Virtual machine migration method and system, computer equipment and storage medium

By creating a shared memory resource pool between the source node and the destination node, the virtual machine migration process is divided into two stages, which solves the problem of business interruption during the virtual machine migration process, and achieves the effects of interruption-free business migration and network resource saving.

CN119806731AActive Publication Date: 2025-04-11INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202411855532.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-11
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

During the virtual machine migration process, the virtual machine's business needs to be interrupted, affecting the business operation.

Method used

By creating a shared memory resource pool between the source node and the destination node, the migration process of the virtual machine is divided into two stages: the source node migrates memory data to the shared memory resource pool, and the destination node migrates data from the shared memory resource pool to itself. Use the address information table to record the correspondence between the source memory address and the shared memory address to ensure that the virtual machine's business can continue during the migration process.

Benefits of technology

It realizes that there is no need to interrupt services during the virtual machine migration process, reduces the impact on the operation of virtual machine services, and reduces the use of network resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806731A_ABST
    Figure CN119806731A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of cloud computing, and discloses a virtual machine migration method and system, computer equipment and a storage medium, and the method comprises the steps that a source node receives a migration instruction of a target virtual machine, and obtains an address information table of the target virtual machine; acquiring a shared memory address according to the source memory address in the address information table; updating an address information table according to the source memory address and the shared memory address, and migrating memory data of the target virtual machine to a shared memory resource pool from the target virtual machine; acquiring register data of the target virtual machine; sending the updated address information table and the register data of the target virtual machine to the destination node; and stopping running the target virtual machine. The destination node migrates memory data of the target virtual machine from the shared memory resource pool to the destination node according to the shared memory address; and running the target virtual machine according to the register data of the target virtual machine and the memory data of the target virtual machine. In the process of migrating the virtual machine, the service of the virtual machine does not need to be interrupted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cloud computing, and in particular to a virtual machine migration method, system, computer equipment and storage medium. Background Art

[0002] In the field of cloud computing, the application of virtual machines reduces the demand for physical servers. During the operation of a virtual machine, when the source node where the virtual machine is located is undergoing operation and maintenance, the virtual machine needs to be migrated to another destination node.

[0003] During the online migration of a virtual machine, the source node generally transmits memory data to the destination node through the network. During the network transmission process, the virtual machine will still perform business processing, resulting in changes in memory data, that is, the data that has been transmitted to the destination node becomes dirty data (old data). Therefore, the source node needs to retransmit the changed data in the memory to the destination node. When the amount of memory data that has not been transmitted by the virtual machine is less than or equal to the preset data amount, the source node will stop the operation of the virtual machine and transmit the memory data that has not been transmitted to the destination node. After receiving the memory data that has not been transmitted, the destination node starts the operation of the virtual machine, and the migration of the virtual machine is completed.

[0004] In the related art, the business of the virtual machine needs to be interrupted during the migration of the virtual machine, which affects the business operation of the virtual machine. Summary of the invention

[0005] In view of this, the present invention provides a virtual machine migration method, system, computer device, storage medium and program product to solve the problem of needing to interrupt the virtual machine's services during the virtual machine migration process.

[0006] In a first aspect, the present invention provides a virtual machine migration method, the method is applied to a virtual machine migration system, the virtual machine migration system includes a shared memory resource pool, a source node and a destination node, the method includes:

[0007] When the source node receives a migration instruction for the target virtual machine, the address information table corresponding to the target virtual machine is obtained, wherein the address information table includes at least one source memory address; according to each of the source memory addresses, a shared memory address corresponding to each of the source memory addresses is obtained; according to each of the source memory addresses and the shared memory address corresponding to each of the source memory addresses, the address information table is updated, and the memory data of the target virtual machine is migrated from the source node to the shared memory resource pool; the register data of the target virtual machine is obtained; the updated address information table and the register data of the target virtual machine are sent to the destination node; and the target virtual machine is stopped;

[0008] The destination node migrates the memory data of the target virtual machine from the shared memory resource pool to the destination node according to each shared memory address in the updated address information table; and runs the target virtual machine according to the register data of the target virtual machine and the memory data of the target virtual machine migrated to the destination node.

[0009] The virtual machine migration method provided by the present invention has the following advantages:

