A method, apparatus, device, and readable storage medium for cluster setup

By using an automated cluster setup method, virtual machines are cloned and network configured in ESXi using virtual machine templates, and mon and OSD are created. This solves the problem of repetitive operations in virtual cluster deployment and improves the accuracy and efficiency of cluster setup.

CN115309509BActive Publication Date: 2026-01-30JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211027035.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-25
Publication Date
2026-01-30
Estimated Expiration
2042-08-25

AI Technical Summary

Technical Problem

Deploying a virtual cluster involves a large number of repetitive operations, which are time-consuming, tedious, and susceptible to human error, affecting the accuracy and efficiency of cluster setup.

Method used

By receiving and parsing the request to build the target cluster, connecting to the ESXi address, searching for virtual machine templates, cloning virtual machines in ESXi using the templates, configuring the network, creating a mon and initializing OSDs, the cluster is automatically built.

Benefits of technology

It enables automated cluster setup, reducing repetitive work for operators, avoiding human interference, and improving the accuracy and efficiency of cluster setup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115309509B_ABST
    Figure CN115309509B_ABST
Patent Text Reader

Abstract

This application discloses a cluster setup method, apparatus, device, and readable storage medium. The method includes: receiving and parsing a request to build a target cluster to obtain the ESXi address to be configured and managed; connecting to the ESXi address and searching for virtual machine templates within the ESXi; using the virtual machine templates, cloning several virtual machines required for building the target cluster within the ESXi; configuring the network for the several virtual machines; creating a corresponding number of MONs within the several virtual machines and initializing OSDs; creating a storage pool for the target cluster; and completing the setup of the target cluster within the ESXi. This application can automatically complete cluster setup, eliminating repetitive operations by operators and avoiding interference caused by human factors, thereby improving the accuracy and efficiency of cluster setup.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of storage, in particular to a cluster building method and device, equipment and readable storage medium. BACKGROUND

[0002] In the environment of massive data, distributed clusters are widely used in various industries. In order to meet the needs of business, more and more new features of the cluster are mined out, and the test personnel need to verify the newly developed functions.

[0003] In the laboratory environment, people often use esxi (a kind of server designed to run virtual machines, minimize configuration requirements and simplify deployment) to deploy a virtual cluster for testing. When deploying a virtual cluster, generally according to the scale of the cluster, the virtual machines corresponding to the number of nodes are filled in esxi, then according to the distributed cluster deployment manual, the network of each node is configured and the node name is modified, and finally the cluster is built through the management software. In this process, there are a lot of repeated operations, which is time-consuming and tedious, and the operator needs to have a certain understanding of each step, and human factors will cause great interference.

[0004] In summary, how to effectively solve the problems such as cluster building is a technical problem that the technical personnel in the field urgently need to solve at present. SUMMARY

[0005] The purpose of the present application is to provide a cluster building method, device, equipment and readable storage medium, so as to realize automatic completion of cluster building and improve the accuracy and efficiency of cluster building.

[0006] To solve the above technical problems, the present application provides the following technical solutions:

[0007] A cluster building method, comprising:

[0008] Receiving and analyzing the request of building the target cluster to obtain the esxi address to be configured and managed;

[0009] Connecting the esxi of the esxi address and searching the virtual machine template in the esxi;

[0010] Using the virtual machine template, cloning a plurality of virtual machines required by the target cluster in the esxi;

[0011] Configuring the network of the plurality of virtual machines;

[0012] Creating a corresponding number of mons in the plurality of virtual machines and initializing OSD;

[0013] After creating the storage pool of the target cluster, the target cluster is built in the esxi.

[0014] Preferably, the virtual machine templates are cloned to build the target cluster, including:

[0015] The names of the virtual machine templates are displayed on the visual interface, and the cloning instruction information is received.

[0016] The target virtual machine template is selected from the virtual machine templates according to the cloning instruction information, and the number of virtual machines required to build the target cluster is determined.

[0017] The target virtual machine template is cloned to build the target cluster in the esxi.

[0018] Preferably, the network of the virtual machines is configured, including:

[0019] The newly cloned virtual machines in the esxi are identified.

