Data migration method, device, apparatus, and storage medium

By employing parallel migration methods and control node management, the problem of low efficiency in migrating massive numbers of virtual machines was solved, achieving an efficient and accurate data migration process and reducing manual intervention and errors.

CN119311202BActive Publication Date: 2025-10-24INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311365096.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-20
Publication Date
2025-10-24
Estimated Expiration
2043-10-20

AI Technical Summary

Technical Problem

In existing technologies, data migration of massive virtual machines is inefficient and has a low accuracy rate. Especially in private cloud scenarios, single virtual machine migration methods are time-consuming, labor-intensive, and prone to operational errors.

Method used

A parallel migration approach is adopted. By acquiring the migration information of virtual machines, extracting the cloud disk information corresponding to the virtual machines, and migrating the data in the original environment cloud disk to the target environment cloud disk, the control node is used to manage and migrate independently of the storage cluster.

Benefits of technology

It improves the efficiency and accuracy of data migration, reduces manual intervention, and significantly improves migration efficiency and reduces the risk of misoperation, especially in the migration of large-capacity virtual machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311202B_ABST
    Figure CN119311202B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data migration method, which can be applied to the field of cloud computing technology. The data migration method comprises: obtaining migration information of a virtual machine to be migrated; extracting information of at least one cloud disk corresponding to the virtual machine based on the migration information of the virtual machine, wherein the information of any cloud disk comprises a source environment cloud disk and a target environment cloud disk in a mapping relationship, the source environment cloud disk is in a first storage cluster, and the target environment cloud disk is in a second storage cluster; and migrating data in the source environment cloud disk to the target environment cloud disk in a virtual machine parallel migration manner, wherein the virtual machine parallel migration manner is a parallel migration manner for different virtual machines. The present disclosure also provides a data migration device, equipment and storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of cloud computing, in particular to a data migration method, device, equipment and storage medium. BACKGROUND

[0002] In the early use of cloud computing environment, the corresponding back-end storage of the virtual machine (also known as elastic cloud server) is generally distributed block storage technology, and the hardware often uses HDD mechanical hard disk, which has the characteristics of durability, low cost and large capacity. With the continuous development of the times and technology, SSD solid state disk gradually occupies the market mainstream, with high performance, small size and gradually flat price with mechanical hard disk. Using solid state disk in new scene has become a mainstream selection method.

[0003] There are still many storage clusters based on mechanical hard disks in the stock cloud environment. Using solid state disk storage clusters can significantly improve user experience and performance, but most existing platforms provide cloud disk migration function for single virtual machine, which requires several click operation steps. For private cloud scenarios with massive environment, there is no batch processing method, resulting in a large amount of manual operation for data migration, which is time-consuming and laborious, easy to cause operation errors and low migration efficiency. SUMMARY

[0004] In view of the above problems, the present disclosure provides a data migration method, device, equipment, medium and program product for improving data migration efficiency and data migration correctness.

[0005] According to a first aspect of the present disclosure, a data migration method is provided, comprising: obtaining migration information of a virtual machine to be migrated; based on the migration information of the virtual machine, extracting information of at least one cloud disk corresponding to the virtual machine, wherein the information of any cloud disk includes a source environment cloud disk and a target environment cloud disk in a mapping relationship, the source environment cloud disk is in a first storage cluster, and the target environment cloud disk is in a second storage cluster; and migrating data in the source environment cloud disk to the target environment cloud disk in a virtual machine parallel migration manner, wherein the virtual machine parallel migration manner is to adopt a parallel migration manner for different virtual machines.

[0006] According to an embodiment of the present disclosure, wherein the virtual machine comprises a first virtual machine, the migration information of the virtual machine comprises a first list, a second list and a third list, the first list comprises N virtual machine addresses, the second list comprises M first mapping relationships, the first mapping relationship comprises a mapping relationship between the virtual machine address and a virtual machine identifier, the third list comprises L second mapping relationships, the second mapping relationship comprises a mapping relationship between the virtual machine identifier and a cloud disk data identifier, N, M and L are positive integers, and the extracting, based on the migration information of the virtual machine, information of at least one cloud disk corresponding to the virtual machine comprises: extracting a preset number of virtual machine addresses in the first list, the virtual machine addresses at least comprising a first virtual machine address; for the first virtual machine, querying the first virtual machine identifier in the first mapping relationship through the first virtual machine address; and based on the first virtual machine identifier, querying the cloud disk data identifier through the second mapping relationship.

[0007] According to an embodiment of the present disclosure, wherein the first list, the second list and the third list are stored in the form of static files.

[0008] According to an embodiment of the present disclosure, wherein the cloud disk data comprises first cloud disk data, and the migrating, in the virtual machine parallel migration manner, the data in the original environment cloud disk to the target environment cloud disk comprises: for the first virtual machine, checking a migration state of the first cloud disk data; in a case where the migration state of the first cloud disk data is migratable, migrating the first cloud disk data from the original environment cloud disk to the target environment cloud disk; and marking the migration state of the first cloud disk data as in migration.

[0009] According to an embodiment of the present disclosure, wherein after the marking of the migration state of the first cloud disk data as in migration, further comprising: cyclically checking a migration result of the first cloud disk data according to a preset period; and in a case where the migration result of the first cloud disk data is migration completed, marking the migration state of the first cloud disk data as migrated.

[0010] According to an embodiment of the present disclosure, wherein the migrating the first cloud disk data from the original environment cloud disk to the target environment cloud disk comprises: checking a cloud disk category involved by the first cloud disk data; in a case where the first cloud disk data involves a system disk, pausing the first virtual machine in the process of migration; and in a case where the migration of the first cloud disk data is completed, closing the pause of the first virtual machine.

[0011] According to an embodiment of the present disclosure, the cloud disk data further comprises second cloud disk data, and the data in the cloud disk in the source environment is migrated into the cloud disk in the target environment in a parallel virtual machine migration manner, comprising: migrating the first cloud disk data and the second cloud disk data in a serial migration manner.

[0012] According to an embodiment of the present disclosure, the data migration method is applied to a control node which is independent of the first storage cluster and the second storage cluster.

[0013] A second aspect of the present disclosure provides a data migration device, comprising: an acquisition module configured to acquire migration information of a virtual machine to be migrated; an extraction module configured to extract information of at least one cloud disk corresponding to the virtual machine based on the migration information of the virtual machine, wherein the information of any cloud disk comprises a cloud disk in a source environment and a cloud disk in a target environment which have a mapping relationship, the cloud disk in the source environment is in a first storage cluster, and the cloud disk in the target environment is in a second storage cluster; and a virtual machine migration module configured to migrate data in the cloud disk in the source environment into the cloud disk in the target environment in a parallel virtual machine migration manner, wherein the parallel virtual machine migration manner is to use a parallel migration manner for different virtual machines.

[0014] According to an embodiment of the present disclosure, the virtual machine comprises a first virtual machine, the migration information of the virtual machine comprises a first list, a second list and a third list, the first list comprises N virtual machine addresses, the second list comprises M first mapping relationships, the first mapping relationship comprises a mapping relationship between the virtual machine address and a virtual machine identifier, the third list comprises L second mapping relationships, the second mapping relationship comprises a mapping relationship between the virtual machine identifier and a cloud disk data identifier, N, M and L are positive integers, the extraction module comprises a virtual machine address extraction unit, a virtual machine identifier extraction unit and a cloud disk data extraction unit, the virtual machine address extraction unit is configured to extract a preset number of virtual machine addresses in the first list, the virtual machine address at least comprising a first virtual machine address; the virtual machine identifier extraction unit is configured to query a first virtual machine identifier in the first mapping relationship through the first virtual machine address for the first virtual machine; and the cloud disk data extraction unit is configured to query the cloud disk data identifier through the second mapping relationship based on the first virtual machine identifier.

[0015] According to an embodiment of the present disclosure, the first list, the second list and the third list are stored in a static file form.

[0016] According to an embodiment of the present disclosure, the cloud disk data includes first cloud disk data, and the virtual machine migration module includes a migration state checking unit, a migration executing unit, and a migration marking unit. The migration state checking unit is configured to check a migration state of the first cloud disk data for the first virtual machine. The migration executing unit is configured to migrate the first cloud disk data from the original environment cloud disk to the target environment cloud disk when the migration state of the first cloud disk data is migratable. The migration marking unit is configured to mark the migration state of the first cloud disk data as in migration.

[0017] According to an embodiment of the present disclosure, the virtual machine migration module further includes a migration result checking unit and a migration marking unit. The migration result checking unit is configured to cyclically check a migration result of the first cloud disk data according to a preset period. The migration marking unit is configured to mark the migration state of the first cloud disk data as migrated when the migration result of the first cloud disk data is migration completed.

[0018] According to an embodiment of the present disclosure, the migration executing unit includes a classification subunit, a suspension subunit, and an opening subunit. The classification subunit is configured to check a cloud disk category involved by the first cloud disk data. The suspension subunit is configured to suspend the first virtual machine in a migration process when the first cloud disk data involves a system disk. The opening subunit is configured to close the suspension of the first virtual machine when the migration of the first cloud disk data is completed.

[0019] According to an embodiment of the present disclosure, the cloud disk data further includes second cloud disk data, and the virtual machine migration module is further configured to implement migration on the first cloud disk data and the second cloud disk data in a serial migration manner.

[0020] According to an embodiment of the present disclosure, the data migration method is applied to a control node, and the control node is independent of the first storage cluster and the second storage cluster.

[0021] A third aspect of the present disclosure provides an electronic device, including: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the above-mentioned data migration method.

[0022] A fourth aspect of the present disclosure further provides a computer-readable storage medium having stored executable instructions, which, when executed by a processor, cause the processor to perform the above-mentioned data migration method.

[0023] In the embodiments of the present disclosure, in order to solve the technical problems of low efficiency and low accuracy of mass virtual machine disk migration in a private cloud scenario, the data in the cloud disks of different virtual machines can be migrated simultaneously and concurrently, which can obviously improve the efficiency compared with manual operation, especially for large-capacity virtual machine migration which is time-consuming and does not require personnel on duty, thereby improving the migration efficiency and significantly improving the migration efficiency in a mass environment. BRIEF DESCRIPTION OF DRAWINGS

[0024] The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of the embodiments of the present disclosure taken in conjunction with the accompanying drawings, in which:

[0025] Figure 1A A diagram schematically showing an application scenario of a data migration method according to an embodiment of the present disclosure is shown;

[0026] Figure 1A A diagram schematically showing an architecture of a data migration method according to an embodiment of the present disclosure is shown;

[0027] Figure 2 A flowchart schematically showing a data migration method according to an embodiment of the present disclosure is shown;

