Virtual machine migration method, device and equipment, readable storage medium and program product

通过获取组播域内目标主机节点的资源信息并生成目标资源记录,自动执行虚拟机迁移,解决了云计算环境下虚拟机迁移方式不灵活的问题,实现了虚拟机的自主动态迁移和资源交互, Improve users' control and flexibility over resources.

CN119088505APending Publication Date: 2024-12-06SHENZHEN POWER SUPPLY BUREAU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411126443.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In the cloud computing environment, virtual machines have pre-allocated resources and users lack flexibility in the migration methods of virtual machines, making it difficult to meet the rapid changes in application and service needs.

Method used

By obtaining resource information of each target host node in the multicast domain, generating target resource records, and automatically performing virtual machine migration based on policy decision results, dynamic resource interaction between host nodes and independent migration of virtual machines are realized.

Benefits of technology

It improves the flexibility of virtual machine migration, realizes automated virtual machine migration, reduces manual intervention, meets users' flexibility and control over resources, and reduces usage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088505A_ABST
    Figure CN119088505A_ABST
Patent Text Reader

Abstract

The invention relates to a virtual machine migration method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the steps that resource information of all target host nodes in a multicast domain is obtained, a target resource record is generated according to the resource information of all the target host nodes, and virtual machines are deployed in the target host nodes; analyzing the target resource record to obtain a strategy decision result; and executing migration of the virtual machine according to a strategy decision result. By adopting the method, the dynamic migration of the virtual machine can be automatically triggered through the interaction of the resource information between the target host nodes, so that the migration flexibility of the virtual machine is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of virtual machine technology, and in particular to a virtual machine migration method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] Cloud computing is an emerging network computing model. It is the result of the natural evolution and integration of a series of distributed computing technologies such as grid, virtualization, service computing, on-demand computing and utility computing. Cloud computing platforms mainly use centralized control to manage multi-virtual machine resources, that is, multiple host nodes are managed by a centralized controller, and the virtual machine monitor of the node is used to manage the virtual machines on it, thereby realizing the centralized management of multiple virtual machines in the cloud computing environment.

[0003] However, in a cloud computing environment, virtual machine resources are generally pre-allocated, and novice users lack experience in choosing the scale of virtual machine instances. The actual needs of intermediate or advanced users also change rapidly with the continuous development of applications and services. They need greater flexibility and more control over the virtualized resources provided by the cloud computing platform.

[0004] Traditional virtualization management methods can only migrate virtual machines through user requests for resources, that is, manual intervention, which results in poor flexibility in the way virtual machines are migrated. Summary of the invention

[0005] Based on this, it is necessary to provide a virtual machine migration method, apparatus, computer device, computer-readable storage medium and computer program product that can improve migration flexibility in response to the above technical problems.

[0006] In a first aspect, the present application provides a virtual machine migration method, the method comprising:

[0007] Acquire resource information of each target host node in the multicast domain, and generate a target resource record according to the resource information of each target host node, wherein the target host node is deployed with a virtual machine;

[0008] Analyze the target resource record to obtain a policy decision result;

[0009] The migration of the virtual machine is performed according to the policy decision result.

[0010] In one embodiment, the multicast domain includes a peer-to-peer network; the obtaining resource information of each target host node in the multicast domain includes:

[0011] Acquire information about resources to be shared, and generate a multicast message based on the information about resources to be shared;

[0012] Sending the multicast message to a host node in the peer-to-peer network;

[0013] Determine a host node that receives the multicast message as a target host node;

[0014] According to each target host node, resource information of each target host node is obtained.

[0015] In one embodiment, the target host node carries a corresponding node identifier; and generating a target resource record according to the resource information of each target host node includes:

[0016] Associating the resource information of each target host node with a node identifier corresponding to the target host node to obtain a first resource record;

[0017] A target resource record is generated based on the first resource record and the second resource record, wherein the second resource record is generated based on resource information of the historical host node and a node identifier corresponding to the historical host node.

[0018] In one embodiment, the first resource record includes each first node identifier and corresponding resource information, and the second resource record includes each second node identifier and corresponding resource information; and generating the target resource record based on the first resource record and the second resource record includes:

[0019] Match each of the first node identifiers with the second node identifier, and if the match fails, add the first node identifier that fails to match the second node identifier and the corresponding resource information to the second resource record to generate a target resource record;

[0020] If the match succeeds, the resource information corresponding to the second node identifier in the second resource record is replaced with the resource information corresponding to the first node identifier that successfully matches the second node identifier, to generate a target resource record;

[0021] Alternatively, each of the second node identifiers within a preset historical time period is matched with the first node identifier. If the match fails, the target host node and corresponding resource information of the second node identifier that fails to match the first node identifier are deleted from the second resource record to generate a target resource record.

[0022] In one embodiment, performing migration of the virtual machine according to the policy decision result includes:

[0023] When the resource information of the target host node where the virtual machine is deployed is less than the resource information threshold, migrating the first created virtual machine in the target host node to the first target node, wherein the first target host node is a host node whose resource information is greater than or equal to the resource information threshold;

[0024] When the load standard deviation of all the target host nodes is greater than the load balancing threshold, the virtual machine with the largest resource usage on the second target host node is migrated to the third target host node, wherein the second target host node is the host node with the highest load in the multicast domain, and the third target host node is the host node with the lowest load in the multicast domain.

[0025] In one embodiment, the method further comprises at least one of the following:

[0026] receiving a first virtual machine operation request, wherein the first virtual machine operation request includes creating a virtual machine; and creating a virtual machine on a target host node that satisfies the resource information if the resource information of the target host node satisfies the first virtual machine operation request;

[0027] A second operation request for a virtual machine is received, and a corresponding operation is performed on a virtual machine of a corresponding target master node according to the second operation request for the virtual machine, wherein the second operation request for the virtual machine includes at least one of deleting the virtual machine and stopping the virtual machine.

[0028] In a second aspect, the present application further provides a virtual machine migration device, the device comprising:

[0029] An acquisition and generation module, used for acquiring resource information of each target host node in the multicast domain, and generating a target resource record according to the resource information of each target host node, wherein the target host node is deployed with a virtual machine;

[0030] An analysis module, used to analyze the target resource record to obtain a policy decision result;

[0031] A migration module is used to execute the migration of the virtual machine according to the policy decision result.

[0032] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0034] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.

[0035] The above-mentioned virtual machine migration method, device, computer equipment, computer-readable storage medium and computer program product first obtain the resource information of each target host node in the multicast domain, and generate a target resource record based on the resource information of each target host node, and the target host node is deployed with a virtual machine; it is capable of monitoring the resource usage of the target host node; secondly, the target resource record is analyzed to obtain a policy decision result; an interaction mechanism between the host nodes is established, and finally the migration of the virtual machine is executed according to the policy decision result, and the dynamic migration of the virtual machine between the host nodes is automatically triggered according to the decision result policy. In addition to manual intervention in virtual machine migration, the dynamic migration of the virtual machine can also be autonomously triggered according to the interaction of resource information between host nodes, thereby improving the flexibility of virtual machine migration. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0037] FIG1 is an application environment diagram of a virtual machine migration method in one embodiment;

[0038] FIG2 is a schematic diagram of a flow chart of a virtual machine migration method in one embodiment;

[0039] FIG3 is a schematic diagram of a process for obtaining resource information of each target host node in one embodiment;

[0040] FIG4 is a schematic diagram of a process of generating a target resource record in another embodiment;

[0041] FIG5 is a schematic diagram of a process for generating a target resource record in another embodiment;

[0042] FIG6 is a schematic diagram of a process of executing migration of a virtual machine according to a policy decision result in one embodiment;

[0043] FIG7 is a schematic diagram of a flow chart of a virtual machine migration method in another embodiment;

[0044] FIG8 is a control system diagram of a virtual machine migration method in one embodiment;

[0045] FIG9 is a structural block diagram of a virtual machine migration device in one embodiment;

[0046] FIG. 10 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0048] The virtual machine migration method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the host node 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 obtains the resource information of each target host node in the multicast domain, and generates a target resource record based on the resource information of each target host node. The target host node is deployed with a virtual machine; the target resource record is analyzed to obtain a policy decision result; and the migration of the virtual machine is performed according to the policy decision result. The host node 102 is composed of multiple physical machines. The server 104 can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server that provides cloud computing services.

[0049] In an exemplary embodiment, as shown in FIG2 , a virtual machine migration method is provided, which is described by taking the method applied to the server in FIG1 as an example, and includes the following steps S202 to S206 . Among them:

[0050] Step S202, obtaining resource information of each target host node in the multicast domain, and generating a target resource record according to the resource information of each target host node, where a virtual machine is deployed.

[0051] Among them, traditional Internet applications are all point-to-point IP (Internet Protocol) transmission (unicast technology), while point-to-multipoint IP transmission (broadcast technology) is limited to applications within the local area network, and multicast technology implements point-to-multipoint IP transmission technology within the wide area network. Each target host node belongs to the same multicast domain.

[0052] The target host node refers to the physical host node. Resource information includes hardware resources, such as central processing unit (CPU) usage, memory usage, storage space, network bandwidth and other resources.

