Cloud storage pool mirror image cloning method, electronic equipment and storage medium

By constructing a semi-mesh network connection structure and a specific spanning tree algorithm in the cloud storage pool to dynamically build image cache copies, the problem of slow image cloning speed and high cost in the cloud storage pool is solved, and efficient image cloning at a lower cost is achieved.

CN119363764APending Publication Date: 2025-01-24SICHUAN ZHONGDIAN AOSTAR INFORMATION TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411385450.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In cloud storage pools, mirror cloning speed is slow and costly, and the existing technology is difficult to effectively solve this problem.

Method used

By constructing the semi -network network connection structure, the computing node is connected to the storage pool, and a specific tree algorithm dynamically constructs a mirror cache copy to optimize the cloning path of the mirror.

Benefits of technology

It achieves a significant increase in the speed of image cloning at a lower cost, reduces the average time required to activate a cloud host, and solves the problems of slow speed and high cost of image cloning in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363764A_ABST
    Figure CN119363764A_ABST
Patent Text Reader

Abstract

The invention discloses a cloud storage pool mirror image cloning method, electronic equipment and a storage medium, a semi-mesh network connection structure is constructed between a computing node and a storage pool, mirror image cloning is performed under the semi-mesh network connection structure, and the method comprises the following steps: uploading an original mirror image and caching a mirror image copy; synchronizing the mirror image storage pool with the cached copy data; and obtaining the mirror image cache to execute mirror image cloning. The method comprises the following steps: orderly constructing network connection between storage pools and computing nodes of a cloud platform by adopting a semi-mesh connection mode, searching an optimal storage pool set according to a topological relation and a real-time connection state among the storage pools to construct a mirror image cache copy, and dynamically selecting a proper cache copy to perform mirror image cloning. The average speed of mirror image cloning in the cloud host opening process is greatly increased with low cost, the average time needed by cloud host opening is shortened, the problems existing in an existing mirror image cloning method in a cloud platform are well solved, and the method has good practical application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of cloud storage, and in particular relates to a cloud storage pool mirror cloning method, electronic equipment and storage medium. Background Art

[0002] In medium-to-large enterprise-level cloud platform environments, a large number of heterogeneous storages are usually deployed synchronously to a cloud platform. When cloud users activate cloud hosts, different target storage pools will be allocated to them in the background. Due to the transmission path efficiency from the image storage to the target storage, the startup waiting time is long. If the entire image library is fully copied in all storage pools, it will not only increase the space cost by dozens of times, but also cause the problem of inconsistent copy data.

[0003] In large-scale enterprise-level cloud platforms, the image cloning process requires that images be sent from the storage pool to the target storage pool on demand. All storage pools have image sending requirements. The more connection paths between storage pools and the faster the speed, the faster the image cloning speed will be, but it will greatly increase the construction cost of the cloud platform.

[0004] One solution is to send images from a single image storage pool to other storage pools for each image cloning task, which requires deploying a network connection between the image storage pool and all other storage pools. In this method, the speed of image cloning will be limited by the upper limit of the network connection speed specification, and even if a high-speed network connection is used, when there are too many concurrent tasks, the pressure on the image storage pool to read data will increase significantly, resulting in queuing, which will still lead to a decrease in the average speed of image cloning.

[0005] Another solution is to use each storage pool as mirror storage to store the complete mirror library. This method not only increases the storage space occupied, but also makes it difficult to ensure the consistency of data between a large number of mirror copies.

[0006] Another solution is to use a serial connection method, using a dedicated high-speed storage network to connect multiple storage pools one by one in end-to-end order, placing the image library in one or more intermediate nodes along the entire path, and completing the image cloning by transferring through multiple storage pools. This method will consume additional computing power, and once a network failure occurs, some storage pools will be unavailable. In addition, in actual applications, there are factors such as physical servers, network cards, switches, storage, and other equipment specifications and technical limitations, which make it impossible to find a suitable computing node to connect between two storage pools, and also make it impossible to read image data from certain adjacent storage pools. Summary of the invention

