Virtual machine migration processing method, source host machine, storage medium, and electronic apparatus
By pausing the IO write request queue in the virtual machine monitor and using the idle time of the storage device to synchronize storage data, the problem of long pause time caused by storage device synchronization during virtual machine migration is solved, and real-time-sensitive scenarios are realized. Reduced migration time and improved stability.
Patent Information
- Application Number
- PCT/CN2023/143715
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-24
- Filing Date
- 2023-12-30
- Publication Date
- 2024-08-29
AI Technical Summary
In the existing technology, the final data synchronization of the storage device during the virtual machine migration process causes a long pause time. Especially in real-time sensitive application scenarios, it is difficult to complete the migration within 50ms, and there are problems caused by the synchronization of dirty block data. Time uncertainty.
In the final migration preparation state of the virtual machine, the IO write request queue is paused through the virtual machine monitor, the idle time of the storage device is used to perform a one-time migration of dirty block data, and the VCPU is paused when the number of dirty pages in the memory is less than the threshold. Completed The remaining data is synchronized to ensure that storage synchronization does not affect the migration pause time.
It effectively shortens the final pause time of virtual machine migration, reduces the IO delay and data synchronization time caused by storage synchronization, and improves the stability and real-time performance of the migration process, especially in telecommunications and other companies that have high real-time business requirements. It is of great significance in cloud computing scenarios.
Smart Images

