A method, device and equipment for creating a cloud host through mirroring and a readable medium
By adopting a cross-storage image file copying mechanism, the problem of slow image data reading during the creation of cloud hosts under multiple cluster block storage backends is solved, realizing fast startup and efficient data transmission, and improving the maintainability and operability of the cloud platform.
Patent Information
- Application Number
- CN202111343848.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-14
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2041-11-14
AI Technical Summary
In existing technologies, the computing module cannot effectively handle the situation of multiple cluster block storage backends, resulting in slow and time-consuming image data reading during the cloud host creation process, increasing network traffic and disk usage.
The method of creating cloud hosts through images adopts a cross-storage image file copying mechanism to achieve pre-copying and rapid cloning of image files, avoid uploading multiple copies of the image, improve data transmission efficiency, and reduce network traffic and disk space usage.
It enables rapid startup of cloud servers, reduces network traffic and disk space usage, and improves the maintainability and operability of cloud platform resources.
Smart Images

Figure CN114064209B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cloud computing platform, and particularly relates to a method and device for creating cloud host through image, equipment and readable medium. BACKGROUND
[0002] Currently, the compute module itself does not support the deployment of multiple known usable cluster block storage (Ceph RBD) backends. If there is only one, the compute module and the image module will cooperate to achieve a fast and light cloning behavior from the image to the cloud host; if there is more than one, the compute module usually cannot handle this situation well, and in the worst case, it will cause the creation of the cloud host to fail due to slow and time-consuming image data reading.
[0003] In most cases, it is necessary to have multiple independent cluster storage backends in a single cloud platform (such as OpenStack) resource pool. The most common is multi-site or edge deployment, where it is important for the cluster to be physically close to the compute nodes it serves. And the current cloud platform image module already supports multi-storage backend configuration, users or developers can choose to store the image used in the corresponding cluster block storage backend.
[0004] In the prior art, when the image module and the compute module cooperate on the cluster backend deployment, the user image is stored on the cluster block storage backend by the image module when it is uploaded by the operator or user. When the compute module starts to launch an instance, it will require the cluster to make a Copy-on-Write clone of this image, which is very fast and efficient, not only reducing the launch time, but also reducing the network traffic.
[0005] However, if there are two or more groups of compute nodes, each with its own cluster deployment, then when it must be ensured that the image stored in one cluster is not assigned to another cluster of compute nodes to start. The image module can logically store a single image in one or two clusters, and the compute module will look at this during cloud host launch. But if the image is not in the cluster where the cloud host is launched, the image will be downloaded from the image module and then uploaded as a raw flat image to the local cluster of the cloud platform resource pool where the cloud host is located each time a cloud host in that image is launched, since each cluster needs to store the same image file, the disk usage is several times the usage of a single cluster storage, which will result in more network traffic and disk usage than expected.
[0006] Taking a case that two storage backends of cluster block storage A and cluster block storage B are configured by a mirror module, in the prior art, a mirror file image2 is stored in storage B, and a logical mapping of the mirror file image2 exists in storage A, that is, the cloud platform is informed that the mirror file image2 also exists in storage A, and a cloud host created by the mirror module using the mirror file image2 can be started in storage A. At this time, since the computing module does not support the configuration of storage B, if the cloud host in storage A wants to start using the mirror file image2, it needs to read data to the computing module for caching through the mirror module, and then write data to storage A through libvirt rbd, and the cloud host can be started by completing the data copy between the computing module and storage A for multiple times, which needs to perform data copy at least twice and takes a long time. SUMMARY
[0007] Therefore, the embodiments of the present application aim to provide a method, device, equipment and readable medium for creating a cloud host by a mirror, based on the support for multiple storage backends, develop a cross-storage mirror file copying mechanism to realize the pre-copying of mirror files between started cloud hosts, and start the cloud host by the fast cloning mode based on the pre-copied mirror file, without uploading the mirror to multiple parts, improve the data transmission efficiency, reduce the occupation of network traffic and disk space, and effectively improve the maintainability and operability of cloud platform resources.
[0008] Based on the above purpose, one aspect of the embodiments of the present application provides a method for creating a cloud host by a mirror, comprising the following steps: in response to receiving a cloud host creation request, determining whether a target mirror in the cloud host creation request is stored in a local cluster block storage; if the target mirror in the cloud host creation request is not stored in the local cluster block storage, finding a target cluster block storage where the target mirror is located; copying the target mirror in the target cluster block storage to the local cluster block storage through a bottom layer data copying mechanism; and in response to detecting the target mirror in the local cluster block storage, starting a cloud host by the target mirror.
[0009] In some embodiments, in response to receiving a cloud host creation request, determining whether a target mirror in the cloud host creation request is stored in a local cluster block storage comprises: in response to receiving a cloud host creation request, scheduling a host node conforming to a specification based on the cloud host creation request, and setting the host node conforming to the specification as a local node; determining whether the target mirror in the cloud host creation request is stored in a local cluster block storage of the local node.
[0010] In some embodiments, the finding the target cluster block storage where the target image is located comprises: obtaining a logical mapping in the local cluster block storage based on the target image, and finding the target cluster block storage where the target image is located based on the logical mapping.
[0011] In some embodiments, the method further comprises: monitoring a copy state through an image attribute parameter; polling the image attribute parameter, and determining whether the copy is successful based on the image attribute parameter.
[0012] In some embodiments, the method further comprises: in response to determining that the copy is successful based on the image attribute parameter, determining whether the target image is detected in the local cluster block storage.
[0013] In some embodiments, the method further comprises: in response to determining that the copy fails based on the image attribute parameter, setting a cloud host state to error, and sending a creation failure alarm.
[0014] In some embodiments, the method further comprises: if the target image in the cloud host creation request is stored in the local cluster block storage, obtaining the target image from the local cluster block storage, and starting the cloud host through the target image.
[0015] Another aspect of the embodiment of the present application also provides an apparatus for creating a cloud host through an image, comprising: a first module configured to determine whether a target image in a cloud host creation request is stored in a local cluster block storage in response to receiving the cloud host creation request; a second module configured to find a target cluster block storage where the target image is located if the target image in the cloud host creation request is not stored in the local cluster block storage; a third module configured to copy the target image in the target cluster block storage to the local cluster block storage through a bottom-layer data copy mechanism; and a fourth module configured to start a cloud host through the target image in response to detecting the target image in the local cluster block storage.
[0016] In some embodiments, the first module is further configured to: in response to receiving the cloud host creation request, schedule a host node conforming to a specification based on the cloud host creation request, set the host node conforming to the specification as a local node, and determine whether the target image in the cloud host creation request is stored in a local cluster block storage of the local node.
[0017] In some embodiments, the second module is further configured to: obtain a logical mapping in the local cluster block storage based on the target image, and find the target cluster block storage where the target image is located based on the logical mapping.
[0018] In some embodiments, the third module is further configured to monitor a copy state through a mirror attribute parameter; poll the mirror attribute parameter, and determine whether the copy is successful based on the mirror attribute parameter.
[0019] In some embodiments, the third module is further configured to, in response to determining that the copy is successful based on the mirror attribute parameter, determine whether the target image is detected in the local cluster block storage.
[0020] In some embodiments, the third module is further configured to, in response to determining that the copy fails based on the mirror attribute parameter, set a cloud host state to error, and send a creation failure alarm.
[0021] In some embodiments, the fourth module is further configured to, if the target image in the cloud host creation request is stored in the local cluster block storage, obtain the target image from the local cluster block storage, and start the cloud host through the target image.
[0022] Still another aspect of the embodiments of the present application further provides a computer device, comprising: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executed by the processor to implement steps of a method, including: in response to receiving a cloud host creation request, determining whether a target image in the cloud host creation request is stored in a local cluster block storage; if the target image in the cloud host creation request is not stored in the local cluster block storage, finding a target cluster block storage where the target image is located; copying the target image in the target cluster block storage to the local cluster block storage through an underlying data copy mechanism; and in response to detecting the target image in the local cluster block storage, starting a cloud host through the target image.
[0023] In some embodiments, in response to receiving a cloud host creation request, determining whether a target image in the cloud host creation request is stored in a local cluster block storage includes: in response to receiving a cloud host creation request, dispatching a host node conforming to a specification based on the cloud host creation request, and setting the host node conforming to the specification as a local node; determining whether the target image in the cloud host creation request is stored in a local cluster block storage of the local node.
[0024] In some embodiments, finding a target cluster block storage where the target image is located includes: obtaining a logical mapping in the local cluster block storage based on the target image, and finding the target cluster block storage where the target image is located based on the logical mapping.
[0025] In some embodiments, the steps further comprise: monitoring the copy status through a mirror attribute parameter; polling the mirror attribute parameter and determining whether the copy is successful based on the mirror attribute parameter.
[0026] In some embodiments, the steps further comprise: in response to determining that the copy is successful based on the mirror attribute parameter, determining whether the target image is detected in the local cluster block storage.
[0027] In some embodiments, the steps further comprise: in response to determining that the copy fails based on the mirror attribute parameter, setting the cloud host status to error and sending a creation failure alarm.
[0028] In some embodiments, the steps further comprise: if the target image in the cloud host creation request is stored in the local cluster block storage, obtaining the target image from the local cluster block storage and starting the cloud host through the target image.
[0029] Still another aspect of the embodiment of the present application further provides a computer readable storage medium, which stores a computer program that is executed by a processor to implement the method steps as above.
[0030] The present application has at least the following beneficial technical effects: based on the support for multiple storage backends, a cross-storage mirror file copying mechanism is developed to realize pre-copying of mirror files between cloud hosts, and the cloud host is started through fast cloning based on the pre-copied mirror files, without the need to upload multiple copies of the image, thereby improving data transmission efficiency, reducing the occupation of network traffic and disk space, and effectively improving the maintainability and operability of cloud platform resources. BRIEF DESCRIPTION OF DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other embodiments can be obtained without creative labor based on these drawings.
[0032] Figure 1 The schematic diagram of the embodiment of the method for creating a cloud host through an image provided by the present application;
[0033] Figure 2 The architecture diagram of the embodiment of the method for creating a cloud host through an image provided by the present application;
[0034] Figure 3 The schematic diagram of the embodiment of the device for creating a cloud host through an image provided by the present application;
[0035] Figure 4 a schematic diagram of an embodiment of a computer device provided by the present application;
[0036] Figure 5 a schematic diagram of an embodiment of a computer readable storage medium provided by the present application. DETAILED DESCRIPTION
[0037] In order to make the objectives, technical solutions and advantages of the present application clearer, further detailed description will be made to the embodiments of the present application with reference to the accompanying drawings.
[0038] It should be noted that all the expressions of "first" and "second" in the embodiments of the present application are used to distinguish two same-named different entities or different parameters, and the "first" and "second" are only used for the convenience of description, and should not be understood as a limitation of the embodiments of the present application. The subsequent embodiments will not be described one by one.
[0039] Based on the above purpose, in a first aspect of the embodiments of the present application, an embodiment of a method for creating a cloud host through mirroring is provided. Figure 1 The embodiment of the method for creating a cloud host through mirroring provided by the present application is shown in a schematic diagram. As shown in the figure, Figure 1 The method for creating a cloud host through mirroring of the embodiments of the present application includes the following steps:
[0040] 001, in response to receiving a cloud host creation request, it is judged whether the target image in the cloud host creation request is stored in the local cluster block storage;
[0041] 002, if the target image in the cloud host creation request is not stored in the local cluster block storage, the target cluster block storage where the target image is located is found;
[0042] 003, the target image in the target cluster block storage is copied to the local cluster block storage through a bottom layer data copying mechanism; and
[0043] 004, in response to detecting the target image in the local cluster block storage, the cloud host is started through the target image.
[0044] In some embodiments of the present application, in response to receiving a cloud host creation request, it is judged whether the target image in the cloud host creation request is stored in the local cluster block storage, including: in response to receiving a cloud host creation request, a host node meeting the specification is scheduled based on the cloud host creation request, and the host node meeting the specification is set as a local node; it is judged whether the target image in the cloud host creation request is stored in the local cluster block storage of the local node.
[0045] In some embodiments of the present application, the method further comprises: obtaining a logical mapping of the target image in the local cluster block storage based on the target image, and searching for the target cluster block storage where the target image is located based on the logical mapping.
[0046] In some embodiments of the present application, the method further comprises: monitoring the copy state through the image attribute parameter; polling the image attribute parameter, and determining whether the copy is successful based on the image attribute parameter.
[0047] In some embodiments of the present application, the method further comprises: in response to determining that the copy is successful based on the image attribute parameter, determining whether the target image is detected in the local cluster block storage.
[0048] In some embodiments of the present application, the method further comprises: in response to determining that the copy fails based on the image attribute parameter, setting the cloud host state to error, and sending a creation failure alarm.
[0049] In some embodiments of the present application, the method further comprises: if the target image in the cloud host creation request is stored in the local cluster block storage, obtaining the target image from the local cluster block storage, and starting the cloud host through the target image.
[0050] The specific embodiments of the present application are further described below according to specific embodiments. Figure 2 The architecture diagram of the embodiment of the method for creating a cloud host through an image provided by the present application is shown. As shown in Figure 2 The storage module management manages a plurality of storage backends, and the RBD storage A and the RBD storage B are managed by the storage module management. The image module and the computing module are respectively configured with a plurality of Ceph RBD storage backends, and different backend storage pools are distinguished by the names of the image storage backends configured in the computing module. When a cloud host is started through an image, a host node meeting the specification of the cloud host request is first scheduled, and then the creation of the cloud host is performed based on libvirt / qemu on the node.
[0051] The implementation logic of the libvirt rbd image backend is modified, so that the libvirt RBD can synchronize the image file to the current RBD storage backend through the storage underlying data copy mechanism when requesting the corresponding image. For example, a cloud host is created through image2, and when the libvirt brd driver is executed, it is found that image2 does not exist on storage A when requesting the image file of image2 from the image module, but the file exists on RBD storage B. At this time, the storage copy mechanism is called to realize the copy of the image2 image file in the RBD storage B to the RBD storage A.
[0052] The computing module monitors the copying of the image through the attribute of image_importing_to_stores, at this time, the computing module needs to poll this attribute, once it is detected that the image2 image data is copied from the RBD storage B to the RBD storage A, the cloud host is started through the image copied by the image2 on the RBD storage A, and the cloud host can be quickly started through the Copy-on-Write cloning based on the image.
[0053] If the computing module detects that the image2 fails to copy from the RBD storage B to the RBD storage A, the computing module and the image module are informed through the image_failed_import attribute, and the cloud host state is set to error, that is, the cloud host creation fails.
[0054] It should be particularly pointed out that each step in each embodiment of the method for creating a cloud host through an image can be crossed, replaced, added, deleted and reduced, and therefore, these reasonable permutations and combinations of the method for creating a cloud host through an image should also belong to the protection scope of the present application, and the protection scope of the present application should not be limited to the embodiments.
[0055] Based on the above purpose, a second aspect of the embodiment of the present application provides a device for creating a cloud host through an image. Figure 3 The device for creating a cloud host through an image provided by the present application is shown in the schematic diagram of the embodiment of the device for creating a cloud host through an image provided by the present application. Figure 3 As shown, the device for creating a cloud host through an image of the embodiment of the present application comprises the following modules: a first module 011 configured to determine whether the target image in the cloud host creation request is stored in the local cluster block storage in response to receiving the cloud host creation request; a second module 012 configured to find the target cluster block storage where the target image is located if the target image in the cloud host creation request is not stored in the local cluster block storage; a third module 013 configured to copy the target image in the target cluster block storage to the local cluster block storage through a bottom-layer data copying mechanism; and a fourth module 014 configured to start the cloud host through the target image in response to detecting the target image in the local cluster block storage.
[0056] In some embodiments of the present application, the first module 011 is further configured to: determine whether the target image in the cloud host creation request is stored in the local cluster block storage of the local node based on scheduling the specification-compliant host node and setting the specification-compliant host node as the local node in response to receiving the cloud host creation request.
[0057] In some embodiments of the present application, the second module 012 is further configured to: acquire a logical mapping in the local cluster block storage based on the target image, and find the target cluster block storage where the target image is located based on the logical mapping.
[0058] In some embodiments of the present application, the third module 013 is further configured to: monitor the copy state through the image attribute parameter; poll the image attribute parameter, and determine whether the copy is successful based on the image attribute parameter.
[0059] In some embodiments of the present application, the third module 013 is further configured to: in response to determining that the copy is successful based on the image attribute parameter, determine whether the target image is detected in the local cluster block storage.
[0060] In some embodiments of the present application, the third module 013 is further configured to: in response to determining that the copy fails based on the image attribute parameter, set the cloud host state to error, and send a creation failure alarm.
[0061] In some embodiments of the present application, the fourth module 014 is further configured to: if the target image in the cloud host creation request is stored in the local cluster block storage, acquire the target image from the local cluster block storage, and start the cloud host through the target image.
[0062] To achieve the above object, a third aspect of the embodiments of the present application provides a computer device. Figure 4 The figure shows a schematic diagram of an embodiment of the computer device provided by the present application. As shown in the figure, Figure 4 The computer device of the embodiments of the present application includes the following devices: at least one processor 021; and a memory 022, the memory 022 storing computer instructions 023 executable on the processor, the instructions being executed by the processor to implement the steps of the method, including: in response to receiving a cloud host creation request, determining whether a target image in the cloud host creation request is stored in a local cluster block storage; if the target image in the cloud host creation request is not stored in the local cluster block storage, finding a target cluster block storage where the target image is located; copying the target image in the target cluster block storage to the local cluster block storage through a bottom-layer data copy mechanism; and in response to detecting the target image in the local cluster block storage, starting a cloud host through the target image.
[0063] In some embodiments of the present application, in response to receiving a cloud host creation request, determining whether a target image in the cloud host creation request is stored in a local cluster block storage includes: in response to receiving the cloud host creation request, scheduling a host node conforming to a specification based on the cloud host creation request, and setting the host node conforming to the specification as a local node; determining whether the target image in the cloud host creation request is stored in a local cluster block storage of the local node.
[0064] In some embodiments of the present application, the step of finding the target cluster block storage where the target image is located comprises: obtaining a logical mapping in the local cluster block storage based on the target image, and finding the target cluster block storage where the target image is located based on the logical mapping.
[0065] In some embodiments of the present application, the step further comprises: monitoring the copy state through the image attribute parameter; polling the image attribute parameter, and determining whether the copy is successful based on the image attribute parameter.
[0066] In some embodiments of the present application, the step further comprises: in response to determining that the copy is successful based on the image attribute parameter, determining whether the target image is detected in the local cluster block storage.
[0067] In some embodiments of the present application, the step further comprises: in response to determining that the copy fails based on the image attribute parameter, setting the cloud host state to error, and sending a creation failure alarm.
[0068] In some embodiments of the present application, the step further comprises: if the target image in the cloud host creation request is stored in the local cluster block storage, obtaining the target image from the local cluster block storage, and starting the cloud host through the target image.
[0069] The present application also provides a computer readable storage medium. Figure 5 Shown is a schematic diagram of an embodiment of the computer readable storage medium provided by the present application. Figure 5 As shown, the computer readable storage medium 031 stores a computer program 032 which is executed by a processor to perform the above method.
[0070] Finally, it should be noted that those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program to instruct related hardware, and the program of the method of creating a cloud host through an image can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments of the method. The storage medium of the program can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiments can achieve the same or similar effects as any of the above-mentioned method embodiments.
[0071] In addition, the method disclosed in the embodiments of the present application can also be implemented as a computer program executed by a processor, which can be stored in a computer readable storage medium. When the computer program is executed by the processor, the above-mentioned functions defined in the method disclosed in the embodiments of the present application are executed.
[0072] Furthermore, the method steps and system elements described above can also be implemented using a controller and a computer readable storage medium for storing a computer program which causes the controller to implement the steps or element functions described above.
[0073] Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein can be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans can implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
[0074] In one or more exemplary designs, the functions described can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions can be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media can be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code means in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or other wire-based, fiber-optic based, or wireless technologies, then the coaxial cable, fiber optic cable, twisted pair, DSL, or other wire-based, fiber-optic based, or wireless technologies are included in the definition of medium. Disk and disc, as used herein, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0075] The above are exemplary embodiments disclosed by the present application, but it should be noted that various changes and modifications can be made without departing from the scope of the embodiments disclosed by the present application defined by the claims. The functions, steps and / or actions of the method claims described herein need not be performed in any particular order. Furthermore, although elements of the embodiments disclosed by the present application can be described or claimed in individual forms, they can also be understood as plural unless explicitly limited to single.
[0076] It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising", or "includes" and / or "including" when used herein, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0077] The above-mentioned embodiment number of the embodiments of the present application is only for description, not representing the advantages or disadvantages of the embodiments.
[0078] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by program instructing relevant hardware to complete, and the program can be stored in a computer readable storage medium, which can be read-only memory, magnetic disk or optical disk, etc.
[0079] Those skilled in the art will understand that the above discussion of any embodiment is merely exemplary and is not intended to suggest that the scope of the embodiments disclosed by the present application (including the claims) is limited to these examples; under the idea of the embodiments of the present application, the above embodiments or technical features in different embodiments can also be combined, and there are many other changes of the above aspects of the embodiments of the present application. In order to be brief, they are not provided in details. Therefore, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principles of the embodiments of the present application shall be included in the scope of protection of the embodiments of the present application.
Claims
1. A method for creating a cloud host by mirroring, characterized by, The method comprises the following steps: in response to receiving a cloud host creation request, determining whether a target image in the cloud host creation request is stored in a local cluster block storage; if the target image in the cloud host creation request is not stored in the local cluster block storage, searching for a target cluster block storage where the target image is located; copying the target image in the target cluster block storage to the local cluster block storage through a bottom-layer data copying mechanism; and in response to detecting the target image in the local cluster block storage, starting a cloud host through the target image; in response to receiving a cloud host creation request, scheduling a host node conforming to a specification based on the cloud host creation request, and setting the host node conforming to the specification as a local node; determining whether a target image in the cloud host creation request is stored in a local cluster block storage of the local node; searching for a target cluster block storage where the target image is located comprises: obtaining a logical mapping in the local cluster block storage based on the target image, and searching for the target cluster block storage where the target image is located based on the logical mapping; wherein, further comprising: monitoring a copying state through an image_importing_to_stores attribute; polling the image_importing_to_stores attribute, and determining whether the copying is successful based on the image_importing_to_stores attribute. Further comprising: 2.The method of creating a cloud host by mirroring according to claim 1, wherein, in response to determining that the copying is successful based on the image attribute parameter, determining whether the target image is detected in the local cluster block storage. Further comprising: 3.The method of creating a cloud host by mirroring according to claim 1, wherein, in response to determining that the copying fails based on the image attribute parameter, setting a cloud host state as an error, and sending a creation failure alarm. Further comprising: 4.The method of creating a cloud host by mirroring according to claim 1, wherein, if the target image in the cloud host creation request is stored in the local cluster block storage, obtaining the target image from the local cluster block storage, and starting a cloud host through the target image. Comprising:
5. An apparatus for creating a cloud host by mirroring, the apparatus comprising: a first module configured to, in response to receiving a cloud host creation request, determine whether a target image in the cloud host creation request is stored in a local cluster block storage; the first module is further configured to, in response to receiving a cloud host creation request, schedule a host node conforming to a specification based on the cloud host creation request, and set the host node conforming to the specification as a local node; determine whether a target image in the cloud host creation request is stored in a local cluster block storage of the local node; a second module configured to, if the target image in the cloud host creation request is not stored in the local cluster block storage, search for a target cluster block storage where the target image is located; the second module is further configured to, based on the target image, obtain a logical mapping in the local cluster block storage, and based on the logical mapping, search for the target cluster block storage where the target image is located; a third module configured to copy the target image in the target cluster block storage to the local cluster block storage through a bottom layer data copy mechanism; and a fourth module configured to start a cloud host through the target image in response to detecting the target image in the local cluster block storage; wherein further comprising: monitoring the copy state through the attribute of image_importing_to_stores; polling the attribute of image_importing_to_stores and judging whether the copy is successful based on the attribute of image_importing_to_stores.
6. A computer device, characterized by comprising: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executed by the processor to implement the steps of the method of any one of claims 1-4.
7. A computer-readable storage medium storing a computer program, wherein the computer program comprises the following steps of: receiving a request for a resource from a client; determining whether the client is authorized to access the resource; and if the client is authorized to access the resource, providing the resource to the client. the computer program being executed by the processor to implement the steps of the method of any one of claims 1-4.
Citation Information
Patent Citations
Cloud host creation method and device and cloud service system
CN108076078A
Data loading method, device and system
CN110955720A
Virtual machine creation method, system and device, server and storage medium
CN112084010A