CN116974698A - Virtual machine scheduling method, device, equipment and computer readable storage medium - Google Patents
Virtual machine scheduling method, device, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN116974698A CN116974698A CN202310957476.3A CN202310957476A CN116974698A CN 116974698 A CN116974698 A CN 116974698A CN 202310957476 A CN202310957476 A CN 202310957476A CN 116974698 A CN116974698 A CN 116974698A
- Authority
- CN
- China
- Prior art keywords
- physical machine
- target
- virtual machine
- cluster
- resource
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5077—Logical partitioning of resources; Management or configuration of virtualized resources
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/4557—Distribution of virtual machine instances; Migration and load balancing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45595—Network integration; Enabling network access in virtual machine instances
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the application discloses a virtual machine scheduling method, a virtual machine scheduling device, virtual machine scheduling equipment and a computer readable storage medium, which are used for performing virtual machine scheduling under the condition of improving the resource utilization rate of a host in a cluster. The method of the embodiment of the application comprises the following steps: the method comprises the steps of obtaining residual resources corresponding to each physical machine in a cluster, determining the current resource demand of a virtual machine to be started, determining a target physical machine with the residual resources in the cluster being larger than or equal to the current resource demand and the target resource occupancy reaching a preset resource occupancy threshold, wherein the target resource occupancy represents the ratio between the virtual machine load and the physical machine capacity of the cluster after the virtual machine to be started is scheduled to the target physical machine, and scheduling the virtual machine to be started to the target physical machine.
Description
Technical Field
The embodiment of the application relates to the field of virtual machine scheduling, in particular to a virtual machine scheduling method, a virtual machine scheduling device, virtual machine scheduling equipment and a computer readable storage medium.
Background
With the development of communication technology, particularly the popularization of cloud computing virtualization technology, a plurality of service systems share physical resources of a same physical machine by virtualizing the physical resources into virtual resources, that is, by setting a plurality of virtual machines on the physical machine, and therefore, virtual machine scheduling is required.
The existing virtual machine scheduling method is that configuration information of a virtual machine to be started is obtained, a host (physical machine) with more residual resources is selected as a target host (physical machine), and the virtual machine to be started is scheduled to the target host, so that the virtual machine to be started is started in the target host.
However, the virtual machine scheduling method only considers scheduling the virtual machines to the physical machines with more residual resources to run the virtual machines to be started, only solves the problem of the feasibility of scheduling the virtual machines to be started, and does not consider the situation that the load of the virtual machine corresponding to each physical machine is lower after scheduling the virtual machines to be started to the physical machines, so the resource utilization rate of the cluster is lower,
disclosure of Invention
The embodiment of the application provides a virtual machine scheduling method, a virtual machine scheduling device, virtual machine scheduling equipment and a computer readable storage medium, which are used for performing virtual machine scheduling under the condition of improving the resource utilization rate of a host in a cluster.
In a first aspect, an embodiment of the present application provides a virtual machine scheduling method, including:
obtaining residual resources corresponding to each physical machine in the cluster;
determining the current resource demand of the virtual machine to be started;
determining that the residual resources in the cluster are greater than or equal to the current resource demand, and the target physical machine with target resource occupancy reaching a preset resource occupancy threshold; the target resource occupancy rate characterizes the ratio between the virtual machine load and the physical machine capacity of the cluster after the virtual machine to be started is scheduled to the target physical machine;
and dispatching the virtual machine to be started to the target physical machine.
Optionally, the determining that the remaining resources in the cluster are greater than or equal to the current resource demand, and the target resource occupancy rate reaches the target physical machine of the preset resource occupancy rate threshold includes:
determining the physical machines with the residual resources larger than or equal to the current resource demand to obtain a physical machine set;
and determining the target physical machine with the maximum target resource occupancy rate and reaching a preset resource occupancy rate threshold value in the physical machine set.
Optionally, the determining that the remaining resources in the cluster are greater than or equal to the current resource demand, and the target resource occupancy rate reaches the target physical machine of the preset resource occupancy rate threshold includes:
Traversing each physical machine in the cluster according to the sequence from small to large of the residual resources, and determining the physical machine, of which the first residual resource is larger than or equal to the current resource demand and the target resource occupancy rate reaches a preset resource occupancy rate threshold value, as the target physical machine.
Optionally, traversing each physical machine in the cluster according to the order of the remaining resources from small to large, and determining, as the target physical machine, a physical machine whose first remaining resource is greater than or equal to the current resource demand and whose target resource occupancy reaches a preset resource occupancy threshold includes:
determining a migration scheme according to the set migration times, traversing each physical machine in the cluster according to the sequence from small to large of residual resources after the virtual machines in the running state are migrated according to the migration scheme, and taking a physical machine with the first residual resource being greater than or equal to the current resource demand and the target resource occupancy rate reaching a preset resource occupancy rate threshold as a target physical machine.
Optionally, the number of migration times is N, where N is an integer greater than or equal to 0;
after the migration scheme is used for migrating the virtual machines in the running state according to the set migration times, traversing each physical machine in the cluster according to the sequence from small to large of the residual resources, and taking the physical machine with the first residual resource being greater than or equal to the current resource demand and the target resource occupancy rate reaching the preset resource occupancy rate threshold as the target physical machine, wherein the method comprises the following steps:
If the N is 0, traversing each physical machine in the cluster according to the sequence from small to large of the residual resources, and taking a physical machine with the first residual resource being larger than or equal to the current resource demand and the target resource occupancy rate reaching a preset resource occupancy rate threshold as a target physical machine;
if the N is not 0, determining at least one migration scheme corresponding to each migration frequency in sequence from 0 to N; and aiming at each migration scheme corresponding to the migration times, after the virtual machines are migrated and operated according to the migration scheme, traversing each physical machine in the cluster according to the sequence from small to large of the residual resources, and taking the physical machine with the first residual resource larger than or equal to the current resource demand and the target resource occupancy rate reaching a preset resource occupancy rate threshold as the target physical machine.
Optionally, the determining that the remaining resources in the cluster are greater than or equal to the current resource demand, and the target resource occupancy rate reaches the target physical machine of the preset resource occupancy rate threshold includes:
determining a physical machine set according to the set scheduling limit strategy; the scheduling limiting strategy is used for determining physical machines of which the running positions of the virtual machines meet preset position limiting conditions after the virtual machines to be started are scheduled to the target physical machine;
And determining that the residual resources in the physical machine set are greater than or equal to the current resource demand, and the target physical machine with the maximum target resource occupancy rate reaches a preset resource occupancy rate threshold value.
Optionally, the determining that the remaining resources in the cluster are greater than or equal to the current resource demand, and the target resource occupancy rate reaches the target physical machine of the preset resource occupancy rate threshold includes:
determining a first physical machine of which the residual resources in the cluster are greater than or equal to the current resource demand and the target resource occupancy rate reaches a preset resource occupancy rate threshold value;
and if the first physical machine does not exist, predicting predicted residual resources corresponding to each physical machine in the cluster after a preset period, determining a second physical machine with predicted residual resources in the cluster being greater than or equal to the current resource demand according to a preset method, wherein the target resource occupancy rate reaches a preset resource occupancy rate threshold value, and taking the second physical machine as the target physical machine.
Optionally, the determining the current resource demand of the virtual machine to be started includes:
obtaining an average resource demand configuration ratio of each running virtual machine in the cluster and configuration information of the virtual machines to be started;
And taking the product of the average resource demand configuration ratio and the configuration information of the virtual machine to be started as the current resource demand of the virtual machine to be started.
Optionally, the obtaining the average resource requirement configuration ratio of each running virtual machine in the cluster includes:
obtaining configuration information and actual demand corresponding to each running virtual machine in the cluster;
aiming at each running virtual machine, taking the ratio of the actual demand quantity corresponding to the running virtual machine to the configuration information as the resource demand configuration ratio corresponding to the running virtual machine;
and carrying out averaging processing on the resource demand configuration ratios corresponding to the running virtual machines to obtain the average resource demand configuration ratio.
In a second aspect, an embodiment of the present application provides a virtual machine scheduling apparatus, including:
the obtaining unit is used for obtaining the residual resources corresponding to each physical machine in the cluster;
the determining unit is used for determining the current resource demand of the virtual machine to be started;
the determining unit is further configured to determine that a remaining resource in the cluster is greater than or equal to the current resource demand, and a target physical machine whose target resource occupancy rate reaches a preset resource occupancy rate threshold; the target resource occupancy rate characterizes the ratio between the virtual machine load and the physical machine capacity of the cluster after the virtual machine to be started is scheduled to the target physical machine;
And the scheduling unit is used for scheduling the virtual machine to be started to the target physical machine.
In a third aspect, an embodiment of the present application provides a virtual machine scheduling apparatus, including:
the device comprises a central processing unit, a memory, an input/output interface, a wired or wireless network interface and a power supply;
the memory is a short-term memory or a persistent memory;
the central processor is configured to communicate with the memory and to execute instruction operations in the memory to perform the aforementioned virtual machine scheduling method.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the aforementioned virtual machine scheduling method.
In a fifth aspect, embodiments of the present application provide a computer program product comprising instructions that, when run on a computer, cause the computer to perform the aforementioned virtual machine scheduling method.
From the above technical solutions, the embodiment of the present application has the following advantages: the method comprises the steps of obtaining residual resources corresponding to each physical machine in a cluster, determining the current resource demand of a virtual machine to be started, determining a target physical machine with the residual resources in the cluster being larger than or equal to the current resource demand and the target resource occupancy reaching a preset resource occupancy threshold, wherein the target resource occupancy represents the ratio between the virtual machine load and the physical machine capacity of the cluster after the virtual machine to be started is scheduled to the target physical machine, and scheduling the virtual machine to be started to the target physical machine. The resource occupancy rate of the cluster after the virtual machine scheduling is improved while the virtual machine scheduling is realized, so that the resource utilization rate of the cluster is improved.
Drawings
Fig. 1 is a schematic architecture diagram of a virtual machine scheduling system according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a virtual machine scheduling method according to an embodiment of the present application;
fig. 3 is a flow chart of a virtual machine boot scheduling scheme with migration depth of 1 according to an embodiment of the present application;
fig. 4 is a schematic flow chart of a scheduling scheme of a virtual machine startup scene according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a virtual machine scheduling device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a virtual machine scheduling device according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a virtual machine scheduling method, a virtual machine scheduling device, virtual machine scheduling equipment and a computer readable storage medium, which are used for performing virtual machine scheduling under the condition of improving the resource utilization rate of a host in a cluster.
Referring to fig. 1, in an embodiment of the present application, a virtual machine scheduling system includes:
the virtual machine schedules the device 101, each physical machine 102 in the cluster, and the virtual machine to be started. When performing virtual machine scheduling, the virtual machine scheduling device 101 may be connected with each physical machine 102 in the cluster. The virtual machine scheduling device 101 may obtain configuration information and load information sent by each physical machine 102, obtain, according to the configuration information and load information of each physical machine 102, a remaining resource corresponding to each physical machine, determine that the remaining resource in the cluster is greater than or equal to a current resource demand, and the target resource occupancy rate reaches a target physical machine 102 with a preset resource occupancy rate threshold, and schedule the virtual machine to be started to the target physical machine 102.
Referring to fig. 2, fig. 2 is a schematic flow chart of a virtual machine scheduling method disclosed in an embodiment of the present application, where the method includes:
201. and obtaining the residual resources corresponding to each physical machine in the cluster.
In this embodiment, when virtual machine scheduling is performed, the remaining resources corresponding to each physical machine in the cluster may be obtained.
202. And determining the current resource demand of the virtual machine to be started.
After obtaining the remaining resources corresponding to each physical machine in the cluster, the current resource demand of the virtual machine to be started can be determined.
203. Determining a target physical machine of which the residual resources in the cluster are larger than or equal to the current resource demand and the target resource occupancy rate reaches a preset resource occupancy rate threshold value; and the target resource occupancy rate characterizes the ratio between the virtual machine load and the physical machine capacity of the cluster after the virtual machine to be started is scheduled to the target physical machine.
After the current resource demand of the virtual machine to be started is determined, the target physical machine of which the residual resources in the cluster are greater than or equal to the current resource demand and the target resource occupancy rate reaches the preset resource occupancy rate threshold value can be determined; and the target resource occupancy rate characterizes the ratio between the virtual machine load and the physical machine capacity of the cluster after the virtual machine to be started is scheduled to the target physical machine.
It can be understood that the method for determining the target physical machine with the remaining resources greater than or equal to the current resource demand in the cluster and the target resource occupancy rate reaching the preset resource occupancy rate threshold may be that the physical machine with the remaining resources greater than or equal to the current resource demand is determined first to obtain a physical machine set, and then the target physical machine with the maximum target resource occupancy rate and reaching the preset resource occupancy rate threshold is determined in the physical machine set. The method for determining the target physical machines, in which the residual resources in the cluster are greater than or equal to the current resource demand and the target resource occupancy rate reaches the preset resource occupancy rate threshold, may further include traversing each physical machine in the cluster according to the sequence from small to large of the residual resources, and determining the physical machine, in which the first residual resource is greater than or equal to the current resource demand and the target resource occupancy rate reaches the preset resource occupancy rate threshold, as the target physical machine. Other reasonable methods are also possible, and are not limited in this regard.
204. And dispatching the virtual machine to be started to the target physical machine.
After determining that the residual resources in the cluster are greater than or equal to the current resource demand and the target resource occupancy rate reaches the target physical machine with the preset resource occupancy rate threshold, the virtual machine to be started can be scheduled to the target physical machine.
In the embodiment of the application, the residual resources corresponding to each physical machine in the cluster can be obtained, the current resource demand of the virtual machine to be started is determined, the target physical machine of which the residual resources in the cluster are larger than or equal to the current resource demand and the target resource occupancy reaches the preset resource occupancy threshold is determined, wherein the target resource occupancy represents the ratio between the virtual machine load and the physical machine capacity of the cluster after the virtual machine to be started is scheduled to the target physical machine, and the virtual machine to be started is scheduled to the target physical machine. The resource occupancy rate of the cluster after the virtual machine scheduling is improved while the virtual machine scheduling is realized, so that the resource utilization rate of the cluster is improved.
In the embodiment of the present application, there may be multiple methods for determining that the remaining resources in the cluster are greater than or equal to the current resource demand, and that the target resource occupancy rate reaches the target physical machine of the preset resource occupancy rate threshold, and one of the methods is described below based on the virtual machine scheduling method shown in fig. 2.
In this embodiment, when virtual machine scheduling is performed, the remaining resources corresponding to each physical machine in the cluster may be obtained.
The virtual machine scheduling scene may be a scene of scheduling startup for a virtual machine in the data center server cluster. The method for obtaining the residual resources corresponding to each physical machine in the cluster may be to obtain configuration information and load information corresponding to each physical machine in the cluster, and take the difference value between the configuration information and the load information corresponding to each physical machine as the residual resources corresponding to each physical machine.
The current resource demand of the virtual machine to be started may be determined.
The method for determining the current resource demand of the virtual machine to be started may include obtaining an average resource demand configuration ratio of each running virtual machine in the cluster and configuration information of the virtual machine to be started, and then taking a product of the average resource demand configuration ratio and the configuration information of the virtual machine to be started as the current resource demand of the virtual machine to be started. Specifically, the current resource requirements include, but are not limited to, CPU resource requirements and/or memory resource requirements.
The method for obtaining the average resource demand configuration ratio of each running virtual machine in the cluster includes the steps of firstly obtaining configuration information and actual demand corresponding to each running virtual machine in the cluster, then regarding the ratio of the actual demand corresponding to each running virtual machine to the configuration information as the resource demand configuration ratio corresponding to the running virtual machine, and finally carrying out averaging processing on the resource demand configuration ratio corresponding to each running virtual machine to obtain the average resource demand configuration ratio.
It should be noted that, because the virtual machine to be started has no history data, the actual demand of the CPU and the memory of the virtual machine cannot be obtained, so the ratio of the actual demand corresponding to the running virtual machine to the configuration information is taken as the resource demand configuration ratio corresponding to the running virtual machine, the average value is obtained by averaging the resource demand configuration ratios corresponding to the running virtual machines, and the average value is taken as the average resource demand configuration ratio, so that the rationality, the realizability and the accuracy of obtaining the current resource demand of the virtual machine to be started can be improved.
After the corresponding residual resources of each physical machine in the cluster are obtained and the current resource demand of the virtual machine to be started is determined, the target physical machine of which the residual resources in the cluster are greater than or equal to the current resource demand and the target resource occupancy rate reaches the preset resource occupancy rate threshold value can be determined; and the target resource occupancy rate characterizes the ratio between the virtual machine load and the physical machine capacity of the cluster after the virtual machine to be started is scheduled to the target physical machine.
After determining that the residual resources in the cluster are greater than or equal to the current resource demand and the target resource occupancy rate reaches the target physical machine with the preset resource occupancy rate threshold, the virtual machine to be started can be scheduled to the target physical machine.
Specifically, the preset resource occupancy rate threshold is a threshold determined according to experience (historical data), and the specific method may be that the target resource occupancy rate corresponding to the cluster after virtual machine scheduling is obtained for a period of time, and then the threshold is determined based on the target resource occupancy rate in the period of time.
The method for determining the target physical machines with the residual resources larger than or equal to the current resource demand in the cluster and the target resource occupancy rate reaching the preset resource occupancy rate threshold value comprises the steps of determining the physical machines with the residual resources larger than or equal to the current resource demand to obtain a physical machine set, and determining the target physical machine with the maximum target resource occupancy rate and reaching the preset resource occupancy rate threshold value in the physical machine set.
The method for determining the target physical machines, in which the residual resources in the cluster are greater than or equal to the current resource demand and the target resource occupancy rate reaches the preset resource occupancy rate threshold, may be that each physical machine in the cluster is traversed according to the sequence from small to large of the residual resources, and the first physical machine, in which the residual resources are greater than or equal to the current resource demand and the target resource occupancy rate reaches the preset resource occupancy rate threshold, is determined as the target physical machine.
The method for determining the physical machine with the first residual resource larger than or equal to the current resource demand and the target resource occupancy rate reaching the preset resource occupancy rate threshold as the target physical machine by traversing each physical machine in the cluster from small to large according to the residual resource sequence comprises the steps of determining a migration scheme according to the set migration times, traversing each physical machine in the cluster from small to large according to the migration scheme after migrating the virtual machine in the running state according to the migration scheme, and taking the physical machine with the first residual resource larger than or equal to the current resource demand and the target resource occupancy rate reaching the preset resource occupancy rate threshold as the target physical machine.
After the virtual machines in the running state are migrated according to the migration scheme, traversing each physical machine in the cluster according to the sequence from small to large of the residual resources, and taking the physical machine with the first residual resource larger than or equal to the current resource demand and the target resource occupancy rate reaching the preset resource occupancy rate threshold as the target physical machine; if N is not 0, determining at least one migration scheme corresponding to each migration frequency from 0 to N in sequence; and traversing each physical machine in the cluster according to the sequence from small to large of the residual resources after the virtual machines are migrated according to each migration scheme corresponding to the migration times, and taking the physical machine with the first residual resource larger than or equal to the current resource demand and the target resource occupancy rate reaching the preset resource occupancy rate threshold as the target physical machine, wherein the set value of the migration times is N, and N is an integer larger than or equal to 0.
Specifically, the migration times may be parameters set by the user, which are used to characterize how many virtual machines can be migrated up to the maximum allowable number, for example, the migration times is 2, that is, it is characterized that at the maximum two different hosts (physical machines) can migrate one running virtual machine to other host nodes in the same cluster or two running virtual machines on one host to other host nodes in the same cluster. If the migration times are 0, the characterization does not allow migration.
It should be noted that, migrating the virtual machine in the running state to other physical machines consumes the performance of the whole system, so if N is not 0, determining at least one migration scheme corresponding to each migration number sequentially from 0 to N, and for each migration scheme corresponding to the migration number, traversing each physical machine in the cluster according to the order of the sizes of the remaining resources from small to large after migrating the virtual machine according to the migration scheme, and taking the physical machine with the first remaining resource greater than or equal to the current resource demand and the target resource occupancy rate reaching the preset resource occupancy rate threshold as the target physical machine, thereby ensuring the stability of the performance of the whole system.
The method for determining the target physical machines with the residual resources larger than or equal to the current resource demand in the cluster and the target resource occupancy rate reaching the preset resource occupancy rate threshold value comprises the steps of determining a physical machine set according to a set scheduling limit strategy, wherein the scheduling limit strategy is used for determining the physical machines with the running positions of all virtual machines meeting the preset position limiting conditions after the virtual machines to be started are scheduled to the target physical machines, and then determining the target physical machines with the residual resources larger than or equal to the current resource demand in the physical machine set and the maximum target resource occupancy rate reaching the preset resource occupancy rate threshold value.
It will be appreciated that in actual situations, various location defining conditions of the virtual machine may exist, which may include a condition of defining a location where a single virtual machine runs a physical machine, and a condition of defining a location where multiple virtual machines cannot run on the same physical machine, specifically, a single virtual machine in an operating state cannot be located on a target physical machine of a cluster, and/or multiple virtual machines in an operating state must be located on the same physical machine, must not be located on the same physical machine, and cannot be located on only the target physical machine. Therefore, the physical machine set is determined according to the set scheduling limit strategy, then the target physical machine with the largest target resource occupancy rate and reaching the preset resource occupancy rate threshold value in the physical machine set is determined to be larger than or equal to the current resource demand, and the conditions that the operation effect of each virtual machine is poor and the user experience is poor after scheduling due to the condition that the position limitation of the virtual machine operation is ignored can be reduced.
The method for determining the target physical machines with the residual resources larger than or equal to the current resource demand and the target resource occupancy rate reaching the preset resource occupancy rate threshold in the cluster includes the steps of determining first physical machines with the residual resources larger than or equal to the current resource demand and the target resource occupancy rate reaching the preset resource occupancy rate threshold in the cluster, if the first physical machines do not exist, predicting predicted residual resources corresponding to all physical machines in the cluster after a preset period, determining second physical machines with the predicted residual resources larger than or equal to the current resource demand and the target resource occupancy rate reaching the preset resource occupancy rate threshold in the cluster, and taking the second physical machines as the target physical machines.
It should be noted that, because the physical machine has the over-allocated resources, although the remaining resources of the physical machine are insufficient, the virtual machine to be started may still be scheduled to the physical machine, for example, the remaining resources of the physical machine are insufficient, the virtual machine to be started may still be scheduled to the physical machine, and after one hour after the scheduling, the performance of the physical machine may not be particularly good, but after one hour, the physical machine may release some resources (for example, the virtual machine in the previous running state has already been run, and at this time, the performance of the physical machine may be restored to the optimal state. Therefore, it is reasonable and feasible to directly schedule the virtual machine to be started to the target physical machine after determining that the predicted residual resource is greater than or equal to the current resource demand and the target resource occupancy reaches the target physical machine with the preset resource occupancy threshold.
In summary, the situation that the remaining resources are greater than or equal to the current resource demand may include that the remaining CPU resources are greater than or equal to the current CPU resource demand, and/or that the remaining memory resources are greater than or equal to the current memory resource demand, and/or that the remaining CPU overcomplete resource threshold is greater than or equal to the current CPU resource demand.
It is worth mentioning that the embodiment of the application realizes virtual machine scheduling under preset constraint conditions of each dimension, wherein the preset constraint conditions of each dimension include, but are not limited to, a CPU overdompartment constraint condition, a memory resource constraint condition and a migration depth constraint condition. The CPU overdriving constraint condition characterizes that the CPU requirement of the virtual machine in each running state of the same host computer is allowed to exceed the CPU capacity of the host computer, but the ratio of the CPU requirement of the virtual machine in each running state to the CPU capacity of the host computer is not allowed to exceed a CPU overdriving threshold, the CPU overdriving threshold can be preset (for example, the CPU overdriving threshold is set by a user) and the memory resource constraint condition characterizes that the memory requirement of the virtual machine in each running state of the same host computer is not allowed to exceed the memory capacity of the host computer; the migration depth constraint characterizes that the number of times the virtual machine that changes the running state in the cluster runs the host computer location is not allowed to exceed a set value of the migration number.
Specifically, the preset resource occupancy rate threshold may be preset resource occupancy rate criteria corresponding to different optimal solution levels set by the user, for example, may be an optimal solution, an optimal solution in the optimal solution, a suboptimal solution, and/or a preset resource occupancy rate criteria corresponding to a feasible solution, and explanation is made on the optimal solutions of different levels below:
[ optimal solution ]: after the virtual machine is started, the virtual machine starting scheme which satisfies the conditions that the CPU load of each host computer in the cluster is less than 80% of the CPU capacity and the memory load is less than 80% of the memory capacity is the optimal solution, and a plurality of optimal solutions possibly exist;
[ optimal solution among optimal solutions ]: in the optimal solution set, the scheme that the ratio of the memory load to the memory capacity of the host computer operated by the virtual machine to be started is closest to 80 percent is the only optimal scheme in theory;
[ suboptimal solution ]: in the scheme of not meeting the [ optimal solution ], the virtual machine starting schemes meeting the [ all host memory loads in the cluster are less than 80% of the memory capacity ] are all suboptimal solutions, and a plurality of suboptimal solutions possibly exist;
[ feasible solution ]: in the schemes which do not meet the [ optimal solution ] and the [ suboptimal solution ], the virtual machine starting scheme which meets the condition that the memory load of each host in the cluster is smaller than the memory capacity is a feasible solution, and a plurality of feasible solutions possibly exist;
[ no solution ]: and after the virtual machine is started, the condition that the memory load of each host in the cluster is smaller than the memory capacity cannot be met is considered to be free of solutions, namely the virtual machine to be started cannot be started on the current cluster.
For easy understanding, the following describes a virtual machine scheduling scheme design based on migration traversal according to an embodiment of the present application:
1. If the virtual machine migration is not allowed, the hosts meeting the scheduling policy can be ordered in reverse order according to the use amount of the host memory (namely, the order of loads is ordered from large to small, namely, the order of the residual resources is ordered from small to large), the scheme level of starting up on each host is analyzed, and the optimal scheme in the hosts is selected;
2. if the virtual machine is allowed to migrate, the following operations can be sequentially executed under the condition that the migration times limit condition is met:
2.1, firstly, trying to perform virtual machine migration without performing virtual machine migration, judging whether an optimal solution can be obtained, and selecting an optimal solution from the optimal solution;
2.2 under the premise that the scheme does not have a solution, an attempt can be made to obtain a solution meeting the optimal solution under the condition of virtual machine migration;
2.3 under the premise that the scheme does not have a solution, an attempt can be made to obtain a solution meeting suboptimal solutions under the condition of virtual machine migration;
2.4 under the premise that the scheme does not have solution, an attempt can be made to obtain a solution meeting the feasibility under the condition of virtual machine migration;
2.5 if the above conditions are not met, continuing to try the subsequent scheme;
3. if the operation cannot be performed, according to the CPU and memory load information of the virtual machines in each running state in the cluster, predicting CPU and memory demand information of the virtual machines in each running state after N hours, updating the CPU and memory demand information, and then executing each attempt in the step 2 again.
4. If the feasible scheme can not be found after the execution of the last step is finished, the virtual machine to be started can be considered to be unable to be started in the current cluster.
In order to facilitate understanding of the solution for virtual machine migration in the embodiment of the present application, the following is illustrated:
specifically, referring to fig. 3, fig. 3 is a schematic flow chart of a virtual machine scheduling scheme with migration depth of 1 disclosed in the embodiment of the present application, as shown in fig. 3, migration times are from 0 to 1, migration times are 0, whether remaining resources of the host 3 are greater than or equal to current resource demand of a virtual machine to be started is sequentially determined, if not, whether remaining resources of the host 4 are greater than or equal to current resource demand of the virtual machine to be started is determined, if not, whether remaining resources of the host 5 are greater than or equal to current resource demand of the virtual machine to be started is determined, if yes, target resource occupancy rate after the virtual machine to be started is scheduled to the host 5 is predicted, if the target resource occupancy rate is determined to not reach a preset resource occupancy rate threshold, scheduling with migration times of 1 is performed, and if migration times are 1, VM-1 (virtual machine in an operating state) in the host 3 can be scheduled to the host 4, if the scheduled target resource occupancy rate is determined to be greater than or equal to the current resource demand of the virtual machine to be started, if yes, and if the scheduled target resource occupancy rate reaches the preset resource occupancy rate is determined to be equal to the preset resource occupancy rate in the host 3, and the virtual machine to be started is scheduled to be 3.
It can be understood that in the virtual machine starting scheme based on migration times, the system finds an optimal scheme through the least migration times of the operated virtual machine under the condition of meeting constraint principles according to the CPU and memory requirement values of the virtual machine to be started, and meanwhile, considers resource reservation for the subsequent potential virtual machine to be started, and searches an optimal host configuration scheme meeting the conditions in the cluster where the virtual machine to be started (started) is located.
Specifically, referring to fig. 4, fig. 4 is a flow chart of a virtual machine boot scene scheduling scheme disclosed in the embodiment of the present application, and as can be seen from fig. 4, a virtual machine boot scheduling attempt under the constraint of migration times can be performed first, and if a virtual machine boot scheme meeting the condition can be found, the virtual machine boot scene scheduling attempt is output as a result; if the virtual machine starting scheme meeting the conditions cannot be found, the cluster load and the virtual machine load after a period of time can be predicted based on the historical data, so that predicted residual resources of each physical machine after a period of time can be determined. After the operation is completed, the system performs virtual machine startup scheduling attempt under the constraint of migration times again. If no viable solution exists, the virtual machine is considered to be unable to start up at the current cluster.
It is further worth mentioning that the remaining resources in the cluster can be determined to be greater than or equal to the current resource demand, and the target resource occupancy rate reaches the target physical machine with the preset resource occupancy rate threshold, enough remaining resources can be vacated as much as possible for the subsequent virtual machine to be operated, so that after the virtual machine to be started is scheduled to the target physical machine, the virtual machine in the operating state of the target physical machine occupies fewer resources, and the resource competition of the virtual machine to be started is fewer when the virtual machine to be started is started, therefore, the resource competition of the virtual machine after the virtual machine is started can be reduced as much as possible, meanwhile, the calculation and memory resources of the subsequent virtual machine to be started are guaranteed as much as possible, and the resource utilization rate of a host (physical machine) in the cluster is improved.
It will be appreciated that in addition to the method described above for determining a target physical machine in a cluster where the remaining resources are greater than or equal to the current resource demand and the target resource occupancy reaches a preset resource occupancy threshold; except the method for traversing each physical machine in the cluster from small to large according to the residual resources, determining the physical machine with the first residual resource being larger than or equal to the current resource demand and the target resource occupancy reaching the preset resource occupancy threshold as the target physical machine; except the method that the migration scheme is determined according to the set migration times, after the virtual machines in the running state are migrated according to the migration scheme, each physical machine in the cluster is traversed according to the sequence from small to large of the residual resources, and the first physical machine with the residual resources larger than or equal to the current resource demand and the target resource occupancy rate reaching the preset resource occupancy rate threshold is taken as the target physical machine; in addition to the method of determining the current resource demand of a virtual machine to be booted described above; in addition to the method described above of obtaining an average resource demand configuration ratio for each running virtual machine in a cluster; other reasonable methods are also possible, and are not limited in this regard.
In this embodiment, a remaining resource corresponding to each physical machine in the cluster may be obtained, a current resource demand of the virtual machine to be started is determined, a target physical machine in which the remaining resource in the cluster is greater than or equal to the current resource demand and the target resource occupancy reaches a preset resource occupancy threshold is determined, where the target resource occupancy represents a ratio between a virtual machine load and a physical machine capacity of the cluster after the virtual machine to be started is scheduled to the target physical machine, and the virtual machine to be started is scheduled to the target physical machine. The resource occupancy rate of the cluster after the virtual machine scheduling is improved while the virtual machine scheduling is realized, so that the resource utilization rate of the cluster is improved. And secondly, the ratio of the actual demand quantity corresponding to the running virtual machine to the configuration information can be used as the resource demand configuration ratio corresponding to the running virtual machine, the resource demand configuration ratio corresponding to each running virtual machine is averaged to obtain an average value, and the average value is used as the average resource demand configuration ratio, so that the rationality, the realizability and the accuracy for obtaining the current resource demand quantity of the virtual machine to be started can be improved. And if N is not 0, determining at least one migration scheme corresponding to each migration frequency in turn from 0 to N, migrating and operating the virtual machine according to the migration scheme, traversing each physical machine in the cluster according to the sequence from small to large of the residual resources, and taking the physical machine with the first residual resource larger than or equal to the current resource demand and the target resource occupancy rate reaching the preset resource occupancy rate threshold as the target physical machine, thereby ensuring the stability of the overall system performance. Furthermore, the physical machine set can be determined according to the set scheduling limit policy, then the target physical machine with the largest target resource occupancy rate and reaching the preset resource occupancy rate threshold value in the physical machine set is determined to be larger than or equal to the current resource demand, and the conditions that the operation effect of each virtual machine is poor and the user experience is poor after scheduling due to the condition that the operation position of the virtual machine is ignored can be reduced. Furthermore, the target physical machine with the residual resources larger than or equal to the current resource demand in the cluster and the target resource occupancy rate reaching the preset resource occupancy rate threshold can be determined, enough residual resources can be emptied as much as possible for the subsequent virtual machine to be operated, the resource competition after the virtual machine is started can be reduced as much as possible, meanwhile, the calculation and memory resources of the subsequent virtual machine to be started are ensured as much as possible, and the resource utilization rate of a host (physical machine) in the cluster is improved. Moreover, under the preset constraint condition of each dimension, the optimal scheme can be found through the minimum virtual machine migration times in the running state, meanwhile, CPU and memory resources reserved by the virtual machines to be started potentially in the follow-up process are fully considered, the integration of fragment resources based on the virtual machine thermal migration in the cluster is fully considered, the optimal host (physical machine) configuration scheme meeting the condition is found in the cluster where the virtual machine to be started is located, and the resource utilization rate of the hosts (physical machines) in the cluster is improved. Moreover, the scheduling strategy can be met, the optimal scheme can be obtained as far as possible, the migration times can be reduced as far as possible, if the optimal solution can be obtained without migration, the optimal scheme is obtained, the optimal solution, the suboptimal solution and the feasible solution scheme are respectively tried to find in sequence, under the conditions that the suboptimal solution/the feasible solution is tried to find and virtual machine migration is allowed to be carried out, the searching is stopped when one scheme is found, the target virtual machine scheduling scheme can be determined according to requirements, and the feasibility of determining the target virtual machine scheduling scheme is improved. Finally, an evaluation system of a virtual machine starting scheduling scheme can be established for guiding the design of a virtual machine starting scheduling algorithm, a virtual machine starting scheme under a virtual machine resource reservation scene to be started can be designed based on the virtual machine starting scheduling scheme evaluation system, virtual machine starting scheduling under the conditions of fragmented computing resources and memory resources in a cluster can be realized through the hot migration of the virtual machines in the cluster, the change of the CPU and memory load demands of the virtual machine can be predicted through historical data, and the possibility of starting the virtual machine in a resource dynamic change scene is ensured.
The virtual machine scheduling method in the embodiment of the present application is described above, and the virtual machine scheduling apparatus in the embodiment of the present application is described below, referring to fig. 5, where an embodiment of the virtual machine scheduling apparatus in the embodiment of the present application includes:
an obtaining unit 501, configured to obtain remaining resources corresponding to each physical machine in the cluster;
a determining unit 502, configured to determine a current resource demand of a virtual machine to be started;
the determining unit 502 is further configured to determine that a remaining resource in the cluster is greater than or equal to the current resource demand, and a target physical machine whose target resource occupancy rate reaches a preset resource occupancy rate threshold; the target resource occupancy rate characterizes the ratio between the virtual machine load and the physical machine capacity of the cluster after the virtual machine to be started is scheduled to the target physical machine;
and the scheduling unit 503 is configured to schedule the virtual machine to be started to the target physical machine.
In the embodiment of the application, the residual resources corresponding to each physical machine in the cluster can be obtained, the current resource demand of the virtual machine to be started is determined, the target physical machine of which the residual resources in the cluster are larger than or equal to the current resource demand and the target resource occupancy reaches the preset resource occupancy threshold is determined, wherein the target resource occupancy represents the ratio between the virtual machine load and the physical machine capacity of the cluster after the virtual machine to be started is scheduled to the target physical machine, and the virtual machine to be started is scheduled to the target physical machine. The resource occupancy rate of the cluster after the virtual machine scheduling is improved while the virtual machine scheduling is realized, so that the resource utilization rate of the cluster is improved.
The following describes in detail a virtual machine scheduling device in an embodiment of the present application, and another embodiment of a virtual machine scheduling apparatus in an embodiment of the present application includes:
the obtaining unit is used for obtaining the residual resources corresponding to each physical machine in the cluster;
the determining unit is used for determining the current resource demand of the virtual machine to be started;
the determining unit is further configured to determine that a remaining resource in the cluster is greater than or equal to the current resource demand, and a target physical machine whose target resource occupancy rate reaches a preset resource occupancy rate threshold; the target resource occupancy rate characterizes the ratio between the virtual machine load and the physical machine capacity of the cluster after the virtual machine to be started is scheduled to the target physical machine;
and the scheduling unit is used for scheduling the virtual machine to be started to the target physical machine.
The determining unit is specifically configured to determine a physical machine with a remaining resource greater than or equal to a current resource demand, obtain a physical machine set, and determine a target physical machine with a maximum target resource occupancy rate and reaching a preset resource occupancy rate threshold in the physical machine set.
The determining unit is specifically configured to traverse each physical machine in the cluster according to the order of the remaining resources from small to large, and determine, as the target physical machine, a physical machine whose first remaining resource is greater than or equal to the current resource demand and whose target resource occupancy rate reaches a preset resource occupancy rate threshold.
The determining unit is specifically configured to determine a migration scheme according to a set migration number, traverse each physical machine in the cluster according to a sequence from small to large of remaining resources after migrating the virtual machine in the running state according to the migration scheme, and use a physical machine with a first remaining resource greater than or equal to the current resource demand and a target resource occupancy rate reaching a preset resource occupancy rate threshold as a target physical machine.
The determining unit is specifically configured to traverse each physical machine in the cluster according to a sequence from small to large of the remaining resources if the N is 0, and sequentially determine at least one migration scheme corresponding to each migration frequency from 0 to N if the N is not 0, where the first remaining resource is greater than or equal to the current resource demand and the target resource occupancy reaches a preset resource occupancy threshold; and traversing each physical machine in the cluster according to the sequence from small to large of the residual resources after the virtual machines are migrated according to the migration schemes according to each migration scheme corresponding to the migration times, and taking the physical machine with the first residual resource larger than or equal to the current resource demand and the target resource occupancy rate reaching the preset resource occupancy rate threshold as the target physical machine, wherein the set value of the migration times is N, and the N is an integer larger than or equal to 0.
The determining unit is specifically configured to determine a physical machine set according to a set scheduling restriction policy; the scheduling limiting strategy is used for determining physical machines of which the running positions of the virtual machines meet preset position limiting conditions after the virtual machines to be started are scheduled to the target physical machines, and determining target physical machines of which the residual resources in the physical machine set are greater than or equal to the current resource demand and the target resource occupancy rate is maximum and reaches a preset resource occupancy rate threshold.
The determining unit is specifically configured to determine a first physical machine, where the remaining resources in the cluster are greater than or equal to the current resource demand, and the target resource occupancy rate reaches a preset resource occupancy rate threshold, predict predicted remaining resources corresponding to each physical machine in the cluster after a preset period if the first physical machine does not exist, determine a second physical machine, where the predicted remaining resources in the cluster are greater than or equal to the current resource demand, and the target resource occupancy rate reaches the preset resource occupancy rate threshold, and use the second physical machine as the target physical machine.
The determining unit is specifically configured to obtain an average resource demand configuration ratio of each running virtual machine in the cluster and configuration information of the virtual machine to be started, and take a product of the average resource demand configuration ratio and the configuration information of the virtual machine to be started as a current resource demand of the virtual machine to be started.
The determining unit is specifically configured to obtain configuration information and actual demand corresponding to each running virtual machine in the cluster, and for each running virtual machine, take a ratio of the actual demand corresponding to the running virtual machine to the configuration information as a resource demand configuration ratio corresponding to the running virtual machine, and perform an average processing on the resource demand configuration ratios corresponding to the running virtual machines to obtain the average resource demand configuration ratio.
In this embodiment, each unit in the virtual machine scheduling device executes the operation of the virtual machine scheduling device in the embodiment shown in fig. 2, which is not described herein.
Referring to fig. 6, an embodiment of a virtual machine scheduling apparatus 600 according to an embodiment of the present application includes:
a central processor 601, a memory 605, an input/output interface 604, a wired or wireless network interface 603, and a power supply 602;
memory 605 is a transient memory or a persistent memory;
the central processor 601 is configured to communicate with the memory 605 and to execute the instructions in the memory 605 to perform the method of the embodiment shown in fig. 2 described above.
Embodiments of the present application also provide a computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method of the embodiment shown in fig. 2 described above.
Embodiments of the present application also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of the embodiment shown in fig. 2 described above.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (RAM, random access memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Claims (12)
1. A virtual machine scheduling method, comprising:
obtaining residual resources corresponding to each physical machine in the cluster;
determining the current resource demand of the virtual machine to be started;
determining that the residual resources in the cluster are greater than or equal to the current resource demand, and the target physical machine with target resource occupancy reaching a preset resource occupancy threshold; the target resource occupancy rate characterizes the ratio between the virtual machine load and the physical machine capacity of the cluster after the virtual machine to be started is scheduled to the target physical machine;
And dispatching the virtual machine to be started to the target physical machine.
2. The method of claim 1, wherein the determining that the remaining resources in the cluster are greater than or equal to the current resource demand and the target resource occupancy reaches the target physical machine of the preset resource occupancy threshold comprises:
determining the physical machines with the residual resources larger than or equal to the current resource demand to obtain a physical machine set;
and determining the target physical machine with the maximum target resource occupancy rate and reaching a preset resource occupancy rate threshold value in the physical machine set.
3. The method of claim 1, wherein the determining that the remaining resources in the cluster are greater than or equal to the current resource demand and the target resource occupancy reaches the target physical machine of the preset resource occupancy threshold comprises:
traversing each physical machine in the cluster according to the sequence from small to large of the residual resources, and determining the physical machine, of which the first residual resource is larger than or equal to the current resource demand and the target resource occupancy rate reaches a preset resource occupancy rate threshold value, as the target physical machine.
4. A method according to claim 3, wherein traversing each physical machine in the cluster from the smaller to the larger of the remaining resources, determining a physical machine whose first remaining resource is greater than or equal to the current resource demand and whose target resource occupancy reaches a preset resource occupancy threshold as the target physical machine comprises:
Determining a migration scheme according to the set migration times, traversing each physical machine in the cluster according to the sequence from small to large of residual resources after the virtual machines in the running state are migrated according to the migration scheme, and taking a physical machine with the first residual resource being greater than or equal to the current resource demand and the target resource occupancy rate reaching a preset resource occupancy rate threshold as a target physical machine.
5. The method according to claim 4, wherein the number of migration times set is N, which is an integer greater than or equal to 0;
after the migration scheme is used for migrating the virtual machines in the running state according to the set migration times, traversing each physical machine in the cluster according to the sequence from small to large of the residual resources, and taking the physical machine with the first residual resource being greater than or equal to the current resource demand and the target resource occupancy rate reaching the preset resource occupancy rate threshold as the target physical machine, wherein the method comprises the following steps:
if the N is 0, traversing each physical machine in the cluster according to the sequence from small to large of the residual resources, and taking a physical machine with the first residual resource being larger than or equal to the current resource demand and the target resource occupancy rate reaching a preset resource occupancy rate threshold as a target physical machine;
If the N is not 0, determining at least one migration scheme corresponding to each migration frequency in sequence from 0 to N; and aiming at each migration scheme corresponding to the migration times, after the virtual machines are migrated and operated according to the migration scheme, traversing each physical machine in the cluster according to the sequence from small to large of the residual resources, and taking the physical machine with the first residual resource larger than or equal to the current resource demand and the target resource occupancy rate reaching a preset resource occupancy rate threshold as the target physical machine.
6. The method of claim 1, wherein the determining that the remaining resources in the cluster are greater than or equal to the current resource demand and the target resource occupancy reaches the target physical machine of the preset resource occupancy threshold comprises:
determining a physical machine set according to the set scheduling limit strategy; the scheduling limiting strategy is used for determining physical machines of which the running positions of the virtual machines meet preset position limiting conditions after the virtual machines to be started are scheduled to the target physical machine;
and determining that the residual resources in the physical machine set are greater than or equal to the current resource demand, and the target physical machine with the maximum target resource occupancy rate reaches a preset resource occupancy rate threshold value.
7. The method of claim 1, wherein the determining that the remaining resources in the cluster are greater than or equal to the current resource demand and the target resource occupancy reaches the target physical machine of the preset resource occupancy threshold comprises:
determining a first physical machine of which the residual resources in the cluster are greater than or equal to the current resource demand and the target resource occupancy rate reaches a preset resource occupancy rate threshold value;
and if the first physical machine does not exist, predicting predicted residual resources corresponding to all physical machines in the cluster after a preset period, determining a second physical machine with predicted residual resources in the cluster being greater than or equal to the current resource demand and target resource occupancy reaching a preset resource occupancy threshold, and taking the second physical machine as the target physical machine.
8. The method of claim 1, wherein the determining the current resource demand of the virtual machine to be booted comprises:
obtaining an average resource demand configuration ratio of each running virtual machine in the cluster and configuration information of the virtual machines to be started;
and taking the product of the average resource demand configuration ratio and the configuration information of the virtual machine to be started as the current resource demand of the virtual machine to be started.
9. The method of claim 8, wherein the obtaining the average resource demand configuration ratio for each running virtual machine in the cluster comprises:
obtaining configuration information and actual demand corresponding to each running virtual machine in the cluster;
aiming at each running virtual machine, taking the ratio of the actual demand quantity corresponding to the running virtual machine to the configuration information as the resource demand configuration ratio corresponding to the running virtual machine;
and carrying out averaging processing on the resource demand configuration ratios corresponding to the running virtual machines to obtain the average resource demand configuration ratio.
10. A virtual machine scheduling apparatus, comprising:
the obtaining unit is used for obtaining the residual resources corresponding to each physical machine in the cluster;
the determining unit is used for determining the current resource demand of the virtual machine to be started;
the determining unit is further configured to determine that a remaining resource in the cluster is greater than or equal to the current resource demand, and a target physical machine whose target resource occupancy rate reaches a preset resource occupancy rate threshold; the target resource occupancy rate characterizes the ratio between the virtual machine load and the physical machine capacity of the cluster after the virtual machine to be started is scheduled to the target physical machine;
And the scheduling unit is used for scheduling the virtual machine to be started to the target physical machine.
11. A virtual machine scheduling apparatus, comprising:
a central processing unit and a memory;
the memory is a short-term memory or a persistent memory;
the central processor is configured to communicate with the memory and to execute instruction operations in the memory to perform the method of any of claims 1 to 9.
12. A computer readable storage medium comprising instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310957476.3A CN116974698A (en) | 2023-07-31 | 2023-07-31 | Virtual machine scheduling method, device, equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310957476.3A CN116974698A (en) | 2023-07-31 | 2023-07-31 | Virtual machine scheduling method, device, equipment and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116974698A true CN116974698A (en) | 2023-10-31 |
Family
ID=88476456
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310957476.3A Pending CN116974698A (en) | 2023-07-31 | 2023-07-31 | Virtual machine scheduling method, device, equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116974698A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118779065A (en) * | 2024-07-03 | 2024-10-15 | 华数智环 (北京)数字科技有限公司 | Virtual machine scheduling processing method, system and storage medium with priority on remaining cloud storage capacity |
-
2023
- 2023-07-31 CN CN202310957476.3A patent/CN116974698A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118779065A (en) * | 2024-07-03 | 2024-10-15 | 华数智环 (北京)数字科技有限公司 | Virtual machine scheduling processing method, system and storage medium with priority on remaining cloud storage capacity |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111796908B (en) | System and method for automatic elastic expansion and contraction of resources and cloud platform | |
CN101593133B (en) | Method and device for load balancing of resources of virtual machine | |
US8839263B2 (en) | Apparatus to manage virtual machine migration to a best fit server based on reserve capacity | |
US9396026B2 (en) | Allocating a task to a computer based on determined resources | |
CN103685256B (en) | A virtual machine migration management method, device and system | |
CN104102523A (en) | Method for migrating virtual machine and resource scheduling platform | |
CN107562512B (en) | Method, device and system for migrating virtual machine | |
EP2725862A1 (en) | Resource allocation method and resource management platform | |
US12067413B2 (en) | Apparatus for determining resource migration schedule | |
US9535492B2 (en) | Information processing apparatus, control method, and computer-readable recording medium | |
CN107026877A (en) | The method and apparatus that resource is managed in cloud platform | |
US9385964B2 (en) | Resource management method and management server | |
CN105893113A (en) | Management system and management method of virtual machine | |
JP2016126562A (en) | Information processing system, management apparatus, and control method of information processing system | |
CN103916438A (en) | Cloud testing environment scheduling method and system based on load forecast | |
CN112882827B (en) | Method, electronic device and computer program product for load balancing | |
CN107506233B (en) | Virtual resource scheduling method, device and server | |
CN116974698A (en) | Virtual machine scheduling method, device, equipment and computer readable storage medium | |
JP7035858B2 (en) | Migration management program, migration method and migration system | |
CN114625474A (en) | Container migration method and device, electronic equipment and storage medium | |
US11379130B2 (en) | Predicting and preparing volume configurations | |
US8607245B2 (en) | Dynamic processor-set management | |
KR20150070930A (en) | Resource allocation system and method for migration considering optimal cost | |
CN112748850B (en) | Method, apparatus and computer program product for storage management | |
JP2014206805A (en) | Control device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |