Cloud disk cloning method and device and electronic equipment

By utilizing snapshot chains and delayed loading technology in the elastic container instance service, the problem of low cloud disk cloning efficiency is solved, a more efficient cloud disk cloning process is achieved, and object storage bandwidth occupation and delay are avoided.

CN120723536APending Publication Date: 2025-09-30HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410362472.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-27
Publication Date
2025-09-30

AI Technical Summary

Technical Problem

In the Elastic Container Instance service, when cloning a VM or container cloud disk based on full snapshot data, the cloud disk cloning efficiency is low due to the limited bandwidth for accessing object storage within the region.

Method used

By receiving the cloud disk cloning request from the instance management service, the target block storage cluster is determined, the target snapshot chain to which the snapshot ID belongs is obtained, the target cloud disk is created based on the snapshot chain, and the data blocks are imported using a lazy loading method. This avoids downloading the full data from the object storage and only downloads the snapshot copy uniquely within the region.

Benefits of technology

It improves the efficiency of cloud disk cloning, avoids bandwidth exhaustion and data access delays, reduces competition for object storage bandwidth, and achieves more efficient cloud disk cloning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120723536A_ABST
    Figure CN120723536A_ABST
Patent Text Reader

Abstract

The invention discloses a cloud disk cloning method and device and electronic equipment. The method relates to the technical field of cloud computing, and comprises the following steps: receiving a cloud disk cloning request initiated by an instance control service, and determining a target block storage cluster to process the cloud disk cloning request; obtaining a target snapshot chain to which the snapshot ID belongs according to the target block storage cluster, and creating a target cloud disk based on the target snapshot chain; returning cloud disk creation success information to the instance management and control service to indicate the instance management and control service to mount the target cloud disk to the instance; and processing the data reading request according to the target block storage cluster so as to import a target data block requested by the data reading request into a target cloud disk. The technical problem that cloud disk cloning efficiency is low when virtual machine or container cloud disk cloning is carried out based on full-amount snapshot data in the related technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and more specifically, to a cloud disk cloning method, device, and electronic device. Background Art

[0002] With the continuous evolution of container and serverless technologies, elastic computing, as a key component of cloud computing, is also booming. Currently, in Elastic Container Instance (ECI) service applications, users have a need for batch cloud disk cloning. Related technologies for cloning virtual machines or container cloud disks rely on full snapshot data, for example, downloading full snapshot data from Object Storage Service (OSS) to a local cluster. However, due to the limited bandwidth and latency of accessing OSS within the entire region, cloud disk cloning efficiency is low.

[0003] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0004] The embodiments of the present application provide a cloud disk cloning method, device, and electronic device to at least solve the technical problem in the related art of low cloud disk cloning efficiency when cloning a virtual machine or container cloud disk based on full snapshot data.

[0005] According to one aspect of an embodiment of the present application, a cloud disk cloning method is provided, comprising: receiving a cloud disk cloning request initiated by an instance management service, and determining a target block storage cluster to process the cloud disk cloning request, wherein the cloud disk cloning request includes at least a snapshot ID of a cloud disk snapshot used for cloning; obtaining a target snapshot chain to which the snapshot ID belongs based on the target block storage cluster, and creating a target cloud disk based on the target snapshot chain, wherein the target snapshot chain is used to represent a parent-child relationship between the cloud disk snapshot corresponding to the snapshot ID and the cloud disk snapshots corresponding to other snapshot IDs in the target snapshot chain; returning cloud disk creation success information to the instance management service to instruct the instance management service to mount the target cloud disk to the instance, wherein the instance is used to initiate a data read request to the target block storage cluster where the target cloud disk is located after detecting the target cloud disk; processing the data read request based on the target block storage cluster to import the target data block requested by the data read request into the target cloud disk, wherein the address of the target data block is determined based on the target snapshot chain.

[0006] Furthermore, the cloud disk cloning request also includes the number of cloud disks to be cloned. Determining the target block storage cluster for processing the cloud disk cloning request includes: obtaining capacity information of block storage clusters and number information of existing cloud disks from multiple block storage clusters; and determining the target block storage cluster from the multiple block storage clusters based on the capacity information of the block storage clusters, the number information of existing cloud disks, and the number of cloud disks to be cloned.

[0007] Furthermore, obtaining the target snapshot chain to which the snapshot ID belongs according to the target block storage cluster includes: obtaining the target snapshot chain according to a metadata server of the target block storage cluster.

[0008] Furthermore, after obtaining the target snapshot chain to which the snapshot ID belongs based on the target block storage cluster, the method also includes: determining the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs based on the metadata server; storing the target snapshot chain, the address of the snapshot server corresponding to the snapshot ID, and the addresses of the snapshot servers corresponding to the remaining snapshot IDs; sending the target snapshot chain and the cluster identifier of the target block storage cluster to the target node, so that the target node stores the target snapshot chain and the cluster identifier, wherein the target node is used to manage multiple block storage clusters.

[0009] Furthermore, processing the data read request according to the target block storage cluster to import the target data block requested by the data read request into the target cloud disk includes: processing the data read request according to the target block storage cluster to obtain the target data block, and returning the target data block to the instance; downloading the data blocks other than the target data block by using a delayed loading method, and forming a data file of the snapshot copy based on the target data block and the data blocks other than the target data block, and importing the data file of the snapshot copy into the target cloud disk.

[0010] Furthermore, the data read request includes at least the target logical block address of the target cloud disk. The data read request is processed according to the target block storage cluster to obtain the target data block, including: determining the target snapshot server address and the target data block address corresponding to the target logical block address according to the target block storage cluster; scheduling the target snapshot server corresponding to the target snapshot server address to obtain the target data block corresponding to the target data block address.

[0011] Furthermore, scheduling the target snapshot server corresponding to the target snapshot server address to obtain the target data block corresponding to the target data block address includes: scheduling the target snapshot server to determine whether the target data block in the cache of the target snapshot server is a target loading block, wherein the target loading block is used to represent a data block with a delayed loading identifier; if the target data block in the cache of the target snapshot server is not a target loading block, obtaining the target data block from the cache of the target snapshot server; if the target data block in the cache of the target snapshot server is a target loading block, determining the parent snapshot of the cloud disk snapshot to which the target data block belongs based on the target snapshot chain, and initiating a delayed loading request to the parent snapshot to obtain the target data block returned by the parent snapshot; if the target data block returned by the parent snapshot is not obtained, downloading the target data block from the object storage node.

[0012] Furthermore, after downloading the target data block from the object storage node, the method further includes: scheduling the target snapshot server to write the target data block from the cache of the target snapshot server into the snapshot copy.

[0013] Furthermore, downloading data blocks other than the target data block by using a delayed loading method includes: determining the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs based on the metadata server; scheduling the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs to download data blocks other than the target data block from the object storage node by using a delayed loading method based on the target snapshot chain.

[0014] Furthermore, after determining the target block storage cluster to process the cloud disk cloning request, the method also includes: if there are multiple target block storage clusters, determining a source target block storage cluster from the multiple target block storage clusters based on the cluster identifier corresponding to the existing snapshot copy recorded in the target node, wherein the source target block storage cluster is used to store data blocks downloaded from the object storage node; sending the snapshot ID recorded in the target node and the cluster identifier corresponding to the snapshot ID to the metadata servers of the target block storage clusters other than the source target block storage cluster in the multiple target block storage clusters, so that the metadata servers of the target block storage clusters other than the source target block storage cluster initiate data read requests to the source target block storage cluster.

[0015] According to another aspect of an embodiment of the present application, a cloud disk cloning system is further provided, including: a target node, the target node is used to receive a cloud disk cloning request initiated by an instance management service, and determine a target block storage cluster to process the cloud disk cloning request, wherein the cloud disk cloning request includes at least a snapshot ID of the cloud disk snapshot used for cloning; a block storage cluster, a cloud disk is provided in the block storage cluster, the block storage cluster includes a target block storage cluster, the target block storage cluster is used to obtain a target snapshot chain to which the snapshot ID belongs, create a target cloud disk based on the target snapshot chain, and return cloud disk creation success information to the instance management service to instruct the instance management service to mount the target cloud disk to the instance, and after receiving a data read request, process the data read request to import the target data block requested by the data read request to the target cloud disk; an object storage node, the object storage node is used to store cloud disk snapshots and snapshot chains corresponding to the cloud disk snapshots, wherein the snapshot chain includes the target snapshot chain.

[0016] According to another aspect of an embodiment of the present application, a cloud disk cloning device is further provided, comprising: a receiving unit, configured to receive a cloud disk cloning request initiated by an instance management service, and determine a target block storage cluster to process the cloud disk cloning request, wherein the cloud disk cloning request includes at least a snapshot ID of a cloud disk snapshot used for cloning; an acquiring unit, configured to acquire a target snapshot chain to which the snapshot ID belongs based on the target block storage cluster, and create a target cloud disk based on the target snapshot chain, wherein the target snapshot chain is used to represent a parent-child relationship between the cloud disk snapshot corresponding to the snapshot ID and the cloud disk snapshots corresponding to the remaining snapshot IDs in the target snapshot chain; a sending unit, configured to return cloud disk creation success information to the instance management service to instruct the instance management service to mount the target cloud disk to the instance, wherein the instance is configured to initiate a data read request to the target block storage cluster where the target cloud disk is located after detecting the target cloud disk; and a processing unit, configured to process the data read request based on the target block storage cluster, to import the target data block requested by the data read request into the target cloud disk, wherein the address of the target data block is determined based on the target snapshot chain.

[0017] Furthermore, the receiving unit includes: a first obtaining subunit, used to obtain capacity information of a block storage cluster and the number of existing cloud disks in the multiple block storage clusters; a first determining subunit, used to determine a target block storage cluster from the multiple block storage clusters based on the capacity information of the block storage cluster, the number of existing cloud disks, and the number of cloud disks to be cloned.

[0018] Furthermore, the acquisition unit includes: a second acquisition sub-unit, configured to acquire a target snapshot chain according to a metadata server of a target block storage cluster.

[0019] Furthermore, the cloud disk cloning device also includes: a first determination unit, which is used to determine the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs based on the metadata server after obtaining the target snapshot chain to which the snapshot ID belongs based on the target block storage cluster; a first processing unit, which is used to store the target snapshot chain, the address of the snapshot server corresponding to the snapshot ID, and the addresses of the snapshot servers corresponding to the remaining snapshot IDs; and a second processing unit, which is used to send the target snapshot chain and the cluster identifier of the target block storage cluster to the target node, so that the target node stores the target snapshot chain and the cluster identifier, wherein the target node is used to manage multiple block storage clusters.

[0020] Furthermore, the processing unit includes: a first processing sub-unit, which is used to process the data read request based on the target block storage cluster, obtain the target data block, and return the target data block to the instance; a second processing sub-unit, which is used to download data blocks other than the target data block using a delayed loading method, and form a snapshot copy data file based on the target data block and the data blocks other than the target data block, and import the snapshot copy data file into the target cloud disk.

[0021] Furthermore, the data read request includes at least the target logical block address of the target cloud disk, and the first processing sub-unit includes: a first determination module, used to determine the target snapshot server address and target data block address corresponding to the target logical block address based on the target block storage cluster; a first processing module, used to schedule the target snapshot server corresponding to the target snapshot server address to obtain the target data block corresponding to the target data block address.

[0022] Furthermore, the first processing module includes: a judgment submodule, which is used to schedule the target snapshot server to determine whether the target data block in the cache of the target snapshot server is a target loading block, wherein the target loading block is used to represent a data block with a delayed loading identifier; an acquisition submodule, which is used to obtain the target data block from the cache of the target snapshot server if the target data block in the cache of the target snapshot server is not a target loading block; a determination submodule, which is used to determine the parent snapshot of the cloud disk snapshot to which the target data block belongs based on the target snapshot chain if the target data block in the cache of the target snapshot server is a target loading block, and initiate a delayed loading request to the parent snapshot to obtain the target data block returned by the parent snapshot; and a processing submodule, which is used to download the target data block from the object storage node if the target data block returned by the parent snapshot is not obtained.

[0023] Furthermore, the cloud disk cloning device further includes: a third processing unit, configured to schedule the target snapshot server to write the target data block from the cache of the target snapshot server into the snapshot copy after downloading the target data block from the object storage node.

[0024] Furthermore, the second processing sub-unit includes: a second determination module, used to determine the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs based on the metadata server; a second processing module, used to schedule the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs to download data blocks other than the target data blocks from the object storage node using a delayed loading method based on the target snapshot chain.

[0025] Furthermore, the cloud disk cloning device also includes: a second determination unit, which is used to, after determining the target block storage cluster to process the cloud disk cloning request, determine the source target block storage cluster from the multiple target block storage clusters based on the cluster identifier corresponding to the existing snapshot copy recorded in the target node, if there are multiple target block storage clusters, wherein the source target block storage cluster is used to store data blocks downloaded from the object storage node; a fourth processing unit, which is used to send the snapshot ID recorded in the target node and the cluster identifier corresponding to the snapshot ID to the metadata server of the target block storage cluster other than the source target block storage cluster in the multiple target block storage clusters, so that the metadata server of the target block storage cluster other than the source target block storage cluster initiates a data read request to the source target block storage cluster.

[0026] According to another aspect of an embodiment of the present invention, an electronic device is provided, including: a memory storing an executable program; and a processor for running the program, wherein when the program is running, any one of the above-mentioned cloud disk cloning methods is executed.

[0027] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, which stores a program, wherein when the program is running, the device where the storage medium is located is controlled to execute any of the above-mentioned cloud disk cloning methods.

[0028] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, which implements any of the above-mentioned cloud disk cloning methods when executed by a processor.

[0029] In an embodiment of the present application, a cloud disk cloning request initiated by an instance management service is received, and a target block storage cluster to be used to process the cloud disk cloning request is determined, wherein the cloud disk cloning request includes at least the snapshot ID of the cloud disk snapshot used for cloning; a target snapshot chain to which the snapshot ID belongs is obtained according to the target block storage cluster, and a target cloud disk is created based on the target snapshot chain, wherein the target snapshot chain is used to characterize the parent-child relationship between the cloud disk snapshot corresponding to the snapshot ID and the cloud disk snapshots corresponding to the remaining snapshot IDs in the target snapshot chain; a cloud disk creation success message is returned to the instance management service to instruct the instance management service to mount the target cloud disk to the instance, wherein the instance is used to initiate a data read request to the target block storage cluster where the target cloud disk is located after detecting the target cloud disk; the data read request is processed according to the target block storage cluster to import the target data block requested by the data read request into the target cloud disk, wherein, The address of the target data block is determined according to the target snapshot chain. Cloud disk cloning is accelerated based on the parent-child relationship between cloud disk snapshots represented by the snapshot chain. That is, the snapshot copy is downloaded uniquely in the entire region based on the snapshot chain. This avoids the OSS bandwidth occupation caused by all snapshot copies downloading full data from OSS to the local cluster when multiple snapshot copies are used for batch cloud disk cloning. This can avoid the bandwidth exhaustion and OSS data access timeout caused by concurrent centralized access of multiple snapshots across clusters in multi-tenant scenarios, effectively reducing the delay caused by downloading data from OSS, improving the cloud disk cloning efficiency, and achieving the purpose of reducing the competition for OSS bandwidth caused by sudden increase in batch tasks, thereby achieving the technical effect of improving cloud disk cloning efficiency, and further solving the technical problem of low cloud disk cloning efficiency in related technologies when cloning virtual machines or container cloud disks based on full snapshot data. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0031] Figure 1 is a schematic diagram of a computer terminal provided according to the first embodiment of the present application;

[0032] Figure 2 is a structural diagram of a distributed block device provided according to the first embodiment of the present application;

[0033] Figure 3 is a schematic diagram of the logical relationship of the logical storage unit provided according to the first embodiment of the present application;

[0034] Figure 4 Schematic diagram of the storage format of the physical file of the logical segment provided in the first embodiment of the present application;

[0035] Figure 5 1 is a schematic diagram of a data writing process for a logical segment according to the first embodiment of the present application;

[0036] Figure 6 This is a schematic diagram of the process of cloud disk cloning based on snapshots provided in Example 1 of the present application;

[0037] Figure 7 This is a flow chart of a cloud disk cloning method provided in accordance with the first embodiment of the present application;

[0038] Figure 8 This is a schematic diagram of cloud disk cloning based on snapshot chain provided according to the first embodiment of the present application;

[0039] Figure 9 This is a schematic diagram of the incremental reference relationship of snapshot data provided according to the first embodiment of the present application;

[0040] Figure 10 Schematic diagram of data of a snapshot chain management module in a control node provided in Example 1 of the present application;

[0041] Figure 11 Schematic diagram of data of a snapshot chain management module in a metadata server provided in Example 1 of the present application;

[0042] Figure 12 Schematic diagram of a multi-level data delayed loading request and return process based on a snapshot chain according to the first embodiment of the present application;

[0043] Figure 13 This is a schematic diagram of an incremental storage method for a snapshot chain on a block storage cluster provided in accordance with the first embodiment of the present application;

[0044] Figure 14 This is a schematic diagram of a reference storage method after incremental import of a snapshot chain on a block storage cluster provided in Example 1 of the present application;

[0045] Figure 15 Schematic diagram of a multi-level data cache and data request process based on a snapshot chain according to the first embodiment of the present application;

[0046] Figure 16 This is a schematic diagram of a cloud disk cloning device provided according to the third embodiment of the present application;

[0047] Figure 17 This is a structural block diagram of an electronic device provided according to Example 4 of the present application. DETAILED DESCRIPTION

[0048] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0049] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0050] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0051] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretations:

[0052] Delayed loading: When a virtual machine starts, disk data is slowly loaded from a disk snapshot. The virtual machine can run without the loading being completed.

[0053] Example 1

[0054] According to an embodiment of the present application, a method for cloning a cloud disk is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0055] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1The hardware structure block diagram of a computer terminal (or mobile device) for implementing a cloud disk cloning method is shown. Figure 1 As shown, the computer terminal (or mobile device) 10 may include a processor set 102 (the processor set 102 may include but is not limited to a processing device such as a microprocessor MCU (Microcontroller Unit) or a programmable logic device FPGA (Field Programmable Gate Array), and the processor set 102 may include a processor set, Figure 1 102a, 102b, ..., 102n are used to illustrate), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0056] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry." The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be fully or partially integrated into any of the other components of the computer terminal 10 (or mobile device).

[0057] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the cloud disk cloning method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the above-mentioned cloud disk cloning method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0058] The transmission device 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.

[0059] The display may be a touch screen liquid crystal display that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0060] With the continuous evolution of container and serverless technologies, elastic computing, a key component of cloud computing, is also booming. For example, in big data training scenarios built on public cloud elastic infrastructure, to address the slow image startup caused by the large size of model and training data, some optimization methods decouple image data from model data to speed up image pull and startup. In this process, model data is independently stored on a separate data disk by the user during the early stages of training. When needed, cloud disks and cloud disk snapshots are used to enable fast data access and container startup.

[0061] For example, in ECI service applications, users can store model data on OSS, File Storage Network Attached Storage (NAS), and Elastic Block Storage (EBS) cloud disk snapshots, and then mount them to containers using the container universal interface to achieve data sharing. During big data training and usage, user data cache disks can be created based on existing data disk snapshots. After minor modifications to the current training, the data on the current data disk will be used as cache data for the next training session.

[0062] Figure 2 This is a schematic diagram of the structure of the distributed block device provided in Example 1 of the present application. Figure 2As shown in the figure, the Log Structured Block Device (LSBD) based on the log structure includes a metadata server cluster, a block server and a distributed file system. The writing of LSBD data is appended, and the reference to the data written to the block device does not need to update the reference address of the logical block to the disk. Instead, the index of the read data block is accumulated in the memory. When it reaches a certain level, the newer index of the partially updated data block in the memory is asynchronously updated and merged with the index of the full amount that has been stored, so as to achieve efficient reading of data. In this distributed storage environment, the metadata and data access servers required by the storage units provided by the storage device are distributed to multiple storage servers responsible for providing disk block devices (such as Figure 2 Block server 1, block server 2, block server 3) shown.

[0063] The block storage service cluster consists of at least metadata servers 1, 2, and 3, as well as multiple block servers. The metadata servers store cloud disk and snapshot scheduling and configuration information, while the block servers store logical relationship data, logical segment groups, and logical segment information for logical storage units (LUNs). Figure 3 This is a schematic diagram of the logical relationship of the logical storage unit provided in the first embodiment of the present application. Figure 2 The logical segments in the distributed file system shown in Figure 3 As shown in the figure, multiple logical segments (such as segment #0, segment #1, segment #2, segment #3) constitute a segment group, and multiple segment groups (such as segment group #0, segment group #1) constitute a LUN. That is, the logical segment group is divided into fixed segments. The logical segment (Device Segment) represents a continuous logical storage address space. The metadata of the logical segment includes configuration information such as size and is stored on the metadata server. The physical file is stored in the directory corresponding to the logical segment of the shared storage service. For example, Figure 2 As shown, the storage directory corresponding to the logical segment includes: data file (Data File) and index file (Index File).

[0064] Figure 4 This is a schematic diagram of the storage format of the physical file of the logical segment provided in the first embodiment of the present application, such as Figure 4As shown, the application writes to the data file in an appended manner. The offset of the file is always increasing and cannot be overwritten. The index file records the merger of all write locations of the application at a certain point in time, which represents the logical address space. The index file is loaded into the memory when the logical segment is loaded, so that when the application reads the logical segment, it indicates the specific data file corresponding to the logical block address (Logical Block Address, LBA for short) and the offset in the data file, and performs the actual data access process. The entire logical data length represented by the index file is consistent with the entire logical data length of the logical segment.

[0065] A cloud disk's logical segments consist of data files, index files, and log files. These files are distributed file types that can only be appended to, not overwritten. The index file records the correspondence between the logical address range (Device LBA Range) and the physical address range of the data file. The data file stores the data in the logical segment, and the log file records the transaction logs that modify the logical segment.

[0066] Figure 5 Schematic diagram of the data writing process of the logical segment provided in the first embodiment of the present application. Figure 5 As shown, for write requests initiated by an application, the application data carried in the write request is written to the data file in the form of data blocks. A transaction log is recorded in the log file for each written data block, and the correspondence between the logical address range and the physical address range of the newly written data block is updated in the index file. When a data block is read, this index file can be loaded into the compression mapping table in memory. The index file in memory can be swapped in and out based on data read requirements.

[0067] Figure 6 This is a flow chart of cloud disk cloning based on snapshots provided in Example 1 of the present application. Figure 6 As shown, as the storage front end, the instance can be a virtual machine or a container. The following takes the container as an example. The block storage backend can include a storage management node, an object storage node, a block storage cluster, and a distributed file system. Among them, the block service node can deploy at least one cloud disk. For example, the cloud disk is cloned based on a snapshot and mounted on the container instance (such as Figure 6 Storage access as shown). Wherein, Figure 6As shown in steps ① to ⑦, after creating a container data disk based on the snapshot on OSS, you can use the delayed loading of data blocks to provide access to the container instance on the storage access end. After the snapshot data is downloaded from OSS to the distributed file system on this cluster, the cloud disk data is directly referenced using the local snapshot copy. For example, by referencing the snapshot copy data through hard links, data files of a single local snapshot copy can be shared.

[0068] However, in scenarios where snapshots are used as container cache disks for data disks, downloading and cloning based on snapshots effectively ignores the data chain generation process. For example, when cloning a cloud disk based on snapshots 2 and 3, two full copies of data need to be downloaded from OSS to the local cluster. Moreover, when cloning across clusters (such as snapshot 2 for cluster 1 and snapshot 3 for cluster 2), the data downloaded from snapshot 3 on cluster 2 also downloads the full data to the local cluster. This results in single-tenant or multi-tenant input and output (I / O) latency being limited by the bandwidth and latency of accessing OSS within the entire region, resulting in low cloud disk cloning efficiency.

[0069] In the above technical background, the present application provides Figure 7 The following table shows the method for cloning a cloud disk. Figure 7 This is a flow chart of a cloud disk cloning method according to the first embodiment of the present application. The method includes:

[0070] Step S701: Receive a cloud disk cloning request initiated by an instance management service, and determine a target block storage cluster to process the cloud disk cloning request, wherein the cloud disk cloning request includes at least the snapshot ID of the cloud disk snapshot used for cloning.

[0071] Optionally, the instance can be a virtual machine or a container, the instance management service can be a cloud server (Elastic Compute Service, referred to as ECS) or an ECI service, and the target block storage cluster can be one or more. For example, the block storage backend can include an availability zone (AZ) storage management node, an object storage node (OSS), and a block storage cluster. The AZ storage management node can receive a cloud disk cloning request initiated by an instance management service (such as an ECI service), determine the target block storage cluster to process the cloud disk cloning request, and forward the cloud disk cloning request to the target block storage cluster.

[0072] In an optional embodiment, it is possible to use Figure 8 The diagram shown in the figure shows how to clone a cloud disk. Taking the use case of EBS cloud disk and snapshot as container data disk as an example, Figure 8This is a schematic diagram of cloud disk cloning based on snapshot chain provided in accordance with the first embodiment of the present application, as shown in FIG. Figure 8 As shown in step 1, the AZ storage management node can receive the cloud disk cloning request initiated by the ECI service, determine the appropriate target block storage cluster based on the cloud disk performance indicators, the capacity information of the block storage cluster, the number of existing cloud disks, and the snapshot ID carried in the request (such as snapshot 3), and forward the cloud disk cloning request to the metadata server (Block Master) of the target block storage cluster. Among them, one cloud disk corresponds to one backend storage cluster, or several cloud disks are located in one backend storage cluster.

[0073] Step S702: Obtain the target snapshot chain to which the snapshot ID belongs based on the target block storage cluster, and create a target cloud disk based on the target snapshot chain. The target snapshot chain is used to represent the parent-child relationship between the cloud disk snapshot corresponding to the snapshot ID and the cloud disk snapshots corresponding to the remaining snapshot IDs in the target snapshot chain.

[0074] Since the snapshot data generated by cloud disk data based on incremental changes to task data has incremental characteristics, consistent with the incremental data generation process of container images, cloud disk cloning is accelerated based on the parent-child relationship between cloud disk snapshots represented by the snapshot chain. That is, snapshot copies are uniquely downloaded and cached at multiple storage nodes throughout the entire region based on the snapshot chain. This avoids the OSS bandwidth occupation caused by all snapshot copies downloading the full data from OSS to the local cluster when using multiple snapshot copies with incremental relationships for batch cloud disk cloning. This avoids the bandwidth exhaustion and OSS data access timeout caused by multiple snapshots concurrently accessing OSS across clusters in multi-tenant scenarios. This effectively reduces the delay caused by downloading data from OSS and improves cloud disk cloning efficiency.

[0075] For example, after forwarding the cloud disk cloning request to the target block storage cluster, the metadata server of the target block storage cluster can obtain the target snapshot chain corresponding to the snapshot ID from OSS based on the snapshot ID (such as snapshot 3), such as: snapshot 1←snapshot 2←snapshot 3, and create the target cloud disk (i.e., a new cloud disk) based on the number of cloud disks to be cloned (such as 10 disks) and the target snapshot chain.

[0076] For example, when a cloud disk clone request arrives at the target block storage cluster, the metadata server determines whether to download the snapshot chain locally. For example, when the request is made for the first time, the metadata server can download the snapshot chain from the OSS and record the snapshot chain and the address of the snapshot server (Snapshot Server) corresponding to the downloaded snapshot in the snapshot chain management module of the metadata server itself. After the creation is completed, the snapshot chain information is returned to the AZ storage management node. Among them, the metadata server is provided with a snapshot chain management module to record the address of the Snapshot Server (referred to as the SS address). After obtaining the target snapshot chain to which the snapshot ID belongs according to the metadata server, the metadata server determines the snapshot server Snapshot Server corresponding to the snapshot ID and the Snapshot Server corresponding to the remaining snapshot IDs, that is, the snapshot IDs are respectively assigned to one or more SnapshotServers, and the target snapshot chain, the address of the snapshot server corresponding to the snapshot ID, and the address of the snapshot server corresponding to the remaining snapshot IDs are stored. The target snapshot chain and the cluster identifier of the target block storage cluster are sent to the AZ storage management node so that the AZ storage management node stores the target snapshot chain and the cluster identifier to achieve the creation of the target cloud disk.

[0077] Figure 9 Schematic diagram of the incremental reference relationship of snapshot data provided in Example 1 of the present application, such as Figure 9 As shown, disk snapshot Snapshot 1 mirrors the earlier data, Snapshot 2 is an incremental copy of Snapshot 1, and Snapshot 3 is an incremental copy of Snapshot 2. That is, both Snapshot 2 and Snapshot 3 inherit data blocks from Snapshot 1. Snapshot IDs in the snapshot chain, except for the first one, which represents the full data, represent incremental snapshots. Snapshot IDs are assigned to one or more snapshot servers for subsequent data download.

[0078] Step S703: Return cloud disk creation success information to the instance management service to instruct the instance management service to mount the target cloud disk to the instance. After detecting the target cloud disk, the instance is used to initiate a data read request to the target block storage cluster where the target cloud disk is located.

[0079] Optionally, after a new cloud disk is created, it is returned to the instance management service. For example, after the metadata server of the target block storage cluster completes the storage of the cloud disk information and the snapshot chain, it returns to the AZ storage management node. The AZ storage management node returns the cloud disk creation success information to the instance management service. After that, the instance application can detect the target cloud disk. After detecting the target cloud disk, it initiates a data read request to the target block storage cluster where the target cloud disk is located (such as Figure 8 ), that is, cloud disk cloning includes the cloud disk creation and data import process.

[0080] Step S704 : Process the data read request according to the target block storage cluster to import the target data block requested by the data read request into the target cloud disk, wherein the address of the target data block is determined according to the target snapshot chain.

[0081] After a cloud disk is created, the actual data on the disk is empty. The missing LBAs are marked as pending data. When a container or VM application needs to read data from the cloud disk (i.e., initiates an I / O request), the backend downloads the required data blocks from OSS or can read them from the already downloaded cache. The backend then slowly downloads the remaining data blocks from OSS to the snapshot replica. Therefore, the data read request is processed based on the target block storage cluster to import the target data blocks requested by the data read request to the target cloud disk.

[0082] In this solution, cloud disk cloning is accelerated based on the parent-child relationship between cloud disk snapshots represented by the snapshot chain. That is, snapshot copies are downloaded uniquely in the entire region based on the snapshot chain. This avoids the OSS bandwidth occupation caused by all snapshot copies downloading full data from OSS to the local cluster when using multiple snapshot copies for batch cloud disk cloning. This can avoid the bandwidth exhaustion and OSS data access timeout caused by concurrent centralized access of multiple snapshots across clusters in multi-tenant scenarios. This effectively reduces the delay caused by downloading data from OSS and improves the efficiency of cloud disk cloning.

[0083] How to determine the target block storage cluster to process the cloud disk cloning request is crucial. Therefore, in the cloud disk cloning method provided in Example 1 of the present application, the cloud disk cloning request also includes the number of cloud disks to be cloned. Determining the target block storage cluster to process the cloud disk cloning request includes: obtaining capacity information of block storage clusters and number information of existing cloud disks in multiple block storage clusters; and determining the target block storage cluster from the multiple block storage clusters based on the capacity information of the block storage clusters, the number information of existing cloud disks, and the number of cloud disks to be cloned.

[0084] Optionally, in order to achieve data cache acceleration, the AZ storage management and control node is provided with a snapshot copy balancing module and a snapshot chain management module, wherein the snapshot copy balancing module records information such as the number of cloned cloud disks and cluster identifier corresponding to the snapshot ID. When the AZ storage management and control node receives a batch cloud disk cloning request, it can obtain the capacity information of the block storage cluster and the number of existing cloud disks from the snapshot copy balancing module, and then determine the target block storage cluster from multiple block storage clusters based on the capacity information of the block storage cluster, the number of existing cloud disks and the number of cloud disks to be cloned.

[0085] For example, when the AZ storage management and control node receives a batch cloud disk cloning request, the snapshot copy balancing module determines whether to distribute the pressure to multiple block storage clusters based on the threshold number of cloud disks created in a single cluster. For example, the snapshot copy balancing module can compare the number of cloud disks to be cloned with the threshold number of cloud disks to be created in a single cluster. If the number of cloud disks to be cloned is greater than the threshold number of cloud disks to be created in a single cluster, multiple target block storage clusters (such as Figure 8 Block storage cluster 1 and block storage cluster 2 are shown in the figure. According to the snapshot copy balancing module, a suitable block storage cluster is selected as the source end of the entire snapshot chain from among the available alternative clusters (i.e., multiple target block storage clusters). Figure 8 Block storage cluster 1 shown is the source block storage cluster. This means that a snapshot source is selected within the entire region, and the full snapshot data is downloaded from OSS to the local cluster. The snapshot chain management module records whether the snapshot is being used for the first time. When the target block storage cluster returns the backend storage snapshot chain information, it is recorded in the snapshot chain management module, along with the address of the source block storage cluster.

[0086] Figure 10 Schematic diagram of the data of the snapshot chain management module in the control node provided in the first embodiment of the present application, such as Figure 10 As shown, the snapshot chain management module of the AZ storage management node stores the block storage cluster address of a single snapshot on the snapshot chain, so as to facilitate cross-cluster access. For example, snapshot copy Snap2 is in cluster 1, and snapshot copy Snap3 is in cluster 2. Therefore, the snapshot chain management module of the AZ storage management node can be used to select snapshot copies in the snapshot chain in multiple block storage clusters. In addition, the snapshot chain management module of the AZ storage management node also stores the parent-child relationship of the snapshot chain. For example, for the snapshot chain: snapshot 1←snapshot 2←snapshot 3, the parent snapshot of snapshot copy Snap1 (snapshot ID of snapshot 1) is empty (NULL), the parent snapshot of snapshot copy Snap2 is snapshot copy Snap1, and the parent snapshot of snapshot copy Snap3 is snapshot copy Snap2.

[0087] By setting up a snapshot copy balancing module and a snapshot chain management module, based on the snapshot chain storage and caching method, the pressure of data I / O requests can be effectively dispersed, and multi-level snapshot data block caching can be implemented, thereby accelerating the startup of single-tenant data disks. In addition, for cross-cluster data requests, direct data requests to the source cluster can effectively avoid overall OSS bandwidth usage, taking into account the data caching speed requirements of multiple tenants, thereby ensuring the startup speed of multi-tenant images.

[0088] In order to obtain the target snapshot chain to which the snapshot ID belongs, in the cloud disk cloning method provided in the first embodiment of the present application, obtaining the target snapshot chain to which the snapshot ID belongs based on the target block storage cluster includes: obtaining the target snapshot chain based on the metadata server of the target block storage cluster.

[0089] In order to achieve data cache acceleration, in the cloud disk cloning method provided in Example 1 of the present application, after obtaining the target snapshot chain to which the snapshot ID belongs based on the target block storage cluster, the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs are determined based on the metadata server; the target snapshot chain, the address of the snapshot server corresponding to the snapshot ID, and the addresses of the snapshot servers corresponding to the remaining snapshot IDs are stored; the target snapshot chain and the cluster identifier of the target block storage cluster are sent to the target node, so that the target node stores the target snapshot chain and the cluster identifier, wherein the target node is used to manage multiple block storage clusters.

[0090] The metadata server of the target block storage cluster can obtain the target snapshot chain from the object storage node (ie OSS), for example, Figure 8 The block storage cluster 1 shown is the target block storage cluster. When the cloud disk clone request reaches the metadata server of block storage cluster 1, the metadata server determines whether to download the snapshot chain locally based on the request of the AZ storage control node. For example, when the request is made for the first time, the metadata server can download the snapshot chain from OSS (such as Figure 8 In steps 3 and 4 shown in the figure, the snapshot chain and the address of the snapshot server (Snapshot Server) for downloading the corresponding snapshot are recorded in the snapshot chain management module of the metadata server itself. After creation, the snapshot chain information is returned to the AZ storage management node.

[0091] Figure 11 This is a schematic diagram of the data of the snapshot chain management module in the metadata server provided in Example 1 of the present application. The snapshot chain management module is set in the metadata server of the EBS block storage cluster. However, the snapshot chain management module of the metadata server is different from the snapshot chain management module of the AZ storage control node, such as Figure 11 As shown, what is recorded in the snapshot chain management module of the metadata server is the address of the Snapshot Server (SS address for short).

[0092] After obtaining the target snapshot chain to which the snapshot ID belongs based on the metadata server, the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs are determined based on the metadata server. That is, the snapshot IDs are assigned to one or more Snapshot Servers, for example, the snapshot copy Snap1 is assigned to Figure 8As shown in the Snapshot Server1, the snapshot copy Snap2 is assigned to Figure 8 The target snapshot chain, the address of the snapshot server corresponding to the snapshot ID, and the addresses of the snapshot servers corresponding to the remaining snapshot IDs are stored (eg Figure 11 ), sends the target snapshot chain and the cluster identifier of the target block storage cluster to the target node (ie, the AZ storage management node), so that the target node stores the target snapshot chain and the cluster identifier (as shown in Figure 10 shown).

[0093] It should be noted that cloud disk cloning acceleration is achieved based on the increment of the snapshot chain, which avoids the OSS bandwidth occupation caused by all snapshot copies downloading the full data from OSS to the local cluster when using multiple snapshot copies for batch cloud disk cloning. In the case of a single cluster or cross-storage clusters, the cluster data is cached based on the incremental relationship of snapshots on the snapshot chain, effectively reducing the I / O delay caused by downloading data from OSS and improving the efficiency of cloud disk cloning.

[0094] In order to realize data import, in the cloud disk cloning method provided in Example 1 of the present application, the data read request is processed according to the target block storage cluster to import the target data block requested by the data read request into the target cloud disk, including: processing the data read request according to the target block storage cluster to obtain the target data block, and returning the target data block to the instance; using a delayed loading method to download data blocks other than the target data block, and forming a snapshot copy of the data file based on the target data block and the data blocks other than the target data block, and importing the snapshot copy of the data file into the target cloud disk.

[0095] Optionally, snapshot clone requests adopt a delayed loading method, that is, the data blocks on the OSS do not need to be fully downloaded before providing external services. Instead, they are downloaded according to the user's I / O request. The incremental data blocks that are not requested and need to be downloaded are delayed until the user's I / O request is made.

[0096] In an optional embodiment, the data read request includes at least the target logical block address (such as LBA#3) of the target cloud disk. In the process of processing the data read request according to the target block storage cluster to obtain the target data block, the target snapshot server address and target data block address corresponding to the target logical block address can be determined according to the target block storage cluster, and then the target snapshot server corresponding to the target snapshot server address is scheduled to obtain the target data block corresponding to the target data block address.

[0097] For example, the data read request is to read LBA#3 of snapshot 3. At the beginning of cloud disk creation, the snapshot ID corresponding to the cloud disk clone has been recorded in the cloud disk metadata. The requested LBA can be converted into the address of the snapshot server and the corresponding snapshot data block address (i.e., the target data block address). For example, based on the data information recorded in the snapshot chain management module of the Block Master, it can be determined that the target snapshot server address corresponding to snapshot 3 is the address of Snapshot Server 3.

[0098] In an optional embodiment, in the process of scheduling the target snapshot server corresponding to the target snapshot server address to obtain the target data block corresponding to the target data block address, the target snapshot server can be scheduled to determine whether the target data block in the cache of the target snapshot server is the target loading block. If the target data block in the cache of the target snapshot server is not the target loading block, the target data block is obtained from the cache of the target snapshot server; if the target data block in the cache of the target snapshot server is the target loading block, the parent snapshot of the cloud disk snapshot to which the target data block belongs is determined based on the target snapshot chain, and a delayed loading request is initiated to the parent snapshot to obtain the target data block returned by the parent snapshot; if the target data block returned by the parent snapshot is not obtained, the target data block is downloaded from the object storage node.

[0099] During the cloud disk cloning process, before the snapshot is completely downloaded to the local computer, data block reading is performed in the form of lazy loading. That is, the data blocks cached in the Snapshot Server are read. When the current snapshot indicates that the data block is stored in the parent snapshot, a request is made to the parent snapshot. After the request, the data is stored in the cache of the local Snapshot Server.

[0100] Figure 12 This is a schematic diagram of a multi-level data delayed loading request and return process based on a snapshot chain according to the first embodiment of the present application. The index information of all data blocks of the cloud disk is marked as a delayed loading block (i.e., in the waiting download state) in the block server. Figure 12As shown, the data block marked as (-1) is a delayed loading block, that is, the data block has not been downloaded in the local cluster and needs to continue to access the snapshot server for download. For example, the data read request is to read LBA#3 of snapshot 3 (Snap3). Snap3 is in Snapshot Server3, that is, the target snapshot server is SnapshotServer3 at this time. Snapshot Server3 determines that LBA#3 in its own cache is a delayed loading block (that is, the target loading block), and determines the parent snapshot (Snap2) of the cloud disk snapshot (Snap3) to which the target data block belongs based on the snapshot chain, and initiates a delayed loading request to Snap2. LBA#3 in Snapshot Server2 where Snap2 is located is also a delayed loading block. Snapshot Server2 determines the parent snapshot (Snap1) based on the snapshot chain, and initiates a delayed loading request to Snap1 to obtain the target data block returned by Snap1 (as shown in the figure). Figure 12 In the example shown in Figure 1, Snapshot Server 1, where Snap1 resides, returns V1 to Snapshot Server 2, which then returns V1 to Snapshot Server 3. This causes LBA #3 of Snap3 to change from (-1) to V1. If the target data block returned by the parent snapshot is not obtained, it means that the Snapshot Server cache does not have a record of the data block. In this case, it can be downloaded from OSS.

[0101] By adopting the snapshot chain download method, different data cache disks request different snapshot IDs as image IDs, realizing multi-level snapshot copy data caching and acceleration, effectively reducing the delay caused by downloading data from OSS and improving the efficiency of cloud disk cloning.

[0102] In order to improve the efficiency of cloud disk cloning, in the cloud disk cloning method provided in Example 1 of the present application, after downloading the target data block from the object storage node, the target snapshot server is scheduled to write the target data block from the cache of the target snapshot server to the snapshot copy.

[0103] In order to improve the efficiency of cloud disk cloning, in the cloud disk cloning method provided in Example 1 of the present application, a delayed loading method is used to download data blocks other than the target data block, including: determining the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs based on the metadata server; scheduling the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs to download data blocks other than the target data block from the object storage node based on the target snapshot chain using a delayed loading method.

[0104] The local cluster uses a snapshot chain-based data management method. Incremental snapshot storage only downloads the newly added data in the snapshot chain and uses a delayed loading method to reference the parent snapshot, that is, the cloud disk data references the full amount of snapshot data. Snapshot chain data is stored uniquely in the cluster as increments. After the download is complete, an incremental iterative completion method is adopted, which not only avoids data reading and copying, but also meets the requirement of complete data for cloud disk cloning. Therefore, in the process of downloading data blocks other than the target data block using the delayed loading method, the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs are determined based on the Block Master. The snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs are scheduled to download data blocks other than the target data block from OSS using a delayed loading method based on the snapshot chain to complete the overall completion.

[0105] When the snapshot download on the snapshot chain is completed, the snapshot chain management module of Block Master will complete the incremental data according to the snapshot chain. The completion process adopts a chain iteration method to avoid reading and copying the full data. Figure 13 Schematic diagram of the snapshot chain incremental storage method on the block storage cluster provided in Example 1 of the present application, as shown in FIG. Figure 13 As shown, the snapshot increment is stored incrementally in the local cluster. The I / O read of the delayed loading block needs to initiate a data request to the parent snapshot. The method of requesting the parent snapshot is as follows Figure 12 As shown, no further description is given here.

[0106] Figure 14 Schematic diagram of the reference storage method after incremental import of the snapshot chain on the block storage cluster provided in the first embodiment of the present application, as shown in FIG. Figure 14 As shown in the figure, once the snapshot download is complete, the Block Master's snapshot chain management module initiates a data import from the snapshot on Snap1 to Snap2, based on the snapshot's SS address recorded in the snapshot chain. This import utilizes a hard link mechanism, with the delayed-load block in Snap2 referencing the data file on Snap1. After Snap2 completes its data import, the Block Master's snapshot chain management module imports Snap2 to Snap3. Through the import operation, the incremental snapshots Snap2 and Snap3 complete the snapshot reference data, completing the iterative import process. Snapshots Snap1, Snap2, and Snap3 can each initiate data imports to the cloud disk. The index file corresponding to the delayed-load block in the original incremental snapshot references the parent snapshot data file via a hard link, thereby completing the snapshot's incremental data and forming a complete full snapshot. This completes the cloning process of the incremental snapshot to the cloud disk within the cluster.

[0107] Cloud disk cloning is achieved based on the incremental relationship of the snapshot chain, effectively improving the efficiency of cloud disk cloning. It enables a single tenant to accelerate startup by leveraging data caches across multiple nodes within the cluster and between clusters, avoiding full data downloads from OSS. This also prevents concurrent centralized access to OSS across multiple snapshots in multi-tenant scenarios, bandwidth exhaustion caused by downloading full data from OSS, and OSS data access timeouts. Based on the snapshot chain, snapshot copies are uniquely downloaded within the entire region and cached at multiple storage nodes, effectively reducing the delay caused by downloading data from OSS and improving cloud disk cloning efficiency.

[0108] In order to avoid concurrent centralized access to OSS by multiple snapshots across clusters in a multi-tenant scenario, in the cloud disk cloning method provided in Example 1 of the present application, after determining the target block storage cluster for processing the cloud disk cloning request, if there are multiple target block storage clusters, a source target block storage cluster is determined from the multiple target block storage clusters based on the cluster identifier corresponding to the existing snapshot copy recorded in the target node, wherein the source target block storage cluster is used to store data blocks downloaded from the object storage node; the snapshot ID recorded in the target node and the cluster identifier corresponding to the snapshot ID are sent to the metadata servers of the target block storage clusters other than the source target block storage cluster in the multiple target block storage clusters, so that the metadata servers of the target block storage clusters other than the source target block storage cluster initiate data read requests to the source target block storage cluster.

[0109] The snapshot copy balancing module in the AZ storage control node, for cross-cluster cloning requests, includes the cluster address of the source data end in the request sent to other Block Masters, which facilitates subsequent snapshot cloning data requests. That is, the AZ storage control node selects the appropriate block storage cluster as the source end of the entire snapshot chain (such as Figure 8 The block storage cluster 1 shown is the source block storage cluster), and then sends the snapshot ID and the cluster identifier corresponding to the snapshot ID to the metadata servers of the target block storage clusters other than the source target block storage cluster (i.e., other Block Masters) in multiple target block storage clusters, so that the metadata servers of the target block storage clusters other than the source target block storage cluster initiate data read requests to the source target block storage cluster. For example, block storage cluster 2 does not need to download data from OSS, but only needs to initiate a data read request to block storage cluster 1, thereby avoiding the overall OSS bandwidth occupation, thereby effectively improving the efficiency of cloud disk cloning.

[0110] Figure 15 This is a schematic diagram of a multi-level data cache and data request process based on a snapshot chain according to the first embodiment of the present application, which adopts a full download and on-demand request method across clusters, such as Figure 15As shown, cluster 1 is the source data end storing the snapshot chain, and the cluster information is recorded in the AZ storage management node, for example, Figure 15 Clusters 2, 3, and 4 correspond to snapshot 3, and cluster 5 corresponds to snapshot 2. When cluster 2 is heavily loaded, cluster 2 serves as the source for cluster 4. For example, when an I / O request requests data from cluster 2 or cluster 3 across clusters, the snapshot replica balancing module and snapshot chain management module of the AZ storage management node initiate a data request to Snap3 in source cluster 1. After the read is complete, the cross-cluster data blocks are stored in the local cluster as new snapshot replicas, implementing multi-level caching.

[0111] Optionally, data can be cached locally in memory for acceleration based on data proximity. For example, data caches can be set up on the Snapshot Servers where Snap1 and Snap2 reside. Data read from the parent snapshot is cached on the corresponding Snapshot Server. If the parent snapshot doesn't download any data blocks, the corresponding child snapshot index will reference the parent snapshot's data files after the subsequent incremental snapshots are downloaded, completing the overall download.

[0112] It should be noted that, through the embodiments of the present invention, in scenarios where EBS cloud disks and snapshots are used as container data disks, users in the ECI service can use snapshot chain data to perform multiple iterative container startups, thereby optimizing the latency of single-tenant and multi-tenant batch concurrent snapshot cloning based on container data disks, and reducing the competition for OSS bandwidth caused by sudden increases in batch tasks; based on the incremental chain feature of the data disk image, multi-level caching is implemented to accelerate startup and reduce the impact on multi-tenant cloning latency.

[0113] In an embodiment of the present application, a cloud disk cloning request initiated by an instance management service is received, and a target block storage cluster to be used to process the cloud disk cloning request is determined, wherein the cloud disk cloning request includes at least the snapshot ID of the cloud disk snapshot used for cloning; a target snapshot chain to which the snapshot ID belongs is obtained according to the target block storage cluster, and a target cloud disk is created based on the target snapshot chain, wherein the target snapshot chain is used to characterize the parent-child relationship between the cloud disk snapshot corresponding to the snapshot ID and the cloud disk snapshots corresponding to the remaining snapshot IDs in the target snapshot chain; a cloud disk creation success message is returned to the instance management service to instruct the instance management service to mount the target cloud disk to the instance, wherein the instance is used to initiate a data read request to the target block storage cluster where the target cloud disk is located after detecting the target cloud disk; the data read request is processed according to the target block storage cluster to import the target data block requested by the data read request into the target cloud disk, wherein, The address of the target data block is determined according to the target snapshot chain. Cloud disk cloning is accelerated based on the parent-child relationship between cloud disk snapshots represented by the snapshot chain. That is, the snapshot copy is downloaded uniquely in the entire region based on the snapshot chain. This avoids the OSS bandwidth occupation caused by all snapshot copies downloading full data from OSS to the local cluster when multiple snapshot copies are used for batch cloud disk cloning. This can avoid the bandwidth exhaustion and OSS data access timeout caused by concurrent centralized access of multiple snapshots across clusters in multi-tenant scenarios, effectively reducing the delay caused by downloading data from OSS, improving the cloud disk cloning efficiency, and achieving the purpose of reducing the competition for OSS bandwidth caused by sudden increase in batch tasks, thereby achieving the technical effect of improving cloud disk cloning efficiency, and further solving the technical problem of low cloud disk cloning efficiency in related technologies when cloning virtual machines or container cloud disks based on full snapshot data.

[0114] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0115] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0116] Example 2

[0117] According to another aspect of an embodiment of the present application, a cloud disk cloning system is provided, including:

[0118] The target node is used to receive the cloud disk cloning request initiated by the instance management service and determine the target block storage cluster to process the cloud disk cloning request. The cloud disk cloning request includes at least the snapshot ID of the cloud disk snapshot used for cloning.

[0119] A block storage cluster is configured with a cloud disk. The block storage cluster includes a target block storage cluster. The target block storage cluster is used to obtain the target snapshot chain to which the snapshot ID belongs, create a target cloud disk based on the target snapshot chain, and return a cloud disk creation success message to the instance management service to instruct the instance management service to mount the target cloud disk to the instance. After receiving a data read request, the target block storage cluster processes the data read request to import the target data block requested by the data read request to the target cloud disk.

[0120] Object storage node, the object storage node is used to store cloud disk snapshots and the snapshot chain corresponding to the cloud disk snapshot, where the snapshot chain includes the target snapshot chain.

[0121] The target node corresponds to Figure 8 The AZ storage management node shown in the figure, the block storage cluster includes at least the following Figure 8 The block storage cluster 1 and block storage cluster 2 shown in the figure have object storage nodes corresponding to Figure 8 The object storage OSS is shown.

[0122] In the cloud disk cloning system, the specific method for cloning the cloud disk is the same as that in the first embodiment and will not be described in detail here.

[0123] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0125] Example 3

[0126] According to an embodiment of the present application, a cloud disk cloning device for implementing the above-mentioned cloud disk cloning method is also provided. Figure 16 As shown, the device includes: a receiving unit 1601, an acquiring unit 1602, a sending unit 1603, and a processing unit 1604.

[0127] The receiving unit 1601 is configured to receive a cloud disk cloning request initiated by the instance management service and determine a target block storage cluster to process the cloud disk cloning request, wherein the cloud disk cloning request includes at least a snapshot ID of a cloud disk snapshot to be used for cloning;

[0128] An acquisition unit 1602 is configured to acquire a target snapshot chain to which the snapshot ID belongs based on the target block storage cluster, and create a target cloud disk based on the target snapshot chain, wherein the target snapshot chain represents a parent-child relationship between the cloud disk snapshot corresponding to the snapshot ID and the cloud disk snapshots corresponding to the remaining snapshot IDs in the target snapshot chain.

[0129] The sending unit 1603 is configured to return a cloud disk creation success message to the instance management service, instructing the instance management service to mount the target cloud disk to the instance. After detecting the target cloud disk, the instance is configured to initiate a data read request to the target block storage cluster where the target cloud disk is located.

[0130] The processing unit 1604 is configured to process the data read request according to the target block storage cluster to import the target data block requested by the data read request to the target cloud disk, wherein the address of the target data block is determined according to the target snapshot chain.

[0131] In the cloud disk cloning device provided in the third embodiment of the present application, a receiving unit 1601 receives a cloud disk cloning request initiated by an instance management service, and determines a target block storage cluster to process the cloud disk cloning request, wherein the cloud disk cloning request includes at least a snapshot ID of the cloud disk snapshot used for cloning; an obtaining unit 1602 obtains a target snapshot chain to which the snapshot ID belongs based on the target block storage cluster, and creates a target cloud disk based on the target snapshot chain, wherein the target snapshot chain is used to represent the parent-child relationship between the cloud disk snapshot corresponding to the snapshot ID and the cloud disk snapshots corresponding to the remaining snapshot IDs in the target snapshot chain; a sending unit 1603 returns a cloud disk creation success message to the instance management service to instruct the instance management service to mount the target cloud disk to the instance, wherein the instance is used to initiate a data read request to the target block storage cluster where the target cloud disk is located after detecting the target cloud disk; a processing unit 1604 processes the data read request based on the target block storage cluster to import the target data block requested by the data read request into the target cloud disk, wherein the address of the target data block is determined based on the target snapshot chain.

[0132] In this solution, cloud disk cloning is accelerated based on the parent-child relationship between cloud disk snapshots represented by the snapshot chain. That is, the snapshot copy is downloaded uniquely in the entire region based on the snapshot chain, avoiding the OSS bandwidth occupation caused by all snapshot copies downloading full data from OSS to the local cluster when using multiple snapshot copies for batch cloud disk cloning. This can avoid the bandwidth exhaustion and OSS data access timeout caused by concurrent centralized access of multiple snapshots across clusters in multi-tenant scenarios, effectively reducing the delay caused by downloading data from OSS, improving the cloud disk cloning efficiency, and achieving the purpose of reducing the competition for OSS bandwidth caused by sudden increase in batch tasks, thereby achieving the technical effect of improving cloud disk cloning efficiency, and further solving the technical problem of low cloud disk cloning efficiency in related technologies based on full snapshot data for virtual machine or container cloud disk cloning.

[0133] Optionally, in the cloud disk cloning device provided in Example 3 of the present application, the receiving unit 1601 includes: a first obtaining subunit, used to obtain capacity information of a block storage cluster and the number of existing cloud disks in multiple block storage clusters; a first determining subunit, used to determine a target block storage cluster from the multiple block storage clusters based on the capacity information of the block storage cluster, the number of existing cloud disks, and the number of cloud disks to be cloned.

[0134] Optionally, in the cloud disk cloning device provided in the third embodiment of the present application, the obtaining unit 1602 includes: a second obtaining sub-unit, configured to obtain a target snapshot chain based on a metadata server of a target block storage cluster.

[0135] Optionally, in the cloud disk cloning device provided in Example 3 of the present application, the cloud disk cloning device also includes: a first determination unit, used to determine the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs based on the metadata server after obtaining the target snapshot chain to which the snapshot ID belongs based on the target block storage cluster; a first processing unit, used to store the target snapshot chain, the address of the snapshot server corresponding to the snapshot ID, and the addresses of the snapshot servers corresponding to the remaining snapshot IDs; a second processing unit, used to send the target snapshot chain and the cluster identifier of the target block storage cluster to the target node, so that the target node stores the target snapshot chain and the cluster identifier, wherein the target node is used to manage multiple block storage clusters.

[0136] Optionally, in the cloud disk cloning device provided in Example 3 of the present application, the processing unit 1604 includes: a first processing sub-unit, used to process the data read request based on the target block storage cluster, obtain the target data block, and return the target data block to the instance; a second processing sub-unit, used to download data blocks other than the target data block using a delayed loading method, and form a snapshot copy of the data file based on the target data block and the data blocks other than the target data block, and import the snapshot copy of the data file into the target cloud disk.

[0137] Optionally, in the cloud disk cloning device provided in Example 3 of the present application, the data reading request includes at least the target logical block address of the target cloud disk, and the first processing sub-unit includes: a first determination module, used to determine the target snapshot server address and target data block address corresponding to the target logical block address based on the target block storage cluster; a first processing module, used to schedule the target snapshot server corresponding to the target snapshot server address to obtain the target data block corresponding to the target data block address.

[0138] Optionally, in the cloud disk cloning device provided in Example 3 of the present application, the first processing module includes: a judgment sub-module, which is used to schedule the target snapshot server to determine whether the target data block in the cache of the target snapshot server is a target loading block, wherein the target loading block is used to represent a data block with a delayed loading identifier; an acquisition sub-module, which is used to obtain the target data block from the cache of the target snapshot server if the target data block in the cache of the target snapshot server is not a target loading block; a determination sub-module, which is used to determine the parent snapshot of the cloud disk snapshot to which the target data block belongs based on the target snapshot chain if the target data block in the cache of the target snapshot server is a target loading block, and initiate a delayed loading request to the parent snapshot to obtain the target data block returned by the parent snapshot; and a processing sub-module, which is used to download the target data block from the object storage node if the target data block returned by the parent snapshot is not obtained.

[0139] Optionally, in the cloud disk cloning device provided in Example 3 of the present application, the cloud disk cloning device also includes: a third processing unit, which is used to schedule the target snapshot server to write the target data block from the cache of the target snapshot server to the snapshot copy after downloading the target data block from the object storage node.

[0140] Optionally, in the cloud disk cloning device provided in Example 3 of the present application, the second processing sub-unit includes: a second determination module, used to determine the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs based on the metadata server; a second processing module, used to schedule the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs to download data blocks other than the target data blocks from the object storage node according to the target snapshot chain using a delayed loading method.

[0141] Optionally, in the cloud disk cloning device provided in Example 3 of the present application, the cloud disk cloning device also includes: a second determination unit, for, after determining the target block storage cluster to process the cloud disk cloning request, if there are multiple target block storage clusters, determining a source target block storage cluster from the multiple target block storage clusters based on the cluster identifier corresponding to the existing snapshot copy recorded in the target node, wherein the source target block storage cluster is used to store data blocks downloaded from the object storage node; a fourth processing unit, for sending the snapshot ID recorded in the target node and the cluster identifier corresponding to the snapshot ID to the metadata server of the target block storage cluster other than the source target block storage cluster in the multiple target block storage clusters, so that the metadata server of the target block storage cluster other than the source target block storage cluster initiates a data read request to the source target block storage cluster.

[0142] It should be noted that the receiving unit 1601, acquiring unit 1602, sending unit 1603, and processing unit 1604 described above correspond to steps S701 to S704 in Example 1. The examples and application scenarios implemented by the above units and corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.

[0143] It should be noted that the preferred implementation scheme involved in the above embodiments of this application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.

[0144] Example 4

[0145] The embodiment of the present application may provide an electronic device, which may be any electronic device in a group of electronic devices. Optionally, in this embodiment, the electronic device may also be replaced by a terminal device such as a mobile terminal.

[0146] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0147] In this embodiment, the electronic device can execute the program code of the following steps in the cloud disk cloning method: receiving a cloud disk cloning request initiated by an instance management service, and determining a target block storage cluster to process the cloud disk cloning request, wherein the cloud disk cloning request includes at least the snapshot ID of the cloud disk snapshot used for cloning; obtaining a target snapshot chain to which the snapshot ID belongs based on the target block storage cluster, and creating a target cloud disk based on the target snapshot chain, wherein the target snapshot chain is used to represent the parent-child relationship between the cloud disk snapshot corresponding to the snapshot ID and the cloud disk snapshots corresponding to the remaining snapshot IDs in the target snapshot chain; returning cloud disk creation success information to the instance management service to instruct the instance management service to mount the target cloud disk to the instance, wherein the instance is used to initiate a data read request to the target block storage cluster where the target cloud disk is located after detecting the target cloud disk; processing the data read request based on the target block storage cluster to import the target data block requested by the data read request into the target cloud disk, wherein the address of the target data block is determined based on the target snapshot chain.

[0148] The electronic device may also execute the program code for the following steps in the cloud disk cloning method: obtaining capacity information of a block storage cluster and information about the number of existing cloud disks among the multiple block storage clusters; and determining a target block storage cluster from the multiple block storage clusters based on the capacity information of the block storage cluster, information about the number of existing cloud disks, and the number of cloud disks to be cloned.

[0149] The electronic device may also execute the program code of the following steps in the cloud disk cloning method: obtaining a target snapshot chain according to the metadata server of the target block storage cluster.

[0150] The above-mentioned electronic device can also execute the program code of the following steps in the cloud disk cloning method: after obtaining the target snapshot chain to which the snapshot ID belongs based on the target block storage cluster, determining the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs based on the metadata server; storing the target snapshot chain, the address of the snapshot server corresponding to the snapshot ID, and the addresses of the snapshot servers corresponding to the remaining snapshot IDs; sending the target snapshot chain and the cluster identifier of the target block storage cluster to the target node, so that the target node stores the target snapshot chain and the cluster identifier, wherein the target node is used to manage multiple block storage clusters.

[0151] The above-mentioned electronic device can also execute the program code of the following steps in the cloud disk cloning method: processing the data read request according to the target block storage cluster to obtain the target data block, and returning the target data block to the instance; using a delayed loading method to download the data blocks other than the target data block, and forming a snapshot copy data file based on the target data block and the data blocks other than the target data block, and importing the snapshot copy data file into the target cloud disk.

[0152] The above-mentioned electronic device can also execute the program code of the following steps in the cloud disk cloning method: determining the target snapshot server address and target data block address corresponding to the target logical block address based on the target block storage cluster; scheduling the target snapshot server corresponding to the target snapshot server address to obtain the target data block corresponding to the target data block address.

[0153] The above-mentioned electronic device can also execute the program code of the following steps in the cloud disk cloning method: scheduling the target snapshot server to determine whether the target data block in the cache of the target snapshot server is a target loading block, wherein the target loading block is used to represent a data block with a delayed loading identifier; if the target data block in the cache of the target snapshot server is not a target loading block, then obtaining the target data block from the cache of the target snapshot server; if the target data block in the cache of the target snapshot server is a target loading block, then determining the parent snapshot of the cloud disk snapshot to which the target data block belongs based on the target snapshot chain, and initiating a delayed loading request to the parent snapshot to obtain the target data block returned by the parent snapshot; if the target data block returned by the parent snapshot is not obtained, then downloading the target data block from the object storage node.

[0154] The electronic device can also execute the program code of the following steps in the cloud disk cloning method: after downloading the target data block from the object storage node, scheduling the target snapshot server to write the target data block from the cache of the target snapshot server to the snapshot copy.

[0155] The electronic device can also execute the program code of the following steps in the cloud disk cloning method: determining the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs based on the metadata server; scheduling the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs to download data blocks other than the target data blocks from the object storage node using a delayed loading method based on the target snapshot chain.

