CN106469092B - Virtual machine mapping method and device - Google Patents
Virtual machine mapping method and device Download PDFInfo
- Publication number
- CN106469092B CN106469092B CN201610805268.1A CN201610805268A CN106469092B CN 106469092 B CN106469092 B CN 106469092B CN 201610805268 A CN201610805268 A CN 201610805268A CN 106469092 B CN106469092 B CN 106469092B
- Authority
- CN
- China
- Prior art keywords
- cased
- platform
- physical machine
- jth
- virtual machine
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5077—Logical partitioning of resources; Management or configuration of virtualized resources
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Control Of Vending Devices And Auxiliary Devices For Vending Devices (AREA)
Abstract
The present invention provides virtual machine mapping method and device, method include: the kth ascending to the opening time in virtual machine setiPlatform virtual machine to be allocated, judges whether there is jiMake jth in physical machine setiPlatform physical machine to be cased meets default vanning condition;If it exists, and there are at least two default vanning conditions of physical machines satisfaction to be cased, then the utilization rate for meeting default all physical machines to be cased of vanning condition is calculated, by kthiIt is maximum wait in physical machine of casing that platform virtual machine to be allocated puts into utilization rate;If jth at this timeiThe efficiency of platform physical machine to be cased is higher than preset negative and carries balanced lower threshold value, it is determined that it is cased successfully, and jth will have been put intoiVirtual machine in platform physical machine to be cased is removed from virtual machine set, and will case successful jthiPlatform physical machine to be cased is removed from physical machine set, is returned and is started step up to virtual machine quantity to be allocated in virtual machine set is 0.Virtual machine can be carried out reasonable distribution by the present invention, meet load balancing.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of virtual machine mapping methods and device.
Background technique
It needs to carry out multiple virtual machines in cloud environment Internet data center (IDC, InternetDataCenter)
Distribution, i.e., need to judge to be mapped to these virtual machine VM to be allocated on which physical server (i.e. physical machine) PM.Therefore, should
Distribution is a critically important process, and data exchange amount and physical server usage quantity can be greatly reduced in reasonable distribution
To achieve the purpose that energy saving optimizing.
During the operation management of cloud environment data center, energy consumption accounts for most of spending of O&M cost, in data
The research of heart energy saving optimizing is the chief component of operation management, to energy-saving and emission-reduction, reduces cost and all has important meaning,
And the major issue in load balancing and virtual machine distribution.
Therefore, how virtual machine reasonably to be distributed, new physical server is opened in realization less as far as possible, and full simultaneously
Sufficient load balancing becomes the current technical issues that need to address.
Summary of the invention
In order to solve the above technical problems, the present invention provides a kind of virtual machine mapping method and device, based on memory, center
Bin packing under processor cpu, input/output interface I/O three-dimensional constraining increases time dimension and load balancing constraint,
Virtual machine can reasonably be distributed, new physical server is opened in realization less as far as possible, and meets load balancing simultaneously.
First invention, the present invention provide a kind of virtual machine mapping method, comprising:
Virtual machine to be allocated in virtual machine set is ranked up according to the size of opening time;
For opening time ascending kth in virtual machine set after sequenceiPlatform virtual machine to be allocated, judges whether
There are jiMake jth in physical machine setiPlatform physical machine to be cased meets default vanning condition, wherein ki=1...mi, miFor void
The quantity of virtual machine to be allocated, j in quasi- machine seti=1...ni, niFor the number of physical machine to be cased in physical machine set
Amount;
J if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets default vanning condition, and physical machine collection
There are at least two physical machines to be cased in conjunction and meet default vanning condition, then calculates and meet being needed for default vanning condition
The utilization rate of the physical machine of vanning, by the kthiPlatform virtual machine to be allocated puts into the maximum jth of utilization rateiPlatform is to be cased
In physical machine;
Judge jth at this timeiWhether the efficiency of platform physical machine to be cased is higher than default load balancing lower threshold value;
If jth at this timeiThe efficiency of platform physical machine to be cased is higher than preset negative and carries balanced lower threshold value, it is determined that jthiPlatform waits for
The physical machine of vanning is cased successfully, and jth will have been put intoiVirtual machine in platform physical machine to be cased is from virtual machine set
It removes, will case successful jthiPlatform physical machine to be cased is removed from physical machine set, and return is described will be in virtual machine set
The step of virtual machine to be allocated is ranked up according to the size of opening time, until virtual machine to be allocated in virtual machine set
Quantity is 0;
Wherein, the virtual machine collection is combined into the set of all virtual machines to be allocated in cloud environment, the physical machine set
For the set of physical machines to be cased all in cloud environment.
Optionally, the default vanning condition, comprising:
For ki, there are jiMeet following three conditions simultaneously:
Wherein, p is to preset load balancing upper threshold value, 0 < p < 1,It is corresponding for the virtual machine to be allocated of u platform after sequence
Cpu,For the u platform corresponding memory of virtual machine to be allocated after sequence,For the void that u platform after sequence is to be allocated
The quasi- corresponding I/O of machine,For jth in physical machine setiThe corresponding cpu of platform physical machine to be cased,For physical machine collection
Jth in conjunctioniThe corresponding memory of platform physical machine to be cased,For jth in physical machine setiPlatform physical machine to be cased is corresponding
I/O;
And for ki+ 1, meet for jiAt least one condition is set up in following conditions:
Optionally, j is judged whether there is describediMake jth in physical machine setiPlatform physical machine to be cased meets default
After vanning condition, jth at this time is judged describediWhether the efficiency of platform physical machine to be cased is higher than threshold under default load balancing
Before value, the method also includes:
Unique j if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets default vanning condition, will be described
KthiPlatform virtual machine to be allocated puts into the jthiIn platform physical machine to be cased.
Optionally, the j if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets default vanning item
Part, and there are at least two physical machines to be cased in physical machine set and meet default vanning condition, then calculate the default dress of satisfaction
The utilization rate of all physical machines to be cased of case condition, comprising:
J if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets default vanning condition, and physical machine collection
There are the physical machines that α platform is to be cased in conjunctionMeeting default vanning condition, α is the positive integer greater than 1,
Then by the first formula, the utilization rate for meeting all physical machines to be cased of default vanning condition is calculated;
First formula are as follows:
Wherein, v=1... α,It is in physical machine setThe utilization rate of platform physical machine to be cased.
Optionally, described to judge jth at this timeiWhether the efficiency of platform physical machine to be cased is higher than threshold under default load balancing
Value, comprising:
If meeting the k of default vanning conditioniAnd ji, also meet any of following conditions condition:
Then determine jth at this timeiThe efficiency of platform physical machine to be cased is higher than preset negative and carries balanced lower threshold value, wherein q is pre-
If load balancing lower threshold value, 0 < q < p < 1;
If meeting the k of default vanning conditioniAnd ji, also while meeting following three conditions:
Then determine jth at this timeiThe efficiency of platform physical machine to be cased carries balanced lower threshold value lower than preset negative.
Optionally, jth at this time is judged describediWhether the efficiency of platform physical machine to be cased is higher than under default load balancing
After threshold value, the method also includes:
If jth at this timeiThe efficiency of platform physical machine to be cased carries balanced lower threshold value lower than preset negative, then it is virtual to search for calculating
In addition to having put into jth in machine setiK in platform physical machine to be casediResidue except platform virtual machine to be allocated is to be allocated
Jth can be put into virtual machineiVirtual machine to be allocated in platform physical machine to be cased, is put into jthiPlatform object to be cased
In reason machine, until search is less than can put into jthiVirtual machine to be allocated in platform physical machine to be cased, it is determined that jthiPlatform waits for
The physical machine of vanning is cased successfully, and jth will have been put intoiVirtual machine in platform physical machine to be cased is from virtual machine set
It removes, will case successful jthiPlatform physical machine to be cased is removed from physical machine set, and return is described will be in virtual machine set
The step of virtual machine to be allocated is ranked up according to the size of opening time, until virtual machine to be allocated in virtual machine set
Quantity is 0.
Second invention, the present invention provide a kind of virtual machine mapping device, comprising:
Sorting module, for virtual machine to be allocated in virtual machine set to be ranked up according to the size of opening time;
First judgment module, for the kth ascending for the opening time in virtual machine set after sequenceiPlatform is to be allocated
Virtual machine, judge whether there is jiMake jth in physical machine setiPlatform physical machine to be cased meets default vanning condition,
In, ki=1...mi, miFor the quantity of virtual machine to be allocated in virtual machine set, ji=1...ni, niFor in physical machine set
The quantity of physical machine to be cased;
First mapping block, for j if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets default dress
Case condition, and there are at least two physical machines to be cased in physical machine set and meet default vanning condition, then it is pre- to calculate satisfaction
If the utilization rate of all physical machines to be cased of the condition of vanning, by the kthiPlatform virtual machine to be allocated puts into utilization rate most
Big jthiIn platform physical machine to be cased;
Second judgment module, for judging jth at this timeiIt is equal whether the efficiency of platform physical machine to be cased is higher than default load
Weigh lower threshold value;
Module is removed, if for jth at this timeiThe efficiency of platform physical machine to be cased is higher than preset negative and carries balanced lower threshold value,
Then determine jthiPlatform physical machine to be cased is cased successfully, and jth will have been put intoiVirtual machine in platform physical machine to be cased is from void
It is removed in quasi- machine set, will case successful jthiPlatform physical machine to be cased is removed from physical machine set, returns to the row
Sequence module, until virtual machine quantity to be allocated in virtual machine set is 0;
Wherein, the virtual machine collection is combined into the set of all virtual machines to be allocated in cloud environment, the physical machine set
For the set of physical machines to be cased all in cloud environment.
Optionally, the default vanning condition, comprising:
For ki, there are jiMeet following three conditions simultaneously:
Wherein, p is to preset load balancing upper threshold value, 0 < p < 1,It is corresponding for the virtual machine to be allocated of u platform after sequence
Cpu,For the u platform corresponding memory of virtual machine to be allocated after sequence,For the void that u platform after sequence is to be allocated
The quasi- corresponding I/O of machine,For jth in physical machine setiThe corresponding cpu of platform physical machine to be cased,For physical machine collection
Jth in conjunctioniThe corresponding memory of platform physical machine to be cased,For jth in physical machine setiPlatform physical machine to be cased is corresponding
I/O;
And for ki+ 1, meet for jiAt least one condition is set up in following conditions:
Optionally, described device further include:
Second mapping block, for unique j if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets pre-
If the condition of vanning, by the kthiPlatform virtual machine to be allocated puts into the jthiIn platform physical machine to be cased.
Optionally, described device further include:
Third mapping block, if for jth at this timeiThe efficiency of platform physical machine to be cased carries balanced lower threshold lower than preset negative
Value is then searched for and is calculated in virtual machine set in addition to having put into jthiK in platform physical machine to be casediPlatform virtual machine to be allocated
Except residue virtual machine to be allocated in can put into jthiVirtual machine to be allocated in platform physical machine to be cased, is filled
Into jthiIn platform physical machine to be cased, until search is less than can put into jthiVoid to be allocated in platform physical machine to be cased
Quasi- machine, it is determined that jthiPlatform physical machine to be cased is cased successfully, and jth will have been put intoiVirtual machine in platform physical machine to be cased
It is removed from virtual machine set, will case successful jthiPlatform physical machine to be cased is removed from physical machine set, returns to institute
Sorting module is stated, until virtual machine quantity to be allocated in virtual machine set is 0.
As shown from the above technical solution, virtual machine mapping method and device of the invention, based on memory, central processing unit
Bin packing under cpu, input/output interface I/O three-dimensional constraining increases time dimension and load balancing constraint, can incite somebody to action
Virtual machine is reasonably distributed, and new physical server is opened in realization less as far as possible, and meets load balancing simultaneously.
Detailed description of the invention
Fig. 1 is a kind of flow diagram for virtual machine mapping method that one embodiment of the invention provides;
Fig. 2 is the schematic diagram of virtual machine vanning;
Fig. 3 is that the resource of the time attribute of virtual machine vanning places schematic diagram;
Fig. 4 is a kind of structural schematic diagram for virtual machine mapping device that one embodiment of the invention provides.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, the technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only
It is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiment of the present invention, ordinary skill people
Member's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
The difference of resources of virtual machine mapping and conventional multidimensional bin packing in cloud environment, is mainly reflected in two sides
Face: be on the one hand virtual machine instance and physical server multi dimensional resource attribute can not superimposed characteristics;It on the other hand is virtual machine
The time attribute of example and physical server.Next respectively in terms of the two, resources of virtual machine mapping is explained further
Feature.
One, multi dimensional resource attribute can not superimposed characteristics: as shown in Fig. 2, in classical bin packing, with Two-dimension Bin Packing Problem
For, the article in Fig. 2 (a) chest can be overlapped on horizontal and vertical position, however due in physical server
The resources such as CPU, memory, disk and I/O cannot be assigned to virtual machine VM2 simultaneously if being assigned to virtual machine VM1.Cause
This can only diagonally carry out non-superimposable vanning and place for virtual machine VM to the resource impact of physical server PM,
As shown in Fig. 2 (b).Wherein million grades of machine language instruction number MIPS of the unit of CPU processing per second is measured.In Fig. 2
Virtual machine instance and physical server are measured from two dimensions of memory and CPU for simplicity, in actual scene,
It is usually measured from tri- memory, CPU and network I/O dimensions, in this case, virtual machine instance should be according to pair of cube
Linea angulata direction carries out non-superimposable vanning and places.
Two, since virtual machine instance and physical server all have time attribute, as shown in Figure 3.Under normal conditions, divided
The remaining execution time for being fitted on multiple VM on same PM is different, and the time attribute of PM is executed with the longest run on it
The time of the VM of time is identical.In Fig. 3, before VM1 is not cased, the longest remaining time of the operation virtual machine on PM1 is
The longest remaining time of operation virtual machine on 5min, PM2 is 40min, at this point, the runing time of VM1 to be allocated is
60min.If VM1 is placed on PM1, the remaining operation duration of PM1 becomes 60min, if VM1 is placed on PM2,
Then the remaining operation duration of PM2 becomes 60min.If PM1 will transported in the case where without new VM arrival before VM1 distribution
After row 5min, it can shut down.PM2 will can be shut down after running 40min.Therefore, VM1 is placed on PM2 and is put with by VM1
It sets and is compared on PM1, although the laying method in Fig. 3 (a), the resource utilization of acquisition is higher, will from the point of view of time angle
VM1 is placed on PM2, and PM1 is shut down after 5min with better effect, is more advantageous to resource clustering, and be able to achieve section
It can consumption reduction.
Therefore, when formulating resources of virtual machine mapping policy, not only spatially to meet the constraint of multi dimensional resource attribute,
It also needs resource impact strategy to be formulated, to realize long-term resource using runing time as the considerations for carrying out tactful judgement
It is centrally placed, and the further saving of global energy consumption cost.Moreover, it is contemplated that arriving server stress and efficiency, we are for void
The mapping of quasi- machine should relative load equilibrium.
Fig. 1 shows the flow diagram of the virtual machine mapping method of one embodiment of the invention offer, as shown in Figure 1, this
The virtual machine mapping method of embodiment is as described below.
101, virtual machine to be allocated in virtual machine set is ranked up according to the size of opening time.
In a particular application, the present embodiment, which may be assumed that in cloud environment, initially n platform physical machine (i.e. physical server), physics
Machine collection is combined into (s1,s2,...,sn), the corresponding cpu of this n platform physical machine isCorresponding memory are as follows:Corresponding I/O are as follows:It may assume m platform virtual machine, virtual machine
Collection is combined into (v1,v2,...,vm) the corresponding cpu of this m platform virtual machine are as follows:Corresponding memory are as follows:Corresponding I/O are as follows:For every virtual machine, every
Virtual machine enabling time is t1, t2,...,tm, a sequence can be arranged to their time, it can be assumed that: t1≤t2≤....≤tm.。
It should be noted that the virtual machine collection in the present embodiment is combined into the set of all virtual machines to be allocated in cloud environment,
Physical machine collection is combined into the set of all physical machines to be cased in cloud environment.For the i-th (i=1...mi) secondary vanning, virtual machine
Collection is combined into (v1,v2,...,vmi), physical machine collection is combined into (s1,s2,...,sni), by virtual machine to be allocated in virtual machine set
Opening time according to ascending sequence are as follows: t1≤t2≤....≤tmi;It cases for the 1st time, n1=n, m1=m.
102, for opening time ascending kth in virtual machine set after sequenceiPlatform virtual machine to be allocated, judgement
With the presence or absence of jiMake jth in physical machine setiPlatform physical machine to be cased meets default vanning condition, wherein ki=1...mi, mi
For the quantity of virtual machine to be allocated in virtual machine set, ji=1...ni, niFor physical machine to be cased in physical machine set
Quantity.
It is understood that the present embodiment from after sequence in virtual machine set opening time ascending the 1st to point
The virtual machine matched starts to load.
In a particular application, the default vanning condition, may particularly include:
For ki, there are jiSimultaneously meet the condition of following (1)-(3) three (that is, in virtual machine set the 1st arrive kthiPlatform waits for
The virtual function of distribution is by jth in physical machine setiPlatform physical machine to be cased loads, and jiIt is not necessarily unique):
Wherein, p is to preset load balancing upper threshold value, 0 < p < 1,It is corresponding for the virtual machine to be allocated of u platform after sequence
Cpu,For the u platform corresponding memory of virtual machine to be allocated after sequence,For the void that u platform after sequence is to be allocated
The quasi- corresponding I/O of machine,For jth in physical machine setiThe corresponding cpu of platform physical machine to be cased,For physical machine collection
Jth in conjunctioniThe corresponding memory of platform physical machine to be cased,For jth in physical machine setiPlatform physical machine to be cased is corresponding
I/O;
And for ki+ 1, meet for jiAt least one condition is set up (that is, virtual machine set in following condition (4)-(6)
In the 1st arrive kthiPlatform virtual machine to be allocated just can be by jth in physical machine setiPlatform physical machine to be cased loads):
In a particular application, the value of p can select occurrence in (0,1) according to the actual situation, and the present embodiment is not
It is defined.
103, j if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets default vanning condition, and physics
There are at least two physical machines to be cased in machine set and meet default vanning condition, then calculates the institute for meeting default vanning condition
Need the utilization rate of physical machine cased, by the kthiPlatform virtual machine to be allocated puts into the maximum jth of utilization rateiPlatform is to be installed
In the physical machine of case.
In a particular application, " the j if it exists in the step 103i, make jth in physical machine setiPlatform object to be cased
Reason machine meets default vanning condition, and there are at least two physical machines to be cased in physical machine set and meet default vanning item
Part then calculates the utilization rate for meeting all physical machines to be cased of default vanning condition ", it can specifically include:
J if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets default vanning condition, and physical machine collection
There are the physical machines that α platform is to be cased in conjunctionMeeting default vanning condition, α is the positive integer greater than 1,
Then by the first formula, the utilization rate for meeting all physical machines to be cased of default vanning condition is calculated;
First formula are as follows:
Wherein, v=1... α,It is in physical machine setThe utilization rate of platform physical machine to be cased.
104, judge jth at this timeiWhether the efficiency of platform physical machine to be cased is higher than default load balancing lower threshold value.
In a particular application, the step 104 can specifically include:
If meeting the k of default vanning conditioniAnd ji, also meet any of following conditions (8)-(10) condition:
Then determine jth at this timeiThe efficiency of platform physical machine to be cased is higher than preset negative and carries balanced lower threshold value, wherein q is pre-
If load balancing lower threshold value, 0 < q < p < 1;
If meeting the k of default vanning conditioniAnd ji, also while meeting the condition of following (11)-(13) three:
Then determine jth at this timeiThe efficiency of platform physical machine to be cased carries balanced lower threshold value lower than preset negative.
In a particular application, the value of q can be specifically arranged according to the actual situation, and the present embodiment does not carry out it
It limits.
If 105, jth at this timeiThe efficiency of platform physical machine to be cased is higher than preset negative and carries balanced lower threshold value, it is determined that jthi
Platform physical machine to be cased is cased successfully, and jth will have been put intoiVirtual machine in platform physical machine to be cased is from virtual machine set
Removal, will case successful jthiPlatform physical machine to be cased is removed from physical machine set, returns to the step 101, until
Virtual machine quantity to be allocated is 0 in virtual machine set.
In a particular application, between above-mentioned steps 102-104, the method can also include:
Unique j if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets default vanning condition, will be described
KthiPlatform virtual machine to be allocated puts into the jthiIn platform physical machine to be cased.
In a particular application, after above-mentioned steps 104, the method can also include:
If jth at this timeiThe efficiency of platform physical machine to be cased carries balanced lower threshold value lower than preset negative, then it is virtual to search for calculating
In addition to having put into jth in machine setiK in platform physical machine to be casediResidue except platform virtual machine to be allocated is to be allocated
Jth can be put into virtual machineiVirtual machine to be allocated in platform physical machine to be cased, is put into jthiPlatform object to be cased
In reason machine, until search is less than can put into jthiVirtual machine to be allocated in platform physical machine to be cased, it is determined that jthiPlatform waits for
The physical machine of vanning is cased successfully, and jth will have been put intoiVirtual machine in platform physical machine to be cased is from virtual machine set
It removes, will case successful jthiPlatform physical machine to be cased is removed from physical machine set, and return is described will be in virtual machine set
The step of virtual machine to be allocated is ranked up according to the size of opening time, until virtual machine to be allocated in virtual machine set
Quantity is 0.
The virtual machine mapping method of the present embodiment, the ingenious bin packing by time-constrain so nondeterministic polynomial
Np problem turns to multiple linear programming problems using the method for time-sequencing packaging, and it is excellent dexterously to solve virtual machine mapping
Change;Based on memory, the bin packing under central processing unit cpu, input/output interface I/O three-dimensional constraining, increases time dimension
It constrains, virtual machine can reasonably be distributed with load balancing, new physical server is opened in realization less as far as possible, and simultaneously
Meet load balancing.The present embodiment the method also contemplates load balancing, in order to further avoid the waste of physical machine vacant land,
By binary search, the physical server that load is not up to lower threshold value is filled up as far as possible, more fully solve the time and born
Both balanced common constraint virtual machine is carried to distribute.
Fig. 4 shows a kind of structural schematic diagram of virtual machine mapping device of one embodiment of the invention offer, such as Fig. 4 institute
Show, the virtual machine mapping device of the present embodiment, comprising: sorting module 41, first judgment module 42, the first mapping block 43,
Two judgment modules 44 and removal module 45;Wherein:
Sorting module 41, for arranging virtual machine to be allocated in virtual machine set according to the size of opening time
Sequence;
First judgment module 42, for the kth ascending for the opening time in virtual machine set after sequenceiPlatform waits for point
The virtual machine matched, judges whether there is jiMake jth in physical machine setiPlatform physical machine to be cased meets default vanning condition,
In, ki=1...mi, miFor the quantity of virtual machine to be allocated in virtual machine set, ji=1...ni, niFor in physical machine set
The quantity of physical machine to be cased;
First mapping block 43, for j if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets default
Vanning condition, and there are at least two physical machines to be cased in physical machine set and meet default vanning condition, then calculate satisfaction
The utilization rate of all physical machines to be cased of default vanning condition, by the kthiPlatform virtual machine to be allocated puts into utilization rate
Maximum jthiIn platform physical machine to be cased;
Second judgment module 44, for judging jth at this timeiWhether the efficiency of platform physical machine to be cased is higher than default load
Balanced lower threshold value;
Module 45 is removed, if for jth at this timeiThe efficiency of platform physical machine to be cased is higher than preset negative and carries balanced lower threshold
Value, it is determined that jthiPlatform physical machine to be cased is cased successfully, and jth will have been put intoiVirtual machine in platform physical machine to be cased from
It is removed in virtual machine set, will case successful jthiPlatform physical machine to be cased is removed from physical machine set, described in return
Sorting module 41, until virtual machine quantity to be allocated in virtual machine set is 0;
Wherein, the virtual machine collection is combined into the set of all virtual machines to be allocated in cloud environment, the physical machine set
For the set of physical machines to be cased all in cloud environment.
In a particular application, the default vanning condition, may particularly include:
For ki, there are jiSimultaneously meet the condition of following (1)-(3) three (that is, in virtual machine set the 1st arrive kthiPlatform waits for
The virtual function of distribution is by jth in physical machine setiPlatform physical machine to be cased loads, and jiIt is not necessarily unique):
Wherein, p is to preset load balancing upper threshold value, 0 < p < 1,It is corresponding for the virtual machine to be allocated of u platform after sequence
Cpu,For the u platform corresponding memory of virtual machine to be allocated after sequence,For the void that u platform after sequence is to be allocated
The quasi- corresponding I/O of machine,For jth in physical machine setiThe corresponding cpu of platform physical machine to be cased,For physical machine collection
Jth in conjunctioniThe corresponding memory of platform physical machine to be cased,For jth in physical machine setiPlatform physical machine to be cased is corresponding
I/O;
And for ki+ 1, meet for jiAt least one condition is set up (that is, virtual machine set in following condition (4)-(6)
In the 1st arrive kthiPlatform virtual machine to be allocated just can be by jth in physical machine setiPlatform physical machine to be cased loads):
In a particular application, 0 < p < 1, p can select occurrence, this implementation to value in (0,1) according to the actual situation
Example is simultaneously not limited thereof.
In a particular application, described device can also include not shown in the figure:
Second mapping block, for unique j if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets pre-
If the condition of vanning, by the kthiPlatform virtual machine to be allocated puts into the jthiIn platform physical machine to be cased.
In a particular application, described device can also include not shown in the figure:
Third mapping block, if for jth at this timeiThe efficiency of platform physical machine to be cased carries balanced lower threshold lower than preset negative
Value is then searched for and is calculated in virtual machine set in addition to having put into jthiK in platform physical machine to be casediPlatform virtual machine to be allocated
Except residue virtual machine to be allocated in can put into jthiVirtual machine to be allocated in platform physical machine to be cased, is filled
Into jthiIn platform physical machine to be cased, until search is less than can put into jthiVoid to be allocated in platform physical machine to be cased
Quasi- machine, it is determined that jthiPlatform physical machine to be cased is cased successfully, and jth will have been put intoiVirtual machine in platform physical machine to be cased
It is removed from virtual machine set, will case successful jthiPlatform physical machine to be cased is removed from physical machine set, returns to institute
Sorting module is stated, until virtual machine quantity to be allocated in virtual machine set is 0.
It should be noted that for device/system embodiment, since it is basically similar to the method embodiment, so
It is described relatively simple, the relevent part can refer to the partial explaination of embodiments of method.
The virtual machine mapping device of the present embodiment, the ingenious bin packing by time-constrain so nondeterministic polynomial
Np problem turns to multiple linear programming problems using the method for time-sequencing packaging, and it is excellent dexterously to solve virtual machine mapping
Change;Based on memory, the bin packing under central processing unit cpu, input/output interface I/O three-dimensional constraining, increases time dimension
It constrains, virtual machine can reasonably be distributed with load balancing, new physical server is opened in realization less as far as possible, and simultaneously
Meet load balancing.The present embodiment the method also contemplates load balancing, in order to further avoid the waste of physical machine vacant land,
By binary search, the physical server that load is not up to lower threshold value is filled up as far as possible, more fully solve the time and born
Both balanced common constraint virtual machine is carried to distribute.
The virtual machine mapping device of the present embodiment, can be used for executing the technical solution of embodiment of the method shown in earlier figures 1,
That the realization principle and technical effect are similar is similar for it, and details are not described herein again.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence " including one ... ", it is not excluded that
There is also other identical elements in the process, method, article or apparatus that includes the element.Term " on ", "lower" etc.
The orientation or positional relationship of instruction is to be based on the orientation or positional relationship shown in the drawings, and is merely for convenience of the description present invention and letter
Change description, rather than the device or element of indication or suggestion meaning must have a particular orientation, with specific orientation construct and
Operation, therefore be not considered as limiting the invention.Unless otherwise clearly defined and limited, term " installation ", " connected ",
" connection " shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection, or be integrally connected;It can be
Mechanical connection, is also possible to be electrically connected;It can be directly connected, two can also be can be indirectly connected through an intermediary
Connection inside element.For the ordinary skill in the art, above-mentioned term can be understood at this as the case may be
Concrete meaning in invention.
In specification of the invention, numerous specific details are set forth.Although it is understood that the embodiment of the present invention can
To practice without these specific details.In some instances, well known method, structure and skill is not been shown in detail
Art, so as not to obscure the understanding of this specification.Similarly, it should be understood that disclose in order to simplify the present invention and helps to understand respectively
One or more of a inventive aspect, in the above description of the exemplary embodiment of the present invention, each spy of the invention
Sign is grouped together into a single embodiment, figure, or description thereof sometimes.However, should not be by the method solution of the disclosure
Release is in reflect an intention that i.e. the claimed invention requires more than feature expressly recited in each claim
More features.More precisely, as the following claims reflect, inventive aspect is less than single reality disclosed above
Apply all features of example.Therefore, it then follows thus claims of specific embodiment are expressly incorporated in the specific embodiment,
It is wherein each that the claims themselves are regarded as separate embodiments of the invention.It should be noted that in the absence of conflict, this
The feature in embodiment and embodiment in application can be combined with each other.The invention is not limited to any single aspect,
It is not limited to any single embodiment, is also not limited to any combination and/or displacement of these aspects and/or embodiment.And
And can be used alone each aspect and/or embodiment of the invention or with other one or more aspects and/or its implementation
Example is used in combination.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to
So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into
Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme should all cover within the scope of the claims and the description of the invention.
Claims (10)
1. a kind of virtual machine mapping method characterized by comprising
Virtual machine to be allocated in virtual machine set is ranked up according to the size of opening time;
For opening time ascending kth in virtual machine set after sequenceiPlatform virtual machine to be allocated, judges whether there is
jiMake jth in physical machine setiPlatform physical machine to be cased meets default vanning condition, wherein ki=1...mi, miFor virtual machine
The quantity of virtual machine to be allocated, j in seti=1...ni, niFor the quantity of physical machine to be cased in physical machine set;
J if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets default vanning condition, and in physical machine set
Meet default vanning condition in the presence of at least two physical machines to be cased, then calculates and meet all wait case of default vanning condition
Physical machine utilization rate, by the kthiPlatform virtual machine to be allocated puts into the maximum jth of utilization rateiPlatform physics to be cased
In machine;
Judge jth at this timeiWhether the efficiency of platform physical machine to be cased is higher than default load balancing lower threshold value;
If jth at this timeiThe efficiency of platform physical machine to be cased is higher than preset negative and carries balanced lower threshold value, it is determined that jthiPlatform waits casing
Physical machine case successfully, jth will have been put intoiVirtual machine in platform physical machine to be cased is removed from virtual machine set, will
It cases successful jthiPlatform physical machine to be cased is removed from physical machine set, and return is described will be to be allocated in virtual machine set
Virtual machine the step of being ranked up according to the size of opening time, until virtual machine quantity to be allocated in virtual machine set is
0;
Wherein, the virtual machine collection is combined into the set of all virtual machines to be allocated in cloud environment, and the physical machine collection is combined into cloud
The set of all physical machines to be cased in environment.
2. the method according to claim 1, wherein the default vanning condition, comprising:
For ki, there are jiMeet following three conditions simultaneously:
Wherein, p is to preset load balancing upper threshold value, 0 < p < 1,It is corresponding for the virtual machine to be allocated of u platform after sequence
Cpu,For the u platform corresponding memory of virtual machine to be allocated after sequence,For to be allocated virtual of u platform after sequence
The corresponding I/O of machine,For jth in physical machine setiThe corresponding cpu of platform physical machine to be cased,For physical machine set
Middle jthiThe corresponding memory of platform physical machine to be cased,For jth in physical machine setiPlatform physical machine to be cased is corresponding
I/O;
And for ki+ 1, meet for jiAt least one condition is set up in following conditions:
3. according to the method described in claim 2, it is characterized in that, judging whether there is j describediMake in physical machine set
jiAfter platform physical machine to be cased meets default vanning condition, jth at this time is judged describediThe effect of platform physical machine to be cased
Whether rate is higher than before default load balancing lower threshold value, the method also includes:
Unique j if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets default vanning condition, by the kthi
Platform virtual machine to be allocated puts into the jthiIn platform physical machine to be cased.
4. according to the method described in claim 2, it is characterized in that, the j if it existsi, make jth in physical machine setiPlatform is to be installed
The physical machine of case meets default vanning condition, and there are at least two physical machines to be cased in physical machine set and meet default dress
Case condition then calculates the utilization rate for meeting all physical machines to be cased of default vanning condition, comprising:
J if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets default vanning condition, and in physical machine set
There are α platform physical machines to be casedMeet default vanning condition, α is the positive integer greater than 1, then leads to
The first formula is crossed, the utilization rate for meeting all physical machines to be cased of default vanning condition is calculated;
First formula are as follows:
Wherein, v=1 ... α,It is in physical machine setThe utilization rate of platform physical machine to be cased.
5. according to the method described in claim 2, it is characterized in that, described judge jth at this timeiThe effect of platform physical machine to be cased
Whether rate is higher than default load balancing lower threshold value, comprising:
If meeting the k of default vanning conditioniAnd ji, also meet any of following conditions condition:
Then determine jth at this timeiThe efficiency of platform physical machine to be cased is higher than preset negative and carries balanced lower threshold value, wherein q is preset negative
Carry balanced lower threshold value, 0 < q < p < 1;
If meeting the k of default vanning conditioniAnd ji, also while meeting following three conditions:
Then determine jth at this timeiThe efficiency of platform physical machine to be cased carries balanced lower threshold value lower than preset negative.
6. according to the method described in claim 2, it is characterized in that, judging jth at this time describediPlatform physical machine to be cased
Whether efficiency is higher than after default load balancing lower threshold value, the method also includes:
If jth at this timeiThe efficiency of platform physical machine to be cased carries balanced lower threshold value lower than preset negative, then searches for and calculate virtual machine collection
In addition to having put into jth in conjunctioniK in platform physical machine to be casediResidue except platform virtual machine to be allocated is to be allocated virtual
Jth can be put into machineiVirtual machine to be allocated in platform physical machine to be cased, is put into jthiPlatform physical machine to be cased
In, until search is less than can put into jthiVirtual machine to be allocated in platform physical machine to be cased, it is determined that jthiPlatform waits casing
Physical machine case successfully, jth will have been put intoiVirtual machine in platform physical machine to be cased is removed from virtual machine set, will
It cases successful jthiPlatform physical machine to be cased is removed from physical machine set, and return is described will be to be allocated in virtual machine set
Virtual machine the step of being ranked up according to the size of opening time, until virtual machine quantity to be allocated in virtual machine set is
0。
7. a kind of virtual machine mapping device characterized by comprising
Sorting module, for virtual machine to be allocated in virtual machine set to be ranked up according to the size of opening time;
First judgment module, for the kth ascending for the opening time in virtual machine set after sequenceiPlatform void to be allocated
Quasi- machine, judges whether there is jiMake jth in physical machine setiPlatform physical machine to be cased meets default vanning condition, wherein ki
=1...mi, miFor the quantity of virtual machine to be allocated in virtual machine set, ji=1...ni, niFor in physical machine set wait case
Physical machine quantity;
First mapping block, for j if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets default vanning item
Part, and there are at least two physical machines to be cased in physical machine set and meet default vanning condition, then calculate the default dress of satisfaction
The utilization rate of all physical machines to be cased of case condition, by the kthiIt is maximum that platform virtual machine to be allocated puts into utilization rate
JthiIn platform physical machine to be cased;
Second judgment module, for judging jth at this timeiWhether the efficiency of platform physical machine to be cased is higher than under default load balancing
Threshold value;
Module is removed, if for jth at this timeiThe efficiency of platform physical machine to be cased is higher than preset negative and carries balanced lower threshold value, it is determined that
JthiPlatform physical machine to be cased is cased successfully, and jth will have been put intoiVirtual machine in platform physical machine to be cased is from virtual machine collection
It is removed in conjunction, will case successful jthiPlatform physical machine to be cased is removed from physical machine set, returns to the sorting module,
Until virtual machine quantity to be allocated in virtual machine set is 0;
Wherein, the virtual machine collection is combined into the set of all virtual machines to be allocated in cloud environment, and the physical machine collection is combined into cloud
The set of all physical machines to be cased in environment.
8. device according to claim 7, which is characterized in that the default vanning condition, comprising:
For ki, there are jiMeet following three conditions simultaneously:
Wherein, p is to preset load balancing upper threshold value, 0 < p < 1,It is corresponding for the virtual machine to be allocated of u platform after sequence
Cpu,For the u platform corresponding memory of virtual machine to be allocated after sequence,For to be allocated virtual of u platform after sequence
The corresponding I/O of machine,For jth in physical machine setiThe corresponding cpu of platform physical machine to be cased,For physical machine set
Middle jthiThe corresponding memory of platform physical machine to be cased,For jth in physical machine setiPlatform physical machine to be cased is corresponding
I/O;
And for ki+ 1, meet for jiAt least one condition is set up in following conditions:
9. device according to claim 8, which is characterized in that described device further include:
Second mapping block, for unique j if it existsi, make jth in physical machine setiPlatform physical machine to be cased meets default dress
Case condition, by the kthiPlatform virtual machine to be allocated puts into the jthiIn platform physical machine to be cased.
10. device according to claim 8, which is characterized in that described device further include:
Third mapping block, if for jth at this timeiThe efficiency of platform physical machine to be cased carries balanced lower threshold value lower than preset negative, then
Search calculates in virtual machine set in addition to having put into jthiK in platform physical machine to be casediExcept platform virtual machine to be allocated
Jth can be put into remaining virtual machine to be allocatediVirtual machine to be allocated in platform physical machine to be cased, is put into jthi
In platform physical machine to be cased, until search is less than can put into jthiVirtual machine to be allocated in platform physical machine to be cased,
Then determine jthiPlatform physical machine to be cased is cased successfully, and jth will have been put intoiVirtual machine in platform physical machine to be cased is from void
It is removed in quasi- machine set, will case successful jthiPlatform physical machine to be cased is removed from physical machine set, returns to the row
Sequence module, until virtual machine quantity to be allocated in virtual machine set is 0.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610805268.1A CN106469092B (en) | 2016-09-06 | 2016-09-06 | Virtual machine mapping method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610805268.1A CN106469092B (en) | 2016-09-06 | 2016-09-06 | Virtual machine mapping method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106469092A CN106469092A (en) | 2017-03-01 |
CN106469092B true CN106469092B (en) | 2019-11-12 |
Family
ID=58230552
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610805268.1A Active CN106469092B (en) | 2016-09-06 | 2016-09-06 | Virtual machine mapping method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106469092B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103576827A (en) * | 2012-07-25 | 2014-02-12 | 田文洪 | Method and device of online energy-saving dispatching in cloud computing data center |
CN103778020A (en) * | 2014-02-08 | 2014-05-07 | 中国联合网络通信集团有限公司 | Virtual machine placing method and device |
CN104503826A (en) * | 2015-01-04 | 2015-04-08 | 中国联合网络通信集团有限公司 | Virtual machine mapping method and device for cloud computing data center |
CN105786619A (en) * | 2016-02-24 | 2016-07-20 | 中国联合网络通信集团有限公司 | Virtual machine distribution method and device |
CN105847385A (en) * | 2016-04-20 | 2016-08-10 | 南京邮电大学 | Cloud computing platform virtual machine dispatching method based on operation duration |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5767480B2 (en) * | 2011-01-31 | 2015-08-19 | インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation | Information processing apparatus, information processing system, arrangement configuration determining method, program, and recording medium |
-
2016
- 2016-09-06 CN CN201610805268.1A patent/CN106469092B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103576827A (en) * | 2012-07-25 | 2014-02-12 | 田文洪 | Method and device of online energy-saving dispatching in cloud computing data center |
CN103778020A (en) * | 2014-02-08 | 2014-05-07 | 中国联合网络通信集团有限公司 | Virtual machine placing method and device |
CN104503826A (en) * | 2015-01-04 | 2015-04-08 | 中国联合网络通信集团有限公司 | Virtual machine mapping method and device for cloud computing data center |
CN105786619A (en) * | 2016-02-24 | 2016-07-20 | 中国联合网络通信集团有限公司 | Virtual machine distribution method and device |
CN105847385A (en) * | 2016-04-20 | 2016-08-10 | 南京邮电大学 | Cloud computing platform virtual machine dispatching method based on operation duration |
Also Published As
Publication number | Publication date |
---|---|
CN106469092A (en) | 2017-03-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102981910B (en) | The implementation method of scheduling virtual machine and device | |
CN104516768B (en) | The real-time migration of virtualization system | |
Schaller et al. | SWIFT: Using task-based parallelism, fully asynchronous communication, and graph partition-based domain decomposition for strong scaling on more than 100,000 cores | |
CN106254166A (en) | A kind of cloud platform resource allocation method based on Disaster Preparation Center and system | |
CN103970607A (en) | Computing Optimized Virtual Machine Allocations Using Equivalence Combinations | |
CN104167736A (en) | Large power grid parallel network topology analyzing method | |
CN102932279A (en) | Multidimensional resource scheduling system and method for cloud environment data center | |
CN102694868A (en) | Cluster system implementation and task dynamic distribution method | |
CN103870455A (en) | Multi-data-source data integrated processing method and device | |
CN106445629A (en) | Load balancing method and device | |
CN109254836B (en) | Deadline constraint cost optimization scheduling method for priority dependent tasks of cloud computing system | |
CN103577896B (en) | A kind of region partitioning method of large scale electric network adaptive setting | |
CN103823709B (en) | System of virtual cluster, resource allocation methods and management node | |
CN103514046A (en) | Virtual machine placement method and cluster management server | |
CN104699946A (en) | Game scene management method and device | |
CN104753977A (en) | Seismic processing and interpretation infrastructure cloud resource scheduling method based on fuzzy clustering | |
CN106201693A (en) | Dispatching method in a kind of virtualized environment and system | |
Padoin et al. | Saving energy by exploiting residual imbalances on iterative applications | |
WO2015188504A1 (en) | Data centre solution method for decomposition-coordination calculation of block bordered diagonal frame model | |
CN108874508A (en) | A kind of cloud computing virtual server system load equilibration scheduling method | |
CN102147813A (en) | Method for automatically classifying documents based on K nearest neighbor algorithm under power cloud environment | |
CN106156049A (en) | A kind of method and system of digital independent | |
Burstedde et al. | Towards adaptive mesh PDE simulations on petascale computers | |
CN106469092B (en) | Virtual machine mapping method and device | |
CN104299170B (en) | Intermittent energy source mass data processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |