Virtual Machine Operation Control Method, Device, Equipment and Medium
By dynamically migrating virtual machines to processors with higher single-core turbo frequencies based on processor usage and sleep power consumption, the method addresses underutilization and enhances VM performance and resource utilization.
Patent Information
- Application Number
- CN202310731722.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-19
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2043-06-19
AI Technical Summary
In the prior art, the performance of virtual machine processors created on physical machines is not high, resulting in low resource utilization and inability to fully utilize the processor's high turbo frequency capabilities.
By monitoring the processor usage on the physical machine, when the threshold is exceeded, the virtual machine is migrated to an idle processor with high turbo frequency capability for turbo frequency processing, and the processor's resource utilization is improved.
It achieves improvement of virtual machine performance and efficient utilization of processor resources, ensuring that the processor can still operate at high performance under high load conditions.
Smart Images

Figure CN116755840B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technologies, and in particular, to a method, apparatus, device, and medium for controlling the operation of a virtual machine. Background Art
[0002] A processor (Central Processing Unit, CPU) usually provides a turbo frequency capability, which supports the actual operating frequency of the processor to be greater than its base frequency. For example, when the base frequency of the processor is 2.x GHz, the turbo frequency capability can enable it to run at 3.x GHz. Among them, the turbo frequency capability can include single-core turbo frequency and all-core turbo frequency. A processor is generally a multi-core processor composed of one main core and several secondary cores. The single-core turbo frequency refers to the operating frequency that a single core can reach, and the all-core turbo frequency refers to the operating frequency that the processor can reach when all cores are running. Limited by the thermal design power consumption and the number of cores of the processor, usually the all-core turbo frequency is lower than the single-core turbo frequency. For example, even if the single-core turbo frequency has the ability to reach 3.8 GHz (in a specific scenario), the all-core turbo frequency may only reach 3.1 GHz.
[0003] In the related art, when creating a processor corresponding to a virtual machine for a user on a physical machine, the maximum frequency of the processor is limited to a relatively small turbo frequency, such as limited to the all-core turbo frequency, resulting in low performance of the processor.
[0004] However, the operating states of the processors corresponding to the virtual machines on different physical machines are different, and the processor load utilization rates are some high and some low. Therefore, it is necessary to provide a high-performance virtual machine created based on a processor with a higher turbo frequency capability to improve the performance of the virtual machine processor and make full use of the processing resources. Summary of the Invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, apparatus, device, and medium for controlling the operation of a virtual machine, which improves the performance of the virtual machine and the resource utilization rate of the processor.
[0006] An embodiment of the present disclosure provides a virtual machine operation control method, and the method includes: in response to a creation request of a target virtual machine, creating the target virtual machine based on at least one processor on a first physical machine in a server cluster, wherein an upper limit of a running frequency of a processor of the target virtual machine is set to a target frequency; monitoring a usage rate of a running processor on the first physical machine, and when the usage rate of the processor of the first physical machine exceeds the preset threshold, selecting a second physical machine that meets a preset switching condition from the server cluster according to a sleep level corresponding to an idle processor on other physical machines in the server cluster, wherein the preset switching condition is that a sleep power consumption corresponding to an idle processor on the physical machine meets a preset heat release index, and the heat release index reflects a turbo frequency ability for a running processor; migrating the target virtual machine from the first physical machine to the second physical machine, and performing turbo frequency processing on a running processor on the target virtual machine based on the target frequency.
[0007] An embodiment of the present disclosure further provides a virtual machine operation control device, and the device includes:
[0008] a creation module, configured to create the target virtual machine based on at least one processor on a first physical machine in a server cluster in response to a creation request of the target virtual machine, wherein an upper limit of a running frequency of a processor of the target virtual machine is set to a target frequency; a monitoring module, configured to monitor a usage rate of a running processor on the first physical machine; a determination module, configured to, when the usage rate of the processor of the first physical machine exceeds the preset threshold, select a second physical machine that meets a preset switching condition from the server cluster according to a sleep level corresponding to an idle processor on other physical machines in the server cluster, wherein the preset switching condition is that a sleep power consumption corresponding to an idle processor on the physical machine meets a preset heat release index, and the heat release index reflects a turbo frequency ability for a running processor; a processing module, configured to migrate the target virtual machine from the first physical machine to the second physical machine, and perform turbo frequency processing on a running processor on the target virtual machine based on the target frequency.
[0009] An embodiment of the present disclosure further provides an electronic device, and the electronic device includes: a processor; a memory for storing executable instructions of the processor; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the virtual machine operation control method provided by the embodiment of the present disclosure.
[0010] An embodiment of the present disclosure further provides a computer-readable storage medium, and the storage medium stores a computer program, and the computer program is used to execute the virtual machine operation control method provided by the embodiment of the present disclosure.
[0011] The technical solution provided by the embodiments of the present disclosure has the following advantages compared with the prior art:
[0012] In the virtual machine operation control solution provided by the embodiments of the present disclosure, in response to a creation request of a target virtual machine, the target virtual machine is created based on at least one processor on a first physical machine in a server cluster, wherein the upper limit of the operating frequency of the processor of the target virtual machine is set to a target frequency. Furthermore, the utilization rate of the processors in the running state on the first physical machine is monitored. When it is known that the utilization rate of the processors on the first physical machine exceeds a preset threshold, then according to the sleep levels corresponding to the processors in the idle state on other physical machines in the server cluster, a second physical machine that meets the preset switching condition is selected from the server cluster, where the preset switching condition is that the sleep power consumption corresponding to the processors in the idle state on the physical machine meets a preset heat release index, and the heat release index reflects the ability to perform turbo frequency on the processors in the running state. The target virtual machine is migrated from the first physical machine to the second physical machine, and the processors in the running state on the target virtual machine are turbo boosted based on the target frequency. In this technical solution, the performance of the virtual machine can be improved, and the resource utilization rate of the processors can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages and aspects of the embodiments of the present disclosure will become more obvious. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic, and the original components and elements are not necessarily drawn to scale.
[0014] Figure 1 It is a flowchart of a virtual machine operation control method provided by an embodiment of the present disclosure;
[0015] Figure 2 It is a schematic diagram of the architecture of a server cluster provided by an embodiment of the present disclosure;
[0016] Figure 3 It is a flowchart of another virtual machine operation control method provided by an embodiment of the present disclosure;
[0017] Figure 4 It is a flowchart of another virtual machine operation control method provided by an embodiment of the present disclosure;
[0018] Figure 5 It is a schematic diagram of the structure of a virtual machine operation control device provided by an embodiment of the present disclosure;
[0019] Figure 6 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0020] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Instead, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.
[0021] It should be understood that the various steps described in the method embodiments of the present disclosure can be executed in different orders and / or executed in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.
[0022] As used herein, the term "including" and its variations are open-ended, that is, "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0023] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of functions executed by these devices, modules or units or their interdependent relationships.
[0024] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".
[0025] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.
[0026] To solve the above problems, embodiments of the present disclosure provide a method for controlling the operation of virtual machines. In this method, according to the operating states of the processors corresponding to the virtual machines on a physical machine, processors with high turbo frequency capabilities are determined, and high-performance virtual machines are created based on these processors, so as to make full use of the processing resources of the processors and improve the performance of the processors corresponding to the virtual machines.
[0027] The method will be introduced below in combination with specific embodiments.
[0028] Figure 1Schematic flowchart of a virtual machine operation control method provided by an embodiment of the present disclosure. This method can be executed by a virtual machine operation control device, which can be implemented by software and / or hardware and is generally integrated in an electronic device. As Figure 1 shown, the method includes:
[0029] Step 101, in response to a creation request for a target virtual machine, create the target virtual machine based on at least one processor on a first physical machine in a server cluster, where the upper limit of the operating frequency of the processor of the target virtual machine is set to a target frequency.
[0030] Among them, as Figure 2 shown, a server cluster can be understood as a cloud platform, etc. A server cluster can include multiple physical machines. Multiple virtual machines can be created in each physical machine. Multiple processors can be included in each virtual machine, and each processor can be a multi-core processor, etc.
[0031] In an embodiment of the present disclosure, obtain a creation request for a target virtual machine. This creation requirement can be initiated by a client according to the requirement. In response to the creation request for the target virtual machine, create the target virtual machine based on at least one processor on a first physical machine in a server cluster, where the upper limit of the operating frequency of the processor of the target virtual machine is set to a target frequency. This target frequency can be understood as a relatively high turbo frequency, for example, the single-core turbo frequency that can be achieved by a single core.
[0032] In some possible embodiments, receive a creation request for a virtual machine, where the creation request includes the number of processors and the type of processor performance. The type of processor performance can include the type corresponding to the upper limit of the operating frequency of the processor corresponding to the virtual machine. For example, the type of processor performance can include the base frequency type, single-core turbo frequency, all-core turbo frequency, etc.
[0033] In the actual execution process, the type of processor performance can have different identification methods. For example, it can be a text identification, a digital identification, etc. In this embodiment, determine whether the type of processor performance is a target type, where the target type indicates that the upper limit of the operating frequency of the processor corresponding to the virtual machine to be configured is set to a target frequency, that is, the target type indicates that the operating frequency of the processor can reach a relatively high turbo frequency at most. For example, it can reach the single-core turbo frequency, etc. Thus, select processors matching the number of processors on the first physical machine and create the corresponding high-performance target virtual machine.
[0034] Step 102, monitor the utilization rate of the processors in the first physical machine that are in the running state. When the utilization rate of the processors in the first physical machine exceeds a preset threshold, select a second physical machine that meets the preset switching condition from the server cluster according to the sleep levels corresponding to the processors in the idle state on other physical machines in the server cluster. The preset switching condition is that the sleep power consumption corresponding to the processors in the idle state on the physical machine meets a preset heat release index, and the heat release index reflects the turbo frequency ability of the processors in the running state.
[0035] It is not difficult to understand that even if the upper limit of the running frequency of the target virtual machine is set to the target frequency, it does not mean that the processor has the running condition of the target frequency. Therefore, in order to ensure the full utilization of the processor resources of the processor, in an embodiment of the present disclosure, the utilization rate of the processors in the running state on the first physical machine in the server cluster is also monitored, and the utilization rate is compared with a preset threshold, so as to determine whether the target virtual machine has the condition of running according to the target frequency according to the comparison result.
[0036] In an embodiment of the present disclosure, if it is known that the utilization rate of the processors in the first physical machine exceeds the preset threshold, it indicates that the first physical machine may be highly loaded, and the running resources on the first physical machine may not support the target virtual machine to run at the target frequency, and the processors in the running state on the first physical machine do not have the turbo frequency ability. Therefore, obtain the sleep levels corresponding to the processors in the idle state on other physical machines in the server cluster. The sleep level is used to identify the wake-up time of the corresponding processor from the sleep state to the running state. The higher the sleep level, the longer the wake-up time of the processor from the sleep state to the running state, and the lower the corresponding sleep power consumption. For example, the higher the sleep level of the processors in the idle state on other physical machines, the lower the running resources (sleep power consumption) it occupies. Therefore, in this embodiment, a second physical machine that meets the preset switching condition can also be determined in the server cluster according to the sleep level. The preset switching condition is that the sleep power consumption corresponding to the processors in the idle state on the physical machine meets a preset heat release index, and the heat release index reflects the turbo frequency ability of the processors in the running state, that is, it can support the target processor to run at the target frequency on the second physical machine, etc.
[0037] It should be noted that in different application scenarios, the methods for obtaining the sleep levels corresponding to the processors in the idle state on other physical machines are different. The examples are as follows:
[0038] In some possible examples, after creating a virtual machine corresponding to a processor on a physical machine, report to the virtual machine the candidate sleep levels that can be supported when the processor is in an idle state. Among them, the model of the processor can be identified through relevant driver components, and the candidate sleep levels that can be supported can be determined by querying the preset corresponding relationship according to the model. Furthermore, receive the sleep level sent when the virtual machine on another physical machine detects that the corresponding processor is in an idle state. The sleep level is determined by the corresponding virtual machine according to the candidate sleep levels and the running services. The specific determination method can be set according to the scenario requirements and will not be listed one by one here.
[0039] Step 104, migrate the target virtual machine from the first physical machine to the second physical machine, and perform turbo frequency processing on the processors in the running state on the target virtual machine based on the target frequency.
[0040] In an embodiment of the present disclosure, since the second physical machine has the ability to perform turbo frequency on the processors in the running state, in order to ensure the high-performance operation of the target virtual machine, the target virtual machine is migrated from the first physical machine to the second physical machine, and turbo frequency processing is performed on the processors in the running state on the virtual machine based on the target frequency. Among them, the running frequency of the processor after the turbo frequency processing is relatively large, usually greater than the all-core turbo frequency. For example, it can be a single-core turbo frequency greater than the all-core turbo frequency. Thus, combining the processor utilization rate of the first physical machine and the sleep power consumption of other physical machines, when the load of the first physical machine is high, dynamic thermal migration of the target virtual machine to the second physical machine is realized, ensuring that the target virtual machine can operate with high performance and improving the utilization rate of the processing resources of the target virtual machine.
[0041] In summary, for the virtual machine operation control method in the embodiments of the present disclosure, in response to a creation request for a target virtual machine, create the target virtual machine based on at least one processor on the first physical machine in the server cluster, where the upper limit of the processor running frequency of the target virtual machine is set to the target frequency. Furthermore, monitor the utilization rate of the processors in the running state on the first physical machine. When it is known that the utilization rate of the processors on the first physical machine exceeds a preset threshold, then select a second physical machine that meets the preset switching conditions from the server cluster according to the sleep levels corresponding to the processors in the idle state on other physical machines in the server cluster. The preset switching condition is that the sleep power consumption corresponding to the processors in the idle state on the physical machine meets a preset heat release index, and the heat release index reflects the ability to perform turbo frequency on the processors in the running state. Migrate the target virtual machine from the first physical machine to the second physical machine, and perform turbo frequency processing on the processors in the running state on the target virtual machine based on the target frequency. In this technical solution, the performance of the virtual machine can be improved, and the utilization rate of the processor resources can be improved.
[0042] In one embodiment of the present disclosure, after monitoring the usage rate of the processor running on the first physical machine and comparing the usage rate of the processor with a preset threshold, if it is known that the usage rate of the processor of the first physical machine is less than the preset threshold, it indicates that the load of the first physical machine may not be large and may support maximizing the processor performance of the target virtual machine. To determine whether the processor running on the virtual machine can be turbo-boosted based on the target frequency on the first physical machine, it is also necessary to detect whether the sleep level corresponding to the processor in the idle state on the first physical machine meets the preset switching condition. The preset switching condition is that the sleep power consumption released by the processor in the idle state on the physical machine meets the heat release index, that is, further combine the sleep power consumption of the first physical machine to determine whether the first physical machine can perform turbo-boosting on the processor running on the virtual machine based on the target frequency. The heat release index reflects the turbo-boosting ability of the processor in the running state.
[0043] Further, if it is known that the sleep power consumption released by the sleep level corresponding to the processor in the idle state on the first physical machine does not meet the heat release index, it indicates that the first physical machine cannot perform turbo-boosting on the processor running on the virtual machine based on the target frequency. Therefore, it is still necessary to determine the second physical machine in the server cluster.
[0044] On the contrary, if it is known that the sleep level corresponding to the processor in the idle state on the first physical machine meets the preset switching condition, it is determined that the first physical machine can perform turbo-boosting on the processor running on the virtual machine based on the target frequency, and perform turbo-boosting on the processor running on the target virtual machine based on the target frequency.
[0045] Among them, in some possible embodiments, in order to detect whether the sleep power consumption released by the sleep level corresponding to the idle processor on the first physical machine meets the heat release index (that is, to detect whether the idle processor on the physical machine meets the preset switching conditions mentioned in the above embodiments), the setting information of the processor sleep level on the first physical machine can be obtained, that is, the setting information is stored on the first physical machine in advance. The setting information stores the sleep level information of the processor on the first physical machine. The sleep level information can be actively reported by the processor or actively obtained by the first physical machine, etc. Among them, in different application scenarios, the method of controlling the processor to enter the sleep level is different. For example, the processor (CPU in this embodiment) can be controlled to enter the sleep level through relevant drivers (the sleep level is identified by C-state in this embodiment). There are two drivers for the A model CPU to enter different C-states, namely intel_idle and acpi_idle. The intel_idle driver determines the C-state that the CPU is allowed to enter by identifying the CPU model (the kernel maintains a mapping table of C-states supported by different CPU models). Every time a new CPU is released, the kernel needs to adapt to this CPU to identify the C-state information supported by this CPU model. Considering the actual application scenario, the client generally does not upgrade the client image to the latest kernel (for compatibility and stability considerations). Therefore, the intel_idle driver cannot work properly. The acpi_idle adjusts the CPU to enter different C-states in the idle state by judging whether the ACPI table provides C-state information. Therefore, as long as the supported C-states are reported at the virtualization layer, this process does not require client intervention. For example, the Linux operating system defaults to loading the intel_idle driver first. If the intel_idle driver cannot work, the acpi_idle driver will be loaded again. Therefore, as long as one of these two drivers can work properly, the settings for the CPU to enter the C-state in the idle state can be made inside the client, etc.
[0046] After obtaining the setting information, it is judged according to the setting information whether the processor sleep level is restricted to the first sleep level. Among them, the first sleep level indicates that the processor in the running state does not have the turbo frequency ability. For example, when the preset sleep levels are divided from low to high into C1, C2, C3, C4, C5, and C6, the first sleep level can be other sleep levels except C1. If it is known that the processor sleep level is restricted to the first sleep level, it means that the corresponding processor does not have the turbo frequency ability for the processor in the running state. Thus, it is determined that the sleep level corresponding to the idle processor on the first physical machine meets the preset switching conditions.
[0047] Otherwise, if it is known that the processor sleep level is not restricted to the first sleep level, for example, the processor sleep level is restricted to the C1 level, then obtain the sleep level corresponding to the processor in the idle state on the first physical machine, obtain the correspondence between the preset sleep level and the sleep power consumption, and determine the target sleep level to be detected and the corresponding proportion threshold according to the correspondence between the sleep level and the sleep power consumption. Among them, the target sleep level can be a deep sleep level such as C6. Among them, the power consumption corresponding to the target sleep level is relatively low. Therefore, the proportion threshold is used to limit the number of processors at the target sleep level, etc., to avoid a large sleep power consumption when the number of processors at the target sleep level is small, thereby causing the turbo frequency to not be available on the first physical machine.
[0048] In this embodiment, detect the proportion result between the processors corresponding to the target sleep level on the first physical machine and the processors in the idle state, and compare the proportion result with the proportion threshold. If the proportion result is less than the proportion threshold, it is determined that the sleep level corresponding to the processors in the idle state on the first physical machine does not meet the preset switching condition. If the proportion result is greater than or equal to the proportion threshold, it is determined that the sleep level corresponding to the processors in the idle state on the first physical machine meets the preset switching condition.
[0049] In summary, the virtual machine operation control method of the present disclosure embodiment combines the sleep power consumption released by the sleep level corresponding to the processors in the idle state on the first physical machine and the utilization rate of the processors on the first physical machine to determine whether the processors in the running state on the target virtual machine have the turbo frequency processing ability. When the processors in the running state on the target virtual machine have the turbo frequency processing ability, perform turbo frequency processing on the processors in the running state on the target virtual machine, which improves the utilization rate of the processing resources of the processors in the running state on the target virtual machine.
[0050] Based on the above embodiment, in order to fully ensure that the processing resources of the processor can be utilized to a greater extent, when the turbo frequency processing of the processors in the running state on the target virtual machine is not supported on the first physical machine, the target virtual machine can also be migrated to the second physical machine for turbo frequency processing. The following specifically illustrates how to determine the second physical machine in combination with the embodiment.
[0051] In an embodiment of the present disclosure, obtain the sleep level corresponding to the processors in the idle state on other physical machines in the server cluster, and determine the second physical machine according to the sleep level:
[0052] Figure 3 It is a flowchart of the method steps for determining the second physical machine in the server cluster according to the sleep level according to an embodiment of the present disclosure. As Figure 3 shown, the method includes:
[0053] Step 301: Determine candidate physical machines in the server cluster whose processor utilization rate is less than a preset threshold.
[0054] In an embodiment of the present disclosure, to determine candidate physical machines with a processor utilization rate less than a preset threshold. Such candidate physical machines have a relatively low load as their processor utilization rate is less than the preset threshold, and they may support the turbo boost processing of the target virtual machine.
[0055] It should be noted that in different application scenarios, the methods for determining candidate physical machines in the server cluster with a processor utilization rate less than a preset threshold are different. Examples are as follows:
[0056] In some possible embodiments, the processor utilization rate corresponding to the target virtual machine in the first physical machine can be obtained, and it is detected whether the processor utilization rate corresponding to the target virtual machine is greater than a preset first threshold. Here, the first threshold is calibrated according to the scenario and is greater than the preset threshold. If it is known that the processor utilization rate corresponding to the target virtual machine is greater than the first threshold, it indicates that the utilization rate of the processor in the target virtual machine is relatively higher compared to the utilization rate corresponding to the preset threshold. Thus, if it is known that the processor utilization rate corresponding to the target virtual machine is greater than the first threshold, a second threshold is determined according to the processor utilization rate corresponding to the target virtual machine. The second threshold is less than the preset threshold, and the difference between the first threshold and the second threshold is greater than a preset threshold value. That is, when the utilization rate of the processor in the target virtual machine is relatively higher compared to the utilization rate corresponding to the preset threshold, a second threshold with a relatively lower utilization rate compared to the utilization rate corresponding to the preset threshold is determined. The processor utilization rates of other physical machines in the server cluster are compared with the preset second threshold to determine candidate physical machines whose processor utilization rates are less than the second threshold, that is, to further determine candidate physical machines with a relatively lower utilization rate compared to the utilization rate corresponding to the preset threshold of the processor.
[0057] In some possible embodiments, the processor utilization rate corresponding to the target virtual machine in the first physical machine can be obtained, the first difference between the processor utilization rate and the preset threshold is calculated, the processor utilization rates of other physical machines in the server cluster are compared with the preset threshold to determine initial candidate physical machines whose processor utilization rates are less than the preset threshold. Furthermore, the second difference between the preset threshold and the processor utilization rate of the initial candidate physical machine is calculated, the third difference between the second difference and the first difference is calculated, and the initial candidate physical machines for which the third difference is greater than the preset difference threshold are determined as the finally determined candidate physical machines.
[0058] Step 302: Obtain the sleep level corresponding to the processors in the candidate physical machines that are in the idle state.
[0059] Step 303: Select a second physical machine that meets the preset switching conditions from the server cluster according to the sleep level corresponding to the processors in the candidate physical machines that are in the idle state.
[0060] After determining the candidate physical machines, in order to further screen out the second physical machines that can support the turbo processing of the target virtual machine from the candidate physical machines, the sleep levels corresponding to the processors in the idle state on the physical machines are further obtained, so as to screen out the second physical machines that meet the preset switching conditions according to the sleep levels on the candidate physical machines. Among them, the target sleep level to be detected and the corresponding proportion threshold can be determined according to the pre-set correspondence between the sleep level and the sleep power consumption. The target sleep level can be a deep sleep level such as C6. Since the sleep power consumption corresponding to the target sleep level is relatively low, the proportion threshold corresponding to the target sleep level can be calibrated according to the scenario requirements. Detect the proportion result between the processors corresponding to the target sleep level on the candidate physical machines and the processors in the idle state. If the proportion result is greater than the proportion threshold, it indicates that the sleep power consumption of the candidate physical machines is relatively low.
[0061] On the contrary, if the proportion result is less than the proportion threshold, it indicates that the human power consumption of the candidate physical machines is relatively high. Therefore, in this embodiment, the proportion result is compared with the proportion threshold, and the target candidate physical machines are determined according to the comparison result. The proportion result corresponding to the target candidate physical machines is greater than the proportion threshold, that is, most of the processors in the idle state in the target candidate physical machines are in the target sleep level with relatively low sleep power consumption. Thus, at least one of the target candidate physical machines can be determined as the second physical machine that meets the preset switching conditions. For example, one can be randomly determined from the target candidate physical machines as the second physical machine, or multiple can be determined from the target candidate physical machines as the second physical machines, etc.
[0062] To enable those skilled in the art to more comprehensively understand the processor performance adjustment process of the present disclosure embodiments, the following will be described in conjunction with a specific embodiment. In this embodiment, the target frequency is the single-core turbo frequency and is greater than 3.1 GHz, the all-core turbo frequency is 3.1 GHz, and the target sleep level is the deep sleep level C6.
[0063] Refer to Figure 4, in this embodiment, in response to a creation request of a target virtual machine, the target virtual machine is created based on at least one processor on a first physical machine in a server cluster. Wherein, the upper limit of the operating frequency of the processor of the target virtual machine is set to a target frequency. The out-of-band monitoring component and the like are used to monitor the utilization rate of the processors in the running state on multiple physical machines (including the first physical machine and other physical machines) in the server cluster, and compare the utilization rate of the processors with a preset threshold. If it is known that the utilization rate of the processor of the first physical machine exceeds the preset threshold, the sleep level corresponding to the idle processors on other physical machines is obtained, and a second physical machine is determined in the server cluster according to the sleep level (wherein, candidate physical machines with a processor utilization rate less than the preset threshold are determined in the server cluster according to the processor utilization rate, and the second physical machine is determined from the candidate physical machines). In this embodiment, according to the correspondence between the sleep level and the sleep power consumption, the C6 level to be detected and the corresponding proportion threshold are determined, the proportion result between the processors corresponding to the C6 level and the idle processors on the candidate physical machines is detected, the proportion result is compared with the proportion threshold, and the second physical machine that meets the preset switching condition is determined according to the comparison result, that is, the second physical machine with a lower load is selected based on the above-mentioned processor utilization rate and the sleep power consumption corresponding to the idle processors, and the target virtual machine is migrated to the second physical machine with a lower load based on the live migration ability, so as to ensure that the processors in the running state in the target virtual machine can run at a non-operating frequency greater than 3.1 GHz, thereby exerting greater processing performance.
[0064] In summary, for the virtual machine operation control method of the present disclosure embodiment, when the utilization rate of the processors on the first physical machine is relatively high, a second physical machine with a lower load can be screened out from other physical machines based on the sleep power consumption, and the target virtual machine is live migrated to the second physical machine, so as to ensure that the processors in the running state of the target virtual machine can run with greater processing performance.
[0065] To implement the above embodiment, the present disclosure also proposes a virtual machine operation control device. Figure 5 FIG. is a schematic structural diagram of a virtual machine operation control device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware, and is generally integrated in an electronic device for processor performance adjustment. As Figure 5 shown, the device includes: a creation module 510, a comparison module 520, a determination module 530, and a processing module 540, wherein,
[0066] The creation module 510 is configured to, in response to a creation request of a target virtual machine, create the target virtual machine based on at least one processor on a first physical machine in a server cluster, wherein the upper limit of the operating frequency of the processor of the target virtual machine is set to a target frequency;
[0067] The monitoring module 520 is configured to monitor the usage rate of the processors in the running state on the first physical machine;
[0068] The determining module 530 is configured to, when the usage rate of the processors on the first physical machine exceeds a preset threshold, select a second physical machine that meets the preset switching condition from the server cluster according to the sleep levels corresponding to the idle processors on other physical machines in the server cluster, where the preset switching condition is that the sleep power consumption corresponding to the idle processors on the physical machine meets a preset heat release index, and the heat release index reflects the turbo frequency ability of the processors in the running state;
[0069] The processing module 540 is configured to migrate the target virtual machine from the first physical machine to the second physical machine and perform turbo frequency processing on the processors in the running state on the target virtual machine based on the target frequency.
[0070] The virtual machine operation control device provided by the embodiments of the present disclosure can execute the virtual machine operation control method provided by any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the method, which will not be elaborated here.
[0071] To implement the above embodiments, the present disclosure also proposes a computer program product, including a computer program / instructions, which when executed by a processor, implement the virtual machine operation control method in the above embodiments.
[0072] Figure 6 It is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
[0073] Specifically, refer to Figure 6 , which shows a schematic structural diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure. The electronic device 600 in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not impose any limitations on the functions and usage scopes of the embodiments of the present disclosure.
[0074] As Figure 6As shown, the electronic device 600 may include a processor (such as a processor, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a memory 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0075] Generally, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a memory 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or wireline to exchange data. Although Figure 6 the electronic device 600 with various devices is shown, it should be understood that it is not required to implement or include all the shown devices. Instead, more or fewer devices may be implemented or included.
[0076] Specifically, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 609, or installed from the memory 608, or installed from the ROM 602. When the computer program is executed by the processor 601, the above functions defined in the virtual machine operation control method of the embodiment of the present disclosure are performed.
[0077] It should be noted that the above-mentioned computer-readable medium in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection having one or more wires, 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 above. In the present disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0078] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0079] The above-mentioned computer-readable medium can be included in the above-mentioned electronic device; or it can exist separately and not be assembled into the electronic device.
[0080] The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is caused to:
[0081] In response to a creation request for a target virtual machine, the target virtual machine is created based on at least one processor on a first physical machine in a server cluster. The upper limit of the operating frequency of the processor of the target virtual machine is set to a target frequency. Further, the utilization rate of the processors in the running state on the first physical machine is monitored. When the utilization rate of the processors on the first physical machine exceeds a preset threshold, a second physical machine that meets a preset switching condition is selected from the server cluster according to the sleep levels corresponding to the processors in the idle state on other physical machines in the server cluster. The preset switching condition is that the sleep power consumption corresponding to the processors in the idle state on the physical machine meets a preset heat release index, and the heat release index reflects the ability to perform turbo boost on the processors in the running state. The target virtual machine is migrated from the first physical machine to the second physical machine, and the processors in the running state on the target virtual machine are turbo-boosted based on the target frequency. In this technical solution, the performance of the virtual machine can be improved, and the resource utilization rate of the processors can be improved.
[0082] The electronic device can write computer program code for performing the operations of the present disclosure in one or more programming languages or combinations thereof. The above programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0083] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of code, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or by a combination of dedicated hardware and computer instructions.
[0084] The units involved in the embodiments described in the present disclosure can be implemented in software or in hardware. In some cases, the name of the unit does not constitute a limitation on the unit itself.
[0085] The functions described above herein can be performed at least in part by one or more hardware logic components. By way of example and not limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0086] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0087] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.
[0088] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although a number of specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0089] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims.
Claims
1. A virtual machine operation control method, characterized in that, Including: In response to a creation request of a target virtual machine, creating the target virtual machine based on at least one processor on a first physical machine in a server cluster, wherein an upper limit of the operating frequency of the processor of the target virtual machine is set to a target frequency; Monitoring the utilization rate of the processors in the running state on the first physical machine, and when the utilization rate of the processors on the first physical machine exceeds a preset threshold, selecting a second physical machine that meets a preset switching condition from the server cluster according to the sleep levels corresponding to the processors in the idle state on other physical machines in the server cluster, wherein the preset switching condition is that the sleep power consumption corresponding to the processors in the idle state on the physical machine meets a preset heat release index, and the heat release index reflects the turbo frequency ability of the processors in the running state; Migrating the target virtual machine from the first physical machine to the second physical machine, and performing turbo frequency processing on the processors in the running state on the target virtual machine based on the target frequency.
2. The method according to claim 1, wherein The creating the target virtual machine based on at least one processor on a first physical machine in a server cluster in response to a creation request of a target virtual machine includes: Receiving a creation request of a virtual machine, wherein the creation request includes: the number of processors and the type of processor performance; Judging whether the type of processor performance is a target type, wherein the target type indicates that the upper limit of the operating frequency of the processor corresponding to the virtual machine to be configured is set to a target frequency; Selecting processors matching the number of processors on the first physical machine and creating the target virtual machine.
3. The method according to claim 1, wherein Before selecting a second physical machine that meets a preset switching condition from the server cluster according to the sleep levels corresponding to the processors in the idle state on other physical machines in the server cluster, it further includes: After creating a virtual machine corresponding to a processor on a physical machine in the server cluster, reporting to the virtual machine the candidate sleep levels that can be supported when the processor is in the idle state; Receiving the sleep level sent by the virtual machine on the other physical machine when it detects that the corresponding processor is in the idle state, wherein the sleep level is determined by the virtual machine according to the candidate sleep levels and the running services.
4. The method according to claim 1, wherein The selecting a second physical machine that meets a preset switching condition from the server cluster according to the sleep levels corresponding to the processors in the idle state on other physical machines in the server cluster includes: Determining candidate physical machines with a processor utilization rate less than the preset threshold in the server cluster; Obtaining the sleep levels corresponding to the processors in the idle state on the candidate physical machines; Selecting a second physical machine that meets a preset switching condition from the server cluster according to the sleep levels corresponding to the processors in the idle state on the candidate physical machines.
5. The method according to claim 4, characterized in that The determining candidate physical machines with a processor utilization rate less than the preset threshold in the server cluster includes: Obtaining the utilization rate of the processors corresponding to the target virtual machine in the first physical machine, and detecting whether the utilization rate of the processors corresponding to the target virtual machine is greater than a preset first threshold, wherein the first threshold is greater than the preset threshold; If it is known that the processor utilization rate corresponding to the target virtual machine is greater than the first threshold, then determine a second threshold according to the processor utilization rate corresponding to the target virtual machine, where the second threshold is less than the preset threshold, and the difference between the first threshold and the second threshold is greater than a preset threshold value; Compare the processor utilization rates of other physical machines in the server cluster with the preset second threshold, and determine candidate physical machines whose processor utilization rates are less than the second threshold.
6. The method according to claim 4, characterized in that, The step of selecting a second physical machine that meets the preset switching condition from the server cluster according to the sleep level corresponding to the idle processors on the candidate physical machine includes: Determine the target sleep level to be detected and the corresponding proportion threshold according to the correspondence between the sleep level and the sleep power consumption; Detect the proportion result between the processors corresponding to the target sleep level and the idle processors on the candidate physical machine; Compare the proportion result with the proportion threshold, and determine the target candidate physical machine according to the comparison result, where the proportion result corresponding to the target candidate physical machine is greater than the proportion threshold; Determine at least one of the target candidate physical machines as the second physical machine that meets the preset switching condition.
7. The method according to any one of claims 1-6, characterized in that After monitoring the processor utilization rate of the first physical machine in the running state, it further includes: If it is known that the processor utilization rate of the first physical machine is less than the preset threshold, then detect whether the sleep level corresponding to the idle processors on the first physical machine meets the preset switching condition; If it is known that the sleep level corresponding to the idle processors on the first physical machine meets the preset switching condition, then select a second physical machine that meets the switching condition from the server cluster.
8. The method according to claim 7, wherein The step of detecting whether the sleep level corresponding to the idle processors on the first physical machine meets the preset switching condition includes: Obtain the setting information of the processor sleep level on the first physical machine; Judge whether the processor sleep level is restricted to the first sleep level according to the setting information, where the first sleep level indicates that there is no turbo frequency ability for the running state processors; If it is known that the processor sleep level is restricted to the first sleep level, then determine that the sleep level corresponding to the idle processors on the first physical machine meets the preset switching condition.
9. The method according to claim 8, wherein It further includes: If it is known that the processor sleep level is not restricted to the first sleep level, then obtain the sleep level corresponding to the idle processors on the first physical machine; Determine the target sleep level to be detected and the corresponding proportion threshold according to the correspondence between the sleep level and the sleep power consumption; Detect the proportion result between the processors corresponding to the target sleep level and the idle processors on the first physical machine, and compare the proportion result with the proportion threshold; If the proportion result is less than the proportion threshold, then determine that the sleep level corresponding to the idle processors on the first physical machine meets the preset switching condition; If the ratio result is greater than or equal to the ratio threshold, it is determined that the sleep level corresponding to the processor in the idle state on the first physical machine does not meet the preset switching condition.
10. The method according to claim 7, wherein It further includes: If it is known that the sleep level corresponding to the processor in the idle state on the first physical machine does not meet the preset switching condition, the processor in the running state on the target virtual machine is turbo-boosted based on the target frequency.
11. A virtual machine operation control device, characterized in that, It includes: A creation module, configured to, in response to a creation request of a target virtual machine, create the target virtual machine based on at least one processor on a first physical machine in a server cluster, where the upper limit of the running frequency of the processor of the target virtual machine is set to a target frequency; A monitoring module, configured to monitor the usage rate of the processor in the running state on the first physical machine; A determination module, configured to, when the usage rate of the processor of the first physical machine exceeds a preset threshold, select a second physical machine that meets the preset switching condition from the server cluster according to the sleep level corresponding to the processor in the idle state on other physical machines in the server cluster, where the preset switching condition is that the sleep power consumption corresponding to the processor in the idle state on the physical machine meets a preset heat release index, and the heat release index reflects the ability to turbo-boost the processor in the running state; A processing module, configured to migrate the target virtual machine from the first physical machine to the second physical machine, and perform turbo-boosting on the processor in the running state on the target virtual machine based on the target frequency.
12. An electronic device, characterized in that, The electronic device includes: A processor; A memory for storing executable instructions of the processor; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the virtual machine operation control method according to any one of claims 1-10 above.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program is used to execute the virtual machine operation control method according to any one of claims 1-10 above.
Citation Information
Patent Citations
Dynamic Virtual Machine Consolidation
US20140068608A1
Migrating virtual machines
US20140165063A1