[0007] The object of the present invention is to provide a cloud storage pool image cloning method, electronic device and storage medium to solve the problems of slow speed and high cost in cloud storage pool image cloning.

[0008] The present invention is achieved through the following technical solutions:

[0009] The cloud storage pool image cloning method constructs a semi-mesh network connection structure between the computing node and the storage pool, and performs image cloning under the semi-mesh network connection structure, including the following steps:

[0010] Upload the original image and cache the image copy;

[0011] Synchronize the mirror storage pool with the cache copy data;

[0012] Get the image cache to perform image cloning.

[0013] In some embodiments, a method for constructing a semi-mesh network connection structure between a computing node and a storage pool includes the following steps:

[0014] Use NFS storage as the mirror storage pool, and use Ethernet to connect the mirror storage pool and all computing nodes;

[0015] Multiple computing nodes with the same CPU architecture and similar specifications are used as a computing cluster. A sharable storage pool is configured for each computing cluster. A collection of all shared storage pools is constructed as Smx1. The storage pools in the storage pool collection are numbered sequentially starting from 1. All computing nodes in the computing cluster are connected to the corresponding shared storage pool through a fiber high-speed network.

[0016] Create an XFS file system on the idle hard disk on the computing node to use as a local file storage pool;

[0017] Traverse all computing nodes in each adjacent shared storage pool until a computing node Hx that can connect to both storage pools is found, and connect the computing node Hx to the storage pool that is not yet connected in the two storage pools using a fiber high-speed network;

[0018] Get all even-numbered storage pools from the storage pool set Smx1 to form a new storage pool set Smx2, and number the storage pools in the storage pool set Smx2 in sequence starting from 1; traverse the computing nodes in the computing clusters corresponding to all even-numbered storage pools in the storage pool set Smx2 in sequence until a computing node Hs that can simultaneously connect to its two adjacent storage pools is found, and connect the computing node Hs to two adjacent odd-numbered storage pools through a fiber optic high-speed network to form a semi-mesh network connection structure.

[0019] In some embodiments, when constructing a semi-mesh network connection structure, different shared storage pool types are configured for different computing clusters, including SAN storage pool, distributed block storage pool, distributed file system storage pool, and NFS storage pool.

[0020] In some embodiments, the steps of uploading the original image and caching the image copy include:

[0021] A calculation method getTempCacheStoreage() of a cache storage pool is defined. When the calculation method getTempCacheStoreage() is executed, the set Scx of the mirror cache storage pool can be obtained from the storage pool set according to the topological relationship and online connection status of the current storage pool node and the set spanning tree algorithm;

[0022] Define the method imgCache() for executing template cache, which takes the image number and the collection Scx of the image cache storage pool as parameter input; when executing the method imgCache(), the following process can be achieved:

[0023] Query the database to obtain the image Mgi to be cached currently, and determine that when the image Mgi is in an unfinished cache state and is not in the image cache state, proceed to the next step;

[0024] Query the database to obtain the storage pool set Scs that has completed the cache of the mirror Mgi, and find a storage pool St that is directly connected to the storage pool Si from the storage pool set Scs;

[0025] If storage pool St does not exist, the mirror storage pool is used as storage pool St; traverse all computing nodes to find the computing node hi that is directly connected to storage pool St and storage pool Si and has the smallest corresponding storage network bandwidth occupation;

[0026] The original image of the image Mgi is read from the storage pool St through the computing node hi, the image format is converted to the format corresponding to the storage pool Si, and then the image after the format conversion is written to the storage pool Si, and the cache number, image number, image MD5 code, and cache storage pool number information of the image Mgi are saved to the database;

[0027] Follow the above steps in sequence until the traversal of the set of cache storage pools is completed;

[0028] Define the cache image event listener ImgCacheListener, enter the image number parameter, and run the listener; the process of executing the cache image event listener ImgCacheListener to listen includes:

[0029] Call the calculation method getTempCacheStoreage() to get the cache storage pool collection Scx;

