CPU service quality control method and device of virtual machine

Through real-time monitoring and dynamic adjustment of the virtual machine quantity coefficient and CPU service quality parameters, the problem that the existing technology cannot effectively control the virtual machine CPU service quality, and realizes the virtual machine granularity CPU service quality control and dynamic resource adjustment.

CN119806722APending Publication Date: 2025-04-11CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411774703.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The existing CPU service quality control method cannot effectively ensure the CPU service quality of virtual machines with the same level, especially when the host CPU resource competition.

Method used

By monitoring the host's CPU load or CPU usage in real time, determine whether it meets the CPU configuration requirements. If it does not meet, the virtual machine quantity coefficient will be recalculated and the low-level virtual machines will be migrated to other hosts, and the CPU quality of service parameters will be dynamically adjusted to achieve CPU service quality control of the virtual machine granularity.

Benefits of technology

It realizes granularity-level CPU service quality control for virtual machines, ensures that high-level virtual machines obtain more CPU resources when competition for CPU resources, supports multiple application scenarios, and dynamic adjustment of CPU service quality through dynamic monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806722A_ABST
    Figure CN119806722A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of cloud computing, and discloses a CPU (Central Processing Unit) service quality control method for a virtual machine, which comprises the following steps of: acquiring a CPU load or a CPU utilization rate of a host machine; judging whether the CPU load or the CPU utilization rate of the host machine meets the CPU configuration requirement or not; if the CPU load and the CPU utilization rate of the host machine do not meet the CPU configuration requirements, recalculating the number coefficient of the virtual machines and migrating the low-level virtual machines to other host machines; based on the recalculated virtual machine number coefficient, CPU service quality parameters are calculated, and the CPU service quality parameters are used for configuring the CPU service quality level. According to the method, whether the CPU load or the CPU utilization rate of the host machine meets the CPU configuration requirement or not is judged in real time, and when the CPU load or the CPU utilization rate does not meet the CPU configuration requirement, the number coefficient of the virtual machines is recalculated, and the CPU service quality level is reconfigured, so that CPU service quality control of the granularity of the virtual machines is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cloud computing, and in particular to a method and device for controlling CPU service quality of a virtual machine. Background Art

[0002] The CPU quality of service of a virtual machine is used to ensure the CPU resource allocation of the virtual machine and isolate the CPU resources of the virtual machines from each other due to different services. The CPU quality of service of the virtual machine can meet the requirements of different services for the computing performance of the virtual machine, maximize resource reuse, and reduce costs.

[0003] In OpenStack, the quality of service parameters are configured through the specifications of the virtual machine, and are statically configured. It is necessary to plan the specifications of various virtual machines in advance according to the quality of service levels. For those who are not familiar with the use of parameters, the configuration is very difficult. In addition, the CPU quality of service is configured by the specifications of the virtual machine, which cannot achieve CPU quality of service control at the virtual machine granularity. In other words, if you want to modify the CPU quality of service of a virtual machine, you need to rebuild the specifications of a new virtual machine. The virtual machine must use the new virtual machine specifications by adjusting the instance's vCPU, memory, and disk resources. This adjustment method is relatively costly. On the one hand, the virtual machine must be rescheduled, and on the other hand, the number of flavors will increase.

[0004] When multiple virtual machines on the same host machine compete for CPU resources and CPU resource utilization has reached an upper limit, existing CPU quality of service methods cannot guarantee the CPU quality of service of virtual machines with the same level. Summary of the invention

[0005] In view of this, the present invention provides a method and device for controlling the CPU service quality of a virtual machine to solve the problem that the existing CPU service quality method cannot guarantee the CPU service quality of virtual machines with the same level.

[0006] In a first aspect, the present invention provides a method for controlling the CPU service quality of a virtual machine, comprising: obtaining the CPU load or CPU usage of a host machine; determining whether the CPU load or CPU usage of a host machine meets the CPU configuration requirements; if the CPU load and CPU usage of a host machine do not meet the CPU configuration requirements, recalculating the virtual machine quantity coefficient and migrating low-level virtual machines to other host machines; and calculating CPU service quality parameters based on the recalculated virtual machine quantity coefficient, wherein the CPU service quality parameters are used to configure the CPU service quality level.

