Virtual machine thermal migration system, method and device used in DPU environment and storage medium
By introducing a virtual machine hot migration system in the DPU environment, the shortcomings of unused memory processing, pre-checking and rollback mechanisms are solved, and efficient, stable and continuous hot migration process is achieved.
Patent Information
- Application Number
- CN202411755562.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
AI Technical Summary
The existing hot migration technology has unoptimized unused memory processing, lack of effective pre-checking mechanisms and lack of rollback mechanisms in the DPU environment, resulting in problems such as wasted bandwidth, increased migration time, increased error risk, migration failure and business interruption.
A virtual machine hot migration system is provided, including a source host, a destination host, a proxy module and a thermal migration control module. The proxy module collects the memory information of the virtual machine. The hot migration control module marks the memory data to be migrated based on the unused memory information, performs data migration, and performs pre-checking and rollback processing during the migration process to ensure the efficiency, stability and business continuity of the migration.
By intelligently handling unused memory, reduce data transmission, simplify migration processes, reduce network bandwidth burden, improve thermal migration efficiency, reduce failure risk, and ensure business continuity through pre-checking and rollback mechanisms.
Smart Images

Figure CN119668777A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of virtual machine (VM) hot migration, and in particular to a virtual machine hot migration system, method, device and storage medium for use in a smart network card (Data Processing Unit, DPU) environment. Background Art
[0002] With the development of cloud technology and big data technology, massive computing has become the mainstream. In order to unload the pressure of CPU, smart network card (Data Processing Unit, DPU) came into being. Smart network card generally has network card (NIC) and solid state storage device (SSD) or hard disk (HDD). Smart network card can provide network and storage as well as encryption and decryption functions. Figure 1 As shown, an existing DPU overall architecture diagram is shown:
[0003] In a DPU environment, if a virtual machine (VM) on a host (Host) is abnormal, or the host resources are insufficient or the hardware is abnormal, the VM on the host needs to be migrated online (hot migration). Hot migration is a technology that moves the VM from one physical host (source host) to another physical host (destination host) without interrupting its operation. Its advantage is that it can not interrupt the business, so that the applications or services inside the VM are basically unaware of the migration.
[0004] Hot migration technology is becoming increasingly important in the application scenarios of smart network cards. However, current hot migration technology usually copies all memory data of the entire VM, including unused (i.e. FREE) memory, to the destination VM. In actual applications, this unused memory may occupy 50%-70% of the total memory. Its migration not only wastes a lot of bandwidth, but also significantly increases the migration time and complexity, thereby reducing migration efficiency and increasing the risk of errors. For DPU scenarios, this technical deficiency seriously restricts the promotion and application of DPU.
[0005] In addition, the lack of an effective pre-check mechanism during hot migration is also a significant problem. Pre-check can timely discover and deal with environmental factors that may cause migration anomalies before and during migration, thereby effectively avoiding migration failure or unnecessary downtime. The lack of such a mechanism may not only lead to migration failure, but also waste valuable time resources and adversely affect the normal business operations of users.
[0006] Furthermore, in the actual application environment of DPU, due to the diversity of business scenarios, usage environments and hardware conditions, the hot migration process is often difficult to proceed completely according to the preset process. At this time, if there is no rollback mechanism for hot migration failure, once the migration is abnormal, it may cause unpredictable errors in the migrated VM, which will have a serious impact on user business and reduce the service quality and user experience of DPU.
[0007] In summary, the existing thermal migration technology solutions have the following main shortcomings:
[0008] Unused memory is not handled optimally, resulting in wasted bandwidth, increased migration time, and increased error probability;
[0009] Lack of effective pre-check mechanism, unable to timely detect and handle potential problems during the migration process;
[0010] There is no rollback mechanism for hot migration failure, which cannot ensure that the business can continue to operate normally when migration is abnormal.
[0011] These shortcomings have severely restricted the application and development of heat migration technology in DPU scenarios and urgently need to be improved and optimized. Summary of the invention
[0012] The technical problem to be solved by the present application is to provide a virtual machine hot migration system, method, device and storage medium for a DPU environment, which can improve the efficiency, stability and business continuity of hot migration.
[0013] To solve the above technical problems, as one aspect of the present application, a virtual machine hot migration system for a DPU environment is provided, which at least includes:
[0014] A source host, on which an active hypervisor is running and an active DPU device is configured, and the source hypervisor manages the source virtual machine to be migrated;
[0015] A destination host, on which a destination Hypervisor is running and a destination DPU device is configured, for using the destination Hypervisor to respond to a hot migration instruction sent by the source host through the source DPU device to establish a destination virtual machine, and receiving data to be migrated through the destination DPU device; the source host and the destination host communicate with each other using the destination DPU device and the source DPU device;
[0016] An agent module is deployed in a source virtual machine managed by a source hypervisor, and is used to receive a hot migration instruction from the source hypervisor and collect memory information of the source virtual machine, wherein the memory information includes information of unused memory;
[0017] The hot migration control module is configured on the source Hypervisor and is used to control the hot migration process, including: initiating a hot migration instruction, marking the memory data to be migrated at least according to the information of unused memory; executing the data migration operation and monitoring the data migration process; pausing the source virtual machine and starting the destination virtual machine after the migration is successful, and rolling back the hot migration in case of migration abnormality.
[0018] Wherein, the proxy module further includes:
[0019] A memory collection module is used to collect memory information of the source virtual machine according to the hot migration instruction of the source Hypervisor;
[0020] The communication module establishes communication with the source Hypervisor through a virtual dedicated device and sends the collected memory information to the source Hypervisor.
[0021] Wherein, the hot migration control module further includes:
[0022] An instruction issuing unit, used for issuing a hot migration instruction to the proxy module and the source DPU device, and sending the hot migration instruction to the destination Hypervisor of the destination host via the destination DPU device;
[0023] A data migration processing unit, used to mark the memory data to be migrated of the source virtual machine according to the information of the unused memory returned by the proxy module and the dirty page log recorded by the source DPU device, and perform a data migration operation to migrate the memory data to be migrated to the storage space corresponding to the destination virtual machine;
[0024] A pre-check startup unit is used to instruct the destination Hypervisor to pre-check the environment and configuration after the data migration is completed;
[0025] A pre-check result processing unit, configured to, when the pre-check result of the destination Hypervisor is passed, suspend the source virtual machine and send an instruction to start the destination virtual machine to the destination Hypervisor; if the pre-check result is that at least one abnormality exists, send a hot migration cancellation instruction to the destination Hypervisor;
[0026] The rollback processing unit is used to execute the hot migration rollback process when the destination Hypervisor fails to start the destination virtual machine, including: canceling the hot migration task of the destination Hypervisor; controlling the source Hypervisor to obtain the device status information and configuration saved at the beginning of the migration operation from the source DPU and load them into the corresponding device; and restoring the memory information from the memory snapshot, rolling back the source virtual machine to the state at the beginning of the migration operation, and continuing to run the source virtual machine.
[0027] Accordingly, the present application also provides a method for hot migration of a virtual machine in a DPU environment, which comprises the following steps:
[0028] The source Hypervisor of the source host issues a hot migration instruction to the proxy module and the source DPU device, and sends the hot migration instruction to the destination Hypervisor of the destination host via the destination DPU device;
[0029] The destination host responds to the hot migration instruction and starts a destination virtual machine through its destination Hypervisor;
[0030] The proxy module collects memory information of the source virtual machine and sends it to the source Hypervisor, wherein the memory information at least includes information of unused memory;
[0031] The source Hypervisor marks the memory data to be migrated according to the memory information returned by the proxy module and the dirty page log recorded by the source DPU device, and performs a data migration operation to migrate the memory data to the storage space corresponding to the destination virtual machine. The memory data does not include data corresponding to the information of unused memory.
[0032] Monitor the data migration process, pause the source virtual machine and start the destination virtual machine after the migration is successful, and perform a hot migration rollback operation if an exception occurs in the migration.
[0033] The proxy module collects the memory information of the virtual machine, including:
[0034] The proxy module counts the memory allocation information of the virtual machine through the kernel state module;
[0035] The proxy module sends the statistical memory allocation information to the source Hypervisor through the virtual dedicated device.
[0036] The hot migration process is monitored, and after the migration is successful, the source virtual machine is paused and the destination virtual machine is started, further comprising:
[0037] After the source Hypervisor completes sending the data to be migrated, it sends a pre-check instruction to the destination Hypervisor;
[0038] After receiving the pre-check instruction, the destination Hypervisor performs a data consistency check and checks whether the environment configuration is correct;
[0039] If all checks pass, the source Hypervisor pauses the source VM and sends a command to the destination Hypervisor to start the destination VM.
[0040] If at least one exception is detected, the source hypervisor sends a hot migration cancellation instruction to the target hypervisor.
[0041] Among them, the hot migration rollback operation is performed after an exception occurs in the migration, including:
[0042] When the destination Hypervisor fails to start the destination virtual machine, the hot migration rollback process is executed, including: canceling the hot migration task of the destination Hypervisor; controlling the source Hypervisor to obtain the device status information and configuration saved at the beginning of the migration operation from the source DPU and load them into the corresponding device; and restoring the memory information from the memory snapshot, rolling back the source virtual machine to the state at the beginning of the migration operation, and continuing to run the source virtual machine.
[0043] The hot migration process also includes:
[0044] The source Hypervisor records the memory of the virtual machine with dirty pages;
[0045] After receiving the hot migration instruction, the source DPU device marks the memory dirty page;
[0046] The source Hypervisor determines the memory data that needs to be migrated based on the memory information returned by the proxy module and the dirty page information marked by the source DPU device.
[0047] Save the status information and configuration of the device that needs to be migrated to the source DPU;
[0048] Generate a snapshot of the modified memory content corresponding to the source Hypervisor.
[0049] Accordingly, as another aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned method are implemented.
[0050] Correspondingly, as another aspect of the present application, there is also provided an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the functions of the aforementioned system when executing the computer program.
[0051] Implementing this embodiment has the following beneficial effects:
[0052] The present application provides a virtual machine hot migration system, method, device and storage medium for a DPU environment, which intelligently obtains the memory and status information of the source virtual machine in the source Hypervisor and avoids copying memory data that does not need to be migrated (i.e., unused memory) according to the available memory situation. This reduces the amount of data transmission during hot migration, simplifies the migration process, reduces the burden of network bandwidth in the DPU environment, and thus improves the efficiency of hot migration and reduces the risk of failures that may occur during the migration process.
[0053] An agent module is deployed inside each virtual machine managed by the source hypervisor. The agent module can respond to the instructions of the hypervisor and actively collect and feedback the memory information of the virtual machine. This enhances the source hypervisor's ability to monitor the internal status of the source virtual machine and provides data support for efficient management.
[0054] At the critical stage of hot migration, a comprehensive status and configuration check is performed to ensure that the prerequisites for migration are met. This will identify and resolve potential migration obstacles in advance, significantly reducing hot migration failures and unnecessary system downtime caused by insufficient preparation.
[0055] By setting up a rollback mechanism, additional security can be provided for hot migration, ensuring business continuity and data integrity.
[0056] In summary, the implementation of this application can improve the efficiency, stability and business continuity of hot migration. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, without paying creative labor, other drawings obtained based on these drawings still belong to the scope of the present application.
[0058] Figure 1 This is a DPU overall architecture diagram in the prior art;
[0059] Figure 2 A schematic diagram of the structure of an embodiment of a virtual machine hot migration system for a DPU environment provided by the present application;
[0060] Figure 3 for Figure 2 A more detailed structural diagram of the Zhongyuan host;
[0061] Figure 4 for Figure 2 The schematic diagram of the structure of the agent module;
[0062] Figure 5 for Figure 2 A schematic diagram of the structure of the heat migration control module;
[0063] Figure 6 A schematic diagram of the main process of an embodiment of a method for hot migration of a virtual machine in a DPU environment provided by the present application;
[0064] Figure 7 A more detailed flowchart of the method of this application;
[0065] Figure 8 A schematic diagram of the pre-check process involved in the method of this application;
[0066] Fig. 9 A schematic diagram of the rollback process involved in the method of the present application. DETAILED DESCRIPTION
[0067] In order to make the objectives, technical solutions and advantages of the present application more clear, the present application will be further described in detail below in conjunction with the accompanying drawings.
[0068] like Figure 2 FIG. 1 is a schematic diagram showing a structure of an embodiment of a virtual machine hot migration system for a DPU environment provided by the present application; and FIG. Figures 3 to 5 As shown, in this embodiment, the virtual machine hot migration system for the DPU environment includes at least:
[0069] A source host 1, on which an active virtual machine monitoring module (source Hypervisor) 10 is running and an active DPU device 14 is configured, and the source Hypervisor 10 manages a source virtual machine 11 to be migrated;
[0070] The destination host 2 runs a destination virtual machine monitoring module (destination Hypervisor) 20 and is configured with a destination DPU device 24, which is used to use the destination Hypervisor to respond to the hot migration instruction sent by the source host 1 via the source DPU device to establish a destination virtual machine 21, and receive the data to be migrated through the destination DPU device, and the source host 1 and the destination host 2 communicate with each other using the destination DPU device 24 and the source DPU device 14;
[0071] An agent module (Agent) 12, deployed in a source virtual machine 11 managed by a source Hypervisor 10, for receiving a hot migration instruction from the source Hypervisor 10 and collecting memory information of the source virtual machine 11, wherein the memory data includes information of unused memory (free memory);
[0072] The hot migration control module 13 is configured on the source Hypervisor 10 and is used to control the hot migration process, including initiating a hot migration instruction, marking the memory data to be migrated based on at least the information of unused memory, and performing data migration operations; monitoring the hot migration process: pausing the source virtual machine and starting the destination virtual machine after the migration is successful, and rolling back the hot migration when the migration is abnormal.
[0073] It is understandable that in Figure 3 In the Hypervisor architecture diagram shown in Figure 1, Migration and dev are two important functional modules. The Migration module is responsible for implementing the hot migration function of the virtual machine to improve the availability and flexibility of the system; while the dev module is responsible for providing virtual hardware devices for the virtual machine and managing the interaction between the virtual machine and the hardware to achieve hardware independence and improve the performance of the virtual machine. The two modules work together to provide a stable, efficient and flexible operating environment for the virtual machine. At the same time, in the virtualization environment, the devices in the source VM (virtual machine) (see Figure 2 As shown in the figure, it usually refers to various virtual hardware devices assigned to the virtual machine. These virtual hardware devices are simulated by Hypervisor (virtual machine monitor) to provide a virtual machine with an operating environment similar to physical hardware.
[0074] More specifically, if Figure 4 As shown, the proxy module 12 further includes:
[0075] The memory acquisition module 120 is used to collect the memory information of the source virtual machine 11 according to the hot migration instruction of the source Hypervisor 10, and the memory information includes the information of the unused memory (Free memory); specifically, in actual application, an agent process (Agent) is started in advance in the source virtual machine. The hot migration instruction will notify the agent process, and the agent process will perform an environmental check and then start to collect the information of the unused memory of the source virtual machine; specifically, a kernel state module (such as Figure 3 As shown in Figure 1-1). The proxy module communicates with the kernel module through ioctl. When the proxy module receives the instruction to start hot migration from the source hypervisor, it sends a memory statistics instruction to the kernel module. The module will count the memory allocation information of the current source virtual machine, find the corresponding actual physical memory according to the page frame number (PFN) of the memory page, and then send the memory allocation information to the proxy module, which will return it to the source hypervisor.
[0076] The communication module 121, through a virtual dedicated device (such as Figure 3The dev device in the source Hypervisor 10 establishes communication with the source Hypervisor 10 and sends the collected memory information to the source Hypervisor 10.
[0077] More specifically, if Figure 5 As shown, the hot migration control module 13 further includes:
[0078] The instruction issuing unit 130 is used to issue a hot migration instruction to the proxy module and the source DPU device, and send the hot migration instruction to the destination Hypervisor of the destination host via the destination DPU device; it can be understood that the hot migration instruction is forwarded by the source DPU device to other hosts to find a destination host, and a new virtual machine (i.e., the destination virtual machine) is started on the destination host through its Hypervisor (i.e., the destination Hypervisor), and then the destination host notifies the source host to prepare for hot migration of the virtual machine on it;
[0079] The data migration processing unit 131 is used to mark the memory data to be migrated corresponding to the source virtual machine 11 according to the information of the unused memory returned by the proxy module 12 and the dirty page log recorded by the source DPU device 14, and perform a data migration operation to migrate the memory data to be migrated to the storage space corresponding to the destination virtual machine;
[0080] Specifically, when the source hypervisor sends a hot migration notification to the proxy module, it starts a hot migration processing thread on the hypervisor: the thread needs to notify the source DPU device to start the hot migration of the source virtual machine. And the source hypervisor needs to record the dirty page information (dirty memory) of the source virtual machine;
[0081] After receiving the hot migration instruction, the source DPU device will mark the memory dirty pages. In a virtualized environment, dirty page information specifically refers to those memory pages that have been modified but not yet synchronized to persistent storage (such as disk). The "dirty pages" here do not refer to all memory pages that have stored data, but specifically refer to those pages whose data has been modified but not yet refreshed.
[0082] The source Hypervisor marks which memory needs to be migrated based on the free memory information returned by the proxy module and the dirty page log recorded by the source DPU device. Then the hypervisor sends the memory that needs to be migrated to the destination Hypervisor based on the marked memory. The destination Hypervisor loads the received memory into the destination virtual machine.
[0083] The pre-check start unit 132 is used to instruct the destination Hypervisor 20 to pre-check the environment and configuration after the data migration is completed; specifically, when the source Hypervisor reaches a threshold according to the migrated memory, it sends a pre-check instruction to the destination Hypervisor to pre-check the environment and configuration. If there is no abnormality in the check, the source Hypervisor sends a pause instruction to the source DPU device and the source virtual machine, and then sends a start instruction to the destination Hypervisor. After receiving the start instruction, the destination Hypervisor starts the destination virtual machine and the destination DPU device.
[0084] The pre-check result processing unit 133 is used to suspend the source virtual machine and send an instruction to start the destination virtual machine to the destination Hypervisor when the pre-check result of the destination Hypervisor is passed; if the pre-check result is that there is at least one abnormality, send a hot migration cancellation instruction to the destination Hypervisor;
[0085] The rollback processing unit 134 is configured to execute a hot migration rollback process when the target Hypervisor 20 fails to start.
[0086] Specifically, if the destination hypervisor starts the destination virtual machine and the destination DPU device normally, the source hypervisor will stop the source virtual machine and notify the source DPU device. If the destination hypervisor starts the destination virtual machine abnormally, the destination hypervisor will cancel the startup task, and then the source hypervisor will issue a continue-running instruction to the source virtual machine and the source DPU device. The source hypervisor performs a rollback process and resumes normal operation.
[0087] Among them, the hot migration rollback process at least includes: controlling the source Hypervisor to obtain the device status information and configuration saved at the beginning of the migration operation from the source DPU, and loading it into the corresponding device; and restoring the memory information from the memory snapshot, rolling back the source virtual machine to the state at the beginning of the migration operation, and continuing to run the source virtual machine.
[0088] It is understandable that after the hot migration operation is completed, a proxy module also needs to be generated in the destination virtual machine 21 (see Figure 2 As shown in the dotted box in the figure), when the current destination host 2 has a need to perform hot migration to other destination hosts, the proxy module is used to implement the corresponding hot migration detection or monitoring function, and its function can be referred to and combined with the aforementioned description of the proxy module 12 in the source host 1.
[0089] like Figure 6FIG. 1 is a schematic diagram showing a main flow of an embodiment of a method for hot migration of a virtual machine in a DPU environment provided by the present application, and FIG. Figures 7 to 9 As shown, in this embodiment, the virtual machine hot migration method in the DPU environment includes at least the following steps:
[0090] Step S10, the source Hypervisor of the source host issues a hot migration instruction to the proxy module and the source DPU device, and sends the hot migration instruction to the destination Hypervisor of the destination host via the destination DPU device;
[0091] Step S11, the destination host responds to the hot migration instruction and starts a destination virtual machine through its destination Hypervisor;
[0092] Step S12, the proxy module collects memory information of the source virtual machine and sends it to the source Hypervisor, wherein the memory information at least includes information of unused memory;
[0093] Step S13, the source Hypervisor marks the memory data to be migrated according to the memory information returned by the proxy module and the dirty page log recorded by the source DPU device, and performs a data migration operation to migrate the memory data to the storage space corresponding to the destination virtual machine, wherein the memory data does not include data corresponding to the information of unused memory; the destination Hypervisor loads the memory data into the destination virtual machine;
[0094] Step S14, monitoring the data migration operation process, pausing the source virtual machine and starting the destination virtual machine after the migration is successful, and performing a hot migration rollback operation after an abnormality occurs in the migration.
[0095] In a specific example, in step S12, the step of the agent module collecting the memory information of the virtual machine further includes:
[0096] The agent module collects memory allocation information of the virtual machine through the kernel state module, and the memory allocation information at least includes information about unused memory. Specifically, in actual applications, an agent process (Agent) is started in advance in the source virtual machine. The hot migration instruction will notify the agent process, and the agent process will perform an environmental check and then start collecting information about unused memory of the source virtual machine. Specifically, a kernel state module (such as Figure 3As shown in Figure 1-1). The proxy module communicates with the kernel module through ioctl. When the proxy module receives the instruction to start hot migration from the source hypervisor, it sends a memory statistics instruction to the kernel module. The module will count the memory allocation information of the current source virtual machine, find the corresponding actual physical memory according to the page identification number of the memory page, and then send the memory allocation information to the proxy module, which will return it to the source hypervisor.
[0097] The proxy module sends the collected memory allocation information to the source Hypervisor through the virtual dedicated device. Figure 3 The dev device in the memory establishes communication with the source Hypervisor and sends the collected memory information to the source Hypervisor.
[0098] For a specific example, see Figure 7 As shown, in step S13, the hot migration process also includes the following steps:
[0099] The source Hypervisor records the memory of the virtual machine with dirty pages;
[0100] After receiving the hot migration instruction, the source DPU device marks the memory dirty page;
[0101] The source Hypervisor determines the memory data that needs to be migrated based on the memory information returned by the proxy module and the dirty page information marked by the source DPU device.
[0102] Save the status information and configuration of the device that needs to be migrated to the source DPU;
[0103] Generate a snapshot of the modified memory content corresponding to the source Hypervisor.
[0104] Specifically, when the source hypervisor sends a hot migration notification to the proxy module, it starts a hot migration processing thread on the hypervisor: the thread needs to notify the source DPU device to start the hot migration of the source virtual machine. And the source hypervisor needs to record the dirty page information (dirty memory) of the source virtual machine;
[0105] After receiving the hot migration instruction, the source DPU device will mark the memory dirty pages. In a virtualized environment, dirty page information specifically refers to those memory pages that have been modified but not yet synchronized to persistent storage (such as disk). The "dirty pages" here do not refer to all memory pages that have stored data, but specifically refer to those pages whose data has been modified but not yet refreshed.
[0106] The source Hypervisor marks which memory needs to be migrated based on the free memory information returned by the proxy module and the dirty page log recorded by the source DPU device. Then the hypervisor sends the memory that needs to be migrated to the destination Hypervisor based on the marked memory. The destination Hypervisor loads the received memory into the destination virtual machine.
[0107] For a specific example, see Figure 8 As shown, in step S14, the hot migration process is monitored, and after the migration is successful, the source virtual machine is paused and the destination virtual machine is started, further comprising:
[0108] After the source Hypervisor completes sending the data to be migrated, it sends a pre-check instruction to the destination Hypervisor. Specifically, when the source Hypervisor reaches a threshold according to the memory to be migrated, it sends the pre-check instruction to the destination Hypervisor.
[0109] After receiving the pre-check instruction, the destination Hypervisor performs a data consistency check and checks whether the environment configuration is correct;
[0110] If all checks are passed, the source Hypervisor pauses the source virtual machine and sends an instruction to start the destination virtual machine to the destination Hypervisor; specifically, if there is no abnormality in the check, the source Hypervisor sends a pause instruction to the source DPU device and the source source virtual machine, and then sends an instruction to start the destination virtual machine to the destination Hypervisor. After receiving the start instruction, the destination Hypervisor starts the destination virtual machine and the destination DPU device.
[0111] If at least one exception is detected, the source hypervisor sends a hot migration cancellation instruction to the target hypervisor.
[0112] Specifically, if the destination hypervisor starts the destination virtual machine and the destination DPU device normally, the source hypervisor will stop the source virtual machine and notify the source DPU device. If the destination hypervisor starts abnormally, the destination hypervisor will cancel the startup task, and then the source hypervisor will issue a continue-running instruction to the source virtual machine and the source DPU device. The source hypervisor will then perform a rollback process and resume normal operation.
[0113] For a specific example, see Fig. 9 As shown, in step S14, the step of performing a hot migration rollback operation after an abnormality occurs in the migration further includes:
[0114] When the destination Hypervisor fails to start the destination virtual machine, the hot migration rollback process is executed, including: canceling the hot migration task of the destination Hypervisor; controlling the source Hypervisor to obtain the device status information and configuration saved at the beginning of the migration operation from the source DPU and load them into the corresponding device; and restoring the memory information from the memory snapshot, rolling back the source virtual machine to the state at the beginning of the migration operation, and continuing to run the source virtual machine.
[0115] For more details, please refer to and combine Figures 2 to 5 As shown, no further description is given here.
[0116] As another aspect of the present application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following is implemented: Figures 2 to 5 The functions of the described system. For more details, please refer to and combine Figures 2 to 5 As shown, no further description is given here.
[0117] As another aspect of the present application, a computer-readable storage medium is further provided, on which a computer program is stored, and when the computer program is executed by a processor, the following is implemented: Figures 6 to 9 For more details, please refer to and combine Figures 6 to 9 As shown, no further description is given here.
[0118] Implementing this embodiment has the following beneficial effects:
[0119] The present application provides a virtual machine hot migration system, method, device and storage medium for a DPU environment, which intelligently obtains the memory and status information of the source virtual machine in the source Hypervisor and avoids copying memory data that does not need to be migrated (i.e., unused memory) according to the available memory situation. This reduces the amount of data transmission during hot migration, simplifies the migration process, reduces the burden of network bandwidth in the DPU environment, and thus improves the efficiency of hot migration and reduces the risk of failures that may occur during the migration process.
[0120] An agent module is deployed inside each virtual machine managed by the source hypervisor. The agent module can respond to the instructions of the hypervisor and actively collect and feedback the memory information of the virtual machine. This enhances the source hypervisor's ability to monitor the internal status of the source virtual machine and provides data support for efficient management.
[0121] At the critical stage of hot migration, a comprehensive status and configuration check is performed to ensure that the prerequisites for migration are met. This will identify and resolve potential migration obstacles in advance, significantly reducing hot migration failures and unnecessary system downtime caused by insufficient preparation.
[0122] By setting up a rollback mechanism, additional security can be provided for hot migration, ensuring business continuity and data integrity.
[0123] In summary, the implementation of this application can improve the efficiency, stability and business continuity of hot migration.
[0124] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0125] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0126] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A virtual machine hot migration system for a DPU environment, characterized in that: At least: A source host, on which an active hypervisor is running and an active DPU device is configured, and the source hypervisor manages the source virtual machine to be migrated; A destination host, on which a destination Hypervisor is running and a destination DPU device is configured, for using the destination Hypervisor to respond to a hot migration instruction sent by the source host via the source DPU device to establish a destination virtual machine, and receiving data to be migrated via the destination DPU device; the source host and the destination host communicate with each other using the destination DPU device and the source DPU device; An agent module is deployed in a source virtual machine managed by a source hypervisor, and is used to receive a hot migration instruction from the source hypervisor and collect memory information of the source virtual machine, wherein the memory information includes information of unused memory; The hot migration control module is configured on the source Hypervisor and is used to control the hot migration process, including: initiating a hot migration instruction, marking the memory data to be migrated based on at least the information of unused memory; executing the data migration operation and monitoring the data migration operation process; pausing the source virtual machine and starting the destination virtual machine after the migration is successful, and rolling back the hot migration in case of migration abnormality.
2. The system according to claim 1, characterized in that The proxy module further comprises: A memory collection module is used to collect memory information of the source virtual machine according to the hot migration instruction of the source Hypervisor; The communication module establishes communication with the source Hypervisor through a virtual dedicated device and sends the collected memory information to the source Hypervisor.
3. The system according to claim 2, characterized in that The thermal migration control module further comprises: An instruction issuing unit, used for issuing a hot migration instruction to the proxy module and the source DPU device, and sending the hot migration instruction to the destination Hypervisor of the destination host via the destination DPU device; A data migration processing unit, used to mark the memory data to be migrated of the source virtual machine according to the information of the unused memory returned by the proxy module and the dirty page log recorded by the source DPU device, and perform a data migration operation to migrate the memory data to be migrated to the storage space corresponding to the destination virtual machine; A pre-check startup unit is used to instruct the destination Hypervisor to pre-check the environment and configuration after the data migration is completed; A pre-check result processing unit, configured to, when the pre-check result of the destination Hypervisor is passed, suspend the source virtual machine and send an instruction to start the destination virtual machine to the destination Hypervisor; if the pre-check result is that at least one abnormality exists, send a hot migration cancellation instruction to the destination Hypervisor; The rollback processing unit is used to execute the hot migration rollback process when the destination Hypervisor fails to start the destination virtual machine, including: canceling the hot migration task of the destination Hypervisor; controlling the source Hypervisor to obtain the device status information and configuration saved at the beginning of the migration operation from the source DPU and load them into the corresponding device; and restoring the memory information from the memory snapshot, rolling back the source virtual machine to the state at the beginning of the migration operation, and continuing to run the source virtual machine.
4. A method for hot migration of virtual machines in a DPU environment, characterized in that: The method comprises the following steps: The source Hypervisor of the source host issues a hot migration instruction to the proxy module and the source DPU device, and sends the hot migration instruction to the destination Hypervisor of the destination host via the destination DPU device; The destination host responds to the hot migration instruction and starts a destination virtual machine through its destination Hypervisor; The proxy module collects memory information of the source virtual machine and sends it to the source Hypervisor, wherein the memory information at least includes information of unused memory; The source Hypervisor marks the memory data to be migrated according to the memory information returned by the proxy module and the dirty page log recorded by the source DPU device, and performs a data migration operation to migrate the memory data to the storage space corresponding to the destination virtual machine. The memory data does not include data corresponding to the information of unused memory. Monitor the data migration process, pause the source virtual machine and start the destination virtual machine after the migration is successful, and perform a hot migration rollback operation if an exception occurs in the migration.
5. The method according to claim 4, characterized in that The agent module collects memory information of the virtual machine, including: The proxy module counts the memory allocation information of the virtual machine through the kernel state module; The proxy module sends the statistical memory allocation information to the source Hypervisor through the virtual dedicated device.
6. The method according to claim 5, characterized in that The hot migration process is monitored, and after the migration is successful, the source virtual machine is paused and the destination virtual machine is started, further comprising: After the source Hypervisor completes sending the data to be migrated, it sends a pre-check instruction to the destination Hypervisor; After receiving the pre-check instruction, the destination Hypervisor performs a data consistency check and checks whether the environment configuration is correct; If all checks pass, the source Hypervisor pauses the source VM and sends a command to the destination Hypervisor to start the destination VM. If at least one exception is detected, the source hypervisor sends a hot migration cancellation instruction to the target hypervisor.
7. The method according to claim 6, characterized in that Perform hot migration rollback after a migration exception occurs, including: When the destination Hypervisor fails to start the destination virtual machine, the hot migration rollback process is executed, including: canceling the hot migration task of the destination Hypervisor; controlling the source Hypervisor to obtain the device status information and configuration saved at the beginning of the migration operation from the source DPU and load them into the corresponding device; and restoring the memory information from the memory snapshot, rolling back the source virtual machine to the state at the beginning of the migration operation, and continuing to run the source virtual machine.
8. The method according to claim 7, characterized in that The hot migration process also includes: The source Hypervisor records the memory of the virtual machine with dirty pages; After receiving the hot migration instruction, the source DPU device marks the memory dirty page; The source Hypervisor determines the memory data that needs to be migrated based on the memory information returned by the proxy module and the dirty page information marked by the source DPU device. Save the status information and configuration of the device that needs to be migrated to the source DPU; Generate a snapshot of the modified memory content corresponding to the source Hypervisor.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 4 to 8 are implemented.
10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the function of the system according to any one of claims 1 to 3 is realized.
Citation Information
Cited By
Operation management method and device for virtual machine, equipment, storage medium and program
CN120429068A
Method, device, equipment, storage medium and program for operating virtual machine
CN120429068B