[0030] Call the method imgCache(), input the image number and the set Scs of the image cache storage pool, and execute the current image cache;

[0031] Upload the original image file to the image library, save the file to the image storage pool, calculate the MD5 code of the image file, save the image number, image file path, and image MD5 code to the database, and then immediately asynchronously trigger the image cache event listener ImgCacheListener.

[0032] In some embodiments, when executing the calculation method getTempCacheStoreage(), first, one or more special spanning tree sets Sr are found from the storage pool set Smx1, so that for any vertex in the spanning tree, there is a cache vertex Sc that can be directly connected, and Sc is used as an alternative cache storage pool to form an alternative cache storage pool set; then, the cache effective range, repeated cache paths, and speed differences of different cache storage pools are used as evaluation indicators to select a cache storage pool set Scx from the alternative cache storage pool set.

[0033] In some embodiments, the process of executing the calculation method getTempCacheStoreage() includes:

[0034] Traverse the storage pool set Smx1 in sequence, set the current storage pool to be Si, find the storage pool Sn that is directly connected to the storage pool Si, and define this relationship combination as R(Si, Sn), and define the set of all found relationship combinations as Rx(Si, Sn);

[0035] Traverse the relation set Rx(Si, Sn), use cumulative calculation to obtain the number of times each storage pool appears in Rx(Si, Sn), and arrange them in descending order to obtain an ordered storage pool set Smi;

[0036] Arrange the storage pools that appear the same number of times in the storage pool set Smi in the order of distributed block storage pool, SAN storage pool, distributed file system storage pool, and NFS storage pool to obtain an ordered storage pool set Soi;

[0037] Put the first storage pool in the storage pool set Soi into the mirror cache storage pool set Scx, start traversing from the second storage pool in the storage pool set Soi, set the current storage pool to be Sj, if Sj has no relationship combination with all the storage pools in the storage set Scx, then add Sj to the storage pool set Scx, until the traversal of the storage pool set Soi is completed, and the final mirror cache storage pool set Scx is obtained.

[0038] In some embodiments, the step of synchronizing the mirrored storage pool with the cached copy data includes:

[0039] Start an automatic round-robin task ImgCacheCheckTask, which is executed at the set time every day;

[0040] Check the availability status of the mirror storage pool, and proceed to the next step after confirming that the mirror storage pool is available;

[0041] Query the image list of unfinished cache from the database, traverse the image list, call the calculation method getTempCacheStoreage() to get the cache storage pool set Scx, call the method imgCache(), input the image number and the image cache storage pool set Scs, and execute the current image cache;

[0042] All image cache information is queried from the database. When the MD5 code of the cached image is inconsistent with the original image or the original image does not exist, the cached image is deleted from the current cache storage pool and the current cache information is deleted from the database.

[0043] In some embodiments, the step of obtaining the image cache to perform image cloning includes:

[0044] After receiving the cloud host activation request, find the template image Mgi of the corresponding cloud host from the database, obtain the target storage pool Sn of the cloud host, and perform image cloning preparation;

[0045] Query all cache lists of the image Mgi from the database, traverse the image cache list, set the storage pool where the current cache is located to be Sc, and query the computing node Hi that is directly connected to the storage pools Sn and Sc and is currently connected online;

[0046] If Hi does not exist, the compute node that is directly connected to the query mirror storage pool and storage pool Sc and is currently online is used as the compute node Hi, and the mirror storage pool is used as Sc;

[0047] The image is read from the storage pool Sc by the computing node Hi, the image format is converted into a format corresponding to the target storage pool Sc, and then written into the target storage pool Sc.

[0048] In another aspect, the present invention further provides an electronic device, comprising:

[0049] processor; and,

[0050] A memory, configured to store executable instructions of the processor;

[0051] The processor is configured to execute the cloud storage pool image cloning method by executing the executable instructions.

[0052] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the cloud storage pool image cloning method is implemented.

