Virtual machine live migration method, apparatus, and system, and related device

By defining a standard storage method, the hardware usage status information of the virtual machine on the first physical device is converted into a standard storage method and passed to the second physical device, solving the problem of hot migration of virtual machines between heterogeneous physical devices, and realizing the Efficient migration process and privacy protection.

WO2025025622A1PCT designated stage expired Publication Date: 2025-02-06HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/082394
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-07-31
Filing Date
2024-03-19
Publication Date
2025-02-06

AI Technical Summary

Technical Problem

The prior art is difficult to realize the thermal migration of virtual machines between heterogeneous physical devices, because physical devices of different hardware manufacturers use different storage methods, making it difficult to accurately identify and restore the hardware usage status.

Method used

By defining a standard storage method, the hardware usage status information of the virtual machine on the first physical device is converted into the status information of the standard storage method and passed to the second physical device. The second physical device then converts the information of the standard storage method into the storage method it can recognize, thereby restoring the operation of the virtual machine.

Benefits of technology

The hot migration of virtual machines between heterogeneous physical devices is realized, reducing users' perception of the migration process, and protecting the privacy of storage methods in various physical devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024082394_06022025_PF_FP_ABST
    Figure CN2024082394_06022025_PF_FP_ABST
Patent Text Reader

Abstract

A virtual machine live migration method, apparatus, and system, and a related device, relating to the technical field of virtualization. A first physical device obtains first status information of a first storage mode that can be recognized by the first physical device, wherein the first status information is used for indicating a status of a virtual machine using hardware when the virtual machine runs on the first physical device, and then the first physical device converts the first status information to obtain third status information of a standard storage mode and sends the third status information to a second physical device; and the second physical device converts the third status information of the standard storage mode to obtain second status information of a second storage mode that can be recognized by the second physical device, and runs the virtual machine on the second physical device on the basis of the second status information. In this way, the second physical device obtains the status of the virtual machine using hardware in the first physical device by converting the information of the standard storage mode, and accordingly recovers running of the virtual machine on the second physical device, thereby implementing live migration of the virtual machine between two heterogeneous physical devices.
Need to check novelty before this filing date? Find Prior Art

Description

Virtual machine hot migration method, device, system and related equipment

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on July 31, 2023, with application number 202310954585.X and application name “Virtual Machine Hot Migration Method, Device, System and Related Equipment”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of virtualization technology, and in particular to a virtual machine hot migration method, device, system and related equipment. Background Art

[0003] With the development of virtualization technology, the use of virtual machines (VMs) is becoming increasingly widespread. In practical applications, it may be necessary to migrate a running VM from a physical device to another physical device through hot migration to minimize service interruption on the VM and reduce user awareness of the VM migration.

[0004] Currently, when hot migrating a virtual machine on physical device 1 to physical device 2, the usage status of the virtual machine on physical device 1 for hardware such as the network card, processor, and memory will be obtained first, and the usage status of the hardware will be sent to physical device 2 so that physical device 2 can resume the operation of the virtual machine based on the usage status.

[0005] However, this hot migration method is only applicable to hot migration between physical device 1 and physical device 2 of the same model produced by the same hardware manufacturer, that is, virtual machines can only be hot migrated between multiple physical devices of the same structure. When physical device 1 and physical device 2 come from different hardware manufacturers or belong to different models (that is, physical device 1 and physical device 2 are heterogeneous), physical device 1 and physical device 2 will use different storage methods to record data with the same content. In addition, hardware manufacturers usually do not disclose the storage method used by physical devices to record data. This makes it difficult for physical device 2 to accurately identify data such as the hardware usage status sent by physical device 1 to physical device 2, resulting in the virtual machine on physical device 1 being unable to successfully hot migrate to physical device 2.

[0006] Therefore, there is an urgent need for a method for hot migration of virtual machines between multiple heterogeneous physical devices.

[0007] Summary of the Invention

[0008] The present application provides a virtual machine hot migration method to implement hot migration of virtual machines between multiple heterogeneous physical devices. In addition, the present application also provides a virtual machine hot migration apparatus, system, computing device, computer-readable storage medium, and computer program product.

[0009] In the first aspect, the present application provides a method for hot migration of a virtual machine. Specifically, a first physical device obtains first status information, and the first status information is used to indicate the usage status of the hardware in the first physical device when the virtual machine is running on the first physical device. For example, it can indicate the usage status of the virtual machine for PCIe devices such as hard disks, network cards, and computing cards, etc. The first status information is information of a first storage method that can be recognized by the first physical device, and the storage methods of the data that can be recognized by the first physical device and the second physical device are different. For example, the first physical device and the second physical device are produced by different manufacturers, resulting in differences in the storage methods of the data that can be recognized by the two physical devices, etc., wherein the storage method of the data can define the physical device record The first physical device converts the first state information after obtaining the first state information to obtain third state information of the standard storage method, which is a common storage method defined between the first physical device and the second physical device and can be parsed by both physical devices; then, the first physical device sends the third state information of the standard storage method to the second physical device; accordingly, the second physical device converts the received third state information of the standard storage method to obtain second state information, which is information of the second storage method that can be recognized by the second physical device, and runs the virtual machine on the second physical device according to the second state information.

[0010] In this way, during the process of hot migrating a virtual machine between two physical devices, although the two physical devices cannot know each other's data storage method, the information about the hardware usage status when the virtual machine is running on the first physical device can be transmitted between the two physical devices through a standard storage method. This enables the second physical device to convert the information of the standard storage method to obtain the second state information of the second storage method that the second physical device can recognize, thereby identifying the hardware usage status of the virtual machine on the first physical device, so that the second physical device can resume the virtual machine operation on the second physical device based on the hardware usage status, thereby realizing hot migration of the virtual machine between two heterogeneous physical devices. At the same time, during the process of hot migrating the virtual machine, the data storage method of each physical device can not be known by the other physical device, thereby realizing privacy protection of the storage method in each physical device.