[0010] This solution divides the migration process of the target virtual machine into two stages by creating a shared memory resource pool between the source node and the destination node. One is that the source node migrates the memory data of the target virtual machine from itself to the shared memory resource pool, and the other is that the destination node migrates the memory data of the target virtual machine from the shared memory resource pool to itself. During the migration process of the target virtual machine, the storage location of the memory data of the target virtual machine changes. Therefore, the address information table is used to record the corresponding relationship between the source memory address and the shared memory address. In this way, during this migration process, the source node can still perform business operations on the target virtual machine through the address information table, the unfinished migration data in its own memory or the completed migration data in the shared memory resource pool. When the destination node receives the updated address information table and the register data of the target virtual machine, it can start to migrate the memory data of the target virtual machine in the shared memory resource pool to its own memory. During this migration process, the destination node can still perform business operations on the target virtual machine through the address information table, the completed migration data in its own memory or the unfinished migration data in the shared memory resource pool. During the entire migration process, the target virtual machine does not need to suspend business, which can reduce the impact on the business operation of the target virtual machine during the virtual machine migration process. In addition, this solution does not occupy network resources and can reduce the impact on other services during online migration of virtual machines.

[0011] In an optional implementation, updating the address information table according to each of the source memory addresses and the shared memory address corresponding to each of the source memory addresses, and migrating the memory data of the target virtual machine from the source node to the shared memory resource pool, includes:

[0012] Filling a first shared memory address into a shared memory address field corresponding to a first source memory address in the address information table, wherein the first source memory address is any one of at least one of the source memory addresses, and the first shared memory address is a shared memory address corresponding to the first source memory address;

[0013] Migrate memory data in a storage location corresponding to the first source memory address to a storage location corresponding to the first shared memory address.

[0014] Specifically, by updating the address information table, it can be known that the data of each source memory address in the source node is migrated to a specific location in the shared memory resource, which facilitates the subsequent destination node to execute the migration process and ensures that the business can continue during the entire migration process of the target virtual machine.

[0015] In an optional implementation, migrating the memory data of the target virtual machine from the shared memory resource pool to the destination node according to each of the shared memory addresses in the updated address information table includes:

[0016] Traversing each of the shared memory addresses in the updated address information table, and each time a shared memory address is traversed, assigning a destination memory address to the traversed shared memory address according to a preset storage space size;

[0017] Migrate memory data in a storage location corresponding to a first shared memory address to a storage location corresponding to a first destination memory address, wherein the first destination memory address is a destination memory address assigned to the first shared memory address.

[0018] Specifically, this solution can completely migrate the memory data of the target virtual machine from the shared memory resource pool to the destination node.

[0019] In an optional implementation, in the process of migrating the memory data of the target virtual machine from the source node to the shared memory resource pool, the method further includes:

[0020] When the source node receives a first service execution instruction for the target virtual machine, determining, according to the first service execution instruction, a first logical address of the memory data operated by the first service execution instruction;

[0021] Acquire first migration progress information, wherein the first migration progress information includes at least one logical address and a migration status corresponding to each of the logical addresses, wherein the migration status is migrated or not migrated;

[0022] According to the first logical address, acquiring a migration status corresponding to the first logical address in the first migration progress information;

[0023] When it is determined that the migration state corresponding to the first logical address is the migrated state, determining, according to the first logical address, a second shared memory address corresponding to the first logical address;

[0024] According to the first service execution instruction, memory data in a storage location corresponding to the second shared memory address is modified.

[0025] Specifically, during the data migration process, this solution can still determine the location of the memory data to be operated according to the first business execution instruction and the first migration progress information, and perform corresponding operations.

[0026] In an optional implementation, when it is determined that the migration state corresponding to the first logical address is not migrated, the method further includes:

[0027] Determine, according to the first logical address, a second source memory address corresponding to the first logical address;

[0028] According to the first service execution instruction, memory data in a storage location corresponding to the second source memory address is modified.

[0029] Specifically, during the data migration process, this solution can still determine the location of the memory data to be operated according to the first business execution instruction and the first migration progress information, and perform corresponding operations.

[0030] In an optional implementation, in the process of migrating the memory data of the target virtual machine from the shared memory resource pool to the destination node, the method further includes:

[0031] When the destination node receives the second service execution instruction for the target virtual machine, determining, according to the second service execution instruction, a second logical address of the memory data operated by the second service execution instruction;

[0032] Acquire second migration progress information, wherein the second migration progress information includes at least one logical address and a migration status corresponding to each of the logical addresses, and the migration status is migrated or not migrated;

[0033] According to the second logical address, acquiring a migration status corresponding to the second logical address in the second migration progress information;

[0034] When it is determined that the migration state corresponding to the second logical address is the not-migrated state, determining, according to the second logical address, a second shared memory address corresponding to the second logical address;

[0035] According to the second service execution instruction, memory data in a storage location corresponding to the second shared memory address is modified.

[0036] Specifically, during the data migration process, this solution can still determine the location of the memory data to be operated according to the second business execution instruction and the second migration progress information, and perform corresponding operations.

[0037] In an optional implementation, when it is determined that the migration state of the second logical address is migrated, the method further includes:

[0038] Determine, according to the second logical address, a second destination memory address corresponding to the second logical address;

[0039] According to the second service execution instruction, memory data in a storage location corresponding to the second destination memory address is modified.

[0040] Specifically, during the data migration process, this solution can still determine the location of the memory data to be operated according to the second business execution instruction and the second migration progress information, and perform corresponding operations.

[0041] In a second aspect, the present invention provides a virtual machine migration system, the virtual machine migration system comprising a shared memory resource pool, a source node and a destination node;

[0042] The source node is used to, when receiving a migration instruction for a target virtual machine, obtain an address information table corresponding to the target virtual machine, wherein the address information table includes at least one source memory address; according to each of the source memory addresses, obtain a shared memory address corresponding to each of the source memory addresses; according to each of the source memory addresses and the shared memory address corresponding to each of the source memory addresses, update the address information table, and migrate the memory data of the target virtual machine from the source node to the shared memory resource pool; obtain the register data of the target virtual machine; send the updated address information table and the register data of the target virtual machine to the destination node; and stop running the target virtual machine;

[0043] The destination node is used to migrate the memory data of the target virtual machine from the shared memory resource pool to the destination node according to each shared memory address in the updated address information table; and run the target virtual machine according to the register data of the target virtual machine and the memory data of the target virtual machine migrated to the destination node.

[0044] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the virtual machine migration method performed by the above-mentioned destination node or source node in the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0045] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the virtual machine migration method of the first aspect or any corresponding embodiment thereof.

[0046] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the virtual machine migration method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1 is a schematic diagram of the architecture of a virtual machine migration system according to an embodiment of the present invention;

[0049] Figure 2 is a flow chart of a virtual machine migration method according to an embodiment of the present invention;

[0050] Figure 3 is a schematic diagram of the flow of memory data of a virtual machine according to an embodiment of the present invention;

[0051] Figure 4 is a flow chart of a method for executing a virtual machine service according to an embodiment of the present invention;

[0052] Figure 5 is a flow chart of another method for executing a virtual machine service according to an embodiment of the present invention;

[0053] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0055] The present invention provides a virtual machine migration system, which may include a shared memory resource pool, a source node and a destination node, and may also include a shared memory management device. The shared memory resource pool may be a storage server composed of multiple memory bars. The shared memory management device may include a first port, a second port and a third port. The shared memory management device may be connected to the source node through the first port, connected to the destination node through the second port, and connected to the shared memory resource pool through the third port.

[0056] The source node and the destination node may be business servers for deploying virtual machines (VMs). In addition, software for performing virtual machine migration may be installed on both the source node and the destination node, including two modules: a memory management engine and a virtualization infrastructure. That is, each node software layer may include multiple deployed virtual machines, a memory management engine, and a virtualization infrastructure. The virtual machine infrastructure may be a management component for simulating, creating, and migrating virtual machines. The memory management engine may be specifically divided into two submodules: a memory management engine and a memory tiering engine. The memory management engine is mainly used to connect the memory of the shared memory resource pool to the node where it is located, and to uniformly manage the local memory of the node where it is located and the memory of the shared memory resource pool. The memory tiering engine may provide two main functions including Swap Out and Swap In. Among them, Swap Out is used to migrate data at a specified memory address in the local memory of the source node to the memory of the shared memory resource pool, and Swap In is used to migrate data at a specified memory address in the memory of the shared memory resource pool to the local memory of the destination node. After accessing the shared resource memory pool, the memory management engine can scan the shared resource memory pool and register the memory of the shared resource memory pool for use in subsequent migration of the virtual machine.

[0057] In some optional embodiments, such as Figure 1As shown, the shared memory resource pool can be a Compute Express Link (CXL) memory resource pool, and the shared memory management device can be a CXL switch. The first port and the second port of the CXL switch can be UpStream, and the third port can be DownStream. The CXL memory resource pool can support global memory mode and local memory mode. When executing the virtual machine migration method, the CXL memory resource pool can be set to global memory mode so that multiple hosts (i.e., the source node and destination node mentioned above) can use the CXL shared memory resource pool at the same time, that is, each node can use its own local memory and the CXL memory provided by the CXL shared memory resource pool. The CXL switch can be connected to the source node and the destination node through a Common Display Form Factor Project (CDFP) bus. For example, Figure 1 The virtual machine in the dashed box may be a target virtual machine, that is, a virtual machine that needs to complete online migration.

[0058] The embodiment of the present invention provides a virtual machine migration method, which can avoid interrupting the service of the virtual machine during the migration process by accessing a shared memory resource pool between a source node and a destination node.

[0059] According to an embodiment of the present invention, an embodiment of a virtual machine migration method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0060] In this embodiment, a virtual machine migration method is provided, which can be applied to the above-mentioned virtual machine migration system, and the migration of the virtual machine is completed through interaction between various devices in the virtual machine migration system.

[0061] Figure 2 is a flow chart of a virtual machine migration method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0062] Step S201: When the source node receives a migration instruction for a target virtual machine, the source node obtains an address information table corresponding to the target virtual machine.

[0063] The data structure of the address information table may include a local memory address field and a shared memory address field, or the data structure of the address information table may include a source memory address field, a shared memory address field, and a destination memory address field. Alternatively, under the premise of any of the aforementioned data structures, a length field may also be included to indicate the size of the memory space occupied by the virtual machine. For example, the data structure of the address information table may be as shown in Table 1.

[0064] Table 1

[0065] Fields meaning LocalAddress Local memory address Size length CXL Address Shared memory address

[0066] Specifically, when the source node starts a virtual machine, memory space can be allocated from the local memory to the virtual machine, and at least one allocated source memory address can be recorded in the address information table. When the source node needs maintenance, the technician can perform the corresponding virtual machine migration operation in the terminal, and the terminal can generate a migration instruction based on the technician's operation and send it to the source node. When the virtualization infrastructure in the source node receives the migration instruction for the target virtual machine, a SwapOut instruction can be sent to the memory management engine in the source node. After receiving the Swap Out instruction, the memory management engine in the source node can select the address information table corresponding to the target virtual machine from the address information tables corresponding to the multiple deployed virtual machines according to the identification information of the target virtual machine carried in the Swap Out instruction.

[0067] In some optional implementations, when the source node receives a migration instruction for the target virtual machine, it can first obtain the historical operation data of the target virtual machine (including the number of received business execution instructions corresponding to multiple time periods respectively), select at least one candidate time period from multiple time periods according to a preset number threshold, and determine whether the target time period to which the current time point belongs is any time period in at least one candidate time period. If yes, a time period closest to the current time can be selected from the multiple time periods except all the candidate time periods to perform the migration operation of the target virtual machine. If not, it can be executed directly. In this way, the problem of resource shortage caused by the migration of the target virtual machine during business peak hours can be avoided.

[0068] Step S202: The source node obtains a shared memory address corresponding to each source memory address according to each source memory address.

[0069] Specifically, the memory management engine in the source node can traverse the address information table corresponding to the acquired target virtual machine, and each time a source memory address is traversed, a shared memory address is applied from the managed shared memory resource pool according to the preset storage space size. After traversing all source memory addresses in the address information table, the shared memory address corresponding to each source memory address can be obtained.

[0070] Step S203: the source node updates the address information table according to each source memory address and the shared memory address corresponding to each source memory address, and migrates the memory data of the target virtual machine from the source node to the shared memory resource pool.

[0071] Specifically, during the traversal process, the memory management engine in the source node can also fill the traversed first shared memory address into the shared memory address field corresponding to the first source memory address in the address information table. In this way, after the shared memory address of each source memory address is filled into the corresponding shared memory address field, an updated address information table can be obtained. Among them, the first source memory address is any one of the at least one source memory address, and the first shared memory address is the shared memory address corresponding to the first source memory address. After completing the traversal process, the memory management engine of the source node can send the updated address information table to the virtualization infrastructure in the source node. In addition, the memory management engine in the source node can migrate (replace, cut) the memory data in the storage location corresponding to the first source memory address to the storage location corresponding to the first shared memory address. In this way, after the memory data in the storage location corresponding to each source memory address is migrated to the storage location corresponding to the corresponding shared memory address in the shared memory resource pool, the operation of migrating the memory data of the target virtual machine from the source node to the shared memory resource pool is completed.