[0028] Figure 3 A flowchart schematically showing a virtual machine cloud disk extraction method according to an embodiment of the present disclosure is shown;

[0029] Figure 4 A flowchart schematically showing a cloud disk data migration method according to an embodiment of the present disclosure is shown;

[0030] Figure 5 A flowchart schematically showing a data migration method according to an embodiment of the present disclosure is shown;

[0031] Figure 6 A block diagram schematically showing a data migration apparatus according to an embodiment of the present disclosure is shown; and

[0032] Figure 7 A block diagram schematically showing an electronic device suitable for implementing a data migration method according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0033] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. However, it will be apparent to those skilled in the art that one or more embodiments can be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques have been omitted to avoid unnecessarily obscuring the concept of the present disclosure.

[0034] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the terms "comprises", "comprising", "includes", "including" and the like are, unless otherwise stated, taken to mean the statement that one includes, i.e. the features, steps, operations, and / or components so referred to, but not to the exclusion of the other features, steps, operations, components, and so forth.

[0035] All terms used herein, including technical and scientific terms, have the meanings commonly understood by one of ordinary skill in the art unless otherwise defined herein. It should be noted that the use of certain terms or terminology in this document should not be interpreted as excluding or requiring the use of other terms or terminology.

[0036] In the case of using expressions similar to "at least one of A, B, and C, etc.", it generally should be interpreted to include at least one of each item enumerated, i.e., A only, B only, C only, both A and B, both A and C, both B and C, or all of A, B, and C, etc.

[0037] In the scenario of a private cloud, hardware matching facility upgrade will bring migration of the underlying cloud disk of the virtual machine. The prior art only involves cloud disk migration technology for a single virtual machine, specifically: through manual input of the cloud disk ID to be migrated and the target cloud disk ID of the same virtual machine by an operator on the cloud platform, and then inputting the cloud disk ID to be migrated and the target cloud disk ID on the cloud platform and executing a migration command to ensure migration of the virtual machine.

[0038] If a large number of virtual machines or the entire cluster are to be migrated, the amount of operation is relatively large, and frequent query and copy of the command result can easily cause misoperation. Disks are lower-level virtual hardware, and faults can easily cause the entire business to be unavailable, with high risk. The migration process can affect the IO performance of the virtual machine, and simultaneous migration of multiple cloud disks of a single virtual machine can easily cause the business to be unavailable. Generally, it is a serial operation to reduce the impact on the business.

[0039] To solve the technical problems in the prior art, embodiments of the present disclosure provide a data migration method, comprising: obtaining migration information of a virtual machine to be migrated; extracting information of at least one cloud disk corresponding to the virtual machine based on the migration information of the virtual machine, wherein the information of any cloud disk includes a source environment cloud disk and a target environment cloud disk in a mapping relationship, the source environment cloud disk is in a first storage cluster, and the target environment cloud disk is in a second storage cluster; and migrating data in the source environment cloud disk to the target environment cloud disk in a virtual machine parallel migration manner, wherein the virtual machine parallel migration manner is a parallel migration manner for different virtual machines.

[0040] In the embodiments of the present disclosure, in order to solve the technical problems of low efficiency and low accuracy of mass virtual machine disk migration in a private cloud scenario, the data in the cloud disks of different virtual machines is migrated in parallel, multiple virtual machines can be migrated at the same time, which is obviously better than manual operation, especially for large-capacity virtual machine migration which is time-consuming and does not require personnel on duty, which can improve the migration efficiency and significantly improve the migration efficiency in a mass environment.

[0041] Figure 1A An application scenario diagram of the data migration method according to the embodiments of the present disclosure is schematically shown.

[0042] As shown in Figure 1A The application scenario 100 according to the embodiments can include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0043] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0044] The terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.

[0045] The server 105 can be a server that provides various services, such as a background management server that provides support for a website browsed by a user using the terminal device 101, 102, or 103 (as an example). The background management server can perform analysis and the like on received user requests and the like, and feed back a processing result (such as a web page, information, or data obtained or generated according to a user request) to the terminal device.

[0046] It should be noted that the data migration method provided by the embodiments of the present disclosure can generally be executed by the server 105. Accordingly, the data migration apparatus provided by the embodiments of the present disclosure can generally be arranged in the server 105. The data migration method provided by the embodiments of the present disclosure can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal device 101, 102, or 103 and / or the server 105. Accordingly, the data migration apparatus provided by the embodiments of the present disclosure can also be arranged in a server or a server cluster different from the server 105 and capable of communicating with the terminal device 101, 102, or 103 and / or the server 105.

[0047] It should be understood that Figure 1A The number of terminal devices, networks, and servers in the above description is merely illustrative. Any number of terminal devices, networks, and servers can be provided according to implementation needs.

[0048] Figure 1B An architecture diagram of data migration according to an embodiment of the present disclosure is schematically shown.

[0049] As Figure 1B shown, the architecture diagram of data migration includes a control node 110, an old storage cluster 120, a new storage cluster 130, and a configuration management system 140, wherein

[0050] The control node (CtlSrv) 110 is used for deployment and execution scheduling of the method tool; the old storage cluster (HDD-Ceph) 120 stores cloud virtual machine data of a pre-migration environment; the new storage cluster (SSD-Ceph) 130 stores cloud virtual machine data of a post-migration environment; and the configuration management system (CMDB) 140 is used for storing configuration data of virtual machines and cloud hard disks.

