Data migration method and device, equipment, medium and product
By using cloud storage devices in virtual machines for data migration, the problem of low data migration efficiency of local storage devices in virtual machines is solved, and an efficient data migration process is realized, reducing costs and simplifying virtual machine management.
Patent Information
- Application Number
- CN202411095816.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-12-03
AI Technical Summary
In the process of data migration of local storage devices of virtual machines, the virtual machine needs to be recreated, resulting in complex data migration links, inefficient, and cost problems in creating additional virtual machines.
By mounting cloud storage devices in a virtual machine, migrating data from local storage devices to cloud storage devices, migrating virtual machines to new physical servers, and migrating data from cloud storage devices to new local storage devices, using Cloud storage devices are transferred as data migration, avoiding creating new virtual machines and cross-VM data migration.
Improves data migration efficiency, reduces the complexity of virtual machine creation and cross-VM data copying, reduces costs, and ensures that data is always processed in one virtual machine during the migration process.
Smart Images

Figure CN119065786A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data migration method, device, electronic device, computer-readable storage medium, and computer program product. Background Art
[0002] With the rapid development of computer technology, the demand for virtualization is growing, and virtual machines (VMs) have emerged. A virtual machine is a computer system implemented by software, which runs on a physical server (also called a physical machine) through virtualization technology, allowing operating systems and applications to run in a virtualized environment.
[0003] A virtual machine can use a local storage device (also called a local disk) for data storage. During the operation of a virtual machine, there is often a need to migrate data in the local storage device. Usually, you can create another virtual machine in the same computing cluster and migrate data from the current virtual machine to the newly created virtual machine to complete the data migration.
[0004] However, the above method requires re-creating the virtual machine, the data migration link is long, the complexity is high, and the data migration efficiency is low. Summary of the invention
[0005] The present application provides a data migration method. The method is aimed at data migration scenarios in a local storage device of a virtual machine and can improve data migration efficiency. The present application also provides a device, an electronic device, a computer-readable storage medium, and a computer program product corresponding to the above method.
[0006] In a first aspect, the present application provides a data migration method, the method comprising:
[0007] In response to a data migration request for a first local storage device used by a first virtual machine, mounting a cloud storage device to the first virtual machine; wherein the first virtual machine runs on a first physical server;
[0008] Migrating target data in the first local storage device to the cloud storage device;
[0009] Migrating the first virtual machine to a second physical server, so that the first virtual machine runs on the second physical server and uses a second local storage device of the second physical server;
[0010] Migrate the target data in the cloud storage device to the second local storage device.
[0011] In some possible implementations, in response to a data migration request for a first local storage device used by a first virtual machine, mounting a cloud storage device to the first virtual machine includes:
[0012] In response to a failure of a first virtual machine, determining a first local storage device used by the first virtual machine, and triggering a data migration request for the first local storage device;
[0013] Mount the cloud storage device to the first virtual machine.
[0014] In some possible implementations, determining the first local storage device used by the first virtual machine includes:
[0015] executing a query command line to obtain storage device information used by the first virtual machine, and determining a first local storage device used by the first virtual machine according to the storage device information; or,
[0016] A first local storage device used by the first virtual machine is determined according to the storage device information provided by the virtual machine management platform.
[0017] In some possible implementations, migrating the first virtual machine to the second physical server includes:
[0018] Modifying the affinity tag of the first virtual machine; wherein the modified affinity tag indicates that the first virtual machine runs on the second physical server;
[0019] Control the first virtual machine to restart.
[0020] In some possible implementations, before modifying the affinity tag of the first virtual machine, the method further includes:
[0021] Disassociate the first virtual machine from the first local storage device;
[0022] After controlling the first virtual machine to restart, the method further includes:
[0023] An association relationship is added between the first virtual machine and the second local storage device in the second physical server.
[0024] In some possible implementations, after migrating the target data in the cloud storage device to the second local storage device, the method further includes:
[0025] Uninstall the cloud storage device in the first virtual machine.
[0026] In a second aspect, the present application provides a data migration device, the device comprising:
[0027] A mounting module, configured to mount a cloud storage device to a first virtual machine in response to a data migration request for a first local storage device used by the first virtual machine; wherein the first virtual machine runs on a first physical server;
[0028] A first migration module, used to migrate target data in the first local storage device to the cloud storage device;
[0029] A second migration module, used to migrate the first virtual machine to a second physical server, so that the first virtual machine runs on the second physical server and uses a second local storage device of the second physical server;
[0030] The third migration module is used to migrate the target data in the cloud storage device to the second local storage device.
[0031] In some possible implementations, the mounting module is specifically used to:
[0032] In response to a failure of a first virtual machine, determining a first local storage device used by the first virtual machine, and triggering a data migration request for the first local storage device;
[0033] Mount the cloud storage device to the first virtual machine.
[0034] In some possible implementations, the mounting module is specifically used to:
[0035] executing a query command line to obtain storage device information used by the first virtual machine, and determining a first local storage device used by the first virtual machine according to the storage device information; or,
[0036] A first local storage device used by the first virtual machine is determined according to the storage device information provided by the virtual machine management platform.
[0037] In some possible implementations, the second migration module is specifically configured to:
[0038] Modifying the affinity tag of the first virtual machine; wherein the modified affinity tag indicates that the first virtual machine runs on the second physical server;
[0039] Control the first virtual machine to restart.
[0040] In some possible implementations, the apparatus further includes an association module, wherein the association module is configured to:
[0041] Disassociate the first virtual machine from the first local storage device;
[0042] An association relationship is added between the first virtual machine and the second local storage device in the second physical server.
[0043] In some possible implementations, the device further includes an unloading module, and the unloading module is configured to:
[0044] Uninstall the cloud storage device in the first virtual machine.
[0045] In a third aspect, the present application provides an electronic device, the electronic device comprising a processor and a memory. The processor and the memory communicate with each other. The processor is used to execute instructions stored in the memory so that the electronic device performs the data migration method in the first aspect or any implementation of the first aspect.
[0046] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, wherein the instructions instruct an electronic device to execute the data migration method described in the first aspect or any one of the implementations of the first aspect.
[0047] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the data migration method described in the first aspect or any one of the implementations of the first aspect.
[0048] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations.
[0049] It can be seen from the above technical solutions that this application has the following advantages:
[0050] The present application provides a data migration method, which mounts a cloud storage device to the first virtual machine in response to a data migration request for a first local storage device used by a first virtual machine, wherein the first virtual machine runs on a first physical server, then migrates target data in the first local storage device to the cloud storage device, migrates the first virtual machine to a second physical server, so that the first virtual machine runs on the second physical server and uses a second local storage device of the second physical server, and then migrates the target data in the cloud storage device to the second local storage device.
[0051] In this method, for the data migration scenario in the local storage device of the virtual machine, the data is first migrated from the local storage device to the cloud storage device by mounting the cloud storage device in the virtual machine. After the virtual machine migration is completed, the data is then migrated from the cloud storage device to the local storage device of the new virtual machine. In this way, the cloud storage device is used as a transit for data migration, so that during the data migration process, the data is always retained in one virtual machine, and there is no need to create a new virtual machine or migrate data across virtual machines, thereby improving the efficiency of data migration. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required for use in the embodiments are briefly introduced below.
[0053] Figure 1 A schematic diagram of data migration provided in an embodiment of the present application;
[0054] Figure 2 A flowchart of a data migration method provided in an embodiment of the present application;
[0055] Figure 3 A schematic diagram of another data migration provided in an embodiment of the present application;
[0056] Figure 4 A schematic diagram of the structure of a data migration device provided in an embodiment of the present application;
[0057] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The terms "first" and "second" in the embodiments of the present application are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.
[0059] First, some technical terms involved in the embodiments of the present application are introduced.
[0060] A virtual machine (VM) is a computer system implemented by software and runs on a physical server (also called a physical machine or host machine) through virtualization technology. A virtual machine can simulate a complete computer hardware system, allowing the operating system and applications to run in a virtualized environment.
[0061] The virtualization platform can dynamically allocate resources of multiple physical servers in a computing cluster to different virtual machines, such as central processing unit (CPU), memory, network bandwidth, etc. Multiple virtual machines in the same computing cluster are independent of each other and do not interfere with each other, so that the virtual machines have good isolation and security.
[0062] Virtual machines can use local storage devices (also called local disks) or cloud storage devices (also called cloud disks) for data storage. Among them, cloud storage devices can be understood as block storage services, which are used to provide distributed storage services within the computing cluster in a centralized manner, and are usually used as system disks. Local storage devices can include different types of storage devices, such as storage performance development kit (SPDK) local disks, non-volatile memory express (NVMe) pass-through disks, hard disk drive (HDD) pass-through disks, logical volume manager (LVM) local disks, etc., which are usually used as data disks.
[0063] Local storage devices and cloud storage devices have different characteristics, as shown in Table 1.
[0064] As can be seen from Table 1, compared with cloud storage devices, local storage devices usually do not support hot migration. Among them, hot migration can be understood as the process of migrating a virtual machine from one physical server to another physical server without interrupting the operation of the virtual machine. Therefore, in the scenario of cold migration of data in the local storage device of the virtual machine, it is usually necessary to recreate the virtual machine and synchronize the data remotely to achieve cold migration. Among them, cold migration can be understood as the process of migrating a virtual machine from one physical server to another physical server under the premise of shutting down the virtual machine.
[0065] Table 1
[0066] SPDK HDD NVMe LVM Cloud Disk Data reliability Single copy Single copy Single copy Single copy Three copies performance high Low high Low middle cost Low Low Low Low high Disk Splitting support Not supported Not supported support support Speed limit according to specification support Not supported Not supported Not supported support Hot Migration Not supported Not supported Not supported Not supported support Observable support support none support support
[0067] like Figure 1 A schematic diagram of data migration is shown, in which virtual machine 1 is running on physical server 1 of a computing cluster. When data in a local storage device in virtual machine 1 needs to be migrated, virtual machine 2 needs to be created on physical server 2 of the same computing cluster, and the data in the local storage device in virtual machine 1 needs to be copied to the local storage device in virtual machine 2. Then virtual machine 1 is released to complete the data migration.
[0068] However, the above method requires re-creating and deleting the virtual machine, the data migration link is long, and the data copy between virtual machines requires obtaining user permissions, which is highly complex and has low data migration efficiency. In addition, the user originally only has one virtual machine, and the above method requires creating a second virtual machine for data migration. There is a scenario where two virtual machines coexist, which involves the cost issue of two virtual machines coexisting.
[0069] In view of this, the present application provides a data migration method. The method mounts a cloud storage device to the first virtual machine in response to a data migration request for a first local storage device used by a first virtual machine, wherein the first virtual machine runs on a first physical server, then migrates target data in the first local storage device to the cloud storage device, migrates the first virtual machine to a second physical server, so that the first virtual machine runs on the second physical server and uses a second local storage device of the second physical server, and then migrates the target data in the cloud storage device to the second local storage device.
[0070] In this method, for the data migration scenario in the local storage device of the virtual machine, the data is first migrated from the local storage device to the cloud storage device by mounting the cloud storage device in the virtual machine. After the virtual machine migration is completed, the data is then migrated from the cloud storage device to the local storage device of the new virtual machine. In this way, the cloud storage device is used as a transit for data migration, so that during the data migration process, the data is always retained in one virtual machine, and there is no need to create a new virtual machine or migrate data across virtual machines, thereby improving the efficiency of data migration.
[0071] To facilitate understanding of the technical solution provided by the embodiments of the present application, it will be described below with reference to the accompanying drawings.
[0072] See also Figure 2 The flowchart of a data migration method provided by an embodiment of the present application is shown. The method can be executed by a virtualization platform, and the virtualization platform can be deployed in a computing cluster. The method specifically includes:
[0073] S201: In response to a data migration request for a first local storage device used by a first virtual machine, mount a cloud storage device to the first virtual machine.
[0074] In the embodiment of the present application, the first virtual machine can be understood as a virtual machine currently being used by the user, and the first virtual machine can be run on the first physical server. In other words, the first virtual machine uses the resources of the first physical server. The first physical server provides a first local storage device, and the first virtual machine uses the first local storage device for data storage.
[0075] The data migration request may be understood as a request for migrating target data in the first local storage device. That is, the data migration request may request to migrate the target data in the first local storage device to another local storage device.
[0076] In some possible implementations, in response to a failure of the first virtual machine, a first local storage device used by the first virtual machine is determined, a data migration request for the first local storage device is triggered, and a cloud storage device is mounted to the first virtual machine.
[0077] That is, when the first virtual machine fails, the virtualization platform can automatically trigger a data migration request for the first local storage device used by the first virtual machine.
[0078] In some embodiments, the failure of the first virtual machine may be a failure that is unrelated to the target data in the first local storage device. In other words, the target data in the first local storage device is not lost due to the failure, and the user can normally access the target data in the first local storage device. For example, the failure of the first virtual machine may be a failure of the graphics processing unit (GPU) or other hardware of the first physical server. The first local storage device used by the first virtual machine is not affected, but the target data in the first local storage device needs to be migrated. At this time, the virtualization platform automatically triggers a data migration request for the first local storage device so that the failure can be handled later on the premise of ensuring data integrity.
[0079] In the embodiment of the present application, after a data migration request is generated, the cloud storage device can be mounted to the first virtual machine. In specific implementation, since the computing cluster where the first virtual machine is located can provide different types of resources, for example, the computing cluster can provide physical servers and cloud storage services, in response to the data migration request, the virtualization platform can apply for a cloud storage device from the cloud storage service provided by the computing cluster, and mount the cloud storage device to the first virtual machine, so that the first virtual machine can use the cloud storage device for data storage.
[0080] In specific implementation, the virtualization platform needs to determine the first local storage device used by the first virtual machine so as to subsequently migrate the target data in the first local storage device. In some embodiments, the virtualization platform can execute a query command line to obtain storage device information used by the first virtual machine, and determine the first local storage device used by the first virtual machine based on the storage device information.
[0081] That is to say, the virtualization platform can determine the first local storage device whose device attribute is a local storage device through storage device information. For example, the query command line can be the command line "get pvc" for querying persistent volume claim (PVC). If the storage device information is "local-disk", "spdk" or "lvm", it is determined to be the first local storage device. In this way, the first local storage device that needs to perform data migration is determined from the storage devices used by the first virtual machine.
[0082] In other embodiments, the virtualization platform may determine the first local storage device used by the first virtual machine based on the storage device information provided by the virtual machine management platform.
[0083] The virtual machine management platform can be understood as a platform for managing virtual machines. Users can create virtual machines, view information related to virtual machines, manage resources related to virtual machines, etc. in the virtual machine management platform. The virtual machine management platform can provide storage device information used by the virtual machine. The virtualization platform can determine the first local storage device that needs to perform data migration from the storage devices used by the first virtual machine based on the storage device information (for example, the specification field in the storage device information).
[0084] S202: Migrate target data in the first local storage device to the cloud storage device.
[0085] After the cloud storage device is mounted to the first virtual machine, the virtualization platform can migrate the target data in the first local storage device from the first local storage device to the cloud storage device.
[0086] Since both the first local storage device and the cloud storage device are storage devices inside the first virtual machine, the virtualization platform can achieve data migration by copying data. For example, when the first virtual machine uses the Linux operating system, the target data can be migrated from the first local storage device to the cloud storage device through the "cp" command line. For another example, when the first virtual machine uses the Windows operating system, the target data can be migrated from the first local storage device to the cloud storage device through the "copy" command and the "paste" command.
[0087] In an embodiment of the present application, by introducing a cloud storage device, the target data in the first local storage device is migrated to the cloud storage device. Since the first local storage device and the cloud storage device are both located inside the first virtual machine, the data migration can be completed without occupying public network traffic.
[0088] S203: Migrate the first virtual machine to the second physical server, so that the first virtual machine runs on the second physical server and uses a second local storage device of the second physical server.
[0089] After migrating the target data to the cloud storage device, the virtualization platform can migrate the first virtual machine from the first physical server to the second physical server, and use the second local storage device of the second physical server to complete the cold migration of the first virtual machine. The second physical server can be a physical server located in the same computing cluster as the first physical server.
[0090] During specific implementation, the virtualization platform may modify the affinity tag of the first virtual machine and control the first virtual machine to restart.
[0091] Among them, affinity labels are usually used to control the distribution of virtual machines on physical servers. Affinity labels can understand a set of key-value pairs to define affinity or anti-affinity rules between virtual machines to ensure high availability, load balancing and performance optimization of virtual machines.
[0092] In the embodiment of the present application, the modified affinity tag may indicate that the first virtual machine is running on the second physical server. In other words, the modified affinity tag may indicate that the first virtual machine has affinity with the second physical server. By modifying the affinity tag of the first virtual machine and controlling the first virtual machine to perform a cold restart, the first virtual machine may be migrated to the second physical server with affinity to run.
[0093] For example, the virtualization platform may execute the following code to modify the affinity tag so that the first virtual machine runs on the gpu03.yzmp physical server.
[0094] nodeSelector:object
[0095] nodeSelector:
[0096] kubernetes.io / hostname:gpu03.yzmp
[0097] In some embodiments, considering that the first virtual machine originally uses the first local storage device of the first physical server, before modifying the affinity tag of the first virtual machine, the virtualization platform may also remove the association between the first virtual machine and the first local storage device. Furthermore, after controlling the first virtual machine to restart, the virtualization platform may also add the association between the first virtual machine and the second local storage device in the second physical server.
[0098] That is to say, since the first virtual machine is bound to the first local storage device and has an association relationship, before migrating the first virtual machine to the second physical server, the virtualization platform needs to first delete the association relationship and release the binding between the first virtual machine and the first local storage device. After migrating the first virtual machine to the second physical server, the virtualization platform adds the association relationship between the first virtual machine and the second local storage device provided by the second physical server and binds the first virtual machine to the second local storage device. In this way, during the cold migration process of the first virtual machine, the local storage device associated with the first virtual machine is modified at the same time to ensure the normal operation of the first virtual machine after the cold migration.
[0099] S204: Migrate the target data in the cloud storage device to the second local storage device.
[0100] Since the first physical server and the second physical server are located in the same computing cluster, and the cloud storage device mounted in the first virtual machine is provided by the same computing cluster, after the first virtual machine is migrated to the second physical server for operation, the first virtual machine can still use the cloud storage device.
[0101] In the embodiment of the present application, the virtualization platform can migrate the target data in the cloud storage device to the second local storage device. Similarly, the virtualization platform can achieve data migration by copying data, such as by using the "cp" command line, "copy" command, and "paste" command.
[0102] In this method, for the data migration scenario in the local storage device of the virtual machine, the data is first migrated from the local storage device to the cloud storage device by mounting the cloud storage device in the virtual machine. After the virtual machine migration is completed, the data is then migrated from the cloud storage device to the local storage device of the new virtual machine. In this way, the cloud storage device is used as a transit for data migration, so that during the data migration process, the data is always retained in one virtual machine, and there is no need to create a new virtual machine or migrate data across virtual machines, thereby improving the efficiency of data migration.
[0103] The following is an explanation based on specific scenarios. Figure 3 , a virtual machine 1 is running on a physical server 1 of the computing cluster, and the virtual machine 1 uses a local storage device 1 provided by the physical server 1. In addition, the computing cluster also provides a distributed storage service.
[0104] When it is necessary to migrate the target data of the local storage device 1 in the virtual machine 1, the cloud storage device is mounted to the virtual machine 1 using distributed storage, and the target data is migrated from the local storage device 1 to the cloud storage device.
[0105] Next, virtual machine 1 is migrated to physical server 2 of the computing cluster for operation, and virtual machine 1 uses local storage device 2 in physical server 2 to migrate target data in the cloud storage device to local storage device 2, completes data migration, and releases virtual machine 1.
[0106] In the data migration method provided in the present application, there is no need to introduce a second virtual machine, and data cold migration can be completed using only one virtual machine. Moreover, in the process of migrating the target data from the first local storage device provided by the first physical server to the second local storage device provided by the second physical server, due to the existence of the cloud storage device, the target data is always retained in one virtual machine, and only the data migration within the virtual machine is involved, which can reduce the traffic across virtual machines. Even if the virtual machine is migrated from the first physical server to the second physical server, the target data and the virtual machine always have a stable corresponding relationship.
[0107] Moreover, before and after data migration, only the local storage device changes, and the virtual machine configuration information such as the virtual machine instance identification (identity, ID), Internet protocol (internet protocol, IP) address, etc. remains unchanged, so there is no need to reconfigure the virtual machine, reducing data migration costs.
[0108] Combination of the above Figures 1 to 3 The data migration method provided in the embodiment of the present application is introduced in detail. The device and equipment provided in the embodiment of the present application will be introduced in conjunction with the accompanying drawings.
[0109] See also Figure 4 The structural diagram of the data migration device shown in FIG. 40 includes:
[0110] The mounting module 401 is used to mount the cloud storage device to the first virtual machine in response to a data migration request for the first local storage device used by the first virtual machine; wherein the first virtual machine runs on the first physical server;
[0111] A first migration module 402, configured to migrate target data in the first local storage device to the cloud storage device;
[0112] A second migration module 403, configured to migrate the first virtual machine to a second physical server, so that the first virtual machine runs on the second physical server and uses a second local storage device of the second physical server;
[0113] The third migration module 404 is used to migrate the target data in the cloud storage device to the second local storage device.
[0114] In some possible implementations, the mounting module 401 is specifically used to:
[0115] In response to a failure of a first virtual machine, determining a first local storage device used by the first virtual machine, and triggering a data migration request for the first local storage device;
[0116] Mount the cloud storage device to the first virtual machine.
[0117] In some possible implementations, the mounting module 401 is specifically used to:
[0118] executing a query command line to obtain storage device information used by the first virtual machine, and determining a first local storage device used by the first virtual machine according to the storage device information; or,
[0119] A first local storage device used by the first virtual machine is determined according to the storage device information provided by the virtual machine management platform.
[0120] In some possible implementations, the second migration module 403 is specifically configured to:
[0121] Modifying the affinity tag of the first virtual machine; wherein the modified affinity tag indicates that the first virtual machine runs on the second physical server;
[0122] Control the first virtual machine to restart.
[0123] In some possible implementations, the apparatus further includes an association module, wherein the association module is configured to:
[0124] Disassociate the first virtual machine from the first local storage device;
[0125] An association relationship is added between the first virtual machine and the second local storage device in the second physical server.
[0126] In some possible implementations, the device further includes an unloading module, and the unloading module is configured to:
[0127] Uninstall the cloud storage device in the first virtual machine.
[0128] The data migration device 40 according to the embodiment of the present application may correspond to executing the method described in the embodiment of the present application, and the above and other operations and / or functions of each module / unit of the data migration device 40 are respectively to implement Figure 2 For the sake of brevity, the corresponding processes of each method in the illustrated embodiment are not described in detail here.
[0129] The present application also provides an electronic device. The electronic device is specifically used to implement Figure 4 The function of the data migration device 40 in the illustrated embodiment.
[0130] Figure 5 A schematic diagram of the structure of an electronic device 500 is provided. Figure 5 As shown, the electronic device 500 includes a bus 501, a processor 502, a communication interface 503 and a memory 504. The processor 502, the memory 504 and the communication interface 503 communicate with each other via the bus 501.
[0131] The bus 501 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0132] The processor 502 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0133] The communication interface 503 is used for communicating with the outside. For example, the communication interface 503 can be used for communicating with a terminal.
[0134] The memory 504 may include a volatile memory, such as a random access memory (RAM). The memory 504 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0135] The memory 504 stores executable codes, and the processor 502 executes the executable codes to perform the aforementioned data migration method.
[0136] Specifically, in implementing Figure 4In the case of the embodiment shown, and Figure 4 When each module or unit of the data migration device 40 described in the embodiment is implemented by software, the execution Figure 4 The software or program code required for the functions of each module / unit in the system may be partially or completely stored in the memory 504. The processor 502 executes the program code corresponding to each unit stored in the memory 504 to perform the aforementioned data migration method.
[0137] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the data migration method applied to the data migration device 40.
[0138] The embodiment of the present application further provides a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part.
[0139] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0140] When the computer program product is executed by a computer, the computer executes any of the aforementioned data migration methods. The computer program product may be a software installation package, and when any of the aforementioned data migration methods is needed, the computer program product may be downloaded and executed on a computer.
[0141] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to each embodiment of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0142] The units involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the unit / module does not, in some cases, constitute a limitation on the unit itself.
[0143] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0144] In the context of the present application embodiment, machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable medium can include but is not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0145] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0146] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0147] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0148] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0149] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. 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 application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data migration method, characterized in that: The method comprises: In response to a data migration request for a first local storage device used by a first virtual machine, mounting a cloud storage device to the first virtual machine; wherein the first virtual machine runs on a first physical server; Migrating target data in the first local storage device to the cloud storage device; Migrating the first virtual machine to a second physical server, so that the first virtual machine runs on the second physical server and uses a second local storage device of the second physical server; Migrate the target data in the cloud storage device to the second local storage device.
2. The method according to claim 1, characterized in that The step of mounting the cloud storage device to the first virtual machine in response to a data migration request for the first local storage device used by the first virtual machine includes: In response to a failure of a first virtual machine, determining a first local storage device used by the first virtual machine, and triggering a data migration request for the first local storage device; Mount the cloud storage device to the first virtual machine.
3. The method according to claim 2, characterized in that The determining the first local storage device used by the first virtual machine includes: executing a query command line to obtain storage device information used by the first virtual machine, and determining a first local storage device used by the first virtual machine according to the storage device information; or, A first local storage device used by the first virtual machine is determined according to the storage device information provided by the virtual machine management platform.
4. The method according to claim 1, characterized in that The migrating the first virtual machine to the second physical server includes: Modifying the affinity tag of the first virtual machine; wherein the modified affinity tag indicates that the first virtual machine runs on the second physical server; Control the first virtual machine to restart.
5. The method according to claim 4, characterized in that Before modifying the affinity tag of the first virtual machine, the method further includes: Disassociate the first virtual machine from the first local storage device; After controlling the first virtual machine to restart, the method further includes: An association relationship is added between the first virtual machine and the second local storage device in the second physical server.
6. The method according to claim 1, characterized in that After migrating the target data in the cloud storage device to the second local storage device, the method further includes: Uninstall the cloud storage device in the first virtual machine.
7. A data migration device, characterized in that: The device comprises: A mounting module, configured to mount a cloud storage device to a first virtual machine in response to a data migration request for a first local storage device used by the first virtual machine; wherein the first virtual machine runs on a first physical server; A first migration module, used to migrate target data in the first local storage device to the cloud storage device; A second migration module, used to migrate the first virtual machine to a second physical server, so that the first virtual machine runs on the second physical server and uses a second local storage device of the second physical server; The third migration module is used to migrate the target data in the cloud storage device to the second local storage device.
8. An electronic device, characterized in that: The electronic device comprises a processor and a memory; The processor is configured to execute instructions stored in the memory, so that the electronic device executes the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The method comprises instructions, wherein the instructions instruct an electronic device to execute the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product comprises computer readable instructions for implementing the method according to any one of claims 1 to 6.