[0007] The present invention determines in real time whether the host machine CPU load or CPU usage rate meets the CPU configuration requirements. When it does not meet the CPU configuration requirements, the virtual machine quantity coefficient is recalculated and the CPU service quality level is reconfigured, thereby realizing CPU service quality control at the virtual machine granularity. When competition occurs for the CPU resources of the host machine, high-level virtual machines will obtain more CPU resources. By providing a concise configuration method, CPU service quality control parameters and parameter application logic are added to the virtual machine to support a variety of application scenarios, and by monitoring the CPU service quality status, dynamic control of the CPU service quality is realized.

[0008] In an optional implementation, before obtaining the host CPU load or CPU usage, the initial CPU service quality level is calculated. The process of calculating the initial CPU service quality level includes: planning the CPU service quality level; and calculating the CPU service quality parameters based on the CPU service quality level.

[0009] In an optional implementation, the process of calculating CPU service quality parameters based on the CPU service quality level includes: determining whether the virtual machine has set the CPU service quality; when the virtual machine has set the CPU service quality, identifying the CPU service quality level based on the CPU service quality level; when the virtual machine has not set the CPU service quality, identifying the CPU service quality level as the default level; calculating the CPU service quality parameters based on the identified CPU service quality level; and calculating the CPU service quality parameters according to the CPU service quality parameters.

[0010] In an optional embodiment, the process of determining whether the host CPU load or CPU usage meets the CPU configuration requirements includes: determining whether the host CPU load or the host CPU usage is greater than a first preset threshold, and determining whether the host CPU load or the host CPU usage is greater than a second preset threshold, and the first preset threshold is less than the second preset threshold.

[0011] In an optional implementation, when the host machine CPU load or CPU usage reaches the second preset threshold, the virtual machine quantity coefficient is recalculated and low-level virtual machines are migrated to other host machines.

[0012] In an optional implementation, the CPU service quality parameters include: a CPU resource share parameter, a CPU resource reservation parameter, and a CPU resource limit parameter.

[0013] In a second aspect, the present invention provides a CPU service quality control device, comprising: an acquisition module for acquiring a host machine CPU load or CPU usage; a judgment module for judging whether the host machine CPU load or CPU usage meets the CPU configuration requirements; a first calculation module for recalculating a virtual machine quantity coefficient if the host machine CPU load and CPU usage do not meet the CPU configuration requirements, or recalculating a virtual machine quantity coefficient and migrating low-level virtual machines to other host machines; a second calculation module for calculating a CPU service quality parameter based on the recalculated virtual machine quantity coefficient, and the CPU service quality parameter is used to configure the CPU service quality level.

[0014] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the CPU service quality control method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0015] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the CPU service quality control method of the first aspect or any corresponding embodiment thereof.

[0016] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the CPU service quality control method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 is a flow chart of a method for controlling CPU quality of service of a virtual machine according to an embodiment of the present invention;

[0019] Figure 2 is a flow chart of another method for controlling CPU quality of service of a virtual machine according to an embodiment of the present invention;

[0020] Figure 3 is a flow chart of a CPU service quality control method for another virtual machine according to an embodiment of the present invention;

[0021] Figure 4is a structural block diagram of a CPU service quality control device for a virtual machine according to an embodiment of the present invention;

[0022] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0024] According to an embodiment of the present invention, an embodiment of a method for controlling the CPU service quality of a virtual machine is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0025] In this embodiment, a method for controlling the CPU service quality of a virtual machine is provided, such as Figure 1 As shown, including:

[0026] Step S11: Obtain the CPU load or CPU usage of the host machine.

[0027] Step S12: Determine whether the host machine CPU load or CPU usage meets the CPU configuration requirements.

[0028] Specifically, a CPU service quality monitor is deployed on the host machine, and the CPU service quality monitor monitors the number of virtual machines, CPU load and CPU utilization of the host machine. If the CPU load and CPU utilization do not meet the CPU configuration requirements, the CPU service quality level needs to be reconfigured.

[0029] Step S13: If the host machine CPU load and CPU usage do not meet the CPU configuration requirements, recalculate the virtual machine quantity coefficient and migrate low-level virtual machines to other host machines.

[0030] Specifically, if the CPU load or CPU usage of the host machine does not meet the CPU configuration requirements, it is necessary to notify the virtual machine management and control component to migrate the low-level virtual machines to other host machines according to the CPU service quality level of the virtual machines.