[0051] According to an embodiment of the present disclosure, the data migration method is applied to a control node (i.e., a control node) that is independent of the first storage cluster and the second storage cluster.

[0052] The data migration method of the disclosed embodiments will be described in detail below based on the scenarios described in Figure 1A and Figure 1B Figures 2-6 The data migration method of the disclosed embodiments will be described in detail below based on the scenarios described in ​

[0053] Figure 2 A flowchart of a data migration method according to an embodiment of the present disclosure is schematically shown.

[0054] As Figure 2 shown, the data migration method of this embodiment includes operation S210 to operation S230, which can be executed by the server 105, or the method can be executed by the total control node 110.

[0055] In operation S210, migration information of a virtual machine to be migrated is acquired.

[0056] It should be noted that in the embodiments of the present disclosure, each virtual machine to be migrated corresponds to one or more cloud disks for underlying support, and the cloud disks can be divided into system disks (i.e., cloud disks involving system data) and non-system disks (i.e., cloud disks not involving system data) according to stored data.

[0057] In a typical scenario, as shown in Figure 1B shown, in the old storage cluster 120, a plurality of cloud disks are configured, and before migration, each virtual machine and these cloud disks in the old storage cluster 120 have a one-to-one or one-to-many correspondence relationship. Due to the need for business upgrade, the data of these cloud disks in the old storage cluster 120 needs to be migrated to the new storage cluster 130, and similarly, the new storage cluster 130 is also configured with a plurality of cloud disks, and after migration is completed, each virtual machine and these cloud disks in the new storage cluster 130 have a one-to-one or one-to-many correspondence relationship.

[0058] The migration information of the virtual machine is information for locating the data in the cloud disk involved by the virtual machine, and enables the data in the cloud disk to be migrated in different cloud disks. In the embodiments of the present disclosure, what needs to be done is to migrate the data in the cloud disk of the virtual machine from the cloud disk in the old storage cluster 120 to the cloud disk in the new storage cluster 130. In this process, the data in the cloud disk can be located through various types of information, and then, from the perspective of the object of the maintenance query portal, the query portal can be various, for example, through the virtual machine identifier as the query portal, the data in the corresponding cloud disk is queried, and the path of the data migrated from somewhere to somewhere, and for example, through the virtual machine address as the query portal, the data in the corresponding cloud disk is queried, and the path of the data migrated from somewhere to somewhere.

[0059] In operation S220, based on the migration information of the virtual machine, information of at least one cloud disk corresponding to the virtual machine is extracted, wherein the information of any cloud disk includes an original environment cloud disk and a target environment cloud disk in a mapping relationship, the original environment cloud disk is in a first storage cluster, and the target environment cloud disk is in a second storage cluster.

[0060] Specifically, the information of the cloud disk corresponding to each virtual machine is extracted as a granularity, and the information of the cloud disk at least includes cloud disk data and a migration path of the cloud disk, and the migration path defines migration of the data from a certain original environment cloud disk to a certain target environment cloud disk.

[0061] In operation S230, the data in the original environment cloud disk is migrated into the target environment cloud disk in a parallel migration manner of the virtual machine, and the parallel migration manner of the virtual machine is a parallel migration manner for different virtual machines.

[0062] Specifically, the parallel migration refers to parallel migration between virtual machines, that is, multiple virtual machines can be supported to migrate at the same time, and the migration process of the cloud disk data in each virtual machine (here, the case that the virtual machine has multiple cloud disks corresponding thereto is discussed) is not limited and can be parallel or serial.

[0063] In the embodiment of the present disclosure, in order to solve the technical problems of low efficiency and low accuracy of migration of a large number of virtual machine disks in a private cloud scenario, the data in the cloud disk of each virtual machine is migrated in parallel, and multiple virtual machines can be concurrently migrated, which is obviously improved compared with manual operation, especially for large-capacity virtual machine migration which is time-consuming and does not require personnel on duty, and the migration efficiency can be improved, and the migration efficiency is obviously improved in a large number of environment.

[0064] It should be noted that the migration information can be various based on different query entrances, and the cloud disk extraction method will be disclosed in detail below with the virtual machine address (or virtual machine IP) as the query entrance, as shown below:

[0065] Figure 3 A flowchart of a virtual machine cloud disk extraction method according to an embodiment of the present disclosure is schematically shown.

[0066] As Figure 3 shown, the virtual machine cloud disk extraction method of the embodiment includes operation S310 to operation S330, and the operation S310 to operation S330 can at least partially execute the operation S220.

[0067] According to the embodiment of the present disclosure, the virtual machine includes a first virtual machine, the migration information of the virtual machine includes a first list, a second list and a third list, the first list includes N virtual machine addresses, the second list includes M first mapping relationships, the first mapping relationship includes a mapping relationship between the virtual machine address and a virtual machine identifier, the third list includes L second mapping relationships, the second mapping relationship includes a mapping relationship between the virtual machine identifier and a cloud disk data identifier, and N, M and L are positive integers.

[0068] The first list stores addresses of virtual machines to be migrated, the second list stores a first mapping relationship between the virtual machine addresses and virtual machine identifiers, and the third list stores a mapping relationship between the virtual machine identifiers and cloud disk data identifiers. The first mapping relationship can be one-to-one correspondence between the virtual machine addresses and the virtual machine identifiers, or can be non-one-to-one correspondence between the virtual machine addresses and the virtual machine identifiers. The second mapping relationship can be one-to-one relationship between the virtual machine identifiers and the cloud disk data identifiers, or can be one-to-many relationship between the virtual machine identifiers and the cloud disk data identifiers.

