Virtual machine scheduling method, device and storage medium
By initializing and optimizing the scheduling matrix, generating a recommended scheduling matrix and rationally planning the migration of virtual machines, the problem of virtual machine migration failure in cloud computing resource scheduling is solved, and scheduling efficiency and resource utilization are improved.
Patent Information
- Application Number
- CN202111651478.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-12-30
AI Technical Summary
The problem of virtual machine migration failure in cloud computing resource scheduling is mainly due to the lack of time planning and resource constraints, which results in too many virtual machines being moved in and out of a single host at the same time, resulting in insufficient resources and migration failure.
By initializing and optimizing the scheduling matrix, a recommended scheduling matrix is generated to represent the scheduling information of virtual machines, determine the migration time point, and reasonably plan the migration of virtual machines to avoid resource shortages and improve scheduling efficiency.
It effectively avoids virtual machine scheduling failures caused by insufficient resources, improves the efficiency of virtual machine scheduling, makes full use of the network bandwidth and computing resources of cloud computing nodes, and achieves rapid resource scheduling and balancing.
Smart Images

Figure CN114416291B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a virtual machine scheduling method, device and storage medium. Background Art
[0002] In the related art, in the process of cloud computing resource scheduling, the scheduling plan of virtual machines between hosts is usually expressed as the scheduling of virtual machines from the original host to another host. The existing cloud computing resource scheduling plan does not include its time planning, that is, which scheduling jobs are executed and which are not executed at different times. In fact, cloud computing resource scheduling is constrained by the network environment, computing environment, storage environment, etc., and generally limits the number of concurrent scheduling, that is, if a single host simultaneously migrates in and out of more than a certain number of virtual machines, it may cause the virtual machine migration to fail. Summary of the invention
[0003] The present disclosure provides a virtual machine scheduling method, device and storage medium to at least solve the problem of virtual machine migration failure in the related art. The technical solution of the present disclosure is as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, a virtual machine scheduling method is provided, including:
[0005] Initialize the scheduling matrix to obtain the initial scheduling matrix of the host machine;
[0006] Optimizing the initial scheduling matrix of the host machine to generate a first recommended scheduling matrix, wherein the first recommended scheduling matrix represents scheduling information of the virtual machine;
[0007] The virtual machines are scheduled to enter and exit the host machine according to the first recommended scheduling matrix. Optionally, the rows of the elements in the initial scheduling matrix correspond to the virtual machines, and the columns correspond to the time points, and the elements in the initial scheduling matrix include any one of the following:
[0008] Optionally, the rows of the initial scheduling matrix correspond to virtual machines, the columns of the initial scheduling matrix correspond to time points, and the elements in the initial scheduling matrix include any one of the following:
[0009] Migration behavior identification information;
[0010] Emigrant behavior identification information;
[0011] No behavioral identification information.
[0012] Optionally, the step of optimizing the initial scheduling matrix of the host machine includes:
[0013] Determine the time point ranked first in the initial scheduling matrix as the first target time point, and determine the count value of the incoming behavior identification information and the count value of the outgoing behavior identification information in the element of the column corresponding to the first target time point;
[0014] Whether the first target time point is a migration-available time point is determined according to the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information.
[0015] Optionally, the step of determining whether the first target time point is a migration-available time point according to the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information includes:
[0016] If the count value of the in-migration behavior identification information in the column corresponding to the first target time point is less than the in-migration quantity threshold, and the count value of the out-migration behavior identification information is less than the out-migration quantity threshold, then the first target time point is determined to be a migration-enabled time point, the element corresponding to the migration-enabled time point is retained, and a time point separated from the first target time point by a preset number of time points is determined to be a second target time point, and whether the second target time point is a migration-enabled time point is determined;
[0017] Otherwise, whether the first target time point is a migration-available time point is determined according to the sum of the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information.
[0018] Optionally, the step of determining whether the first target time point is a migration-available time point according to the sum of the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information includes:
[0019] If the sum of the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information at the first target time point is less than or equal to the total scheduling quantity threshold, then determining the first target time point as a migration-available time point and retaining the element corresponding to the time point;
[0020] Otherwise, the first target time point is determined to be a non-migratable time point, a next time point adjacent to the first target time point is determined to be a third target time point, and it is determined whether the third target time point is a migratable time point.
[0021] Optionally, the step of generating a first recommended scheduling matrix includes:
[0022] The first recommended scheduling matrix is generated according to the elements of the reserved columns corresponding to the migratable time points.
[0023] Optionally, the step of scheduling the virtual machines to enter and exit the host machine according to the first recommended scheduling matrix includes at least one of the following:
[0024] In response to the instruction that does not require verification, scheduling the virtual machine to enter and exit the host machine according to the first recommended scheduling matrix;
[0025] In response to an instruction that needs to be verified, and the total scheduling duration corresponding to the first recommended scheduling matrix is greater than a scheduling duration threshold, a new initial scheduling matrix is generated and the new initial scheduling matrix is optimized to generate a new first recommended scheduling matrix, and virtual machines are scheduled to enter and exit the host machine according to the new first recommended scheduling matrix;
[0026] In response to an instruction that needs to be verified, and the processor load of the virtual machine is greater than a first load threshold, the migration behavior identification information and the migration behavior identification information corresponding to the virtual machine in the first recommended scheduling matrix are shifted back by a preset number of time points to generate a new first recommended scheduling matrix, and the virtual machines are scheduled to enter and exit the host machine according to the new first recommended scheduling matrix;
[0027] In response to an instruction that needs to be verified and the disk load of the host machine is greater than a second load threshold, all elements in the first recommended scheduling matrix are moved backward by a certain number of time points to generate a new first recommended scheduling matrix, and virtual machines are scheduled to enter and exit the host machine according to the new first recommended scheduling matrix.
[0028] According to a second aspect of an embodiment of the present disclosure, a virtual machine scheduling device is provided, including:
[0029] An initialization module is used to initialize the scheduling matrix to obtain the initial scheduling matrix of the host machine;
[0030] An optimization module, configured to optimize an initial scheduling matrix of the host machine to generate a first recommended scheduling matrix, wherein the first recommended scheduling matrix represents scheduling information of the virtual machine;
[0031] A scheduling module is used to schedule virtual machines to enter and exit the host machine according to the first recommended scheduling matrix.
[0032] Optionally, the rows of the initial scheduling matrix correspond to virtual machines, the columns of the initial scheduling matrix correspond to time points, and the elements in the initial scheduling matrix include any one of the following:
[0033] Migration behavior identification information;
[0034] Emigrant behavior identification information;
[0035] No behavioral identification information.
[0036] Optionally, the optimization module includes:
[0037] A first time point determination submodule, used to determine the first time point in the initial scheduling matrix as the first target time point, and determine the count value of the incoming behavior identification information and the count value of the outgoing behavior identification information in the element of the column corresponding to the first target time point;
[0038] The first judgment submodule is used to determine whether the first target time point is a migration-available time point according to the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information.
[0039] Optionally, the first judgment submodule includes:
[0040] A first judgment unit, if the count value of the in-migration behavior identification information in the column corresponding to the first target time point is less than the in-migration quantity threshold, and the count value of the out-migration behavior identification information is less than the out-migration quantity threshold, determines that the first target time point is a migration-available time point, retains the element corresponding to the migration-available time point, determines that a time point separated from the first target time point by a preset number of time points is a second target time point, and determines whether the second target time point is a migration-available time point;
[0041] The second judgment unit, otherwise, determines whether the first target time point is a migration-available time point according to the sum of the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information.
[0042] Optionally, the second judging unit includes:
[0043] A first judgment subunit determines that the first target time point is a migration-available time point and retains the element corresponding to the time point if the sum of the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information at the first target time point is less than or equal to the total scheduling quantity threshold;
[0044] The second judgment subunit, otherwise, determines that the first target time point is a non-migratable time point, determines the next time point adjacent to the first target time point as a third target time point, and determines whether the third target time point is a migratable time point.
[0045] Optionally, the optimization module includes:
[0046] The matrix generation submodule is used to generate the first recommended scheduling matrix according to the elements of the columns corresponding to the reserved migration time points.
[0047] Optionally, the scheduling module includes:
[0048] A first scheduling submodule, configured to, in response to an instruction that does not require verification, schedule the virtual machine to enter and exit the host machine according to the first recommended scheduling matrix;
[0049] A second scheduling submodule is used to generate a new initial scheduling matrix and optimize the new initial scheduling matrix in response to the instruction that needs to be verified, and the total scheduling duration corresponding to the first recommended scheduling matrix is greater than the scheduling duration threshold, so as to generate a new first recommended scheduling matrix, and schedule the virtual machine to enter and exit the host machine according to the new first recommended scheduling matrix;
[0050] A third scheduling submodule is used for, in response to an instruction that needs to be verified and the processor load of the virtual machine is greater than a first load threshold, shifting the migration behavior identification information and the migration behavior identification information corresponding to the virtual machine in the first recommended scheduling matrix back by a preset number of time points to generate a new first recommended scheduling matrix, and scheduling the virtual machine to enter and exit the host machine according to the new first recommended scheduling matrix;
[0051] The fourth scheduling submodule is used to respond to instructions that need to be verified and the disk load of the host machine is greater than a second load threshold, move all elements in the first recommended scheduling matrix backward by a certain number of time points to generate a new first recommended scheduling matrix, and schedule virtual machines to enter and exit the host machine according to the new first recommended scheduling matrix.
[0052] According to a third aspect of the present disclosure, there is provided a
[0053] An electronic device, characterized in that it comprises:
[0054] processor;
[0055] a memory for storing instructions executable by the processor;
[0056] The processor is configured to execute the instructions to implement the virtual machine scheduling method as described in any one of the first aspects above.
[0057] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, characterized in that when instructions in the storage medium are executed by a processor of a virtual machine scheduling electronic device, the virtual machine scheduling electronic device is enabled to execute a virtual machine scheduling method as described in any one of the first aspects above.
[0058] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method described in any one of the first aspects is implemented.
[0059] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0060] By generating a scheduling matrix, reasonable time planning is performed for the scheduling of virtual machines, and virtual machines are scheduled to avoid virtual machine scheduling failures caused by insufficient resources, thereby improving the efficiency of virtual machine scheduling.
[0061] Take full advantage of the large network bandwidth resources between cloud computing nodes, maximize concurrent resource scheduling and achieve rapid resource scheduling and balance based on the relatively limited computing resources and storage IO resources of the host machine and the limited resource scheduling capacity of a single cloud computing host node.
[0062] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0064] Figure 1 The present invention is a flowchart of a virtual machine scheduling method according to an exemplary embodiment.
[0065] Figure 2 The present invention is a flowchart of a virtual machine scheduling method according to an exemplary embodiment.
[0066] Figure 3 The present invention is a flowchart of a virtual machine scheduling method according to an exemplary embodiment.
[0067] Figure 4 The present invention is a block diagram of a virtual machine scheduling device according to an exemplary embodiment.
[0068] Figure 5 It is a block diagram of a device according to an exemplary embodiment. DETAILED DESCRIPTION
[0069] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0070] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0071] Virtual machine migration includes migration of the entire system and migration of a certain workload. System migration is to completely copy all the software on the system, including the operating system, to another physical hardware machine. Migration in a virtualized environment can be divided into static migration and dynamic migration. The biggest difference between static migration and dynamic migration is that static migration has a significant period of time when the client service is unavailable, while dynamic migration has no significant service suspension time.
[0072] Static migration in a virtualized environment can also be divided into two types. One is to shut down the client, copy its hard disk image to another host machine and then resume it. This type of migration cannot retain the workload running in the client. The other is that two hosts share a storage system. In this case, the migration can maintain the client's memory status before migration and the workload running on the system.
[0073] Dynamic migration means migrating clients between different host machines while ensuring the normal operation of application services on the client. Its logical steps are almost the same as the previous static migration. There are dynamic migrations that copy both hard disk storage and memory, and there are also dynamic migrations that only copy memory images. The difference is that in order to ensure the availability of client services during the migration process, the migration process can only have a very short downtime. Dynamic migration allows system administrators to migrate clients between different physical machines without disconnecting the connection of clients or applications accessing services in the client. A successful migration requires that the client's memory, hard disk storage, and network connection remain unchanged after migration to the destination host, and the service suspension time during the migration process is short.
[0074] In the process of cloud computing resource scheduling, the scheduling plan of virtual machines between hosts is usually expressed as the scheduling of virtual machines from the original host to another host. In related technologies, cloud computing resource scheduling does not include its time planning, that is, which scheduling jobs are executed and which are not executed at different times. In fact, cloud computing resource scheduling is constrained by the network environment, computing environment, storage environment, etc., and generally limits the number of concurrent scheduling. That is, if a single host simultaneously migrates in and out of more than a certain number of virtual machines, it will cause the virtual machine migration to fail, or even cause the migrated virtual machine to crash.
[0075] In the related technology, virtual machines are scheduled according to algorithms. However, due to the huge solution space, although some heuristic algorithms can theoretically help obtain feasible solutions, in actual calculations, there are often problems such as huge consumption of computing power, long time consumption, and unstable calculation results.
[0076] Different from the critical path optimization problem of traditional project management, the scheduling between various activities will become more complicated due to the increase in the degree of parallelism that can be supported. Under such constraints, it is difficult to achieve good results using the critical path optimization method of traditional project management systems.
[0077] Figure 1 FIG. 1 is a flowchart of a virtual machine scheduling method according to an exemplary embodiment. Figure 1 As shown, the method is used in virtual machine scheduling and includes the following steps.
[0078] In step 101, a scheduling matrix is initialized to obtain an initial scheduling matrix of a host machine.
[0079] In the embodiment of the present disclosure, the migration behavior of virtual machines at various time points is planned through a matrix, and virtual machine migration includes the migration of the entire system and the migration of a certain workload. The scheduling matrix represents the scheduling behavior of multiple virtual machines corresponding to a host machine at various time points, and each matrix corresponds to a host machine. The scheduling behavior includes migration behavior, migration behavior and no behavior. Each row of the scheduling matrix corresponds to a virtual machine, and each column corresponds to a time point. The length of time between adjacent time points can be adjusted by the implementer according to needs. The migration behavior is the behavior of the virtual machine migrating into the host machine, and the virtual machine is not in the host machine before the migration; the migration behavior is the behavior of the virtual machine migrating from the host machine, and the virtual machine is already in the host machine before the migration; the no behavior is that the virtual machine neither migrates into the host machine nor migrates out of the host machine. It should be noted that in the no behavior state, the virtual machine may be in the host machine or may not be in the host machine.
[0080] First, the scheduling matrix is initialized to obtain an initial scheduling matrix, and then the initial scheduling matrix is adjusted and optimized according to the constraint conditions.
[0081] In step 102, the initial scheduling matrix of the host machine is optimized to generate a first recommended scheduling matrix, wherein the first recommended scheduling matrix represents scheduling information of the virtual machine.
[0082] In the disclosed embodiment, the resource scheduling of cloud computing is subject to constraints such as the network environment, computing environment, and storage environment, and generally limits the number of concurrent scheduling of virtual machines on the same host machine, which is the number of virtual machines that migrate in and out of the same host machine at the same time point. Based on the constraints of hardware conditions and actual business needs, the scheduling behavior of each virtual machine at each time point in the initial scheduling matrix of the host machine is optimized to generate a first recommended scheduling matrix to avoid the virtual machine scheduling occupying resources exceeding the upper limit of the host machine.
[0083] By optimizing the obtained initial scheduling matrix to generate a first recommended scheduling matrix, the scheduling of virtual machines is reasonably planned to avoid virtual machine scheduling failure caused by insufficient resources, thereby improving the efficiency of virtual machine scheduling.
[0084] Optionally, the rows of the initial scheduling matrix correspond to virtual machines, the columns of the initial scheduling matrix correspond to time points, and the elements in the initial scheduling matrix include any one of the following:
[0085] Migration behavior identification information;
[0086] Emigrant behavior identification information;
[0087] No behavioral identification information.
[0088] In the disclosed embodiment, each row in the scheduling matrix corresponds to a virtual machine, and each column corresponds to a time point. The rows of elements in the initial scheduling matrix correspond to virtual machines, and the columns of the elements correspond to the time points of the scheduling behaviors. The migration behavior refers to the behavior of the virtual machine migrating into the host machine, and the virtual machine is not in the host machine before the migration; the migration behavior refers to the behavior of the virtual machine migrating out of the host machine, and the virtual machine is already in the host machine before the migration; the no behavior refers to the virtual machine neither migrating into the host machine nor migrating out of the host machine. It should be noted that in the no behavior state, the virtual machine may be in the host machine or in other host machines.
[0089] In a possible embodiment, an element in the initial scheduling matrix is the migration behavior identification information α, and the element is located in the row corresponding to virtual machine 1 and in the column corresponding to the time point 10 o'clock, indicating that in the plan, virtual machine 1 is to migrate to the host machine corresponding to the initial scheduling matrix at the time point 10 o'clock.
[0090] In a possible embodiment, an element in the initial scheduling matrix is the migration behavior identification information β, which is located in the row corresponding to virtual machine 2 and in the column corresponding to the time point 10 o'clock, indicating that in the plan, virtual machine 2 is to migrate out of the host machine corresponding to the initial scheduling matrix at the time point 10 o'clock.
[0091] In a possible embodiment, an element in the initial scheduling matrix is the non-behavior identification information γ, which is located in the row corresponding to virtual machine 3 and in the column corresponding to the time point 10 o'clock, indicating that virtual machine 3 is scheduled to be idle at the time point 10 o'clock.
[0092] The first recommended scheduling matrix is generated for the elements in the initial scheduling matrix that meet the hardware condition constraints and the actual business demand restrictions.
[0093] Step 103: Schedule the virtual machines to enter and exit the host machine according to the first recommended scheduling matrix.
[0094] Optionally, the step of scheduling the virtual machines to enter and exit the host machine according to the first recommended scheduling matrix includes at least one of the following:
[0095] In response to the instruction that does not require verification, scheduling the virtual machine to enter and exit the host machine according to the first recommended scheduling matrix;
[0096] In response to an instruction that needs to be verified, and the total scheduling duration corresponding to the first recommended scheduling matrix is greater than a scheduling duration threshold, a new initial scheduling matrix is generated and the new initial scheduling matrix is optimized to generate a new first recommended scheduling matrix, and virtual machines are scheduled to enter and exit the host machine according to the new first recommended scheduling matrix;
[0097] In response to an instruction that needs to be verified, and the processor load of the virtual machine is greater than a first load threshold, the migration behavior identification information and the migration behavior identification information corresponding to the virtual machine in the first recommended scheduling matrix are shifted back by a preset number of time points to generate a new first recommended scheduling matrix, and the virtual machines are scheduled to enter and exit the host machine according to the new first recommended scheduling matrix;
[0098] In response to an instruction that needs to be verified and the disk load of the host machine is greater than a second load threshold, all elements in the first recommended scheduling matrix are moved backward by a certain number of time points to generate a new first recommended scheduling matrix, and virtual machines are scheduled to enter and exit the host machine according to the new first recommended scheduling matrix.
[0099] The present invention generates a scheduling matrix, performs reasonable time planning for virtual machine scheduling, and schedules virtual machines to avoid virtual machine scheduling failures caused by insufficient resources, thereby improving the efficiency of virtual machine scheduling.
[0100] Figure 2 FIG. 1 is a flowchart of a virtual machine scheduling method according to an exemplary embodiment. Figure 2 As shown, the method is used in virtual machine scheduling. Figure 1 Step 102 further specifically includes the following steps:
[0101] Step 201, determining the first ranked time point in the initial scheduling matrix as the first target time point, and determining the count value of the incoming behavior identification information and the count value of the outgoing behavior identification information in the element of the column corresponding to the first target time point.
[0102] In the embodiment of the present disclosure, constraints are set according to the host migration and the carrying capacity of the migrated virtual machine, and whether the scheduling of the virtual machine by the initial scheduling matrix at each time point is reasonable is determined according to the constraints. In order to determine whether it is reasonable, it is necessary to calculate the count value count of the migration behavior identification information α in the element of the column corresponding to the time point i in the initial scheduling matrix αiand the count value count of the migration behavior identification information β βi .
[0103] First, the first time point in the initial scheduling matrix, that is, time i=1, is determined as the first target time point, and the count value count of the migration behavior identification information α in the element of the column corresponding to the time point is calculated. αi and the count value count of the migration behavior identification information β βi .
[0104] Step 202: according to the count value count of the migration behavior identification information α αi and the count value count of the migration behavior identification information β βi value, and determines whether the first target time point is a migrationable time point.
[0105] In the embodiment of the present disclosure, a threshold value of the number of virtual machines migrated into the host machine and a threshold value of the number of virtual machines migrated out of the host machine at the same time point are set according to the carrying capacity of the host machine and the virtual machine migrated out. αi and count βi Whether the above threshold conditions are met.
[0106] In this embodiment of the application, count the number of α in the elements of the column corresponding to time point i αi and the number of β count βi The scheduling matrix is optimized to generate a first recommended scheduling matrix, and the scheduling of virtual machines is reasonably planned to avoid virtual machine scheduling failures caused by insufficient resources, thereby improving the efficiency of virtual machine scheduling.
[0107] Optionally, the count value count according to the migration behavior identification information α αi and the count value count of the migration behavior identification information β βi The step of determining whether the first target time point is a migration-capable time point comprises:
[0108] If time point i corresponds to count in the column αi Less than the migration threshold M, and count βi If the number of migrations is less than the threshold value N, then the first target time point i is determined to be a migration time point, the elements of the column corresponding to the migration time point i are retained, and the time point separated from the first target time point by a preset number of x time points is determined to be the second target time point, that is, the time point (i+x), and whether the second target time point is a migration time point is determined. Get the count corresponding to the (i+x) time point α(i+x) and count β(i+x) And determine whether the corresponding time point (i+x) is a migration time point.
[0109] It should be noted that the preset number x of intervals can be set by the implementer according to the requirements, and the present disclosure does not limit the specific value of x. In a possible embodiment, x=5.
[0110] Otherwise, according to the count value count of the migration behavior identification information α αi and the count value count of the migration behavior identification information β βi The sum of the values determines whether the first target time point is a migration time point.
[0111] In the embodiment of the present disclosure, a migration threshold M and a migration threshold N are set. The number of virtual machines migrated to the host machine at the same time point needs to be less than M, and the number of virtual machines migrated to the host machine at the same time point needs to be less than N. The migration feasibility is judged for each time point according to the order from early to late, that is, the order from left to right in the columns of the initial scheduling matrix. If the count in the column corresponding to the time point i is αi Less than the migration threshold M, and count βi If the value is less than the out-migration threshold N, then the time point i is determined to be a migration-capable time point, and the element corresponding to the time point i can be retained. It should be noted that the in-migration threshold M and the out-migration threshold N can be set by the implementer according to the needs, and the present disclosure does not limit the specific values of M and N. In a possible embodiment, M=10, N=12.
[0112] If the time point i corresponds to the count in the column αi Greater than or equal to the migration threshold M, or count βi If it is greater than or equal to the migration quantity threshold N, it is necessary to further determine whether the time point i can be migrated according to the total number threshold of virtual machines migrated in and out of the host at a time point.
[0113] In this embodiment of the application, the count value count of α in the element of the column corresponding to time point i is αi and the count value of β βi , the migration quantity threshold M and the migration quantity threshold N are used to optimize the scheduling matrix to generate a first recommended scheduling matrix, and the scheduling of the virtual machines is reasonably planned to avoid the failure of virtual machine scheduling due to insufficient resources, thereby improving the efficiency of virtual machine scheduling.
[0114] Optionally, the count value count according to the migration behavior identification information α αi and the count value count of the migration behavior identification information β βi The step of determining whether the first target time point is a migration-available time point comprises:
[0115] If the count value count of the migration behavior identification information α at the first target time point αi and the count value count of the migration behavior identification information β βi If the sum is less than or equal to the total scheduling quantity threshold, the first target time point is determined to be a migration time point and the element corresponding to the time point is retained;
[0116] Otherwise, the first target time point is determined to be a non-migratable time point, a next time point adjacent to the first target time point is determined to be a third target time point, and it is determined whether the third target time point is a migratable time point.
[0117] In the embodiment of the present disclosure, a threshold value K of the total number of virtual machines scheduled to be migrated into and out of the host machine at the same time point is set according to the carrying capacity of the host machine. αi +count βi If it is less than or equal to the total scheduling quantity threshold K, the first target time point is determined as a migrationable time point and the element corresponding to the time point i is retained.
[0118] Otherwise, determine that the first target time point i is a non-migratable time point, determine the next time point adjacent to the first target time point as the third target time point, and determine whether the third target time point is a migratable time point. Determine that time point i is an infeasible time point, and obtain the count corresponding to the (i+1) time point α(i+1) and count β(i+1) , and determine whether the corresponding time point i+1 is a migration time point.
[0119] It should be noted that the total number threshold K of virtual machine scheduling can be set by the implementer according to the requirements, and the present disclosure does not limit the specific value of K. In a possible embodiment, K=24.
[0120] In this embodiment of the application, count the number of α in the elements of the column corresponding to time point i αi and the number of β count βi The scheduling matrix is optimized to generate a first recommended scheduling matrix, and the scheduling of virtual machines is reasonably planned to avoid virtual machine scheduling failures caused by insufficient resources, thereby improving the efficiency of virtual machine scheduling.
[0121] Optionally, the step of generating a first recommended scheduling matrix includes:
[0122] The first recommended scheduling matrix is generated according to the elements of the reserved columns corresponding to the migratable time points.
[0123] In the embodiment of the present disclosure, the first recommended scheduling matrix is used to schedule the migration of virtual machines into or out of the host machine within the carrying capacity of the host machine. If the user needs to add additional constraints according to business needs, a verification instruction needs to be set to further optimize the first recommended scheduling matrix.
[0124] In a possible embodiment, there is no need to further optimize the first recommended scheduling matrix. When the host machine receives an instruction that does not require verification, the host machine schedules the virtual machine according to the elements in the first recommended scheduling matrix to migrate the virtual machine in or out.
[0125] In response to an instruction that needs to be verified, and the total scheduling duration corresponding to the first recommended scheduling matrix is greater than a scheduling duration threshold, generating a new initial scheduling matrix and optimizing the new initial scheduling matrix to generate a new first recommended scheduling matrix;
[0126] In an embodiment of the present disclosure, constraints are added according to business needs to optimize the scheduling plan of the first scheduling matrix, and the host machine receives instructions that need to be verified, and further optimizes the first recommended scheduling matrix according to the instructions that need to be verified. In a possible embodiment, according to business needs, the total scheduling duration of the recommended scheduling matrix should be less than a certain time threshold, that is, the scheduling duration threshold. The scheduling duration is the length of time from the time point corresponding to the first migration-in or migration-out behavior to the time point corresponding to the last migration-in or migration-out behavior. If the total scheduling duration corresponding to the first recommended scheduling matrix is greater than the scheduling duration threshold, it means that there is competition for resources such as CPU memory storage during the scheduling process, and it is necessary to reinitialize to generate a new initial scheduling matrix, and then optimize the new initial scheduling matrix to generate the first recommended scheduling matrix that meets the scheduling duration requirements.
[0127] In response to an instruction that needs to be verified and the processor load of the virtual machine is greater than a first load threshold, α and β corresponding to the virtual machine are moved backward by y time points.
[0128] In the disclosed embodiment, according to business needs, the CPU load of the virtual machine resources needs to be less than a certain threshold, namely, the first load threshold. During the scheduling process, if the processor load of the virtual machine at a certain point in time is greater than the first load threshold, it will cause the migration time of the virtual machine to be too long, and then it is necessary to move the α and β elements in the corresponding row of the virtual machine in the first recommended scheduling matrix backward by y time points, wait for the scheduling of each virtual machine with a smaller CPU load in the host machine to be completed, and then schedule the virtual machine.
[0129] It should be noted that the total number threshold y of virtual machine scheduling can be set by the implementer according to the requirements, and the present disclosure does not limit the specific value of y. In a possible embodiment, y=10.
[0130] In response to the instruction that needs to be verified and the disk load of the host machine is greater than a second load threshold, all elements in the first recommended scheduling matrix are moved backward by z time points.
[0131] In the disclosed embodiment, according to business needs, the disk IO load of the host machine needs to be less than a certain threshold, namely the second load threshold. During the scheduling process, since the cloud computing environment uses local storage, if the load of the disk IO of the host machine migrated at a certain point in time is higher than the second load threshold, it will cause excessive pressure on the host machine. It is necessary to pause the migration to the target host machine and re-run the host machine after z time points to schedule the virtual machine. That is, all elements in the first recommended scheduling matrix are moved back by z time points.
[0132] It should be noted that the total number threshold z of virtual machine scheduling can be set by the implementer according to the requirements, and the present disclosure does not limit the specific value of z. In a possible embodiment, z=15.
[0133] Figure 3 FIG. 1 is a flowchart of a virtual machine scheduling method according to an exemplary embodiment. Figure 3 As shown, first generate a resource scheduling plan, that is, an initial scheduling matrix. Obtain cloud computing host machines and virtual machines from the cloud platform database, and obtain monitoring information from the monitoring database. Then optimize the scheduling matrix based on the above information to generate a scheduling method under collision detection constraints, that is, the first recommended scheduling matrix. Subsequently, obtain other constraints set by the user from the alarm policy database and verify them. If the constraints set by the user are not met, such as the disk IO load of the host machine needs to be less than the second load threshold, or the CPU load of the virtual machine resources needs to be less than the first load threshold, an alarm message is sent and the first recommended scheduling matrix is optimized. When the first recommended scheduling matrix meets all the constraints, the virtual machines can be scheduled to migrate in or out of the host machine according to the first recommended scheduling matrix on the cloud platform.
[0134] Figure 4 is a block diagram of a virtual machine scheduling device according to an exemplary embodiment. Figure 4 The device includes an initialization module 410, an optimization module 420 and a scheduling module 430.
[0135] Initialization module 410, used to initialize the scheduling matrix to obtain the initial scheduling matrix of the host machine;
[0136] An optimization module 420, configured to optimize the initial scheduling matrix of the host machine to generate a first recommended scheduling matrix, wherein the first recommended scheduling matrix represents scheduling information of the virtual machine;
[0137] The scheduling module 430 is used to schedule the virtual machines to enter and exit the host machine according to the first recommended scheduling matrix.
[0138] Optionally, the rows of the initial scheduling matrix correspond to virtual machines, the columns of the initial scheduling matrix correspond to time points, and the elements in the initial scheduling matrix include any one of the following:
[0139] Migration behavior identification information;
[0140] Emigrant behavior identification information;
[0141] No behavioral identification information.
[0142] Optionally, the optimization module includes:
[0143] A first time point determination submodule, used to determine the first time point in the initial scheduling matrix as the first target time point, and determine the count value of the incoming behavior identification information and the count value of the outgoing behavior identification information in the element of the column corresponding to the first target time point;
[0144] The first judgment submodule is used to determine whether the first target time point is a migration-available time point according to the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information.
[0145] Optionally, the first judgment submodule includes:
[0146] A first judgment unit, if the count value of the in-migration behavior identification information in the column corresponding to the first target time point is less than the in-migration quantity threshold, and the count value of the out-migration behavior identification information is less than the out-migration quantity threshold, determines that the first target time point is a migration-available time point, retains the element corresponding to the migration-available time point, determines that a time point separated from the first target time point by a preset number of time points is a second target time point, and determines whether the second target time point is a migration-available time point;
[0147] The second judgment unit, otherwise, determines whether the first target time point is a migration-available time point according to the sum of the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information.
[0148] Optionally, the second judging unit includes:
[0149] A first judgment subunit determines that the first target time point is a migration-available time point and retains the element corresponding to the time point if the sum of the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information at the first target time point is less than or equal to the total scheduling quantity threshold;
[0150] The second judgment subunit, otherwise, determines that the first target time point is a non-migratable time point, determines the next time point adjacent to the first target time point as a third target time point, and determines whether the third target time point is a migratable time point.
[0151] Optionally, the optimization module includes:
[0152] The matrix generation submodule is used to generate the first recommended scheduling matrix according to the elements of the columns corresponding to the reserved migration time points.
[0153] Optionally, the scheduling module includes:
[0154] A first scheduling submodule, configured to, in response to an instruction that does not require verification, schedule the virtual machine to enter and exit the host machine according to the first recommended scheduling matrix;
[0155] A second scheduling submodule is used to generate a new initial scheduling matrix and optimize the new initial scheduling matrix in response to the instruction that needs to be verified, and the total scheduling duration corresponding to the first recommended scheduling matrix is greater than the scheduling duration threshold, so as to generate a new first recommended scheduling matrix, and schedule the virtual machine to enter and exit the host machine according to the new first recommended scheduling matrix;
[0156] A third scheduling submodule is used for, in response to an instruction that needs to be verified and the processor load of the virtual machine is greater than a first load threshold, shifting the migration behavior identification information and the migration behavior identification information corresponding to the virtual machine in the first recommended scheduling matrix back by a preset number of time points to generate a new first recommended scheduling matrix, and scheduling the virtual machine to enter and exit the host machine according to the new first recommended scheduling matrix;
[0157] The fourth scheduling submodule is used to respond to instructions that need to be verified and the disk load of the host machine is greater than a second load threshold, move all elements in the first recommended scheduling matrix backward by a certain number of time points to generate a new first recommended scheduling matrix, and schedule virtual machines to enter and exit the host machine according to the new first recommended scheduling matrix.
[0158] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0159] Figure 5 is a block diagram of a device 500 for implementing a virtual machine scheduling method according to an exemplary embodiment. For example, the device 500 may be provided as a server. Figure 5, the apparatus 500 includes a processing component 522, which further includes one or more processors, and a memory resource represented by a memory 532 for storing instructions executable by the processing component 522, such as an application. The application stored in the memory 532 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 522 is configured to execute instructions to perform the above-mentioned virtual machine scheduling method.
[0160] The device 500 may also include a power supply component 526 configured to perform power management of the device 500, a wired or wireless network interface 550 configured to connect the device 500 to a network, and an input / output (I / O) interface 558. The device 500 may operate based on an operating system stored in the memory 532, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.
[0161] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0162] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A virtual machine scheduling method, characterized in that: include: Initialize the scheduling matrix to obtain the initial scheduling matrix of the host machine; Optimizing the initial scheduling matrix of the host machine to generate a first recommended scheduling matrix, wherein the first recommended scheduling matrix represents scheduling information of the virtual machine; scheduling virtual machines to enter and exit the host machine according to the first recommended scheduling matrix; The rows of the initial scheduling matrix correspond to virtual machines, the columns of the initial scheduling matrix correspond to time points, and the elements in the initial scheduling matrix include any one of the following: Migration behavior identification information; Emigrant behavior identification information; No behavioral identification information; The step of optimizing the initial scheduling matrix of the host machine includes: Determine the time point ranked first in the initial scheduling matrix as the first target time point, and determine the count value of the incoming behavior identification information and the count value of the outgoing behavior identification information in the element of the column corresponding to the first target time point; determining whether the first target time point is a migration-available time point according to the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information; The step of determining whether the first target time point is a migration-available time point according to the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information includes: If the count value of the in-migration behavior identification information in the column corresponding to the first target time point is less than the in-migration quantity threshold, and the count value of the out-migration behavior identification information is less than the out-migration quantity threshold, then the first target time point is determined to be a migration-enabled time point, the element corresponding to the migration-enabled time point is retained, and a time point separated from the first target time point by a preset number of time points is determined to be a second target time point, and whether the second target time point is a migration-enabled time point is determined; Otherwise, whether the first target time point is a migration-available time point is determined according to the sum of the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information.
2. The virtual machine scheduling method according to claim 1, characterized in that: The step of determining whether the first target time point is a migration-available time point according to the sum of the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information comprises: If the sum of the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information at the first target time point is less than or equal to the total scheduling quantity threshold, then determining the first target time point as a migration-available time point and retaining the element corresponding to the time point; Otherwise, the first target time point is determined to be a non-migratable time point, a next time point adjacent to the first target time point is determined to be a third target time point, and it is determined whether the third target time point is a migratable time point.
3. The virtual machine scheduling method according to claim 2, characterized in that: The step of generating a first recommended scheduling matrix comprises: The first recommended scheduling matrix is generated according to the elements of the reserved columns corresponding to the migratable time points.
4. The virtual machine scheduling method according to claim 3, characterized in that: The step of scheduling the virtual machines to enter and exit the host machine according to the first recommended scheduling matrix includes at least one of the following: In response to the instruction that does not require verification, scheduling the virtual machine to enter and exit the host machine according to the first recommended scheduling matrix; In response to an instruction that needs to be verified, and the total scheduling duration corresponding to the first recommended scheduling matrix is greater than a scheduling duration threshold, a new initial scheduling matrix is generated and the new initial scheduling matrix is optimized to generate a new first recommended scheduling matrix, and virtual machines are scheduled to enter and exit the host machine according to the new first recommended scheduling matrix; In response to an instruction that needs to be verified, and the processor load of the virtual machine is greater than a first load threshold, the migration behavior identification information and the migration behavior identification information corresponding to the virtual machine in the first recommended scheduling matrix are shifted back by a preset number of time points to generate a new first recommended scheduling matrix, and the virtual machines are scheduled to enter and exit the host machine according to the new first recommended scheduling matrix; In response to an instruction that needs to be verified and the disk load of the host machine is greater than a second load threshold, all elements in the first recommended scheduling matrix are moved backward by a certain number of time points to generate a new first recommended scheduling matrix, and virtual machines are scheduled to enter and exit the host machine according to the new first recommended scheduling matrix.
5. A virtual machine scheduling device, characterized in that: include: An initialization module is used to initialize the scheduling matrix to obtain the initial scheduling matrix of the host machine; An optimization module, configured to optimize an initial scheduling matrix of the host machine to generate a first recommended scheduling matrix, wherein the first recommended scheduling matrix represents scheduling information of the virtual machine; A scheduling module, configured to schedule virtual machines to enter and exit the host machine according to the first recommended scheduling matrix; The rows of the initial scheduling matrix correspond to virtual machines, the columns of the initial scheduling matrix correspond to time points, and the elements in the initial scheduling matrix include any one of the following: Migration behavior identification information; Emigrant behavior identification information; No behavioral identification information; Wherein, the optimization module includes: A first time point determination submodule, used to determine the first time point in the initial scheduling matrix as the first target time point, and determine the count value of the incoming behavior identification information and the count value of the outgoing behavior identification information in the element of the column corresponding to the first target time point; A first judgment submodule, configured to determine whether the first target time point is a migration-available time point according to the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information; Wherein, the first judgment submodule includes: A first judgment unit, if the count value of the in-migration behavior identification information in the column corresponding to the first target time point is less than the in-migration quantity threshold, and the count value of the out-migration behavior identification information is less than the out-migration quantity threshold, determines that the first target time point is a migration-available time point, retains the element corresponding to the migration-available time point, determines that a time point separated from the first target time point by a preset number of time points is a second target time point, and determines whether the second target time point is a migration-available time point; The second judgment unit, otherwise, determines whether the first target time point is a migration-available time point according to the sum of the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information.
6. The virtual machine scheduling device according to claim 5, characterized in that: The second judging unit comprises: A first judgment subunit determines that the first target time point is a migration-available time point and retains the element corresponding to the time point if the sum of the count value of the in-migration behavior identification information and the count value of the out-migration behavior identification information at the first target time point is less than or equal to the total scheduling quantity threshold; The second judgment subunit, otherwise, determines that the first target time point is a non-migratable time point, determines the next time point adjacent to the first target time point as a third target time point, and determines whether the third target time point is a migratable time point.
7. The virtual machine scheduling device according to claim 6, characterized in that: The optimization module includes: The matrix generation submodule is used to generate the first recommended scheduling matrix according to the elements of the columns corresponding to the reserved migration time points.
8. The virtual machine scheduling device according to claim 7, characterized in that: The scheduling module includes: A first scheduling submodule, configured to schedule the virtual machines to enter and exit the host machine according to the first recommended scheduling matrix in response to the instruction that does not require verification; A second scheduling submodule is used to generate a new initial scheduling matrix and optimize the new initial scheduling matrix in response to the instruction that needs to be verified, and the total scheduling duration corresponding to the first recommended scheduling matrix is greater than the scheduling duration threshold, so as to generate a new first recommended scheduling matrix, and schedule the virtual machine to enter and exit the host machine according to the new first recommended scheduling matrix; A third scheduling submodule is used for, in response to an instruction that needs to be verified and the processor load of the virtual machine is greater than a first load threshold, shifting the migration behavior identification information and the migration behavior identification information corresponding to the virtual machine in the first recommended scheduling matrix back by a preset number of time points to generate a new first recommended scheduling matrix, and scheduling the virtual machine to enter and exit the host machine according to the new first recommended scheduling matrix; The fourth scheduling submodule is used to respond to instructions that need to be verified and the disk load of the host machine is greater than a second load threshold, move all elements in the first recommended scheduling matrix backward by a certain number of time points to generate a new first recommended scheduling matrix, and schedule virtual machines to enter and exit the host machine according to the new first recommended scheduling matrix.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instruction to implement the virtual machine scheduling method according to any one of claims 1 to 4.
10. A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of a virtual machine scheduling electronic device, the virtual machine scheduling electronic device is enabled to execute the virtual machine scheduling method according to any one of claims 1 to 4.
11. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 4.
