A virtual machine creation method, device, equipment and computer readable storage medium

By segmenting and writing target mirror data in parallel during the virtual machine creation process, the problems of low disk storage space utilization and low virtual machine creation efficiency in the existing technology are solved, and a more efficient virtual machine creation process is achieved.

CN113703922BActive Publication Date: 2025-03-25JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111006765.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-30
Publication Date
2025-03-25
Estimated Expiration
2041-08-30

AI Technical Summary

Technical Problem

The existing virtual machine creation method results in low disk storage space utilization and low virtual machine creation efficiency.

Method used

By parsing the received virtual machine creation request, it is determined whether the target mirror data exists in the storage backend. If it does not exist, the target mirror data is downloaded locally, and the segmentation operation is performed to obtain each mirror data block, and distribute it to each virtual machine node in the local computing area, and use these nodes to write to the storage backend in parallel.

Benefits of technology

Make full use of the disk storage space of each virtual machine node in the local computing area, significantly improving the efficiency of virtual machine creation and avoiding the performance bottleneck of single-node writing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113703922B_ABST
    Figure CN113703922B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for creating a virtual machine, including: parsing a received virtual machine creation request to obtain target image data corresponding to the virtual machine to be created; judging whether the target image data exists in the storage backend; if not, downloading the target image data to the local, segmenting the target image data to obtain each image data block; distributing each image data block to each virtual machine node in the local computing area; using each virtual machine node to write each image data block to the storage backend in parallel, so that the storage backend obtains the target image data; retrieving the target image data from the storage backend to perform a creation operation on the virtual machine to be created. The present invention makes full use of the disk storage space of each virtual machine node in the local computing area, greatly improving the efficiency of virtual machine creation. The present invention also discloses a virtual machine creation device, equipment and storage medium, which have corresponding technical effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage technology, and in particular to a virtual machine creation method, device, equipment and computer-readable storage medium. Background Art

[0002] In large-scale cloud platform architectures, the virtual machine image files and the storage space used by the virtual machine at runtime are usually not in the same backend storage. They are physically two unconnected storage systems, and may even be located in different regions. During the virtual machine creation process, the image data used by the virtual machine needs to be copied from the image storage backend to the storage backend when the virtual machine is running.

[0003] The current common way to create a virtual machine is that the host VMM (Virtual Machine Monitor) where the virtual machine is located first downloads the image data to the local disk space where the VMM program is located by calling the API (Application Programming Interface) of the image service, and then transfers it to the storage backend used by the virtual machine. After that, the VMM program starts to create the virtual machine process and memory space, and associates the virtual machine process with the data on the storage backend to complete the virtual machine creation operation. When the image data is too large, it takes a lot of time to transfer the data.

[0004] To speed up this process, the VMM program usually caches a copy of the image data that has been used locally to avoid repeated downloading when creating a virtual machine with the same image next time. However, this approach consumes a certain amount of local storage space, and in actual use, the disk usage of each virtual machine node cannot be balanced. This can easily lead to some virtual machine node disks being full, while some virtual machine node disks still have more storage space left, resulting in low disk storage space utilization and low virtual machine creation efficiency.

[0005] In summary, how to effectively solve the problem of low disk storage space utilization and low virtual machine creation efficiency in the existing virtual machine creation method is a problem that technicians in this field urgently need to solve. Summary of the invention

[0006] The purpose of the present invention is to provide a virtual machine creation method, which fully utilizes the disk storage space of each virtual machine node in the local computing area, thereby greatly improving the efficiency of virtual machine creation; another purpose of the present invention is to provide a virtual machine creation device, equipment and computer-readable storage medium.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0008] A method for creating a virtual machine, comprising:

[0009] Parse the received virtual machine creation request to obtain the target image data corresponding to the virtual machine to be created;

[0010] Determine whether the target image data exists in the storage backend;

[0011] If not, download the target image data to the local computer, and perform a segmentation operation on the target image data to obtain image data blocks;

[0012] Distributing each of the mirror data blocks to each of the virtual machine nodes in the local computing area;

[0013] Using each of the virtual machine nodes to write each of the mirror data blocks to the storage backend in parallel, so that the storage backend obtains the target mirror data;