[0053] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0054] The present invention uses a semi-mesh connection method to orderly build network connections for the storage pools and computing nodes of the cloud platform, uses networks with different speed specifications for hierarchical deployment, and combines a specific spanning tree algorithm. It uses space occupancy, data consistency, computing power consumption, and system availability as evaluation indicators. According to the topological relationship and real-time connection status between the storage pools, the optimal storage pool set is found to build a mirror cache copy, and a suitable cache copy is dynamically selected for mirror cloning. This greatly improves the average speed of mirror cloning in the process of cloud host activation at a relatively low cost, reduces the average time required for cloud host activation, and well solves the problems existing in the existing mirror cloning method in the cloud platform, and has good practical application value. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0056] Figure 1 A topological diagram of a semi-mesh network connection structure constructed in an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.

[0058] Terminology Note:

[0059] Cloud storage pool: A logical storage unit that can be recognized by the cloud platform after the software or hardware storage system is mapped to the cloud platform, such as the LUN volume provided by FCSAN storage, the pool of the CEPH storage cluster, an independent local disk, etc.

[0060] Transit path: Cloud storage pools are not directly connected to each other, but are connected through computing nodes. When a computing node is connected to two storage pools through the network at the same time, this computing node is a transit path.

[0061] Semi-network cloud storage pool: In the same cloud platform, for any storage pool, there is another storage pool directly connected to it, but not any two storage pools are directly connected to each other.

[0062] Storage network: A high-speed network used in the cloud platform to connect each computing node to the storage pool and to carry computing nodes to read and write data from the storage pool.

[0063] Direct transit connection: There is always a computing node between two storage pools that is connected to them through the network, which is called direct transit connection.

[0064] Compute node: A physical server that provides computing power in a cloud platform. Virtual hosts are usually run on compute nodes.

[0065] Image cloning: The process of finding a transit path between the image storage pool and the target storage pool, reading the image from the storage pool where the image is stored through the computing node, and writing it to the target storage pool.

[0066] In large and medium-sized enterprise-level cloud platforms, computing nodes are usually divided into multiple computing clusters, each of which is connected to one or more storage pools. Storage pools can be divided into many different types according to different technical routes, mainly including SAN storage, distributed block storage, NFS storage, distributed file system storage, local file storage, etc. The first four types can support multiple computing nodes to share read and write data, while there are large differences in the mirror read and write speeds of local file storage and different types of storage pools.

[0067] There are one or more storage pools in the cloud platform for storing the original image warehouse, which is called an image storage pool. In the process of opening a cloud host, the most time-consuming step is image cloning, which requires finding a suitable computing node to read the original image from the image storage pool and write it to the target storage pool. The image storage pool usually stores dozens or even hundreds of images, each of which is between 1GB and 10GB in size. When cloning, a large amount of data needs to be transmitted, which often requires a dedicated high-speed storage network to carry it.

[0068] Cloning virtual machine images between two heterogeneous storage pools will incur additional time and computing power consumption due to data mode conversion. Due to technical differences and cost considerations, it may be impossible to find a computing node to connect two heterogeneous storage pools.

[0069] The local storage pool uses the local disk of a computing node to access data. There is no dedicated storage network to carry data transmission between the local storage on other computing nodes. It can only use low-speed networks for other management purposes for mirror cloning. This method may affect its function because the borrowed network bandwidth is occupied for a long time.

[0070] The present invention connects multiple heterogeneous cloud storage pools in a semi-mesh manner with the minimum path through computing nodes, and finds one or more interoperable storage sets through calculations using a specific spanning tree model, so that in each interoperable storage set, there is a mirror cache node that can be cloned in transit for any cloud storage pool, and the speed is the fastest.

[0071] Storage is deployed in an orderly manner according to the interoperable storage sets, and the cache and updates applied by each interoperable storage set are regularly calculated and checked through the image summary. When cloning the image, the cache is read from the current interoperable storage set first, which greatly reduces the average time required for cloud host activation at a lower cost, and has good practical application value.