[0072] Step S204: the source node obtains register data of the target virtual machine.

[0073] The register data of the target virtual machine is the result of the operation performed by the processor of the target virtual machine.

[0074] Step S205: the source node sends the updated address information table and the register data of the target virtual machine to the destination node.

[0075] Specifically, after receiving the updated address information table, the virtualization infrastructure of the source node can obtain the register data of the target virtual machine, and send the updated address information table and the register data of the target virtual machine to the virtualization infrastructure in the destination node. After receiving the updated address information table and the register data of the target virtual machine, the virtualization infrastructure of the destination node can send a response instruction to the virtualization infrastructure of the source node to inform the source node that the data reception is completed.

[0076] Step S206: the source node stops running the target virtual machine.

[0077] Specifically, after receiving the response instruction, the source node may shut down the operation of the target virtual machine on it. Alternatively, the source node may directly shut down the operation of the target virtual machine on it after sending the updated address information table and the register data of the target virtual machine.

[0078] Step S207: the destination node migrates the memory data of the target virtual machine from the shared memory resource pool to the destination node according to each shared memory address in the updated address information table.

[0079] Specifically, after receiving the updated address information table and the register data of the target virtual machine, the virtualization infrastructure of the destination node can send the Swap In instruction and the updated address information table to the memory management engine of the destination node. The memory management engine of the destination node can traverse each shared memory address in the updated address information table, and each time a shared memory address is traversed, a destination memory address is allocated to the traversed shared memory address according to a preset storage space size. In this way, the memory management engine of the destination node can migrate the memory data in the storage location corresponding to the first shared memory address to the storage location corresponding to the first destination memory address. Among them, the first destination memory address is the destination memory address allocated to the first shared memory address.

[0080] In some optional implementations, during the traversal process of step S207, the memory management engine of the destination node may update the address information table again, specifically:

[0081] When the data structure in the address information table includes a local memory address field and a shared memory address field, the memory management engine of the destination node can also overwrite the first source memory address corresponding to the first shared memory address in the address information table with the first destination memory address, that is, modify the local memory address field corresponding to the first shared memory address to the first destination memory address. In this way, the corresponding local memory address field can be overwritten for each shared memory address to obtain an updated address information table.

[0082] Alternatively, when the data structure in the address information table includes a source memory address field, a shared memory address field, and a destination memory address field, the memory management engine of the destination node may also fill the destination memory address field corresponding to the first shared memory address in the address information table with the first destination memory address. In this way, the corresponding destination memory address field may be overwritten for each shared memory address to obtain an updated address information table.

[0083] In this way, when the destination node needs to be maintained later, the updated address information table can be directly used to migrate the target virtual machine.

[0084] Step S208: The destination node runs the target virtual machine according to the register data of the target virtual machine and the memory data of the target virtual machine migrated to the destination node.

[0085] Specifically, after the migration operation of the target virtual machine is completed, the virtualization infrastructure in the destination node can start the operation of the target virtual machine thereon.

[0086] like Figure 3 As shown in the figure, the data flow process of the target virtual machine during the entire migration process of the target virtual machine is given, that is, non-memory data (register data and address information table) flows from the source node to the destination node through the network, and memory data flows from the local memory of the source node to the shared memory resource pool (CXL memory), and then flows to the local memory of the destination node.

[0087] The virtual machine migration method provided in this embodiment divides the migration process of the target virtual machine into two stages by creating a shared memory resource pool between the source node and the destination node. One is that the source node migrates the memory data of the target virtual machine from itself to the shared memory resource pool, and the other is that the destination node migrates the memory data of the target virtual machine from the shared memory resource pool to itself. During the migration process of the target virtual machine, the memory data storage location of the target virtual machine changes. Therefore, the address information table is used to record the corresponding relationship between the source memory address and the shared memory address. In this way, during this migration process, the source node can still perform business operations on the target virtual machine through the address information table, the data that has not been migrated in its own memory or the data that has been migrated in the shared memory resource pool. When the destination node receives the updated address information table and the register data of the target virtual machine, it can start to migrate the memory data of the target virtual machine in the shared memory resource pool to its own memory. During this migration process, the destination node can still perform business operations on the target virtual machine through the address information table, the data that has been migrated in its own memory or the data that has not been migrated in the shared memory resource pool. During the entire migration process, there is no need for the target virtual machine to suspend business, which can reduce the impact on the business operation of the target virtual machine during the virtual machine migration process. In addition, this solution does not occupy network resources and can reduce the impact on other services during online migration of virtual machines.