[0156] The above-mentioned electronic device can also execute the program code of the following steps in the cloud disk cloning method: after determining the target block storage cluster to process the cloud disk cloning request, if there are multiple target block storage clusters, determine the source target block storage cluster from the multiple target block storage clusters based on the cluster identifier corresponding to the existing snapshot copy recorded in the target node, wherein the source target block storage cluster is used to store data blocks downloaded from the object storage node; send the snapshot ID recorded in the target node and the cluster identifier corresponding to the snapshot ID to the metadata server of the target block storage cluster other than the source target block storage cluster in the multiple target block storage clusters, so that the metadata server of the target block storage cluster other than the source target block storage cluster initiates a data read request to the source target block storage cluster.

[0157] Optionally, Figure 17 This is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 17 As shown, the electronic device 10 may include: one or more ( Figure 17 (Only one is shown) processor 102, memory 104. The electronic device 10 may further include a memory controller to control and manage the memory 104; the electronic device 10 may further include a peripheral interface to connect to a radio frequency module, an audio module, and a display screen, etc.

[0158] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the cloud disk cloning method and device in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned cloud disk cloning method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely located relative to the processor, and these remote memories can be connected to the terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0159] The processor can call information and applications stored in the memory through a transmission device to perform the following steps: receive a cloud disk cloning request initiated by an instance management service, and determine a target block storage cluster to process the cloud disk cloning request, wherein the cloud disk cloning request includes at least a snapshot ID of a cloud disk snapshot used for cloning; obtain a target snapshot chain to which the snapshot ID belongs based on the target block storage cluster, and create a target cloud disk based on the target snapshot chain, wherein the target snapshot chain is used to represent the parent-child relationship between the cloud disk snapshot corresponding to the snapshot ID and the cloud disk snapshots corresponding to other snapshot IDs in the target snapshot chain; return cloud disk creation success information to the instance management service to instruct the instance management service to mount the target cloud disk to the instance, wherein the instance is used to initiate a data read request to the target block storage cluster where the target cloud disk is located after detecting the target cloud disk; process the data read request based on the target block storage cluster to import the target data block requested by the data read request into the target cloud disk, wherein the address of the target data block is determined based on the target snapshot chain.