[0072] The present invention adopts a semi-mesh connection method to build a network connection between each cloud storage pool and computing node of the cloud platform. Taking the cost into consideration, networks with different speed specifications are used for hierarchical deployment. A specific spanning tree model algorithm is used to dynamically find the optimal storage pool set according to the topological relationship and real-time connection status between each storage pool to build a mirror cache copy, and dynamically find a suitable cache copy for mirror cloning, so as to greatly improve the average speed of cloud host activation.

[0073] In some embodiments of the present invention, a cloud storage pool image cloning method includes the following steps:

[0074] S01. Build a semi-mesh network connection between the computing nodes and the storage pool.

[0075] include:

[0076] S011. Use NFS storage as the mirror storage pool, and use low-cost 1Gbps low-speed Ethernet to connect the mirror storage pool and all computing nodes.

[0077] S012. Divide every 3-24 computing nodes with the same CPU architecture and similar specifications into a computing cluster. Configure a sharable storage pool for each computing cluster. Build a set of all shared storage pools, Smx1. Number the storage pools in the storage pool set sequentially starting from 1.

[0078] All computing nodes in the computing cluster are connected to the corresponding shared storage pool through a 10Gbps-40Gbps optical fiber high-speed network.

[0079] Different computing clusters can be configured with different shared storage pool types, including SAN storage pool, distributed block storage pool, distributed file system storage pool, and NFS storage pool.

[0080] S013. Create an XFS file system on an idle hard disk on the computing node as needed to serve as a local file storage pool.

[0081] S014. Traverse all computing nodes in each adjacent shared storage pool until a computing node Hx that can connect to both storage pools is found, and connect the computing node Hx to the storage pool that is not yet connected in the two storage pools using a 10Gbps-40Gbps optical fiber high-speed network.

[0082] If two storage pools cannot find a suitable computing node to connect due to the limitations of the specifications and technologies of physical servers, network cards, switches, storage, etc., the connection will not be made.

[0083] S015. Obtain all storage pools with even numbers from the storage pool set Smx1 to form a new storage pool set Smx2, and number the storage pools in the storage pool set Smx2 in sequence starting from 1.

[0084] In the computing clusters corresponding to all even-numbered storage pools in the storage pool set Smx2, the computing nodes are traversed in sequence until a computing node Hs that can simultaneously connect to its two adjacent storage pools is found, and the computing node Hs is connected to the two adjacent storage pools with odd numbers through a 10Gbps-40Gbps optical fiber high-speed network to form a semi-mesh network connection structure.

[0085] The topology diagram of the semi-mesh network connection structure constructed based on the above method is as follows: Figure 1 described.

[0086] S02. Upload the original image and cache the image copy.

[0087] include:

[0088] S021. Predefine a calculation method getTempCacheStoreage() of the cache storage pool through a Java program;

[0089] The calculation method calculates the mirror cache storage pool set Scx from the storage pool set Smx1 according to the topological relationship and online connection status of the current storage pool nodes and a specific spanning tree algorithm.

[0090] The calculation method first finds one or more special spanning tree sets Sr from the storage pool set Smx1, so that for any vertex in the spanning tree, there is a cache vertex Sc that can be directly connected, and Sc is used as an alternative cache storage pool to form an alternative cache storage pool set.

[0091] Then, taking into account factors such as the effective range of cache, repeated cache paths, speed differences of different cache storage pools, etc., a cache storage pool set Scx is selected from the candidate cache storage pool sets.

[0092] The implementation process of the calculation method getTempCacheStoreage() includes the following steps:

[0093] S0211. Traverse the storage pool set Smx1 in sequence, assume that the current storage pool is Si, find the storage pool Sn that is directly connected to the storage pool Si, and define this relationship combination as R(Si, Sn), and define the set of all found relationship combinations as Rx(Si, Sn).

[0094] S0212. Traverse the relationship set Rx(Si, Sn), use cumulative calculation to obtain the number of times each storage pool appears in Rx(Si, Sn), and arrange them in descending order to obtain an ordered storage pool set Smi.