[0011] In one possible implementation, the standard storage method is a structure, where the values ​​of multiple members defined in the structure can indicate the virtual machine's usage status for each hardware component on the first physical device. In this way, the first and second physical devices can communicate status information based on the structure.

[0012] In one possible implementation, the first physical device can also send memory data to the second physical device by marking memory dirty. This memory data is the data cached in the memory of the first physical device while the virtual machine is running. This allows the virtual machine to resume running on the second physical device based on the data in memory. This reduces the impact of memory data migration on virtual machine live migration and further reduces the user's perception of virtual machine live migration.

[0013] In one possible implementation, the various state information mentioned above may include one or more of a feature bit, resource configuration, and queue status, and the state information refers to the first state information, the second state information, or the third state information. Alternatively, the state information may include other types of information.

[0014] In a second aspect, the present application provides a method for hot migration of a virtual machine. Specifically, a second physical device receives third state information of a standard storage method, where the third state information of the standard storage method is used to indicate the usage status of the hardware in the first physical device when the virtual machine is running on the first physical device; the second physical device converts the third state information of the standard storage method to obtain second state information, where the second state information is information of a second storage method that can be recognized by the second physical device; and the second physical device runs the virtual machine on the second physical device based on the second state information. In this way, the second physical device can convert the information of the standard storage method to obtain the second state information of the second storage method that can be recognized by the second physical device, and thereby identify the usage status of the virtual machine for the hardware on the first physical device, so that the second physical device can resume the operation of the virtual machine on the second physical device based on the usage status of the hardware, thereby realizing hot migration of the virtual machine between two heterogeneous physical devices.

[0015] On the third aspect, the present application provides a method for hot migration of a virtual machine. Specifically, a first physical device obtains first state information, the first state information is used to indicate the usage status of the virtual machine for the hardware in the first physical device when the virtual machine is running on the first physical device, and the first state information is information of a first storage method that the first physical device can recognize; the first physical device converts the first state information to obtain third state information of a standard storage method; the first physical device sends the third state information of the standard storage method to a second physical device. In this way, the first physical device can convert the first state information into third state information of a standard storage method supported and recognized by the second physical device, so that the second physical device can recognize the usage status of the virtual machine for the hardware on the first physical device, so as to restore the virtual machine operation on the second physical device according to the usage status, thereby realizing hot migration of the virtual machine between two heterogeneous physical devices.

[0016] In a fourth aspect, the present application provides a virtual machine hot migration system, which includes a first physical device and a second physical device; wherein the first physical device is used to obtain first status information, the first status information is used to indicate the usage status of the hardware in the first physical device when the virtual machine is running on the first physical device, and the first status information is information of a first storage method that can be recognized by the first physical device; the first status information is converted to obtain third status information of a standard storage method; the third status information of the standard storage method is sent to the second physical device; the second physical device is used to receive the third status information of the standard storage method; the third status information of the standard storage method is converted to obtain second status information, and the second status information is information of a second storage method that can be recognized by the second physical device; and the virtual machine is run on the second physical device according to the second status information.

[0017] In a possible implementation, the standard storage method is a structure.

[0018] In a possible implementation, the first physical device is further configured to send memory data to the second physical device by marking the memory dirty, where the memory data is data cached in the memory of the first physical device when the virtual machine is running.

[0019] In a possible implementation, the various status information mentioned above includes one or more of a feature bit, resource configuration, and queue status, and the status information refers to the first status information, the second status information, or the third status information.

[0020] In a fifth aspect, the present application provides a virtual machine hot migration device, which includes various modules for executing the virtual machine hot migration method in the second aspect.

[0021] In a sixth aspect, the present application provides a virtual machine hot migration device, which includes various modules for executing the virtual machine hot migration method in the third aspect.

[0022] In a seventh aspect, the present application provides a computing device comprising a processor and a memory. The processor and the memory communicate with each other. The processor is configured to execute instructions stored in the memory so that the computing device performs the virtual machine live migration method described in the second or third aspect. It should be noted that the memory may be integrated into the processor or may be independent of the processor. The computing device may further comprise a bus. The processor is connected to the memory via the bus. The memory may comprise a readable memory and a random access memory.

[0023] In an eighth aspect, the present application provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computing device, the computing device executes the operating steps of the virtual machine hot migration method described in the second or third aspect above.

[0024] In a ninth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computing device, enables the computing device to execute the operating steps of the virtual machine hot migration method described in the second or third aspect above.

[0025] Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] FIG1 is a schematic diagram of the architecture of an exemplary virtual machine live migration system provided by the present application;

[0027] FIG2 is a flow chart of a method for hot migration of a virtual machine provided in this application;

[0028] FIG3 is a schematic diagram of the architecture of another exemplary virtual machine live migration system provided by the present application;

[0029] FIG4 is a flow chart of another virtual machine live migration method provided by the present application;

[0030] FIG5 is a schematic structural diagram of a virtual machine hot migration device provided by the present application;

[0031] FIG6 is a schematic structural diagram of another virtual machine hot migration device provided by the present application;

[0032] FIG7 is a schematic diagram of the hardware structure of a computing device provided in this application. DETAILED DESCRIPTION

[0033] In order to enable hot migration of a virtual machine between two heterogeneous physical devices, the present application provides a virtual machine hot migration method, which uses a standard storage method to transfer information indicating the hardware usage status of the virtual machine when running on a first physical device to a second physical device. This enables the second physical device to identify the hardware usage status of the virtual machine based on the status information of the standard storage method, and thus to resume the virtual machine operation on the second physical device according to the hardware usage status, thereby enabling hot migration of the virtual machine between two heterogeneous physical devices.

[0034] The technical solutions in this application will be described below in conjunction with the drawings in the embodiments of this application.

[0035] Referring to Figure 1 , there is shown a schematic diagram of the architecture of an exemplary virtual machine live migration system provided in an embodiment of the present application. The virtual machine live migration system 10 includes multiple physical devices, with Figure 1 exemplarily illustrating physical devices 100 and 200. Furthermore, physical devices 100 and 200 can communicate with each other via a high-speed interconnection network.

[0036] Both the physical device 100 and the physical device 200 may be computing devices including a processor, such as a server. The processor may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a programmable logic device (PLD), a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a system on chip (SoC), a software-defined infrastructure (SDI) chip, an artificial intelligence (AI) chip, a data processing unit (DPU), or any combination thereof. Furthermore, the number of processors included in the physical device may be one or more, and the types of processors included may be one or more. The number and type of processors may be set based on the actual business requirements of the application, and this embodiment does not limit this.

[0037] Furthermore, the physical device 100 and the physical device 200 may be two heterogeneous physical devices, specifically referring to the use of different types of hardware on the physical device 100 and the physical device 200, and different storage methods are used to cache the relevant data for the hardware. For example, for the same data (including data a and data b), the physical device 100 may use 512 bits (bits) for recording, while the physical device 200 may use 1024 bits for recording, that is, the two physical devices use different numbers of bits to record the same data; or, the data content recorded by the physical device 100 is data a and data b in sequence, while the data content recorded by the physical device 200 is data b and data a in sequence, that is, the two physical devices use different layouts to record the same data. Therefore, under normal circumstances, the physical device 200 may not be able to recognize the data sent by the physical device 100 or may easily make recognition errors.

[0038] As shown in FIG. 1 , a physical device 100 may include a software layer 101 and a hardware layer 102 .

[0039] Among them, the software layer 101 includes an operating system installed and running on the physical device 100, which can also be called a host operating system. One or more virtual machines 1011 can be created on the host operating system. The virtual machine 1011 includes a client (guest) operating system and one or more applications (applications) running thereon, which are used to provide corresponding virtualization services. The virtual machine 1011 can access the hardware in the hardware layer 102 through the driver in the client operating system and the kernel 1012 in the host operating system. For example, it can access the hardware layer 102 through the kernel-based virtual machine (KVM) 1013 (an open source system virtualization kernel driver module) in the kernel 1012.

[0040] The hardware layer 102 includes multiple hardware on the physical device 100, such as a processor, memory, and one or more peripheral component interconnect express (PCIe) devices. PCIe devices refer to devices that can be inserted into the PCIe slots on the physical device 100, such as hard disks, network cards, graphics processing units (GPUs), offload cards, etc. Furthermore, the hardware layer 102 can also include cloud devices that can be accessed by the physical device 100, such as cloud disks, etc., and the virtual machine 1011 can be unaware of the location of the hardware in the hardware layer 102 and can access the cloud devices as if they were local hardware.

[0041] In addition, the physical device 100 also includes a virtual machine hot migration device 103 for collecting information on the physical device 100 and transmitting it to the physical device 200. The virtual machine hot migration device 103 can be implemented by software and can be deployed in the software layer 101, as shown in Figure 1. Alternatively, the virtual machine hot migration device 103 can be implemented by hardware and can be deployed in the hardware layer 102. In this case, the virtual machine hot migration device 103 can specifically be a CPU, as well as any processor such as ASIC, PLD, CPLD, FPGA, GAL, SoC, SDI chip, AI chip, DPU (data processing unit), or any combination thereof.

[0042] The architecture of the physical device 200 is similar to that of the physical device 100 . For details, please refer to FIG. 1 and the related description of the physical device 100 , which will not be repeated here.

[0043] In actual application scenarios, when there are too many virtual machines 1011 running on the physical device 100 (causing the physical device 100 to be overloaded), or the host operating system on the physical device 100 needs to be upgraded and restarted, it is usually necessary to migrate the virtual machine 1011 on the physical device 100 to the physical device 200 through hot migration to reduce the user's perception of the hot migration process of the virtual machine 1011.

[0044] During the process of hot migrating the virtual machine 1011, the virtual machine hot migration device 103 collects the usage status of the hardware in the hardware layer 102 when the virtual machine 1011 is running on the physical device 100, such as the access status of the hard disk (such as the progress of reading / writing data), the usage status of the PCIe device, etc. The collected usage status can be cached as the status information of the first storage method that can be accurately identified by the physical device 100, hereinafter referred to as the first status information.

[0045] Since the data storage method that can be recognized by the physical device 200 is different from that of the physical device 100, and the data storage method that can be recognized by the physical device 200 is also difficult for the physical device 100 to know, the virtual machine hot migration device 103 will convert the first state information to obtain the third state information of the universal storage method. The universal storage method is referred to as the standard storage method below. Then, the virtual machine hot migration device 103 sends the third state information of the standard storage method to the physical device 200.

[0046] The virtual machine hot migration device 203 can obtain the state information of the second storage mode that can be recognized by the physical device 200 by converting the third state information of the standard storage mode, which is hereinafter referred to as the second state information. Since the second state information can indicate the hardware usage status of the virtual machine 1011, the virtual machine hot migration device 203 can resume the operation of the virtual machine 1011 on the physical device 200 based on the second state information.

[0047] Thus, during the hot migration of virtual machine 1011 between two physical devices, although the two physical devices cannot know each other's data storage methods, the information about the hardware usage status of virtual machine 1011 when running on physical device 100 can be transmitted between the two physical devices through a standard storage method. This enables physical device 200 to convert the information of the standard storage method to obtain second state information of a second storage method that physical device 200 can recognize, thereby identifying the hardware usage status of virtual machine 1011 on physical device 100. Physical device 200 can then resume the operation of virtual machine 1011 on physical device 200 based on the hardware usage status, thereby achieving hot migration of virtual machine 1011 between two heterogeneous physical devices. At the same time, the storage method in each physical device can also be protected for privacy, that is, the data storage method of each physical device can be kept secret from the other physical device.

[0048] It is worth noting that the virtual machine live migration system 10 shown in FIG1 is merely an example and is not intended to be limiting. For example, other possible virtual machine live migration systems may include a greater number of physical devices, and virtual machines running on physical device 100 and physical device 200 may be live migrated to other physical devices; or, in other possible virtual machine live migration systems, physical device 100 (and physical device 200) may include more functional modules. This application does not limit the specific architecture of the virtual machine live migration system 10 and the physical devices it includes.

[0049] For ease of understanding, an embodiment of the virtual machine hot migration method provided in this application is described below in conjunction with the accompanying drawings.

[0050] Referring to FIG. 2 , FIG. 2 is a flow chart illustrating a method for live migration of a virtual machine provided in an embodiment of the present application. This method can be applied to the virtual machine live migration system 10 described in FIG. 1 , or can be applied to other applicable virtual machine live migration systems. For ease of explanation, this embodiment is described using the virtual machine live migration system 10 shown in FIG. 1 as an example.

[0051] The virtual machine live migration method shown in FIG2 may specifically include:

[0052] S201: The virtual machine hot migration device 103 obtains first status information, which is used to indicate the usage status of the hardware in the physical device 100 when the virtual machine 1011 runs on the physical device 100. The first status information is information of a first storage method that can be recognized by the physical device 100.

[0053] In actual application, the physical device 100 can perform a hot migration process on one or more virtual machines 1011 running thereon if the hot migration conditions are met.

[0054] As a first example, the hot migration condition may specifically be receiving user instruction information for hot migration of a virtual machine. For example, when the number of virtual machines 1011 running on physical device 100 is excessive, or the host operating system in physical device 100 needs to be upgraded and restarted, or physical device 100 needs to be powered off for maintenance, the user may trigger a hot migration operation for virtual machine 1011 on physical device 100, and physical device 100 will respond to the trigger operation and begin the hot migration process for virtual machine 1011.

[0055] As a second example, the hot migration condition may specifically be detecting that a failure of the physical device 100 has occurred, or detecting that the physical device 100 has reached the time for regular operation and maintenance (such as the physical device 100 may periodically perform system upgrades or power-off inspections, etc.). At this time, the physical device 100 may automatically execute the hot migration process for the virtual machine 1011.

[0056] After determining to start hot migration of virtual machine 1011, the virtual machine hot migration device 103 can stop running virtual machine 1011 and collect the usage status of the hardware in the hardware layer 102 when virtual machine 1011 is currently running. The usage status can indicate the hardware required by virtual machine 1011 during operation (such as the usage status may include the identification of the hardware, etc.), as well as the current usage status of each of these hardware.

[0057] Exemplarily, the usage status collected by the virtual machine hot migration device 103 may specifically include information such as feature bits, resource configuration, and queue status. Among them, the feature bits are used to specify the functions and features that the virtual machine 1011 can support. For example, when the value of the feature bit is 1, it indicates that function A is turned on; when the value of the feature bit is 0, it indicates that function A is turned off. Resource configuration is used to specify the resources allocated to the virtual machine 1011, such as the media access control (MAC) address, Internet Protocol (IP) address, and the length of the data packet when communicating with other virtual machines / devices. The queue status is used to specify the usage of the queue, such as the number of queues used, the identifier of the available position corresponding to each queue, the identifier of the used position, etc. In actual application, the collected usage status may also include other types of information, which is not limited in this embodiment.

[0058] Typically, the hardware usage status of virtual machine 1011 can reflect the operating status of virtual machine 1011. Therefore, the hardware usage status can be used to subsequently restore virtual machine 1011 to run on other physical devices. For example, the data read / write progress of virtual machine 1011 can be determined based on the queue usage status of virtual machine 1011. Therefore, when resuming the operation of virtual machine 1011, data can be read / written in the queue based on the queue usage status.

[0059] Since the virtual machine hot migration device 103 is deployed in the physical device 100, the virtual machine hot migration device 103 can summarize the usage status of each hardware collected to obtain first status information, and the first status information is stored in the buffer of the physical device 100 in a first storage method that can be recognized by the physical device 100.

[0060] S202: The virtual machine live migration device 103 converts the first state information to obtain third state information in a standard storage manner.

[0061] S203 : The virtual machine live migration apparatus 103 sends the third state information of the standard storage method to the physical device 200 .

[0062] Typically, two heterogeneous physical devices may have difficulty learning each other's data storage methods. For example, when physical device 100 and physical device 200 are manufactured by different hardware manufacturers, each hardware manufacturer may not publicly disclose the data storage methods used by the physical devices they produce. Therefore, in order to enable physical device 200 to identify the hardware usage status of virtual machine 1011 from the received information, in this embodiment, a common data storage method, namely a standard storage method, can be defined between physical device 100 and physical device 200. This standard storage method defines unified data length and data content layout, such as the data length corresponding to each hardware usage status and the arrangement order of the usage status of each hardware state in the third state information of the standard storage method. In addition, physical device 100 and physical device 200 can both convert data between the standard storage method and a storage method that each device can recognize.

[0063] As an implementation example, the standard storage method can be, for example, a predefined structure. A structure refers to structured data composed of a group of data, and each data constituting the structured data can be referred to as a member. In this embodiment, a plurality of members (or elements) can be defined in the structure, and the data type corresponding to each member can be defined, such as integer (int), character (char), string (string), floating point (float), Boolean (bool), etc. When the virtual machine hot migration device 103 converts the first state information, it can specifically assign values ​​to the members in the structure according to the usage status of each hardware indicated in the first state information, such as assigning an integer value to the member in the structure used to indicate the length of the communication data packet. In this way, the structure after assignment can carry information about the usage status of the virtual machine 1011 for the hardware.

[0064] The above implementation example is an illustrative example using the standard storage method as a structure. In other implementation examples, the standard storage method can also be implemented in other ways. For example, the standard storage method can also be implemented through an array or a table, etc. This implementation does not limit this.

[0065] After obtaining the third state information of the standard storage method, the virtual machine hot migration device 103 may send it to the physical device 200 so that the physical device 200 can resume the operation of the virtual machine 1011 according to the third state information.

[0066] For example, the physical device to which the virtual machine 1011 is to be migrated can be specified by the user. For example, when the virtual machine hot migration system 10 includes multiple physical devices, the user can specify to hot migrate the virtual machine 1011 on the physical device 100 to one of the physical devices. The physical device specified by the user is the physical device 200 in this embodiment.

[0067] Alternatively, the physical device to which virtual machine 1011 is to be migrated can be a pre-configured default physical device. For example, in virtual machine hot migration system 10, physical device 200 can be configured as a disaster recovery for physical device 100. Thus, when hot migrating virtual machine 1011 on physical device 100, virtual machine hot migration apparatus 102 can automatically migrate virtual machine 1011 to the pre-configured physical device 200.

[0068] Alternatively, the physical device to which virtual machine 1011 is to be migrated may be determined by physical device 100 after negotiation with other devices. For example, when virtual machine hot migration system 10 includes three or more physical devices, before hot migrating virtual machine 1011 on physical device 100, physical device 100 may first negotiate with multiple other physical devices to select a physical device from the multiple physical devices to host virtual machine 1011. The selected physical device is physical device 200 in this embodiment.

[0069] In actual applications, virtual machine 1011 typically uses the memory of physical device 100 to read and write data during operation. Furthermore, when live migration of virtual machine 1011 is determined, the memory of physical device 100 may contain data written by virtual machine 1011 during operation that has not yet been permanently stored. Therefore, virtual machine live migration apparatus 103 may also send the data in the memory allocated to virtual machine 1011 to physical device 200, so that physical device 200 can restore the data in the memory for virtual machine 1011 when resuming operation of virtual machine 1011.

[0070] As an implementation example, as shown in FIG2 , before suspending the operation of the virtual machine 1011, the virtual machine hot migration device 103 can mark the pages in the memory allocated to the virtual machine 1011 as dirty, that is, set a dirty mark for the pages in the memory. At this time, the pages in the memory can be called dirty pages. Then, the virtual machine hot migration device 103 can migrate the data in the dirty pages (hereinafter referred to as dirty page data) from the physical device 100 to the physical device 200. The dirty page refers to the data on the page that has not been synchronized to the disk and may be modified during the data migration process to the physical device 200. Therefore, when the virtual machine 1011 resumes operation on the physical device 200, it can be determined through the dirty mark of the page that the data read from the dirty page may not be the most recently updated data, so that the data finally read by the virtual machine 1011 is the correct latest data. During the process of migrating all dirty page data, the virtual machine 1011 may write new data to the memory, thereby generating new dirty page data. In this case, the virtual machine 1011 will migrate the new dirty page data to the physical device 200. The above process is iterated continuously until the amount of remaining unmigrated dirty page data is less than a threshold. Then, the virtual machine 1011 is stopped and all remaining dirty page data is migrated to the physical device 200. In this way, the migration of memory data can be completed while the virtual machine 1011 is running, thereby reducing the impact of memory data migration on the hot migration of the virtual machine 1011 and further reducing the user's perception of the hot migration of the virtual machine.

[0071] S204 : The virtual machine live migration device 203 converts the received third state information of the standard storage method to obtain second state information. The second state information is information of the second storage method that can be recognized by the physical device 200 .

[0072] Since the physical device 200 caches data based on the second storage method, the virtual machine hot migration device 203 can convert the information of the standard storage method into information of the second storage method after receiving the third state information of the standard storage method. Specifically, it can determine the usage status of the virtual machine 1011 for each hardware based on the value of each member in the structure, so that the physical device 200 can identify the information content indicated by the data, that is, identify the usage status of the virtual machine 1011 for each hardware.

[0073] S205 : The virtual machine live migration device 203 runs the virtual machine 1011 to be live migrated on the physical device 200 according to the second state information.

[0074] In a specific implementation, the virtual machine hot migration device 203 can pre-create a virtual machine with the same configuration as the virtual machine 1011 on the physical device 100. For example, before hot migrating the virtual machine 1011, the virtual machine hot migration device 203 can create a virtual machine based on the configuration information of the virtual machine 1011. In this way, after obtaining the second state information through conversion, the virtual machine hot migration device 203 can start running the created virtual machine based on the hardware usage status of the virtual machine 1011 indicated by the second state information. At this time, the virtual machine running on the physical device 200 can continue to perform the services provided by the virtual machine 1011 when it was suspended based on the second state information, which is equivalent to the virtual machine 1011 continuing to run on the physical device 200, thereby achieving hot migration of the virtual machine 1011 from the physical device 100 to the physical device 200.

[0075] In this embodiment, during the process of hot migrating virtual machine 1011 from physical device 100 to physical device 200, although the two physical devices cannot know each other's data storage methods, the information on the hardware usage status of virtual machine 1011 when running on physical device 100 can be transmitted between the two physical devices through a standard storage method. This enables physical device 200 to convert the information of the standard storage method to obtain second status information of the second storage method that can be recognized by physical device 200, thereby identifying the hardware usage status of virtual machine 1011 on physical device 100, so that physical device 200 can restore the operation of virtual machine 1011 on physical device 200 according to the hardware usage status, thereby realizing hot migration of virtual machine 1011 between two heterogeneous physical devices.

[0076] To facilitate further understanding of the technical solution of the present invention, the process of hot migrating the virtual machine 1011 on the physical device 100 to the physical device 200 is exemplarily described below in conjunction with a specific scenario.

[0077] 3 and 4 , FIG. 3 shows a schematic structural diagram of another virtual machine live migration system 30 , and FIG. 4 shows a schematic flow diagram of another virtual machine live migration method.

[0078] As shown in FIG3 , based on the virtual machine hot migration system 10 shown in FIG1 , in the virtual machine hot migration system 30 shown in FIG3 , the software layer 101 in the physical device 100 may further include a quick emulator (QEMU) 104, and QEMU 104 runs in user mode in the host operating system. QEMU 104 is an open source emulator software that can implement hardware virtualization. QEMU 104 may include a general virtio data path acceleration device (vDPA device) 1041, and the vDPA device 1041 is a virtio data plane hardware acceleration device that can separate the control plane and data plane of virtio, wherein the data plane is directly connected to the inside of the virtual machine, and the control plane is connected to the QEMU device layer through the vDPA framework, which can read and set the status of the virtio device. Kernel 1012 also includes a virtual host framework (vhost framework) 1014 and a vDPA framework 1015, which provide a unified interface for user space and kernel space to access the hardware in hardware layer 102. Furthermore, vDPA framework 1015 includes at least one vDPA device. FIG3 illustrates this using vDPA device 11 and vDPA device 12 as examples. Each vDPA device can access the hardware in hardware layer 102 through a corresponding vDPA driver. The hardware in hardware layer 102 can be paravirtualized as virtio (virtual input / output) devices.

[0079] When the virtual machine hot migration device 103 is implemented by software, the virtual machine hot migration device 103 may specifically include QEMU 104 , a virtual host framework 1014 , a vDPA framework 1015 , multiple vDPA devices, and multiple vDPA drivers in the software layer 101 .

[0080] The physical device 200 has a similar architecture to the physical device 100 . For details, please refer to FIG. 3 and the above description of the relevant parts of the physical device 100 , which will not be repeated here.

[0081] Referring to FIG4 , the virtual machine live migration method provided in FIG4 may specifically include:

[0082] S401 : QEMU 204 creates a virtual machine on the physical device 200 , which has the same configuration as the virtual machine 1011 on the physical device 100 .

[0083] S402 : QEMU 104 marks dirty pages in the memory used by the virtual machine 1011 , and migrates all dirty pages in the memory to the physical device 200 .

[0084] Among them, the specific implementation process of QEMU104 migrating dirty pages in memory to the physical device 200 can be found in the above-mentioned relevant descriptions and will not be repeated here.

[0085] S403 : QEMU 104 stops the virtual machine 1011 , disables the virtio device in the hardware layer 102 , and sends a command to the general vDPA device 1041 to obtain the usage status of the virtio device.

[0086] S404: The general vDPA device 1041 sends a command for obtaining the usage status of the virtio device to the virtual host framework 1014 through the vhost protocol.

[0087] S405 : The virtual host framework 1014 sends the command to the vDPA framework 1015 .

[0088] S406 : The vDPA framework 1015 sends a command to the vDPA device 11 and the vDPA device 12 to instruct the vDPA device 11 and the vDPA device 12 to feedback the usage status of the virtio device in the hardware layer 102 .

[0089] Illustratively, the usage status of the virtio device may include information such as a feature bit, resource configuration, and queue status, or may include other types of information, which is not limited thereto.

[0090] S407 : The vDPA device 11 and the vDPA device 12 respectively obtain the usage status of the virtio device in the hardware layer 102 through the corresponding vDPA driver.

[0091] S408 : The vDPA device 11 and the vDPA device 12 use corresponding vDPA drivers to convert the acquired first state information of the first storage mode to obtain third state information of the standard storage mode, and feed it back to QEMU 104 .

[0092] The vDPA device 11 and the vDPA device 12 can feed back the third state information of the standard storage method to QEMU 104 through the vDPA framework 1015 , the virtual host framework 1014 , and the general vDPA device 1041 .

[0093] S409 : QEMU 104 sends the third status information of the standard storage mode to the physical device 200 .

[0094] Exemplarily, the standard storage method may be a structure.

[0095] S410: QEMU 204 sends a command to the vDPA framework 2015 to set the usage status of the virtio device. The command includes the third status information of the standard storage mode.

[0096] In specific implementation, QEMU 204 may send the command to the vDPA framework 2015 through the general vDPA device 2041 and the virtual host framework 2014 .

[0097] S411 : The vDPA framework 2015 sends the command to the vDPA device 21 and the vDPA device 22 .

[0098] S412: vDPA device 21 and vDPA device 22 use corresponding vDPA drivers to convert the third state information of the standard storage mode in the command into second state information of the second storage mode, and configure the usage state of the corresponding virtio device in hardware layer 202 according to the second state information of the second storage mode.

[0099] S413: QEMU 204 starts and runs the virtual machine according to the usage status of each virtio device in the hardware layer 202.

[0100] In this way, hot migration of the virtual machine 1011 on the physical device 100 to the physical device 200 can be achieved.

[0101] In this embodiment, since the information on the usage status of the virtio device when the virtual machine 1011 is running on the physical device 100 can be transmitted between the two physical devices through a standard storage method, this enables the physical device 200 to convert the information of the standard storage method to obtain the usage status of each virtio device of the second storage method that can be recognized by the physical device 200, so that the virtual machine 1011 can be restored to run on the physical device 200 according to the usage status of the virtio device, thereby realizing hot migration of the virtual machine 1011 between two heterogeneous physical devices.

[0102] Furthermore, during the live migration of virtual machine 1011 on physical device 100, the usage status of all virtio devices can be directly obtained through the vDPA driver after virtual machine 1011 is stopped. This ensures that virtual machine 1011 will not be affected while in operation (i.e., there will be no performance degradation due to the upcoming live migration), thus ensuring the service processing efficiency of virtual machine 1011. Furthermore, physical device 200 can simultaneously send and configure the usage status of all virtio devices to hardware layer 202, which can accelerate the recovery efficiency of the virtual machine, effectively reduce the service interruption time on the virtual machine, and further reduce the user's perception of the virtual machine live migration.

[0103] It is worth noting that other reasonable step combinations that can be thought of by those skilled in the art based on the above description also fall within the scope of protection of this application. Secondly, those skilled in the art should also be familiar with that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by this application.

[0104] The above describes the virtual machine hot migration method provided in the embodiment of the present application in conjunction with Figures 1 to 4. Next, the structure of the virtual machine hot migration device and the computing device provided in the embodiment of the present application will be described in conjunction with the accompanying drawings.

[0105] 5 , which shows a schematic diagram of the structure of a virtual machine hot migration device. The virtual machine hot migration device 500 shown in FIG5 can be applied to the above-mentioned physical device 200. As shown in FIG5 , the virtual machine hot migration device 500 includes:

[0106] The communication module 501 is configured to receive third status information of a standard storage method, where the third status information of the standard storage method is used to indicate a usage status of hardware in the first physical device when the virtual machine runs on the first physical device;

[0107] The conversion module 502 is used to convert the third state information of the standard storage mode to obtain second state information, where the second state information is information of the second storage mode that can be recognized by the second physical device;

[0108] The running module 503 is configured to run the virtual machine on the second physical device according to the second state information.

[0109] In a possible implementation, the above-mentioned standard storage method is specifically a structure.

[0110] In a possible implementation, the various status information mentioned above may include one or more of feature bits, resource configuration, queue status, or may include other types of information, and the status information refers to the above-mentioned first status information, second status information or third status information.

[0111] Since the virtual machine hot migration device 500 shown in Figure 5 corresponds to the virtual machine hot migration device 203 in the embodiment shown in Figure 2 above, the specific implementation method of the virtual machine hot migration device 500 shown in Figure 5 and its technical effects can be found in the relevant description of the embodiment shown in Figure 2 above, and will not be repeated here.

[0112] 6 , which shows a schematic diagram of the structure of a virtual machine hot migration device. The virtual machine hot migration device 600 shown in FIG6 can be applied to the above-mentioned physical device 100. As shown in FIG6 , the virtual machine hot migration device 600 includes:

[0113] An acquisition module 601 is configured to acquire first status information, where the first status information indicates a usage status of hardware in the first physical device when the virtual machine is running on the first physical device. The first status information is information of a first storage mode that can be recognized by the first physical device.

[0114] The conversion module 602 is used to convert the first state information to obtain third state information in a standard storage mode;

[0115] The communication module 603 is configured to send the third state information of the standard storage mode to the second physical device.

[0116] In a possible implementation, the above-mentioned standard storage method is specifically a structure.

[0117] In a possible implementation, the communication module 601 is further configured to:

[0118] Memory data is sent to the second physical device in a memory dirty marking manner, where the memory data is data cached in the memory of the first physical device when the virtual machine is running.

[0119] In a possible implementation, the various status information mentioned above may include one or more of feature bits, resource configuration, queue status, or may include other types of information, and the status information refers to the above-mentioned first status information, second status information or third status information.

[0120] Since the virtual machine hot migration device 600 shown in Figure 6 corresponds to the virtual machine hot migration device 103 in the embodiment shown in Figure 2 above, the specific implementation method of the virtual machine hot migration device 600 shown in Figure 6 and its technical effects can be found in the relevant description of the embodiment shown in Figure 2 above, and will not be repeated here.

[0121] FIG7 is a schematic diagram of the hardware structure of a computing device 700 provided in the present application. The computing device 700 can, for example, implement the virtual machine hot migration device 103 or the virtual machine hot migration device 203 in the embodiment shown in FIG2 .

[0122] As shown in Figure 7, the computing device 700 includes a processor 701, a memory 702, and a communication interface 703. The processor 701, the memory 702, and the communication interface 703 communicate via a bus 704, and may also communicate via other means such as wireless transmission. The memory 702 is used to store instructions, and the processor 701 is used to execute the instructions stored in the memory 702. Furthermore, the computing device 700 may also include a memory unit 705, and the memory unit 705 may be connected to the processor 701, the storage medium 702, and the communication interface 703 via a bus 704. The memory 702 stores program code, and the processor 701 may call the program code stored in the memory 702 to perform the following operations:

[0123] receiving third state information of the standard storage mode, where the third state information of the standard storage mode is used to indicate a usage state of hardware in the first physical device when the virtual machine runs on the first physical device;

[0124] Converting the third state information of the standard storage mode to obtain second state information, where the second state information is information of the second storage mode that can be recognized by the second physical device;

[0125] The virtual machine is run on the second physical device according to the second state information.

[0126] Alternatively, the processor 701 may call the program code stored in the memory 702 to perform the following operations:

[0127] Obtaining first status information, where the first status information is used to indicate a usage status of hardware in the first physical device when the virtual machine is running on the first physical device, and the first status information is information of a first storage mode that can be recognized by the first physical device;

[0128] Converting the first state information to obtain third state information in a standard storage manner;

[0129] The third state information of the standard storage mode is sent to the second physical device.

[0130] It should be understood that in the embodiment of the present application, the processor 701 may be a CPU, or may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete device components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0131] The memory 702 may include a read-only memory and a random access memory, and provides instructions and data to the processor 701. The memory 702 may also include a nonvolatile random access memory.

