Virtual machine migration acceleration method and system, migration device, and medium
Through negotiation to create logical links and select the best copy method, the problem of virtual machine live migration method being incompatible with different migration scenarios is solved, efficient and universal virtual machine migration is achieved, and migration efficiency and compatibility are improved.
Patent Information
- Application Number
- PCT/CN2024/076142
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-24
- Filing Date
- 2024-02-05
- Publication Date
- 2024-08-29
AI Technical Summary
The virtual machine live migration method in the existing technology is not compatible with different migration scenarios, resulting in low migration efficiency, relying on specific hardware characteristics, and cannot be universally applied.
Create logical links through negotiation, obtain the page frame number sequence and page identification sequence of physical memory pages, organize them into a continuous data stream, and select the best copy method according to the hardware configuration to copy and receive data to achieve network acceleration.
It achieves efficient and versatile virtual machine migration, is compatible with a variety of migration scenarios, and improves migration efficiency and compatibility.
Smart Images

Figure CN2024076142_29082024_PF_FP_ABST
Abstract
Description
Virtual machine migration acceleration method, system, migration device and medium
[0001] Related applications
[0002] This application claims priority to Chinese patent application No. 202310164076.7 filed on February 24, 2023, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the technical field of virtual machine hot migration, and in particular to a virtual machine migration acceleration method, a virtual machine migration acceleration system, a migration device, and a computer-readable storage medium. Background Art
[0004] Implementing efficient, stable, and seamless virtual machine live migration has been a hot topic in cloud computing and virtualization research. Live migration is crucial for balancing the load of virtual machines across physical resources while maintaining service interruption, as well as for proactively preventing hardware failures. Efficient virtual machine live migration remains a hot research topic.
[0005] With the rapid evolution of cloud computing technology, the hardware and software environments are also rapidly iterating. Data centers are now home to both new and existing hardware and software. Live migration of virtual machines often involves migrating from new hosts to old hosts, or vice versa. This often leads to incompatible migration methods and acceleration tools between new and old hosts, leading to bottlenecks in migration efficiency. Conventional technologies often focus on leveraging the latest hardware to accelerate migrations, but lack a universal and efficient acceleration method that can be used across all migration scenarios.
[0006] As can be seen from the above, the current mainstream solutions for virtual machine live migration all rely on specific hardware features. For example, they rely on zero-copy network cards, RDMA (Remote Direct Memory Access) technology, or dedicated migration hardware devices. As a result, the implementation of virtual machine live migration is highly dependent on the hardware and networking environment, and cannot be applied to all migration scenarios.
[0007] Summary of the Invention
[0008] The main purpose of this application is to provide a virtual machine migration acceleration method, a virtual machine migration acceleration system, a migration device and a computer-readable storage medium, aiming to solve the technical problem that the virtual machine hot migration method in conventional technology is not compatible with the migration scenario.
[0009] To achieve the above objectives, the present application provides a method for accelerating virtual machine migration, which is applied to a migration source and includes:
[0010] Negotiating and creating a logical link for migration network transmission based on the local network address and the network address of the migration destination, and determining a network acceleration method for the logical link;
[0011] Obtaining a page frame number sequence of the physical memory pages to be migrated in the current batch and a page identification sequence corresponding to the page frame number sequence, organizing the data of the physical memory pages corresponding to the page frame number sequence into a continuous data stream, wherein the page identification sequence is attached to the header of the data stream;
[0012] The optimal copy method is selected according to the specified migration type and software and hardware configuration to copy the data stream to the network packet buffer, and the data stream on the network packet buffer is sent to the migration destination corresponding to the logical link according to the network acceleration method.
[0013] To achieve the above objectives, the present application provides a method for accelerating virtual machine migration, which is applied to a migration destination and includes:
[0014] Negotiating and creating a logical link for migration network transmission based on the local network address and the network address of the migration source, and determining a network acceleration method for the logical link;
[0015] receiving, in accordance with the network acceleration method, a data stream sent by the migration source end corresponding to the logical link, and saving the data stream to a network packet receiving buffer;
[0016] Parsing the data stream on the network packet receiving buffer to obtain a page identification sequence, preparing to receive a memory page according to the page identification sequence, and determining a page frame number sequence of the ready-to-receive memory page;
[0017] An optimal copying method is selected according to the specified migration type and software and hardware configuration to copy the data stream on the network packet receiving buffer to the receiving memory page corresponding to the prepared page frame number sequence.
[0018] The present application also provides a virtual machine migration acceleration system, which is located on a migration source end and a migration destination end, and includes:
[0019] The migration channel configuration submodule is used to negotiate and create a logical link for migration network transmission based on the network addresses of the migration source and migration destination.
[0020] a migration memory sending submodule, configured to obtain a page frame number sequence of a current batch of physical memory pages to be migrated and a page identification sequence corresponding to the page frame number sequence, and organize the data of the physical memory pages corresponding to the page frame number sequence into a continuous data stream, wherein the page identification sequence is attached to the header of the data stream;
[0021] The data fast push-pull submodule is used to select the best copy method according to the specified migration type and software and hardware configuration to copy the data stream to the network packet sending buffer; and is also used to select the best copy method according to the specified migration type and software and hardware configuration to copy the data stream in the network packet receiving buffer to the receiving memory page corresponding to the prepared page frame number sequence;
[0022] a network transceiver acceleration submodule, configured to determine a network acceleration method for the logical link; further configured to send the data stream in the network packet sending buffer to the migration destination corresponding to the logical link according to the network acceleration method; further configured to receive the data stream sent by the migration source corresponding to the logical link according to the network acceleration method, and save the data stream in the network packet receiving buffer;
[0023] The waiting receiving memory page ready submodule is used to parse the page identification sequence obtained by the data flow on the network packet receiving buffer, prepare to receive memory pages according to the page identification sequence, and determine the page frame number sequence of the ready receiving memory pages.
[0024] The present application also provides a migration device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the virtual machine migration acceleration method described above are implemented.
[0025] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the virtual machine migration acceleration method described above are implemented.
[0026] The present application also provides a first virtual machine migration acceleration device, which includes:
[0027] A first preparation module is used to negotiate and create a logical link for migration network transmission according to the local network address and the network address of the migration destination, and determine a network acceleration method for the logical link;
[0028] an encapsulation module, configured to obtain a page frame number sequence of physical memory pages to be migrated in a current batch and a page identification sequence corresponding to the page frame number sequence, and organize the data of the physical memory pages corresponding to the page frame number sequence into a continuous data stream, wherein the page identification sequence is attached to the header of the data stream;
[0029] The sending module is used to select the best copy method according to the specified migration type and software and hardware configuration to copy the data stream to the network packet buffer, and send the data stream on the network packet buffer to the migration destination corresponding to the logical link according to the network acceleration method.
[0030] The present application also provides a second virtual machine migration acceleration device, which includes:
[0031] A second preparation module is configured to negotiate and create a logical link for migration network transmission based on the local network address and the network address of the migration source end, and determine a network acceleration method for the logical link;
[0032] a receiving module, configured to receive the data stream sent by the migration source end corresponding to the logical link according to the network acceleration mode, and save the data stream to a network packet receiving buffer;
[0033] a parsing module, configured to parse a page identification sequence obtained from the data stream on the network packet receiving buffer, prepare a receiving memory page according to the page identification sequence, and determine a page frame number sequence of the ready-to-receive memory page;
[0034] The cache module is used to select the best copy method according to the specified migration type and software and hardware configuration to copy the data stream on the network packet receiving cache to the receiving memory page corresponding to the ready page frame number sequence. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] FIG1 is a schematic diagram of the structure of the operating equipment of the hardware operating environment involved in the embodiment of the present application;
[0036] FIG2 is a system diagram of an embodiment of a virtual machine migration acceleration system according to an embodiment of the present application;
[0037] FIG3 is a flow chart of an embodiment of a method for accelerating virtual machine migration according to an embodiment of the present application;
[0038] FIG4 is a flow chart of another embodiment of a method for accelerating virtual machine migration according to an embodiment of the present application;
[0039] FIG5 is a schematic diagram of an application scenario of a method for accelerating virtual machine migration according to an embodiment of the present application;
[0040] FIG6 is a schematic diagram of another application scenario of the virtual machine migration acceleration method involved in the embodiment of the present application;
[0041] FIG7 is a schematic diagram of another application scenario of the virtual machine migration acceleration method involved in the embodiment of the present application;
[0042] FIG8 is a schematic diagram of a first virtual machine migration acceleration device involved in an embodiment of the present application;
[0043] FIG9 is a schematic diagram of a second virtual machine migration acceleration device according to an embodiment of the present application.
[0044] The realization of the objectives, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0045] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0046] Refer to Figure 1, which is a schematic diagram of the operating equipment structure of the hardware operating environment involved in the embodiment of the present application.
[0047] As shown in Figure 1, the operating device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may include a standard wired interface and a wireless interface (such as a wireless fidelity (WI-FI) interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0048] Those skilled in the art will understand that the structure shown in FIG1 does not constitute a limitation on the operating device, and may include more or fewer components than shown, or a combination of certain components, or a different arrangement of components.
[0049] As shown in FIG. 1 , the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module, and a computer program.
[0050] In the operating device shown in FIG1 , the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the operating device of the present application can be set in the operating device, and the operating device calls the computer program stored in the memory 1005 through the processor 1001 and performs the following operations:
[0051] Negotiating and creating a logical link for migration network transmission based on the local network address and the network address of the migration destination, and determining a network acceleration method for the logical link;
[0052] Obtaining a page frame number sequence of the physical memory pages to be migrated in the current batch and a page identification sequence corresponding to the page frame number sequence, organizing the data of the physical memory pages corresponding to the page frame number sequence into a continuous data stream, wherein the page identification sequence is attached to the header of the data stream;
[0053] The optimal copy method is selected according to the specified migration type and software and hardware configuration to copy the data stream to the network packet buffer, and the data stream on the network packet buffer is sent to the migration destination corresponding to the logical link according to the network acceleration method.
[0054] In one embodiment, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:
[0055] The step of determining the network acceleration mode of the logical link includes:
[0056] The software and hardware configurations of the migration source end and the migration destination end carrying the logical link are obtained, and the network acceleration mode of the logical link is determined according to the software and hardware configurations.
[0057] In one embodiment, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:
[0058] Before the step of obtaining the page frame number sequence of the current batch of physical memory pages to be migrated and the page identification sequence corresponding to the page frame number sequence, the method further includes:
[0059] A page identifier of a physical memory page is defined according to a migration scenario, wherein the page identifier is consensus information between a migration source end and a migration destination end.
[0060] In one embodiment, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:
[0061] The step of selecting the best copy method according to the specified migration type and software and hardware configuration includes:
[0062] After confirming that the physical network card supports zero-copy capability, the optimal copy method is determined to be zero-copy;
[0063] After determining that the physical network adapter does not support zero-copy capabilities and the specified migration type is memory migration or local storage migration, the optimal copy mode is determined to be CPU multi-core concurrent copy.
[0064] After determining that the physical network card does not support zero-copy capability and the specified migration type is remote memory migration, the optimal copy mode is determined to be DMA push.
[0065] In one embodiment, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:
[0066] Negotiating and creating a logical link for migration network transmission based on the local network address and the network address of the migration source, and determining a network acceleration method for the logical link;
[0067] receiving, in accordance with the network acceleration method, a data stream sent by the migration source end corresponding to the logical link, and saving the data stream to a network packet receiving buffer;
[0068] Parsing the data stream on the network packet receiving buffer to obtain a page identification sequence, preparing to receive a memory page according to the page identification sequence, and determining a page frame number sequence of the ready-to-receive memory page;
[0069] An optimal copying method is selected according to the specified migration type and software and hardware configuration to copy the data stream on the network packet receiving buffer to the receiving memory page corresponding to the prepared page frame number sequence.
[0070] In one embodiment, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:
[0071] The step of determining the network acceleration mode of the logical link includes:
[0072] The software and hardware configurations of the migration source end and the migration destination end carrying the logical link are obtained, and the network acceleration mode of the logical link is determined according to the software and hardware configurations.
[0073] In one embodiment, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:
[0074] Before the step of parsing the page identification sequence obtained by the data stream on the network packet receiving buffer, the method further includes:
[0075] A page identifier of a physical memory page is defined according to a migration scenario, wherein the page identifier is consensus information between a migration source end and a migration destination end.
[0076] The embodiment of the present application provides a virtual machine migration acceleration system, which is located on a migration source end and a migration destination end, and includes:
[0077] The migration channel configuration submodule is used to negotiate and create a logical link for migration network transmission based on the network addresses of the migration source and migration destination.
[0078] a migration memory sending submodule, configured to obtain a page frame number sequence of a current batch of physical memory pages to be migrated and a page identification sequence corresponding to the page frame number sequence, and organize the data of the physical memory pages corresponding to the page frame number sequence into a continuous data stream, wherein the page identification sequence is attached to the header of the data stream;
[0079] The data fast push-pull submodule is used to select the best copy method according to the specified migration type and software and hardware configuration to copy the data stream to the network packet sending buffer; and is also used to select the best copy method according to the specified migration type and software and hardware configuration to copy the data stream in the network packet receiving buffer to the receiving memory page corresponding to the prepared page frame number sequence;
[0080] a network transceiver acceleration submodule, configured to determine a network acceleration method for the logical link; further configured to send the data stream in the network packet sending buffer to the migration destination corresponding to the logical link according to the network acceleration method; further configured to receive the data stream sent by the migration source corresponding to the logical link according to the network acceleration method, and save the data stream in the network packet receiving buffer;
[0081] The waiting receiving memory page ready submodule is used to parse the page identification sequence obtained by the data flow on the network packet receiving buffer, prepare to receive memory pages according to the page identification sequence, and determine the page frame number sequence of the ready receiving memory pages.
[0082] 2 , the virtual machine migration acceleration system of the present application includes but is not limited to the submodules shown in FIG2 , and these submodules can be reasonably added, deleted, merged, or split, all within the scope of the present application.
[0083] The migration channel configuration submodule 101 creates a logical migration channel by configuring the source address information, destination address information, migration type and other configuration information of the specified migration, and is responsible for dismantling the channel after the migration is completed. Different migration scenarios are described by migration type, and migration scenarios include but are not limited to memory migration, remote memory migration, local storage migration or others. In one embodiment, during the migration preparation stage, the migration source and migration destination of the migration respectively configure their respective network addresses through their respective migration channel configuration submodules 101 and negotiate to create a logical link for the migration network transmission based on their respective network addresses, and specify the migration type (memory migration, remote memory migration, local storage migration or others).
[0084] The migration memory sending submodule 102 is responsible for obtaining a set of page frame number sequences for the physical memory pages to be migrated, issued by the migration source during migration, as well as a set of page identification sequences corresponding to the page frame number sequences. The characteristic of the page identification sequence is that the migration destination can index or apply for a specific receiving memory page based on the page identification sequence. The migration memory sending submodule 102 organizes the memory page data corresponding to the page frame number sequence into a data stream, encapsulates the page identification sequence in the data stream header, and notifies the data fast push-pull submodule 104 and the network transceiver acceleration submodule 105 to collaboratively transmit the physical memory page memory data to the network. In one embodiment, after the data stream is transmitted, the migration source can be notified to transmit the next set of page frame number sequences and corresponding page identification sequences for the physical memory pages to be migrated, through methods such as blocking wakeup and interruption.
[0085] For the waiting receiving memory page ready submodule 103, when a group of data streams migrated from the migration source end are received, the information of the data stream header is exposed to the migration destination end. The migration destination end prepares the corresponding migration receiving memory page sequence based on the identifiable page identification sequence in the header information and the situation of its own business, and returns the receiving memory page sequence to the submodule 103. The submodule 103 then notifies the data fast push and pull submodule 104 to push the received data stream to the receiving memory page, thereby completing the migration of this batch of memory. A feature of the submodule 103 is that after receiving the page identification in the data stream header and after the data stream is pushed to the receiving memory page, the migration destination end can be notified of the event using interrupts, messages, polling, etc., and wait for the response of the migration destination end and wait for the next group of data streams. In one embodiment, the submodule 103 has a built-in receiving data stream caching function, so that during the time spent waiting for the receiving page to be ready, the data stream on the network can still be continued to be received through the cache, without causing data congestion.
[0086] In the data fast push and pull sub-module 104, built-in functions include but are not limited to DMA, multi-threaded copying, page table switching, etc., and can flexibly select a method at the migration source end according to the migration type and hardware support to copy or zero-copy the memory page data to be migrated to the network packet data stream, or flexibly select a method at the migration destination end to copy or zero-copy the data from the network packet data stream to the receiving memory page.
[0087] The network transceiver acceleration submodule 105 generally has one or a group of independent network transceiver processes. This submodule is characterized by scanning the hardware environment and software configuration, determining the network acceleration method of the logical link, and sending the data stream in the network packet buffer to the migration destination corresponding to the logical link according to the network acceleration method at the migration source end; at the migration destination end, receiving the data stream sent by the migration source corresponding to the logical link according to the network acceleration method and saving it to the network packet buffer. In addition, the submodule 105 achieves the effect of accelerating network transceiver by reducing the number of data copies, managing and utilizing multiple physical network cards, and shielding the dedicated migration network transceiver process from interference, forming a CPU core monopoly, etc. This submodule 105 can also be implemented through the hardware of a smart network card. The purpose is to fully utilize conventional technologies to accelerate the network transceiver of the migration data stream.
[0088] In this embodiment, it can be seen from the description of each sub-module mentioned above that in sub-module 102 and sub-module 103, a software interface common to various migration scenarios is abstracted, which is universal and scalable. Sub-module 104 and sub-module 105 have the function of automatically scanning and adapting hardware characteristics and software configurations. Therefore, they can shield the differences in the underlying acceleration implementation and provide software users with universal acceleration capabilities. Thus, the common points of multiple migration scenarios are abstracted in the design, and adaptive steps that can automatically identify the environment are added. The application scenarios are diverse, and the user interfaces in different migration scenarios can be unified, and the differences in architecture differences, software version differences and the differences in the capabilities of the old and new hardware of the underlying acceleration are shielded. Thus, in this application, the migration efficiency is high and the versatility is strong, and it is compatible with various migration scenarios, which facilitates the mutual migration based on the old and new hardware in various migration scenarios, the respective technical evolution of the components and the compatible upgrade of the versions.
[0089] The present application provides a method for accelerating virtual machine migration. Referring to FIG. 3 , in one embodiment of the method for accelerating virtual machine migration, the method is applied to a migration source end, and the method includes:
[0090] Step A1: creating a logical link for migration network transmission based on the local network address and the network address of the migration destination through negotiation, and determining a network acceleration method for the logical link;
[0091] The virtual machine migration acceleration method in this embodiment can be implemented by combining a software module with traditional hardware, or by a dedicated hardware device. It can exist on the host machine that is coexisting with the virtual machine, or on a control subcard connected to the host machine. In other words, this method is suitable for hot migration of cloud computing virtual machines, and has various application scenarios. It can be applied to virtual machine memory migration or virtual machine local storage migration. The migration acceleration module can exist on the host machine that is coexisting with the virtual machine, or on a control subcard connected to the host machine. It can be implemented by software in conjunction with a general network card, or by hardware through a programmable smart network card. All forms of existence can provide a unified software interface for a variety of migration scenarios and have strong compatibility.
[0092] During the migration preparation phase, the migration source and destination nodes configure their respective network addresses through their respective migration channel configuration submodules 101. Based on these addresses, they negotiate to create a logical link for the migration network transmission and specify the migration type (memory migration, remote memory migration, local storage migration, or other). Simultaneously, the network transceiver acceleration submodules 105 on each node negotiate based on these network addresses, create a logical link for the migration network transmission, and automatically select a network acceleration method appropriate for this logical link based on the hardware and software configurations of the source and destination nodes.
[0093] Exemplarily, the step of determining the network acceleration mode of the logical link includes:
[0094] The software and hardware configurations of the migration source end and the migration destination end carrying the logical link are obtained, and the network acceleration mode of the logical link is determined according to the software and hardware configurations.
[0095] 1. Submodule 105 detects the logical link of the migration network transmission and determines whether it can be accelerated in hardware by using multiple physical network cards through multifd (a hot migration method), link aggregation, etc. 2. Submodule 105 reads the software configuration to determine whether a dedicated CPU core is reserved for the logical link. If a dedicated CPU core is reserved, the network sending and receiving process will be bound to the reserved core and interference exclusion processing will be performed. 3. Submodule 105 detects whether the physical network card supports zero-copy capability. If it supports zero-copy capability, it is necessary to inform submodule 104 to use zero-copy method to send and receive data subsequently, that is, no copy is required during push and pull, and the pointer of the user's send / receive memory page is directly passed to the network card sending and receiving packet interface.
[0096] Step A2: Obtain the page frame number sequence of the current batch of physical memory pages to be migrated and the page identification sequence corresponding to the page frame number sequence, organize the data of the physical memory pages corresponding to the page frame number sequence into a continuous data stream, wherein the page identification sequence is attached to the header of the data stream.
[0097] After the migration starts, the migration source sends a batch of page frame sequences of physical memory pages to be migrated to the submodule 102, and at the same time, a set of corresponding page identification sequences needs to be sent down. The characteristic of the page identification is that the destination end user can index or apply for a certain receiving memory page based on the identification. In one embodiment, the sending action can be synchronous blocking or asynchronous non-blocking; in one embodiment, after the migration of the batch of memory pages is successful, the migration source can be notified through mechanisms such as interruption or synchronous wake-up. After the submodule 102 performs a validity check on the migration request, the validity check includes but is not limited to whether the input parameters are correct, whether the physical page is legal and can be migrated, etc., the data of the physical memory page sequence to be migrated is organized into a continuous data stream, and the header of the data stream must also be attached with a page identifier sequence. After the data stream is organized, it is handed over to the data push-pull acceleration submodule 104.
[0098] Exemplarily, before the step of obtaining the page frame number sequence of the current batch of physical memory pages to be migrated and the page identification sequence corresponding to the page frame number sequence, the method further includes:
[0099] A page identifier of a physical memory page is defined according to a migration scenario, wherein the page identifier is consensus information between a migration source end and a migration destination end.
[0100] Before obtaining the page frame number sequence and the corresponding page identifier sequence for the current batch of physical memory pages to be migrated, the migration source and migration destination must reach a consensus on the page identifier, determine consensus information, and define the page identifier of the physical memory page based on the migration scenario. The page identifier features are the consensus information between the migration source and migration destination, and can be flexibly defined based on the migration scenario, including but not limited to number, location, storage offset, etc. In this embodiment, the definition of the page identifier is not limited.
[0101] Step A3: Select the best copy method according to the specified migration type and software and hardware configuration to copy the data stream to the network packet buffer, and send the data stream on the network packet buffer to the migration destination corresponding to the logical link according to the network acceleration method.
[0102] The data fast push and pull submodule 104 has built-in functions including but not limited to DMA, multi-threaded copying, and page table switching. It can flexibly select a method at the migration source end based on the migration type and hardware support to copy or zero-copy the memory page data to be migrated to the network packet data stream. In this embodiment, the submodule 104 selects the best copy method based on the specified migration type and software and hardware environment to copy the data stream to the network packet buffer, and sends the data stream on the network packet buffer to the migration destination corresponding to the logical link in accordance with the network acceleration method. Then, the network acceleration submodule 105 sends the created migration data stream and the data stream copied to the network packet buffer to the network according to the network acceleration method determined when the logical channel is connected.
[0103] In one embodiment, step A2 and step A3 may be performed concurrently, that is, the data stream is constructed while the packet is sent, so as to achieve optimal efficiency.
[0104] Exemplarily, the step of selecting the best copy method according to the specified migration type and software and hardware configuration includes:
[0105] After confirming that the physical network card supports zero-copy capability, the optimal copy method is determined to be zero-copy;
[0106] After determining that the physical network adapter does not support zero-copy capabilities and the specified migration type is memory migration or local storage migration, the optimal copy mode is determined to be CPU multi-core concurrent copy.
[0107] After determining that the physical network card does not support zero-copy capability and the specified migration type is remote memory migration, the optimal copy mode is determined to be DMA push.
[0108] 1. If it is determined that the physical network card supports zero-copy capability, the pointer to the memory data to be sent is passed to the network card driver, and the data stream is copied to the network packet cache in a zero-copy manner. 2. If it is determined that the physical network card is a non-zero-copy network card, does not support zero-copy capability, and the migration channel type is memory migration or local storage migration, the CPU multi-core concurrent copy method is used to accelerate the copying of memory data into the packet cache of the network card driver. 3. If it is determined that the physical network card is a non-zero-copy network card, and the migration channel type is remote memory migration, indicating that the virtual machine migration acceleration device is on the sub-card device of the memory host to be migrated, choose to push the data to the memory to be migrated on the host to which the sub-card belongs through DMA push.
[0109] In this embodiment, a logical link for migration network transmission is created based on negotiation between the local network address and the network address of the migration destination, and a network acceleration method for the logical link is determined; the page frame number sequence of the current batch of physical memory pages to be migrated and the page identification sequence corresponding to the page frame number sequence are obtained, and the data of the physical memory pages corresponding to the page frame number sequence are organized into a continuous data stream, wherein the page identification sequence is attached to the header of the data stream; the best copy method is selected according to the specified migration type and software and hardware configuration to copy the data stream to the network packet sending cache, and the data stream on the network packet sending cache is sent to the migration destination corresponding to the logical link according to the network acceleration method.
[0110] A specific type of logical link is established between the migration source and the migration destination, that is, a logical acceleration channel is established, the optimal acceleration configuration is automatically detected and selected, and the network acceleration method of the logical link is determined. During the migration, the migration source combines memory data and page identification sequences into a data stream. After the migration destination is customized according to the business scenario and is ready to receive memory pages, the data stream is quickly pushed to the receiving memory pages, thus completing a migration.
[0111] The design abstracts the commonalities of multiple migration scenarios and incorporates adaptive steps that automatically identify the environment. This allows for diverse application scenarios, unifies the user interface across different migration scenarios, and shields against differences in architecture, software versions, and the capabilities of new and old underlying acceleration hardware. This results in highly efficient and versatile migration, compatible with various migration scenarios, and facilitates inter-migration between new and old hardware, as well as compatible upgrades based on component technology evolution and versions.
[0112] The present application provides a method for accelerating virtual machine migration. Referring to FIG. 4 , in another embodiment of the method for accelerating virtual machine migration, the method is applied to a migration destination, and the method includes:
[0113] Step B1: creating a logical link for migration network transmission based on the local network address and the network address of the migration source end through negotiation, and determining a network acceleration method for the logical link;
[0114] The virtual machine migration acceleration method in this embodiment can be implemented by combining a software module with traditional hardware, or by a dedicated hardware device. It can exist on the host machine that is coexisting with the virtual machine, or on a control subcard connected to the host machine. In other words, this method is suitable for hot migration of cloud computing virtual machines, and has various application scenarios. It can be applied to virtual machine memory migration or virtual machine local storage migration. The migration acceleration module can exist on the host machine that is coexisting with the virtual machine, or on a control subcard connected to the host machine. It can be implemented by software in conjunction with a general network card, or by hardware through a programmable smart network card. All forms of existence can provide a unified software interface for a variety of migration scenarios and have strong compatibility.
[0115] During the migration preparation phase, the migration source and destination nodes configure their respective network addresses through their respective migration channel configuration submodules 101. Based on these addresses, they negotiate to create a logical link for the migration network transmission and specify the migration type (memory migration, remote memory migration, local storage migration, or other). Simultaneously, the network transceiver acceleration submodules 105 on each node negotiate based on these network addresses, create a logical link for the migration network transmission, and automatically select a network acceleration method appropriate for this logical link based on the hardware and software configurations of the source and destination nodes.
[0116] Exemplarily, the step of determining the network acceleration mode of the logical link includes:
[0117] The software and hardware configurations of the migration source end and the migration destination end carrying the logical link are obtained, and the network acceleration mode of the logical link is determined according to the software and hardware configurations.
[0118] 1. Submodule 105 detects the logical link of the migration network transmission and determines whether it can be accelerated in hardware by using multiple physical network cards through multifd (multi-channel migration), link aggregation, etc. 2. Submodule 105 reads the software configuration to determine whether a dedicated CPU core is reserved for the logical link. If a dedicated CPU core is reserved, the network sending and receiving process will be bound to the reserved core and interference exclusion processing will be performed. 3. Submodule 105 detects whether the physical network card supports zero-copy capability. If it supports zero-copy capability, it is necessary to inform submodule 104 to use zero-copy method to send and receive data subsequently, that is, no copy is required during push and pull, and the pointer of the user's send / receive memory page can be directly passed into the network card packet sending and receiving interface.
[0119] Step B2: receiving the data stream sent by the migration source end corresponding to the logical link according to the network acceleration method, and saving the data stream to a network packet receiving buffer;
[0120] The network transmission and reception acceleration submodule 105 typically includes one or a group of independent network packet transmission and reception processes. This submodule is characterized by scanning the hardware environment and software configuration, determining the network acceleration method for the logical link, and then, at the migration destination, receiving the data stream sent by the migration source corresponding to the logical link according to the network acceleration method and storing it in the network packet receiving buffer. In this embodiment, the network acceleration submodule 105 receives the data stream sent by the migration source corresponding to the logical link according to the network acceleration method determined when the logical channel is connected, and stores it in the network packet receiving buffer.
[0121] Step B3, parsing the data stream on the network packet receiving buffer to obtain a page identification sequence, preparing to receive a memory page according to the page identification sequence, and determining a page frame number sequence of the ready-to-receive memory page;
[0122] After the data stream is received by the migration destination terminal module 105, submodule 105 sends the received data to submodule 103, which parses the data to obtain a page identifier. The migration destination parses the page identifier in the data stream header from submodule 103, indexes or requests it based on the service characteristics, and prepares the memory pages to receive. It then returns the prepared page frame sequence to submodule 103. Regardless of the service characteristics or the specific service situation, the corresponding memory pages must be prepared.
[0123] In one embodiment, while the submodule 103 is waiting for the migration destination to send back the page frame sequence of the received memory page, the submodule 105 does not need to block the network reception of the data stream, but instead creates a buffer space to temporarily store the data stream received during the waiting period, thereby achieving better migration efficiency.
[0124] Exemplarily, before the step of parsing the page identification sequence obtained from the data stream in the network packet receiving buffer, the method further includes:
[0125] A page identifier of a physical memory page is defined according to a migration scenario, wherein the page identifier is consensus information between a migration source end and a migration destination end.
[0126] Before obtaining the page frame number sequence and the corresponding page identifier sequence for the current batch of physical memory pages to be migrated, the migration source and migration destination must reach a consensus on the page identifier, determine consensus information, and define the page identifier of the physical memory page based on the migration scenario. The page identifier features are the consensus information between the migration source and migration destination, and can be flexibly defined based on the migration scenario, including but not limited to number, location, storage offset, etc. In this embodiment, the definition of the page identifier is not limited.
[0127] Step B4: Select the best copy method according to the specified migration type and software and hardware configuration to copy the data stream in the network packet receiving buffer to the receiving memory page corresponding to the prepared page frame number sequence.
[0128] The fast data push / pull submodule 104 includes built-in functions including, but not limited to, DMA, multi-threaded copying, and page table switching. Based on the migration type and hardware support, it flexibly selects a method at the migration destination to copy or zero-copy data from the network packet data stream to the receiving memory page. In this embodiment, the optimal copy method is selected based on the specified migration type and hardware and software configuration to copy the data stream from the network packet buffer to the receiving memory page corresponding to the prepared page frame number sequence.
[0129] In one embodiment, after receiving the page frame sequence of the receiving physical memory page, the sub-module 103 notifies the sub-module 104 to copy or zero-copy the data from the packet receiving cache of the network card to the prepared receiving physical memory page. After the push is completed, the sub-module 103 needs to use interrupts, messages or polling to notify the migration destination of the event, that is, the event notification that the current batch has been pushed and everything has been saved.
[0130] In one embodiment, the migration destination terminal module 105 releases the cache of the current batch of data streams and continues to receive the next batch of migration data streams from the network until the sub-module 104 and sub-module 105 at the migration source end find that there is no new data to send, and then notify the sub-module 102. The sub-module 102 then notifies the migration source end of the completion of the migration of the batch of memory page data through interruption or blocking wake-up, and can then send the next batch for migration until the final migration is completed.
[0131] In one embodiment, for the migration type of local storage, it is necessary to wait for the migration destination to reply that the data has been taken away and is ready to be written or has been written to the storage device before releasing the cache of this batch of data streams.
[0132] Exemplarily, the step of selecting the best copy method according to the specified migration type and software and hardware configuration includes:
[0133] After confirming that the physical network card supports zero-copy capability, the optimal copy method is determined to be zero-copy;
[0134] After determining that the physical network adapter does not support zero-copy capabilities and the specified migration type is memory migration or local storage migration, the optimal copy mode is determined to be CPU multi-core concurrent copy.
[0135] After determining that the physical network card does not support zero-copy capability and the specified migration type is remote memory migration, the optimal copy mode is determined to be DMA push.
[0136] 1. If it is determined that the physical network card supports zero-copy capability, the pointer to the memory data to be sent is passed to the network card driver, and the data stream is copied to the network packet cache in a zero-copy manner. 2. If it is determined that the physical network card is a non-zero-copy network card, does not support zero-copy capability, and the migration channel type is memory migration or local storage migration, the CPU multi-core concurrent copy method is used to accelerate the copying of memory data into the packet cache of the network card driver. 3. If it is determined that the physical network card is a non-zero-copy network card, and the migration channel type is remote memory migration, indicating that the virtual machine migration acceleration device is on the sub-card device of the memory host to be migrated, choose to push the data to the memory to be migrated on the host to which the sub-card belongs through DMA push.
[0137] In this embodiment, a logical link for migration network transmission is created based on negotiation between the local network address and the network address of the migration source, and a network acceleration method for the logical link is determined; the data stream sent by the migration source corresponding to the logical link is received according to the network acceleration method, and saved to the network packet receiving cache; the page identification sequence obtained by parsing the data stream on the network packet receiving cache is prepared, and a receiving memory page is prepared according to the page identification sequence, and a page frame number sequence of the ready receiving memory page is determined; the best copy method is selected according to the specified migration type and software and hardware configuration to copy the data stream on the network packet receiving cache to the receiving memory page corresponding to the ready page frame number sequence.
[0138] A specific type of logical link is established between the migration source and the migration destination, that is, a logical acceleration channel is established, the optimal acceleration configuration is automatically detected and selected, and the network acceleration method of the logical link is determined. During the migration, the migration source combines memory data and page identification sequences into a data stream. After the migration destination is customized according to the business scenario and is ready to receive memory pages, the data stream is quickly pushed to the receiving memory pages, thus completing a migration.
[0139] The design abstracts the commonalities of multiple migration scenarios and incorporates adaptive steps that automatically identify the environment. This allows for diverse application scenarios, unifies the user interface across different migration scenarios, and shields against differences in architecture, software versions, and the capabilities of new and old underlying acceleration hardware. This results in highly efficient and versatile migration, compatible with various migration scenarios, and facilitates inter-migration between new and old hardware, as well as compatible upgrades based on component technology evolution and versions.
[0140] Referring to Figure 5, in an application scenario of the present application, the virtual machine migration acceleration system of the present application is used to accelerate the hot migration of virtual machine memory, running on an x86 LINUX server as a kernel module or hardware device. The operating system runs the kernel of the LINUX system, using QEMU (a user-mode virtualization program) + KVM (Kernel-based Virtual Machine, a kernel-based virtualization solution) as a virtualization VMM (Virtual Machine Monitor, also known as Hypervisor), and at the same time runs the Linux system virtual machine currently used by the business user as the migration source virtual machine. In this application scenario, the following roles are specifically included:
[0141] 301, serving as a migration source x86 server host, includes a LINUX kernel and the software system running thereon, and provides a virtual machine operating environment.
[0142] 302, serving as the migration destination x86 server host, includes a Linux kernel and the software system running on it, providing a virtual machine operating environment. In one embodiment, it is connected to the migration source server via a 100G fiber optic network. In this embodiment, the network card is a standard network card that does not support zero copy.
[0143] 303 and 304 are QEMU in user mode and KVM in kernel mode running on the host machines of the migration source and migration destination respectively. The two constitute the virtual machine simulator and monitor (VMM), which is responsible for the life cycle of the virtual machine and the status maintenance of the hot migration action.
[0144] 305 and 306 are universal migration acceleration modules that exist as kernel modules or hardware devices on the host machines of the migration source and migration destination, respectively, that is, the virtual machine migration acceleration system of the present application.
[0145] In one embodiment, the specific implementation steps for implementing accelerated hot migration of virtual machine memory are as follows:
[0146] Step 401, when the hot migration of the virtual machine memory on the migration source host 301 begins, first 303 QEMU accesses 305 acceleration module, negotiates with the opposite end and the migration destination 304 and 306, and creates a migration acceleration logical channel, the channel type of which is memory migration.
[0147] Step 402, hot migration begins. During the memory hot migration of the virtual machine running on the source host machine 301, each memory page of the memory write operation will be recorded by 303KVM and marked as a "dirty" memory page. When the physical memory PFN (Page Frame Number, the page frame number of the physical memory page) corresponding to all dirty pages within a time period can be collected by 303KVM, a sequence can be formed.
[0148] In step 403, KVM sends the PFN sequence collected over a time period to the 305 general migration acceleration module, and also groups the corresponding positions (or offsets) of these dirty pages on the virtual machine GPA (Guest Physical Address, the pseudo-physical address space corresponding to the virtual machine operating system) into a sequence as a page identification sequence, which is also sent to the 305 general migration acceleration module at the same time.
[0149] In step 404, the data push-pull acceleration submodule of acceleration module 305 uses a multi-threaded copy method to copy the physical page contents of the PFN sequence into the network card's packet sending buffer, forming a data stream. A page identifier sequence indicating the GPA location is enclosed in the data stream header. The network packet sending thread is then isolated, giving it exclusive CPU access (the destination end's network packet receiving thread also has exclusive CPU access). Network packet sending and copying into the packet sending buffer are performed concurrently to achieve the fastest migration transmission rate.
[0150] Step 405: After receiving the migrated data stream, 306 first parses the header identification sequence, i.e., the offset position sequence in the virtual machine pseudo-physical memory GPA, and passes it to the QEMU at the destination end 304. 304 finds the host user state address in the virtual machine memory space maintained by the QEMU user state based on these offset positions, i.e., the memory page corresponding to the HVA (Guest Virtual Address, the host virtual address space used by the host VMM program to simulate the virtual machine memory) as the receiving page, and returns the receiving page address to 306.
[0151] In step 406 , the data push-pull acceleration submodule of the acceleration module 306 copies the data stream to the receiving page address using a multi-threaded copy method, thereby completing the synchronization of the batch of memory dirty pages.
[0152] Step 407 , after the copying is completed, 306 releases the cache of this batch of received data streams and continues to receive the dirty page data streams of the next time period, ultimately completing the migration synchronization of all memory dirty pages.
[0153] Referring to Figure 6, in another application scenario of the present application, the virtual machine migration acceleration system of the present application is used to accelerate the hot migration of the local storage disk used by the virtual machine. It also runs on an x86 server, the operating system runs the LINUX kernel, and uses QEMU as the virtualization VMM (Hypervisor). At the same time, the Linux system virtual machine currently used by the business user runs on it. The virtual machine accesses the disk array storage device RAID1 on the host machine through the virtio-blk virtualization device commonly used in the industry. In this application scenario, the following roles are specifically included:
[0154] 501, the migration source end x86 server host includes a LINUX kernel and QEMU running thereon as a virtualization VMM, providing a virtual machine operating environment.
[0155] 502. The migration destination x86 server host includes a Linux kernel and QEMU running on it as a virtualized VMM, providing a virtual machine operating environment. In one embodiment, the server is connected to the migration source server via a 100G fiber optic network. In this embodiment, the network card is a standard network card that does not support zero copy.
[0156] 503 and 504 are QEMU running in user mode on the migration source and migration destination hosts, respectively. When an IO (input / output) request is submitted inside the virtual machine, it will exit and be taken over by QEMU, and the IO request will be taken out from the semi-virtualized virtio-blk device of the virtual machine and submitted to the storage block device / dev / sda on the host. They also serve as the initiator and receiver of the virtual machine hot migration, respectively, and directly interact with the general migration acceleration modules 505 and 506 of this application.
[0157] 505 and 506 are universal migration acceleration modules that exist as kernel modules on the host machines at the migration source and migration destination, respectively, that is, the virtual machine migration acceleration system of the present application.
[0158] In one embodiment, the specific implementation steps for implementing accelerated hot migration of virtual machine local storage are as follows:
[0159] In step 601, the migration source and destination hosts 501 and 502 respectively cache the disk block device / dev / sda to be migrated using mmap (a memory-mapped file method). The QEMUs on both ends create a logical migration channel of the local storage migration type through their respective migration acceleration modules.
[0160] In step 602, each IO write operation of the migration source virtual machine to the virito-blk driver during the migration period will be notified to 503 QEMU through virtio kick. QEMU then submits the IO write request to / dev / sda of the host machine and records the write location corresponding to / dev / sda as a dirty block. Then, the buffer page corresponding to the corresponding write location is found from the mmap space and pinned in the memory.
[0161] Step 603 , the migration source end 503 QEMU collects the physical cache page sequence that is currently pinned in the memory and passes it to the migration acceleration module of the migration source end 505 , and also needs to pass the corresponding offset of the cache page on the disk into an identification sequence to 505 .
[0162] In step 604, the acceleration module 505 uses a multi-threaded copy method to copy the cache page content into the network card's packet sending buffer and encapsulates the offset position identification sequence in the data stream header. This isolates the network packet sending thread, giving it exclusive CPU access (the destination end's network packet receiving thread also has exclusive CPU access). Concurrent packet sending and copying are performed to achieve the fastest migration transmission rate.
[0163] Step 605: After 506 receives the migrated data stream, it first parses the header identification sequence, i.e., the offset position sequence in the disk, and hands it over to the migration destination QEMU 504. Based on these offset positions, 504 finds the page cache of the corresponding offset position from the memory space of the target end / dev / sda block device mmap, pins it, and collects the physical memory page frame numbers corresponding to all the fixed cache pages, and returns them to 506 as the received memory page frame sequence.
[0164] Step 606: While QEMU is receiving fixed memory pages in step 605, 506 continues to receive the migration data stream from the network into its own cache. After 506 confirms the receive memory page sequence returned by 504, it copies the cached data stream to the receive memory page through multi-threaded concurrent copying.
[0165] Step 607, after 506 completes pushing the batch of data streams to the receiving memory page, it checks that the current channel is the local storage migration channel, and needs to notify 504 QEMU again through an interrupt. QEMU unpins this batch of receiving memory pages and sets them as dirty pages. Since these receiving memory pages themselves are the page cache of the block device / dev / sda, the page cache content will be automatically written back to the / dev / sda device by the 502 operating system at an appropriate time.
[0166] Step 608: After the received page is unpinned, QEMU 504 responds to the migration acceleration module 506 that the data has been received, and 506 releases the local cache of the data. This completes the data migration synchronization from the migration source / dev / sda to the migration destination / dev / sda.
[0167] Referring to Figure 7, in another application scenario of the present application, the virtual machine migration acceleration system of the present application is used to accelerate the hot migration of virtual machines in the management plane unloading scenario. Most of the current cloud computing hosts require that the environment in which the virtual machines run is as interference-free as possible, and a large number of control programs are sunk or called "unloaded" to the control sub-card, which generally runs another operating system. In this application scenario, the control sub-card is a PCIE (Peripheral Component Interconnect Express) sub-card inserted into the x86LINUX server, which runs the aarch64 (a RISC architecture, also known as ARM64) LINUX system and migration status control program. The migration acceleration module of the present application can be run as a kernel module of the control sub-card or as an independent hardware sub-card device. Specifically included in this application scenario are the following roles:
[0168] 701 and 702 represent the source and destination x86 server hosts in the control plane offload scenario. These hosts include the Linux kernel and virtualization components running on it, providing the virtual machine's operating environment. Unlike non-offload scenarios, the x86 servers are significantly streamlined because a large amount of control software is offloaded to the daughter card. In this scenario, the network adapters for the control plane and migration-related networks are not connected to the x86 servers but to the control daughter card.
[0169] 703 and 704 are QEMU in user mode and KVM in kernel mode running on the migration source and destination hosts, respectively. The two constitute the virtual machine emulator and monitor (VMM). In the offload scenario, the functions of the two are simplified as much as possible, and the maintenance of migration-related status is handed over to the control daughter card.
[0170] 705 and 706 are control daughter cards on the migration source and destination hosts, respectively. They connect to the x86 server via PCIE slots and can interact with QEMU on the x86 server via messages. The control daughter cards are responsible for maintaining the lifecycle and migration status of the virtual machine. In one embodiment, the migration source and destination control daughter cards are connected via a 100G fiber optic network. In this embodiment, the network card is a standard network card that does not support zero copy.
[0171] 707 and 708 are the universal migration acceleration modules of the present application that exist as control daughter card kernel modules or independent hardware daughter cards on the migration source and migration destination host machines, respectively.
[0172] In one embodiment, the specific implementation steps for implementing accelerated live migration of virtual machine memory in a control plane offload scenario are as follows:
[0173] Step 801, when the hot migration of the virtual machine memory on the migration source host 701 begins, the migration source control subcard 705 first accesses the acceleration module 707, negotiates with the other ends 706 and 708, and creates a migration acceleration logical channel, the channel type of which is remote memory migration.
[0174] In step 802, all memory pages of the virtual machines to be migrated on the x86 servers 701 and 702 at the migration source and migration destination are applied for and pinned (pinned). Note that the memory content of the virtual machine at the migration destination is empty at this time, but memory pages with blank content also need to be applied for and pinned (pinned). Then, DMA mapping is performed on the control sub-card or the migration acceleration sub-card. The purpose is to enable the migration acceleration module / sub-card of this application to access the entire memory space of the virtual machine through DMA (Direct Memory Access).
[0175] Step 803, start hot migration. During the memory hot migration of the virtual machine running on the migration source host machine 701, each memory page of the memory write operation will be recorded by 703KVM and marked as a "dirty" memory page. When the physical memory PFN corresponding to all dirty pages within a time period can be collected by 703KVM, a sequence can be formed.
[0176] In step 804, during the migration process, KVM sends the PFN sequence collected in each time period to the 705 control sub-card through a message, and at the same time, the corresponding positions (or offsets) of these dirty pages on the virtual machine GPA are also composed into a sequence as a page identification sequence, which is also sent to the 705 control sub-card at the same time, and the control sub-card then transfers it to the 707 general acceleration module.
[0177] In step 805, since the migration channel type is remote memory migration, the data push-pull acceleration submodule of acceleration module 707 uses DMA to pull the physical page contents of the PFN sequence from the x86 server and copy them to the network card's packet buffer, forming a data stream. The page identifier sequence indicating the GPA location is enclosed in the data stream header. The network packet sending thread is then isolated, giving it exclusive CPU access (the destination end's network packet receiving thread also has exclusive CPU access). Network packet sending and DMA pulling and copying memory pages to the packet buffer are performed concurrently to achieve the fastest migration transmission rate.
[0178] In step 806, after receiving the migrated data stream, 708 first parses the page identifier sequence in the header, i.e., the offset position sequence in the virtual machine's pseudo-physical memory GPA. Since DMA mapping has been performed on the entire virtual machine's memory space in advance, it is clear that the GPA offset corresponds to the IOVA (Virtual Address) offset during the DMA operation. Furthermore, since the memory page has been pinned in advance, the received memory page on the migration destination x86 server is also ready by default.
[0179] In step 807, since the migration channel type is remote memory migration, the data push-pull acceleration submodule of the acceleration module 708 uses DMA push to push the page content in the data stream to the IOVA offset specified by the page identification sequence, completing the synchronization of this batch of dirty pages.
[0180] Step 808: After the DMA push is completed, 708 releases the cache of this batch of received data streams and continues to receive the dirty page data streams of the next time period, finally completing the migration synchronization of all memory dirty pages. After the migration is completed, the virtual machine memory space can be unpinned and the DMA mapping of the migration acceleration module can be canceled.
[0181] Through the above application scenarios, it can be seen that in this application, the common points of multiple migration scenarios are abstracted in the design, and an adaptive step that can automatically identify the environment is added. The application scenarios are diverse: it can be applied to virtual machine memory migration, and it can also be applied to virtual machine local storage migration. The migration acceleration module can exist on the host machine with the virtual machine, or on the control sub-card connected to the host machine. It can be implemented by software in conjunction with a general network card, or by hardware through a programmable smart network card. This application can unify the user interface in different virtual machine migration scenarios, and shield the differences in architecture, software version, and the differences in the capabilities of the new and old hardware of the underlying acceleration. The migration efficiency is very high and the versatility is very strong, which facilitates the mutual migration based on the old and new hardware in the cloud computing scenario, the respective technical evolution of the components, and the compatible upgrade of the version.
[0182] 8 , in addition, an embodiment of the present application further provides a first virtual machine migration acceleration device, the first virtual machine migration acceleration device comprising:
[0183] A first preparation module M1 is configured to negotiate and create a logical link for migration network transmission based on the local network address and the network address of the migration destination, and determine a network acceleration method for the logical link;
[0184] The encapsulation module M2 is configured to obtain a page frame number sequence of the physical memory pages to be migrated in the current batch and a page identification sequence corresponding to the page frame number sequence, and organize the data of the physical memory pages corresponding to the page frame number sequence into a continuous data stream, wherein the page identification sequence is attached to the header of the data stream;
[0185] The sending module M3 is used to select the best copy method to copy the data stream to the network packet buffer according to the specified migration type and software and hardware configuration, and send the data stream on the network packet buffer to the migration destination corresponding to the logical link according to the network acceleration method.
[0186] Exemplarily, the first preparation module is further configured to:
[0187] The software and hardware configurations of the migration source end and the migration destination end carrying the logical link are obtained, and the network acceleration mode of the logical link is determined according to the software and hardware configurations.
[0188] Exemplarily, the first virtual machine migration acceleration device further includes a first consensus module, configured to:
[0189] Before the step of obtaining the page frame number sequence of the current batch of physical memory pages to be migrated and the page identification sequence corresponding to the page frame number sequence,
[0190] A page identifier of a physical memory page is defined according to a migration scenario, wherein the page identifier is consensus information between a migration source end and a migration destination end.
[0191] Exemplarily, the sending module is further configured to:
[0192] After confirming that the physical network card supports zero-copy capability, the optimal copy method is determined to be zero-copy;
[0193] After determining that the physical network adapter does not support zero-copy capabilities and the specified migration type is memory migration or local storage migration, the optimal copy mode is determined to be CPU multi-core concurrent copy.
[0194] After determining that the physical network card does not support zero-copy capability and the specified migration type is remote memory migration, the optimal copy mode is determined to be DMA push.
[0195] 9 , in addition, an embodiment of the present application further provides a second virtual machine migration acceleration device, the second virtual machine migration acceleration device comprising:
[0196] A second preparation module N1 is configured to negotiate and create a logical link for migration network transmission based on the local network address and the network address of the migration source, and determine a network acceleration method for the logical link;
[0197] a receiving module N2, configured to receive the data stream sent by the migration source end corresponding to the logical link according to the network acceleration mode, and save the data stream to a network packet receiving buffer;
[0198] a parsing module N3, configured to parse the data stream on the network packet receiving buffer to obtain a page identification sequence, prepare a receiving memory page according to the page identification sequence, and determine a page frame number sequence of the ready-to-receive memory page;
[0199] The cache module N4 is configured to select an optimal copy method according to the specified migration type and software and hardware configurations to copy the data stream in the network packet receiving cache to the receiving memory page corresponding to the prepared page frame number sequence.
[0200] Exemplarily, the second preparation module is further configured to:
[0201] The software and hardware configurations of the migration source end and the migration destination end carrying the logical link are obtained, and the network acceleration mode of the logical link is determined according to the software and hardware configurations.
[0202] Exemplarily, the second virtual machine migration acceleration device further includes a second consensus module, which is configured to:
[0203] Before the step of parsing the page identification sequence obtained from the data stream on the network packet receiving buffer,
[0204] A page identifier of a physical memory page is defined according to a migration scenario, wherein the page identifier is consensus information between a migration source end and a migration destination end.
[0205] The first virtual machine migration acceleration device and the second virtual machine migration acceleration device provided in this application employ the virtual machine migration acceleration method of the aforementioned embodiment to resolve the technical issue of conventional virtual machine hot migration methods being incompatible with migration scenarios. Compared to conventional technologies, the beneficial effects of the first virtual machine migration acceleration device and the second virtual machine migration acceleration device provided in the embodiments of this application are the same as the beneficial effects of the virtual machine migration acceleration method provided in the aforementioned embodiment, and the other technical features of the first virtual machine migration acceleration device and the second virtual machine migration acceleration device are the same as those disclosed in the aforementioned embodiment method, and are not further elaborated here.
[0206] In addition, an embodiment of the present application also provides a migration device, which includes: a memory, a processor, and a computer program stored on the memory and runnable on the processor. When the computer program is executed by the processor, the steps of the virtual machine migration acceleration method described above are implemented.
[0207] In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the virtual machine migration acceleration method described above are implemented.
[0208] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.
[0209] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to conventional technology can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0210] The above are merely optional embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for accelerating virtual machine migration, wherein: The method is applied to the migration source end, and the method includes: Negotiate and create a logical link for migration network transmission according to the local network address and the network address of the migration destination, and determine a network acceleration method for the logical link; Obtaining a page frame number sequence of the physical memory pages to be migrated in the current batch and a page identification sequence corresponding to the page frame number sequence, and organizing the data of the physical memory pages corresponding to the page frame number sequence into a continuous data stream, wherein the page identification sequence is attached to the header of the data stream; The best copy method is selected according to the specified migration type and software and hardware configuration to copy the data stream to the network packet buffer, and the data stream on the network packet buffer is sent to the migration destination corresponding to the logical link according to the network acceleration method.
2. The virtual machine migration acceleration method according to claim 1, wherein: The step of determining the network acceleration mode of the logical link comprises: The software and hardware configurations of the migration source end and the migration destination end that carry the logical link are obtained, and the network acceleration mode of the logical link is determined according to the software and hardware configurations.
3. The virtual machine migration acceleration method according to claim 1, wherein: Before the step of obtaining the page frame number sequence of the current batch of physical memory pages to be migrated and the page identification sequence corresponding to the page frame number sequence, the method further includes: A page identifier of a physical memory page is defined according to a migration scenario, wherein the page identifier is consensus information of a migration source end and a migration destination end.
4. The virtual machine migration acceleration method according to claim 1, wherein: The step of selecting the best copy method according to the specified migration type and software and hardware configurations includes: After confirming that the physical network card supports zero-copy capability, determine that the best copy mode is zero-copy mode; After determining that the physical network card does not support zero copy capability and the specified migration type is memory migration or local storage migration, determine that the best copy mode is CPU multi-core concurrent copy mode; After determining that the physical network card does not support the zero copy capability and the specified migration type is remote memory migration, it is determined that the best copy mode is the DMA push mode.
5. A method for accelerating virtual machine migration, wherein: The method is applied to the migration destination, and the method includes: Negotiate and create a logical link for migration network transmission based on the local network address and the network address of the migration source, and determine a network acceleration method for the logical link; receiving the data stream sent by the migration source end corresponding to the logical link according to the network acceleration mode, and saving the data stream to the network packet receiving cache; Parsing the data stream on the network packet receiving buffer to obtain a page identification sequence, preparing a receiving memory page according to the page identification sequence, and determining a page frame number sequence of the ready receiving memory page; The best copying method is selected according to the specified migration type and software and hardware configuration to copy the data stream on the network packet receiving buffer to the receiving memory page corresponding to the ready page frame number sequence.
6. The virtual machine migration acceleration method according to claim 5, wherein: The step of determining the network acceleration mode of the logical link comprises: The software and hardware configurations of the migration source end and the migration destination end that carry the logical link are obtained, and the network acceleration mode of the logical link is determined according to the software and hardware configurations.
7. The virtual machine migration acceleration method according to claim 5, wherein: Before the step of parsing the page identification sequence obtained by the data stream on the network packet receiving buffer, the method further includes: A page identifier of a physical memory page is defined according to a migration scenario, wherein the page identifier is consensus information of a migration source end and a migration destination end.
8. A virtual machine migration acceleration system, wherein: The system is located on the migration source end and the migration destination end, and the system includes: A migration channel configuration submodule is configured to negotiate and create a logical link for migration network transmission according to the network addresses of the migration source and the migration destination; The migration memory sending submodule is configured to obtain the page frame number sequence of the physical memory pages to be migrated in the current batch and the page identification sequence corresponding to the page frame number sequence, and organize the data of the physical memory pages corresponding to the page frame number sequence into a continuous data stream, wherein the page identification sequence is attached to the header of the data stream; The data fast push-pull submodule is configured to select the best copy method according to the specified migration type and software and hardware configuration to copy the data stream to the network packet sending buffer; and is also configured to select the best copy method according to the specified migration type and software and hardware configuration to copy the data stream on the network packet receiving buffer to the receiving memory page corresponding to the ready page frame number sequence; A network transceiver acceleration submodule, configured to determine a network acceleration mode for the logical link; further configured to send the data stream on the network packet sending buffer to the migration destination corresponding to the logical link according to the network acceleration mode; further configured to receive the data stream sent by the migration source corresponding to the logical link according to the network acceleration mode, and save it to the network packet receiving buffer; The submodule waiting for the receiving memory page to be ready is configured to parse the page identification sequence obtained by the data stream on the network packet receiving buffer, prepare the receiving memory page according to the page identification sequence, and determine the page frame number sequence of the ready receiving memory page.
9. A migration device, wherein: The migration device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the virtual machine migration acceleration method according to any one of claims 1 to 7.
10. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the virtual machine migration acceleration method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Virtual machine live migration method and virtual machine live migration system
CN106911534A
Data migration method, device and system
CN111666036A
Conversion and migration method and system of virtual machine
CN111679889A
Virtual machine thermal migration method and device based on intelligent network card, equipment and medium
CN111736945A
Information processing method, physical machine and PCIE equipment
CN112306624A
