Data pre-migration method and device of virtual machine, storage medium and electronic equipment

Through the virtual machine data pre-migration method, the virtual machine data is split and pre-migrated, which solves the problem of long-term hot migration of virtual machines, and achieves a faster and more flexible migration process.

CN119668769APending Publication Date: 2025-03-21BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311220649.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-20
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

In the prior art, the virtual machine hot migration process takes a long time and cannot be configured upgraded or modified during the migration process.

Method used

Through the data pre-migration method, the data of the target virtual machine is first split into virtual machine data located in the shared storage and target data located in the local disk, first migrate the target data to the local disk of the destination node, and then migrate the virtual machine data to the shared storage of the destination node.

Benefits of technology

The data volume and migration time of virtual machines are reduced, the migration speed is improved, and configuration upgrades or modifications are realized during the hot migration process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668769A_ABST
    Figure CN119668769A_ABST
Patent Text Reader

Abstract

The invention relates to a data pre-migration method and device of a virtual machine, a storage medium and electronic equipment. The method comprises the following steps: determining a target virtual machine to execute a live migration operation; determining target data located in a local disk of the current node and virtual machine data located in a shared storage in the data of the target virtual machine; migrating the target data to a local disk of a destination node of the target virtual machine; and under the condition that the target data is successfully migrated, migrating the virtual machine data of the target virtual machine to the shared storage of the destination node. The technical problem of long time consumption of live migration of the virtual machine is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of virtual machine hot migration, and in particular to a virtual machine data pre-migration method, device, storage medium and electronic device. Background Art

[0002] In the prior art, during the hot migration of a virtual machine, although the user can use the functions of the virtual machine normally, if the user wants to perform configuration upgrades, configuration modifications, etc. on the virtual machine, it cannot be performed due to the hot migration of the virtual machine.

[0003] Therefore, a method needs to be proposed to reduce the duration of virtual machine hot migration. Summary of the invention

[0004] The present application provides a method, device, storage medium and electronic device for pre-migration of data of a virtual machine, so as to solve the technical problem that hot migration of a virtual machine takes a long time.

[0005] In a first aspect, the present application provides a method for pre-migration of data of a virtual machine, comprising: determining a target virtual machine on which a hot migration operation is to be performed; determining, among the data of the above-mentioned target virtual machine, target data located on a local disk of a current node and virtual machine data located in a shared storage; migrating the above-mentioned target data to a local disk of a destination node of the above-mentioned target virtual machine; and in the event that the migration of the above-mentioned target data is successful, migrating the virtual machine data of the above-mentioned target virtual machine to the shared storage of the above-mentioned destination node.

[0006] In the second aspect, the present application provides a data pre-migration device for a virtual machine, comprising: a first determination module, used to determine a target virtual machine on which a hot migration operation is to be performed; a second determination module, used to determine, among the data of the above-mentioned target virtual machine, target data located on the local disk of the current node and virtual machine data located in shared storage; a first migration module, used to migrate the above-mentioned target data to the local disk of the destination node of the above-mentioned target virtual machine; and a second migration module, used to migrate the virtual machine data of the above-mentioned target virtual machine to the shared storage of the above-mentioned destination node if the migration of the above-mentioned target data is successful.

[0007] As an optional example, the second determination module includes: a first determination unit, used to determine the storage path of the data of the target virtual machine; traversing the storage path starting from the first string of the storage path; if the target string is not traversed, determining that the data is the target data; if the target string is traversed, determining that the data is the virtual machine data, wherein the target string is the string under the path of the shared storage.

[0008] As an optional example, the first migration module includes: a migration unit, used to copy the target data to a cloud storage area that provides object storage services; move the target data in the cloud storage area to the local disk of the destination node; and when the target data is successfully moved to the local disk of the destination node, delete the target data in the local disk of the current node.

[0009] As an optional example, the above-mentioned migration unit includes: a first migration sub-unit, used to determine the network bandwidth occupancy value; when the average value of the above-mentioned network bandwidth occupancy value within a predetermined time period is less than a preset threshold, the above-mentioned target data is copied to the above-mentioned cloud storage area or the above-mentioned target data is moved from the above-mentioned cloud storage area to the local disk of the above-mentioned destination node.

