Virtual machine migration method and system, server, and storage medium
By obtaining and migrating the hardware acceleration device information and dirty page information of virtual machines, the problem of live migration of virtual machines is solved, and efficient migration and business continuity of virtual machines are achieved.
Patent Information
- Application Number
- PCT/CN2024/071206
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-22
- Filing Date
- 2024-01-08
- Publication Date
- 2024-08-29
AI Technical Summary
Existing technology cannot realize complete live migration of virtual machines, especially when the server load is unbalanced or requires maintenance. Virtual machines cannot be migrated to other host servers without interrupting business.
By obtaining the hardware acceleration device information and configuration parameters of the source virtual machine, creating the destination virtual machine and configuring the same hardware acceleration device, and migrating its dirty page information, the live migration of the virtual machine is achieved.
Efficient and accurate live migration of virtual machines is achieved, reducing server load and ensuring business continuity and resource utilization.
Smart Images

Figure CN2024071206_29082024_PF_FP_ABST
Abstract
Description
Virtual machine migration method, server, system and storage medium
[0001] Related applications
[0002] This application claims priority to Chinese patent application No. 202310190240.1 filed on February 22, 2023, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The embodiments of the present application relate to the field of cloud computing technology, and in particular to a virtual machine migration method, server, system, and storage medium. Background Art
[0004] A virtual machine (VM) is a complete computer system with complete hardware system functionality, simulated through software and running in a completely isolated environment. VMs typically run on a host server, and each host server can run multiple VMs. To improve server utilization, an increasing number of acceleration devices (Field Programmable Gate Array (FPGA) accelerator cards and Data Processing Unit (DPU) accelerator cards) are being inserted into servers to offload network and disk functions to the accelerators. The server is then solely responsible for computing and memory virtualization, significantly reducing the server burden and enabling the operation of more VMs.
[0005] Nowadays, the server resources required by virtual machines depend on the business load running in the virtual machines. When the virtual machines run heavy-load businesses, the server host resources will be under great pressure. For load balancing reasons, some virtual machines need to be hot migrated to servers with less load to run; or when the server needs maintenance (for example, upgrading or replacing parts, etc.), the virtual machines with business can be migrated to other servers if the programs running the business cannot be terminated or paused. However, current technology cannot completely hot migrate virtual machines to other host servers.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide a virtual machine migration method, server, system and storage medium, aiming to implement hot migration of virtual machines.
[0008] In a first aspect, an embodiment of the present application provides a virtual machine migration method, comprising:
[0009] Obtaining hardware acceleration device information and configuration parameter information corresponding to the source virtual machine to be migrated, wherein the hardware acceleration device information includes device description information of one or more hardware acceleration devices configured on the source virtual machine;
[0010] Determine a destination host machine, and send the hardware acceleration device information and configuration parameter information to the destination host machine, so that the destination host machine can create a destination virtual machine with the same configuration as the source virtual machine according to the configuration parameter information, and configure a destination hardware acceleration device of the destination virtual machine according to the hardware acceleration device information;
[0011] Obtain first dirty page information corresponding to each of the hardware acceleration devices and second dirty page information of the source virtual machine, and migrate the first dirty page information and the second dirty page information to the destination host machine. When the migration is completed, the destination host machine controls the destination virtual machine and each of the destination hardware acceleration devices to start running.
[0012] In a second aspect, an embodiment of the present application further provides a virtual machine migration system, the virtual machine migration system including a source host machine and a destination host machine, wherein:
[0013] The source host machine is configured to obtain hardware acceleration device information and configuration parameter information corresponding to the source virtual machine to be migrated, wherein the hardware acceleration device information includes device description information of one or more hardware acceleration devices configured on the source virtual machine;
[0014] The source host machine is further configured to determine a destination host machine and send the hardware acceleration device information and configuration parameter information to the destination host machine;
[0015] The destination host machine is configured to receive the hardware acceleration device information and configuration parameter information, create a destination virtual machine with the same configuration as the source virtual machine according to the configuration parameter information, and configure a destination hardware acceleration device of the destination virtual machine according to the hardware acceleration device information;
[0016] The source host machine is further configured to obtain first dirty page information corresponding to each of the hardware acceleration devices and second dirty page information of the source virtual machine, and migrate the first dirty page information and the second dirty page information to the destination host machine;
[0017] The destination host machine is further configured to receive the first dirty page information and the second dirty page information, and control the destination virtual machine and each of the destination hardware acceleration devices to start running when the migration is completed.
[0018] In a third aspect, an embodiment of the present application further provides a server, comprising a processor, a memory, a computer program stored on the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of any one of the virtual machine migration methods provided in the specification of this application are implemented.
[0019] In a fourth aspect, an embodiment of the present application further provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any virtual machine migration method provided in the specification of this application. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] FIG1 is a flow chart of a virtual machine migration method provided in an embodiment of the present application;
[0021] FIG2 is a schematic diagram of the sub-step flow of the virtual machine migration method in FIG1 ;
[0022] FIG3 is a schematic flow chart of another sub-step of the virtual machine migration method in FIG1 ;
[0023] FIG4 is a schematic diagram of a scenario of a virtual machine migration method provided in an embodiment of the present application;
[0024] FIG5 is a schematic block diagram of the structure of a virtual machine migration system provided in an embodiment of the present application;
[0025] FIG6 is a schematic block diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0027] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[0028] It should be understood that the terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit this application. As used in this specification, the singular forms "a", "an" and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0029] The embodiment of the present application provides a virtual machine migration method, server, system and storage medium. The virtual machine migration method can be applied to servers, including desktop servers, rack servers, cabinet servers, blade servers and cloud servers. For example, the server is a desktop server, and the desktop server obtains the hardware acceleration device information and configuration parameter information corresponding to the source virtual machine to be migrated, and the hardware acceleration device information includes the device description information of one or more hardware acceleration devices configured by the source virtual machine; determines the destination host machine, and sends the hardware acceleration device information and configuration parameter information to the destination host machine, so that the destination host machine can create a destination virtual machine with the same configuration as the source virtual machine according to the configuration parameter information, and configure the destination hardware acceleration device of the destination virtual machine according to the hardware acceleration device information; obtains the first dirty page information corresponding to each hardware acceleration device and the second dirty page information of the source virtual machine, and migrates the first dirty page information and the second dirty page information to the destination host machine, wherein, when the migration is completed, the destination host machine controls the destination virtual machine and each destination hardware acceleration device to start running.
[0030] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.
[0031] Please refer to Figure 1, which is a flowchart of a virtual machine migration method provided in an embodiment of the present application.
[0032] As shown in FIG1 , the virtual machine migration method includes steps S101 to S103 .
[0033] Step S101: Obtain hardware acceleration device information and configuration parameter information corresponding to a source virtual machine to be migrated, wherein the hardware acceleration device information includes device description information of one or more hardware acceleration devices configured on the source virtual machine.
[0034] The hardware acceleration device information stores information about each hardware acceleration device and its device description. The hardware acceleration device information includes the name and address of the hardware acceleration device, and the device description includes the attributes and type of the acceleration device. The virtual machine configuration parameter information includes information such as the virtual CPU and memory.
[0035] In one embodiment, a migration instruction of a source virtual machine to be migrated is obtained, and based on the migration instruction, device description information, name information, and address information of one or more hardware acceleration devices configured for the source virtual machine are obtained; each hardware acceleration device is abstracted to generate hardware acceleration devices of the same type; and the device description information, name information, and address information of each hardware acceleration device of the same type are merged to generate hardware acceleration device information. By abstracting each hardware acceleration device, hardware acceleration devices of the same type can be generated, and hardware acceleration devices of the same type greatly improve the efficiency and accuracy of virtual machine migration.
[0036] The conditions for triggering the generation of migration instructions for the source virtual machine can be set according to actual conditions, and the embodiments of the present application do not make specific limitations on this. For example, when the source host machine requires maintenance (such as upgrades and repairs), a migration instruction for the source virtual machine is generated; or, when the remaining available resources of the source host machine (such as CPU availability and memory availability) are insufficient, a migration instruction for the source virtual machine is generated.
[0037] Exemplarily, the representation form of the hardware acceleration device information can be set according to actual conditions, and the embodiments of the present application do not specifically limit this. For example, the representation form of the hardware acceleration device information is a hardware acceleration device linked list, which obtains the migration instructions of the source virtual machine to be migrated, and obtains the device description information, name information, and address information of one or more hardware acceleration devices configured for the source virtual machine based on the migration instructions; abstracts each hardware acceleration device to generate hardware acceleration devices of the same type; and merges the device description information, name information, and address information of each hardware acceleration device of the same type to generate a hardware acceleration device linked list. The generated hardware acceleration device linked list accurately and clearly represents the hardware acceleration device information.
[0038] In one embodiment, a virtual machine monitor (VMM) is provided in the source host machine. Upon receiving a migration instruction from a source virtual machine to be migrated, the VMM is activated according to the migration instruction. The VMM obtains device description information, name information, and address information of one or more hardware acceleration devices configured for the source virtual machine; abstracts each hardware acceleration device to generate hardware acceleration devices of the same type; and merges the device description information, name information, and address information of each hardware acceleration device of the same type to generate hardware acceleration device information. The VMM can accurately and efficiently establish hardware acceleration device information.
[0039] In the embodiment of the present application, each step can be controlled by the VMM to realize the migration of the virtual machine, but the migration of the virtual machine can also be completed without using the VMM, that is, the embodiment of the present application is not limited to the control of the VMM.
[0040] Step S102: Determine a destination host machine, and send the hardware acceleration device information and configuration parameter information to the destination host machine, so that the destination host machine can create a destination virtual machine with the same configuration as the source virtual machine according to the configuration parameter information, and configure the destination hardware acceleration device of the destination virtual machine according to the hardware acceleration device information.
[0041] The destination host machine is a host machine used to create a destination virtual machine. The destination host machine can provide conditions for creating a destination virtual machine with the same configuration as the source virtual machine, and the destination host machine is configured with a destination hardware acceleration device that realizes the function of the hardware acceleration device.
[0042] In one embodiment, multiple candidate host machines and device description information for each hardware acceleration device carried by each candidate host machine are obtained. Based on the device description information for the hardware acceleration device configured on the source virtual machine and the device description information for each hardware acceleration device carried by each candidate host machine, a candidate host machine containing the device description information for the hardware acceleration device configured on the source virtual machine is determined, and the determined candidate host machine is selected as the destination host machine. By selecting a destination host machine that meets the requirements from the multiple candidate host machines, the efficiency and accuracy of virtual machine migration can be improved.
[0043] Exemplarily, the source virtual machine is configured with hardware acceleration devices including hardware acceleration device 1 and hardware acceleration device 2. The device description information of hardware acceleration device 1 includes device description information A, and the device description information of hardware acceleration device 2 includes device description information B. Candidate host machine 1 includes hardware acceleration device 3, hardware acceleration device 4, and hardware acceleration device 5. The device description information of hardware acceleration device 3 includes device description information C, the device description information of hardware acceleration device 4 includes device description information A, and the device description information of hardware acceleration device 5 includes device description information D. Candidate host machine 2 includes hardware acceleration device 6 and hardware acceleration device 7. The device description information of hardware acceleration device 6 includes device description information E, and the device description information of hardware acceleration device 4 includes device description information F. Candidate host machine 3 includes hardware acceleration device 8, hardware acceleration device 9, and hardware acceleration device 10. The device description information of hardware acceleration device 8 includes device description information A, the device description information of hardware acceleration device 9 includes device description information G, and the device description information of hardware acceleration device 10 includes device description information B. The device description information A, device description information G, and device description information B included in the candidate host machine 3 include the device description information A and device description information B of the source virtual machine, and the candidate host machine 3 is determined as the destination host machine.
[0044] In one embodiment, based on the device description information of the hardware acceleration device configured on the source virtual machine and the device description information of each hardware acceleration device carried by each candidate host machine, a candidate host machine with the device description information of the hardware acceleration device configured on the source virtual machine is determined, multiple target candidate host machines are obtained, the available resources of each target candidate host machine are obtained, and the target candidate host machine with the first available resource is determined as the destination host machine. Among them, the available resources can be set according to actual conditions, and the embodiment of the present application does not make specific restrictions on this. For example, the available resources include CPU availability and memory available size. By selecting the optimal destination host machine from multiple target candidate host machines, the efficiency and accuracy of virtual machine migration can be improved, as well as the processing efficiency of the destination virtual machine can be improved.
[0045] In one embodiment, the address information of a destination host machine is obtained, and hardware acceleration device information and configuration parameter information are sent to the destination host machine based on the address information of the destination host machine. The destination host machine receives the hardware acceleration device information and configuration parameter information, creates a destination virtual machine with the same configuration as the source virtual machine based on the configuration parameter information, and configures the destination hardware acceleration device of the destination virtual machine based on the hardware acceleration device information. The hardware acceleration device information and configuration parameter information are sent to the destination host machine, so that the destination host machine can efficiently create the destination virtual machine and configure the destination hardware acceleration device.
[0046] In one embodiment, a method for creating a destination virtual machine with the same configuration as a source virtual machine based on configuration parameter information may include: obtaining configuration resources based on the configuration parameter information, creating a virtual machine based on the configuration resources, and obtaining a destination virtual machine with the same configuration as the source virtual machine. The creation of a virtual machine based on configuration resources includes, but is not limited to, central processing unit configuration, memory configuration, network configuration, I / O controller type configuration, and disk type configuration. Using the configuration parameter information, a destination virtual machine with the same configuration as the source virtual machine can be accurately configured, significantly improving the efficiency and accuracy of virtual machine migration.
[0047] In one embodiment, a method for configuring a destination hardware acceleration device for a destination virtual machine based on hardware acceleration device information may include: determining, based on attribute information and type information of the hardware acceleration device in the hardware acceleration device information, at least one hardware acceleration device including the attribute information and type information, and determining each of the determined hardware acceleration devices as the destination hardware acceleration device. Accurately configuring the destination hardware acceleration device for the destination virtual machine based on the hardware acceleration device information greatly improves the efficiency and accuracy of virtual machine migration.
[0048] Step S103: Obtain first dirty page information corresponding to each of the hardware acceleration devices and second dirty page information of the source virtual machine, and migrate the first dirty page information and the second dirty page information to the destination host machine. When the migration is completed, the destination host machine controls the destination virtual machine and each of the destination hardware acceleration devices to start running.
[0049] The dirty page information refers to the data pages generated by the hardware acceleration devices and virtual machines during operation.
[0050] In one embodiment, as shown in FIG. 2 , step S103 includes sub-steps S1031 and S1032 .
[0051] Sub-step S1031 : Sending a dirty page record instruction to each of the hardware acceleration devices respectively, and obtaining first dirty page information collected by each of the hardware acceleration devices based on the dirty page record instruction.
[0052] The hardware acceleration device information is traversed, and a dirty page record instruction is sent to each hardware acceleration device. After receiving the dirty page record instruction, each hardware acceleration device collects dirty page information according to the dirty page record instruction to obtain the first dirty page information corresponding to each hardware acceleration device. Each hardware acceleration device then sends the first dirty page information corresponding to each hardware acceleration device to the source host machine, so that the source host machine receives the first dirty page information of each hardware acceleration device. By sending the dirty page record instruction to each hardware acceleration device, the data pages generated by each hardware acceleration device can be accurately collected.
[0053] The first dirty page information includes data pages that are not modified after the hardware acceleration device receives the dirty page record instruction and data pages that are modified based on the execution.
[0054] Sub-step S1032: obtaining the second dirty page information of the source virtual machine, and migrating the first dirty page information and the second dirty page information to the destination host machine.
[0055] The second dirty page information of the source virtual machine is received, and the first dirty page information and the second dirty page information are transmitted to the destination host machine. The destination host machine receives the first dirty page information and the second dirty page information and, based on the device description information, sends the first dirty page information to the corresponding destination hardware acceleration device and sends the second dirty page information to the destination virtual machine. Sending the first dirty page information to the corresponding destination hardware acceleration device and sending the second dirty page information to the destination virtual machine can accurately and efficiently migrate data from the source virtual machine to the destination virtual machine.
[0056] In one embodiment, as shown in FIG3 , sub-step S1032 further includes sub-steps S1033 to S1035 .
[0057] Sub-step S1033: Send a collect dirty page bitmap instruction to each of the hardware acceleration devices, and obtain first dirty page bitmap information collected by each of the hardware acceleration devices based on the collect dirty page bitmap instruction, where the first dirty page bitmap information is used to represent the changed dirty page information.
[0058] The collect dirty page bitmap instruction is used to instruct the hardware acceleration device to collect a dirty page bitmap of changed dirty page information, and the first dirty page bitmap information is used to represent the changed dirty page information.
[0059] In one embodiment, hardware acceleration device information is traversed, and a collect dirty page bitmap instruction is sent to each hardware acceleration device. Each hardware acceleration device collects dirty page bitmaps that have changed during operation according to the collect dirty page bitmap instruction, obtaining first dirty page bitmap information corresponding to each hardware acceleration device. Each hardware acceleration device then sends its first dirty page bitmap information to a source host machine, so that the source host machine obtains the first dirty page bitmap information corresponding to each hardware acceleration device. By sending the collect dirty page bitmap instruction to each hardware acceleration device, the first dirty page bitmap information corresponding to each hardware acceleration device can be accurately received.
[0060] Sub-step S1034: obtaining second dirty page bitmap information of the source virtual machine.
[0061] Obtain a dirty page bitmap of dirty page information that changes during the running of the source virtual machine, and obtain second dirty page bitmap information of the source virtual machine.
[0062] Sub-step S1035 : acquiring modified target dirty page information according to each of the first dirty page bitmap information and the second dirty page bitmap information, and sending the target dirty page information to the destination host machine.
[0063] The target dirty page information is dirty page information modified during the operation of each hardware acceleration device and the source virtual machine.
[0064] In one embodiment, a bitwise OR operation is performed on each of the first dirty page bitmap information and the second dirty page bitmap information to generate target dirty page bitmap information; modified dirty page information is obtained based on the target dirty page bitmap information, and the modified dirty page information is determined as the target dirty page information. By performing a bitwise OR operation on each of the first dirty page bitmap information and the second dirty page bitmap information, the changed target dirty page bitmap information can be accurately obtained, and the target dirty page information can be accurately obtained and sent from the storage medium using the target dirty page bitmap information.
[0065] In one embodiment, after obtaining the target dirty page information, the target dirty page information is sent to the destination host machine. The destination host machine modifies the dirty page information of each destination hardware acceleration device and / or destination virtual machine according to the destination host machine to complete the update of the migration data, thereby greatly improving the efficiency and accuracy of virtual machine migration.
[0066] In one embodiment, the number of target dirty page information that has not been migrated to the destination host machine is obtained, and it is determined whether the number of target dirty page information that has not been migrated to the destination host machine is less than or equal to a preset threshold; when the number of target dirty page information that has not been migrated to the destination host machine is less than or equal to the preset threshold, the source virtual machine is controlled to stop running, and the target dirty page information that has not been migrated to the destination host machine is migrated to the destination host machine. Among them, the preset threshold can be set according to actual conditions, and the embodiment of the present application does not make specific restrictions on this. When it is determined that the number of dirty page information that has changed is small, the source virtual machine is shut down so that the source virtual machine and each hardware acceleration device are not working, so that the dirty page information of the source virtual machine will not change, and the target dirty page information that has not been migrated to the destination host machine is migrated to the destination host machine to complete the migration of all dirty page information, so that the migration of virtual machine data can be completed accurately.
[0067] In one embodiment, after the source virtual machine is shut down, a state data acquisition instruction is sent to each hardware acceleration device to acquire state data sent by each hardware acceleration device based on the state data acquisition instruction. Each state data is then sent to the destination host machine, which then sends matching state data to each destination hardware acceleration device based on the hardware acceleration device information. The type of state data can be set based on actual circumstances, and this embodiment of the present application does not specifically limit this. For example, the types of state data include register data, global variable data, and array operation data. By acquiring the state data of each hardware acceleration device and sending the state data to the destination host machine, state data migration can be completed efficiently and accurately.
[0068] In one embodiment, when the migration is completed, the destination host machine controls the operation of each hardware acceleration device and the destination virtual machine according to the state data to complete the migration and operation of the virtual machine, and deletes the source virtual machine.
[0069] Exemplarily, as shown in FIG4 , the hardware acceleration device information and configuration parameter information corresponding to the source virtual machine 210 to be migrated from the source host machine 200 are obtained. The hardware acceleration devices configured on the source virtual machine 210 include a disk acceleration card 220, a network acceleration card A 230, and a network acceleration card B 240. The destination host machine 300 is determined. The source host machine 200 sends the hardware acceleration device information and configuration parameter information to the destination host machine 300. The destination host machine 300 creates a destination virtual machine 310 with the same configuration as the source virtual machine 210 according to the configuration parameter information, and configures the destination hardware of the destination virtual machine 310 according to the hardware acceleration device information. The destination hardware acceleration device includes a disk acceleration card 320, a network acceleration card A330, and a network acceleration card B340; the source host machine 200 obtains the corresponding first dirty page information of the disk acceleration card 220, the network acceleration card A230, and the network acceleration card B240 and the second dirty page information of the source virtual machine 210, and sends the first dirty page information and the second dirty page information to the destination host machine 300. When the migration is completed, the destination host machine controls the destination virtual machine 310, the disk acceleration card 320, the network acceleration card A330, and the network acceleration card B340 to run to complete the migration of the source virtual machine 210.
[0070] The virtual machine migration method in the above embodiment obtains hardware acceleration device information and configuration parameter information corresponding to the source virtual machine to be migrated, the hardware acceleration device information including device description information of one or more hardware acceleration devices configured on the source virtual machine; determines a destination host machine, and sends the hardware acceleration device information and configuration parameter information to the destination host machine, so that the destination host machine can create a destination virtual machine with the same configuration as the source virtual machine based on the configuration parameter information, and configure the destination hardware acceleration device of the destination virtual machine based on the hardware acceleration device information; obtains first dirty page information corresponding to each hardware acceleration device and second dirty page information of the source virtual machine, and migrates the first dirty page information and second dirty page information to the destination host machine, wherein, upon completion of the migration, the destination host machine controls the destination virtual machine and each destination hardware acceleration device to start running. This solution creates a destination virtual machine with the same configuration as the source virtual machine and configures the destination hardware acceleration device in the destination host machine, thereby creating a destination virtual machine operating environment, and migrates the first dirty page information corresponding to each hardware acceleration device and the second dirty page information of the source virtual machine to the destination host machine, thereby achieving virtual machine data migration. Upon completion of the migration, the destination virtual machine and each destination hardware acceleration device start running, thus efficiently and accurately completing the hot migration of the virtual machine.
[0071] Please refer to FIG. 5 , which is a schematic block diagram of the structure of a virtual machine migration system provided in an embodiment of the present application.
[0072] As shown in FIG5 , the virtual machine migration system 400 includes a source host machine 410 and a destination host machine 420 , wherein:
[0073] The source host machine 410 is configured to obtain hardware acceleration device information and configuration parameter information corresponding to the source virtual machine to be migrated, wherein the hardware acceleration device information includes device description information of one or more hardware acceleration devices configured on the source virtual machine;
[0074] The source host machine 410 is further configured to determine a destination host machine and send the hardware acceleration device information and configuration parameter information to the destination host machine;
[0075] The destination host machine 420 is configured to receive the hardware acceleration device information and configuration parameter information, create a destination virtual machine with the same configuration as the source virtual machine according to the configuration parameter information, and configure a destination hardware acceleration device of the destination virtual machine according to the hardware acceleration device information;
[0076] The source host machine 410 is further configured to obtain first dirty page information corresponding to each of the hardware acceleration devices and second dirty page information of the source virtual machine, and migrate the first dirty page information and the second dirty page information to the destination host machine;
[0077] The destination host machine 420 is further configured to receive the first dirty page information and the second dirty page information, and control the destination virtual machine and each of the destination hardware acceleration devices to start running when the migration is completed.
[0078] In one embodiment, the source host machine 410 is further configured to:
[0079] Obtain device description information of multiple candidate host machines and each hardware acceleration device carried by each candidate host machine;
[0080] According to the device description information of the hardware acceleration device configured on the source virtual machine and the device description information of each hardware acceleration device carried by each candidate host machine, a candidate host machine having the device description information of the hardware acceleration device configured on the source virtual machine is determined, and the determined candidate host machine is used as the destination host machine.
[0081] In one embodiment, the source host machine 410 is further configured to:
[0082] Sending a dirty page record instruction to each of the hardware acceleration devices respectively, and obtaining first dirty page information collected by each of the hardware acceleration devices based on the dirty page record instruction;
[0083] The second dirty page information of the source virtual machine is obtained, and the first dirty page information and the second dirty page information are migrated to the destination host machine.
[0084] In one embodiment, the source host machine 410 is further configured to:
[0085] Sending a collect dirty page bitmap instruction to each of the hardware acceleration devices respectively, and obtaining first dirty page bitmap information collected by each of the hardware acceleration devices based on the collect dirty page bitmap instruction, where the first dirty page bitmap information is used to represent changed dirty page information;
[0086] Obtaining second dirty page bitmap information of the source virtual machine;
[0087] According to each of the first dirty page bitmap information and the second dirty page bitmap information, the modified target dirty page information is acquired, and the target dirty page information is sent to the destination host machine.
[0088] In one embodiment, the source host machine 410 is further configured to:
[0089] Performing bitwise OR processing on each of the first dirty page bitmap information and the second dirty page bitmap information to generate target dirty page bitmap information;
[0090] The modified dirty page information is acquired according to the target dirty page bitmap information, and the modified dirty page information is determined as the target dirty page information.
[0091] In one embodiment, the source host machine 410 is further configured to:
[0092] Obtaining the number of target dirty page information that has not been migrated to the destination host machine, and determining whether the number of target dirty page information that has not been migrated to the destination host machine is less than or equal to a preset threshold;
[0093] When the amount of the target dirty page information that has not been migrated to the destination host machine is less than or equal to a preset threshold, the source virtual machine is controlled to stop running, and the target dirty page information that has not been migrated to the destination host machine is migrated to the destination host machine.
[0094] In one embodiment, the source host machine 410 is further configured to:
[0095] Acquire status data corresponding to each of the hardware acceleration devices, and send the status data to the destination host machine.
[0096] In one embodiment, the source host machine 410 is further configured to:
[0097] Obtaining a migration instruction of a source virtual machine to be migrated, and obtaining device description information, name information, and address information of one or more hardware acceleration devices configured for the source virtual machine according to the migration instruction;
[0098] Performing abstract processing on each of the hardware acceleration devices to generate hardware acceleration devices of the same type;
[0099] The hardware acceleration devices of the same type, the device description information, the name information and the address information of the hardware acceleration devices are merged to generate the hardware acceleration device information.
[0100] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working process of the virtual machine migration system described above can refer to the corresponding process in the aforementioned virtual machine migration method embodiment, and will not be repeated here.
[0101] Please refer to FIG6 , which is a schematic block diagram of the structure of a server provided in an embodiment of the present application.
[0102] As shown in FIG6 , the server 500 includes a processor 501 and a memory 502 . The processor 501 and the memory 502 are connected via a bus 503 , such as an I 2 C (Inter-Integrated Circuit) bus.
[0103] Specifically, the processor 501 is used to provide computing and control capabilities to support the operation of the entire server. The processor 501 can be a central processing unit (CPU), and the processor 501 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0104] In one embodiment, the memory 502 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.
[0105] Those skilled in the art will understand that the structure shown in Figure 6 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied. The specific server may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0106] The processor is configured to run a computer program stored in a memory, and implement any one of the virtual machine migration methods provided in the embodiments of the present application when executing the computer program.
[0107] In one embodiment, the processor 501 is configured to run a computer program stored in a memory, and implement the following steps when executing the computer program:
[0108] Obtaining hardware acceleration device information and configuration parameter information corresponding to the source virtual machine to be migrated, wherein the hardware acceleration device information includes device description information of one or more hardware acceleration devices configured on the source virtual machine;
[0109] Determine a destination host machine, and send the hardware acceleration device information and configuration parameter information to the destination host machine, so that the destination host machine can create a destination virtual machine with the same configuration as the source virtual machine according to the configuration parameter information, and configure a destination hardware acceleration device of the destination virtual machine according to the hardware acceleration device information;
[0110] Obtain first dirty page information corresponding to each of the hardware acceleration devices and second dirty page information of the source virtual machine, and migrate the first dirty page information and the second dirty page information to the destination host machine. When the migration is completed, the destination host machine controls the destination virtual machine and each of the destination hardware acceleration devices to start running.
[0111] In one embodiment, when determining the target host, the processor 501 is configured to:
[0112] Obtain device description information of multiple candidate host machines and each hardware acceleration device carried by each candidate host machine;
[0113] According to the device description information of the hardware acceleration device configured on the source virtual machine and the device description information of each hardware acceleration device carried by each candidate host machine, a candidate host machine having the device description information of the hardware acceleration device configured on the source virtual machine is determined, and the determined candidate host machine is used as the destination host machine.
[0114] In one embodiment, when the processor 501 obtains the first dirty page information corresponding to each of the hardware acceleration devices and the second dirty page information of the source virtual machine, and migrates the first dirty page information and the second dirty page information to the destination host machine, it is configured to implement:
[0115] Sending a dirty page record instruction to each of the hardware acceleration devices respectively, and obtaining first dirty page information collected by each of the hardware acceleration devices based on the dirty page record instruction;
[0116] The second dirty page information of the source virtual machine is obtained, and the first dirty page information and the second dirty page information are migrated to the destination host machine.
[0117] In one embodiment, after migrating the first dirty page information and the second dirty page information to the destination host machine, the processor 501 is further configured to:
[0118] Sending a collect dirty page bitmap instruction to each of the hardware acceleration devices respectively, and obtaining first dirty page bitmap information collected by each of the hardware acceleration devices based on the collect dirty page bitmap instruction, where the first dirty page bitmap information is used to represent changed dirty page information;
[0119] Obtaining second dirty page bitmap information of the source virtual machine;
[0120] According to each of the first dirty page bitmap information and the second dirty page bitmap information, the modified target dirty page information is acquired, and the target dirty page information is sent to the destination host machine.
[0121] In one embodiment, when the processor 501 obtains the modified target dirty page information according to each of the first dirty page bitmap information and the second dirty page bitmap information, it is configured to implement:
[0122] Performing bitwise OR processing on each of the first dirty page bitmap information and the second dirty page bitmap information to generate target dirty page bitmap information;
[0123] The modified dirty page information is acquired according to the target dirty page bitmap information, and the modified dirty page information is determined as the target dirty page information.
[0124] In one embodiment, after determining the modified target dirty page information based on the first dirty page bitmap information and the second dirty page bitmap information, and sending the target dirty page information to the destination host machine, the processor 501 is further configured to:
[0125] Obtaining the number of target dirty page information that has not been migrated to the destination host machine, and determining whether the number of target dirty page information that has not been migrated to the destination host machine is less than or equal to a preset threshold;
[0126] When the amount of the target dirty page information that has not been migrated to the destination host machine is less than or equal to a preset threshold, the source virtual machine is controlled to stop running, and the target dirty page information that has not been migrated to the destination host machine is migrated to the destination host machine.
[0127] In one embodiment, after controlling the source virtual machine to stop running, the processor 501 is further configured to:
[0128] Acquire status data corresponding to each of the hardware acceleration devices, and send the status data to the destination host machine.
[0129] In one embodiment, when obtaining the hardware acceleration device information corresponding to the source virtual machine to be migrated, the processor 501 is configured to implement:
[0130] Obtaining a migration instruction of a source virtual machine to be migrated, and obtaining device description information, name information, and address information of one or more hardware acceleration devices configured for the source virtual machine according to the migration instruction;
[0131] Performing abstract processing on each of the hardware acceleration devices to generate hardware acceleration devices of the same type;
[0132] The hardware acceleration devices of the same type, the device description information, the name information and the address information of the hardware acceleration devices are merged to generate the hardware acceleration device information.
[0133] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working process of the server described above can refer to the corresponding process in the aforementioned virtual machine migration method embodiment, and will not be repeated here.
[0134] An embodiment of the present application also provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any virtual machine migration method provided in the specification of this application.
[0135] The storage medium may be an internal storage unit of the server described in the aforementioned embodiment, such as a hard disk or memory of the server. The storage medium may also be an external storage device of the server, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the server.
[0136] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0137] It should be understood that the term "and / or" used in this specification refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system that includes a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements that are inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system that includes the element.
[0138] The serial numbers of the embodiments of the present application are for descriptive purposes only and do not represent the merits of the embodiments. The above description is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the scope of protection of the present application.
Claims
1. A virtual machine migration method, comprising: Obtaining hardware acceleration device information and configuration parameter information corresponding to the source virtual machine to be migrated, wherein the hardware acceleration device information includes device description information of one or more hardware acceleration devices configured on the source virtual machine; Determine a destination host machine, and send the hardware acceleration device information and configuration parameter information to the destination host machine, so that the destination host machine can create a destination virtual machine with the same configuration as the source virtual machine according to the configuration parameter information, and configure a destination hardware acceleration device of the destination virtual machine according to the hardware acceleration device information; The first dirty page information corresponding to each of the hardware acceleration devices and the second dirty page information of the source virtual machine are obtained, and the first dirty page information and the second dirty page information are migrated to the destination host machine, wherein, when the migration is completed, the destination host machine controls the destination virtual machine and each of the destination hardware acceleration devices to start running.
2. The virtual machine migration method according to claim 1, wherein: The determining of the destination host machine includes: Obtain device description information of multiple candidate host machines and each hardware acceleration device carried by each of the candidate host machines; According to the device description information of the hardware acceleration device configured on the source virtual machine and the device description information of each hardware acceleration device carried by each candidate host machine, a candidate host machine having the device description information of the hardware acceleration device configured on the source virtual machine is determined, and the determined candidate host machine is used as the destination host machine.
3. The virtual machine migration method according to claim 1, wherein: The obtaining first dirty page information corresponding to each of the hardware acceleration devices and second dirty page information of the source virtual machine, and migrating the first dirty page information and the second dirty page information to the destination host machine includes: Sending a dirty page record instruction to each of the hardware acceleration devices respectively, and obtaining first dirty page information collected by each of the hardware acceleration devices based on the dirty page record instruction; The second dirty page information of the source virtual machine is obtained, and the first dirty page information and the second dirty page information are migrated to the destination host machine.
4. The virtual machine migration method according to claim 3, wherein: After migrating the first dirty page information and the second dirty page information to the destination host machine, the method further includes: Sending a dirty page bitmap collection instruction to each of the hardware acceleration devices respectively, and obtaining first dirty page bitmap information collected by each of the hardware acceleration devices based on the dirty page bitmap collection instruction, where the first dirty page bitmap information is used to represent the changed dirty page information; Obtaining second dirty page bitmap information of the source virtual machine; According to each of the first dirty page bitmap information and the second dirty page bitmap information, the modified target dirty page information is acquired, and the target dirty page information is sent to the destination host machine.
5. The virtual machine migration method according to claim 4, wherein: The acquiring the modified target dirty page information according to each of the first dirty page bitmap information and the second dirty page bitmap information includes: Performing bitwise OR processing on each of the first dirty page bitmap information and the second dirty page bitmap information to generate target dirty page bitmap information; The modified dirty page information is acquired according to the target dirty page bitmap information, and the modified dirty page information is determined as the target dirty page information.
6. The virtual machine migration method according to claim 4, wherein: After determining the modified target dirty page information according to the first dirty page bitmap information and the second dirty page bitmap information, and sending the target dirty page information to the destination host machine, the method further includes: Acquire the amount of the target dirty page information that has not been migrated to the destination host machine, and determine whether the amount of the target dirty page information that has not been migrated to the destination host machine is less than or equal to a preset threshold; When the amount of the target dirty page information that has not been migrated to the destination host machine is less than or equal to a preset threshold, the source virtual machine is controlled to stop running, and the target dirty page information that has not been migrated to the destination host machine is migrated to the destination host machine.
7. The virtual machine migration method according to claim 6, wherein: After controlling the source virtual machine to stop running, the method further includes: The status data corresponding to each of the hardware acceleration devices is obtained, and each of the status data is sent to the destination host machine.
8. The virtual machine migration method according to claim 1, wherein: The obtaining of hardware acceleration device information corresponding to the source virtual machine to be migrated includes: Obtaining a migration instruction of a source virtual machine to be migrated, and obtaining device description information, name information, and address information of one or more hardware acceleration devices configured for the source virtual machine according to the migration instruction; Abstract processing is performed on each of the hardware acceleration devices to generate hardware acceleration devices of the same type; The hardware acceleration devices of the same type, the device description information, the name information and the address information of the hardware acceleration devices are merged to generate the hardware acceleration device information.
9. A virtual machine migration system, wherein: The virtual machine migration system includes a source host machine and a destination host machine, wherein: The source host machine is configured to obtain hardware acceleration device information and configuration parameter information corresponding to the source virtual machine to be migrated, wherein the hardware acceleration device information includes device description information of one or more hardware acceleration devices configured on the source virtual machine; The source host machine is further configured to determine a destination host machine and send the hardware acceleration device information and configuration parameter information to the destination host machine; The destination host machine is configured to receive the hardware acceleration device information and configuration parameter information, create a destination virtual machine with the same configuration as the source virtual machine according to the configuration parameter information, and configure a destination hardware acceleration device of the destination virtual machine according to the hardware acceleration device information; The source host machine is further configured to obtain first dirty page information corresponding to each of the hardware acceleration devices and second dirty page information of the source virtual machine, and migrate the first dirty page information and the second dirty page information to the destination host machine; The destination host machine is further configured to receive the first dirty page information and the second dirty page information, and control the destination virtual machine and each of the destination hardware acceleration devices to start running when the migration is completed.
10. A server, wherein: The server includes a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus configured to implement connection communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of the virtual machine migration method as described in any one of claims 1 to 8 are implemented.
11. A storage medium for computer-readable storage, wherein: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the virtual machine migration method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Online migration method and device for virtual machine
CN105760218A
Virtual machine migration method, device and system and storage medium
CN113312138A
Cloud host live migration method, medium and electronic equipment
CN115269116A
Virtual machine migration method, system and device and storage medium
CN115629844A
Virtual Machine Hot Migration Method, Apparatus, Electronic Device, and Computer Storage Medium
US20220156106A1