[0014] The target image data is retrieved from the storage backend to perform a creation operation on the virtual machine to be created.

[0015] In a specific implementation of the present invention, the target image data is split, including:

[0016] Respectively obtain node information of each of the virtual machine nodes in the local computing area;

[0017] The target mirror data is segmented according to the node information.

[0018] In a specific implementation of the present invention, distributing each of the mirror data blocks to each of the virtual machine nodes in the local computing area includes:

[0019] Distribute each of the mirror data blocks to each of the virtual machine nodes in the local computing area according to a preset distribution rule.

[0020] In a specific implementation of the present invention, using each of the virtual machine nodes to write each of the mirror data blocks to the storage backend in parallel includes:

[0021] Receiving confirmation messages returned by each of the virtual machine nodes based on receipt of each of the mirror data blocks;

[0022] Determine whether each of the virtual machine nodes has returned a completion response to the confirmation message;

[0023] If so, each of the virtual machine nodes is used to write each of the mirror data blocks to the storage backend in parallel.

[0024] In a specific implementation of the present invention, after distributing each of the mirror data blocks to each of the virtual machine nodes in the local computing area, the method further includes:

[0025] Obtaining the image data block sizes and offsets corresponding to the image data blocks divided into the virtual machine nodes;

[0026] A data correspondence table is generated, and the image data block sizes and offsets corresponding to each of the virtual machine nodes are recorded using the data correspondence table.

[0027] In a specific implementation of the present invention, using each of the virtual machine nodes to write each of the mirror data blocks to the storage backend in parallel includes:

[0028] Each of the virtual machine nodes is utilized to write each of the mirror data blocks in parallel to the storage backend according to the data correspondence table.

[0029] In a specific implementation of the present invention, after the target mirror data is segmented to obtain mirror data blocks, the method further includes:

[0030] Generate data verification files corresponding to each of the mirror data blocks;

[0031] After using each of the virtual machine nodes to write each of the mirror data blocks to the storage backend in parallel, the method further includes:

[0032] Performing verification operations on each of the mirror data blocks according to each of the data verification files;

[0033] Retrieving the target image data from the storage backend to perform a creation operation on the virtual machine to be created includes:

[0034] When all the mirror data blocks have passed the verification, the target mirror data is retrieved from the storage backend to perform a creation operation on the virtual machine to be created.

[0035] A virtual machine creation device, comprising:

[0036] The request parsing module is used to parse the received virtual machine creation request to obtain the target image data corresponding to the virtual machine to be created;

[0037] A determination module, used to determine whether the target image data exists in the storage backend;

[0038] A data splitting module, used for downloading the target image data to a local computer and performing a splitting operation on the target image data to obtain image data blocks when it is determined that the target image data does not exist in the storage backend;

[0039] A data block distribution module, used to distribute each of the mirror data blocks to each of the virtual machine nodes in the local computing area;

[0040] A data block parallel writing module, used to use each of the virtual machine nodes to write each of the mirror data blocks to the storage backend in parallel, so that the storage backend obtains the target mirror data;

[0041] The virtual machine creation module is used to retrieve the target image data from the storage backend to perform a creation operation on the virtual machine to be created.

[0042] A virtual machine creation device, comprising:

[0043] Memory for storing computer programs;

[0044] A processor is used to implement the steps of the virtual machine creation method as described above when executing the computer program.

[0045] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the virtual machine creation method described above are implemented.

[0046] The virtual machine creation method provided by the present invention parses the received virtual machine creation request to obtain the target image data corresponding to the virtual machine to be created; determines whether the target image data exists in the storage backend; if not, downloads the target image data to the local, and performs a segmentation operation on the target image data to obtain each image data block; distributes each image data block to each virtual machine node in the local computing area; uses each virtual machine node to write each image data block to the storage backend in parallel, so that the storage backend obtains the target image data; and retrieves the target image data from the storage backend to perform a creation operation on the virtual machine to be created.

[0047] It can be seen from the above technical solution that when it is determined that the target image data corresponding to the virtual machine to be created does not exist in the backend storage, the target image data downloaded to the local computer is divided into data blocks, and the multiple image data blocks obtained by the division are distributed to each virtual machine node in the local computing area, thereby using multiple virtual machine nodes to send each image data block in parallel to the storage backend. The present invention makes full use of the disk storage space of each virtual machine node in the local computing area, and greatly improves the efficiency of virtual machine creation.

[0048] Correspondingly, the present invention also provides a virtual machine creation device, equipment and computer-readable storage medium corresponding to the above-mentioned virtual machine creation method, which have the above-mentioned technical effects and are not repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 A flowchart of a method for creating a virtual machine according to an embodiment of the present invention;

[0051] Figure 2 Another implementation flow chart of the method for creating a virtual machine in an embodiment of the present invention;

[0052] Figure 3 A structural block diagram of a virtual machine creation device in an embodiment of the present invention;

[0053] Figure 4 A structural block diagram of a virtual machine creation device in an embodiment of the present invention;

[0054] Figure 5 A schematic diagram of a specific structure of a virtual machine creation device provided in this embodiment. DETAILED DESCRIPTION

[0055] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0056] See also Figure 1 , Figure 1 This is a flowchart of an implementation of a method for creating a virtual machine in an embodiment of the present invention. The method may include the following steps:

[0057] S101: Parse the received virtual machine creation request to obtain target image data corresponding to the virtual machine to be created.

[0058] When a virtual machine needs to be created, the virtual machine creation request end generates a virtual machine creation request and sends the virtual machine creation request to the image data management center. The virtual machine creation request contains the target image data corresponding to the virtual machine to be created. The image data management center receives the virtual machine creation request and parses the received virtual machine creation request to obtain the target image data corresponding to the virtual machine to be created.

[0059] S102: Determine whether the target image data exists in the storage backend, if yes, execute step S106, if no, execute step S103.

[0060] After parsing and obtaining the target image data corresponding to the virtual machine to be created, the image data management center determines whether the target image data exists in the storage backend. If yes, it means that the target image data has been stored in the backend in advance, and step S106 is executed. If no, it means that the target image data has not been stored in the backend, and step S103 is executed. For example, it can be determined whether the target image data required for creating the virtual machine to be created exists in the storage backend according to the identification information of the virtual machine to be created.

[0061] S103: Download the target image data to the local computer, and split the target image data into blocks of image data.

[0062] When it is determined that the target image data does not exist in the storage backend, it means that the target image data has not been backend stored, the target image data is downloaded to the local, and the target image data is split to obtain image data blocks.

[0063] It should be noted that the target image data segmentation rules can be set and adjusted according to actual conditions, and the embodiments of the present invention do not limit this. For example, the target image data can be segmented by hash table, average segmentation, fixed size segmentation, etc.

[0064] S104: Distribute each mirror data block to each virtual machine node in the local computing area.

[0065] The local computing area generally includes multiple virtual machine nodes. After the target image data is segmented to obtain each image data block, each image data block is distributed to each virtual machine node in the local computing area. For example, each image data block can be distributed to each virtual machine node according to the available disk storage space size of each virtual machine node in the local computing area.

[0066] S105: Using each virtual machine node to write each mirror data block to the storage backend in parallel, so that the storage backend obtains the target mirror data.

[0067] After distributing each mirror data block to each virtual machine node in the local computing area, each virtual machine node is used to write each mirror data block in parallel to the storage backend, that is, each mirror data block is written in parallel to the storage backend according to the splicing order of each mirror data block in the target mirror data, so that the storage backend obtains the target mirror data. By writing each mirror data block in parallel, the utilization rate of the disk storage space of each virtual machine node is greatly improved, and the efficiency of sending the target mirror data to the backend storage is greatly improved.

[0068] S106: Retrieve target image data from the storage backend to perform a creation operation on the virtual machine to be created.

[0069] After each virtual machine node is used to write each mirror data block to the storage backend in parallel, the target mirror data is retrieved from the storage backend to perform a creation operation on the virtual machine to be created. The present invention uses each virtual machine node to write each mirror data block to the storage backend in parallel, converting the transmission task of a large amount of data into a distributed task, thereby sharing the pressure of data cache on disk space, avoiding the problem of uneven disk occupancy of virtual machine nodes, thereby fully utilizing the disk storage space of each virtual machine node in the local computing area, greatly improving the efficiency of virtual machine creation, and avoiding the performance bottleneck of single-node writing.

[0070] It can be seen from the above technical solution that when it is determined that the target image data corresponding to the virtual machine to be created does not exist in the backend storage, the target image data downloaded to the local computer is divided into data blocks, and the multiple image data blocks obtained by the division are distributed to each virtual machine node in the local computing area, thereby using multiple virtual machine nodes to send each image data block in parallel to the storage backend. The present invention makes full use of the disk storage space of each virtual machine node in the local computing area, and greatly improves the efficiency of virtual machine creation.

[0071] It should be noted that, based on the above embodiment, the embodiment of the present invention also provides corresponding improved solutions. In the subsequent embodiments, the same steps or corresponding steps as those in the above embodiment can be referenced to each other, and the corresponding beneficial effects can also be referenced to each other, which will not be repeated one by one in the following improved embodiments.

[0072] See also Figure 2 , Figure 2 Another implementation flow chart of the method for creating a virtual machine in an embodiment of the present invention is shown below. The method may include the following steps:

[0073] S201: Parse the received virtual machine creation request to obtain target image data corresponding to the virtual machine to be created.

[0074] S202: Determine whether the target image data exists in the storage backend, if so, execute step S206, if not, execute step S215.

[0075] S203: Download the target image data to the local computer.

[0076] S204: Obtain node information of each virtual machine node in the local computing area respectively.

[0077] After the target image data is downloaded to the local computer, the node information of each virtual machine node in the local computing area is obtained respectively. The node information of each virtual machine node may include the available storage space size of each virtual machine node, the system busyness, and other information.

[0078] S205: Splitting the target mirror data according to the information of each node to obtain mirror data blocks.

[0079] After obtaining the node information of each virtual machine node in the local computing area, the target mirror data is segmented according to the node information to obtain each mirror data block. For example, a virtual machine node with large available storage space and low system busyness can be segmented into a relatively large mirror data block, and a virtual machine node with small available storage space and high system busyness can be segmented into a relatively small mirror data block.

[0080] S206: Generate data verification files corresponding to each mirror data block.

[0081] After the mirror data blocks are obtained by segmentation, data verification files corresponding to the mirror data blocks are generated. For example, a corresponding MD5 code can be generated for each mirror data block, and the accuracy of the mirror data block transmission is ensured by subsequently verifying the MD5 code.

[0082] S207: Distribute each mirror data block to each virtual machine node in the local computing area according to a preset distribution rule.

[0083] After each mirror data block is obtained by segmentation, each mirror data block is distributed to each virtual machine node in the local computing area according to a preset distribution rule. Following the example in step S205, each mirror data block can be distributed to each virtual machine node in the local computing area in a manner that the size of the available storage space is proportional to the size of the mirror data block. Each virtual machine node can store the corresponding mirror data block according to the initialized mirror cache directory and mirror metadata storage structure.

[0084] S208: Obtain the mirror data block size and offset corresponding to each mirror data block divided into each virtual machine node.

[0085] After distributing each mirror data block to each virtual machine node in the local computing area, the mirror data block size and offset corresponding to each mirror data block divided to each virtual machine node are obtained.

[0086] S209: Generate a data correspondence table, and use the data correspondence table to record the image data block size and offset corresponding to each virtual machine node.

[0087] After obtaining the image data block size and offset corresponding to each image data block divided into each virtual machine node, a data correspondence table is generated, and the image data block size and offset corresponding to each virtual machine node are recorded using the data correspondence table. In addition, the data correspondence table can be synchronized to the image data management center of each virtual machine node in the local computing area, so that when the same virtual machine is created later, a virtual machine creation request is sent to any virtual machine node in the local computing area, and the target image data can be obtained through the data correspondence table.

[0088] S210: receiving confirmation messages returned by each virtual machine node based on receipt of each mirror data block.

[0089] After receiving the corresponding mirror data block, each virtual machine node in the local computing area will return a confirmation message to the mirror data management center. The mirror data management center receives the confirmation message returned by each virtual machine node based on the received mirror data block.

[0090] S211: Determine whether all virtual machine nodes have completed returning the confirmation message. If so, execute step S212; if not, do nothing.

[0091] After distributing each mirror data block to each virtual machine node in the local computing area, the mirror data management center can determine in real time or at a preset time interval whether each virtual machine node has completed returning the confirmation message. If so, it means that each virtual machine node has completed receiving the corresponding mirror data block, and execute step S212. If not, it means that there are still virtual machine nodes among the virtual machine nodes that have not completed receiving the corresponding mirror data block, and no processing is performed.

[0092] S212: Using each virtual machine node to write each mirror data block to the storage backend in parallel according to the data correspondence table, so that the storage backend obtains the target mirror data.

[0093] Create a blank disk in the storage backend in advance and save the disk information. When it is determined that each virtual machine node has completed returning the confirmation message, it means that each virtual machine node has completed receiving the corresponding mirror data block. Use each virtual machine node to write each mirror data block in parallel to the disk of the storage backend according to the data correspondence table, so that the storage backend obtains the target mirror data. By writing each mirror data block in parallel to the storage backend according to the correspondence table, the accuracy of the write position of each mirror data block to the backend storage is guaranteed. The storage backend can store the corresponding mirror data block according to the initialized mirror cache directory and mirror metadata storage structure.

[0094] S213: performing verification operations on each mirror data block according to each data verification file.

[0095] After writing each mirror data block to the storage backend in parallel, each mirror data block is verified according to each data verification file. By verifying each mirror data block, if each mirror data block is tampered with during transmission, the tampered mirror data block can be identified in time, thereby improving the accuracy of the mirror data block.

[0096] S214: When all the mirror data blocks have passed the verification, the target mirror data is retrieved from the storage backend to perform a creation operation on the virtual machine to be created.

[0097] When it is determined that all the image data blocks have passed the verification, it means that all the image data blocks have not been tampered with during the transmission process, and the target image data is retrieved from the storage backend to perform a creation operation on the virtual machine to be created.

[0098] S215: Directly retrieve the target image data from the storage backend to perform a creation operation on the virtual machine to be created.

[0099] When it is determined that the target image data already exists in the storage backend, it means that the target image data has been pre-stored in the backend, and the target image data is directly retrieved from the storage backend to perform the creation operation on the virtual machine to be created.

[0100] This embodiment is different from the embodiment 1 corresponding to the technical solution claimed for protection by the independent claim 1, and further adds the technical solutions claimed for protection by the dependent claims 2 to 7. Of course, according to different actual conditions and requirements, the technical solutions claimed for protection by the dependent claims can be flexibly combined without affecting the integrity of the solutions, so as to better meet the requirements of different usage scenarios. This embodiment only provides one of the solutions with the most solutions and the best effects. Due to the complexity of the situation, it is impossible to list all possible solutions one by one. Those skilled in the art should be able to realize that there can be many examples based on the basic method principles provided by this application in combination with actual conditions, and they should all be within the scope of protection of this application without sufficient creative work.

[0101] Corresponding to the above method embodiment, the present invention further provides a virtual machine creation device. The virtual machine creation device described below and the virtual machine creation method described above can refer to each other.

[0102] See also Figure 3 , Figure 3 This is a structural block diagram of a virtual machine creation device in an embodiment of the present invention, and the device may include:

[0103] The request parsing module 31 is used to parse the received virtual machine creation request to obtain the target image data corresponding to the virtual machine to be created;

[0104] A determination module 32, used to determine whether the target image data exists in the storage backend;

[0105] The data segmentation module 33 is used to download the target image data to the local computer and perform segmentation operation on the target image data to obtain image data blocks when it is determined that the target image data does not exist in the storage backend;

[0106] A data block distribution module 34, used to distribute each mirror data block to each virtual machine node in the local computing area;

[0107] The data block parallel writing module 35 is used to use each virtual machine node to write each mirror data block to the storage backend in parallel, so that the storage backend obtains the target mirror data;

[0108] The virtual machine creation module 36 is used to retrieve the target image data from the storage backend to perform a creation operation on the virtual machine to be created.