[0010] As an optional example, the first migration sub-unit is also used to: determine the network bandwidth occupancy value once every predetermined time period; start copying or moving the target data when the average value of multiple consecutive network bandwidth occupancy values ​​is less than the preset threshold; in the process of copying or moving the target data, if the network bandwidth occupancy value is greater than or equal to the preset threshold, suspend copying or moving the target data until the network bandwidth occupancy value is less than the preset threshold.

[0011] As an optional example, the above-mentioned migration unit includes: a second migration sub-unit, used to divide a time period into multiple sub-periods; determine the network bandwidth occupancy value within each of the above-mentioned sub-periods; according to the size of the network bandwidth occupancy value within each sub-period, split the above-mentioned target data into multiple parts to obtain multiple sub-target data, wherein the number of the above-mentioned sub-target data is the same as the number of the above-mentioned sub-periods, and the size of the above-mentioned sub-target data is negatively correlated with the network bandwidth occupancy value within the above-mentioned sub-period; and transmit the corresponding above-mentioned sub-target data within each of the above-mentioned sub-periods.

[0012] As an optional example, the first determination module includes: a second determination unit, which is used to determine the virtual machine that occupies the most local resources in the current node as the target virtual machine when the local resource value of the current node is greater than a warning value.

[0013] In a third aspect, the present application provides an electronic device comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor is configured to implement any one of the above-mentioned data pre-migration methods for the virtual machine when executing the computer program.

[0014] In a fourth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the data pre-migration method for a virtual machine of any one of the above items of the present application.

[0015] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application can first split the data of the target virtual machine to be hot migrated into the virtual machine data located in the shared storage and the target data of the user in the local disk. The target data is first migrated to the local disk of the destination node, and when the migration of the target data is successful, the virtual machine data is migrated to the destination node, so that when the virtual machine is hot migrated, only the virtual machine data of the virtual machine needs to be migrated, which reduces the amount of data for hot migration of the virtual machine and improves the migration speed of hot migration of the virtual machine. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0018] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0019] Figure 1 A flowchart of a method for pre-migrating data of a virtual machine provided in an embodiment of the present application;

[0020] Figure 2 A flowchart of another method for pre-migrating data of a virtual machine provided in an embodiment of the present application;

[0021] Figure 3 A flowchart of another method for pre-migrating data of a virtual machine provided in an embodiment of the present application;

[0022] Figure 4 A data migration flow chart of a data pre-migration method for a virtual machine provided in an embodiment of the present application;

[0023] Figure 5 A flowchart of another method for pre-migrating data of a virtual machine provided in an embodiment of the present application;

[0024] Figure 6 A schematic diagram of the structure of a data pre-migration device for a virtual machine provided in an embodiment of the present application;

[0025] Figure 7 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0027] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0028] In order to solve the technical problem that hot migration of virtual machines takes a long time in the prior art, the present application provides a data pre-migration method for a virtual machine, which can achieve the effect of reducing the migration time of hot migration.

[0029] Figure 1 A flowchart of a method for pre-migrating data of a virtual machine provided in an embodiment of the present application. Figure 1 As shown, the data pre-migration method of the virtual machine includes:

[0030] S102, determining a target virtual machine on which a hot migration operation is to be performed;

[0031] S104, determining, among the data of the target virtual machine, the target data located in the local disk of the current node and the virtual machine data located in the shared storage;

[0032] S106, migrating the target data to the local disk of the destination node of the target virtual machine;

[0033] S108, when the migration of the target data is successful, the virtual machine data of the target virtual machine is migrated to the shared storage of the destination node.

[0034] The above-mentioned virtual machine can be a virtual machine instance created for a user. The virtual machine data of the virtual machine instance is stored in shared storage. The virtual machine instance can be used by the user. The data generated during the user's use is user data, that is, the above-mentioned target data, which can be stored in the local disk of the current node where the virtual machine instance is located.

[0035] The above-mentioned target virtual machine may be a virtual machine to be hot migrated. The target virtual machine is to be migrated from the current node to the target node. The above-mentioned two parts of data of the target virtual machine, namely the target data and the virtual machine data, are first determined, and then the target data is migrated first. The target data is migrated to the local disk of the destination node. If the local disk of the destination node has insufficient storage space, the migration fails. If the local disk of the destination node has sufficient storage space and the target data is successfully written to the local disk of the destination node, the target data is successfully migrated.

