Virtual machine batch creation method and device, computer equipment and storage medium
Through the virtual machine batch creation method, the user side obtains the virtual machine creation template to fill in the request information, the server side returns the target data identification, the user side obtains data from the cache or server to generate virtual machine creation data and creates virtual machines in batches, solving the problems of page stuttering and browser crashes during batch creation of virtual machines in the existing technology, and improving creation efficiency and user experience.
Patent Information
- Application Number
- CN202510108318.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-27
AI Technical Summary
When creating virtual machines in batches, existing cloud platforms cause page stuttering or browser crashes due to interface verification, data acquisition, and page loading, which affects the user experience.
Provides a method of batch creation of virtual machines. By obtaining virtual machine creation templates, users fill in multiple virtual machine creation request information, send it to the server to obtain target data identification, and the user obtains data from the cache or server, generates virtual machine creation data and batch creates virtual machines.
It significantly improves the efficiency and convenience of virtual machine creation, reduces configuration complexity and time cost, optimizes network resource utilization, and avoids duplicate data transmission and server query load.
Smart Images

Figure CN120045282A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of virtual machines, and particularly to a method and apparatus for batch creation of virtual machines, a computer device, and a storage medium. Background Art
[0002] As a technology that supplies and manages scalable, elastic, and shared physical and virtual resource pools in a self-service on-demand manner, cloud computing has profoundly changed the landscape of enterprise operations and personal life. A cloud platform is an indispensable management tool in the field of cloud computing, enabling users to conveniently, quickly, and efficiently manage physical and virtual resources. Virtual machines play a crucial role in the cloud computing architecture. By simulating the hardware environment of a physical computer, they provide users with an isolated and configurable operating system instance, allowing users to run multiple operating systems and applications on the same physical server. In the scenario of creating virtual machines, usually, virtual machines need to be created one by one by users, with very low efficiency, which seriously reduces the user experience. Although some cloud platforms have a batch import function, since corresponding interface validations, data acquisitions, page data loadings, etc. are required for each created virtual machine, if batch creation is performed, a large number of interface validations, data acquisitions, and page data loadings often lead to page lags and even browser crashes, thus affecting the normal use of the cloud platform and reducing the user experience. Summary of the Invention
[0003] Based on this, to address the above technical problems, it is necessary to provide a method and apparatus for batch creation of virtual machines, a computer device, and a storage medium that can improve the convenience and efficiency of virtual machine creation.
[0004] On the one hand, a method for batch creation of virtual machines is provided. The method includes:
[0005] In response to receiving a user's request for batch creation of virtual machines, obtain a virtual machine creation template and provide it to the user;
[0006] Obtain multiple virtual machine creation request information filled in by the user based on the virtual machine creation template, where each virtual machine creation request information includes first requirement information;
[0007] Send the multiple virtual machine creation request information to the server, so that the server can obtain corresponding first target data identifiers and second target data identifiers according to each virtual machine creation request, and return the first target data identifiers and the second target data identifiers to the user side, where the first target data identifier corresponds to the first requirement information, and the second target data identifier corresponds to the first target data identifier;
[0008] The client, in response to receiving the first target data identifier and the second target data identifier, obtains the first target data and / or the second target data from the cache and / or the server according to the first target data identifier and / or the second target data identifier;
[0009] Generate virtual machine creation data according to the first target data and the second target data;
[0010] Create a virtual machine according to the virtual machine creation data.
[0011] In one embodiment, the client includes a data cache unit. The client, in response to receiving the first target data identifier and the second target data identifier, obtains the first target data and / or the second target data from the cache and / or the server according to the first target data identifier and / or the second target data identifier, including:
[0012] Initialize the data cache unit,
[0013] According to the first target data identifier and / or the second target data identifier, determine whether the corresponding first target data and / or the second target data exist in the data cache unit,
[0014] If the corresponding first target data and / or the second target data exist in the data cache unit, obtain the first target data and / or the second target data from the data cache unit,
[0015] If the corresponding first target data and / or the second target data do not exist in the data cache unit, obtain the first target data and / or the second target data from the server, and store the first target data and / or the second target data obtained from the server in the data cache unit.
[0016] In one embodiment, the first requirement information includes first sub-requirement information and second sub-requirement information. Before sending multiple virtual machine creation request messages to the server, the method includes:
[0017] Obtain historical virtual machine creation request information;
[0018] Obtain the sub-requirement information included in the historical virtual machine creation request information;
[0019] According to the first sub-requirement information, the second sub-requirement information, and the sub-requirement information included in the historical virtual machine creation request information in the second requirement information, determine whether the sub-requirement information included in the historical virtual machine creation request information includes the first sub-requirement information and the second sub-requirement information,
[0020] If the sub-requirement information included in the historical virtual machine creation request information includes the first sub-requirement information and the second sub-requirement information, use this virtual machine creation request information as the target virtual machine creation request information;
[0021] Use the second target data identifier corresponding to the target virtual machine creation request information in the client data cache unit as the second target data identifier corresponding to the current virtual machine creation request information;
[0022] If the sub - requirement information included in the historical virtual machine creation request information does not include the first sub - requirement information and the second sub - requirement information, send multiple virtual machine creation request information to the server.
[0023] On the one hand, provide another method for batch creating virtual machines. The method includes:
[0024] Receive multiple virtual machine creation request information, where the multiple virtual machine creation request information is obtained after the client receives the user's virtual machine batch creation request, obtains the virtual machine creation template and provides it to the user, and obtains multiple virtual machine creation request information filled in by the user based on the virtual machine creation template. Each virtual machine creation request information includes first requirement information;
[0025] Obtain the corresponding first target data identifier and second target data identifier according to each virtual machine creation request;
[0026] Return the first target data identifier and the second target data identifier to the client, so that the client can obtain the first target data and the second target data from the client cache and / or the server according to the first target data identifier and the second target data identifier, and generate virtual machine creation data to batch create virtual machines according to the first target data and the second target data, where the first target data identifier corresponds to the first requirement information and the second target data identifier corresponds to the first target data identifier.
[0027] In one embodiment, the server includes a data list. The first requirement information includes the first sub - requirement information and the second sub - requirement information. The server obtains the corresponding first target data identifier and second target data identifier according to each virtual machine creation request information, including:
[0028] Parse any virtual machine batch creation request information and obtain the first requirement information;
[0029] Query whether there is a first target data identifier corresponding to the first requirement information in the server according to the first requirement information;
[0030] If a first target data identifier corresponding to the first requirement information is queried, obtain the first target data identifier and the second target data identifier;
[0031] If a first target data identifier corresponding to the first requirement information is not queried, return a verification failure of the first requirement information to the client for the client to mark that the data does not exist in the cell where the first requirement information with verification failure is located;
[0032] Among them, obtaining the first target data identifier and the second target data identifier includes:
[0033] Obtaining a first sub-target data identifier and a second sub-target data identifier according to the first sub-requirement information and the second sub-requirement information respectively, where the first sub-target data identifier corresponds to the first sub-requirement information and the second sub-target data identifier corresponds to the second sub-requirement information;
[0034] Determining the first target data identifier according to the first sub-target data identifier and the second sub-target data identifier;
[0035] Querying the corresponding second target data identifier in the data list according to the first sub-target data identifier and the second sub-target data identifier, where the data list includes the first sub-target data identifier, the second sub-target data identifier, and the second target data identifier corresponding to the first sub-target data identifier and the second sub-target data identifier.
[0036] In one embodiment, according to the first requirement information and the requirement information filling rule, it is determined whether the first requirement information conforms to the requirement information filling rule;
[0037] In response to the first requirement information conforming to the requirement information filling rule, it is returned to the user side that the first requirement information passes the verification, so that the user side marks the data verification as passed in the line where the virtual machine creation request that passes the verification is located;
[0038] In response to the first requirement information not conforming to the requirement information filling rule, it is returned to the user side that the first requirement information fails the verification, so that the user side marks the data verification as failed in the line where the virtual machine creation request that fails the verification is located.
[0039] In one embodiment, the first requirement information further includes third sub-requirement information, and the first target data identifier further includes a third sub-target data identifier, where the third sub-target data identifier corresponds to the third sub-requirement information. Determining whether the first requirement information conforms to the requirement information filling rule includes:
[0040] Determining whether there is an association relationship between the first sub-target data identifier and the third sub-target data identifier;
[0041] If there is an association relationship between the first sub-target data and the third sub-target data, the first requirement information passes the verification,
[0042] If there is no association relationship between the first sub-target data and the third sub-target data, the first requirement information fails the verification.
[0043] On the other hand, a virtual machine batch creation device is provided, and the device includes:
[0044] A request receiving module, configured to obtain a virtual machine creation template in response to receiving a user's virtual machine batch creation request and provide it to the user;
[0045] An information acquisition module, configured to obtain multiple virtual machine creation request information filled in by the user based on the virtual machine creation template, where each virtual machine creation request information includes first requirement information;
[0046] An information sending module, configured to send the multiple virtual machine creation request information to the server, so that the server can obtain corresponding first target data identifiers and second target data identifiers according to each virtual machine creation request, and return the first target data identifiers and the second target data identifiers to the user side, where the first target data identifier corresponds to the first requirement information, and the second target data identifier corresponds to the first target data identifier;
[0047] A data acquisition module, configured for the user side to obtain first target data and / or second target data from the cache and / or the server according to the first target data identifier and / or the second target data identifier in response to receiving the first target data identifier and the second target data identifier;
[0048] A creation data generation module, configured to generate virtual machine creation data according to the first target data and the second target data;
[0049] A virtual machine creation module, configured to create virtual machines according to the virtual machine creation data.
[0050] On the other hand, another virtual machine batch creation device is provided. The device includes:
[0051] An information receiving module, configured to receive multiple virtual machine creation request information, where the multiple virtual machine creation request information is obtained by the user side after receiving the user's virtual machine batch creation request, obtaining a virtual machine creation template and providing it to the user, and obtaining multiple virtual machine creation request information filled in by the user based on the virtual machine creation template, where each virtual machine creation request information includes first requirement information;
[0052] An identifier acquisition module, configured to obtain corresponding first target data identifiers and second target data identifiers according to each virtual machine creation request;
[0053] An identifier return module, configured to return the first target data identifiers and the second target data identifiers to the user side, so that the user side can obtain first target data and / or second target data from the user side cache and / or the server according to the first target data identifier and / or the second target data identifier, and generate virtual machine creation data according to the first target data and the second target data to batch create virtual machines, where the first target data identifier corresponds to the first requirement information, and the second target data identifier corresponds to the first target data identifier.
[0054] On the other hand, a computer program product is provided. When the computer program is executed by a processor, the following steps are implemented:
[0055] In response to receiving a user's virtual machine batch creation request, obtain a virtual machine creation template and provide it to the user;
[0056] Obtain multiple virtual machine creation request information filled in by the user based on the virtual machine creation template, where each virtual machine creation request information includes first requirement information;
[0057] Send the multiple virtual machine creation request information to the server, so that the server can obtain corresponding first target data identifiers and second target data identifiers according to each virtual machine creation request, and return the first target data identifiers and the second target data identifiers to the user side, where the first target data identifier corresponds to the first requirement information, and the second target data identifier corresponds to the first target data identifier;
[0058] In response to receiving the first target data identifier and the second target data identifier, the user side obtains the first target data and / or the second target data from the cache and / or the server according to the first target data identifier and / or the second target data identifier;
[0059] Generate virtual machine creation data according to the first target data and the second target data;
[0060] Create a virtual machine according to the virtual machine creation data.
[0061] On the other hand, another computer program product is provided. When the computer program is executed by a processor, the following steps are implemented:
[0062] Receive multiple virtual machine creation request information, where the multiple virtual machine creation request information is obtained by the user side after receiving the user's virtual machine batch creation request, obtaining a virtual machine creation template and providing it to the user, and obtaining multiple virtual machine creation request information filled in by the user based on the virtual machine creation template, where each virtual machine creation request information includes first requirement information;
[0063] Obtain corresponding first target data identifiers and second target data identifiers according to each virtual machine creation request;
[0064] Return the first target data identifier and the second target data identifier to the user side, so that the user side can obtain the first target data and / or the second target data from the user side cache and / or the server according to the first target data identifier and the second target data identifier, and generate virtual machine creation data to batch create virtual machines according to the first target data and the second target data, where the first target data identifier corresponds to the first requirement information, and the second target data identifier corresponds to the first target data identifier.
[0065] On the other hand, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0066] In response to receiving a user's virtual machine batch creation request, obtain a virtual machine creation template and provide it to the user;
[0067] Obtain multiple virtual machine creation request information filled in by the user based on the virtual machine creation template, where each virtual machine creation request information includes first requirement information;
[0068] Send the multiple virtual machine creation request information to the server, so that the server can obtain the corresponding first target data identifier and second target data identifier according to each virtual machine creation request, and return the first target data identifier and the second target data identifier to the user side, where the first target data identifier corresponds to the first requirement information, and the second target data identifier corresponds to the first target data identifier;
[0069] In response to receiving the first target data identifier and the second target data identifier, the user side obtains the first target data and / or the second target data from the cache and / or the server according to the first target data identifier and / or the second target data identifier;
[0070] Generate virtual machine creation data according to the first target data and the second target data;
[0071] Create a virtual machine according to the virtual machine creation data.
[0072] On the other hand, another computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0073] Receive multiple virtual machine creation request information, where the multiple virtual machine creation request information is obtained by the user side after receiving the user's virtual machine batch creation request, obtaining a virtual machine creation template and providing it to the user, and obtaining multiple virtual machine creation request information filled in by the user based on the virtual machine creation template, where each virtual machine creation request information includes first requirement information;
[0074] Obtain the corresponding first target data identifier and second target data identifier according to each virtual machine creation request;
[0075] Return the first target data identifier and the second target data identifier to the client, so that the client can obtain the first target data and / or the second target data from the client cache and / or the server according to the first target data identifier and / or the second target data identifier, and generate virtual machine creation data based on the first target data and the second target data to batch-create virtual machines, where the first target data identifier corresponds to the first requirement information, and the second target data identifier corresponds to the first target data identifier.
[0076] In another aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0077] In response to receiving a virtual machine batch creation request from the user, obtain a virtual machine creation template and provide it to the user; obtain multiple virtual machine creation request information filled in by the user based on the virtual machine creation template, where each virtual machine creation request information includes first requirement information;
[0078] Send the multiple virtual machine creation request information to the server, so that the server can obtain the corresponding first target data identifier and second target data identifier according to each virtual machine creation request, and return the first target data identifier and the second target data identifier to the client, where the first target data identifier corresponds to the first requirement information, and the second target data identifier corresponds to the first target data identifier;
[0079] In response to receiving the first target data identifier and the second target data identifier, the client obtains the first target data and / or the second target data from the cache and / or the server according to the first target data identifier and / or the second target data identifier;
[0080] Generate virtual machine creation data based on the first target data and the second target data;
[0081] Create virtual machines according to the virtual machine creation data.
[0082] In another aspect, another computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0083] Receive multiple virtual machine creation request information, where the multiple virtual machine creation request information is obtained by the client after receiving a virtual machine batch creation request from the user, obtaining a virtual machine creation template and providing it to the user, and obtaining multiple virtual machine creation request information filled in by the user based on the virtual machine creation template, where each virtual machine creation request information includes first requirement information;
[0084] Obtain the corresponding first target data identifier and second target data identifier according to each virtual machine creation request;
[0085] Return the first target data identifier and the second target data identifier to the client, so that the client can obtain the first target data and / or the second target data from the client cache and / or the server according to the first target data identifier and / or the second target data identifier, and generate virtual machine creation data based on the first target data and the second target data to batch-create virtual machines, where the first target data identifier corresponds to the first requirement information, and the second target data identifier corresponds to the first target data identifier.
[0086] The above virtual machine batch creation method, device, computer device, and storage medium significantly improve the efficiency and flexibility of resource allocation by optimizing the virtual machine batch creation process. In the traditional virtual machine creation process, users need to manually configure the parameters of each virtual machine one by one, which is time-consuming and prone to errors due to manual operations. However, this method standardizes the virtual machine creation requests through template design, allowing users to only fill in the core configuration requirements, greatly reducing the configuration complexity and time cost. In addition, the collaborative work between the client and the server further improves the data processing efficiency. The server automatically parses and generates the first target data identifier and the second target data identifier according to the user request and returns them to the client. The client then quickly extracts the required data from the cache or the server based on the identifiers, avoiding the overhead of repeated data transmission, thus optimizing the network resource utilization rate and improving the convenience and efficiency of virtual machine creation. Description of the Drawings
[0087] Figure 1 It is an application environment diagram of the virtual machine batch creation method in an embodiment;
[0088] Figure 2 It is a flowchart of the virtual machine batch creation method in an embodiment;
[0089] Figure 3 It is a schematic diagram of the creation template for virtual machine batch creation in an embodiment;
[0090] Figure 4 It is a flowchart of the virtual machine batch creation steps in an embodiment;
[0091] Figure 5 It is a flowchart of the virtual machine batch creation steps in another embodiment;
[0092] Figure 6 It is a structural block diagram of the virtual machine batch creation device in an embodiment;
[0093] Figure 7 It is a structural block diagram of the virtual machine batch creation device in an embodiment;
[0094] Figure 8 It is an internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0095] To make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0096] The virtual machine batch creation method provided by the present application can be applied to, for example Figure 1 the application environment shown in the figure. Among them, the terminal 102 communicates with the server 104 through the network. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0097] In one embodiment, as Figure 2 shown in the figure, a virtual machine batch creation method is provided. Taking the user side in Figure 1 as an example, the method includes the following steps:
[0098] Step 201, in response to receiving a user's virtual machine batch creation request, obtain a virtual machine creation template and provide it to the user.
[0099] Specifically, when the user needs to create a virtual machine, click the virtual machine creation button on the system interface. The user side receives the user's virtual machine batch creation request, retrieves the pre-stored virtual machine creation template in the system, and displays the template on the system interface for the user to fill in the specific creation request information.
[0100] Step 203, obtain multiple virtual machine creation request information filled in by the user based on the virtual machine creation template, where each virtual machine creation request information includes first requirement information.
[0101] As Figure 3 shown in the figure, each line in the virtual machine creation template represents a virtual machine creation request information, and a virtual machine creation template may include multiple virtual machine creation request information. Each virtual machine creation request information includes fields such as name, resource pool, image file, cpu architecture, memory, network card, disk, status, etc., where one or more fields are first requirement information.
[0102] To avoid system lag caused by overly large data during the virtual machine creation process, preferably, the number of virtual machines created at one time does not exceed 500.
[0103] Step 205: Send multiple virtual machine creation request messages to the server, so that the server can obtain the corresponding first target data identifier and second target data identifier according to each virtual machine creation request, and return the first target data identifier and the second target data identifier to the client. The first target data identifier corresponds to the first requirement information, and the second target data identifier corresponds to the first target data identifier.
[0104] Among them, the data identifier is used to point to the corresponding data, so as to obtain the data through the identifier.
[0105] Specifically, the client sends multiple virtual machine creation request messages filled in by the user to the server. The server sequentially reads the virtual machine creation request messages one by one, and reads all the requirement information in each virtual machine creation request message when reading each virtual machine creation request message.
[0106] When the server reads the requirement information, it obtains the corresponding first target data identifier of the first requirement information and the second target data identifier corresponding to the first target data identifier from the database, and returns the first target data identifier and the second target data identifier to the client.
[0107] Step 207: In response to receiving the first target data identifier and the second target data identifier, the client obtains the first target data and / or the second target data from the cache or the server according to the first target data identifier and / or the second target data identifier.
[0108] Specifically, when the client receives the first target data identifier and the second target data identifier corresponding to the first virtual machine creation request message returned by the server, it judges whether the target data pointed to by the target data identifier exists in the cache according to the first target data identifier and / or the second target data identifier. If not, it retrieves the target data from the server through the interface.
[0109] Step 209: Generate virtual machine creation data according to the first target data and the second target data.
[0110] Specifically, obtaining the target data through the data cache unit or the server means that the corresponding data has been obtained according to the multiple virtual machine creation request messages filled in by the user. The obtained corresponding data is the data required for creating a virtual machine.
[0111] Step 211: Create a virtual machine according to the virtual machine creation data.
[0112] In the above method for batch creation of virtual machines, through the optimization of the batch creation process of virtual machines, the efficiency and flexibility of resource allocation are significantly improved. In the traditional virtual machine creation process, users need to manually configure the parameters of each virtual machine one by one, which is time-consuming and prone to errors due to manual operations. However, this method standardizes the creation requests of virtual machines through template design, enabling users to only fill in the core configuration requirements, greatly reducing the configuration complexity and time cost. In addition, the collaborative work between the user side and the server side further improves the data processing efficiency. The server automatically parses and generates the first target data identifier and the second target data identifier according to the user request and returns them to the user side. The user side then quickly extracts the required data from the cache or the server according to the identifiers, avoiding the overhead of repeated data transmission, thereby optimizing the utilization rate of network resources and improving the convenience and efficiency of virtual machine creation.
[0113] In one embodiment, the user side includes a data cache unit. When the user side receives the first target data identifier and the second target data identifier, and obtains the first target data and / or the second target data from the cache and / or the server according to the first target data identifier and the second target data identifier, it includes:
[0114] Initializing the data cache unit,
[0115] According to the first target data identifier and / or the second target data identifier, determining whether there is corresponding first target data and / or second target data in the data cache unit,
[0116] If there is corresponding first target data and / or second target data in the data cache unit, obtaining the first target data and / or the second target data from the data cache unit,
[0117] If there is no corresponding first target data and / or second target data in the data cache unit, obtaining the first target data and / or the second target data from the server and storing the first target data and / or the second target data obtained from the server in the data cache unit.
[0118] Specifically, the data cache unit is initialized. The data cache unit is used to store target data that is the same as the requirements of the virtual machines already created by the user. For example Figure 4As shown, when the client reads the first virtual machine creation request, the resource pool identifier and the CPU architecture identifier are jointly used as the first target data identifier, and the operating system identifier mapped by the first target data identifier is used as the second target data identifier. It is determined whether there are corresponding resource pools, CPU architectures, and operating systems in the cache unit. At this time, since the first virtual machine creation request requirement information is read, the cache unit is empty. Therefore, the cache unit does not have the resource pool identifier and the CPU architecture identifier of the first virtual machine jointly used as the first target data identifier, and the operating system identifier mapped by the first target data identifier as the second target data identifier. Therefore, the server obtains the resource pool data, CPU architecture data, and operating system data of the first virtual machine from the server's database through the interface and stores them in the cache unit; when the client reads the second virtual machine creation request, after parsing, it is determined that the first target data identifier of the second virtual machine is the same as that of the first virtual machine, and the resource pool data, CPU architecture data, and operating system data that have been stored in the data cache unit are directly obtained from the data cache unit without obtaining the corresponding resources from the server through the interface.
[0119] Among them, the interface can be a RestAPI. The RestAPI is an application programming interface based on the REST (Representational State Transfer) architectural style. It is a design principle that defines how to transfer resources between the client and the server through the standard HTTP protocol.
[0120] In the above embodiment, when the client receives a new virtual machine creation request, it can determine whether the corresponding target data already exists in the cache unit according to the first target data identifier and / or the second target data identifier in the request. If the required data exists in the cache, it is directly read from the cache and returned without repeatedly accessing the server. If the required data does not exist in the cache, the target data is obtained from the server through the interface and stored in the cache for reuse by subsequent requests. This avoids the overhead of repeatedly obtaining the same data from the server, reduces network transmission latency and server database query load, thereby improving the overall response speed.
[0121] In one of the embodiments, the second target data identifier includes one or more options. One of the multiple options of the second target data identifier is determined through the third sub-target data identifier, and the data identifier is returned to the user interface. The user can modify the requirement information according to the needs. For example, if the second target data identifier is the operating system identifier, a set of operating systems can be mapped through the resource pool and the CPU architecture. The server first selects the operating system corresponding to the user's mirror requirement information through the corresponding relationship between the third sub-target data identifier, that is, the mirror identifier and the operating system, and displays it on the user interface, such as Figure 5As shown, secondly, the user can perform secondary editing according to actual needs to decide whether to modify the operating system options. If modified, a virtual machine is created based on the virtual machine creation data after modification.
[0122] In the above embodiment, the server automatically matches other requirement information according to the mapping relationship between requirements, reducing the cognitive burden of the user when filling in the virtual machine creation request, avoiding manual matching of various configurations, improving the configuration accuracy, and preventing incompatible operating systems from being selected. At the same time, although the system gives the best option according to the rules, the user can still modify the recommended operating system options according to actual needs, enhancing the user's decision-making freedom.
[0123] In one of the embodiments, the first requirement information includes first sub-requirement information and second sub-requirement information. Before sending multiple virtual machine creation request messages to the server, the method includes:
[0124] Obtain historical virtual machine creation request information;
[0125] Obtain the sub-requirement information included in the historical virtual machine creation request information;
[0126] According to the first sub-requirement information, the second sub-requirement information, and the sub-requirement information included in the historical virtual machine creation request information in the second requirement information, determine whether the sub-requirement information included in the historical virtual machine creation request information includes the first sub-requirement information and the second sub-requirement information.
[0127] If the sub-requirement information included in the historical virtual machine creation request information includes the first sub-requirement information and the second sub-requirement information, use this virtual machine creation request information as the target virtual machine creation request information.
[0128] Use the second target data identifier corresponding to the target virtual machine creation request information in the user-side data cache unit as the second target data identifier corresponding to the current virtual machine creation request information.
[0129] If the sub-requirement information included in the historical virtual machine creation request information does not include the first sub-requirement information and the second sub-requirement information, send the multiple virtual machine creation request messages to the server.
[0130] Exemplarily, the first sub - requirement information and the second sub - requirement information are respectively the resource pool information and the CPU architecture information. Both of these two sub - requirement information exist in any virtual machine requirement information. Before sending multiple virtual machine creation request messages to the server, the client obtains the sub - requirement information in the first virtual machine creation request message, including resource pool information A and CPU architecture information B, and determines whether the sub - requirement information in the current virtual machine creation request message includes the resource pool information A and the CPU architecture information B in the first virtual machine creation request message according to the sub - requirement information in the current virtual machine creation request message and the resource pool information A and the CPU architecture information B in the first virtual machine creation request message.
[0131] If the current virtual machine creation request message includes resource pool information A and CPU architecture information B, then use resource pool information A and CPU architecture information B as the current virtual machine creation request message, and use the operating system identifier C corresponding to resource pool information A and CPU architecture information B in the data cache unit as the operating system identifier in the current virtual machine creation request message. If the current virtual machine creation request message does not include resource pool information A and CPU architecture information B, then send the current virtual machine creation request message to the server to obtain an identifier.
[0132] In the above - mentioned embodiment, by determining whether the historical virtual machine request requirement information includes the sub - requirement information in the current virtual machine creation request message, it avoids repeated access to exactly the same requirements, eliminates the need to re - obtain the data identifier from the server every time, and directly obtains the required identifier quickly through the client, thus accelerating the virtual machine creation process.
[0133] In one of the embodiments, the server receives multiple virtual machine creation request messages, where the multiple virtual machine creation request messages are obtained after the client receives the user's virtual machine batch creation request, obtains the virtual machine creation template and provides it to the user, and then obtains the multiple virtual machine creation request messages filled in by the user based on the virtual machine creation template. Each virtual machine creation request message includes first requirement information.
[0134] Obtain the corresponding first target data identifier and second target data identifier according to each virtual machine creation request.
[0135] Return the first target data identifier and the second target data identifier to the client, so that the client can obtain the first target data and the second target data from the client cache and / or the server according to the first target data identifier and the second target data identifier, and generate virtual machine creation data to batch - create virtual machines according to the first target data and the second target data, where the first target data identifier corresponds to the first requirement information, and the second target data identifier corresponds to the first target data identifier.
[0136] In the above embodiments, the server automatically matches one or more demand information filled in by the user with other demand information, returns data identifiers, and supports batch processing, significantly improving the creation efficiency, ensuring data accuracy, and optimizing resource utilization, thereby providing users with a more efficient, reliable, and cost-effective virtual machine creation service.
[0137] In one embodiment, the server includes a data list. The first demand information includes first sub-demand information and second sub-demand information. The server obtains corresponding first target data identifiers and second target data identifiers according to each virtual machine creation request information, including:
[0138] Parse any virtual machine batch creation request information and obtain the first demand information;
[0139] Query the server according to the first demand information to check whether there is a first target data identifier corresponding to the first demand information;
[0140] If a first target data identifier corresponding to the first demand information is found, obtain the first target data identifier and the second target data identifier;
[0141] If a first target data identifier corresponding to the first demand information is not found, return a failure in validating the first demand information to the user terminal for the user terminal to mark the non-existence of data in the cell where the first demand information with validation failure is located;
[0142] Wherein obtaining the first target data identifier and the second target data identifier includes:
[0143] Obtain a first sub-target data identifier and a second sub-target data identifier according to the first sub-demand information and the second sub-demand information respectively, where the first sub-target data identifier corresponds to the first sub-demand information and the second sub-target data identifier corresponds to the second sub-demand information;
[0144] Determine the first target data identifier according to the first sub-target data identifier and the second sub-target data identifier;
[0145] Query the corresponding second target data identifier in the data list according to the first sub-target data identifier and the second sub-target data identifier, where the data list includes the first sub-target data identifier, the second sub-target data identifier, and the second target data identifier corresponding to the first sub-target data identifier and the second sub-target data identifier.
[0146] Specifically, there is a data list in the server, which is used to record the data mapping information that constitutes the mapping relationship. For example, a set of operating systems can be mapped through the resource pool and the CPU architecture. The server determines the first target data identifier by obtaining the first sub-target data identifier, i.e., the resource pool identifier, and the second sub-target data identifier, i.e., the CPU architecture identifier, and queries the second target data identifier, i.e., the operating system identifier, corresponding to the first target data identifier in the data list. If the first target data identifier is queried, the first target data identifier and the operating system identifier are obtained; if not, a resource pool and CPU architecture verification failure is returned to the client to mark the non-existence of data in the cells where the resource pool and CPU architecture information are located in the client.
[0147] In the above embodiment, when the server parses the first virtual machine creation request and finds that the resources corresponding to the requirement information exist, it can quickly generate the identifiers corresponding to the target data, and further obtain the other target data identifiers corresponding thereto based on these identifiers to complete resource matching and data preparation. If the corresponding resources do not exist, it is clearly marked in the user interface to identify the missing resources corresponding to the requirements filled in by the user, facilitating the user to adjust the requirement information in a timely manner according to the prompt.
[0148] In one of the embodiments, according to the first requirement information and the requirement information filling rule, it is judged whether the first requirement information conforms to the requirement information filling rule;
[0149] In response to the first requirement information conforming to the requirement information filling rule, a verification pass of the first requirement information is returned to the client for the client to mark the data verification pass in the row where the virtual machine creation request with verification passed is located;
[0150] In response to the first requirement information not conforming to the requirement information filling rule, a verification failure of the first requirement information is returned to the client for the client to mark the data verification failure in the row where the virtual machine creation request with verification failed is located.
[0151] Specifically, the filling rules for the user's creation template are preset in advance to verify whether the content filled in by the user conforms to the filling rules. For example, the number of CPU cores is input as a number between 1 and 128; the memory is input as a number between 1 and 4096; the disk is input as a number between 1 and 16, etc. If the requirement information input by the user does not conform to this rule, a data verification failure is prompted in the row where the requirement information of the virtual machine is located for the user to modify.
[0152] In the above embodiment, by presetting detailed requirement information filling rules, the system can quickly verify whether the content input by the user is compliant. It avoids the creation failure caused by the user's incorrect filling. By prompting the data verification failure, the user can correct it in time to ensure the data quality and improve the efficiency of virtual machine creation.
[0153] In one embodiment, the first requirement information further includes third sub-requirement information, and the first target data identifier further includes a third sub-target data identifier, where the third sub-target data identifier corresponds to the third sub-requirement information. Determining whether the first requirement information conforms to the requirement information filling rule includes:
[0154] Determining whether there is an association relationship between the first sub-target data identifier and the third sub-target data identifier;
[0155] If there is an association relationship between the first sub-target data and the third sub-target data, the first requirement information passes the verification.
[0156] If there is no association relationship between the first sub-target data and the third sub-target data, the first requirement information fails the verification.
[0157] Specifically, if the server has queried the corresponding resource pool identifier and image name identifier in the server database through the first sub-requirement information, i.e., the resource pool, and the third sub-requirement information, i.e., the image name, it is further determined whether there is an association relationship between the resource pool identifier and the image name identifier, that is, whether the image file is in the resource pool. If it exists, it is considered that there is an association relationship between the resource pool identifier and the image name identifier. If it does not exist, it is considered that there is no association relationship between the resource pool identifier and the image name identifier, and the above verification result is displayed on the line where the virtual machine creation request is located.
[0158] In the above embodiment, through the correlation verification between requirement information, conflicts in user-configured requirements are prevented, and the rigor and success rate of the virtual machine creation process are improved. Marking the data verification result enables the user to directly obtain the verification result or locate the specific error without having to troubleshoot it themselves.
[0159] It should be understood that although Figures 1-5 the steps in the flowchart of Figures 1-5 are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover,
[0160] In one embodiment, such as Figure 6As shown, a virtual machine batch creation device is provided, including: a request receiving module 21, an information obtaining module 22, an information sending module 23, a data obtaining module 24, a creation data generation module 25, and a virtual machine creation module 26, where:
[0161] The request receiving module 21 is configured to, in response to receiving a user's virtual machine batch creation request, obtain a virtual machine creation template and provide it to the user;
[0162] The information obtaining module 22 is configured to obtain multiple virtual machine creation request information filled in by the user based on the virtual machine creation template, where each virtual machine creation request information includes first requirement information;
[0163] The information sending module 23 is configured to send the multiple virtual machine creation request information to the server, so that the server obtains corresponding first target data identifiers and second target data identifiers according to each virtual machine creation request, and returns the first target data identifiers and the second target data identifiers to the user side, where the first target data identifier corresponds to the first requirement information, and the second target data identifier corresponds to the first target data identifier;
[0164] The data obtaining module 24 is configured to, in response to the user side receiving the first target data identifier and the second target data identifier, obtain the first target data and / or the second target data from the cache and / or the server according to the first target data identifier and / or the second target data identifier;
[0165] The creation data generation module 25 is configured to generate virtual machine creation data according to the first target data and the second target data;
[0166] The virtual machine creation module 26 is configured to create a virtual machine according to the virtual machine creation data.
[0167] In another embodiment, as Figure 7 shown, a virtual machine batch creation device is provided, including: an information receiving module 31, an identifier obtaining module 32, and an identifier returning module 33, where:
[0168] The information receiving module 31 is configured to receive multiple virtual machine creation request information, where the multiple virtual machine creation request information is obtained by the user side after receiving the user's virtual machine batch creation request, obtaining a virtual machine creation template and providing it to the user, and obtaining multiple virtual machine creation request information filled in by the user based on the virtual machine creation template, where each virtual machine creation request information includes first requirement information;
[0169] The identifier obtaining module 32 is configured to obtain corresponding first target data identifiers and second target data identifiers according to each virtual machine creation request;
[0170] An identification return module 33 is configured to return the first target data identifier and the second target data identifier to the client, so that the client can obtain the first target data and / or the second target data from the client cache and / or the server according to the first target data identifier and / or the second target data identifier, and generate virtual machine creation data based on the first target data and the second target data to create virtual machines in batches, where the first target data identifier corresponds to the first requirement information, and the second target data identifier corresponds to the first target data identifier.
[0171] For the specific limitations of the virtual machine batch creation device, reference can be made to the limitations of the virtual machine batch creation method in the foregoing text, which will not be elaborated here. Each module in the above virtual machine batch creation device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0172] For the specific limitations of the computer program product for virtual machine batch creation, reference can be made to the limitations of the virtual machine batch creation method in the foregoing text, which will not be elaborated here.
[0173] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as Figure 7 shown. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a virtual machine batch creation method. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device may be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0174] Those skilled in the art can understand that Figure 8 the structure shown in
[0175] For the specific limitations of the computer device and readable storage medium for batch creation of virtual machines, reference may be made to the limitations on the method for batch creation of virtual machines in the foregoing text, which will not be elaborated herein.
[0176] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0177] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0178] The above embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.
Claims
1. A method for creating virtual machines in batches, applied to a user end, characterized in that: include, In response to receiving a request from a user to create a batch of virtual machines, obtaining a virtual machine creation template and providing it to the user; Acquire multiple virtual machine creation request information filled in by the user based on the virtual machine creation template, wherein each virtual machine creation request information includes first requirement information; Sending the multiple virtual machine creation request information to the server, so that the server obtains the corresponding first target data identifier and second target data identifier according to each virtual machine creation request, and returns the first target data identifier and the second target data identifier to the user end, wherein the first target data identifier corresponds to the first requirement information, and the second target data identifier corresponds to the first target data identifier; In response to receiving the first target data identifier and the second target data identifier, the user end obtains the first target data and / or the second target data from the cache and / or the server end according to the first target data identifier and / or the second target data identifier; Generate virtual machine creation data according to the first target data and the second target data; A virtual machine is created according to the virtual machine creation data.
2. The method according to claim 1, characterized in that The user end includes a data cache unit, and in response to receiving the first target data identifier and the second target data identifier, the user end obtains the first target data and / or the second target data from the cache and / or the server according to the first target data identifier and / or the second target data identifier, including: Initialize the data cache unit, According to the first target data identifier and / or the second target data identifier, determining whether corresponding first target data and / or second target data exists in the data cache unit, If the corresponding first target data and / or second target data exists in the data cache unit, the first target data and / or the second target data are acquired from the data cache unit, If the corresponding first target data and / or second target data does not exist in the data cache unit, the first target data and / or second target data are obtained from the server, and the first target data and / or second target data obtained from the server are stored in the data cache unit.
3. The method according to claim 1, characterized in that The first requirement information includes first sub-requirement information and second sub-requirement information. Before sending the plurality of virtual machine creation request information to the server, the method includes: Get historical virtual machine creation request information; Obtain sub-requirement information included in historical virtual machine creation request information; According to the first sub-requirement information, the second sub-requirement information, and the sub-requirement information included in the historical virtual machine creation request information in the second requirement information, it is determined whether the sub-requirement information included in the historical virtual machine creation request information includes the first sub-requirement information and the second sub-requirement information, If the sub-requirement information included in the historical virtual machine creation request information includes the first sub-requirement information and the second sub-requirement information, then the virtual machine creation request information is used as the target virtual machine creation request information; Using the second target data identifier corresponding to the target virtual machine creation request information in the user-side data cache unit as the second target data identifier corresponding to the current virtual machine creation request information; If the sub-requirement information included in the historical virtual machine creation request information does not include the first sub-requirement information and the second sub-requirement information, the multiple virtual machine creation request information is sent to the server.
4. A method for creating virtual machines in batches, applied to a server, characterized in that: include, Receiving multiple virtual machine creation request information, wherein the multiple virtual machine creation request information is obtained by the user end after receiving the user's virtual machine batch creation request, obtaining a virtual machine creation template and providing it to the user, and obtaining multiple virtual machine creation request information filled in by the user based on the virtual machine creation template, wherein each virtual machine creation request information includes first requirement information; Acquire a corresponding first target data identifier and a second target data identifier according to each virtual machine creation request; The first target data identifier and the second target data identifier are returned to the user end, so that the user end can obtain the first target data and the second target data from the user end cache and / or the server end according to the first target data identifier and the second target data identifier, and generate virtual machine creation data according to the first target data and the second target data to batch create virtual machines, wherein the first target data identifier corresponds to the first demand information, and the second target data identifier corresponds to the first target data identifier.
5. The method according to claim 4, characterized in that The server includes a data list, the first requirement information includes first sub-requirement information and second sub-requirement information, and the server obtains the corresponding first target data identifier and second target data identifier according to each virtual machine creation request information, including: Parsing any of the virtual machine batch creation request information and obtaining first requirement information; querying the server, according to the first demand information, whether there is a first target data identifier corresponding to the first demand information; If the first target data identifier corresponding to the first demand information is found, the first target data identifier and the second target data identifier are obtained; If the first target data identifier corresponding to the first requirement information is not found, a message indicating that the verification of the first requirement information has failed is returned to the user terminal, so that the user terminal can mark the cell where the verification of the first requirement information has failed as non-existent data; The obtaining of the first target data identifier and the second target data identifier includes: Acquire a first sub-target data identifier and a second sub-target data identifier according to the first sub-requirement information and the second sub-requirement information, respectively, wherein the first sub-target data identifier corresponds to the first sub-requirement information, and the second sub-target data identifier corresponds to the second sub-requirement information; Determine a first target data identifier according to the first sub-target data identifier and the second sub-target data identifier; According to the first sub-target data identifier and the second sub-target data identifier, the corresponding second target data identifier is searched in the data list, wherein the data list includes the first sub-target data identifier, the second sub-target data identifier, and the second target data identifier corresponding to the first sub-target data identifier and the second sub-target data identifier.
6. The method according to claim 5, characterized in that The method further comprises: According to the first requirement information and the requirement information filling rule, determining whether the first requirement information complies with the requirement information filling rule; In response to the first requirement information meeting the requirement information filling rule, returning the first requirement information verification passed to the user end, so that the user end can mark the data verification passed in the row where the verified virtual machine creation request is located; In response to the first requirement information not meeting the requirement information filling rule, a check failure of the first requirement information is returned to the user end, so that the user end can mark the data check failure in the row where the virtual machine creation request where the check failed is located.
7. The method according to claim 6, characterized in that The first requirement information further includes third sub-requirement information, the first target data identifier further includes a third sub-target data identifier, wherein the third sub-target data identifier corresponds to the third sub-requirement information, and the determining whether the first requirement information complies with the requirement information filling rule includes: Determine whether there is an association relationship between the first sub-target data identifier and the third sub-target data identifier; If the first sub-target data and the third sub-target data are associated, the first requirement information verification passes. If there is no association between the first sub-target data and the third sub-target data, the first requirement information verification fails.
8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.