[0095] S0213. Arrange the storage pools that appear the same number of times in the storage pool set Smi in the order of distributed block storage pool, SAN storage pool, distributed file system storage pool, and NFS storage pool to obtain an ordered storage pool set Soi.

[0096] S0214, define the set of image cache storage pools as Scx;

[0097] First, put the first storage pool in the storage pool set Soi into the mirror cache storage pool set Scx, and start traversing from the second storage pool in the storage pool set Soi. Suppose the current storage pool is Sj. If Sj does not have a relationship combination with all the storage pools in the storage set Scx, then add Sj to the storage pool set Scx until the traversal of the storage pool set Soi is completed, and the final mirror cache storage pool set Scx is obtained.

[0098] S022, pre-define the method ImgCache (imageId, cacheStorageList) for executing template cache through the Java program, and input the image number and the set Scx of the image cache storage pool as parameters; the implementation process of this method imgCache () is as follows:

[0099] S0221, query the database to obtain the image Mgi to be cached currently, and determine that when the image Mgi is in an unfinished cache state and is not in the image cache state, proceed to the next step.

[0100] S0222. Query the database to obtain the storage pool set Scs that has completed caching of the mirror Mgi, and find a storage pool St that is directly connected to the storage pool Si from the storage pool set Scs.

[0101] S0223. If the storage pool St does not exist, the mirror storage pool is used as the storage pool St; all computing nodes are traversed to find the computing node hi that is directly connected to the storage pool St and the storage pool Si and has the smallest corresponding storage network bandwidth occupancy.

[0102] S0224. Read the original image of the image Mgi from the storage pool St through the computing node hi based on the high-speed storage network or the low-speed management network, convert the image format into a format corresponding to the storage pool Si, and then write the image after the format conversion into the storage pool Si through the high-speed storage network. At the same time, save the cache number, image number, image MD5 code, cache storage pool number and other information of the image Mgi into the database.

[0103] S0225. Execute the above steps in sequence until the traversal of the set of cache storage pools is completed.

[0104] S023. Predefine the cache image event listener ImgCacheListener through the Java program, input the image number parameter, and run the listener; the process implemented inside the listener ImgCacheListener includes:

[0105] S0231. Call the calculation method getTempCacheStoreage() to obtain the set Scx of cache storage pools.

[0106] S0232. Call the method imgCache(), input the image number and the set Scs of the image cache storage pool, and execute the current image cache.

[0107] S024. The administrator uploads the original image file to the image library from the web interface. The background saves the file to the image storage pool through the Java program, calculates the MD5 code of the image file, and saves the image number, image file path, image MD5 code and other information to the database, and then immediately asynchronously triggers the image cache event listener ImgCacheListener.

[0108] S03. Synchronize the mirror storage pool with the cache copy data.

[0109] include:

[0110] S031. Start an automatic round-robin task ImgCacheCheckTask, which is executed at 1:00 every day.

[0111] S032. Check the availability status of the mirror storage pool, and proceed to the next step after confirming that the mirror storage pool is available.

[0112] S033, query the image list of unfinished caching from the database, traverse the image list, call the calculation method getTempCacheStoreage() to obtain the set of cache storage pools Scx, call the method imgCache(), input the image number and the set of image cache storage pools Scs, and execute the current image cache.

[0113] S034. Query all image cache information from the database. When the md5 code of the cache image is inconsistent with the original image or the original image does not exist, delete the cache image from the current cache storage pool and delete the current cache information from the database.

[0114] S04, obtaining the image cache and performing image cloning.

[0115] S041. After receiving the cloud host activation request, the cloud platform system finds the template image Mgi corresponding to the cloud host from the database, obtains the target storage pool Sn of the cloud host, and performs image cloning preparation.

[0116] S042. Query all cache lists of the image Mgi from the database, traverse the image cache list, set the storage pool where the current cache is located to be Sc, and query the computing node Hi that is directly connected to the storage pools Sn and Sc and is currently connected online.