[0036] After the target data is successfully migrated, the target virtual machine can be hot migrated. The virtual machine data of the target virtual machine is hot migrated to the shared storage of the destination node. Since the target data has been migrated to the destination node, the hot migration of the target virtual machine only needs to migrate the virtual machine data, which greatly reduces the amount of data for hot migration of the virtual machine.

[0037] When migrating target data, the path of the target data in the local disk of the current node and the path of the local disk of the destination node can be the same except for the prefix of the local disk. The path of the virtual machine data in the shared storage of the current node and the destination node can also be the same except for the prefix.

[0038] The method provided in the embodiment of the present application can first split the data of the target virtual machine to be hot migrated into the virtual machine data in the shared storage and the target data of the user in the local disk. The target data is first migrated to the local disk of the destination node, and when the migration of the target data is successful, the virtual machine data is migrated to the destination node, so that when the virtual machine is hot migrated, only the virtual machine data of the virtual machine needs to be migrated, which reduces the amount of data for hot migration of the virtual machine and improves the migration speed of hot migration of the virtual machine.

[0039] As an alternative example, Figure 2 As shown, in determining the data of the target virtual machine, the target data located in the local disk of the current node and the virtual machine data located in the shared storage include:

[0040] S202, determining a storage path for data of a target virtual machine;

[0041] S204, traversing the storage path starting from the first character string of the storage path;

[0042] S206, if the target character string is not traversed, determining that the data is the target data;

[0043] S208: When the target string is traversed, determine that the data is virtual machine data, wherein the target string is a string under a shared storage path.

[0044] In this embodiment, whether the data of the target virtual machine is target data or virtual machine data can be identified through the path of the virtual machine.

[0045] Get all the data of the target virtual machine. For each piece of data, identify the storage path of the data. The storage path is composed of a series of strings. The strings can be separated by specific symbols, such as the symbol "\". By identifying the string, check whether the string contains the target string. The target string is the string under the shared storage path. If the storage path of the data contains the shared string, it can be determined that the data is virtual machine data. Otherwise, the data is the target data.

[0046] By identifying the character string, the data of the virtual machine is divided into target data and virtual machine data.

[0047] As an alternative example, Figure 3 As shown, migrating the target data to the local disk of the destination node of the target virtual machine includes:

[0048] S302, copying the target data to a cloud storage area that provides object storage services;

[0049] S304, moving the target data in the cloud storage area to the local disk of the destination node;

[0050] S306: When the target data is successfully moved to the local disk of the destination node, the target data in the local disk of the current node is deleted.

[0051] In this embodiment, the object storage service of the cloud storage can be used as a transit station for the migration of the target data. First, the target data is copied to the cloud storage area, and then the target data can be downloaded, previewed online, etc. The online preview can be used to check whether there are any abnormalities in the target data uploaded to the cloud storage area. If there are no abnormalities, the target data can be downloaded or moved to the local disk of the destination node.

[0052] If the target data is successfully moved to the local disk of the destination node, you can delete the target data in the local disk of the current node and start the hot migration of the virtual machine immediately. If the target data is not successfully moved to the local disk of the destination node, you need to check the reason. If it is a network problem, monitor the network parameters and try again when the network status is good. If it is a local disk of the destination node, you need to replace the destination node or clear some data on the local disk of the destination node, and then migrate the target data.

[0053] As an optional example, copying the target data to a cloud storage area or moving the target data from the cloud storage area to a local disk of a destination node includes: determining a network bandwidth occupancy value; and copying the target data to the cloud storage area or moving the target data from the cloud storage area to a local disk of a destination node when an average value of the network bandwidth occupancy value within a predetermined time period is less than a preset threshold.

[0054] In this embodiment, in the process of copying or moving the target data to the cloud storage area or to the local disk of the destination node, the network bandwidth occupancy value can be determined. The network bandwidth occupancy value indicates the current network bandwidth occupancy. Since the migration of the target data requires a certain amount of network bandwidth, if the current network bandwidth value is large, it means that the network bandwidth occupancy is large, and the target data migration may fail. Therefore, the timing of migrating the target data should be determined based on the network bandwidth occupancy value. If the network bandwidth occupancy values ​​are low within the predetermined time period, or the average value is low, it means that the network bandwidth occupancy is small, and the migration of the target data can be started. If the network bandwidth occupancy value is large, you can wait for the migration opportunity.