[0053] The target resource record may include node identifiers of several target host nodes and resource information of the target host nodes in the current time period or the historical time period.

[0054] Optionally, the server can periodically collect resource information of each target host node in a group through a local resource collection module, such as CPU usage, memory usage, storage space, network bandwidth and other resources. The collected data may be real-time, or it may be an average or peak value over a period of time. The collected resource information will indeed vary due to different hardware configurations, load conditions and time. And generate a target resource record with the collected resource information of each target host node.

[0055] Step S204: Analyze the target resource record to obtain a policy decision result.

[0056] Optionally, the server can use the policy module in the management control center to analyze and judge the target resource records using pre-specified algorithms and policies, and decide on the policy decision results to be taken. The policy module returns the policy decision results to the management control center. Among them, the policy decision results include load balancing strategy, resource allocation strategy, fault recovery strategy, etc. Dynamically adjusting the distribution of virtual machines according to the load conditions of the nodes to ensure that resources are used evenly is called a load balancing strategy. Allocating resources according to user needs and priorities to ensure that critical tasks have sufficient resource support is called a resource allocation strategy. When a node fails, the above virtual machines are automatically migrated to other healthy nodes to ensure service continuity, which is called a fault recovery strategy.

[0057] Step S206: executing migration of the virtual machine according to the policy decision result.

[0058] Optionally, the virtual machine processing module includes a migration module and a scheduling module. The server first schedules the control program on the physical host through the scheduling module based on the policy decision result, and then realizes the dynamic migration of virtual machines between target host nodes in the multicast domain through the migration module.

[0059] Optionally, in a cloud computing network, the subject of executing the policy is usually the virtual machine processing module of the server or its various submodules (such as scheduling module, migration module, etc.). The management control center will call the corresponding submodule to perform specific operations according to the policy decision results. For example, according to the load balancing policy, when the virtual machine needs to be migrated, the management control center will call the migration module to perform the migration operation of the virtual machine.

[0060] In the above-mentioned virtual machine migration method, resource information of each target host node in the multicast domain is first obtained, and a target resource record is generated according to the resource information of each target host node, and the target host node is deployed with a virtual machine; the resource usage of the target host node can be monitored; secondly, the target resource record is analyzed to obtain a policy decision result; an interaction mechanism between the host nodes is established, and finally the migration of the virtual machine is executed according to the policy decision result, and the dynamic migration of the virtual machine between the host nodes is automatically triggered according to the decision result policy. In addition to manual intervention in virtual machine migration, the dynamic migration of the virtual machine can also be triggered autonomously according to the interaction of resource information between host nodes, thereby improving the flexibility of virtual machine migration.

[0061] In an exemplary embodiment, as shown in FIG3 , the multicast domain includes a peer-to-peer network; obtaining resource information of each target host node in the multicast domain includes steps S302 to S308. In which:

[0062] Step S302: Acquire information about resources to be shared, and generate a multicast message based on the information about resources to be shared.

[0063] Optionally, the server obtains the resource information to be shared, wherein the shared resource information may be resource information of any host node in the multicast domain pre-collected by the server, such as network bandwidth resources. The server transmits the resource information to be shared to the multicast sending submodule, and the multicast sending submodule generates a multicast message according to the meta information, location information or other information that can help the node find the resource in the resource information to be shared.

[0064] Step S304: Send a multicast message to the host node in the peer-to-peer network.

[0065] The multicast domain includes a peer-to-peer network, where each host node (participant) shares a portion of its hardware resources (processing power, storage capacity, network connection capacity, etc.). These shared resources provide services and content through the network and can be directly accessed by other peer nodes without going through an intermediate entity. The host node (participant) in this peer-to-peer network is both a provider of resources, services, and content, and a recipient of resources, services, and content.

[0066] Optionally, the server sends a multicast message to each host node in the peer-to-peer network through a multicast sending submodule.

[0067] Step S306: determine the host node that receives the multicast message as the target host node.

[0068] Optionally, the server determines the host node receiving the multicast message as the target host node through the multicast receiving submodule, that is, discovers whether other peer nodes have available physical hardware resources, that is, the target host node, through IP multicast, so as to subsequently create a virtual machine thereon or migrate the virtual machine to the node.

[0069] Step S308: acquiring resource information of each target host node according to each target host node.

[0070] Optionally, the server obtains resource information of each target host node according to each target host node. In order to distinguish the resource information, a unique identifier (such as a node ID) is usually generated for each target host node, and the collected resource information is associated with the identifier.

[0071] In this embodiment, in a peer-to-peer network, resource discovery is performed through multicast, and the resource usage of each target host node can be continuously monitored, so that target resource records can be subsequently generated based on the resource information of each target host node, and dynamic migration of virtual machines between nodes can be automatically triggered based on the analysis of the resource records.