[0132] The memory 702 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. The nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0133] The communication interface 703 is used to communicate with other devices connected to the computing device 700. The bus 704 includes not only a data bus, but also a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as bus 704 in the figure.

[0134] It should be understood that the computing device 700 according to the embodiment of the present application may correspond to the virtual machine hot migration device 500 or the virtual machine hot migration device 600 in the embodiment of the present application, and may correspond to executing the method executed by the virtual machine hot migration device 103 in the method shown in Figure 2 in the embodiment of the present application, or correspond to executing the method executed by the virtual machine hot migration device 203 in the method shown in Figure 2 in the embodiment of the present application. The above-mentioned and other operations and / or functions implemented by the computing device 700 are respectively for implementing the process of the corresponding method in Figure 2. For the sake of brevity, they will not be repeated here.

[0135] The present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device, or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-described virtual machine hot migration method.

[0136] The present application also provides a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the computer program product fully or partially generates the process or function described in the present application.

[0137] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, or data center to another website, computer, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0138] The computer program product may be a software installation package. When any of the aforementioned virtual machine live migration methods is required, the computer program product may be downloaded and executed on a computing device.

[0139] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.

[0140] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A virtual machine hot migration method, characterized in that: The method comprises: The first physical device acquires first status information, where the first status information is used to indicate a usage status of hardware in the first physical device when the virtual machine is running on the first physical device, and the first status information is information of a first storage mode that can be recognized by the first physical device; The first physical device converts the first state information to obtain third state information in a standard storage manner; The first physical device sends third state information of the standard storage mode to the second physical device; The second physical device converts the third state information of the standard storage mode to obtain second state information, where the second state information is information of the second storage mode that can be recognized by the second physical device; The second physical device runs the virtual machine on the second physical device according to the second state information.

2. The method according to claim 1, characterized in that The standard storage method is a structure.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: The first physical device sends memory data to the second physical device by marking the memory dirty, and the memory data is data cached in the memory of the first physical device when the virtual machine is running.

4. The method according to any one of claims 1 to 3, characterized in that: The state information includes one or more of a feature bit, a resource configuration, and a queue state, and the state information includes the first state information, the second state information, or the third state information.

5. A virtual machine hot migration method, characterized in that: The method comprises: The second physical device receives third status information of the standard storage method, where the third status information of the standard storage method is used to indicate a usage status of hardware in the first physical device when the virtual machine runs on the first physical device; The second physical device converts the third state information of the standard storage mode to obtain second state information, where the second state information is information of the second storage mode that can be recognized by the second physical device; The second physical device runs the virtual machine on the second physical device according to the second state information.

6. A virtual machine hot migration method, characterized in that: The method comprises: The first physical device acquires first status information, where the first status information is used to indicate a usage status of hardware in the first physical device when the virtual machine is running on the first physical device, and the first status information is information of a first storage mode that can be recognized by the first physical device; The first physical device converts the first state information to obtain third state information in a standard storage manner; The first physical device sends the third state information of the standard storage mode to the second physical device.

7. A virtual machine hot migration system, characterized in that: The system includes a first physical device and a second physical device; The first physical device is used to obtain first state information, where the first state information is used to indicate the use state of the hardware in the first physical device when the virtual machine runs on the first physical device, and the first state information is information of a first storage method that can be recognized by the first physical device; convert the first state information to obtain third state information of a standard storage method; and send the third state information of the standard storage method to the second physical device; The second physical device is used to receive the third state information of the standard storage method; convert the third state information of the standard storage method to obtain second state information, where the second state information is information of the second storage method that can be recognized by the second physical device; and run the virtual machine on the second physical device according to the second state information.

8. The system according to claim 7, characterized in that The standard storage method is a structure.

9. The system according to claim 7 or 8, characterized in that: The first physical device is further used for: Memory data is sent to the second physical device in a memory dirty marking manner, where the memory data is data cached in the memory of the first physical device when the virtual machine is running.

10. The system according to any one of claims 7 to 9, characterized in that: The state information includes one or more of a feature bit, a resource configuration, and a queue state, and the state information includes the first state information, the second state information, or the third state information.

11. A virtual machine hot migration device, characterized in that: The device comprises: A communication module, used for receiving third status information of the standard storage mode, wherein the third status information of the standard storage mode is used for indicating a usage status of hardware in the first physical device when the virtual machine runs on the first physical device; A conversion module, used for converting the third state information of the standard storage mode to obtain second state information, where the second state information is information of the second storage mode that can be recognized by the second physical device; An operating module is used to operate the virtual machine on the second physical device according to the second state information.

12. A virtual machine hot migration device, characterized in that: The device comprises: An acquisition module, configured to acquire first status information, wherein the first status information is used to indicate a usage status of hardware in the first physical device when the virtual machine is running on the first physical device, and the first status information is information of a first storage mode that can be recognized by the first physical device; A conversion module, used for converting the first state information to obtain third state information in a standard storage mode; The communication module is used to send the third state information of the standard storage mode to the second physical device.

13. A computing device, characterized in that: Including processor and memory; The processor is configured to execute instructions stored in the memory so as to enable the computing device to perform the steps of the method according to claim 5 or 6.

14. A computer-readable storage medium, characterized in that: The method comprises instructions which, when executed on a computing device, cause the computing device to perform the steps of the method as claimed in claim 5 or 6.

Citation Information

Patent Citations

  • Data processing method used in cross-data-center live migration process of virtual machine

    CN103885830A

  • Virtual machine instance live migration method

    CN114691300A

  • Container thermal migration method and container thermal migration device

    CN114968477A

  • Coalescing virtual machines to enable optimum performance

    US20120167083A1