Summary of the invention
It is an object of the invention to overcome the deficiencies in the prior art, the virtual machine (vm) migration at a kind of Energy-saving Data center
Method, increases consideration to virtual machine service traffics, realize virtual machine (vm) migration energy-conservation while, reduce void
Plan machine service traffics, and reach to optimize the purpose of data center's energy-saving effect with the fewest number of times that migrates.
For achieving the above object, the virtual machine migration method at Energy-saving Data center of the present invention, including following
Step:
S1: the set of all physical machine in existing virtual machine mapping scheme is designated as S;
S2:, the virtual machine quantity mapped in each physical machine in statistics set S, select virtual machine in set S
Physical machine m of minimum number, is designated as H (m), statistics H (m) by the virtual machine set mapped in this physical machine m
In total service traffics of all virtual machines, all for other beyond H (m) virtual machine set are designated as E;
S3: if H (m) is empty set, enters step S4, if not being empty set, selects total business in H (m)
The virtual machine i of maximum flow, in set S, other physical machine in addition to physical machine m search surplus resources appearance
Amount can meet the physical machine of virtual machine i, and resource includes CPU, internal memory, rate of discharge, if it does not, move
Shifting terminates;If only existing a physical machine met, as migrating physical machine, enter step S6;
If there is multiple physical machine met, enter step S5;
S4: physical machine m is deleted from set S, returns step S2;
S5: for each physical machine t met, virtual with in other physical machine of virtual machine i after computation migration
Service traffics cost T between machine, computing formula is:
T=Σj∈ED(i,j)×C(t,π(j))+Σj∈ED(j,i)×C(π(j),t)
Wherein, (i, j) represents the oriented service traffics of virtual machine i to virtual machine j to D, and π (j) is that virtual machine j maps
Physical machine, C (t, π (j)) represent physical machine t to the communication cost of the unit traffic amount of physical machine π (j),
j∈E;(j, i) represents the oriented service traffics of virtual machine j to virtual machine i to D, and (π (j) t) represents physical machine π (j) to C
Communication cost to the unit traffic amount of physical machine t;
Select the physical machine of service traffics cost T minimum as migrating physical machine, enter step S6;
S6: the mapping address of change virtual machine i, moves to virtual machine i migrate in physical machine, by virtual machine i
Delete from set H (m), return step S3.
Further, before step S3 makes a look up, by each physical machine in physical machine set S according to residue
Resource size descending
Wherein, in step S5, communication cost is the jumping figure between two physical machine.
Wherein, the communication cost in step S5 is the link weight sum in path between two physical machine.
The virtual machine migration method at Energy-saving Data center of the present invention, owning in existing virtual machine mapping scheme
In physical machine, select the physical machine of virtual machine minimum number to carry out virtual machine (vm) migration successively, select successively during migration
Select the virtual machine that total service traffics are maximum, search surplus resources capacity and can meet the physical machine of this virtual machine, as
There is multiple physical machine met in fruit, then virtual machine Business Stream when calculating this virtual machine (vm) migration to each physical machine
The cost that amount produces, selecting the physical machine of Least-cost to migrate, meeting until there being virtual machine to find
The physical machine of capacity-constrained, i.e. terminates virtual machine (vm) migration.Use the present invention, closed by virtual machine (vm) migration
While free physical machine is energy-conservation, also consider service traffics, occurred multiple meeting capacity about migrating
Select the physical machine that service traffics are minimum during the physical machine restrainted, further reduce the energy consumption of data center network,
The present invention completes virtual machine (vm) migration with the fewest migration number of times simultaneously, optimizes and migrates the energy consumption brought.
Embodiment
The main purpose of virtual machine (vm) migration is to concentrate virtual machine, reduces the unlatching quantity of physical machine, thus
Energy efficient.In the present invention in the virtual machine migration method at Energy-saving Data center, need to consider following
Several aspects:
Whether a: the new physical machine moved to disclosure satisfy that the physical machine resource requirement of physical machine to be migrated, virtual
The resource that machine needs physical machine to provide includes CPU (calculating resource), internal memory, rate of discharge, and should be every
One resource can meet the demand of virtual machine;
B: virtual machine is after the original physical machine mapped moves to new physical machine, if can minimize physical machine
Between the cost that produces of virtual machine service traffics, set reducing data center network link resource and exchange
Standby use, thus reduce the energy consumption of data center network;
C: owing to the transition process of virtual machine itself is also required to take Internet resources, then whether can be with minimum
Migrate number of times and reach preferably migration effect, thus reduce and migrate the energy consumption brought.
Virtual machine service traffics Least-cost between physical machine quantity minimum, physics, migration least number of times
There is conflict between three optimization aim, therefore need necessarily to compromise in moving method, so that virtual
Machine migrates and reaches preferable effect.
Fig. 1 is a kind of detailed description of the invention flow chart of the virtual machine migration method at Energy-saving Data center of the present invention.
As it is shown in figure 1, the virtual machine migration method at Energy-saving Data center of the present invention comprises the following steps:
S101: initialize physical machine set S: by the set note of all physical machine in existing virtual machine mapping scheme
For S.
S102: the virtual machine quantity mapped in each physical machine in statistics set S, selects virtual machine in set S
Physical machine m of minimum number, is designated as H (m), statistics H (m) by the virtual machine set mapped in this physical machine m
In total service traffics of all virtual machines, all for other beyond H (m) virtual machine set are designated as E.
The physical machine selecting current virtual machine minimum number migrates, can be with the fewest migration number of times
Complete virtual machine (vm) migration, migrate, to reduce, the energy expenditure brought.
S103: judge whether whether H (m)=φ, i.e. H (m) are empty set, if empty set, enters step
S104, if not empty set, enters step S105.
S104:S=S-{m}, physical machine m will delete from set S, returns step S102.
S105: select the virtual machine i that in H (m), total service traffics are maximum to carry out migrating judgement, i.e. in set S
Other physical machine in addition to physical machine m search surplus resources capacity can meet the physical machine of virtual machine i, resource
Including CPU, internal memory, rate of discharge.
The reason that the virtual machine selecting total service traffics maximum carries out judging is, for a physical machine, if
There is a virtual machine to migrate, then this physical machine i.e. cannot be closed, be i.e. unable to reach closedown physical machine and come
Energy-conservation purpose, judges the virtual machine that total service traffics are maximum the most every time, to prevent from having migrated part void
Plan machine still cannot cut out the situation of physical machine, reduces unnecessary migration number of times.
Before lookup, can in advance each physical machine in physical machine set S be arranged according to surplus resources size descending
Row, such that it is able to improve search efficiency.
S106: if the transportable physical machine quantity that step S105 finds is 0, does not i.e. find and meet capacity about
Bundle physical machine, migration terminates, if not being 0, enters step S107.
In the present invention, it is that the carrying out of physical machine with virtual machine minimum number migrates every time, if other
Physical machine cannot support that the virtual machine in this physical machine migrates, then illustrates in whole virtual data
The heart has compared concentration, therefore terminates to migrate.In a practical situation, a physical machine generally can carry
30-50 virtual machine, so the resource granularity shared by each virtual machine is the least, if there being a void
Plan machine cannot find transportable physical machine, can illustrate that other physical machine have approached to saturation.
S107: if the transportable physical machine quantity that step S105 finds is 1, then as migrating physics
Machine, enters step S109, if not being 1, transportable physical machine quantity more than one being i.e. described, entering step
Rapid S108 selects.
S108: for each physical machine t met, virtual machine i and the void in other physical machine after computation migration
Service traffics cost T between plan machine, computing formula is:
T=Σj∈ED(i,j)×C(t,π(j))+Σj∈ED(j,i)×C(π(j),t)
Wherein, (i, j) represents the oriented service traffics of virtual machine i to virtual machine j to D, and π (j) is that virtual machine j maps
Physical machine, C (t, π (j)) represent physical machine t to the communication cost of the unit traffic amount of physical machine π (j),
j∈E;Similarly, (j, i) represents the oriented service traffics of virtual machine j to virtual machine i to D, and (π (j) t) represents C
Physical machine π (j) is to the communication cost of the unit traffic amount of physical machine t.When physical machine t to physical machine π (j) and
When physical machine π (j) is same to the path of physical machine t, and C (t, π (j))=C (π (j), t).Unit traffic amount
Communication cost can directly use the jumping figure of path link, it would however also be possible to employ path link weight sum.
Select the physical machine of service traffics cost T minimum as migrating physical machine, enter step S109.
S109: migrate virtual machine i, i.e. change the mapping address of virtual machine i, move to virtual machine i to determine
Migrate in physical machine, update the surplus resources capacity in this physical machine, and make that H (m)=H (m)-{ i}, will
Virtual machine i deletes from set H (m), returns step S103.
The virtual machine migration method at Energy-saving Data center of the present invention, it is contemplated that be short of the void of consideration in prior art
Plan machine service traffics, reduce the energy consumption model of data center more really, thus improve by virtual
Machine moving method realizes the efficiency that data center is energy-conservation.Owing to the model of this problem is a Non-Linear Programming
Problem, possibly cannot try to achieve optimal solution or need the hugest time just can obtain solution.The present invention is energy-conservation
The virtual machine migration method of data center uses heuritic approach, for a thing comprising M congruence property
The data center of the virtual machine of reason machine and N number of different demand, the time complexity solved is reduced to by the present invention
O (M × N), substantially increases solving speed.
Although detailed description of the invention illustrative to the present invention is described above, in order to the art
Artisans understand that the present invention, it should be apparent that the invention is not restricted to the scope of detailed description of the invention, right
From the point of view of those skilled in the art, as long as various change limits in appended claim and determines
The spirit and scope of the present invention in, these changes are apparent from, all utilize present inventive concept send out
Bright creation is all at the row of protection.