Method, device and computer storage medium for scheduling virtual machines

By obtaining the virtual machine's IP address and resource data, and selecting the target host for migration based on consecutive IP rules, the problem of multiple virtual machines failing simultaneously due to a single host failure is solved, improving the reliability of virtual machine migration and the availability of business systems.

CN116932134BActive Publication Date: 2026-06-05CHINA MOBILE COMM GRP CHONGQING CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE COMM GRP CHONGQING CO LTD
Filing Date
2022-11-30
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

The problem of multiple virtual machines carrying the same business function failing simultaneously due to the failure of a single host machine.

Method used

By obtaining the virtual machine's IP address, calculating the resource data of the virtual machine to be migrated, and selecting the target host for migration based on the preset consecutive IP rules and resource utilization, it is ensured that there are no virtual machines with consecutive IP addresses in the source host.

Benefits of technology

This effectively avoids the simultaneous failure of multiple virtual machines due to the failure of a single host machine, improving the reliability of virtual machine migration and the availability of business systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116932134B_ABST
    Figure CN116932134B_ABST
Patent Text Reader

Abstract

The application discloses a virtual machine scheduling method, device and equipment and a computer storage medium. The method comprises the following steps: obtaining an IP address of a virtual machine in a first source host; calculating an IP address of a first virtual machine to be migrated in the first source host according to a preset IP number contained in continuous IP and the IP of the virtual machine; obtaining first resource data of the first virtual machine to be migrated according to the IP address of the first virtual machine to be migrated; obtaining second resource data of a first target host; calculating resource utilization rate estimation data of the first target host according to the first resource data and the second resource data; and determining first migration information according to the first resource data and the second resource data when the first source host and the first target host satisfy a first migration rule. According to the embodiment of the application, the problem that multiple virtual machines carrying the same service function are simultaneously faulty due to the failure of a single host can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of cloud computing technology, and in particular relates to a virtual machine scheduling method, apparatus, device and computer storage medium. Background Technology

[0002] A virtual machine (VM) is a complete computer system that is simulated by software, has full hardware system functionality, and runs in a completely isolated environment.

[0003] Currently, because the IP addresses of multiple virtual machines carrying the same business function are consecutive, there are situations where multiple virtual machines carrying the same business function are distributed on a single host machine. If the single host machine fails, it will cause multiple virtual machines carrying the same business function to fail simultaneously. Summary of the Invention

[0004] This application provides a virtual machine scheduling method, apparatus, device, and computer storage medium, which can solve the problem of multiple virtual machines carrying the same business function failing simultaneously due to the failure of a single host machine.

[0005] In a first aspect, embodiments of this application provide a virtual machine scheduling method, the method comprising:

[0006] Obtain the IP address of the virtual machine in the first source host machine;

[0007] Based on the preset number of IPs contained in the consecutive IPs and the virtual machine IP, calculate the IP address of the first virtual machine to be migrated in the first source host;

[0008] Based on the IP address of the first virtual machine to be migrated, obtain the first resource data of the first virtual machine to be migrated. The first resource data includes the memory usage, bandwidth utilization, CPU utilization, number of virtual machine CPU cores, and memory capacity of the first virtual machine to be migrated.

[0009] Obtain the second resource data of the first target host machine. The first target host machine does not include virtual machines whose IP addresses meet the preset consecutive IP address of the first virtual machine to be migrated. The second resource data includes the memory usage, bandwidth utilization, CPU utilization, physical CPU core count, total memory capacity of virtual machines in the first target host machine that are powered on, and physical memory capacity of the host machine.

[0010] Based on the first resource data and the second resource data, calculate the estimated resource utilization rate of the first target host machine. The estimated resource utilization rate includes the estimated first memory utilization rate, the estimated first bandwidth utilization rate, the estimated first CPU utilization rate, and the estimated first super-resolution ratio of the first target host machine.

[0011] When the first source host and the first target host meet the first migration rule, the first migration information is determined based on the first resource data and the second resource data. The first migration information is used to migrate the first virtual machine to be migrated to the first target host.

[0012] The first migration rule includes:

[0013] All of the following conditions must be met: the first estimated memory utilization is less than the first memory utilization threshold, the first estimated bandwidth utilization is less than the first bandwidth utilization threshold, the first estimated CPU utilization is less than the first CPU utilization threshold, and the first estimated super-resolution ratio is less than the first super-resolution ratio threshold. Furthermore, the first target host does not include any virtual machines whose IP addresses satisfy the preset consecutive IP address of the first virtual machine to be migrated.

[0014] Secondly, embodiments of this application provide a virtual machine scheduling device, the device comprising:

[0015] The acquisition module is used to obtain the IP address of the virtual machine in the first source host machine;

[0016] The calculation module is used to calculate the IP address of the first virtual machine to be migrated in the first source host machine based on the number of IPs contained in the preset consecutive IPs and the virtual machine IP.

[0017] The acquisition module is also used to acquire the first resource data of the first virtual machine to be migrated based on the IP address of the first virtual machine to be migrated. The first resource data includes the memory usage, bandwidth utilization, CPU utilization, number of virtual machine CPU cores, and memory capacity of the first virtual machine to be migrated.

[0018] The acquisition module is also used to acquire the second resource data of the first target host machine. The first target host machine does not include virtual machines whose IP addresses satisfy a preset consecutive IP address with the IP address of the first virtual machine to be migrated. The second resource data includes the memory usage, bandwidth utilization, CPU utilization, number of physical CPU cores, total memory capacity of virtual machines in the first target host machine in the powered-on state, and physical memory capacity of the host machine.

[0019] The calculation module is also used to calculate the estimated resource utilization rate of the first target host machine based on the first resource data and the second resource data. The estimated resource utilization rate includes the estimated first memory utilization rate, the estimated first bandwidth utilization rate, the estimated first CPU utilization rate, and the estimated first super-resolution ratio of the first target host machine.

[0020] The determination module is used to determine first migration information based on first resource data and second resource data when the first source host and the first target host meet the first migration rules. The first migration information is used to migrate the first virtual machine to be migrated to the first target host.

[0021] The first migration rule includes:

[0022] All of the following conditions must be met: the first estimated memory utilization is less than the first memory utilization threshold, the first estimated bandwidth utilization is less than the first bandwidth utilization threshold, the first estimated CPU utilization is less than the first CPU utilization threshold, and the first estimated super-resolution ratio is less than the first super-resolution ratio threshold. Furthermore, the first target host does not include any virtual machines whose IP addresses satisfy the preset consecutive IP address of the first virtual machine to be migrated.

[0023] Thirdly, embodiments of this application provide a virtual machine scheduling device, the device including: a processor and a memory storing computer program instructions;

[0024] The processor executes computer program instructions to implement the method described in the first aspect.

[0025] Fourthly, embodiments of this application provide a computer storage medium on which computer program instructions are stored, which, when executed by a processor, implement the method described in the first aspect.

[0026] Fifthly, embodiments of this application provide a computer program product, characterized in that, when the instructions in the computer program product are executed by the processor of an electronic device, the electronic device performs the method described in the first aspect.

[0027] The virtual machine scheduling method, apparatus, device, and computer storage medium provided in this application can, based on the characteristic that the IP addresses of multiple virtual machines carrying the same business function in a single host are consecutive IPs, obtain the IP addresses of virtual machines in a first source host, calculate the IP address of a first virtual machine to be migrated in the first source host according to a preset number of consecutive IPs and the virtual machine IP, and then obtain the first resource data of the first virtual machine to be migrated based on the IP address of the first virtual machine to be migrated. The first resource data includes the memory usage, bandwidth utilization, CPU utilization, number of virtual machine CPU cores, and memory capacity of the first virtual machine to be migrated. Then, the second resource data of the first target host is obtained. The first target host does not include virtual machines whose IP addresses satisfy the preset consecutive IPs of the first virtual machine to be migrated. The second resource data includes the memory usage, bandwidth utilization, CPU utilization, number of physical CPU cores, total memory capacity of virtual machines in the first target host when they are powered on, and the host machine's physical memory. Based on the memory capacity, and according to the first resource data and the second resource data, the estimated resource utilization of the first target host is calculated. The estimated resource utilization includes the estimated first memory utilization, the estimated first bandwidth utilization, the estimated first CPU utilization, and the estimated first super-resolution ratio. When all the following conditions are met: the estimated first memory utilization is less than the first memory utilization threshold, the estimated first bandwidth utilization is less than the first bandwidth utilization threshold, the estimated first CPU utilization is less than the first CPU utilization threshold, and the estimated first super-resolution ratio is less than the first super-resolution ratio threshold, that is, when the first source host and the first target host meet the first migration rule, the first migration information is determined according to the first resource data and the second resource data. The first migration information is used to migrate the first virtual machine to be migrated to the first target host, so that there is no first virtual machine to be migrated with consecutive IP addresses among the multiple virtual machines hosted by the source host, thereby solving the problem of multiple virtual machines carrying the same business function failing simultaneously due to the failure of a single host. Attached Figure Description

[0028] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 A flowchart illustrating the virtual machine scheduling method provided in an embodiment of this application is shown.

[0030] Figure 2 A schematic diagram of the virtual machine scheduler device provided in an embodiment of this application is shown.

[0031] Figure 3 A schematic diagram of the structure of the virtual machine scheduler device provided in an embodiment of this application is shown. Detailed Implementation

[0032] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0033] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0034] With the development of cloud computing, virtualization technology has been widely used. Among them, hot migration technology in virtualization can migrate virtual machines from one host machine to another without interrupting business operations.

[0035] Currently, virtualization platforms employ load balancing or energy-saving strategies when selecting virtual machine objects to be migrated and the target host machines for virtual machine migration, treating each virtual machine as an independent individual.

[0036] However, a single host machine may host multiple virtual machines that share the same business system functional module and have a primary / standby or load-balanced relationship. If a host machine failure causes multiple virtual machines to restart simultaneously, these virtual machines with primary / standby or load-balanced relationships will render the business system functional module unavailable or significantly degrade business performance.

[0037] Meanwhile, if the virtual machine hot migration strategy does not consider the correlation between virtual machines, multiple virtual machines that should have been deployed on different hosts to carry the same business system functional modules and have a master-slave relationship or load balancing relationship will be dispersed to the same host after hot migration, resulting in business interruption due to the failure of a single host.

[0038] Current virtual machine hot migration strategies, taking VMware products as an example, include load balancing strategies (Distributed Resource Scheduler, DRS) and power saving strategies (Distributed Power Management, DPM). These strategies migrate virtual machines based on user-defined virtual machine affinity rules, thereby achieving load balancing on the host machine.

[0039] When creating an affinity rule, DRS attempts to keep the specified virtual machines on the same host. When using an anti-affinity rule, DRS attempts to separate the specified virtual machines. This type of rule can be used to ensure that certain virtual machines always reside on different physical hosts.

[0040] However, based on the virtual machine affinity and anti-affinity rules currently defined by the user, it is impossible to avoid the situation where multiple virtual machines carrying the same business function are distributed on a single host machine by manually adding them. If the single host machine fails, it will cause multiple virtual machines carrying the same business function to fail simultaneously.

[0041] To address the problems of the prior art, embodiments of this application provide a virtual machine scheduling method, apparatus, device, and computer storage medium. The virtual machine scheduling method provided in this application embodiment will be described first below.

[0042] Figure 1 A flowchart illustrating the virtual machine scheduling method provided in an embodiment of this application is shown. Figure 1 As shown, the virtual machine scheduling method provided in this application embodiment includes the following steps: S101 to S106.

[0043] S101. Obtain the IP address of the virtual machine in the first source host machine.

[0044] For example, the first source host machine includes 12 virtual machines, and the IP addresses of the virtual machines in the first source host machine are 192.210.17.1, 192.210.17.2, 192.210.17.3, 192.210.17.4, 192.210.17.5, 192.210.17.6, 192.210.17.7, 192.210.17.8, 192.210.17.9, 192.210.18.1, and 192.210.18.2.

[0045] S102. Calculate the IP address of the first virtual machine to be migrated in the first source host machine based on the number of IPs contained in the preset consecutive IP and the virtual machine IP.

[0046] The number of IPs included in the preset consecutive IP can be set manually. For example, if the preset number of IPs included in the consecutive IP is set to 3, then the IP addresses of the virtual machines with consecutive IPs in the first source host can be 192.210.17.1, 192.210.17.2, and 192.210.17.3, respectively.

[0047] Among them, consecutive IPs, assuming that the number of IPs included in the preset consecutive IPs is N (N is greater than or equal to 2), then the number of IP addresses between any two virtual IPs belonging to the same Virtual Local Area Network (VLAN) on each host must be greater than N-2 in order to satisfy the anti-affinity association rule based on consecutive IPs.

[0048] It should be noted that when calculating the first virtual machine to be migrated, the association rule type of the virtual machine's IP address should be given priority. The association rule type of the virtual machine's IP address can be manually set, including anti-affinity rules and affinity rules.

[0049] Among them, the anti-affinity association rule for consecutive IPs means that multiple virtual machines that achieve high availability of business functions using master-slave or cluster modes must be under the same VLAN. Generally, the IPs of multiple virtual machines that achieve high availability of business functions using master-slave or cluster modes are consecutive IPs. When selecting the first virtual machine to be migrated, priority is given to selecting the virtual machine to be migrated from multiple virtual machines with consecutive IPs on the same host. At the same time, when determining the first target host, the host machine that carries the virtual machine with the IP adjacent to the virtual machine to be migrated is first excluded. The host machine to which the virtual machine belongs is selected first, and the business system of the virtual machine it carries is different from the business system of the virtual machine to which the virtual machine to be migrated belongs.

[0050] For example, setting virtual machines with IP addresses of 192.210.17.8 and 192.210.17.1 is an anti-affinity rule, while setting virtual machines with IP addresses of 192.210.18.1 and 192.210.18.2 is an affinity rule.

[0051] In one embodiment, the last digit of the IP address of each virtual machine in the first source host is divided by a preset number of consecutive IP addresses. Virtual machines with the same remainder are considered to be in the same group, i.e., N virtual machine groups.

[0052] For example, when N equals 3, the 11 virtual machines in the first source host are divided into four groups. The virtual machines in the first group are 192.210.17.1, 192.210.17.4, and 192.210.17.7, the virtual machines in the second group are 192.210.17.2, 192.210.17.5, and 192.210.17.8, the virtual machines in the third group are 192.210.17.3, 192.210.17.6, and 192.210.17.9, and the virtual machines in the fourth group are 192.210.18.1 and 192.210.18.2.

[0053] Among them, the virtual machines in the fourth group are virtual machines that are manually configured to conform to affinity rules. The priority of manually configured affinity association rules is higher than the priority of the default anti-affinity association rules based on consecutive IPs. Therefore, the virtual machines in the fourth group will not be migrated.

[0054] Furthermore, if there is only one virtual machine in a virtual machine group, the virtual machines in that virtual machine group will not be migrated.

[0055] To ensure that there are no virtual machines in the source host that meet the consecutive IP rule, two groups of virtual machines from the first to the third group in the first source host need to be migrated, that is, the N-1 group of virtual machines needs to be migrated out.

