Resource adjusting method, device and the cloud platform of cluster
Technical field
This application involves field of cloud calculation, more particularly to a kind of resource adjusting method of cluster, device and cloud platform.
Background technology
Platform in cloud computing (Cloud Computing) services (Platform as a Service, PaaS) technology
It is a kind of a kind of technology that user can be supplied to using the operation of application program and development environment as service.Wherein, for carrying
The platform of operation and development environment for application program is known as cloud platform, which generally includes scheduler, and by a large amount of
The cluster of virtual machine (Virtual Machine, VM) composition, the scheduler can according to the demand of user and preset scheduling
Rule, the application deployment that user is submitted realize the scheduling to application program in one or more virtual machines.
In the related technology, in order to improve dispatching efficiency, multiple schedulers, multiple scheduler can be set in cloud platform
The resource of cluster can be shared, i.e., each scheduler can obtain the resource information of each virtual machine in cluster in real time, and can be with
According to the resource information got, the scheduling to application program is realized.Wherein, the resource of cluster refers to each virtual machine in cluster
The resources such as occupied CPU, memory and disk.
But when cluster load it is larger, when surplus resources are less, if multiple schedulers have scheduler task in synchronization
Need to execute, and multiple scheduler by application program scheduling to same surplus resources less virtual machine when, it is possible that
Scheduling conflict leads to the case where scheduling failure.
Invention content
This application provides a kind of resource adjusting method of cluster, device and cloud platforms, can solve in the related technology
Scheduling conflict leads to the problem of scheduling failure, and technical solution is as follows:
On the one hand, a kind of resource adjusting method of cluster is provided, this method can be applied in the host node of cloud platform,
The cluster includes multiple resource partitionings, and each resource partitioning includes at least one virtual machine VM, and each resource partitioning corresponds to one
A scheduler, this method may include:Host node obtains the VM information of each VM in the cluster, is believed according to the VM got
Breath adjusts the VM included by least one resource partitioning, and can update the partition information of the cluster, this point according to adjustment result
Area's information is used to indicate the VM that each resource partitioning includes, and each scheduler is used for according to the partition information in corresponding resource point
Scheduler task is executed in area.
It, can be to avoid each since each scheduler can independently execute scheduler task in corresponding resource partitioning
The problem of failure being dispatched caused by scheduler schedules conflict;And since VM information can be based on, to each resource in cluster
The resource of subregion is adjusted into Mobile state, therefore the equiblibrium mass distribution of cluster resource may be implemented, the money of each resource partitioning of efficient balance
Source utilization rate, and then the utilization rate of cluster resource can be improved.
Optionally, which includes:Resource information;Then host node is according to the VM information got, adjustment at least one
The process of VM included by a resource partitioning may include:
According to the resource information of each VM in the cluster, the surplus yield of each VM is determined, and determine the surplus of the cluster
Remaining total resources;The surplus resources total amount of surplus yield and the cluster based on each VM adjusts at least one resource point
VM ownership included by area so that the surplus yield that each resource partitioning occupies meets preset resource proportioning.
Preset resource proportioning such as can be at the ratios, can also be to be determined based on the history scheduling quantum of each scheduler
, the stock number included by each resource partitioning is adjusted by resource proportioning, it is ensured that the reasonable distribution of cluster resource carries
High resource utilization.
Optionally, surplus yield and the surplus resources total amount of the host node based on each VM, adjustment are at least one
The process of VM included by resource partitioning may include:
It is matched according to the preset resource, the surplus resources of the cluster is divided into N parts of resources, every part of resource is by least one
A VM is provided, and every part of resource corresponds to a resource partitioning, which is the number for the resource partitioning that the cluster includes;
At least one VM for providing every part of resource is divided to corresponding resource partitioning.
Further, which can also include:The type information of VM;Then determine the surplus resources total amount of the cluster
Process may include:
According to the type information of each VM, multiple VM which includes are divided at least two groups resource group, every group of money
The type at least one VM that source group includes is consistent;
The surplus resources total amount at least one VM that every group of resource group includes is determined respectively;
Correspondingly, matched according to the preset resource, the process that the surplus resources of the cluster are divided into N parts of resources can be with
Including:
It is matched according to the preset resource, the surplus resources of every group of resource group is divided into N one's share of expenses for a joint undertaking resources, per one's share of expenses for a joint undertaking resource
It is provided by least one VM, and a resource partitioning is corresponded to per one's share of expenses for a joint undertaking resource;
It will be determined as a resource corresponding at least two one's share of expenses for a joint undertaking resources of the same resource partitioning.
Type based on each VM is adjusted cluster resource, it is ensured that different types of resource is equal in cluster
Weighing apparatus distribution, further improves the harmony of resource allocation in cluster.
Optionally, before adjusting the VM included by least one resource partitioning, this method can also include:
Determine the physical location that each VM is disposed;
Correspondingly, the surplus yield based on each VM and the surplus resources total amount, adjust at least one resource partitioning
The process of included VM may include:
The physical location that surplus yield, the surplus resources total amount and each VM based on each VM are disposed, adjustment
VM included by least one resource partitioning;
Wherein, equal for any two surplus yield, and adjust to the first VM of different resource subregion and the 2nd VM,
Average physical distance in first VM and first resource subregion belonging to it between each VM, be less than the 2nd VM with this first
Average physical distance in resource partitioning between each VM.
The closer VM of physical location can be divided in the same resource partitioning by method provided by the present application as possible, to reduce
Communication delay in same resource partitioning between each VM improves the efficiency of communication.
Optionally, according to the resource information of each VM in the cluster, the surplus yield of each VM is determined, and determine the collection
The surplus resources of group always measure process and may include:
According to the resource information of each VM in the cluster, the surplus yield of each VM is determined;
Based on the surplus yield of each VM, determine that at least one target VM, the surplus yield of each target VM are more than
Predetermined threshold value;
The sum of the surplus yield of at least one target VM is determined as to the surplus resources total amount of the cluster;
Correspondingly, the surplus yield based on each VM and the surplus resources total amount, adjust at least one resource partitioning
The process of included VM may include:
Surplus yield based on each target VM and the surplus resources total amount, adjust at least one resource partitioning and are wrapped
The target VM included.
Method provided by the present application can only be adjusted the resource partitioning belonging at least one target VM, and for
Surplus yield be less than predetermined threshold value VM, may not need adjustment its belonging to subregion, it is possible thereby to minimize resource partitioning
Variation degree, improve the regulated efficiency of resource partitioning.
Optionally, which may include:Resource information;Adjust the VM included by least one resource partitioning it
Before, this method can also include:
Obtain the partition information of the cluster;According to the resource information and the partition information of each VM in the cluster, detection
Whether the cluster meets subregion regularization condition;
Correspondingly, according to the VM information got, the process for adjusting the partition information of the cluster may include:
When detecting that the cluster meets the subregion regularization condition, according to the VM information got, each resource is adjusted
VM included by subregion.
Wherein, it detects the cluster and whether meets the process of subregion regularization condition and may include:
According to the resource information and the partition information of each VM in the cluster, determine that the resource of each resource partitioning makes
With rate, which is the ratio of the total resources of the used stock number of resource partitioning and occupancy;
When detecting that resource utilization is more than the number of the resource partitioning of utilization rate threshold value more than number threshold value, determining should
Cluster meets subregion regularization condition;
When detecting that resource utilization is more than the number of the resource partitioning of utilization rate threshold value no more than number threshold value, determine
The cluster is unsatisfactory for subregion regularization condition.
To the resource of cluster when being more than the number of the resource partitioning of utilization rate threshold value in resource utilization more than number threshold value
It is readjusted, it is ensured that the promptness of cluster resource adjustment effectively avoids the higher resource partitioning institute of resource utilization
There is the problem of scheduling failure in corresponding scheduler.
Optionally, which may include:In processor resource information, memory source information and storage resource information
At least one information;The resource utilization is more than utilization rate threshold value:
The average value of the utilization rate of the corresponding resource of each information is more than the utilization rate threshold value;Alternatively, at least one is believed
In breath, the number that the utilization rate of corresponding resource is more than the information of the utilization rate threshold value is more than amount threshold.
Optionally, the process of the VM information of each VM may include in acquisition cluster:
According to the preset adjustment period, the VM information of each VM in the cluster is periodically obtained;
Alternatively, when the quantity for the scheduler being arranged in detecting cloud platform changes, each VM in the cluster is obtained
VM information.
Method provided by the present application, host node periodically can carry out cluster resource according to the preset adjustment period
Adjustment, or the resource partitioning of cluster can be adjusted in time when scheduler quantity changes, the resource adjusting method
Flexibility is higher.
On the other hand, a kind of resource adjusting apparatus of cluster is provided, which includes multiple resource partitionings, each resource
Subregion includes at least one VM, and each resource partitioning corresponds to a scheduler, which may include:At least one module,
The resource adjusting method for the cluster that at least one module is provided for realizing above-mentioned aspect.
Another aspect provides a kind of cloud platform, which includes:Cluster, multiple schedulers and as in terms of above-mentioned
The resource adjusting apparatus of the cluster provided.
In another aspect, providing a kind of computer readable storage medium, finger is stored in the computer readable storage medium
It enables, when the computer readable storage medium is run on computers so that computer executes the collection as provided in terms of above-mentioned
The resource adjusting method of group.
In another aspect, a kind of computer program product including instruction is provided, when the computer program product is calculating
When being run on machine, computer can be made to execute the resource adjusting method for the cluster that above-mentioned aspect is provided.
In conclusion this application provides a kind of resource adjusting method of cluster, device and cloud platforms, for including multiple
The cluster of resource partitioning, the method that the application supplies can obtain the VM information of each VM in the cluster, be believed according to the VM got
Breath adjusts the VM included by least one resource partitioning, and can update the partition information of cluster according to adjustment result so that every
A scheduler can execute scheduler task according to the partition information after adjustment in corresponding resource partitioning.Since the application provides
Method in, each scheduler can independently execute scheduler task in corresponding resource partitioning, therefore it is possible to prevente effectively from adjust
The problem of failure being dispatched caused by degree conflict;And it due to can be adjusted into Mobile state to the resource of cluster, can protect
Cluster resource is demonstrate,proved in the equilibrium assignment of each resource partitioning, the efficient balance resource utilization of each resource partitioning improves
The utilization rate of cluster resource.
Description of the drawings
Figure 1A is the framework of the cloud platform involved by a kind of resource adjusting method of the cluster provided in the embodiment of the present invention
Figure;
Figure 1B is a kind of schematic diagram of the resource dividing condition of the cluster provided in the embodiment of the present invention;
Fig. 1 C are the framves of the cloud platform involved by the resource adjusting method of another cluster provided in the embodiment of the present invention
Composition;
Fig. 2 is a kind of flow chart of the resource adjusting method of the cluster provided in the embodiment of the present invention;
Fig. 3 is whether a kind of detection cluster provided in the embodiment of the present invention meets the method flow of subregion regularization condition
Figure;
Fig. 4 is the method flow of the VM included by least one resource partitioning of a kind of adjustment for being provided in the embodiment of the present invention
Figure;
Fig. 5 is the schematic diagram of the resource dividing condition of another cluster provided in the embodiment of the present invention;
Fig. 6 is the schematic diagram of the resource dividing condition of another cluster provided in the embodiment of the present invention;
Fig. 7 is the flow chart of the resource adjusting method of another cluster provided in the embodiment of the present invention;
Fig. 8 is the flow chart of the resource adjusting method of another cluster provided in the embodiment of the present invention;
Fig. 9 is the flow chart of the resource adjusting method of another cluster provided in the embodiment of the present invention;
Figure 10 is a kind of structural schematic diagram of the resource adjusting apparatus of cluster provided in an embodiment of the present invention;
Figure 11 is a kind of structural schematic diagram of adjustment module provided in an embodiment of the present invention;
Figure 12 is the structural schematic diagram of the resource adjusting apparatus of another cluster provided in an embodiment of the present invention;
Figure 13 is the structural schematic diagram of the resource adjusting apparatus of another cluster provided in an embodiment of the present invention.
Specific implementation mode
In the related technology, can also be multiple by assemblage classification according to the difference of Computational frame in order to improve dispatching efficiency
Resource partitioning, each resource partitioning include for supporting a kind of multiple VM of Computational frame.And it is possible to be each resource partitioning
It is correspondingly arranged a scheduler, each scheduler can execute task scheduling in its corresponding resource partitioning, that is to say, each
Scheduler can select after the application program for receiving user's submission in multiple VM included by its corresponding resource partitioning
Select suitable VM and dispose the application program, to allow application program installation kit or image file start and run it is virtual at this
On machine.Multiple scheduler concurrent working, can effectively improve the efficiency of scheduling.
But with the growth of cloud platform run time, it is possible that the resource of certain resource partitionings is nervous in cluster,
The resource of certain resource partitionings is idle, causes each unbalanced problem of resource partitioning resource utilization in cluster.
Figure 1A is referred to, it illustrates the cloud involved by the resource adjusting method of the cluster provided in the embodiment of the present invention is flat
The Organization Chart of platform.The resource adjusting method of the cluster can be applied to the host node of cluster management system in cloud platform (also referred to as
Master nodes) in 00.With reference to figure 1A, which further includes cluster, multiple schedulers and the data being made of multiple VM
Library 10, such as Figure 1A show S0, S1 and S2 totally three schedulers.Multiple VM included by the cluster can be divided into multiple moneys
Source partition, each resource partitioning include at least one VM.Each scheduler in multiple scheduler can correspond to a money
Source partition, each scheduler, can be included by its corresponding resource partitionings after the application program for receiving user's submission
Suitable VM is selected to dispose the application program at least one VM, it is possible thereby to when avoiding multiple scheduler Parallel Schedulings, it may
The problem of scheduling conflict of appearance.For example, with reference to figure 1B, which may include S00, S10 and S20 totally three resource partitionings,
Each resource partitioning includes multiple VM.Wherein resource partitioning S00 is corresponding with scheduler S0, S1 pairs of resource partitioning S10 and scheduler
It answers, resource partitioning S20 is corresponding with scheduler S2, can be right at its after scheduler S0 receives the application program of user's submission
Suitable VM is selected to dispose the application program at least one VM included by resource partitioning S00 answered.The database 10 can be with
For the partition information of each resource partitioning in storage cluster, which is used to indicate included by each resource partitioning
VM;The database 10 can also store the VM information (such as type information of VM and location information etc.) of each VM, for the pipe
It manages module 01 and policy module 03 is read.
With reference to figure 1A, which establishes with each scheduler and each VM communication connection, the host node 00
The VM information that each VM is sent can be received, and can be based on the VM information received, included by least one resource partitioning
VM be adjusted so that each scheduler can be according to after adjustment as a result, the scheduling of application program is realized, it is possible thereby to real
The dynamic adjustment of existing cluster resource, improves the utilization rate of resource.
As shown in Figure 1A, the host node 00 may include management module 01, collection module 02, policy module 03 and with this
The corresponding multiple cachings of multiple schedulers, each caching are believed for store the subregion of the resource partitioning corresponding to one scheduler
Breath, such as caching 0 can store the partition information of scheduler S0.Collection module 02 can be used for obtaining the VM of each VM in cluster
Information (such as mark of VM and resource information etc.), and the VM information got is sent to policy module 03;Policy module 03
The VM included by least one resource partitioning can be adjusted according to the VM information of each VM, and more according to adjustment result
The partition information stored in new database, and updated partition information is sent to management module 01;The management module 01 can
To be based on the partition information, the partition information stored in each caching is updated.The partition information stored in each caching removes
It may include the mark of the VM included by resource partitioning, can also include the resource information of each VM in the resource partitioning, often
A scheduler can carry out the scheduling of application program based on the partition information stored in its corresponding caching.
It should be noted that in embodiments of the present invention, multiple VM in cloud platform included by cluster can be divided into two
Group, the VM included by one of which is chain of command VM, and the VM included by another group is data surface VM.Chain of command VM is used for
Dispose the various components, such as host node 00, each scheduler and database 10 etc. in cluster management system;Data surface VM
Application program for disposing user's submission, therefore the resource of cluster that method provided in an embodiment of the present invention is adjusted refers to this
The occupied resources of data surface VM.
It should also be noted that, with reference to figure 1C, in embodiments of the present invention, which can support multiple and different meters
Frame is calculated, for example, Fig. 1 C show Computational frame 0, Computational frame 1 and Computational frame 2 totally three Computational frames.In cloud platform
Each scheduler can be under the jurisdiction of a Computational frame, and (can be used to the application program in the Computational frame belonging to it
The application program of Computational frame exploitation) it is scheduled.For example, scheduler S0 corresponds to Computational frame 0, scheduler S0 can be with
Application program in the Computational frame 0 is scheduled.Exemplary, Mesos frames can be provided in the cloud platform, and (one kind is opened
Source distribution formula resource management framework), the upper layer of the Mesos frames can dock the Computational frame of multiple stand-alone developments, such as
Hadoop, MPI and Kubernetes etc., the Mesos frames can pass through a generic resource inclusion layer so that multiple calculating
Frame can share the resource in a cluster.
Can also be seen that in each VM to may include multiple actuators (Executor) with reference to figure 1C, each VM can lead to
Cross the deployment that the actuator realizes task (i.e. application program).
Fig. 2 is a kind of flow chart of the resource adjusting method of cluster provided in an embodiment of the present invention, and this method can be applied
In the host node 00 shown in Figure 1A or Fig. 1 C.In the cloud platform shown in Figure 1A or Fig. 1 C, cluster may include multiple moneys
Source partition, each resource partitioning include at least one virtual machine VM, and each resource partitioning corresponds to a scheduler.With reference to figure 2,
The resource adjusting method of the cluster may include:
Step 101, the VM information for obtaining each VM in cluster.
In embodiments of the present invention, which can on demand or periodically obtain the VM letters of each VM in cluster
Breath, for example, the host node 00 can obtain the VM information of each VM in a cluster by collection module 02 every 30 minutes, and
The VM information of each VM stored in library 10 can be updated the data based on the VM information that this gets.The VM information of each VM is extremely
May include the mark of VM and the resource information of VM less, which can also be including the status information of VM, type information, position
At least one of the information of information and affiliated subregion.
Wherein, the mark of VM can be capable of the character string of the unique mark VM, and the character string can by cloud platform with
Machine generates;Resource information can serve to indicate that VM currently used stock number and surplus yield, such as the resource information
May include the total resources of VM and used stock number, which can refer to cpu resource, memory source and storage
Resource etc.;The status information can serve to indicate that the current working conditions of VM, the working condition can be normal condition or delay machine
State;The type information can serve to indicate that the heterogeneous types (being referred to as type of architecture) of VM, wherein different types of VM
Can refer to the VM of the processor or memory using different architectural frameworks;The location information can serve to indicate that the VM is disposed
Physical location, such as the location information may include VM disposed rack, computer room, data center (Data center,
DC), at least one of available area (Available Zone, AZ) and region (Region);The information of the affiliated subregions of VM is then
It can serve to indicate that the current affiliated resource partitionings of VM.
Step 102, the partition information for obtaining cluster.
Host node 00 can obtain the partition information from database 10, for example, the policy module 03 in the host node 00
After receiving the VM information of each VM of the transmission of collection module 02 partition information can be obtained from database 10.The subregion
Information is used to indicate the mark that each resource partitioning can be recorded in the VM included by resource partitioning, such as the partition information,
And the mark of the VM included by each resource partitioning.
It is exemplary, it is assumed that as shown in Figure 1B, S0, S1 and S3 totally three schedulers to be provided in the cloud platform, wherein dispatching
The corresponding resource partitionings of device S0 are S00, and the corresponding resource partitionings of scheduler S1 are S10, and the corresponding resource partitionings of scheduler S2 are
S20.It can be seen from figure 1b the number of the VM included by resource partitioning S20 is more, of the VM included by resource partitioning S00
Number is less.Correspondingly, the partition information that the host node 00 is got can be as shown in table 1.As it can be seen from table 1 resource partitioning
S00 includes 10 VM, and the mark of 10 VM is followed successively by VM1 to VM10;Resource partitioning S10 includes 12 VM, 12 VM's
Mark is followed successively by VM11 to VM22;Resource partitioning S20 includes 26 VM, and the mark of 26 VM is followed successively by VM23 to VM48.
Table 1
Resource partitioning |
VM |
S00 |
VM1-VM10 |
S10 |
VM11-VM22 |
S20 |
VM23-VM48 |
Step 103, according to the resource information and the partition information of each VM in cluster, detect whether the cluster meets
Subregion regularization condition.
When host node detects that the cluster meets the subregion regularization condition, the adjustment of resource partitioning can be carried out, that is, is held
Row step 104;When detecting that cluster is unsatisfactory for the subregion regularization condition, step 101 can be continued to execute, that is, continues to obtain collection
The VM information of each VM in group.
In embodiments of the present invention, as shown in figure 3, whether host node detection cluster meets the process of subregion regularization condition
May include:
Step 1031, according to the resource information of each VM in cluster, and partition information, determine each resource partitioning
Resource utilization.
The resource utilization of each resource partitioning can refer to the used stock number of the resource partitioning and the resource partitioning
The ratio of occupied total resources.Assuming that the cluster includes N number of resource partitioning (N is the integer more than 1), wherein n-th of money
Source partition includes SnA VM, then the utilization rate r of n-th of resource partitioningnIt can meet:
Wherein, UiFor the current used stock numbers of i-th of VM, TiFor the total resources of i-th of VM, n is no more than N
Positive integer, i be no more than SnPositive integer.
Step 1032, when detect resource utilization be more than utilization rate threshold value resource partitioning number be more than number threshold value
When, determine that the cluster meets subregion regularization condition.
In embodiments of the present invention, the utilization rate threshold value and number threshold value can manually be set by the operation maintenance personnel of cloud platform
It sets;Or the utilization rate threshold value can also be counted to obtain by host node according to historical data, for example, host node can be to each void
Resource utilization when intending performance of the machine under different resource utilization rate to be analyzed, and can virtual machine performance be declined very fast
It is determined as the utilization rate threshold value;The number threshold value can also be determined by host node according to the number of Current resource subregion, for example, should
Number threshold value can be 10% or 30% etc. of the number of Current resource subregion.Also, according to Current resource subregion
When number calculates the number threshold value, it shall be guaranteed that the number threshold value being calculated is integer.
It is exemplary, it is assumed that the utilization rate threshold value be 80%, the number threshold value be 1, then when host node 00 detect the S00,
In tri- resource partitionings of S10 and S30, when the resource utilization of any resource partitioning is more than 80%, you can determine that cluster meets and divide
Area's regularization condition.Alternatively, if the number of resource partitioning is 10 in current cluster, which is the number of Current resource subregion
30%, i.e., number threshold value be 3;Correspondingly, host node 00 can detect it is big more than the resource utilization of 3 resource partitionings
When 80%, determine that the cluster meets subregion regularization condition.
Step 1033, when detect resource utilization be more than utilization rate threshold value resource partitioning number be not more than number threshold
When value, determine that the cluster is unsatisfactory for subregion regularization condition.
It is exemplary, it, can be true when host node 00 detects the resource utilization of each resource partitioning no more than 80%
Determine cluster and is unsatisfactory for subregion regularization condition.
It should be noted that due to the resource of each VM may include in cpu resource, memory source and storage resource extremely
Few one kind, therefore the resource information of each VM can also include:Cpu resource information, memory source information and storage resource information
At least one of information.Correspondingly, in above-mentioned steps 1031, host node can be counted respectively in computing resource utilization rate
Calculate the utilization rate of the corresponding resource of each information.Such as the cpu resource utilization rate, interior of each resource partitioning can be calculated separately
Deposit resource utilization and storage resource utilization rate.
Further, the resource utilization described in above-mentioned steps 1032 and step 1033, which is more than utilization rate threshold value, to be
Refer to:The average value of the utilization rate of the corresponding resource of each information is more than the utilization rate threshold value;Alternatively, in at least one information,
The number that the utilization rate of corresponding resource is more than the information of the utilization rate threshold value is more than amount threshold.Wherein, which can
Think preset fixed value, the number for the information that can also include according to resource information by host node determines, for example, the quantity threshold
Value can be the one third or 2/3rds of the number of the resource information information that includes, and the amount threshold should be it is whole
Number.
In addition, each resource can also correspond respectively to a utilization rate threshold value, and the corresponding utilization rate threshold of various resources
Value can be different;Correspondingly, in above-mentioned steps 1032 and step 1033, it can be right with it by the resource utilization of each resource
The utilization rate threshold value answered is compared.
It is exemplary, it is assumed that utilization rate threshold value is 80%, and resource utilization refers to more than utilization rate threshold value:Resource information packet
In at least one information included, the utilization rate of the corresponding resource of any information is more than utilization rate threshold value (the i.e. amount threshold
For 1).If the resource information of each VM includes cpu resource information, memory source information and storage resource information, and host node meter
The cpu resource utilization rate of obtained resource partitioning S00 is 85%, and memory source utilization rate is 75%, storage resource utilization rate
It is 50%, then since wherein cpu resource utilization rate is more than 80%, then host node 00 can determine the resource of resource partitioning S00
Utilization rate is more than utilization rate threshold value.
Or, it is assumed that the corresponding utilization rate threshold value of cpu resource is 80%, and the corresponding utilization rate threshold value of memory source is
85%, the corresponding utilization rate threshold value of storage resource is 90%, and resource utilization refers to more than utilization rate threshold value:Each information pair
The utilization rate for the resource answered is all higher than the corresponding utilization rate threshold value of the information (i.e. amount threshold is 3).Then when host node calculates
Cpu resource utilization rate to resource partitioning S00 is 85%, and memory source utilization rate is 88%, storage resource utilization rate 92%,
Then since the utilization rate of the corresponding resource of each information is all higher than its corresponding utilization rate threshold value, then host node 00 can determine this
The resource utilization of resource partitioning S00 is more than utilization rate threshold value.
It should also be noted that, in embodiments of the present invention, host node 00 adjusts item whether detection cluster meets subregion
When part, whether the resource utilization in addition to that can detect each resource partitioning is more than utilization rate threshold value, can also be each by detecting
The balance degree of the resource utilization of a resource partitioning judges whether the cluster meets subregion regularization condition.For example, host node
The variance that the resource utilization of each resource partitioning can be calculated, when the variance is more than default variance threshold values, it may be determined that each
The resource utilization of a resource partitioning is unbalanced, and then can determine that the cluster meets subregion regularization condition;When variance is not more than
When the default variance threshold values, it may be determined that the resource utilization of each resource partitioning is more balanced, without the resource point to cluster
Area is adjusted, you can to determine that the cluster is unsatisfactory for subregion regularization condition.
To the resource of cluster when being more than the number of the resource partitioning of utilization rate threshold value in resource utilization more than number threshold value
It is readjusted, it is ensured that the promptness of cluster resource adjustment, and then it is possible to prevente effectively from the higher money of resource utilization
There is the problem of scheduling failure in scheduler corresponding to source partition, improves the dispatching effect of scheduler.
Step 104, according to the resource information of each VM in cluster, determine the surplus yield of each VM, and determine cluster
Surplus resources total amount.
After host node determines that cluster meets subregion regularization condition, you can start to re-start adjustment to the resource of cluster, with
The resource utilization of balanced each resource partitioning, and then the utilization rate of cluster resource can be improved.It, should before carrying out resource adjustment
Host node can first determine the current surplus resources total amount of cluster.
Since the resource information of each VM may include the total resources of the VM and used stock number, master
Node 00 can obtain the surplus yield of each VM based on the total resources and used Resources calculation, and then can be with
The surplus yield of each VM is added up, to determine the surplus resources total amount of the cluster.
Alternatively, the resource information that each VM is reported to the host node 00 can be with the surplus yield for the VM, host node
00 can be directly based upon the surplus resources total amount for the resource information computing cluster that each VM is reported.
Or the resource information that each VM is reported to the host node 00 can be only the VM currently used resources
Amount, host node 00 can obtain the total resources of each VM from database 10, and then calculate the surplus resources of each VM again
The surplus resources total amount of amount and cluster.
It should be noted that due to the resource of each VM may include in cpu resource, memory source and storage resource extremely
A kind of few resource, therefore host node can calculate separately the remaining money of each resource in the surplus resources total amount of computing cluster
Source total amount.For example, the surplus resources total amount of the cpu resource of all VM in cluster, memory money can be calculated separately with host node
The surplus resources total amount in source and the surplus resources total amount of storage resource.
Exemplary, if as shown in Figure 1B, which includes 48 VM, then the host node can calculate separately 48 VM
The surplus resources total amount of cpu resource, the surplus resources total amount of the surplus resources total amount of memory source and storage resource.
Step 105 determines the physical location that each VM is disposed.
In embodiments of the present invention, may include the position letter of the VM in the VM information for each VM that host node receives
Breath, therefore host node can determine the physical location that each VM is disposed based on the VM information got;Alternatively, host node 00
The location information of each VM can be directly obtained from database, and then determines the physical location that each VM is disposed.
The object that step 106, the surplus yield based on each VM, the surplus resources total amount of cluster and each VM are disposed
Position is managed, the VM included by least one resource partitioning is adjusted.
Further, the principle that host node can be distributed based on resources balance, adjusts in multiple resource partitioning, at least one
VM included by a resource partitioning, so that the surplus yield that each resource partitioning occupies meets preset resource proportioning, with
Ensure the equilibrium assignment of cluster resource.And during the adjustment, host node can also refer to the object that each VM is disposed
Reason position is adjusted, so that it is equal for any two surplus yield, and adjust to the first VM of different resource subregion
With the 2nd VM, the average physical distance in the first VM and first resource subregion belonging to it between each VM, be less than the 2nd VM with
Average physical distance in the first resource subregion between each VM.It that is to say, can as possible draw the closer VM of physical location
Divide in the same resource partitioning, to reduce the communication delay in same resource partitioning between each VM, and then application can be reduced
The communication delay of program or application component.
Wherein, which can be to wait ratios, i.e. the host node 00 can be by adjusting at least one resource
VM included by subregion so that each occupied surplus yield of resource partitioning is equal;Alternatively, the preset resource proportioning can
To be determined by the history scheduling quantum according to each scheduler, for example, host node can count primary with every preset time period
History scheduling quantum of each scheduler in the preset time period, and can be determined based on the history scheduling quantum that the statistics obtains each
The resource of resource partitioning corresponding to a scheduler matches, and resource proportioning can be the ratio between with the history scheduling quantum of each scheduler
Positive correlation, i.e., for the resource partitioning corresponding to the higher scheduler of history scheduling quantum, its allocated stock number arrived is in residue
Shared ratio can be higher in total resources, to ensure the reasonability of cluster resource distribution, improves resource utilization.
It is exemplary, it is assumed that S0, S1 and S3 totally three schedulers to be provided in the cloud platform, and host node 00 is united week about
The history scheduling quantum of the primary each scheduler of meter, if the history scheduling of three schedulers that host node the last time counts
The ratio between amount is 1:2:3, then host node 00 can determine three resource partitionings corresponding to three schedulers resource proportioning can
Think 1:2:3.
In a kind of optional realization method of the embodiment of the present invention, host node can be first according to the current surplus resources of cluster
Total amount and the preset resource proportioning, determine the surplus yield that each resource partitioning should occupy;Further, host node
The stock number difference of each resource partitioning can be determined based on the surplus yield of the currently practical occupancy of each resource partitioning, into
And the physical location that can be disposed based on the stock number difference, the surplus yield of each VM and each VM, adjustment are each
VM included by resource partitioning so that the ratio between the stock number of each resource partitioning meets the preset resource proportioning and (that is to say, make
0) the stock number difference for obtaining each resource partitioning is.Certainly, the resource partitioning for being 0 for stock number difference, host node can be with
Without adjusting the VM included by the resource partitioning.
It, should the surplus resources based on each VM with reference to figure 4 in another optional realization method of the embodiment of the present invention
The physical location that amount, the surplus resources total amount of cluster and each VM are disposed, adjusts included by least one resource partitioning
The method of VM may include:
Step 1061 is matched according to preset resource, and the surplus resources of the cluster are divided into N parts of resources.
Wherein, N is the number of the resource partitioning included by cluster, and every part of resource corresponds to a resource partitioning, i.e., every part money
Source can be distributed to a corresponding resource partitioning.In embodiments of the present invention, host node can be remained first according to cluster is current
Remaining total resources and the preset resource proportioning, determine the stock number of every part of resource;Further, for any part of resource,
Host node can choose resource of the sum of the surplus yield with any part of resource according to the surplus yield of each VM in cluster
At least one set of VM of equal (or both difference be less than preset difference value threshold value) is measured, every group of VM may include at least one VM.Most
Afterwards, host node can be by least one set VM, and the average physical between each VM is determined as being used for apart from shortest one group of VM
The VM of any part of resource is provided.
Exemplary, which can be by surplus resources current in cluster according to 1:2:3 ratio cut partition is three parts
Resource, if the stock number corresponding to first part of resource of resource partitioning S00 is P0, corresponding to second part of money of resource partitioning S10
The stock number in source is P1, and the stock number corresponding to third part resource of resource partitioning S30 is P2, then the stock number of three parts of resources
The ratio between meet P0:P1:P2=1:2:3.If in 48 VM included by cluster, there are 6 the first VM and 40 the 2nd VM, wherein
The surplus yield of each first VM is P0/6, and the surplus yield of each 2nd VM is P0/8, then host node can select
Take 6 the first VM for provide first part of resource, and choose 16 the 2nd VM for providing second part of resource, selection 24 the
Two VM are for providing third part resource.It is of course also possible to choose 8 the 2nd VM for provide first part of resource, selection 6 the
One VM and 8 the 2nd VM chooses 24 the 2nd VM for providing third part resource for providing second part of resource.
In addition, during the selection, the VM that host node can make physical location closer as possible is provided with a resource.
If for example, in 40 the 2nd VM, 16 the 2nd VM are deployed in same computer room, and 24 the 2nd VM of residue are deployed in another machine
Room, then host node can choose 16 the 2nd VM for being deployed in same computer room for providing second part of resource, and choosing should
24 the 2nd VM of another computer room are deployed in for providing third part resource.
At least one VM for providing every part of resource is divided to corresponding resource partitioning by step 1062.
Further, host node 00 can will be used to provide every part of resource according to the division result of surplus resources in cluster
At least one VM be divided to corresponding resource partitioning, wrapped so as to adjust at least one resource partitioning in multiple resource partitioning
The VM included.
Exemplary, 6 the first VM for providing first part of resource can be divided to resource partitioning S00 by host node 00,
It will be divided to resource partitioning S10 for providing 16 the 2nd VM of second part of resource, and will be for providing third part resource
24 the 2nd VM are divided to resource partitioning S20.
It should be noted that in embodiments of the present invention, due to being gone back in the VM information of each VM accessed by host node
May include the status information of VM, then before carrying out resource adjustment, host node can be first according to the shape of each VM got
State information, detects whether each VM is in normal condition, and the resource partitioning belonging to the VM of normal condition can be only in this
It is adjusted, and is in the VM of delay machine state for this, then it can not be adjusted.It that is to say, above-mentioned steps 103 to step
Signified VM can be the VM in normal condition in rapid 106.
It should also be noted that, due in above-mentioned steps 104, host node can with included by computing cluster resource at least
In a kind of resource, the surplus resources total amount of each resource, therefore in above-mentioned steps 106, when adjusting cluster resource, as one
The achievable mode of kind, host node can be adjusted on the basis of the surplus resources total amount of the specified resource at least one resource
It is whole.The specified resource can be a kind of resource arbitrarily chosen at least one resource, such as can be cpu resource.Or
Person, host node can also calculate separately in at least one resource, the balance degree that each resource is distributed in each resource partitioning,
And a kind of minimum resource of balance degree is determined as the specified resource;Exist for example, host node can calculate separately each resource
The variance of the surplus yield of each resource partitioning, and a kind of maximum resource of variance can be determined as to the specified resource.
As the achievable mode of another kind, host node can also first calculate the surplus resources total amount of at least one resource
The average value of at least one of average value, and each VM surplus yield of resource, and it is flat based on the surplus resources total amount
Mean value carries out the adjustment of cluster resource.
Step 107, the partition information that cluster is updated according to adjustment result
Further, the partition information of the result update cluster after host node 00 can be adjusted according to subregion, so as to each
Scheduler can execute scheduler task according to updated partition information in corresponding resource partitioning.Such as Figure 1A and Fig. 1 C institutes
Show, policy module 03 can update the data the partition information stored in library 10, and can after completing the readjusting of cluster resource
The updated partition information is sent to management module 01.The management module 01 can receive the updated subregion
After information, the VM information of each VM is obtained from database 10, and then can be according to the updated partition information and each
The VM information of VM updates the partition information stored in each caching.The partition information stored in each caching may include
The mark of VM included by the corresponding resource partitioning of the caching can also include the VM letters of each VM included by the resource partitioning
Breath, such as may include resource information and status information of VM etc..Each scheduler can be according to updated subregion in caching
Information executes scheduler task in corresponding resource partitioning.
It is exemplary, it is assumed that as shown in figure 5, after the cluster resource is readjusted, the corresponding resource partitioning S00 packets of scheduler S0
16 VM are included, the corresponding resource partitioning S10 of scheduler S10 include 17 VM, and the corresponding resource partitioning S20 of scheduler S20 include
15 VM, then each scheduler can execute scheduler task in its corresponding resource partitioning.
Due to method provided in an embodiment of the present invention, each scheduler can independently execute tune in corresponding resource partitioning
Degree task, thus can to avoid caused by scheduling conflict dispatch failure the problem of;Again since host node can be based on getting
VM information adjusts the resource of cluster into Mobile state, therefore can ensure the equilibrium assignment of cluster resource, effectively improves resource profit
With rate, and then improve the dispatching effect of scheduler.
Optionally, as a kind of optional realization method, the VM information for each VM that host node 00 is got can also wrap
It includes:The type information of VM.Then in above-mentioned steps 104, host node determines that the process of the surplus resources total amount of cluster may include:
Step 1041a, according to the type information of each VM, multiple VM that cluster includes are divided at least two groups resource
Group.
Wherein, the type at least one VM that every group of resource group includes is consistent.Assuming that the cluster includes that (K is more than 1 to K
Integer) a type VM, then host node can be by multiple VM in the cluster, and the VM of same type is divided into one group of resource
Group, it is hereby achieved that K group resource groups.
Step 1042a, the surplus resources total amount at least one VM that every group of resource group includes is determined respectively.
Further, in the surplus resources total amount for determining cluster, host node 00 can calculate separately the K group resource groups
In, the surplus resources total amount of every group of resource group.
Correspondingly, in above-mentioned steps 1061, the process of host node adjustresources may include:
Step 1061a, it is matched according to the preset resource, the surplus resources of every group of resource group is divided into N one's share of expenses for a joint undertaking resources.
It can wherein be provided by least one VM per one's share of expenses for a joint undertaking resource, and a resource partitioning is corresponded to per one's share of expenses for a joint undertaking resource.
Step 1061b, a resource will be determined as corresponding at least two one's share of expenses for a joint undertaking resources of the same resource partitioning.
If multiple VM in the cluster divide for K group resource groups, the surplus resources of every group of resource group are divided into N parts
After child resource, each resource partitioning, which can correspond to, is assigned to K one's share of expenses for a joint undertaking resources, which constitutes the resource partitioning institute
A resource being assigned to, wherein the stock number L of a resource assigned by n-th of resource partitioningnIt can meet:
Wherein,It is the money for a child resource that n-th of resource partitioning distributes in kth group resource group by host node
Source is measured, and k is the positive integer no more than K, and n is the positive integer no more than N.
In embodiments of the present invention, the type based on each VM is adjusted cluster resource, it is ensured that in cluster
The equilibrium assignment of the resource of different isomerization type further improves the harmony of resource allocation in cluster.
Optionally, as another optional realization method, above-mentioned steps 104 may include:
Step 1041b, according to the resource information of each VM in cluster, the surplus yield of each VM is determined.
Step 1042b, the surplus yield based on each VM determines at least one target VM.
The surplus yield of each target VM is more than predetermined threshold value, which can be preset in host node
Fixed value;Or, or host node is determined according to the total resources of each VM, such as the predetermined threshold value can be for VM's
The 10% of total resources;Or the predetermined threshold value can also be manually adjusted by the operation maintenance personnel of cloud platform.
It is exemplary, it is assumed that the predetermined threshold value is 0, then the VM there are surplus resources in cluster can be determined as by host node 00
Target VM.
Step 1043b, the sum of the surplus yield of at least one target VM is determined as to the surplus resources total amount of cluster.
Further, host node can calculate the sum of the surplus yield of at least one target VM, and by this at least one
The sum of the surplus yield of a target VM is determined as the surplus resources total amount of the cluster.
Correspondingly, in above-mentioned steps 105, host node only needs to determine the physical location of each target VM;In above-mentioned steps
In 106, the process of host node adjustresources may include:
The surplus resources total amount of surplus yield, the cluster based on each target VM and the physical bit of each target VM
It sets, adjusts the target VM included by least one resource partitioning.
In addition, method shown in above-mentioned steps 1041b to step 1043b can also execute before step 1041a.Accordingly
, in step 1041a, host node can be according to the type information of each target VM, the multiple target VM for including by the cluster
It is divided at least two groups resource group;In step 1042a, host node can then determine at least one mesh that every group of resource group includes
Mark the surplus resources total amount of VM.
In embodiments of the present invention, host node can only adjust the resource partitioning belonging at least one target VM
It is whole, and for surplus yield be less than predetermined threshold value VM, may not need adjustment its belonging to subregion, it is possible thereby to minimize
The variation degree of resource partitioning improves the regulated efficiency of resource partitioning.
It should be noted that in embodiments of the present invention, host node based on the resource of each resource partitioning in addition to can be made
The adjustment that the resource of cluster is triggered with rate, can also trigger the adjustment of the resource of cluster in the following manner:
A kind of optional triggering mode:Host node can be based on the preset adjustment period, periodically to the money of the cluster
Source is adjusted.Correspondingly, in above-mentioned steps 101, host node can be according to the preset adjustment period, and periodically obtaining should
The VM information of each VM in cluster.Later, host node can execute method shown in step 102 to step 107 successively again, with reality
Now to the adjustment of cluster resource.
Wherein, which can be preset fixed value, can also be configured by the operation maintenance personnel of cloud platform, example
Such as adjustment period can be 12 hours, or one week.Assuming that the adjustment period is one week, then host node can be every
One week, method shown in 101 to step 107, once adjusted the resource of cluster through the above steps.The host node 00 exists
On the basis of resource dividing condition shown in fig. 5, the resource of cluster is carried out after once adjusting, the resource dividing condition of cluster can
With as shown in Figure 6.
Another optional triggering mode:The quantity for the scheduler that host node can also be arranged in detecting cloud platform is sent out
When changing, the resource of the cluster is adjusted.Correspondingly, before above-mentioned steps 101, host node can monitor cloud in real time
The quantity for the scheduler being arranged in platform;Then in above-mentioned steps 101, tune that host node can be arranged in detecting cloud platform
When the quantity of degree device changes, the VM information of each VM in the cluster is obtained.Later, host node can execute step successively again
102 to method shown in step 107, to realize the adjustment to cluster resource.
It should be noted that host node after detecting the quantity increase of scheduler, can also be each newly-increased scheduling
Device creates corresponding caching;Correspondingly, host node can also delete the tune of the reduction after the quantity for detecting scheduler is reduced
Spend the caching corresponding to device.
For above two triggering mode, the step 103 in above-described embodiment can also delete, i.e., host node is being got
After VM information and partition information, adjustment that can directly by method shown in step 104 to step 107 to cluster resource.
Certainly, host node can also simultaneously be adjusted cluster resource using above-mentioned a variety of triggering modes, that is to say, when
When host node detects that cloud platform meets any of the above-described trigger condition, you can adjustment of the triggering to cluster resource.At this point, host node
It can also first detect and adjusted in the period at upper one, if by other means when entering each new adjustment period
(such as resource utilization or dispatch group quantity change) triggers the adjustment to cluster resource.If host node is detected upper one
Be not carried out the resource triggered by other modes in a adjustment period and adjust operation, then can with through the above steps 101 to
Method is adjusted the resource of cluster shown in step 107 (wherein operation shown in step 103 can delete);If host node
It detects to adjust to have executed in the period at upper one and operation is adjusted by the resource that other modes are triggered at least once, then lead
Node can skip current resource adjustment operation, and wait for next adjustment period.
Further by taking framework shown in Figure 1A and Fig. 1 C as an example, the resource tune of cluster provided in an embodiment of the present invention is introduced
Adjusting method, with reference to figure 7, when host node judges whether that triggering resource adjusts according to the resource utilization of each resource partitioning in cluster
When, this method may include:
Step 201, collection module obtain the VM information of each VM in cluster.
Step 202, collection module send VM information to policy module.
Step 203, collection module send VM information to database.
The collection module can also send the VM information got to database, and so as to database update, it is stored
The VM information of each VM.
Step 204, policy module obtain the current partition information of cluster from database.
Whether step 205, policy module detection cluster meet subregion regularization condition.
When policy module detects that cluster meets subregion regularization condition, step 206 can be executed;Otherwise behaviour can not be executed
Make, or can also be sent to the management module and be used to indicate the instruction for not adjusting resource partitioning.
Step 206, policy module adjust the VM included by least one resource partitioning according to the VM information got.
Step 207, policy module update the data the partition information stored in library.
Step 208, policy module send the partition information after adjustment to management module.
Step 209, management module obtain the VM information of each VM from database.
Step 210, management module update the partition information stored at least one caching.
Wherein, the realization process of above-mentioned steps 201 to step 210 can be referring to figs. 2 to the correspondence in embodiment illustrated in fig. 4
Step, details are not described herein again.
With reference to figure 8, when host node is according to triggering of preset adjustment period resource adjustment, this method may include:
Timer timing in step 301, policy module.
In embodiments of the present invention, which can be countdown timer, and countdown duration is that this is preset
The period is adjusted, when reaching timing instant (i.e. countdown is 0) of the timer, step 302 can be executed.
Step 302, policy module send adjust instruction to collection module.
Step 303, collection module obtain the VM information of each VM in cluster according to adjust instruction.
Step 304, collection module send VM information to policy module.
Step 305, collection module send VM information to database.
Database can be according to the VM information of its each VM stored of the VM information updates of each VM received.
Step 306, policy module obtain the current partition information of cluster from database.
Step 307, policy module adjust the VM included by least one resource partitioning according to the VM information got.
Step 308, policy module update the data the partition information stored in library.
Step 309, policy module send the partition information after adjustment to management module.
Step 310, management module obtain the VM information of each VM from database.
Step 311, management module update the partition information stored at least one caching.
Wherein, the realization process of above-mentioned steps 301 to step 311 can be referring to figs. 2 to the correspondence in embodiment illustrated in fig. 4
Step, details are not described herein again.
With reference to figure 9, when host node is adjusted according to the quantity change triggers resource of scheduler, this method may include:
Whether the quantity of scheduler changes in step 401, management module detection cloud platform.
When detecting that the quantity of scheduler changes, step 402 can be executed;Otherwise it can continue the quantity to scheduler
It is monitored, that is, continues to execute step 401.Also, when the quantity of scheduler increases, management module can also be each newly-increased
Scheduler create corresponding caching;When the quantity of scheduler is reduced, management module can be corresponding to the scheduler by reduction
Caching delete.
Step 402, management module send adjust instruction to policy module.
Step 403, policy module send adjust instruction to collection module.
Step 404, collection module obtain the VM information of each VM in cluster according to adjust instruction.
Step 405, collection module send VM information to policy module.
Step 406, collection module send VM information to database.
Database can be according to the VM information of its each VM stored of the VM information updates of each VM received.
Step 407, policy module obtain the current partition information of cluster from database.
Step 408, policy module adjust the VM included by least one resource partitioning according to the VM information got.
Step 409, policy module update the data the partition information stored in library.
Step 410, policy module send the partition information after adjustment to management module.
Step 411, management module obtain the VM information of each VM from database.
Step 412, management module update the partition information stored at least one caching.
Wherein, the realization process of above-mentioned steps 401 to step 412 can be referring to figs. 2 to the correspondence in embodiment illustrated in fig. 4
Step, details are not described herein again.
It should be noted that the sequencing of the step of resource adjusting method of cluster provided in an embodiment of the present invention can be with
It is suitably adjusted, step according to circumstances can also accordingly be increased and decreased.For example, step 102 can be deleted according to circumstances,
I.e. host node can not also consider current partition information when carrying out resource adjustment, which can be directly according to each
The VM information of VM, adjusts the VM included by least one resource partitioning;Alternatively, step 103 can also be deleted according to circumstances,
I.e. host node can directly carry out the adjustment of cluster resource after getting VM information and partition information;Or step 105
Can according to circumstances be deleted, i.e., in above-mentioned steps 106, host node can be based only upon each VM surplus yield and
The surplus resources total amount of cluster adjusts the VM that at least one resource partitioning includes.Any one skilled in the art
In the technical scope that the application discloses, the method that can readily occur in variation should all cover within the protection domain of the application,
Therefore it repeats no more.
In conclusion an embodiment of the present invention provides a kind of resource adjusting method of cluster, for including multiple resources point
The cluster in area, method provided in an embodiment of the present invention can obtain the VM information of each VM in the cluster, according to the VM got
Information adjusts the VM included by least one resource partitioning, and can update the partition information of cluster according to adjustment result so that
Each scheduler can execute scheduler task according to the partition information after adjustment in corresponding resource partitioning.Due to of the invention real
In the method for applying example offer, each scheduler can independently execute scheduler task in corresponding resource partitioning, therefore can have
Effect avoids the problem that dispatching failure caused by scheduling conflict;And due to can be adjusted into Mobile state to the resource of cluster, because
This can ensure cluster resource in the equilibrium assignment of each resource partitioning, and the resource of each resource partitioning of efficient balance uses
Rate improves the utilization rate of cluster resource.
Figure 10 is a kind of structural schematic diagram of the resource adjusting apparatus of cluster provided in an embodiment of the present invention, which can be with
It is configured in the host node 00 in the cloud platform shown in Figure 1A or Fig. 1 C, which includes multiple resource partitionings, each resource point
Area includes at least one virtual machine VM, and each resource partitioning corresponds to a scheduler.With reference to figure 10, which may include:
First acquisition module 501, for realizing the method for step 101 in above-mentioned embodiment illustrated in fig. 2.
Module 502 is adjusted, for according to the VM information got, adjusting the VM included by least one resource partitioning.
Update module 503, for realizing the method for step 107 in above-mentioned embodiment illustrated in fig. 2.
Optionally, which may include:Resource information;Figure 11 is a kind of adjustment module provided in an embodiment of the present invention
502 structural schematic diagram, with reference to figure 11, which may include:
First determination sub-module 5021, for realizing the method for step 104 in above-mentioned embodiment illustrated in fig. 2.
Submodule 5022 is adjusted, is used for surplus yield and the surplus resources total amount based on each VM, adjustment is at least
VM included by one resource partitioning so that the surplus yield that each resource partitioning occupies meets preset resource proportioning.
Optionally, which can be used to implement in above-mentioned embodiment illustrated in fig. 4 step 1061 to step
1062 method.
Optionally, which can also include:The type information of VM;
First determination sub-module 5021, is used for:
According to the type information of each VM, multiple VM which includes are divided at least two groups resource group, every group of money
The type at least one VM that source group includes is consistent;
The surplus resources total amount at least one VM that every group of resource group includes is determined respectively;
Correspondingly, the adjustment submodule 5022 can be used for:
It is matched according to the preset resource, the surplus resources of every group of resource group is divided into N one's share of expenses for a joint undertaking resources, per one's share of expenses for a joint undertaking resource
It is provided by least one VM, and a resource partitioning is corresponded to per one's share of expenses for a joint undertaking resource;
It will be determined as a resource corresponding at least two one's share of expenses for a joint undertaking resources of the same resource partitioning.
Optionally, as shown in figure 11, the adjustment module 502 can also include:
Second determination sub-module 5023, for realizing the method for step 105 in above-mentioned embodiment illustrated in fig. 2.
Correspondingly, the method that the adjustment submodule 5022 can be used to implement step 106 in above-mentioned embodiment illustrated in fig. 2.
Optionally, which can be used for:
According to the resource information of each VM in the cluster, the surplus yield of each VM is determined;
Based on the surplus yield of each VM, determine that at least one target VM, the surplus yield of each target VM are more than
Predetermined threshold value;
The sum of the surplus yield of at least one target VM is determined as to the surplus resources total amount of the cluster.
Correspondingly, the adjustment submodule 5022 can be used for:
Surplus yield based on each target VM and the surplus resources total amount, adjust at least one resource partitioning and are wrapped
The target VM included.
Optionally, which includes:Resource information;With reference to figure 12, which can also include:
Second acquisition module 504, for realizing the method for step 102 in above-mentioned embodiment illustrated in fig. 2.
Detection module 505, for realizing the method for step 103 in above-mentioned embodiment illustrated in fig. 2.
Correspondingly, the adjustment module 502 can be used for:When detecting that the cluster meets the subregion regularization condition, according to
The VM information got, adjusts the VM included by each resource partitioning.
Optionally, which can be used to implement in above-mentioned embodiment illustrated in fig. 3 step 1031 to step 1033
Method.
Optionally, which includes:In processor resource information, memory source information and storage resource information extremely
A kind of few information;The resource utilization refers to more than utilization rate threshold value:The average value of the utilization rate of the corresponding resource of each information
More than the utilization rate threshold value;Alternatively, in at least one information, the utilization rate of corresponding resource is more than the letter of the utilization rate threshold value
The number of breath is more than amount threshold.
Optionally, which can be used for:
According to the preset adjustment period, the VM information of each VM in the cluster is periodically obtained;
Alternatively, when the quantity for the scheduler being arranged in detecting cloud platform changes, each VM in the cluster is obtained
VM information.
It should be noted that the function of the first acquisition module 501 in above-mentioned apparatus embodiment can be with Figure 1A or Fig. 1 C
The function of collection module 02 is identical in shown host node 00, adjustment module 502, update module 503,504 and of the second acquisition module
The function of detection module 505 can be identical as the function of policy module 03 in host node 00 shown in Figure 1A or Fig. 1 C.
In conclusion an embodiment of the present invention provides a kind of resource adjusting apparatus of cluster, for including multiple resources point
The cluster in area, device provided in an embodiment of the present invention can obtain the VM information of each VM in the cluster, according to the VM got
Information adjusts the VM included by least one resource partitioning, and can update the partition information of cluster according to adjustment result so that
Each scheduler can execute scheduler task according to the partition information after adjustment in corresponding resource partitioning.Due to each scheduling
Device can independently execute scheduler task in corresponding resource partitioning, therefore it is possible to prevente effectively from be dispatched caused by scheduling conflict
The problem of failure;And due to can be adjusted into Mobile state to the resource of cluster, cluster resource can be ensured in each money
The equilibrium assignment of source partition, the efficient balance resource utilization of each resource partitioning, and then improve the utilization of cluster resource
Rate.
About the device in above-described embodiment, wherein modules execute the realization method of operation in related this method
Embodiment in be described in detail, therefore herein no longer illustrate explanation.
3 are please referred to Fig.1, it illustrates a kind of structures of the resource adjusting apparatus 600 of cluster provided by the embodiments of the present application
Schematic diagram, referring to Figure 13, the resource adjusting apparatus 600 of the cluster may include:Processor 610, communication interface 620 and memory
630, communication interface 620 and memory 630 are connected with processor 610 respectively, illustratively, as shown in figure 13,620 He of communication interface
Memory 630 is connected by bus 640 with processor 610.
Wherein, processor 610 can be central processing unit (CPU), and processor 610 includes one or more than one processing
Core.Processor 610 is by runs software program, to perform various functions application and data processing.
Wherein, communication interface 620 can be multiple, the communication interface 620 for cluster resource adjusting apparatus 600 with it is outer
Portion's equipment is communicated, and the external equipment is such as display, third party device (for example, storage device, mobile terminal) etc..
Wherein, memory 630 can include but is not limited to:Random access memory (RAM), read-only memory (ROM), can
Erasable programmable read-only memory (EPROM) (EPROM), flash memory, optical memory.The memory 630 is responsible for information storage, for example,
The memory 630 is for storing software program.
Optionally, the resource adjusting apparatus 600 of the cluster can also include:Input/output (I/O) interface is (in Figure 13 not
It shows).I/O interfaces are connect with processor 610, communication interface 620 and memory 630.I/O interfaces for example can be general string
Row bus (USB).
In the embodiment of the present application, processor 610 is configured as executing the instruction stored in memory 630, processor 630
By the resource adjusting method for executing instruction the cluster to realize above method embodiment offer.
An embodiment of the present invention provides a kind of cloud platforms, and as shown in Figure 1A and Fig. 1 C, which may include:Cluster,
The resource adjusting apparatus of multiple schedulers and the cluster as shown in Figure 10, Figure 12 or Figure 13, the resource adjusting apparatus of the cluster
It can be deployed in host node 00.
An embodiment of the present invention provides a kind of computer readable storage medium, it is stored in the computer readable storage medium
Instruction, when the computer readable storage medium is run on computers so that computer executes above method embodiment and carried
The resource adjusting method of the cluster of confession.
The embodiment of the present invention additionally provides a kind of computer program product including instruction, when the computer program product exists
When being run on computer so that computer executes the resource adjusting method for the cluster that above method embodiment is provided.