[0088] In the process of migrating the memory data of the target virtual machine from the source node to the shared memory resource pool, the target virtual machine still needs to execute the corresponding service. Therefore, in this embodiment, a method for executing the virtual machine service is provided, which can be executed by the above-mentioned source node. Figure 4 As shown, the process includes the following steps:

[0089] Step S401: When a source node receives a first service execution instruction for a target virtual machine, the source node determines, according to the first service execution instruction, a first logical address of memory data operated by the first service execution instruction.

[0090] Specifically, when the source node migrates the memory data of the target virtual machine from itself to the shared memory resource pool, it may receive a service execution instruction for the target virtual machine. At this time, the virtualization infrastructure of the source node can parse the first service execution instruction to obtain the first logical address and operation information of the memory data that the first service execution instruction needs to operate.

[0091] Step S402: Obtain first migration progress information.

[0092] The first migration progress information includes at least one logical address and a migration status corresponding to each logical address, where the migration status is migrated or not migrated.

[0093] Step S403: According to the first logical address, obtain a migration status corresponding to the first logical address in the first migration progress information.

[0094] Specifically, each time the memory management engine of the source node completes a migration operation of a source memory address, it can determine the logical address corresponding to the source memory address according to the first correspondence table between the source memory address and the logical address, and mark it as having been migrated. In this way, each logical address in the first correspondence table and its marked state constitute the first migration progress information. When the virtualization infrastructure of the source node receives the service execution instruction, it can first obtain the first migration progress information of the target virtual machine, and determine the migration state corresponding to the first logical address in the first migration progress information to determine whether the data to be operated is in the source node or the shared memory resource pool.

[0095] Step S404: when it is determined that the migration status corresponding to the first logical address is migrated, a second shared memory address corresponding to the first logical address is determined according to the first logical address.

[0096] Specifically, when the virtualization infrastructure of the source node determines that the migration state corresponding to the first logical address is migrated, it means that the data operated by the first service execution instruction is in the shared memory resource pool. At this time, according to the first logical address, the second source memory address corresponding to the first logical address can be determined in the first correspondence table, and then according to the second source memory address, the corresponding second shared memory address can be determined in the updated address information table.

[0097] Step S405: modify the memory data in the storage location corresponding to the second shared memory address according to the first service execution instruction.

[0098] Specifically, the virtualization infrastructure of the source node may modify the memory data in the second shared memory address according to the operation information in the first service execution instruction.

[0099] Step S406: When it is determined that the migration state corresponding to the first logical address is not migrated, a second source memory address corresponding to the first logical address is determined according to the first logical address.

[0100] Specifically, when the virtualization infrastructure of the source node determines that the migration state corresponding to the first logical address is not migrated, it means that the data operated by the first service execution instruction is in the shared memory resource pool. At this time, according to the first logical address, the second source memory address corresponding to the first logical address can be determined in the first correspondence table.

[0101] Step S407: modify the memory data in the storage location corresponding to the second source memory address according to the first service execution instruction.

[0102] Specifically, the virtualization infrastructure of the source node may modify the memory data in the second source memory address according to the operation information in the first service execution instruction.

[0103] The method for executing virtual machine services provided in this embodiment can, during the online migration of the virtual machine, when a service execution instruction related to the target virtual machine is received, make corresponding modifications based on the actual physical location of the data operated by the service execution instruction, thereby realizing service execution related to the target virtual machine.

[0104] In the process of migrating the memory data of the target virtual machine from the shared memory resource pool to the destination node, the target virtual machine still needs to execute the corresponding service. Therefore, a method for executing virtual machine services is provided in this embodiment, which can be executed by the above-mentioned destination node. Figure 5 As shown, the process includes the following steps:

[0105] Step S501: When a destination node receives a second service execution instruction for a target virtual machine, the destination node determines, according to the second service execution instruction, a second logical address of memory data operated by the second service execution instruction.

[0106] Specifically, when the destination node migrates the memory data of the target virtual machine from the shared memory resource pool to itself, it may receive a service execution instruction for the target virtual machine. At this time, the virtualization infrastructure of the destination node can parse the second service execution instruction to obtain the second logical address and operation information of the memory data that the second service execution instruction needs to operate.

