The self-adaptation method and system of resources allocation as required in a kind of virtualized environment(1) technical field
The present invention relates to resources allocation, relate in particular in a kind of virtualized environment the self-adaptation method and system of resources allocation as required, belong to field of computer technology.
(2) background technology
Along with the develop rapidly that Internet uses, increasing service provider gives data center service outsourcing, makes the scale of data center become increasing, become increasingly complex.Intel Virtualization Technology makes it bring into play more and more important effect in the heart in making up large-scale data owing to have following characteristics: the resource utilization that 1, promotes architecture.Can move many virtual machines (VM) simultaneously on the physical machine (PM), monitor of virtual machine (VMM) provides more fine-grained resource allocation mechanism support, for example the credit scheduling strategy of xen (a kind of virtualization product of increasing income) acquiescence provides the mechanism support of cpu resource dynamic assignment, balloon driver provides the support of memory resource dynamic distribution mechanism, and fine-grained resources allocation approaches optimized distribution; 2, better safety, isolation.A virtual machine is subjected to virus, security threat or application wherein and causes system crash can not influence the operation of other virtual machines; 3, has better high availability.When the physical machine accident that virtual machine the moved machine of delaying, can use virtual machine (vm) migration mechanism that whole virtual machine fast transferring is continued operation to other physical machine; 4, can better reduce power consumption, refrigeration and machine room space.Utilize the Server Consolidation technology, reduce the quantity of data center's physical server and related hardware, from reduce machine room space, energy consumption and refrigeration demand, benefit; 5, improved IT employee's work efficiency.Reaching the standard grade of a new server needs complicated flow process, and newly-built virtual machine is the thing of a few minutes, has simplified the supply of server greatly.
Resource management in the data center divides three levels: how to divide the physical machine resource between a plurality of virtual machines on (1) same physical machine; (2) the placement problem of virtual machine on physical machine; (3) externally provide more than one of the server of service, how ask distribution between the virtual machine of same services providing.
In present resource management system,, exist following several problem for the distribution and the management of resource:
1) these three separate considerations of level do not have consideration dependence each other.For example, request distribution policy in the level (3) design unreasonable can not perceive the dynamic change of resources of virtual machine, the phenomenon that " futile effort " in the level (1) increases or reduce resources of virtual machine can occur.In level (1) accurately by being required to be the virtual machine Resources allocation, can be so that virtual machine be placed on the physical machine of less amount in the level (2).
2) the expectation resource utilization that all is based on definition at the Tivoli of DRS, the IBM of HP-UX Workload Manager, the VMware of level (1) Hewlett-Packard Corporation at present excites resource to redistribute adjustment.At the P.Padala of academia, X.Zhu etc. also are based on the adjustment that similar thinking is carried out resource.Exist following shortcomings based on resource utilization adjustment: (a) along with the Internet application and development, use and to become more and more " huge ", to become increasingly complex, what suitablely become more and more difficult in the resource utilization definition of expectation.If definition is too high, can influence the performance of application.If definition is low excessively, cause wasting resource.(b) under virtualized environment, it is difficult more that resource utilization sampling accurately becomes, because need to filter the expense that monitor of virtual machine brings.(c) when a plurality of virtual machines run on the same physical machine, predict that with the current resource utilization that records real resource requirement accuracy is very poor.
3) traditional no longer suitable under virtualized environment at the request distribution policy under the physical machine environment.Under the physical machine environment, remove the non-administrator and carry out scale up or scale down by hand, otherwise it is constant using shared server resource capacity in operational process, and under virtualized environment, providing dynamically more fine granularity resource allocation mechanism support owing to VMM, dynamic change can take place in the resource capacity of virtual machine in using operational process.
4) under the conventional situation for reduce power consumption and the refrigeration cost, obsolete physical machine is shut down to reach purpose of energy saving.But web service has very big suddenly under the actual conditions, and it is too big to add the expense that new physical machine participates on working time when this situation takes place.According to statistics, if system can not respond the satisfaction that exceeds the user to user's request on time, the service provider not only is faced with " lifting " user to serving the risk of dejected degree, What is more, and the user may turn to rival's service, influence product and company's reputation of company, bring very big economic loss.
In order to solve the problem of above existence, we have designed cover self-adaptation resource allocation system as required.At problem 2), carry out the foundation that resource is redistributed between a plurality of virtual machines on the physical machine at level (1) according to user's the Expected Response time, the more direct reality that more meets of this mode.At problem 3), designed the dynamic change of the dynamic sensing module energy of a resources of virtual machine capacity real-time perception virtual machine capacity at level (2).At problem 4), safeguarded an idling-resource pond, when physical machine is not used adding idling-resource pond, not to allow it shut down immediately, keep a period of time but allow it be in dormant state.At problem 1) our designed system considers interdepending between these three levels.
(3) summary of the invention
The purpose of this invention is to provide in a kind of virtualized environment the self-adaptation method and system of resources allocation as required, satisfy user experience, more effective use resource with more effective.
The present invention is achieved by the following technical solutions:
1, self-adaptation resource distributor system as required in a kind of virtualized environment of the present invention, it comprises distribution according to need module between a plurality of virtual machines on dynamic perception request distribution module, the physical machine (being called for short the 1-PM:N-VM module) and global administration of data center module, as shown in Figure 1.Relation between them is: 1-PM:N-VMmodule 101 is carried out the distribution of resource on the physical machine according to the user experience of real-time collecting; Dynamically perceptionrequest distribution module 102 responds load distribution to suitable virtual machine according to the application request load information and the virtual machine capacity information of monitoring to request; Whether whether global administration ofdata center module 103 determines the needs virtual machine to move between physical machine placing again according to the physical machine resource load information of collecting, discharge or apply for that new physical machine is to withdraw from or to add the service of application to the idling-resource pond when physical machine is excessive or not enough.
Described dynamic perception request distribution module comprises: application load monitoring module, application load prediction module, the dynamic sensing module of virtual machine capacity and request distribution module, as shown in Figure 2.Relation between them is: applicationload monitoring module 201 monitoring request load informations pass to applicationload prediction module 202 to the result; Applicationload prediction module 202 is used long-term forecasting to add the short-term modification method charge capacity is predicted; The capacity information ofdynamic sensing module 203 each virtual machines of real-time collecting of virtual machine capacity;Request distribution module 204 selects suitable virtual machine processing request that it is responded according to the result of load estimation and the capacity information of each virtual machine.
This application load monitoring module is: each class is used all needs a load distribution device, and the load monitoring module is moved thereon.All requests at first arrive corresponding load distribution device, and application load monitoring module herein can be known overall load information easily.This module is a program element.
This application load prediction module is: the method for using long-term forecasting to add the short-term correction is predicted load.The load condition of predicting i+1 stage according to the actual measurement load and the predicated error in i stage in i stage of application load monitoring module.This module is a program element.
The dynamic sensing module of this virtual machine capacity is: monitoring in real time moves the volume change of each virtual machine on it in the domain0 control desk virtual machine in physical machine.This module is a program element.
This request distribution module is: according to designed strategy request is forwarded in the corresponding virtual machine and handles.This module is a program element.
Described distribution according to need module is that the 1-PM:N-VM module comprises: request response time obtains module, resource requirement control module and resource ruling control module, as shown in Figure 3.Relation between them is: requestresponse time module 301 obtains to move in each virtual machine the request response time of using in real time; Resourcerequirement control module 302 determines the stock number that need increase or reduce according to the actual response time and the defined Expected Response temporal differences that obtain in real time; Each the virtual demand that resourceruling control module 303 is provided according to the resource requirement control module and the restrictive condition of total resources are made the decision of final resources allocation.
This request response time obtains module: stab time of arrival and the dispose difference of timestamp of response obtains the actual treatment time of each request at server end according to request.This module is a program element.
This resource requirement control module is: according to the actual treatment time of request and the resource requirement of Expected Response time decision virtual machine.This module is a program element.
This resource ruling control module is: according to the resource requirement of each virtual machine and the final resource allocation result of limit decision of total resources.When resource contention not taking place, by being required to be each virtual machine Resources allocation.When competition takes place when, service difference is provided, preferentially guarantee the resource requirement of high-priority applications.This module is a program element.
Global administration of described data center module comprises: physical machine monitoring resource module, virtual machine (vm) migration administration module and idling-resource pond administration module.As shown in Figure 4.Relation between them is: all kinds of resource operating positions of physical machinemonitoring resource module 401 monitors physical machines; The information that virtual machine (vm)migration administration module 402 is collected according to physical machine monitoring resource module determines whether the migration of needs generation virtual machine between each physical machine reapposes, and selects which virtual machine to move; Result after idling-resourcepond administration module 403 moves according to the virtual machine (vm) migration administration module determines whether needs are to free pool application or release physical machine.
This physical machine monitoring resource module is: all kinds of resource operating positions of monitors physical machine.This module is a program element.
This virtual machine (vm) migration administration module is: when the physical machine monitoring module monitors the resource utilization of physical machine when too high, need take some virtual machines of operation on it certain strategy to move on the lighter physical nodes of other load resource utilization rates.The resource utilization that monitors most of physical machine when the physical machine monitoring module is crossed when low, need take the low virtual machine of operation physically of some load certain strategy to move on other physical nodes, go out more physical machine with the free time and be discharged into the purpose that the idling-resource pond reaches the reduction power consumption.This module is a program element.
This idling-resource pond administration module is: be responsible for safeguarding the idling-resource pond, when the current physical machine quantity of moving " excessive " or " deficiency ", idling-resource pond administration module is responsible for to application interpolation of idling-resource pond or release physical machine.This module is a program element.
2, the self-adaptation method of resources allocation as required in a kind of virtualized environment of the present invention, comprising three concrete strategies:
1) adaptive virtual machine dynamic capacity perception request distribution policy, its concrete steps are as follows:
Step 1: monitor application load in real time;
Step 2: use the method for long-term forecasting and short-term correction, the application load of predicting i+1 stage according to the actual measurement load and the predicated error in i stage;
Step 3: the resource capacity information that obtains virtual machine in real time;
Step 4: charge capacity information and the load threshold of presetting according tostep 1 prediction compare, if less than load threshold, when application load is very low, should be discharged into the idling-resource pond to reach the purpose that reduces power consumption so that vacate more physical machine as far as possible with load centralization; If be higher than load threshold, should be as far as possible with load balancing, the virtual machine of avoiding having " hurries extremely ", the generation of the virtual machine that has " not busy dead " phenomenon.
2) 1-PM:N-VM resource allocation policy
Designed on a kind of physical machine method (being called for short the 1-PM:N-VM resource allocation policy) of carrying out resources allocation between many virtual machines according to the user experience of using (referring to the response time) at this.Its concrete steps are as follows:
Step 1: obtain to operate in the request response time of using on each virtual machine in real time;
Step 2: be the response time scope of an expectation of every class application definition.Statistics response time in each cycle falls into Expected Response time range left side, just in time falls in the Expected Response time range, falls into the request number on Expected Response time range right side.The user satisfaction of definition expectation, the user satisfaction of expectation represents that with the request number and the total ratio of number of asking that fall in the Expected Response time range high more effect is good more.When the request number that falls into Expected Response time range left side and total ratio of number of asking exceed the resource abundance that certain threshold value means to be provided for application, should reduce resource.When the request number that falls into Expected Response time range right side and total ratio of number of asking exceed the phenomenon that certain threshold value means the supply of generation inadequate resource, should increase resource;
Step 3: according to resource difference and the function model decision needs increase of response time difference or the stock number that reduces of design;
Step 4: according to the Optimization Theory Model of design, according to the resource requirement of each virtual machine and the final resources allocation of restriction ruling of total resources.
3) virtual machine (vm) migration strategy, its concrete steps are as follows:
Step 1: be the bound threshold value of a resource utilization of every physical machine definition
Step 2: do not have the resource utilization of physical machine to be higher than the upper limit again this moment when the physical machine resource utilization is lower than lower limit, and exist the virtual machine (can receive and mean that other physical machine sink virtual machines can not cause the resource utilization of physical machine to exceed the upper limit) that physical machine can receive on it operation and indicating physical machine " excessive " supply, the virtual machine (vm) migration of operation on it on the physical machine that can receive, is reduced the quantity of physical machine.When the physical machine resource utilization is higher than the upper limit, but exist physical machine can receive the virtual machine of operation on it, need on the physical machine that can receive, continue operation to virtual machine (vm) migration.When the physical machine resource utilization is higher than upper limit threshold and has kept a period of time, the virtual machine that does not have to receive operation it on this moment continues the physical machine of operation, and the physical machine adding that just should absorb from the idling-resource pond in dormancy moves.
3, the invention has the advantages that:
1) having designed one takes all factors into consideration resources allocation between a plurality of virtual machines on the physical machine, provides request distribution, virtual machine between a plurality of virtual machines of equal service to place the adaptive resource Governance framework of three levels.Designed system has adaptivity, has reduced system manager's maintenance cost.
2) design the strategy that carries out resources allocation according to the user experience of reality, carried out the method for resources allocation adjustment with traditional foundation expectation resource utilization and compare, not only directly had more realistic meaning.
3) be different from traditional request distribution policy, the dynamic sensing module of designed virtual machine capacity can real-time perception arrive the variation of virtual machine capacity, and then can better utilize resource.
" sudden change " of load can better be tackled in the idling-resource pond of 4) being safeguarded.Because the physical machine that is discharged in the idling-resource pond is not to shut down immediately, keeps a period of time but be in dormant state, reduced the start-up time that load changing dynamically adds needs.
(4) description of drawings
Fig. 1 self-adaptation of the present invention is resources allocation general frame figure as required
The dynamic perception request of Fig. 2 the present invention distribution module structural representation
Fig. 3 1-PM:N-VM resource distribution module of the present invention structural representation
Global administration of Fig. 4 data center of the present invention modular structure synoptic diagram
The dynamic perception request of Fig. 5 the present invention distribution policy process flow diagram
Figure 61-PM:N-VM resource allocation policy process flow diagram
Fig. 7 virtual machine (vm) migration strategic process figure
Symbol description is as follows among the figure:
101 1-PM:N-VM modules; 102 dynamic perception request distribution modules; 103 global administration of data center modules; 201 application load monitoring modules; 202 application load prediction module; The dynamic sensing module of 203 virtual machine capacity; 204 request distribution modules; 301 request response time obtain module; 302 resource requirement control modules; 303 resource ruling control modules; 401 physical machine monitoring resource modules; 402 virtual machine (vm) migration administration modules; 403 idling-resource pond administration modules.
PM Physical Machine, physical machine; VM Virtual Machine, virtual machine; 1-PM:N-VM represents the resources allocation between a plurality of virtual machines on the physical machine; Tij i total request number that is applied in j measurement period; Nij i is applied in the request number that j measurement period actual response time falls into the Expected Response time; Lij i is applied in the request number that j measurement period actual response time falls into Expected Response time left side; Uij i is applied in the request number that j measurement period actual response time falls into Expected Response time right side.
(5) embodiment
For making technical solution of the present invention and advantage clearer,, the technical scheme in the embodiment of the invention is carried out clear, complete description below in conjunction with the embodiment of the invention.Need to prove that in accompanying drawing or instructions, components identical is all used identical Reference numeral.
Self-adaptation resource distributor system as required in a kind of virtualized environment of the present invention, it comprises the distribution according to need module between a plurality of virtual machines on the physical machine (being called for short the 1-PM:N-VM module) 101, dynamic perceptionrequest distribution module 102, global administration ofdata center module 103, as shown in Figure 1.1-PM:N-VMmodule 101 is carried out the distribution of resource on the physical machine according to the user experience of real-time collecting; Dynamically perceptionrequest distribution module 102 responds load distribution to suitable virtual machine according to the application request load information and the virtual machine capacity information of monitoring to request; Whether whether global administration ofdata center module 103 determines the needs virtual machine to move between physical machine placing again according to the physical machine resource load information of collecting, discharge or apply for that new physical machine is to withdraw from or to add the service of application to the idling-resource pond when physical machine is excessive or not enough.
Described dynamic perceptionrequest distribution module 102 comprises: applicationload monitoring module 201, applicationload prediction module 202, thedynamic sensing module 203 of virtual machine capacity andrequest distribution module 204, as shown in Figure 2.Applicationload monitoring module 201 monitoring request load informations pass to applicationload prediction module 202 to the result; Applicationload prediction module 202 is used long-term forecasting to add the short-term modification method charge capacity is predicted; The capacity information ofdynamic sensing module 203 each virtual machines of real-time collecting of virtual machine capacity;Request distribution module 204 selects suitable virtual machine processing request that it is responded according to the result of load estimation and the capacity information of each virtual machine.
This application load monitoring module 201: each class is used all needs a load distribution device, and the load monitoring module is moved thereon.All requests at first arrive corresponding load distribution device, and application load monitoring module herein can be known overall load information easily, each charge capacity information of using of real-time collecting.This module is a program element.
This application load prediction module 202: at the load of web service, load has certain rules on long terms, but has certain suddenly in a short time again, takes long-term forecasting to add the method for short-term correction to the prediction of load.The load condition of predicting i+1 stage according to the actual measurement load and the predicated error in i stage in i stage of application load monitoring module.This module is a program element.
Thedynamic sensing module 203 of this virtual machine capacity: monitoring in real time moves the volume change of each virtual machine on it in the domain0 control desk virtual machine in physical machine, utilizes xenstore and uses the xentop order can obtain the resource capacity information of each virtual machine in real time.This module is a program element.
This asks distribution module 204: each the virtual machine capacity information according to the charge capacity and the dynamic sensing module of virtual machine capacity of the prediction of applied forcasting module are collected is forwarded to request in the corresponding virtual machine and handles according to designed strategy (seeing the request distribution policy in the real-time example one).This module is a program element.
Described distribution according to need module is that 1-PM:N-VM module 101 comprises: request response time obtainsmodule 301, resourcerequirement control module 302 and resource rulingcontrol module 303, as shown in Figure 3.Requestresponse time module 301 obtains to move in each virtual machine the request response time of using in real time; Resourcerequirement control module 302 determines the stock number that need increase or reduce according to the actual response time and the defined Expected Response temporal differences that obtain in real time; Each the virtual demand that resource rulingcontrol module 303 is provided according to the resource requirement control module and the restrictive condition of total resources are made the decision of final resources allocation.
This request response time obtains module 301: stab time of arrival and the dispose difference of timestamp of response obtains the actual treatment time of each request at server end according to request.The response time of an expectation of every class application definition.All requests all can be transmitted by the virtual bridge that is arranged in domain0, use the tshark instrument from data link layer request and respond packet to be obtained, and use four-tuple<source IP, purpose IP, source port, destination interface〉connection of sign, analyze and obtain the response time.This module is a program element.
This resource requirement control module 302: according to the actual treatment time of request and the resource requirement of Expected Response time decision virtual machine.Stock number and the relation between the response time are very complicated, the relation between being difficult to express with a mathematical model.People such as the Wang Xiaorui of University of Tennessee confirm difference between the stock number and the difference of response time relation is easier represents with mathematical model, and the relational model of design resource difference of the present invention and response time difference draws with this needs the stock number (seeing embodiment two) that increases or reduce.This module is a program element.
This resource ruling control module 303: according to the resource requirement of each virtual machine and the final resource allocation result of limit decision of total resources.When resource contention not taking place, by being required to be each virtual machine Resources allocation.When competition takes place when, service difference is provided, preferentially guarantee the resource requirement of high-priority applications.This module is a program element.
Global administration of describeddata center module 103 comprises: physical machinemonitoring resource module 401, virtual machine (vm)migration administration module 402 and idling-resource pond administration module 403.All kinds of resource operating positions of physical machinemonitoring resource module 401 monitors physical machines; The information that virtual machine (vm)migration administration module 402 is collected according to physical machine monitoring resource module determines whether the migration of needs generation virtual machine between each physical machine reapposes, and selects which virtual machine to move; Result after idling-resourcepond administration module 403 moves according to virtual machine (vm)migration administration module 402 determines whether needs are to free pool application or release physical machine.
This physical machine monitoring resource module 401: all kinds of resource operating positions of monitors physical machine.The performance collection kit sysstat that use is increased income carries out real-time collecting to all kinds of resource operating positions of physical machine.This module is a program element.
This virtual machine (vm) migration administration module 402:, need take some virtual machines of operation on it certain strategy migration (seeing embodiment three) on the lighter physical nodes of other load resource utilization rates when the physical machine monitoring module monitors the resource utilization of physical machine when too high.The resource utilization that monitors most of physical machine when the physical machine monitoring module is crossed when low, need take the low virtual machine of operation physically of some load certain strategy (seeing embodiment three) to move on other physical nodes, go out more physical machine with the free time and be discharged into the purpose that the idling-resource pond reaches the reduction power consumption.This module is a program element.
This idling-resource pond administration module 403: be responsible for safeguarding the idling-resource pond, when the current physical machine quantity of moving " excessive " or " deficiency ", idling-resource pond administration module is responsible for to application interpolation of idling-resource pond or release physical machine.This module is a program element.
2, the present invention a kind of in virtualized environment the method for self-adaptation distribution according to need resource, comprising three concrete strategy: embodiment one, adaptive virtual machine dynamic capacity perception request distribution policy; Embodiment two, the 1-PM:N-VM resource allocation policy; Embodiment three, the virtual machine (vm) migration strategy.
1) embodiment one: adaptive virtual machine dynamic capacity perception request distribution policy
The dynamic method flow diagram of perception request distribution policy in the virtualized environment that Fig. 5 provides for the embodiment of the invention one, in the present embodiment, dynamically the method step of perception request distribution policy is:
Step 1: the load state information of using application load monitoring modular 201 monitoring current application;
Step 2: the Forecasting Methodology of using long-term forecasting to add the short-term correction is predicted the load size in next stage according to current load state information and current predicated error
Step 3: thedynamic sensing module 203 real-time perception virtual machine volume change of virtual machine capacity, safeguard one this serve the double-linked circular list of all virtual machine capacity.Double-linked circular list sorts to virtual machine according to capacity order from big to small.
Step 4: requestdistribution module 204 is forwarded to request on the suitable servers with the virtual machine capacity that service is provided according to current load condition and serves.If what charge capacity less than certain threshold value, should be tried one's best load concentrates.Calculate by following formula 1:
W1* VM quantity+W of having of PM2* VM resource utilization+W3* VM resource capacity (formula 1)
Value is carried out descending sort, handle on the virtual machine of the value of forwarding the request to maximum, so that " emptying " load on it as early as possible of the few physics function of the virtual machine number of being moved, reach as early as possible the release physical machine to the idling-resource pond to reach the purpose that reduces power consumption.If charge capacity is higher than certain threshold value, that load should be tried one's best carries out equilibrium between each virtual machine.Calculate by following formula 2:
W1* resource utilization+W of VM place PM2* VM resource utilization+W3/ VM resource capacity (formula 2)
Value is sorted by ascending order, handle on the virtual machine of the value of forwarding the request to minimum, so that the equilibrium that load can be tried one's best.
2) embodiment two: the 1-PM:N-VM resource allocation policy
The process flow diagram of the 1-PM:N-VM resource allocation policy that Fig. 6 provides for the embodiment of the invention two, in the present embodiment, the method step of 1-PM:N-VM resource allocation policy is:
Step 1: use request response time to obtain the actual response time that
module 301 obtains each request.According to<source IP, purpose IP, source port, destination interface〉indicate a connection, utilize the difference that request time stabs and the response time stabs to obtain the actual response time of each request, and add up each and use the handling capacity T of i in j cycle
Ij, the response time of setting expectation is
Counting response time falls in the Expected Response time range
Request count N
IjFall into the response time
L is counted in the request in left side
IjOr the response time falls into
U is counted in the request on right side
Ijd
IjBe j interior actual measurement response time in cycle of i virtual machine, R
IjIt is the resource in j cycle of i virtual machine.
Step 2: setting the satisfaction of using is
PIj=NIj/ TIj(formula 3)
The worst tolerances of using i is
, when
The satisfaction of Shi Yingyong is met.
When
When (formula 4), fall into the request number in Expected Response time range left side and the ratio of total request number and exceed the resource abundance that preset threshold means to be provided for application, user experience is fine.But this situation also is not expect the phenomenon that takes place in the middle of reality, because application takies many more resources and need pay more cost, the service provider does not obtain because better user experience is provided than falling into more income in the Expected Response time range, the net proceeds of provider is to have reduced in fact in this case, so should reduce resource.
When
When (formula 5), fall into the request number on Expected Response time range right side and the ratio of total request number and exceed the phenomenon that preset threshold means the supply of generation inadequate resource, user experience is affected, and should increase resource for it.
Step 3: the difference between the stock number and the difference of response time relation is easier to be represented with mathematical model, and the relational model of design resource difference of the present invention and response time difference draws with this needs the stock number that increases or reduce.Approaching more from the Expected Response time range, need the stock number of increase or minimizing more little.
Δ RIj=λ (1-PIj) * Δ dIj(formula 6)
Δ R whereinIj=RIj-RIj-1, Δ dIj=| dIj-DIj|, λ is a coefficient.
Step 4: according to the resource requirement of each virtual machine, consider the restriction of total resources, when resource contention not taking place, distribute as required, the preferential resource requirement that guarantees high-priority applications when resource contention takes place.
3) embodiment three: the virtual machine (vm) migration strategy
The process flow diagram of the virtual machine (vm) migration strategy that Fig. 7 provides for the embodiment of the invention three, the method step of virtual machine (vm) migration strategy is in the present embodiment:
Step 1: use physical machinemonitoring resource module 401 to obtain the resource operating position of each physical machine.Bound for a resource utilization of each physical machine definition.
Step 2: judge that resource utilization is greater than the upper limit?
If greater than the upper limit, be calculated as follows:
W1* VM amount of ram+W2* the dirty page or leaf of VM internal memory rate+W3The cpu load of/VM (formula 7)
The virtual machine of selective value minimum moves.This is because test analysis factually, and the expense of virtual machine (vm) migration is mainly relevant with the dirty page or leaf rate that virtual machine produces in operational process with the shared amount of ram size of virtual machine.Move the expense in the time of to reduce virtual machine (vm) migration in such a way, save time.
Can judge whether to exist the physical machine that sink virtual machine continues operation? can sink virtual machine, be meant that virtual machine (vm) migration in the past after, can not make that the resource utilization of target physical machine exceeds the ceiling restriction of utilization rate.
If there is the operation of then moving.
If do not exist, then apply for adding new physical machine and put into operation to idling-resource pond administration module.
Can, judge whether to exist the physical machine that receive all virtual machines that move on the physical machine? if less than the upper limit
If exist, then carry out migration operation.
Can virtual machine (vm) migrations all on the physical machine be finished? if can, then the physical machine of free time this moment is discharged in the idling-resource pond.