An apparatus for controlling virtual application node migration, comprising:
- a memory comprising instructions;
- and
- a processor coupled to the memory and configured to execute the instructions, which causes the processor to be configured to:
- obtain information about a first application running on a first virtual application node when a quantity of resources remaining on second host node is greater than or equal to a preset threshold, wherein the first virtual application node runs on a first host, wherein a second virtual application node runs on the second host, wherein the information includes an application type comprising ordinary, a double-machine or a cluster, wherein the information further includes an identifier of the first application when the first application is a double-machine or cluster application type, and wherein the identifier of the first application includes an application name and a node identifier of the first application;
- determine whether a second application running on the second virtual application node is associated with the first application by:
- determining whether the application name of the first application matches a name of the second application;
- and
- determining whether the node identifier of the first application matches a node identifier of the second application;
- migrate, in response to determining that the name of the second application does not match the application name of the first application and that the node identifier of the second application does not match the node identifier of the first application, the first virtual application node to the second host;
- and
- determine, when the first application is a different type of application than the second application, that identifiers of the first and second applications match each other only when:
- the application name of the first application matches the name of the second application;
- and
- the node identifier of the first application matches the node identifier of the second application.