[0107] Step S502: Obtain second migration progress information.

[0108] The second migration progress information includes at least one logical address and a migration status corresponding to each logical address, and the migration status is migrated or not migrated.

[0109] Step S503: According to the second logical address, obtain the migration status corresponding to the second logical address in the second migration progress information.

[0110] Specifically, each time the memory management engine of the destination node completes a migration operation of a shared memory address, it can determine the destination memory address corresponding to the shared memory address according to the address information table updated again in step S207, and can determine the logical address corresponding to the destination memory address according to the second correspondence table between the destination memory address and the logical address, and mark it as having been migrated. In this way, each logical address in the second correspondence table and its marked state constitute the second migration progress information. When the virtualization infrastructure of the destination node receives the service execution instruction, it can first obtain the second migration progress information of the target virtual machine, and determine the migration state corresponding to the second logical address in the second migration progress information to determine whether the data to be operated is in the destination node or the shared memory resource pool.

[0111] Step S504: when it is determined that the migration state corresponding to the second logical address is not migrated, a second shared memory address corresponding to the second logical address is determined according to the second logical address.

[0112] Specifically, when the virtualization infrastructure of the destination node determines that the migration state corresponding to the second logical address is not migrated, it means that the data operated by the second service execution instruction is still in the shared memory resource pool. At this time, according to the second logical address, the second destination memory address corresponding to the second logical address can be determined in the second correspondence table, and then according to the second destination memory address, the corresponding second shared memory address can be determined in the updated address information table.

[0113] Step S505: modify the memory data in the storage location corresponding to the second shared memory address according to the second service execution instruction.

[0114] Specifically, the virtualization infrastructure of the destination node may modify the memory data in the second shared memory address according to the operation information in the second service execution instruction.

[0115] Step S506: when it is determined that the migration status of the second logical address is migrated, determine a second destination memory address corresponding to the second logical address according to the second logical address.

[0116] Specifically, when the virtualization infrastructure of the destination node determines that the migration state corresponding to the second logical address is migrated, it means that the data operated by the second service execution instruction is in the destination node. At this time, the second destination memory address corresponding to the second logical address can be determined in the second correspondence table according to the second logical address.

[0117] Step S507: modify the memory data in the storage location corresponding to the second destination memory address according to the second service execution instruction.

[0118] Specifically, the virtualization infrastructure of the destination node may modify the memory data in the second destination memory address according to the operation information in the second service execution instruction.

[0119] The method for executing virtual machine services provided in this embodiment can, during the online migration of the virtual machine, when a service execution instruction related to the target virtual machine is received, make corresponding modifications based on the actual physical location of the data operated by the service execution instruction, thereby realizing service execution related to the target virtual machine.

[0120] An embodiment of the present invention further provides a computer device, which may be the above-mentioned destination node or source node.

[0121] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.

[0122] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware integrated circuit. The hardware integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.

[0123] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0124] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0125] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0126] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0127] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0128] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0129] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A virtual machine migration method, characterized in that: The method is applied to a virtual machine migration system, the virtual machine migration system includes a shared memory resource pool, a source node and a destination node, and the method includes: When the source node receives a migration instruction for the target virtual machine, the address information table corresponding to the target virtual machine is obtained, wherein the address information table includes at least one source memory address; according to each of the source memory addresses, a shared memory address corresponding to each of the source memory addresses is obtained; according to each of the source memory addresses and the shared memory address corresponding to each of the source memory addresses, the address information table is updated, and the memory data of the target virtual machine is migrated from the source node to the shared memory resource pool; the register data of the target virtual machine is obtained; the updated address information table and the register data of the target virtual machine are sent to the destination node; and the target virtual machine is stopped; The destination node migrates the memory data of the target virtual machine from the shared memory resource pool to the destination node according to each shared memory address in the updated address information table; and runs the target virtual machine according to the register data of the target virtual machine and the memory data of the target virtual machine migrated to the destination node.

2. The method according to claim 1, characterized in that The updating of the address information table according to each of the source memory addresses and the shared memory address corresponding to each of the source memory addresses, and migrating the memory data of the target virtual machine from the source node to the shared memory resource pool, includes: Filling a first shared memory address into a shared memory address field corresponding to a first source memory address in the address information table, wherein the first source memory address is any one of at least one of the source memory addresses, and the first shared memory address is a shared memory address corresponding to the first source memory address; Migrate memory data in a storage location corresponding to the first source memory address to a storage location corresponding to the first shared memory address.