[0069] In operation S310, a preset number of virtual machine addresses in the first list are extracted, and the virtual machine addresses at least include a first virtual machine address.

[0070] Specifically, a preset number of virtual machine addresses are extracted in one batch, so that a preset number of virtual machines corresponding to the virtual machine addresses can perform concurrent migration.

[0071] In operation S320, for the first virtual machine, a first virtual machine identifier in the first mapping relationship is queried through the first virtual machine address.

[0072] In operation S330, based on the first virtual machine identifier, a cloud disk data identifier is queried through the second mapping relationship.

[0073] The first mapping relationship is from the second list, and the second mapping relationship is from the third list.

[0074] Specifically, for a virtual machine, an identifier is queried through an address of the virtual machine, and a cloud disk data identifier is queried through the identifier, so as to locate data related to the virtual machine and then implement migration.

[0075] In the embodiments of the present disclosure, only an IP address list of managed migration needs to be maintained, and the underlying virtual machine ID and hard disk information do not need to be concerned. No professional skill background is needed, parameters of a migration process can be automatically acquired and transmitted, human intervention is not needed, and convenience of tool execution is improved.

[0076] According to the embodiments of the present disclosure, the first list, the second list, and the third list are stored in the form of static files.

[0077] In the embodiments of the present disclosure, to improve query efficiency, the information is output as a static file before initial execution, and retrieval efficiency is improved.

[0078] Figure 4 A flowchart of a cloud disk data migration method according to an embodiment of the present disclosure is schematically shown.

[0079] As Figure 4 shown, the cloud hard disk data migration method of this embodiment includes operation S410 to operation S450, which can at least partially perform the above-mentioned operation S220.

[0080] According to an embodiment of the present disclosure, wherein the cloud hard disk data includes first cloud hard disk data.

[0081] In operation S410, for the first virtual machine, the migration state of the first cloud hard disk data is checked.

[0082] In operation S420, in the case that the migration state of the first cloud hard disk data is migratable, the first cloud hard disk data is migrated from the original environment cloud hard disk to the target environment cloud hard disk.

[0083] Specifically, the migration state of the first cloud hard disk data is checked by the above-mentioned third list, in which a migration state bit is reserved for cloud hard disk data identification, and the migration state bit is modified accordingly whenever the corresponding cloud hard disk data is in the process of migration or after the migration is completed, so as to facilitate the management of each migration by the control node.

[0084] According to an embodiment of the present disclosure, wherein the migration of the first cloud hard disk data from the original environment cloud hard disk to the target environment cloud hard disk includes: checking the cloud hard disk category involved in the first cloud hard disk data; in the case that the first cloud hard disk data involves a system disk, pausing the first virtual machine during the migration; and in the case that the migration of the first cloud hard disk data is completed, closing the pause of the first virtual machine.

[0085] Specifically, during the migration, the category of the cloud hard disk involved needs to be checked, and in the case that a system disk is involved, the current virtual machine needs to be paused, and the pause is closed after the corresponding cloud hard disk migration is completed.

[0086] In operation S430, the migration state of the first cloud hard disk data is marked as in migration.

[0087] In operation S440, the migration result of the first cloud hard disk data is checked cyclically according to a preset period.

[0088] In operation S450, in the case that the migration result of the first cloud hard disk data is migration completed, the migration state of the first cloud hard disk data is marked as migrated.

[0089] Specifically, the logic of checking the migration state in the third list according to the period is set, and in the case that the migration state is in migration, the migration state is checked constantly, and after the migration is completed, the migration state in the third list is set to migrated.

[0090] According to an embodiment of the present disclosure, the cloud hard disk data further comprises second cloud hard disk data, and the data in the original environment cloud hard disk is migrated into the target environment cloud hard disk in a parallel migration manner of the virtual machine, comprising: migrating the first cloud hard disk data and the second cloud hard disk data in a serial migration manner.

[0091] Specifically, for different cloud hard disks under the same virtual machine, the migration process can be set to be executed in series, ensuring that only one cloud hard disk is in a migration state at the same time for one virtual machine. It can be understood that the migration process will affect the input and output performance of the virtual machine. If there are multiple cloud hard disks for a single virtual machine, parallel migration for these multiple cloud hard disks will easily lead to the unavailability of the business running in the virtual machine, so serial operation will be adopted to reduce the impact on the existing business.

[0092] Figure 5 An overall flowchart of a data migration method according to an embodiment of the present disclosure is schematically shown.

[0093] As shown in Figure 5 The data migration method of this embodiment comprises operations S501-S512.

[0094] In operation S501, a virtual machine IP list file that needs to be migrated is constructed, the file name is ip.list, and each line saves an ip address to be migrated.

[0095] In operation S502, information of a cloud environment full virtual machine list is generated, nova list--all_tenova.list, and the nova.list file is generated as a basis for obtaining the virtual machine id through the ip.

[0096] In operation S503, information of a cloud environment full cloud hard disk list is generated, cinder list--all_tecinder.list, and the cinder.list file is generated as a basis for obtaining the cloud hard disk id through the virtual machine id.

[0097] In operation S504, the ip.list file is read line by line using a for or while loop method, and each time an ip address is obtained and passed to the parameter $ip.

