CN109739614A - Virtual machine rebuilding method, device and equipment - Google Patents
Virtual machine rebuilding method, device and equipment Download PDFInfo
- Publication number
- CN109739614A CN109739614A CN201811401343.3A CN201811401343A CN109739614A CN 109739614 A CN109739614 A CN 109739614A CN 201811401343 A CN201811401343 A CN 201811401343A CN 109739614 A CN109739614 A CN 109739614A
- Authority
- CN
- China
- Prior art keywords
- machine
- virtual machine
- physical machine
- physical
- migration
- 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
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention proposes a kind of virtual machine rebuilding method, device and equipment, wherein method includes: to obtain the target resource amount of target virtual machine to be created, and target resource amount is compared with the surplus yield of current each physical machine;If knowing, the surplus yield of each physical machine is respectively less than target resource amount, the virtual machine to be migrated in source physical machine to be migrated is then determined according to occupancy stock number, surplus yield and the target resource amount of each virtual machine current in each physical machine, and determines purpose physical machine to be received;Target virtual machine is established by virtual machine (vm) migration to be migrated to purpose physical machine, and in the physical machine of source.Hereby it is achieved that the detection of automation, migration virtual machine and newly-built virtual machine, improve the convenience and intelligence degree of newly-built virtual machine, and it is possible to improve the resource utilization of physical machine.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of virtual machine rebuilding methods, device and equipment.
Background technique
Virtual machine refer to by software simulate with complete hardware system function, operate in a completely isolated environment
Complete computer.Virtual machine technique is also paid close attention to by more and more people as a hot spot in cloud computing.
In the related technology, when the inadequate resource needed for newly-built virtual machine, newly-built virtual machine be will fail, and need system after failure
Administrator meets newly-built resources of virtual machine demand by modes such as manual releasing other resources, dilatation cloud resources.However, above-mentioned side
The cumbersome and inconvenient victory of formula, and the remaining resource of physical machine can not be fully utilized.
Summary of the invention
The present invention is directed to solve at least some of the technical problems in related technologies.
For this purpose, the first purpose of this invention is to propose a kind of virtual machine rebuilding method, with realize automation detection,
Virtual machine and newly-built virtual machine are migrated, the convenience and intelligence degree of newly-built virtual machine are improved, and it is possible to improve object
The resource utilization of reason machine.
Second object of the present invention is to propose a kind of virtual machine new device.
Third object of the present invention is to propose a kind of computer equipment.
Fourth object of the present invention is to propose a kind of non-transitorycomputer readable storage medium.
First aspect present invention embodiment proposes a kind of virtual machine rebuilding method, comprising:
The target resource amount for obtaining target virtual machine to be created, by the target resource amount and current each physical machine
Surplus yield is compared;
If knowing, the surplus yield of each physical machine is respectively less than the target resource amount, according to each object
Occupancy stock number, the surplus yield and the target resource amount of current each virtual machine determine source object to be migrated on reason machine
Virtual machine to be migrated on reason machine, and determine purpose physical machine to be received;
The target is established by the virtual machine (vm) migration to be migrated to the purpose physical machine, and in the source physical machine
Virtual machine.
The virtual machine rebuilding method of the embodiment of the present invention obtains the target resource amount of target virtual machine to be created first,
And target resource amount is compared with the surplus yield of current each physical machine.In turn, if knowing the surplus of each physical machine
Remaining stock number is respectively less than target resource amount, then according to the occupancy stock number of each virtual machine current in each physical machine, surplus resources
Amount and target resource amount determine the virtual machine to be migrated in source physical machine to be migrated, and determine purpose physics to be received
Machine.Further by virtual machine (vm) migration to be migrated to purpose physical machine, and target virtual machine is established in the physical machine of source.The present embodiment
In, by by the virtual machine (vm) migration in the physical machine of source to purpose physical machine, so that source physical machine surplus yield meets newly-built void
The stock number demand of quasi- machine, to create virtual machine in the physical machine of source.Hereby it is achieved that the detection of automation, migration are virtually
Machine and newly-built virtual machine, improve the convenience and intelligence degree of newly-built virtual machine, and it is possible to improve the money of physical machine
Source utilization rate.
In addition, virtual machine rebuilding method according to the above embodiment of the present invention can also have following additional technical feature:
Optionally, the virtual machine to be migrated in determination source physical machine to be migrated includes: to judge that the first physical machine is surplus
Whether the sum of occupancy stock number of remaining stock number and candidate virtual machine is more than or equal to the target resource amount, wherein the candidate
Virtual machine is located in first physical machine;If so, judging whether there is surplus yield more than or equal to the candidate virtual
Second physical machine of the occupancy stock number of machine;If so, obtaining the migration shadow of first physical machine and the candidate virtual machine
Ring value;It determines the combination of migration influence value the smallest first physical machine and candidate virtual machine, and is determined according to the combination
The source physical machine and the virtual machine to be migrated.
Optionally, the migration influence value is determining according to the following formula:
Wherein,
SH is the migration influence value;
WA,WB,WC,WDFor weight;
HcuFor physical machine central processor CPU utilization rate;
HmuFor physical machine memory usage;
hicuFor the CPU usage of i-th candidate virtual machine in the physical machine;
himuFor the memory usage of i-th candidate virtual machine in the physical machine.
Optionally, determination purpose physical machine to be received includes: to obtain surplus yield more than or equal to described wait move
The physical machine of the occupancy stock number of virtual machine is moved, and generates physical machine list;Maximum weight is determined from the physical machine list
Physical machine physical machine as a purpose.
Optionally, the weight is determining according to the following formula:
DH=Wa(1-Hcu)+Wb(1-Hmu)+Wc(1-Hco)+Wd(1-Hmo), wherein
DH is the weight;
Wa,Wb,Wc,WdFor weight;
HcuFor physical machine CPU usage;
HmuFor physical machine memory usage;
HcoFor physical machine CPU occupation rate;
HmoFor physical machine memory occupation rate.
Optionally, judge whether there is surplus yield more than or equal to the candidate virtual machine occupancy stock number the
After two physical machines, further includes: if it is not, then further determining whether to move by carrying out virtual machine to second physical machine
It moves, second physical machine is made to meet the transition condition of the candidate virtual machine after migration;If so, to second physics
Machine carries out virtual machine (vm) migration.
Second aspect of the present invention embodiment proposes a kind of virtual machine new device, comprising:
Judgment module, for obtaining the target resource amount of target virtual machine to be created, by the target resource amount with work as
The surplus yield of preceding each physical machine is compared;
Processing module, if for knowing that the surplus yield of each physical machine is respectively less than the target resource amount,
It is true according to the occupancy stock number of each virtual machine current in each physical machine, the surplus yield and the target resource amount
Virtual machine to be migrated in fixed source physical machine to be migrated, and determine purpose physical machine to be received;
Newly-built module, is used for the virtual machine (vm) migration to be migrated to the purpose physical machine, and in the source physical machine
On establish the target virtual machine.
The virtual machine new device of the embodiment of the present invention obtains the target resource amount of target virtual machine to be created first,
And target resource amount is compared with the surplus yield of current each physical machine.In turn, if knowing the surplus of each physical machine
Remaining stock number is respectively less than target resource amount, then according to the occupancy stock number of each virtual machine current in each physical machine, surplus resources
Amount and target resource amount determine the virtual machine to be migrated in source physical machine to be migrated, and determine purpose physics to be received
Machine.Further by virtual machine (vm) migration to be migrated to purpose physical machine, and target virtual machine is established in the physical machine of source.It is real as a result,
Detection, migration virtual machine and the newly-built virtual machine for having showed automation improve the convenience and intelligent journey of newly-built virtual machine
Degree, and it is possible to improve the resource utilization of physical machine.
In addition, virtual machine new device according to the above embodiment of the present invention can also have following additional technical feature:
Optionally, the processing module is specifically used for: judging accounting for for the first physical machine surplus yield and candidate virtual machine
Whether it is more than or equal to the target resource amount with the sum of stock number, wherein the candidate virtual machine is located at first physical machine
In;If so, judging whether there is second physics of the surplus yield more than or equal to the occupancy stock number of the candidate virtual machine
Machine;If so, obtaining the migration influence value of first physical machine and the candidate virtual machine;Determine the migration influence value most
The combination of small the first physical machine and candidate virtual machine, and the source physical machine and the void to be migrated are determined according to the combination
Quasi- machine.
Optionally, the processing module is specifically used for: obtaining surplus yield and is more than or equal to the virtual machine to be migrated
The physical machine of stock number is occupied, and generates physical machine list;Determine that the physical machine of maximum weight is made from the physical machine list
For purpose physical machine.
Optionally, the processing module is also used to: if there is no surplus yields to be more than or equal to the candidate virtual for judgement
Second physical machine of the occupancy stock number of machine, then further determining whether can be by carrying out virtual machine to second physical machine
Migration, makes second physical machine meet the transition condition of the candidate virtual machine after migration;If so, to second object
Reason machine carries out virtual machine (vm) migration.
Third aspect present invention embodiment proposes a kind of computer equipment, including processor and memory;Wherein, described
Processor is corresponding with the executable program code to run by reading the executable program code stored in the memory
Program, for realizing the virtual machine rebuilding method as described in first aspect embodiment.
Fourth aspect present invention embodiment proposes a kind of non-transitorycomputer readable storage medium, is stored thereon with meter
Calculation machine program, which is characterized in that realize that the virtual machine as described in first aspect embodiment is newly-built when the program is executed by processor
Method.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partially become from the following description
Obviously, or practice through the invention is recognized.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of virtual machine rebuilding method provided by the embodiment of the present invention;
Fig. 2 is the flow diagram of another kind virtual machine rebuilding method provided by the embodiment of the present invention;
Fig. 3 is a kind of schematic diagram of determining purpose physical machine provided by the embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of virtual machine new device provided by the embodiment of the present invention;
Fig. 5 shows the block diagram for being suitable for the exemplary computer device for being used to realize the embodiment of the present invention.
Specific embodiment
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end
Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached
The embodiment of figure description is exemplary, it is intended to is used to explain the present invention, and is not considered as limiting the invention.
Below with reference to the accompanying drawings virtual machine rebuilding method, device and the equipment of the embodiment of the present invention are described.
Fig. 1 is a kind of flow diagram of virtual machine rebuilding method provided by the embodiment of the present invention, as shown in Figure 1, should
Method includes:
Step 101, the target resource amount for obtaining target virtual machine to be created, by target resource amount and current each physics
The surplus yield of machine is compared.
In the embodiment of the present invention, available newly-built virtual machine request, and destination virtual to be created is extracted from request
The target resource amount of machine, and then by target resource amount compared with the surplus yield of current each physical machine, with according to comparing knot
Fruit is controlled accordingly.For example, target resource amount is a, the surplus yield of physical machine B and C are respectively b, c, if b is less than a,
C is less than a, thens follow the steps 102;If b is more than or equal to a, c is less than a, then virtual machine is created in physical machine B.
Step 102, if knowing, the surplus yield of each physical machine is respectively less than target resource amount, according to each physical machine
Occupancy stock number, surplus yield and the target resource amount of upper current each virtual machine determine in source physical machine to be migrated wait move
Virtual machine is moved, and determines purpose physical machine to be received.
It in one embodiment of the invention, can be according to can currently be carried out on the surplus yield and physical machine of physical machine
The sum of the occupancy stock number of each virtual machine of migration S, is compared with target resource amount A, if S is more than or equal to A, it is determined that the object
Reason machine is source physical machine to be migrated, determines that current each virtual machine is virtual machine to be migrated in the physical machine.
It as an example, can be according to CPU (Central Processing Unit, central processing unit) quantity and interior
Quantity is deposited to be judged.
Wherein, n is positive integer,
NcFor CPU quantity needed for new destination virtual machine
HcFor physical machine residue CPU quantity
hicCPU quantity is occupied for i-th virtual machine
NmFor amount of memory needed for new destination virtual machine
HmFor physical machine free memory quantity
himFor i-th virtual machine committed memory quantity
When each virtual machine current on physical machine A and physical machine A meets above-mentioned condition, further according to current each virtual machine
CPU quantity and amount of memory are occupied, other physical machines that surplus yield meets transition condition are judged whether there is, and if it exists,
It then determines that physical machine A is source physical machine to be migrated, and determines that the 1st-the n-th virtual machine is virtual machine to be migrated.
It in one embodiment of the invention, can be according to the occupancy stock number and other physical machines of virtual machine to be migrated
Surplus yield is compared, and then determines purpose physical machine to be received.For example, the occupancy of virtual machine 1 CPU quantity to be migrated is
A, committed memory quantity are b, and the remaining CPU quantity of physical machine B is c, and free memory quantity is d, if c is more than or equal to a and d is greater than
Equal to b, it is determined that physical machine B is the purpose physical machine of virtual machine 1 to be migrated.
It should be noted that the source physical machine and purpose physical machine that determine in the embodiment of the present invention can be one, it can also
To be multiple.When determining multiple source physical machine/purpose physical machines, can therefrom randomly select source physical machine to be migrated/to
Received purpose physical machine, can also be chosen, herein with no restrictions according to related algorithm.
Step 103, by virtual machine (vm) migration to be migrated to purpose physical machine, and target virtual machine is established in the physical machine of source.
As an example, after determining the corresponding purpose physical machine of virtual machine to be migrated, thermophoresis skill can be passed through
Art migrates virtual machine to be migrated respectively to corresponding purpose physical machine, and then after the completion of migration, creates in the physical machine of source
Target virtual machine.
It is appreciated that in the related technology in newly-built virtual machine, if the surplus yield of all physical machines is not satisfied newly
The stock number demand for building virtual machine needs administrator to carry out resource release or dilatation, cumbersome and inconvenient victory, and to physical machine
Surplus resources utilization rate is lower.In the present embodiment, by the way that newly-built virtual machine is not satisfied in each physical machine surplus yield
When target resource amount demand, the money that physical machine can be made to meet newly-built virtual machine by migrating virtual machine is further determined whether
Demand is measured in source, if so, by the virtual machine (vm) migration in the physical machine of source to purpose physical machine, so that source physical machine surplus yield is big
In being equal to target resource amount, to create virtual machine in the physical machine of source.
The virtual machine rebuilding method of the embodiment of the present invention obtains the target resource amount of target virtual machine to be created first,
And target resource amount is compared with the surplus yield of current each physical machine.In turn, if knowing the surplus of each physical machine
Remaining stock number is respectively less than target resource amount, then according to the occupancy stock number of each virtual machine current in each physical machine, surplus resources
Amount and target resource amount determine the virtual machine to be migrated in source physical machine to be migrated, and determine purpose physics to be received
Machine.Further by virtual machine (vm) migration to be migrated to purpose physical machine, and target virtual machine is established in the physical machine of source.It is real as a result,
Detection, migration virtual machine and the newly-built virtual machine for having showed automation improve the convenience and intelligent journey of newly-built virtual machine
Degree, and it is possible to improve the resource utilization of physical machine.
Based on the above embodiment, further, source physical machine and purpose physical machine can also be chosen by related algorithm, with
Balanced physical machine load is realized by migration virtual machine.
Fig. 2 is the flow diagram of another kind virtual machine rebuilding method provided by the embodiment of the present invention, as shown in Fig. 2,
This method comprises:
Step 201, whether the sum of the occupancy stock number for judging the first physical machine surplus yield and candidate virtual machine is greater than
Equal to target resource amount, wherein candidate virtual machine is located in the first physical machine.
Step 202, if so, judging whether there is occupancy stock number of the surplus yield more than or equal to candidate virtual machine
Second physical machine.
In the present embodiment, first determine whether that the sum of the occupancy stock number of the first physical machine surplus yield and candidate virtual machine is
It is no to be more than or equal to target resource amount, to determine whether that the first physical machine is made to meet newly-built virtual machine by virtual machine (vm) migration
Resource requirement.In turn, be more than or equal to the occupancy stock number of candidate virtual machine by judging whether there is surplus yield second
Physical machine, to determine whether there is the purpose physical machine of receivable virtual machine.
For example, target resource amount is 25, physical machine A surplus yield 5, virtual machine 1 and virtual machine 2 occupy money respectively in A
Source amount 10, physical machine B, C surplus yield is 11.In turn, determine that physical machine B and C are respectively that can receive virtual machine 1 and virtual
Second physical machine of machine 2, physical machine A are the first physical machine.
In one embodiment of the invention, if there is no the occupancy that surplus yield is more than or equal to candidate virtual machine for judgement
Second physical machine of stock number then further determines whether that second can be made by carrying out virtual machine (vm) migration to the second physical machine
Physical machine meets the transition condition of candidate virtual machine after migration;If so, carrying out virtual machine (vm) migration to the second physical machine, in turn
Obtain the migration influence value of the first physical machine and candidate virtual machine;If it is not, hint instructions can be sent to system manager, so that
Administrator's dilatation or release resource.
For example, target resource amount is 25, physical machine A, B, C gross space is respectively 25,21,21, wherein A surplus yield
5, virtual machine a occupy stock number 20;It is 10 that virtual machine b, c, which occupy stock number, B, C surplus yield 11.Wherein, physical machine A
Surplus yield and virtual machine a occupy the sum of stock number and are equal to target resource amount, but physical machine B, C surplus yield is respectively less than void
Quasi- machine a occupies stock number, and in turn, judging, which can make physical machine B meet virtual machine a physical machine B progress virtual machine (vm) migration, moves
Shifting condition further moves to virtual machine b in physical machine C from physical machine B, and determines that physical machine A is the first physical machine, virtually
Machine a is candidate virtual machine.
Step 203, if so, obtaining the migration influence value of the first physical machine and candidate virtual machine.
Step 204, the combination of migration influence value the smallest first physical machine and candidate virtual machine is determined, and true according to combination
Determine source physical machine and virtual machine to be migrated.
In one embodiment of the invention, following formula computation migration influence values can be passed through.
Wherein,
SH is migration influence value;
WA,WB,WC,WDFor weight;
HcuFor physical machine CPU usage;
HmuFor physical machine memory usage;
hicuFor the CPU usage of i-th candidate virtual machine in physical machine;
himuFor the memory usage of i-th candidate virtual machine in physical machine.
Wherein, weight can be obtained according to lot of experimental data, also can according to need self-setting.For example, WA,WB,
WC,WDRespectively 3,2,1.5,1, wherein influence of the CPU computing capability relative to memory power to migration is bigger, therefore CPU makes
It is greater than memory usage weight with rate weight, since migration influences also to be influenced by virtual machine quantity, virtual machine weight is small
In physical machine weight.
It is appreciated that can choose the lesser physical machine of load for the load of balanced physical machine and complete newly-built virtual machine.And
And the CPU usage and memory usage of virtual machine to be migrated are smaller, virtual machine quantity to be migrated is fewer, migration influences more
It is small, migrate influence to business and balanced physical machine load to reduce, available the smallest first physical machine of SH value with
The combination of candidate virtual machine, as source physical machine and virtual machine to be migrated.
Step 205, the physical machine that surplus yield is more than or equal to the occupancy stock number of virtual machine to be migrated is obtained, and is generated
Physical machine list.
As an example, it is a that virtual machine to be migrated, which occupies CPU quantity, and committed memory quantity is b, the residue of physical machine B
CPU quantity is A, and free memory quantity is B, if A is more than or equal to a and B is more than or equal to b, physical machine B is added to physical machine column
Table.
Step 206, the physical machine physical machine as a purpose of maximum weight is determined from physical machine list.
In one embodiment of the invention, weight can be calculated by following formula.
DH=Wa(1-Hcu)+Wb(1-Hmu)+Wc(1-Hco)+Wd(1-Hmo), wherein
DH is weight;
Wa,Wb,Wc,WdFor weight;
HcuFor physical machine CPU usage;
HmuFor physical machine memory usage;
HcoFor physical machine CPU occupation rate;
HmoFor physical machine memory occupation rate.
Wherein, weight can be obtained according to lot of experimental data, also can according to need self-setting.For example, Wa,Wb,
Wc,WdRespectively 3,2,1.5,1.
In the present embodiment, for the load of balanced physical machine, it is to be migrated virtual that the lesser physical machine reception of load can be chosen
Machine, that is to say, that the physical machine of available maximum weight physical machine as a purpose.For example, referring to Fig. 3, from physical machine 1-5
The physical machine 2,3,5 for meeting virtual machine (vm) migration condition to be migrated is filtered out, and then is ranked up according to weight, maximum weight is obtained
The physical machine as a purpose of physical machine 5.
The virtual machine rebuilding method of the embodiment of the present invention determines the migration the smallest source physical machine of influence value by related algorithm
With virtual machine to be migrated, and the purpose physical machine of determining maximum weight, reduces influence of the virtual machine (vm) migration to business, realize
Balanced physical machine load, improves physical machine resource utilization.
It is illustrated combined with specific embodiments below.
Wherein, virtual machine CPU, amount of memory and physical machine surplus yield are that physical machine passes through virtual machine technology with 1:
The quantity that 4 ratios obtain.
The target resource amount of newly-built virtual machine is 32 core 64G, and all physical machine surplus yields are not satisfied newly-built virtual
Machine demand.The existing virtual machine of all physical machines of automatic checking and physical machine surplus resources situation, determination can be by moving
Preceding 3 virtual machines on Host1,2 virtual machines before preceding 4 virtual machines, Host4 on Host2 are moved, to meet newly-built virtual machine
Newly-built virtual machine demand can not be met after demand, Host3 and Host5 migration virtual machine.And then judge before Host4 2 virtually
Only have 1 virtual function to find the migration of purpose physical machine in machine, for Host1 and Host2, according to formula:
SH1=3*30%+2*35%+ (1.5*30%+35%)+(1.5*45%+55%)+(1.5*25%+30%)=
4.300;
SH2=3*40%+2*45%+ (1.5*40%+45%)+(1.5*45%+55%)+(1.5*35%+45%)+
(1.5*45%+50%)=6.525;
SH1 < SH2, Host1 migration influence value are smaller, indicate that migration Host1 virtual machine service impact to be migrated is smaller, choosing
Host1 is selected as source physical machine, and Host1 is selected to go forward 3 virtual machines as virtual machine to be migrated.
And then be preferably the high virtual machine to be migrated selection purpose physical machine of configuration, that is, determine the void of 8 core 16G in Host1
The purpose physical machine of quasi- machine, according to physical machine CPU and memory surplus yield, Host2, Host3, Host4 are all satisfied to be migrated
Virtual machine configuration demand, Host5 are unsatisfactory for being filtered.According to formula:
DH=3 (1-Hcu)+2(1-Hmu)+1.5(1-Hco)+(1-Hmo)
Weight is higher, and expression physical machine is more idle, is more suitable as purpose physical machine, therefore select the maximum physics of weight
Machine physical machine as a purpose, wherein DH2=3.600, DH3=3.435, DH4=3.105, DH2 > DH3 > DH4, so Host2
It is the purpose physical machine of the virtual machine of 8 core 16G.And then determine the corresponding purpose physical machine of 4 core 16G virtual machines, according to newest object
Reason machine CPU and memory surplus yield, Host3, Host4, Host5 are all satisfied migration demand, and Host2 is unsatisfactory for being filtered.
DH3=3.435, DH4=3.105, DH5=3.200, DH3 > DH5 > DH4, so Host3 is the purpose of the virtual machine of 4 core 16G
Physical machine.Finally determine the corresponding purpose physical machine of 4 core 8G virtual machines, according to newest physical machine CPU and memory surplus yield,
Host4, Host5 are all satisfied migration demand, and Host2, Host3 are unsatisfactory for being filtered.DH4=3.105, DH5=3.200, DH5
> DH4, so Host5 is the physical machine of the purpose of the virtual machine of 4 core 8G.Determine all virtual machine purpose physical machines to be migrated
Afterwards, starting migration creates virtual machine after all virtual machines to be migrated complete migration on Host1.
In order to realize above-described embodiment, the present invention also proposes a kind of virtual machine new device.
Fig. 4 is a kind of structural schematic diagram of virtual machine new device provided by the embodiment of the present invention, as shown in figure 4, should
Device includes: judgment module 100, and processing module 200 creates module 300.
Wherein, judgment module 100, for obtaining the target resource amount of target virtual machine to be created, by target resource amount
It is compared with the surplus yield of current each physical machine.
Processing module 200, if for knowing that the surplus yield of each physical machine is respectively less than target resource amount, according to every
Occupancy stock number, surplus yield and the target resource amount of current each virtual machine determine source physical machine to be migrated in a physical machine
On virtual machine to be migrated, and determine purpose physical machine to be received.
Newly-built module 300, for establishing target by virtual machine (vm) migration to be migrated to purpose physical machine, and in the physical machine of source
Virtual machine.
Further, processing module 200 is specifically used for: judging accounting for for the first physical machine surplus yield and candidate virtual machine
Whether it is more than or equal to target resource amount with the sum of stock number, wherein candidate virtual machine is located in the first physical machine;If so, sentencing
Second physical machine of the disconnected occupancy stock number for being more than or equal to candidate virtual machine with the presence or absence of surplus yield;If so, obtaining the
The migration influence value of one physical machine and candidate virtual machine;Determine the smallest first physical machine of migration influence value and candidate virtual machine
Combination, and source physical machine and virtual machine to be migrated are determined according to combining.
Further, processing module 200 is specifically used for: obtaining the occupancy that surplus yield is more than or equal to virtual machine to be migrated
The physical machine of stock number, and generate physical machine list;The physical machine object as a purpose of maximum weight is determined from physical machine list
Reason machine.
Further, processing module 200 is also used to: if there is no surplus yields to be more than or equal to candidate virtual machine for judgement
The second physical machine for occupying stock number then further determines whether to make by carrying out virtual machine (vm) migration to the second physical machine
Second physical machine meets the transition condition of candidate virtual machine after migration;If so, carrying out virtual machine (vm) migration to the second physical machine.
It should be noted that explanation of the previous embodiment to virtual machine rebuilding method, is equally applicable to the present embodiment
Virtual machine new device, details are not described herein again.
The virtual machine new device of the embodiment of the present invention obtains the target resource amount of target virtual machine to be created first,
And target resource amount is compared with the surplus yield of current each physical machine.In turn, if knowing the surplus of each physical machine
Remaining stock number is respectively less than target resource amount, then according to the occupancy stock number of each virtual machine current in each physical machine, surplus resources
Amount and target resource amount determine the virtual machine to be migrated in source physical machine to be migrated, and determine purpose physics to be received
Machine.Further by virtual machine (vm) migration to be migrated to purpose physical machine, and target virtual machine is established in the physical machine of source.It is real as a result,
Detection, migration virtual machine and the newly-built virtual machine for having showed automation improve the convenience and intelligent journey of newly-built virtual machine
Degree, and it is possible to improve the resource utilization of physical machine.
In order to realize above-described embodiment, the present invention also proposes a kind of computer equipment, including processor and memory;Its
In, processor runs journey corresponding with executable program code by reading the executable program code stored in memory
Sequence, for realizing the virtual machine rebuilding method as described in aforementioned any embodiment.
In order to realize above-described embodiment, the present invention also proposes a kind of computer program product, when in computer program product
Instruction the virtual machine rebuilding method as described in aforementioned any embodiment is realized when being executed by processor.
In order to realize above-described embodiment, the present invention also proposes a kind of non-transitorycomputer readable storage medium, deposits thereon
Computer program is contained, the virtual machine rebuilding method as described in aforementioned any embodiment is realized when which is executed by processor.
Fig. 5 shows the block diagram for being suitable for the exemplary computer device for being used to realize the embodiment of the present invention.The meter that Fig. 5 is shown
Calculating machine equipment 12 is only an example, should not function to the embodiment of the present invention and use scope bring any restrictions.
As shown in figure 5, computer equipment 12 is showed in the form of universal computing device.The component of computer equipment 12 can be with
Including but not limited to: one or more processor or processing unit 16, system storage 28 connect different system components
The bus 18 of (including system storage 28 and processing unit 16).
Bus 18 indicates one of a few class bus structures or a variety of, including memory bus or Memory Controller,
Peripheral bus, graphics acceleration port, processor or the local bus using any bus structures in a variety of bus structures.It lifts
For example, these architectures include but is not limited to industry standard architecture (Industry Standard
Architecture;Hereinafter referred to as: ISA) bus, microchannel architecture (Micro Channel Architecture;Below
Referred to as: MAC) bus, enhanced isa bus, Video Electronics Standards Association (Video Electronics Standards
Association;Hereinafter referred to as: VESA) local bus and peripheral component interconnection (Peripheral Component
Interconnection;Hereinafter referred to as: PCI) bus.
Computer equipment 12 typically comprises a variety of computer system readable media.These media can be it is any can be by
The usable medium that computer equipment 12 accesses, including volatile and non-volatile media, moveable and immovable medium.
Memory 28 may include the computer system readable media of form of volatile memory, such as random access memory
Device (Random Access Memory;Hereinafter referred to as: RAM) 30 and/or cache memory 32.Computer equipment 12 can be with
It further comprise other removable/nonremovable, volatile/non-volatile computer system storage mediums.Only as an example,
Storage system 34 can be used for reading and writing immovable, non-volatile magnetic media, and (Fig. 5 do not show, commonly referred to as " hard drive
Device ").Although being not shown in Fig. 5, the disk for reading and writing to removable non-volatile magnetic disk (such as " floppy disk ") can be provided and driven
Dynamic device, and to removable anonvolatile optical disk (such as: compact disc read-only memory (Compact Disc Read Only
Memory;Hereinafter referred to as: CD-ROM), digital multi CD-ROM (Digital Video Disc Read Only
Memory;Hereinafter referred to as: DVD-ROM) or other optical mediums) read-write CD drive.In these cases, each driving
Device can be connected by one or more data media interfaces with bus 18.Memory 28 may include that at least one program produces
Product, the program product have one group of (for example, at least one) program module, and it is each that these program modules are configured to perform the application
The function of embodiment.
Program/utility 40 with one group of (at least one) program module 42 can store in such as memory 28
In, such program module 42 include but is not limited to operating system, one or more application program, other program modules and
It may include the realization of network environment in program data, each of these examples or certain combination.Program module 42 is usual
Execute the function and/or method in embodiments described herein.
Computer equipment 12 can also be with one or more external equipments 14 (such as keyboard, sensing equipment, display 24
Deng) communication, the equipment interacted with the computer system/server 12 can be also enabled a user to one or more to be communicated, and/
Or with enable the computer system/server 12 and one or more of the other any equipment (example for being communicated of calculating equipment
Such as network interface card, modem etc.) communication.This communication can be carried out by input/output (I/O) interface 22.Also, it calculates
Machine equipment 12 can also pass through network adapter 20 and one or more network (such as local area network (Local Area
Network;Hereinafter referred to as: LAN), wide area network (Wide Area Network;Hereinafter referred to as: WAN) and/or public network, example
Such as internet) communication.As shown, network adapter 20 is communicated by bus 18 with other modules of computer equipment 12.It answers
When understanding, although not shown in the drawings, other hardware and/or software module can be used in conjunction with computer equipment 12, including but not
Be limited to: microcode, device driver, redundant processing unit, external disk drive array, RAID system, tape drive and
Data backup storage system etc..
Processing unit 16 by the program that is stored in system storage 28 of operation, thereby executing various function application and
Data processing, such as realize the method referred in previous embodiment.
In the description of the present invention, it is to be understood that, term " first ", " second " are used for description purposes only, and cannot
It is interpreted as indication or suggestion relative importance or implicitly indicates the quantity of indicated technical characteristic.Define as a result, " the
One ", the feature of " second " can explicitly or implicitly include at least one of the features.In the description of the present invention, " multiple "
It is meant that at least two, such as two, three etc., unless otherwise specifically defined.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show
The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example
Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not
It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office
It can be combined in any suitable manner in one or more embodiment or examples.In addition, without conflicting with each other, the skill of this field
Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples
It closes and combines.
Although the embodiments of the present invention has been shown and described above, it is to be understood that above-described embodiment is example
Property, it is not considered as limiting the invention, those skilled in the art within the scope of the invention can be to above-mentioned
Embodiment is changed, modifies, replacement and variant.
Claims (12)
1. a kind of virtual machine rebuilding method, which comprises the following steps:
The target resource amount for obtaining target virtual machine to be created, by the residue of the target resource amount and current each physical machine
Stock number is compared;
If knowing, the surplus yield of each physical machine is respectively less than the target resource amount, according to each physical machine
Occupancy stock number, the surplus yield and the target resource amount of upper current each virtual machine determine source physical machine to be migrated
On virtual machine to be migrated, and determine purpose physical machine to be received;
The destination virtual is established by the virtual machine (vm) migration to be migrated to the purpose physical machine, and in the source physical machine
Machine.
2. virtual machine rebuilding method as described in claim 1, which is characterized in that in determination source physical machine to be migrated
Virtual machine to be migrated includes:
Judge whether the sum of occupancy stock number of the first physical machine surplus yield and candidate virtual machine is more than or equal to the target
Stock number, wherein the candidate virtual machine is located in first physical machine;
If so, judging whether there is second physics of the surplus yield more than or equal to the occupancy stock number of the candidate virtual machine
Machine;
If so, obtaining the migration influence value of first physical machine and the candidate virtual machine;
It determines the combination of migration influence value the smallest first physical machine and candidate virtual machine, and institute is determined according to the combination
State source physical machine and the virtual machine to be migrated.
3. virtual machine rebuilding method as claimed in claim 2, which is characterized in that the migration influence value is according to the following formula
Determining:
Wherein,
SH is the migration influence value;
WA,WB,WC,WDFor weight;
HcuFor physical machine central processor CPU utilization rate;
HmuFor physical machine memory usage;
hicuFor the CPU usage of i-th candidate virtual machine in the physical machine;
himuFor the memory usage of i-th candidate virtual machine in the physical machine.
4. virtual machine rebuilding method as described in claim 1, which is characterized in that determination purpose physical machine packet to be received
It includes:
The physical machine that surplus yield is more than or equal to the occupancy stock number of the virtual machine to be migrated is obtained, and generates physical machine column
Table;
The physical machine physical machine as a purpose of maximum weight is determined from the physical machine list.
5. virtual machine rebuilding method as claimed in claim 4, which is characterized in that the weight is determining according to the following formula
:
DH=Wa(1-Hcu)+Wb(1-Hmu)+Wc(1-Hco)+Wd(1-Hmo), wherein
DH is the weight;
Wa,Wb,Wc,WdFor weight;
HcuFor physical machine CPU usage;
HmuFor physical machine memory usage;
HcoFor physical machine CPU occupation rate;
HmoFor physical machine memory occupation rate.
6. virtual machine rebuilding method as claimed in claim 2, which is characterized in that be greater than judging whether there is surplus yield
After the second physical machine equal to the occupancy stock number of the candidate virtual machine, further includes:
If it is not, then further determining whether that second object can be made by carrying out virtual machine (vm) migration to second physical machine
Reason machine meets the transition condition of the candidate virtual machine after migration;
If so, carrying out virtual machine (vm) migration to second physical machine.
7. a kind of virtual machine new device characterized by comprising
Judgment module, it is by the target resource amount and currently every for obtaining the target resource amount of target virtual machine to be created
The surplus yield of a physical machine is compared;
Processing module, if for knowing that the surplus yield of each physical machine is respectively less than the target resource amount, basis
The occupancy stock number of current each virtual machine in each physical machine, the surplus yield and the target resource amount determine to
Virtual machine to be migrated in the source physical machine of migration, and determine purpose physical machine to be received;
Newly-built module, for being built by the virtual machine (vm) migration to be migrated to the purpose physical machine, and in the source physical machine
Found the target virtual machine.
8. virtual machine new device as claimed in claim 7, which is characterized in that the processing module is specifically used for:
Judge whether the sum of occupancy stock number of the first physical machine surplus yield and candidate virtual machine is more than or equal to the target
Stock number, wherein the candidate virtual machine is located in first physical machine;
If so, judging whether there is second physics of the surplus yield more than or equal to the occupancy stock number of the candidate virtual machine
Machine;
If so, obtaining the migration influence value of first physical machine and the candidate virtual machine;
It determines the combination of migration influence value the smallest first physical machine and candidate virtual machine, and institute is determined according to the combination
State source physical machine and the virtual machine to be migrated.
9. virtual machine new device as claimed in claim 7, which is characterized in that the processing module is specifically used for:
The physical machine that surplus yield is more than or equal to the occupancy stock number of the virtual machine to be migrated is obtained, and generates physical machine column
Table;
The physical machine physical machine as a purpose of maximum weight is determined from the physical machine list.
10. virtual machine new device as claimed in claim 8, which is characterized in that the processing module is also used to:
If second physical machine of the judgement there is no surplus yield more than or equal to the occupancy stock number of the candidate virtual machine, into
One step judges whether second physical machine can be kept full after migration by carrying out virtual machine (vm) migration to second physical machine
The transition condition of the foot candidate virtual machine;
If so, carrying out virtual machine (vm) migration to second physical machine.
11. a kind of computer equipment, which is characterized in that including processor and memory;
Wherein, the processor is run by reading the executable program code stored in the memory can be performed with described
The corresponding program of program code, for realizing virtual machine rebuilding method such as of any of claims 1-6.
12. a kind of non-transitorycomputer readable storage medium, is stored thereon with computer program, which is characterized in that the program
Such as virtual machine rebuilding method of any of claims 1-6 is realized when being executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811401343.3A CN109739614A (en) | 2018-11-22 | 2018-11-22 | Virtual machine rebuilding method, device and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811401343.3A CN109739614A (en) | 2018-11-22 | 2018-11-22 | Virtual machine rebuilding method, device and equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109739614A true CN109739614A (en) | 2019-05-10 |
Family
ID=66358034
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811401343.3A Pending CN109739614A (en) | 2018-11-22 | 2018-11-22 | Virtual machine rebuilding method, device and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109739614A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111190691A (en) * | 2019-12-25 | 2020-05-22 | 中国建设银行股份有限公司 | Automatic migration method, system, device and storage medium suitable for virtual machine |
CN111324424A (en) * | 2020-04-15 | 2020-06-23 | 中国联合网络通信集团有限公司 | Virtual machine deployment method, device, server and storage medium |
CN111400046A (en) * | 2020-03-16 | 2020-07-10 | 广州虎牙科技有限公司 | Database resource management method and device, resource management equipment and storage medium |
CN111722908A (en) * | 2020-06-12 | 2020-09-29 | 苏州浪潮智能科技有限公司 | Virtual machine creating method, system, equipment and medium |
CN112019368A (en) * | 2019-05-31 | 2020-12-01 | 中移(苏州)软件技术有限公司 | VNF migration method, VNF migration device and VNF migration storage medium |
WO2024022142A1 (en) * | 2022-07-26 | 2024-02-01 | 支付宝(杭州)信息技术有限公司 | Resource use method and apparatus |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102117226A (en) * | 2011-03-18 | 2011-07-06 | 浪潮(北京)电子信息产业有限公司 | Resource dispatching system and resource dispatching method |
EP2345962A2 (en) * | 2009-12-02 | 2011-07-20 | Hitachi, Ltd. | Virtual machine migration managing method, computer using the method, virtualizer using the method and computer system using the method |
CN103067425A (en) * | 2011-10-20 | 2013-04-24 | ***通信集团公司 | Creation method of virtual machine, management system of virtual machine and related equipment thereof |
CN103248659A (en) * | 2012-02-13 | 2013-08-14 | 北京华胜天成科技股份有限公司 | Method and system for dispatching cloud computed resources |
CN103455486A (en) * | 2012-05-28 | 2013-12-18 | 国际商业机器公司 | Database arranging method and system |
CN103810016A (en) * | 2012-11-09 | 2014-05-21 | 北京华胜天成科技股份有限公司 | Method and device for realizing virtual machine migration and cluster system |
CN103823541A (en) * | 2012-11-16 | 2014-05-28 | 北京航空航天大学 | Equipment and method for energy-saving dispatching of virtual data center |
CN104348881A (en) * | 2013-08-08 | 2015-02-11 | 中国电信股份有限公司 | Method and device for user resource partitioning in cloud management platform |
CN106250210A (en) * | 2016-08-03 | 2016-12-21 | 上海交通大学 | Dispatching method of virtual machine under cloud environment |
CN106681802A (en) * | 2015-11-06 | 2017-05-17 | 华为技术有限公司 | Virtual machine migration method, device and system |
CN107547595A (en) * | 2016-06-27 | 2018-01-05 | 腾讯科技(深圳)有限公司 | cloud resource scheduling system, method and device |
CN108388471A (en) * | 2018-01-31 | 2018-08-10 | 山东汇贸电子口岸有限公司 | A kind of management method constraining empty machine migration based on double threshold |
CN108667859A (en) * | 2017-03-27 | 2018-10-16 | 中兴通讯股份有限公司 | A kind of method and device for realizing scheduling of resource |
-
2018
- 2018-11-22 CN CN201811401343.3A patent/CN109739614A/en active Pending
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2345962A2 (en) * | 2009-12-02 | 2011-07-20 | Hitachi, Ltd. | Virtual machine migration managing method, computer using the method, virtualizer using the method and computer system using the method |
CN102117226A (en) * | 2011-03-18 | 2011-07-06 | 浪潮(北京)电子信息产业有限公司 | Resource dispatching system and resource dispatching method |
CN103067425A (en) * | 2011-10-20 | 2013-04-24 | ***通信集团公司 | Creation method of virtual machine, management system of virtual machine and related equipment thereof |
CN103248659A (en) * | 2012-02-13 | 2013-08-14 | 北京华胜天成科技股份有限公司 | Method and system for dispatching cloud computed resources |
CN103455486A (en) * | 2012-05-28 | 2013-12-18 | 国际商业机器公司 | Database arranging method and system |
CN103810016A (en) * | 2012-11-09 | 2014-05-21 | 北京华胜天成科技股份有限公司 | Method and device for realizing virtual machine migration and cluster system |
CN103823541A (en) * | 2012-11-16 | 2014-05-28 | 北京航空航天大学 | Equipment and method for energy-saving dispatching of virtual data center |
CN104348881A (en) * | 2013-08-08 | 2015-02-11 | 中国电信股份有限公司 | Method and device for user resource partitioning in cloud management platform |
CN106681802A (en) * | 2015-11-06 | 2017-05-17 | 华为技术有限公司 | Virtual machine migration method, device and system |
CN107547595A (en) * | 2016-06-27 | 2018-01-05 | 腾讯科技(深圳)有限公司 | cloud resource scheduling system, method and device |
CN106250210A (en) * | 2016-08-03 | 2016-12-21 | 上海交通大学 | Dispatching method of virtual machine under cloud environment |
CN108667859A (en) * | 2017-03-27 | 2018-10-16 | 中兴通讯股份有限公司 | A kind of method and device for realizing scheduling of resource |
CN108388471A (en) * | 2018-01-31 | 2018-08-10 | 山东汇贸电子口岸有限公司 | A kind of management method constraining empty machine migration based on double threshold |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112019368A (en) * | 2019-05-31 | 2020-12-01 | 中移(苏州)软件技术有限公司 | VNF migration method, VNF migration device and VNF migration storage medium |
CN112019368B (en) * | 2019-05-31 | 2022-06-10 | 中移(苏州)软件技术有限公司 | VNF migration method, VNF migration device and VNF migration storage medium |
CN111190691A (en) * | 2019-12-25 | 2020-05-22 | 中国建设银行股份有限公司 | Automatic migration method, system, device and storage medium suitable for virtual machine |
CN111400046A (en) * | 2020-03-16 | 2020-07-10 | 广州虎牙科技有限公司 | Database resource management method and device, resource management equipment and storage medium |
CN111400046B (en) * | 2020-03-16 | 2024-02-27 | 广州虎牙科技有限公司 | Database resource management method, device, resource management equipment and storage medium |
CN111324424A (en) * | 2020-04-15 | 2020-06-23 | 中国联合网络通信集团有限公司 | Virtual machine deployment method, device, server and storage medium |
CN111722908A (en) * | 2020-06-12 | 2020-09-29 | 苏州浪潮智能科技有限公司 | Virtual machine creating method, system, equipment and medium |
CN111722908B (en) * | 2020-06-12 | 2023-01-06 | 苏州浪潮智能科技有限公司 | Virtual machine creating method, system, equipment and medium |
WO2024022142A1 (en) * | 2022-07-26 | 2024-02-01 | 支付宝(杭州)信息技术有限公司 | Resource use method and apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109739614A (en) | Virtual machine rebuilding method, device and equipment | |
US11010206B2 (en) | Constrained placement in hierarchical randomized schedulers | |
US9413683B2 (en) | Managing resources in a distributed system using dynamic clusters | |
JP6423468B2 (en) | Dynamic selection of storage hierarchy | |
RU2702268C2 (en) | Scalable data storage pools | |
CN103810016B (en) | Realize method, device and the group system of virtual machine (vm) migration | |
US10203993B2 (en) | Method and system for continuous optimization of data centers by combining server and storage virtualization | |
US8217951B2 (en) | Graphic data processing apparatus and method | |
US8610725B2 (en) | Framework for dynamic configuration of hardware resources | |
US9223631B2 (en) | Performing an operation using multiple services | |
CN104519119B (en) | For throttling in the cloud computing environment of virtualization while running and share the method and system of multiple isomery migration sessions of same asset set | |
CN101681275A (en) | Scalable performance-based volume allocation in large storage controller collections | |
US11463509B2 (en) | Rolling capacity upgrade control | |
CN109814545A (en) | Replenishing method, device and the storage medium of the unmanned vending machine of automatic Pilot | |
CN108509339A (en) | Method for generating test case, device based on browser and mind map and equipment | |
CN109447253B (en) | Video memory allocation method and device, computing equipment and computer storage medium | |
US20070239746A1 (en) | Visual merge of portlets | |
CN104580194B (en) | Towards the virtual resources management method and device of Video Applications | |
CN101939729A (en) | Re-tasking a managed virtual machine image in a virtualization data processing system | |
US8881166B2 (en) | Method, data processing program, and computer program product to compensate for coupling overhead in a distributed computing system, and corresponding overhead calculator for a distributed computing system and corresponding computer system | |
CN106648826A (en) | Method and device for live migration of virtual machine | |
US7500186B2 (en) | Systems and methods for efficiently generating table layouts using moveable items | |
US9933929B1 (en) | Automatic layout management through static GUI analysis | |
CN108153565A (en) | The method and device of page info is provided | |
CN107180117A (en) | Chart recommends method, device and computer equipment |
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 |