[0031] Step S14: Calculate a CPU service quality parameter based on the recalculated virtual machine quantity coefficient, where the CPU service quality parameter is used to configure the CPU service quality level.

[0032] This embodiment implements CPU service quality control at the virtual machine level. Specifically, when competition arises for the CPU resources of the host machine, high-level virtual machines will obtain more CPU resources. A concise configuration method is provided to add CPU service quality control parameters and parameter application logic to the virtual machines to support a variety of application scenarios. Dynamic control of the CPU service quality is achieved by monitoring the CPU service quality status.

[0033] In some optional implementations, before obtaining the host CPU load or CPU usage, the initial CPU service quality level is calculated. The process of calculating the initial CPU service quality level includes: planning the CPU service quality level; and calculating the CPU service quality parameters based on the CPU service quality level.

[0034] Specifically, when using a virtual machine, you can specify the corresponding CPU service quality based on the CPU performance requirements of the business that the virtual machine is expected to deploy. Different CPU service qualities represent different computing capabilities of the virtual machine. In order to ensure the service quality of the virtual machine, in OpenStack, there are 3 parameters to control the CPU service quality parameters of the virtual machine:

[0035] CPU resource share parameters: CPU share defines the proportion of computing resources allocated to multiple virtual machines when competing for physical CPU resources;

[0036] CPU resource reservation parameters: CPU reservation defines the minimum computing resources allocated when multiple virtual machines compete for physical CPU resources;

[0037] CPU resource limit parameter: controls the upper limit of the physical CPU resources occupied by the virtual machine.

[0038] Specifically, before configuring the CPU service quality level, the CPU service quality level is set, for example, to level 0, 1, 2, 3, 4, 5. The larger the number, the higher the level. Level 0 is the lowest level and the default level. When the CPU service quality level of the virtual machine is not configured, the CPU service quality level parameter of the virtual machine is this value.

[0039] In some optional embodiments, such as Figure 2 As shown in FIG. 1 , the process of calculating the CPU service quality parameter based on the CPU service quality level includes:

[0040] Step S21: Determine whether the virtual machine sets the CPU service quality;

[0041] Step S22: When the CPU quality of service has been set for the virtual machine, the CPU quality of service level is identified based on the CPU quality of service level; when the CPU quality of service has not been set for the virtual machine, the CPU quality of service level is identified as a default level.

[0042] Step S23: Calculate the CPU service quality parameter based on the identified CPU service quality level.

[0043] Step S24: Calculate the CPU service quality parameter according to the CPU service quality parameter.

[0044] Specifically, when the CPU service quality level of the virtual machine is not configured, the CPU service quality level parameter of the virtual machine is level 0, wherein the CPU service quality parameter of step S24 is updated by updating the CPU service quality level interface during the use of the virtual machine.

[0045] Specifically, the CPU service quality parameter is calculated as follows:

[0046] The CPU resource share parameter is calculated using the following formula:

[0047] Qs=(cpu*1024)*(qos_cpu*c*100+1)(1)

[0048] The CPU resource reservation parameter is calculated using the following formula:

[0049] Q min =(cpu*hz)*(qos_cpu+1) / (c*qos_cpu)(2)

[0050] The CPU resource limit parameter is calculated using the following formula:

[0051] Q max =cpu*hz*(qos_cpu+1) / qos_cpu(3)

[0052] Among them, Q s Indicates the CPU resource share parameter; Q min Indicates CPU resource reservation parameters; Q max Indicates the CPU resource limit parameter; cpu indicates the number of CPUs allocated to the virtual machine; qos_cpu indicates the CPU service quality level; hz indicates the main frequency of the physical CPU; c indicates the coefficient of the number of virtual machines on the host machine, which is a dynamic value.

[0053] When configuring the CPU service quality level, Q s Represents the share of CPU resources used by the virtual machine. When there is competition for CPU resources, CPU resources are allocated based on the share ratio. minIt is the minimum CPU resource usage guarantee, which ensures that the virtual machine can obtain at least the CPU resources. max The CPU resource usage limit is set to the value that limits the CPU resources that a virtual machine can obtain.

[0054] When configuring the CPU service quality level, Q s Can be used alone or in combination with Q min and Q max Use together, specifically divided into the following situations:

[0055] (1) If Q s When the physical CPU resources are insufficient, the virtual machine's use of CPU resources is controlled by Q s Allocate CPU resources according to the share.

[0056] (2) If Q s Combined with Q min and Q max When used together, Q s It does not affect the competition among virtual machines for CPU resources. At this time, the upper limit of CPU resource usage by virtual machines is limited by Q max When physical CPU resources are insufficient, the use of CPU resources by virtual machines is controlled by Q s and Q max influence, take the smallest of the two. s The CPU computing power occupied in the overall CPU resource share exceeds Q max , then the upper limit of CPU resource usage of the virtual machine is Q max Set value, otherwise it is Q s The CPU computing power value occupied in the overall CPU resource share. min Ensure the minimum CPU resources that can be used by the virtual machine.

[0057] In some optional embodiments, the process of determining whether the host CPU load or CPU usage meets the CPU configuration requirements includes: determining whether the host CPU load or the host CPU usage is greater than a first preset threshold, and determining whether the host CPU load or the host CPU usage is greater than a second preset threshold; the first preset threshold is less than the second preset threshold.

[0058] Optionally, when the host machine CPU load or CPU usage is greater than a first preset threshold, and when the host machine CPU load or CPU usage reaches a second preset threshold, the host machine CPU load and CPU usage do not meet the CPU configuration requirements.

[0059] Optionally, when the CPU load or CPU usage of the host machine reaches the second preset threshold, the virtual machine quantity coefficient is recalculated and low-level virtual machines are migrated to other host machines.

[0060] Specifically, if the CPU load or CPU usage of the host machine is very high and reaches the CPU service quality adjustment threshold M1, the virtual machine quantity coefficient c is recalculated according to the number of virtual machines.

[0061] c=(round(vms / C)+1)*C(4)

[0062] Where vms is the number of virtual machines, C is a constant, and the CPU service quality monitor uses the newly calculated number of virtual machines, c, to calculate Q s and Q min Re-adjust the CPU quality of service configuration of the virtual machine.

[0063] If the CPU load or CPU usage of the host machine is very high, exceeding the first preset threshold M1 and reaching the second preset threshold M2, in addition to recalculating the virtual machine data coefficient c according to the above calculation method, the CPU service quality monitor also notifies the virtual machine control component to migrate the low-level virtual machine to other hosts according to the CPU service quality level of the virtual machine. The M1 and M2 values ​​need to be set in combination with the actual business.

[0064] In this embodiment, a CPU service quality control device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0065] Specifically, the overall flow chart of the CPU service quality control method of this embodiment is as follows: Figure 3 As shown, Figure 3 In the configurable CPU QoS level according to the granularity of the virtual machine, the CPU QoS level of the virtual machine can be set and changed at any time. For example, when creating a virtual machine, the CPU QoS level parameters are passed in the creation parameters; during the use of the virtual machine, they are updated through the CPU QoS level update interface. The CPU QoS parameters are saved in the database together with other parameters of the virtual machine. When the virtual machine is started, the parameters are obtained from the database and calculated together with the CPU main frequency of the host machine, the number of virtual machines on the current host machine, and other parameters to generate the CPU QoS parameters actually used at the bottom layer for the virtual machine to run.

[0066] This embodiment provides a CPU service quality control device, such as Figure 4 As shown, including:

[0067] The acquisition module is used to obtain the CPU load or CPU usage of the host;

[0068] A judgment module is used to judge whether the CPU load or CPU usage of the host machine meets the CPU configuration requirements;

[0069] The first calculation module is used to migrate low-level virtual machines to other host machines and recalculate the virtual machine quantity coefficient if the host machine CPU load and CPU usage do not meet the CPU configuration requirements;

[0070] The second calculation module is used to calculate the CPU service quality parameter based on the recalculated virtual machine quantity coefficient, and the CPU service quality parameter is used to configure the CPU service quality level.

[0071] In some optional implementations, the CPU service quality control device further includes:

[0072] The initial configuration module is used to calculate the initial level of CPU service quality before obtaining the CPU load or CPU usage of the host machine, which is the process of calculating the initial level of CPU service quality.

[0073] The process of calculating the initial CPU service quality level includes: planning the CPU service quality level; and calculating the CPU service quality parameters based on the CPU service quality level.

[0074] In some optional implementations, the process of calculating the CPU quality of service parameter based on the CPU quality of service level includes:

[0075] Determine whether the virtual machine has set the CPU service quality; when the virtual machine has set the CPU service quality, identify the CPU service quality level based on the CPU service quality level; when the virtual machine has not set the CPU service quality, identify the CPU service quality level as a default level; calculate the CPU service quality parameters based on the identified CPU service quality level; calculate the CPU service quality parameters according to the CPU service quality parameters.

[0076] In some optional implementations, the process of determining whether the CPU load or CPU usage of the host machine meets the CPU configuration requirements includes:

[0077] Determine whether the host CPU load or the host CPU usage is greater than a first preset threshold, and determine whether the host CPU load or the host CPU usage reaches a second preset threshold; the first preset threshold is less than the second preset threshold.

[0078] In some optional implementations, when the host machine CPU load or CPU usage reaches the second preset threshold, the virtual machine quantity coefficient is recalculated and low-level virtual machines are migrated to other host machines.

[0079] In some optional implementations, the CPU service quality parameters include: CPU resource share parameters, CPU resource reservation parameters, and CPU resource limit parameters.

[0080] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0081] The service quality control device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0082] An embodiment of the present invention further provides a computer device having the above-mentioned CPU service quality control device.

[0083] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0084] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0085] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0086] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0087] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0088] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0089] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0090] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0091] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for controlling CPU service quality of a virtual machine, characterized in that: include: Get the host CPU load or CPU usage; Determine whether the CPU load or CPU usage of the host machine meets the CPU configuration requirements; If the CPU load and CPU usage of the host machine do not meet the CPU configuration requirements, recalculate the virtual machine quantity coefficient and migrate low-level virtual machines to other host machines; Based on the recalculated virtual machine quantity coefficient, a CPU service quality parameter is calculated, where the CPU service quality parameter is used to configure the CPU service quality level.

2. The method for controlling the CPU quality of service of a virtual machine according to claim 1, characterized in that: Before obtaining the CPU load or CPU usage of the host machine, the initial CPU service quality level is calculated. The process of calculating the initial CPU service quality level includes: Plan the CPU service quality level; Based on the CPU quality of service level, a CPU quality of service parameter is calculated.

3. The method for controlling the CPU quality of service of a virtual machine according to claim 2, characterized in that: The process of calculating the CPU quality of service parameter based on the CPU quality of service level includes: Determine whether the virtual machine has set CPU service quality; When the CPU quality of service has been set for the virtual machine, the CPU quality of service level is identified based on the CPU quality of service level; when the CPU quality of service has not been set for the virtual machine, the CPU quality of service level is identified as a default level; Calculate CPU service quality parameters based on the identified CPU service quality level; A CPU quality of service parameter is calculated according to the CPU quality of service parameter.

4. The method for controlling the CPU quality of service of a virtual machine according to claim 1, characterized in that: The process of determining whether the host machine CPU load or CPU usage meets the CPU configuration requirements includes: Determine whether the host CPU load or the host CPU usage is greater than a first preset threshold, and determine whether the host CPU load or the host CPU usage reaches a second preset threshold; The first preset threshold is smaller than the second preset threshold.

5. The method for controlling the CPU quality of service of a virtual machine according to claim 4, characterized in that: When the host machine CPU load or CPU usage reaches the second preset threshold, the virtual machine quantity coefficient is recalculated and low-level virtual machines are migrated to other host machines.

6. The method for controlling the CPU quality of service of a virtual machine according to claim 1, characterized in that: The CPU service quality parameters include: CPU resource share parameters, CPU resource reservation parameters, and CPU resource limit parameters.

7. A CPU service quality control device, characterized in that: include: The acquisition module is used to obtain the CPU load or CPU usage of the host; A judgment module, used to judge whether the CPU load or CPU usage of the host machine meets the CPU configuration requirements; A first calculation module, configured to recalculate the virtual machine quantity coefficient and migrate low-level virtual machines to other host machines if the host machine CPU load and CPU usage do not meet the CPU configuration requirements; The second calculation module is used to calculate a CPU service quality parameter based on the recalculated virtual machine quantity coefficient, and the CPU service quality parameter is used to configure the CPU service quality level.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the CPU service quality control method of the virtual machine described in any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the CPU service quality control method for a virtual machine according to any one of claims 1 to 6.

10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the CPU service quality control method of a virtual machine according to any one of claims 1 to 6.