A virtual machine CPU resource management system and method for a cloud platform
By dynamically allocating the virtual machine CPU frequency in a cloud computing environment, using Intel's speed selection technology (SST) to adjust the physical core frequency, the resource waste and business design complexity caused by the fixed virtual machine CPU frequency in a cloud computing environment are solved, and more efficient resource utilization and business processing capabilities are achieved.
Patent Information
- Application Number
- CN202111188425.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-12
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-10-12
AI Technical Summary
In a cloud computing environment, the CPU frequency of different virtual machines in the same physical machine is fixed, resulting in the remaining CPU capabilities of some virtual machines, while the performance of some business CPUs is insufficient, resulting in waste of computing power and complexity of business design.
The method of dynamically allocating core frequency is adopted, and the CPU frequency of the virtual machine is dynamically adjusted according to business needs through the collaborative work of the business configuration module, resource management module and virtual machine monitor, and the frequency of the physical core is adjusted using Intel's speed selection technology (SST).
It realizes efficient resource management for deploying different services on the same physical machine, reducing resource vacancy, improving resource utilization, reducing resource waste, and improving business processing capabilities.
Smart Images

Figure CN113986454B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of virtualization, and in particular to a virtual machine CPU resource management system and method for a cloud platform. Background Art
[0002] As cloud computing technology matures, more and more businesses are running on the cloud. The scale of various cloud platform hosts has gradually increased, and the number of virtual machines carrying businesses has also increased sharply. Business scenarios are becoming more and more complex, and different businesses have different requirements for the processing performance of virtual machines. However, in the converged deployment scenario, all CPU frequencies in the same physical machine are the same, which inevitably leads to some virtual machine CPUs having excess capacity, while some business CPUs have insufficient performance. It is necessary to redesign the business to allocate more cores, resulting in a waste of computing power and complex business design. In some scenarios with low business load, such as at night, some virtual machines do not run businesses, but the CPUs are still working, wasting resources.
[0003] Traditional methods only distribute processing power among multiple virtual processors of a physical CPU by improving CPU scheduling algorithms, priority settings, and virtual processor frequency settings, but they are essentially unable to increase the processing power limit of a single virtual processor. At the same time, the business modules of virtual machines that are running idle are delayed, resulting in serious waste of resources. Summary of the invention
[0004] In view of the defects existing in the prior art, the purpose of the present invention is to provide a virtual machine CPU resource management system and method for a cloud platform. By dynamically allocating core frequencies to different virtual machines, different services can be deployed on the same physical machine, reducing vacancy, improving resource utilization, and reducing resource waste.
[0005] To achieve the above objectives, on the one hand, a cloud platform virtual machine CPU resource management system is adopted, including:
[0006] A business configuration module, which is used to configure the required virtual machine type and memory size according to business attributes and generate a virtual machine allocation request;
[0007] The resource management module control node is used to receive the virtual machine allocation request, obtain a matching physical machine through a resource remaining minimum matching algorithm according to the hardware information of the physical machines in the cluster, and generate virtual machine allocation parameters;
[0008] A virtual machine monitor is used to receive the virtual machine allocation parameters, and is also used to use the speed selection technology SST to adjust the frequency of the corresponding physical core to meet the frequency of the virtual machine when the basic frequency of the unused physical core does not meet the frequency of the virtual machine before allocating it to the virtual machine, and bind the CPU of the virtual machine to the CPU of the physical machine.
[0009] Preferably, the virtual machine types include computing type, IO type and balanced type. The business configuration module will configure computing type virtual machines for businesses that tend to be computing, IO type virtual machines for businesses that tend to be IO type, and balanced type virtual machines for uncertain businesses, and all virtual machines can subsequently adjust the virtual machine type.
[0010] Preferably, the system also includes a template configuration tool for configuring multiple resource templates for each virtual machine type, the resource template including the virtual machine type, CPU model, basic frequency and SST adjusted maximum frequency, and the template configuration tool is also used to transmit the resource template to the business configuration module through the resource management module control node.
[0011] Preferably, the virtual machine monitor is further used to control the node to send a request to shut down the virtual machine through the resource management module when the CPU occupancy rate of the virtual machine is monitored to be lower than a preset threshold;
[0012] The system also includes a service load balancing module, which is used to migrate the service to other virtual machines according to the CPU resources used by the service after the resource management module control node receives the request to shut down the virtual machine, and send a response to the virtual machine monitor through the resource management module control node;
[0013] The virtual machine monitor is also used to shut down the virtual machine and shut down the physical core using SST after receiving the response.
[0014] Preferably, the virtual machine monitor counts the virtual machine processes running on each core based on timed interrupts, calculates the CPU occupancy of the virtual machine in real time, and sends a virtual machine shutdown warning to the resource management module control node when the CPU occupancy is lower than a preset threshold. After receiving the virtual machine shutdown warning, the resource management module control node sends a request to shut down the virtual machine to the business load balancing module.
[0015] Preferably, the virtual machine monitor sets a timer interrupt cycle, and registers a callback function in the timer interrupt to perform dot counting. In the callback function, the virtual machine monitor adds 1 to the total dot count. If the current core is running the CPU of the virtual machine, the virtual machine statistics count adds 1.
[0016] After the preset time, the ratio of the virtual machine statistical count and the total dot count is calculated, which is the CPU occupancy rate of each core; the CPU occupancy rates of all cores are averaged, which is the CPU occupancy rate of the virtual machine within the preset time, where the preset time includes multiple interrupt cycles.
[0017] Preferably, the virtual machine monitor counts the CPU occupancy rate of the virtual machine for a continuous preset time. If the CPU occupancy rate is continuously higher than the upper limit or lower than the lower limit, the resource management module controls the node to increase or decrease the allocated CPU resources by adjusting the resource template under the current type of virtual machine;
[0018] If the current type of resource template cannot meet the requirements, the virtual machine type will be switched. If the current type is computing type and the allocated CPU resources cannot be increased, the switch cannot be made and an alarm will be generated. If the current type is IO type and the allocated CPU resources cannot be reduced, the switch cannot be made. The virtual machine monitor notifies the resource management module to control the node and issues an alert to shut down the virtual machine.
[0019] Preferably, the system also includes multiple resource management module agent nodes, which are deployed on each physical machine respectively, and are used to report the physical machine hardware information to the resource management module control node, including CPU model, frequency, number of CPUs and memory size of the physical machine.
[0020] Preferably, the resource management module control node obtains a matching physical machine through a resource remaining minimum matching algorithm according to the hardware information of the physical machines in the cluster, including:
[0021] The resource management module control node calculates the maximum frequency MAX_HZ of a single CPU of each physical machine, the total remaining physical frequency TOTAL_HZ, and the remaining memory TOTAL_MEM according to the physical machine hardware information, and generates a resource table by sorting the MAX_HZ, TOTAL_HZ, and TOTAL_MEM triples;
[0022] The resource management module control node parses the service type according to the virtual machine allocation request and selects the required minimum CPU frequency MIN_HZ; parses the CPU requirement number N, calculates the minimum total CPU frequency MIN_TOTAL, parses the memory field as the minimum memory MIN_MEM, and generates the resource requirement triple MIN_HZ, MIN_TOTAL, MIN_MEM;
[0023] Traverse the resource table according to the resource requirement triples, find the minimum matching MAX_HZ, TOTAL_HZ, TOTAL_MEM triples in turn, and the corresponding physical machine is the matching physical machine.
[0024] Preferably, the resource table is traversed according to the resource requirement triples to find the minimum matching MAX_HZ, TOTAL_HZ, TOTAL_MEM triples in sequence, specifically including:
[0025] First, find the minimum matching MAX_HZ, select the minimum matching TOTAL_HZ in the resource table that meets the conditions, and then traverse to find the minimum matching TOTAL_MEM;
[0026] If there is no TOTAL_MEM that matches, backtrack forward to find the next best matching TOTAL_HZ, and then find the TOTAL_MEM that meets the conditions;
[0027] If all TOTAL_HZ and TOTAL_MEM in the same MAX_HZ do not match, continue to backtrack forward, find the second best matching MAX_HZ, and traverse again.
[0028] On the other hand, a method for managing CPU resources of a virtual machine on a cloud platform based on the system is also provided, comprising the steps of:
[0029] The business configuration module configures the required virtual machine type and memory size according to the business attributes, and generates a virtual machine allocation request to the resource management module control node;
[0030] The resource management module control node obtains matching physical machines based on the hardware information of the physical machines in the cluster through the resource remaining minimum matching algorithm, and generates virtual machine allocation parameters and sends them to the virtual machine monitor;
[0031] When the base frequency of the unused physical core does not meet the frequency of the virtual machine, the virtual machine monitor uses SST to adjust the frequency of the corresponding physical core until it meets the frequency and then allocates it to the virtual machine, and binds the CPU of the virtual machine to the CPU of the physical machine.
[0032] One of the above technical solutions has the following beneficial effects:
[0033] Based on Intel's Speed Select Technology (SST), the core frequency is dynamically changed so that different cores have different frequencies. Then, according to business needs, computing services are allocated virtual machines with high-frequency cores, and input and output (IO) services are allocated virtual machines with low-frequency cores. This fully utilizes the CPU's computing power, reduces waste, and meets the current private cloud application scenario requirements.
[0034] Compared with the prior art, the present invention can dynamically allocate core frequencies to different virtual machines, deploy different services on the same physical machine, reduce vacancy, and improve resource utilization. It can also allocate CPU frequencies to virtual machines when the business is busy, thereby improving business processing capabilities, managing virtual machines through dynamic frequency allocation, and reducing virtual machine migration.
[0035] In addition, through the monitoring of the virtual machine monitor, it is possible to monitor that the CPU usage of the virtual machine is lower than the preset threshold, notify the business migration and shut down the virtual machine and the corresponding physical core to reduce resource waste. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic diagram of a virtual machine CPU resource management system of a cloud platform according to an embodiment of the present invention;
[0037] Figure 2 A schematic diagram of physical machine hardware information reporting and template configuration according to an embodiment of the present invention;
[0038] Figure 3 This is a schematic diagram of the process flow of the minimum remaining resource matching algorithm according to an embodiment of the present invention;
[0039] Figure 4 A schematic diagram of a virtual machine monitor managing virtual machines;
[0040] Figure 5 A schematic diagram of a virtual machine monitor monitoring the status of a virtual machine in real time.
[0041] Reference numerals:
[0042] 1. Business configuration module; 2. Resource management module control node; 3. Virtual machine monitor; 4. Resource management module proxy node; 5. Template configuration tool; 6. Business load balancing module. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0044] like Figure 1 As shown, an embodiment of a virtual machine CPU resource management system for a cloud platform is provided, including a service configuration module 1, a resource management module control node 2, and a virtual machine monitor 3. Among them, the service configuration module 1 configures the type and CPU quantity of the virtual machine. Specifically, the virtual machine type includes computing type, IO type, and balanced type. The service configuration module 1 is used to configure the required virtual machine type and memory size according to the service attributes, and generate a virtual machine allocation request to the resource management module control node 2.
[0045] The resource management module control node 2 can be deployed on a physical machine or a virtual machine. The resource management module control node 2 is used to obtain a matching physical machine through a resource remaining minimum matching algorithm according to the hardware information of the physical machines in the cluster, and generate virtual machine allocation parameters for the virtual machine monitor 3.
[0046] The virtual machine monitor 3 is used to use SST to adjust the frequency of the corresponding physical core to meet the frequency of the virtual machine when the basic frequency of the unused physical core does not meet the frequency of the virtual machine, and then allocate it to the virtual machine, and bind the CPU of the virtual machine to the CPU of the physical machine.
[0047] Furthermore, the virtual machine CPU resource management system of the cloud platform also includes a resource management module proxy node 4, a template configuration tool 5 and a business load balancing module 6. The resource management module proxy node 4 is deployed on each physical machine to report the physical machine hardware information, such as CPU model, frequency, number of CPUs and memory size of the physical machine, to the resource management module control node 2. The template configuration tool 5 is used to configure resource templates and also to transmit resource templates to the business configuration module 1 through the resource management module control node 2.
[0048] The virtual machine monitor 3 is also used to send a virtual machine shutdown request to the resource management module control node 2 when the CPU occupancy of the virtual machine is lower than the preset threshold. The service load balancing module 6 is used to migrate the service to other virtual machines according to the CPU resources used by the service after the resource management module control node 2 receives the virtual machine shutdown request, and send a response to the virtual machine monitor 3 through the resource management module control node 2. The virtual machine monitor 3 is also used to shut down the virtual machine after receiving the response, and use SST to shut down the physical core.
[0049] like Figure 1 As shown, based on the above system embodiment, an embodiment of a method for managing CPU resources of a virtual machine on a cloud platform is provided, comprising the steps of:
[0050] S1. The resource management module agent node 4 reports the physical machine hardware information to the resource management module control node 2.
[0051] S2. Template configuration tool 5 configures the resource template of resource management module control node 2, configures the basic frequency of the CPU model and the maximum frequency supported after adjustment by SST technology, and configures the virtual machine type, which is divided into computing type, IO type and balanced type, as well as the corresponding frequencies of different types of virtual machines.
[0052] S3. The business configuration module 1 configures the required virtual machine type and memory size according to its own business attributes. Specifically, a computing-oriented business will be configured with a computing virtual machine, an IO-oriented business will be configured with an IO-oriented business, and an uncertain business will be configured with a balanced virtual machine, and the virtual machine type of all virtual machines can be adjusted later. The business configuration module 1 generates a virtual machine allocation request for the required virtual machine configuration, sends it to the resource management module control node 2, waits for the virtual machine to be successfully created and returns. It should be understood that the adjustment of the virtual machine type needs to comply with the principle: a balanced virtual machine can be adjusted to a computing virtual machine or an IO virtual machine, while neither a computing virtual machine nor an IO virtual machine can be adjusted to a balanced virtual machine, and a computing virtual machine and an IO virtual machine can be adjusted to each other.
[0053] S4. The resource management module control node 2 receives the virtual machine allocation request sent by the business configuration module, calculates according to the physical machine hardware information reported by each resource management module agent node 4 and the information reported by the virtual machine monitor 3, uses the resource remaining minimum matching algorithm to find the matching physical machine, and generates the corresponding virtual machine allocation parameters, which are sent to the virtual machine monitor 3 of the physical machine.
[0054] S5. The virtual machine monitor 3 first determines whether the basic frequency of the unused physical core meets the frequency of the virtual machine based on the virtual machine allocation parameters sent by the resource management module control node 2. If so, the corresponding core is allocated to the physical machine; if not, Intel's SST is used to reduce the frequency of some cores and increase the frequency of other cores to meet the needs, and then allocate them to the virtual machine.
[0055] S6. After the virtual machine monitor 3 allocates the cores required by the virtual machine, it starts the virtual machine. After the virtual machine starts successfully or fails, the result is returned to the resource management module control node. After the virtual machine starts successfully, the virtual machine monitor 3 binds the CPU of the virtual machine to the CPU of the physical machine.
[0056] S7. The virtual machine monitor 3 counts the virtual machine processes running on each core based on the timer interrupt, and calculates the CPU occupancy rate of the virtual machine in real time. When the CPU occupancy rate of the virtual machine is lower than the preset threshold, the virtual machine monitor 3 sends a warning to the resource management module control node 2 to shut down the virtual machine.
[0057] S8. After receiving the warning of shutting down the virtual machine, the resource management module control node 2 sends a request to shut down the virtual machine to the service load balancing module 6. The service load balancing module 6 adjusts the service allocation according to the request of the physical machine, no longer sends the service to the virtual machine to be shut down, and notifies the resource management module control node 2. After receiving the notification, the resource management module control node 2 sends a response to the virtual machine monitor 3. After receiving the response, the virtual machine monitor 3 shuts down the virtual machine and uses SST to shut down the corresponding physical core.
[0058] Based on the above steps, an embodiment of hardware information reporting and template configuration is provided. Figure 2 As shown, the above steps S1 and S2 specifically include the following steps:
[0059] S21. The resource management module agent node 4 deployed on each physical machine collects various hardware information, including CPU, storage, and network information, through the server's operating system interface.
[0060] S22. The resource management module proxy node 4 formats and encrypts the collected hardware information and reports it to the resource management module control node 2. The resource management module control node 2 is deployed on a physical machine or a virtual machine. The resource management module control node 2 monitors a fixed port in the form of a background service, waiting for the resource management module proxy node 4 to report the physical machine hardware information.
[0061] S23. The resource management module control node 2 provides a template configuration interface, and the template configuration tool 5 configures the resource template through the template configuration interface. In some embodiments, the format is ("virtual machine type", "CPU model", "base frequency", "SST adjustment maximum frequency"). The resource management module control node 2 provides this resource template to the upper-level business configuration module 1. Specifically, each virtual machine type will be configured with multiple resource templates, and the resource templates subdivide the CPU resources.
[0062] like Figure 3 As shown, based on the above steps S3 and S4, an embodiment is provided in which a resource management module control node obtains a matching physical machine through a resource remaining minimum matching algorithm according to the hardware information of the physical machine in the cluster, including the steps of:
[0063] S31. The resource management module control node 2 calculates the maximum frequency MAX_HZ of a single CPU of each physical machine, the total remaining physical frequency TOTAL_HZ, and the remaining memory TOTAL_MEM according to the physical machine hardware information reported in real time by the resource management module proxy node 4 and the virtual machine monitor 3, and generates a resource table by sorting the MAX_HZ, TOTAL_HZ, and TOTAL_MEM triples; wherein MAX_HZ is the maximum frequency after being increased by SST. Preferably, the MAX_HZ, TOTAL_HZ, and TOTAL_MEM triples are sorted in ascending order to generate a resource table.
[0064] S32. The business configuration module 1 defines the virtual machine type as computing type, IO type or balanced type according to the business needs, and sends the virtual machine configuration. The business configuration module 1 also selects the number of CPUs and memory size required. The template defines the default memory, which can be modified if the business needs it.
[0065] S33. After receiving the virtual machine allocation request sent by the service configuration module and parsing the service type, the resource management module control node 2 can select the required minimum CPU frequency MIN_HZ according to the template. Parse the CPU requirement number N and calculate the minimum total CPU frequency MIN_TOTAL, where MIN_TOTAL = MIN_HZ*N. Parse the memory field as the minimum memory MIN_MEM and generate the resource requirement triple MIN_HZ, MIN_TOTAL, MIN_MEM.
[0066] S34. According to the information of the resource requirement triplet, traverse the resource table, find the minimum matching MAX_HZ, TOTAL_HZ, TOTAL_MEM triplet in turn, and enter S35.
[0067] The specific steps are as follows:
[0068] S341. First find the minimum matching MAX_HZ, select the minimum matching TOTAL_HZ in the resource table that meets the conditions, then traverse to find the minimum matching TOTAL_MEM. If found, go to S35; if not found, go to S342.
[0069] S342. Backtrack forward to find the suboptimal matching TOTAL_HZ, and then find the TOTAL_MEM that meets the conditions. If a TOTAL_MEM that meets the conditions is found, go to S35; if not found, go to S343.
[0070] S343. If all TOTAL_HZ and TOTAL_MEM in the same MAX_HZ do not match, continue to backtrack forward to find the second best matching MAX_HZ, and repeat the above steps until a MAX_HZ, TOTAL_HZ, TOTAL_MEM triple is found, and enter S35.
[0071] S35. The physical machine corresponding to the MAX_HZ, TOTAL_HZ, and TOTAL_MEM triplet found at this time is a physical machine matched by the resource remaining minimum matching algorithm.
[0072] In this embodiment, by allocating resources through the resource remaining minimum matching algorithm, it is possible to avoid dividing the physical machine resources into a plurality of small virtual machines, thereby reducing resource fragmentation.
[0073] like Figure 4 As shown, based on the above steps S5 and S6, an embodiment of a virtual machine monitor managing a virtual machine is provided, comprising the steps of:
[0074] S41. After receiving the virtual machine allocation parameters sent by the resource management module control node 2, the virtual machine monitor 3 reads the CPU frequency through the operating system interface.
[0075] S42. Determine whether the CPU frequency meets the frequency of the virtual machine. If yes, proceed to S44. If no, it means that the CPU base frequency is lower than the frequency required by the virtual machine, and proceed to S43.
[0076] S43. Use Intel's SST to increase the frequency of the physical CPUs required by the virtual machine and enter S44.
[0077] S44. Allocate CPU to the virtual machine.
[0078] S45. The virtual machine monitor 3 starts the virtual machine.
[0079] S46. After the virtual machine is successfully started, the virtual machine monitor 3 binds the CPU of the virtual machine to the CPU of the physical machine.
[0080] like Figure 5 As shown, based on the above steps S7 and S8, an embodiment of a virtual machine monitor 3 monitoring the state of a virtual machine in real time is provided, comprising the steps of:
[0081] S51. Preset a threshold value of the low-load CPU occupancy rate of the virtual machine according to the type of the business virtual machine.
[0082] S52. The virtual machine monitor 3 sets a timer interrupt cycle. Preferably, the interrupt cycle may be 1ms-10ms, and registers a callback function in the timer interrupt to perform CPU usage counting.
[0083] S53. In the callback function, the virtual machine monitor 3 counts the total dot count and adds 1, and determines whether the current core is running the CPU of the virtual machine. If so, the virtual machine statistical count is added by 1.
[0084] S54. After the preset time, the virtual machine monitor 3 calculates the ratio of the virtual machine statistical count and the total marking count, which is the CPU occupancy rate of each core. The CPU occupancy rates of all cores are calculated and then the average is calculated, which is the CPU occupancy rate of the virtual machine within the preset time. The virtual machine monitor 3 continues to mark and count the CPU occupancy rate of the virtual machine for a continuous time. In this embodiment, the preset time is 1s and the continuous time is 10s.
[0085] Specifically, if the CPU occupancy rate continues to be higher than the upper limit, the virtual machine load is marked as high, and the resource management module controls node 2 to increase the allocated CPU resources by adjusting the resource template under the current virtual machine type. If the resource template under the current virtual machine type still cannot meet the requirements after adjustment, it is necessary to switch the virtual machine type. If the current type is computing type, it means that there is no way to increase the allocated CPU resources, then the virtual machine type cannot be switched and an alarm is generated.
[0086] If the CPU occupancy rate continues to be lower than the lower limit, the virtual machine load is marked as low, and the resource management module controls node 2 to reduce the allocated CPU resources by adjusting the resource template under the current virtual machine type. If the resource template under the current virtual machine type still cannot meet the requirements after adjustment, the virtual machine type needs to be switched. If the current type is IO type, it means that there is no way to reduce the allocated CPU resources, and the virtual machine type cannot be switched. The virtual machine monitor 3 notifies the resource management module to control node 2 and issues a warning to shut down the virtual machine.
[0087] The above-mentioned switching of the virtual machine type refers to creating a new virtual machine of the required type and migrating the business data to the newly created virtual machine of the new type.
[0088] S55. After receiving the warning for shutting down the virtual machine, the resource management module control node 2 sends a notification of the virtual machine state change, that is, sends a request to shut down the virtual machine to the service load balancing module 6.
[0089] S56. The service load balancing module 6 changes the distribution rule, no longer sends services to the virtual machine to be shut down, and migrates the services.
[0090] S57. After the service migration is completed, the service load balancing module 6 notifies the resource management module that the migration of the control node 2 is completed.
[0091] S58. After receiving the notification, the resource management module control node 2 sends a response to the virtual machine monitor 3, specifically, sends a virtual machine shutdown instruction.
[0092] S59. After receiving the response, the virtual machine monitor 3 shuts down the virtual machine and uses SST to shut down the corresponding physical core.
[0093] The above are merely embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are included in the scope of the claims of the present invention to be approved.
Claims
1. A virtual machine CPU resource management system for a cloud platform, characterized in that: include: A business configuration module, which is used to configure the required virtual machine type and memory size according to business attributes and generate a virtual machine allocation request; The resource management module control node is used to receive the virtual machine allocation request, obtain a matching physical machine through a resource remaining minimum matching algorithm according to the hardware information of the physical machines in the cluster, and generate virtual machine allocation parameters; A virtual machine monitor, which is used to receive the virtual machine allocation parameters, and is also used to use the speed selection technology SST to adjust the frequency of the corresponding physical core to meet the frequency of the virtual machine when the basic frequency of the unused physical core does not meet the frequency of the virtual machine, and then allocate it to the virtual machine, and bind the CPU of the virtual machine to the CPU of the physical machine; The system also includes a template configuration tool for configuring multiple resource templates for each virtual machine type, the resource template including the virtual machine type, CPU model, basic frequency and SST adjusted maximum frequency, and the template configuration tool is also used to transmit the resource template to the business configuration module through the resource management module control node; The virtual machine monitor counts the CPU usage of the virtual machine for a preset period of time. If the CPU usage continues to be higher than the upper limit or lower than the lower limit, the resource management module controls the node to increase or decrease the allocated CPU resources by adjusting the resource template under the current type of virtual machine.
2. The cloud platform virtual machine CPU resource management system according to claim 1, characterized in that: The virtual machine types include computing type, IO type and balanced type. The business configuration module will configure computing type virtual machines for businesses that are biased towards computing, IO type virtual machines for businesses that are biased towards IO type, and balanced type virtual machines for uncertain businesses, and all virtual machines can subsequently adjust the virtual machine type.
3. The cloud platform virtual machine CPU resource management system according to claim 2, characterized in that: The virtual machine monitor is also used to control the node to send a request to shut down the virtual machine through the resource management module when the CPU occupancy rate of the virtual machine is lower than a preset threshold; The system also includes a service load balancing module, which is used to migrate the service to other virtual machines according to the CPU resources used by the service after the resource management module control node receives the request to shut down the virtual machine, and send a response to the virtual machine monitor through the resource management module control node; The virtual machine monitor is also used to shut down the virtual machine and shut down the physical core using SST after receiving the response.
4. The cloud platform virtual machine CPU resource management system according to claim 3, characterized in that: The virtual machine monitor counts the virtual machine processes running on each core based on timed interrupts, calculates the CPU occupancy of the virtual machine in real time, and sends a virtual machine shutdown warning to the resource management module control node when the CPU occupancy is lower than a preset threshold. After receiving the virtual machine shutdown warning, the resource management module control node sends a request to the business load balancing module to shut down the virtual machine.
5. The cloud platform virtual machine CPU resource management system according to claim 4, characterized in that: The virtual machine monitor sets the timer interrupt cycle and registers a callback function in the timer interrupt to count the points. In the callback function, the virtual machine monitor adds 1 to the total count. If the current core is running the CPU of the virtual machine, the virtual machine statistics count adds 1. After the preset time, the ratio of the virtual machine statistical count and the total dot count is calculated, which is the CPU occupancy rate of each core; the CPU occupancy rates of all cores are averaged, which is the CPU occupancy rate of the virtual machine within the preset time, where the preset time includes multiple interrupt cycles.
6. The cloud platform virtual machine CPU resource management system according to claim 5, characterized in that: If the current type of resource template cannot meet the requirements, the virtual machine type will be switched. If the current type is computing type and the allocated CPU resources cannot be increased, the switch cannot be made and an alarm will be generated. If the current type is IO type and the allocated CPU resources cannot be reduced, the switch cannot be made. The virtual machine monitor notifies the resource management module to control the node and issues an alert to shut down the virtual machine.
7. The cloud platform virtual machine CPU resource management system according to claim 1, characterized in that: The system also includes multiple resource management module agent nodes, which are deployed on each physical machine respectively, and are used to report the physical machine hardware information to the resource management module control node, including CPU model, frequency, number of CPUs and memory size of the physical machine.
8. The cloud platform virtual machine CPU resource management system according to claim 7, characterized in that: The resource management module control node obtains a matching physical machine through a resource remaining minimum matching algorithm according to the hardware information of the physical machines in the cluster, including: The resource management module control node calculates the maximum frequency MAX_HZ of a single CPU of each physical machine, the total remaining physical frequency TOTAL_HZ, and the remaining memory TOTAL_MEM according to the physical machine hardware information, and generates a resource table by sorting the MAX_HZ, TOTAL_HZ, and TOTAL_MEM triples; The resource management module control node parses the service type according to the virtual machine allocation request and selects the required minimum CPU frequency MIN_HZ; parses the CPU requirement number N, calculates the minimum total CPU frequency MIN_TOTAL, parses the memory field as the minimum memory MIN_MEM, and generates the resource requirement triple MIN_HZ, MIN_TOTAL, MIN_MEM; Traverse the resource table according to the resource requirement triples, find the minimum matching MAX_HZ, TOTAL_HZ, TOTAL_MEM triples in turn, and the corresponding physical machine is the matching physical machine.
9. The cloud platform virtual machine CPU resource management system according to claim 8, characterized in that: Traverse the resource table according to the resource requirement triples and find the minimum matching MAX_HZ, TOTAL_HZ, and TOTAL_MEM triples in turn, including: First, find the minimum matching MAX_HZ, select the minimum matching TOTAL_HZ in the resource table that meets the conditions, and then traverse to find the minimum matching TOTAL_MEM; If there is no TOTAL_MEM that matches, backtrack to find the next best matching TOTAL_HZ, and then find the TOTAL_MEM that meets the conditions; If all TOTAL_HZ and TOTAL_MEM in the same MAX_HZ do not match, continue to backtrack forward, find the second best matching MAX_HZ, and traverse again.
10. A method for managing CPU resources of a virtual machine on a cloud platform based on the system of any one of claims 1 to 9, characterized in that: Includes steps: The business configuration module configures the required virtual machine type and memory size according to the business attributes, and generates a virtual machine allocation request to the resource management module control node; The resource management module control node obtains matching physical machines based on the hardware information of the physical machines in the cluster through the resource remaining minimum matching algorithm, and generates virtual machine allocation parameters and sends them to the virtual machine monitor; When the base frequency of the unused physical core does not meet the frequency of the virtual machine, the virtual machine monitor uses SST to adjust the frequency of the corresponding physical core until it meets the frequency and then allocates it to the virtual machine, and binds the CPU of the virtual machine to the CPU of the physical machine.
Citation Information
Patent Citations
Load balancing method and device
CN106445629A
OpenStack cloud platform resource dynamic scheduling system and method based on flow affinity
CN106534318A