[0160] Optionally, the processor may also execute the program code of the following steps: obtaining capacity information of a block storage cluster and the number of existing cloud disks in a plurality of block storage clusters; and determining a target block storage cluster from the plurality of block storage clusters based on the capacity information of the block storage cluster, the number of existing cloud disks, and the number of cloud disks to be cloned.

[0161] Optionally, the processor may further execute program code of the following steps: obtaining a target snapshot chain according to a metadata server of a target block storage cluster.

[0162] Optionally, the processor may also execute the program code of the following steps: after obtaining the target snapshot chain to which the snapshot ID belongs based on the target block storage cluster, determining the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs based on the metadata server; storing the target snapshot chain, the address of the snapshot server corresponding to the snapshot ID, and the addresses of the snapshot servers corresponding to the remaining snapshot IDs; sending the target snapshot chain and the cluster identifier of the target block storage cluster to the target node, so that the target node stores the target snapshot chain and the cluster identifier, wherein the target node is used to manage multiple block storage clusters.

[0163] Optionally, the processor may also execute the program code of the following steps: processing the data read request based on the target block storage cluster to obtain the target data block, and returning the target data block to the instance; downloading the data blocks other than the target data block using a delayed loading method, and forming a snapshot copy of the data file based on the target data block and the data blocks other than the target data block, and importing the snapshot copy of the data file to the target cloud disk.

[0164] Optionally, the processor may also execute the program code of the following steps: determining the target snapshot server address and target data block address corresponding to the target logical block address based on the target block storage cluster; scheduling the target snapshot server corresponding to the target snapshot server address to obtain the target data block corresponding to the target data block address.