[0098] In operation S505, the virtual machine id is queried according to $ip using cat nova.list|grep-w $ip|awk′{print $2}′, and passed to the parameter $vmid.

[0099] In operation S506, according to the $vmid, the virtual machine corresponding cloud hard disk is queried using nova show $vmid, the cloud hard disk can have one or more, as a parameter $vmDiskStr, the string is composed of multiple $vmDisk parameters, separated by commas, and each $vmDisk can be obtained by parsing as a parameter of a subsequent command.

[0100] In operation S507, the first cloud hard disk $vmDisk is selected, and it is judged whether it is a system disk. If it is a system disk, the operation of nova pause $vmid is performed to pause the virtual machine, and if it is a data disk, the operation is not performed.

[0101] In operation S508, the first cloud hard disk is migrated, and cinder retype $vmDisk $new cluster ID--migration-policy on-demand.

[0102] In operation S509, the nova.list list is modified, and the migration state of the virtual machine $ip is marked as in migration.

[0103] In operation S510, the state of the $vmDisk disk is checked in a loop. If it is in migration, it is checked again in five minutes; if it is in a normal state after migration, the $ip corresponding row in the nova.list list is marked as migratable.

[0104] In operation S511, the cinder.list list is modified, and the migration state of the cloud hard disk $vmDisk is marked as migrated.

[0105] In operation S512, if the migrated hard disk is a system disk, the operation of nova unpause $vmid is performed to cancel the suspension of the virtual machine.

[0106] The above operations S508 to S512 are repeatedly performed until all cloud hard disks of the virtual machine are migrated. It can be understood that different virtual machines can simultaneously perform the above operations. According to the overall performance of the storage cluster, the number of virtual machines simultaneously performing migration operations can be controlled by limiting the concurrency parameter, and the concurrent migration of multiple virtual machines is realized.

[0107] Based on the above method, the present disclosure also provides a data migration device. The following will be described in detail Figure 6 The device is described in detail.

[0108] Figure 6 The structure block diagram of the data migration device according to the embodiment of the present disclosure is schematically shown.

[0109] As Figure 6As shown, the data migration apparatus 600 of this embodiment comprises an acquisition module 610, an extraction module 620 and a virtual machine migration module 630.

[0110] The acquisition module 610 is configured to acquire migration information of a virtual machine to be migrated. In an embodiment, the acquisition module 610 can be configured to perform operation S210 described above, and thus details are not repeated here.

[0111] The extraction module 620 is configured to extract information of at least one cloud disk corresponding to the virtual machine based on the migration information of the virtual machine, wherein the information of any cloud disk comprises a source environment cloud disk and a target environment cloud disk in an existence mapping relationship, the source environment cloud disk is in a first storage cluster, and the target environment cloud disk is in a second storage cluster. In an embodiment, the extraction module 620 can be configured to perform operation S220 described above, and thus details are not repeated here.

[0112] The virtual machine migration module 630 is configured to migrate data in the source environment cloud disk to the target environment cloud disk in a parallel migration manner of the virtual machine, wherein the parallel migration manner of the virtual machine is a parallel migration manner for different virtual machines. In an embodiment, the virtual machine migration module 630 can be configured to perform operation S230 described above, and thus details are not repeated here.

[0113] In an embodiment of the present disclosure, in order to solve the technical problems of low efficiency and low accuracy of mass virtual machine disk migration in a private cloud scenario, data in cloud disks of different virtual machines can be migrated in parallel, a plurality of virtual machines can be migrated simultaneously, which is obviously better than manual operation, especially for large-capacity virtual machine migration which is time-consuming and does not require personnel on duty, which can improve the migration efficiency and significantly improve the migration efficiency in a mass environment.

[0114] According to an embodiment of the present disclosure, the virtual machine includes a first virtual machine, the migration information of the virtual machine includes a first list, a second list and a third list, the first list includes N virtual machine addresses, the second list includes M first mapping relationships, the first mapping relationship includes a mapping relationship between the virtual machine address and a virtual machine identifier, the third list includes L second mapping relationships, the second mapping relationship includes a mapping relationship between the virtual machine identifier and a cloud disk data identifier, N, M and L are positive integers, the extraction module includes a virtual machine address extraction unit, a virtual machine identifier extraction unit and a cloud disk data extraction unit, the virtual machine address extraction unit is configured to extract a preset number of virtual machine addresses in the first list, the virtual machine address at least including a first virtual machine address; the virtual machine identifier extraction unit is configured to query a first virtual machine identifier in the first mapping relationship through the first virtual machine address for the first virtual machine; and the cloud disk data extraction unit is configured to query the cloud disk data identifier through the second mapping relationship based on the first virtual machine identifier.

[0115] According to an embodiment of the present disclosure, the first list, the second list and the third list are stored in the form of static files.

[0116] According to an embodiment of the present disclosure, the cloud disk data includes first cloud disk data, and the virtual machine migration module includes a migration state checking unit, a migration execution unit and a migration marking unit, the migration state checking unit is configured to check a migration state of the first cloud disk data for the first virtual machine; the migration execution unit is configured to migrate the first cloud disk data from the original environment cloud disk to the target environment cloud disk in a case where the migration state of the first cloud disk data is migratable; and the migration marking unit is configured to mark the migration state of the first cloud disk data as in migration.

