A method, device and system for hot migration of virtual machines
By simulating missing CPU instructions between the source and destination physical machines, and performing hot migration of virtual machine memory after receiving a successful negotiation response, the service abnormality caused by inconsistent CPU characteristics during hot migration of virtual machines in the prior art is solved, and a virtual machine hot migration is achieved while ensuring business continuity.
Patent Information
- Application Number
- CN202111593288.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2041-12-23
AI Technical Summary
The prior art cannot realize virtual machine hot migration while ensuring business continuity, especially when migrating between the source-side physical machine and the destination-side physical machine of heterogeneous or heterogeneous platforms, inconsistent CPU characteristics lead to service abnormalities or virtual machine failures.
By sending an simulation request between the source physical machine and the destination physical machine, it instructs the destination physical machine to simulate the missing CPU instructions. The missing CPU instructions are CPU instructions supported by the source physical machine but not supported by the destination physical machine. Then, a negotiation request is sent to the destination physical machine, and upon receiving the successful negotiation response, the memory of the virtual machine to be migrated to the destination physical machine is hotly migrated.
The CPU characteristic matching rate of the source and destination physical machines is improved, and service abnormalities or virtual machine failures caused by the use of unsupported CPU instructions by the virtual machine on the destination physical machine is avoided, thereby realizing the virtual machine hot migration while ensuring business continuity.
Smart Images

Figure CN114489930B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a method, device and system for hot migration of a virtual machine. Background Art
[0002] Live Migration of virtual machines is a key technology in cloud computing operations. It can migrate virtual machines from the source physical machine to the destination physical machine while keeping the virtual machines running normally on the source physical machine, so as to achieve dynamic scheduling of computing resources and proactive operation and maintenance of physical failures. Among them, live migration of virtual machines has restrictions on virtual machines, source physical machines and destination physical machines. For example, when the source physical machine and the destination physical machine share storage or do not share storage but migrate through blocks, the time, network configuration and central processing unit (CPU) type or characteristics of the source physical machine and the destination physical machine need to be consistent or compatible, and the virtual operating system simulator (Quick EMUlator, QEMU) version and read-only memory (Read Only Memory, ROM) version of the virtual machine need to be consistent or compatible.
[0003] At present, when hot migrating a virtual machine between a source physical machine and a destination physical machine of a heterogeneous or different platform, the virtual machine needs to be configured in host-model mode or host-passthrough mode. During hot migration of virtual machines in these two modes, the CPU characteristics of the source physical machine and the destination physical machine must be completely consistent. For scenarios with many virtual machines but few physical machines or a cluster of physical machine failures, if the restrictions are followed, business continuity cannot be guaranteed. If the restrictions are not followed, hot migration of virtual machines cannot be achieved. For example, if the CPU characteristics of the source physical machine and the destination physical machine are completely different or have low consistency, after migrating the virtual machine from the source physical machine to the destination physical machine, once the virtual machine uses unsupported CPU instructions on the destination physical machine, service abnormalities or even virtual machine failures will occur.
[0004] It can be seen that the existing technology has the problem of being unable to achieve hot migration of virtual machines while ensuring business continuity. Summary of the invention
[0005] The embodiments of the present application provide a virtual machine hot migration method, device and system for solving the technical problem in the prior art that it is impossible to achieve virtual machine hot migration while ensuring business continuity.
[0006] In a first aspect, in order to solve the above technical problems, an embodiment of the present application provides a virtual machine hot migration method, which is applied to a source end physical machine, comprising:
[0007] Obtain the configuration information of the virtual machine to be migrated and determine the destination physical machine;
[0008] Sending a simulation request to the destination physical machine; wherein the simulation request is used to instruct the destination physical machine to simulate a missing central processing unit (CPU) instruction, where the missing CPU instruction is a CPU instruction supported by the source physical machine but not supported by the destination physical machine;
[0009] A negotiation request is sent to the destination physical machine, and upon receiving a negotiation success response returned by the destination physical machine, the memory of the virtual machine to be migrated is hot migrated to the destination physical machine; wherein the negotiation request carries the configuration information.
[0010] In an embodiment of the present application, the source physical machine can obtain the configuration information of the virtual machine to be migrated, determine the destination physical machine, and send a simulation request to the destination physical machine, wherein the simulation request is used to instruct the destination physical machine to simulate missing CPU instructions, and the missing CPU instructions are CPU instructions supported by the source physical machine but not supported by the destination physical machine, send a negotiation request to the destination physical machine, and when receiving a successful negotiation response returned by the destination physical machine, hot migrate the memory of the virtual machine to be migrated to the destination physical machine; wherein the negotiation request carries the configuration information of the virtual machine to be migrated. By instructing the destination physical machine to simulate missing CPU instructions, the matching rate of the CPU characteristics of the source physical machine and the CPU characteristics of the destination physical machine is improved, and service anomalies or even virtual machine failures caused by the virtual machine using unsupported CPU instructions on the destination physical machine are avoided, thereby achieving hot migration of virtual machines while ensuring business continuity.
[0011] In an optional implementation manner, determining the destination physical machine includes:
[0012] Obtaining a matching rate between the CPU characteristics of the source end physical machine and the CPU characteristics of at least one physical machine, and determining whether there is a physical machine whose matching rate is greater than a preset threshold;
[0013] If so, determining that the physical machine with a matching rate greater than a preset threshold is the destination physical machine;
[0014] If not, sort the at least one physical machine from large to small based on the set length and usage frequency of the CPU characteristics of the at least one physical machine to obtain a target sorting result, and determine that the highest ranked physical machine in the target sorting result is the destination physical machine.
[0015] In an optional implementation, the step of sorting the at least one physical machine from large to small based on the set length and the usage frequency of the CPU characteristics of the at least one physical machine to obtain a target sorting result includes:
[0016] Sorting the at least one physical machine from large to small based on the set length of the CPU characteristics of the at least one physical machine to obtain a first sorting result;
[0017] Sort the physical machines with the same ranking in the first sorting result from large to small based on the usage frequency of the CPU characteristics of the at least one physical machine, to obtain a second sorting result;
[0018] Determine that the second sorting result is the target sorting result.
[0019] In an optional implementation manner, the sending a simulation request to the destination physical machine includes:
[0020] A simulation request is sent to the destination physical machine, so that the destination physical machine sends a first instruction to the virtual machine manager VMM and sends a second instruction to the field programmable gate array FPGA, wherein the first instruction instructs the VMM to load a CPU instruction simulator to simulate the missing CPU instruction, and the second instruction instructs the FPGA to burn the missing CPU instruction.
[0021] In an embodiment of the present application, the source end physical machine can send a simulation request to the destination end physical machine, so that the destination end physical machine sends a first instruction to the VMM and sends a second instruction to the FPGA, wherein the first instruction instructs the VMM to load the CPU instruction simulator to simulate the missing CPU instruction, and the second instruction instructs the FPGA to burn the missing CPU instruction. The destination end physical machine simulates the missing CPU instruction by combining software and hardware, which improves the performance of the simulated missing CPU instruction compared to the pure software method, thereby avoiding service anomalies or even virtual machine failures caused by the virtual machine using unsupported CPU instructions on the destination end physical machine, and realizing hot migration of virtual machines while ensuring business continuity.
[0022] In an optional implementation, it also includes:
[0023] Before obtaining configuration information of the virtual machine to be migrated, switching the state of the virtual machine to be migrated from non-migration to preparation;
[0024] Before hot migrating the memory of the virtual machine to be migrated to the destination physical machine, changing the state of the virtual machine to be migrated from preparation to migration;
[0025] After hot migrating the memory of the virtual machine to be migrated to the destination physical machine, the state of the virtual machine to be migrated is switched from migration to non-migration, and the memory of the virtual machine to be migrated is cleared.
[0026] In a second aspect, an embodiment of the present application further provides a virtual machine hot migration device, which is applied to a source end physical machine, comprising:
[0027] A determination module is used to obtain the configuration information of the virtual machine to be migrated and determine the destination physical machine;
[0028] A sending module, used to send a simulation request to the destination physical machine; wherein the simulation request is used to instruct the destination physical machine to simulate a missing central processing unit CPU instruction, and the missing CPU instruction is a CPU instruction supported by the source physical machine but not supported by the destination physical machine;
[0029] A migration module is used to send a negotiation request to the destination physical machine, and upon receiving a negotiation success response returned by the destination physical machine, hot migrate the memory of the virtual machine to be migrated to the destination physical machine; wherein the negotiation request carries the configuration information.
[0030] In an optional implementation manner, the determining module is specifically configured to:
[0031] Obtaining a matching rate between the CPU characteristics of the source end physical machine and the CPU characteristics of at least one physical machine, and determining whether there is a physical machine whose matching rate is greater than a preset threshold;
[0032] If so, determining that the physical machine with a matching rate greater than a preset threshold is the destination physical machine;
[0033] If not, sort the at least one physical machine from large to small based on the set length and usage frequency of the CPU characteristics of the at least one physical machine to obtain a target sorting result, and determine that the highest ranked physical machine in the target sorting result is the destination physical machine.
[0034] In an optional implementation manner, the determining module is specifically configured to:
[0035] Sorting the at least one physical machine from large to small based on the set length of the CPU characteristics of the at least one physical machine to obtain a first sorting result;
[0036] Sort the physical machines with the same ranking in the first sorting result from large to small based on the usage frequency of the CPU characteristics of the at least one physical machine, to obtain a second sorting result;
[0037] Determine that the second sorting result is the target sorting result.
[0038] In an optional implementation manner, the sending module is specifically configured to:
[0039] A simulation request is sent to the destination physical machine, so that the destination physical machine sends a first instruction to the virtual machine manager VMM and sends a second instruction to the field programmable gate array FPGA, wherein the first instruction instructs the VMM to load a CPU instruction simulator to simulate the missing CPU instruction, and the second instruction instructs the FPGA to burn the missing CPU instruction.
[0040] In an optional implementation manner, the device further includes a processing module, configured to:
[0041] Before obtaining configuration information of the virtual machine to be migrated, switching the state of the virtual machine to be migrated from non-migration to preparation;
[0042] Before hot migrating the memory of the virtual machine to be migrated to the destination physical machine, changing the state of the virtual machine to be migrated from preparation to migration;
[0043] After hot migrating the memory of the virtual machine to be migrated to the destination physical machine, the state of the virtual machine to be migrated is switched from migration to non-migration, and the memory of the virtual machine to be migrated is cleared.
[0044] In a third aspect, an embodiment of the present application further provides a virtual machine hot migration system, including:
[0045] A memory for storing program instructions;
[0046] The processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the implementations of the first aspect according to the obtained program instructions.
[0047] In a fourth aspect, an embodiment of the present application provides a storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to enable a computer to execute the steps included in any one of the implementations in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application.
[0049] Figure 1 A schematic diagram of the structure of a virtual machine hot migration system provided in an embodiment of the present application;
[0050] Figure 2 A schematic diagram of a flow chart of a virtual machine hot migration method provided in an embodiment of the present application;
[0051] Figure 3 A schematic diagram of the structure of a virtual machine hot migration device provided in an embodiment of the present application;
[0052] Figure 4 A structural diagram of another virtual machine hot migration system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
[0054] The terms "first" and "second" in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any variation thereof are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0055] In the embodiment of the present application, "at least one" may mean at least two, for example, two, three or more, and the embodiment of the present application does not limit this.
[0056] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally indicates that the associated objects before and after are in an "or" relationship.
[0057] At present, when hot migrating virtual machines between source and destination physical machines of heterogeneous or heterogeneous platforms, the virtual machines need to be configured as host-model mode or host-passthrough mode. When hot migrating virtual machines in these two modes, the CPU characteristics of the source and destination physical machines need to be completely consistent. For scenarios with more virtual machines but fewer physical machines or cluster failures of physical machines, if the restrictions are followed, business continuity cannot be guaranteed. If the restrictions are not followed, hot migration of virtual machines cannot be achieved. For example, if the CPU characteristics of the source and destination physical machines are completely different or have low consistency, after migrating the virtual machine from the source physical machine to the destination physical machine, once the virtual machine uses unsupported CPU instructions on the destination physical machine, it will cause service anomalies or even virtual machine failures. It can be seen that the existing technology has the problem of being unable to achieve hot migration of virtual machines while ensuring business continuity.
[0058] In view of this, an embodiment of the present application provides a method for hot migration of a virtual machine, in which a source physical machine can obtain configuration information of a virtual machine to be migrated, determine a destination physical machine, and send a simulation request to the destination physical machine, wherein the simulation request is used to instruct the destination physical machine to simulate missing CPU instructions, and the missing CPU instructions are CPU instructions supported by the source physical machine but not supported by the destination physical machine, send a negotiation request to the destination physical machine, and when receiving a successful negotiation response returned by the destination physical machine, hot migrate the memory of the virtual machine to be migrated to the destination physical machine; wherein the negotiation request carries the configuration information of the virtual machine to be migrated. By instructing the destination physical machine to simulate missing CPU instructions, the matching rate of the CPU characteristics of the source physical machine and the CPU characteristics of the destination physical machine is improved, and service anomalies or even virtual machine failures caused by the virtual machine using unsupported CPU instructions on the destination physical machine are avoided, thereby achieving hot migration of virtual machines while ensuring business continuity.
[0059] In order to better understand the above technical scheme, the technical scheme of the present application is described in detail below through the accompanying drawings and specific embodiments of the specification. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical scheme of the present application, rather than limitations on the technical scheme of the present application. In the absence of conflict, the embodiments of the present application and the technical features in the embodiments can be combined with each other.
[0060] like Figure 1 As shown, it is a structural diagram of a virtual machine hot migration system to which the method provided in the embodiment of the present application is applicable. Of course, the method provided in the embodiment of the present application can be applied to a variety of virtual machine hot migration systems. It should be understood that Figure 1The virtual machine hot migration system shown is a simple description of a virtual machine hot migration system to which the method provided by the embodiment of the present application is applicable, and is not a limitation of the virtual machine hot migration system to which the method provided by the embodiment of the present application is applicable.
[0061] Figure 1 The virtual machine hot migration system shown includes a source physical machine 101 and a destination physical machine 102, wherein the source physical machine 101 runs a virtual machine 1011 to be migrated, and the destination physical machine 102 includes a virtual machine manager (Virtual Machine Manager, VMM) 1021 and a field programmable gate array (Field Programmable Gate Array, FPGA) 1022.
[0062] It should be noted that, in the embodiment of the present application, the source end physical machine 101 may run one virtual machine to be migrated, or may run multiple virtual machines to be migrated. Figure 1 It is only an exemplary drawing of a virtual machine to be migrated, and the embodiment of the present application does not limit the number of virtual machines to be migrated running on the source physical machine 101.
[0063] It should be noted that in the embodiment of the present application, the source physical machine 101 and the destination physical machine 102 can be heterogeneous or on different platforms, or can be isomorphic or on the same platform. The embodiment of the present application does not make specific limitations on this. For the convenience of explanation, the following takes the example that the source physical machine 101 and the destination physical machine 102 are heterogeneous or on different platforms, and the virtual machine to be migrated running on the source physical machine 101 is configured in host-model mode or host-passthrough mode.
[0064] like Figure 2 FIG. 1 is a flow chart of a virtual machine hot migration method provided in an embodiment of the present application. The virtual machine hot migration method can be applied to the aforementioned Figure 1 The source physical machine in the virtual machine hot migration system shown in FIG. The specific process of the method is described as follows.
[0065] Step 201: The source physical machine obtains configuration information of the virtual machine to be migrated and determines the destination physical machine.
[0066] In the embodiments of the present application, hot migration is also called dynamic migration or real-time migration, that is, virtual machine save or restore, usually the running state of the entire virtual machine is completely saved, and it can be quickly restored to the original hardware platform or even a different hardware platform. After the restoration, the virtual machine still runs smoothly and the user will not notice any difference. When it is necessary to hot migrate the virtual machine to be migrated running on the source physical machine to the destination physical machine, the source physical machine can first obtain the configuration information of the virtual machine to be migrated, and then determine the destination physical machine from at least one physical machine.
[0067] Specifically, obtain the matching rate between the CPU characteristics of the source physical machine and the CPU characteristics of at least one physical machine, and determine whether there is a physical machine with a matching rate greater than a preset threshold; if so, determine the physical machine with a matching rate greater than the preset threshold as the destination physical machine; if not, sort at least one physical machine from large to small based on the set length and usage frequency of the CPU characteristics of at least one physical machine to obtain a target sorting result, and determine the physical machine with the highest ranking in the target sorting result as the destination physical machine.
[0068] Exemplarily, if the preset threshold is 95%, the matching rate of the CPU characteristics of the source physical machine with the CPU characteristics of the first physical machine is 80%, the matching rate with the CPU characteristics of the second physical machine is 90%, and the matching rate with the CPU characteristics of the third physical machine is 92%, then it is determined that there is no physical machine whose matching rate is greater than the preset threshold, and it is necessary to sort the first physical machine, the second physical machine, and the third physical machine from large to small based on the set length and usage frequency of the CPU characteristics of the first physical machine, the second physical machine, and the third physical machine to obtain the target sorting result. If the target sorting result is the third physical machine, the second physical machine, and the first physical machine, determine that the third physical machine with the highest ranking in the target sorting result is the destination physical machine.
[0069] It should be noted that, in an embodiment of the present application, when sorting at least one physical machine from large to small based on the set length and usage frequency of the CPU characteristics of at least one physical machine to obtain a target sorting result, at least one physical machine can be first sorted from large to small based on the set length of the CPU characteristics of at least one physical machine to obtain a first sorting result, and then the physical machines with the same ranking in the first sorting result can be sorted from large to small based on the usage frequency of the CPU characteristics of at least one physical machine to obtain a second sorting result, and the second sorting result is determined to be the target sorting result.
[0070] Exemplarily, if the set lengths of the CPU characteristics of the first physical machine, the second physical machine, and the third physical machine are 20, 30, and 30 respectively, and the usage frequencies of the CPU characteristics are 30%, 40%, and 60%, then at least one physical machine is first sorted from large to small based on the set lengths of the CPU characteristics of the first physical machine, the second physical machine, and the third physical machine, and the first sorting result is that the second physical machine and the third physical machine are tied for first, and the first physical machine is second, and then the second physical machine and the third physical machine with the same ranking in the first sorting result are sorted from large to small based on the usage frequencies of the CPU characteristics of the first physical machine, the second physical machine, and the third physical machine, and the second sorting result is determined to be the third physical machine, the second physical machine, and the first physical machine, and the second sorting result is determined to be the target sorting result.
[0071] It should be noted that, in the embodiment of the present application, before obtaining the configuration information of the virtual machine to be migrated, the state of the virtual machine to be migrated may be switched from no-migrating to preparing.
[0072] Step 202: The source physical machine sends a simulation request to the destination physical machine.
[0073] In an embodiment of the present application, after the source physical machine determines the destination physical machine, it can send a simulation request to the destination physical machine, wherein the simulation request is used to instruct the destination physical machine to simulate missing CPU instructions, and the missing CPU instructions are CPU instructions supported by the source physical machine but not supported by the destination physical machine.
[0074] It should be noted that in the embodiment of the present application, after the source physical machine sends a simulation request to the destination physical machine, the destination physical machine will send a first instruction to the VMM and a second instruction to the FPGA, wherein the first instruction instructs the VMM to load the CPU instruction simulator to simulate the missing CPU instruction, and the second instruction instructs the FPGA to burn the missing CPU instruction. The destination physical machine simulates the missing CPU instruction by combining software and hardware, which not only avoids service anomalies or even virtual machine failures caused by the virtual machine using unsupported CPU instructions on the destination physical machine, but also realizes hot migration of virtual machines while ensuring business continuity. Moreover, compared with the pure software method, the combination of software and hardware improves the performance of the simulated missing CPU instructions.
[0075] Step 203: the source physical machine sends a negotiation request to the destination physical machine, and upon receiving a negotiation success response returned by the destination physical machine, hot migrates the memory of the virtual machine to be migrated to the destination physical machine.
[0076] In an embodiment of the present application, after the source physical machine sends a simulation request to the destination physical machine, it can send a negotiation request to the destination physical machine, and upon receiving a successful negotiation response returned by the destination physical machine, hot migrate the memory of the virtual machine to be migrated to the destination physical machine, wherein the negotiation request carries the configuration information of the virtual machine to be migrated.
[0077] It should be noted that in an embodiment of the present application, after the source physical machine sends a negotiation request to the destination physical machine, the destination physical machine can start to allocate the required resources for the virtual machine to be migrated based on the configuration information of the virtual machine to be migrated carried in the negotiation request, for example, calling VMM to negotiate pre-migration (pre_live_migration), create a local resource directory, create or link storage resources, create a network device and connect it. If the negotiation pre-migration fails, the network device is deleted, the storage resources are deleted or disconnected, and the local resource directory is deleted.
[0078] It should be noted that in an embodiment of the present application, when hot migrating the memory of the virtual machine to be migrated to the destination physical machine, the destination physical machine can start the VMM to monitor the progress of the hot migration. For example, the VMM executes the hot migration of the memory of the virtual machine to be migrated, and checks after executing the hot migration of the memory of the virtual machine to be migrated.
[0079] It should be noted that in an embodiment of the present application, before hot migrating the memory of the virtual machine to be migrated to the destination physical machine, the state of the virtual machine to be migrated can be changed from preparing to migrating; after hot migrating the memory of the virtual machine to be migrated to the destination physical machine, the state of the virtual machine to be migrated can be switched from migrating to no-migrating, and the memory of the virtual machine to be migrated can be cleaned up.
[0080] In the above scheme, after the source physical machine obtains the configuration information of the virtual machine to be migrated and determines the destination physical machine, it first sends a simulation request to the destination physical machine, wherein the simulation request is used to instruct the destination physical machine to simulate the missing CPU instruction, and the missing CPU instruction is a CPU instruction supported by the source physical machine but not supported by the destination physical machine. Then, a negotiation request is sent to the destination physical machine, and then upon receiving the successful negotiation response returned by the destination physical machine, the memory of the virtual machine to be migrated is hot migrated to the destination physical machine; wherein the negotiation request carries the configuration information of the virtual machine to be migrated. By instructing the destination physical machine to simulate the missing CPU instruction, the matching rate of the CPU characteristics of the source physical machine and the CPU characteristics of the destination physical machine is improved, and service anomalies or even virtual machine failures caused by the virtual machine using unsupported CPU instructions on the destination physical machine are avoided, thereby achieving hot migration of virtual machines while ensuring business continuity.
[0081] Based on the same inventive concept, the embodiment of the present application also provides a virtual machine hot migration device, which can be applied to the aforementioned Figure 1 The source physical machine in the virtual machine hot migration system shown. The virtual machine hot migration device can implement the functions corresponding to the aforementioned virtual machine hot migration method. The virtual machine hot migration device can be a hardware structure, a software module, or a hardware structure plus a software module. The virtual machine hot migration device can be implemented by a chip system, which can be composed of chips or include chips and other discrete devices. See Figure 3 , is a structural diagram of a virtual machine hot migration device provided in an embodiment of the present application, and the virtual machine hot migration device includes a determination module 301, a sending module 302 and a migration module 303.
[0082] The determination module 301 is used to obtain the configuration information of the virtual machine to be migrated and determine the destination physical machine;
[0083] A sending module 302 is used to send a simulation request to the destination physical machine; wherein the simulation request is used to instruct the destination physical machine to simulate a missing central processing unit CPU instruction, and the missing CPU instruction is a CPU instruction supported by the source physical machine but not supported by the destination physical machine;
[0084] The migration module 303 is used to send a negotiation request to the destination physical machine, and upon receiving a successful negotiation response returned by the destination physical machine, hot migrate the memory of the virtual machine to be migrated to the destination physical machine; wherein the negotiation request carries the configuration information.
[0085] In an optional implementation manner, the determining module 301 is specifically configured to:
[0086] Obtaining a matching rate between the CPU characteristics of the source end physical machine and the CPU characteristics of at least one physical machine, and determining whether there is a physical machine whose matching rate is greater than a preset threshold;
[0087] If so, determining that the physical machine with a matching rate greater than a preset threshold is the destination physical machine;
[0088] If not, sort the at least one physical machine from large to small based on the set length and usage frequency of the CPU characteristics of the at least one physical machine to obtain a target sorting result, and determine that the highest ranked physical machine in the target sorting result is the destination physical machine.
[0089] In an optional implementation manner, the determining module 301 is specifically configured to:
[0090] Sorting the at least one physical machine from large to small based on the set length of the CPU characteristics of the at least one physical machine to obtain a first sorting result;
[0091] Sort the physical machines with the same ranking in the first sorting result from large to small based on the usage frequency of the CPU characteristics of the at least one physical machine, to obtain a second sorting result;
[0092] Determine that the second sorting result is the target sorting result.
[0093] In an optional implementation manner, the sending module 302 is specifically configured to:
[0094] A simulation request is sent to the destination physical machine, so that the destination physical machine sends a first instruction to the virtual machine manager VMM and sends a second instruction to the field programmable gate array FPGA, wherein the first instruction instructs the VMM to load a CPU instruction simulator to simulate the missing CPU instruction, and the second instruction instructs the FPGA to burn the missing CPU instruction.
[0095] In an optional implementation, the device further includes a processing module, configured to:
[0096] Before obtaining configuration information of the virtual machine to be migrated, switching the state of the virtual machine to be migrated from non-migration to preparation;
[0097] Before hot migrating the memory of the virtual machine to be migrated to the destination physical machine, changing the state of the virtual machine to be migrated from preparation to migration;
[0098] After hot migrating the memory of the virtual machine to be migrated to the destination physical machine, the state of the virtual machine to be migrated is switched from migration to non-migration, and the memory of the virtual machine to be migrated is cleared.
[0099] Based on the same inventive concept, the present application also provides a virtual machine hot migration system, see Figure 4 , is a structural diagram of a virtual machine hot migration system provided in an embodiment of the present application, the virtual machine hot migration system includes at least one processor 402, and a memory 401 connected to the at least one processor. The specific connection medium between the processor 402 and the memory 401 is not limited in the embodiment of the present application. Figure 4 For example, the processor 402 and the memory 401 are connected via a bus 400. Figure 4 The bus 400 is represented by a bold line, and the connection between other components is only for schematic illustration and is not limited thereto. The bus 400 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0100] In an embodiment of the present application, the memory 401 stores instructions that can be executed by at least one processor 402. At least one processor 402 can execute the steps included in the aforementioned virtual machine hot migration method by calling the instructions stored in the memory 401. Among them, the processor 402 is the control center of the virtual machine hot migration system, and can use various interfaces and lines to connect various parts of the entire virtual machine hot migration system, and implement various functions of the virtual machine hot migration system by executing the instructions stored in the memory 401. Optionally, the processor 402 may include one or more processing units, and the processor 402 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application program, etc., and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 402. In some embodiments, the processor 402 and the memory 401 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.
[0101] Memory 401, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. Memory 401 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic storage, disk, optical disk, etc. Memory 401 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 401 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0102] In the embodiment of the present application, the processor 402 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiment of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the virtual machine hot migration method disclosed in the embodiment of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0103] By designing and programming the processor 402, the code corresponding to the virtual machine hot migration method introduced in the aforementioned embodiment can be solidified into the chip, so that the chip can execute the steps of the aforementioned virtual machine hot migration method during operation. How to design and program the processor 402 is a technology well known to those skilled in the art and will not be repeated here.
[0104] Based on the same inventive concept, an embodiment of the present application further provides a storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes the steps of the aforementioned virtual machine hot migration method.
[0105] In some possible implementations, various aspects of the virtual machine hot migration method provided in the present application can also be implemented in the form of a program product, which includes program code. When the program product is run on a virtual machine hot migration system, the program code is used to enable the virtual machine hot migration system to execute the steps of the virtual machine hot migration method according to various exemplary embodiments of the present application described above in this specification.
[0106] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0107] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0108] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0109] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0110] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A virtual machine hot migration method, characterized in that: Applied to the source physical machine, including: Obtain the configuration information of the virtual machine to be migrated and determine the destination physical machine; Sending a simulation request to the destination physical machine, so that the destination physical machine sends a first instruction to the virtual machine manager VMM, and sends a second instruction to the field programmable gate array FPGA; wherein the simulation request is used to instruct the destination physical machine to simulate a missing central processing unit CPU instruction, the missing CPU instruction is a CPU instruction supported by the source physical machine but not supported by the destination physical machine, the first instruction instructs the VMM to load a CPU instruction simulator to simulate the missing CPU instruction, and the second instruction instructs the FPGA to burn the missing CPU instruction; A negotiation request is sent to the destination physical machine, and upon receiving a negotiation success response returned by the destination physical machine, the memory of the virtual machine to be migrated is hot migrated to the destination physical machine; wherein the negotiation request carries the configuration information.
2. The method according to claim 1, characterized in that The determining of the destination physical machine includes: Obtaining a matching rate between the CPU characteristics of the source end physical machine and the CPU characteristics of at least one physical machine, and determining whether there is a physical machine whose matching rate is greater than a preset threshold; If so, determining that the physical machine with a matching rate greater than a preset threshold is the destination physical machine; If not, sort the at least one physical machine from large to small based on the set length and usage frequency of the CPU characteristics of the at least one physical machine to obtain a target sorting result, and determine that the highest ranked physical machine in the target sorting result is the destination physical machine.
3. The method according to claim 2, characterized in that The step of sorting the at least one physical machine from large to small based on the set length and the usage frequency of the CPU characteristics of the at least one physical machine to obtain a target sorting result includes: Sorting the at least one physical machine from large to small based on the set length of the CPU characteristics of the at least one physical machine to obtain a first sorting result; Sort the physical machines with the same ranking in the first sorting result from large to small based on the usage frequency of the CPU characteristics of the at least one physical machine, to obtain a second sorting result; Determine that the second sorting result is the target sorting result.
4. The method according to claim 1, characterized in that Also includes: Before obtaining configuration information of the virtual machine to be migrated, switching the state of the virtual machine to be migrated from non-migration to preparation; Before hot migrating the memory of the virtual machine to be migrated to the destination physical machine, changing the state of the virtual machine to be migrated from preparation to migration; After hot migrating the memory of the virtual machine to be migrated to the destination physical machine, the state of the virtual machine to be migrated is switched from migration to non-migration, and the memory of the virtual machine to be migrated is cleared.
5. A virtual machine hot migration device, characterized in that: Applied to the source physical machine, including: A determination module is used to obtain the configuration information of the virtual machine to be migrated and determine the destination physical machine; A sending module, used for sending a simulation request to the destination physical machine, so that the destination physical machine sends a first instruction to the virtual machine manager VMM, and sends a second instruction to the field programmable gate array FPGA; wherein the simulation request is used to instruct the destination physical machine to simulate a missing central processing unit CPU instruction, the missing CPU instruction is a CPU instruction supported by the source physical machine but not supported by the destination physical machine, the first instruction instructs the VMM to load a CPU instruction simulator to simulate the missing CPU instruction, and the second instruction instructs the FPGA to burn the missing CPU instruction; A migration module is used to send a negotiation request to the destination physical machine, and upon receiving a negotiation success response returned by the destination physical machine, hot migrate the memory of the virtual machine to be migrated to the destination physical machine; wherein the negotiation request carries the configuration information.
6. The device according to claim 5, characterized in that The determination module is specifically used for: Obtaining a matching rate between the CPU characteristics of the source end physical machine and the CPU characteristics of at least one physical machine, and determining whether there is a physical machine whose matching rate is greater than a preset threshold; If so, determining that the physical machine with a matching rate greater than a preset threshold is the destination physical machine; If not, sort the at least one physical machine from large to small based on the set length and usage frequency of the CPU characteristics of the at least one physical machine to obtain a target sorting result, and determine that the highest ranked physical machine in the target sorting result is the destination physical machine.
7. The device according to claim 6, characterized in that The determination module is specifically used for: Sorting the at least one physical machine from large to small based on the set length of the CPU characteristics of the at least one physical machine to obtain a first sorting result; Sort the physical machines with the same ranking in the first sorting result from large to small based on the usage frequency of the CPU characteristics of the at least one physical machine, to obtain a second sorting result; Determine that the second sorting result is the target sorting result.
8. A virtual machine hot migration system, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in the method according to any one of claims 1 to 4 according to the obtained program instructions.
9. A storage medium, characterized in that: The storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the steps included in the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Method and device for realizing virtual machine migration and cluster system
CN103810016A
Methods and equipment of data migration and systems thereof
CN107678830A