[0165] Optionally, the processor may also execute the following program code: scheduling the target snapshot server to determine whether the target data block in the cache of the target snapshot server is a target loading block, wherein the target loading block is used to represent a data block with a delayed loading identifier; if the target data block in the cache of the target snapshot server is not a target loading block, obtaining the target data block from the cache of the target snapshot server; if the target data block in the cache of the target snapshot server is a target loading block, determining the parent snapshot of the cloud disk snapshot to which the target data block belongs based on the target snapshot chain, and initiating a delayed loading request to the parent snapshot to obtain the target data block returned by the parent snapshot; if the target data block returned by the parent snapshot is not obtained, downloading the target data block from the object storage node.

[0166] Optionally, the processor may further execute program code of the following steps: after downloading the target data block from the object storage node, scheduling the target snapshot server to write the target data block from the cache of the target snapshot server into the snapshot copy.

[0167] Optionally, the processor may also execute the program code of the following steps: determining the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs based on the metadata server; scheduling the snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs to download data blocks other than the target data blocks from the object storage node using a delayed loading method based on the target snapshot chain.

[0168] Optionally, the processor may also execute the program code of the following steps: after determining the target block storage cluster to process the cloud disk cloning request, if there are multiple target block storage clusters, determining the source target block storage cluster from the multiple target block storage clusters based on the cluster identifier corresponding to the existing snapshot copy recorded in the target node, wherein the source target block storage cluster is used to store data blocks downloaded from the object storage node; sending the snapshot ID recorded in the target node and the cluster identifier corresponding to the snapshot ID to the metadata servers of the target block storage clusters other than the source target block storage cluster in the multiple target block storage clusters, so that the metadata servers of the target block storage clusters other than the source target block storage cluster initiate data read requests to the source target block storage cluster.

[0169] It can be understood by those skilled in the art that Figure 17The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, or other terminal devices. Figure 17 It does not limit the structure of the above electronic device. For example, the electronic device 10 may also include Figure 17 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 17 Different configurations shown.

[0170] A person skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0171] Example 5

[0172] The embodiment of the present application further provides a computer-readable storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the cloud disk cloning method provided in the first embodiment.

[0173] Optionally, in this embodiment, the storage medium may be located in any electronic device in a group of electronic devices in a computer network, or in any mobile terminal in a group of mobile terminals.

[0174] Example 6

[0175] The embodiment of the present application further provides a computer program product. Optionally, in this embodiment, the computer program product may include a computer program, which, when executed by a processor, implements the cloud disk cloning method provided in the first embodiment.

[0176] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0177] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0178] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0179] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0180] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0181] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.

[0182] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A cloud disk cloning method, characterized in that: include: Receive a cloud disk cloning request initiated by the instance management service, and determine a target block storage cluster to process the cloud disk cloning request, wherein the cloud disk cloning request includes at least a snapshot ID of a cloud disk snapshot to be used for cloning; Obtaining a target snapshot chain to which the snapshot ID belongs based on the target block storage cluster, and creating a target cloud disk based on the target snapshot chain, wherein the target snapshot chain is used to represent the parent-child relationship between the cloud disk snapshot corresponding to the snapshot ID and the cloud disk snapshots corresponding to the remaining snapshot IDs in the target snapshot chain; Returning cloud disk creation success information to the instance management service to instruct the instance management service to mount the target cloud disk to the instance, wherein the instance is configured to initiate a data read request to the target block storage cluster where the target cloud disk is located after detecting the target cloud disk; The data read request is processed according to the target block storage cluster to import the target data block requested by the data read request into the target cloud disk, wherein the address of the target data block is determined according to the target snapshot chain.

2. The method according to claim 1, characterized in that The cloud disk cloning request also includes the number of cloud disks to be cloned. Determining the target block storage cluster to process the cloud disk cloning request includes: Obtain the capacity information of block storage clusters and the number of existing cloud disks in multiple block storage clusters; The target block storage cluster is determined from the multiple block storage clusters according to the capacity information of the block storage cluster, the number of the existing cloud disks, and the number of the cloud disks to be cloned.

3. The method according to claim 1, characterized in that Obtaining a target snapshot chain to which the snapshot ID belongs according to the target block storage cluster includes: The target snapshot chain is obtained according to the metadata server of the target block storage cluster.

4. The method according to claim 3, characterized in that After obtaining the target snapshot chain to which the snapshot ID belongs based on the target block storage cluster, the method further includes: Determining, according to the metadata server, a snapshot server corresponding to the snapshot ID and snapshot servers corresponding to the remaining snapshot IDs; Storing the target snapshot chain, the address of the snapshot server corresponding to the snapshot ID, and the addresses of the snapshot servers corresponding to the remaining snapshot IDs; The target snapshot chain and the cluster identifier of the target block storage cluster are sent to a target node, so that the target node stores the target snapshot chain and the cluster identifier, wherein the target node is used to manage multiple block storage clusters.

5. The method according to claim 1, wherein Processing the data read request according to the target block storage cluster to import the target data block requested by the data read request into the target cloud disk includes: Processing the data read request according to the target block storage cluster to obtain the target data block, and returning the target data block to the instance; The data blocks other than the target data blocks are downloaded by delayed loading, and a data file of a snapshot copy is formed based on the target data block and the data blocks other than the target data block, and the data file of the snapshot copy is imported into the target cloud disk.

6. The method according to claim 5, characterized in that The data read request includes at least the target logical block address of the target cloud disk. The data read request is processed according to the target block storage cluster to obtain the target data block including: Determining a target snapshot server address and a target data block address corresponding to the target logical block address according to the target block storage cluster; The target snapshot server corresponding to the target snapshot server address is scheduled to obtain the target data block corresponding to the target data block address.

7. The method according to claim 6, characterized in that Scheduling the target snapshot server corresponding to the target snapshot server address to obtain the target data block corresponding to the target data block address includes: Scheduling the target snapshot server to determine whether the target data block in the cache of the target snapshot server is a target loading block, wherein the target loading block is used to represent a data block with a delayed loading identifier; If the target data block in the cache of the target snapshot server is not the target loaded block, obtaining the target data block from the cache of the target snapshot server; If the target data block in the cache of the target snapshot server is the target loading block, the parent snapshot of the cloud disk snapshot to which the target data block belongs is determined according to the target snapshot chain, and a delayed loading request is initiated to the parent snapshot to obtain the target data block returned by the parent snapshot; If the target data block returned by the parent snapshot is not obtained, the target data block is downloaded from the object storage node.

8. The method according to claim 7, characterized in that After downloading the target data block from the object storage node, the method further includes: The target snapshot server is scheduled to write the target data block from the cache of the target snapshot server to the snapshot copy.

9. The method according to claim 5, characterized in that Downloading data blocks other than the target data block by using a delayed loading method includes: Determining, according to the metadata server, a snapshot server corresponding to the snapshot ID and snapshot servers corresponding to the remaining snapshot IDs; The snapshot server corresponding to the snapshot ID and the snapshot servers corresponding to the remaining snapshot IDs are scheduled to download data blocks other than the target data block from the object storage node in a delayed loading manner according to the target snapshot chain.

10. The method according to claim 4, characterized in that After determining the target block storage cluster to process the cloud disk cloning request, the method further includes: If there are multiple target block storage clusters, determining a source target block storage cluster from the multiple target block storage clusters based on the cluster identifier corresponding to the existing snapshot copy recorded in the target node, wherein the source target block storage cluster is used to store the data blocks downloaded from the object storage node; The snapshot ID recorded in the target node and the cluster identifier corresponding to the snapshot ID are sent to the metadata servers of the target block storage clusters other than the source target block storage cluster in the multiple target block storage clusters, so that the metadata servers of the target block storage clusters other than the source target block storage cluster initiate data read requests to the source target block storage cluster.

11. A cloud disk cloning system, characterized in that: include: A target node, configured to receive a cloud disk cloning request initiated by the instance management service and determine a target block storage cluster to process the cloud disk cloning request, wherein the cloud disk cloning request includes at least a snapshot ID of a cloud disk snapshot to be used for cloning; A block storage cluster, wherein a cloud disk is provided in the block storage cluster, and the block storage cluster includes the target block storage cluster. The target block storage cluster is used to obtain a target snapshot chain to which the snapshot ID belongs, create a target cloud disk based on the target snapshot chain, and return a cloud disk creation success message to the instance management service to instruct the instance management service to mount the target cloud disk to the instance. After receiving a data read request, the target block storage cluster processes the data read request to import the target data block requested by the data read request to the target cloud disk. An object storage node is used to store the cloud disk snapshot and a snapshot chain corresponding to the cloud disk snapshot, wherein the snapshot chain includes the target snapshot chain.

12. A cloud disk cloning device, characterized in that: include: a receiving unit, configured to receive a cloud disk cloning request initiated by an instance management service, and determine a target block storage cluster to process the cloud disk cloning request, wherein the cloud disk cloning request includes at least a snapshot ID of a cloud disk snapshot used for cloning; an acquiring unit, configured to acquire, from the target block storage cluster, a target snapshot chain to which the snapshot ID belongs, and create a target cloud disk based on the target snapshot chain, wherein the target snapshot chain is used to represent a parent-child relationship between the cloud disk snapshot corresponding to the snapshot ID and the cloud disk snapshots corresponding to the remaining snapshot IDs in the target snapshot chain; a sending unit, configured to return cloud disk creation success information to the instance management service, so as to instruct the instance management service to mount the target cloud disk to the instance, wherein the instance is configured to initiate a data read request to the target block storage cluster where the target cloud disk is located after detecting the target cloud disk; A processing unit is used to process the data read request according to the target block storage cluster to import the target data block requested by the data read request into the target cloud disk, wherein the address of the target data block is determined according to the target snapshot chain.

13. An electronic device, characterized in that: include: a memory storing an executable program; A processor, configured to run the program, wherein the program, when running, executes the cloud disk cloning method according to any one of claims 1 to 10.

14. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the storage medium is located is controlled to execute the cloud disk cloning method according to any one of claims 1 to 10.

15. A computer program product, characterized in that The invention comprises a computer program, which implements the cloud disk cloning method according to any one of claims 1 to 10 when being executed by a processor.