[0020] The user network, cluster network and management network required to build the target cluster are configured for each virtual machine.

[0021] Preferably, the mons corresponding to the number of virtual machines are created, including:

[0022] The cluster size of the target cluster is obtained.

[0023] The target number of mons in the target cluster is determined from the correspondence between the size and the mon.

[0024] The mons corresponding to the target number are created in the virtual machines.

[0025] Preferably, the esxi connected to the esxi address includes:

[0026] The esxi is connected by using the username and password provided by the client.

[0027] Preferably, it further includes:

[0028] The target cluster is tested.

[0029] Preferably, after the test is completed, it further includes:

[0030] The target virtual machine to be released is determined by receiving and analyzing the resource release request.

[0031] The target virtual machine is deleted or closed.

[0032] A cluster building device, comprising:

[0033] The virtual machine cloning module is used to receive and parse the request to build the target cluster, obtain the ESXi address to be configured and managed; connect to the ESXi address and search for the virtual machine template in the ESXi; and use the virtual machine template to clone several virtual machines required to build the target cluster in the ESXi.

[0034] The network configuration module is used to configure the network of the plurality of virtual machines;

[0035] An automatic cluster building module is used to create a corresponding number of mons in the several virtual machines and initialize OSDs; after creating the storage pool of the target cluster, the target cluster is built in the ESXi.

[0036] An electronic device, comprising:

[0037] Memory, used to store computer programs;

[0038] A processor is used to implement the steps of the above-described cluster setup method when executing the computer program.

[0039] A readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described cluster setup method.

[0040] Using the method provided in the embodiments of this application, a request to build a target cluster is received and parsed to obtain the ESXi address to be configured and managed; the ESXi address is connected to, and a virtual machine template is searched in the ESXi; using the virtual machine template, several virtual machines required to build the target cluster are cloned in the ESXi; the network of the several virtual machines is configured; in the several virtual machines, a corresponding number of mon are created, and OSDs are initialized; after creating the storage pool of the target cluster, the target cluster is built in the ESXi.

[0041] In this application, upon receiving a request to build a target cluster, the ESXi address to be configured and managed can be determined by parsing the request. Once the ESXi address is obtained, a connection to the ESXi can be established. Searching the ESXi reveals the virtual machine template within it. Then, using the virtual machine template, several virtual machines required for building the target cluster can be cloned from the ESXi. After cloning the virtual machines, network configuration can be performed. Then, the corresponding master mon, OSDs are initialized, and a storage pool is created, completing the setup of the target cluster within the ESXi. This application can automatically complete cluster setup, eliminating repetitive operations by operators and avoiding interference caused by human factors, thus improving the accuracy and efficiency of cluster setup.

[0042] Correspondingly, the embodiments of the present application also provide a cluster building device, equipment and a readable storage medium corresponding to the cluster building method, which have the above technical effects, and details are not repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the embodiments or the related art description will be briefly introduced. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of these drawings.

[0044] Figure 1 The flowchart of the cluster building method in the embodiments of the present application is shown in the figure.

[0045] Figure 2 The structure diagram of the cluster building device in the embodiments of the present application is shown in the figure.

[0046] Figure 3 The specific implementation diagram of the cluster building device in the embodiments of the present application is shown in the figure.

[0047] Figure 4 The structure diagram of the electronic device in the embodiments of the present application is shown in the figure.

[0048] Figure 5 The specific structure diagram of the electronic device in the embodiments of the present application is shown in the figure. DETAILED DESCRIPTION

[0049] In order to make the person skilled in the art better understand the present application, the present application will be further described in detail below in combination with the drawings and specific embodiments. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0050] Please refer to Figure 1 , Figure 1 The flowchart of the cluster building method in the embodiments of the present application is shown in the figure. The method can be applied to the management equipment of esxi, and the method comprises the following steps:

[0051] S101, receiving and analyzing the request of building target cluster, obtaining the esxi address to be configured and managed.

[0052] The user can issue the request of building target cluster through the operation of user interface. The target request can carry the esxi address to be configured and managed and the related information about the target cluster, such as the number of virtual machines.