[0055] As an optional example, when the average value of the network bandwidth occupancy value within a predetermined time period is less than a preset threshold, copying the target data to a cloud storage area or moving the target data from the cloud storage area to a local disk of a destination node includes: determining the network bandwidth occupancy value once every predetermined time period; starting to copy or move the target data when the average value of multiple consecutive network bandwidth occupancy values ​​is less than a preset threshold; during the process of copying or moving the target data, if the network bandwidth occupancy value is greater than or equal to the preset threshold, pausing the copying or moving of the target data until the network bandwidth occupancy value is less than the preset threshold.

[0056] In this embodiment, the migration of target data takes into account the influence of network bandwidth occupancy, and the migration timing of target data is determined by monitoring the network bandwidth occupancy value. For example, in this embodiment, the network bandwidth occupancy value is detected once every predetermined time period, and the network bandwidth occupancy of the current predetermined time period is checked by the average value of the network bandwidth occupancy value of this time and the previous times. If the above average value is less than the preset threshold, the migration of target data begins. If the network bandwidth occupancy value increases suddenly during the migration of target data, the migration of target data is suspended, and the migration of target data is continued after the network bandwidth occupancy value drops.

[0057] As an optional example, copying target data to a cloud storage area or moving target data from a cloud storage area to a local disk of a destination node includes: dividing a time period into multiple sub-periods; determining a network bandwidth occupancy value within each sub-period; according to the size of the network bandwidth occupancy value within each sub-period, splitting the target data into multiple parts to obtain multiple sub-target data, wherein the number of sub-target data is the same as the number of sub-periods, and the size of the sub-target data is negatively correlated with the network bandwidth occupancy value within the sub-period; and transmitting the corresponding sub-target data within each sub-period.

[0058] This embodiment provides another means of target data migration. The above-mentioned time period can be the migration period of the target data, which can be one day, one hour, 5 minutes, etc. The specific length of the time period is determined according to the actual situation. The time period is divided into multiple sub-periods. The network bandwidth occupancy value of each sub-period is estimated, and then, based on the estimated result, the target data is divided into multiple parts, and the size of each part is negatively correlated with the estimated network bandwidth occupancy value in the corresponding sub-period. That is to say, the larger the network bandwidth occupancy value, the smaller the sub-target data transmitted in the sub-period. For example, Figure 4 As shown. In sub-period 1 to sub-period 4, the network bandwidth occupancy values ​​are 10, 5, 10 and 20 respectively (the values ​​are for example only), and correspondingly, the size of the sub-target data is proportionally inversely correlated therewith, which are 20, 40, 20 and 10 respectively (the values ​​are for example only, and the inverse correlation may not be proportional). In addition, in the actual transmission process, since the predicted network bandwidth occupancy value may be inaccurate, therefore, in the process of transmitting the sub-target data, when the network bandwidth occupancy value is greater than the predicted value, less sub-target data may be transmitted and left to the next sub-period for transmission, or when the network bandwidth occupancy value is less than the predicted value, part or all of the sub-target data of the next sub-period may be transmitted in the sub-period.

[0059] As an optional example, determining the target virtual machine for performing the hot migration operation includes: when the local resource value of the current node is greater than the warning value, determining the virtual machine that occupies the most local resources in the current node as the target virtual machine.

[0060] In this embodiment, if the local resource value of a node's local resources is greater than the warning value, it means that the local resources of the node are insufficient. At this time, one or more virtual machines occupying more local resources in the node are used as target virtual machines and migrated to other nodes.

[0061] Figure 5 Schematic diagram of the system of this embodiment. Nova-api is the application programming interface (API) of nova, through which the nova component can receive and process external requests. Nova is a component of openstack. Openstack is an open source cloud computing management platform project. Nova-scheduler is the scheduler of nova, which can be used to schedule the migration request of the virtual machine and determine to which destination node the virtual machine is scheduled. The destination node is nova-compute, which is the node to which the target virtual machine is scheduled. The current node is the source node nova-compute, which is the node where the target virtual machine is currently located.

[0062] In this system process, first of all, for nova-api, the API parameters of nova-api are verified to verify the integrity of the parameters, and then the scheduling policy parameters are filled in according to the parameters to determine the scheduling policy. Then, a pre-migration record before_migration(start) is created to track and record the migration process. If a new derivative version flavor is specified in the scheduling policy parameters, the new and old flavors are recorded, which can be recorded through the extra of before_migration. By calling the rpc component of openstack, the pre-migration scheduling request is sent to the nova scheduler through the communication program rpc cast. Finally, the Hypertext Transfer Protocol (HTTP) status code is returned.