[0109] It can be seen from the above technical solution that when it is determined that the target image data corresponding to the virtual machine to be created does not exist in the backend storage, the target image data downloaded to the local computer is divided into data blocks, and the multiple image data blocks obtained by the division are distributed to each virtual machine node in the local computing area, thereby using multiple virtual machine nodes to send each image data block in parallel to the storage backend. The present invention makes full use of the disk storage space of each virtual machine node in the local computing area, and greatly improves the efficiency of virtual machine creation.

[0110] In a specific embodiment of the present invention, the data segmentation module 33 includes:

[0111] The node information acquisition submodule is used to respectively acquire the node information of each virtual machine node in the local computing area;

[0112] The data splitting submodule is used to split the target mirror data according to the information of each node.

[0113] In a specific implementation of the present invention, the data block distribution module 34 is specifically a module that distributes each mirror data block to each virtual machine node in the local computing area according to a preset distribution rule.

[0114] In a specific implementation of the present invention, the data block parallel writing module 35 includes:

[0115] A confirmation message receiving submodule, used to receive confirmation messages returned by each virtual machine node based on the received mirror data blocks;

[0116] A judgment submodule is used to judge whether each virtual machine node has completed returning the confirmation message;

[0117] The data block parallel writing submodule is used to use each virtual machine node to write each mirror data block to the storage backend in parallel when it is determined that each virtual machine node has completed returning the confirmation message.

[0118] In a specific embodiment of the present invention, the device may further include:

[0119] The size and offset acquisition module is used to obtain the image data block size and offset corresponding to each image data block divided by each virtual machine node after distributing each image data block to each virtual machine node in the local computing area;

[0120] The size and offset recording module is used to generate a data correspondence table, and use the data correspondence table to record the image data block size and offset corresponding to each virtual machine node.

[0121] In a specific implementation of the present invention, the data block parallel writing module 35 is specifically a module that uses each virtual machine node to write each mirror data block in parallel to the storage backend according to the data correspondence table.

[0122] In a specific embodiment of the present invention, the device may further include:

[0123] The verification file generation module is used to generate data verification files corresponding to each mirror data block after the target mirror data is segmented to obtain each mirror data block;

[0124] A data block verification module is used to perform verification operations on each mirror data block according to each data verification file after each virtual machine node writes each mirror data block to the storage backend in parallel;

[0125] The virtual machine creation module 36 is specifically a module that retrieves the target image data from the storage backend to perform a creation operation on the virtual machine to be created when all image data blocks have passed verification.

[0126] Corresponding to the above method embodiment, see Figure 4 , Figure 4 A schematic diagram of a virtual machine creation device provided by the present invention, the device may include:

[0127] A memory 332, for storing computer programs;

[0128] The processor 322 is used to implement the steps of the virtual machine creation method of the above method embodiment when executing a computer program.

[0129] For details, please refer to Figure 5 , Figure 5A specific structural diagram of a virtual machine creation device provided for this embodiment, the virtual machine creation device may have relatively large differences due to different configurations or performances, and may include a processor (central processing units, CPU) 322 (for example, one or more processors) and a memory 332, and the memory 332 stores one or more computer applications 342 or data 344. Among them, the memory 332 can be a temporary storage or a permanent storage. The program stored in the memory 332 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the data processing device. Furthermore, the processor 322 can be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the virtual machine creation device 301.

[0130] The virtual machine creation device 301 may further include one or more power supplies 326 , one or more wired or wireless network interfaces 350 , one or more input and output interfaces 358 , and / or one or more operating systems 341 .

[0131] The steps in the virtual machine creation method described above can be implemented by the structure of the virtual machine creation device.

[0132] Corresponding to the above method embodiment, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps can be implemented:

[0133] Parse the received virtual machine creation request to obtain the target image data corresponding to the virtual machine to be created; determine whether the target image data exists in the storage backend; if not, download the target image data to the local, split the target image data to obtain each image data block; distribute each image data block to each virtual machine node in the local computing area; use each virtual machine node to write each image data block to the storage backend in parallel, so that the storage backend obtains the target image data; retrieve the target image data from the storage backend to perform the creation operation on the virtual machine to be created.

[0134] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0135] For an introduction to the computer-readable storage medium provided by the present invention, please refer to the above method embodiment, and the present invention will not be elaborated here.

