CN107621980A - A kind of virtual machine migration method, cluster control system and control device - Google Patents

A kind of virtual machine migration method, cluster control system and control device Download PDF

Info

Publication number
CN107621980A
CN107621980A CN201610551130.3A CN201610551130A CN107621980A CN 107621980 A CN107621980 A CN 107621980A CN 201610551130 A CN201610551130 A CN 201610551130A CN 107621980 A CN107621980 A CN 107621980A
Authority
CN
China
Prior art keywords
cluster
virtual machine
migration
emplacement
resource
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.)
Pending
Application number
CN201610551130.3A
Other languages
Chinese (zh)
Inventor
张勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610551130.3A priority Critical patent/CN107621980A/en
Publication of CN107621980A publication Critical patent/CN107621980A/en
Pending legal-status Critical Current

Links

Abstract

A kind of virtual machine migration method, cluster control system and control device, methods described include following virtual machine (vm) migration processing procedure:According to the resource information of the cluster to have put into operation, determine new placement mode of the virtual machine in physical machine in the cluster, wherein, former modes of emplacement of resources of virtual machine information, physical machine resource information and the virtual machine of the resource information including the cluster in physical machine, the resource fragmentation of the cluster is less than the resource fragmentation of the cluster under former modes of emplacement under the new placement mode;According to the new placement mode, virtual machine (vm) migration is carried out between different physical machines.The cluster control system includes inventory management module and migration process module.Application scheme fully integrates the resource fragmentation in the cluster to have put into production so that the resource of cluster is fully used.

Description

A kind of virtual machine migration method, cluster control system and control device
Technical field
The present invention relates to computer cluster (referred to as cluster), more particularly, to the virtual machine migration method in cluster, Cluster control system and control device.
Background technology
Infrastructure i.e. service in cloud computing is a kind of physical resource using bottom as the resource pool of an entirety, base In this resource pool by virtualization technology, with software come define calculate, storage Internet resources, cutting and whole can be done to resource Close, with it is flexible, supermatic, fully effectively use physical resource, and this resource is sold to user as service sale Use.
In this mode, multiple virtual machines can be created in a physical machine, these virtual machines can be according to the need of user Be customized to different resource specifications, such as 2 core cpu, 4G memory sizes, among these how the specification asked according to random user Become a challenge reasonably to place virtual machine in physical machine.Common business cloud computing platform can select relatively rough Solution (referring both to computer cluster in text) so that cluster, interior physical resource can have fragment after dispensing, such as multiple The all remaining certain space of physical machine resource such as 2 core 4G, but the Virtual Space of 4 core 8G specifications of user's request can not be distributed, Cause the wasting of resources.
Another commonplace situation is, in order to make full use of physical resource, reduces cost, a usual business cloud Calculating platform can all put into production the physical resource in cluster, establishment virtual machine as much as possible.And it is limited to network rack Structure, have no idea to increase physical resource newly in cluster.But physical machine has the machine of delaying of certain probability, delay after machine to protect Card service is, it is necessary to the virtual machine of migrated userses, if cluster resource fragment is a lot, even if the total amount of surplus resources is enough, also without Method recovers the former virtual machine delayed in machine physical machine, triggers failure.In addition, existing virtual machine has the need of upgrading specification in cluster Ask, such as 2 core cpu, 4G memory upgrades are to 4 core cpu, 8G internal memories, if resource fragmentation is a lot.No Assets upgrading can equally be faced Problem, have a strong impact on that user uses.
Under the above situation, the resource of one side cluster causes to waste due to the presence of fragment, and still further aspect is due to thing Reason machine delays machine or user needs to upgrade specification and can use without resource.One business cloud computing platform is in cluster and virtual machine Scale can face this problem after reaching to a certain degree, how ensure that the cluster resource that storage has put into production maximizes use And service quality is can guarantee that, it is a very stubborn problem.And for the product of a resource-hungry, each cloud meter Cost is reduced as far as possible using production cost as an extremely important Consideration, pole between calculation platform vendor, so this Individual problem is had in face of solving the problems, such as.
The problem of similar all be present for other computer clusters that scheduling of resource be present.
The content of the invention
In view of this, the invention provides following scheme.
A kind of virtual machine migration method, including following virtual machine (vm) migration processing procedure:
According to the resource information of the cluster to have put into operation, new placement of the virtual machine in physical machine in the cluster is determined Mode, wherein, the resource information includes resources of virtual machine information, physical machine resource information and the virtual machine of the cluster in thing Former modes of emplacement on reason machine, the resource fragmentation of the cluster is less than the cluster under former modes of emplacement under the new placement mode Resource fragmentation;
According to the new placement mode, virtual machine (vm) migration is carried out between different physical machines.
A kind of cluster control system, including inventory management module and migration process module, wherein:
The inventory management module, for managing the resource information of the cluster to have put into operation, the resource information includes Modes of emplacement of the resources of virtual machine information, physical machine resource information and virtual machine of the cluster in physical machine;
The migration process module includes:
Resource fragmentation sorting module, for determining that virtual machine is in physical machine in the cluster according to the resource information New placement mode, wherein, the resource fragmentation of the cluster is less than the cluster under former modes of emplacement under the new placement mode Resource fragmentation;
Task execution module is migrated, for according to the new placement mode, progress virtual machine to move between different physical machines Move.
A kind of clustered control device, including CPU and memory, wherein:
The memory is used for save routine code;
The CPU is used to read described program code from the memory, performs following virtual machine (vm) migration processing:According to The resource information of the cluster to put into operation, determine new placement mode of the virtual machine in physical machine in the cluster;According to described New placement mode, virtual machine (vm) migration is carried out between different physical machines;Wherein, the resource information includes the virtual of the cluster The former modes of emplacement of machine resource information, physical machine resource information and virtual machine in physical machine, it is described under the new placement mode The resource fragmentation of cluster is less than the resource fragmentation of the cluster under former modes of emplacement.
Such scheme fully integrates the resource fragmentation in the cluster to have put into production so that the resource of cluster obtains abundant profit With available for meeting that physical machine delays after machine and can have resource to be used to recover virtual machine, while meeting that the upgrading of user's needs such as configures at the field Scape.
Brief description of the drawings
Fig. 1 is the flow chart of the virtual machine migration method of the embodiment of the present invention one;
Fig. 2 is the module map of the cluster control system of the embodiment of the present invention two;
Fig. 3 is the structural representation of cloud computing platform in example of the present invention;
Fig. 4 is the schematic diagram of the migration task subgraph of example of the present invention.
Embodiment
For the object, technical solutions and advantages of the present invention are more clearly understood, below in conjunction with accompanying drawing to the present invention Embodiment be described in detail.It should be noted that in the case where not conflicting, in the embodiment and embodiment in the application Feature can mutually be combined.
Embodiment one
In order to realize the arrangement to cluster resource fragment, the present embodiment provides a kind of virtual machine migration method, the present embodiment Cluster be cloud computing platform in computer cluster, but the present invention be not limited to this or other there is scheduling of resource The computer cluster of function.
As shown in figure 1, the virtual machine migration method of the present embodiment includes following virtual machine (vm) migration processing procedure:
Step 110, according to the resource information of the cluster to have put into operation, determine that virtual machine is in physical machine in the cluster New placement mode, the resource fragmentation of the cluster is less than the resource of the cluster under former modes of emplacement under the new placement mode Fragment;
The resource information of the cluster used in this step can obtain from the database of cluster, empty in the cluster got Modes of emplacement of the plan machine in physical machine is " former modes of emplacement ".
In the present embodiment, the resource information of cluster includes resources of virtual machine information, the physical machine resource information of the cluster And former modes of emplacement of the virtual machine in physical machine, wherein, resources of virtual machine information includes the physical resource letter that virtual machine uses Breath, the specification of virtual machine is corresponding with the physical resource that it is used, and the virtual machine of such as a certain specification is needed to use in 2 core cpu, 4G Deposit, and the virtual machine of another specification needs to use 32 core cpu, 32G internal memories etc..Resources of virtual machine information can also include software and provide Source information, such as the category of image of virtual machine, mirror image refers to the operating system file for creating and being specified during virtual machine, and some support migration, Sometimes do not support to migrate.Resource fragmentation is reduced and can weighed with the quantity of the virtual machine for a certain specification that can be created in cluster Amount, the increasing number of the virtual machine for the specification that can such as create, then it represents that the resource fragmentation in cluster is reduced.
In the present embodiment, according to the resource information of the cluster to have put into operation, determine that virtual machine is in physics in the cluster New placement mode on machine, including:Determined according to the resource information to placement of the virtual machine in physical machine in the cluster The constraints of mode, the cluster under former modes of emplacement is less than with reference to the resource fragmentation of the cluster under the new placement mode Resource fragmentation requirement, a kind of modes of emplacement is selected from the modes of emplacement for meeting the constraints, as described new Modes of emplacement.
When specifically chosen, there is the method that can much use, for example, the various possible placements that constraints will be met The indexs such as the migration amount that mode is listed and calculates the quantity of resource fragmentation under these modes of emplacements, needs, therefrom select one Meet desired modes of emplacement, during selection, it may be considered that the quantity of resource fragmentation, migration amount can also be considered simultaneously, born The other factors such as lotus.For large-scale cluster, combinatorial optimization algorithm can be used to solve, one of the combinatorial optimization algorithm Xie represents a kind of modes of emplacement of the virtual machine in physical machine in the cluster, during solution, using the constraints as described in The constraint of the solution of combinatorial optimization algorithm, the combinatorial optimization algorithm is determined according to the requirement for making the cluster resource fragment minimum Object function, the optimal solution obtained is as the new placement mode.Although the present embodiment be in the hope of optimal solution be used as described in New placement mode, but the invention is not limited in this or suboptimal solution, secondary suboptimal solution etc. it is any meet require solution, because It may need to combine the factors such as the load sharing of migration amount, physical machine to consider for user.
In the present embodiment, the constraints of modes of emplacement is included:The representative modes of emplacement of each solution all should Meet one or more of condition:
Under the modes of emplacement, to each physical resource, each physical machine distributes to the physical resource that virtual machine uses No more than the upper limit of the physical resource of the physical machine;Wherein, source physical machine refers to virtual machine where under the former modes of emplacement Physical machine, target physical machine refer to virtual machine under the new placement mode where physical machine.
, it is necessary to which the category of image of each virtual machine of migration is supported when the modes of emplacement is different from the former modes of emplacement Migration;
, it is necessary to the CPU of the source physical machine of each virtual machine of migration when the modes of emplacement is different from the former modes of emplacement Model is consistent with the CPU models of target physical machine;
Under the modes of emplacement, the virtual machine of any specification created to needs in the cluster can be in the cluster The maximum number of the specification virtual machine created is not less than the minimal amount thresholding of respective settings.
In the present embodiment, the object function is represented with the variance of a class value, and the optimal solution is so that variance maximum Solution, wherein, a class value is made up of the value for having distributed physical resource of each physical machine in the cluster, described to have distributed The value of physical resource is the value of single one physical resource, or is to be obtained after normalized is done to the value of a variety of physical resources Value.
It is when being solved using combinatorial optimization algorithm, the former modes of emplacement is excellent as the combination in the present embodiment Change the initial solution of algorithm.Approached as far as possible between the optimal solution and initial solution that can so to try to achieve, reduce subsequent migration task Quantity.
Step 120, according to the new placement mode, virtual machine (vm) migration is carried out between different physical machines;
It is described to carry out virtual machine (vm) migration between different physical machines in the present embodiment, including:
It is determined that the migration task to be performed, each migration task includes virtual machine, source physical machine and the object that need to be migrated Reason machine;
The execution sequence of the migration task is determined, wherein, the source physical machine of a migration task is another migration task During target physical machine, the migration task is prior to another migration tasks carrying;
The migration task is performed according to the execution sequence.
If when the source physical machine of a migration task is the target physical machine of another migration task, first carries out this and another move Shifting task, it is possible to migrate failure because of the target physical machine inadequate resource of another migration task.First carry out the migration After task, the resource of the target physical machine of another migration task is reclaimed, it is possible to successful execution another migration task .
In the present embodiment, the virtual machine (vm) migration when by the way of migrating online, in order to ensure the service of whole cluster Quality, it is undesirable to the situation for having multiple virtual machines simultaneously in migration in same physical machine occur, determine that the migration is appointed During the execution sequence of business, one or more of rule is also followed:When the source physical machine of multiple migration tasks is identical, perform successively The multiple migration task;When the target physical machine of multiple migration tasks is identical, the multiple migration task is performed successively.To When there is no sequence requirement between multiple migration tasks, in order to improve efficiency, then the multiple migration task is performed with concurrent fashion.
In the present embodiment, above-mentioned virtual machine (vm) migration processing procedure can also specify triggering with clocked flip according to user, Can also be by the way of event triggering.For example, the virtual machine of any specification created to needs, according to the resource information and The resource requirement of the specification virtual machine, it is determined that the maximum number for the specification virtual machine that can be also created in the cluster, such as institute The minimal amount thresholding that maximum number is less than respective settings is stated, triggers the virtual machine (vm) migration processing.Cluster can so be ensured There is sufficient amount of resource to create new virtual machine, ensure the reliability of cluster, also excessively will not continually be migrated.
The present embodiment method fully integrates the resource fragmentation in the cluster to have put into production so that the resource of cluster is filled Point utilize, available for meeting that physical machine delays after machine and there can be resource to be used to recover virtual machine, while meet that the upgrading of user's needs configures Etc. scene.
Embodiment two
A kind of cluster control system is present embodiments provided, as shown in Fig. 2 including inventory management module 10 and migration process Module 20, wherein:
The inventory management module 10 is used for the resource information for managing the cluster to have put into operation, and the resource information includes Modes of emplacement of the resources of virtual machine information, physical machine resource information and virtual machine of the cluster in physical machine;
The migration process module 20 includes:
Resource fragmentation sorting module 201, for determining that virtual machine is in physical machine in the cluster according to the resource information On new placement mode, wherein, under the new placement mode resource fragmentation of the cluster be less than former modes of emplacement under the collection The resource fragmentation of group;
Task execution module 202 is migrated, for according to the new placement mode, virtual machine to be carried out between different physical machines Migration.
Alternatively,
The resource fragmentation sorting module includes:
Constraints determining unit, for being determined according to the resource information to virtual machine in the cluster in physical machine Modes of emplacement constraints;
Modes of emplacement selecting unit, for according to the constraints, with reference to the cluster under the new placement mode Resource fragmentation is less than the requirement of the resource fragmentation of the cluster under former modes of emplacement, from the modes of emplacement for meeting the constraints In select a kind of modes of emplacement, as the new placement mode.
Alternatively,
The modes of emplacement selecting unit selects a kind of modes of emplacement from the modes of emplacement for meeting the constraints, As the new placement mode, including:
Solved using combinatorial optimization algorithm, a solution of the combinatorial optimization algorithm represents in the cluster virtual machine in thing A kind of modes of emplacement on reason machine, during solution, the constraint using the constraints as the solution of the combinatorial optimization algorithm, according to The requirement for making the cluster resource fragment minimum determines the object function of the combinatorial optimization algorithm, and the optimal solution obtained is as institute State new placement mode.
Alternatively,
The constraints to modes of emplacement that the constraints determining unit determines includes one or more of Condition:
Under the modes of emplacement, to each physical resource, each physical machine distributes to the physical resource that virtual machine uses No more than the upper limit of the physical resource of the physical machine;
, it is necessary to which the category of image of each virtual machine of migration is supported when the modes of emplacement is different from the former modes of emplacement Migration;
, it is necessary to the CPU of the source physical machine of each virtual machine of migration when the modes of emplacement is different from the former modes of emplacement Model is consistent with the CPU models of target physical machine;
Under the modes of emplacement, the virtual machine for any specification that needs are created, the specification that can be created in the cluster The maximum number of virtual machine is not less than the minimal amount thresholding of respective settings.
Alternatively,
The object function that the modes of emplacement selecting unit determines represents that the optimal solution is with the variance of a class value So that the solution that the variance is maximum, wherein, a class value by each physical machine in the cluster the value for having distributed physical resource Composition, the value for having distributed physical resource are the value of single one physical resource, or to do normalizing to the value of a variety of physical resources The value obtained after change processing.
Alternatively,
The inventory management module is additionally operable to the virtual machine of any specification created to needs, according to the resource information and The resource requirement of the specification virtual machine, it is determined that the maximum number for the specification virtual machine that can be also created in the cluster, such as institute The minimal amount thresholding that maximum number is less than respective settings is stated, the migration process module is triggered and carries out migration process.
Alternatively,
The migration task execution module includes:
Migration task determining unit, for determining the migration task to be performed, the migration task includes the void that need to be migrated Plan machine, source physical machine and the target physical machine different from source physical machine;
Execution sequence determining unit, for determining the execution sequence of the migration task, wherein, the source thing of a migration task When reason machine is the target physical machine of another migration task, the migration task is prior to another migration tasks carrying;
Task executing units are migrated, for performing the migration task according to the execution sequence.
Alternatively,
The migration task executing units perform the migration task by the way of migrating online;
When the execution sequence determining unit determines the execution sequence of the migration task, one or more of is also followed Rule:When the source physical machine of multiple migration tasks is identical, the multiple migration task is performed successively;The target of multiple migration tasks When physical machine is identical, the multiple migration task is performed successively.
Embodiment three
The present embodiment provides one kind, including CPU and memory, wherein:
The memory is used for save routine code;
The CPU is used to read described program code from the memory, performs following virtual machine (vm) migration processing:According to The resource information of the cluster to put into operation, determine new placement mode of the virtual machine in physical machine in the cluster;According to described New placement mode, virtual machine (vm) migration is carried out between different physical machines;Wherein, the resource information includes the virtual of the cluster The former modes of emplacement of machine resource information, physical machine resource information and virtual machine in physical machine, it is described under the new placement mode The resource fragmentation of cluster is less than the resource fragmentation of the cluster under former modes of emplacement.
In the present embodiment, virtual machine (vm) migration processing procedure that the CPU is performed can be with any for being limited in embodiment one Virtual machine (vm) migration processing is identical.
This explanation is illustrated below by the example in several applications.
Fig. 3 is the architecture schematic diagram for the cloud computing platform that this example is applied to.As illustrated, cloud computing platform bag Include:
API (Application Programming Interface, application programming interface):It is responsible for receiving, explains User creates, discharged, the request of operation virtual machine.
Cluster control system (central controller), it is responsible for operation requests of the processing user to virtual machine, completes to create virtually The request of machine, newly-built information unification is saved in database, while manages the uniformity of resource data.In this example, the control Device is additionally operable to realize that virtual machine (vm) migration is handled.
Physical machine, it is responsible for passing through virtual machine tool management virtual machine, virtual machine is specifically run in physical machine.
Other modules, such as scheduling manager can also be included in cluster control system:For determining virtual machine creating Onto which platform physical machine.
Cluster control system in this example uses the cluster control system of embodiment two, no longer illustrates one by one here.Its In resource fragmentation sorting module to determine that virtual machine is in thing in the cluster according to the resource information of the cluster to have put into operation New placement mode on reason machine, the resource fragmentation of the cluster under the new placement mode is set to be less than the collection under former modes of emplacement The resource fragmentation of group.
How to optimize and place virtual machine so that optimal utilization space is a Combinatorial Optimization (Combinatorial Optimization) problem, the target of combinatorial optimization problem is from the set of feasible solution of combinatorial problem, is obtained according to object function Optimal solution, it is an important branch of operational research.This example performs combinatorial optimization algorithm using optplanner solvers, but Other Combinatorial Optimization solvers can also be replaced with.
When being solved using combinatorial optimization algorithm, the parameter of correlation with advanced row mathematical modeling, can be defined, such as physical machine collection Conjunction, virtual machine set, resource category set, support virtual machine migrate online mirror image set, physical machine the set of CPU models and The specification set of virtual machine, virtual machine specification need the size for the various resources distributed;To each virtual machine, the mesh of the virtual machine Mark physical machine, source physical machine, the size of various resources for needing to distribute, category of image used (including are supported migration and not propped up Hold two kinds of migration);To each physical machine, the upper limits of the various resources that the physical machine possesses, CPU models etc..Resource therein Including cpu resource and RAM resources, the size of cpu resource can use how many kernel representation, and such as 32 cores, the size of RAM resources can be used How many individual G represent, such as 100G.
In this example, a solution of the combinatorial optimization algorithm represents the one kind of virtual machine in physical machine in the cluster Modes of emplacement.In this example, the representative modes of emplacement of each solution all should meet to include one or more of condition:
1) under the modes of emplacement, to each physical resource, each physical machine distributes to the physics money that virtual machine uses The upper limit of the source no more than the physical resource of the physical machine;
2), it is necessary to which the category of image of each virtual machine of migration props up when the modes of emplacement is different from the former modes of emplacement Hold migration;
3), it is necessary to the source physical machine of each virtual machine of migration when the modes of emplacement is different from the former modes of emplacement CPU models are consistent with the CPU models of target physical machine;
4) under the modes of emplacement, the virtual machine of any specification created to needs in the cluster can be in the cluster The maximum number of the specification virtual machine of middle establishment is not less than the minimal amount thresholding of respective settings.Wherein can be in the cluster The maximum number of the specification virtual machine created is the number for the specification virtual machine that can be at most created in all physical machines in cluster Mesh sum.
It is how virtual machine is rationally placed in physical machine in view of what combinatorial optimization algorithm to be solved, so that in cluster Resource fragmentation is minimum.In this example, the object function of combinatorial optimization algorithm represents that the optimal solution is to make with the variance of a class value Obtain the maximum solution of the variance.One class value is made up of the value for having distributed physical resource of each physical machine in the cluster, institute The value for having distributed the value of physical resource as single one physical resource is stated, or is after doing normalized to the value of a variety of physical resources Obtained value.
In this example, the value of the value of cpu resource and RAM resources is done into normalized, obtained value is as physical machine The value for having distributed physical resource, corresponding object function represents as follows:
ResourceVariance=D (r.cpu/targe+r.ram)
Wherein:
ResourceVariance is object function;
R.cpu represents the value for having distributed cpu resource of physical machine;
R.ram represents the value for having distributed RAM resources of physical machine;
Target represents the cpu resource of physical machine and the ratio of RAM resources, and cpu resource therein and RAM resources are physics The resource that machine has in itself;
R.cpu/targe+r.ram represents the value after normalized;
D (r.cpu/targe+r.ram) represents to ask the variance of a class value, and a class value is that each physical machine is returned in cluster What the value after one change processing formed.
The optimal solution of the combinatorial optimization algorithm is just so that the maximum solution of party's difference.Because the big expression of resource variance, use Few physical machine carries existing virtual machine as far as possible, thus indicates that resource fragmentation is less.Because variance is bigger, illustrate this class value Fluctuation it is bigger, that is to say, that or the value close to the physical machine resource upper limit, or how the value does not consume close to 0.So Resource occupation can be allowed to focus in a few physical machine.For example, it is all 16 cores there are 5 physical machines, 5 are carried virtually Machine, and virtual machine is all 4 cores, it is a kind of distribution mode that this 5 virtual machines are distributed to 1 physical machine respectively, draws and has used CPU Variance yields A;Another distribution is to focus on 4 in 1 physical machine, is left one in an other physical machine, this Mode draws variance yields B, and B is calculated and is greater than A, because first way is average, does not fluctuate.At this moment user wants to create Build the virtual machine of 16 cores of one big specification, then only second of method of salary distribution meets to require.
In addition, when being solved, the most probable solution space of the problem by structure of solution space, can be constructed, reduces meter Calculation amount.In this example, the virtual machine information on the physics machine information and every physical machine of cluster is read from database the inside, these Resource information of the packet containing needs.It is during initialization, modes of emplacement of the virtual machine under former modes of emplacement in physical machine is (specific The mark of the physical machine where each virtual machine can be recorded in the table), in this, as initial solution.
In this example, virtual machine (vm) migration is carried out between different physical machines, first determines the migration task to be performed, it is described to move Shifting task includes virtual machine, source physical machine and the target physical machine different from source physical machine that need to be migrated, then, it is determined that described move The execution sequence of shifting task, wherein, when the source physical machine of a migration task is the target physical machine of another migration task, the migration Task is prior to another migration tasks carrying;Finally, the migration task is performed further according to the execution sequence.Above-mentioned migration is appointed Business can be noted down in database, read and performed by migration task processor.
Exemplarily, the result how placed for the virtual machine being calculated, the source physical machine for containing virtual machine are compiled Number and the physical machine numbering that is newly calculated, traversing result one by one, it can be deduced that source physical machine number and new physicses machine numbering not The same result items, the result items, which represent one, to be needed to do virtual machine the migration task migrated.Really doing the mistake that migrates Cheng Zhong, in order to ensure the service quality of whole cluster, it is undesirable to occur having multiple virtual machines in same physical machine while moving The situation of shifting occurs.
Using the following migration task for needing to perform as example:
Virtual machine is numbered Source physical machine numbering Target physical machine is numbered
Vm1 Nc1 Nc2
Vm2 Nc3 Nc4
Vm3 Nc5 Nc6
Vm4 Nc5 Nc6
Vm5 Nc5 Nc7
Vm6 Nc8 Nc5
Vm7 Nc7 Nc9
To such a migration task list, one virtual machine of each entry representation moves to target from the physical machine of source In physical machine.
These migration tasks are first pre-processed, do not have it is related migration item can directly carry out, as Vm1 and Vm2 this Two migration tasks;Related migration item can connect into subgraph, as shown in Figure 4.To each subgraph, it is necessary to from leaf node Gradually recall to root node, migrated since the migration item near leaf node.It is multiple if there is having in a pair of physical machines Virtual machine needs to migrate, then migrates virtual machine above one by one.It can ensure all migration energy successes from leaf node migration.
Migration task for being not carried out sequence requirement can do concurrent, asynchronous execution, will by online migrating technology Virtual machine is reapposed more reasonably in physical machine.It is slow in centralization for the needing serially to migrate by pretreatment of the task The physical machine that middle preservation is carrying out migration is deposited, then checks whether source physical machine or target physical machine are caching in migration In, the task is not temporarily performed if in the buffer.
By arranging the cloud computing cluster resource fragment fully to have put into production of storage, available for relatively low cost guarantor Demonstrate,prove the service quality of cloud computing platform.For example, because cluster has fully produced, virtual machine will not be created in a period of time again, After the lasting release of virtual machine in cluster, by fragment resource consolidation, to enable cluster to continue the resource after integration Put into production.
In addition, at the beginning of cluster use, although can by predicting that user applies for specification, carry out corresponding initial setting up with Fragment is reduced, but the behavior of user is very random, especially on large-scale commercial podium, thousands of user needs The sample diversified in specifications wanted, it is difficult to the behavior of Accurate Prediction user.Once forecasting inaccuracy is, it is necessary to projected resources pond again, real-time Difference, and can not equally solve the problems, such as that continuing establishment and release upsets resource allocation.Moreover, regardless of initial modes of emplacement such as What, establishment and release resources of virtual machine with dynamic continuance, original space distribution are disturbed already, after some time Still a large amount of fragments occur.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.Embodiment party more than The description of formula, it is required general that those skilled in the art can be understood that above-described embodiment method can add by software The mode of hardware platform is realized, naturally it is also possible to which by hardware, but the former is more preferably embodiment in many cases.It is based on Such understanding, the part that the technical scheme of the embodiment of the present invention substantially contributes to prior art in other words can be with soft The form of part product embodies, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disc, CD) In, including some instructions are causing a station terminal equipment (can be mobile phone, computer, server, or network equipment etc.) Perform the method described in each embodiment of the present invention.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies Change, equivalent substitution, improvement etc., should be included in the scope of the protection.

Claims (18)

1. a kind of virtual machine migration method, including following virtual machine (vm) migration processing procedure:
According to the resource information of the cluster to have put into operation, new placement side of the virtual machine in physical machine in the cluster is determined Formula, wherein, the resource information includes resources of virtual machine information, physical machine resource information and the virtual machine of the cluster in physics Former modes of emplacement on machine, the resource fragmentation of the cluster is less than the cluster under former modes of emplacement under the new placement mode Resource fragmentation;
According to the new placement mode, virtual machine (vm) migration is carried out between different physical machines.
2. the method as described in claim 1, it is characterised in that:
According to the resource information of the cluster to have put into operation, new placement side of the virtual machine in physical machine in the cluster is determined Formula, including:
Constraints to modes of emplacement of the virtual machine in physical machine in the cluster is determined according to the resource information, with reference to The resource fragmentation of the cluster is less than the requirement of the resource fragmentation of the cluster under former modes of emplacement under the new placement mode, from Meet to select a kind of modes of emplacement in the modes of emplacement of the constraints, as the new placement mode.
3. method as claimed in claim 2, it is characterised in that:
A kind of modes of emplacement is selected from the modes of emplacement for meeting the constraints, as the new placement mode, including:
Solved using combinatorial optimization algorithm, a solution of the combinatorial optimization algorithm represents in the cluster virtual machine in physical machine On a kind of modes of emplacement, during solution, the constraint using the constraints as the solution of the combinatorial optimization algorithm, according to making The object function that the minimum requirement of cluster resource fragment determines the combinatorial optimization algorithm is stated, described in the optimal solution obtained and conduct New placement mode.
4. method as claimed in claim 2 or claim 3, it is characterised in that:
One or more of condition is included to the constraints of modes of emplacement:
Under the modes of emplacement, to each physical resource, it is little that each physical machine distributes to the physical resource that virtual machine uses In the upper limit of the physical resource of the physical machine;
, it is necessary to which the category of image of each virtual machine of migration is supported to move when the modes of emplacement is different from the former modes of emplacement Move;
, it is necessary to the CPU models of the source physical machine of each virtual machine of migration when the modes of emplacement is different from the former modes of emplacement It is consistent with the CPU models of target physical machine;
Under the modes of emplacement, to the virtual machine for any specification for needing to create, the specification that can be created in the cluster is virtual The maximum number of machine is not less than the minimal amount thresholding of respective settings.
5. method as claimed in claim 3, it is characterised in that:
The object function represents that the optimal solution is so that the maximum solution of the variance with the variance of a class value, wherein, described one Class value is made up of the value for having distributed physical resource of each physical machine in the cluster, and the value for having distributed physical resource is single The value of one physical resource, or to do the value obtained after normalized to the value of a variety of physical resources.
6. method as claimed in claim 3, it is characterised in that:
It is described to be solved using combinatorial optimization algorithm, including:During solution, using the former modes of emplacement as the combinatorial optimization algorithm Initial solution.
7. the method as described in any in claim 1-3,5-6, it is characterised in that:
Before the virtual machine (vm) migration processing procedure, in addition to:
The virtual machine of any specification that needs are created, according to the resource requirement of the resource information and the specification virtual machine, really The maximum number of the fixed specification virtual machine that can be also created in the cluster, such as described maximum number are less than respective settings most Peanut thresholding, trigger the virtual machine (vm) migration processing.
8. the method as described in any in claim 1-3,5-6, it is characterised in that:
It is described to carry out virtual machine (vm) migration between different physical machines, including:
It is determined that the migration task to be performed, each migration task includes virtual machine, source physical machine and the target physical machine that need to be migrated;
The execution sequence of the migration task is determined, wherein, the source physical machine of a migration task is the target of another migration task During physical machine, the migration task is prior to another migration tasks carrying;
The migration task is performed according to the execution sequence.
9. method as claimed in claim 8, it is characterised in that:
The virtual machine (vm) migration by the way of migrating online;
When determining the execution sequence of the migration task, one or more of rule is also followed:The source thing of multiple migration tasks When reason machine is identical, the multiple migration task is performed successively;When the target physical machine of multiple migration tasks is identical, institute is performed successively State multiple migration tasks.
A kind of 10. cluster control system, it is characterised in that including inventory management module and migration process module, wherein:
The inventory management module, for managing the resource information of the cluster to have put into operation, the resource information includes described Modes of emplacement of the resources of virtual machine information, physical machine resource information and virtual machine of cluster in physical machine;
The migration process module includes:
Resource fragmentation sorting module, for determining virtual machine newly putting in physical machine in the cluster according to the resource information Mode is put, wherein, the resource fragmentation of the cluster is less than the resource of the cluster under former modes of emplacement under the new placement mode Fragment;
Task execution module is migrated, for according to the new placement mode, virtual machine (vm) migration to be carried out between different physical machines.
11. cluster control system as claimed in claim 10, it is characterised in that:
The resource fragmentation sorting module includes:
Constraints determining unit, for being determined according to the resource information to virtual machine putting in physical machine in the cluster Put the constraints of mode;
Modes of emplacement selecting unit, for according to the constraints, with reference to the resource of the cluster under the new placement mode Fragment is less than the requirement of the resource fragmentation of the cluster under former modes of emplacement, is selected from the modes of emplacement for meeting the constraints A kind of modes of emplacement is selected out, as the new placement mode.
12. cluster control system as claimed in claim 10, it is characterised in that:
The modes of emplacement selecting unit selects a kind of modes of emplacement from the modes of emplacement for meeting the constraints, as The new placement mode, including:
Solved using combinatorial optimization algorithm, a solution of the combinatorial optimization algorithm represents in the cluster virtual machine in physical machine On a kind of modes of emplacement, during solution, the constraint using the constraints as the solution of the combinatorial optimization algorithm, according to making The object function that the minimum requirement of cluster resource fragment determines the combinatorial optimization algorithm is stated, the optimal solution obtained is as described new Modes of emplacement.
13. the cluster control system as described in claim 11 or 12, it is characterised in that:
The constraints to modes of emplacement that the constraints determining unit determines includes one or more of condition:
Under the modes of emplacement, to each physical resource, it is little that each physical machine distributes to the physical resource that virtual machine uses In the upper limit of the physical resource of the physical machine;
, it is necessary to which the category of image of each virtual machine of migration is supported to move when the modes of emplacement is different from the former modes of emplacement Move;
, it is necessary to the CPU models of the source physical machine of each virtual machine of migration when the modes of emplacement is different from the former modes of emplacement It is consistent with the CPU models of target physical machine;
Under the modes of emplacement, to the virtual machine for any specification for needing to create, the specification that can be created in the cluster is virtual The maximum number of machine is not less than the minimal amount thresholding of respective settings.
14. cluster control system as claimed in claim 12, it is characterised in that:
The object function that the modes of emplacement selecting unit determines represents that the optimal solution is so that with the variance of a class value The maximum solution of the variance, wherein, a class value is made up of the value for having distributed physical resource of each physical machine in the cluster, The value for having distributed physical resource is the value of single one physical resource, or to do normalized to the value of a variety of physical resources The value obtained afterwards.
15. the cluster control system as described in any in claim 10-12,14, it is characterised in that:
The inventory management module is additionally operable to the virtual machine of any specification created to needs, according to the resource information and the rule The resource requirement of lattice virtual machine, it is determined that the maximum number for the specification virtual machine that can be also created in the cluster, as described in most Big figure is less than the minimal amount thresholding of respective settings, triggers the migration process module and carries out migration process.
16. the cluster control system as described in any in claim 10-12,14, it is characterised in that:
The migration task execution module includes:
Migration task determining unit, for determine the migration task to be performed, the migration task include need to migrate virtual machine, Source physical machine and the target physical machine different from source physical machine;
Execution sequence determining unit, for determining the execution sequence of the migration task, wherein, the source physical machine of a migration task For another migration task target physical machine when, the migration task is prior to another migration tasks carrying;
Task executing units are migrated, for performing the migration task according to the execution sequence.
17. cluster control system as claimed in claim 16, it is characterised in that:
The migration task executing units perform the migration task by the way of migrating online;
When the execution sequence determining unit determines the execution sequence of the migration task, one or more of rule are also followed Then:When the source physical machine of multiple migration tasks is identical, the multiple migration task is performed successively;The object of multiple migration tasks When reason machine is identical, the multiple migration task is performed successively.
18. a kind of clustered control device, including CPU and memory, it is characterised in that:
The memory is used for save routine code;
The CPU is used to read described program code from the memory, performs following virtual machine (vm) migration processing:According to having put into The resource information of the cluster of operation, determine new placement mode of the virtual machine in physical machine in the cluster;Newly put according to described Mode is put, virtual machine (vm) migration is carried out between different physical machines;Wherein, the resource information includes the virtual machine money of the cluster The former modes of emplacement of source information, physical machine resource information and virtual machine in physical machine, the cluster under the new placement mode Resource fragmentation be less than former modes of emplacement under the cluster resource fragmentation.
CN201610551130.3A 2016-07-13 2016-07-13 A kind of virtual machine migration method, cluster control system and control device Pending CN107621980A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610551130.3A CN107621980A (en) 2016-07-13 2016-07-13 A kind of virtual machine migration method, cluster control system and control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610551130.3A CN107621980A (en) 2016-07-13 2016-07-13 A kind of virtual machine migration method, cluster control system and control device

Publications (1)

Publication Number Publication Date
CN107621980A true CN107621980A (en) 2018-01-23

Family

ID=61087202

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610551130.3A Pending CN107621980A (en) 2016-07-13 2016-07-13 A kind of virtual machine migration method, cluster control system and control device

Country Status (1)

Country Link
CN (1) CN107621980A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101710339A (en) * 2009-11-20 2010-05-19 中国科学院计算技术研究所 Method and system for controlling data storage in cluster file system and method for creating file
CN102880802A (en) * 2012-09-25 2013-01-16 浙江图讯科技有限公司 Fatal danger fountainhead analysis and evaluation method for safety production cloud service platform system facing industrial and mining enterprises
CN103455363A (en) * 2013-08-30 2013-12-18 华为技术有限公司 Command processing method, device and physical host of virtual machine
CN103870339A (en) * 2014-03-06 2014-06-18 上海华为技术有限公司 Cluster resource allocation method and cluster resource allocation device
US20150012570A1 (en) * 2003-04-11 2015-01-08 Vmware, Inc. System and method for converting a physical disk to a virtual disk
CN104536803A (en) * 2014-12-23 2015-04-22 西安电子科技大学 Virtual machine scheduling method based on combination optimization
CN105159750A (en) * 2015-09-14 2015-12-16 浪潮集团有限公司 Virtual machine creation method and apparatus

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150012570A1 (en) * 2003-04-11 2015-01-08 Vmware, Inc. System and method for converting a physical disk to a virtual disk
CN101710339A (en) * 2009-11-20 2010-05-19 中国科学院计算技术研究所 Method and system for controlling data storage in cluster file system and method for creating file
CN102880802A (en) * 2012-09-25 2013-01-16 浙江图讯科技有限公司 Fatal danger fountainhead analysis and evaluation method for safety production cloud service platform system facing industrial and mining enterprises
CN103455363A (en) * 2013-08-30 2013-12-18 华为技术有限公司 Command processing method, device and physical host of virtual machine
CN103870339A (en) * 2014-03-06 2014-06-18 上海华为技术有限公司 Cluster resource allocation method and cluster resource allocation device
CN104536803A (en) * 2014-12-23 2015-04-22 西安电子科技大学 Virtual machine scheduling method based on combination optimization
CN105159750A (en) * 2015-09-14 2015-12-16 浪潮集团有限公司 Virtual machine creation method and apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
沈晓茹: "基于虚拟集群在线迁移的虚拟化资源整合算法研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Similar Documents

Publication Publication Date Title
Kaur et al. Container-as-a-service at the edge: Trade-off between energy efficiency and service availability at fog nano data centers
Liu et al. Deadline‐constrained coevolutionary genetic algorithm for scientific workflow scheduling in cloud computing
CN103970607B (en) Carry out the method and apparatus that calculation optimization virtual machine is distributed using equivalence set
US9800465B2 (en) Application placement through multiple allocation domain agents and flexible cloud scheduler framework
CN104484220B (en) The method and device of the dynamic resource scheduling of virtual cluster
CN108292241A (en) Processing calculates figure
US9679029B2 (en) Optimizing storage cloud environments through adaptive statistical modeling
LeBeane et al. Data partitioning strategies for graph workloads on heterogeneous clusters
Sheikhalishahi et al. A multi-dimensional job scheduling
CN104731528B (en) A kind of construction method and system of cloud computing block storage service
CN107273185B (en) Load balancing control method based on virtual machine
US20140282540A1 (en) Performant host selection for virtualization centers
CN102929707A (en) Parallel task dynamical allocation method
CN107924340A (en) Resource configuration system, resource allocation method and resource allocation process
WO2016040699A1 (en) Computing instance launch time
Ma et al. Dependency-aware data locality for MapReduce
Ma et al. vlocality: Revisiting data locality for mapreduce in virtualized clouds
CN105843683A (en) Method,system and device for dynamically optimizing platform resource allocation
CN107291536B (en) Application task flow scheduling method in cloud computing environment
Kijsipongse et al. A hybrid GPU cluster and volunteer computing platform for scalable deep learning
CN103250139B (en) A kind of method and device migrating calculating node
CN103548324B (en) Virtual machine distribution method and virtual machine distributor
Al-Moalmi et al. A whale optimization system for energy-efficient container placement in data centers
Dow Decomposed multi-objective bin-packing for virtual machine consolidation
CN107864211A (en) Cluster resource dispatching method and system

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