[0117] According to an embodiment of the present disclosure, the virtual machine migration module further includes a migration result viewing unit and a migration marking unit, the migration result viewing unit is configured to view a migration result of the first cloud disk data in a preset period cycle; and the migration marking unit is configured to mark the migration state of the first cloud disk data as migrated in a case where the migration result of the first cloud disk data is migration completed.

[0118] According to an embodiment of the present disclosure, the migration executing unit includes a classification sub-unit, a suspension sub-unit and a start sub-unit. The classification sub-unit is configured to check a cloud hard disk category to which the first cloud hard disk data belongs. The suspension sub-unit is configured to suspend the first virtual machine during the migration when the first cloud hard disk data belongs to a system disk. The start sub-unit is configured to start the first virtual machine when the migration of the first cloud hard disk data is completed.

[0119] According to an embodiment of the present disclosure, the cloud hard disk data further includes second cloud hard disk data. The virtual machine migration module is further configured to migrate the first cloud hard disk data and the second cloud hard disk data by using a serial migration mode.

[0120] According to an embodiment of the present disclosure, the data migration method is applied to a control node which is independent of the first storage cluster and the second storage cluster.

[0121] According to an embodiment of the present disclosure, any of the acquisition module 610, the extraction module 620 and the virtual machine migration module 630 can be combined in one module, or any of the modules can be split into multiple modules. Alternatively, at least part of the function of one or more of the modules can be combined with at least part of the function of the other modules, and implemented in one module. According to an embodiment of the present disclosure, at least one of the acquisition module 610, the extraction module 620 and the virtual machine migration module 630 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on substrate, a system on package, an application specific integrated circuit (ASIC), or any other reasonable way of hardware or firmware by integrating or packaging the circuit, or implemented in any one of software, hardware and firmware or in a proper combination of any of the above. Alternatively, at least one of the acquisition module 610, the extraction module 620 and the virtual machine migration module 630 can be at least partially implemented as a computer program module which can perform the corresponding function when the computer program module is run.

[0122] Figure 7 A block diagram of an electronic device suitable for implementing the data migration method according to an embodiment of the present disclosure is schematically shown.

[0123] As Figure 7As shown, the electronic device 700 according to embodiments of the present disclosure includes a processor 701 that can perform various appropriate actions and processes according to programs stored in a read only memory (ROM) 702 or loaded into a random access memory (RAM) 703 from a storage section 708. The processor 701 can include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (e.g., an application specific integrated circuit (ASIC)), and so on. The processor 701 can also include an on-board memory for cache use. The processor 701 can include a single processing unit or multiple processing units for executing different actions of the method processes according to embodiments of the present disclosure.

[0124] In the RAM 703, various programs and data required for the operation of the electronic device 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. The processor 701 performs various operations of the method processes according to embodiments of the present disclosure by executing the programs in the ROM 702 and / or the RAM 703. Note that the programs can also be stored in one or more memories other than the ROM 702 and the RAM 703. The processor 701 can also perform various operations of the method processes according to embodiments of the present disclosure by executing the programs stored in the one or more memories.

[0125] According to embodiments of the present disclosure, the electronic device 700 can further include an input / output (I / O) interface 705, which is also connected to the bus 704. The electronic device 700 can further include one or more of the following components connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as necessary. A removable recording medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 710 as necessary, so that a computer program read out therefrom is installed in the storage section 708 as necessary.

[0126] The present disclosure also provides a computer readable storage medium, which can be included in the device / apparatus / system described in the above embodiments; or can exist separately without being assembled into the device / apparatus / system. The above computer readable storage medium carries one or more programs, which when executed, implement the method according to embodiments of the present disclosure.

[0127] According to an embodiment of the present disclosure, the computer readable storage medium can be a nonvolatile computer readable storage medium, for example, can include but not limited to: a portable computer diskette, a hard disk, a random access memory (RAM), a read only memory (ROM), an erasable programmable read only memory (EPROM or flash memory), a portable compact disc read only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer readable storage medium can include one or more memories such as the ROM 702 and / or the RAM 703 described above and / or one or more memory other than the ROM 702 and the RAM 703.

[0128] Embodiments of the present disclosure also include a computer program product, which includes a computer program containing program codes for executing the methods shown in the flowcharts. When the computer program product is run in a computer system, the program codes are used to make the computer system implement the item recommendation method provided by the embodiments of the present disclosure.

[0129] The above functions defined in the system / device of the embodiments of the present disclosure are performed when the computer program is executed by the processor 701. According to an embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by computer program modules.

[0130] In one embodiment, the computer program can rely on tangible storage media such as optical storage media, magnetic storage media, etc. In another embodiment, the computer program can also be transmitted, distributed, and downloaded in the form of signals on a network medium, and be downloaded and installed through the communication part 709, and / or be installed from the detachable medium 711. The program codes contained in the computer program can be transmitted by any appropriate network medium, including but not limited to: wireless, wired, etc., or any appropriate combination thereof.

[0131] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or be installed from the detachable medium 711. When the computer program is executed by the processor 701, the above functions defined in the system of the embodiments of the present disclosure are performed. According to an embodiment of the present disclosure, the system, device, apparatus, module, unit, etc. described above can be implemented by computer program modules.

[0132] According to embodiments of the present disclosure, program code of the computer program for performing the methods provided by the embodiments of the present disclosure can be written in any combination of one or more programming languages, and can be implemented in a computer program product. Specifically, the computer program can be implemented in a high-level procedural and / or object-oriented programming language, and / or in assembly / machine language. The programming language includes, but is not limited to, Java, C++, python, “C” language, or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's device, and partly on a remote computing device, or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider (ISP).