[0053] After receiving the request of building the target cluster, the esxi address to be configured and managed can be determined by analyzing the request. The esxi address can be specifically an IP address of the connected esxi.

[0054] S102, connecting the esxi of the esxi address and searching the virtual machine template in the esxi.

[0055] Based on the esxi address, the esxi corresponding to the esxi address can be connected. Specifically, when connecting the esxi, the connection can be specifically based on the username and password input by the user. That is, connecting the esxi of the esxi address in step S102 includes connecting the esxi by using the username and password provided by the client.

[0056] After connecting the esxi, the esxi can be searched to find the virtual machine template in the esxi. In particular, when there are multiple virtual machine templates in the esxi, the found virtual machine template is also multiple. In this application, different virtual machine templates can be distinguished by virtual machine template names.

[0057] Among them, the virtual machine template is an exact copy of the virtual machine, and a large number of virtual machines identical to the original virtual machine can be quickly created through the template. The virtual machine template includes the image file of the operating system of the virtual machine and the hardware (also known as the configuration file) of the virtual machine. When making a template, the virtual machine is divided into cloning a template and converting a template. Cloning a template means that the original virtual machine still exists, only the hardware specifications and installed system image of this virtual machine are made into a template, so cloning a template can be made in the state of starting and shutting down the virtual machine; but if the selection is converting a template, the virtual machine that makes a template becomes a template, that is, this virtual machine no longer exists, so converting a template can only be made when the virtual machine is off. In this embodiment, cloning a template and converting a template are not limited for the virtual machine template.

[0058] For ease of selection, in this embodiment, the virtual machine template name can include the image information when the virtual machine is filled, such as the name of the system version.

[0059] Searching for a virtual machine template in the esxi can find various virtual machine templates in the esxi, and in actual application, a specific virtual machine template can be selected or found according to the demand. Specifically, a specific virtual machine template can be selected or found based on the virtual machine template name.

[0060] S103, cloning a number of virtual machines required for building the target cluster in the esxi by using the virtual machine template.

[0061] After the virtual machine template is found, a number of virtual machines required for building the target cluster can be cloned directly in the esxi. Specifically, if N virtual machines are required for building the target cluster, N virtual machines are cloned based on the virtual machine template. The value N can be set by the user or selected according to the size of the target cluster.

[0062] For how to clone the virtual machine in the esxi based on the virtual machine template, the application and implementation of the virtual machine template can be referred to, which will not be described here.

[0063] In a specific embodiment of the present application, step S103 clones a number of virtual machines required for building the target cluster using the virtual machine template, including:

[0064] Step one, display the names of each virtual machine template in the visual interface, and receive the cloning instruction information;

[0065] Step two, use the cloning instruction information to select the target virtual machine template from the virtual machine target, and determine the number of virtual machines required for building the target cluster;

[0066] Step three, use the target virtual machine template to clone the virtual machines in the esxi.

[0067] For ease of description, the above three steps will be described together.

[0068] After searching for each virtual machine target in the esxi, the names of each virtual machine target can be displayed in the visual interface, which can include the image information when the virtual machine is filled, such as the name of the system version, for the user to select. After the user selects a virtual machine template, the cloning instruction information can be inputted / issued.

[0069] The cloning instruction information can specifically specify the target virtual machine template and the number of virtual machines. Thus, the virtual machine template to be used can be selected from the virtual machine target directly using the cloning instruction information, and the number of virtual machines required for building the target cluster is clear.

[0070] After the virtual machine template to be used and the number of virtual machines are clear, the target virtual machine template can be used to clone the corresponding number of virtual machines in the esxi. When cloning the virtual machines, a parallel execution mode can be used for cloning, that is, a plurality of virtual machines can be cloned at the same time.

[0071] After the virtual machines are cloned, the virtual machines are started, and the operation of step S104 can be performed.

[0072] S104, configure the network of a number of virtual machines.

[0073] After cloning the several virtual machines, the several virtual machines can be configured with corresponding networks, such as a user network, a cluster network, and a management network. The specific network configuration manner can refer to the network configuration specific implementation, and will not be described here one by one.