[0072] In an exemplary embodiment, as shown in FIG4 , the target host node carries a corresponding node identifier; generating a target resource record according to the resource information of each target host node includes steps S402 to S404. Among them:

[0073] Step S402: Associating the resource information of each target host node with the node identifier corresponding to the target host node to obtain a first resource record.

[0074] The first resource record is the resource information of the target host node and the corresponding node identifier collected in the current time period. The current time period can be a real-time time point, such as 12:00:00-12:00:00, that is, 12:00:00. It can also be a time period with a fixed interval, such as 8:00:00-12:00:00.

[0075] Optionally, each target host node corresponds to a unique node identifier, such as a node ID. The server associates the resource information of each target host node collected in the current time period with the corresponding node identifier to obtain a first resource record.

[0076] Step S404: Generate a target resource record based on the first resource record and the second resource record, wherein the second resource record is generated based on the resource information of the historical host node and the node identifier corresponding to the historical host node.

[0077] The second resource record is generated based on the resource information of the historical host node and the node identifier corresponding to the historical host node. If the current time period can be a real-time time point, then the host node before the current real-time time point is called the historical host node. If the current time period can be a time period of fixed interval length, such as 8:00:00-12:00:00, the host nodes in each time period before 8:00:00 are all historical host nodes, such as the host nodes running from 4:00:00 to 8:00:00 and 0:00:00 to 4:00:00.

[0078] Optionally, the server compares the first resource record collected in the current time period with the second resource record collected in the historical time period, and generates the target resource record according to the comparison result.

[0079] In this embodiment, by generating a target resource record based on the first resource record and the second resource record, resource information of all target host nodes in the multicast domain or the peer-to-peer network can be collected, and interaction of resource information between each target host node is established to improve the service quality during virtual machine migration.

[0080] A target resource record is generated based on the first resource record and the second resource record, wherein the second resource record is generated based on resource information of the historical host node and a node identifier corresponding to the historical host node.

[0081] In an exemplary embodiment, as shown in FIG5 , the first resource record includes each first node identifier and corresponding resource information, and the second resource record includes each second node identifier and corresponding resource information; based on the first resource record and the second resource record, generating a target resource record includes steps S502 to S506. Wherein:

[0082] Step S502, each first node identifier is matched with the second node identifier. If the match fails, the first node identifier that fails to match the second node identifier and the corresponding resource information are added to the second resource record to generate a target resource record.

[0083] The first resource record includes resource information of the target host node collected in the current time period and the corresponding node identifier. The node identifier of the target host node is used as the first node identifier. The second resource record includes resource information of the historical host node collected in the historical time period and the node identifier corresponding to the historical host node. The node identifier corresponding to the historical host node is used as the second node identifier.

[0084] Optionally, the server sequentially traverses the second node identifier for each first node identifier in order. If the first node identifier is not found in the second node identifier, that is, the first node identifier collected in the current time period is a newly added node identifier that has not appeared in the historical time period, it indicates that the first node identifier fails to match the second node identifier. The server then adds the first node identifier that fails to match the second node identifier and the corresponding resource information to the second resource record to generate a target resource record.

[0085] Step S504: If the match succeeds, the resource information corresponding to the first node identifier that successfully matches the second node identifier replaces the resource information corresponding to the second node identifier in the second resource record, and a target resource record is generated.

[0086] As an embodiment of step S502, if the first node identifier hits any second node identifier, that is, the first node identifier collected in the current time period has also appeared in the historical time period. It indicates that the first node identifier successfully matches the second node identifier, and the server replaces the resource information corresponding to the second node identifier in the second resource record (historical time period) with the resource information corresponding to the first node identifier that successfully matches the second node identifier (current time period), and generates a target resource record. That is, the resource information corresponding to the latest node identifier replaces the resource information corresponding to the old node identifier.

[0087] Step S506, match each second node identifier within a preset historical time period with the first node identifier. If the match fails, delete the target host node and corresponding resource information of the second node identifier that fails to match the first node identifier from the second resource record to generate a target resource record.

[0088] The preset historical time period may be a few hours, a few days, or a few months.

[0089] Optionally, the server obtains a second node identifier within a preset historical time period, and then traverses the first node identifier in sequence for each second node identifier obtained. If the second node identifier cannot be queried in the first node identifier, that is, the resource information corresponding to the second node identifier has not been updated within the preset historical time period, indicating that the second node identifier fails to match the first node identifier, the server deletes the target host node and corresponding resource information of the second node identifier that fails to match the first node identifier from the second resource record, and generates a target resource record.