[0063] For the nova scheduler nova-scheduler, a message middleware notify message of type pre_migration.start is sent to indicate the preparation of the pre-migration process. A node is selected as the destination node according to the scheduling policy parameters, and an allocation is created on the node to temporarily occupy resources. The occupied resources are the resources required by the target virtual machine. Then, a preparation request for pre-migration from the current node to the destination node is initiated to the destination node.

[0064] For the destination node, send a notify message to indicate the end of the pre-migration process before_migration.prep.end, then determine the resources to be occupied by the target virtual machine based on the resource data in the allocation record, update the resource record compute_node.stats, and delete the allocation record. Next, change the status of the pre-migration before_migration to pre_migrating, and set the host_resource in the extra parameter to reserved to indicate that the resources have been pre-occupied. Then initiate a pre-migration request to the current node.

[0065] After receiving the request, the current node changes the status of the before_migration record to the migrating state, sends a notify message indicating the start of pre-migration before_migration.start, creates an incremental backup based on the existing backup chain for the example data disk (uploaded to the object storage service), and the backup mode is backup_before_migration_{{instance_uuid}}. The current node updates the status of before_migration to post-migration, and updates the backup-uuid field to the uuid of the data disk backup. Initiates the disk data recovery process to the destination node, and initiates the before_migration.end end message.

[0066] The destination node initiates the finish_before_migrate.start message, indicating that the pre-migration is finished, and creates a local disk locally. The size of the local disk is the same as the size recorded in the flavor parameter. After the local disk is created, data is downloaded from the object storage to the local disk, and a finish message is sent to complete the pre-migration process.

[0067] Figure 6 A schematic diagram of the structure of a data pre-migration device for a virtual machine provided in an embodiment of the present application. Figure 6 As shown, the data pre-migration device of the virtual machine includes:

[0068] A first determination module 602 is used to determine a target virtual machine on which a hot migration operation is to be performed;

[0069] A second determination module 604 is used to determine, among the data of the target virtual machine, the target data located in the local disk of the current node and the virtual machine data located in the shared storage;

[0070] A first migration module 606, configured to migrate target data to a local disk of a destination node of a target virtual machine;

[0071] The second migration module 608 is used to migrate the virtual machine data of the target virtual machine to the shared storage of the destination node when the migration of the target data is successful.

[0072] The above-mentioned virtual machine can be a virtual machine instance created for a user. The virtual machine data of the virtual machine instance is stored in shared storage. The virtual machine instance can be used by the user. The data generated during the user's use is user data, that is, the above-mentioned target data, which can be stored in the local disk of the current node where the virtual machine instance is located.

[0073] The above-mentioned target virtual machine may be a virtual machine to be hot migrated. The target virtual machine is to be migrated from the current node to the target node. The above-mentioned two parts of data of the target virtual machine, namely the target data and the virtual machine data, are first determined, and then the target data is migrated first. The target data is migrated to the local disk of the destination node. If the local disk of the destination node has insufficient storage space, the migration fails. If the local disk of the destination node has sufficient storage space and the target data is successfully written to the local disk of the destination node, the target data is successfully migrated.

[0074] After the target data is successfully migrated, the target virtual machine can be hot migrated. The virtual machine data of the target virtual machine is hot migrated to the shared storage of the destination node. Since the target data has been migrated to the destination node, the hot migration of the target virtual machine only needs to migrate the virtual machine data, which greatly reduces the amount of data for hot migration of the virtual machine.

[0075] When migrating target data, the path of the target data in the local disk of the current node and the path of the local disk of the destination node can be the same except for the prefix of the local disk. The path of the virtual machine data in the shared storage of the current node and the destination node can also be the same except for the prefix.

[0076] The solution provided by the embodiment of the present application can first split the data of the target virtual machine to be hot migrated into the virtual machine data in the shared storage and the target data of the user in the local disk. The target data is first migrated to the local disk of the destination node, and when the migration of the target data is successful, the virtual machine data is migrated to the destination node, so that when the virtual machine is hot migrated, only the virtual machine data of the virtual machine needs to be migrated, which reduces the amount of data for hot migration of the virtual machine and improves the migration speed of hot migration of the virtual machine.