[0074] In an embodiment of the present application, the step S104 of configuring the network of the several virtual machines comprises:

[0075] Step one, identify the several virtual machines newly cloned in the esxi;

[0076] Step two, configure the user network, the cluster network, and the management network required for building the target cluster for each virtual machine.

[0077] For ease of description, the above two steps will be described in combination.

[0078] Specifically, all the virtual machines newly cloned in the esxi can be automatically identified according to the virtual machine template name selected by the user and the number of cluster nodes (i.e. the number of virtual machines). These newly cloned virtual machines are the virtual machines required for building the target cluster. Then, the user network, the cluster network, and the management network required for building the cluster are automatically configured for each virtual machine, and the name of each virtual machine is configured, to prepare for automatically building the cluster. Among them, configuring the user network, the cluster network, and the management network, that is, modifying the network port configuration file, modifying the virtual machine name of each port in the network device, and the like.

[0079] S105, create corresponding number of mons in the several virtual machines, and initialize OSD.

[0080] The cluster needs to be created, and the mon needs to be created and the OSD needs to be initialized.

[0081] Therefore, the corresponding number of mons need to be created in the several virtual machines, and the OSD needs to be initialized. The mon is a node for monitoring the target cluster.

[0082] The OSD (Object Storage Device, providing storage resources) is activated, that is, the virtual machine in the target cluster can use the storage device. For specific how to initialize and activate the OSD, it can be specifically referred to the related implementation, and will not be described here one by one.

[0083] In an embodiment of the present application, the step S105 of creating corresponding number of mons in the several virtual machines comprises:

[0084] Step one, obtain the cluster size of the target cluster;

[0085] Step two, determine the target number of mons in the target cluster from the correspondence between the scale and mons;

[0086] Step three, create mons corresponding to the target number in the several virtual machines.

[0087] For the convenience of description, the above three steps will be described together.

[0088] The cluster scale, that is, the number of nodes in the cluster, is also the number of virtual machines. That is, the cluster scale can be determined by counting the number of cloned virtual machines.

[0089] The correspondence between the scale and mons can be set in advance, for example, the correspondence can be specifically 3 mons for 5 nodes or less, 5 mons for 5-20 nodes, and 7 mons for 20 or more nodes. Of course, the values here can be set and adjusted according to actual needs.

[0090] After the cluster scale is determined, the target number of mons of the target cluster can be quickly determined based on the correspondence. Then, the target number of virtual machines is selected from the several virtual machines, thereby creating mons.

[0091] In actual application, the node information, user network, cluster network and other information of each virtual machine can be automatically integrated according to the cloned virtual machine information, and then the number of mons (monitor) and the virtual disk of the extended virtual machine are automatically planned according to the scale of the cluster, and ODS is initialized.

[0092] Among them, the creation of mons and the initialization of OSD can be created in parallel, thereby speeding up the creation.

[0093] S106, after creating the storage pool of the target cluster, the target cluster is built in esxi.

[0094] Creating a storage pool enables the target cluster to effectively use storage resources. How to create a storage pool can refer to the definition of a storage pool and related implementation schemes, which will not be described here.

[0095] After the target cluster is created, the target cluster can be tested. How to test the target cluster can refer to the related test scheme, which will not be described here.

[0096] In one specific embodiment of the present application, after the test is completed, the following steps can also be performed:

[0097] Step one, receiving and analyzing the resource release request to determine the target virtual machine to be released;

[0098] Step two, deleting or shutting down the target virtual machine.

[0099] The resource release request can be generated according to the selection of the user. That is, the user can select the target virtual machine to release. Specifically, after the virtual machine cluster environment test is completed, the virtual machines cloned according to the virtual machine template set by the user can be shut down or deleted according to the virtual machine template name set by the user, so as to release the resources on the esxi and realize the maximum utilization of the esxi resources.

[0100] By applying the method provided in the embodiment of the application, a request for building a target cluster is received and parsed to obtain an esxi address to be configured and managed; an esxi connected with the esxi address is searched for a virtual machine template in the esxi; the virtual machine template is used to clone a plurality of virtual machines required for building the target cluster in the esxi; the network of the plurality of virtual machines is configured; a corresponding number of mons are created in the plurality of virtual machines, and the OSD is initialized; after a storage pool of the target cluster is created, the building of the target cluster in the esxi is completed.

[0101] In the application, when the request for building the target cluster is received, the esxi address to be configured and managed can be determined by parsing the request. After the esxi address is obtained, the esxi can be connected through the esxi address. The virtual machine template in the esxi can be searched. Then, the virtual machine template can be used to clone a plurality of virtual machines required for building the target cluster in the esxi. After the virtual machines are cloned, the network of the virtual machines can be configured. Then, the main mon is created, the OSD is initialized, and after the storage pool is created, the building of the target cluster in the esxi is completed. The application can automatically complete the cluster building, can save the repeated operation of the operator, can avoid the interference caused by human factors, and can improve the accuracy and efficiency of the cluster building.

[0102] Corresponding to the above method embodiment, the embodiment of the application also provides a cluster building device. The cluster building device described below can be referred to each other corresponding to the cluster building method described above.

[0103] Referring to Figure 2 As shown in the figure, the device comprises the following modules:

[0104] The virtual machine cloning module 101 is configured to receive and parse a request for building a target cluster to obtain an esxi address to be configured and managed; connect an esxi connected with the esxi address, and search for a virtual machine template in the esxi; use the virtual machine template to clone a plurality of virtual machines required for building the target cluster in the esxi;

[0105] The network configuration module 102 is configured to configure the network of the plurality of virtual machines.

[0106] The automatic cluster building module 103 is configured to create a corresponding number of mons in a plurality of virtual machines and initialize OSDs; and complete building of the target cluster in the esxi after creating a storage pool of the target cluster.

[0107] The device provided in the embodiment of the application receives and parses a request for building a target cluster to obtain an esxi address to be configured and managed; connects an esxi at the esxi address and searches a virtual machine template in the esxi; clones a plurality of virtual machines required for building the target cluster in the esxi by using the virtual machine template; configures a network of the plurality of virtual machines; creates a corresponding number of mons in the plurality of virtual machines and initializes OSDs; and completes building of the target cluster in the esxi after creating a storage pool of the target cluster.

[0108] In the application, when receiving a request for building a target cluster, the request can be parsed to determine an esxi address to be configured and managed. After obtaining the esxi address, the esxi can be connected through the esxi address. The virtual machine template in the esxi can be searched. Then, the plurality of virtual machines required for building the target cluster can be cloned in the esxi by using the virtual machine template. After cloning the virtual machines, the virtual machines can be configured in a network. Then, the main mon is created, the OSD is initialized, and the target cluster can be built in the esxi after the storage pool is created. The application can automatically complete cluster building, can save repeated operations of an operator, can avoid interference caused by human factors, and can improve the accuracy and efficiency of cluster building.

[0109] In one specific embodiment of the application, the virtual machine cloning module 101 is specifically configured to display names of each virtual machine template in a visual interface and receive cloning instruction information.

[0110] The cloning instruction information is used to select a target virtual machine template from the virtual machine target and determine a number of virtual machines required for building the target cluster.

[0111] The target virtual machine template is used to clone the number of virtual machines in the esxi.

[0112] In one specific embodiment of the application, the network configuration module 102 is specifically configured to identify a plurality of virtual machines newly cloned in the esxi.

[0113] The user network, the cluster network and the management network required for building the target cluster are configured for each virtual machine.

[0114] In one specific embodiment of the application, the automatic cluster building module 103 is specifically configured to obtain a cluster size of the target cluster.

[0115] From the correspondence between the scale and the mon, the target number of mons in the target cluster is determined;

[0116] Among the several virtual machines, the mons corresponding to the target number are created.

[0117] In an embodiment of the present application, the virtual machine cloning module 101 is specifically configured to connect the esxi by using the username and password provided by the client.

[0118] In an embodiment of the present application, it further comprises a test module configured to test the target cluster.

[0119] In an embodiment of the present application, it further comprises a virtual machine management module configured to receive and parse a resource release request after the test is completed, and determine the target virtual machine to be released.

[0120] The target virtual machine is deleted or closed.

[0121] In order to better understand and implement the cluster building device provided by the present application by those skilled in the art, the modules in the cluster building device will be described in detail below with specific application scenarios as examples.

[0122] Please refer to Figure 3 The device mainly comprises the following four modules in dependence on the upper layer management software.

[0123] The virtual machine cloning module can configure the address of the esxi to be managed according to actual needs, and automatically connect the esxi by using the username and password provided by the user. Meanwhile, the module supports collecting the existing virtual machine templates in the esxi and displaying them to the user. The virtual machine template name generally contains the image information when the virtual machine is filled, such as the name of the system version. The user can independently select which virtual machine to build a cluster as a template according to the virtual machine template name. Finally, according to the number of nodes of the cluster to be built and the selected virtual machine template set by the user, the corresponding number of virtual machines are automatically cloned in the esxi and started.

[0124] The network configuration module automatically identifies all the virtual machines newly cloned in the virtual machine cloning module according to the virtual machine template name and the number of cluster nodes selected by the user, and then automatically configures the user network, cluster network and management network required for building the cluster for each virtual machine, and configures the name of each virtual machine, to prepare for automatically building the cluster. Modify the network port configuration file, modify the virtual machine name

[0125] The automatic cluster building module first integrates node information, user network and cluster network information of each virtual machine according to the cloned virtual machine information, then automatically plans the number of mon monitoring service nodes (3 mons for 5 nodes or less, 5-20, 5, 20 or more 7, experience value) and extends the virtual disk of the virtual machine and initializes the osd, and finally completes the deployment of the cluster (creating MON, activating OSD) and the creation of the storage pool (concurrent creation is possible), so that a virtual machine cluster test environment is built.

[0126] The virtual machine management module (resource recycling) can shut down or delete all virtual machines cloned according to the virtual machine template name set by the user, thereby releasing the resources on the esxi and maximizing the use of esxi resources.

[0127] Through the above four modules, the user only needs to select the virtual machine template name and the number of cluster nodes to automatically build a virtual machine distributed cluster test environment of the corresponding size, which not only improves the efficiency of building a test environment and greatly saves the labor cost, but also supports the destruction of the cluster test environment, thereby maximizing the use of esxi resources.

[0128] Corresponding to the above method embodiment, the embodiment of the present application also provides an electronic device, and the electronic device described below can be mutually corresponding to the cluster building method described above.

[0129] Referring to Figure 4 The electronic device includes:

[0130] The memory 332 is configured to store a computer program.

[0131] The processor 322 is configured to execute the computer program to implement the steps of the cluster building method of the method embodiment.

[0132] Specifically, please refer to Figure 5 , Figure 5A specific structure schematic diagram of an electronic device is provided for the embodiment. The electronic device can have great differences due to different configurations or performances, and can include one or more than one central processing unit (CPU) 322 (for example, one or more than one processor) and a memory 332 storing one or more than one computer application program 342 or data 344. The memory 332 can be temporary storage or persistent storage. The program stored in the memory 332 can include one or more than one module (not shown in the figure), and each module can include a series of instruction operations in the data processing device. Further, the central processing unit 322 can be configured to communicate with the memory 332 and execute the series of instruction operations in the memory 332 on the electronic device 301.

[0133] The electronic device 301 can further include one or more than one power supply 326, one or more than one wired or wireless network interface 350, one or more than one input and output interface 358, and / or one or more than one operating system 341.

[0134] The steps in the cluster building method described above can be implemented by the structure of the electronic device.

[0135] Corresponding to the method embodiments above, the embodiment of the present application further provides a readable storage medium. The readable storage medium described below can be correspondingly referred to the cluster building method described above.

[0136] A readable storage medium, the readable storage medium storing a computer program, the computer program being executed by a processor to implement the steps of the cluster building method of the method embodiments.

[0137] The readable storage medium can be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various readable storage media that can store program codes.

[0138] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the device disclosed in the embodiments, the description is relatively simple because it corresponds to the method disclosed in the embodiments. The relevant parts can be referred to the description of the method.

[0139] Those skilled in the art can further understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been described in the above description in a general manner. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0140] The steps of the method or algorithm described in combination with the embodiments disclosed herein can be directly implemented by hardware, a software module executed by a processor, or a combination of both. The software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0141] Finally, it should be noted that, in this document, the terms including, including, or any other variant are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or inherent to such a process, method, article or device.

[0142] The principles and implementation modes of the present application are described in this document by applying specific examples. The above description of the examples is only to help understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in specific implementation modes and application scope. In view of the above, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A cluster building method, characterized by, The application relates to a management device applied to an esxi, which comprises the following steps: Receiving and analyzing a request for building a target cluster to obtain an esxi address to be configured and managed; Connecting an esxi at the esxi address and searching a virtual machine template in the esxi; Cloning a plurality of virtual machines required for building the target cluster in the esxi by using the virtual machine template; Configuring a network of the plurality of virtual machines; Creating a corresponding number of mons in the plurality of virtual machines and initializing OSD; Completing building the target cluster in the esxi after creating a storage pool of the target cluster; Wherein, the creating of the corresponding number of mons in the plurality of virtual machines comprises the following steps: Obtaining a cluster size of the target cluster; the cluster size corresponds to a virtual machine number; Determining a target number of mons in the target cluster from a corresponding relationship between the size and the mons; Creating mons corresponding to the target number in the plurality of virtual machines; Wherein, the cloning of the plurality of virtual machines required for building the target cluster by using the virtual machine template comprises the following steps: Displaying names of all the virtual machine templates on a visual interface and receiving cloning instruction information; Selecting a target virtual machine template from the virtual machine templates by using the cloning instruction information and determining a virtual machine number required for building the target cluster; Cloning the virtual machine number of virtual machines in the esxi by using the target virtual machine template.

2. The cluster building method of claim 1, wherein, The network configuration of the plurality of virtual machines comprises the following steps: Identifying the plurality of virtual machines newly cloned in the esxi; Configuring a user network, a cluster network and a management network required for building the target cluster for each virtual machine.

3. The cluster building method of claim 1, wherein, The connection of the esxi at the esxi address comprises the following steps: Connecting the esxi by using a username and a password provided by a client.

4. The cluster building method according to any one of claims 1 to 3, characterized in that, Further comprising: Testing the target cluster.

5. The cluster building method of claim 4, wherein, After the testing is completed, further comprising: Receiving and analyzing a resource release request to determine a target virtual machine to be released; Deleting or closing the target virtual machine.

6. A cluster building apparatus, characterized by comprising: The application relates to a management device applied to an esxi, which comprises the following steps: A virtual machine cloning module is used for receiving and analyzing a request for building a target cluster to obtain an esxi address to be configured and managed; connecting an esxi at the esxi address and searching a virtual machine template in the esxi; and cloning a plurality of virtual machines required for building the target cluster in the esxi by using the virtual machine template; A network configuration module is used for configuring a network of the plurality of virtual machines; An automatic cluster building module is used for creating a corresponding number of mons in the plurality of virtual machines and initializing OSD; and completing building the target cluster in the esxi after creating a storage pool of the target cluster. The virtual machine cloning module is specifically configured to display names of each virtual machine template on a visual interface, and receive cloning instruction information; select a target virtual machine template from the virtual machine targets by using the cloning instruction information, and determine a number of virtual machines required for building the target cluster; and clone the number of virtual machines from the virtual machine template in the esxi. The automatic cluster building module is specifically configured to obtain a cluster size of the target cluster; the cluster size corresponds to the number of virtual machines; determine a target number of mons in the target cluster from a correspondence between sizes and mons; and create mons corresponding to the target number in the number of virtual machines.

7. An electronic device, comprising: The computer program comprises: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the cluster building method according to any one of claims 1 to 5.

8. A readable storage medium, characterized by, The computer program is stored on the readable storage medium and is executed by the processor to implement the steps of the cluster building method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Virtual-machine management system and method

    CN103905232A

  • Test platform establishment method based on virtualization technology

    CN107995064A