[0090] In actual applications, in order to maintain the consistency and accuracy of target resource records, the system needs to regularly clean up records that have not been updated for a long time. If a node identification record has not been updated for a fixed period of time, the system will assume that the host node may have failed or left the network, so the record is considered a timeout record and deleted, which means that the host node cannot be used as a node for virtual machine migration.

[0091] In this embodiment, the first node identifier is compared with the second node identifier to determine whether the node is in the newly added, updated or timed-out state, and operations are performed according to the node state, thereby ensuring the accuracy and consistency of the target resource record.

[0092] In an exemplary embodiment, as shown in FIG6 , performing migration of a virtual machine according to a policy decision result includes steps S602 to S604 . Among them:

[0093] Step S602: When the resource information of the target host node where the virtual machine is deployed is less than the resource information threshold, the first virtual machine created in the target host node is migrated to the first target node, where the first target host node is a host node with a resource information greater than or equal to the resource information threshold.

[0094] Optionally, when the resource information of the target host node where the virtual machine is deployed is less than the resource information threshold, the dynamic migration of the virtual machine can be triggered, and the first virtual machine created in the target node less than the resource information threshold is used as the object to be migrated, wherein the virtual machine numbers can be assigned according to the order in which the virtual machines are created, and the virtual machines created earlier are assigned smaller numbers, so the server can use the virtual machine with the smallest number in the target node less than the resource information threshold as the object to be migrated. The object to be migrated is migrated to the first target node, that is, the node that meets the resource information threshold.

[0095] The server will query a database (or resource directory, resource registration center, etc.) that stores resource status information of each node in the network, so as to find a host node that can receive and run the virtual machine well as the first target node.

[0096] Optionally, when the resource information of the target host node where the virtual machine is deployed is greater than or equal to the resource information threshold, the load data of the target host node that is greater than or equal to the resource information threshold is obtained, and it is determined whether it is necessary to initiate the migration of the virtual machine based on the load data. If it is necessary to initiate, the virtual machine is migrated to the first target node.

[0097] Step S604, when the load standard deviation of all target host nodes is greater than the load balancing threshold, the virtual machine with the largest resource occupancy on the second target host node is migrated to the third target host node, wherein the second target host node is the host node with the highest load in the multicast domain, and the third target host node is the host node with the lowest load in the multicast domain.

[0098] Optionally, the server also learns about the load conditions of all target host nodes within the cloud platform through the monitoring module of the virtual machine processing module, and calculates the standard deviation based on the load. If the standard deviation exceeds the specified load balancing threshold, it is a load imbalance. The virtual machine with the largest resource usage on the host node with the highest load in the multicast domain is selected as the object to be migrated, and the object to be migrated is migrated to the host node with the lowest load in the multicast domain.

[0099] In actual applications, this method can better reflect the operating status of each physical host (target host node). When the virtual machine migration is triggered, the corresponding load value of the physical host with the largest load will drop significantly, thereby reducing the deviation value. The load of the physical host with the lowest load will increase rapidly due to the acceptance of the migrated virtual machines. In this process, the host with the second highest load in the cluster will gradually be selected as the object to accept the virtual machine migration, and the corresponding resource utilization rate will also increase. On the whole, the load of the cluster can be balanced in the shortest time.

[0100] The main resource cost of virtual machine migration is network bandwidth, and the main factor occupying the migration bandwidth is the memory usage of the virtual machine. Because the amount of CPU status information is small during virtual machine migration, it can be transferred in a short time. The storage of virtual machines is shared and does not need to occupy the migration bandwidth. Therefore, two physical hosts with relatively less busy networks can be selected for migration. If the virtual machine must be migrated on a physical host with a heavy network load, virtual machines with small memory usage and high CPU usage should be selected for migration.

[0101] In this embodiment, the policy decision result is generated through the resource occupancy and load of the target host node, and the migration of the virtual machine is executed according to the policy decision result, which automatically triggers the dynamic migration of the virtual machine between the target host nodes. It can realize flexible virtual machine scheduling and migration according to the resource occupancy of applications and services, and can migrate the virtual machine from a host node to another host node in real time and run it. During this process, the virtual machine itself does not need to be shut down, and the services running in it are not disturbed, and the user will not feel the switching of the physical node, so that the dynamic allocation of resources in the host node environment is realized, which can provide users with a more flexible management method and effectively reduce the cost of use.

[0102] In an exemplary embodiment, as shown in FIG7 , the virtual machine migration method further includes steps S702 to S704. In which:

[0103] Step S702, receiving a first virtual machine operation request, the first virtual machine operation request including creating a virtual machine; when the resource information of the target host node meets the first virtual machine operation request, creating a virtual machine on the target host node that meets the resource information.

[0104] The first virtual machine operation request may be issued by a root node in a peer-to-peer network, and the root node is responsible for monitoring the resource status of the entire peer-to-peer network. The root node is a host node specified in the target host node. When the server receives the root node virtual machine creation operation request, the server decides whether to create a virtual machine based on the resource information of the target host node. If it meets the requirements of the root node virtual machine creation operation request, the virtual machine is created on the target host node; if it does not meet the requirements of the root node virtual machine creation operation request, the root node's request is rejected.

[0105] Step S704, receiving a second operation request of the virtual machine, and performing a corresponding operation on the virtual machine of the corresponding target master node according to the second operation request of the virtual machine, wherein the second operation request of the virtual machine includes at least one of deleting the virtual machine and stopping the virtual machine.

[0106] The second operation request of the virtual machine may be issued by a root node in the peer-to-peer network. The server receives at least one of deleting the virtual machine and stopping the virtual machine from the root node.

[0107] Optionally, the server may simultaneously receive a virtual machine deletion request and a virtual machine stop request sent by the root node, and the server executes the virtual machine deletion request and the virtual machine stop request correspondingly according to the requests.

[0108] In this embodiment, the management of the virtual machine can be achieved by creating, deleting or stopping the virtual machine.

[0109] In an exemplary embodiment, as shown in Fig. 8, a control system diagram of a virtual machine migration method includes a user module 100, a management control center 200, a virtual machine processing module 300, a local resource collection module 400, a resource record processing module 500, a multicast module 600, and a multicast domain 700. The management control center 200 includes a policy module 201; the virtual machine processing module 300 includes a monitoring module 301, a migration module 302, and a scheduling module 303; the resource record processing module 500 includes a resource record database 501; the multicast module 600 includes a multicast sending submodule 601 and a multicast receiving submodule 602; and the multicast domain 700 includes a number of host nodes.

[0110] The user terminal sends operation commands including creating, starting, stopping, pausing, saving and restoring virtual machines to the management control center 200 in the cloud platform through the user module 100. At the same time, it subscribes to the threshold and policy of virtual machine scheduling, and inquires about the operating status and real-time cost of the rented virtual machines.

[0111] The multicast domain includes a peer-to-peer network; the server obtains the resource information to be shared, wherein the shared resource information can be the resource information of any target host node in the multicast domain collected in advance by the server, such as network bandwidth resources. The server passes the resource information to be shared to the multicast sending submodule 601, and the multicast sending submodule 601 generates a multicast message based on the meta-information, location information or other information that can help the node find resources in the resource information to be shared. The server sends a multicast message to each host node in the peer-to-peer network 700 through the multicast sending submodule 602. The server determines the host node receiving the multicast message as the target host node through the multicast receiving submodule 602. That is, it is discovered through IP multicast whether other peer nodes have available hardware resources, that is, the target host node, so as to subsequently create a virtual machine on it or migrate the virtual machine to the node. The server discovers the resource information of each target host node through multicast according to each target host node.

[0112] The target host node carries a corresponding node identifier; the server associates the resource information of each target host node with the node identifier corresponding to the target host node through the resource record processing module 500 to obtain a first resource record; the first resource record includes each first node identifier and the corresponding resource information, and the second resource record includes each second node identifier and the corresponding resource information; wherein the second resource record is stored in the resource record database 501, and the server traverses each first node identifier through the resource record processing module 500 to the second node identifier. If the match fails, the server adds the first node identifier that fails to match the second node identifier and the corresponding resource information to the second resource record through the resource record processing module 500 to generate a target host node. The target resource record is generated by the server; if the match is successful, the server replaces the resource information corresponding to the second node identifier in the second resource record with the resource information corresponding to the first node identifier that successfully matches the second node identifier through the resource record processing module 500, and generates a target resource record; within a preset historical time period, the server traverses each second node identifier through the resource record processing module 500 for the first node identifier. If the match fails, the server deletes the target host node and the corresponding resource information of the second node identifier that fails to match the first node identifier from the second resource record through the resource record processing module 500, and generates a target resource record, wherein the second resource record is generated based on the resource information of the historical host node and the node identifier corresponding to the historical host node. The target resource record is also saved in the resource record database 501.

[0113] The server can analyze and judge the target resource record by using the pre-specified algorithm and policy through the policy module 201 in the management control center 200, and determine the policy decision result to be adopted. The policy module 201 returns the policy decision result to the management control center 200. Among them, the policy decision result includes load balancing policy, resource allocation policy, fault recovery policy, etc. The server calls the migration module 302 to perform the migration of the virtual machine according to the policy decision result.

[0114] When the resource information of the target host node where the virtual machine is deployed is less than the resource information threshold, the server calls the migration module 302 to migrate the first virtual machine created in the target host node to the first target node, wherein the first target host node is a host node greater than or equal to the resource information threshold; when the load standard deviation of all the target host nodes is greater than the load balancing threshold, the server calls the migration module 302 to migrate the virtual machine with the largest resource occupancy on the second target host node to the third target host node, wherein the second target host node is the host node with the highest load in the multicast domain, and the third target host node is the host node with the lowest load in the multicast domain.

[0115] The server receives a first virtual machine operation request sent by the root node through the virtual machine processing module 300, and the first virtual machine operation request includes creating a virtual machine; when the resource information of the target host node meets the first virtual machine operation request, the server creates a virtual machine on the target master node that meets the resource information through the virtual machine processing module 300; the server receives a second virtual machine operation request sent by the root node through the virtual machine processing module 300, and the server performs a corresponding operation on the virtual machine of the corresponding target master node according to the second virtual machine operation request through the virtual machine processing module 300, and the second virtual machine operation request includes at least one of deleting the virtual machine and stopping the virtual machine.

[0116] By setting up the management control center 200, virtual machine processing module 300 and multicast module 600, in the peer-to-peer network structure, it is possible to continuously monitor the usage of host node resources, perform resource discovery through multicast, and automatically trigger dynamic migration of virtual machines between nodes. It is possible to achieve flexible virtual machine scheduling and migration based on the resource occupancy of applications and services, and to migrate the virtual machine from the host node to another node in real time and run it. During this process, the virtual machine itself does not need to be shut down, and the services running in it are not disturbed, and the user will not perceive the switching of physical nodes, thereby achieving dynamic allocation of resources in a multi-host node environment, providing users with a more flexible management method, and effectively reducing the cost of use.

[0117] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0118] Based on the same inventive concept, the embodiment of the present application also provides a virtual machine migration device for implementing the virtual machine migration method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more virtual machine migration device embodiments provided below can refer to the limitations of the virtual machine migration method above, and will not be repeated here.

[0119] In an exemplary embodiment, as shown in FIG. 9 , a virtual machine migration device is provided, including: an acquisition generation module 901, an analysis module 902 and a migration module 903, wherein:

[0120] The acquisition and generation module 901 is used to acquire resource information of each target host node in the multicast domain, and generate a target resource record according to the resource information of each target host node, and the target host node is deployed with a virtual machine.

[0121] The analysis module 902 is used to analyze the target resource record to obtain a policy decision result.

[0122] The migration module 903 is used to execute the migration of the virtual machine according to the policy decision result.

[0123] In an exemplary embodiment, the multicast domain includes a peer-to-peer network; the acquisition generation module 901 includes:

[0124] The message generating unit is used to obtain the information of resources to be shared and generate a multicast message based on the information of resources to be shared.

[0125] The message sending unit is used to send multicast messages to host nodes in the peer-to-peer network.

[0126] The node determination unit is used to determine the host node receiving the multicast message as the target host node.

[0127] The node resource acquisition unit is used to acquire resource information of each target host node according to each target host node.

[0128] In an exemplary embodiment, the target host node carries a corresponding node identifier; the acquisition generation module 901 includes:

[0129] The first resource record generating unit is used to associate the resource information of each target host node with the node identifier corresponding to the target host node to obtain a first resource record.

[0130] The target resource record generating unit is used to generate a target resource record based on the first resource record and the second resource record, wherein the second resource record is generated based on the resource information of the historical host node and the node identifier corresponding to the historical host node.

[0131] In an exemplary embodiment, the first resource record includes each first node identifier and corresponding resource information, and the second resource record includes each second node identifier and corresponding resource information; the target resource record generation unit includes:

[0132] A new subunit is added to match each of the first node identifiers with the second node identifiers. If the match fails, the first node identifier that fails to match the second node identifier and the corresponding resource information are added to the second resource record to generate a target resource record.

[0133] The updating subunit is used to replace the resource information corresponding to the second node identifier in the second resource record with the resource information corresponding to the first node identifier that successfully matches the second node identifier if the match is successful, so as to generate a target resource record.

[0134] Alternatively, a timeout deletion sub-unit is used to match each of the second node identifiers with the first node identifier within a preset historical time period. If the match fails, the target host node and corresponding resource information of the second node identifier that fails to match the first node identifier are deleted from the second resource record to generate a target resource record.

[0135] In an exemplary embodiment, the migration module 903 includes:

[0136] The first migration unit is used to migrate the first created virtual machine in the target host node to the first target node when the resource information of the target host node where the virtual machine is deployed is less than the resource information threshold, wherein the first target host node is a host node whose resource information is greater than or equal to the resource information threshold.

[0137] The second migration unit is used to migrate the virtual machine with the largest resource occupancy on the second target host node to the third target host node when the load standard deviation of all target host nodes is greater than the load balancing threshold, wherein the second target host node is the host node with the highest load in the multicast domain, and the third target host node is the host node with the lowest load in the multicast domain.

[0138] In an exemplary embodiment, a virtual machine migration device is provided, further comprising at least one of the following:

[0139] The first operation module is used to receive a first operation request for a virtual machine, the first operation request for the virtual machine includes creating a virtual machine; if the resource information of the target host node meets the first operation request for the virtual machine, the virtual machine is created on the target host node that meets the resource information.

[0140] The second operation module is used to receive a second operation request of the virtual machine, and perform a corresponding operation on the virtual machine of the corresponding target master node according to the second operation request of the virtual machine. The second operation request of the virtual machine includes at least one of deleting the virtual machine and stopping the virtual machine.

[0141] Each module in the above-mentioned virtual machine migration device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0142] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG10. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store virtual machine migration data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a virtual machine migration method is implemented.

[0143] Those skilled in the art will understand that the structure shown in FIG. 10 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0144] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0145] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0146] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0147] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0148] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0149] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A virtual machine migration method, characterized in that: The method comprises: Acquire resource information of each target host node in the multicast domain, and generate a target resource record according to the resource information of each target host node, wherein the target host node is deployed with a virtual machine; Analyze the target resource record to obtain a policy decision result; The migration of the virtual machine is performed according to the policy decision result.

2. The method according to claim 1, characterized in that The multicast domain includes a peer-to-peer network; The step of obtaining resource information of each target host node in the multicast domain includes: Acquire information about resources to be shared, and generate a multicast message based on the information about resources to be shared; Sending the multicast message to a host node in the peer-to-peer network; Determine a host node that receives the multicast message as a target host node; According to each target host node, resource information of each target host node is obtained.

3. The method according to claim 1, characterized in that The target host node carries a corresponding node identifier; The generating of the target resource record according to the resource information of each target host node includes: Associating the resource information of each target host node with a node identifier corresponding to the target host node to obtain a first resource record; A target resource record is generated based on the first resource record and the second resource record, wherein the second resource record is generated based on resource information of a historical host node and a node identifier corresponding to the historical host node.

4. The method according to claim 3, characterized in that The first resource record includes each first node identifier and corresponding resource information, and the second resource record includes each second node identifier and corresponding resource information; and generating the target resource record based on the first resource record and the second resource record includes: Match each of the first node identifiers with the second node identifier, and if the match fails, add the first node identifier that fails to match the second node identifier and the corresponding resource information to the second resource record to generate a target resource record; If the match succeeds, the resource information corresponding to the second node identifier in the second resource record is replaced with the resource information corresponding to the first node identifier that successfully matches the second node identifier, to generate a target resource record; Alternatively, each of the second node identifiers within a preset historical time period is matched with the first node identifier. If the match fails, the target host node and corresponding resource information of the second node identifier that fails to match the first node identifier are deleted from the second resource record to generate a target resource record.

5. The method according to claim 3, characterized in that: The performing migration of the virtual machine according to the policy decision result includes: When the resource information of the target host node where the virtual machine is deployed is less than the resource information threshold, migrating the first created virtual machine in the target host node to the first target node, wherein the first target host node is a host node whose resource information is greater than or equal to the resource information threshold; When the load standard deviation of all the target host nodes is greater than the load balancing threshold, the virtual machine with the largest resource usage on the second target host node is migrated to the third target host node, wherein the second target host node is the host node with the highest load in the multicast domain, and the third target host node is the host node with the lowest load in the multicast domain.

6. The method according to claim 1, characterized in that The method further comprises at least one of the following: receiving a first virtual machine operation request, wherein the first virtual machine operation request includes creating a virtual machine; and creating a virtual machine on a target host node that satisfies the resource information if the resource information of the target host node satisfies the first virtual machine operation request; A second operation request for a virtual machine is received, and a corresponding operation is performed on a virtual machine of a corresponding target master node according to the second operation request for the virtual machine, wherein the second operation request for the virtual machine includes at least one of deleting the virtual machine and stopping the virtual machine.

7. A virtual machine migration device, characterized in that: The device comprises: An acquisition and generation module, used for acquiring resource information of each target host node in the multicast domain, and generating a target resource record according to the resource information of each target host node, wherein the target host node is deployed with a virtual machine; An analysis module, used to analyze the target resource record to obtain a policy decision result; A migration module is used to execute the migration of the virtual machine according to the policy decision result.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.