Figure CN2023143715_29082024_PF_FP_ABST
Abstract
Description
A virtual machine migration processing method, source host machine, storage medium and electronic device
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This disclosure is based on Chinese patent application No. 202310207462.X filed on February 24, 2023, and claims the priority of the patent application, and all the disclosed contents thereof are incorporated into this disclosure by reference. Technical Field
[0003] The embodiments of the present disclosure relate to the field of computer software technology, and in particular to a virtual machine migration processing method, a source host machine, a storage medium, and an electronic device. Background Art
[0004] Live migration is crucial for achieving efficient, stable, and seamless virtual machine migration. This requires balancing the load of virtual machines across physical resources without disrupting services, and proactively preventing hardware failures. Virtual machine live migration generally involves two steps: iterative migration and a final, briefly paused migration. At the beginning of the migration, all memory pages and storage blocks are marked as dirty, copied to the destination, and then the dirty bit is removed. Iterative migration involves multiple rounds of continuous extraction of dirty memory or disk blocks, transferring them to the paused destination virtual machine, and writing them to the source and destination machines, ensuring consistency between the source and destination. During iterative migration, the source VM remains running. When the remaining dirty memory pages and dirty disk blocks are reduced to a certain threshold, a final migration pause is performed. This briefly pauses all of the source VM's Virtual Machine Central Processing Units (VCPUs) to synchronize the remaining dirty pages and blocks, as well as device status data, to the destination VM, ensuring complete consistency between the source and destination VMs. The destination VM's VCPU then begins running, and the source VM is deleted, completing the VM migration. This brief pause (usually within 1 second) is called the VM's migration downtime.
[0005] In the current implementation, final data synchronization with the storage device occurs after the source VM's VCPU is paused, counting this as part of the pause period. However, because storage devices are slower than CPUs, the collection and synchronization of dirty block data is subject to greater timing uncertainty than the synchronization of dirty memory pages. In real-time-sensitive applications, shortening the final pause period for VM migration is crucial. A pause that results in even slightly prolonged network outages can lead to retransmission storms of various packets. Therefore, migration pauses are typically required to be within 50ms, and potential interference jitter must be eliminated.
[0006] Regarding the problem of how to shorten the pause time of the last VCPU of virtual machine migration in related technologies, no solution has been proposed yet.
[0007] Summary of the Invention
[0008] The embodiments of the present disclosure provide a virtual machine migration processing method, a source host machine, a storage medium, and an electronic device to at least solve the problem of how to shorten the pause time of the last VCPU of virtual machine migration in the related art.
[0009] According to an embodiment of the present disclosure, a virtual machine migration processing method is provided, which is applied to a source host machine, and the method includes:
[0010] In the final migration preparation state of the virtual machine, the virtual machine monitor (VMM) suspends the extraction of IO write requests from the IO write request queue of the virtual machine to the corresponding storage device;
[0011] During the period of suspending the extraction of IO write requests, the dirty block data at the write operation location marked as dirty blocks in the storage device is migrated to the storage device corresponding to the destination host machine at one time, wherein the VCPU of the virtual machine is in a running state;
[0012] When the number of remaining dirty memory pages of the virtual machine is less than a first preset threshold, the VMM controls the VCPU to be in a pause state, and migrates the remaining dirty memory pages to a storage device corresponding to the destination host machine.
[0013] According to another embodiment of the present disclosure, a source host is provided, comprising: a VMM and a storage device, wherein:
[0014] The VMM is configured to, in a final migration preparation state of the virtual machine, suspend extracting IO write requests from an IO write request queue of the virtual machine to a corresponding storage device; during the period of suspending the extraction of IO write requests, migrate dirty block data at write operation locations marked as dirty blocks in the storage device to a storage device corresponding to a destination host machine at one time, wherein the VCPU of the virtual machine is in a running state; and when the number of remaining memory dirty pages of the virtual machine is less than a first preset threshold, control the virtual machine central processing unit VCPU to be in a suspended state;
[0015] The VMM or storage device is configured to migrate the remaining dirty memory pages to the storage device corresponding to the destination host;
[0016] A storage device configured to receive and execute I / O write requests.
[0017] According to another embodiment of the present disclosure, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above method embodiments when run.
[0018] According to another embodiment of the present disclosure, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps in any one of the above method embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] FIG1 is a hardware structure block diagram of a computer device according to a method for processing virtual machine migration according to an embodiment of the present disclosure;
[0020] FIG2 is a flow chart of a virtual machine migration processing method according to an embodiment of the present disclosure;
[0021] FIG3 is a flow chart of a method for hot storage migration of a virtual machine according to an embodiment of the present disclosure;
[0022] FIG4 is a structural block diagram of a source host according to an embodiment of the present disclosure;
[0023] FIG5 is a structural block diagram of storage live migration of a virtual machine according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings and in conjunction with embodiments.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0026] The method embodiments provided in the embodiments of the present disclosure can be executed in a computer device or a similar computing device. Taking operation on a computer device as an example, FIG1 is a hardware structure block diagram of a computer device of the virtual machine migration processing method of the embodiment of the present disclosure. As shown in FIG1 , the computer device may include one or more (only one is shown in FIG1 ) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device) and a memory 104 for storing data, wherein the above-mentioned computer device may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that the structure shown in FIG1 is only for illustration, and it does not limit the structure of the above-mentioned computer device. For example, the computer device may also include more or fewer components than those shown in FIG1 , or have a configuration different from that shown in FIG1 .
[0027] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the virtual machine migration processing method in the embodiment of the present disclosure. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories can be connected to the computer device via a network. Examples of the above-mentioned network include but are not limited to the Internet, corporate intranet, local area network, mobile communication network and combinations thereof.
[0028] The transmission device 106 is used to receive or send data via a network. A specific example of the aforementioned network may include a wireless network provided by a communications provider of a computer device. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0029] In this embodiment, a method for processing virtual machine migration running on the above-mentioned computer device is provided. FIG2 is a flow chart of the method for processing virtual machine migration according to an embodiment of the present disclosure. As shown in FIG2 , the method is applied to a source host machine. The flow includes the following steps:
[0030] Step S202: In the final migration preparation state of the virtual machine, the VMM suspends extracting IO write requests from the IO write request queue of the virtual machine to the corresponding storage device;
[0031] Step S204: During the period of suspending the extraction of IO write requests, the dirty block data at the write operation location marked as dirty block in the storage device is migrated to the storage device corresponding to the destination host machine through the VMM at one time, wherein the VCPU of the virtual machine is in a running state;
[0032] In the embodiment of the present disclosure, the above-mentioned step S204 may specifically include: when the storage device is local storage, the dirty block data at the write operation position marked as dirty block in the storage device is migrated to the storage device corresponding to the destination host machine at one time through the VMM; when the storage device is shared storage, the dirty block data at the write operation position marked as dirty block in the storage device is migrated to the storage device corresponding to the destination host machine at one time through the storage device, and the migration result is notified to the VMM after execution is completed.
[0033] Step S206: When the number of remaining dirty memory pages of the virtual machine is less than a first preset threshold, the VMM controls the VCPU to be in a pause state, and migrates the remaining dirty memory pages to a storage device corresponding to the destination host machine.
[0034] Through the above steps S202 to S206, the problem of how to shorten the pause time of the last VCPU of virtual machine migration in the related technology can be solved. By completing the hot migration synchronization of the last dirty block data in the idle time period of the IO write request queue (that is, during the suspension of extracting IO write requests), the time introduced by the synchronization of the last batch of stored dirty block data is excluded from the migration pause time (that is, the time when the VCPU is in the pause state), thereby achieving the beneficial effect of optimizing, reducing and stabilizing the total migration pause time.
[0035] The disclosed embodiments are applicable to both local and shared storage migrations. By completing hot migration synchronization of the final dirty storage block during the idle period of the storage IO write request queue, the virtual machine VCPU is not paused during synchronization. This effectively eliminates the IO latency and data synchronization time associated with dirty storage block synchronization from the migration pause period, effectively reducing and ensuring a stable final hot migration pause period. This is particularly significant in cloud computing scenarios, such as telecommunications, where real-time services are highly sensitive.
[0036] In one embodiment, before the above-mentioned step S202, the method further includes: determining through the VMM whether the number of dirty pages of the virtual machine's memory and the remaining dirty block data of the storage device is less than a first preset threshold; if the judgment result is yes, marking the current state of the virtual machine as the above-mentioned final migration preparation state through the VMM.
[0037] Furthermore, the VMM can also determine that the generation rate of the virtual machine's memory dirty pages and the dirty block data of the storage device is less than the second preset threshold; when the number of the virtual machine's memory dirty pages and the remaining dirty block data of the storage device is less than the first preset threshold and the generation rate of the virtual machine's memory dirty pages and the dirty block data of the storage device is less than the second preset threshold, the VMM marks the current state as the final migration preparation state.
[0038] In another embodiment, before step S202, the method further includes: after each execution of one or a batch of IO write request migrations, determining through the VMM that all remaining IO write requests in the IO write request queue of the storage device have been executed.
[0039] Furthermore, while migrating the remaining dirty memory pages to the storage device corresponding to the destination host machine, the device configuration information and device status information are also migrated to the storage device corresponding to the destination host machine, that is, the remaining dirty memory pages, device configuration information and device status information are sent to the destination host machine at the same time and written to the storage device corresponding to the destination host machine.
[0040] In yet another embodiment, before step S202, the method further includes: extracting, by the VMM, IO write requests from the IO write request queue and submitting them to the corresponding storage device for execution; marking the write operation location on the storage device as a dirty block; and iteratively migrating the dirty block data at the write operation location marked as a dirty block on the storage device to the storage device corresponding to the destination host machine. In this embodiment, the IO write requests in the IO write request queue are submitted by the operating system within the virtual machine.
[0041] The disclosed embodiment is applicable to the scenario where a cloud computing virtual machine carries hot storage migration. There is a continuous network connection between the source host machine where the virtual machine is located before migration and the migration destination host machine. The data of memory dirty pages and storage dirty blocks during the migration process can be continuously synchronized to the destination end according to industry common sense. The data collection of the virtual machine dirty blocks is carried out through the virtualization infrastructure VMM, that is, when the virtual machine operating system submits a storage IO request, the CPU exits (VmExit) to the VMM to capture the request, submits the IO request to the real storage device on the physical host machine, and asynchronously waits for the storage device to send the IO return result back to the memory specified by the virtual machine. If the executed IO request is a storage write request, and the virtual machine is in the migration process when it is executed, the VMM will record the storage write location and mark it as a dirty block, and regularly pull the dirty block content from the physical storage in batches and send it to the same storage device at the migration destination and write it. After sending the last batch of dirty blocks, the VMM pauses the virtual machine's VCPU and then copies dirty memory pages, device configuration information, and device status information to the destination host to complete the virtual machine migration. This prevents the generation of new dirty blocks during the sending process, and the source and destination storage devices remain identical after the sending, thus achieving the purpose of hot migration. This disclosure specifically excludes the time it takes to synchronize the sending of the last batch of dirty blocks from the VCPU pause period, thereby reducing and stabilizing the final VCPU pause period during migration. This is particularly significant in industries such as telecommunications that are highly sensitive to real-time service performance.
[0042] FIG3 is a flow chart of a method for hot migration of virtual machines according to an embodiment of the present disclosure, as shown in FIG3 , including the following steps:
[0043] S301, the iterative copy phase of virtual machine live migration, synchronizes storage dirty blocks and memory dirty pages to the destination (i.e., the destination host) in batches. When the migration starts, the virtual machine is in the iterative migration phase. The operating system in the virtual machine submits IO requests to the IO request queue of the storage device. The VMM backend takes the IO request from the IO request queue and submits it to the storage device of the host for execution. If it is an IO write request, the VMM marks the write operation location of the storage device as a dirty block, and iteratively copies the storage dirty block data to the destination and writes it to the corresponding storage device of the destination.
[0044] S302-S303, determine whether the data of the virtual machine's memory dirty pages and the storage device's dirty block data is less than the first preset threshold. When the data of the virtual machine's memory dirty pages and the storage device's dirty block data is less than the first preset threshold, the VMM marks the current state as the final migration preparation state.
[0045] Furthermore, after determining that the rate at which the virtual machine memory dirty pages and all storage devices associated with the virtual machine generate dirty blocks is less than the first preset threshold, it is possible to judge whether the rate at which the virtual machine memory dirty pages and all storage devices associated with the virtual machine generate dirty block data is less than the first preset threshold. If the judgment result is yes, the current state is marked as the final migration preparation state.
[0046] In the final migration preparation state, illustratively, the data written by IO to the storage device in this state can be temporarily stored by the VMM in the source host memory to facilitate subsequent rapid retrieval and transmission to the peer end.
[0047] S304, the VMM confirms the status of the remaining requests in the IO request queue each time it completes one or a batch of IO write requests;
[0048] S305: Determine whether all remaining IO write requests in the IO request queue have been executed. If so, execute step S306.
[0049] If, in the final migration preparation state, it is still impossible to wait until the number of IO write requests in the queue reaches 0, then, for example, S306 is executed immediately after the number of write requests drops to a certain threshold. This approach may introduce a very short IO write delay in the virtual machine, but can still achieve the effect of reducing the final migration pause time.
[0050] S306: The VMM suspends obtaining and executing new IO write requests from the IO request queues of all storage devices.
[0051] S307, the VMM sends the remaining dirty block data marked by all storage devices of the source end (ie, the source host) to the destination end at one time and writes them into the corresponding storage devices.
[0052] If the storage used is shared storage, the synchronization of the last batch of dirty block data can be performed by the storage device's own storage protocol and network, and then notified to the VMM after completion.
[0053] S308, checking whether the number of remaining dirty memory pages of the virtual machine is still lower than the set threshold (i.e., the first preset threshold);
[0054] If not, exit the final migration preparation state and continue with the iterative migration.
[0055] If yes, step S309 is executed to complete the final migration step of the virtual machine.
[0056] S309: Pause the virtual machine VCPU to complete the final copy of the remaining dirty pages in the memory and the device configuration information and device status information.
[0057] S310: The VCPU of the destination virtual machine begins execution, and the destination VMM continues to take read and write requests from the IO request queue and executes them. The virtual machine on the source host is deleted, completing the hot migration of the virtual machine.
[0058] Another aspect of the present disclosure further provides a source host machine. FIG4 is a structural block diagram of a source host machine according to an embodiment of the present disclosure. As shown in FIG4 , the source host machine includes: a VMM 42 and a storage device 44, wherein:
[0059] VMM 42 is configured to, in a final migration preparation state of the virtual machine, suspend extracting IO write requests from an IO write request queue of the virtual machine to the corresponding storage device; migrate dirty block data at write operation locations marked as dirty blocks in the storage device to the storage device corresponding to the destination host machine at one time during the period of suspending the extraction of IO write requests, wherein the VCPU of the virtual machine is in a running state; and control the VCPU to be in a suspended state when the number of remaining dirty memory pages of the virtual machine is less than a first preset threshold;
[0060] The VMM 42 or the storage device 44 is configured to migrate the remaining dirty memory pages to the storage device corresponding to the destination host machine;
[0061] The storage device 44 is configured to receive and execute the IO write request.
[0062] In one embodiment, the VMM 42 is further configured to, when the storage device is local storage, migrate dirty block data at a write operation location marked as a dirty block in the storage device to a storage device corresponding to the destination host machine at one time;
[0063] The storage device 44 is also configured to migrate dirty block data at write operation locations marked as dirty blocks in the storage device to the storage device corresponding to the destination host machine at one time when the storage device is shared storage, and inform VMM42 of the migration result.
[0064] In one embodiment, VMM42 is further configured to determine whether the number of dirty pages of the virtual machine's memory and the remaining dirty block data of the storage device is less than the first preset threshold; if the judgment result is yes, the current state of the virtual machine is marked as the final migration preparation state.
[0065] In one embodiment, VMM42 is further configured to determine that the generation rate of dirty pages of the virtual machine's memory and dirty block data of the storage device is less than a second preset threshold; if the judgment result is yes, the current state is marked as the final migration preparation state.
[0066] In one embodiment, the VMM 42 is further configured to determine, through the VMM, that all remaining IO write requests in the IO write request queue of the storage device have been executed after each execution of one or a batch of IO write request migrations.
[0067] In one embodiment, VMM42 is further configured to migrate the device configuration information and device status information to the storage device corresponding to the destination host machine while migrating the remaining dirty memory pages to the storage device corresponding to the destination host machine.
[0068] In one embodiment, VMM42 is further configured to extract the IO write request from the IO write request queue and submit it to the corresponding storage device for execution; mark the write operation location of the storage device as a dirty block; and iteratively migrate the dirty block data of the write operation location marked as a dirty block in the storage device to the storage device corresponding to the destination host machine.
[0069] The storage hot migration in the embodiment of the present disclosure mainly includes the source host machine, the destination host machine, the VMM components running on them, and the storage devices used by the virtual machine. Figure 5 is a block diagram of the storage hot migration of the virtual machine according to the embodiment of the present disclosure, as shown in Figure 5, including:
[0070] The source host machine 501 includes a kernel and VMM components running thereon, and provides a virtual machine operating environment.
[0071] The destination host machine 502 includes a kernel and VMM components running thereon, provides a virtual machine operating environment, and is connected to the migration source server via a network.
[0072] VMM 503 (corresponding to VMM42 above) controls the migration steps of the virtual machine, takes out the IO request of the virtual machine to the physical storage and submits it to the storage device on the host machine, and then returns the IO result to the receiving memory at the specified location of the virtual machine.
[0073] The IO request queue 504 is configured as a queue for temporarily storing IO requests from virtual machines to storage devices. For example, this portion is generally presented in the form of a first-in-first-out circular queue and can be accessed by both the IO block device within the virtual machine and the VMM on the host machine. Storage IO requests within the virtual machine will be temporarily stored here and retrieved and executed by the VMM on the host machine side.
[0074] The storage device 505 on the host (corresponding to the storage device 44 described above) can support both local storage and shared storage. Local storage can only access data from its host. During local storage migration, data must first be read from the host using I / O and then sent over the network to the peer's local storage for writing. For shared storage, the storage device itself has a shared protocol and connects to the storage network to synchronize data with the peer during the migration.
[0075] An embodiment of the present disclosure further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above method embodiments when run.
[0076] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0077] An embodiment of the present disclosure further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0078] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0079] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail here.
[0080] Obviously, those skilled in the art should understand that the modules or steps of the present disclosure described above can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices, they can be implemented using program code executable by the computing device, and thus, they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be performed in a different order than herein, or they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. Thus, the present disclosure is not limited to any particular combination of hardware and software.
[0081] The foregoing is merely an exemplary embodiment of the present disclosure and is not intended to limit the present disclosure. Those skilled in the art will readily appreciate that the present disclosure is susceptible to various modifications and variations. Any modifications, equivalent substitutions, improvements, and the like made within the principles of the present disclosure shall be included within the scope of protection of the present disclosure.
Claims
1. A virtual machine migration processing method, applied to a source host machine, the method comprising: In the final migration preparation state of the virtual machine, suspending the extraction of IO write requests from the IO write request queue of the virtual machine to the corresponding storage device through the virtual machine monitor VMM; During the period of suspending the extraction of the IO write request, the dirty block data of the write operation position marked as the dirty block in the storage device is migrated to the storage device corresponding to the destination host machine at one time, wherein the virtual machine central processing unit VCPU of the virtual machine is in a running state; When the number of remaining dirty memory pages of the virtual machine is less than a first preset threshold, the VMM controls the VCPU to be in a paused state, and migrates the remaining dirty memory pages to a storage device corresponding to the destination host machine.
2. The method according to claim 1, wherein: Migrating dirty block data at write operation locations marked as dirty blocks in the storage device to the storage device corresponding to the destination host at one time includes: In the case where the storage device is local storage, the dirty block data at the write operation position marked as a dirty block in the storage device is migrated to the storage device corresponding to the destination host machine at one time through the VMM; In the case where the storage device is a shared storage, the dirty block data at the write operation position marked as a dirty block in the storage device is migrated at one time to the storage device corresponding to the destination host machine through the storage device.
3. The method according to claim 1, wherein: Before pausing the extraction of IO write requests from the IO write request queue of the virtual machine to the corresponding storage device through the virtual machine monitor VMM, the method further includes: Determining, by the VMM, whether the number of dirty pages of the virtual machine's memory and the number of remaining dirty block data of the storage device are less than the first preset threshold; If the judgment result is yes, the current state of the virtual machine is marked as the final migration preparation state by the VMM.
4. The method according to claim 3, wherein: Marking the current state as the final migration preparation state by the VMM includes: Determining by the VMM that a generation rate of dirty pages of the virtual machine's memory and dirty block data of the storage device is less than a second preset threshold; If the judgment result is yes, the VMM marks the current state as the final migration preparation state.
5. The method according to claim 1, wherein: Before pausing the extraction of IO write requests from the IO write request queue of the virtual machine to the corresponding storage device through the virtual machine monitor VMM, the method further includes: After each execution of one or a batch of IO write request migrations, the VMM determines that all remaining IO write requests in the IO write request queue of the storage device have been executed.
6. The method according to claim 1, wherein: The method further comprises: While the remaining dirty memory pages are migrated to the storage device corresponding to the destination host machine through the VMM, the device configuration information and the device status information are migrated to the storage device corresponding to the destination host machine.
7. The method according to any one of claims 1 to 6, wherein: Before pausing the extraction of IO write requests from the IO write request queue of the virtual machine to the corresponding storage device through the virtual machine monitor VMM, the method further includes: Extracting the IO write request from the IO write request queue through the VMM and submitting it to the corresponding storage device for execution; Marking the write operation location of the storage device as a dirty block by the VMM; The dirty block data at the write operation position marked as a dirty block in the storage device is iteratively migrated to the storage device corresponding to the destination host machine through the VMM.
8. A source host machine, comprising: A virtual machine monitor VMM and a storage device, wherein: The VMM is configured to suspend the extraction of IO write requests from the IO write request queue of the virtual machine to the corresponding storage device in the final migration preparation state of the virtual machine; migrate the dirty block data of the write operation position marked as dirty blocks in the storage device to the storage device corresponding to the destination host machine at one time during the period of suspending the extraction of IO write requests, wherein the virtual machine central processing unit VCPU of the virtual machine is in a running state; and control the VCPU to be in a suspended state when the number of remaining memory dirty pages of the virtual machine is less than a first preset threshold value; The VMM or the storage device is configured to migrate the remaining dirty memory pages to the storage device corresponding to the destination host machine; The storage device is configured to receive and execute the IO write request.
9. The source host machine according to claim 8, wherein: The VMM is further configured to migrate dirty block data at write operation locations marked as dirty blocks in the storage device to the storage device corresponding to the destination host machine at one time when the storage device is local storage; The storage device is also configured to migrate dirty block data at write operation locations marked as dirty blocks in the storage device to the storage device corresponding to the destination host machine at one time when the storage device is shared storage, and inform the VMM of the migration result.
10. The source host according to claim 8, wherein: The VMM is further configured to determine whether the number of dirty pages of the virtual machine's memory and the remaining dirty block data of the storage device is less than the first preset threshold; if the determination result is yes, mark the current state as a final migration preparation state.
11. The source host machine according to claim 10, wherein: The VMM is further configured to determine whether a generation rate of dirty pages of the virtual machine's memory and dirty block data of the storage device is less than a second preset threshold; if the determination result is yes, mark the current state of the virtual machine as the final migration preparation state.
12. The source host machine according to claim 8, wherein: The VMM is further configured to determine, through the VMM, that all remaining IO write requests in the IO write request queue of the storage device have been executed after each execution of one or a batch of IO write request migrations.
13. The source host machine according to claim 8, wherein: The VMM is further configured to migrate the device configuration information and device status information to the storage device corresponding to the destination host machine while migrating the remaining dirty memory pages to the storage device corresponding to the destination host machine.
14. The source host according to any one of claims 8 to 13, wherein: The VMM is further configured to extract the IO write request from the IO write request queue and submit it to the corresponding storage device for execution; mark the write operation location of the storage device as a dirty block; Iteratively migrate dirty block data at a write operation location marked as a dirty block in the storage device to a storage device corresponding to the destination host machine.
15. A computer-readable storage medium, wherein a computer program is stored in the storage medium, wherein: The computer program is arranged to execute the method as claimed in any one of claims 1 to 7 when executed.
16. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Virtual machine migration method
CN101464812A
Method, device and system for transferring from physical machine to virtual machine on line
CN102081552A
Thermal migration method and device of virtual machine
CN114546604A
Virtual machine memory migration method and device, equipment and storage medium
CN115033337A
Live migration of virtual machine during direct access to storage over SR IOV adapter
US20120042034A1
