CN114489930A - Virtual machine live migration method, device and system - Google Patents
Virtual machine live migration method, device and system Download PDFInfo
- Publication number
- CN114489930A CN114489930A CN202111593288.4A CN202111593288A CN114489930A CN 114489930 A CN114489930 A CN 114489930A CN 202111593288 A CN202111593288 A CN 202111593288A CN 114489930 A CN114489930 A CN 114489930A
- Authority
- CN
- China
- Prior art keywords
- physical machine
- destination
- machine
- virtual machine
- cpu
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000013508 migration Methods 0.000 title claims abstract description 112
- 230000005012 migration Effects 0.000 title claims abstract description 110
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000004088 simulation Methods 0.000 claims abstract description 29
- 230000004044 response Effects 0.000 claims abstract description 11
- 238000012545 processing Methods 0.000 claims description 14
- 238000003860 storage Methods 0.000 claims description 13
- 238000002360 preparation method Methods 0.000 claims description 12
- 238000004140 cleaning Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 16
- 238000004590 computer program Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 230000002159 abnormal effect Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/4557—Distribution of virtual machine instances; Migration and load balancing
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Hardware Redundancy (AREA)
Abstract
The application provides a method, a device and a system for virtual machine live migration, which are used for solving the technical problem that the virtual machine live migration cannot be realized while the service continuity is ensured in the prior art, and the method comprises the following steps: acquiring configuration information of a virtual machine to be migrated, and determining a destination physical machine; sending a simulation request to the destination physical machine; the simulation request is used for indicating the destination end physical machine to simulate a missing CPU instruction, wherein the missing CPU instruction is a CPU instruction which is supported by the source end physical machine but not supported by the destination end physical machine; sending a negotiation request to the destination physical machine, and performing hot migration on the memory of the virtual machine to be migrated to the destination physical machine when receiving a negotiation success response returned by the destination physical machine; wherein the negotiation request carries the configuration information.
Description
Technical Field
The application relates to the technical field of cloud computing, in particular to a method, a device and a system for live migration of a virtual machine.
Background
Virtual machine Live Migration (Live Migration) is a key technology in cloud computing operation, and can migrate a virtual machine from a source-end physical machine to a destination-end physical machine under the condition that the virtual machine is kept running normally on the source-end physical machine, so that dynamic scheduling of computing resources and active operation and maintenance of physical faults are realized. The virtual machine live migration has a constraint condition on all the virtual machines, the source physical machine and the destination physical machine, for example, when the source physical machine and the destination physical machine share storage or do not share storage but migrate through a Block (Block), 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 a virtual operating system EMUlator (QEMU) version and a Read Only Memory (ROM) version of the virtual machine need to be consistent or compatible.
At present, when the virtual machine is subjected to the hot migration between a source physical machine and a destination physical machine of a heterogeneous or heterogeneous platform, the virtual machine needs to be configured in a host-model mode or a host-passthrough mode, the CPU characteristics of the source physical machine and the destination physical machine are required to be completely consistent during the live migration of the virtual machines in the two modes, for a scene with more virtual machines but less physical machines or a physical cluster fault, if the constraint condition is obeyed, the service continuity cannot be guaranteed, if the constraint condition is not obeyed, the virtual machine live migration cannot be realized, for example, if the CPU characteristics of the source physical machine and the destination physical machine are completely different or the consistency is low, after the virtual machine is migrated from the source physical machine to the destination physical machine, once the virtual machine uses unsupported CPU instructions at the destination physical machine, it can cause service exceptions or even virtual machine failures.
Therefore, the prior art has the problem that the live migration of the virtual machine cannot be realized while the service continuity is ensured.
Disclosure of Invention
The embodiment of the application provides a virtual machine live migration method, device and system, which are used for solving the technical problem that the virtual machine live migration cannot be realized while the service continuity is ensured in the prior art.
In a first aspect, to solve the foregoing technical problem, an embodiment of the present application provides a virtual machine live migration method, applied to a source physical machine, including:
acquiring configuration information of a virtual machine to be migrated, and determining a destination physical machine;
sending a simulation request to the destination physical machine; the simulation request is used for indicating the destination terminal physical machine to simulate a missing Central Processing Unit (CPU) instruction, wherein the missing CPU instruction is a CPU instruction supported by the source terminal physical machine but not supported by the destination terminal physical machine;
sending a negotiation request to the destination physical machine, and performing hot migration on the memory of the virtual machine to be migrated to the destination physical machine when receiving a negotiation success response returned by the destination physical machine; wherein the negotiation request carries the configuration information.
In the embodiment of the application, a source end physical machine can obtain configuration information of a virtual machine to be migrated, determine a destination end physical machine, and send a simulation request to the destination end physical machine, where the simulation request is used to instruct the destination end physical machine to simulate a missing CPU instruction, the missing CPU instruction is a CPU instruction supported by the source end physical machine but not supported by the destination end physical machine, send a negotiation request to the destination end physical machine, and when a negotiation success response returned by the destination end physical machine is received, perform hot migration on a memory of the virtual machine to be migrated to the destination end physical machine; and the negotiation request carries configuration information of the virtual machine to be migrated. By indicating the destination physical machine to simulate the missing CPU instruction, the matching rate of the CPU characteristic of the source physical machine and the CPU characteristic of the destination physical machine is improved, abnormal service even virtual machine failure caused by the fact that the virtual machine uses the unsupported CPU instruction in the destination physical machine is avoided, and therefore service continuity is guaranteed while virtual machine live migration is achieved.
In an optional implementation, the determining the destination physical machine includes:
acquiring the matching rate of the CPU characteristic of the source end physical machine and the CPU characteristic of at least one physical machine, and determining whether the physical machine with the matching rate larger than a preset threshold exists;
if the matching rate is greater than the preset threshold value, determining the physical machine with the matching rate greater than the preset threshold value as the destination end physical machine;
if not, sorting the at least one physical machine from large to small based on the set length and the use frequency of the CPU characteristics of the at least one physical machine to obtain a target sorting result, and determining the physical machine with the highest sorting in the target sorting result as the destination end physical machine.
In an optional implementation, the 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 big to small based on the set length of the CPU characteristics of the at least one physical machine to obtain a first sorting result;
sorting physical machines with the same sorting in the first sorting result from large to small based on the using frequency of the CPU characteristic of at least one physical machine to obtain a second sorting result;
and determining the second sorting result as the target sorting result.
In an optional implementation, the sending a simulation request to the destination physical machine includes:
sending a simulation request to the destination physical machine to enable the destination physical machine to send a first instruction to a Virtual Machine Manager (VMM) and send a second instruction to a field programmable logic 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 write the missing CPU instruction.
In this embodiment of the present application, the source physical machine may send a simulation request to the destination physical machine, so that the destination physical machine sends a first instruction to the VMM, and sends a second instruction to the FPGA, where 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 write the missing CPU instruction. The target end physical machine simulates the CPU instruction in a software and hardware combined mode, compared with a pure software mode, the performance of the simulated CPU instruction in the absence is improved, further, the service abnormity and even the virtual machine fault caused by the fact that the virtual machine uses the unsupported CPU instruction in the target end physical machine are avoided, and the virtual machine heat transfer is realized while the service continuity is guaranteed.
In an alternative embodiment, the method further comprises:
before configuration information of a virtual machine to be migrated is acquired, switching the state of the virtual machine to be migrated from non-migration to preparation;
before the memory of the virtual machine to be migrated is hot-migrated to the destination physical machine, the state of the virtual machine to be migrated is changed from preparation to migration;
after the memory of the virtual machine to be migrated is migrated to the destination physical machine, switching the state of the virtual machine to be migrated from migration to non-migration, and cleaning the memory of the virtual machine to be migrated.
In a second aspect, an embodiment of the present application further provides a virtual machine live migration apparatus, which is applied to a source physical machine, and includes:
the determining module is used for acquiring configuration information of the virtual machine to be migrated and determining a destination physical machine;
the sending module is used for sending a simulation request to the destination physical machine; the simulation request is used for indicating the destination terminal physical machine to simulate a missing Central Processing Unit (CPU) instruction, wherein the missing CPU instruction is a CPU instruction supported by the source terminal physical machine but not supported by the destination terminal physical machine;
the migration module is used for sending a negotiation request to the destination physical machine and performing hot migration on the memory of the virtual machine to be migrated to the destination physical machine when receiving a negotiation success response returned by the destination physical machine; wherein the negotiation request carries the configuration information.
In an optional implementation manner, the determining module is specifically configured to:
acquiring the matching rate of the CPU characteristic of the source end physical machine and the CPU characteristic of at least one physical machine, and determining whether the physical machine with the matching rate larger than a preset threshold exists;
if the matching rate is greater than the preset threshold value, determining the physical machine with the matching rate greater than the preset threshold value as the destination end physical machine;
if not, sorting the at least one physical machine from large to small based on the set length and the use frequency of the CPU characteristics of the at least one physical machine to obtain a target sorting result, and determining the physical machine with the highest sorting in the target sorting result as the destination end physical machine.
In an optional implementation manner, the determining module is specifically configured to:
sorting the at least one physical machine from big to small based on the set length of the CPU characteristics of the at least one physical machine to obtain a first sorting result;
sorting physical machines with the same sorting in the first sorting result from large to small based on the using frequency of the CPU characteristic of at least one physical machine to obtain a second sorting result;
and determining the second sorting result as the target sorting result.
In an optional implementation manner, the sending module is specifically configured to:
sending a simulation request to the destination physical machine to enable the destination physical machine to send a first instruction to a Virtual Machine Manager (VMM) and send a second instruction to a field programmable logic 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 write the missing CPU instruction.
In an optional embodiment, the apparatus further comprises a processing module configured to:
before configuration information of a virtual machine to be migrated is acquired, switching the state of the virtual machine to be migrated from non-migration to preparation;
before the memory of the virtual machine to be migrated is hot-migrated to the destination physical machine, the state of the virtual machine to be migrated is changed from preparation to migration;
after the memory of the virtual machine to be migrated is migrated to the destination physical machine, switching the state of the virtual machine to be migrated from migration to non-migration, and cleaning the memory of the virtual machine to be migrated.
In a third aspect, an embodiment of the present application further provides a virtual machine live migration system, including:
a memory for storing program instructions;
and the processor is used for calling the program instructions stored in the memory and executing the steps included in any one of the implementation modes of the first aspect according to the obtained program instructions.
In a fourth aspect, embodiments of the present application provide a storage medium storing computer-executable instructions for causing a computer to perform the steps included in any one of the embodiments of the first aspect.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application.
Fig. 1 is a schematic structural diagram of a virtual machine live migration system according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a virtual machine live migration method according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a virtual machine live migration apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of another virtual machine live migration system according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. In the present application, the embodiments and features of the embodiments may be arbitrarily combined with each other without conflict. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described can be performed in an order different than here.
The terms "first" and "second" in the description and claims of the present application and the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the term "comprises" and any variations thereof, which are intended to cover non-exclusive protection. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
In the embodiments of the present application, "at least one" may mean at least two, for example, two, three, or more, and the embodiments of the present application are not limited.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in this document generally indicates that the preceding and following related objects are in an "or" relationship unless otherwise specified.
At present, when the virtual machine is subjected to the hot migration between a source physical machine and a destination physical machine of a heterogeneous or heterogeneous platform, the virtual machine needs to be configured in a host-model mode or a host-passthrough mode, the CPU characteristics of the source physical machine and the destination physical machine are required to be completely consistent during the live migration of the virtual machines in the two modes, for a scene with more virtual machines but less physical machines or a physical cluster fault, if the constraint condition is obeyed, the service continuity cannot be guaranteed, if the constraint condition is not obeyed, the virtual machine live migration cannot be realized, for example, if the CPU characteristics of the source physical machine and the destination physical machine are completely different or the consistency is low, after the virtual machine is migrated from the source physical machine to the destination physical machine, once the virtual machine uses unsupported CPU instructions at the destination physical machine, it can cause service exceptions or even virtual machine failures. Therefore, the prior art has the problem that the live migration of the virtual machine cannot be realized while the service continuity is ensured.
In view of this, an embodiment of the present application provides a virtual machine live migration method, in which a source end physical machine may obtain configuration information of a virtual machine to be migrated, determine a destination end physical machine, and send a simulation request to the destination end physical machine, where the simulation request is used to indicate that the destination end physical machine simulates a missing CPU instruction, the missing CPU instruction is a CPU instruction that is supported by the source end physical machine but not supported by the destination end physical machine, send a negotiation request to the destination end physical machine, and when a negotiation success response returned by the destination end physical machine is received, live migrate a memory of the virtual machine to be migrated to the destination end physical machine; and the negotiation request carries configuration information of the virtual machine to be migrated. By indicating the destination physical machine to simulate the missing CPU instruction, the matching rate of the CPU characteristic of the source physical machine and the CPU characteristic of the destination physical machine is improved, abnormal service even virtual machine failure caused by the fact that the virtual machine uses the unsupported CPU instruction in the destination physical machine is avoided, and therefore service continuity is guaranteed while virtual machine live migration is achieved.
In order to better understand the technical solutions, the technical solutions of the present application are described in detail below through the drawings and the specific embodiments of the specification, and it should be understood that the specific features of the embodiments and examples of the present application are detailed descriptions of the technical solutions of the present application, and are not limitations of the technical solutions of the present application, and the technical features of the embodiments and examples of the present application may be combined with each other without conflict.
As shown in fig. 1, a schematic structural diagram of a virtual machine live migration system to which the method provided in the embodiment of the present application is applicable is shown, but it should be understood that the virtual machine live migration system shown in fig. 1 is a simple illustration of a virtual machine live migration system to which the method provided in the embodiment of the present application is applicable, and is not a limitation of a virtual machine live migration system to which the method provided in the embodiment of the present application is applicable.
The Virtual Machine live migration system shown in fig. 1 includes a source physical Machine 101 and a destination physical Machine 102, where the source physical Machine 101 runs a Virtual Machine to be migrated 1011, and the destination physical Machine 102 includes a Virtual Machine Manager (VMM) 1021 and a Field Programmable Gate Array (FPGA) 1022.
It should be noted that, in this embodiment of the application, one virtual machine to be migrated may run on the source physical machine 101, or multiple virtual machines to be migrated may run on the source physical machine 101, and fig. 1 is only an exemplary diagram of one virtual machine to be migrated, and this embodiment of the application does not limit the number of virtual machines to be migrated that run on the source physical machine 101.
It should be noted that, in this embodiment of the present application, the source physical machine 101 and the destination physical machine 102 may be heterogeneous or heterogeneous platforms, or may also be homogeneous or the same platform, which is not specifically limited in this embodiment of the present application, and for convenience of description, for example, the source physical machine 101 and the destination physical machine 102 are heterogeneous or heterogeneous platforms, and a to-be-migrated virtual machine running on the source physical machine 101 is configured to be in a host-model mode or a host-passhrough mode.
Fig. 2 is a schematic flow chart of a virtual machine live migration method according to an embodiment of the present application, where the virtual machine live migration method may be applied to a source physical machine in the virtual machine live migration system shown in fig. 1. The specific flow of the method is described below.
Step 201: the source end physical machine obtains configuration information of the virtual machine to be migrated, and determines a destination end physical machine.
In the embodiment of the present application, the live migration is also referred to as live migration or live migration, that is, virtual machine save (save) or restore (restore), which generally saves the running state of the entire virtual machine completely, and can be quickly restored to the original hardware platform or even different hardware platforms at the same time, after the restoration, the virtual machine still runs smoothly, and the user does not perceive any difference. When the virtual machine to be migrated running on the source physical machine needs to be migrated to the destination physical machine in a hot migration manner, the source physical machine may first obtain configuration information of the virtual machine to be migrated, and then determine the destination physical machine from at least one physical machine.
Specifically, the matching rate of the CPU characteristic of the source end physical machine and the CPU characteristic of the at least one physical machine is obtained, whether the physical machine with the matching rate larger than a preset threshold value exists is determined, if yes, the physical machine with the matching rate larger than the preset threshold value is determined to be the destination end physical machine, if not, the at least one physical machine is sorted from large to small based on the collection length and the use frequency of the CPU characteristic of the at least one physical machine, a target sorting result is obtained, and the physical machine with the highest sorting degree in the target sorting result is determined to be the destination end physical machine.
For example, if the preset threshold is 95%, the matching rate of the CPU characteristics of the source physical machine to the CPU characteristics of the first physical machine is 80%, the matching rate to the CPU characteristics of the second physical machine is 90%, and the matching rate to the CPU characteristics of the third physical machine is 92%, it is determined that there is no physical machine whose matching rate is greater than the preset threshold, the first physical machine, the second physical machine, and the third physical machine need to be sorted from large to small based on the set length and the use frequency of the CPU characteristics of the first physical machine, the second physical machine, and the third physical machine to obtain a target sorting result, and if the target sorting result is the third physical machine, the second physical machine, and the first physical machine, it is determined that the third physical machine with the highest ranking in the target sorting result is the destination physical machine.
It should be noted that, in this embodiment of the present application, when the at least one physical machine is sorted from large to small based on the set length and the usage frequency of the CPU characteristic of the at least one physical machine to obtain the target sorting result, the at least one physical machine may be sorted from large to small based on the set length of the CPU characteristic of the at least one physical machine to obtain a first sorting result, and then the physical machines with the same sorting order in the first sorting result are sorted from large to small based on the usage frequency of the CPU characteristic of the at least one physical machine to obtain a second sorting result, and the second sorting result is determined as the target sorting result.
For example, 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%, 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, the first sorting result is obtained that the second physical machine and the third physical machine are juxtaposed to be the first, the first physical machine is the second, and then the second physical machine and the third physical machine, which are sorted in the first sorting result in the same order, 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, the second sorting result is obtained that 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.
It should be noted that, in the embodiment of the present application, before the configuration information of the virtual machine to be migrated is obtained, the state of the virtual machine to be migrated may be changed from non-migration switching (no-migration) to preparation (preparation).
Step 202: the source end physical machine sends a simulation request to the destination end physical machine.
In this embodiment of the present application, after determining the destination physical machine, the source physical machine may send a simulation request to the destination physical machine, where the simulation request is used to instruct the destination physical machine to simulate a missing CPU instruction, and the missing CPU instruction is a CPU instruction that is supported by the source physical machine but not supported by the destination physical machine.
It should be noted that, in this embodiment of the present application, after the source physical machine sends the emulation request to the destination physical machine, the destination physical machine sends a first instruction to the VMM, and sends a second instruction to the FPGA, where the first instruction instructs the VMM to load the CPU instruction emulator to emulate the missing CPU instruction, and the second instruction instructs the FPGA to write the missing CPU instruction. The target end physical machine simulates the missing CPU instruction in a mode of combining software and hardware, so that the abnormal service and even the virtual machine fault caused by the fact that the virtual machine uses the unsupported CPU instruction at the target end physical machine are avoided, the service continuity is guaranteed, meanwhile, the virtual machine live migration is realized, and compared with a pure software mode, the performance of the simulated missing CPU instruction is improved in a mode of combining software and hardware.
Step 203: and the source end physical machine sends a negotiation request to the destination end physical machine, and the memory of the virtual machine to be migrated is migrated to the destination end physical machine in a hot mode when a negotiation success response returned by the destination end physical machine is received.
In this embodiment of the present application, after a source end physical machine sends a simulation request to a destination end physical machine, a negotiation request may be sent to the destination end physical machine, and when a negotiation success response returned by the destination end physical machine is received, a memory of a virtual machine to be migrated is migrated to the destination end physical machine in a hot migration manner, where the negotiation request carries configuration information of the virtual machine to be migrated.
It should be noted that, in this embodiment of the application, after the source physical machine sends the negotiation request to the destination physical machine, the destination physical machine may start to allocate a required resource to the virtual machine to be migrated based on the configuration information of the virtual machine to be migrated, which is carried in the negotiation request, for example, call the VMM to perform pre-migration (pre _ live _ migration), create a local resource directory, create or link a storage resource, create a network device and connect, and if the pre-migration fails, delete the network device, delete or disconnect the storage resource, and delete the local resource directory.
It should be noted that, in this embodiment of the application, when the memory of the virtual machine to be migrated is migrated to the destination physical machine, the destination physical machine may start the VMM to monitor a migration progress, for example, the VMM executes the migration of the memory of the virtual machine to be migrated, and checks after executing the migration of the memory of the virtual machine to be migrated.
It should be noted that, in this embodiment of the application, before the memory of the virtual machine to be migrated is hot-migrated to the destination physical machine, the state of the virtual machine to be migrated may be changed from preparation (preparation) to migration (migration), and after the memory of the virtual machine to be migrated is hot-migrated to the destination physical machine, the state of the virtual machine to be migrated may be switched from migration (migration) to non-migration (no-migration), and the memory of the virtual machine to be migrated is cleaned.
According to the scheme, after a source end physical machine acquires configuration information of a virtual machine to be migrated and determines a destination end physical machine, a simulation request is sent to the destination end physical machine, wherein the simulation request is used for indicating the destination end physical machine to simulate a missing CPU instruction, the missing CPU instruction is a CPU instruction which is supported by the source end physical machine but not supported by the destination end physical machine, a negotiation request is sent to the destination end physical machine, and then when a negotiation success response returned by the destination end physical machine is received, a memory of the virtual machine to be migrated is subjected to hot migration to the destination end physical machine; and the negotiation request carries configuration information of the virtual machine to be migrated. By indicating the destination physical machine to simulate the missing CPU instruction, the matching rate of the CPU characteristic of the source physical machine and the CPU characteristic of the destination physical machine is improved, abnormal service even virtual machine failure caused by the fact that the virtual machine uses the unsupported CPU instruction in the destination physical machine is avoided, and therefore service continuity is guaranteed while virtual machine live migration is achieved.
Based on the same inventive concept, an embodiment of the present application further provides a virtual machine live migration apparatus, where the virtual machine live migration apparatus may be applied to a source physical machine in the virtual machine live migration system shown in fig. 1. The virtual machine live migration device can realize the corresponding function of the virtual machine live migration method. The virtual machine live migration apparatus may be a hardware structure, a software module, or a hardware structure plus a software module. The virtual machine heat migration device can be realized by a chip system, and the chip system can be formed by a chip and can also comprise the chip and other discrete devices. Referring to fig. 3, a schematic structural diagram of a virtual machine live migration apparatus according to an embodiment of the present disclosure is shown, where the virtual machine live migration apparatus includes a determining module 301, a sending module 302, and a migration module 303.
The determining module 301 is configured to obtain configuration information of a virtual machine to be migrated, and determine a destination physical machine;
a sending module 302, configured to send a simulation request to the destination physical machine; the simulation request is used for indicating the destination terminal physical machine to simulate a missing Central Processing Unit (CPU) instruction, wherein the missing CPU instruction is a CPU instruction supported by the source terminal physical machine but not supported by the destination terminal physical machine;
a migration module 303, configured to send a negotiation request to the destination physical machine, and when 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.
In an optional implementation manner, the determining module 301 is specifically configured to:
acquiring the matching rate of the CPU characteristic of the source end physical machine and the CPU characteristic of at least one physical machine, and determining whether the physical machine with the matching rate larger than a preset threshold exists;
if the matching rate is greater than the preset threshold value, determining the physical machine with the matching rate greater than the preset threshold value as the destination end physical machine;
if not, sorting the at least one physical machine from large to small based on the set length and the use frequency of the CPU characteristics of the at least one physical machine to obtain a target sorting result, and determining the physical machine with the highest sorting in the target sorting result as the destination end physical machine.
In an optional implementation manner, the determining module 301 is specifically configured to:
sorting the at least one physical machine from big to small based on the set length of the CPU characteristics of the at least one physical machine to obtain a first sorting result;
sorting physical machines with the same sorting in the first sorting result from large to small based on the using frequency of the CPU characteristic of at least one physical machine to obtain a second sorting result;
and determining the second sorting result as the target sorting result.
In an optional implementation manner, the sending module 302 is specifically configured to:
sending a simulation request to the destination physical machine to enable the destination physical machine to send a first instruction to a Virtual Machine Manager (VMM) and send a second instruction to a field programmable logic 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 write the missing CPU instruction.
In an optional embodiment, the apparatus further comprises a processing module configured to:
before configuration information of a virtual machine to be migrated is acquired, switching the state of the virtual machine to be migrated from non-migration to preparation;
before the memory of the virtual machine to be migrated is hot-migrated to the destination physical machine, the state of the virtual machine to be migrated is changed from preparation to migration;
after the memory of the virtual machine to be migrated is migrated to the destination physical machine, switching the state of the virtual machine to be migrated from migration to non-migration, and cleaning the memory of the virtual machine to be migrated.
Based on the same inventive concept, an embodiment of the present application further provides a virtual machine live migration system, please refer to fig. 4, which is a schematic structural diagram of a virtual machine live migration system provided in the embodiment of the present application, where the virtual machine live migration system includes at least one processor 402 and a memory 401 connected to the at least one processor, a specific connection medium between the processor 402 and the memory 401 is not limited in the embodiment of the present application, fig. 4 illustrates an example in which the processor 402 and the memory 401 are connected by a bus 400, the bus 400 is shown by a thick line in fig. 4, and a connection manner between other components is only schematically illustrated, and is not limited thereto. The bus 400 may be divided into an address bus, a data bus, a control bus, etc., and is shown with only one thick line in fig. 4 for ease of illustration, but does not represent only one bus or type of bus.
In this embodiment, the memory 401 stores instructions executable by the at least one processor 402, and the at least one processor 402 may execute the steps included in the foregoing virtual machine live migration method by calling the instructions stored in the memory 401. The processor 402 is a control center of the virtual machine live migration system, and may connect various parts of the entire virtual machine live migration system by using various interfaces and lines, and implement various functions of the virtual machine live migration system by executing 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 handles operating systems, user interfaces, application programs, and the like, and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 402. In some embodiments, processor 402 and memory 401 may be implemented on the same chip, or in some embodiments, they may be implemented separately on separate chips.
In the embodiments 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, or discrete hardware components, and may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the virtual machine live migration method disclosed in the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
By programming the processor 402, the code corresponding to the virtual machine live migration method described in the foregoing embodiment may be solidified into a chip, so that the chip can execute the steps of the virtual machine live migration method when running, and how to program and design the processor 402 is a technique known to those skilled in the art, and is not described here again.
Based on the same inventive concept, embodiments of the present application further provide a storage medium storing computer instructions, which, when executed on a computer, cause the computer to perform the steps of the virtual machine live migration method as described above.
In some possible embodiments, the aspects of the virtual machine live migration method provided by the present application may also be implemented in the form of a program product, which includes program code for causing a virtual machine live migration system to execute the steps in the virtual machine live migration method according to various exemplary embodiments of the present application described above in this specification, when the program product runs on the virtual machine live migration system.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such 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 intended to include such modifications and variations as well.
Claims (10)
1. A virtual machine live migration method is applied to a source physical machine and comprises the following steps:
acquiring configuration information of a virtual machine to be migrated, and determining a destination physical machine;
sending a simulation request to the destination physical machine; the simulation request is used for indicating the destination terminal physical machine to simulate a missing Central Processing Unit (CPU) instruction, wherein the missing CPU instruction is a CPU instruction supported by the source terminal physical machine but not supported by the destination terminal physical machine;
sending a negotiation request to the destination physical machine, and performing hot migration on the memory of the virtual machine to be migrated to the destination physical machine when receiving a negotiation success response returned by the destination physical machine; wherein the negotiation request carries the configuration information.
2. The method of claim 1, wherein the determining a destination physical machine comprises:
acquiring the matching rate of the CPU characteristic of the source end physical machine and the CPU characteristic of at least one physical machine, and determining whether the physical machine with the matching rate larger than a preset threshold exists;
if the matching rate is greater than the preset threshold value, determining the physical machine with the matching rate greater than the preset threshold value as the destination end physical machine;
if not, sorting the at least one physical machine from large to small based on the set length and the use frequency of the CPU characteristics of the at least one physical machine to obtain a target sorting result, and determining the physical machine with the highest sorting in the target sorting result as the destination end physical machine.
3. The method of claim 2, wherein said sorting the at least one physical machine from big to small based on the set length and frequency of use of the CPU characteristics of the at least one physical machine to obtain a target sorting result comprises:
sorting the at least one physical machine from big to small based on the set length of the CPU characteristics of the at least one physical machine to obtain a first sorting result;
sorting physical machines with the same sorting in the first sorting result from large to small based on the using frequency of the CPU characteristic of at least one physical machine to obtain a second sorting result;
and determining the second sorting result as the target sorting result.
4. A method as claimed in any one of claims 1 to 3, wherein said sending a simulation request to said destination physical machine comprises:
sending a simulation request to the destination physical machine to enable the destination physical machine to send a first instruction to a Virtual Machine Manager (VMM) and send a second instruction to a field programmable logic 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 write the missing CPU instruction.
5. The method of claim 1, further comprising:
before configuration information of a virtual machine to be migrated is acquired, switching the state of the virtual machine to be migrated from non-migration to preparation;
before the memory of the virtual machine to be migrated is hot-migrated to the destination physical machine, the state of the virtual machine to be migrated is changed from preparation to migration;
after the memory of the virtual machine to be migrated is subjected to hot migration to the destination physical machine, switching the state of the virtual machine to be migrated from migration to non-migration, and cleaning the memory of the virtual machine to be migrated.
6. A virtual machine live migration device applied to a source end physical machine comprises:
the determining module is used for acquiring configuration information of the virtual machine to be migrated and determining a destination physical machine;
the sending module is used for sending a simulation request to the destination physical machine; the simulation request is used for indicating the destination terminal physical machine to simulate a missing Central Processing Unit (CPU) instruction, wherein the missing CPU instruction is a CPU instruction supported by the source terminal physical machine but not supported by the destination terminal physical machine;
the migration module is used for sending a negotiation request to the destination physical machine and performing hot migration on the memory of the virtual machine to be migrated to the destination physical machine when receiving a negotiation success response returned by the destination physical machine; wherein the negotiation request carries the configuration information.
7. The apparatus of claim 6, wherein the determination module is specifically configured to:
acquiring the matching rate of the CPU characteristic of the source end physical machine and the CPU characteristic of at least one physical machine, and determining whether the physical machine with the matching rate larger than a preset threshold exists;
if the matching rate is greater than the preset threshold value, determining the physical machine with the matching rate greater than the preset threshold value as the destination end physical machine;
if not, sorting the at least one physical machine from large to small based on the set length and the use frequency of the CPU characteristics of the at least one physical machine to obtain a target sorting result, and determining the physical machine with the highest sorting in the target sorting result as the destination end physical machine.
8. The apparatus of claim 7, wherein the determination module is specifically configured to:
sorting the at least one physical machine from big to small based on the set length of the CPU characteristics of the at least one physical machine to obtain a first sorting result;
sorting physical machines with the same sorting in the first sorting result from large to small based on the using frequency of the CPU characteristic of at least one physical machine to obtain a second sorting result;
and determining the second sorting result as the target sorting result.
9. A virtual machine live migration system, comprising:
a memory for storing program instructions;
a processor for calling program instructions stored in said memory and for executing the steps comprised by the method of any one of claims 1 to 5 in accordance with the obtained program instructions.
10. A storage medium storing computer-executable instructions for causing a computer to perform the steps comprising the method of any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111593288.4A CN114489930A (en) | 2021-12-23 | 2021-12-23 | Virtual machine live migration method, device and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111593288.4A CN114489930A (en) | 2021-12-23 | 2021-12-23 | Virtual machine live migration method, device and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114489930A true CN114489930A (en) | 2022-05-13 |
Family
ID=81493230
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111593288.4A Pending CN114489930A (en) | 2021-12-23 | 2021-12-23 | Virtual machine live migration method, device and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114489930A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116700899A (en) * | 2023-06-14 | 2023-09-05 | 北京志凌海纳科技有限公司 | Compatibility solving method and system of Option ROM in virtual machine thermomigration process |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103810016A (en) * | 2012-11-09 | 2014-05-21 | 北京华胜天成科技股份有限公司 | Method and device for realizing virtual machine migration and cluster system |
US20160014039A1 (en) * | 2014-07-11 | 2016-01-14 | Vmware, Inc. | Methods and apparatus to provision a workload in a virtual server rack deployment |
CN107678830A (en) * | 2017-09-15 | 2018-02-09 | 联想(北京)有限公司 | Data migration method, equipment and its system |
CN113760451A (en) * | 2021-07-26 | 2021-12-07 | 麒麟软件有限公司 | Method and device for correcting migration of virtual machine across host architecture |
-
2021
- 2021-12-23 CN CN202111593288.4A patent/CN114489930A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103810016A (en) * | 2012-11-09 | 2014-05-21 | 北京华胜天成科技股份有限公司 | Method and device for realizing virtual machine migration and cluster system |
US20160014039A1 (en) * | 2014-07-11 | 2016-01-14 | Vmware, Inc. | Methods and apparatus to provision a workload in a virtual server rack deployment |
CN107678830A (en) * | 2017-09-15 | 2018-02-09 | 联想(北京)有限公司 | Data migration method, equipment and its system |
CN113760451A (en) * | 2021-07-26 | 2021-12-07 | 麒麟软件有限公司 | Method and device for correcting migration of virtual machine across host architecture |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116700899A (en) * | 2023-06-14 | 2023-09-05 | 北京志凌海纳科技有限公司 | Compatibility solving method and system of Option ROM in virtual machine thermomigration process |
CN116700899B (en) * | 2023-06-14 | 2023-11-14 | 北京志凌海纳科技有限公司 | Compatibility solving method and system of Option ROM in virtual machine thermomigration process |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104618155B (en) | A kind of virtual machine fault-tolerant method, apparatus and system | |
CN107608757B (en) | Container-based isolation processing method and related equipment | |
CN110704161B (en) | Virtual machine creation method and device and computer equipment | |
CN107395710B (en) | Method and device for realizing configuration and high availability HA of cloud platform network element | |
CN111143034B (en) | Method, device and system for controlling network data forwarding plane | |
CN111736943B (en) | Migration method and system of virtual machine | |
CN108319492B (en) | Method, device and system for resetting physical machine | |
US20190079791A1 (en) | Data Storage Method and Apparatus | |
CN104283951A (en) | Method and device for migrating instances and system | |
CN113342471A (en) | Virtual machine migration method and system and electronic equipment | |
US20240354095A1 (en) | Version Upgrade Method and Apparatus | |
CN111866210A (en) | Virtual IP balance distribution method, system, terminal and storage medium | |
CN110413286A (en) | A kind of application dispositions method, device and equipment | |
CN110569157B (en) | Storage testing method, device, server and storage medium | |
CN114489930A (en) | Virtual machine live migration method, device and system | |
CN110602229A (en) | Terminal system version downloading method, device and system based on dynamic slicing | |
CN109542829B (en) | Control method and device of GPU (graphics processing Unit) equipment in multiple systems and electronic equipment | |
CN117519908B (en) | Virtual machine thermomigration method, computer equipment and medium | |
CN110780889A (en) | Cloud mobile phone data cloning method and cloud mobile phone data restoring method | |
CN105743696A (en) | Cloud computing platform management method | |
CN116560802B (en) | Virtual machine load-based virtual machine self-adaptive thermal migration method and system | |
CN107688479B (en) | Android system network cluster, construction method thereof, and Android system network cluster data processing method and system | |
US20220206836A1 (en) | Method and Apparatus for Processing Virtual Machine Migration, Method and Apparatus for Generating Virtual Machine Migration Strategy, Device and Storage Medium | |
CN112631994A (en) | Data migration method and system | |
CN111124669A (en) | Operation method, system, terminal and storage medium of distributed SaaS software |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |