A virtual machine resource scheduling method, system, device and medium
By responding to preset rules triggered by the storage pool, determining the host and virtual machine and performing data migration, the problem of not being able to automatically handle storage-related alarms in the prior art is solved, and load balancing of the storage pool and efficient utilization of resources are achieved.
Patent Information
- Application Number
- CN202111035192.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-05
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-09-05
AI Technical Summary
The existing virtual machine resource scheduling scheme cannot automatically handle storage-related alarms, resulting in unbalanced storage pool load.
By responding to preset rules triggered by the storage pool, determine the corresponding host and virtual machine, obtain the storage pool load parameters mounted by the host, determine the target host and the target storage pool, and perform data migration to achieve load balancing of the storage pool.
It realizes automatic scheduling of storage pool resources, achieves load balancing of storage pools, and improves the utilization efficiency of storage resources.
Smart Images

Figure CN113806016B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage, and in particular to a resource scheduling method, system, device and storage medium for a virtual machine. Background Art
[0002] Currently, the resource scheduling solution provided by VMware can only be used in conjunction with solutions such as vCD, vRA, and Horizon view based on association and anti-association rules, and does not automatically process storage-related alarms. Summary of the invention
[0003] In view of this, in order to overcome at least one aspect of the above problems, an embodiment of the present invention proposes a resource scheduling method for a virtual machine, comprising the following steps:
[0004] In response to a storage pool triggering a preset rule, determining a number of hosts corresponding to the storage pool;
[0005] Determining a virtual machine to be subjected to data migration and a source host among a plurality of hosts according to a preset rule triggered by the storage pool;
[0006] Obtaining load parameters of several other storage pools mounted by each of the hosts;
[0007] Determine a target host and a target storage pool among several other storage pools mounted under the target host according to the load parameter;
[0008] The data of the virtual machine to be migrated is migrated from the storage pool to the target storage pool mounted on the target host.
[0009] In some embodiments, in response to a storage pool triggering a preset rule, determining a number of hosts corresponding to the storage pool further includes:
[0010] Obtain the usage rate and IO pressure value of the storage pool at preset time intervals;
[0011] In response to a usage rate of the storage pool being greater than a usage rate threshold, the storage pool triggers a first preset rule;
[0012] In response to the IO pressure value of the storage pool being greater than a pressure threshold, the storage pool triggers a second preset rule.
[0013] In some embodiments, determining a source host among a plurality of hosts and a virtual machine on the source host to be migrated data according to a preset rule triggered by the storage pool further includes:
[0014] In response to the virtual machine triggering a first preset rule, determining the virtual machine to be migrated according to the largest virtual machine file in the storage pool, and further determining the source host according to the virtual machine to be migrated;
[0015] In response to the virtual machine triggering the second preset rule, a virtual machine with the largest virtual machine file among the shut down virtual machines in the plurality of hosts is used as the virtual machine to be migrated, and then the source host is determined according to the virtual machine to be migrated.
[0016] In some embodiments, obtaining load parameters of several other storage pools mounted by each of the hosts further includes:
[0017] In response to the storage pool triggering a first preset rule, obtaining current usage rates of a plurality of other storage pools mounted by each of the hosts;
[0018] In response to the storage pool triggering a second preset rule, current IO pressure values of several other storage pools mounted by each of the hosts are obtained.
[0019] In some embodiments, determining a target host and a target storage pool among several other storage pools mounted under the target host according to the load parameter further includes:
[0020] In response to the storage pool triggering a first preset rule, determining whether current usage rates of a plurality of other storage pools mounted on the source host are all greater than a first preset value;
[0021] In response to the existence of other storage pools whose current usage rate is less than the first preset value, taking the storage pool whose usage rate is less than the first preset value as the target storage pool and taking the source host as the target host;
[0022] In response to the current usage rates of several other storage pools being greater than the first preset value, other storage pools whose current usage rates are less than the first preset value are randomly mounted from other hosts as target storage pools.
[0023] In some embodiments, it also includes:
[0024] In response to the storage pool triggering a second preset rule, determining whether current IO pressure values of a plurality of other storage pools mounted under the source host are all greater than a second preset value;
[0025] In response to the existence of other storage pools whose current IO pressure value is less than the second preset value, taking the storage pool whose current IO pressure value is less than the second preset value as the target storage pool and taking the source host as the target host;
[0026] In response to the current IO pressure values of several other storage pools being greater than the second preset value, other storage pools mounted in other hosts and having current IO pressure values less than the second preset value are used as target storage pools.
[0027] In some embodiments, it also includes:
[0028] The data of the virtual machine to be migrated in the storage pool is deleted.
[0029] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a resource scheduling system for a virtual machine, comprising:
[0030] A first determination module is configured to determine a number of hosts corresponding to the storage pool in response to a storage pool triggering a preset rule;
[0031] A second determination module is configured to determine a virtual machine to be subjected to data migration and a source host among a plurality of hosts according to a preset rule triggered by the storage pool;
[0032] An acquisition module configured to acquire load parameters of a plurality of other storage pools mounted by each of the hosts;
[0033] A third determination module is configured to determine a target host and a target storage pool among several other storage pools mounted under the target host according to the load parameter;
[0034] The migration module is configured to migrate the data of the virtual machine to be migrated from the storage pool to the target storage pool mounted on the target host.
[0035] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer device, including:
[0036] at least one processor; and
[0037] A memory storing a computer program executable on the processor, wherein the processor executes the steps of any one of the resource scheduling methods for a virtual machine as described above when executing the program.
[0038] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the resource scheduling methods for a virtual machine as described above are performed.
[0039] The present invention has one of the following beneficial technical effects: the solution proposed in the present invention can automatically schedule storage pool resources to achieve load balancing of the storage pool. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.
[0041] Figure 1 A schematic diagram of a flow chart of a resource scheduling method for a virtual machine provided by an embodiment of the present invention;
[0042] Figure 2 A schematic diagram of the structure of a resource scheduling system for a virtual machine provided by an embodiment of the present invention;
[0043] Figure 3 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention;
[0044] Figure 4 A schematic diagram of the structure of a computer-readable storage medium provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0046] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.
[0047] According to one aspect of the present invention, an embodiment of the present invention provides a resource scheduling method for a virtual machine, such as Figure 1 As shown, it may include the steps of:
[0048] S1, in response to a storage pool triggering a preset rule, determining a number of hosts corresponding to the storage pool;
[0049] S2, determining a virtual machine to be subjected to data migration and a source host among a plurality of hosts according to a preset rule triggered by the storage pool;
[0050] S3, obtaining load parameters of several other storage pools mounted by each of the hosts;
[0051] S4, determining a target host and a target storage pool among several other storage pools mounted under the target host according to the load parameter;
[0052] S5, migrating the data of the virtual machine to be migrated from the storage pool to the target storage pool mounted on the target host.
[0053] The solution proposed in the present invention can automatically schedule storage pool resources to achieve load balancing of the storage pool.
[0054] In some embodiments, the OCFS cluster file system can be used to implement basic management of the file system through the 02cb service, and any node in the cluster can access the storage device in parallel. The storage pool device type supports local disks of server nodes, shared disks of SCSI services provided by SAS and ATA disks, and disks of distributed storage pools.
[0055] In this way, multiple storage pools of different types can be mounted on each host. Multiple storage pools can include storage pools that are exclusive to the host or storage pools shared with other hosts. In addition, the storage pool has a special tree structure. You only need to create a separate DRS directory, which can also be called a storage cluster. Add different storage pool resources to the storage cluster for management. In addition to automatically recommending the best storage resources when creating, cloning, or migrating VMs, it can also trigger preset rules when a storage pool on the host has an increased storage rate or excessive IO pressure due to the continuous growth of business data of the virtual machine, which exceeds the trigger threshold.
[0056] In some embodiments, in response to a storage pool triggering a preset rule, determining a number of hosts corresponding to the storage pool further includes:
[0057] Obtain the usage rate and IO pressure value of the storage pool at preset time intervals;
[0058] In response to a usage rate of the storage pool being greater than a usage rate threshold, the storage pool triggers a first preset rule;
[0059] In response to the IO pressure value of the storage pool being greater than a pressure threshold, the storage pool triggers a second preset rule.
[0060] Specifically, the normal operation of a virtual machine depends not only on whether the CPU and memory resources of the host where it is located are sufficient, but also on whether the storage resources where it is located are sufficient. In order to ensure the storage resources required by the running virtual machines, multiple different storage pools can be managed in a clustered manner. With the increase of virtual machine business data, when the usage rate or IO pressure of a storage pool in the cluster is high, the storage pool will generate a corresponding alarm, or the usage rate and IO pressure of the storage pool can be detected at preset time intervals. If the usage rate or IO pressure exceeds the set scheduling threshold, the scheduling of the storage cluster will be triggered. At this time, the background can obtain the storage usage of all storage and the %util value of IO pressure (a few percent of a second is used for IO operations), and obtain through monitoring whether the usage rate of a storage pool in the cluster pool is higher than the set threshold, or the %util value is higher than the threshold.
[0061] In some embodiments, determining a source host among a plurality of hosts and a virtual machine on the source host to be migrated data according to a preset rule triggered by the storage pool further includes:
[0062] In response to the virtual machine triggering a first preset rule, determining the virtual machine to be migrated according to the largest virtual machine file in the storage pool, and further determining the source host according to the virtual machine to be migrated;
[0063] In response to the virtual machine triggering the second preset rule, a virtual machine with the largest virtual machine file among the shut down virtual machines in the plurality of hosts is used as the virtual machine to be migrated, and then the source host is determined according to the virtual machine to be migrated.
[0064] Specifically, if the usage rate of a storage pool is higher than a threshold, the disk files of all virtual machines on the storage pool can be sorted by size, and the largest disk file can be obtained as the migration object. The virtual machine to be migrated and the source host where the virtual machine is located can be determined through the largest disk file. If the %util value is higher than or equal to the set threshold, because the IO operation of the original storage pool is relatively frequent at this time, the virtual machine with the largest virtual machine file among the virtual machines in the shutdown state of several hosts will be used as the virtual machine to be migrated.
[0065] In some embodiments, obtaining load parameters of several other storage pools mounted by each of the hosts further includes:
[0066] In response to the storage pool triggering a first preset rule, obtaining current usage rates of a plurality of other storage pools mounted by each of the hosts;
[0067] In response to the storage pool triggering a second preset rule, current IO pressure values of several other storage pools mounted by each of the hosts are obtained.
[0068] In some embodiments, determining a target host and a target storage pool among several other storage pools mounted under the target host according to the load parameter further includes:
[0069] In response to the storage pool triggering a first preset rule, determining whether current usage rates of a plurality of other storage pools mounted on the source host are all greater than a first preset value;
[0070] In response to the existence of other storage pools whose current usage rate is less than the first preset value, taking the storage pool whose usage rate is less than the first preset value as the target storage pool and taking the source host as the target host;
[0071] In response to the current usage rates of several other storage pools being greater than the first preset value, other storage pools whose current usage rates are less than the first preset value are randomly mounted from other hosts as target storage pools.
[0072] In some embodiments, it also includes:
[0073] In response to the storage pool triggering a second preset rule, determining whether current IO pressure values of a plurality of other storage pools mounted under the source host are all greater than a second preset value;
[0074] In response to the existence of other storage pools whose current IO pressure value is less than the second preset value, taking the storage pool whose current IO pressure value is less than the second preset value as the target storage pool and taking the source host as the target host;
[0075] In response to the current IO pressure values of several other storage pools being greater than the second preset value, other storage pools mounted in other hosts and having current IO pressure values less than the second preset value are used as target storage pools.
[0076] Specifically, when the first preset rule is triggered, the storage pools in the cluster with IO pressure values lower than the first preset value can be sorted by the current usage rate, and the storage pool with the smallest usage rate mounted on the same host is preferentially obtained as the target storage pool for scheduling. If there is no applicable storage pool on the same host, other storage pools are traversed and the storage pool with the smallest usage rate is used as the target storage, and then the data in the original storage pool is obtained and migrated to the target storage pool. When the second preset rule is triggered, the storage pools in the cluster with IO pressure values lower than the second preset value can be sorted by the current IO pressure values, and the storage pool with the current IO pressure value mounted on the same host is preferentially obtained as the target storage pool for scheduling. If there is no applicable storage pool on the same host, other storage pools are traversed and the storage pool with the current IO pressure value is used as the target storage, and then the data in the original storage pool is obtained and migrated to the target storage pool.
[0077] In some embodiments, it also includes:
[0078] The data of the virtual machine to be migrated in the storage pool is deleted.
[0079] Specifically, after the data migration is completed, the virtual machine disk files of the original storage pool are deleted, and the alarms generated by the original storage pool automatically disappear from the historical alarm list.
[0080] Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a virtual machine resource scheduling system 400, such as Figure 2 As shown, including:
[0081] A first determination module 401 is configured to determine a number of hosts corresponding to the storage pool in response to a storage pool triggering a preset rule;
[0082] A second determination module 402 is configured to determine a virtual machine to be subjected to data migration and a source host among a plurality of hosts according to a preset rule triggered by the storage pool;
[0083] The acquisition module 403 is configured to acquire load parameters of a plurality of other storage pools mounted by each of the hosts;
[0084] A third determination module 404 is configured to determine a target host and a target storage pool among several other storage pools mounted under the target host according to the load parameter;
[0085] The migration module 405 is configured to migrate the data of the virtual machine to be migrated from the storage pool to the target storage pool mounted on the target host.
[0086] The solution proposed in the present invention can automatically schedule storage pool resources to achieve load balancing of the storage pool.
[0087] In some embodiments, in response to a storage pool triggering a preset rule, determining a number of hosts corresponding to the storage pool further includes:
[0088] Obtain the usage rate and IO pressure value of the storage pool at preset time intervals;
[0089] In response to a usage rate of the storage pool being greater than a usage rate threshold, the storage pool triggers a first preset rule;
[0090] In response to the IO pressure value of the storage pool being greater than a pressure threshold, the storage pool triggers a second preset rule.
[0091] In some embodiments, determining a source host among a plurality of hosts and a virtual machine on the source host to be migrated data according to a preset rule triggered by the storage pool further includes:
[0092] In response to the virtual machine triggering a first preset rule, determining the virtual machine to be migrated according to the largest virtual machine file in the storage pool, and further determining the source host according to the virtual machine to be migrated;
[0093] In response to the virtual machine triggering the second preset rule, a virtual machine with the largest virtual machine file among the shut down virtual machines in the plurality of hosts is used as the virtual machine to be migrated, and then the source host is determined according to the virtual machine to be migrated.
[0094] In some embodiments, obtaining load parameters of several other storage pools mounted by each of the hosts further includes:
[0095] In response to the storage pool triggering a first preset rule, obtaining current usage rates of a plurality of other storage pools mounted by each of the hosts;
[0096] In response to the storage pool triggering a second preset rule, current IO pressure values of several other storage pools mounted by each of the hosts are obtained.
[0097] In some embodiments, determining a target host and a target storage pool among several other storage pools mounted under the target host according to the load parameter further includes:
[0098] In response to the storage pool triggering a first preset rule, determining whether current usage rates of a plurality of other storage pools mounted on the source host are all greater than a first preset value;
[0099] In response to the existence of other storage pools whose current usage rate is less than the first preset value, taking the storage pool whose usage rate is less than the first preset value as the target storage pool and taking the source host as the target host;
[0100] In response to the current usage rates of several other storage pools being greater than the first preset value, other storage pools whose current usage rates are less than the first preset value are randomly mounted from other hosts as target storage pools.
[0101] In some embodiments, it also includes:
[0102] In response to the storage pool triggering a second preset rule, determining whether current IO pressure values of a plurality of other storage pools mounted under the source host are all greater than a second preset value;
[0103] In response to the existence of other storage pools whose current IO pressure value is less than the second preset value, taking the storage pool whose current IO pressure value is less than the second preset value as the target storage pool and taking the source host as the target host;
[0104] In response to the current IO pressure values of several other storage pools being greater than the second preset value, other storage pools mounted in other hosts and having current IO pressure values less than the second preset value are used as target storage pools.
[0105] In some embodiments, it also includes:
[0106] The data of the virtual machine to be migrated in the storage pool is deleted.
[0107] Based on the same inventive concept, according to another aspect of the present invention, Figure 3 As shown, an embodiment of the present invention further provides a computer device 501, including:
[0108] at least one processor 520; and
[0109] The memory 510 stores a computer program 511 that can be run on the processor. When the processor 520 executes the program, the following steps are performed:
[0110] S1, in response to a storage pool triggering a preset rule, determining a number of hosts corresponding to the storage pool;
[0111] S2, determining a virtual machine to be subjected to data migration and a source host among a plurality of hosts according to a preset rule triggered by the storage pool;
[0112] S3, obtaining load parameters of several other storage pools mounted by each of the hosts;
[0113] S4, determining a target host and a target storage pool among several other storage pools mounted under the target host according to the load parameter;
[0114] S5, migrating the data of the virtual machine to be migrated from the storage pool to the target storage pool mounted on the target host.
[0115] The solution proposed in the present invention can automatically schedule storage pool resources to achieve load balancing of the storage pool.
[0116] In some embodiments, in response to a storage pool triggering a preset rule, determining a number of hosts corresponding to the storage pool further includes:
[0117] Obtain the usage rate and IO pressure value of the storage pool at preset time intervals;
[0118] In response to a usage rate of the storage pool being greater than a usage rate threshold, the storage pool triggers a first preset rule;
[0119] In response to the IO pressure value of the storage pool being greater than a pressure threshold, the storage pool triggers a second preset rule.
[0120] In some embodiments, determining a source host among a plurality of hosts and a virtual machine on the source host to be migrated data according to a preset rule triggered by the storage pool further includes:
[0121] In response to the virtual machine triggering a first preset rule, determining the virtual machine to be migrated according to the largest virtual machine file in the storage pool, and further determining the source host according to the virtual machine to be migrated;
[0122] In response to the virtual machine triggering the second preset rule, a virtual machine with the largest virtual machine file among the shut down virtual machines in the plurality of hosts is used as the virtual machine to be migrated, and then the source host is determined according to the virtual machine to be migrated.
[0123] In some embodiments, obtaining load parameters of several other storage pools mounted by each of the hosts further includes:
[0124] In response to the storage pool triggering a first preset rule, obtaining current usage rates of a plurality of other storage pools mounted by each of the hosts;
[0125] In response to the storage pool triggering a second preset rule, current IO pressure values of several other storage pools mounted by each of the hosts are obtained.
[0126] In some embodiments, determining a target host and a target storage pool among several other storage pools mounted under the target host according to the load parameter further includes:
[0127] In response to the storage pool triggering a first preset rule, determining whether current usage rates of a plurality of other storage pools mounted on the source host are all greater than a first preset value;
[0128] In response to the existence of other storage pools whose current usage rate is less than the first preset value, taking the storage pool whose usage rate is less than the first preset value as the target storage pool and taking the source host as the target host;
[0129] In response to the current usage rates of several other storage pools being greater than the first preset value, other storage pools whose current usage rates are less than the first preset value are randomly mounted from other hosts as target storage pools.
[0130] In some embodiments, it also includes:
[0131] In response to the storage pool triggering a second preset rule, determining whether current IO pressure values of a plurality of other storage pools mounted under the source host are all greater than a second preset value;
[0132] In response to the existence of other storage pools whose current IO pressure value is less than the second preset value, taking the storage pool whose current IO pressure value is less than the second preset value as the target storage pool and taking the source host as the target host;
[0133] In response to the current IO pressure values of several other storage pools being greater than the second preset value, other storage pools mounted in other hosts and having current IO pressure values less than the second preset value are used as target storage pools.
[0134] In some embodiments, it also includes:
[0135] The data of the virtual machine to be migrated in the storage pool is deleted.
[0136] Based on the same inventive concept, according to another aspect of the present invention, Figure 4 As shown, an embodiment of the present invention further provides a computer-readable storage medium 601, wherein the computer-readable storage medium 601 stores computer program instructions 610, and when the computer program instructions 610 are executed by a processor, the following steps are performed:
[0137] S1, in response to a storage pool triggering a preset rule, determining a number of hosts corresponding to the storage pool;
[0138] S2, determining a virtual machine to be subjected to data migration and a source host among a plurality of hosts according to a preset rule triggered by the storage pool;
[0139] S3, obtaining load parameters of several other storage pools mounted by each of the hosts;
[0140] S4, determining a target host and a target storage pool among several other storage pools mounted under the target host according to the load parameter;
[0141] S5, migrating the data of the virtual machine to be migrated from the storage pool to the target storage pool mounted on the target host.
[0142] The solution proposed in the present invention can automatically schedule storage pool resources to achieve load balancing of the storage pool.
[0143] In some embodiments, in response to a storage pool triggering a preset rule, determining a number of hosts corresponding to the storage pool further includes:
[0144] Obtain the usage rate and IO pressure value of the storage pool at preset time intervals;
[0145] In response to a usage rate of the storage pool being greater than a usage rate threshold, the storage pool triggers a first preset rule;
[0146] In response to the IO pressure value of the storage pool being greater than a pressure threshold, the storage pool triggers a second preset rule.
[0147] In some embodiments, determining a source host among a plurality of hosts and a virtual machine on the source host to be migrated data according to a preset rule triggered by the storage pool further includes:
[0148] In response to the virtual machine triggering a first preset rule, determining the virtual machine to be migrated according to the largest virtual machine file in the storage pool, and further determining the source host according to the virtual machine to be migrated;
[0149] In response to the virtual machine triggering the second preset rule, a virtual machine with the largest virtual machine file among the shut down virtual machines in the plurality of hosts is used as the virtual machine to be migrated, and then the source host is determined according to the virtual machine to be migrated.
[0150] In some embodiments, obtaining load parameters of several other storage pools mounted by each of the hosts further includes:
[0151] In response to the storage pool triggering a first preset rule, obtaining current usage rates of a plurality of other storage pools mounted by each of the hosts;
[0152] In response to the storage pool triggering a second preset rule, current IO pressure values of several other storage pools mounted by each of the hosts are obtained.
[0153] In some embodiments, determining a target host and a target storage pool among several other storage pools mounted under the target host according to the load parameter further includes:
[0154] In response to the storage pool triggering a first preset rule, determining whether current usage rates of a plurality of other storage pools mounted on the source host are all greater than a first preset value;
[0155] In response to the existence of other storage pools whose current usage rate is less than the first preset value, taking the storage pool whose usage rate is less than the first preset value as the target storage pool and taking the source host as the target host;
[0156] In response to the current usage rates of several other storage pools being greater than the first preset value, other storage pools whose current usage rates are less than the first preset value are randomly mounted from other hosts as target storage pools.
[0157] In some embodiments, it also includes:
[0158] In response to the storage pool triggering a second preset rule, determining whether current IO pressure values of a plurality of other storage pools mounted under the source host are all greater than a second preset value;
[0159] In response to the existence of other storage pools whose current IO pressure value is less than the second preset value, taking the storage pool whose current IO pressure value is less than the second preset value as the target storage pool and taking the source host as the target host;
[0160] In response to the current IO pressure values of several other storage pools being greater than the second preset value, other storage pools mounted in other hosts and having current IO pressure values less than the second preset value are used as target storage pools.
[0161] In some embodiments, it also includes:
[0162] The data of the virtual machine to be migrated in the storage pool is deleted.
[0163] Finally, it should be noted that a person skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods.
[0164] Furthermore, it should be appreciated that the computer-readable storage medium (eg, memory) herein may be either a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.
[0165] It will also be appreciated by those skilled in the art that various exemplary logic blocks, modules, circuits and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.
[0166] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
[0167] It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations including one or more of the associated listed items.
[0168] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0169] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0170] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.
Claims
1. A method for resource scheduling of a virtual machine, characterized in that: The following steps are involved: In response to a storage pool triggering a preset rule, determining a number of hosts corresponding to the storage pool; Determining a virtual machine to be subjected to data migration and a source host among a plurality of hosts according to a preset rule triggered by the storage pool; Obtaining load parameters of several other storage pools mounted by each of the hosts; Determine a target host and a target storage pool among several other storage pools mounted under the target host according to the load parameter; Migrating the data of the virtual machine to be migrated from the storage pool to the target storage pool mounted on the target host; In response to a storage pool triggering a preset rule, determining a number of hosts corresponding to the storage pool further includes: Obtain the usage rate and IO pressure value of the storage pool at preset time intervals; In response to a usage rate of the storage pool being greater than a usage rate threshold, the storage pool triggers a first preset rule; In response to the IO pressure value of the storage pool being greater than a pressure threshold, the storage pool triggers a second preset rule; Determining a source host among a plurality of hosts and a virtual machine on the source host to be migrated data according to a preset rule triggered by the storage pool further includes: In response to the virtual machine triggering a first preset rule, determining the virtual machine to be migrated according to the largest virtual machine file in the storage pool, and further determining the source host according to the virtual machine to be migrated; In response to the virtual machine triggering the second preset rule, a virtual machine with the largest virtual machine file among the virtual machines in the shut down state in the plurality of hosts is used as the virtual machine to be migrated, and then the source host is determined according to the virtual machine to be migrated; Determining a target host and a target storage pool among a plurality of other storage pools mounted under the target host according to the load parameter further includes: In response to the storage pool triggering a first preset rule, determining whether current usage rates of a plurality of other storage pools mounted on the source host are all greater than a first preset value; In response to the existence of other storage pools whose current usage rate is less than the first preset value, taking the storage pool whose usage rate is less than the first preset value as the target storage pool and taking the source host as the target host; In response to the current usage rates of the other storage pools being greater than the first preset value, randomly mounting other storage pools whose current usage rates are less than the first preset value from other hosts as target storage pools; In response to the storage pool triggering a second preset rule, determining whether current IO pressure values of a plurality of other storage pools mounted under the source host are all greater than a second preset value; In response to the existence of other storage pools whose current IO pressure value is less than the second preset value, taking the storage pool whose current IO pressure value is less than the second preset value as the target storage pool and taking the source host as the target host; In response to the current IO pressure values of several other storage pools being greater than the second preset value, other storage pools mounted in other hosts and having current IO pressure values less than the second preset value are used as target storage pools.
2. The method according to claim 1, characterized in that Obtaining load parameters of several other storage pools mounted by each of the hosts further includes: In response to the storage pool triggering a first preset rule, obtaining current usage rates of a plurality of other storage pools mounted by each of the hosts; In response to the storage pool triggering a second preset rule, current IO pressure values of several other storage pools mounted by each of the hosts are obtained.
3. The method according to claim 1, characterized in that Also includes: The data of the virtual machine to be migrated in the storage pool is deleted.
4. A virtual machine resource scheduling system, characterized in that: include: A first determination module is configured to determine a number of hosts corresponding to the storage pool in response to a storage pool triggering a preset rule; A second determination module is configured to determine a virtual machine to be subjected to data migration and a source host among a plurality of hosts according to a preset rule triggered by the storage pool; An acquisition module configured to acquire load parameters of a plurality of other storage pools mounted by each of the hosts; A third determination module is configured to determine a target host and a target storage pool among several other storage pools mounted under the target host according to the load parameter; A migration module, configured to migrate the data of the virtual machine to be migrated from the storage pool to the target storage pool mounted on the target host; The first determination module is further configured to: Obtain the usage rate and IO pressure value of the storage pool at preset time intervals; In response to a usage rate of the storage pool being greater than a usage rate threshold, the storage pool triggers a first preset rule; In response to the IO pressure value of the storage pool being greater than a pressure threshold, the storage pool triggers a second preset rule; The second determination module is further configured as: In response to the virtual machine triggering a first preset rule, determining the virtual machine to be migrated according to the largest virtual machine file in the storage pool, and further determining the source host according to the virtual machine to be migrated; In response to the virtual machine triggering the second preset rule, a virtual machine with the largest virtual machine file among the virtual machines in the shut down state in the plurality of hosts is used as the virtual machine to be migrated, and then the source host is determined according to the virtual machine to be migrated; The third determination module is further configured as: In response to the storage pool triggering a first preset rule, determining whether current usage rates of a plurality of other storage pools mounted on the source host are all greater than a first preset value; In response to the existence of other storage pools whose current usage rate is less than the first preset value, taking the storage pool whose usage rate is less than the first preset value as the target storage pool and taking the source host as the target host; In response to the current usage rates of the other storage pools being greater than the first preset value, randomly mounting other storage pools whose current usage rates are less than the first preset value from other hosts as target storage pools; In response to the storage pool triggering a second preset rule, determining whether current IO pressure values of a plurality of other storage pools mounted under the source host are all greater than a second preset value; In response to the existence of other storage pools whose current IO pressure value is less than the second preset value, taking the storage pool whose current IO pressure value is less than the second preset value as the target storage pool and taking the source host as the target host; In response to the current IO pressure values of several other storage pools being greater than the second preset value, other storage pools mounted in other hosts and having current IO pressure values less than the second preset value are used as target storage pools.
5. A computer device comprising: at least one processor; as well as A memory storing a computer program executable on the processor, wherein the processor executes the steps of the method according to any one of claims 1 to 3 when executing the program.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are performed.
Citation Information
Patent Citations
Method and device for balancing load of virtual machine
CN102508718A
Load balance scheduling method for cloud computing virtual server system
CN108874508A