[0136] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the devices, equipment and computer-readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0137] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the technical solution and core ideas of the present invention. It should be pointed out that for ordinary technicians in this technical field, the present invention can also be improved and modified without departing from the principles of the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A method for creating a virtual machine, characterized in that: include: Parse the received virtual machine creation request to obtain the target image data corresponding to the virtual machine to be created; Determine whether the target image data exists in the storage backend; If not, download the target image data to the local computer, and perform a segmentation operation on the target image data to obtain image data blocks; Distributing each of the mirror data blocks to each of the virtual machine nodes in the local computing area; Using each of the virtual machine nodes to write each of the mirror data blocks to the storage backend in parallel, so that the storage backend obtains the target mirror data; Retrieving the target image data from the storage backend to perform a creation operation on the virtual machine to be created; The target image data is segmented, including: Respectively obtain node information of each virtual machine node in the local computing area; the node information of each virtual machine node includes the available storage space size and system busyness of each virtual machine node; Performing a segmentation operation on the target mirror data according to the node information; Distributing each of the mirror data blocks to each of the virtual machine nodes in the local computing area includes: Each mirror data block is distributed to each virtual machine node in the local computing area in a manner that the size of the available storage space is proportional to the size of the mirror data block.

2. The method for creating a virtual machine according to claim 1, characterized in that: Using each of the virtual machine nodes to write each of the mirror data blocks to the storage backend in parallel includes: Receiving confirmation messages returned by each of the virtual machine nodes based on receipt of each of the mirror data blocks; Determine whether each of the virtual machine nodes has returned a completion response to the confirmation message; If so, each of the virtual machine nodes is used to write each of the mirror data blocks to the storage backend in parallel.

3. The method for creating a virtual machine according to any one of claims 1 to 2, characterized in that: After distributing each of the mirror data blocks to each of the virtual machine nodes in the local computing area, the method further includes: Obtaining the image data block sizes and offsets corresponding to the image data blocks divided into the virtual machine nodes; A data correspondence table is generated, and the image data block sizes and offsets corresponding to each of the virtual machine nodes are recorded using the data correspondence table.

4. The method for creating a virtual machine according to claim 3, characterized in that: Using each of the virtual machine nodes to write each of the mirror data blocks to the storage backend in parallel includes: Each of the virtual machine nodes is utilized to write each of the mirror data blocks in parallel to the storage backend according to the data correspondence table.

5. The method for creating a virtual machine according to claim 1, characterized in that: After the target mirror data is segmented to obtain mirror data blocks, the method further includes: Generate data verification files corresponding to each of the mirror data blocks; After using each of the virtual machine nodes to write each of the mirror data blocks to the storage backend in parallel, the method further includes: Performing verification operations on each of the mirror data blocks according to each of the data verification files; Retrieving the target image data from the storage backend to perform a creation operation on the virtual machine to be created includes: When all the mirror data blocks have passed the verification, the target mirror data is retrieved from the storage backend to perform a creation operation on the virtual machine to be created.

6. A virtual machine creation device, characterized in that: include: The request parsing module is used to parse the received virtual machine creation request to obtain the target image data corresponding to the virtual machine to be created; A determination module, used to determine whether the target image data exists in the storage backend; A data splitting module is used to download the target image data to a local computer when it is determined that the target image data does not exist in the storage backend, and obtain node information of each virtual machine node in the computing area where the local computer is located; the node information of each virtual machine node includes the available storage space size and system busyness of each virtual machine node; and split the target image data according to each node information to obtain each image data block; A data block distribution module is used to distribute each mirror data block to each virtual machine node in the local computing area in a manner that the size of the available storage space is proportional to the size of the mirror data block; A data block parallel writing module, used to use each of the virtual machine nodes to write each of the mirror data blocks to the storage backend in parallel, so that the storage backend obtains the target mirror data; The virtual machine creation module is used to retrieve the target image data from the storage backend to perform a creation operation on the virtual machine to be created.

7. A virtual machine creation device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the virtual machine creation method according to any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the virtual machine creation method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • File storage and processing method, device and system

    CN105205143A

  • Mirror image construction, mirror image storage, mirror image distribution method and device

    CN109358857A