Data copying method, device and equipment and computer readable storage medium
By uploading disk snapshots of local virtual machines to the object storage node and creating cloud disks in the cloud environment of the target virtual machine, copying disk snapshots from the object storage node to the cloud disk, the user needs to manually mount and uninstall The problem of cloud disk achieves an efficient and stable data copying process.
Patent Information
- Application Number
- CN202411497684.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, users need to manually mount and uninstall cloud disks, resulting in cumbersome operation steps, time-consuming, and risk of data corruption or loss.
Copy the data by uploading the disk snapshot of the local virtual machine to the object storage node and creating a cloud disk in the cloud environment of the target virtual machine, copying the disk snapshot from the object storage node to the cloud disk without the user's manual Mount the cloud disk.
It realizes efficiently copying the data of the local virtual machine to the cloud disk of the target virtual machine without the need for user manual mount of the cloud disk, reducing the risk of data corruption or loss caused by operational errors and improving the flexibility of data copying. and stability.
Smart Images

Figure CN119440410A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of cloud computing, and in particular to a data copy method, device, equipment, and computer-readable storage medium. Background Art
[0002] Cloud disk is a professional Internet storage tool. Users can mount cloud disk to virtual machines and use it as storage resources for virtual machines.
[0003] Normally, if you need to copy data from a local virtual machine to the cloud disk of another virtual machine, you need to mount the cloud disk to the local virtual machine and then unmount the cloud disk after the data copy is complete.
[0004] However, this method requires customers to manually mount the cloud disk of another virtual machine to the local virtual machine and then perform the data copy operation. This manual operation has many steps and takes a long time, which is very inconvenient for users. In addition, during the process of manually mounting and copying data, operational errors (such as incorrect mounting, data loss, incorrect permission settings, etc.) may cause data damage or loss, increasing operational risks. Summary of the invention
[0005] In order to solve the above technical problems, the present disclosure provides a data copy method, device, equipment and computer-readable storage medium to improve the flexibility and stability of the data copy method.
[0006] In a first aspect, an embodiment of the present disclosure provides a data copy method, including:
[0007] Upload the disk snapshot of the local virtual machine to the object storage node;
[0008] Create a cloud disk in the cloud environment of the target virtual machine;
[0009] The disk snapshot in the object storage node is copied to the cloud disk, so that the cloud disk is restored according to the disk snapshot to obtain a target cloud disk including the data in the local virtual machine.
[0010] In some embodiments, the method further comprises:
[0011] Determine the last time the disk snapshot was copied according to the copy information of the disk snapshot in the object storage node;
[0012] If the time difference between the last copied time point and the current time point exceeds a preset time threshold, the disk snapshot is recycled.
[0013] In some embodiments, the object storage node includes a plurality of storage subnodes, and uploading the disk snapshot of the local virtual machine to the object storage node includes:
[0014] Dividing the disk snapshot into a plurality of snapshot data blocks;
[0015] The plurality of snapshot data blocks are stored in the plurality of storage sub-nodes respectively.
[0016] In some embodiments, copying the disk snapshot in the object storage node to the cloud disk includes:
[0017] The snapshot data blocks in each of the storage subnodes are concurrently copied to the cloud disk.
[0018] In some embodiments, the method further comprises:
[0019] The cloud disk is mounted to the target virtual machine so that a user of the target virtual machine can access data in the target cloud disk.
[0020] In some embodiments, creating a cloud disk in the cloud environment of the target virtual machine includes:
[0021] Determining the size of the disk snapshot;
[0022] A cloud disk is created, where the size of the cloud disk is greater than or equal to the size of the disk snapshot.
[0023] In a second aspect, an embodiment of the present disclosure provides a data copying device, including:
[0024] The upload module is used to upload the disk snapshot of the local virtual machine to the object storage node;
[0025] A creation module, used to create a cloud disk in the cloud environment of the target virtual machine;
[0026] The copy module is used to copy the disk snapshot in the object storage node to the cloud disk, so that the cloud disk is restored according to the disk snapshot to obtain a target cloud disk including the data in the local virtual machine.
[0027] In some embodiments, the device further comprises a recovery module for:
[0028] Determine the last time the disk snapshot was copied according to the copy information of the disk snapshot in the object storage node;
[0029] If the time difference between the last copied time point and the current time point exceeds a preset time threshold, the disk snapshot is recycled.
[0030] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
[0031] Memory;
[0032] Processor; and
[0033] Computer programs;
[0034] The computer program is stored in the memory and is configured to be executed by the processor to implement the method as described in the first aspect.
[0035] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the method described in the first aspect.
[0036] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the data copy method as described above is implemented.
[0037] The data copy method, apparatus, device and computer-readable storage medium provided by the embodiments of the present disclosure utilize object storage nodes to store disk snapshots of local virtual machines, and download the disk snapshots of local virtual machines to the cloud disk of target virtual machines, thereby copying the data of local virtual machines to the cloud disk of another virtual machine without the need for users to manually mount and unmount the cloud disk, thereby avoiding the risk of data damage or loss caused by operational errors and improving the flexibility and stability of the data copy method. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0040] Figure 1 A flow chart of a data copy method provided by an embodiment of the present disclosure;
[0041] Figure 2 A schematic diagram of an application scenario provided by an embodiment of the present disclosure;
[0042] Figure 3 A flow chart of a data copy method provided by another embodiment of the present disclosure;
[0043] Figure 4 A schematic diagram of the structure of a data copying device provided in an embodiment of the present disclosure;
[0044] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0045] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0046] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0047] In the existing data copying method, the local virtual machine data can be copied to another virtual machine cloud disk. Currently, it can only be achieved by mounting the cloud disk of another virtual machine to the local virtual machine, manually copying the data and then unmounting the cloud disk. This manual operation has many steps and is time-consuming, which is very inconvenient for users. In the process of manually mounting and copying data, operational errors may cause data damage or loss, increasing operational risks.
[0048] If you want to copy the data in cloud disk A to cloud disk B, since they are the same storage medium, you can create a snapshot of cloud disk A and store it in the distributed storage node. When you create the target cloud disk B and call the distributed storage copy interface, you can directly copy the snapshot data of cloud disk A to cloud disk B. However, this method can only be used for copying the same storage medium, and cannot achieve cross-storage medium copying from a virtual machine to another virtual machine cloud disk.
[0049] Another method is to store the snapshot data in the local storage server, that is, to store the snapshot data of the local virtual machine A directly in the storage space of the physical machine node where the local virtual machine A is located. When you want to copy the data of the local virtual machine A to the cloud disk B, you need to distribute the snapshot data of the physical machine node where the local virtual machine A is located to the physical machine node where the cloud disk B is located, and then write the data to the cloud disk B. However, since the physical machine is a single-point server, if the server goes down, the snapshot data will be lost, and when you need to copy it in batches from the physical machine node, it will form an energy bottleneck. Furthermore, because the physical machine where the local virtual machine is located uses a computing node on the cloud platform, and the cloud platform storage space needs to be used when creating virtual machines, if a large number of snapshots occupy the cloud platform storage space, it will lead to a reduction in the number of virtual machines that customers can create, which is not worth the loss.
[0050] In view of the above problems, the present disclosure provides a data copy method, which is described below in conjunction with a specific embodiment.
[0051] Figure 1 The data copy method flow chart provided in the embodiment of the present disclosure. The method can be applied to Figure 2 The application scenario shown includes a local virtual machine 21, an object storage node 22, a cloud disk 23, and a target virtual machine 24. It can be understood that the data copy method provided in the embodiment of the present disclosure can also be applied in other scenarios.
[0052] Combine the following Figure 2 The application scenario shown is Figure 1 The data copy method shown in the figure is introduced, and the specific steps of the method are as follows:
[0053] S101: Upload a disk snapshot of a local virtual machine to an object storage node.
[0054] A disk snapshot is a copy or image of a virtual machine disk file at a certain point in time. This copy or image retains the state of the disk file and system memory at that point in time.
[0055] An object storage node is a physical or logical unit in a distributed storage system that is used to store and manage user data objects. It can provide object-level storage services and support users to upload, download, and manage data objects.
[0056] The disk snapshot of the local virtual machine is uploaded to the object storage node through the object storage service application programming interface (Application Programming Interface, API) of the object storage node.
[0057] S102: Create a cloud disk in the cloud environment of the target virtual machine.
[0058] The target virtual machine is different from the local virtual machine, and data cannot be copied directly between the two.
[0059] Cloud environment refers to the integration of dynamically virtualized computing resources and applications into a resource pool to serve users' big data or Internet service environment. Virtual machines are an important part of it. They simulate independent computing environments through software to host and run various applications.
[0060] When a disk snapshot in an object storage node needs to be copied, a cloud disk is created in the cloud environment of the target virtual machine.
[0061] Specifically, first determine the size of the disk snapshot; create a cloud disk, the size of the cloud disk is greater than or equal to the size of the disk snapshot, to ensure that the cloud disk can completely obtain the disk snapshot.
[0062] S103: Copy the disk snapshot in the object storage node to the cloud disk, so that the cloud disk is restored according to the disk snapshot to obtain a target cloud disk including the data in the local virtual machine.
[0063] The cloud environment also includes cloud servers, which are based on a group of high-performance physical servers, also known as hosts or hosts. These servers are usually located in data centers and provide computing resources and storage capacity. On the cloud server, the previously uploaded disk snapshot is downloaded from the object storage node, and the downloaded disk snapshot is written to the cloud disk, so that the cloud disk is restored to the corresponding disk state based on the disk snapshot to obtain the target cloud disk.
[0064] At this point, the target cloud disk and the local virtual machine disk corresponding to the disk snapshot have the same disk status, and the data in the target cloud disk is the same as the files in the local virtual machine data, that is, the process of copying the files in the local virtual machine disk to the target cloud disk is completed.
[0065] The disclosed embodiment uploads a disk snapshot of a local virtual machine to an object storage node; creates a cloud disk in a cloud environment of a target virtual machine; copies the disk snapshot in the object storage node to the cloud disk so that the cloud disk is restored according to the disk snapshot to obtain a target cloud disk including data in the local virtual machine, uses the object storage node to store the disk snapshot of the local virtual machine, and downloads the disk snapshot of the local virtual machine to the cloud disk of the target virtual machine, thereby copying the data of the local virtual machine to the cloud disk of another virtual machine without the need for the user to manually mount and unmount the cloud disk, thereby avoiding the risk of data damage or loss caused by operational errors and improving the flexibility and stability of the data copying method.
[0066] In addition, the embodiments of the present disclosure can improve the reliability of data storage by using object storage nodes, without having to worry about data loss due to single point failures.
[0067] Based on the above embodiment, the method further includes: mounting the cloud disk to the target virtual machine, so that a user of the target virtual machine can access data in the target cloud disk.
[0068] In the virtual machine management tool, you can mount the created cloud disk to the target virtual machine, and the user can access the data in the target virtual machine. This is equivalent to the user being able to access the data in the local virtual machine through the target virtual machine.
[0069] In the prior art, if the user of the target virtual machine wants to access the data in the local virtual machine, it is necessary to unmount the cloud disk of the target virtual machine and then mount it to the local virtual machine to copy the data. After the data copy is completed, the cloud disk is unmounted from the local virtual machine and mounted to the target virtual machine to achieve data access needs. The whole process requires at least two operations of mounting and unmounting the cloud disk. However, through the data copy method provided by the embodiment of the present disclosure, it is only necessary to mount the cloud disk once to achieve data access needs, which greatly simplifies the data access process and user operations, and also avoids the operational risks of each cloud disk mounting and unmounting as much as possible.
[0070] Based on the above embodiment, the method also includes: determining the last time the disk snapshot was copied based on the copy information of the disk snapshot in the object storage node; if the time difference between the last time the disk snapshot was copied and the current time point exceeds a preset time threshold, the disk snapshot is recycled.
[0071] The storage space in the object storage node requires the enterprise to bear the corresponding capital cost, so the embodiment of the present disclosure recycles the cold snapshots in the object storage node to save the storage space in the object storage node, thereby saving the storage cost of the enterprise.
[0072] Specifically, the object storage node may store disk snapshots corresponding to different virtual machine disks for copying to the cloud disk. The cloud disk usually copies the corresponding disk snapshot when the user needs to access the specified data. Therefore, when the disk snapshot in the object storage node has not been obtained for a long time, it means that the disk snapshot has a low utilization rate and is a cold snapshot.
[0073] Configure the cold snapshot recovery logic in the object storage node, regularly obtain the last copy time point of each disk snapshot in the object storage node, and determine whether the time difference between the last copy time point and the current time point exceeds the preset time threshold.
[0074] For each disk snapshot in the object storage node, if the time difference between the last copy time point and the current time point exceeds the preset threshold, it means that the disk snapshot has not been copied for a long time and the usage rate is low. In this case, the disk snapshot will be recycled to release the storage space occupied by the disk snapshot in the object storage node.
[0075] Alternatively, if the time difference between the last copy time point and the current time point does not exceed the preset threshold, it means that the usage frequency of the disk snapshot is still within a normal range, and the disk snapshot is still stored normally.
[0076] Optionally, the last copy time point of each disk snapshot in each object storage node is monitored in real time. When the time difference between the last copy time point of any disk snapshot and the current time point exceeds a preset time threshold, the disk snapshot is recycled as a cold snapshot.
[0077] The embodiment of the present disclosure periodically recycles cold snapshots in object storage nodes to avoid excessive occupation of storage space in object storage nodes by cold snapshots, thereby reducing waste of storage space.
[0078] In other embodiments, the object storage node includes multiple storage sub-nodes. Figure 3 A flow chart of a data copy method provided by another embodiment of the present disclosure is shown in FIG. Figure 3 As shown, the method includes the following steps:
[0079] S301: Divide the disk snapshot into multiple snapshot data blocks.
[0080] Optionally, the number of the storage subnodes is greater than or equal to the number of the snapshot data blocks.
[0081] S302: Store the plurality of snapshot data blocks in the plurality of storage subnodes respectively.
[0082] The object storage node includes multiple storage sub-nodes, each of which can store data separately.
[0083] A disk snapshot is essentially a type of data, which is divided into multiple snapshot data blocks using a data partitioning method. Each snapshot data block is stored in a different storage subnode, wherein each storage subnode can perform the storage process of the snapshot data block simultaneously.
[0084] For example, if the number of storage subnodes is consistent with the number of snapshot data blocks, each storage subnode can store a snapshot data block respectively, and the storage processes of different storage subnodes are performed simultaneously.
[0085] Optionally, this step is equivalent to assigning different storage tasks to each storage subnode, and different storage tasks correspond to different snapshot data blocks, so that the object storage node can concurrently store disk snapshots.
[0086] S303: Create a cloud disk in the cloud environment of the target virtual machine.
[0087] Specifically, the implementation process and principle of S303 and S102 are the same, and will not be repeated here.
[0088] S304: Concurrently copy the snapshot data blocks in each of the storage subnodes to the cloud disk, so that the cloud disk is restored according to the disk snapshot to obtain a target cloud disk including the data in the local virtual machine.
[0089] Each storage subnode is relatively independent, so the object storage node can provide concurrent download services for different storage subnodes.
[0090] Specifically, on the cloud server, multiple snapshot data blocks are downloaded concurrently from different storage subnodes to finally obtain a complete disk snapshot, and the disk snapshot is written to the cloud disk, so that the cloud disk is restored to the corresponding disk state based on the disk snapshot to obtain the target cloud disk.
[0091] S305: Mount the cloud disk to the target virtual machine so that a user of the target virtual machine can access data in the target cloud disk.
[0092] Specifically, in the virtual machine management tool, the created cloud disk can be mounted to the target virtual machine, and the user can access the data in the target virtual machine. This is equivalent to the user being able to access the data in the local virtual machine through the target virtual machine.
[0093] The disclosed embodiment divides the disk snapshot into multiple snapshot data blocks when uploading the disk snapshot, and stores the multiple snapshot data blocks in the multiple storage sub-nodes respectively; and concurrently copies the snapshot data blocks in each storage sub-node to the cloud disk when downloading the disk, thereby achieving high-concurrency data access of the object storage node, solving the performance bottleneck problem of the single-point server, and further improving the efficiency of data copying and access.
[0094] Figure 4 The data copying device provided by the embodiment of the present disclosure can execute the processing flow provided by the data copying method embodiment, such as Figure 4 As shown, the data copying device 40 includes: an upload module 41, a creation module 42, and a copy module 43. The upload module 41 is used to upload the disk snapshot of the local virtual machine to the object storage node; the creation module 42 is used to create a cloud disk in the cloud environment of the target virtual machine; the copy module 43 is used to copy the disk snapshot in the object storage node to the cloud disk, so that the cloud disk is restored according to the disk snapshot to obtain the target cloud disk including the data in the local virtual machine.
[0095] Optionally, the data copying device 40 also includes a recycling module 44, which is used to determine the last copied time point of the disk snapshot based on the copy information of the disk snapshot in the object storage node; if the time difference between the last copied time point and the current time point exceeds a preset time threshold, the disk snapshot is recycled.
[0096] Optionally, the object storage node includes multiple storage sub-nodes, and the upload module 41 includes a partitioning unit 411 and a storage unit 412; the partitioning unit 411 is used to partition the disk snapshot into multiple snapshot data blocks; the storage unit 412 is used to store the multiple snapshot data blocks in the multiple storage sub-nodes respectively.
[0097] Optionally, the copy module 43 is used to concurrently copy the snapshot data block in each of the storage subnodes to the cloud disk.
[0098] Optionally, the data copying device 40 further includes a mounting module 45, which is used to mount the cloud disk to the target virtual machine, so that a user of the target virtual machine can access the data in the target cloud disk.
[0099] Optionally, the creation module 42 is used to determine the size of the disk snapshot; create a cloud disk, and the size of the cloud disk is greater than or equal to the size of the disk snapshot.
[0100] Figure 4 The data copying device of the illustrated embodiment can be used to execute the technical solution of the above-mentioned method embodiment. Its implementation principle and technical effect are similar and will not be described in detail here.
[0101] Figure 5 The electronic device provided by the embodiment of the present disclosure can execute the processing flow provided by the data copy method embodiment, such as Figure 5 As shown, the electronic device 50 includes: a memory 51, a processor 52, a computer program and a communication interface 53; wherein the computer program is stored in the memory 51 and is configured so that the processor 52 executes the data copy method as described above.
[0102] Specifically, the processor implements the following steps when executing the computer program: uploading a disk snapshot of a local virtual machine to an object storage node; creating a cloud disk in a cloud environment of a target virtual machine; and copying the disk snapshot in the object storage node to the cloud disk, so that the cloud disk is restored according to the disk snapshot to obtain a target cloud disk including data in the local virtual machine.
[0103] In one embodiment, when the processor executes the computer program, the following steps are also implemented: based on the copy information of the disk snapshot in the object storage node, the time point when the disk snapshot was last copied is determined; if the time difference between the last copy time point and the current time point exceeds a preset time threshold, the disk snapshot is recycled.
[0104] In one embodiment, the processor further implements the following steps when executing the computer program: the object storage node includes multiple storage sub-nodes, and uploading the disk snapshot of the local virtual machine to the object storage node includes: dividing the disk snapshot into multiple snapshot data blocks; and storing the multiple snapshot data blocks in the multiple storage sub-nodes respectively.
[0105] In one embodiment, when the processor executes the computer program, the following steps are also implemented: copying the disk snapshot in the object storage node to the cloud disk includes: concurrently copying the snapshot data blocks in each of the storage subnodes to the cloud disk.
[0106] In one embodiment, when the processor executes the computer program, the following steps are further implemented: mounting the cloud disk to the target virtual machine so that a user of the target virtual machine can access data in the target cloud disk.
[0107] In one embodiment, when the processor executes the computer program, the following steps are also implemented: creating a cloud disk in the cloud environment of the target virtual machine includes: determining the size of the disk snapshot; creating a cloud disk, the size of the cloud disk is greater than or equal to the size of the disk snapshot.
[0108] In addition, an embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. The computer program is executed by a processor to implement the data copy method described in the above embodiment.
[0109] The computer program implements the following steps when executed by a processor: uploading a disk snapshot of a local virtual machine to an object storage node; creating a cloud disk in a cloud environment of a target virtual machine; and copying the disk snapshot in the object storage node to the cloud disk, so that the cloud disk is restored according to the disk snapshot to obtain a target cloud disk including data in the local virtual machine.
[0110] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the copy information of the disk snapshot in the object storage node, the time point when the disk snapshot was last copied is determined; if the time difference between the last copy time point and the current time point exceeds a preset time threshold, the disk snapshot is recycled.
[0111] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the object storage node includes multiple storage sub-nodes, and uploading the disk snapshot of the local virtual machine to the object storage node includes: dividing the disk snapshot into multiple snapshot data blocks; and storing the multiple snapshot data blocks in the multiple storage sub-nodes respectively.
[0112] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: copying the disk snapshot in the object storage node to the cloud disk includes: concurrently copying the snapshot data blocks in each of the storage subnodes to the cloud disk.
[0113] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: mounting the cloud disk to the target virtual machine so that a user of the target virtual machine can access data in the target cloud disk.
[0114] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: creating a cloud disk in the cloud environment of the target virtual machine includes: determining the size of the disk snapshot; creating a cloud disk, the size of the cloud disk being greater than or equal to the size of the disk snapshot.
[0115] In addition, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the data copy method as described above is implemented.
[0116] The computer program or instruction implements the following steps when executed by the processor: uploading a disk snapshot of a local virtual machine to an object storage node; creating a cloud disk in a cloud environment of a target virtual machine; and copying the disk snapshot in the object storage node to the cloud disk, so that the cloud disk is restored according to the disk snapshot to obtain a target cloud disk including data in the local virtual machine.
[0117] In one embodiment, when the computer program or instruction is executed by the processor, the following steps are implemented: based on the copy information of the disk snapshot in the object storage node, determine the time point when the disk snapshot was last copied; if the time difference between the last copy time point and the current time point exceeds a preset time threshold, the disk snapshot is recycled.
[0118] In one embodiment, when a computer program or instruction is executed by a processor, the following steps are implemented: the object storage node includes multiple storage sub-nodes, and uploading the disk snapshot of the local virtual machine to the object storage node includes: dividing the disk snapshot into multiple snapshot data blocks; and storing the multiple snapshot data blocks in the multiple storage sub-nodes respectively.
[0119] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: copying the disk snapshot in the object storage node to the cloud disk includes: concurrently copying the snapshot data blocks in each of the storage subnodes to the cloud disk.
[0120] In one embodiment, when the computer program or instruction is executed by the processor, the following steps are implemented: mounting the cloud disk to the target virtual machine so that a user of the target virtual machine can access data in the target cloud disk.
[0121] In one embodiment, when a computer program or instruction is executed by a processor, the following steps are implemented: creating a cloud disk in a cloud environment of a target virtual machine includes: determining the size of the disk snapshot; creating a cloud disk, the size of the cloud disk being greater than or equal to the size of the disk snapshot.
[0122] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0123] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0124] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
[0125] It should be noted that, in this article, relational terms such as "first" and "second" 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 existence of other identical elements in the process, method, article or device including the elements.
[0126] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. 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 disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data copy method, characterized in that: The method comprises: Upload the disk snapshot of the local virtual machine to the object storage node; Create a cloud disk in the cloud environment of the target virtual machine; The disk snapshot in the object storage node is copied to the cloud disk, so that the cloud disk is restored according to the disk snapshot to obtain a target cloud disk including the data in the local virtual machine.
2. The method according to claim 1, characterized in that The method further comprises: Determine the last time the disk snapshot was copied according to the copy information of the disk snapshot in the object storage node; If the time difference between the last copied time point and the current time point exceeds a preset time threshold, the disk snapshot is recycled.
3. The method according to claim 1, characterized in that The object storage node includes a plurality of storage subnodes, and uploading the disk snapshot of the local virtual machine to the object storage node includes: Dividing the disk snapshot into a plurality of snapshot data blocks; The plurality of snapshot data blocks are stored in the plurality of storage sub-nodes respectively.
4. The method according to claim 3, characterized in that The step of copying the disk snapshot in the object storage node to the cloud disk includes: The snapshot data blocks in each of the storage subnodes are concurrently copied to the cloud disk.
5. The method according to claim 1, characterized in that The method further comprises: The cloud disk is mounted to the target virtual machine so that a user of the target virtual machine can access data in the target cloud disk.
6. The method according to claim 1, characterized in that The step of creating a cloud disk in the cloud environment of the target virtual machine includes: Determining the size of the disk snapshot; A cloud disk is created, where the size of the cloud disk is greater than or equal to the size of the disk snapshot.
7. A data copying device, characterized in that: include: The upload module is used to upload the disk snapshot of the local virtual machine to the object storage node; A creation module, used to create a cloud disk in the cloud environment of the target virtual machine; The copy module is used to copy the disk snapshot in the object storage node to the cloud disk, so that the cloud disk is restored according to the disk snapshot to obtain a target cloud disk including the data in the local virtual machine.
8. The device according to claim 7, characterized in that The device also includes a recovery module, which is used to: Determine the last time the disk snapshot was copied according to the copy information of the disk snapshot in the object storage node; If the time difference between the last copied time point and the current time point exceeds a preset time threshold, the disk snapshot is recycled.
9. An electronic device, characterized in that: include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.