Virtual machine capacity expansion method and device, storage medium and product
By obtaining the virtual machine placing list and registration list, filtering and supplementing the initial application form, generating more realistic expansion orders, and expanding through automated processes, the problem of manual verification of virtual machine memory resource expansion in the existing technology is solved, and more accurate demand analysis and resource allocation is achieved, and the stability and reliability of the virtual machine system is improved.
Patent Information
- Application Number
- CN202411684799.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
AI Technical Summary
In the prior art, virtual machine memory resource expansion relies on manual verification, resulting in large workloads and high costs, and cannot flexibly adapt to business dynamic changes, resulting in virtual machines that may not be able to obtain sufficient memory resources in time.
By obtaining the virtual machine allocation list and registration list, the initial application form is screened and supplemented, and more realistic expansion orders are generated, and expansion is carried out through automated processes to ensure that the resource allocation rate is controllable.
It realizes more accurate demand analysis and resource allocation, reduces manual intervention, shortens capacity expansion cycle, and improves the stability and reliability of the virtual machine system.
Smart Images

Figure CN119621235A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing technology, and in particular to a virtual machine capacity expansion method, device, storage medium and product. Background Art
[0002] With the rapid development of information technology, virtual machine technology has been widely used in cloud computing, data centers and other fields. Virtual machines can run multiple independent operating systems and applications on a physical server at the same time, greatly improving the utilization and flexibility of server resources.
[0003] During the operation of a virtual machine, memory resources are one of the key factors affecting its performance and stability. With the growth of business needs and the increase of application loads, virtual machines may face insufficient memory resources. When a virtual machine is short of memory, it will lead to system performance degradation, slow application response, and even serious problems such as system crashes, thus affecting the normal operation of the business.
[0004] In the prior art, the expansion of virtual machine memory resources relies on the general API online expansion interface provided by the infrastructure cloud to implement the expansion. When faced with a large number of expansion demand work orders, operation and maintenance personnel often need to manually check the expansion requirements in multiple dimensions. The manual workload is large and the cost is high. In addition, manual verification can only rely on static reports and cannot flexibly adapt to dynamic changes in the business. When the business load suddenly increases, the virtual machine may not be able to obtain sufficient memory resources in time to meet the demand. Summary of the invention
[0005] The present invention provides a virtual machine capacity expansion method, device, storage medium and product, which can realize the expandable screening and assembly of memory application forms based on the infrastructure cloud universal interface, and can ensure the controllable allocation rate in the cloud through real-time comparison of resources in the cloud, and finally output the expansion result for review by operation and maintenance personnel.
[0006] According to one aspect of the present invention, a method for expanding capacity of a virtual machine is provided, the method comprising:
[0007] Obtain the initial application form for each virtual machine to be expanded, and obtain the virtual machine configuration list and virtual machine registration list based on the infrastructure cloud general interface;
[0008] Screening each initial application form through the virtual machine configuration list and the virtual machine registration list to generate a screening application form, and generating each supplementary application form based on the virtual machine registration list and the screening application form;
[0009] Data of each supplementary application form is grouped to generate each capacity expansion order, and the capacity of the virtual machine is expanded based on each capacity expansion order.
[0010] Optionally, the virtual machine configuration list includes standard memory specifications, the virtual machine registration list includes each valid virtual machine address and the corresponding virtual machine attribute information, and each initial application form is screened through the virtual machine configuration list and the virtual machine registration list to generate a screened application form, including: determining the application memory specifications corresponding to each initial application form; matching the application memory specifications through the virtual machine configuration list to screen out the initial application forms that meet the standard memory specifications as the application forms to be verified; determining the application virtual machine identifier corresponding to the application form to be verified; when the application virtual machine identifier and the virtual machine registration list match, using the application virtual machine identifier as the target virtual machine identifier, and using the application form to be verified corresponding to the target virtual machine identifier as the screened application form.
[0011] Optionally, each supplementary application form is generated based on the virtual machine registration list and the screening application form, including: determining the target virtual machine attribute information corresponding to the target virtual machine identifier through the virtual machine registration list, wherein the virtual machine attribute information includes the availability zone, host group and computing node where the virtual machine is located; combining the target virtual machine attribute information and the corresponding screening application form to generate a supplementary application form.
[0012] Optionally, data of each supplementary application form is grouped to generate each expansion order, including: determining the priority and host group corresponding to each supplementary application form, and grouping each supplementary application form based on the priority and host group to generate each host group grouping, wherein the host group grouping includes supplementary application forms with the same priority and host group; taking each host group group as the target host group group in turn, determining the computing node corresponding to each supplementary application form in the target host group group, and sorting each supplementary application form based on the computing node to generate a capacity expansion order, wherein the capacity expansion order includes the host group group after the computing nodes are sorted.
[0013] Optionally, virtual machine capacity expansion is performed based on each capacity expansion order, including: taking each capacity expansion order as a target capacity expansion order in turn, determining a target availability zone corresponding to the target capacity expansion order, and determining a current memory allocation rate corresponding to the target availability zone; when the memory allocation rate is less than a memory allocation threshold, obtaining host group related information corresponding to the target capacity expansion order and determining a final threshold of the host group, wherein the host group related information includes the host group memory allocation rate, the host group CPU allocation rate, and the host group allocation threshold; when the host group memory allocation rate is less than the final threshold, polling the computing nodes in the target capacity expansion order as target computing nodes in turn; determining a node memory allocation rate corresponding to the target computing node, and when the node memory allocation rate is less than the node memory allocation threshold, adding the target computing node to a pending queue; after completing the computing node polling, generating an expansion queue according to the pending queue; determining an interface concurrency threshold, and expanding the expansion queue in batches based on the interface concurrency threshold.
[0014] Optionally, after determining the current memory allocation rate corresponding to the target availability zone, the method further includes: when the memory allocation rate is greater than or equal to the memory allocation threshold, adding the target capacity expansion order to the standby queue; when the host group memory allocation rate is greater than or equal to the final threshold, adding the target capacity expansion order to the standby queue; when the node memory allocation rate is greater than or equal to the node memory allocation threshold, adding the target capacity expansion order to the standby queue.
[0015] Optionally, after the expansion queue is expanded in batches based on the interface concurrent number threshold, the method further includes: obtaining a failure application form for failed expansion results, extracting a supplementary expansion application form from the standby queue based on the failure application form; and expanding according to the supplementary expansion application form.
[0016] According to another aspect of the present invention, a device for expanding capacity of a virtual machine is provided, the device comprising:
[0017] The initial application form acquisition module is used to obtain the initial application form of each virtual machine to be expanded, and obtain the virtual machine configuration list and virtual machine registration list based on the infrastructure cloud general interface;
[0018] The application form screening module is used to screen each initial application form through the virtual machine configuration list and the virtual machine registration list to generate a screening application form, and to generate each supplementary application form according to the virtual machine registration list and the screening application form;
[0019] The virtual machine capacity expansion module is used to group the data of each supplementary application form to generate each capacity expansion order, and expand the capacity of the virtual machine based on each capacity expansion order.
[0020] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0021] at least one processor;
[0022] and a memory communicatively coupled to the at least one processor;
[0023] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a virtual machine expansion method described in any embodiment of the present invention.
[0024] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a virtual machine expansion method described in any embodiment of the present invention when executed.
[0025] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the computer program implements a method for expanding capacity of a virtual machine according to any embodiment of the present invention.
[0026] The technical solution of the embodiment of the present invention can more accurately determine the actual needs and configuration of the virtual machine by obtaining the virtual machine configuration list and registration list to screen and supplement the initial application form, thereby generating a more realistic expansion order and avoiding unnecessary expansion operations or waste of resources. Through the automated expansion process, the time for manual intervention and processing is reduced, and expansion orders can be quickly generated and expanded, shortening the virtual machine expansion cycle. Expansion based on accurate demand analysis and reasonable resource allocation helps maintain the stable operation of the virtual machine system and reduce system failures or performance degradation caused by improper expansion.
[0027] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0029] Figure 1 is a flowchart of a method for expanding capacity of a virtual machine provided according to Embodiment 1 of the present invention;
[0030] Figure 2 is a flow chart of a method for expanding capacity within a host group provided according to Embodiment 1 of the present invention;
[0031] Figure 3 is a flowchart of another virtual machine capacity expansion method provided according to Embodiment 2 of the present invention;
[0032] Figure 4 is a structural diagram of a virtual machine capacity expansion device provided according to Embodiment 3 of the present invention;
[0033] Figure 5 The present invention is a schematic diagram of the structure of an electronic device for implementing a method for expanding capacity of a virtual machine according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0036] Embodiment 1
[0037] Figure 1 A flowchart of a virtual machine expansion method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of online expansion of a virtual machine. The method can be executed by a virtual machine expansion device. The virtual machine expansion device can be implemented in the form of hardware and / or software. The virtual machine expansion device can be configured in a computer controller. Figure 1 As shown, the method includes:
[0038] S110: Obtain an initial application form for each virtual machine to be expanded, and obtain a virtual machine configuration list and a virtual machine registration list based on the infrastructure cloud general interface.
[0039] Among them, the virtual machine to be expanded refers to a virtual machine that needs to expand its memory resources because the currently configured memory resources can no longer meet the actual operation requirements due to business development, increased performance requirements, etc. in the cloud platform environment. The initial application form refers to a document submitted by the user that records the requirements for the virtual machine to be expanded. It contains basic information on the requirements for expanding the virtual machine to be expanded, such as the type and quantity of resources expected to be added, the reason for the expansion, and the basic identification information of the virtual machine. The infrastructure cloud universal interface refers to a standardized channel interface provided by the cloud platform for connecting different system modules or obtaining information related to various types of resources.
[0040] It should be noted that in a cloud computing environment, a token authentication mechanism can be used to ensure the security of interface calls. The infrastructure cloud will have a dedicated authentication server. When requesting a token, the client needs to send a request containing legal authentication information to the authentication server. After the authentication server verifies the correctness of the information, it generates a unique token based on certain encryption algorithms and rules. Subsequent interface calls need to carry a token, and the server verifies the token to confirm the legitimacy of the request and prevent unauthorized access.
[0041] Specifically, the infrastructure cloud universal interface is a channel that connects the cloud platform resource management system with other related systems or modules. The virtual machine configuration list contains standard configuration template information for various virtual machines in the cloud platform, such as the number of CPU cores, memory size, storage capacity and other standard configuration combinations corresponding to virtual machines of different specifications. The purpose of obtaining the virtual machine configuration list is to measure the situation of the virtual machine to be expanded based on these standard configuration templates, so as to make reasonable expansion planning.
[0042] S120: Screening each initial application form through the virtual machine configuration list and the virtual machine registration list to generate a screening application form, and generating each supplementary application form according to the virtual machine registration list and the screening application form.
[0043] Among them, the screening application form is obtained by screening the initial application form by using the standard configuration template of the virtual machine configuration list and the actual situation of the virtual machine registration list. Its purpose is to eliminate those initial application contents that do not meet the existing resource rules of the cloud platform, such as the applied expansion configuration does not meet the standard configuration in the configuration list, conflicts with the actual operation of the virtual machine registration, etc., and leave the parts that meet the conditions and can be reasonably expanded under the current cloud platform resource architecture, so as to perform more accurate operations later.
[0044] Optionally, the virtual machine configuration list includes standard memory specifications, the virtual machine registration list includes each valid virtual machine address and the corresponding virtual machine attribute information, and each initial application form is screened through the virtual machine configuration list and the virtual machine registration list to generate a screened application form, including: determining the application memory specifications corresponding to each initial application form; matching the application memory specifications through the virtual machine configuration list to screen out the initial application forms that meet the standard memory specifications as the application forms to be verified; determining the application virtual machine identifier corresponding to the application form to be verified; when the application virtual machine identifier and the virtual machine registration list match, using the application virtual machine identifier as the target virtual machine identifier, and using the application form to be verified corresponding to the target virtual machine identifier as the screened application form.
[0045] Among them, the virtual machine configuration list refers to a list that records the standard configuration template information of various virtual machines in the cloud platform, which lists in detail the standard resource configuration corresponding to virtual machines of different types and specifications. The virtual machine configuration list is pre-set by the cloud platform based on business needs, hardware resource conditions, performance optimization and other factors, and can be used as a reference for measuring the rationality of virtual machine expansion requirements. For example, there may be low memory specifications (such as 2GB) suitable for small office applications, medium memory specifications (such as 4GB-8GB) to meet general web services, and high memory specifications (such as 16GB and above) for large databases or complex computing tasks. The virtual machine registration list refers to the actual registration list of each virtual machine that already exists in the cloud platform, which contains the attribute information of each virtual machine, such as the actual configuration of the virtual machine, the operating status, the available zone, the host group to which it belongs, the computing node it relies on, the IP address and other information. The virtual machine registration list can accurately reflect the real status of each virtual machine and provide an accurate data basis for virtual machine management, expansion and other operations.
[0046] Specifically, the memory specification requested in the initial application form is the user's estimate of the memory size required for the virtual machine based on their business expectations. For example, a newly launched small e-commerce website may estimate that 4GB of memory is required in the initial stage to ensure the normal operation of the website and a certain amount of concurrent access processing capabilities. The controller needs to ensure that the resources requested by the user meet its pre-set standard configuration to ensure the effective use of resources and the stability of the overall system. The controller will compare the requested memory specification in the initial application form with the standard memory specification in the virtual machine configuration list. Only those initial application forms whose requested memory specifications are consistent with the standard memory specifications or within a reasonable range will be screened out as application forms to be verified. In addition, a certain allowable floating range can also be set. For example, if the standard specification is 8GB, the case where the floating range is allowed to be 1GB is also considered to be consistent. By verifying the memory specification, users can be prevented from applying for unreasonable resource configurations, avoiding resource waste or system performance problems caused by resource mismatch.
[0047] Furthermore, the controller will also determine the ID of the application virtual machine corresponding to the application form to be verified. The virtual machine ID can be the name, number or other information that uniquely identifies the virtual machine in the cloud platform. The controller will determine whether the processed virtual machine application information is consistent with the actual virtual machine situation. When a record matching the application virtual machine ID can be found in the virtual machine registration list, the application virtual machine ID can be used as the target virtual machine ID. At this time, the application form to be verified corresponding to the target virtual machine ID becomes the final screening application form.
[0048] Optionally, each supplementary application form is generated based on the virtual machine registration list and the screening application form, including: determining the target virtual machine attribute information corresponding to the target virtual machine identifier through the virtual machine registration list, wherein the virtual machine attribute information includes the availability zone, host group and computing node where the virtual machine is located; combining the target virtual machine attribute information and the corresponding screening application form to generate a supplementary application form.
[0049] It should be noted that in the architectural design of the cloud platform, multiple availability zones are divided in order to achieve efficient resource management, improve the fault tolerance of the system, and meet the needs of different users for resource locations. Each availability zone is usually relatively independent in terms of geographical location and is equipped with independent power, network and other infrastructure. By recording the availability zone information of the virtual machine in the virtual machine registration list, the cloud platform manager can clearly know in which region the resource pool of a certain virtual machine is located, so that when performing operations such as expansion and migration, the resource margin and network status of the availability zone can be considered to ensure the smooth operation. The host group is a way to classify and manage physical hosts in the cloud platform. Recording the host group information to which the virtual machine belongs in the virtual machine registration list helps to understand the general situation of the physical host on which the virtual machine relies. The computing node is the physical unit that actually performs computing tasks in the cloud platform, and each virtual machine will eventually run on a specific computing node. Different computing nodes may have differences in hardware configuration, network connection, etc. Knowing the computing node where the virtual machine is located helps to carry out targeted resource allocation or optimization operations according to its specific situation.
[0050] Specifically, the screening application form is a relatively reasonable application form for virtual machine expansion obtained through a series of previous screening steps, but the screening application form only preliminarily clarifies the general direction of the demand, such as the amount of memory and number of CPU cores that need to be increased. However, in order to more accurately allocate resources and meet actual business needs, it is also necessary to combine the actual attribute information of the virtual machine. When the attribute information of the target virtual machine determined by the virtual machine registration list is combined with the corresponding screening application form, the demand can be further refined in the supplementary application form. For example, combined with the information of the available zone, the current resource margin of the available zone can be considered to more accurately determine whether the expansion demand can be met and from which specific resource pool the resources need to be obtained; combined with the host group information, the specific method or time schedule of the expansion can be adjusted according to the hardware configuration and maintenance plan of the host group; combined with the computing node information, the operating parameters of the virtual machine after the expansion can be optimized according to the actual performance and resource utilization of the computing node.
[0051] S130: Grouping data of each supplementary application form to generate each capacity expansion order, and performing capacity expansion of the virtual machine based on each capacity expansion order.
[0052] Among them, the expansion order is an order form generated after the data grouping processing of the supplementary application form, which is used to clarify the virtual machine expansion task. According to certain rules, the relevant virtual machine expansion requirements can be classified and integrated to form independent expansion orders. Each expansion order clarifies the specific expansion tasks and requirements of a host group.
[0053] Optionally, virtual machine capacity expansion is performed based on each capacity expansion order, including: taking each capacity expansion order as a target capacity expansion order in turn, determining a target availability zone corresponding to the target capacity expansion order, and determining a current memory allocation rate corresponding to the target availability zone; when the memory allocation rate is less than a memory allocation threshold, obtaining host group related information corresponding to the target capacity expansion order and determining a final threshold of the host group, wherein the host group related information includes the host group memory allocation rate, the host group CPU allocation rate, and the host group allocation threshold; when the host group memory allocation rate is less than the final threshold, polling the computing nodes in the target capacity expansion order as target computing nodes in turn; determining a node memory allocation rate corresponding to the target computing node, and when the node memory allocation rate is less than the node memory allocation threshold, adding the target computing node to a pending queue; after completing the computing node polling, generating an expansion queue according to the pending queue; determining an interface concurrency threshold, and expanding the expansion queue in batches based on the interface concurrency threshold.
[0054] The memory allocation rate refers to the ratio of currently allocated memory to the total memory resources of the availability zone. If the current memory allocation rate is already very high, close to or reaching saturation, then when expanding the capacity of a virtual machine, you need to be more careful to consider whether there is enough memory to support the needs of the newly added virtual machines. Otherwise, the entire availability zone may be short of memory resources, affecting the normal operation of all virtual machines in the zone.
[0055] Specifically, the memory allocation threshold is set to ensure that there are relatively sufficient memory resources available for allocation before the expansion operation is performed. When the memory allocation rate of the target availability zone is less than the set memory allocation threshold, it means that the availability zone may still have a certain amount of memory expansion space. At this time, the controller can calculate the final threshold. Specifically, it can obtain the information of all computing nodes associated with the current host group, as well as the CPU and memory allocation rates, convert the host group dimension CPU and memory allocation rates, and take the smaller value of the configured host group allocation threshold and the current host group CPU allocation rate as the current host group final threshold. After determining that the host group memory allocation rate is less than the final threshold, it indicates that there may be sufficient resources at the host group level to support the expansion, but further investigation of the specific computing node situation is required. Therefore, when the controller determines that the host group memory allocation rate is less than the final threshold, it will start polling the computing nodes in the target expansion order. Because the resource utilization of each computing node may be different, even if the overall resources of the host group are sufficient, individual computing nodes may have approached or reached resource saturation. Therefore, the computing nodes in the target expansion order are polled as target computing nodes in turn, and the resource utilization of these computing nodes is checked one by one, so as to more accurately find the computing nodes with sufficient resources to support the expansion.
[0056] Furthermore, for each target compute node being polled, the controller will determine the corresponding node memory allocation rate, that is, the proportion of the memory allocated to the compute node to its total memory resources. When the node memory allocation rate is less than the node memory allocation threshold, it means that the compute node may still have some room for memory expansion, and it will be added to the pending queue. After completing the polling of all compute nodes in the target expansion order, the expansion queue is regenerated based on the collected information on whether there are sufficient resources to support expansion at each compute node level.
[0057] In addition, in order to prevent problems such as interface congestion and system crash caused by too many expansion requests being sent at the same time, users can set an interface concurrency threshold. Users refer to developers who expand virtual machines. The interface concurrency threshold can be determined based on factors such as the processing capacity of the interface and the overall stability requirements of the cloud platform. The controller will divide the expansion queue into several batches according to the number of concurrent connections that the interface can withstand, and only expand the virtual machines in one batch at a time. By setting the interface concurrency threshold, interface resources can be effectively utilized to avoid problems such as interface congestion caused by too many expansion requests being sent at the same time, ensuring that the expansion operation can be carried out smoothly and orderly to meet the needs of virtual machine expansion.
[0058] Specific application scenarios: Figure 2 A flowchart of a method for expanding capacity within a host group is provided for the first embodiment of the present invention. Figure 2The following steps are included: Step 1: Obtain the current memory allocation rate of the AZ where the host group is located through the infrastructure cloud general interface. If it exceeds the configured AZ memory allocation threshold, exit the current host group expansion. Step 2: Obtain the information of all computing nodes associated with the current host group, as well as the CPU and memory allocation rates through the infrastructure cloud general interface, convert the CPU and memory allocation rates of the host group dimension, and take the smaller value of the configured host group allocation threshold and the current host group CPU allocation rate as the final threshold of the current host group. If the memory allocation rate exceeds the current host group final threshold, exit the current host group expansion. Step 3: Start polling the computing node group in the host group. Step 4: Find the memory allocation rate of the computing node according to the cache. If it exceeds the configured computing node memory allocation threshold, exit the current computing node. Step 5: According to the difference between the current computing node allocation rate and the memory allocation threshold, combined with the total amount of application orders for expansion in the computing node group, calculate the expandable application order, add it to the pending queue, and poll the next computing node group. Step 6. After completing the polling of the computing node group, compare the current host group allocation rate with the final threshold of the current host group, calculate the expansion application form in the pending list, add it to the expansion queue, and put the rest into the pending queue. Step 7. Further assemble the expansion queue according to the maximum concurrency of the general interface for batch expansion, or the concurrency manually configured by the operation and maintenance personnel, form an expansion order and submit it, and record the failed application information. Step 8. Compare the failed application information, and propose a supplementary expansion application form from the standby queue information (the proposed application form needs to be deleted from the standby queue), repeat step 3 until there is no failed application form or the standby queue is 0, and enter the next host group. After all host groups are polled, output the expansion results.
[0059] Optionally, after determining the current memory allocation rate corresponding to the target availability zone, the method further includes: when the memory allocation rate is greater than or equal to the memory allocation threshold, adding the target capacity expansion order to the standby queue; when the host group memory allocation rate is greater than or equal to the final threshold, adding the target capacity expansion order to the standby queue; when the node memory allocation rate is greater than or equal to the node memory allocation threshold, adding the target capacity expansion order to the standby queue.
[0060] Specifically, by adding the target expansion order to the standby queue, it is possible to avoid forced expansion operations when memory resources are tight, thereby preventing possible problems such as system performance degradation, unstable virtual machine operation, and even failures due to insufficient memory. The order is temporarily stored in the standby queue so that it can be re-evaluated and processed later when the memory resource situation in the available zone improves, ensuring that the expansion operation can be carried out under the premise of sufficient memory resources.
[0061] Optionally, after the expansion queue is expanded in batches based on the interface concurrent number threshold, the method further includes: obtaining a failure application form for failed expansion results, extracting a supplementary expansion application form from the standby queue based on the failure application form; and expanding according to the supplementary expansion application form.
[0062] Specifically, the controller can identify the application forms that failed to complete the expansion by monitoring and identifying the expansion results, that is, failed application forms. The standby queue stores the expansion application forms that were temporarily shelved due to various resource shortages, such as the target availability zone's memory allocation rate is too high, the host group's memory allocation rate is too high, or the node's memory allocation rate is too high. When the expansion fails, you need to find an application form from these standby resources that can be used to try the expansion again as a supplementary expansion application form.
[0063] It is known that the controller can analyze the initial expansion requirements of the failed application form and the possible reasons for the failure, and then filter out the matching expansion application forms from the standby queue. For example, if a failed application form fails to expand due to tight memory resources in the target availability zone, then the application forms whose memory conditions in the availability zone are relatively good when in standby and whose expansion requirements are similar to those of the failed application form will be extracted from the standby queue as expansion application forms. The selected expansion application forms will have a greater probability of success in the current situation, and the resources in the standby queue can be used more specifically to try to solve the previous expansion failure problem.
[0064] The technical solution of the embodiment of the present invention can more accurately determine the actual needs and configuration of the virtual machine by obtaining the virtual machine configuration list and registration list to screen and supplement the initial application form, thereby generating a more realistic expansion order and avoiding unnecessary expansion operations or waste of resources. Through the automated expansion process, the time for manual intervention and processing is reduced, and expansion orders can be quickly generated and expanded, shortening the virtual machine expansion cycle. Expansion based on accurate demand analysis and reasonable resource allocation helps maintain the stable operation of the virtual machine system and reduce system failures or performance degradation caused by improper expansion.
[0065] Embodiment 2
[0066] Figure 3 This is a flowchart of a virtual machine expansion method provided in the second embodiment of the present invention. This embodiment adds a specific process of grouping data of each supplementary application form to generate each expansion order based on the above-mentioned first embodiment. Among them, the specific content of steps S210-S220 is roughly the same as steps S110-S120 in the first embodiment, so they will not be repeated in this embodiment. Figure 3 As shown, the method includes:
[0067] S210: Obtain an initial application form for each virtual machine to be expanded, and obtain a virtual machine configuration list and a virtual machine registration list based on the infrastructure cloud general interface.
[0068] S220: Screen each initial application form through the virtual machine configuration list and the virtual machine registration list to generate a screening application form, and generate each supplementary application form according to the virtual machine registration list and the screening application form.
[0069] Optionally, the virtual machine configuration list includes standard memory specifications, the virtual machine registration list includes each valid virtual machine address and the corresponding virtual machine attribute information, and each initial application form is screened through the virtual machine configuration list and the virtual machine registration list to generate a screened application form, including: determining the application memory specifications corresponding to each initial application form; matching the application memory specifications through the virtual machine configuration list to screen out the initial application forms that meet the standard memory specifications as the application forms to be verified; determining the application virtual machine identifier corresponding to the application form to be verified; when the application virtual machine identifier and the virtual machine registration list match, using the application virtual machine identifier as the target virtual machine identifier, and using the application form to be verified corresponding to the target virtual machine identifier as the screened application form.
[0070] Optionally, each supplementary application form is generated based on the virtual machine registration list and the screening application form, including: determining the target virtual machine attribute information corresponding to the target virtual machine identifier through the virtual machine registration list, wherein the virtual machine attribute information includes the availability zone, host group and computing node where the virtual machine is located; combining the target virtual machine attribute information and the corresponding screening application form to generate a supplementary application form.
[0071] S230, determining the priority and host group corresponding to each supplementary application form, and grouping each supplementary application form based on the priority and host group to generate each host group group, wherein the host group group includes supplementary application forms with the same priority and host group.
[0072] It should be noted that different virtual machine expansion requirements may have different urgency and importance. For example, for some virtual machines that support key business systems, such as financial transaction systems and core production systems, their expansion requirements may have a higher priority, because the normal operation of these systems is crucial to business continuity. Once insufficient resources affect performance, it may cause serious business losses. For some virtual machines used in test environments or non-core businesses, their expansion requirements have a relatively low priority. Priority setting is usually based on a comprehensive judgment based on factors such as the importance of the business, the current resource shortage of the virtual machine, and business growth expectations, so that the most urgent needs can be met first when resources are allocated.
[0073] Specifically, the controller will group supplementary application forms with the same priority and host group into a host group group, so that in the subsequent resource allocation and operation process, the same type of situation can be handled more orderly. For example, for supplementary application forms with high priority and belonging to the database business host group, they may have similarities in resource demand characteristics, expectations for host group hardware configuration, etc. By grouping, we can focus on arranging resources and formulating expansion plans based on the characteristics of the group, avoiding resource allocation confusion and operational inconvenience caused by mixing different priorities and different host groups.
[0074] S240. Group each host group as a target host group in turn, determine the computing node corresponding to each supplementary application form in the target host group, and sort each supplementary application form based on the computing node to generate an expansion order, wherein the expansion order includes the host group after the computing nodes are sorted.
[0075] Among them, the host group is a virtual logical collection of computing nodes, which is usually manually maintained by operation and maintenance personnel according to the device model to achieve different device management. The computing node is a service node responsible for the creation, operation, and destruction of virtual machine instances, providing computing power and storage for the instances.
[0076] Specifically, after determining the computing nodes corresponding to each supplementary application form, the controller will also sort each host group application form according to the computing node dimension, so that the virtual machine servers on the same computing node are in the same batch expansion order as much as possible. Sorting can enable the controller to arrange the expansion operation in a sequence that is more conducive to optimal resource allocation and efficient operation of virtual machines when generating expansion orders. For example, if a computing node has good hardware performance and low resource utilization, the corresponding supplementary application form may be placed in the front, so that when performing expansion operations, these virtual machines are expanded first, which can better utilize the advantageous resources of the computing node and improve the resource utilization efficiency of the entire cloud platform. The expansion order includes the host group grouping after the computing nodes are sorted. The sorted order structure enables each virtual machine to be expanded in turn according to the grouping and sorting when performing the expansion operation, ensuring the orderliness and rationality of resource allocation and meeting the needs of virtual machine expansion in different business scenarios.
[0077] S250: Expand the capacity of the virtual machine based on each expansion order.
[0078] Optionally, virtual machine capacity expansion is performed based on each capacity expansion order, including: taking each capacity expansion order as a target capacity expansion order in turn, determining a target availability zone corresponding to the target capacity expansion order, and determining a current memory allocation rate corresponding to the target availability zone; when the memory allocation rate is less than a memory allocation threshold, obtaining host group related information corresponding to the target capacity expansion order and determining a final threshold of the host group, wherein the host group related information includes the host group memory allocation rate, the host group CPU allocation rate, and the host group allocation threshold; when the host group memory allocation rate is less than the final threshold, polling the computing nodes in the target capacity expansion order as target computing nodes in turn; determining a node memory allocation rate corresponding to the target computing node, and when the node memory allocation rate is less than the node memory allocation threshold, adding the target computing node to a pending queue; after completing the computing node polling, generating an expansion queue according to the pending queue; determining an interface concurrency threshold, and expanding the expansion queue in batches based on the interface concurrency threshold.
[0079] Optionally, after determining the current memory allocation rate corresponding to the target availability zone, the method further includes: when the memory allocation rate is greater than or equal to the memory allocation threshold, adding the target capacity expansion order to the standby queue; when the host group memory allocation rate is greater than or equal to the final threshold, adding the target capacity expansion order to the standby queue; when the node memory allocation rate is greater than or equal to the node memory allocation threshold, adding the target capacity expansion order to the standby queue.
[0080] Optionally, after the expansion queue is expanded in batches based on the interface concurrent number threshold, the method further includes: obtaining a failure application form for failed expansion results, extracting a supplementary expansion application form from the standby queue based on the failure application form; and expanding according to the supplementary expansion application form.
[0081] The technical solution of the embodiment of the present invention can allocate resources more specifically by determining priorities and grouping host groups, giving priority to important applications and avoiding confusion in resource allocation, thereby improving the efficiency of overall resource allocation. Generating expansion orders based on the sorting of supplementary application forms by computing nodes can more accurately match resources to nodes with actual needs, which helps to optimize system performance and stability.
[0082] Embodiment 3
[0083] Figure 4 This is a schematic diagram of the structure of a virtual machine expansion device provided in Embodiment 3 of the present invention. Figure 4 As shown, the device includes: an initial application form acquisition module 310, which is used to acquire the initial application form of each virtual machine to be expanded, and acquire the virtual machine configuration list and the virtual machine registration list based on the infrastructure cloud general interface;
[0084] The application form screening module 320 is used to screen each initial application form through the virtual machine configuration list and the virtual machine registration list to generate a screening application form, and to generate each supplementary application form according to the virtual machine registration list and the screening application form;
[0085] The virtual machine capacity expansion module 330 is used to group the data of each supplementary application form to generate each capacity expansion order, and expand the capacity of the virtual machine based on each capacity expansion order.
[0086] Optionally, the application form screening module 320 specifically includes: an application form screening acquisition unit, used to: determine the application memory specifications corresponding to each initial application form; match the application memory specifications through the virtual machine standard matching list to screen out the initial application forms that meet the standard memory specifications as the application forms to be verified; determine the application virtual machine identifier corresponding to the application form to be verified; when the application virtual machine identifier and the virtual machine registration list match, use the application virtual machine identifier as the target virtual machine identifier, and use the application form to be verified corresponding to the target virtual machine identifier as the screening application form.
[0087] Optionally, the application form screening module 320 specifically includes: a supplementary application form generation unit, used to: determine the target virtual machine attribute information corresponding to the target virtual machine identifier through the virtual machine registration list, wherein the virtual machine attribute information includes the availability zone, host group and computing node where the virtual machine is located; combine the target virtual machine attribute information and the corresponding screening application form to generate a supplementary application form.
[0088] Optionally, the virtual machine capacity expansion module 330 specifically includes: an expansion order generation unit, which is used to: determine the priority and host group corresponding to each supplementary application form, and group each supplementary application form based on the priority and the host group to generate each host group group, wherein the host group group includes supplementary application forms with the same priority and host group; take each host group group as the target host group group in turn, determine the computing node corresponding to each supplementary application form in the target host group group, and sort each supplementary application form based on the computing node to generate an expansion order, wherein the expansion order includes the host group group after the computing node is sorted.
[0089] Optionally, the virtual machine expansion module 330 specifically includes: a virtual machine expansion unit, used to: take each expansion order as a target expansion order in turn, determine the target availability zone corresponding to the target expansion order, and determine the current memory allocation rate corresponding to the target availability zone; when the memory allocation rate is less than the memory allocation threshold, obtain the host group related information corresponding to the target expansion order and determine the host group final threshold, wherein the host group related information includes the host group memory allocation rate, the host group CPU allocation rate and the host group allocation threshold; when the host group memory allocation rate is less than the final threshold, poll the computing nodes in the target expansion order as target computing nodes in turn; determine the node memory allocation rate corresponding to the target computing node, and when the node memory allocation rate is less than the node memory allocation threshold, add the target computing node to the pending queue; after completing the computing node polling, generate an expansion queue according to the pending queue; determine the interface concurrency threshold, and expand the expansion queue in batches based on the interface concurrency threshold.
[0090] Optionally, the device also includes: a standby queue generation module, which is used to, after determining the current memory allocation rate corresponding to the target availability zone, add the target capacity expansion order to the standby queue when the memory allocation rate is greater than or equal to the memory allocation threshold; when the host group memory allocation rate is greater than or equal to the final threshold, add the target capacity expansion order to the standby queue; when the node memory allocation rate is greater than or equal to the node memory allocation threshold, add the target capacity expansion order to the standby queue.
[0091] Optionally, the device also includes: a supplementary expansion module, which is used to obtain a failure application form for failed expansion results after expanding the expansion queue in batches based on the interface concurrent number threshold, and extract a supplementary expansion application form from the standby queue based on the failure application form; and expand the capacity according to the supplementary expansion application form.
[0092] The technical solution of the embodiment of the present invention can more accurately determine the actual needs and configuration of the virtual machine by obtaining the virtual machine configuration list and registration list to screen and supplement the initial application form, thereby generating a more realistic expansion order and avoiding unnecessary expansion operations or waste of resources. Through the automated expansion process, the time for manual intervention and processing is reduced, and expansion orders can be quickly generated and expanded, shortening the virtual machine expansion cycle. Expansion based on accurate demand analysis and reasonable resource allocation helps maintain the stable operation of the virtual machine system and reduce system failures or performance degradation caused by improper expansion.
[0093] A virtual machine capacity expansion device provided in an embodiment of the present invention can execute a virtual machine capacity expansion method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0094] Embodiment 4
[0095] Figure 5A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0096] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0097] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0098] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for expanding the capacity of a virtual machine.
[0099] In some embodiments, a method for expanding the capacity of a virtual machine may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for expanding the capacity of a virtual machine described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform a method for expanding the capacity of a virtual machine in any other appropriate manner (e.g., by means of firmware).
[0100] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0101] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0102] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0103] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0104] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0105] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0106] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0107] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for expanding the capacity of a virtual machine, characterized in that: include: Obtain the initial application form for each virtual machine to be expanded, and obtain the virtual machine configuration list and virtual machine registration list based on the infrastructure cloud general interface; Screening each initial application form through the virtual machine configuration list and the virtual machine registration list to generate a screening application form, and generating each supplementary application form according to the virtual machine registration list and the screening application form; Data of each of the supplementary application forms is grouped to generate each capacity expansion order, and the capacity of the virtual machine is expanded based on each of the capacity expansion orders.
2. The method according to claim 1, characterized in that The virtual machine configuration list includes standard memory specifications, the virtual machine registration list includes each valid virtual machine address and corresponding virtual machine attribute information, and the initial application form is screened by the virtual machine configuration list and the virtual machine registration list to generate a screening application form, including: Determine the application memory specifications corresponding to each of the initial application forms; Matching the memory specifications of the application through the virtual machine standard configuration list to screen out initial application forms that meet the standard memory specifications as application forms to be verified; Determine the application virtual machine identifier corresponding to the application form to be verified; When the application virtual machine identifier matches the virtual machine registration list, the application virtual machine identifier is used as the target virtual machine identifier, and the to-be-verified application form corresponding to the target virtual machine identifier is used as the screening application form.
3. The method according to claim 2, characterized in that The generating of each supplementary application form according to the virtual machine registration list and the screening application form includes: Determining target virtual machine attribute information corresponding to the target virtual machine identifier through the virtual machine registration list, wherein the virtual machine attribute information includes the available zone, host group, and computing node where the virtual machine is located; The target virtual machine attribute information and the corresponding screening application form are combined to generate a supplementary application form.
4. The method according to claim 1, characterized in that The step of grouping the data of the supplementary application forms to generate the capacity expansion orders includes: Determine the priority and host group corresponding to each of the supplementary application forms, and group each of the supplementary application forms based on the priority and the host group to generate each host group group, wherein the host group group includes supplementary application forms with the same priority and host group; Each host group is grouped as a target host group in turn, the computing node corresponding to each supplementary application form in the target host group is determined, and each supplementary application form is sorted based on the computing node to generate an expansion order, wherein the expansion order includes the host group after the computing node is sorted.
5. The method according to claim 4, characterized in that The step of expanding the capacity of the virtual machine based on each of the expansion orders includes: Taking each capacity expansion order as a target capacity expansion order in turn, determining a target availability zone corresponding to the target capacity expansion order, and determining a current memory allocation rate corresponding to the target availability zone; When the memory allocation rate is less than the memory allocation threshold, obtain the host group related information corresponding to the target expansion order and determine the final threshold of the host group, wherein the host group related information includes the host group memory allocation rate, the host group CPU allocation rate and the host group allocation threshold; When the host group memory allocation rate is less than the final threshold, the computing nodes in the target expansion order are polled in turn as target computing nodes; Determine a node memory allocation rate corresponding to the target computing node, and when the node memory allocation rate is less than a node memory allocation threshold, add the target computing node to a pending queue; After the computing node polling is completed, an expansion queue is generated according to the pending queue; An interface concurrent number threshold is determined, and the capacity expansion queue is expanded in batches based on the interface concurrent number threshold.
6. The method according to claim 5, characterized in that After determining the current memory allocation rate corresponding to the target available zone, the method further includes: When the memory allocation rate is greater than or equal to the memory allocation threshold, the target capacity expansion order is added to the standby queue; When the host group memory allocation rate is greater than or equal to the final threshold, adding the target capacity expansion order to a standby queue; When the node memory allocation rate is greater than or equal to the node memory allocation threshold, the target capacity expansion order is added to the standby queue.
7. The method according to claim 6, characterized in that After the expansion queue is expanded in batches based on the interface concurrent number threshold, the method further includes: Obtaining a failed application form for a failed expansion result, and extracting a supplementary expansion application form from the standby queue based on the failed application form; The capacity is expanded according to the expansion application form.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 7.
9. A computer storage medium, characterized in that The computer storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method according to any one of claims 1 to 7 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.