Virtual machine live migration method, device and system and related equipment
By defining standard storage methods, the hardware usage status information of virtual machines between heterogeneous physical devices is standardized, which solves the migration problem between heterogeneous devices and realizes efficient virtual machine thermal migration and privacy protection.
Patent Information
- Application Number
- CN202310954585.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-31
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art is difficult to realize the thermal migration of virtual machines between heterogeneous physical devices, mainly because the physical devices of different hardware manufacturers adopt different storage methods, making it difficult to accurately identify and restore the hardware usage status.
By defining a standard storage method, the hardware usage status information of the virtual machine when it runs on the first physical device can be converted to the standard storage method, and is converted accordingly on the second physical device to identify and restore the virtual machine. running status.
The virtual machine's thermal migration between heterogeneous physical devices is realized, reducing users' perception of the migration process, and protecting the privacy of storage methods in various physical devices.
Smart Images

Figure CN119440711A_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] With the development of virtualization technology, virtual machines (VMs) are increasingly widely used. In actual application scenarios, it may be necessary to migrate a running VM on a physical device to another physical device through hot migration to reduce the interruption time of the VM services and reduce the user's perception of the VM migration.
[0003] 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 is first obtained, and the usage status of the hardware is sent to physical device 2 so that physical device 2 can resume the operation of the virtual machine based on the usage status.
[0004] 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 are 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 of the same content, and 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.
[0005] Therefore, there is an urgent need for a method for implementing hot migration of virtual machines between multiple heterogeneous physical devices. Summary of the invention
[0006] 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 device, system, computing device, computer readable storage medium and computer program product.
[0007] In a 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 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 data that can be recognized by the two physical devices, etc., wherein the storage method of data can define the physical device recording The first physical device converts the first state information after acquiring the first state information to obtain third state information of a standard storage method, where the standard storage method 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; correspondingly, the second physical device converts the received 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 runs a virtual machine on the second physical device according to the second state information.
[0008] In this way, during the process of hot migration of a virtual machine between two physical devices, although the two physical devices cannot know each other's data storage method, the information on 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, which 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 can be recognized by the second physical device, thereby identifying the hardware usage status of the virtual machine on the first physical device, so that the second physical device can restore the virtual machine operation on the second physical device according to 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 migration of virtual machines, the data storage method of each physical device may not be known by the other physical device, thereby realizing privacy protection of the storage method in each physical device.
[0009] In a possible implementation, the standard storage method is a structure, that is, the values of multiple members defined in the structure can indicate the usage status of the virtual machine for each hardware on the first physical device. In this way, the first physical device and the second physical device can realize the transmission of status information between the two physical devices based on the structure.
[0010] In a possible implementation, the first physical device can also send memory data to the second physical device by marking the memory dirty, and the memory data is the data cached in the memory of the first physical device when the virtual machine is running. In this way, when the virtual machine resumes running on the second physical device, it can continue to execute the corresponding business based on the data in the memory, thereby reducing the impact of memory data migration on virtual machine hot migration and further reducing the user's perception of virtual machine hot migration.
[0011] In a possible implementation, the various state information mentioned above may include one or more of a feature bit, resource configuration, and queue state, and the state information refers to the first state information, the second state information, or the third state information. Alternatively, the state information may also include other types of information.
[0012] In the second aspect, the present application provides a method for hot migration of a virtual machine. Specifically, the second physical device receives the third state information of the standard storage method, and the third state information of the standard storage method is used to indicate the use state 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 the second state information, and the second state information is the information of the second storage method 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. 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 use state of the virtual machine on 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 according to the use state of the hardware, thereby realizing hot migration of the virtual machine between two heterogeneous physical devices.
[0013] In 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 use state of 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 can be recognized by the first physical device; 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 enable the second physical device to recognize the use state of the virtual machine for the hardware on the first physical device by converting the first state information into the third state information of a standard storage method supported and recognized by the second physical device, so as to restore the operation of the virtual machine on the second physical device according to the use state, thereby realizing hot migration of the virtual machine between two heterogeneous physical devices.
[0014] 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.
[0015] In a possible implementation, the standard storage method is a structure.
[0016] In a possible implementation, the first physical device is further used 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.
[0017] In a possible implementation, the various state information mentioned above includes one or more of a feature bit, a resource configuration, and a queue state, and the state information refers to the first state information, the second state information, or the third state information.
[0018] 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.
[0019] 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.
[0020] 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 used to execute instructions stored in the memory so that the computing device executes the virtual machine hot migration method as described in the second aspect or the third aspect. It should be noted that the memory can be integrated into the processor or can be independent of the processor. The computing device may also include a bus. The processor is connected to the memory via the bus. The memory may include a readable memory and a random access memory.
[0021] In an eighth aspect, the present application provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, 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 aspect or the third aspect above.
[0022] 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.
[0023] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A schematic diagram of the architecture of an exemplary virtual machine hot migration system provided in this application;
[0025] Figure 2 A flowchart of a virtual machine hot migration method provided in this application;
[0026] Figure 3 A schematic diagram of the architecture of another exemplary virtual machine hot migration system provided in this application;
[0027] Figure 4 A flowchart of another virtual machine hot migration method provided in this application;
[0028] Figure 5 A schematic diagram of the structure of a virtual machine hot migration device provided in this application;
[0029] Figure 6 A schematic diagram of the structure of another virtual machine hot migration device provided in this application;
[0030] Figure 7 A schematic diagram of the hardware structure of a computing device provided for this application. DETAILED DESCRIPTION
[0031] In order to realize hot migration of a virtual machine between two heterogeneous physical devices, the present application provides a method for hot migration of a virtual machine, which transmits information indicating the hardware usage status of the virtual machine when running on a first physical device to a second physical device through a standard storage method, so that the second physical device can identify the hardware usage status of the virtual machine based on the status information of the standard storage method, and thus can resume the operation of the virtual machine on the second physical device according to the hardware usage status, thereby realizing hot migration of the virtual machine between two heterogeneous physical devices.
[0032] The technical solution in the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0033] See also Figure 1 , is a schematic diagram of the architecture of an exemplary virtual machine hot migration system provided in an embodiment of the present application. The virtual machine hot migration system 10 includes multiple physical devices, Figure 1 The physical device 100 and the physical device 200 are used as an example for illustration, and the physical device 100 and the physical device 200 can communicate with each other through a high-speed interconnection network.
[0034] Both the physical device 100 and the physical device 200 may be computing devices including a processor, such as a server, etc. 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. In addition, the number of processors included in the physical device may be one or more, and the type of processors included may be one or more. Specifically, the number and type of processors may be set according to the business requirements of the actual application, and this embodiment does not limit this.
[0035] Furthermore, the physical device 100 and the physical device 200 may be two heterogeneous physical devices, which specifically refers 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, respectively, while the data content recorded by the physical device 200 is data b and data a, respectively, 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.
[0036] like Figure 1 As shown, the physical device 100 may include a software layer 101 and a hardware layer 102 .
[0037] 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, the hardware layer 102 can be accessed through the kernel-based virtual machine (kernel-based virtual machine, KVM) 1013 (an open source system virtualization kernel driver module) in the kernel 1012.
[0038] 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. Among them, PCIe devices refer to devices that can be inserted into the PCIe slot 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 may not be aware of the location of the hardware in the hardware layer 102, and can access the cloud device just like accessing local hardware.
[0039] In addition, the physical device 100 also includes a virtual machine hot migration device 103, which is used to collect information on the physical device 100 and transmit 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, such as 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.
[0040] The architecture of the physical device 200 is similar to that of the physical device 100. Figure 1 The related description of the above-mentioned physical device 100 will not be repeated here.
[0041] 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.
[0042] During the process of hot migration of virtual machine 1011, virtual machine hot migration device 103 collects the usage status of hardware in hardware layer 102 when virtual machine 1011 is running on physical device 100, such as access status to hard disk (such as progress of reading / writing data), usage status of PCIe device, etc. The collected usage status can be cached as status information of the first storage mode that can be accurately identified by physical device 100, hereinafter referred to as first status information.
[0043] 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 to be known by the physical device 100, 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.
[0044] 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 referred to as the second state information below. Since the second state information can indicate the usage status of the virtual machine 1011 for the hardware, the virtual machine hot migration device 203 can resume the operation of the virtual machine 1011 on the physical device 200 according to the second state information.
[0045] In this way, during the hot migration of virtual machine 1011 between two physical devices, although the two physical devices cannot know each other's data storage method, 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, which enables physical device 200 to convert the information of the standard storage method to obtain the second state information of the second storage method that can be recognized by physical device 200, thereby realizing the recognition of 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 the 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 from privacy, that is, the way each physical device stores data can be kept from being known by the other physical device.
[0046] It is worth noting that the above Figure 1 The virtual machine hot migration system 10 shown is only used as an exemplary description and is not intended to be limiting. For example, in other possible virtual machine hot migration systems, a larger number of physical devices may be included, and virtual machines running on the physical device 100 and the physical device 200 may be hot migrated to other physical devices; or, in other possible virtual machine hot migration systems, the physical device 100 (and the physical device 200) may also include more functional modules. The present application does not limit the specific architecture of the virtual machine hot migration system 10 and the physical devices included therein.
[0047] For ease of understanding, an embodiment of the virtual machine hot migration method provided by the present application is described below in conjunction with the accompanying drawings.
[0048] See also Figure 2 , Figure 2 A flow chart of a virtual machine hot migration method provided in an embodiment of the present application, which can be applied to Figure 1 The virtual machine hot migration system 10 may be applied to other applicable virtual machine hot migration systems. Figure 1 The virtual machine hot migration system 10 shown is taken as an example for exemplary description.
[0049] in, Figure 2 The virtual machine hot migration method shown may specifically include:
[0050] S201: The virtual machine hot migration device 103 obtains first status information, where the first status information 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 mode that can be recognized by the physical device 100.
[0051] 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.
[0052] As a first example, the hot migration condition may specifically be receiving instruction information from a user to perform hot migration on a virtual machine. For example, when the number of virtual machines 1011 running on the physical device 100 is too large, or the host operating system in the physical device 100 needs to be upgraded and restarted, or the physical device 100 needs to be powered off for maintenance, the user may perform a trigger operation on the physical device 100 to perform hot migration on the virtual machine 1011, so that the physical device 100 responds to the trigger operation and starts to perform the hot migration process on the virtual machine 1011.
[0053] 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 a 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 a hot migration process for the virtual machine 1011.
[0054] After determining to start hot migration of virtual machine 1011, virtual machine hot migration device 103 can stop running virtual machine 1011 and collect the usage status of hardware in hardware layer 102 when virtual machine 1011 is currently running. The usage status can indicate the hardware required for virtual machine 1011 to use during the 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.
[0055] 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.
[0056] Generally, the hardware usage status of the virtual machine 1011 can usually reflect the operation status of the virtual machine 1011, so that the hardware usage status can be used to restore the virtual machine 1011 to run on other physical devices. For example, the data reading and writing progress of the virtual machine 1011 can be determined based on the queue usage status of the virtual machine 1011, so that in the process of restoring the operation of the virtual machine 1011, data can be continued to be read / written in the queue based on the queue usage status.
[0057] 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.
[0058] S202: The virtual machine hot migration device 103 converts the first state information to obtain third state information in a standard storage manner.
[0059] S203 : the virtual machine hot migration apparatus 103 sends the third state information of the standard storage method to the physical device 200 .
[0060] Normally, two heterogeneous physical devices may find it difficult to know each other's data storage method. For example, when the physical device 100 and the physical device 200 are produced by different hardware manufacturers, each hardware manufacturer may not publicly announce the data storage method used by the physical devices it produces. Therefore, in order to enable the physical device 200 to identify the hardware usage status of the virtual machine 1011 from the received information, in this embodiment, a common data storage method, that is, a standard storage method, can be defined between the physical device 100 and the physical device 200. The standard storage method defines a unified data length and data content layout, such as defining the data length corresponding to the usage status of each hardware, and the arrangement order of the usage status of each hardware state in the third state information of the standard storage method. In addition, the physical device 100 and the physical device 200 can convert data between the standard storage method and the storage method that each can recognize.
[0061] As an implementation example, the standard storage method can be, for example, a predefined structure. The structure refers to structured data composed of a group of data, and each data constituting the structured data can be called a member. In this embodiment, multiple 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.
[0062] The above implementation example is an illustrative description using the standard storage method as a structure. In other implementation examples, the standard storage method may also be implemented in other ways, for example, the standard storage method may also be implemented through an array or a table, etc. This implementation does not limit this.
[0063] After obtaining the third state information of the standard storage method, the virtual machine hot migration device 103 can send it to the physical device 200, so that the physical device 200 can restore the operation of the virtual machine 1011 according to the third state information.
[0064] Exemplarily, 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, and the physical device specified by the user is the physical device 200 in this embodiment.
[0065] Alternatively, the physical device to which the virtual machine 1011 is to be migrated may be a pre-configured default physical device. For example, in the virtual machine hot migration system 10, the physical device 200 may be configured as a disaster recovery for the physical device 100. Thus, when hot migrating the virtual machine 1011 on the physical device 100, the virtual machine hot migration device 102 may automatically migrate the virtual machine 1011 to the physical device 200 pre-configured for it.
[0066] Alternatively, the physical device to which the virtual machine 1011 is to be migrated may be determined by the physical device 100 after negotiation with other devices. For example, when the virtual machine hot migration system 10 includes more than 3 (including 3) physical devices, before hot migrating the virtual machine 1011 on the physical device 100, the physical device 100 may first negotiate with multiple other physical devices to select a physical device for carrying the virtual machine 1011 from the multiple physical devices, and the selected physical device is the physical device 200 in this embodiment.
[0067] In actual application, since the virtual machine 1011 usually uses the memory in the physical device 100 to read and write data during operation, and when it is determined to perform hot migration on the virtual machine 1011, the memory of the physical device 100 may store data written by the virtual machine 1011 during operation and has not yet completed persistent storage. Therefore, the virtual machine hot migration device 103 can also send the data in the memory allocated to the virtual machine 1011 to the physical device 200, so that the physical device 200 can restore the data in the memory for the virtual machine 1011 when resuming the operation of the virtual machine 1011.
[0068] As an implementation example, Figure 2As shown, 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 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. In 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, and then the virtual machine 1011 migrates the new dirty page data to the physical device 200. By continuously iterating the above process, when the amount of remaining unmigrated dirty page data is less than the threshold, the virtual machine 1011 is stopped, and all the remaining dirty page data are migrated to the physical device 200. In this way, the migration of memory data can be completed during the operation of the virtual machine 1011, 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.
[0069] S204: The virtual machine hot migration device 203 converts the received 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 physical device 200.
[0070] 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 according to the value of each member in the structure, so that the physical device 200 can recognize the information content indicated by the data, that is, recognize the usage status of the virtual machine 1011 for each hardware.
[0071] S205: The virtual machine hot migration device 203 runs the virtual machine 1011 to be hot migrated on the physical device 200 according to the second state information.
[0072] In specific implementation, the virtual machine hot migration device 203 can create a virtual machine in advance, and the created virtual machine has the same configuration as the virtual machine 1011 on the physical device 100. For example, before hot migration of the virtual machine 1011, the virtual machine hot migration device 203 can create a virtual machine according to 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 according to the use state of the virtual machine 1011 for the hardware indicated by the second state information. At this time, the virtual machine running on the physical device 200 can continue to perform the service provided by the virtual machine 1011 when it is suspended according to the second state information, which is equivalent to the virtual machine 1011 continuing to run on the physical device 200, thereby realizing the hot migration of the virtual machine 1011 from the physical device 100 to the physical device 200.
[0073] In this embodiment, during the hot migration of virtual machine 1011 from physical device 100 to physical device 200, although the two physical devices cannot know each other's data storage method, the information on the usage status of the hardware when virtual machine 1011 is running on physical device 100 can be transmitted between the two physical devices through a standard storage method, which enables physical device 200 to convert the information of the standard storage method to obtain the second state information of the second storage method that can be recognized by physical device 200, thereby identifying the usage status of the hardware of virtual machine 1011 on physical device 100, so that physical device 200 can resume the operation of virtual machine 1011 on physical device 200 according to the usage status of the hardware, thereby realizing hot migration of virtual machine 1011 between two heterogeneous physical devices.
[0074] 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 combination with a specific scenario.
[0075] See also Figure 3 as well as Figure 4 ,in, Figure 3 A schematic diagram of the structure of another virtual machine hot migration system 30 is shown. Figure 4 A schematic flow chart of another virtual machine hot migration method is shown.
[0076] Among them, Figure 3 As shown, in Figure 1 Based on the virtual machine hot migration system 10 shown, Figure 3In the virtual machine hot migration system 30 shown, the software layer 101 in the physical device 100 may also include a quick emulator (QEMU) 104, and QEMU104 runs in the user state of the host operating system. Among them, QEMU104 is an open source emulator software that can realize hardware virtualization. QEMU104 may include a general virtio data path acceleration device (virtiodata 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 realize the status reading and setting of the virtio device. The kernel 1012 also includes a virtual host framework (vhost framework) 1014 and a vDPA framework 1015, which are used to provide a unified interface for user space and kernel space to use the hardware in the hardware layer 102. Furthermore, the vDPA framework 1015 includes at least one vDPA device. Figure 3 The vDPA device 11 and the vDPA device 12 are used as examples for explanation. Each vDPA device can access the hardware in the hardware layer 102 through the corresponding vDPA driver, wherein the hardware in the hardware layer 102 can be semi-virtualized as a virtio (virtual input / output) device.
[0077] 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 .
[0078] The physical device 200 has a similar architecture to the physical device 100. Figure 3 The above descriptions about the physical device 100 will not be repeated here.
[0079] See also Figure 4 , Figure 4 The provided virtual machine hot migration method may specifically include:
[0080] S401 : QEMU 204 creates a virtual machine on the physical device 200 , and the virtual machine has the same configuration as the virtual machine 1011 on the physical device 100 .
[0081] 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.
[0082] Among them, the specific implementation process of QEMU104 migrating dirty pages in the memory to the physical device 200 can be found in the above-mentioned related descriptions and will not be repeated here.
[0083] S403: QEMU 104 stops the virtual machine 1011, deactivates the virtio device in the hardware layer 102, and sends a command to obtain the usage status of the virtio device to the general vDPA device 1041.
[0084] 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.
[0085] S405 : The virtual host framework 1014 sends the command to the vDPA framework 1015 .
[0086] 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 .
[0087] Exemplarily, the usage status of the virtio device may include information such as feature bits, resource configuration, and queue status, or may include other types of information, which is not limited thereto.
[0088] 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.
[0089] S408 : The vDPA device 11 and the vDPA device 12 use the corresponding vDPA driver to convert the acquired first state information of the first storage mode to obtain the third state information of the standard storage mode, and feed it back to QEMU 104 .
[0090] Among them, the vDPA device 11 and the vDPA device 12 can feedback the third state information of the standard storage method to QEMU104 through the vDPA framework 1015, the virtual host framework 1014, and the general vDPA device 1041.
[0091] S409: QEMU 104 sends the third status information of the standard storage mode to the physical device 200.
[0092] Exemplarily, the standard storage method may specifically be a structure.
[0093] S410: QEMU 204 sends a command for setting the usage status of the virtio device to the vDPA framework 2015, where the command includes the third status information of the standard storage method.
[0094] 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 .
[0095] S411 : The vDPA framework 2015 sends the command to the vDPA device 21 and the vDPA device 22 .
[0096] 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.
[0097] S413: QEMU204 starts and runs the virtual machine according to the usage status of each virtio device in the hardware layer 202.
[0098] In this way, hot migration of the virtual machine 1011 on the physical device 100 to the physical device 200 can be achieved.
[0099] 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, the physical device 200 can 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 operation of the virtual machine 1011 can be restored 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.
[0100] Furthermore, during the hot migration of the virtual machine 1011 on the physical device 100, the use status of all virtio devices can be directly obtained through the vDPA driver after the virtual machine 1011 is stopped, so that the virtual machine 1011 will not be affected when it is in the running stage (that is, there will be no performance degradation due to the upcoming hot migration), ensuring the business processing efficiency of the virtual machine 1011. In addition, the physical device 200 can send the use status of all virtio devices at one time and configure them to the hardware layer 202, which can speed up the recovery efficiency of the virtual machine, effectively reduce the business interruption time on the virtual machine, and further reduce the user's perception of the hot migration of the virtual machine.
[0101] 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 the fact that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by this application.
[0102] Combination of the above Figures 1 to 4 A virtual machine hot migration method provided in an embodiment of the present application is introduced, and then the structure of a virtual machine hot migration device and a computing device provided in an embodiment of the present application are introduced in conjunction with the accompanying drawings.
[0103] See also Figure 5 , shows a schematic diagram of the structure of a virtual machine hot migration device. Figure 5 The virtual machine hot migration device 500 shown can be applied to the above-mentioned physical device 200, such as Figure 5 As shown, the virtual machine hot migration device 500 includes:
[0104] The communication module 501 is used to receive third state information of the standard storage method, where the third state information of the standard storage method is used to indicate a usage state of the hardware in the first physical device when the virtual machine runs on the first physical device;
[0105] The conversion module 502 is used to convert the third state information of the standard storage mode to obtain the second state information, where the second state information is the information of the second storage mode that can be recognized by the second physical device;
[0106] The running module 503 is used to run the virtual machine on the second physical device according to the second state information.
[0107] In a possible implementation manner, the above standard storage method is specifically a structure.
[0108] In a possible implementation, the various status information mentioned above may include one or more of feature bits, resource configurations, and queue status, or may include other types of information, and the status information refers to the first status information, the second status information, or the third status information.
[0109] because Figure 5 The virtual machine hot migration device 500 shown corresponds to the above Figure 2 The virtual machine hot migration device 203 in the embodiment shown, Figure 5 For the specific implementation of the virtual machine hot migration device 500 and its technical effects, see the above Figure 2 The description of the relevant parts in the illustrated embodiment will not be repeated here.
[0110] See also Figure 6 , shows a schematic diagram of the structure of a virtual machine hot migration device. Figure 6 The virtual machine hot migration device 600 shown can be applied to the above-mentioned physical device 100, such as Figure 6 As shown, the virtual machine hot migration device 600 includes:
[0111] An acquisition module 601 is used to acquire 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;
[0112] The conversion module 602 is used to convert the first state information to obtain the third state information in a standard storage mode;
[0113] The communication module 603 is used to send the third state information of the standard storage mode to the second physical device.
[0114] In a possible implementation manner, the above standard storage method is specifically a structure.
[0115] In a possible implementation manner, the communication module 601 is further configured to:
[0116] 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.
[0117] In a possible implementation, the various status information mentioned above may include one or more of feature bits, resource configurations, and queue status, or may include other types of information, and the status information refers to the first status information, the second status information, or the third status information.
[0118] because Figure 6The virtual machine hot migration device 600 shown corresponds to the above Figure 2 The virtual machine hot migration device 103 in the embodiment shown in the figure is Figure 6 For the specific implementation of the virtual machine hot migration device 600 and its technical effects, see the above Figure 2 The description of the relevant parts in the illustrated embodiment will not be repeated here.
[0119] Figure 7 The hardware structure diagram of a computing device 700 provided in this application is as follows. The computing device 700 can implement the above Figure 2 The virtual machine hot migration device 103 or the virtual machine hot migration device 203 in the illustrated embodiment, etc.
[0120] like Figure 7 As shown, 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:
[0121] receiving third state information of the standard storage method, where the third state information of the standard storage method is used to indicate a usage state of hardware in the first physical device when the virtual machine runs on the first physical device;
[0122] 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;
[0123] The virtual machine is run on the second physical device according to the second state information.
[0124] Alternatively, the processor 701 may call the program code stored in the memory 702 to perform the following operations:
[0125] Acquire 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;
[0126] Converting the first state information to obtain third state information in a standard storage manner;
[0127] The third state information of the standard storage mode is sent to the second physical device.
[0128] It should be understood that in the embodiment of the present application, the processor 701 may be a CPU, and the processor 701 may also 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.
[0129] 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.
[0130] The memory 702 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (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 dynamic random access memory (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).
[0131] The communication interface 703 is used to communicate with other devices connected to the computing device 700. The bus 704 may include a power bus, a control bus, a status signal bus, etc. in addition to a data bus. However, for the sake of clarity, various buses are labeled as bus 704 in the figure.
[0132] 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 the execution of the virtual machine hot migration device 500 or the virtual machine hot migration device 600 in the embodiment of the present application. Figure 2 The method performed by the virtual machine hot migration device 103 in the method shown, or corresponding to the execution according to the embodiment of the present application Figure 2 The method performed by the virtual machine hot migration device 203 in the method shown, the above and other operations and / or functions implemented by the computing device 700 are respectively to implement Figure 2 For the sake of brevity, the process of the corresponding method in will not be repeated here.
[0133] The embodiment of 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 the computing device or a data storage device such as a data center containing one or more available media. 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 (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned virtual machine hot migration method.
[0134] The embodiment of 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 process or function described in the embodiment of the present application is generated in whole or in part.
[0135] 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.
[0136] The computer program product may be a software installation package. When any of the aforementioned virtual machine hot migration methods is required, the computer program product may be downloaded and executed on a computing device.
[0137] 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 a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. 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 hard disk.
[0138] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope 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.