[0117] S043. If Hi does not exist, the computing node that is directly connected to the query mirror storage pool and the storage pool Sc and is currently connected online is used as the computing node Hi, and the mirror storage pool is used as Sc.

[0118] S044. Read the image from the storage pool Sc through the computing node Hi, convert the image format into a format corresponding to the target storage pool Sc, and then write it into the target storage pool Sc.

[0119] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification or equivalent change made to the above embodiment based on the technical essence of the present invention shall fall within the protection scope of the present invention.

Claims

1. A cloud storage pool image cloning method, characterized in that: A semi-mesh network connection structure is constructed between the computing nodes and the storage pool, and image cloning is performed under the semi-mesh network connection structure, including the following steps: Upload the original image and cache the image copy; Synchronize the mirror storage pool with the cache copy data; Get the image cache to perform image cloning.

2. The cloud storage pool image cloning method according to claim 1, characterized in that: The method for constructing a semi-mesh network connection structure between a computing node and a storage pool includes the following steps: Use NFS storage as the mirror storage pool, and use Ethernet to connect the mirror storage pool and all computing nodes; Multiple computing nodes with the same CPU architecture and similar specifications are used as a computing cluster. A sharable storage pool is configured for each computing cluster. A collection of all shared storage pools is constructed as Smx1. The storage pools in the storage pool collection are numbered sequentially starting from 1. All computing nodes in the computing cluster are connected to the corresponding shared storage pool through a fiber high-speed network. Create an XFS file system on the idle hard disk on the computing node to use as a local file storage pool; Traverse all computing nodes in each adjacent shared storage pool until a computing node Hx that can connect to both storage pools is found, and connect the computing node Hx to the storage pool that is not yet connected in the two storage pools using a fiber high-speed network; Get all even-numbered storage pools from the storage pool set Smx1 to form a new storage pool set Smx2, and number the storage pools in the storage pool set Smx2 in sequence starting from 1; traverse the computing nodes in the computing clusters corresponding to all even-numbered storage pools in the storage pool set Smx2 in sequence until a computing node Hs that can simultaneously connect to its two adjacent storage pools is found, and connect the computing node Hs to two adjacent odd-numbered storage pools through a fiber optic high-speed network to form a semi-mesh network connection structure.

3. The cloud storage pool image cloning method according to claim 2, characterized in that: When building a semi-mesh network connection structure, different shared storage pool types are configured for different computing clusters, including SAN storage pool, distributed block storage pool, distributed file system storage pool, and NFS storage pool.

4. The cloud storage pool image cloning method according to claim 1, characterized in that: The steps to upload the original image and cache the image copy include: A calculation method getTempCacheStoreage() of a cache storage pool is defined. When the calculation method getTempCacheStoreage() is executed, the set Scx of the mirror cache storage pool can be obtained from the storage pool set according to the topological relationship and online connection status of the current storage pool node and the set spanning tree algorithm; Define the method imgCache() for executing template cache, which takes the image number and the collection Scx of the image cache storage pool as parameter input; when executing the method imgCache(), the following process can be achieved: Query the database to obtain the image Mgi to be cached currently, and determine that when the image Mgi is in an unfinished cache state and is not in the image cache state, proceed to the next step; Query the database to obtain the storage pool set Scs that has completed the cache of the mirror Mgi, and find a storage pool St that is directly connected to the storage pool Si from the storage pool set Scs; If storage pool St does not exist, the mirror storage pool is used as storage pool St; traverse all computing nodes to find the computing node hi that is directly connected to storage pool St and storage pool Si and has the smallest corresponding storage network bandwidth occupation; The original image of the image Mgi is read from the storage pool St through the computing node hi, the image format is converted to the format corresponding to the storage pool Si, and then the image after the format conversion is written to the storage pool Si, and the cache number, image number, image MD5 code, and cache storage pool number information of the image Mgi are saved to the database; Follow the above steps in sequence until the traversal of the set of cache storage pools is completed; Define the cache image event listener ImgCacheListener, enter the image number parameter, and run the listener; the process of executing the cache image event listener ImgCacheListener to listen includes: Call the calculation method getTempCacheStoreage() to get the cache storage pool collection Scx; Call the method imgCache(), input the image number and the set Scs of the image cache storage pool, and execute the current image cache; Upload the original image file to the image library, save the file to the image storage pool, calculate the MD5 code of the image file, save the image number, image file path, and image MD5 code to the database, and then immediately asynchronously trigger the image cache event listener ImgCacheListener.

