A method and device for quickly and in batches creating cloud hosts, a server and a medium
By converting non-clonable images in OpenStack into clonable images and establishing mapping relationships using image IDs, image volumes can be cloned to create sub-images, solving the problems of long batch creation time and resource consumption of cloud hosts, and achieving fast and efficient cloud host creation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN INSPUR DATA TECH CO LTD
- Filing Date
- 2022-09-30
- Publication Date
- 2026-07-24
AI Technical Summary
When creating cloud hosts in batches in OpenStack, copying the qcow2 image that cannot be cloned takes a long time and consumes storage and network bandwidth resources, resulting in a time-consuming creation process and excessive resource consumption.
Convert the first image that cannot be cloned into a second image that can be cloned, establish a mapping relationship through the image ID, create an image volume using the second image, clone the image volume to obtain a sub-image, delete the connection between the sub-image and the image volume, and create a cloud host using the cloned sub-image.
It significantly reduces cloud server creation time, saves storage I/O resources, improves creation speed, and reduces the impact on running services.
Smart Images

Figure CN115509685B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of batch creation of cloud servers, and more particularly to a method, apparatus, server, and medium for rapidly batch creating cloud servers. Background Technology
[0002] OpenStack offers more flexible resource allocation. Relying on virtualization technology, resources can be allocated to users on demand, making it well-suited to the dynamic hardware resource requirements of big data applications. As a result, with the rise and development of the cloud computing and big data industries, OpenStack has been widely promoted.
[0003] There are several ways to create cloud hosts using OpenStack: through images, image volumes, and cloud host snapshots (which are also images). The image format commonly used for creating cloud hosts is qcow2. The advantages of qcow2 are: smaller file size than raw format, and file size only increases when the virtual machine actually occupies disk space, easily reducing migration overhead. It is more suitable for cloud computing systems and supports features not supported by raw format, such as copy-on-write, snapshots, and encryption. When creating a cloud host through an image volume, the qcow2 image needs to be copied to an empty volume to create an image volume, and then the cloud host is started using the image volume. This creation process has a problem: the time it takes to copy the qcow2 image to an empty volume depends on the size of the qcow2 image; the larger the image, the longer the copying time. If you need to create cloud hosts in batches, you need to copy the qcow2 images and create image volumes separately, which takes a lot of time and consumes storage and network bandwidth resources. Summary of the Invention
[0004] To solve the above-mentioned technical problems, or at least partially solve them, the present invention provides a method, apparatus, server, and medium for rapidly creating cloud hosts in batches.
[0005] In one aspect, the present invention provides a method for rapidly creating cloud hosts in batches, comprising: converting a first image that cannot be cloned from OpenStack into a second image that can be cloned, and establishing a mapping relationship between the first image and the second image through the image IDs of the two images;
[0006] When it is necessary to create cloud hosts in batches using the first image, the second image corresponding to the first image is found based on the mapping relationship, and the image volume is created using the found second image.
[0007] According to the required number of cloud hosts, clone the image volume to obtain the corresponding number of sub-images, and merge the image information of the image volume into the sub-images to remove the connection between the sub-images and the image volume;
[0008] Use the cloned sub-images to create cloud hosts.
[0009] Furthermore, based on the image format type of the first image, a corresponding image format conversion tool is selected, and the first image is converted into a second image that can be cloned using the image format conversion tool;
[0010] The system collects the cloneable image format types obtained from the image format conversion tool, stores these cloneable image format types in a second list, and provides the user with image format types that can be used as a second image based on the second list.
[0011] Furthermore, establishing the mapping relationship between the first and second mirrors using their mirror IDs includes:
[0012] Query the corresponding image ID based on the image names of the first and second images;
[0013] Construct a mapping table to record the mapping relationship between the first image and the second image. The mapping table records the mapping relationship number, the image ID of the first image, and the image ID and status of the second image that has a mapping relationship with the first image.
[0014] Furthermore, based on the mapping relationship, it is detected whether there is a second image corresponding to the first image. For a first image that does not have a corresponding second image, the first image is converted into a second image, and a mapping relationship between the first image and the second image is established through the image IDs of the two images.
[0015] Furthermore, when it is necessary to create cloud hosts in batches using the first image, finding the second image corresponding to the first image based on the mapping relationship, and creating an image volume using the found second image includes:
[0016] Iterate through the image format types of the images on which the cloud hosts are created in batches, analyze whether the image is the first image, if it is the first image, obtain the image ID of the first image, and find the corresponding image ID of the second image according to the mapping relationship and the image ID of the first image. Query the second image by image ID, and create an image volume using the queried second image.
[0017] Furthermore, identifying an image as the first image based on its image format type includes: obtaining an image format type that cannot be cloned and storing it in a first list; obtaining the image format type of the image; detecting that the image format type exists in the first list; and if so, determining that the image is the first image.
[0018] Furthermore, based on the required number of cloud hosts to be created, the corresponding number of image volumes are cloned to obtain sub-images. The name of the cloned sub-image includes the name of the cloned source image volume and a sequentially arranged number.
[0019] During cloning, the number in the sub-image name of the last sub-image in the historical clone of the image volume is obtained. The number is incremented sequentially until the number of cloud hosts to be created is reached, so as to obtain the number in the sub-image name of all sub-images in this clone. The number is then combined with the clone source image volume name to obtain the sub-image name of all sub-images.
[0020] Furthermore, the method also includes:
[0021] After the cloud server is created, record the matching relationship between the cloud server ID and the sub-image used;
[0022] The system iterates through the created cloud hosts for testing, counts the IDs of failed cloud hosts, determines the corresponding sub-images based on the failed cloud host IDs and matching relationships, and re-clones the sub-images to create cloud hosts.
[0023] Secondly, the present invention provides an apparatus for rapidly creating cloud hosts in batches, comprising: an image conversion module, wherein the image conversion module converts a first image uploaded to OpenStack that cannot be cloned into a second image that can be cloned;
[0024] A mapping record module, which establishes a mapping relationship between the first and second mirrors through the mirror IDs of the corresponding first and second mirrors;
[0025] When creating cloud hosts in batches using the first image, the cloud host creation module finds the second image corresponding to the first image based on the mapping relationship recorded by the mapping record module, creates an image volume using the found second image, clones the image volume to obtain a corresponding number of sub-images according to the required number of cloud hosts to be created, merges the image information of the image volume into the sub-images to delete the connection between the sub-images and the image volume, and uses the cloned sub-images to create cloud hosts respectively.
[0026] Thirdly, the present invention provides a server for rapidly creating cloud hosts in batches, comprising: at least one processing unit, a bus unit, and a storage unit, wherein the bus unit is connected to the storage unit and the processing unit, the storage unit stores a computer program, and the computer program is executed by the processing unit to implement the method for rapidly creating cloud hosts in batches.
[0027] Fourthly, the present invention provides a storage medium for implementing a method for rapidly creating cloud hosts in batches, the storage medium storing a computer program that, when executed by a processor, implements the method for rapidly creating cloud hosts in batches.
[0028] The technical solutions provided in the embodiments of the present invention have the following advantages compared with the prior art:
[0029] This invention converts an unclonable first image uploaded to OpenStack into a clonable second image, establishing a mapping relationship between the two images using their image IDs. When batch creation of cloud hosts using the first image is required, the corresponding second image is found based on the mapping relationship, and an image volume is created using the found second image. According to the required number of cloud hosts, the corresponding number of image volumes are cloned to obtain sub-images. The image information flattern of the image volumes is merged into the sub-images to remove the connection between the sub-images and the image volumes. Cloud hosts are then created using the cloned sub-images. By converting the unclonable first image into a clonable second image, when creating cloud hosts, the second image is used to create image volumes, and the image volumes are cloned to obtain sub-images. The speed of cloning image volumes on the storage backend can reach the second level, significantly reducing the time consumed compared to creating image volumes by copying image files, thus improving the speed of cloud host creation. Moreover, the cloning method can significantly save the underlying storage I / O resources used when creating large image cloud hosts, ensuring sufficient underlying I / O resources for business operation and minimizing the impact on running services. Attached Figure Description
[0030] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 A flowchart illustrating a method for rapidly creating cloud servers in batches, as provided in an embodiment of the present invention;
[0033] Figure 2 A flowchart for converting a first image that cannot be cloned from OpenStack into a second image that can be cloned, provided as an embodiment of the present invention;
[0034] Figure 3 A flowchart for establishing a mapping relationship between a first image and a second image based on their image IDs, provided as an embodiment of the present invention;
[0035] Figure 4 A flowchart provided for embodiments of the present invention is provided, which describes how, when cloud hosts need to be created in batches using a first image, a second image corresponding to the first image is found based on the mapping relationship, and an image volume is created using the found second image;
[0036] Figure 5A schematic diagram of an apparatus for rapidly creating cloud servers in batches, provided as an embodiment of the present invention;
[0037] Figure 6 This is a schematic diagram of a server for rapidly creating cloud hosts in batches, provided as an embodiment of the invention. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] It should be noted that, in this document, 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. Unless otherwise specified, 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.
[0040] Example 1
[0041] See Figure 1 As shown, the present invention provides a method for quickly creating cloud servers in batches, comprising:
[0042] S100 converts a first image uploaded to OpenStack that cannot be cloned into a second image that can be cloned. For specific implementation details, please refer to [link to documentation / reference]. Figure 2 As shown, step S100 includes:
[0043] S101, obtain the non-clonable image format types in advance and store them in the first list.
[0044] S102, count the images uploaded to OpenStack used for creating cloud hosts and store them in the image list. In one feasible implementation, the first uncontrollable image uploaded to OpenStack for creating cloud hosts is selected. Specifically, for example, an image named image01 with format qcow2 is uploaded to OpenStack using the command "openstack image create "image01" --file image01.qcow2 --disk-for mat qcow2 --container-format bare --public". The uploaded image is then added to the image list along with its image name and format type.
[0045] S103: Iterate through each character in the image list to check if its image format type exists in the first list. If it exists, proceed to S104; otherwise, proceed to S105. The image format types that cannot be cloned are counted and stored in the first list. When analyzing whether an image in the image list is the first image, obtain the image format type of the image and check if the obtained image format type exists in the first list. If it exists, determine that the image is the first image.
[0046] S104, determine that the image is the first image and select it to add to the first image list.
[0047] S105, check if the mirror list has been traversed completely. If not, execute S103 to judge the next character. If the list has been traversed completely, execute S106.
[0048] S106, iterate through the first images in the first image list, select the image format type of the second image; select the corresponding image format conversion tool according to the image format type of the first image to convert the first image into a cloneable second image. A feasible image conversion tool is the qemu-img tool, which converts the first image to the second image by using "qemu-img convert -f {first image format type} -O {second image format type} {first image image name}.{first image format type} {second image image name}.{second image format type}", where the variables in {} are the corresponding variables.
[0049] If the first image list contains two characters representing the first image, image01_qcow2 and image02_qcow2, where the part before the underscore is the image name and the part after the underscore is the image format type, then the characters in the first image list are traversed. Using the split command with the underscore as the separator, each character is processed, and the image name before and after the underscore is extracted as image01 and the image format type as qcow2. If the image format type of the second image is selected as raw, and the image name of the second image is image03, then the characters image01, qcow2, raw, and image are substituted into the qemu-img tool's image conversion command "qemu-img convert -f qcow2 -O raw image01.qcow2 image03.raw". This will convert the first image image01.qcow2 corresponding to the character image01_qcow2 into the second image image03.raw.
[0050] In a preferred embodiment, the cloneable image format types obtained by the image format conversion tool are counted, and the cloneable image format types are stored in a second list. Based on the second list, the image format types that can be used as the second image are provided to the user.
[0051] S200 establishes a mapping relationship between the first and second images using their respective image IDs. For specific implementation details, please refer to [link / reference needed]. Figure 3 As shown, step S200 includes:
[0052] S201, a mapping table is pre-constructed to record the mapping relationship between the first image and the second image. The mapping table records the mapping relationship number, the image ID of the first image, the image ID of the second image with which the first image has a mapping relationship, and the status. In specific implementation, the status includes either a used or unused state.
[0053] S202, query the corresponding image ID based on the image name of the first image and the image name of the second image converted from the first image; specifically, obtain the image name of the first image and the image name of the second image converted from the first image, and use the obtained image name to execute the id query command "select id from glance where name='image name'" to obtain the corresponding image ID.
[0054] S203, record the image IDs of the first image and the second image obtained from the first image in the mapping table according to the mapping relationship.
[0055] When S300 needs to create cloud hosts in batches using the first image, it finds the second image corresponding to the first image based on the mapping relationship and uses the found second image to create an image volume.
[0056] In the specific implementation process, please refer to Figure 4 As shown, step S300 includes:
[0057] S301, count the images on which the cloud servers are based in the cloud server image list.
[0058] S302, iterate through the cloud host image list to see if the image format type exists in the first list. If it does, proceed to step S303.
[0059] S303: Obtain the image ID of the first image and check whether the corresponding image ID of the second image can be found based on the mapping relationship and the image ID of the first image. If it can, execute S304; otherwise, execute S100 and S200. For the first image that cannot find the corresponding second image, convert it into the second image and establish a mapping relationship between the two through the image IDs of the first and second images.
[0060] Specifically, executing the command "select second image's image ID from mapping table where first image's image ID = xxx" will retrieve the second image ID based on the first image's image ID.
[0061] S304: Locate the second mirror using the mirror ID, and create a mirror volume using the retrieved second mirror. Specifically, this is achieved by executing "cinder create --name mirror volume name size --image second mirror name --availability-zone".<az_name> --volume-type<volum_type_name> "To create a mirror volume using a second image, execute `cinder create --name image03_rbd size --image image03 --availability-zone`."<az_name> --volume-type<volum_type_name> Create the second image image03 as a mirror volume named image03_rbd.
[0062] S400 clones the image volume according to the required number of cloud hosts to obtain the corresponding number of sub-images, and merges the image information flattern of the image volume into the sub-images to remove the association between the sub-images and the image volume. Specifically, the image volume is cloned by executing "rbdclone image volume name sub-image name".
[0063] In a preferred embodiment, the name of the cloned sub-image includes the name of the source image volume and a sequentially ordered number, such as for the image volume image03_rbd, its sub-images are named image03_rbd_clone01, image03_rbd_clone02, and so on.
[0064] During cloning, the number in the sub-image name of the last sub-image in the history of the image volume cloning is obtained. The number is incremented from one to the number of cloud hosts to be created, and the numbers in the sub-image names of all sub-images in this cloning are obtained. The numbers are then combined with the cloned source image volume name to obtain the sub-image names of all sub-images.
[0065] After cloning to obtain sub-images, iterate through the obtained sub-images and merge the image volume information flattern of the clone source into each sub-image.
[0066] For the S500, use the cloned sub-images to create cloud hosts. Specifically, execute "novaboot --flavor".<flavor_id> --boot-volume sub-image name--availability-zone<az_name> --nic net-id=<network_id><vm_name> The `--poll` option enables the creation of cloud hosts using cloned sub-images. In a preferred embodiment, the sub-image names in the name list are traversed, configuration information is obtained based on the traversed sub-image names, and the traversed sub-image names and corresponding configurations (`--flavor`, `--availability-zone`, `--nic`) are substituted into the above command to create cloud hosts using sub-images.
[0067] In a preferred embodiment, after the cloud host is created, the matching relationship between the cloud host ID and the sub-image used is recorded; the created cloud hosts are traversed for testing, the IDs of failed cloud hosts are counted, the corresponding sub-image is determined according to the IDs of failed cloud hosts and the matching relationship, and the sub-image is cloned again to create the cloud host.
[0068] Example 2
[0069] See Figure 5As shown, this embodiment of the invention provides a server for rapidly batch creating cloud hosts, comprising: at least one processing unit, a bus unit, and a storage unit, wherein the bus unit connects the storage unit and the processing unit, the storage unit stores a computer program, and the computer program, when executed by the processing unit, implements the method for rapidly batch creating cloud hosts. Specifically, a first image uploaded to OpenStack that cannot be cloned is converted into a second image that can be cloned. A mapping relationship is established between the first and second images using their image IDs. When it is necessary to batch create cloud hosts using the first image, the second image corresponding to the first image is found based on the mapping relationship, and an image volume is created using the found second image. According to the required number of cloud hosts to be created, a corresponding number of image volumes are cloned to obtain sub-images, and the image information flattern of the image volumes is merged into the sub-images to delete the connection between the sub-images and the image volumes. Cloud hosts are created using the cloned sub-images respectively.
[0070] Example 3
[0071] See Figure 5 As shown, this embodiment of the invention provides an apparatus for rapidly creating cloud servers in batches, comprising:
[0072] The image detection module is used to traverse the image format type of the images on which the cloud hosts are created in batches and analyze whether the image is the first image.
[0073] The image conversion module converts a first image uploaded to OpenStack that cannot be cloned into a second image that can be cloned.
[0074] A mapping record module, which establishes a mapping relationship between the first and second mirrors through the mirror IDs of the corresponding first and second mirrors;
[0075] When creating cloud hosts in batches using the first image, the cloud host creation module finds the second image corresponding to the first image based on the mapping relationship recorded by the mapping record module, creates an image volume using the found second image, clones the image volume to obtain a corresponding number of sub-images according to the required number of cloud hosts to be created, merges the image information of the image volume into the sub-images to delete the connection between the sub-images and the image volume, and uses the cloned sub-images to create cloud hosts respectively.
[0076] The cloud server testing module records the matching relationship between the cloud server ID and the sub-image used after the cloud server is created; it iterates through the created cloud servers for testing, counts the failed cloud server IDs, determines the corresponding sub-image based on the failed cloud server IDs and the matching relationship, and re-clones the sub-image to create the cloud server.
[0077] Example 4
[0078] This invention provides a storage medium for implementing a method for rapidly creating cloud hosts in batches. The storage medium stores a computer program, which, when executed by a processor, implements the method for rapidly creating cloud hosts in batches.
[0079] This invention converts an unclonable first image uploaded to OpenStack into a clonable second image, establishing a mapping relationship between the two images using their image IDs. When batch creation of cloud hosts using the first image is required, the corresponding second image is found based on the mapping relationship, and an image volume is created using the found second image. According to the required number of cloud hosts, the corresponding number of image volumes are cloned to obtain sub-images. The image information flattern of the image volumes is merged into the sub-images to remove the connection between the sub-images and the image volumes. Cloud hosts are then created using the cloned sub-images. By converting the unclonable first image into a clonable second image, when creating cloud hosts, the second image is used to create image volumes, and the image volumes are cloned to obtain sub-images. The speed of cloning image volumes on the storage backend can reach the second level, significantly reducing the time consumed compared to creating image volumes by copying image files, thus improving the speed of cloud host creation. Moreover, the cloning method can significantly save the underlying storage I / O resources used when creating large image cloud hosts, ensuring sufficient underlying I / O resources for business operation and minimizing the impact on running services.
[0080] In the embodiments provided by this invention, it should be understood that the disclosed structures and methods can be implemented in other ways. For example, the structural embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, structures, or units, and may be electrical, mechanical, or other forms.
[0081] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0082] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0083] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. 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 the invention. Therefore, the present invention 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 claimed herein.
Claims
1. A method for rapidly creating cloud servers in batches, characterized in that, include: The process involves converting a first image uploaded to OpenStack that cannot be cloned into a second image that can be cloned. This process includes selecting a corresponding image format conversion tool based on the image format type of the first image, and using the conversion tool to convert the first image into a cloneable second image. A list of cloneable image format types obtained from the conversion is compiled and stored in a second list. Based on this second list, the user is provided with the image format types that can be used as the second image. Establishing a mapping relationship between the first and second mirrors by using their mirror IDs includes: querying the corresponding mirror IDs based on the mirror names of the first and second mirrors; constructing a mapping relationship table that records the mapping relationship between the first and second mirrors, wherein the mapping relationship table records the mapping relationship number, the mirror ID of the first mirror, and the mirror ID and status of the second mirror that has a mapping relationship with the first mirror; When it is necessary to create cloud hosts in batches using the first image, the second image corresponding to the first image is found based on the mapping relationship, and the image volume is created using the found second image. Based on the required number of cloud hosts to be created, the image volume is cloned to obtain the corresponding number of sub-images. The name of the cloned sub-image includes the name of the cloned source image volume and a sequentially ordered number. During cloning, the number in the sub-image name of the last sub-image cloned in the image volume's history is obtained. The number is incremented from one to the number of cloud hosts to be created to obtain the number in the sub-image name of all sub-images cloned this time. The number is combined with the name of the cloned source image volume to obtain the sub-image name of all sub-images. The image information of the image volume is merged into the sub-image to delete the relationship between the sub-image and the image volume. Use the cloned sub-images to create cloud hosts. After the cloud hosts are created, record the matching relationship between the cloud host ID and the sub-image used. Iterate through the created cloud hosts for testing, count the IDs of failed cloud hosts, determine the corresponding sub-images based on the IDs of failed cloud hosts and the matching relationship, and re-clone the sub-images to create cloud hosts.
2. The method for rapidly creating cloud servers in batches according to claim 1, characterized in that, Based on the mapping relationship, it is detected whether there is a second image corresponding to the first image. For the first image that does not have a corresponding second image, the first image is converted into the second image, and a mapping relationship between the two is established through the image IDs of the first image and the second image.
3. The method for rapidly creating cloud servers in batches according to claim 1, characterized in that, When it is necessary to create cloud hosts in batches using the first image, the process of finding the second image corresponding to the first image based on the mapping relationship and creating an image volume using the found second image includes: Iterate through the image format type of the images on which the cloud hosts are created in batches to analyze whether the image is the first image. If it is the first image, obtain the image ID of the first image, and find the corresponding image ID of the second image according to the mapping relationship and the image ID of the first image. Query the second image by image ID and create an image volume using the queried second image.
4. The method for rapidly creating cloud servers in batches according to claim 3, characterized in that, Identifying an image as the first image based on its image format type includes: obtaining the image format type that cannot be cloned and storing it in a first list; obtaining the image format type of the image; detecting that the image format type exists in the first list; and if so, determining that the image is the first image.
5. An apparatus for rapidly creating cloud servers in batches, characterized in that, include: The image conversion module converts a first image uploaded to OpenStack that cannot be cloned into a second image that can be cloned. Specifically, it selects a corresponding image format conversion tool based on the image format type of the first image, and uses the conversion tool to convert the first image into a cloneable second image. It then compiles a list of cloneable image format types obtained from the conversion tool, stores these types in a second list, and provides the user with the image format types that can be used as the second image based on this list. The mapping record module establishes a mapping relationship between the first and second images by using their respective image IDs. This includes: querying the corresponding image ID based on the image names of the first and second images; and constructing a mapping relationship table that records the mapping relationship between the first and second images. The mapping relationship table records the mapping relationship number, the image ID of the first image, and the image ID and status of the second image that has a mapping relationship with the first image. The cloud server creation module, when creating cloud servers in batches using the first image, finds the second image corresponding to the first image based on the mapping relationship recorded by the mapping record module. It then uses the found second image to create an image volume and clones the image volume to obtain a corresponding number of sub-images according to the required number of cloud servers. The cloned sub-image name includes the name of the cloned source image volume and a sequentially ordered number. During cloning, it obtains the number from the sub-image name of the last historically cloned sub-image of the image volume, increments the number from one to the required number of cloud servers, and obtains the numbers from the sub-image names of all cloned sub-images. These numbers are then combined with the cloned source image volume name to obtain the sub-image names of all sub-images. The image information of the image volume is merged into the sub-images to remove the connection between the sub-images and the image volume. Cloud servers are created using the cloned sub-images. After cloud server creation, the matching relationship between the cloud server ID and the used sub-image is recorded. The created cloud servers are traversed for testing, and the IDs of failed cloud servers are counted. Based on the failed cloud server IDs and the matching relationship, the corresponding sub-images are determined, and the sub-images are cloned again to create new cloud servers.
6. A server for rapidly creating cloud hosts in batches, characterized in that, include: At least one processing unit, a bus unit, and a storage unit, wherein the bus unit connects the storage unit and the processing unit, the storage unit stores a computer program, and when the computer program is executed by the processing unit, it implements the method for rapidly creating cloud hosts in batches as described in any one of claims 1-4.
7. A storage medium for implementing a method for rapidly creating cloud servers in batches, the storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for rapidly creating cloud hosts in batches as described in any one of claims 1-4.