[0077] For other examples of this embodiment, please refer to the above examples and will not be described in detail here.

[0078] like Figure 7As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0079] Memory 113, used for storing computer programs;

[0080] In one embodiment of the present application, the processor 111 is used to implement the data pre-migration method of the virtual machine provided by any of the aforementioned method embodiments when executing the program stored in the memory 113.

[0081] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of providing a method for pre-migrating data of a virtual machine as described in any of the aforementioned method embodiments are implemented.

[0082] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0083] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0084] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0085] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for pre-migrating data of a virtual machine, characterized in that: include: Determine a target virtual machine for performing a live migration operation; Determine, among the data of the target virtual machine, target data located in a local disk of the current node and virtual machine data located in a shared storage; Migrating the target data to a local disk of a destination node of the target virtual machine; When the target data is successfully migrated, the virtual machine data of the target virtual machine is migrated to the shared storage of the destination node.

2. The method according to claim 1, characterized in that In the data of the target virtual machine determined, the target data located in the local disk of the current node and the virtual machine data located in the shared storage include: Determine a storage path for data of the target virtual machine; Traversing the storage path starting from the first character string of the storage path; In the case where the target string is not traversed, determining that the data is the target data, wherein the target string is a string under the path of the shared storage; When the target character string is traversed, it is determined that the data is the virtual machine data.

3. The method according to claim 1, characterized in that The migrating the target data to the local disk of the destination node of the target virtual machine includes: Copying the target data to a cloud storage area that provides object storage services; Moving the target data in the cloud storage area to the local disk of the destination node; In the case where the target data is successfully moved to the local disk of the destination node, the target data in the local disk of the current node is deleted.

4. The method according to claim 3, characterized in that Copying the target data to the cloud storage area or moving the target data from the cloud storage area to the local disk of the destination node includes: Determine the network bandwidth usage value; When the average value of the network bandwidth occupancy value within the predetermined time period is less than a preset threshold, the target data is copied to the cloud storage area or the target data is moved from the cloud storage area to the local disk of the destination node.

5. The method according to claim 4, characterized in that When the average value of the network bandwidth occupancy value within the predetermined time period is less than a preset threshold, copying the target data to the cloud storage area or moving the target data from the cloud storage area to the local disk of the destination node includes: Determining the network bandwidth occupancy value once every predetermined period of time; When the average value of a plurality of consecutive network bandwidth occupancy values ​​is less than the preset threshold, starting to copy or move the target data; During the process of copying or moving the target data, if the network bandwidth occupancy value is greater than or equal to the preset threshold, copying or moving the target data is suspended until the network bandwidth occupancy value is less than the preset threshold.

6. The method according to claim 3, characterized in that Copying the target data to the cloud storage area or moving the target data from the cloud storage area to the local disk of the destination node includes: Divide a time period into multiple sub-periods; Determine the network bandwidth occupancy value in each of the sub-periods; According to the size of the network bandwidth occupancy value in each sub-period, the target data is split into multiple parts to obtain multiple sub-target data, wherein the number of the sub-target data is the same as the number of the sub-periods, and the size of the sub-target data is negatively correlated with the network bandwidth occupancy value in the sub-period; The corresponding sub-target data is transmitted in each of the sub-periods.

7. The method according to claim 1, characterized in that Determining the target virtual machine to perform the hot migration operation includes: When the local resource value of the current node is greater than the warning value, a virtual machine occupying the most local resources in the current node is determined as the target virtual machine.

8. A data pre-migration device for a virtual machine, characterized in that: include: A first determination module is used to determine a target virtual machine on which a hot migration operation is to be performed; A second determination module is used to determine, among the data of the target virtual machine, the target data located in the local disk of the current node and the virtual machine data located in the shared storage; A first migration module, used to migrate the target data to a local disk of a destination node of the target virtual machine; The second migration module is used to migrate the virtual machine data of the target virtual machine to the shared storage of the destination node when the migration of the target data is successful.

9. An electronic device, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor coupled to the at least one bus; At least one memory connected to the at least one bus, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the method described in any one of claims 1 to 7 of the present application.

Citation Information

Cited By

  • Real-time virtual machine deployment method and system based on buffer queue ant colony algorithm

    CN120723375A

  • A real-time virtual machine deployment method and system based on a buffer queue ant colony algorithm

    CN120723375B