A virtual machine consolidation method, device, and storage medium
By constructing a data center resource model and a virtual machine integration method based on resource bias angle, the problem of unbalanced allocation between host server resources and virtual machines was solved, improving resource utilization and energy efficiency, and reducing energy consumption.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies cannot effectively solve the problem of unbalanced allocation of host server resources and virtual machines in data centers, resulting in low resource utilization and energy waste.
A resource model for the data center is constructed with the optimization goal of minimizing host CPU utilization and virtual machine memory usage. Based on the resource bias angle of hosts and virtual machines, the original hosts and virtual machines to be migrated are selected from the host cluster and virtual machine cluster, and the consolidation operation is performed to achieve resource balance.
It improves the utilization rate of host cluster resources, avoids waste of host resources, reduces energy consumption, and achieves improved host energy efficiency and cluster load balancing.
Smart Images

Figure CN121187705B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data center resource management technology, and in particular to a virtual machine consolidation method, device and storage medium. Background Technology
[0002] In recent years, data center energy consumption has become a hot research topic. Low resource utilization of mainframes and the disproportionate power consumption of mainframes to their workload, resulting in low energy efficiency, are significant causes of energy waste. Furthermore, low resource utilization also increases the investment and consumption of data center power distribution and cooling equipment. Therefore, improving the resource utilization of mainframes within data centers is a crucial approach to solving data center energy consumption problems.
[0003] Existing methods often employ dynamic consolidation techniques, integrating virtual machines with low CPU utilization onto other hosts while setting upper limits to ensure service quality in the data center. These methods consolidate based on a single metric—CPU utilization—and use heuristic algorithms to detect overloaded and underloaded hosts. They then sort active hosts and their internal virtual machines by resource consumption, attempting to deploy the largest virtual machine to the host with the highest load. If the host space is insufficient, the virtual machine is deployed to the next host. However, by introducing the memory resource consumption of virtual machines, this method fails to optimally address host resource imbalances.
[0004] Therefore, a more reliable solution is needed to address the imbalance between host server resources and virtual machine allocation within a data center. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a virtual machine integration method, device and storage medium that can solve the problem of unbalanced allocation of host resources and virtual machines in data centers, effectively improve the utilization rate of host cluster resources, avoid waste of host resources and reduce energy consumption.
[0006] To achieve the above objectives, the present invention employs the following technical solution:
[0007] On one hand, the present invention provides a virtual machine consolidation method, the method comprising:
[0008] Construct a resource model for the data center, which represents the optimization objective of minimizing host CPU utilization and virtual machine memory usage under resource constraints.
[0009] Based on host CPU utilization, host resource bias angle, and host memory utilization, the original host is selected from the host cluster in the data center;
[0010] Based on virtual machine CPU utilization and virtual machine resource bias angle, select virtual machines to be migrated from the original host;
[0011] An integration operation is performed on the virtual machines to be migrated so that the integrated data center meets the optimization goals of the resource model.
[0012] In some possible implementations, the resource model for constructing the data center includes:
[0013] The resource constraints that the host resources and virtual machine resources of the data center need to meet are shown in equations (1)-(3):
[0014] (1)
[0015] (2)
[0016] (3)
[0017] in, Represents virtual machine , This represents the collection of all virtual machines within the data center; Indicates host , This represents the set of all hosts within the data center; Represents virtual machine Configure on the host superior; Represents virtual machine The required CPU resources Indicates host Total CPU resources; Represents virtual machine The required memory resources, Indicates host Total memory resources;
[0018] Based on the resource constraints, an objective function is constructed to characterize the minimization of host CPU utilization and virtual machine memory usage in the data center, as shown in equation (4):
[0019] (4)
[0020] in, Indicates host In an active state, that is ; Indicates host CPU utilization Indicates host The amount of CPU resources currently in use; Represents virtual machine The migration situation, Represents virtual machine Migration occurred. Represents virtual machine No migration occurred; This indicates the penalty weight for host power consumption. This indicates the penalty weight for the memory resources of the migrated virtual machine.
[0021] In some possible implementations, the original host includes overloaded hosts, low-load hosts, and resource-unbalanced hosts. The selection of the original host from the host cluster in the data center based on host CPU utilization, host resource bias angle, and host memory utilization includes:
[0022] Hosts whose CPU utilization reaches the upper limit of the threshold are selected as overloaded hosts;
[0023] Hosts whose CPU utilization is below the lower threshold are selected as low-load hosts;
[0024] Hosts with a resource bias angle greater than a first preset angle and a CPU utilization rate greater than or equal to a preset CPU utilization rate, and hosts with a resource bias angle less than a second preset angle and a memory utilization rate greater than or equal to a preset memory utilization rate are selected as resource-unbalanced hosts. The host resource bias angle is determined based on the host's CPU utilization rate and memory utilization rate, as shown in equation (5):
[0025] (5)
[0026] in, ; ;
[0027] in, This indicates the CPU utilization of the host computer. This indicates the host's memory utilization rate; Indicates host The amount of CPU resources currently in use. Indicates host The amount of memory resources currently in use; Indicates host Total CPU resources; Indicates host Total memory resources.
[0028] In some possible implementations, the virtual machines to be migrated include overloaded virtual machines, low-load virtual machines, and resource-unbalanced virtual machines.
[0029] Based on virtual machine CPU utilization and virtual machine resource bias, virtual machines to be migrated are selected from the original host, including:
[0030] Among the overloaded hosts, the virtual machine with the highest CPU utilization is selected as the overload migration virtual machine;
[0031] Among the low-load hosts, all virtual machines are selected as low-load migration virtual machines;
[0032] The resource-unbalanced hosts are divided into CPU-restricted hosts and memory-restricted hosts. The CPU-restricted host is a resource-unbalanced host with a host resource bias angle greater than a first preset angle and a host CPU utilization rate greater than or equal to a preset CPU utilization rate. The memory-restricted host is a resource-unbalanced host with a host resource bias angle less than a second preset angle and a host memory utilization rate greater than or equal to a preset memory utilization rate.
[0033] Among the CPU-constrained hosts, virtual machines with a resource bias angle greater than or equal to the host resource bias angle are selected as resource-imbalanced migration virtual machines.
[0034] Among the memory-constrained hosts, virtual machines whose virtual machine resource bias angle is less than or equal to the host resource bias angle are selected as resource-imbalanced migration virtual machines.
[0035] In some possible implementations, performing the consolidation operation on the virtual machine to be migrated includes:
[0036] Based on the migration cost of the virtual machines to be migrated, the virtual machines to be migrated are sorted in ascending order to generate a virtual machine migration sequence;
[0037] Traverse the virtual machine migration sequence, and based on preset conditions, the host resource load in the running host cluster, and the capacity of the remaining resources of the currently migrated virtual machine and the running host cluster, determine the current target host from the running host cluster or the host cluster that has not been started, and configure the currently migrated virtual machine to the current target host.
[0038] In some possible implementations, the capacity of the current virtual machine to be migrated and the remaining resources of the already running host cluster are determined in the following manner:
[0039] Based on the required CPU and memory resources of the virtual machine to be migrated, and the idle CPU and memory resources of the hosts in the running host cluster, the capacity of the virtual machine to be migrated and the remaining resources of the running host cluster are determined, as shown in equations (6)-(7):
[0040] (6)
[0041] in, (7)
[0042] in, Indicates the virtual machine to be migrated The capacity of the remaining resources of the already running host cluster; Indicates host Idle CPU resources; Indicates host Free memory resources This indicates the cluster of running hosts in the data center; Indicates the virtual machine currently to be migrated. The amount of CPU resources required. Indicates the virtual machine currently to be migrated. The amount of memory resources required; This indicates the virtual machines currently being migrated during the virtual machine consolidation process. Feasibility information for integrating into an existing host cluster.
[0043] In some possible implementations, determining the current target host from the running host cluster or the inactive host cluster based on preset conditions, the host resource load in the running host cluster, and the capacity of the virtual machine to be migrated and the remaining resources of the running host cluster includes:
[0044] If there is a host in the running host cluster that meets the preset conditions, the host with the highest resource load will be selected as the current target host.
[0045] If there are no hosts in the running host cluster that meet the preset conditions, and the capacity of the current virtual machine to be migrated and the remaining resources of the running host cluster is less than or equal to the preset threshold, then any host in the unstarted host cluster will be started and used as the current target host.
[0046] If there are no hosts in the running host cluster that meet the preset conditions, and the capacity of the virtual machines to be migrated and the remaining resources of the running host cluster is greater than the preset threshold, the configured hosts in the running host cluster will be used as the current target hosts; wherein, the configured host is the host with the most configured virtual machines and the smallest virtual machine memory resource usage.
[0047] In some possible implementations, when the current target host is the configured host, configuring the virtual machine to be migrated to the current target host includes:
[0048] Remove some virtual machines configured on the current target host until the available resources on the current target host are sufficient for the current virtual machines to be migrated;
[0049] The step of removing some virtual machines configured on the current target host until the available resources on the current target host meet the needs of the virtual machines to be migrated includes:
[0050] The resource occupancy ratio of the virtual machines in the current target host is determined as shown in equation (8):
[0051] (8)
[0052] in, Indicates the virtual machine within the current target host. The amount of CPU resources required. Indicates the virtual machine within the current target host. The amount of memory resources required; Represents the virtual machine in the buffer The amount of CPU resources required. Represents the virtual machine in the buffer The amount of memory resources required, Indicates a buffer; Indicates the virtual machine currently to be migrated. The amount of CPU resources required. Indicates the virtual machine currently to be migrated. The amount of memory resources required;
[0053] Sort the virtual machines in the current target host in ascending order according to the resource utilization ratio, and generate a virtual machine sorting result;
[0054] Based on the virtual machine sorting results, virtual machines with a smaller resource occupancy ratio than the virtual machine to be migrated are migrated out in sequence until the available resources on the current target host meet the requirements of the virtual machine to be migrated. Then, the virtual machine to be migrated is migrated to the current target host.
[0055] On the other hand, an electronic device is provided, the device including a processor and a memory, the memory storing at least one instruction and at least one program, the at least one instruction and the at least one program being loaded and executed by the processor to implement the virtual machine integration method as described above.
[0056] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction and at least one program are stored therein, the at least one instruction and the at least one program being loaded and executed by a processor to implement the virtual machine integration method as described above.
[0057] Beneficial effects
[0058] In this invention, a resource model for a data center is constructed. This model represents the optimization objective of minimizing host CPU utilization and virtual machine memory usage under resource constraints, thereby avoiding host resource waste and improving host energy efficiency. Then, based on host CPU utilization, host resource bias angle, and host memory utilization, original hosts are selected from the host cluster within the data center. Based on virtual machine CPU utilization and virtual machine resource bias angle, virtual machines to be migrated are selected from the original hosts. An integration operation is performed on the virtual machines to be migrated, so that the integrated data center achieves the optimization objective of the resource model, thereby ensuring a balanced host resource state, solving the problem of unbalanced allocation of host resources and virtual machines within the data center, avoiding host energy waste, and ultimately achieving efficient utilization of host resources and cluster load balancing, as well as improving the resource utilization and energy efficiency of the host cluster. Attached Figure Description
[0059] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 This is a flowchart illustrating a virtual machine integration method provided in an embodiment of the present invention;
[0061] Figure 2 This is a schematic diagram of a process for selecting virtual machines to be migrated according to an embodiment of the present invention;
[0062] Figure 3 This is a schematic diagram of a process for virtual machine consolidation of virtual machines to be migrated, provided by an embodiment of the present invention;
[0063] Figure 4 This is a schematic diagram of the structure of a virtual machine integration device provided in an embodiment of the present invention. Detailed Implementation
[0064] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0065] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0066] In this embodiment of the invention, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0067] Various exemplary embodiments, features, and aspects of the present invention will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0068] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0069] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0070] Furthermore, to better illustrate the present invention, numerous specific details are set forth in the following detailed embodiments. Those skilled in the art will understand that the present invention can be practiced without certain specific details. In some instances, methods, means, elements, and circuits well known to those skilled in the art have not been described in detail in order to highlight the spirit of the invention.
[0071] Example 1
[0072] Figure 1 This is a flowchart illustrating a virtual machine integration method provided by an embodiment of the present invention. This specification provides method operation steps as shown in the embodiments or flowcharts, but based on conventional or non-inventive methods, more or fewer operation steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual system or server product execution, the method can be executed sequentially according to the embodiments or drawings, or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Specifically, as shown... Figure 1 As shown, the above method may include:
[0073] S101: Construct a resource model for the data center. The resource model represents the optimization goal of minimizing the host CPU utilization and virtual machine memory usage in the data center under resource constraints.
[0074] In one specific embodiment, a preset mapping relationship exists between hosts and virtual machines in the data center, which can be specifically adopted as follows: Based on the preset mapping relationship between the host and the virtual machine, it can be determined which host each virtual machine is deployed on.
[0075] Optionally, the resource consumption of hosts in a data center can be represented as follows:
[0076] ,in, Indicates host Resource consumption; Represents virtual machine The amount of CPU resources required; Represents virtual machine The required amount of memory resources; the host's free resources can be expressed as follows:
[0077] ;in, Indicates host Idle resources; Indicates host Total CPU resources Indicates host Total memory resources; Indicates host CPU resource usage Indicates host Memory resource usage.
[0078] In an optional embodiment, constructing the resource model of the data center includes:
[0079] The resource constraints that the amount of host resources and virtual machine resources in the data center need to meet are shown in equations (1) to (3):
[0080] (1)
[0081] (2)
[0082] (3)
[0083] in, Represents virtual machine , This represents the collection of all virtual machines within the data center; Indicates host , This represents the set of all hosts within the data center; Represents virtual machine Configure on the host superior;
[0084] Based on resource constraints, an objective function is constructed to characterize the minimization of host CPU utilization and virtual machine memory usage in the data center, as shown in equation (4):
[0085] (4)
[0086] in, Indicates host In an active state, that is ; Indicates host CPU utilization Indicates host The amount of CPU resources currently in use; Represents virtual machine The migration situation, Represents virtual machine Migration occurred. Represents virtual machine No migration occurred; This indicates the penalty weight for host power consumption. This indicates the penalty weight for the memory resources of the migrated virtual machine.
[0087] In a specific embodiment, the host resource quantity may include the host's CPU resource quantity and memory resource quantity, and the virtual machine resource quantity may include the CPU resource quantity and memory resource quantity required by the virtual machine. In the above resource constraints, equation (1) can indicate that each virtual machine needs to be configured on a host; equation (2) can indicate that the host's CPU resources must meet the CPU resources of the virtual machines configured on that host; equation (3) can indicate that the host's memory resources must meet the memory resources of the virtual machines configured on that host. Optionally, since the host's energy consumption is positively correlated with its CPU utilization, the host's CPU utilization can be used as the host's energy consumption. Optionally, in order to balance the host resource state, virtual machine migration will be performed, and the data center that completes the virtual machine migration should achieve the resource model optimization goal, that is, satisfy the above objective function under the above resource constraints.
[0088] In the above embodiments, by constructing a resource model for the data center, the host energy consumption is reduced during the virtual machine consolidation process. Furthermore, by introducing penalty weights for virtual machine migration, including penalty weights for host energy consumption and penalty weights for the memory of the migrated virtual machines, the service quality of the data center can be prevented from deteriorating, thereby ensuring and improving the service quality of the data center.
[0089] S102: Select the original host from the host cluster in the data center based on host CPU utilization, host resource bias angle and host memory utilization;
[0090] In one specific embodiment, the host resource bias angle can characterize the host resource balance state. Optionally, the host cluster can be an existing host cluster in a data center. Specifically, the host cluster can include hosts in an active host list, and the original host can be an active host that needs to be consolidated into virtual machines.
[0091] In an optional embodiment, the original host may include overloaded hosts, low-load hosts, and resource-unbalanced hosts. The selection of the original host from the host cluster in the data center based on host CPU utilization, host resource bias angle, and host memory utilization may include:
[0092] Hosts whose CPU utilization reaches the upper limit of the threshold are selected as overloaded hosts.
[0093] Hosts whose CPU utilization is below the lower limit of the threshold are selected as low-load hosts;
[0094] Hosts with a resource bias angle greater than a first preset angle and a host CPU utilization greater than or equal to a preset CPU utilization, and hosts with a resource bias angle less than a second preset angle and a host memory utilization greater than or equal to a preset memory utilization, are selected as resource-unbalanced hosts. The host resource bias angle is determined based on the host's CPU utilization and host memory utilization, as shown in equation (5):
[0095] (5)
[0096] in, ; ;
[0097] in, This indicates the CPU utilization of the host computer. This indicates the host's memory utilization rate; Indicates host The amount of CPU resources currently in use. Indicates host The amount of memory resources currently in use; Indicates host Total CPU resources; Indicates host Total memory resources.
[0098] In one specific embodiment, the upper and lower thresholds can be set according to actual application needs. Specifically, the upper and lower thresholds can be set based on historical load data within the data center. Specifically, by monitoring load data from the past 1-3 months, the upper and lower thresholds can be set within the range of "mean ± standard deviation." Simultaneously, the peak and trough values of historical load data are observed to avoid setting the upper and lower thresholds too conservatively or aggressively. Optionally, the upper threshold can be set to 90%, and the lower threshold to 10%. Optionally, the selection of hosts requiring virtual machine consolidation based on host energy consumption can include: hosts with CPU utilization reaching 90% are considered overloaded hosts, and hosts with CPU utilization below 10% are considered low-load hosts.
[0099] In a specific embodiment, the host resource bias angle can be a dual-indicator resource bias angle based on CPU utilization and memory utilization. Specifically, the host resource bias angle can characterize the main resources consumed by the host. The larger the host resource bias angle, the greater the CPU resource consumption and the less memory resources are available; the smaller the host resource bias angle, the greater the memory resource consumption and the less CPU resources are available. The first preset angle and the second preset angle can be set according to actual application requirements. Optionally, the first preset angle can be 75° and the second preset angle can be 15°. The preset CPU utilization and preset memory utilization can be set according to actual application requirements. Optionally, the preset CPU utilization and preset memory utilization can be 80%. Optionally, if the host resource bias angle is greater than the first preset angle and the host CPU utilization is greater than or equal to the preset CPU utilization, or if the host resource bias angle is less than the second preset angle and the host memory utilization is greater than or equal to the preset memory utilization, it indicates that the host resources are in an unbalanced state, and virtual machines need to be migrated out to ensure the balance of host resources. Optionally, hosts with a host resource skew angle greater than 75° and CPU utilization greater than or equal to 80%, or hosts with a host resource skew angle less than 15° and memory utilization greater than or equal to 80%, are selected as resource-unbalanced hosts.
[0100] In the above embodiments, hosts that need to be integrated into virtual machines are selected based on host power consumption and host resource balance. By using a dual-indicator resource bias angle based on CPU utilization and memory utilization, hosts with resource imbalance problems within the active host cluster are selected. This allows for the classification of overloaded hosts, low-load hosts, and resource-imbalanced hosts. This improves the accuracy of host selection and classification, facilitating the selection of virtual machines to be migrated from the classified resource-imbalanced hosts. Consequently, it improves the efficiency and accuracy of virtual machine selection, thereby enhancing the efficiency of virtual machine integration and ensuring the balance of host resource status.
[0101] S103: Select the virtual machine to be migrated from the original host based on the virtual machine CPU utilization and virtual machine resource bias angle;
[0102] In an optional embodiment, the virtual machine to be migrated may include an overloaded virtual machine, a low-load virtual machine, and a resource-unbalanced virtual machine.
[0103] Based on virtual machine CPU utilization and virtual machine resource bias, the virtual machines to be migrated from the original host can include:
[0104] Among the overloaded hosts, the virtual machine with the highest CPU utilization is selected as the overloaded migration virtual machine;
[0105] On low-load hosts, select all virtual machines as low-load migration virtual machines;
[0106] The resource-unbalanced hosts are divided into CPU-restricted hosts and memory-restricted hosts. A CPU-restricted host is a resource-unbalanced host whose resource bias angle is greater than a first preset angle and whose CPU utilization is greater than or equal to a preset CPU utilization. A memory-restricted host is a resource-unbalanced host whose resource bias angle is less than a second preset angle and whose memory utilization is greater than or equal to a preset memory utilization.
[0107] In a host with limited CPU resources, virtual machines with a resource bias angle greater than or equal to the host resource bias angle are selected as virtual machines for resource imbalance migration.
[0108] In a host with limited memory resources, virtual machines whose virtual machine resource bias angle is less than or equal to the host resource bias angle are selected as virtual machines for resource imbalance migration.
[0109] In one specific embodiment, the overloaded virtual machine to be migrated can be a virtual machine to be migrated selected from an overloaded host; the low-load virtual machine to be migrated can be a virtual machine to be migrated selected from a low-load host; and the resource-unbalanced virtual machine can be a virtual machine to be migrated selected from a resource-unbalanced host.
[0110] In one specific embodiment, the selection of virtual machines to be migrated for overloaded and low-load hosts may include: within an overloaded host, prioritizing the virtual machine with the highest CPU utilization as the overloaded migration virtual machine; within a low-load host, selecting all virtual machines as low-load migration virtual machines. Optionally, the selection of virtual machines to be migrated for resource-unbalanced hosts may include: dividing resource-unbalanced hosts into CPU-restricted hosts and memory-restricted hosts, wherein a CPU-restricted host can be a resource-unbalanced host with a host resource skew angle greater than 75° and a CPU utilization greater than or equal to 80%; a memory-restricted host can be a resource-unbalanced host with a host resource skew angle less than 15° and a memory utilization greater than or equal to 80%; within a CPU-restricted host, selecting virtual machines with a virtual machine resource skew angle greater than or equal to the host resource skew angle as resource-unbalanced migration virtual machines, and within a memory-restricted host, selecting virtual machines with a virtual machine resource skew angle less than or equal to the host resource skew angle as resource-unbalanced migration virtual machines.
[0111] In one specific embodiment, the virtual machine resource bias angle can be determined based on the virtual machine's CPU utilization and memory utilization, as shown in the following formula:
[0112] (5)
[0113] in, ; ;
[0114] in, Indicates the virtual machine resource bias angle; Represents virtual machine CPU resource consumption. Represents virtual machine The amount of memory resources consumed; This indicates the total CPU resources of the host with unbalanced resources. This indicates the total memory resources of the host with unbalanced resources.
[0115] In one specific embodiment Figure 2 This is a schematic diagram of a process for selecting virtual machines to be migrated according to an embodiment of the present invention; as shown below. Figure 2 As shown, the virtual machines to be migrated can be selected in the following ways:
[0116] S201: Determine the resource utilization and host resource bias angle of the active host group;
[0117] S202: Select hosts whose CPU utilization reaches the upper limit of the threshold as overloaded hosts;
[0118] S203: Select hosts whose CPU utilization is below the lower limit of the threshold as low-load hosts;
[0119] S204: Select hosts whose host resource bias angle is greater than the first preset angle and whose host CPU utilization is greater than or equal to the preset CPU utilization as CPU resource-limited hosts.
[0120] S205: Select hosts with a host resource bias angle less than the second preset angle and a host memory utilization rate greater than or equal to the preset memory utilization rate as memory resource-constrained hosts.
[0121] S206: Among the overloaded hosts, select the virtual machine with the highest CPU utilization as the overloaded migration virtual machine;
[0122] S207: Select all virtual machines on low-load hosts as low-load migration virtual machines;
[0123] S208: In a host with limited CPU resources, select virtual machines whose virtual machine resource bias angle is greater than or equal to the host resource bias angle as virtual machines to be migrated due to resource imbalance.
[0124] S209: In a host with limited memory resources, virtual machines whose virtual machine resource bias angle is less than or equal to the host resource bias angle are selected as virtual machines for resource imbalance migration;
[0125] S210: Store overloaded, low-load, and resource-unbalanced virtual machines in a virtual buffer.
[0126] In the above embodiments, the resource utilization of the active host cluster includes host CPU utilization and host memory utilization. Based on the host's energy consumption status, overloaded and low-load hosts are accurately distinguished. A dual-indicator resource bias angle based on CPU utilization and memory utilization is introduced. This indicator is used to locate resource-imbalanced hosts within the active host cluster. Then, virtual machines (VMs) for overloaded, low-load, and resource-imbalanced hosts are selected to adjust the distribution of VMs among hosts, thereby achieving efficient utilization of host resources and cluster load balancing.
[0127] S104: Perform consolidation operations on the virtual machines to be migrated, so that the consolidated data center achieves the resource model optimization goal.
[0128] In one specific embodiment, when the virtual machines to be migrated are integrated, the integrated data center should achieve the optimization goal of the data center's resource model. This can improve host energy efficiency, avoid host resource waste, and reduce energy consumption while ensuring the balance of host resources in the data center.
[0129] In an optional embodiment, the above-described consolidation operation for the virtual machine to be migrated may include:
[0130] Based on the migration cost of the virtual machines to be migrated, sort the virtual machines in ascending order to generate a virtual machine migration sequence;
[0131] Traverse the virtual machine migration sequence, and based on preset conditions, the resource load of the host in the running host cluster, and the capacity of the remaining resources of the virtual machine to be migrated and the running host cluster, determine the current target host from the running host cluster or the host cluster that has not been started, and configure the virtual machine to be migrated to the current target host.
[0132] In a specific embodiment, the migration cost of the virtual machine to be migrated can be determined by the following formula:
[0133] ;
[0134] in, Indicates migration cost; Indicates the virtual machine to be migrated The amount of CPU resources required. Indicates the virtual machine to be migrated The amount of memory resources required; Represents the virtual machine in the buffer The amount of CPU resources required. Represents the virtual machine in the buffer The amount of memory resources required, This represents a buffer, which is optional and is used to store virtual machines to be migrated.
[0135] Optionally, the virtual machine migration sequence may include virtual machines to be migrated, sorted in ascending order of migration cost. Optionally, virtual machine consolidation may be performed from the virtual machine to be migrated with the lowest migration cost.
[0136] In a specific embodiment, the virtual machine to be migrated can be a virtual machine that needs to be integrated during the traversal; the target host can be the host that configures the virtual machine to be migrated. Optionally, the preset conditions can be set according to the actual application requirements. The preset conditions may include: there is one or more hosts with sufficient space resources to accommodate the virtual machine to be migrated, that is, satisfying equations (2) and (3); and there are hosts that satisfy the following formula:
[0137] ;in, Indicates host Idle CPU resources Indicates host Free memory resources; Indicates host Chinese Virtual Machine The amount of CPU resources required. Indicates host Chinese Virtual Machine The amount of memory resources required.
[0138] Optional, host resource load level It can be determined according to the following formula:
[0139] .
[0140] In an optional embodiment, the capacity of the remaining resources of the currently migrated virtual machine and the running host cluster can be determined in the following manner:
[0141] Based on the required CPU and memory resources of the virtual machine to be migrated, and the idle CPU and memory resources of the hosts in the running host cluster, the capacity of the remaining resources of the virtual machine to be migrated and the running host cluster is determined, as shown in equations (6)-(7):
[0142] (6)
[0143] in, (7)
[0144] in, Indicates the virtual machine to be migrated The capacity of the remaining resources of the already running host cluster; Indicates host Idle CPU resources; Indicates host Free memory resources This indicates the cluster of running hosts in the data center; Indicates the virtual machine currently to be migrated. The amount of CPU resources required. Indicates the virtual machine currently to be migrated. The amount of memory resources required; This indicates the virtual machines currently being migrated during the virtual machine consolidation process. Feasibility information for integrating into an existing host cluster.
[0145] In one specific embodiment, the remaining resources of the running host cluster may include the host's idle CPU resources and idle memory resources. The capacity of the remaining resources of the running host cluster to be migrated can characterize the capacity relationship between the remaining resources of the running host cluster and the virtual machine to be migrated; optionally, during the virtual machine consolidation process, the feasibility information of the virtual machine to be migrated integrating into the running host cluster can be used to determine whether the virtual machine to be migrated can be integrated into the running host cluster through the consolidation method.
[0146] In an optional embodiment, determining the current target host from the running host cluster or the inactive host cluster based on preset conditions, the host resource load level in the running host cluster, and the capacity of the remaining resources of the virtual machine to be migrated and the running host cluster may include:
[0147] If there are hosts in the running host cluster that meet the preset conditions, the host with the highest host resource load will be selected as the current target host.
[0148] If there are no hosts in the running host cluster that meet the preset conditions, and the capacity of the remaining resources of the virtual machine to be migrated and the running host cluster is less than or equal to the preset threshold, start any host in the non-started host cluster and use it as the current target host.
[0149] If there are no hosts in the running host cluster that meet the preset conditions, and the capacity of the remaining resources of the virtual machines to be migrated and the running host cluster is greater than the preset threshold, the configured host in the running host cluster will be used as the current target host; among them, the configured host is the host with the most configured virtual machines and the smallest virtual machine memory resource usage.
[0150] In one specific embodiment, the preset threshold can be set according to actual application requirements; specifically, the preset threshold can be 1; optionally, in In this case, regardless of adjustments made to the active host cluster, it means that the virtual machines to be migrated cannot be accommodated. A new host needs to be started to complete the configuration of the virtual machines to be migrated in the buffer. Optionally, a new host can be started as the current target host. Specifically, any host in the currently inactive host cluster can be started and used as the current target host. In this case, the host with the most configured virtual machines and the lowest virtual machine memory usage in the running host cluster can be selected as the current target host. Optionally, since virtual machines with low memory usage are easier to migrate than those with high memory usage, the host with the lowest virtual machine memory usage and the largest number of virtual machines in the running host cluster can be selected as the current target host.
[0151] In an optional embodiment, if the current target host is an already configured host, configuring the virtual machine to be migrated to the current target host includes:
[0152] Remove some virtual machines configured on the current target host until the available resources on the current target host are sufficient for the virtual machines to be migrated.
[0153] This involves removing some virtual machines configured on the current target host until the available resources on the current target host are sufficient for the virtual machines to be migrated, including:
[0154] Determine the resource usage ratio of the virtual machines in the current target host, as shown in equation (8):
[0155] (8)
[0156] in, Indicates the virtual machine within the current target host. The amount of CPU resources required. Indicates the virtual machine within the current target host. The amount of memory resources required; Represents the virtual machine in the buffer The amount of CPU resources required. Represents the virtual machine in the buffer The amount of memory resources required, Indicates a buffer; Indicates the virtual machine currently to be migrated. The amount of CPU resources required. Indicates the virtual machine currently to be migrated. The amount of memory resources required;
[0157] Sort the virtual machines on the current target host in ascending order based on their resource utilization ratio, and generate the virtual machine sorting result;
[0158] Based on the virtual machine sorting results, virtual machines with lower resource usage ratios than the virtual machines to be migrated are migrated out in sequence until the available resources on the target host are sufficient for the virtual machines to be migrated. Then, the virtual machines to be migrated are migrated to the target host.
[0159] In a specific embodiment, if there are no hosts in the running host cluster that meet the preset conditions, and the capacity of the remaining resources of the running host cluster to migrate the virtual machine is greater than the preset threshold, the virtual machine mapping relationship in the running host cluster can be adjusted to integrate the virtual machine to be migrated, thereby configuring the virtual machine to be migrated into the host cluster. Optionally, the virtual machine mapping relationship can be a correspondence between virtual machines and hosts.
[0160] In one specific embodiment, the resource utilization ratio corresponding to the virtual machines within the current target host is based on the virtual machines within the current target host. The required CPU and memory resources, and the amount of each virtual machine in the buffer. The required CPU and memory resources, and the current virtual machines to be migrated. The required CPU and memory resources are determined. Based on the virtual machine sorting results, virtual machines with lower resource usage than the current virtual machine to be migrated are migrated out in sequence. During each migration, an attempt is made to move the virtual machine to be migrated into the current target host until it can be moved into the current target host. Optionally, virtual machines that are migrated out of the current target host can be stored in a buffer, the virtual machines to be migrated in the buffer are updated, the migration cost corresponding to the virtual machines to be migrated in the buffer is re-determined, and resource balancing operations continue until the buffer is empty, completing the virtual machine consolidation.
[0161] In one specific embodiment Figure 3 This is a schematic diagram of a virtual machine consolidation process provided by an embodiment of the present invention; for example... Figure 3 As shown, virtual machines to be migrated can be consolidated in the following ways:
[0162] S301: Determine the migration cost corresponding to the virtual machines to be migrated in the buffer;
[0163] S302: Sort the virtual machines to be migrated in ascending order based on migration cost and generate a virtual machine migration sequence;
[0164] S303: Select the first virtual machine to be migrated in the virtual machine migration sequence as the current virtual machine to be migrated;
[0165] S304: Determine whether there is a host in the running host cluster that meets the preset conditions. If there is a host in the running host cluster that meets the preset conditions, execute S305; if there is no host in the running host cluster that meets the preset conditions, execute S308.
[0166] S305: Identify the host with the highest host resource load as the current target host;
[0167] S306: Configure the virtual machine to be migrated to the current target host;
[0168] S307: Determine if the buffer is empty. If the buffer is not empty, return to execute S303; if the buffer is empty, end virtual machine consolidation.
[0169] S308: Determine the capacity of the remaining resources of the virtual machines to be migrated and the running host cluster;
[0170] S309: Determine if the capacity is less than or equal to 1. If the capacity is less than or equal to 1, execute S310; if the capacity is greater than 1, execute S312.
[0171] S310: Start any host in the host cluster that has not been started, and use it as the current target host;
[0172] S311: Configure the virtual machine to be migrated to the current target host, and execute S307;
[0173] S312: Within the running host cluster, select the host with the most virtual machines and the smallest virtual machine memory resource usage as the current target host;
[0174] S313: Determine the resource usage ratio of the virtual machines within the current target host;
[0175] S314: Sort the virtual machines in the current target host in ascending order according to their resource utilization ratio, and generate the virtual machine sorting result;
[0176] S315: Based on the virtual machine sorting results, migrate out the virtual machines with smaller resource usage ratios than the virtual machines to be migrated in the current target host in sequence until the available resources of the current target host meet the needs of the virtual machines to be migrated, and then migrate the virtual machines to be migrated to the current target host.
[0177] S316: Store the migrated virtual machine in the buffer, update the virtual machine to be migrated in the buffer, and return to execute S301.
[0178] If there are hosts in the running host cluster that meet the preset conditions, the host with the highest host resource load will be selected as the current target host; the second target host can be a new host used to configure the virtual machine to be migrated.
[0179] Optionally, the first target host can be the host with the highest resource load in an active host cluster, provided that there are hosts that meet the preset conditions; specifically, the first target host is used to configure the virtual machines to be migrated in the buffer.
[0180] You can select the host resource load level from a group of active hosts that can accommodate virtual machines. The highest-ranking host is designated as the first target host; then, the virtual machine being migrated is configured onto the first target host; if the buffer is not empty, the virtual machine with the lowest migration cost in the virtual machine migration sequence is reselected as the virtual machine being migrated for virtual machine consolidation, that is, the step of selecting the first virtual machine to be migrated in the virtual machine migration sequence is repeated until the buffer is empty; if the buffer is empty, the virtual machine consolidation ends. Specifically, an empty buffer indicates that there are no virtual machines to be migrated; a non-empty buffer indicates that there are virtual machines to be migrated.
[0181] In one specific embodiment, if it is determined that the buffer is not empty, the virtual machine to be migrated with the lowest migration cost in the virtual machine migration sequence is reselected as the virtual machine to be migrated for virtual machine consolidation until the buffer is empty; if it is determined that the buffer is empty, the virtual machine consolidation ends.
[0182] In the above embodiments, during the virtual machine consolidation process, a forced consolidation method is further adopted. By adjusting the correspondence between virtual machines and hosts within the host cluster, virtual machine consolidation is achieved, which can enhance the balance of host resource allocation and thus effectively improve the resource utilization of the host cluster.
[0183] As can be seen from the technical solutions provided in the embodiments of this specification above, this specification constructs a resource model for a data center. This resource model represents the optimization objective of minimizing the host CPU utilization and virtual machine memory usage under resource constraints, thereby avoiding host resource waste and improving host energy efficiency. Then, based on host CPU utilization, host resource bias angle, and host memory utilization, original hosts are selected from the host cluster in the data center. Based on virtual machine CPU utilization and virtual machine resource bias angle, virtual machines to be migrated are selected from the original hosts. An integration operation is performed on the virtual machines to be migrated so that the integrated data center achieves the optimization objective of the resource model, thereby ensuring the balance of host resource status, solving the problem of unbalanced allocation of host resources and virtual machines in the data center, avoiding host energy waste, and thus achieving efficient utilization of host resources and cluster load balancing, as well as improving the resource utilization and energy efficiency of the host cluster. Simultaneously, it provides reliable technical support for the large-scale expansion and green operation of data centers.
[0184] Example 2
[0185] This invention also provides a virtual machine integration device, accordingly. Figure 4 This is a schematic diagram of the structure of a virtual machine integration device provided in an embodiment of the present invention; as shown below. Figure 4 As shown, the above-mentioned device includes:
[0186] The resource model construction module 410 is used to construct a resource model for the data center. The resource model represents the optimization objective of minimizing the host CPU utilization and virtual machine memory usage of the data center under resource constraints.
[0187] The original host selection module 420 is used to select an original host from the host cluster in the data center based on the host CPU utilization, host resource bias angle and host memory utilization.
[0188] The virtual machine selection module 430 is used to select virtual machines to be migrated from the original host based on the virtual machine CPU utilization and virtual machine resource bias angle.
[0189] The virtual machine consolidation module 440 is used to perform consolidation operations on the virtual machines to be migrated, so that the consolidated data center can achieve the optimization goal of the resource model.
[0190] Example 3
[0191] This invention also provides an electronic device, comprising: a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the virtual machine integration method as described in any of the method embodiments.
[0192] Example 4
[0193] Embodiments of the present invention also provide a computer storage medium, which may be disposed in a server to store at least one instruction, at least one program, code set, or instruction set for implementing the method embodiments, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the virtual machine integration method as described in any of the method embodiments.
[0194] Optionally, in embodiments of the present invention, the storage medium may be located at at least one of a plurality of network servers in a computer network. Optionally, in embodiments of the present invention, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0195] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0196] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more flowcharts and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0197] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more flowcharts and / or boxes Figure 1 The function specified in one or more boxes.
[0198] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more flowcharts and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0199] 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 invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in 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, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0200] Finally, it should be noted that the embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. A virtual machine integration method, characterized by, The method comprises: constructing a resource model of a data center, the resource model representing an optimization objective of minimizing host CPU utilization and virtual machine occupied memory of the data center under resource constraints; selecting an original host from a host cluster in the data center based on host CPU utilization, host resource bias angle and host memory utilization; selecting a virtual machine to be migrated from the original host based on virtual machine CPU utilization and virtual machine resource bias angle; performing consolidation operations on the virtual machine to be migrated to make the consolidated data center reach the optimization objective of the resource model; wherein the original host includes an overloaded host, a low-load host and a resource imbalance host, and the virtual machine to be migrated includes an overloaded migration virtual machine, a low-load migration virtual machine and a resource imbalance migration virtual machine; selecting a virtual machine to be migrated from the original host based on virtual machine CPU utilization and virtual machine resource bias angle, comprising: in the overloaded host, selecting the virtual machine with the largest CPU utilization as the overloaded migration virtual machine; in the low-load host, selecting all virtual machines as low-load migration virtual machines; dividing the resource imbalance host into a CPU resource limited host and a memory resource limited host, wherein the CPU resource limited host is a resource imbalance host with a host resource bias angle greater than a first preset angle and a host CPU utilization greater than or equal to a preset CPU utilization, and the memory resource limited host is a resource imbalance host with a host resource bias angle less than a second preset angle and a host memory utilization greater than or equal to a preset memory utilization; in the CPU resource limited host, selecting a virtual machine with a virtual machine resource bias angle greater than or equal to the host resource bias angle as a resource imbalance migration virtual machine; in the memory resource limited host, selecting a virtual machine with a virtual machine resource bias angle less than or equal to the host resource bias angle as a resource imbalance migration virtual machine; the consolidation operations on the virtual machine to be migrated, comprising: sorting the virtual machines to be migrated in ascending order according to their migration costs to generate a virtual machine migration sequence; traversing the virtual machine migration sequence, determining a current target host from the running host cluster or the non-started host cluster according to a preset condition, the host resource load degree in the running host cluster, and the accommodation degree of the current virtual machine to be migrated and the remaining resources of the running host cluster, and configuring the current virtual machine to be migrated to the current target host; wherein the determination of the current target host from the running host cluster or the non-started host cluster according to the preset condition, the host resource load degree in the running host cluster, and the accommodation degree of the current virtual machine to be migrated and the remaining resources of the running host cluster, comprises: if there is a host in the running host cluster that meets the preset condition, the host with the highest host resource load degree is selected as the current target host; if there is no host in the running host cluster satisfying the preset condition, and the accommodatability of the current virtual machine to be migrated and the remaining resources of the running host cluster is less than or equal to a preset threshold, starting any host in the non-started host cluster and taking the host as the current target host; if there is no host in the running host cluster satisfying the preset condition, and the accommodatability of the current virtual machine to be migrated and the remaining resources of the running host cluster is greater than the preset threshold, taking a configured host in the running host cluster as the current target host, wherein the configured host has the most configured virtual machines and the smallest virtual machine memory resource occupation.
2. The virtual machine consolidation method of claim 1, wherein, The resource model of the data center comprises: The resource constraint condition required to be satisfied by the host resource quantity and the virtual machine resource quantity of the data center is shown in formulas (1)-(3): ;(1) ;(2) ;(3) wherein, represents a virtual machine , represents a set of all virtual machines within a data center; represents a host , represents a set of all hosts within a data center; represents a virtual machine configured on a host ; represents a required CPU resource amount of a virtual machine , represents a total CPU resource amount of a host ; represents a required memory resource amount of a virtual machine represents a total memory resource amount of a host ; Based on the resource constraint condition, a target function is constructed, the target function is used to represent the minimization of the host CPU utilization and the virtual machine occupied memory of the data center, and is shown in formula (4): ;(4) wherein, represents the CPU utilization of the host is in an active state, i.e. ; represents the CPU utilization of the host ; represents the amount of CPU resources currently occupied by the host ; represents the migration situation of the virtual machine ; represents that the virtual machine has migrated, represents that the virtual machine has not migrated; represents the penalty weight of the energy consumption of the host, represents the penalty weight of the memory resources of the migrated virtual machine.
3. The virtual machine consolidation method of claim 1, wherein, The original host comprises an overload host, a low-load host and a resource imbalance host, and the original host is selected from the host cluster in the data center based on the host CPU utilization, the host resource bias angle and the host memory utilization, comprising: a host with the host CPU utilization reaching an upper threshold is selected as the overload host; a host with the host CPU utilization being lower than a lower threshold is selected as the low-load host; a host with the host resource bias angle being greater than a first preset angle, the host CPU utilization being greater than or equal to a preset CPU utilization, the host resource bias angle being less than a second preset angle, and the host memory utilization being greater than or equal to a preset memory utilization is selected as the resource imbalance host, wherein the host resource bias angle is determined based on the CPU utilization of the host and the memory utilization of the host, and is shown in formula (5): ;(5) wherein ; ; wherein, represents a host resource bias angle; represents a CPU utilization of the host, represents a memory utilization of the host; represents a host a current amount of CPU resources occupied, represents a host a current amount of memory resources occupied; represents a host a total amount of CPU resources; represents a host a total amount of memory resources.
4. The virtual machine consolidation method of claim 1, wherein, The accommodatability of the current virtual machine to be migrated and the remaining resources of the running host cluster is determined in the following manner: Based on the required CPU resource quantity and the required memory resource quantity of the current virtual machine to be migrated, and the idle CPU resource and the idle memory resource of the host of the running host cluster, the accommodatability of the current virtual machine to be migrated and the remaining resources of the running host cluster is determined, and is shown in formulas (6)-(7): ;(6) wherein ; (7) wherein, represents a virtual machine to be migrated with the remaining resources of the cluster of running hosts; represents a host of free CPU resources; represents a host of free memory resources, represents a cluster of running hosts of a data center; represents a required amount of CPU resources of the virtual machine to be migrated at present, represents a required amount of memory resources of the virtual machine to be migrated at present; represents the feasibility information of the virtual machine to be migrated to be integrated into the cluster of running hosts in the process of virtual machine integration.
5. The virtual machine consolidation method of claim 1, wherein, In the case that the current target host is the configured host, the configuration of the current virtual machine to be migrated to the current target host comprises: eliminating part of the virtual machines configured in the current target host until the resources vacated by the current target host satisfy the current virtual machine to be migrated; wherein the elimination of part of the virtual machines configured in the current target host until the resources vacated by the current target host satisfy the current virtual machine to be migrated comprises: determining the resource occupation ratio of the virtual machines in the current target host, and is shown in formula (8): ;(8) wherein, represents the required CPU resource amount of the virtual machine within the current target host, represents the required memory resource amount of the virtual machine within the current target host; represents the required CPU resource amount of the virtual machine within the buffer, represents the required memory resource amount of the virtual machine within the buffer, represents the buffer; represents the required CPU resource amount of the current virtual machine to be migrated, represents the required memory resource amount of the current virtual machine to be migrated. sorting the virtual machines in the current target host in ascending order according to the resource occupation ratio to generate a virtual machine sorting result; and configuring the current virtual machine to be migrated to the current target host according to the virtual machine sorting result. Based on the virtual machine sorting result, sequentially migrate out the virtual machines whose resource occupation ratio in the current target host is smaller than that of the current to-be-migrated virtual machine until the freed resources of the current target host satisfy the current to-be-migrated virtual machine, and migrate the current to-be-migrated virtual machine to the current target host. 6.An electronic device, comprising a processor and a memory, wherein the memory stores at least one instruction and at least one program, and the at least one instruction and the at least one program are loaded and executed by the processor to implement the virtual machine integration method according to any one of claims 1-5. 7.A computer storage medium, wherein the computer storage medium stores at least one instruction and at least one program, and the at least one instruction and the at least one program are loaded and executed by a processor to implement the virtual machine integration method according to any one of claims 1-5.
Citation Information
Patent Citations
Cluster resource allocation optimization method and system
CN116302348A
Resource Migration Method and System, and Device
US20230004419A1