[0133] The computer program product of the present disclosure can be a computer program product, which is a machine-readable medium (or computer readable medium) having stored therein a sequence of instructions readable by a machine (e.g., a computer). The instructions in the machine-readable medium focus on the function of the computer program (e.g., in the form of a program unit) and on the cooperation behavior between such program units. The program can be distributed to computers, e.g., over a network, or can be distributed to computers over some other distribution mechanism.

[0134] Those skilled in the art can understand that the features described in the various embodiments of the present disclosure and / or claims can be combined or / and integrated in various combinations or / and integrations, even if such combinations or integrations are not expressly described in the present disclosure. In particular, the features described in the various embodiments of the present disclosure and / or claims can be combined and / or integrated in various combinations or / and integrations without departing from the spirit and teachings of the present disclosure. All such combinations and / or integrations are within the scope of the present disclosure.

[0135] The above describes embodiments of the present disclosure. However, these embodiments are merely for illustrative purposes, and are not intended to limit the scope of the present disclosure. Although each embodiment is described above separately, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Those skilled in the art can make various substitutions and modifications without departing from the scope of the present disclosure, and these substitutions and modifications should all fall within the scope of the present disclosure.

Claims

1. A data migration method, comprising: obtaining migration information of a virtual machine to be migrated; extracting information of at least one cloud disk corresponding to the virtual machine based on the migration information of the virtual machine, wherein the information of any cloud disk comprises a source environment cloud disk and a target environment cloud disk in an existing mapping relationship, the source environment cloud disk is in a first storage cluster, and the target environment cloud disk is in a second storage cluster; and migrating data in the source environment cloud disk to the target environment cloud disk in a virtual machine parallel migration manner, wherein the virtual machine parallel migration manner is a parallel migration manner for different virtual machines. The data migration method is applied to a control node, and the control node is independent of the first storage cluster and the second storage cluster. The virtual machine comprises a first virtual machine, the migration information of the virtual machine comprises a first list, a second list and a third list, the first list comprises N virtual machine addresses, the second list comprises M first mapping relationships, the first mapping relationship comprises a mapping relationship between the virtual machine address and a virtual machine identifier, the third list comprises L second mapping relationships, the second mapping relationship comprises a mapping relationship between the virtual machine identifier and a cloud disk data identifier, N, M and L are positive integers, 2. The method of claim 1, wherein, The extracting information of at least one cloud disk corresponding to the virtual machine based on the migration information of the virtual machine comprises: extracting a preset number of virtual machine addresses in the first list, the virtual machine addresses at least comprising a first virtual machine address; for the first virtual machine, querying the first virtual machine identifier in the first mapping relationship through the first virtual machine address; and based on the first virtual machine identifier, querying the cloud disk data identifier through the second mapping relationship. The first list, the second list and the third list are stored in the form of a static file.

3. The method of claim 2, wherein, The cloud disk data comprises first cloud disk data, 4. The method of claim 2, wherein, The migrating data in the source environment cloud disk to the target environment cloud disk in a virtual machine parallel migration manner comprises: for the first virtual machine, checking the migration state of the first cloud disk data; in the case that the migration state of the first cloud disk data is migratable, migrating the first cloud disk data from the source environment cloud disk to the target environment cloud disk; and marking the migration state of the first cloud disk data as in migration. After marking the migration state of the first cloud disk data as in migration, further comprising:

5. The method of claim 4, wherein, cyclically checking the migration result of the first cloud disk data according to a preset period; and in the case that the migration result of the first cloud disk data is migration complete, marking the migration state of the first cloud disk data as migrated. The migrating the first cloud disk data from the source environment cloud disk to the target environment cloud disk comprises:

6. The method of claim 4, wherein, checking a cloud disk category involved in the first cloud disk data; in the case that the first cloud disk data involves a system disk, pausing the first virtual machine during migration; and ​ In a case where the first cloud disk data migration is completed, suspending the first virtual machine is closed.

7. The method of claim 4, wherein, The cloud disk data further includes second cloud disk data, The data in the original environment cloud disk is migrated into the target environment cloud disk in a virtual machine parallel migration manner, including: The first cloud disk data and the second cloud disk data are migrated in a serial migration manner.

8. A data migration apparatus, comprising: an acquisition module configured to acquire migration information of a virtual machine to be migrated; an extraction module configured to extract information of at least one cloud disk corresponding to the virtual machine based on the migration information of the virtual machine, wherein the information of any cloud disk includes an original environment cloud disk and a target environment cloud disk having a mapping relationship, the original environment cloud disk is in a first storage cluster, and the target environment cloud disk is in a second storage cluster; and a virtual machine migration module configured to migrate data in the original environment cloud disk into the target environment cloud disk in a virtual machine parallel migration manner, wherein the virtual machine parallel migration manner is a parallel migration manner for different virtual machines; wherein the data migration apparatus is applied to a control node which is independent of the first storage cluster and the second storage cluster.

9. An electronic device, comprising: one or more processors; a storage device configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, enable the one or more processors to perform the method according to any one of claims 1-7.

10. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Virtual machine migration method and device

    CN107870802A

  • Gang migration of virtual machines using cluster-wide deduplication

    US20140196037A1