5. The cloud storage pool image cloning method according to claim 4, characterized in that: When executing the calculation method getTempCacheStoreage(), first find one or more special spanning tree sets Sr from the storage pool set Smx1, so that for any vertex in the spanning tree, there is a cache vertex Sc that can be directly connected, and Sc is used as an alternative cache storage pool to form an alternative cache storage pool set; then, the cache effective range, repeated cache paths, and speed differences of different cache storage pools are used as evaluation indicators to select a cache storage pool set Scx from the alternative cache storage pool set.

6. The cloud storage pool image cloning method according to claim 5, characterized in that: The process of executing the calculation method getTempCacheStoreage() includes: Traverse the storage pool set Smx1 in sequence, set the current storage pool to be Si, find the storage pool Sn that is directly connected to the storage pool Si, and define this relationship combination as R(Si, Sn), and define the set of all found relationship combinations as Rx(Si, Sn); Traverse the relation set Rx(Si, Sn), use cumulative calculation to obtain the number of times each storage pool appears in Rx(Si, Sn), and arrange them in descending order to obtain an ordered storage pool set Smi; Arrange the storage pools that appear the same number of times in the storage pool set Smi in the order of distributed block storage pool, SAN storage pool, distributed file system storage pool, and NFS storage pool to obtain an ordered storage pool set Soi; Put the first storage pool in the storage pool set Soi into the mirror cache storage pool set Scx, start traversing from the second storage pool in the storage pool set Soi, set the current storage pool to be Sj, if Sj has no relationship combination with all the storage pools in the storage set Scx, then add Sj to the storage pool set Scx, until the traversal of the storage pool set Soi is completed, and the final mirror cache storage pool set Scx is obtained.

7. The cloud storage pool image cloning method according to claim 4, characterized in that: The steps to synchronize the mirrored storage pool with the cached copy data include: Start an automatic round-robin task ImgCacheCheckTask, which is executed at the set time every day; Check the availability status of the mirror storage pool, and proceed to the next step after confirming that the mirror storage pool is available; Query the image list of unfinished cache from the database, traverse the image list, call the calculation method getTempCacheStoreage() to get the cache storage pool set Scx, call the method imgCache(), input the image number and the image cache storage pool set Scs, and execute the current image cache; All image cache information is queried from the database. When the MD5 code of the cached image is inconsistent with the original image or the original image does not exist, the cached image is deleted from the current cache storage pool and the current cache information is deleted from the database.

8. The cloud storage pool image cloning method according to claim 4, characterized in that: The steps to obtain the image cache and perform image cloning include: After receiving the cloud host activation request, find the template image Mgi of the corresponding cloud host from the database, obtain the target storage pool Sn of the cloud host, and perform image cloning preparation; Query all cache lists of the image Mgi from the database, traverse the image cache list, set the storage pool where the current cache is located to be Sc, and query the computing node Hi that is directly connected to the storage pools Sn and Sc and is currently connected online; If Hi does not exist, the compute node that is directly connected to the query mirror storage pool and storage pool Sc and is currently online is used as the compute node Hi, and the mirror storage pool is used as Sc; The image is read from the storage pool Sc through the computing node Hi, the image format is converted into a format corresponding to the target storage pool Sc, and then written into the target storage pool Sc.

9. An electronic device, characterized in that: include: processor; as well as, A memory, configured to store executable instructions of the processor; The processor is configured to execute the cloud storage pool image cloning method according to any one of claims 1 to 8 by executing the executable instructions.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the cloud storage pool image cloning method according to any one of claims 1 to 8 is implemented.