[0056] In one embodiment, two groups of virtual machines can be selected from the first to the third groups of virtual machines in the first source host for migration using preset migration rules.

[0057] In one embodiment, the virtual machines in each virtual machine group are sorted by memory usage, and the virtual machine group with the largest single virtual machine memory usage is selected to remain on the source host, while the virtual machines in the other virtual machine groups are migrated out.

[0058] If multiple virtual machine groups have the same memory usage at the same position when sorted by memory usage from largest to smallest, then compare the memory usage of the next virtual machine at the same position.

[0059] In one embodiment, if all virtual machines in each virtual machine group have the same memory footprint, the virtual machine group with the highest-ranked virtual machine IP address will be migrated out.

[0060] S103. Based on the IP address of the first virtual machine to be migrated, obtain the first resource data of the first virtual machine to be migrated. The first resource data includes the memory usage, bandwidth utilization, CPU utilization, number of virtual machine CPU cores, and memory capacity of the first virtual machine to be migrated.

[0061] The first virtual machine to be migrated includes a single virtual machine or multiple virtual machines whose IP addresses are consecutive to those of the virtual machines in the source host machine.

[0062] In one embodiment, when the first virtual machine to be migrated includes multiple virtual machines whose IP addresses are consecutive to those of the virtual machines in the source host, the memory usage of the multiple virtual machines in the first virtual machine to be migrated can be added to the virtual machine queue for which the migration plan needs to be calculated, i.e., the list of virtual machines to be migrated, in descending order, and the first target host of the virtual machine with the larger memory provision capacity is obtained first.

[0063] In one embodiment, the first virtual machine to be migrated may also be a virtual machine that is selected by the user and needs to be migrated.

[0064] S104. Obtain the second resource data of the first target host machine. The first target host machine does not include virtual machines whose IP addresses satisfy a preset consecutive IP address with the IP address of the first virtual machine to be migrated. The second resource data includes the memory usage, bandwidth utilization, CPU utilization, number of physical CPU cores, total memory capacity of virtual machines in the first target host machine that are powered on, and physical memory capacity of the host machine.

[0065] In some embodiments, before obtaining the first target host, it can be determined whether the list of virtual machines to be migrated is empty. If the list is empty, it means that there is no first virtual machine to be migrated. If the list is not empty, the resource utilization of the host corresponding to the first virtual machine to be migrated is obtained, and the first target host is determined. In determining the first target host, hosts containing virtual machines with consecutive IP addresses to the first virtual machine to be migrated, or virtual machines that satisfy user-defined anti-affinity association rules with the first virtual machine to be migrated, need to be excluded. For example, when obtaining the first target host, it is first determined whether the host includes virtual machines with IP addresses that satisfy a preset consecutive IP address to the first virtual machine to be migrated, and whether there are virtual machines in the host that satisfy the anti-affinity rules with the first virtual machine to be migrated. If the host does not include virtual machines with IP addresses that satisfy a preset consecutive IP address to the first virtual machine to be migrated, and there are no virtual machines in the host that satisfy the anti-affinity rules with the first virtual machine to be migrated, then the host can be selected as a target host.

[0066] During the process of determining the first target host, hosts that are unavailable must be excluded. Then, it is determined whether there is a suitable host among the multiple hosts corresponding to the first virtual machine to be migrated that meets the virtual machine's consecutive IP address requirement and anti-affinity requirement, and is in a normal state. This means that the suitable host does not have a virtual machine with a consecutive IP address matching the first virtual machine to be migrated, nor does it have a virtual machine that meets the user-defined anti-affinity association rule with the first virtual machine to be migrated, and the suitable host is in an available state. If no suitable host exists, the IP address of the first virtual machine to be migrated that has not generated migration information is recorded; if a suitable host exists, a host that meets the preferred criteria is selected as the first target host.

[0067] In some embodiments, the first target host machine can be determined directly based on the user's specification.

[0068] S105. Based on the first resource data and the second resource data, calculate the estimated resource utilization rate of the first target host machine. The estimated resource utilization rate includes the estimated first memory utilization rate, the estimated first bandwidth utilization rate, the estimated first CPU utilization rate, and the estimated first super-resolution ratio of the first target host machine.

[0069] In some embodiments, the first memory utilization estimate, the first bandwidth utilization estimate, the first CPU utilization estimate, and the first memory super-resolution ratio estimate are calculated using the following formulas:

[0070]

[0071]

[0072]

[0073] S106. When the first source host and the first target host meet the first migration rule, the first migration information is determined based on the first resource data and the second resource data. The first migration information is used to migrate the first virtual machine to be migrated to the first target host.

[0074] The first migration rule includes:

[0075] All of the following conditions must be met: the first estimated memory utilization is less than the first memory utilization threshold, the first estimated bandwidth utilization is less than the first bandwidth utilization threshold, the first estimated CPU utilization is less than the first CPU utilization threshold, and the first estimated super-resolution ratio is less than the first super-resolution ratio threshold. Furthermore, the first target host does not include any virtual machines whose IP addresses satisfy the preset consecutive IP address of the first virtual machine to be migrated.

[0076] The first migration rule is the direct migration rule.

[0077] In some embodiments, for the following virtual machines, the direct migration of the virtual machine can be prioritized for migration.

[0078] For example, the virtual machines that need to be migrated are selected by the user; virtual machines that are automatically created and assigned IPs through the cloud resource management platform; virtual machines that need to be migrated to other hosts when the host utilization is higher than the set alarm threshold; virtual machines that need to be integrated and migrated when the virtualization cluster utilization is low; in the swap migration scenario, each candidate target host needs to select virtual machines to be migrated out; based on the set anti-affinity association rules, the system automatically audits and finds virtual machines that meet the anti-affinity association rules, and selects virtual machines with smaller memory consumption as the virtual machines to be migrated, so that the remaining virtual machines on the host meet the anti-affinity association rules set by the user.

[0079] In one embodiment, the first memory utilization threshold, the first bandwidth utilization threshold, and the first CPU utilization threshold of the first target host machine can be alarm thresholds set manually based on experience. When at least one of the following conditions is met—that the first memory utilization estimate is greater than the first memory utilization threshold, the first bandwidth utilization estimate is greater than the first bandwidth utilization threshold, the first CPU utilization estimate is greater than the first CPU utilization threshold, and the first super-resolution ratio estimate is greater than the first super-resolution ratio threshold—migrating the first virtual machine to be migrated to the first target host machine may cause the resource utilization of the first target host machine to reach its utilization limit, thereby causing the target host machine to crash.

[0080] When the first virtual machine to be migrated and the first target host meet the first migration rule, the first virtual machine to be migrated and the first target host are matched to determine the first migration information of the first virtual machine to be migrated. The first migration information of the first virtual machine to be migrated includes the first virtual machine to be migrated and the first target host after the match, as well as the resource utilization rates of the first virtual machine to be migrated and the first target host after the migration, so as to migrate the first virtual machine to be migrated to the first target host.

[0081] In one embodiment, when the first virtual machine to be migrated and the first target host meet the first migration rule, it means that the first target host is the host machine when the first virtual machine to be migrated is migrated. When the first virtual machine to be migrated includes multiple virtual machines, when migrating the first virtual machine to be migrated to the first target host, the first virtual machine to be migrated only needs to execute the migration task itself in sequence to achieve the migration purpose. That is, after the first virtual machine to be migrated is migrated to the first target host, there are no virtual machines with consecutive IP addresses in the source host.

[0082] The above is a specific implementation of the virtual machine scheduling method provided in this application embodiment. Based on the characteristic that the IP addresses of multiple virtual machines carrying the same business function in a single host are consecutive IPs, the method obtains the IP addresses of virtual machines in the first source host, and calculates the IP address of the first virtual machine to be migrated in the first source host according to the number of IPs included in the preset consecutive IPs and the virtual machine IP. Then, based on the IP address of the first virtual machine to be migrated, the method obtains the first resource data of the first virtual machine to be migrated. The first resource data includes the memory usage, bandwidth utilization, CPU utilization, number of virtual machine CPU cores, and memory capacity of the first virtual machine to be migrated. Then, the method obtains the second resource data of the first target host. The first target host does not include virtual machines whose IP addresses satisfy the preset consecutive IPs of the first virtual machine to be migrated. The second resource data includes the memory usage, bandwidth utilization, CPU utilization, number of physical CPU cores, total memory capacity of virtual machines in the first target host when they are powered on, and physical memory capacity of the host. Then, based on the first resource data and the first resource data, the method obtains the second resource data of the first target host. The second resource data is used to calculate the estimated resource utilization of the first target host machine. The estimated resource utilization includes the estimated memory utilization, estimated bandwidth utilization, estimated CPU utilization, and estimated super-resolution ratio of the first target host machine. When all the following conditions are met, i.e., when the first source host machine and the first target host machine meet the first migration rule, the first resource data and the second resource data are used to determine the first migration information. The first migration information is used to migrate the first virtual machine to be migrated to the first target host machine, so that there is no first virtual machine to be migrated with consecutive IP addresses among the multiple virtual machines hosted by the source host machine, thereby solving the problem of multiple virtual machines carrying the same business function failing simultaneously due to the failure of a single host machine.

[0083] In some embodiments, when the first target host includes multiple host machines, i.e., the multiple host machines and the first virtual machine to be migrated satisfy the first migration rule, an optimal host machine can be selected from the multiple host machines as the target host machine to which the first virtual machine to be migrated is migrated, according to a first preset priority rule. Before selecting an optimal host machine from the multiple host machines as the target host machine to which the first virtual machine to be migrated is migrated according to the first preset priority rule, the business system to which the first virtual machine to be migrated belongs is obtained.

[0084] In one embodiment, the first preset priority rule may include: when multiple host machines and the first virtual machine to be migrated meet the first migration rule, the host machine to which the business system of the virtual machine being hosted is different from the business system of the first virtual machine to be migrated is selected as the target host machine to which the first virtual machine to be migrated is migrated.

[0085] In one embodiment, the first preset priority rule may further include: when there are multiple host machines hosting virtual machines whose business systems are different from the business systems of the virtual machines to be migrated, the host machine with lower memory utilization is selected as the target host machine to which the first virtual machine to be migrated is moved.

[0086] In one embodiment, the first preset priority rule may further include: when multiple host machines have the same memory utilization rate and are lower than other host machines in the cluster, the host machine with the lower bandwidth utilization rate shall be selected as the target host machine for the first virtual machine to be migrated.

[0087] In one embodiment, the first preset priority rule may further include: when multiple host machines have the same bandwidth utilization rate and are lower than other host machines in the cluster, the host machine with the lower CPU utilization rate shall be selected as the target host machine for the first virtual machine to be migrated.

[0088] In one embodiment, the first preset priority rule may further include: when multiple host machines have the same CPU utilization and are lower than other host machines in the cluster, selecting the host machine with the higher IP ranking as the target host machine for the first virtual machine to be migrated.

[0089] By determining whether multiple host machines and the first virtual machine to be migrated meet the first preset priority rule, the optimal host machine can be selected from multiple host machines as the target host machine for the first virtual machine to be migrated, thereby obtaining the best migration scheme corresponding to the first migration information.

[0090] In some embodiments, when the first virtual machine to be migrated is a virtual machine selected by the user, it is not necessary to consider whether the first virtual machine to be migrated includes virtual machines with consecutive IP addresses in the source host. When the second resource utilization of the first target host is obtained and the first virtual machine to be migrated is migrated based on the first migration rule, the first virtual machine to be migrated can be migrated directly to meet the user's actual migration needs.

[0091] In some embodiments, when the first virtual machine to be migrated can be a virtual machine that is automatically created and has been assigned an IP address, when the second resource utilization of the first target host is obtained and the first virtual machine to be migrated is migrated based on the first migration rule, the first virtual machine to be migrated can be migrated directly, so that the cloud resource management platform to which the first virtual machine to be migrated belongs can improve the efficiency of virtual machine migration.

[0092] In some embodiments of this application, the above method further includes the following steps: S107 to S111.

[0093] S107. When the first source host and the first target host do not meet the first migration rule, calculate the resource difference based on the second resource data and the first memory utilization threshold, the first bandwidth utilization threshold, or the first CPU utilization threshold. The resource difference includes memory resource difference, CPU resource difference, or bandwidth resource difference.

[0094] S108. Based on the resource difference and the second resource data, determine the IP address of the second virtual machine to be migrated in the first target host and the third resource data. The third resource data includes the memory usage, bandwidth utilization, CPU utilization, number of virtual machine CPU cores, and memory capacity of the second virtual machine to be migrated.

[0095] S109. Obtain the fourth resource data of the second target host machine. The second target host machine does not include virtual machines whose IP addresses meet the preset consecutive IP addresses of the second virtual machine to be migrated. The fourth resource data includes the memory usage, bandwidth utilization, CPU utilization, physical CPU core count, total memory capacity of virtual machines in the second target host machine that are powered on, and physical memory capacity of the host machine.

[0096] S110. Based on the third resource data and the fourth resource data, calculate the estimated resource utilization rate of the second target host machine. The estimated resource utilization rate includes the estimated second memory utilization rate, the estimated second bandwidth utilization rate, the estimated second CPU utilization rate, and the estimated second super-resolution ratio of the second target host machine.

[0097] S111. When the first target host and the second target host meet the second migration rule, the second migration information is determined based on the first resource data, the second resource data, the third resource data and the fourth resource data. The second migration information is used to migrate the second virtual machine to be migrated to the second target host and to migrate the first virtual machine to be migrated to the first target host.

[0098] The second migration rule includes:

[0099] All of the following conditions must be met: the second estimated memory utilization is less than the second estimated memory utilization threshold, the second estimated bandwidth utilization is less than the second estimated bandwidth utilization threshold, the second estimated CPU utilization is less than the second estimated CPU utilization threshold, and the second estimated super-resolution ratio is less than the second super-resolution ratio threshold. Furthermore, the second target host does not include any virtual machines whose IP addresses are consecutive to the IP addresses of the second virtual machine to be migrated.

[0100] During the virtual machine migration process, if the first source host and the first target host do not meet the first migration rule, it means that the direct migration method cannot find a target host whose resource utilization does not exceed the preset resource utilization threshold for the virtual machine to be migrated. In this case, the swap migration algorithm will be used to determine the target host that meets the above rule.

[0101] In one embodiment, based on the second resource data and the first memory utilization threshold, the first bandwidth utilization threshold, or the first CPU utilization threshold, the calculation formula for the difference in memory resources, CPU resources, or bandwidth resources is as follows:

[0102] Memory resource difference = Target host machine memory capacity × (Target host machine memory utilization rate - First memory utilization threshold)

[0103] CPU resource difference = Number of CPU cores in the target host × (Second CPU utilization rate - First CPU utilization rate threshold) Bandwidth resource difference = Bandwidth capacity of the target host × (Target host bandwidth utilization rate - First bandwidth utilization rate threshold)

[0104] Based on the resource difference, calculate the maximum value Nmax of the host machine CPU utilization difference, memory utilization difference, and bandwidth utilization difference after converting them into the target host machine resource capacity ratio.

[0105] The formulas for calculating the differences in host CPU utilization, memory utilization, and bandwidth utilization after conversion to the target host's resource capacity percentage are as follows:

[0106]

[0107]

[0108]

[0109] Wherein, Nm represents the percentage difference in host memory resources after conversion to the target host memory capacity percentage; Nc represents the percentage difference in host CPU resources after conversion to the target host CPU capacity percentage; and Nn represents the percentage difference in host bandwidth resources after conversion to the target host bandwidth capacity percentage.

[0110] Nmax is the maximum value among Nm, Nc, and Nn, i.e., Nmax = max{Nm, Nc, Nn}.

[0111] Determine if Nmax is greater than 0.

[0112] If Nmax is greater than 0, it is determined whether there are any virtual machines that can be migrated out of the target host. If Nmax is less than or equal to 0, the target host is marked as a host that has completed the migration out of virtual machines, which means that there are no virtual machines that need to be migrated out in the target host.

[0113] If the target host has virtual machines that can be migrated out, the virtual machine to be migrated out is selected according to the resource type and resource difference corresponding to Nmax, as well as the amount of resources of that type and the service level occupied by the virtual machine on the target host, according to the preset selection rules. That is, the second virtual machine to be migrated in the first target host. If the target host does not have virtual machines that can be migrated out, the target host is excluded from the selectable hosts.

[0114] The preset selection rules include: prioritizing the selection of virtual machines with lower service levels on the target host that meet the resource difference corresponding to Nmax and have the smallest memory resource consumption; if no virtual machine meets the resource difference corresponding to Nmax, then prioritizing the selection of virtual machines with lower service levels whose resource consumption difference from the resource difference corresponding to Nmax is less than a set threshold and has the smallest memory consumption.

[0115] When the second virtual machine to be migrated includes multiple virtual machines, the selected virtual machine that needs to be migrated out is excluded from the list of remaining selectable virtual machines on the target host. The process continues to check whether Nmax is greater than 0 and selects the next virtual machine to be migrated out, until there are no more selectable virtual machines to be migrated out on the target host.

[0116] After identifying the second virtual machine to be migrated in the first target host, the IP address and third resource data of the second virtual machine to be migrated in the first target host are obtained based on the resource difference and the second resource data. At this point, the fourth resource data of the second target host is obtained.

[0117] For the sake of brevity, the details will not be elaborated here. Refer to the migration process of the first virtual machine to be migrated from the first source host to the first target host. The second virtual machine to be migrated from the first target host is then migrated to the second target host. This is so that, provided that the resource data of the second target host does not exceed the alarm threshold, after the second virtual machine to be migrated is migrated to the second target host, the first virtual machine to be migrated from the first source host is then migrated to the first target host.

[0118] In one embodiment, the second target host can also be the first source host. That is, by swapping the virtual machines in the first source host with the virtual machines in the first target host, the effect of distributing virtual machines with consecutive IPs in the source host to different hosts can be achieved.

[0119] After the virtual machine to be migrated is migrated from the source host, the estimated resource utilization of the source host needs to be calculated using the following formula:

[0120]

[0121]

[0122]

[0123]

[0124] By migrating virtual machines from the first target host that can be migrated using the direct migration scheme and meet the second migration rules, and swapping them to the second target host, virtual machines with consecutive IP addresses in the source host are distributed to different hosts through swap migration, thus avoiding the simultaneous failure of multiple virtual machines carrying the same business function due to the failure of a single host.

[0125] In one swap migration embodiment, when the first target host includes multiple hosts, an optimal host can be selected from the multiple hosts according to a second preset priority rule, which is the source host where the second virtual machine to be migrated resides. Before selecting an optimal host from the multiple hosts according to the second preset priority rule as the source host where the second virtual machine to be migrated resides, the business system level coefficient and host IP sorting corresponding to the second virtual machine to be migrated are obtained.

[0126] In one embodiment, the second preset priority rule may include: among multiple first target host machines, the host machine with the smallest sum of business system level coefficients corresponding to each migrated virtual machine is selected as the source host machine where the second virtual machine to be migrated is located.

[0127] In one embodiment, the second preset priority rule may further include: among multiple first target host machines, the host machine with the least total memory capacity actually occupied by the migrated virtual machine is selected as the source host machine where the second virtual machine to be migrated is located.

[0128] In one embodiment, the second preset priority rule may further include: among multiple first target host machines, the host machine with the least total bandwidth resources actually occupied by the migrated virtual machine is selected as the source host machine where the second virtual machine to be migrated is located.

[0129] In one embodiment, the second preset priority rule may further include: among multiple first target host machines, the host machine with the least total CPU resources actually occupied by the migrated virtual machine is selected as the source host machine where the second virtual machine to be migrated is located.

[0130] In one embodiment, the second preset priority rule may further include: among multiple first target host machines, the host machine with the highest IP address in the host machine ranking is selected as the source host machine where the second virtual machine to be migrated is located.

[0131] By determining whether multiple host machines and the second virtual machine to be migrated meet the second preset priority rule, the optimal host machine can be selected from multiple host machines as the source host machine where the second virtual machine to be migrated is located. The target host machine of the second virtual machine to be migrated is calculated according to the second migration rule, thereby obtaining the best migration scheme corresponding to the second migration information.

[0132] It should be noted that the second migration rule is a judgment rule for virtual machine swap migration schemes. Based on the virtual machine swap migration scheme, after the virtual machine to be migrated is moved to the candidate target host, the resource difference between the target host's CPU utilization, memory utilization, bandwidth utilization, and memory super-resolution ratio and the set utilization upper limit, such as the target host's CPU utilization threshold, memory utilization threshold, bandwidth utilization threshold, and memory super-resolution ratio threshold, and the virtual machine resource data and performance data of the virtual machines on the target host that satisfy the anti-affinity association rule with the virtual machine to be migrated, is calculated for each target host. A portion of the virtual machines on the target host are migrated out, so that the virtual machines on the target host and the virtual machines to be migrated satisfy the anti-affinity association rule, and after the virtual machine to be migrated is moved to the target host, the target host's CPU utilization, memory utilization, bandwidth utilization, and memory super-resolution ratio do not exceed the set threshold upper limit.

[0133] If multiple target host machines can calculate virtual machine migration plans that satisfy the second migration rule, then select the host machine with the least resource consumption and business impact of the virtual machines to be migrated.

[0134] In one embodiment, the virtual machine with the least overall impact can be selected from the host machine as the virtual machine to be migrated out, based on the difference between the host machine's CPU, memory, and bandwidth resource utilization and the corresponding upper limit threshold, as well as the virtual machine's CPU, memory, and bandwidth resource usage and business importance level, in order to avoid failures caused by excessive utilization of the target host machine.

[0135] In some embodiments of this application, the above method further includes the following steps: S112 to S113.

[0136] S112. Obtain resource data for each host machine in the virtualization cluster. Each host machine in the virtualization cluster does not include virtual machines with IP addresses that meet the preset consecutive IPs. The resource data for each host machine includes the memory usage, bandwidth utilization, CPU utilization, number of physical CPU cores, total memory capacity of virtual machines that are powered on, and physical memory capacity of the host machine.

[0137] S113. When the resource utilization rate of the virtualization cluster is less than or equal to the first preset resource threshold, the host machine with the lowest resource utilization rate in the virtualization cluster is taken as the second source host machine. According to the first migration rule, the second migration rule, and the resource data of the second source host machine and the third target host machine, the third migration information is determined. The third migration information is used to migrate the virtual machines in the second source host machine to the third target host machine until the resource utilization rate of the virtualization cluster is greater than the first preset resource threshold machine, so as to solve the problem of high energy consumption caused by the low resource utilization rate of the host machine.

[0138] The first preset resource threshold is the lower limit of resource utilization in the virtualization cluster. It can be set manually and is the threshold for triggering resource integration of the host machine in the virtualization cluster.

[0139] When a virtualization cluster experiences an imbalance in host machine load, meaning there are hosts in the virtualization cluster with excessively high resource utilization, the unbalanced resource utilization of the virtualization cluster can lead to excessively high host machine resource utilization and subsequent downtime.

[0140] To address load imbalance scenarios in virtualization clusters, resource data for each host machine in the cluster can be obtained. Host machines with resource utilization exceeding a second preset resource threshold are designated as source hosts. Based on the first migration rule, the second migration rule, and the resource data of the source and candidate target hosts (i.e., direct migration and swap migration rules), third migration information is determined. Virtual machines from the source hosts are then migrated to the target hosts until no host machine in the cluster has a resource utilization greater than or equal to the second preset resource threshold. The second preset resource threshold is the resource utilization threshold for normal operation of virtualization hosts and can be manually set; it serves as the threshold for triggering load balancing among hosts in the virtualization cluster.

[0141] By using direct migration rules and swap migration rules, virtual machines in the source host are migrated to the target host until there are no host machines in the virtualization cluster with resource utilization greater than or equal to the second preset resource threshold. This ensures that the load of each host machine in the virtualization cluster is balanced, avoiding downtime caused by excessive host machine resource utilization.

[0142] In some embodiments of this application, the above method further includes the following step: S114.

[0143] S114. When the resource utilization rate of the host machine is greater than or equal to the second preset resource threshold, the host machine with the resource utilization rate greater than or equal to the second preset resource threshold is taken as the second source host machine. According to the first migration rule, the second migration rule, and the resource data of the second source host machine and the third target host machine, the fourth migration information is determined. The fourth migration information is used to migrate the virtual machine in the second source host machine to the third target host machine until the resource utilization rate in the second source host machine is less than the second preset resource threshold machine.

[0144] To address load imbalance scenarios in virtualization clusters, resource data for each host machine in the virtualization cluster can be obtained. The host machine with resource utilization exceeding a second preset resource threshold can be selected as the source host machine. Based on the first migration rule, the second migration rule, and the resource data of the source host machine and the candidate target host machine (i.e., based on the direct migration rule and the swap migration rule), the fourth migration information is determined. Virtual machines in the source host machine are then migrated to the target host machine until the resource utilization of the source host machine is less than or equal to the second preset resource threshold machine.

[0145] Specifically, the resource utilization of the host machines in the virtualization cluster is monitored periodically; it is determined whether the resource utilization of the virtualization cluster is lower than the threshold for triggering host machine resource consolidation; based on the host machine utilization and the service level of the virtual machines carried by each host machine, the host machines that need to release resources are determined; the direct migration algorithm and the swap migration algorithm are called to calculate the target host machine for all virtual machines on the host machines that need to release resources; all virtual machines on the host machines that need to release resources are migrated to the target host machines in the cluster; it is determined whether all virtual machines to be migrated in the virtualization cluster have been migrated; if the virtual machines to be migrated have not been migrated, the migration of all virtual machines on the host machines that need to release resources is continued to the target host machines in the cluster until all virtual machines to be migrated have been migrated. At this point, all virtual machines carried by the host machines that need to release resources are moved out, and the host machine is automatically shut down.

[0146] By using direct migration rules and swap migration rules, virtual machines in the source host are migrated to the target host until all virtual machines in the source host are migrated out so that the source host can be shut down, thereby achieving intelligent power management and minimizing power consumption.

[0147] In one embodiment, after determining the migration information, the virtual machine migration is performed based on the migration information by calling the virtual machine migration API interface of an open-source cloud computing management platform, such as OpenStack's virtual machine migration API interface, or VMware's virtualization platform's virtual machine migration API interface.

[0148] For scenarios such as initial virtual machine allocation, virtualization cluster load balancing, and virtualization cluster energy saving, the Open Stack virtual machine intelligent migration scheduling function has been implemented to ensure that when initially allocating virtual machines, multiple virtual machines with adjacent IPs can be distributed to different hosts according to the default anti-affinity rules based on consecutive IPs.

[0149] In one embodiment, the host machine in the virtual machine cluster that has had its resources fully released is automatically shut down by calling the Intelligent Platform Management Interface (IPMI) in the server hardware management.

[0150] In one embodiment, enterprise-grade open-source solutions, such as Zabbix, which provide distributed system monitoring and network monitoring functions based on a web interface, can collect real-time performance data of Open Stack hosts and virtual machines, that is, collect relevant data involving resource utilization of the source host or target host.

[0151] Based on the virtual machine scheduling method provided in the above embodiments, this application also provides specific implementations of a virtual machine scheduling device. Please refer to the following embodiments.

[0152] First see Figure 2 The virtual machine scheduling device provided in this application embodiment includes the following modules:

[0153] The acquisition module 201 is used to obtain the IP address of the virtual machine in the first source host machine;

[0154] The calculation module 202 is used to calculate the IP of the first virtual machine to be migrated in the first source host machine according to the preset continuous IP rules and the virtual machine IP.

[0155] The acquisition module 201 is also used to acquire the first resource data of the first virtual machine to be migrated based on the IP address of the first virtual machine to be migrated. The first resource data includes the memory usage, bandwidth utilization, CPU utilization, number of virtual machine CPU cores, and memory capacity of the first virtual machine to be migrated.

[0156] The acquisition module 201 is also used to acquire the second resource data of the first target host machine. The first target host machine does not include virtual machines whose IP addresses satisfy a preset consecutive IP address with the IP address of the first virtual machine to be migrated. The second resource data includes the memory usage, bandwidth utilization, CPU utilization, number of physical CPU cores, total memory capacity of virtual machines in the first target host machine in the powered-on state, and physical memory capacity of the host machine.

[0157] The calculation module 202 is also used to calculate the estimated resource utilization rate of the first target host machine based on the first resource data and the second resource data. The estimated resource utilization rate includes the estimated first memory utilization rate, the estimated first bandwidth utilization rate, the estimated first CPU utilization rate, and the estimated first super-resolution ratio of the first target host machine.

[0158] The determination module 203 is used to determine first migration information based on first resource data and second resource data when the first source host and the first target host meet the first migration rules. The first migration information is used to migrate the first virtual machine to be migrated to the first target host.

[0159] The first migration rule includes:

[0160] All of the following conditions must be met: the first estimated memory utilization is less than the first memory utilization threshold, the first estimated bandwidth utilization is less than the first bandwidth utilization threshold, the first estimated CPU utilization is less than the first CPU utilization threshold, and the first estimated super-resolution ratio is less than the first super-resolution ratio threshold. Furthermore, the first target host does not include any virtual machines whose IP addresses satisfy the preset consecutive IP address of the first virtual machine to be migrated.

[0161] The above is a specific implementation of the virtual machine scheduling device provided in this application embodiment. Based on the characteristic that the IP addresses of multiple virtual machines carrying the same business function in a single host are consecutive IPs, the acquisition module 201 acquires the IP address of the virtual machine in the first source host, and calculates the IP address of the first virtual machine to be migrated in the first source host according to the preset number of IPs contained in the consecutive IPs and the virtual machine IP. The acquisition module 202 then calculates the IP address of the first virtual machine to be migrated in the first source host. The acquisition module 201 then acquires the first resource data of the first virtual machine to be migrated according to the IP address of the first virtual machine to be migrated. The first resource data includes the memory usage, bandwidth utilization, CPU utilization, number of virtual machine CPU cores, and memory capacity of the first virtual machine to be migrated. The acquisition module 201 then acquires the second resource data of the first target host. The resource data includes: the first target host machine does not include virtual machines with IP addresses that meet a preset consecutive IP address requirement with the first virtual machine to be migrated; the second resource data includes the memory usage, bandwidth utilization, CPU utilization, number of physical CPU cores, total memory capacity of virtual machines in the powered-on state on the first target host machine, and physical memory capacity of the host machine; the calculation module 202 then calculates the estimated resource utilization data of the first target host machine based on the first and second resource data, including the estimated first memory utilization, estimated first bandwidth utilization, estimated first CPU utilization, and estimated first super-resolution ratio of the first target host machine. When all of the following conditions are met: the first memory utilization estimate is less than the first memory utilization threshold, the first bandwidth utilization estimate is less than the first bandwidth utilization threshold, the first CPU utilization estimate is less than the first CPU utilization threshold, and the first super-resolution ratio estimate is less than the first super-resolution ratio threshold, that is, when the first source host and the first target host meet the first migration rule, the determining module 203 determines the first migration information based on the first resource data and the second resource data. The first migration information is used to migrate the first virtual machine to be migrated to the first target host, so that there is no first virtual machine to be migrated with consecutive IP addresses among the multiple virtual machines carried by the source host, thereby solving the problem of multiple virtual machines carrying the same business function failing simultaneously due to the failure of a single host.

[0162] In some embodiments of this application, the above-mentioned calculation module 202 can also be used to calculate a resource difference based on the second resource data and the first memory utilization threshold, the first bandwidth utilization threshold, or the first CPU utilization threshold when the first source host and the first target host do not meet the first migration rule. The resource difference includes memory resource difference, CPU resource difference, or bandwidth resource difference.

[0163] The aforementioned determining module 203 is also used to determine the IP address of the second virtual machine to be migrated in the first target host machine and the third resource data based on the resource difference and the second resource data. The third resource data includes the memory usage, bandwidth utilization, CPU utilization, number of virtual machine CPU cores, and memory capacity of the second virtual machine to be migrated.

[0164] The aforementioned acquisition module 201 is also used to acquire the fourth resource data of the second target host machine. The second target host machine does not include virtual machines whose IP addresses satisfy a preset consecutive IP address with the IP address of the second virtual machine to be migrated. The fourth resource data includes the memory usage, bandwidth utilization, CPU utilization, number of physical CPU cores, total memory capacity of virtual machines in the second target host machine in the powered-on state, and physical memory capacity of the host machine.

[0165] The aforementioned calculation module 202 is also used to calculate the estimated resource utilization rate of the second target host machine based on the third resource data and the fourth resource data. The estimated resource utilization rate includes the estimated second memory utilization rate, the estimated second bandwidth utilization rate, the estimated second CPU utilization rate, and the estimated second super-resolution ratio of the second target host machine.

[0166] The aforementioned determining module 203 is further configured to determine second migration information based on the first resource data, the second resource data, the third resource data, and the fourth resource data when the first target host and the second target host meet the second migration rules. The second migration information is used to migrate the second virtual machine to be migrated to the second target host and to migrate the first virtual machine to be migrated to the first target host.

[0167] The second migration rule includes:

[0168] All of the following conditions must be met: the estimated second memory utilization rate is less than the second memory utilization rate threshold, the estimated second bandwidth utilization rate is less than the second bandwidth utilization rate threshold, the estimated second CPU utilization rate is less than the second CPU utilization rate threshold, and the estimated second super-resolution ratio is less than the second super-resolution ratio threshold.

[0169] In some embodiments of this application, the acquisition module 201 is further used to acquire resource data of each host machine in the virtualization cluster. Each host machine in the virtualization cluster does not include virtual machines with IP addresses that satisfy a preset consecutive IP. The resource data of each host machine includes the memory usage, bandwidth utilization, CPU utilization, number of physical CPU cores, total memory capacity of virtual machines in the powered-on state, and physical memory capacity of the host machine.

[0170] The aforementioned determining module 203 is further configured to, when the resource utilization rate of the virtualization cluster is less than or equal to the first preset resource threshold, take the host machine with the lowest utilization rate in the virtualization cluster as the second source host machine, and determine the third migration information based on the first migration rule, the second migration rule, and the resource data of the second source host machine and the third target host machine. The third migration information is used to migrate the virtual machines in the second source host machine to the third target host machine until the resource utilization rate of the virtualization cluster is greater than the first preset resource threshold machine.

[0171] In some embodiments of this application, the determining module 203 is further configured to, when the resource utilization rate of the host machine is greater than or equal to the second preset resource threshold, take the host machine with the resource utilization rate greater than or equal to the second preset resource threshold as the second source host machine, and determine the fourth migration information according to the first migration rule, the second migration rule, and the resource data of the second source host machine and the third target host machine. The fourth migration information is used to migrate the virtual machine in the second source host machine to the third target host machine until the resource utilization rate in the second source host machine is less than the second preset resource threshold machine.

[0172] In some embodiments of this application, the acquisition module 201 described above is also used to acquire resource data, IP addresses, and business systems of multiple target host machines.

[0173] The aforementioned determining module 203 is also used to determine the first target host machine from multiple target host machines according to the first preset selection rule.

[0174] In some embodiments of this application, the acquisition module 201 is further used to acquire resource data and IP addresses of multiple target host machines, as well as the business system level coefficients and business systems of virtual machines in the multiple target host machines.

[0175] The aforementioned determining module 203 is also used to determine the source host machine where the second virtual machine to be migrated is located from multiple target host machines according to the second preset selection rule.

[0176] Figure 2 The virtual machine scheduling device shown can achieve Figure 1 The steps of the virtual machine scheduling method shown, and the corresponding technical effects achieved, will not be elaborated here for the sake of brevity.

[0177] Figure 3 A schematic diagram of the hardware structure of the virtual machine scheduling device provided in an embodiment of this application is shown.

[0178] The scheduling device for a virtual machine may include a processor 301 and a memory 302 storing computer program instructions.

[0179] Specifically, the processor 301 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0180] Memory 302 may include mass storage for data or instructions. For example, and not limitingly, memory 302 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 302 may include removable or non-removable (or fixed) media. Where appropriate, memory 302 may be internal or external to the virtual machine's scheduling device. In a particular embodiment, memory 302 is non-volatile solid-state memory.

[0181] In certain embodiments, memory 302 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Therefore, typically, memory 302 includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method disclosed in the first aspect of this application.

[0182] The processor 301 implements any of the virtual machine scheduling methods described in the above embodiments by reading and executing computer program instructions stored in the memory 302.

[0183] In one example, the virtual machine scheduling device may further include a communication interface 303 and a bus 310. Wherein, as... Figure 3 As shown, the processor 301, memory 302, and communication interface 303 are connected through bus 310 and complete communication with each other.

[0184] The communication interface 303 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0185] Bus 310 includes hardware, software, or both, that couples components of a virtual machine's scheduling device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 310 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.

[0186] Furthermore, in conjunction with the virtual machine scheduling methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the virtual machine scheduling methods in the above embodiments.

[0187] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0188] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0189] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0190] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments disclosed in this application. It should be understood that each block in 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, a special-purpose computer, or other programmable data processing apparatus to create a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor may be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0191] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for scheduling virtual machines, characterized in that, include: Obtain the IP address of the virtual machine in the first source host machine; Based on the preset number of IPs contained in the consecutive IPs and the virtual machine IP, calculate the IP address of the first virtual machine to be migrated in the first source host; Based on the IP address of the first virtual machine to be migrated, obtain the first resource data of the first virtual machine to be migrated. The first resource data includes the memory usage, bandwidth utilization, CPU utilization, number of virtual machine CPU cores, and memory capacity of the first virtual machine to be migrated. Obtain second resource data of the first target host machine. The first target host machine does not include virtual machines whose IP addresses satisfy the preset consecutive IPs with the IP addresses of the first virtual machine to be migrated. The second resource data includes the memory usage, bandwidth utilization, CPU utilization, number of physical CPU cores, total memory capacity of virtual machines in the first target host machine when it is powered on, and physical memory capacity of the host machine. Based on the first resource data and the second resource data, the estimated resource utilization rate of the first target host is calculated. The estimated resource utilization rate includes the estimated first memory utilization rate, the estimated first bandwidth utilization rate, the estimated first CPU utilization rate, and the estimated first super-resolution ratio of the first target host. When the first source host and the first target host meet the first migration rule, the first migration information is determined based on the first resource data and the second resource data. The first migration information is used to migrate the first virtual machine to be migrated to the first target host. The first migration rule includes: All of the following conditions must be met: the first memory utilization estimate is less than the first memory utilization threshold; the first bandwidth utilization estimate is less than the first bandwidth utilization threshold; the first CPU utilization estimate is less than the first CPU utilization threshold; and the first super-resolution ratio estimate is less than the first super-resolution ratio threshold. Furthermore, the first target host does not include any virtual machines whose IP addresses satisfy a preset consecutive IP address with the IP address of the first virtual machine to be migrated.

2. The method according to claim 1, characterized in that, The method further includes: When the first source host and the first target host do not meet the first migration rule, a resource difference is calculated based on the second resource data and the first memory utilization threshold, the first bandwidth utilization threshold, or the first CPU utilization threshold. The resource difference includes memory resource difference, CPU resource difference, or bandwidth resource difference. Based on the resource difference and the second resource data, the IP address of the second virtual machine to be migrated in the first target host and the third resource data are determined. The third resource data includes the memory usage, bandwidth utilization, CPU utilization, number of virtual machine CPU cores and memory capacity of the second virtual machine to be migrated. Obtain the fourth resource data of the second target host machine. The second target host machine does not include virtual machines whose IP addresses satisfy the preset consecutive IPs with the IP addresses of the second virtual machine to be migrated. The fourth resource data includes the memory usage, bandwidth utilization, CPU utilization, physical CPU core count, total memory capacity of virtual machines in the second target host machine when it is powered on, and physical memory capacity of the host machine. Based on the third resource data and the fourth resource data, the estimated resource utilization rate of the second target host is calculated. The estimated resource utilization rate includes the estimated second memory utilization rate, the estimated second bandwidth utilization rate, the estimated second CPU utilization rate, and the estimated second super-resolution ratio of the second target host. When the first target host and the second target host meet the second migration rule, the second migration information is determined based on the first resource data, the second resource data, the third resource data and the fourth resource data. The second migration information is used to migrate the second virtual machine to be migrated to the second target host and to migrate the first virtual machine to be migrated to the first target host. The second migration rule includes: All of the following conditions are met: the second memory utilization estimate is less than the second memory utilization threshold; the second bandwidth utilization estimate is less than the second bandwidth utilization threshold; the second CPU utilization estimate is less than the second CPU utilization threshold; and the second super-resolution ratio estimate is less than the second super-resolution ratio threshold.

3. The method according to claim 2, characterized in that, The method further includes: Obtain resource data for each host machine in the virtualization cluster. Each host machine in the virtualization cluster does not include virtual machines with IP addresses that satisfy the preset consecutive IPs. The resource data for each host machine includes the memory usage, bandwidth utilization, CPU utilization, number of physical CPU cores, total memory capacity of virtual machines that are powered on, and physical memory capacity of the host machine. When the resource utilization rate of the virtualization cluster is less than or equal to the first preset resource threshold, the host machine with the lowest utilization rate in the virtualization cluster is selected as the second source host machine. Based on the first migration rule, the second migration rule, and the resource data of the second source host machine and the third target host machine, third migration information is determined. The third migration information is used to migrate the virtual machines in the second source host machine to the third target host machine until the resource utilization rate of the virtualization cluster is greater than the first preset resource threshold machine.

4. The method according to claim 3, characterized in that, The method further includes: When the resource utilization rate of the host machine is greater than or equal to the second preset resource threshold, the host machine with the resource utilization rate greater than or equal to the second preset resource threshold is designated as the second source host machine. Based on the first migration rule, the second migration rule, and the resource data of the second source host machine and the third target host machine, fourth migration information is determined. The fourth migration information is used to migrate the virtual machines in the second source host machine to the third target host machine until the resource utilization rate in the second source host machine is less than the second preset resource threshold machine.

5. The method according to claim 1, characterized in that, Before acquiring the second resource data of the first target host machine, the method further includes: Obtain resource data, IP addresses, or business systems from multiple target host machines; According to the first preset selection rule, the first target host machine is determined from multiple target host machines.

6. The method according to claim 2, characterized in that, Before acquiring the fourth resource data of the second target host, the method further includes: Obtain resource data and IP addresses of multiple target host machines, as well as the business system level coefficients or business systems of virtual machines in multiple target host machines; According to the second preset selection rule, the source host machine where the second virtual machine to be migrated is located is determined from multiple target host machines.

7. A virtual machine scheduling device, characterized in that, The device includes: The acquisition module is used to obtain the IP address of the virtual machine in the first source host machine; The calculation module is used to calculate the IP address of the first virtual machine to be migrated in the first source host machine based on the number of IPs contained in the preset consecutive IPs and the virtual machine IP. The acquisition module is also used to acquire the first resource data of the first virtual machine to be migrated based on the IP address of the first virtual machine to be migrated. The first resource data includes the memory usage, bandwidth utilization, CPU utilization, number of virtual machine CPU cores, and memory capacity of the first virtual machine to be migrated. The acquisition module is also used to acquire the second resource data of the first target host machine. The first target host machine does not include virtual machines whose IP addresses satisfy the preset consecutive IPs with the IP addresses of the first virtual machine to be migrated. The second resource data includes the memory usage, bandwidth utilization, CPU utilization, number of physical CPU cores, total memory capacity of virtual machines in the first target host machine in the powered-on state, and physical memory capacity of the host machine. The calculation module is further configured to calculate the estimated resource utilization rate of the first target host machine based on the first resource data and the second resource data. The estimated resource utilization rate includes the estimated first memory utilization rate, the estimated first bandwidth utilization rate, the estimated first CPU utilization rate, and the estimated first super-resolution ratio of the first target host machine. The determining module is used to determine first migration information based on the first resource data and the second resource data when the first source host and the first target host meet the first migration rule. The first migration information is used to migrate the first virtual machine to be migrated to the first target host. The first migration rule includes: All of the following conditions must be met: the first memory utilization estimate is less than the first memory utilization threshold; the first bandwidth utilization estimate is less than the first bandwidth utilization threshold; the first CPU utilization estimate is less than the first CPU utilization threshold; and the first super-resolution ratio estimate is less than the first super-resolution ratio threshold. Furthermore, the first target host does not include any virtual machines whose IP addresses satisfy a preset consecutive IP address with the IP address of the first virtual machine to be migrated.

8. A virtual machine scheduling device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the method as described in any one of claims 1-6.

10. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Virtual machine migration method and system

    CN110119301A

  • Virtual machine scheduling method and device, electronic equipment and storage medium

    CN115080204A