3. The method according to claim 1, characterized in that The step of migrating the memory data of the target virtual machine from the shared memory resource pool to the destination node according to each of the shared memory addresses in the updated address information table includes: Traversing each of the shared memory addresses in the updated address information table, and each time a shared memory address is traversed, assigning a destination memory address to the traversed shared memory address according to a preset storage space size; Migrate memory data in a storage location corresponding to a first shared memory address to a storage location corresponding to a first destination memory address, wherein the first destination memory address is a destination memory address assigned to the first shared memory address.

4. The method according to claim 1 or 2, characterized in that: In the process of migrating the memory data of the target virtual machine from the source node to the shared memory resource pool, the method further includes: When the source node receives a first service execution instruction for the target virtual machine, determining, according to the first service execution instruction, a first logical address of the memory data operated by the first service execution instruction; Acquire first migration progress information, wherein the first migration progress information includes at least one logical address and a migration status corresponding to each of the logical addresses, wherein the migration status is migrated or not migrated; According to the first logical address, acquiring a migration status corresponding to the first logical address in the first migration progress information; When it is determined that the migration state corresponding to the first logical address is the migrated state, determining, according to the first logical address, a second shared memory address corresponding to the first logical address; According to the first service execution instruction, memory data in a storage location corresponding to the second shared memory address is modified.

5. The method according to claim 4, characterized in that When it is determined that the migration state corresponding to the first logical address is not migrated, the method further includes: Determine, according to the first logical address, a second source memory address corresponding to the first logical address; According to the first service execution instruction, memory data in a storage location corresponding to the second source memory address is modified.

6. The method according to claim 1 or 3, characterized in that: In the process of migrating the memory data of the target virtual machine from the shared memory resource pool to the destination node, the method further includes: When the destination node receives the second service execution instruction for the target virtual machine, determining, according to the second service execution instruction, a second logical address of the memory data operated by the second service execution instruction; Acquire second migration progress information, wherein the second migration progress information includes at least one logical address and a migration status corresponding to each of the logical addresses, and the migration status is migrated or not migrated; According to the second logical address, acquiring a migration status corresponding to the second logical address in the second migration progress information; When it is determined that the migration state corresponding to the second logical address is the not-migrated state, determining, according to the second logical address, a second shared memory address corresponding to the second logical address; According to the second service execution instruction, memory data in a storage location corresponding to the second shared memory address is modified.

7. The method according to claim 6, characterized in that When it is determined that the migration state of the second logical address is migrated, the method further includes: Determine, according to the second logical address, a second destination memory address corresponding to the second logical address; According to the second service execution instruction, memory data in a storage location corresponding to the second destination memory address is modified.

8. A virtual machine migration system, characterized in that: The virtual machine migration system includes a shared memory resource pool, a source node and a destination node; The source node is used to, when receiving a migration instruction for a target virtual machine, obtain an address information table corresponding to the target virtual machine, wherein the address information table includes at least one source memory address; according to each of the source memory addresses, obtain a shared memory address corresponding to each of the source memory addresses; according to each of the source memory addresses and the shared memory address corresponding to each of the source memory addresses, update the address information table, and migrate the memory data of the target virtual machine from the source node to the shared memory resource pool; obtain the register data of the target virtual machine; send the updated address information table and the register data of the target virtual machine to the destination node; and stop running the target virtual machine; The destination node is used to migrate the memory data of the target virtual machine from the shared memory resource pool to the destination node according to each shared memory address in the updated address information table; and run the target virtual machine according to the register data of the target virtual machine and the memory data of the target virtual machine migrated to the destination node.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes any one of the virtual machine migration methods executed by the source node or any one of the virtual machine migration methods executed by the destination node in claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the virtual machine migration method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Page table updating method and device and related equipment

    CN113342711A

  • Virtual machine thermal migration control method and device, storage medium and electronic equipment

    CN114995959A

  • Method and device for hot upgrade of virtual machine

    CN117270929A

  • Virtual machine migration method and device, computer equipment and storage medium

    CN118227259A

  • Virtual machine migration managing method, computer using the method, virtualizer using the method and computer system using the method

    US20110131576A1

Cited By

  • Virtual machine data migration method and device, storage medium and electronic equipment

    CN120803617A

  • Method and device for migrating virtual machine data, storage medium and electronic device

    CN120803617B