Virtual machine migration method and device

By setting up a backup virtual machine in a virtualized environment and monitoring it, and obtaining backup information from the data sharing center for migration after a failure is detected, the reliability and stability of virtual machine services in the event of failure is solved, and rapid migration and high availability are achieved.

CN119536911APending Publication Date: 2025-02-28AISINO CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411676650.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In a virtualized environment, the reliability and stability of virtual machine services still need to be improved, especially when failures or network problems occur, virtual machines need to be detected and migrated quickly to ensure business continuity.

Method used

By running the standby virtual machine on the first host and running the virtual machine that needs to be monitored on the second host, the first host monitors the virtual machine on the second host. If a failure is detected, the backup information of the virtual machine is obtained from the data sharing center and migrates the failed virtual machine to the standby virtual machine.

Benefits of technology

It realizes rapid detection and migration when a virtual machine fails, avoids data loss and service interruption caused by host failure and virtual machine failure, and improves the reliability and stability of virtual machine services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536911A_ABST
    Figure CN119536911A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a virtual machine migration method and device which are applied to a system supporting a virtualization technology, the system comprises a first host machine and a second host machine, a second virtual machine runs on the second host machine, and a standby first virtual machine runs on the first host machine. The virtual machine migration method comprises the steps that a first host machine carries out operation monitoring on a second virtual machine operated on a second host machine so as to obtain operation state information of the second virtual machine; if the first host machine determines that the second virtual machine breaks down according to the running state information, second backup information of the second virtual machine which breaks down is obtained from the data sharing center, and the second virtual machine which breaks down is migrated to a standby first virtual machine in the first host machine according to the second backup information. Through the embodiment of the invention, the reliability of the virtual machine service is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of information technology, and in particular to a virtual machine migration method and device. Background Art

[0002] With the rapid development of information technology, virtualization technology has become the core of the infrastructure of data centers and cloud computing. Through virtualization, the resources of physical servers can be more efficiently allocated to different applications, and load balancing and business continuity can be achieved through dynamic migration of virtual machines. As the core component of virtualization technology, automatic detection and migration of virtual machines when failures or network problems occur is of great significance to ensuring business continuity and improving system stability.

[0003] Currently, in a virtualized environment, the reliability and stability of virtual machine services need to be improved. Summary of the invention

[0004] In view of this, an embodiment of the present application provides a virtual machine migration method and device to at least partially solve the above-mentioned problem.

[0005] According to a first aspect of an embodiment of the present application, a virtual machine migration method is provided, which is applied to a system supporting virtualization technology, wherein the system includes a first host machine and a second host machine, a second virtual machine is running on the second host machine, and a standby first virtual machine is running on the first host machine;

[0006] The method comprises:

[0007] The first host machine monitors the operation of the second virtual machine running on the second host machine to obtain the operation status information of the second virtual machine;

[0008] If the first host machine determines that the second virtual machine has failed based on the operating status information, the second backup information of the failed second virtual machine is obtained from the data sharing center, and the failed second virtual machine is migrated to the backup first virtual machine in the first host machine based on the second backup information.

[0009] In an optional embodiment, migrating the failed second virtual machine to the standby first virtual machine in the first host machine according to the second backup information specifically includes:

[0010] The first host machine locks the second virtual machine information of the second virtual machine that fails in the data sharing center;

[0011] The first host machine obtains the second backup information from the data sharing center, and migrates the failed second virtual machine to the standby first virtual machine according to the second backup information;

[0012] A function check is performed on the standby first virtual machine. If a function check result of the standby first virtual machine passes, the first host machine updates the migration information of the second virtual machine to migrated, and unlocks the second virtual machine information.

[0013] In an optional embodiment, it also includes:

[0014] The second virtual machine periodically checks its own migration information, and if the migration information of the second virtual machine indicates that the second virtual machine has been migrated,

[0015] [HZTC-HXJMJJ241013][HS2411178CCN]The second host machine clears the second virtual machine.

[0016] In an optional embodiment, the step of the first host machine monitoring the operation of the second virtual machine running on the second host machine to obtain the operation status information of the second virtual machine specifically includes:

[0017] The first host machine obtains the operating status of the second host machine from the data sharing center;

[0018] If the running status of the second host machine is running, continue to obtain the running status information of the second virtual machine.

[0019] In an optional embodiment, before obtaining the running status information of the second virtual machine, the method further includes:

[0020] The first host machine sends a heartbeat request to the second host machine, and if the second host machine responds within a timeout period, continues to obtain the running status information of the second virtual machine;

[0021] If the number of response timeouts of the second host machine exceeds a preset value, the second host machine fails, and all of the second virtual machines in the second host machine are migrated to the standby first virtual machines in the first host machine.

[0022] In an optional embodiment, obtaining the running status information of the second virtual machine specifically includes:

[0023] Obtaining the running status of the second virtual machine, and if the running status of the second virtual machine is running, continuing to perform a function check on the second virtual machine;

[0024] If the function check result of the second virtual machine fails, the operation status information of the second virtual machine is abnormal operation, and the second virtual machine fails.

[0025] In an optional embodiment, a first virtual machine is also running on the first host machine, and at least one standby second virtual machine is also running on the second host machine, and the method further includes:

[0026] The second host machine monitors the operation of the first virtual machine running on the first host machine;

[0027] If the first virtual machine fails, the failed first virtual machine is migrated to the standby second virtual machine in the second host machine according to the first backup information of the first virtual machine in the data sharing center.

[0028] In an optional embodiment, the second host machine periodically updates the second backup information of the second virtual machine to the data sharing center;

[0029] The first host machine periodically updates the first backup information of the first virtual machine to the data sharing center.

[0030] In an optional embodiment, it also includes:

[0031] When the first host machine creates the standby first virtual machine according to the preset minimum number of standby first virtual machines, if the available resources of the first host machine are less than the resources required to create the standby first virtual machine, the first host machine issues an alarm.

[0032] According to a second aspect of the present application, a virtual machine migration device is provided, which is applied to a system supporting virtualization technology, the system comprising a first host machine and a second host machine, a second virtual machine running on the second host machine, and a standby first virtual machine running on the first host machine;

[0033] The device comprises:

[0034] A monitoring module, used to monitor the operation of the second virtual machine running on the second host machine to obtain the operation status information of the second virtual machine;

[0035] A migration module is used to obtain the second backup information of the second virtual machine from the data sharing center when the first host machine determines that the second virtual machine has failed based on the running status information, and migrate the failed second virtual machine to the backup first virtual machine in the first host machine based on the second backup information.

[0036] According to the solution provided in the embodiment of the present application, a second virtual machine is running on the second host machine, and a backup first virtual machine is running on the first host machine. The first host machine monitors the operation of the second virtual machine running on the second host machine to obtain the operation status information of the second virtual machine, and can quickly detect the failure when the second virtual machine fails or the second host machine fails; after determining that the second virtual machine fails, the second backup information of the failed second virtual machine is obtained from the data sharing center, and the failed second virtual machine is migrated to the backup first virtual machine in the first host machine according to the second backup information. Therefore, in the local area network built with the help of the data sharing center, the failed virtual machine can be quickly migrated when the virtual machine fails, avoiding data loss, service interruption and other problems caused by host machine failure and virtual machine failure, thereby improving the reliability of the virtual machine service in the second host machine. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0038] Figure 1 A flowchart of a virtual machine migration method according to an embodiment of the present application;

[0039] Figure 2 A system architecture diagram of a system supporting virtualization technology according to an embodiment of the present application;

[0040] Figure 3 is a flow chart of the steps of initializing the first host according to an embodiment of the present application;

[0041] Figure 4 A flowchart of configuration steps of a first host machine and a second host machine according to an embodiment of the present application;

[0042] Figure 5 A heartbeat task flow chart according to an embodiment of the present application;

[0043] Figure 6 is a flowchart of the second virtual machine migration steps according to an embodiment of the present application;

[0044] Figure 7 This is a structural diagram of a virtual machine migration device according to an embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.

[0046] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.

[0047] Hardware servers are physical devices that carry computing resources, storage resources, and network resources. Virtualization technology refers to the use of software to simulate hardware functions, thereby running multiple independent virtual machines on a single physical server. When running multiple independent virtual machines in a physical server that supports virtualization technology, each virtual machine can run its own operating system and application, share hardware resources, improve resource utilization, and reduce resource waste. High Availability (HA): Aims to ensure that the system can quickly recover and continue to provide services in the event of a failure, minimizing downtime. For an enterprise's critical business systems, high availability is an important guarantee for their stable operation.

[0048] [HZTC-HXJMJJ241013][HS2411178CCN]

[0049] However, due to unforeseen factors such as hardware failure, network interruption and resource contention, virtual machines may experience downtime or performance degradation, etc. Currently, automatic detection and migration of virtual machines in the event of failure to achieve high availability of virtual machines generally relies on cluster systems or cloud computing.

[0050] To address this, an embodiment of the present application provides a virtual machine migration method, which is applied to a system supporting virtualization technology. Figure 1 A flowchart of a virtual machine migration method according to an embodiment of the present application is shown. Figure 1 The virtual machine migration method of the present application includes the following steps:

[0051] S102. The first host machine monitors the operation of the second virtual machine running on the second host machine to obtain operation status information of the second virtual machine.

[0052] Figure 2 This is a system architecture diagram of a system supporting virtualization technology in an embodiment of the present application, see Figure 2As shown, the first host machine and the second host machine are in the same local area network and can communicate with each other. The first host machine and the second host machine are any hardware servers supporting virtualization technology or virtual machines.

[0053] In a feasible manner, the topological types of monitoring relationships include single point, one-to-one, many-to-one, belt, ring, and multi-form combination; for example, the first host monitors the virtual machine running on itself; or, the first host monitors the virtual machine running on the second host; or, the system includes the first host, the second host, and the third host, and the first host and the third host jointly monitor the virtual machine running on the second host; or, the first host monitors the virtual machine running on the second host, and the second host monitors the virtual machine running on the third host; or, the first host monitors the virtual machine running on the second host, the second host monitors the virtual machine running on the third host, and the third host monitors the virtual machine running on the first host; or, the first host monitors the virtual machine running on the second host, and the second host monitors the virtual machine running on the third host, and the third host monitors the virtual machine running on the first host; or, the first host monitors the virtual machine running on the second host, and the second host and the third host jointly monitor the virtual machine running on the first host. By flexibly setting multiple types of monitoring relationships, it is possible to adapt to more complex business scenarios, improve resource utilization, and improve the reliability of virtual machine services.

[0054] S104. If the first host machine determines that the second virtual machine fails based on the running status information, it obtains second backup information of the second virtual machine from the data sharing center, and migrates the failed second virtual machine to the standby first virtual machine in the first host machine based on the second backup information.

[0055] See also Figure 2 As shown, the data sharing center and the first host machine and the second host machine are in the same local area network and can communicate with each other. The data sharing center is used to implement data storage, so that the first host machine and the second host machine in the same local area network can share and exchange data. In a feasible manner, the data sharing center can be implemented as a data storage method of a database, a distributed file system or a data warehouse.

[0056] In one feasible manner, before step S102, a virtual machine migration method of an embodiment of the present application further includes: initializing the first host machine and the second host machine. Figure 3 As shown:

[0057] S302. For the started first host machine, upload the first operation information of the first host machine to the data sharing center.

[0058] In one feasible manner, the first operation information includes the first host machine unique identifier, and the first host machine operation status and other information. The first host machine unique identifier is used to uniquely identify the first host machine to ensure that the first host machine can be accurately distinguished from other host machines. In one feasible manner, the first host machine unique identifier can be implemented as a universal unique identification code or a serial number. For the first host machine after startup, the operation status of the first host machine is running. When the first host machine is shut down normally, the operation status of the first host machine in the data sharing center is updated to shutdown.

[0059] [HZTC-HXJMJJ241013][HS2411178CCN] machine.

[0060] S304. The first host machine creates a basic virtual machine and sets up an environment for the basic virtual machine.

[0061] The first host machine builds an environment for the basic virtual machine according to actual business needs to form a basic virtual machine that can complete various functions. In a feasible manner, building an environment for the basic virtual machine includes but is not limited to building a database service, a cache service, a software service, and the like.

[0062] S306. The first host packaged the basic virtual machine that completed the environment construction into an image, obtained the first virtual machine template and uploaded it to the data sharing center.

[0063] The first host machine can generate first virtual machine templates of different functional types according to actual business needs and upload them to the data sharing center.

[0064] S308. The first host machine creates a first virtual machine according to the first virtual machine template.

[0065] The first host creates a first virtual machine as an example of a virtual machine used in the business according to the first virtual machine template. The first virtual machines created by the first virtual machine templates of different functional types have different functions. In the first host, the first virtual machine may include one or more, and the required number of first virtual machines can be created according to actual business needs. The virtual machine unique identifier is used as the virtual machine identifier. In a feasible manner, the virtual machine unique identifier is implemented as a universal unique identifier.

[0066] S310. The first host machine initializes and configures the first virtual machine.

[0067] When the virtual machine is started for the first time, the first host machine performs initialization settings on the first virtual machine. In a feasible manner, the initialization settings on the first virtual machine specifically include: setting the first virtual machine network configuration and initializing the first virtual machine related service configuration.

[0068] Similarly, the second host machine is initialized and configured with reference to the initialization configuration of the first host machine.

[0069] In one possible approach, Figure 4 As shown, after the first host machine and the second host machine are initialized and set, a virtual machine migration method in an embodiment of the present application further includes:

[0070] S402. Set the first host machine to monitor the second host machine.

[0071] Obtain system information from the data sharing center, wherein the system information includes: a first host unique identifier and the first host network information, and a second host unique identifier and the second host network information; in one feasible manner, after the first host is set to monitor the second host, the system information is uploaded to the data sharing center by the first host. Check the system information to determine whether the first host has been set to monitor the second host. If not, set the first host to monitor the second host, and the first host uploads the system information to the data sharing center.

[0072] S404. The first host machine pre-sets a minimum number of standby first virtual machines according to the number of second virtual machines running in the second host machine, and creates and starts standby first virtual machines.

[0073] In one feasible manner, the minimum number of standby first virtual machines is greater than or equal to the number of second virtual machines running in the second host machine. The preset minimum number of standby first virtual machines can be flexibly set according to actual business needs and available resources, which can enhance the reliability of the second virtual machine service while reducing resource usage.

[0074] The first host machine obtains the number of second virtual machines running in the second host machine and the second virtual machine template in the data sharing center, and uses the second virtual machine template to create and start a standby first virtual machine based on a pre-set minimum number of standby first virtual machines; the first host machine updates the standby first virtual machine unique identifier of the standby first virtual machine in the data sharing center.

[0075] In one feasible manner, when the first host machine creates the backup first virtual machine, if the first host machine's available resources are less than the resources required to create the backup first virtual machine, the first host machine cannot implement the migration function, and the first host machine issues an alarm, such as an email notification, a text message notification, etc. In this way, it can be prevented that when the second virtual machine fails, the first host machine cannot implement the migration function, thereby affecting the reliability of the service of the second virtual machine.

[0076] S406. Set a scheduled backup task for the second host machine and a scheduled heartbeat task for the first host machine.

[0077] The second host is set to periodically update the second backup information in the data sharing center. In one feasible method, the second backup information includes: the second virtual machine business data, the second virtual machine unique identifier, the second virtual machine network configuration, the second virtual machine basic configuration information, the second virtual machine business data hash value, and the second virtual machine business data generation time. The second host compares the second virtual machine business data hash value in the packaged second backup information with the second virtual machine business data hash value in the second backup information in the data sharing center. If they are different, the second host updates the second backup information in the data sharing center to the packaged second backup information. In this way, it can be ensured that when the virtual machine is migrated, the first host can obtain the latest backup information of the second virtual machine in the second host in time, avoiding problems such as data loss caused by host failure and virtual machine failure.

[0078] The first host is set to periodically send a heartbeat request to the second host. In one feasible method, as Figure 5 As shown, specifically including:

[0079] S502. The first host machine periodically requests the data sharing center for the operating status of the second host machine.

[0080] In one feasible method, the first host machine configures the heartbeat request time interval, timeout time and timeout retry times, and requests the operating status of the second host machine from the data sharing center according to the heartbeat request time interval, so as to facilitate a more accurate subsequent determination of whether the second virtual machine has failed.

[0081] S504: If the running status of the second host machine is running, the first host machine sends a heartbeat request to the second host machine.

[0082] If the response time of the second host machine does not exceed the timeout period, proceed to step S506;

[0083] When the first host machine communicates normally with the LAN gateway, if the response time of the second host machine exceeds the timeout time, the first host machine accumulates a retry number and resends the heartbeat request. If the accumulated retry number exceeds the timeout retry number, the second host machine fails, and the first host machine migrates all the second virtual machines in the second host machine to the backup first virtual machines in the first host machine.

[0084] In this way, the operating status of the monitored second host machine can be quickly determined, and when a failure occurs in the second host machine, all second virtual machines can be quickly detected and migrated, thereby quickly restoring the service of the second virtual machine, ensuring the reliability and stability of the virtual machine service, and achieving high availability of the virtual machine.

[0085] S506. Obtain the operating status information of the second virtual machine. When the second host machine operates normally, the first host machine continues to obtain the operating status of the second virtual machine from the data sharing center. If the operating status of the second virtual machine is running, continue to perform functional checks on the second virtual machine.

[0086] If the function check result of the second virtual machine fails, the operation status information of the second virtual machine is abnormal operation, and the first host machine migrates the faulty second virtual machine in the second host machine to the backup first virtual machine in the first host machine; thereby, the automatic detection of the faulty second virtual machine and its migration to the backup first virtual machine in the first host machine is realized.

[0087] [HZTC-HXJMJJ241013][HS2411178CCN]In the first virtual machine, the reliability and stability of the virtual machine service are guaranteed, and the high availability of the virtual machine is achieved.

[0088] In one feasible manner, if the network of the second virtual machine is abnormal, the operating status information of the second virtual machine is abnormal operation, and the first host machine migrates the faulty second virtual machine in the second host machine to the backup first virtual machine in the first host machine.

[0089] In one feasible method, if the operating status of the second host machine is running, after performing a functional check on the second virtual machine, the first host machine checks the virtual machine data of the second host machine in the data sharing center, wherein the virtual machine data of the second host machine in the data sharing center includes: the second virtual machine information of all second virtual machines in the second host machine; if there is no record of the virtual machine data of the second host machine in the data sharing center, the second host machine adds the second virtual machine information to the virtual machine data of the second host machine in the data sharing center.

[0090] In this way, the failed second virtual machine is automatically detected and migrated to the spare first virtual machine in the first host machine, and the failed virtual machine is accurately located, ensuring the reliability and stability of the virtual machine service and achieving high availability of the virtual machine.

[0091] In one possible approach, Figure 6 As shown, migrating the second virtual machine to the standby first virtual machine in the first host machine specifically includes:

[0092] S602. The first host machine locks the second virtual machine information of the failed second virtual machine in the data sharing center.

[0093] S604. The first host machine obtains the second backup information of the failed second virtual machine in the data sharing center, restores the second virtual machine business data in the second backup information to the backup first virtual machine in the first host machine, and restores the second virtual machine network configuration in the second backup information to the backup first virtual machine in the first host machine.

[0094] S606. The first host machine performs a functional check on the standby first virtual machine. If the result of the functional check of the first virtual machine is passed, the first host machine updates the migration information of the failed second virtual machine in the virtual machine data of the second host machine in the data sharing center to migrated, and unlocks the second virtual machine information of the failed second virtual machine.

[0095] In a feasible manner, step S604 also includes: obtaining the virtual machine data of the second host machine, and updating the unique identifier of migration to the host machine, the unique identifier of migration to the virtual machine, the second virtual machine business data, and recording time in the data sharing center.

[0096] As a result, the failed second virtual machine is successfully migrated to the standby first virtual machine in the first host machine, thereby ensuring the reliability and stability of the virtual machine service and achieving high availability of the virtual machine.

[0097] In a feasible manner, when the plurality of first host machines monitor the second virtual machine in the second host machine, migrating the second virtual machine to the standby first virtual machine in the first host machine further includes:

[0098] After locking the second virtual machine information of the failed second virtual machine, multiple first host machines obtain information of other first host machines in the data sharing center. In a feasible method, multiple first host machines obtain the hardware resource occupancy rates of other first host machines in the data sharing center, and by sorting the hardware resource occupancy rates, select the first host machine with the smallest hardware resource occupancy rate as the first host machine for actual migration, and migrate the failed second virtual machine to the first host machine for actual migration, and randomly select a backup first virtual machine that uses the same second virtual machine template as the failed second virtual machine.

[0099] In a feasible manner, the second virtual machine in the second host machine periodically checks its own migration information in the data sharing center. If the migration information of the second virtual machine is migrated, the second host machine clears the second virtual machine with the migration information being migrated. Thus, it is ensured that when a virtual machine fails and is successfully migrated and then returns to normal, it no longer occupies the resources of the host machine, thereby improving the resource utilization of the host machine.

[0100] In a feasible manner, after the second virtual machine is migrated to the standby first virtual machine in the first host machine, when the third host machine monitors the virtual machine in the first host machine, if there is no standby third virtual machine created by the second virtual machine template corresponding to the standby first virtual machine in the third host machine, or the number of standby third virtual machines is insufficient to realize the migration of the standby first virtual machine when the standby first virtual machine fails, the third host machine obtains the second virtual machine template corresponding to the standby first virtual machine from the data sharing center, and uses the second virtual machine template to create a certain number of standby third virtual machines, ensuring that the third virtual machine can monitor the virtual machine in the first host machine and realize the migration of the standby first virtual machine when the standby first virtual machine fails. In this way, the reliability of the virtual machine service in the first host machine is guaranteed.

[0101] In one feasible method, before starting the virtual machines in the first host machine and the second host machine, it also includes: the second host machine obtains the second host machine unique identifier, the second virtual machine unique identifier, and the second virtual machine template unique identifier from the data sharing center, migrates to the host machine unique identifier, migrates to the virtual machine unique identifier, the second virtual machine business data, and records the time as the virtual machine data of the second host machine, and starts the second virtual machine that has not been migrated; wherein, if no migration occurs, the migrated to host machine unique identifier, migrated to the virtual machine unique identifier, the second virtual machine business data, and the recorded time are all empty values.

[0102] In the actual implementation process, each step in the embodiment of the present application can be integrated into a software program, for example, which can be installed in a host machine to implement Figure 2 The backup service, migration service, monitoring service and basic service shown in the figure are for the host to manage itself according to the host management protocol to realize the monitoring service and basic service; and for the virtual machine management protocol to manage the virtual machine running in the host to realize the backup service, migration service and basic service.

[0103] In one feasible manner, a second standby virtual machine is running on the second host machine, and when the first host machine monitors the second virtual machine running on the second host machine, the second host machine monitors the first virtual machine running on the first host machine. Thus, the first host machine and the second host machine monitor each other's virtual machine running status, and migrate the virtual machine when a virtual machine fails, which can avoid the situation where all virtual machines on the hardware server cannot run due to a hardware server failure when there is only one hardware server, thereby improving the reliability of the virtual machine service.

[0104] According to a virtual machine migration method of an embodiment of the present application, a virtual machine migration method is constructed through a local area network with the help of a data sharing center, which can quickly migrate the faulty virtual machine when a virtual machine fails, avoiding problems such as data loss and service interruption caused by host machine failure and virtual machine failure; at the same time, backup virtual machines are set according to the type of monitored virtual machines, which improves the resource utilization while enhancing the reliability of virtual machine services; it has rich usage scenarios, can realize various forms of monitoring combinations, and saves the hardware consumption of separately configuring a dedicated cloud platform management center for virtual machine management.

[0105] The following is a virtual machine migration method according to an embodiment of the present application, which is described in conjunction with a specific embodiment:

[0106] Taking host A and host B monitoring each other as an example, upload host A's system information HA_I NFO_A and host B's system information HA_I NFO_B to the data sharing center, and perform preliminary configuration on host A and host B.

[0107] [HZTC-HXJMJJ241013][HS2411178CCN], where host A and host B are equal and there is no master-slave relationship.

[0108] The data sharing center includes virtual machine template T1, virtual machine template T2 and virtual machine template T3; among them, host machine A starts virtual machines A1 and A2 using virtual machine template T1 as template, and virtual machine A3 using virtual machine template T2 as template; host machine B starts virtual machine B1 using virtual machine template T2 as template, and virtual machines B2 and B3 using virtual machine template T3 as template; host machine A uploads its own virtual machine data HA_VM_I NFO_A to the data sharing center, and host machine B uploads its own virtual machine data HA_VM_I NFO_B to the data sharing center.

[0109] Host A and host B are set to monitor each other. Host A creates and starts standby virtual machine A_BAK1 using virtual machine template T2 as a template, and standby virtual machine A_BAK2 and standby virtual machine A_BAK3 using virtual machine template T3 as a template according to virtual machines B1, B2 and B3 in host B. At the same time, host B creates and starts standby virtual machines B_BAK1 and standby virtual machine B_BAK2 using virtual machine template T1 as a template, and standby virtual machine B_BAK3 using virtual machine template T2 as a template according to virtual machines A1, A2 and A3 in host A.

[0110] Host A regularly updates the backup information of virtual machines A1, A2, and A3 in the data sharing center, and regularly sends heartbeat requests to host B. Host B regularly updates the backup information of virtual machines B1, B2, and B3 in the data sharing center, and regularly sends heartbeat requests to host A.

[0111] If host machine B finds that virtual machine A1 fails in the heartbeat response of host machine A, host machine B locks the A1 virtual machine information in the virtual machine data HA_VM_I NFO_A in the data sharing center, obtains the backup information of virtual machine A1 in the data sharing center, and randomly restores the backup information of virtual machine A1 to one of the standby virtual machine B_BAK1 and the standby virtual machine B_BAK2. For example, the backup information of virtual machine A1 is restored to the standby virtual machine B_BAK1, specifically including: restoring the business data of virtual machine A1 and the network configuration of virtual machine A1 in the backup information of virtual machine A1 to the standby virtual machine B_BAK1; host machine B performs a functional check on the standby virtual machine B_BAK1. If the result of the functional check of standby virtual machine B_BAK1 is passed, host machine B updates the migration information of virtual machine A1 in the virtual machine data HA_VM_I NFO_A in the data sharing center to migrated, and unlocks the A1 virtual machine information in the virtual machine data HA_VM_I NFO_A in the data sharing center. At this time, the standby virtual machine B_BAK1 has replaced virtual machine A1 to provide service calls.

[0112] The virtual machines in host A and host B regularly check their migration information. If virtual machine A1 returns to normal, host A confirms that virtual machine A1 has been migrated, and then host A will clean up virtual machine A1. In subsequent heartbeats, when host A finds that the standby virtual machine B_BAK1 in host B replaces virtual machine A1 to provide service calls, it will create a new standby virtual machine with virtual machine template T1 as the template to ensure that the standby virtual machines in host A correspond to the number of virtual machines in host B.

[0113] See also Figure 7 As shown, the embodiment of the present application also provides a virtual machine migration device, which is applied to a system supporting virtualization technology, including:

[0114] A monitoring module, used to monitor the operation of the second virtual machine running on the second host machine to obtain the operation status information of the second virtual machine;

[0115] The migration module is used to obtain the second backup information of the second virtual machine from the data sharing center when the first host machine determines that the second virtual machine has failed based on the running status information, and migrate the failed second virtual machine to the spare first virtual machine in the first host machine based on the second backup information.

[0116] [HZTC-HXJMJJ241013][HS2411178CCN]

[0117] Specifically, by monitoring the second virtual machine running in the second host machine through the monitoring module, it is possible to quickly detect the fault when the second virtual machine fails or the second host machine fails, and after detecting the fault, quickly migrate the faulty virtual machine through the migration module to avoid problems such as data loss and service interruption caused by host machine failure and virtual machine failure; at the same time, a backup virtual machine is set according to the type of monitored virtual machine, which improves resource utilization while enhancing the reliability of virtual machine services.

[0118] The information interaction, execution process and other contents between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present application. The specific contents can be found in the description in the embodiment of the method of the present application and will not be repeated here.

[0119] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.

Claims

1. A virtual machine migration method, applied to a system supporting virtualization technology, characterized in that: The system includes a first host machine and a second host machine, a second virtual machine is running on the second host machine, and a standby first virtual machine is running on the first host machine; The method comprises: The first host machine monitors the operation of the second virtual machine running on the second host machine to obtain the operation status information of the second virtual machine; If the first host machine determines that the second virtual machine has failed based on the operating status information, the second backup information of the failed second virtual machine is obtained from the data sharing center, and the failed second virtual machine is migrated to the backup first virtual machine in the first host machine based on the second backup information.

2. The method according to claim 1, characterized in that: The migrating the failed second virtual machine to the standby first virtual machine in the first host machine according to the second backup information specifically includes: The first host machine locks the second virtual machine information of the second virtual machine that fails in the data sharing center; The first host machine obtains the second backup information from the data sharing center, and migrates the failed second virtual machine to the standby first virtual machine according to the second backup information; A function check is performed on the standby first virtual machine. If a function check result of the standby first virtual machine passes, the first host machine updates the migration information of the second virtual machine to migrated, and unlocks the second virtual machine information.

3. The method according to claim 2, characterized in that Also includes: The second virtual machine periodically checks its own migration information, and if the migration information of the second virtual machine indicates that the second virtual machine has been migrated, the second host machine clears the second virtual machine.

4. The method according to claim 1, characterized in that: The step of monitoring the operation of the second virtual machine running on the second host machine by the first host machine to obtain the operation status information of the second virtual machine specifically includes: The first host machine obtains the operating status of the second host machine from the data sharing center; If the running status of the second host machine is running, continue to obtain the running status information of the second virtual machine.

5. The method according to claim 4, characterized in that Before obtaining the running status information of the second virtual machine, the method further includes: The first host machine sends a heartbeat request to the second host machine, and if the second host machine responds within a timeout period, continues to obtain the running status information of the second virtual machine; If the number of response timeouts of the second host machine exceeds a preset value, the second host machine fails, and all of the second virtual machines in the second host machine are migrated to the standby first virtual machines in the first host machine.

6. The method according to claim 5, characterized in that The obtaining the running status information of the second virtual machine specifically includes: [HZTC-HXJMJJ241013][HS2411178CCN] obtain the running status of the second virtual machine, and if the running status of the second virtual machine is running, continue to perform a function check on the second virtual machine; If the function check result of the second virtual machine fails, the operation status information of the second virtual machine is abnormal operation, and the second virtual machine fails.

7. The method according to claim 1, characterized in that The first host machine also runs a first virtual machine, the second host machine also runs at least one standby second virtual machine, and the method further includes: The second host machine monitors the operation of the first virtual machine running on the first host machine; If the first virtual machine fails, the failed first virtual machine is migrated to the standby second virtual machine in the second host machine according to the first backup information of the first virtual machine in the data sharing center.

8. The method according to claim 7, characterized in that The second host machine periodically updates the second backup information of the second virtual machine to the data sharing center; The first host machine periodically updates the first backup information of the first virtual machine to the data sharing center.

9. The method according to claim 1, characterized in that: Also includes: When the first host machine creates the standby first virtual machine according to the preset minimum number of standby first virtual machines, if the available resources of the first host machine are less than the resources required to create the standby first virtual machine, the first host machine issues an alarm.

10. A virtual machine migration device, applied to a system supporting virtualization technology, characterized in that: The system includes a first host machine and a second host machine, a second virtual machine is running on the second host machine, and a standby first virtual machine is running on the first host machine; The device comprises: A monitoring module, used to monitor the operation of the second virtual machine running on the second host machine to obtain the operation status information of the second virtual machine; A migration module is used to obtain the second backup information of the second virtual machine from the data sharing center when the first host machine determines that the second virtual machine has failed based on the running status information, and migrate the failed second virtual machine to the backup first virtual machine in the first host machine based on the second backup information.