CN106469085B - The online migration method, apparatus and system of virtual machine - Google Patents
The online migration method, apparatus and system of virtual machine Download PDFInfo
- Publication number
- CN106469085B CN106469085B CN201610793779.6A CN201610793779A CN106469085B CN 106469085 B CN106469085 B CN 106469085B CN 201610793779 A CN201610793779 A CN 201610793779A CN 106469085 B CN106469085 B CN 106469085B
- Authority
- CN
- China
- Prior art keywords
- disk
- working set
- virtual machine
- dirty
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
- G06F9/4856—Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/4557—Distribution of virtual machine instances; Migration and load balancing
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention provides a kind of online migration method, apparatus and system of virtual machine, this method comprises: obtaining the disk block data of predetermined number in the disk working set of source virtual machine, and the disk block data of predetermined number is written and are cached;The disk block data of predetermined number are transmitted to purpose host computer, and the memory pages data of source virtual machine are transmitted to purpose host computer;In memory page data transmission process, when memory pages dirty data converges to preset threshold, the memory pages dirty data copy mode of the dirty block number evidence of disk and source virtual machine in disk working set is determined;According to the memory pages dirty data copy mode of the dirty block number evidence of disk in disk working set and source virtual machine, the memory pages dirty data of the dirty block number evidence of disk in disk working set, and/or source virtual machine is transferred to purpose host computer;The disk block data of nonmagnetic disk working set are transferred to purpose host computer.As it can be seen that improving the online transport efficiency of virtual machine.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of online migration method, apparatus and system of virtual machine.
Background technique
Cloud computing is to provide on-demand, flexible, telescopic calculating and storage resource by computer network for user;With
The development of cloud computing, client by way of the on-demand access application in cloud and data become more and more important calculating
And service mode.Cloud divides are as follows: private clound, public cloud and mixed cloud, wherein public cloud is independently of enterprise-like corporation towards public affairs
Many clouds, private clound are the cloud towards organization internal, and mixed cloud is that the two or more private clounds of combination or public cloud are formed by
Infrastructure;Mixed cloud has the characteristics that flexibility, takes into account safety and elasticity, is that the development of the following cloud computing system deployment becomes
Gesture.
Virtualization technology is the core technology of cloud computing, and virtualization technology intercepts and captures virtual opetrating system by virtual middle layer
To the calling of physical layer interface, the difference of underlying computer hardware can be shielded, eliminates the coupling of system software and hardware, improves object
Manage the utilization rate of resource.The online migrating technology of virtual machine refers to the virtual machine service of running source virtual machine pellucidly from source
It moves in host computer and is run on another purpose host computer, while virtual machine service being kept not interrupt, avoid pair
Influenced caused by virtual machine service, be realize scheduling of resource, disaster recovery, on-line maintenance upgrading and save electric energy, provide elasticity,
One of essential technologies such as expansible and high availability.Wherein, virtual machine migrates online needs to consider moving for memory pages
It moves, the migration of the migration (i.e. the migrations of disk block data) of storage and network connection.A) in the same cloud environment, sourcesink analytic accounting
Image file is shared by modes such as network SAN, NAS between calculation machine and purpose host computer, it is only necessary to transmit memory pages;
B) virtual machine between multiple clouds migrates the migration etc. of the migration, storage that need to consider memory pages online.
Existing virtual machine can be divided into pre-copy, rear copy and mixing copy mode in line migration pattern.A) pre-copy
Mode: it completes before the starting of purpose virtual machine by data copy to be copied to the operation of purpose host computer;B) copy mode afterwards:
First only copy purpose virtual machine runs data necessary to virtual machine service, is transferred after starting purpose virtual machine by lacking block
Mode obtains data needed for residue;C copy mode) is mixed: in conjunction with pre-copy mode and rear copy mode.
Existing mixing copy mode is divided into three phases: 1) the pre-copy stage: by memory page data and entire disk block
Data copy is to purpose host computer;Wherein, when some disk block data is modified in the pre-copy stage, then by disk position
The disk block that this in chart is modified is labeled as 1;2) it shuts down the copy stage: stopping the operation of source virtual machine, residue is not copied
Memory page data and disk bitmap table be sent to purpose host computer, and start purpose virtual machine;3) stage is copied after: being caught
I/O operation is obtained, if the access to data in the disk block for being are marked in disk bitmap table, is then obtained from the request of sourcesink master computer
It takes by data in the modified disk block (i.e. the dirty block number evidence of disk), update disk block data in purpose host computer and incites somebody to action
In disk bitmap table the disk block label be set to 0, so until migration complete, while rear copy stage sourcesink master computer not
It is disconnected that other disk dirty data blocks are pushed to purpose host computer, and modify label in disk bitmap table and be.
As it can be seen that needing to copy entire disk block, pre-copy stage institute in the pre-copy stage in existing mixing copy mode
It takes time longer, causes the dirty block number of disk generated according to more, to increase the data bulk for needing to retransmit, reduce virtual
The online transport efficiency of machine.
Summary of the invention
The present invention provides a kind of online migration method, apparatus and system of virtual machine, improves the online transport efficiency of virtual machine.
In a first aspect, the present invention provides a kind of online moving method of virtual machine, comprising:
The disk block data of predetermined number in the disk working set of source virtual machine are obtained, and by the disk of the predetermined number
Block number is cached according to write-in, wherein the disk working set is the set of disk block to be visited in preset time period;
The disk block data of the predetermined number are transmitted to purpose host computer, and by the memory of the source virtual machine
Page data is transmitted to the purpose host computer;Wherein, operation has purpose virtual machine in the purpose host computer;
In the memory pages data transmission procedure, when the memory pages dirty data converges to preset threshold, really
The memory pages dirty data copy mode of the dirty block number evidence of disk and the source virtual machine in the fixed disk working set;
According to the memory pages dirty data copy side of the dirty block number evidence of disk and the source virtual machine in the disk working set
The memory pages dirty data of the dirty block number evidence of disk in the disk working set, and/or the source virtual machine is transferred to institute by formula
State purpose host computer;
The disk block data of nonmagnetic disk working set are transferred to the purpose host computer, wherein the nonmagnetic disk work
Making collection is the disk set of blocks in the source virtual machine in addition to the disk working set.
Optionally, described dirty according to the memory pages of the dirty block number evidence of disk and the source virtual machine in the disk working set
Before data copy mode, further includes:
By the dirty block number of disk in the disk working set according to being written the caching, and by the magnetic in the disk working set
The dirty block number of disk is transmitted according to the purpose host computer.
Optionally, the memory pages of the dirty block number evidence of disk and the source virtual machine are dirty in the determination disk working set
Before data copy mode, further includes:
Obtain dirty piece of data production rate P1 of disk of the disk working set, remaining magnetic in presently described disk working set
The transmission rate P2 that the disk block data of dirty piece of number M of disk and the disk working set are transmitted to purpose host computer;
According to dirty piece of number M of remaining disk in the presently described disk working set and the disk working set
The transmission rate P2 that disk block data are transmitted to purpose host computer is calculated and is shut down copy time segment length and described stop
Dirty piece of number N of maximum residual disk in machine copy time section;
Wherein, M and N is the positive integer greater than 0, and P1 and P2 are greater than 0.
Optionally, the memory pages of the dirty block number evidence of disk and the source virtual machine are dirty in the determination disk working set
Data copy mode, comprising:
When M is less than or equal to N, executes step A: stopping the source virtual machine, and disk in the disk working set is dirty
The memory pages dirty data of block number evidence and the source virtual machine is transmitted to the purpose host computer;Alternatively,
P1 continues the dirty block number of disk in the disk working set less than P2 and when M is greater than N according to the write-in caching
Until executing step A when M is less than or equal to N in default timeout period;Otherwise, step B is executed;
P1 executes step B: stopping the source virtual machine, by the disk working set more than or equal to P2 and when M is greater than N
In dirty piece of the disk disk block for being changed to nonmagnetic disk working set, and by the memory pages dirty data of the source virtual machine to described
The transmission of purpose host computer.
Optionally, in the disk block data write-in process of caching by the predetermined number, the method also includes:
Intercept and capture the write operation that the data in magnetic disk block of the caching is had been written into the disk working set;
Data to be written are written in the caching according to the write operation.
Optionally, in the disk working set for obtaining source virtual machine before the disk block data of predetermined number, further includes:
Intercept and capture all IO read-write operations in preset time period;
According to the IO read-write operation and working set seleciton algorithm, disk working set/inoperative collection information is determined;Its
In, the disk working set/inoperative collection information includes: the instruction information of disk working set and the instruction of nonmagnetic disk working set
Information.
Second aspect, the present invention provide a kind of online moving apparatus of virtual machine, comprising:
Processing module, the disk block data of predetermined number in the disk working set for obtaining source virtual machine, and will be described
Caching is written in the disk block data of predetermined number, wherein the disk working set is disk block to be visited in preset time period
Set;
First transmission module, for the disk block data of the predetermined number to be transmitted to purpose host computer, and will
The memory pages data of the source virtual machine are transmitted to the purpose host computer;Wherein, in the purpose host computer
Operation has purpose virtual machine;
Determining module is used in the memory pages data transmission procedure, when the memory pages dirty data converges to
When preset threshold, determine that the memory pages dirty data of the dirty block number evidence of disk and the source virtual machine copies in the disk working set
Mode;
Second transmission module, for the memory according to disk dirty block number evidence and the source virtual machine in the disk working set
Page dirty data copy mode, by the dirty block number evidence of disk in the disk working set, and/or the page of the source virtual machine
Face dirty data is transferred to the purpose host computer;
Third transmission module, for the disk block data of nonmagnetic disk working set to be transferred to the purpose host computer,
Wherein, the nonmagnetic disk working set is the disk set of blocks in the source virtual machine in addition to the disk working set.
Optionally, described device, further includes:
4th transmission module, for by the dirty block number of disk in the disk working set according to being written the caching, and by institute
The dirty block number of disk stated in disk working set is transmitted according to the purpose host computer.
Optionally, described device, further includes:
Module is obtained, for obtaining dirty piece of data production rate P1 of disk of the disk working set, presently described disk work
Make that the disk block data of remaining dirty piece of number M of disk and the disk working set is concentrated to transmit to purpose host computer
Transmission rate P2;
Computing module, for according to dirty piece of number M of remaining disk in the presently described disk working set and described
The transmission rate P2 that the disk block data of disk working set are transmitted to purpose host computer is calculated and is shut down copy time segment length
Dirty piece of number N of maximum residual disk in degree and the shutdown copy time section;
Wherein, M and N is the positive integer greater than 0, and P1 and P2 are greater than 0.
Optionally, the determining module is specifically used for:
When M is less than or equal to N, executes step A: stopping the source virtual machine, and disk in the disk working set is dirty
The memory pages dirty data of block number evidence and the source virtual machine is transmitted to the purpose host computer;Alternatively,
P1 continues the dirty block number of disk in the disk working set less than P2 and when M is greater than N according to the write-in caching
Until executing step A when M is less than or equal to N in default timeout period;Otherwise, step B is executed;
P1 executes step B: stopping the source virtual machine, by the disk working set more than or equal to P2 and when M is greater than N
In dirty piece of the disk disk block for being changed to nonmagnetic disk working set, and by the memory pages dirty data of the source virtual machine to described
The transmission of purpose host computer.
Optionally, the processing module is also used to:
Intercept and capture the write operation that the data in magnetic disk block of the caching is had been written into the disk working set;
Data to be written are written in the caching according to the write operation.
Optionally, described device, further includes:
Interception module, for intercepting and capturing all IO read-write operations in preset time period;
Determining module, for determining disk working set/non-work according to the IO read-write operation and working set seleciton algorithm
Make collection information;Wherein, the disk working set/inoperative collection information includes: the instruction information and nonmagnetic disk of disk working set
The instruction information of working set.
The third aspect, the present invention provide a kind of online migratory system of virtual machine, comprising: run the sourcesink analytic accounting of source virtual machine
Calculation machine and the purpose host computer for running purpose virtual machine, wherein include such as above-mentioned second in the sourcesink master computer
The online moving apparatus of virtual machine described in any one of aspect.
In the present invention, pass through the disk block data and memory in disk working set of the pre-copy stage by source virtual machine
Page data is transmitted to purpose host computer;In memory page data transmission process, when memory pages dirty data converges to
When preset threshold, the memory pages dirty data copy mode of the dirty block number evidence of disk and source virtual machine in disk working set is determined, and
It, will be in disk working set according to the memory pages dirty data copy mode of the dirty block number evidence of disk in disk working set and source virtual machine
The memory pages dirty data of the dirty block number evidence of disk, and/or source virtual machine is transferred to purpose host computer;Further, rear
The disk block data of nonmagnetic disk working set are transferred to purpose host computer by the copy stage;As it can be seen that only being needed in the pre-copy stage
The disk block data in disk working set are copied, the required pre-copy time is shorter, reduces the generated dirty block number of disk according to number
Amount substantially increases the online transport efficiency of virtual machine to reduce the data bulk for needing to retransmit.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair
Bright some embodiments for those of ordinary skill in the art without any creative labor, can be with
It obtains other drawings based on these drawings.
Figure 1A is the application scenarios schematic diagram of the online moving method of virtual machine of the present invention;
Figure 1B is the flow diagram of the online moving method embodiment one of virtual machine of the present invention;
Fig. 2 is the application architecture schematic diagram of the online moving method of virtual machine of the present invention;
Fig. 3 is the structural schematic diagram of the online moving apparatus embodiment one of virtual machine of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
This application involves disk working set refer to: within a preset period of time, the process of source virtual machine needs the magnetic accessed
Disk set of blocks;It is corresponding, this application involves nonmagnetic disk working set refer to: the disk in source virtual machine in addition to disk working set
Set of blocks.
This application involves memory pages dirty data refer to: (SuSE) Linux OS is using page as cache
Unit, when process has modified the data in cache, which is just that memory is dirty by (SuSE) Linux OS kernel flag
Page, the data which includes are memory pages dirty data.
This application involves the dirty block number of disk according to referring to: by (SuSE) Linux OS kernel flag be interior in some page
After depositing containing dirty pages, (SuSE) Linux OS kernel will be in the suitable time by the data (i.e. memory pages dirty data) of memory containing dirty pages
It writes in disk mirroring, to keep the data in cache consistent with the data in disk mirroring;In disk mirroring certain
A disk block data are modified in page, but latest data has not been written in disk mirroring and corresponds in disk block, the magnetic
Disk block number is according to the as dirty block number evidence of disk.
In existing mixing copy mode, need to copy entire disk block in the pre-copy stage, the pre-copy stage is taken
Between it is longer, cause the dirty block number of disk generated according to more, to increase the data bulk for needing to retransmit, reduce virtual machine and exist
Line transport efficiency.
The online moving method of virtual machine provided by the embodiments of the present application, by dividing pre-copy according to disk working set dynamic
(the disk block data in disk working set need to copy the disk block data in stage and rear copy stage as the pre-copy stage
Disk block, the disk block data in nonmagnetic disk working set copy the disk block in stage as after);As it can be seen that the pre-copy stage only
The disk block data in disk working set need to be copied, the required pre-copy time is shorter, reduces the dirty block number evidence of generated disk
Quantity substantially increases the online transport efficiency of virtual machine to reduce the data bulk for needing to retransmit.
With reference to the accompanying drawing by specific embodiment to the online moving method of virtual machine provided in an embodiment of the present invention, device
And system is described in detail.
Figure 1A is the application scenarios schematic diagram of the online moving method of virtual machine of the present invention, and Figure 1B is that virtual machine of the present invention is online
The flow diagram of moving method embodiment one.As shown in Figure 1A, source virtual machine, purpose host meter are run in sourcesink master computer
Purpose virtual machine is run in calculation machine.The executing subject of the present embodiment can be online for virtual machine of the configuration in sourcesink master computer
Moving apparatus, the device can pass through software and or hardware realization.The scheme of the present embodiment can be improved virtual machine and migrate effect online
Rate.As shown in Figure 1B, the method for the present embodiment may include:
S101, the disk block data for obtaining predetermined number in the disk working set of source virtual machine, and by the magnetic of predetermined number
Disk block number is cached according to write-in.
In this step, the online moving apparatus of virtual machine obtains the disk block of predetermined number in the disk working set of source virtual machine
Data, and the disk block data of predetermined number are written and are cached, the disk block data are transmitted to purpose host meter to wait
Calculation machine, wherein disk working set is the set of disk block to be visited in preset time period.Optionally, in the disk working set
When the disk block data of available for transmission, the disk block data of predetermined number are remained in caching, until in the disk working set
Institute's available for transmission disk block data end of transmission until, for example, being cached when N number of disk block data are written, when wherein 1 magnetic
For disk block number according to when being successfully transmitted to purpose host computer, remaining N-1 disk block data in caching at this time can be again by disk work
Make one concentrated disk block data write-in caching to be transmitted, repeatedly, until all to be passed in the disk working set
Until defeated disk block data end of transmission.
Optionally, in the disk block data write-in process of caching by predetermined number, the online moving apparatus of virtual machine passes through
The write operation for having been written into the data in magnetic disk block of caching in the disk working set is intercepted and captured, and data to be written are written according to the write operation
In caching, such as by intercepting and capturing input and output (Input Output, abbreviation IO) read-write operation, if in the disk working set
Have been written into the write operation of the data in magnetic disk block of caching, then it will be in data to be written write-in caching according to the write operation.
S102, the disk block data of predetermined number are transmitted to purpose host computer, and by the page of source virtual machine
Face data is transmitted to purpose host computer.
In this step, the online moving apparatus of virtual machine is by the disk block data of the predetermined number in caching successively to purpose
Host computer (in purpose host computer operation have purpose virtual machine) transmission, by institute's available for transmission in disk working set
After disk block data are successively transmitted to purpose host computer, further, and by the memory pages data of source virtual machine to mesh
Host computer transmission, optionally, using iteration pre-copy mode by the memory pages data of source virtual machine to purpose host
Computer transmission, wherein iteration pre-copy mode refers to: the first round calculates entire memory pages data copy to purpose host
Machine, second wheel only copy the memory pages data (i.e. memory pages dirty data) being modified in the first round, and so on directly
Preset threshold is converged to memory pages dirty data, stops copying remaining memory pages dirty data.
Optionally, in memory page data transmission process, the online moving apparatus of virtual machine, which passes through, intercepts and captures IO read-write operation,
And by the dirty block number of disk in disk working set according to purpose host computer is synchronized to, optionally, by will be in disk working set
The dirty block number of disk be first written caching, and the dirty block number of disk in the disk working set in caching will be had been written into according to purpose place
Master computer transmission.
S103, in memory page data transmission process, when memory pages dirty data converges to preset threshold, determine magnetic
The memory pages dirty data copy mode of the dirty block number evidence of disk and source virtual machine in disk working set.
It is empty when memory pages dirty data converges to preset threshold in memory page data transmission process in this step
The quasi- online moving apparatus of machine determines the memory pages of disk dirty block number evidence and source virtual machine in disk working set according to preset strategy
Dirty data copy mode.
Optionally it is determined that in disk working set the dirty block number evidence of disk and source virtual machine memory pages dirty data copy mode
Before, further includes:
Obtain dirty piece of data production rate P1 of disk of disk working set, when disk remaining in front disk working set dirty piece
The transmission rate P2 that the disk block data of number M and disk working set are transmitted to purpose host computer;
According in the front disk working set disk block data of dirty piece of number M of remaining disk and disk working set to
The transmission rate P2 of purpose host computer transmission is calculated and is shut down copy time segment length and shut down in copy time section most
Dirty piece of number N of big residue disk;Wherein, M and N is the positive integer greater than 0, and P1 and P2 are greater than 0.
In the present embodiment, the online moving apparatus of virtual machine passes through the dirty piece of data production rate of disk for obtaining disk working set
P1, when the disk block data of dirty piece of number M of disk remaining in front disk working set and disk working set to purpose host count
The transmission rate P2 of calculation machine transmission, and according to when dirty piece of number M of remaining disk and disk working set in front disk working set
The transmission rate P2 that is transmitted to purpose host computer of disk block data, calculate separately shut down copy time segment length t1, with
And dirty piece of number N of maximum residual disk in copy time section is shut down, optionally, when the default maximum shutdown of t1=M/P2, N=copies
Between segment length t2*P2, certainly, the online moving apparatus of virtual machine can also by other deformation formulas of above-mentioned calculation formula or its
Its mode calculates t1 and N, in the embodiment of the present application to this and with no restriction.
Optionally it is determined that in disk working set the dirty block number evidence of disk and source virtual machine memory pages dirty data copy side
Formula, comprising:
When M is less than or equal to N, execute step A: stopping source virtual machine, and by the dirty block number evidence of disk in disk working set and
The memory pages dirty data of source virtual machine is transmitted to purpose host computer;Alternatively,
P1 continues the dirty block number of disk in disk working set according to write-in caching less than P2 and when M is greater than N until pre-
If M is less than or equal to N in timeout period, step A is executed;Otherwise, step B is executed;
P1 executes step B more than or equal to P2 and when M is greater than N: stopping source virtual machine, by the disk in disk working set
Dirty piece is changed to the disk block of nonmagnetic disk working set, and the memory pages dirty data of source virtual machine is passed to purpose host computer
It is defeated.
In the present embodiment, the online moving apparatus of virtual machine determines the dirty block number evidence of disk in disk working set according to preset strategy
With the memory pages dirty data copy mode of source virtual machine, optionally, i) when M is less than or equal to N, (virtual machine migrates online
Dirty piece of whole of M disk can be transferred to purpose host calculating in default maximum shut down in copy time segment length t2 by device
Machine), it thens follow the steps A: stopping source virtual machine, and by the memory pages of dirty the block number evidence and source virtual machine of disk in disk working set
Dirty data is transmitted to purpose host computer;Ii it) (even shuts down needed for copy and shuts down at this time when P1 is less than P2 and M is greater than N
Copy time segment length t1 is greater than default maximum shutdown copy time segment length t2, and P1 is less than P2, then continuing pre-copy
Stage can be such that M reduces), then continue the dirty block number of disk in disk working set according to write-in caching until in default time-out time
When M is less than or equal to N in section, step A is executed;Otherwise, step B is executed;Iii) when P1 is greater than or equal to P2 and M is greater than N
(the required copy time segment length t1 that shuts down of copy is even shut down at this time is greater than default maximum shutdown copy time segment length t2, and
P1 is greater than or equal to P2, and the continuation pre-copy stage can't make the dirty block number of disk according to reduction), it thens follow the steps B: it is virtual to stop source
Machine, while being no more than default maximum shutdown copy time segment length to shut down the required copy time segment length t1 that shuts down of copy
T2, the disk block for being changed to nonmagnetic disk working set for dirty piece of the disk in disk working set (i.e. will be in disk working set bitmap table
It is updated to 0) about dirty piece of the disk corresponding mark, only by the memory pages dirty data of source virtual machine to purpose host computer
Transmission, at this time without transmitting dirty piece of disk in the disk working set to purpose host computer, can the rear copy stage again
It is transmitted.
As it can be seen that the online moving apparatus of virtual machine determines disk working set according to the different situations of P1, P2, M, N, t1 and t2 etc.
The memory pages dirty data copy mode of middle disk dirty block number evidence and source virtual machine, the disk for not only avoiding disk working set are dirty
The too long problem of copy time segment length t1 is shut down caused by block data production rate P1 is excessively high, while ensure that shutdown copy time
Segment length t1 is in the range of default maximum shutdown copy time segment length t2, to avoid causing source virtual machine performance excessive
It influences.
S104, according to the memory pages dirty data copy mode of the dirty block number evidence of disk in disk working set and source virtual machine,
The memory pages dirty data of the dirty block number evidence of disk in disk working set, and/or source virtual machine is transferred to purpose host to calculate
Machine.
In this step, the online moving apparatus of virtual machine is according in the dirty block number evidence of disk in disk working set and source virtual machine
Deposit page dirty data copy mode (the copy side determined such as the above-mentioned different situations according to P1, P2, M, N, t1 and t2 etc.
Formula), the memory pages dirty data of the dirty block number evidence of disk in disk working set, and/or source virtual machine is transferred to purpose host meter
Calculation machine.
S105, the disk block data of nonmagnetic disk working set are transferred to purpose host computer.
In this step, virtual machine transmits the disk block data of nonmagnetic disk working set in the rear copy stage in line moving apparatus
To purpose host computer, wherein nonmagnetic disk working set is the disk set of blocks in source virtual machine in addition to disk working set;It can
Selection of land, virtual machine dirty block number of disk in the disk block working set that the rear copy stage can not also transmit residue in line moving apparatus
According to being transferred to purpose host computer;When whole disk block data full name are copied to purpose host computer, then completion is migrated.
As it can be seen that the dirty block number of disk only in disk working set is transmitted several times according to possible needs, the disk block number in nonmagnetic disk working set
According to transmission primaries are only needed, reduce the data bulk for needing to retransmit.
In the present embodiment, by disk block data in disk working set of the pre-copy stage by source virtual machine and interior
It deposits page data and is transmitted to purpose host computer;In memory page data transmission process, when memory pages dirty data is restrained
When to preset threshold, the memory pages dirty data copy mode of the dirty block number evidence of disk and source virtual machine in disk working set is determined,
And according to the memory pages dirty data copy mode of the dirty block number evidence of disk in disk working set and source virtual machine, by disk working set
The dirty block number of middle disk according to, and/or the memory pages dirty data of source virtual machine be transferred to purpose host computer;Further, In
The disk block data of nonmagnetic disk working set are transferred to purpose host computer by the copy stage afterwards;As it can be seen that the pre-copy stage only
The disk block data in disk working set need to be copied, the required pre-copy time is shorter, reduces the dirty block number evidence of generated disk
Quantity substantially increases the online transport efficiency of virtual machine to reduce the data bulk for needing to retransmit.
Optionally, before step S101, further includes:
Intercept and capture all IO read-write operations in preset time period;
According to the IO read-write operation and working set seleciton algorithm, disk working set/inoperative collection information is determined.
In the present embodiment, the magnetic of the online moving apparatus of virtual machine predetermined number in the disk working set for obtaining source virtual machine
Before disk block number evidence, by intercepting and capturing all IO read-write operations in preset time period, all IO read-write operations pair are determined respectively
The read-write operation information (for example, action type, disk block identification information of operation etc.) answered further is read and write according to all IO and is grasped
Make corresponding read-write operation information and working set seleciton algorithm, determines disk working set/inoperative collection information;Wherein, should
Disk working set/inoperative collection information includes: the instruction information of disk working set and the instruction information of nonmagnetic disk working set;It can
Selection of land, disk working set/inoperative collection information can be identified with disk working set bitmap sheet form, for example, disk working set bitmap
Some corresponding numerical value of disk block identification in table is 0 to represent: the corresponding disk block of disk block identification is nonmagnetic disk working set
In disk block;Some corresponding numerical value of disk block identification in disk working set bitmap table is 1 representative: the disk block identification pair
The disk block answered is the disk block in disk working set.Certainly, disk working set/inoperative collection information can also pass through other shapes
Formula mark, in the embodiment of the present application to this and with no restriction.Optionally, working set seleciton algorithm can be carried out using Hash mapping
Index, at the same using circular list realize first in first out, or can also using memory working set seleciton algorithm (such as using
Spatial locality and temporal locality, using fifo algorithm);Certainly, the working set seleciton algorithm that the present embodiment is related to is also
Other selection algorithms can be used, in the present embodiment to this and with no restriction.
Fig. 2 is the application architecture schematic diagram of the online moving method of virtual machine of the present invention.As shown in Fig. 2, sourcesink master computer
It include: source memory, source internal memory migration unit, intelligence shutdown copy cell, source disk migration units, source transmission unit and source disk
Mirror image, wherein source disk migration units include: source I O process subelement, source IO read-write subelement, dirty piece of disk synchronous subelement
And source disk buffer area;Purpose host computer include: purpose memory, purpose internal memory migration unit, purpose disk migration units,
Purpose transmission unit and purpose disk mirroring, wherein purpose disk migration units include: purpose I O process subelement, purpose IO
Read and write subelement and purpose disk buffering area.As shown in Fig. 2, on the basis of the above embodiments, virtual machine of the present invention moves online
The function of each unit is described in detail in shifting method embodiment two.
The online moving method of the present embodiment virtual machine includes: migration last stage and migration phase, wherein migration phase packet
Include: the pre-copy stage shuts down copy stage and rear copy stage, according to phase sequence to the function of each unit in the present embodiment
Accordingly described.
1) last stage is migrated
Source I O process subelement is used to intercept and capture all IO read-write operations in preset time period, determines that all IO are read respectively
The corresponding read-write operation information of write operation (for example, action type, disk block identification information of operation etc.), further according to all
The corresponding read-write operation information of IO read-write operation and working set seleciton algorithm determine disk working set/inoperative collection information,
Optionally, disk working set/inoperative collection information can be identified with disk working set bitmap sheet form.
2) the pre-copy stage
Source IO reads and writes subelement and is used to that the disk block data in disk working set to be written according to disk working set bitmap table
Source disk buffer area, optionally, source IO read-write subelement check disk working set bitmap table and bitmap table of having moved, if disk work
Make that some disk block data in collection bitmap table in disk working set are corresponding to be identified as 1 and the disk block in bitmap table of having moved
Data are corresponding to be identified as 0 (indicating that the disk block data are not migrated), then source IO reads and writes subelement and writes the disk block data
Enter source disk buffer area, and the corresponding mark of the disk block data is revised as 1 and (indicates the disk block number in the bitmap table that will have moved
According to being migrated);After institute's available for transmission disk block data in disk working set are transmitted to purpose host computer, notice
Source internal memory migration unit, so that source internal memory migration unit starts to migrate the memory pages data of source virtual machine.
The disk block data in disk working set are written in source disk buffer area in source IO read-write subelement, source I O process
Subelement is used for all IO read-write operations of interception system, determines the corresponding read-write operation letter of all IO read-write operations respectively
Breath, and judge whether it is to the write operation for having transmitted data in magnetic disk block in disk working set, if so, by the read-write operation information
And data to be written are sent to dirty piece of disk synchronous subelement;If it is not, not dealing with then.
Dirty piece of disk synchronous subelement is used to receive the read-write operation information and data to be written of source I O process subelement transmission,
And check disk working set bitmap table and have moved bitmap table, A) if some in disk working set bitmap table in disk working set
The corresponding mark of the disk block data is all 1 (i.e. disk block in the corresponding mark of disk block data and bitmap table of having moved
Data are the dirty block number evidence of disk), then source disk buffer area is written into read-write operation information and data to be written, waiting is transmitted to purpose
Host computer;B) if some disk block data in disk working set bitmap table in disk working set it is corresponding be identified as 1 and
It has moved this in bitmap table disk block data is corresponding and be identified as 0, then it represents that the disk block migrates not yet, does not need temporarily same
Step.Meanwhile dirty piece of disk synchronous subelement is also used to: the dirty piece of data production rate P1 of disk and record for updating disk working set work as
Remaining dirty piece of number M of disk etc. in front disk working set.
Source internal memory migration unit is used for the memory pages data of source virtual machine using iteration pre-copy mode to purpose place
Master computer transmission notifies intelligence to shut down copy cell, when memory pages Data Convergence reaches preset threshold to determine magnetic
The memory pages dirty data copy mode of the dirty block number evidence of disk and source virtual machine in disk working set.
Source internal memory migration unit by the memory pages data of source virtual machine into purpose host computer transmission process, source
I O process subelement is also used to all IO read-write operations of interception system, and by the dirty block number of disk in disk working set according to synchronization
To purpose host computer.
3) the copy stage is shut down
Intelligence shuts down copy cell and is used to inquire dirty piece of data production rate P1 of disk of disk working set, when front disk works
The transmission for concentrating the disk block data of dirty piece of number M of remaining disk and disk working set to transmit to purpose host computer
Rate P2, and calculate and shut down dirty piece of number N of maximum residual disk in copy time segment length t1 and shutdown copy time section,
Wherein, the concrete mode for calculating t1 and N can refer to corresponding portion in above-described embodiment, and details are not described herein again;I) when M is less than or waits
When N, step A is executed: stopping source virtual machine, and by the memory pages of dirty the block number evidence and source virtual machine of disk in disk working set
Dirty data is transmitted to purpose host computer;Ii) when P1 is less than P2 and M is greater than N, continue the pre-copy stage (i.e. by disk work
Make the dirty block number of disk concentrated to cache according to write-in) until executing step A when M is less than or equal to N in default timeout period;
Otherwise, step B is executed;Iii it) when P1 is greater than or equal to P2 and M is greater than N, executes step B: stopping source virtual machine, by disk
Dirty piece of disk in working set be changed to nonmagnetic disk working set disk block (i.e. by disk working set bitmap table about the disk
0) dirty piece of corresponding mark is updated to, and the memory pages dirty data of source virtual machine is transmitted and incited somebody to action to purpose host computer
About dirty piece of the disk corresponding mark update notification purpose host computer.
Intelligence is shut down copy cell and is also used at the end of shutting down the copy stage, notifies purpose host computer and/or leads to
The stage is copied after knowing source IO read-write subelement starting.
Optionally, intelligence, which shuts down copy cell, to inquire P1 and M to dirty piece of disk synchronous subelement;Optionally, Intelligent stop
P2 and default maximum shutdown copy time segment length t2 is previously stored in machine copy cell.
4) stage is copied after
IO read-write subelement in source is used to the disk block data of nonmagnetic disk working set being transferred to purpose host computer, optional
Ground, by checking disk working set bitmap table and bitmap table of having moved, if in disk working set bitmap table in disk working set
The corresponding mark of the disk block data is all 0 in the corresponding mark of some disk block data and bitmap table of having moved, then should
Source disk buffer area is written in disk block data, is transmitted to purpose host computer, and the disk block number in the bitmap table that will have moved
1 (indicating that the disk block data have been migrated) is revised as according to corresponding mark.
Purpose I O process subelement is used to intercept and capture all IO read-write operations in preset time period, judges whether to not migrating
The read/write operation of disk block data;A) if read operation, then magnetic needed for the source I O process subunits request to sourcesink master computer
Disk block number evidence, so that required disk block data are transmitted to purpose host computer by source I O process subunits request as early as possible;B) if
It is write operation, then data to be written is write direct into purpose disk buffering area, and the disk block data pair in the bitmap table that will have moved
The mark answered is updated to 1 (indicating that the disk block data have been migrated);C) if the read/write to disk block data of having moved is grasped
Make, then directly carries out read/write.
Purpose IO read-write subelement is used to read the disk block data write-in purpose disk mirroring in purpose disk buffering area
In, and the data of purpose I O process subunits request are written in purpose disk mirroring.
Optionally, in above-mentioned each stage, source I O process subelement is also used to real-time update disk working set/inoperative collection
Information.
In conclusion the online moving method of virtual machine provided by the embodiments of the present application, by according to disk working set dynamic
It divides the pre-copy stage and (the disk block data in disk working set is as the pre-copy stage for the disk block data in copy stage afterwards
The disk block for needing to copy, the disk block data in nonmagnetic disk working set copy the disk block in stage as after), therefore, pre-
The copy stage only needs the disk block data in copy disk working set, and the required pre-copy time is shorter, is realizing smaller scarce block rate
Under the premise of, reduce the dirty block number data bulk of generated disk and is greatly improved to reduce the data bulk for needing to retransmit
Virtual machine online transport efficiency;Further, disk working set is determined according to the different situations of P1, P2, M, N, t1 and t2 etc.
The memory pages dirty data copy mode of middle disk dirty block number evidence and source virtual machine, the disk for not only avoiding disk working set are dirty
The too long problem of copy time segment length t1 is shut down caused by block data production rate P1 is excessively high, while ensure that shutdown copy time
Segment length t1 is in the range of default maximum shutdown copy time segment length t2, to avoid causing source virtual machine performance excessive
It influences.
Fig. 3 is the structural schematic diagram of the online moving apparatus embodiment one of virtual machine of the present invention.As shown in figure 3, the present embodiment
The online moving apparatus 30 of the virtual machine of offer, comprising:
Processing module 301, the disk block data of predetermined number in the disk working set for obtaining source virtual machine, and by institute
State the disk block data write-in caching of predetermined number, wherein the disk working set is disk block to be visited in preset time period
Set;
First transmission module 302, for the disk block data of the predetermined number to be transmitted to purpose host computer, and
The memory pages data of the source virtual machine are transmitted to the purpose host computer;Wherein, the purpose host computer
Middle operation has purpose virtual machine;
Determining module 303 is used in the memory pages data transmission procedure, when the memory pages dirty data is restrained
When to preset threshold, determine that the memory pages dirty data of the dirty block number evidence of disk and the source virtual machine is copied in the disk working set
Shellfish mode;
Second transmission module 304, for according to the dirty block number evidence of disk in the disk working set and the source virtual machine
Memory pages dirty data copy mode, will be in the dirty block number evidence of disk in the disk working set, and/or the source virtual machine
It deposits page dirty data and is transferred to the purpose host computer;
Third transmission module 305 is calculated for the disk block data of nonmagnetic disk working set to be transferred to the purpose host
Machine, wherein the nonmagnetic disk working set is the disk set of blocks in the source virtual machine in addition to the disk working set.
Further, the online moving apparatus 30 of virtual machine further include:
4th transmission module, for by the dirty block number of disk in the disk working set according to being written the caching, and by institute
The dirty block number of disk stated in disk working set is transmitted according to the purpose host computer.
Further, the online moving apparatus 30 of virtual machine further include:
Module is obtained, for obtaining dirty piece of data production rate P1 of disk of the disk working set, presently described disk work
Make that the disk block data of remaining dirty piece of number M of disk and the disk working set is concentrated to transmit to purpose host computer
Transmission rate P2;
Computing module, for according to dirty piece of number M of remaining disk in the presently described disk working set and described
The transmission rate P2 that the disk block data of disk working set are transmitted to purpose host computer is calculated and is shut down copy time segment length
Dirty piece of number N of maximum residual disk in degree and the shutdown copy time section;
Wherein, M and N is the positive integer greater than 0, and P1 and P2 are greater than 0.
Further, the determining module 303 is specifically used for:
When M is less than or equal to N, executes step A: stopping the source virtual machine, and disk in the disk working set is dirty
The memory pages dirty data of block number evidence and the source virtual machine is transmitted to the purpose host computer;Alternatively,
P1 continues the dirty block number of disk in the disk working set less than P2 and when M is greater than N according to the write-in caching
Until executing step A when M is less than or equal to N in default timeout period;Otherwise, step B is executed;
P1 executes step B: stopping the source virtual machine, by the disk working set more than or equal to P2 and when M is greater than N
In dirty piece of the disk disk block for being changed to nonmagnetic disk working set, and by the memory pages dirty data of the source virtual machine to described
The transmission of purpose host computer.
Further, the processing module 301 is also used to:
Intercept and capture the write operation that the data in magnetic disk block of the caching is had been written into the disk working set;
Data to be written are written in the caching according to the write operation.
Further, the online moving apparatus 30 of virtual machine further include:
Interception module, for intercepting and capturing all IO read-write operations in preset time period;
Determining module, for determining disk working set/non-work according to the IO read-write operation and working set seleciton algorithm
Make collection information;Wherein, the disk working set/inoperative collection information includes: the instruction information and nonmagnetic disk of disk working set
The instruction information of working set.
Optionally, the function of each module can be by shown in above-mentioned Fig. 2 in the online moving apparatus of the virtual machine of the present embodiment
Sourcesink master computer in corresponding units realize that it is real that specific implementation is detailed in the online moving method of aforementioned present invention virtual machine
Example two is applied, details are not described herein again.
The online moving apparatus of the virtual machine of the present embodiment can be used for executing the above-mentioned online moving method of virtual machine of the present invention
Technical solution in any embodiment, it is similar that the realization principle and technical effect are similar, and details are not described herein again.
The embodiment of the present invention also provides a kind of online migratory system of virtual machine, provided in this embodiment referring to Fig.1 shown in A
The online migratory system of virtual machine, comprising: run the sourcesink master computer of source virtual machine and run the purpose place of purpose virtual machine
Master computer, wherein include void described in the online moving apparatus embodiment one of above-mentioned virtual machine in the sourcesink master computer
The quasi- online moving apparatus of machine accordingly can execute the skill in the above-mentioned online moving method any embodiment of virtual machine of the present invention
Art scheme, it is similar that the realization principle and technical effect are similar, and details are not described herein again.
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it
Its mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of unit, only
A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or
Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of device or unit
It connects, can be electrical property, mechanical or other forms.
Unit may or may not be physically separated as illustrated by the separation member, shown as a unit
Component may or may not be physical unit, it can and it is in one place, or may be distributed over multiple networks
On unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit being realized in the form of SFU software functional unit can store and computer-readable deposit at one
In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are used so that a computer
It is each that equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute the present invention
The part steps of embodiment the method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read-
Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. it is various
It can store the medium of program code.
Those skilled in the art can be understood that, for convenience and simplicity of description, only with above-mentioned each functional module
Division progress for example, in practical application, can according to need and above-mentioned function distribution is complete by different functional modules
At the internal structure of device being divided into different functional modules, to complete all or part of the functions described above.On
The specific work process for stating the device of description, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
Those of ordinary skill in the art will appreciate that: the various digital numbers such as first, second be referred to herein are only to retouch
The differentiation for facilitating progress is stated, the range of embodiment is not intended to limit the invention.
One with ordinary skill in the art would appreciate that in various embodiments of the present invention, the serial number of above-mentioned each process
Size is not meant that the order of the execution order, and the execution sequence of each process should be determined by its function and internal logic, without answering
Any restriction is constituted to the implementation process of the embodiment of the present invention.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to
The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer readable storage medium.The journey
When being executed, execution includes the steps that above-mentioned each method embodiment to sequence.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to
So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into
Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme.
Claims (9)
1. a kind of online moving method of virtual machine characterized by comprising
The disk block data of predetermined number in the disk working set of source virtual machine are obtained, and by the disk block number of the predetermined number
It is cached according to write-in, wherein the disk working set is the set of disk block to be visited in preset time period;
The disk block data of the predetermined number are transmitted to purpose host computer, and by the memory pages of the source virtual machine
Data are transmitted to the purpose host computer;Wherein, operation has purpose virtual machine in the purpose host computer;
In the memory pages data transmission procedure, when the memory pages dirty data converges to preset threshold, institute is determined
State the memory pages dirty data copy mode of the dirty block number evidence of disk in disk working set and the source virtual machine;
It, will according to the memory pages dirty data copy mode of the dirty block number evidence of disk and the source virtual machine in the disk working set
The memory pages dirty data of the dirty block number evidence of disk, and/or the source virtual machine is transferred to the purpose in the disk working set
Host computer;
The disk block data of nonmagnetic disk working set are transferred to the purpose host computer, wherein the nonmagnetic disk working set
For the disk set of blocks in the source virtual machine in addition to the disk working set;
The memory pages dirty data copy side according to the dirty block number evidence of disk and the source virtual machine in the disk working set
Before formula, further includes:
By the dirty block number of disk in the disk working set according to the caching is written, and the disk in the disk working set is dirty
Block number is transmitted according to the purpose host computer;
The memory pages dirty data copy side of the dirty block number evidence of disk and the source virtual machine in the determination disk working set
Before formula, further includes:
Obtain that dirty piece of data production rate P1 of disk of the disk working set, remaining disk is dirty in presently described disk working set
The transmission rate P2 that the disk block data of block number M and the disk working set are transmitted to purpose host computer;
According to the disk of dirty piece of number M of remaining disk and the disk working set in the presently described disk working set
Block number calculates shutdown copy time segment length and the shutdown is copied according to the transmission rate P2 transmitted to purpose host computer
Dirty piece of number N of maximum residual disk in the shellfish period;
Wherein, M and N is the positive integer greater than 0, and P1 and P2 are greater than 0.
2. the method according to claim 1, wherein the dirty block number evidence of disk in the determination disk working set
With the memory pages dirty data copy mode of the source virtual machine, comprising:
It when M is less than or equal to N, executes step A: stopping the source virtual machine, and by the dirty block number of disk in the disk working set
It is transmitted according to the memory pages dirty data with the source virtual machine to the purpose host computer;Alternatively,
When P1 is less than P2 and M and is greater than N, continue the dirty block number of disk in the disk working set according to the caching is written until
When M is less than or equal to N in default timeout period, step A is executed;Otherwise, step B is executed;
P1 executes step B: stopping the source virtual machine more than or equal to P2 and when M is greater than N, will be in the disk working set
Dirty piece of the disk disk block for being changed to nonmagnetic disk working set, and by the memory pages dirty data of the source virtual machine to the purpose
Host computer transmission.
3. the method according to claim 1, wherein caching is written in the disk block data of the predetermined number
In the process, the method also includes:
Intercept and capture the write operation that the data in magnetic disk block of the caching is had been written into the disk working set;
Data to be written are written in the caching according to the write operation.
4. method according to any one of claim 1-3, which is characterized in that the disk work for obtaining source virtual machine
Before the disk block data for concentrating predetermined number, further includes:
Intercept and capture all IO read-write operations in preset time period;
According to the IO read-write operation and working set seleciton algorithm, disk working set/inoperative collection information is determined;Wherein, institute
Stating disk working set/inoperative collection information includes: the instruction information of disk working set and the instruction information of nonmagnetic disk working set.
5. a kind of online moving apparatus of virtual machine characterized by comprising
Processing module, the disk block data of predetermined number in the disk working set for obtaining source virtual machine, and will be described default
Caching is written in the disk block data of number, wherein the disk working set is the set of disk block to be visited in preset time period;
First transmission module, for the disk block data of the predetermined number to be transmitted to purpose host computer, and will be described
The memory pages data of source virtual machine are transmitted to the purpose host computer;Wherein, it is run in the purpose host computer
There is purpose virtual machine;
Determining module, in the memory pages data transmission procedure, when the memory pages dirty data converge to it is default
When threshold value, the memory pages dirty data copy side of the dirty block number evidence of disk and the source virtual machine in the disk working set is determined
Formula;
Second transmission module, for the memory pages according to disk dirty block number evidence and the source virtual machine in the disk working set
Dirty data copy mode, the memory pages of the dirty block number evidence of disk in the disk working set, and/or the source virtual machine are dirty
Data are transferred to the purpose host computer;
Third transmission module, for the disk block data of nonmagnetic disk working set to be transferred to the purpose host computer, wherein
The nonmagnetic disk working set is the disk set of blocks in the source virtual machine in addition to the disk working set;
4th transmission module, for by the dirty block number of disk in the disk working set according to being written the caching, and by the magnetic
The dirty block number of disk in disk working set is transmitted according to the purpose host computer;
Module is obtained, for obtaining dirty piece of data production rate P1 of disk, the presently described disk working set of the disk working set
In the biography transmitted to purpose host computer of the disk block data of dirty piece of number M of remaining disk and the disk working set
Defeated rate P2;
Computing module, for according to dirty piece of number M of remaining disk and the disk in the presently described disk working set
The transmission rate P2 that the disk block data of working set are transmitted to purpose host computer, calculate shut down copy time segment length, with
And dirty piece of number N of maximum residual disk in the shutdown copy time section;
Wherein, M and N is the positive integer greater than 0, and P1 and P2 are greater than 0.
6. device according to claim 5, which is characterized in that the determining module is specifically used for:
It when M is less than or equal to N, executes step A: stopping the source virtual machine, and by the dirty block number of disk in the disk working set
It is transmitted according to the memory pages dirty data with the source virtual machine to the purpose host computer;Alternatively,
When P1 is less than P2 and M and is greater than N, continue the dirty block number of disk in the disk working set according to the caching is written until
When M is less than or equal to N in default timeout period, step A is executed;Otherwise, step B is executed;
P1 executes step B: stopping the source virtual machine more than or equal to P2 and when M is greater than N, will be in the disk working set
Dirty piece of the disk disk block for being changed to nonmagnetic disk working set, and by the memory pages dirty data of the source virtual machine to the purpose
Host computer transmission.
7. device according to claim 5, which is characterized in that the processing module is also used to:
Intercept and capture the write operation that the data in magnetic disk block of the caching is had been written into the disk working set;
Data to be written are written in the caching according to the write operation.
8. the device according to any one of claim 5-7, which is characterized in that further include:
Interception module, for intercepting and capturing all IO read-write operations in preset time period;
Determining module, for determining disk working set/inoperative collection according to the IO read-write operation and working set seleciton algorithm
Information;Wherein, the disk working set/inoperative collection information includes: the instruction information and nonmagnetic disk work of disk working set
The instruction information of collection.
9. a kind of online migratory system of virtual machine characterized by comprising run the sourcesink master computer and fortune of source virtual machine
The purpose host computer of row purpose virtual machine, wherein comprising such as any one of claim 5-8 in the sourcesink master computer
The online moving apparatus of the virtual machine.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610793779.6A CN106469085B (en) | 2016-08-31 | 2016-08-31 | The online migration method, apparatus and system of virtual machine |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610793779.6A CN106469085B (en) | 2016-08-31 | 2016-08-31 | The online migration method, apparatus and system of virtual machine |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106469085A CN106469085A (en) | 2017-03-01 |
CN106469085B true CN106469085B (en) | 2019-11-08 |
Family
ID=58230437
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610793779.6A Active CN106469085B (en) | 2016-08-31 | 2016-08-31 | The online migration method, apparatus and system of virtual machine |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106469085B (en) |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017049617A1 (en) * | 2015-09-25 | 2017-03-30 | Intel Corporation | Techniques to select virtual machines for migration |
CN106990999A (en) * | 2017-03-15 | 2017-07-28 | 深信服科技股份有限公司 | Virtual machine business migration method and device |
CN107291527B (en) * | 2017-05-23 | 2020-04-03 | 华为技术有限公司 | Pre-copy migration stop pre-judgment method and device |
CN109995814B (en) * | 2017-12-29 | 2021-08-13 | 中移(苏州)软件技术有限公司 | Cloud host resource migration method and device, communication equipment and storage medium |
CN108469982B (en) * | 2018-03-12 | 2021-03-26 | 华中科技大学 | Online migration method for container |
CN108595250B (en) * | 2018-05-02 | 2021-05-28 | 南京大学 | IaaS cloud platform-oriented resource scheduling efficiency optimization method and system |
CN110968393B (en) * | 2018-09-30 | 2023-05-02 | 阿里巴巴集团控股有限公司 | Migration processing method of virtual machine, storage medium and computing device |
CN111176781A (en) * | 2019-08-23 | 2020-05-19 | 腾讯科技(深圳)有限公司 | Virtual machine live migration method and device, storage medium and electronic equipment |
CN111181929A (en) * | 2019-12-16 | 2020-05-19 | 中国电子科技网络信息安全有限公司 | Heterogeneous hybrid cloud architecture based on shared virtual machine files and management method |
CN111580933B (en) * | 2020-05-12 | 2022-12-09 | 西安交通大学 | Hardware acceleration-based virtual machine online migration method |
CN113342471A (en) * | 2021-06-25 | 2021-09-03 | 航天云网科技发展有限责任公司 | Virtual machine migration method and system and electronic equipment |
CN116560796B (en) * | 2023-05-12 | 2024-02-02 | 深圳天融信创新科技有限公司 | Data loading method, device, equipment and medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102073462A (en) * | 2010-11-29 | 2011-05-25 | 华为技术有限公司 | Virtual storage migration method and system and virtual machine monitor |
CN102081552A (en) * | 2009-12-01 | 2011-06-01 | 华为技术有限公司 | Method, device and system for transferring from physical machine to virtual machine on line |
CN103500146A (en) * | 2013-09-30 | 2014-01-08 | 北京邮电大学 | Method and system for migrating stored data of virtual machine disks |
CN103577249A (en) * | 2013-11-13 | 2014-02-12 | 中国科学院计算技术研究所 | Method and system for virtual machine online migration |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20150089688A (en) * | 2014-01-28 | 2015-08-05 | 한국전자통신연구원 | Apparatus and method for managing cache of virtual machine image file |
-
2016
- 2016-08-31 CN CN201610793779.6A patent/CN106469085B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102081552A (en) * | 2009-12-01 | 2011-06-01 | 华为技术有限公司 | Method, device and system for transferring from physical machine to virtual machine on line |
CN102073462A (en) * | 2010-11-29 | 2011-05-25 | 华为技术有限公司 | Virtual storage migration method and system and virtual machine monitor |
CN103500146A (en) * | 2013-09-30 | 2014-01-08 | 北京邮电大学 | Method and system for migrating stored data of virtual machine disks |
CN103577249A (en) * | 2013-11-13 | 2014-02-12 | 中国科学院计算技术研究所 | Method and system for virtual machine online migration |
Non-Patent Citations (1)
Title |
---|
多虚拟机下基于内存缓存的动态块迁移算法;刘典型;《计算机应用与软件》;20150331;第32卷(第3期);第11-15,123页 * |
Also Published As
Publication number | Publication date |
---|---|
CN106469085A (en) | 2017-03-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106469085B (en) | The online migration method, apparatus and system of virtual machine | |
CN102521038B (en) | Virtual machine migration method and device based on distributed file system | |
US9940064B2 (en) | Live migration of virtual disks | |
US8527990B1 (en) | Systems and methods for migrating virtual machines | |
CN104965757B (en) | Method, virtual machine (vm) migration managing device and the system of live migration of virtual machine | |
CN108874506B (en) | Live migration method and device of virtual machine direct connection equipment | |
US8407182B1 (en) | Systems and methods for facilitating long-distance live migrations of virtual machines | |
US8458284B2 (en) | Systems and methods for efficient live application migration within bandwidth constrained networks | |
US11429466B2 (en) | Operating system-based systems and method of achieving fault tolerance | |
US20140208012A1 (en) | Virtual disk replication using log files | |
CN107402722B (en) | Data migration method and storage device | |
CN107644030B (en) | Distributed database data synchronization method, related device and system | |
US20130297888A1 (en) | Scheduling method and multi-core processor system | |
CN102136993B (en) | A kind of methods, devices and systems of Data Migration | |
CN106919471B (en) | Method and system for snapshot creation | |
CN110427284A (en) | Data processing method, distributed system, computer system and medium | |
CN104216806A (en) | Capture and transmission method for serialized operation logs of file system and system thereof | |
CN111708719B (en) | Computer storage acceleration method, electronic equipment and storage medium | |
US8751446B2 (en) | Transference control method, transference control apparatus and recording medium of transference control program | |
CN109471699A (en) | The virtual machine incremental backup system of difference bitmap characteristic based on Qcow2 image file | |
JP5561334B2 (en) | Data transfer device | |
US11614879B2 (en) | Technique for replicating oplog index among nodes of a cluster | |
EP2661691A1 (en) | Upgrading an elastic computing cloud system | |
CN111506385A (en) | Engine preemption and recovery | |
KR102326280B1 (en) | Method, apparatus, device and medium for processing data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |