Cloud service resource expansion method, device, electronic device and storage medium
By automatically obtaining the expansion requirements, determining the target host and generating a resource deployment package, the problem of complexity and inefficiency of host expansion in cloud services is solved, and efficient and safe resource expansion is achieved.
Patent Information
- Application Number
- CN202210282198.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-03-21
AI Technical Summary
In cloud services, the host expansion process is complex and prone to omissions and errors, resulting in low efficiency. Existing technology relies on manual operations, making it difficult to ensure data security and efficiency.
By obtaining the expansion requirements, the target host is determined, a resource deployment package is generated based on its basic information, and the package is executed on the target host to automatically expand the host, avoid manual intervention, and improve expansion efficiency and data security.
It realizes automated cloud service resource expansion, reduces manual errors, improves expansion efficiency and data security, and ensures the accuracy and consistency of resource deployment.
Smart Images

Figure CN114726734B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of cloud service technology, and in particular to a cloud service resource expansion method, device, electronic device and storage medium. Background Art
[0002] With the continuous development of cloud services, users' demand for cloud services is increasing, the amount of data of a single user is also increasing, and the number of users is also increasing. This leads to the need for a corresponding increase in the computing resources required for cloud services. The way to increase the computing resources of cloud services is to expand the computing resources of the host machine.
[0003] When expanding the capacity of a host machine, it is usually done manually by operation and maintenance personnel. However, the cloud host environment is complex (system versions / networks / software versions are different) and has many components. When expanding resources, it is often necessary to manually change the environment and components, which is prone to omissions and errors and is inefficient. Summary of the invention
[0004] The embodiments of the present application provide a cloud service resource expansion method, device, electronic device and storage medium to improve the data security of cloud service resource expansion.
[0005] In a first aspect, an embodiment of the present application provides a cloud service resource expansion method, which is applied to a server, and the method includes:
[0006] Obtaining a capacity expansion requirement for a host machine to be expanded, and determining a target host machine according to the capacity expansion requirement;
[0007] Based on the basic information of the target host, rendering is performed according to a preset script template to generate a resource deployment package;
[0008] The resource deployment package is executed in the target host machine to expand the target host machine into the resource pool of the host machine to be expanded.
[0009] In a second aspect, an embodiment of the present application further provides a cloud service resource expansion device, the cloud service resource expansion device comprising:
[0010] The expansion demand acquisition module is used to obtain the expansion demand of the host to be expanded;
[0011] A target host determination module, used to determine the target host according to the expansion requirement;
[0012] A resource deployment package generation module, used to generate a resource deployment package by rendering according to a preset script template based on the basic information of the target host;
[0013] The expansion module is used to execute the resource deployment package in the target host machine to expand the target host machine into the resource pool of the host machine to be expanded.
[0014] In a third aspect, an embodiment of the present application further provides an electronic device, the electronic device comprising:
[0015] one or more processors;
[0016] a storage device for storing one or more programs,
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the cloud service resource expansion method provided in any embodiment of the present application.
[0018] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, a cloud service resource expansion method as provided in any embodiment of the present application is implemented.
[0019] The technical solution of the embodiment of the present application determines the target host machine according to the expansion demand of the host machine to be expanded, and then renders it according to the preset script template based on the basic information of the target host machine to generate a resource deployment package. After executing the resource deployment package in the target host machine, the target host machine can be expanded to the resource pool of the host machine to be expanded. Based on this, the solution of the present application can automatically generate a resource deployment package that can expand the target host machine to the resource pool of the host machine to be expanded, thereby realizing automatic expansion of the host machine to be expanded based on the expansion demand, avoiding manual expansion, reducing the errors that may occur during expansion, and improving the expansion efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of a cloud service resource expansion method provided in Example 1 of the present application;
[0021] Figure 2 A schematic diagram of a process for obtaining a capacity expansion requirement provided in Example 1 of the present application;
[0022] Figure 3 A schematic diagram of a process for determining a target host machine provided in Embodiment 1 of the present application;
[0023] Figure 4 A schematic diagram of the structure of a cloud service resource expansion device provided in Example 2 of the present application;
[0024] Figure 5 A schematic diagram of the structure of an electronic device provided in Example 3 of the present application. DETAILED DESCRIPTION
[0025] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.
[0026] Embodiment 1
[0027] Figure 1 This is a flow chart of a cloud service resource expansion method provided in Example 1 of the present application. This embodiment is applicable to scenarios of cloud service resource expansion. The method can be executed by a cloud service resource expansion device, which can be implemented in hardware and / or software and can generally be integrated in electronic devices such as computers with data computing capabilities, and specifically includes the following steps:
[0028] Step 101: Obtain the capacity expansion requirement of the host machine to be expanded, and determine the target host machine according to the capacity expansion requirement.
[0029] The host machine refers to a host computer on which a resource management system operable by a user is deployed. The host machine is deployed in the cloud, and the user accesses the resource management system in the host machine through the network. It should be noted that the resource management system can provide functions such as data storage, query, and modification.
[0030] At present, the expansion process generally includes building a new zone, initializing the target host, and joining the target host to the resource pool of the host to be expanded. Among them, the process of joining the target host to the resource pool of the host to be expanded is relatively complicated, mainly including cluster creation, adding the target host, creating a test cloud host, testing, deleting the test cloud host, and cloud host registration monitoring.
[0031] That is to say, if you want to expand the capacity, you must first determine the target host that can be expanded to the resource pool of the host to be expanded. When determining the target host, you need to base it on the expansion requirements of the host to be expanded.
[0032] The process of obtaining expansion requirements can be found in Figure 2 , Figure 2 A schematic diagram of a process for obtaining expansion requirements provided in Example 1 of the present application.
[0033] like Figure 2 As shown in the figure, the process of obtaining expansion requirements may include:
[0034] Step 201: Obtain a capacity expansion request sent by an operation and maintenance party.
[0035] In this step, the operation and maintenance party refers to the party that operates and maintains the cloud service system. In this application, the expansion request is usually sent by the operation and maintenance party, and the expansion request mainly includes the required resource size, such as the size required for running memory and / or storage memory.
[0036] In a specific example, the capacity expansion request may be to expand the running memory by 2 GB and the storage memory by 200 TB.
[0037] Since the host machine to be expanded may have surplus resources, step 202 may be performed to avoid wasting the surplus resources in the host machine to be expanded.
[0038] Step 202: Determine whether the remaining resources of the host machine to be expanded meet the expansion request.
[0039] In this step, the size of the remaining resources of the host machine to be expanded can be obtained first, and then the size of the remaining resources can be compared to see whether it is greater than or equal to the size of the resources required to be expanded in the aforementioned expansion request. If it is greater than or equal to, it means that the remaining resources meet the expansion requirements, otherwise it does not meet the requirements.
[0040] In a specific example, the remaining resources of the host machine to be expanded include 8GB of running memory and 300TB of storage memory. If the expansion request is to expand the running memory by 2GB and the storage memory by 200TB as in the above example, 8GB is greater than 2GB, and 300TB is greater than 200TB. The remaining resources can fully meet the expansion request.
[0041] If the expansion request is to expand the running memory by 10GB and the storage memory by 500TB, since 8GB is less than 10GB and 300TB is less than 500TB, this means that the resources cannot meet the expansion request. It is necessary to determine the target host machine to be expanded to the resource pool of the host machine to be expanded.
[0042] It should be noted that, in this embodiment, only the resources of running memory and storage memory are taken as an example. Only when both resources satisfy the capacity expansion request, will it be determined that the remaining resources satisfy the capacity expansion request, otherwise they are not satisfied.
[0043] If satisfied, the expansion requirement for the host machine to be expanded can be determined based on the expansion request and the remaining resources. The target host machine pointed to in the expansion requirement is the host machine to be expanded itself. Then, when the target host machine is determined based on the expansion requirement, the determined target host machine is the host machine to be expanded itself.
[0044] Step 203: If not satisfied, determine the capacity expansion requirement of the host machine to be expanded according to the capacity expansion request and the remaining resources.
[0045] In this step, an action can be performed when the remaining resources are not satisfied. The expansion requirement refers to the amount of resources required after removing the remaining resources from the expansion request. Specifically, the amount of resources required for various resources needs to be calculated.
[0046] For example, if there are resource a and resource b, then for resource a, you need to calculate the amount of resource a in the expansion request minus the amount of resource a in the remaining resources to get the required amount of resource a; for resource b, you need to calculate the amount of resource b in the expansion request minus the amount of resource b in the remaining resources to get the required amount of resource b.
[0047] Then the required amount of resource a and the required amount of resource b are determined as the expansion demand. It should be noted that the expansion demand here is different from the expansion demand obtained when the aforementioned conditions are met. The expansion demand obtained when the aforementioned conditions are met has host machine orientation, and the host machine orientation points to the host machine to be expanded. When the target host machine is determined later, the host machine to be expanded can be directly determined as the target host machine.
[0048] The expansion requirements obtained in this step are the basis for determining the target host from the host machines other than the host machine to be expanded. The expansion requirements are not host-specific. For details on how to determine the target host machine based on the expansion requirements, please refer to Figure 3 , Figure 3 A schematic diagram of a process for determining a target host machine provided in Example 1 of the present application.
[0049] like Figure 3 As shown, the process of determining the target host provided by this embodiment may include:
[0050] Step 301: Obtain the remaining resources of all host machines in the cloud platform, and select the preliminarily screened host machines whose remaining resources can meet the capacity expansion requirements.
[0051] In this step, the cloud platform refers to a platform equipped with cloud services, which includes a helm host for providing cloud services. In this step, the remaining resources of all hosts in the cloud platform except the host to be expanded can be obtained, and the types of the remaining resources are the same as those of the remaining resources of the host to be expanded.
[0052] Specifically, a request for determining remaining resources can be sent to each host, and then the remaining resource related information fed back by each host can be received to obtain the remaining resources of all hosts in the cloud platform. Then, based on the remaining resources of each host, the initial screening host whose remaining resources can meet the expansion requirements is screened out.
[0053] In a specific example, the host machines in the cloud platform include host machine a, host machine b, host machine c, host machine d, and host machine e. The remaining resources of each host machine are shown in Table 1 below.
[0054] Table 1
[0055] Host Remaining Resources Host machine a 2GB RAM, 20TB storage memory Host b 5GB RAM, 200TB storage memory Host c 10GB RAM, 50TB storage memory Host 10GB RAM, 500TB storage memory Host 5GB RAM, 20TB storage memory
[0056] Among them, if the expansion requirement is 4GB of running memory and 150TB of storage memory, it can be known from the remaining resources in Table 1 that the host b and host d meet the expansion requirement. It should be noted that the screening is the same as the method of judging whether it is satisfied or not followed in the aforementioned step 202, which can be used for reference and will not be repeated here.
[0057] Step 302: compare the basic information of each of the pre-screened host machines with the basic information of the host machines to be expanded, and determine the pre-screened host machine corresponding to the comparison result that meets the preset conditions as the target host machine.
[0058] In this step, the basic information may include environment information and software information. The environment information may include region, cloud type, DNS address, NTP address, yum source address, and VPC version. The software information may include Ceph, libvirt, QEMU, Neutron, and kernel version.
[0059] The preset condition may refer to information that must be consistent between the target host and the host to be expanded during expansion, such as the kernel version and cloud type.
[0060] Still taking the above example as an example, it can be determined whether the kernel version and cloud type of the host b and host d obtained above are consistent with those of the host to be expanded, and the consistent host is determined as the final target host. It should be noted that the number of pre-screened hosts corresponding to the comparison results that meet the preset conditions may not be unique. Therefore, if there are multiple pre-screened hosts that meet the preset conditions, that is, the number of pre-screened hosts corresponding to the comparison results that meet the preset conditions is greater than 1, then the host with the least remaining resources can be determined as the target host to make more effective use of the remaining resources. If the number of pre-screened hosts corresponding to the comparison results that meet the preset conditions is 1, the pre-screened host corresponding to the comparison results that meet the preset conditions is determined as the target host.
[0061] Step 102: Based on the basic information of the target host machine, rendering is performed according to a preset script template to generate a resource deployment package.
[0062] In this step, the basic information of the target host machine and the host machine to be expanded may be rendered according to a preset script template to generate a resource deployment script; and a resource deployment package may be generated based on the resource deployment script.
[0063] It should be noted that a preset script template can have three sub-templates, such as the templates corresponding to the following three sub-scripts:
[0064] 01-before-init-check.sh;
[0065] 02-init-kvm.sh;
[0066] 03-after-init-check.sh.
[0067] Among them, 01-before-init-check.sh is used for environment check before capacity expansion, 02-init-kvm.sh is used for capacity expansion, and 03-after-init-check.sh is used for environment check after capacity expansion.
[0068] Specifically, the basic information of the target host machine and the basic information of the host machine to be expanded can be first obtained from the database; then the basic information of the target host machine and the basic information of the host machine to be expanded are compared to obtain differentiated data; finally, the differentiated data is filled into the preset script template to obtain a resource deployment script.
[0069] In addition, in order to facilitate the transmission of the resource deployment script, it can be packaged into a compressed package, namely, a resource deployment package.
[0070] Step 103: Execute the resource deployment package in the target host machine to expand the target host machine into the resource pool of the host machine to be expanded.
[0071] In this step, the resource deployment package may be specifically executed to initialize the environment of the target host machine; and the initialized target host machine may be expanded into the resource pool of the host machine to be expanded.
[0072] When executing the resource deployment package, the resource deployment package must first be decompressed to extract the corresponding resource deployment script, and then the resource deployment script is executed in sequence to achieve expansion of the initialized target host machine to the resource pool of the host machine to be expanded.
[0073] In addition, after the capacity expansion, a test cloud host can be added to the target host machine, and a feasibility test can be performed on the test cloud host according to a preset test algorithm to obtain a test result; if the test result shows that the test cloud host is feasible, the test cloud host is deleted, and the required number of cloud hosts are added to the target host machine.
[0074] In this embodiment, the target host is determined according to the expansion requirements of the host to be expanded, and then based on the basic information of the target host, it is rendered according to the preset script template to generate a resource deployment package. After the resource deployment package is executed in the target host, the target host can be expanded to the resource pool of the host to be expanded. Based on this, the solution of the present application can automatically generate a resource deployment package that can expand the target host to the resource pool of the host to be expanded, thereby realizing automatic expansion of the host to be expanded based on the expansion requirements, avoiding manual expansion, reducing the errors that may occur during expansion, and improving the expansion efficiency.
[0075] Embodiment 2
[0076] Figure 4 This is a schematic diagram of the structure of a cloud service resource expansion device provided in Example 2 of the present application. The cloud service resource expansion device provided in the embodiment of the present application can execute the cloud service resource expansion method provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. The device can be implemented in software and / or hardware, such as Figure 4 As shown, the cloud service resource expansion device specifically includes: a target host determination module 401, a target host determination module 402, a resource deployment package generation module 403, and an expansion module 404.
[0077] The expansion demand acquisition module is used to acquire the expansion demand of the host machine to be expanded;
[0078] A target host determination module, used to determine the target host according to the expansion requirement;
[0079] A resource deployment package generation module, used to generate a resource deployment package by rendering according to a preset script template based on the basic information of the target host machine and the host machine to be expanded;
[0080] The expansion module is used to execute the resource deployment package in the target host machine to expand the target host machine into the resource pool of the host machine to be expanded.
[0081] In this embodiment, the target host is determined according to the expansion requirements of the host to be expanded, and then based on the basic information of the target host, it is rendered according to the preset script template to generate a resource deployment package. After the resource deployment package is executed in the target host, the target host can be expanded to the resource pool of the host to be expanded. Based on this, the solution of the present application can automatically generate a resource deployment package that can expand the target host to the resource pool of the host to be expanded, thereby realizing automatic expansion of the host to be expanded based on the expansion requirements, avoiding manual expansion, reducing the errors that may occur during expansion, and improving the expansion efficiency.
[0082] Furthermore, the expansion demand acquisition module includes:
[0083] A request acquisition unit, used to acquire a capacity expansion request sent by an operation and maintenance party;
[0084] A judgment unit, used to determine whether the remaining resources of the host machine to be expanded meet the expansion request;
[0085] The capacity expansion demand determining unit is used to determine the capacity expansion demand of the host machine to be expanded according to the capacity expansion request and the remaining resources if the demand is not met.
[0086] Furthermore, the target host determination module includes:
[0087] A primary screening host screening unit is used to obtain the remaining resources of all host machines in the cloud platform and screen out the primary screening host machines whose remaining resources can meet the expansion requirements;
[0088] The target host machine determining unit is used to compare the basic information of each of the initially screened host machines with the basic information of the host machine to be expanded, and determine the initially screened host machine corresponding to the comparison result that meets the preset conditions as the target host machine.
[0089] Furthermore, the resource deployment package generation module includes:
[0090] A resource deployment script generating unit, configured to render the basic information of the target host machine and the host machine to be expanded according to a preset script template to generate a resource deployment script;
[0091] The resource deployment package generating unit is used to generate a resource deployment package based on the resource deployment script.
[0092] Furthermore, the resource deployment script generation unit includes:
[0093] A basic information acquisition subunit is used to acquire basic information of the target host and basic information of the host to be expanded from the database;
[0094] A differential comparison subunit, used to compare the basic information of the target host machine with the basic information of the host machine to be expanded to obtain differential data;
[0095] The script generation subunit is used to fill the differential data into the preset script template to obtain a resource deployment script.
[0096] Furthermore, the expansion module includes:
[0097] A deployment package execution unit, used to execute the resource deployment package and initialize the environment of the target host machine;
[0098] The expansion unit is used to expand the initialized target host machine into the resource pool of the host machine to be expanded.
[0099] Furthermore, the device also includes:
[0100] A test module is used to add a test cloud host to the target host, and perform a feasibility test on the test cloud host according to a preset test algorithm to obtain a test result;
[0101] The cloud host allocation module is used to delete the test cloud host if the test result shows that the test cloud host is feasible, and add a required number of cloud hosts to the target host.
[0102] Embodiment 3
[0103] Figure 5 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present application is shown in FIG. Figure 5 As shown, the electronic device includes a processor 510, a memory 520, an input device 530 and an output device 540; the number of the processor 510 in the electronic device can be one or more. Figure 5 A processor 510 is taken as an example; the processor 510, the memory 520, the input device 530 and the output device 540 in the electronic device can be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0104] The memory 520, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the cloud service resource expansion method in the embodiment of the present invention (for example, the target host determination module 401, the target host determination module 402, the resource deployment package generation module 403, and the expansion module 404 in the cloud service resource expansion device). The processor 510 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 520, that is, realizes the above-mentioned cloud service resource expansion method:
[0105] Obtaining a capacity expansion requirement for a host machine to be expanded, and determining a target host machine according to the capacity expansion requirement;
[0106] Based on the basic information of the target host and the host to be expanded, rendering is performed according to a preset script template to generate a resource deployment package;
[0107] The resource deployment package is executed in the target host machine to expand the target host machine into the resource pool of the host machine to be expanded.
[0108] In this embodiment, the target host is determined according to the expansion requirements of the host to be expanded, and then based on the basic information of the target host, it is rendered according to the preset script template to generate a resource deployment package. After the resource deployment package is executed in the target host, the target host can be expanded to the resource pool of the host to be expanded. Based on this, the solution of the present application can automatically generate a resource deployment package that can expand the target host to the resource pool of the host to be expanded, thereby realizing automatic expansion of the host to be expanded based on the expansion requirements, avoiding manual expansion, reducing the errors that may occur during expansion, and improving the expansion efficiency.
[0109] Furthermore, obtaining the expansion requirement of the host machine to be expanded includes:
[0110] Obtain the capacity expansion request sent by the operation and maintenance party;
[0111] Determine whether the remaining resources of the host machine to be expanded meet the expansion request;
[0112] If not satisfied, the capacity expansion requirement of the host machine to be expanded is determined according to the capacity expansion request and the remaining resources.
[0113] Further, determining the target host machine according to the expansion requirement includes:
[0114] Obtain the remaining resources of all host machines in the cloud platform, and select the preliminarily screened host machines whose remaining resources can meet the capacity expansion requirements;
[0115] The basic information of each of the initially screened host machines is compared with the basic information of the host machine to be expanded, and the initially screened host machine corresponding to the comparison result that meets the preset conditions is determined as the target host machine.
[0116] Furthermore, the rendering is performed according to a preset script template based on the basic information of the target host machine and the host machine to be expanded to generate a resource deployment package, including:
[0117] Render the basic information of the target host machine and the host machine to be expanded according to a preset script template to generate a resource deployment script;
[0118] A resource deployment package is generated based on the resource deployment script.
[0119] Furthermore, the basic information of the target host machine and the host machine to be expanded is rendered according to a preset script template to generate a resource deployment script, including:
[0120] Obtain basic information of the target host and the host to be expanded from the database;
[0121] Compare the basic information of the target host machine with the basic information of the host machine to be expanded to obtain differential data;
[0122] The differential data is filled into the preset script template to obtain a resource deployment script.
[0123] Further, executing the resource deployment package in the target host machine to expand the target host machine into the resource pool of the host machine to be expanded includes:
[0124] Execute the resource deployment package to initialize the environment of the target host machine;
[0125] The initialized target host machine is expanded into the resource pool of the host machine to be expanded.
[0126] Furthermore, after expanding the initialized target host machine into the resource pool of the host machine to be expanded, the method further includes:
[0127] Adding a test cloud host to the target host, and performing a feasibility test on the test cloud host according to a preset test algorithm to obtain a test result;
[0128] If the test result shows that the test cloud host is feasible, the test cloud host is deleted, and the required number of cloud hosts are added to the target host.
[0129] The memory 520 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 520 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 520 may further include a memory remotely arranged relative to the processor 510, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0130] Embodiment 4
[0131] Embodiment 4 of the present application further provides a storage medium including computer executable instructions, which are used to execute a cloud service resource expansion method when executed by a computer processor, the method comprising:
[0132] Obtaining a capacity expansion requirement for a host machine to be expanded, and determining a target host machine according to the capacity expansion requirement;
[0133] Based on the basic information of the target host and the host to be expanded, rendering is performed according to a preset script template to generate a resource deployment package;
[0134] The resource deployment package is executed in the target host machine to expand the target host machine into the resource pool of the host machine to be expanded.
[0135] In this embodiment, the target host is determined according to the expansion requirements of the host to be expanded, and then based on the basic information of the target host, it is rendered according to the preset script template to generate a resource deployment package. After the resource deployment package is executed in the target host, the target host can be expanded to the resource pool of the host to be expanded. Based on this, the solution of the present application can automatically generate a resource deployment package that can expand the target host to the resource pool of the host to be expanded, thereby realizing automatic expansion of the host to be expanded based on the expansion requirements, avoiding manual expansion, reducing the errors that may occur during expansion, and improving the expansion efficiency.
[0136] Furthermore, obtaining the expansion requirement of the host machine to be expanded includes:
[0137] Obtain the capacity expansion request sent by the operation and maintenance party;
[0138] Determine whether the remaining resources of the host machine to be expanded meet the expansion request;
[0139] If not satisfied, the capacity expansion requirement of the host machine to be expanded is determined according to the capacity expansion request and the remaining resources.
[0140] Further, determining the target host machine according to the expansion requirement includes:
[0141] Obtain the remaining resources of all host machines in the cloud platform, and select the preliminarily screened host machines whose remaining resources can meet the capacity expansion requirements;
[0142] The basic information of each of the initially screened host machines is compared with the basic information of the host machine to be expanded, and the initially screened host machine corresponding to the comparison result that meets the preset conditions is determined as the target host machine.
[0143] Furthermore, the rendering is performed according to a preset script template based on the basic information of the target host machine and the host machine to be expanded to generate a resource deployment package, including:
[0144] Render the basic information of the target host machine and the host machine to be expanded according to a preset script template to generate a resource deployment script;
[0145] A resource deployment package is generated based on the resource deployment script.
[0146] Furthermore, the basic information of the target host machine and the host machine to be expanded is rendered according to a preset script template to generate a resource deployment script, including:
[0147] Obtain basic information of the target host and the host to be expanded from the database;
[0148] Compare the basic information of the target host machine with the basic information of the host machine to be expanded to obtain differential data;
[0149] The differential data is filled into the preset script template to obtain a resource deployment script.
[0150] Further, executing the resource deployment package in the target host machine to expand the target host machine into the resource pool of the host machine to be expanded includes:
[0151] Execute the resource deployment package to initialize the environment of the target host machine;
[0152] The initialized target host machine is expanded into the resource pool of the host machine to be expanded.
[0153] Furthermore, after expanding the initialized target host machine into the resource pool of the host machine to be expanded, the method further includes:
[0154] Adding a test cloud host to the target host, and performing a feasibility test on the test cloud host according to a preset test algorithm to obtain a test result;
[0155] If the test result shows that the test cloud host is feasible, the test cloud host is deleted, and the required number of cloud hosts are added to the target host.
[0156] Of course, the computer executable instructions of a storage medium containing computer executable instructions provided in an embodiment of the present application are not limited to the above method operations, and can also execute related operations in the cloud service resource expansion method provided in any embodiment of the present application.
[0157] Through the above description of the implementation method, the technicians in the relevant field can clearly understand that the present application can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0158] It is worth noting that in the embodiment of the above-mentioned search device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.
[0159] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A cloud service resource expansion method, applied to a server, characterized in that: The method comprises: Obtain the capacity expansion requirements of the host to be expanded and the remaining resources of all hosts in the cloud platform, and select the pre-screened hosts whose remaining resources can meet the capacity expansion requirements; Compare the basic information of each of the pre-screened host machines with the basic information of the host machine to be expanded, and determine the pre-screened host machine corresponding to the comparison result that meets the preset conditions as the target host machine; Based on the basic information of the target host and the host to be expanded, rendering is performed according to a preset script template to generate a resource deployment package; The resource deployment package is executed in the target host machine to expand the target host machine into the resource pool of the host machine to be expanded.
2. The method according to claim 1, characterized in that The obtaining of the expansion requirement of the host machine to be expanded includes: Obtain the capacity expansion request sent by the operation and maintenance party; Determining whether the remaining resources of the host machine to be expanded meet the expansion request; If not, the capacity expansion requirement of the host machine to be expanded is determined according to the capacity expansion request and the remaining resources.
3. The method according to claim 1, characterized in that The comparing the basic information of each of the pre-screened host machines with the basic information of the host machine to be expanded, and determining the pre-screened host machine corresponding to the comparison result that meets the preset conditions as the target host machine, includes: If the number of pre-screened hosts corresponding to the comparison results that meet the preset conditions is greater than 1, the host with the least remaining resources is determined as the target host; If the number of pre-screened host machines corresponding to the comparison results that meet the preset conditions is 1, the pre-screened host machine corresponding to the comparison results that meet the preset conditions is determined as the target host machine.
4. The method according to claim 1, wherein The generating of a resource deployment package by rendering according to a preset script template based on the basic information of the target host and the host to be expanded includes: Render the basic information of the target host and the host to be expanded according to a preset script template to generate a resource deployment script; A resource deployment package is generated based on the resource deployment script.
5. The method according to claim 4, characterized in that The basic information of the target host and the host to be expanded is rendered according to a preset script template to generate a resource deployment script, including: Obtain basic information about the target host and the host to be expanded from the database; Comparing the basic information of the target host machine with the basic information of the host machine to be expanded to obtain differential data; Fill the differential data into the preset script template to obtain a resource deployment script.
6. The method according to claim 1, wherein The executing the resource deployment package in the target host machine to expand the target host machine into the resource pool of the host machine to be expanded includes: Executing the resource deployment package to initialize the environment of the target host machine; Expand the initialized target host machine into the resource pool of the host machine to be expanded.
7. The method according to claim 6, characterized in that After expanding the initialized target host into the resource pool of the host to be expanded, the method further includes: Add a test cloud host to the target host, and perform a feasibility test on the test cloud host according to a preset test algorithm to obtain a test result; If the test result shows that the test cloud host is feasible, the test cloud host is deleted, and the required number of cloud hosts are added to the target host.
8. A cloud service resource expansion device, characterized in that: The device comprises: The expansion demand acquisition module is used to obtain the expansion demand of the host to be expanded; A target host determination module, configured to determine a target host according to the expansion requirement; A resource deployment package generation module is used to generate a resource deployment package by rendering according to a preset script template based on the basic information of the target host and the host to be expanded; An expansion module, configured to execute the resource deployment package in the target host machine to expand the target host machine into the resource pool of the host machine to be expanded; The target host determination module includes: A primary host screening unit is used to obtain the remaining resources of all hosts in the cloud platform and screen out the primary host whose remaining resources can meet the expansion requirements; The target host machine determining unit is configured to compare the basic information of each of the pre-screened host machines with the basic information of the host machine to be expanded, and determine the pre-screened host machine corresponding to the comparison result that meets a preset condition as the target host machine.
9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the cloud service resource expansion method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the cloud service resource expansion method as described in any one of claims 1 to 7 is implemented.
