Summary of the invention
The embodiment of the invention discloses a kind of magnetic disk of virtual machine data migration method and devices, to shorten magnetic disk of virtual machine number
Influence duration according to migration to user's operation virtual machine improves user experience.
In order to achieve the above objectives, the embodiment of the invention discloses a kind of magnetic disk of virtual machine data migration methods, are applied to void
Quasi- machine, which comprises
Reception of magnetic disc Data Migration instruction, wherein comprising having moved to target physical in the data in magnetic disk migration instruction
The information of the Disk Backup data of the virtual machine of machine, the Disk Backup data of the virtual machine are stored in and the virtual machine
In the corresponding different backup physical machine of physical machine;
Determine that is generated after generation is had moved to the Disk Backup data of the virtual machine of the target physical machine is directed to
The disk incremental data of the Disk Backup data;
Identified disk incremental data is migrated to the target physical machine, so that the target physical machine is according to institute
Determining disk incremental data and the Disk Backup data having moved obtain whole data in magnetic disk of the virtual machine.
It is described to have moved to the virtual machine of the target physical machine in a specific embodiment of the present invention
Disk Backup data are as follows: until starting to migrate the Disk Backup data moment of the virtual machine, for storing the virtual machine
Disk Backup data backup physical machine in the latest edition Disk Backup data of the virtual machine that store.
In a specific embodiment of the present invention, the magnetic disk of virtual machine data migration method further include:
Receive the data modification operation instruction for the data in magnetic disk of the virtual machine;
Modify the data in magnetic disk of the virtual machine;
It is instructed according to the data modification operation, updates the data modification record of the virtual machine.
It include: according to the data modification in the data modification record in a specific embodiment of the present invention
Operational order, the data block identifier of the data in magnetic disk for the virtual machine modified;
What the determining generation generated after having moved to the Disk Backup data of the virtual machine of the target physical machine
For the disk incremental data of the Disk Backup data, comprising:
According to the data modification record, determine generate have moved to the target physical machine the virtual machine disk
The data block identifier of the data in magnetic disk for the virtual machine modified after Backup Data;
According to the data block identifier found, the block content of data block corresponding with above-mentioned mark is obtained, and is determined
To generate the disk incremental data for the Disk Backup data generated after above-mentioned Disk Backup data.
It is described to be recorded according to the data modification in a specific embodiment of the present invention, it determines to generate and have moved
The number of the data in magnetic disk for the virtual machine modified after to the Disk Backup data of the virtual machine of the target physical machine
According to block identification, comprising:
It is recorded, is obtained for generating the virtual machine having moved to the target physical machine according to the data modification
The data bitmap of data in magnetic disk after Disk Backup data a, wherein marker in the data bitmap generates for indicating
A number of the data in magnetic disk of the virtual machine after migrating to the Disk Backup data of the virtual machine of the target physical machine
Whether modified according to block;
Search the marker for indicating that data block has been modified in the data bitmap;
Determine the corresponding data block identifier of marker found.
In a specific embodiment of the present invention, in data modification operation instruction include: to be modified it is described
The data block identifier of the data in magnetic disk of virtual machine;
It is described to be instructed according to the data modification operation, update the data modification record of the virtual machine, comprising:
Detect in the data modification record of the virtual machine whether include in the instruction of the existing data modification operation
The data block identifier of the data in magnetic disk of the virtual machine to be modified;
If including updating the data and repairing according to the above-mentioned data block identifier for including in data modification operation instruction
Change record.
It include: according to the data modification in the data modification record in a specific embodiment of the present invention
Operational order, the data block identifier of the data in magnetic disk for the virtual machine modified and the modification content of the data block;
What the determining generation generated after having moved to the Disk Backup data of the virtual machine of the target physical machine
For the disk incremental data of the Disk Backup data, comprising:
From the data modification record in search generate have moved to the target physical machine the virtual machine disk
The data block identifier of the data in magnetic disk for the virtual machine modified after Backup Data;
According to the data block identifier found, data block corresponding with above-mentioned mark is obtained from data modification record
Modification content, and determine it as generation have moved to the Disk Backup data of the virtual machine of the target physical machine
The disk incremental data for the Disk Backup data generated.
In a specific embodiment of the present invention, the magnetic disk of virtual machine data migration method further include:
During migrating identified disk incremental data to the target physical machine, the virtual machine is detected
Whether data in magnetic disk is modified;
If it is, disk incremental data determined by updating.
In order to achieve the above objectives, the embodiment of the invention discloses a kind of magnetic disk of virtual machine data migration devices, are applied to void
Quasi- machine, described device include:
Command reception module is instructed for reception of magnetic disc Data Migration, wherein includes in the data in magnetic disk migration instruction
Have moved to target physical machine the virtual machine Disk Backup data information, the Disk Backup data of the virtual machine deposit
It is stored in the different backup physical machine of physical machine corresponding with the virtual machine;
Disk incremental data determining module, for determining that generation is had moved to the virtual machine of the target physical machine
The disk incremental data for the Disk Backup data generated after Disk Backup data;
Disk incremental data transferring module, for migrating identified disk incremental data to the target physical machine,
So that the target physical machine obtains the void according to identified disk incremental data and the Disk Backup data having moved
Whole data in magnetic disk of quasi- machine.
It is described to have moved to the virtual machine of the target physical machine in a specific embodiment of the present invention
Disk Backup data are as follows: until starting to migrate the Disk Backup data moment of the virtual machine, for storing the virtual machine
Disk Backup data backup physical machine in the latest edition Disk Backup data of the virtual machine that store.
In a specific embodiment of the present invention, described instruction receiving module is also used to receive for described virtual
The data modification operation of the data in magnetic disk of machine instructs;
Described device further include:
Data in magnetic disk modified module, for modifying the data in magnetic disk of the virtual machine;
Modification record update module, for being instructed according to the data modification operation, the data for updating the virtual machine are repaired
Change record.
It include: according to the data modification in the data modification record in a specific embodiment of the present invention
Operational order, the data block identifier of the data in magnetic disk for the virtual machine modified;
The disk incremental data determining module, comprising:
Data block identifier determines submodule, for being recorded according to the data modification, determines to generate and have moved to the mesh
Mark the data block identifier of the data in magnetic disk for the virtual machine modified after the Disk Backup data of the virtual machine of physical machine;
First disk incremental data determines submodule, for obtaining and above-mentioned mark according to the data block identifier found
The block content of corresponding data block, and determine it as generate above-mentioned Disk Backup data after generate for the Disk Backup number
According to disk incremental data.
In a specific embodiment of the present invention, the data block identifier determines submodule, comprising:
Data bitmap obtaining unit is obtained and is had moved for generation to the mesh for being recorded according to the data modification
The data bitmap of data in magnetic disk after the Disk Backup data of the virtual machine of mark physical machine, wherein one in the data bitmap
A marker, for indicating the void after generation is had moved to the Disk Backup data of the virtual machine of the target physical machine
Whether one data block of the data in magnetic disk of quasi- machine is modified;
Marker searching unit, for searching the marker for indicating that data block has been modified in the data bitmap;
Data block identifier determination unit, for determining the corresponding data block identifier of marker found.
In a specific embodiment of the present invention, in data modification operation instruction include: to be modified it is described
The data block identifier of the data in magnetic disk of virtual machine;
The modification record update module, comprising:
Data block identifier detection sub-module, the data modification for detecting the virtual machine record in it is whether existing described
The data block identifier of the data in magnetic disk for the virtual machine to be modified for including in data modification operation instruction;
Modification record updates submodule, is the case where being for the testing result in the data block identifier detection sub-module
Under, according to the above-mentioned data block identifier for including in data modification operation instruction, update the data modification record.
It include: according to the data modification in the data modification record in a specific embodiment of the present invention
Operational order, the data block identifier of the data in magnetic disk for the virtual machine modified and the modification content of the data block;
The disk incremental data determining module, comprising:
Data block identifier searches submodule, has moved for searching to generate from data modification record to the target
The data block identifier of the data in magnetic disk for the virtual machine modified after the Disk Backup data of the virtual machine of physical machine;
Second disk incremental data determines submodule, for the data block identifier that basis is found, from the data modification
The modification content of data block corresponding with above-mentioned mark is obtained in record, and is determined it as generation and had moved to the object
The disk incremental data for the Disk Backup data generated after the Disk Backup data of the virtual machine of reason machine.
In a specific embodiment of the present invention, the magnetic disk of virtual machine data migration device further include:
Data modification detection module, for migrating by identified disk incremental data to the mistake of the target physical machine
Whether Cheng Zhong, the data in magnetic disk for detecting the virtual machine are modified;
Disk incremental data update module is the case where being for the testing result in the data modification detection module
Under, update identified disk incremental data.
As seen from the above, in scheme provided in an embodiment of the present invention, the Disk Backup data of virtual machine are first migrated to target
Then physical machine migrates virtual machine again and generates the disk increment for the Disk Backup data generated after the Disk Backup data
Data enable target physical machine to be somebody's turn to do according to above-mentioned Disk Backup data and disk incremental data to target physical machine
Whole data in magnetic disk of virtual machine.Due in scheme provided in an embodiment of the present invention, above-mentioned Disk Backup data be stored in
In the different backup physical machine of the corresponding physical machine of virtual machine, so, when migrating the Disk Backup data to target physical machine
The I/O resource that the corresponding physical machine of virtual machine will not be occupied, would not also influence user's operation virtual machine.In addition, though to
Target physical machine can occupy the I/O resource of the corresponding physical machine of virtual machine, shadow during migrating above-mentioned disk incremental data
User's operation virtual machine is rung, but since above-mentioned disk incremental data is small very compared to for whole data in magnetic disk of virtual machine
It is more, so, it is shorter to the influence time of user's operation virtual machine when migrating above-mentioned disk incremental data to target physical machine.It is comprehensive
It closes visible above, using scheme provided in an embodiment of the present invention, magnetic disk of virtual machine Data Migration can be shortened to user's operation void
The influence duration of quasi- machine, improves user experience.
Specific embodiment
When due to migrating the data in magnetic disk of virtual machine to target physical machine in the prior art, the virtual machine can be occupied for a long time
The I/O resource of corresponding physical machine, and then operation of president's time effects user to the virtual machine, for this purpose, the embodiment of the present invention
A kind of magnetic disk of virtual machine data migration method and device are provided, it is virtual to user's operation to shorten magnetic disk of virtual machine Data Migration
The influence duration of machine.
Introduce a kind of magnetic disk of virtual machine data migration method provided in an embodiment of the present invention, the party on the whole first below
Method is applied to virtual machine, comprising:
Reception of magnetic disc Data Migration instruction, wherein comprising having moved to target physical in the data in magnetic disk migration instruction
The information of the Disk Backup data of the virtual machine of machine, the Disk Backup data of the virtual machine are stored in and the virtual machine
In the corresponding different backup physical machine of physical machine;
Determine that is generated after generation is had moved to the Disk Backup data of the virtual machine of the target physical machine is directed to
The disk incremental data of the Disk Backup data;
Identified disk incremental data is migrated to the target physical machine, so that the target physical machine is according to institute
Determining disk incremental data and the Disk Backup data having moved obtain whole data in magnetic disk of the virtual machine.
The Disk Backup data of above-mentioned virtual machine are for a certain moment, it can be understood as at a time lower void
The copy of whole data in magnetic disk of quasi- machine.
The disk incremental data of virtual machine, should for recording virtual machine generation for a certain Disk Backup data
After Disk Backup data, the modification situation of user on a virtual machine, for example, in data in magnetic disk increased content, delete in
Appearance, the content changed etc..
Whole data in magnetic disk of virtual machine can be corresponding with the Disk Backup data according to the Disk Backup data of virtual machine
Disk incremental data obtain.
In view of foregoing description, when migrating the data in magnetic disk of virtual machine, progress can be divided into two parts, it may be assumed that will first be stored in standby
The Disk Backup Data Migration of part physical machine is to target physical machine, then to target physical machine to migrate the Disk Backup data corresponding
Disk incremental data completes the migration of virtual machine whole data in magnetic disk whereby.
Since the Disk Backup data of above-mentioned virtual machine are stored in the different backup object of physical machine corresponding from the virtual machine
In reason machine, so, when migrating the Disk Backup data of the virtual machine to target physical machine, occupied I/O resource is backup object
The I/O resource of reason machine, rather than the I/O resource of the corresponding physical machine of the virtual machine, and then the virtual machine is migrated to target physical machine
Disk Backup data process, will not influence the user's operation virtual machine.
The corresponding disk incremental data of above-mentioned Disk Backup data is stored in above-mentioned virtual machine, is moreover deposited
It is stored in the corresponding physical machine of above-mentioned virtual machine, so, it is occupied when migrating above-mentioned disk incremental data to target physical machine
I/O resource is the I/O resource of the corresponding physical machine of above-mentioned virtual machine, and then migrates above-mentioned disk incremental data to target physical machine
Process, will affect the user's operation virtual machine.
However for the data volume of whole data in magnetic disk of virtual machine, for the disk increment of Disk Backup data
The data volume of data is much smaller, therefore, when carrying out migration data in magnetic disk using above-mentioned magnetic disk of virtual machine data migration method,
The influence duration to user's operation virtual machine can be shortened.
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Fig. 1 is the first flow diagram of magnetic disk of virtual machine data migration method provided in an embodiment of the present invention, the party
Method is applied in virtual machine, comprising:
S101: reception of magnetic disc Data Migration instruction.
Wherein, in above-mentioned data in magnetic disk migration instruction comprising have moved to target physical machine above-mentioned virtual machine disk it is standby
The information of part data, specifically, may include for indicating that the disk is standby in the information of the Disk Backup data of above-mentioned virtual machine
Part data are had moved the mark of completion, be may include the version information of the Disk Backup data, be may include target physical machine
Mark etc., the application is defined not to this.
It is worth noting that the Disk Backup data of above-mentioned virtual machine need to be stored in physical machine corresponding with the virtual machine not
It is occupied in this way when migrating the Disk Backup data of above-mentioned virtual machine to target physical machine in identical backup physical machine
I/O resource is the I/O resource of backup physical machine, rather than therefore the I/O resource of the corresponding physical machine of above-mentioned virtual machine is being moved
During the Disk Backup data for moving above-mentioned virtual machine, user couple will not be influenced since the I/O resource of physical machine is occupied
The operation of the virtual machine will not influence operation of the user to other virtual machines corresponding to the corresponding physical machine of the virtual machine.
From foregoing description it is known that above-mentioned virtual machine is to complete to migrate virtual machine to target physical machine in backup physical machine
Disk Backup data after the data in magnetic disk migration instruction that just receives, be easier to expect, Data Migration instruction can
To be that above-mentioned backup physical machine is sent, it is also possible to the physical machine with management function and is determining backup physical machine
It completes to send to above-mentioned virtual machine after the migration of above-mentioned magnetic disk of virtual machine Backup Data.
Those skilled in the art are, it is understood that the Disk Backup data for generating virtual machine are in order in virtual machine
When corresponding physical machine etc. breaks down, can with the data in magnetic disk of the small as far as possible error recovery virtual machine to current state,
So virtual machine understands fixed time intervals interval under normal conditions, for example, 6 hours, 12 hours etc., or it is default meeting
In the case where condition, for example, detecting that the case where fluctuation of service etc. occurs in the corresponding physical machine of virtual machine, data in magnetic disk is triggered
Backup functionality generates the Disk Backup data for being directed to current time, virtual in practical application to guarantee Disk Backup data safety
Disk Backup data generated can be sent to above-mentioned backup physical machine by machine.Over time, above-mentioned backup physics
There may be the Disk Backup data of multiple versions of above-mentioned virtual machine in machine.
Preferably, the above-mentioned Disk Backup data of above-mentioned virtual machine having moved to target physical machine can be with are as follows: to starting
Until the Disk Backup data moment for migrating above-mentioned virtual machine, the backup object of the Disk Backup data for storing above-mentioned virtual machine
The latest edition Disk Backup data of the above-mentioned virtual machine stored in reason machine.It should in this way, being stored in being directed in above-mentioned virtual machine
The data volume of the disk incremental data of Disk Backup data can be relatively small, and the time needed when migrating disk incremental data is more
It is short, and then the duration for influence when disk migration user's operation virtual machine to above-mentioned virtual machine is also just shorter.
S102: determine that is generated after generation is had moved to the Disk Backup data of the above-mentioned virtual machine of target physical machine is directed to
The disk incremental data of the Disk Backup data.
Since whole data in magnetic disk of above-mentioned virtual machine are located in the corresponding physical machine of the virtual machine, and generate virtual machine
Disk Backup data need whole data in magnetic disk of the virtual machine, so, its disk is generated by above-mentioned virtual machine under normal conditions
Backup Data has higher working efficiency.
Specifically, when above-mentioned virtual machine generates its Disk Backup data, it can be and generate according to the preset time interval,
It can also be generated in the case where meeting preset condition detecting, for example, detecting the physical machine hair with management function
The Disk Backup data sent generate instruction, detect that the selected Disk Backup data of user generate instruction, detect that this is virtual
Corresponding physical machine operation exception of machine etc..
Those skilled in the art are it is understood that virtual machine can occupy system when generating its Disk Backup data
Therefore resource to prevent from influencing user's operation virtual machine, can generate Disk Backup within the period that user does not operate virtual machine
Data.
In the present embodiment, because occupying the virtual machine when to prevent from migrating the Disk Backup data of virtual machine to target physical machine
The I/O resource of corresponding physical machine and influence user's operation virtual machine, after the virtual machine generates its Disk Backup data, can will
Disk Backup data generated are sent to backup physical machine and are stored.In addition, Disk Backup data generated are stored
User can also be effectively prevent to the maloperation of virtual machine and the damage etc. of bring Disk Backup data to backup physical machine.
It should be understood that virtual machine can occupy this virtually when sending its Disk Backup data generated to backup physical machine
The I/O resource of the corresponding physical machine of machine, therefore, during this period can operation of the user to the virtual machine, or even will affect user couple
The operation of other corresponding virtual machines of corresponding with virtual machine physical machine, in consideration of it, can choose to guarantee user experience
Disk Backup data generated are sent to backup physical machine in the case where user does not operate the virtual machine.
It is well known that the data in magnetic disk of virtual machine can be divided into multiple data blocks, user is to magnetic disk of virtual machine data
Operation, it can be understood as the operation to each data block of magnetic disk of virtual machine data.
Specifically, may include: changed in the content that above-mentioned disk incremental data is recorded in a kind of situation
The information such as the data block identifier and block content of data block;
In another case, may include: changed data in the content that above-mentioned disk incremental data is recorded
The data block identifier and modification content of block etc. information.
Two kinds of situations of the above-mentioned disk incremental data only enumerated, are not to be defined to the application.
In addition, the disk incremental data of virtual machine can store in one file, Disk Backup data can also be directed to
It stores respectively, it may be assumed that only record virtual machine generates a Disk Backup data and generates next Disk Backup number in each file
The information of the disk incremental data generated between.Certainly, the application is only illustrated for above-mentioned, in practical application also
There are the storage modes of other disk incremental datas, can determine as the case may be.
S103: identified disk incremental data is migrated to the target physical machine so that target physical machine according to
Identified disk incremental data and the Disk Backup data having moved obtain whole data in magnetic disk of above-mentioned virtual machine.
By above description it is known that the information that disk incremental data is included under different situations may be different, so, mesh
Physical machine is marked after the Disk Backup data and disk incremental data for obtaining above-mentioned virtual machine, obtains whole disks of the virtual machine
The mode slight difference of data, specifically may refer to subsequent Fig. 3 and embodiment shown in Fig. 4, I will not elaborate.
Those skilled in the art are, it is understood that above-mentioned virtual machine is migrating its disk increment to target physical machine
User may operate the virtual machine during data, then needing to record user in this case to the virtual machine
Operation so that target physical machine can obtain whole data in magnetic disk of the virtual machine.
In view of foregoing description, in a preferred embodiment of the present invention, above-mentioned magnetic disk of virtual machine data migration method
Can also include:
During migrating identified disk incremental data to target physical machine, the disk of above-mentioned virtual machine is detected
Whether data are modified, if updating identified disk incremental data by modifying.
In practical application, if above-mentioned virtual machine is migrated by identified disk incremental data to the process of target physical machine
In, data modification operation instruction was executed, then can be determined that the data in magnetic disk of the virtual machine is modified, it is on the contrary, it can be determined that
The data in magnetic disk of the virtual machine is not modified.
As seen from the above, in scheme provided in this embodiment, the Disk Backup data of virtual machine are first migrated to target physical
Then machine migrates virtual machine again and generates the disk incremental data for the Disk Backup data generated after the Disk Backup data
To target physical machine, target physical machine is enabled to obtain this virtually according to above-mentioned Disk Backup data and disk incremental data
Whole data in magnetic disk of machine.Since in scheme provided in this embodiment, above-mentioned Disk Backup data are stored in and virtual machine pair
In the different backup physical machine of the physical machine answered, so, it will not be occupied when migrating the Disk Backup data to target physical machine
The I/O resource of the corresponding physical machine of virtual machine, would not also influence user's operation virtual machine.In addition, though to target physical
Machine can occupy the I/O resource of the corresponding physical machine of virtual machine during migrating above-mentioned disk incremental data, influence user behaviour
Make virtual machine, but since above-mentioned disk incremental data is much smaller compared to for whole data in magnetic disk of virtual machine, so,
It is shorter to the influence time of user's operation virtual machine when migrating above-mentioned disk incremental data to target physical machine.In summary may be used
See, using scheme provided in this embodiment, when can shorten influence of the magnetic disk of virtual machine Data Migration to user's operation virtual machine
It is long, improve user experience.
Below by the magnetic disk of virtual machine for the magnetic disk of virtual machine data migration method that an application embodiment illustrated in fig. 1 provides
Data mover system is illustrated above-mentioned magnetic disk of virtual machine data migration method.
Specifically, referring to fig. 2, providing a kind of structural schematic diagram of magnetic disk of virtual machine data mover system.
It wherein, include: that management physical machine, backup physical machine, target physical machine and above-mentioned virtual machine are corresponding in the system
Physical machine.
Physical machine is managed, there is management function, manage other physical machines in the system, for example, backup physical machine, above-mentioned
The corresponding physical machine of virtual machine, target physical machine etc.;
Backup physical machine, for storing the Disk Backup data of each virtual machine.
Above-mentioned management physical machine, backup physical machine are functionally being divided from machine, in practical application, management
Physical machine, backup physical machine and target physical machine can correspond to same physical machine, may correspond to more physical machines, this
Application is defined not to this, and still, backup physical machine physical machine corresponding from above-mentioned virtual machine is two different certainly
Physical machine.
When migrating the data in magnetic disk of above-mentioned virtual machine, management physical machine first can send Data Migration to backup physical machine
It instructs, needs to include that information, the backup physical machines such as mark, the mark of target physical machine of above-mentioned virtual machine receive in the instruction
After stating migration instruction, the Disk Backup number of a version is selected from the Disk Backup data of the above-mentioned virtual machine wherein stored
According to, and selected Disk Backup data are migrated to target physical machine, it is that selected disk is standby in the determination of backup physical machine
Part data are all migrated to target physical machine, above-mentioned to the migration of target physical machine using the method that embodiment illustrated in fig. 1 provides
The disk incremental data of virtual machine.
In a kind of situation, backup physical machine is determined after selected Disk Backup Data Migration to target physical machine, can
Feedback command is completed to send migration to management physical machine, management physical machine sends disk number to above-mentioned virtual machine according to the instruction
It is instructed according to migration.
In another case, backup physical machine determines after selected Disk Backup Data Migration to target physical machine,
Migration can not also be sent to management physical machine and complete feedback command, but state virtual machine directly up and send data in magnetic disk migration
Instruction.
After the corresponding physical machine of above-mentioned virtual machine receives data in magnetic disk migration instruction, increased according to the disk that it is recorded
Data are measured, determines and is directed to the Disk Backup number after generation is had moved to the Disk Backup data of the above-mentioned virtual machine of target physical machine
According to disk incremental data, and identified disk incremental data is migrated to target physical machine.
Target physical machine is counted after receiving above-mentioned Disk Backup data in conjunction with the disk incremental data of receipt of subsequent
According to the operation such as synthesis, and then obtain whole data in magnetic disk of above-mentioned magnetic disk of virtual machine.
Further, during migrating virtual machine other than the whole data in magnetic disk that need to migrate virtual machine, it is also necessary to
The full memory data for migrating virtual machine determine to have moved and complete the whole data in magnetic disk and whole of virtual machine in management physical machine
After internal storage data, the instruction of starting virtual machine can also be sent to target physical machine, so that above-mentioned virtual machine starts in target
It is run in physical machine, and sends shutdown command to the virtual machine before migration, so as to stop at its right for the virtual machine before migration
It is run in the physical machine answered.
Certainly, since the disk incremental data and internal storage data of virtual machine are essentially all that be stored in the virtual machine corresponding
In physical machine, the instruction of above-mentioned starting virtual machine is also possible to the virtual machine and is determining its disk incremental data and complete
What portion's internal storage data was sent after migrating to target physical machine to target physical machine, so that the virtual machine starts on target physical machine
It brings into operation, and stops its operation on present physical machine.
Due to the disk incremental data of virtual machine be the operation of magnetic disk of virtual machine data is obtained according to user, for example,
The data in a data block of data in magnetic disk, data in a data block of change data in magnetic disk etc. are deleted, so,
It need to be recorded for its operation when user's operation virtual machine.
Specifically, above-mentioned magnetic disk of virtual machine data migration method can also include:
Receive the data modification operation instruction for the data in magnetic disk of above-mentioned virtual machine;
Modify the data in magnetic disk of above-mentioned virtual machine;
It is instructed according to data modification operation, updates the data modification record of above-mentioned virtual machine.
It should be noted that above-mentioned each step can through the whole process of magnetic disk of virtual machine Data Migration, so,
The application does not limit and executes sequence between above-mentioned each step and S101, S102 and S103.
Based on foregoing description, in a specific embodiment of the present invention, referring to Fig. 3, magnetic disk of virtual machine number is provided
According to second of flow diagram of moving method, compared with previous embodiment, in the present embodiment,
It include: to be instructed according to above-mentioned data modification operation in above-mentioned data modification record, the above-mentioned virtual machine modified
Data in magnetic disk data block identifier.
Specifically, the needle that determining generation generates after having moved to the Disk Backup data of the above-mentioned virtual machine of target physical machine
To the step S102 of the disk incremental data of the Disk Backup data, comprising:
S102A: according to above-mentioned data modification record, determine generate have moved to target physical machine above-mentioned virtual machine magnetic
The data block identifier of the data in magnetic disk for the above-mentioned virtual machine modified after disk Backup Data.
In this step, determines and modified after generation is had moved to the Disk Backup data of the above-mentioned virtual machine of target physical machine
Above-mentioned virtual machine data in magnetic disk data block identifier when, can first according to above-mentioned data modification record, obtain for generate
The data bitmap of data in magnetic disk after having moved to the Disk Backup data of the above-mentioned virtual machine of target physical machine, wherein the data
A marker in bitmap is had moved for indicating to generate to the Disk Backup data of the above-mentioned virtual machine of target physical machine
Whether a data block for stating the data in magnetic disk of virtual machine is modified, and then searching again indicates that data block is repaired in data bitmap
The marker changed, and determine the corresponding data block identifier of marker found, these data block identifiers are to generate to have moved
The data block of the data in magnetic disk for the above-mentioned virtual machine modified after to the Disk Backup data of the above-mentioned virtual machine of target physical machine
Mark.
In addition, being modified of can also directly including from above-mentioned data modification record in practical application is above-mentioned virtual
The data block identifier of the data in magnetic disk of machine.
It should be noted that the application is to illustrate how determining data block identifier for above-mentioned, in practical application simultaneously
It is not limited only to this.
S102B: according to the data block identifier found, the block content of data block corresponding with above-mentioned mark is obtained, and will
It is determined as generating the disk incremental data for the Disk Backup data generated after above-mentioned Disk Backup data.
It does not include the modification content of the data in magnetic disk for the above-mentioned virtual machine modified in above-mentioned data modification record
In the case where, the disk incremental data for the Disk Backup data generated after above-mentioned Disk Backup data is generated, can wrap
The modified piece of content containing the data block identifier modified and these data block identifier corresponding data blocks.
Based on the above situation, when migrating identified disk incremental data to target physical machine, the content migrated includes
Modified piece of content of the data block identifier and these data block identifier corresponding data blocks modified.Correspondingly, target
Physical machine obtains whole disks of above-mentioned virtual machine according to identified disk incremental data and the Disk Backup data having moved
When data, it can find in the Disk Backup data having moved and be modified first according to the mark for the data block modified
The corresponding data block of data block identifier, then the content of the data block is replaced with to the above-mentioned mark for including in disk incremental data
Know modified piece of content of corresponding data block, and then obtains whole data in magnetic disk of the virtual machine.
It may include: to modify in above-mentioned data modification operation instruction in a kind of relatively good implementation of the invention
Above-mentioned virtual machine data in magnetic disk data block identifier.
In this case, it is instructed according to data modification operation, it, can be with when updating the data modification record of above-mentioned virtual machine
Being modified of including in existing data modification operation instruction in the data modification record for detecting above-mentioned virtual machine is above-mentioned
In the case where the data block identifier of the data in magnetic disk of virtual machine, according to data modification operation instruct in include above-mentioned data block mark
Know, updates data modification record.
It is furthermore appreciated that, when migrating the Disk Backup data of above-mentioned virtual machine to target physical machine, due to disk
The reasons such as the data volume of Backup Data is big, network bandwidth is low, migrating the time required for Disk Backup data may be longer, and
Above-mentioned virtual machine may generate the Disk Backup data of new version during this, and can send it to backup physical machine, this
In the case of, although generating the Disk Backup data of new version, due to during migrating disk incremental data, once detection
The data modification operation instruction for data in magnetic disk is had received to above-mentioned virtual machine, that is, the data that will be updated above-mentioned virtual machine are repaired
Change record, so even if the Disk Backup data of new version and the Disk Backup data had moved there are different, will not influence
The migration of the magnetic disk of virtual machine data, can still according to the version for the Disk Backup data having moved and more in subsequent step
Data modification record after new, determines disk incremental data corresponding to the Disk Backup data of target physical machine of having moved.
As seen from the above, in scheme provided in this embodiment, in the data in magnetic disk to target physical machine migration virtual machine
In whole process, only migration disk incremental data will affect operation of the user to virtual machine, and disk incremental data is by
Modified piece of Composition of contents of the data block identifier modified and these data block identifier corresponding data blocks, it is seen that it is counted
Therefore the data volume for the whole data in magnetic disk that be far smaller than virtual machine according to amount can shorten magnetic disk of virtual machine Data Migration pair
The influence duration of user's operation virtual machine.
Referring to fig. 4, magnetic disk of virtual machine is provided in another specific implementation of the invention based on foregoing description
The third flow diagram of data migration method, compared with previous embodiment, in the present embodiment,
It include: to be instructed according to above-mentioned data modification operation in above-mentioned data modification record, the above-mentioned virtual machine modified
Data in magnetic disk data block identifier and the data block modification content.
Specifically, the needle that determining generation generates after having moved to the Disk Backup data of the above-mentioned virtual machine of target physical machine
To the step S102 of the disk incremental data of the Disk Backup data, comprising:
S102C: from data modification record in search generate have moved to target physical machine above-mentioned virtual machine disk it is standby
The data block identifier of the data in magnetic disk for the above-mentioned virtual machine modified after part data.
S102D: according to the data block identifier found, data corresponding with above-mentioned mark are obtained from data modification record
The modification content of block, and determine it as after generation is had moved to the Disk Backup data of the above-mentioned virtual machine of target physical machine and produce
The raw disk incremental data for the Disk Backup data.
Referring to the information for including in above-mentioned data modification record, generate generate after above-mentioned Disk Backup data for the magnetic
The disk incremental data of disk Backup Data, may include the data block identifier modified and these data block identifiers are corresponding
The modification content of data block.
Based on the above situation, when migrating identified disk incremental data to target physical machine, the content migrated includes
The modification content of the data block identifier and these data block identifier corresponding data blocks modified.Correspondingly, target physical machine
When obtaining whole data in magnetic disk of above-mentioned virtual machine according to identified disk incremental data and the Disk Backup data having moved,
The corresponding data block of data block identifier modified can be first found in the Disk Backup data having moved, then according to upper
The block content of above-mentioned mark corresponding data block in the modification content modification Disk Backup data of mark corresponding data block is stated, and then is obtained
To whole data in magnetic disk of the virtual machine.
As seen from the above, in scheme provided in this embodiment, in the data in magnetic disk to target physical machine migration virtual machine
In whole process, the data migrated are only the data block identifier modified and these data block identifier corresponding datas
The modification content of block, compared with modified piece of content of the data block identifier corresponding data block modified, data volume is into one
Step is reduced, and therefore, is carried out Data Migration using scheme provided in this embodiment, can further be shortened magnetic disk of virtual machine data and move
The influence duration to user's operation virtual machine is moved, and then user experience can be further increased.
Corresponding with above-mentioned magnetic disk of virtual machine data migration method, the embodiment of the invention also provides a kind of virtual machine magnetic
Disk data migration device.
Fig. 5 is the first structural schematic diagram of magnetic disk of virtual machine data migration device provided in an embodiment of the present invention, the dress
It sets and is applied to virtual machine, comprising:
Command reception module 501 is instructed for reception of magnetic disc Data Migration, wherein in the data in magnetic disk migration instruction
Comprising have moved to target physical machine the virtual machine Disk Backup data information, the Disk Backup number of the virtual machine
According to being stored in the different backup physical machine of physical machine corresponding with the virtual machine;
Disk incremental data determining module 502, for determining that it is described virtual to the target physical machine that generation is had moved
The disk incremental data for the Disk Backup data generated after the Disk Backup data of machine;
Disk incremental data transferring module 503, for migrating identified disk incremental data to the target physical
Machine, so that the target physical machine is according to identified disk incremental data and the Disk Backup data having moved acquisition
Whole data in magnetic disk of virtual machine.
Specifically, the Disk Backup data of the virtual machine having moved to the target physical machine can be with are as follows: arrive
Until starting the Disk Backup data moment for migrating the virtual machine, for store the virtual machine Disk Backup data it is standby
The latest edition Disk Backup data of the virtual machine stored in part physical machine.
In a kind of optional implementation of the invention, described instruction receiving module is also used to receive for described virtual
The data modification operation of the data in magnetic disk of machine instructs;
The magnetic disk of virtual machine data migration device can also include:
Data in magnetic disk modified module, for modifying the data in magnetic disk of the virtual machine;
Modification record update module, for being instructed according to the data modification operation, the data for updating the virtual machine are repaired
Change record.
In the optional implementation of another kind of the invention, the magnetic disk of virtual machine data migration device can also include:
Data modification detection module, for migrating by identified disk incremental data to the mistake of the target physical machine
Whether Cheng Zhong, the data for detecting the data in magnetic disk of the virtual machine are modified;
Disk incremental data update module, the feelings for being yes in the testing result of the data modification instruction detection module
Under condition, identified disk incremental data is updated.
As seen from the above, in scheme provided in this embodiment, the Disk Backup data of virtual machine are first migrated to target physical
Then machine migrates virtual machine again and generates the disk incremental data for the Disk Backup data generated after the Disk Backup data
To target physical machine, target physical machine is enabled to obtain this virtually according to above-mentioned Disk Backup data and disk incremental data
Whole data in magnetic disk of machine.Since in scheme provided in this embodiment, above-mentioned Disk Backup data are stored in and virtual machine pair
In the different backup physical machine of the physical machine answered, so, it will not be occupied when migrating the Disk Backup data to target physical machine
The I/O resource of the corresponding physical machine of virtual machine, would not also influence user's operation virtual machine.In addition, though to target physical
Machine can occupy the I/O resource of the corresponding physical machine of virtual machine during migrating above-mentioned disk incremental data, influence user behaviour
Make virtual machine, but since above-mentioned disk incremental data is much smaller compared to for whole data in magnetic disk of virtual machine, so,
It is shorter to the influence time of user's operation virtual machine when migrating above-mentioned disk incremental data to target physical machine.In summary may be used
See, using scheme provided in this embodiment, when can shorten influence of the magnetic disk of virtual machine Data Migration to user's operation virtual machine
It is long, improve user experience.
In a specific embodiment of the present invention, referring to Fig. 6, the of magnetic disk of virtual machine data migration device is provided
Two kinds of structural schematic diagrams, compared with previous embodiment, in the present embodiment,
It include: to be instructed according to the data modification operation in the data modification record, the virtual machine modified
Data in magnetic disk data block identifier;
The disk incremental data determining module 502, comprising:
Data block identifier determines submodule 5021, for being recorded according to the data modification, determines to generate and have moved to institute
State the data block of the data in magnetic disk for the virtual machine modified after the Disk Backup data of the virtual machine of target physical machine
Mark;
First disk incremental data determines submodule 5022, for according to the data block identifier that finds, obtain with it is above-mentioned
Identify the block content of corresponding data block, and determine it as generate above-mentioned Disk Backup data after generate it is standby for the disk
The disk incremental data of part data.
Specifically, the data block identifier determines that submodule 5021 may include:
Data bitmap obtaining unit is obtained and is had moved for generation to the mesh for being recorded according to the data modification
The data bitmap of data in magnetic disk after the Disk Backup data of the virtual machine of mark physical machine, wherein one in the data bitmap
A marker, for indicating the void after generation is had moved to the Disk Backup data of the virtual machine of the target physical machine
Whether one data block of the data in magnetic disk of quasi- machine is modified;
Marker searching unit, for searching the marker for indicating that data block has been modified in the data bitmap;
Data block identifier determination unit, for determining the corresponding data block identifier of marker found.
Specifically, may include: the data in magnetic disk of the virtual machine to be modified in the data modification operation instruction
Data block identifier;
The modification record update module may include:
Data block identifier detection sub-module, the data modification for detecting the virtual machine record in it is whether existing described
The data block identifier of the data in magnetic disk for the virtual machine to be modified for including in data modification operation instruction;
Modification record updates submodule, is the case where being for the testing result in the data block identifier detection sub-module
Under, according to the above-mentioned data block identifier for including in data modification operation instruction, update the data modification record.
As seen from the above, in scheme provided in this embodiment, in the data in magnetic disk to target physical machine migration virtual machine
In whole process, only migration disk incremental data will affect operation of the user to virtual machine, and disk incremental data is by
Modified piece of Composition of contents of the data block identifier modified and these data block identifier corresponding data blocks, it is seen that it is counted
Therefore the data volume for the whole data in magnetic disk that be far smaller than virtual machine according to amount can shorten magnetic disk of virtual machine Data Migration pair
The influence duration of user's operation virtual machine.
In another specific implementation of the invention, referring to Fig. 7, magnetic disk of virtual machine data migration device is provided
The third structural schematic diagram, compared with previous embodiment, in the present embodiment,
It include: to be instructed according to the data modification operation in the data modification record, the virtual machine modified
Data in magnetic disk data block identifier and the data block modification content;
The disk incremental data determining module 502, comprising:
Data block identifier searches submodule 5023, has moved for searching to generate from data modification record to described
The data block mark of the data in magnetic disk for the virtual machine modified after the Disk Backup data of the virtual machine of target physical machine
Know;
Second disk incremental data determines submodule 5024, for the data block identifier that basis is found, from the data
The modification content of data block corresponding with above-mentioned mark is obtained in modification record, and is determined it as generation and had moved to the mesh
Mark the disk incremental data for the Disk Backup data generated after the Disk Backup data of the virtual machine of physical machine.
As seen from the above, in scheme provided in this embodiment, in the data in magnetic disk to target physical machine migration virtual machine
In whole process, the data migrated are only the data block identifier modified and these data block identifier corresponding datas
The modification content of block, compared with modified piece of content of the data block identifier corresponding data block modified, data volume is into one
Step is reduced, and therefore, is carried out Data Migration using scheme provided in this embodiment, can further be shortened magnetic disk of virtual machine data and move
The influence duration to user's operation virtual machine is moved, and then user experience can be further increased.
For device embodiment, since it is substantially similar to the method embodiment, related so being described relatively simple
Place illustrates referring to the part of embodiment of the method.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Those of ordinary skill in the art will appreciate that all or part of the steps in realization above method embodiment is can
It is completed with instructing relevant hardware by program, the program can store in computer-readable storage medium,
The storage medium designated herein obtained, such as: ROM/RAM, magnetic disk, CD.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.