Virtual machine image data distribution method, apparatus, device, and storage medium
By copying and distributing image data from the image storage system to the cloud disk storage cluster, and using copy-on-write technology to create virtual machines, the problem of excessive load on the image storage system is solved, and the efficiency of virtual machine creation is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-28
- Publication Date
- 2026-03-31
AI Technical Summary
When creating a large number of virtual machines, the image storage system becomes overloaded, resulting in excessively long virtual machine creation times.
The image data is stored in the image storage system, and it is determined whether the target image data has been stored in the cloud disk image cache cluster. If it has not been stored, it is copied to the cloud disk image cache cluster. When the number of virtual machines reaches the preset value, the image data is distributed to multiple cloud disk storage clusters through a tree-shaped forwarding method, and virtual machines are created using copy-on-write technology.
It reduces virtual machine creation time, lowers the load on the image storage system, and improves virtual machine creation speed.
Smart Images

Figure CN115865948B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a method, apparatus, device, and storage medium for distributing virtual machine image data. Background Technology
[0002] With the development of computer technology, virtual machines are being used in increasingly widespread scenarios. A virtual machine refers to a complete computer system simulated by software, possessing full hardware system functionality and running in a completely isolated environment. When creating a virtual machine on a computer, a portion of the physical machine's hard drive and memory capacity needs to be used as the virtual machine's hard drive and memory capacity. Creating a virtual machine also requires cloning the virtual machine image data.
[0003] In existing technologies, all image data is stored in the image storage system. After receiving the instruction to create a virtual machine, the image data needs to be read from the image storage system and forwarded to the currently created virtual machine. However, when a large number of virtual machines of the same type are created at the same time, the image storage system has a large amount of image data to forward at the same time, which will greatly increase the load on the image storage system. At this time, the virtual machine creation time is long. Summary of the Invention
[0004] In view of this, this application provides a virtual machine image data distribution method, apparatus, device and storage medium to solve the problem in the prior art that when a large number of virtual machines are created, a large amount of image data needs to be forwarded in the same period of time, the image storage system is heavily loaded and the virtual machine creation time is long.
[0005] To achieve the above objectives, the following proposed solution is given:
[0006] A method for distributing virtual machine image data includes:
[0007] Obtain virtual machine image data;
[0008] The image data is stored in an image storage system, which is a preset system for storing image data;
[0009] Determine whether the target image data required to create the virtual machine in the current instruction has been stored in the cloud disk image cache cluster;
[0010] If the target image data is not stored in the cloud disk image cache cluster, then copy the target image data from the image storage system to the cloud disk image cache cluster;
[0011] Determine whether the number of virtual machines created in the current instruction has reached the preset value;
[0012] If the number of virtual machines created in the current instruction reaches a preset value, the target image data in the cloud disk image cache cluster is forwarded to each cloud disk storage cluster in the first cloud disk storage set through a tree-like forwarding method. The first cloud disk storage set includes at least one cloud disk storage cluster in the cloud disk storage system other than the cloud disk image cache cluster.
[0013] Preferably, after forwarding the target image data in the cloud disk image cache cluster to each cloud disk storage cluster in the first cloud disk storage set via tree-structured forwarding, the method further includes:
[0014] Using copy-on-write technology, virtual machines are created in each cloud disk storage cluster of the cloud disk image cache cluster and the first cloud disk storage set based on the target image data.
[0015] Preferably, after determining whether the target image data required for creating the virtual machine in the current instruction has been stored in the cloud disk image cache cluster, the method further includes:
[0016] If the number of virtual machines created in the current instruction does not reach the preset value, then the copy-on-write technique is used to create virtual machines in the cloud disk image cache cluster based on the target image data.
[0017] Preferably, after creating a virtual machine in the cloud disk image cache cluster based on the target image data using copy-on-write technology, the method further includes:
[0018] The system disk of the virtual machine created in the cloud disk image cache cluster is migrated to the cloud disk storage cluster in the second cloud disk storage set, which includes at least one cloud disk storage cluster in the cloud disk storage system other than the image cache cluster.
[0019] Preferably, forwarding the target image data in the cloud disk image cache cluster to each cloud disk storage cluster in the first cloud disk storage set via a tree-structured forwarding method includes:
[0020] The cloud disk storage clusters in the cloud disk storage system are filtered based on at least one of the free capacity and IO pressure of each cloud disk storage cluster in the cloud disk storage system to obtain the first cloud disk storage set;
[0021] The target image data in the cloud disk image cache cluster is forwarded to each cloud disk storage cluster in the first cloud disk storage set through a tree-shaped forwarding method.
[0022] Preferably, before determining whether the target image data required to create the virtual machine in the current instruction has been stored in the cloud disk image cache cluster, the method further includes:
[0023] In response to the user's operation of selecting a cloud disk image cache cluster, the cloud disk storage cluster specified by the user in the cloud disk storage system is used as the cloud disk image cache cluster.
[0024] Preferably, after obtaining the virtual machine image data, the method further includes:
[0025] The mirror data is sliced according to a preset size to obtain a set of mirror data shards, and the set of mirror data shards includes at least one mirror data shard.
[0026] Storing the image data in an image storage system includes:
[0027] The image data fragment set is stored in the image storage system.
[0028] A virtual machine image data distribution device, comprising:
[0029] Image data acquisition unit, used to acquire virtual machine image data;
[0030] A mirror data storage unit is used to store the mirror data in a mirror storage system, wherein the mirror storage system is a preset system for storing mirror data;
[0031] The target image data storage judgment unit is used to determine whether the target image data required for creating the virtual machine in the current instruction has been stored in the cloud disk image cache cluster;
[0032] If the target image data is not stored in the cloud disk image cache cluster, then the target image data copying unit step is executed;
[0033] The target image data replication unit is used to replicate the target image data in the image storage system to the cloud disk image cache cluster;
[0034] The virtual machine quantity determination unit is used to determine whether the number of virtual machines created in the current instruction has reached a preset value;
[0035] If the number of virtual machines created in the current instruction reaches a preset value, then the steps of the target image data forwarding unit are executed;
[0036] The target image data forwarding unit is used to forward the target image data in the cloud disk image cache cluster to each cloud disk storage cluster in the first cloud disk storage set through a tree-shaped forwarding method. The first cloud disk storage set includes at least one cloud disk storage cluster in the cloud disk storage system other than the cloud disk image cache cluster.
[0037] A virtual machine image data distribution device includes: a memory and a processor;
[0038] The memory is used to store programs;
[0039] The processor is used to execute the program to implement each step of the aforementioned virtual machine image data distribution method.
[0040] A storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned virtual machine image data distribution method.
[0041] As can be seen from the above technical solutions, the virtual machine image data distribution method provided in this application stores the virtual machine image data in an image storage system. If the target image data required for creating a virtual machine is not stored in the image cache cluster, the target image data is copied from the image storage system to the image cache cluster in the cloud disk storage system. If the number of virtual machines being created is large, the image data in the image cache cluster can be forwarded to each cloud disk storage cluster in the first cloud disk storage set through a tree-like forwarding method. The first cloud disk storage set includes at least one cloud disk storage cluster in the cloud disk storage system other than the cloud disk image cache cluster. Therefore, by copying the target image data from the image storage system to the image cache cluster, when the number of virtual machines being created is small, virtual machines can be created directly in the image cache cluster based on the target image data without the need for forwarding the target image data, thus reducing the time required to create virtual machines. When the number of virtual machines being created is large, the tree-like forwarding method distributes the data forwarding workload of the image storage system, reducing the load on the image storage system and improving the speed of virtual machine creation. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0043] Figure 1 A flowchart illustrating a virtual machine image data distribution method provided in this application embodiment;
[0044] Figure 2 A schematic diagram of a tree-shaped forwarding process provided in an embodiment of this application;
[0045] Figure 3 A schematic diagram of a copy-on-write process provided in an embodiment of this application;
[0046] Figure 4 A structural diagram of a virtual machine image data distribution device provided in an embodiment of this application;
[0047] Figure 5 This is a hardware structure block diagram of a virtual machine image data distribution device provided in an embodiment of this application. Detailed Implementation
[0048] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0049] Next, combined Figure 1 This application introduces a virtual machine image data distribution method, such as... Figure 1 As shown, the method may include:
[0050] Step S1: Obtain virtual machine image data.
[0051] Specifically, it retrieves all the image data that a user might need to create a virtual machine.
[0052] Step S2: Store the image data in the image storage system.
[0053] Specifically, all acquired image data is stored in the image storage system. The image storage system is a user-preset system for storing image data. The image storage system can be deployed in a distributed architecture, with at least one image storage system deployed in each availability zone. The availability zone is a geographical area within the same service area where power and network are independent of each other.
[0054] Step S3: Determine whether the target image data required to create the virtual machine in the current instruction has been stored in the cloud disk image cache cluster.
[0055] Specifically, the cloud disk image cache cluster is a cloud disk storage cluster within the cloud disk storage system. When a user creates a virtual machine, the virtual machine's system disk is preferentially allocated to the cloud disk image cache cluster. Therefore, before creating the virtual machine in the current instruction, it is necessary to determine whether the target image data required for creating the virtual machine in the current instruction is stored in the cloud disk image cache cluster.
[0056] If the target image data is not stored in the cloud disk image cache cluster, proceed to step S4. If the target image data has been stored in the cloud disk cache cluster, proceed to step S5.
[0057] Step S4: Copy the target image data from the image storage system to the cloud disk image cache cluster.
[0058] Specifically, the image storage system stores all the image data that may be used to create a virtual machine. Therefore, if the target image data required for creating a virtual machine in the current instruction is not stored in the cloud disk image cache cluster, the target image data required for creating a virtual machine in the current instruction can be copied from the image storage system that stores all the image data to the cloud disk image cache cluster.
[0059] Step S5: Determine whether the number of virtual machines created in the current instruction has reached the preset value.
[0060] Specifically, if the number of virtual machines created in the current command is large, the system cloud disk of the virtual machine will be preferentially allocated to the cloud disk image cache cluster. Therefore, it may cause the cloud disk image cache cluster to be insufficient in capacity. Therefore, before creating virtual machines, it is possible to determine in advance whether the number of virtual machines created in the current command has reached the preset value that may cause the cloud disk image cache cluster to be insufficient in capacity.
[0061] If the number of virtual machines created in the current instruction reaches a preset value, then step S6 is executed.
[0062] Step S6: Forward the target image data in the cloud disk image cache cluster to each cloud disk storage cluster in the first cloud disk storage set through a tree-like forwarding method.
[0063] Specifically, if the number of virtual machines created in the current instruction would cause insufficient capacity of the cloud disk image cache cluster, the target image data required for creating the virtual machines in the current instruction is copied from the cloud disk image cache cluster, and the target image data required for creating the virtual machines in the current instruction is forwarded to each cloud disk storage cluster in the first cloud disk storage set through a tree-like forwarding method.
[0064] The first cloud disk storage set includes at least one cloud disk storage cluster in the cloud disk storage system other than the cloud disk image cache cluster.
[0065] The tree-structured forwarding method copies the target image data required for creating a virtual machine in the current instruction from the cloud disk image cache cluster to N cloud disk storage clusters in the first cloud disk storage set. Then, each of the N cloud disk storage clusters copies the target image data required for creating the virtual machine in the current instruction to another N cloud disk storage clusters in the first cloud disk storage set, and so on, achieving exponential forwarding. N is a positive integer other than 1. Examples are shown below. Figure 2 Taking the case of N=2 as an example, the process of forwarding target mirror data is introduced as follows:
[0066] The target image data is copied from the image storage system to the cloud disk image cache cluster. Then, the target image data is forwarded from the cloud disk cache cluster to cloud disk storage cluster 1 and cloud disk storage cluster 2 in a tree-like manner. Cloud disk storage cluster 1 forwards the target image data to cloud disk storage cluster 3 and cloud disk storage cluster 4 in a tree-like manner. Cloud disk storage cluster 2 forwards the target image data to cloud disk storage cluster 5 and cloud disk storage cluster 6, and so on, until the target image data is stored in each cloud disk storage cluster of the first cloud disk storage set, thus completing the entire tree-like forwarding process.
[0067] This application provides a virtual machine image data distribution method. The virtual machine image data is stored in an image storage system. If the target image data required for creating a virtual machine is not stored in the image cache cluster, the target image data is copied from the image storage system to the image cache cluster in the cloud disk storage system. If the number of virtual machines being created is large, the image data in the image cache cluster can be forwarded to each cloud disk storage cluster in a first cloud disk storage set via a tree-like forwarding method. The first cloud disk storage set includes at least one cloud disk storage cluster in the cloud disk storage system other than the cloud disk image cache cluster. Therefore, by copying the target image data from the image storage system to the image cache cluster, this application allows for direct creation of virtual machines based on the target image data in the image cache cluster when the number of virtual machines is small, eliminating the need for target image data forwarding and reducing the time required for virtual machine creation. When the number of virtual machines is large, the tree-like forwarding method distributes the data forwarding workload of the image storage system, reducing the load on the image storage system and increasing the speed of virtual machine creation.
[0068] After the target image data is distributed, virtual machines need to be created. This application provides two optional methods for creating virtual machines in different situations, as follows:
[0069] In the first case, after determining in step S5 whether the number of virtual machines created in the current instruction has reached the preset value, if the number of virtual machines created in the current instruction has not reached the preset value, then step S7 is executed.
[0070] Step S7: Using copy-on-write technology, a virtual machine is created in the cloud disk image cache cluster based on the target image data.
[0071] Specifically, when the number of virtual machines (VMs) being created is small, the system disks of all VMs created in the current command can be allocated to the cloud disk image cache cluster. Using copy-on-write technology, VMs can be directly created within the cloud disk image cache cluster based on the target image data required for the current command. Furthermore, copy-on-write technology allows multiple VMs to be launched simultaneously based on the same target image data.
[0072] Copy-on-write is an optimization strategy in the field of computer programming. The core idea of copy-on-write is that when multiple callers request the same data at the same time, the callers will share the same copy of the data. Only when a caller attempts to modify the data will a dedicated copy be made for that caller, while the original resource seen by other callers remains unchanged. Figure 3 This refers to the process of modifying data using copy-on-write technology, such as... Figure 3 As shown: If you want to change data B in the source volume to data Y, you can use copy-on-write technology to create a snapshot volume and write data Y directly to position 2 in the snapshot volume corresponding to the position of data B in the source volume, while the data B in the source volume remains unchanged.
[0073] In the second scenario, after forwarding the target image data in the cloud disk image cache cluster to each cloud disk storage cluster in the first cloud disk storage set via tree-like forwarding in step S6, step S8 can be executed.
[0074] Step S8: Using copy-on-write technology, virtual machines are created in each cloud disk storage cluster in the cloud disk image cache cluster and the first cloud disk storage set based on the target image data.
[0075] Specifically, after the distribution of the target image data required for the current instruction to create a virtual machine has been completed, the target image data required for the current instruction to create a virtual machine has been stored in each cloud disk storage cluster of the cloud disk image cache cluster and the first cloud disk storage set. When creating a virtual machine, the copy-on-write technology can be used to create a virtual machine based on the target image data required for the current instruction to create a virtual machine in each cloud disk storage cluster of the cloud disk image cache cluster and the first cloud disk storage cluster.
[0076] The two virtual machine creation methods provided in this application utilize copy-on-write technology, allowing multiple virtual machines to be created based on the same target image data. The target image data is only copied again when the user modifies it. This reduces the target image data copying time, enabling the rapid creation of a large number of virtual machines based on the target image data, thus reducing the overall virtual machine creation time.
[0077] Next, in some embodiments of this application, the process of forwarding the target image data in the cloud disk image cache cluster to each cloud disk storage cluster in the first cloud disk storage set through a tree-like forwarding method in step S6 will be described as follows:
[0078] Step S61: Based on at least one of the free capacity and IO pressure of each cloud disk storage cluster in the cloud disk storage system, filter the cloud disk storage clusters in the cloud disk storage system to obtain the first cloud disk storage set.
[0079] Specifically, based on the free capacity and IO pressure of each cloud disk storage cluster in the cloud disk storage system, the virtual machines created in the current instruction are allocated, and the virtual machines to be created are assigned to the cloud disk image cache cluster and other cloud disk storage clusters for creation. The cloud disk storage clusters other than the cloud disk image cache cluster assigned to the virtual machine creation task are designated as the first cloud disk storage set.
[0080] In this context, a large amount of free capacity in a cloud storage cluster indicates that it can accommodate a large number of virtual machines (VMs). Conversely, low I / O pressure in a cloud storage cluster suggests that it can support data read operations from multiple VMs. Therefore, when allocating VMs created in the current instruction based on the free capacity and I / O pressure of each cloud storage cluster, more VMs created in the current instruction will be allocated to cloud storage clusters with large free capacity and low I / O pressure. Allocating VMs in the current instruction based on the free capacity and I / O pressure of the cloud storage clusters allows for more efficient use of the capacity within each cluster while ensuring the speed of data read operations for the last created VM.
[0081] Step S62: The target image data in the cloud disk image cache cluster is forwarded to each cloud disk storage cluster in the first cloud disk storage set through a tree-structured forwarding method.
[0082] Specifically, the cloud disk image cache cluster is used as a root node, and the target image data required for creating a virtual machine in the current instruction in the cloud disk image cache cluster is forwarded to each cloud disk storage cluster in the first cloud disk storage set in a tree-like forwarding manner.
[0083] The first cloud disk storage set filtering method provided in this application allocates the number of virtual machines to be created based on the free capacity and IO pressure of each cloud disk storage cluster in the cloud disk storage system. The cloud disk storage clusters allocated to virtual machine creation tasks, excluding the cloud disk image cache cluster, are taken as the first cloud disk storage set. The target image data only needs to be forwarded to each cloud disk storage cluster in the first cloud disk storage set, instead of being forwarded to all cloud disk storage clusters, which improves the efficiency of image data forwarding.
[0084] Since the system disk of a virtual machine is preferentially allocated to the cloud disk image cache cluster each time it is created, and the capacity of the cloud disk image cache cluster is limited, this application proposes an optional solution to better utilize the capacity of the cloud disk image cache cluster, as follows:
[0085] After creating a virtual machine in the cloud disk image cache cluster based on the target image data using copy-on-write technology in steps S7 and S8, step S9 can be executed.
[0086] Step S9: Migrate the system disk of the virtual machine created in the cloud disk image cache cluster to the cloud disk storage cluster in the second cloud disk storage set.
[0087] Specifically, after the virtual machine is created, the system disk of the virtual machine created in the cloud disk cache cluster can be migrated online to each cloud disk storage cluster in the second cloud disk storage set in the cloud disk storage system. The second cloud disk storage set includes at least one cloud disk storage cluster in the cloud disk storage system other than the image cache cluster. The cloud disk storage clusters in the second cloud disk storage set may or may not include the cloud disk storage clusters in the first cloud disk storage set.
[0088] This application provides a method for utilizing the capacity of a cloud disk image cache cluster. By migrating the system disk of a virtual machine in the cloud disk image cache cluster to another cloud disk storage cluster, the capacity occupied by the cloud disk image cache cluster is reduced, allowing the cloud disk image cache cluster to be fully utilized.
[0089] In some embodiments of this application, before determining whether the target image data required to create the virtual machine in the current instruction has been stored in the cloud disk image cache cluster in step S3, the following step S03 can be performed.
[0090] Step S03: In response to the user's operation of selecting a cloud disk image cache cluster, the cloud disk storage cluster specified by the user in the cloud disk storage system is used as the cloud disk image cache cluster.
[0091] Specifically, the cloud disk storage system adopts a distributed architecture, and a large number of cloud disk storage clusters are deployed in the cloud disk storage system. It can respond to the user's operation of selecting a cloud disk image cache cluster in the cloud disk storage system, and use the cloud disk storage cluster selected by the user in the cloud disk storage system as the cloud disk image cache cluster.
[0092] In this embodiment, by responding to the user's operation of selecting a cloud disk image cluster, the cloud disk storage cluster specified by the user in the cloud disk storage system is used as the cloud disk image cache cluster. The target image data required for creating the virtual machine in the current instruction is copied from the image storage system to the cloud disk image cache cluster. When the virtual machine is created, the system disk of the virtual machine is preferably allocated in the cloud disk image cache cluster, which reduces the forwarding volume of the target image data.
[0093] The image storage system stores a large amount of image data. In order to better store the image data, this application embodiment provides an optional solution. After obtaining the virtual machine image data in step S1, the following step S01 can be performed:
[0094] Step S01: Slice the mirror data according to a preset size to obtain a set of mirror data slices.
[0095] Specifically, the mirrored data is divided into mirrored data shards of a certain size to obtain a set of mirrored data shards, wherein the set of mirrored data shards includes at least one mirrored data shard. Since the mirrored storage system has a distributed architecture, the mirrored data shards in the set of mirrored data shards can be stored on different storage nodes of the mirrored storage system.
[0096] This application provides a method for processing image data, which involves storing image data in image storage systems in fragments. Since the image storage system is a distributed architecture, storing image data in fragments can more effectively utilize the capabilities of each storage node in the image storage system.
[0097] In addition, in order to better store users' high-frequency image data, after copying the target image data from the image storage system to the cloud disk image cache cluster in step S4, the following step S04 can be performed.
[0098] Step S04: Use the LRU (Least Recently Used) algorithm to manage the target image data in the cloud disk image cache cluster.
[0099] Specifically, the LRU algorithm can be used to ensure that the cloud disk image cache cluster retains only the target image data needed for the N most recent virtual machine creations. The LRU algorithm evicts data based on its historical access records. The core idea of the LRU algorithm is that if a piece of data has been accessed recently, then that data is more likely to be accessed in the future.
[0100] This application provides a cloud disk image cache cluster management method. Using the LRU algorithm, it retains only the target image data needed for the most recent N virtual machine creations in the cloud disk image cache cluster, reducing the amount of infrequently used image data occupying the cluster's capacity. This significantly improves the utilization efficiency of target image data in the cloud disk image cache cluster.
[0101] The virtual machine image data distribution device provided in the embodiments of this application is described below. The virtual machine image data distribution device described below can be referred to in correspondence with the virtual machine image data distribution method described above.
[0102] First, combine Figure 4 The virtual machine image data distribution device is introduced, such as... Figure 4 As shown, the virtual machine image data distribution device may include:
[0103] Image data acquisition unit 100 is used to acquire virtual machine image data;
[0104] The mirror data storage unit 200 is used to store the mirror data in a mirror storage system, wherein the mirror storage system is a preset system for storing mirror data;
[0105] The target image data storage judgment unit 300 is used to determine whether the target image data required for creating the virtual machine in the current instruction has been stored in the cloud disk image cache cluster.
[0106] If the target image data is not stored in the cloud disk image cache cluster, then the following steps of the target image data copying unit 400 are executed;
[0107] The target image data replication unit 400 is used to replicate the target image data in the image storage system to the cloud disk image cache cluster.
[0108] The virtual machine quantity determination unit 500 is used to determine whether the number of virtual machines created in the current instruction has reached a preset value;
[0109] If the number of virtual machines created in the current instruction reaches a preset value, then the steps of the target image data forwarding unit 600 are executed;
[0110] The target image data forwarding unit 600 is used to forward the target image data in the cloud disk image cache cluster to each cloud disk storage cluster in the first cloud disk storage set through a tree-shaped forwarding method. The first cloud disk storage set includes at least one cloud disk storage cluster in the cloud disk storage system other than the cloud disk image cache cluster.
[0111] Optionally, the virtual machine image data distribution device of this application may further include:
[0112] The first virtual machine creation unit is used to create virtual machines in the cloud disk image cache cluster based on the target image data when the virtual machine quantity judgment unit 500 determines that the number of virtual machines created in the current instruction has not reached the preset value, by using copy-on-write technology.
[0113] Optionally, the virtual machine image data distribution device of this application may further include:
[0114] The second virtual machine creation unit is used to create virtual machines in each cloud disk storage cluster of the first cloud disk storage set based on the target image data after the target image data forwarding unit 600 forwards the target image data in the cloud disk image cache cluster to each cloud disk storage cluster in the first cloud disk storage set through tree forwarding.
[0115] Optionally, the virtual machine image data distribution device of this application may further include:
[0116] The system disk migration unit is used to migrate the system disk of the virtual machine created in the cloud disk image cache cluster to a cloud disk storage cluster in the second cloud disk storage set after the first virtual machine creation unit creates a virtual machine based on the target image data in the cloud disk image cache cluster using copy-on-write technology. The second cloud disk storage set includes at least one cloud disk storage cluster in the cloud disk storage system other than the image cache cluster.
[0117] Optionally, the target mirror data forwarding unit 600 may include:
[0118] The first cloud disk storage set filtering unit is used to filter the cloud disk storage clusters in the cloud disk storage system based on at least one of the free capacity and IO pressure of each cloud disk storage cluster in the cloud disk storage system, so as to obtain the first cloud disk storage set.
[0119] The tree-shaped forwarding unit is used to forward the target image data in the cloud disk image cache cluster to each cloud disk storage cluster in the first cloud disk storage set through tree-shaped forwarding.
[0120] Optionally, the virtual machine image data distribution device of this application may further include:
[0121] The cache cluster selection unit is used to respond to the user's operation of selecting a cloud disk image cache cluster before the target image data storage judgment unit 300 judges whether the target image data required to create the virtual machine in the current instruction has been stored in the cloud disk image cache cluster, and to use the cloud disk storage cluster specified by the user in the cloud disk storage system as the cloud disk image cache cluster.
[0122] Optionally, the virtual machine image data distribution device of this application may further include:
[0123] The image data slicing unit is used to slice the virtual machine image data according to a preset size after the image data acquisition unit 100 acquires the image data to obtain an image data slicing set, wherein the image data slicing set includes at least one image data slice.
[0124] Optionally, the mirror data storage unit 200 may include:
[0125] A mirror data shard storage unit is used to store the set of mirror data shards into a mirror storage system.
[0126] The virtual machine image data distribution device provided in this application embodiment can be applied to virtual machine image data distribution equipment. Figure 5 The hardware structure block diagram of the virtual machine image data distribution device is shown below. Figure 5 The hardware structure of a virtual machine image data distribution device may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4;
[0127] In this embodiment of the application, the number of processor 1, communication interface 2, memory 3, and communication bus 4 is at least one, and processor 1, communication interface 2, and memory 3 communicate with each other through communication bus 4;
[0128] Processor 1 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0129] Memory 3 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device;
[0130] The memory stores a program, which the processor can call to implement the various processing steps in the aforementioned virtual machine image data distribution scheme.
[0131] This application embodiment also provides a storage medium that can store a program suitable for processor execution, the program being used to implement various processing flows in the aforementioned virtual machine image data distribution scheme.
[0132] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0133] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0134] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A virtual machine image data distribution method, characterized by, The method comprises the following steps: acquiring virtual machine image data; storing the image data to an image storage system, which is a preset system for storing image data; judging whether target image data required by a virtual machine created in a current instruction has been stored to a cloud disk image cache cluster; if the target image data has not been stored to the cloud disk image cache cluster, copying the target image data in the image storage system to the cloud disk image cache cluster; if the target image data has been stored to the cloud disk image cache cluster, judging whether the number of virtual machines created in the current instruction reaches a preset value which will cause insufficient capacity of the cloud disk image cache cluster; if the number of virtual machines created in the current instruction reaches the preset value, forwarding the target image data in the cloud disk image cache cluster to each cloud disk storage cluster in a first cloud disk storage set through tree forwarding, the first cloud disk storage set comprising at least one cloud disk storage cluster in the cloud disk storage system except the cloud disk image cache cluster; after the target image data in the cloud disk image cache cluster is forwarded to each cloud disk storage cluster in the first cloud disk storage set through tree forwarding, creating virtual machines based on the target image data in the cloud disk image cache cluster and each cloud disk storage cluster in the first cloud disk storage set by using a write-once-copy-many technology.
2. The method of claim 1, wherein, After the judgment of whether the target image data required by the virtual machine created in the current instruction has been stored to the cloud disk image cache cluster, the method further comprises the following steps: if the number of virtual machines created in the current instruction does not reach the preset value, creating virtual machines based on the target image data in the cloud disk image cache cluster by using the write-once-copy-many technology.
3. The method according to claim 1 or 2, characterized in that, After the virtual machines are created in the cloud disk image cache cluster based on the target image data by using the write-once-copy-many technology, the method further comprises the following steps: migrating the system disk of the virtual machine created in the cloud disk image cache cluster to a cloud disk storage cluster in a second cloud disk storage set, the second cloud disk storage set comprising at least one cloud disk storage cluster in the cloud disk storage system except the cloud disk image cache cluster.
4. The method of claim 1, wherein, The forwarding of the target image data in the cloud disk image cache cluster to each cloud disk storage cluster in the first cloud disk storage set through tree forwarding comprises the following steps: filtering cloud disk storage clusters in the cloud disk storage system based on at least one of idle capacity and IO pressure of each cloud disk storage cluster in the cloud disk storage system to obtain a first cloud disk storage set; forwarding the target image data in the cloud disk image cache cluster to each cloud disk storage cluster in the first cloud disk storage set through tree forwarding.
5. The method of claim 1, wherein, Before the judgment of whether the target image data required by the virtual machine created in the current instruction has been stored to the cloud disk image cache cluster, the method further comprises the following steps: in response to an operation of selecting the cloud disk image cache cluster by a user, taking a cloud disk storage cluster specified by the user in the cloud disk storage system as the cloud disk image cache cluster.
6. The method of any one of claims 1, 2, 4, 5, wherein, After the acquisition of the virtual machine image data, the method further comprises the following steps: The mirror image data is sliced according to a preset size to obtain a mirror image data fragment set, the mirror image data fragment set including at least one mirror image data fragment; The mirror image data is stored into a mirror image storage system, including: The mirror image data fragment set is stored into the mirror image storage system.
7. A virtual machine image data distribution apparatus characterized by comprising: Comprising: A mirror image data acquisition unit configured to acquire virtual machine mirror image data; A mirror image data storage unit configured to store the mirror image data into a mirror image storage system, the mirror image storage system being a preset system for storing mirror image data; A target mirror image data storage judgment unit configured to judge whether target mirror image data required by a current instruction for creating a virtual machine has been stored into a cloud disk image cache cluster; If the target mirror image data has not been stored into the cloud disk image cache cluster, a step of a target mirror image data copying unit is executed; If the target mirror image data has been stored into the cloud disk image cache cluster, a step of a virtual machine quantity judgment unit is executed; A target mirror image data copying unit configured to copy target mirror image data in the mirror image storage system to the cloud disk image cache cluster; A virtual machine quantity judgment unit configured to judge whether a quantity of virtual machines created in the current instruction reaches a preset value that will cause the cloud disk image cache cluster to be insufficient in capacity; If the quantity of virtual machines created in the current instruction reaches the preset value, a step of a target mirror image data forwarding unit is executed; A target mirror image data forwarding unit configured to forward the target mirror image data in the cloud disk image cache cluster to each cloud disk storage cluster in a first cloud disk storage set through a tree-shaped forwarding manner, the first cloud disk storage set including at least one cloud disk storage cluster in a cloud disk storage system except the cloud disk image cache cluster; A second virtual machine creation unit configured to create virtual machines based on the target mirror image data in the cloud disk image cache cluster and each cloud disk storage cluster in the first cloud disk storage set by using a write-once-copy-many technique after the target mirror image data in the cloud disk image cache cluster is forwarded to each cloud disk storage cluster in the first cloud disk storage set through the tree-shaped forwarding manner by the target mirror image data forwarding unit.
8. A virtual machine image data distribution apparatus, characterized by comprising: Comprising: A memory and a processor; The memory is configured to store a program; The processor is configured to execute the program to implement each step of the virtual machine mirror image data distribution method according to any one of claims 1-6.
9. A storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement each step of the virtual machine mirror image data distribution method according to any one of claims 1-6.
Citation Information
Patent Citations
Virtual machine mirror image file processing method and device, equipment and storage medium
CN112631734A
Virtual machine creation method, apparatus and device, and computer readable storage medium
CN113703922A
Method and device for creating cloud host through mirror image, equipment and readable medium
CN114064209A