The content of the invention
Present invention is primarily targeted at providing a kind of backup and reduction method and device of virtual machine, it is intended to solve virtual machinePoor performance, the problem that reduction Backup Data and Backup Data reduction rate can not be specified slow after recovering data.
For achieving the above object, a kind of backup and reduction method of virtual machine that the present invention is provided, including step:
Backup and reduction instruction is received, determines that the backup and reduction instructs corresponding restoration point;
Current backup increment bitmap and history backup increment bitmap are obtained, and according to current backup increment bitmap and historyBackup increment bitmap determines the corresponding increment bitmap of the restoration point;
The corresponding data block of the increment bitmap is extracted from back-up disk to send to former data disks, with former data disk startupVirtual machine is restored to the restoration point by virtual machine.
Preferably, it is described to determine that the restoration point is corresponding according to current backup increment bitmap and history backup increment bitmapAfter increment bitmap, also include:
Judge whether former data disks damage;
When former data disks are damaged, the corresponding data block of the increment bitmap is extracted from back-up disk and is sent to backup imageDisk, so that virtual machine is restored to the restoration point in backup image disk startup virtual machine.
Preferably, when backup and reduction instruction is that virtual machine is restored to the last backup, methods described includes:
Obtain current backup increment bitmap;
The corresponding data block of the current backup bitmap is extracted from back-up disk to send to former data disks, with former data disksStart virtual machine and virtual machine is restored to into the last backup.
Preferably, when backup and reduction instruction is that virtual machine is restored to the last backup, methods described includes:
Start virtual machine virtual machine is restored to the last backup from backup image.
Preferably, it is described to include the step of virtual machine is restored to the restoration point by former data disk startup virtual machine:
The data block that back-up disk sends is received, and is covered into former data disks;
Start virtual machine according to the data after covering, virtual machine is restored to into the restoration point.
Additionally, for achieving the above object, the present invention also provides a kind of backup and reduction device of virtual machine, including:
Receiver module, for receiving backup and reduction instruction;
Determining module, for determining that the backup and reduction instructs corresponding restoration point;
Acquisition module, for obtaining current backup increment bitmap and history backup increment bitmap;
The determining module, is additionally operable to determine the reduction according to current backup increment bitmap and history backup increment bitmapThe corresponding increment bitmap of point;
Recovery module, sends to former data disks for the corresponding data block of the increment bitmap is extracted from back-up disk, withVirtual machine is restored to into the restoration point in former data disk startup virtual machine.
Preferably, also include:
Judge module, for judging whether former data disks damage;
The recovery module, is additionally operable to, when former data disks are damaged, extract the increment bitmap corresponding from back-up diskData block is sent to backup image disk, so that virtual machine is restored to the restoration point in backup image disk startup virtual machine.
Preferably, the acquisition module, is additionally operable to obtain current backup increment bitmap;The recovery module, be additionally operable to fromExtract the corresponding data block of the current backup bitmap to send to former data disks in back-up disk, with former data disk startup virtual machineVirtual machine is restored to into the last backup.
Preferably, the recovery module, is additionally operable to start virtual machine so that virtual machine is restored to nearest one from backup imageSecondary backup.
Preferably, the receiver module, is additionally operable to receive the data block that back-up disk sends, and covers into former data disks;The recovery module, the data after being additionally operable to according to covering start virtual machine, and virtual machine is restored to the restoration point.
The present invention receives backup and reduction instruction, determines that the backup and reduction instructs corresponding restoration point;Obtain current backupIncrement bitmap and history backup increment bitmap, and according to current backup increment bitmap and history backup increment bitmap determineThe corresponding increment bitmap of restoration point;The corresponding data block of the increment bitmap is extracted from back-up disk to send to former data disks, withVirtual machine is restored to into the restoration point in former data disk startup virtual machine;Effectively faster recover Backup Data, and recover dataDisk afterwards does not affect performance, and can support multiple data convert points.
Specific embodiment
It should be appreciated that specific embodiment described herein is not intended to limit the present invention only to explain the present invention.
The primary solutions of the embodiment of the present invention are:Backup and reduction instruction is received, determines that the backup and reduction instruction is rightThe restoration point answered;Obtain current backup increment bitmap and history backup increment bitmap, and according to current backup increment bitmap andHistory backup increment bitmap determines the corresponding increment bitmap of the restoration point;The increment bitmap is extracted from back-up disk correspondingData block is sent to former data disks, so that virtual machine is restored to the restoration point in former data disk startup virtual machine.Effectively fasterRecover Backup Data, and the disk recovered after data does not affect performance, and multiple data convert points can be supported.
Due to the existing various schemes from Backup and Restore, in the case where multiple restoration points are needed, solution of cannot all working togetherCertainly recover short time consumption long, the problem of degradation after recovery.
Based on the problems referred to above, the present invention provides a kind of backup and reduction method of virtual machine.
With reference to Fig. 1, Fig. 1 is the schematic flow sheet of the first embodiment of the backup and reduction method of virtual machine of the present invention.
In one embodiment, methods described includes:
Step S1, receives backup and reduction instruction, determines that the backup and reduction instructs corresponding restoration point;
The instruction of the backup and reduction that reception is sent from user, and confirm that user is needed corresponding to the backup instruction of reductionRestoration point;The backup and reduction instruction that the user sends, is that user is located in former data disks based on the data cases in data disksHardware device send;The restoration point, is the Backup Data for having been stored in former data disks, is known as mark using restoration pointNot, the Backup Data in former data disks, every part of Backup Data have corresponding restoration point, and the restoration point can be the lastBackup, or the backup of history.
Step S2, obtains current backup increment bitmap and history backup increment bitmap, and according to current backup increment positionFigure and history backup increment bitmap determine the corresponding increment bitmap of the restoration point;
When user reduces Backup Data, the increment bitmap for backing up increment bitmap and history that acquisition is currently backed upPosition, it is determined that after the increment bitmap being currently backed up and history increment bitmap, according to the reduction instruction correspondence confirmed by step S1Restoration point, and confirm position of the corresponding increment bitmap of the restoration point in history increment bitmap.Contrast current delta bitmapThe difference of increment bitmap corresponding with restoration point, and a new increment data bitmap block is generated according to difference.
Step S3, extracts the corresponding data block of the increment bitmap from back-up disk and sends to former data disks, with former numberVirtual machine is restored to into the restoration point according to disk startup virtual machine.
According to the operation of step S2, the corresponding increment position that current delta bitmap is generated with backup increment bitmap difference is extractedDiagram data block is sent into former data disks.And in former data disk startup virtual machine, the data block is covered into former data disksCurrent delta bitmap corresponding data in, update current delta data bitmap, complete data backup.Virtual machine has been restored to instituteState restoration point.
Further, it is described virtual machine is restored to into the restoration point in former data disk startup virtual machine to include:
The data block that back-up disk sends is received, and is covered into former data disks;Based on the data of former data disks, cover withAfter the corresponding data of data block that back-up disk is sended over, the restoration point is updated in former data of data discs corresponding standbyNumber evidence;And start virtual machine according to the data after covering, virtual machine is restored to into the restoration point.
As the time point for recovering is typically closer to current time, so do subtraction to tend to return to backup fasterObject time point.Recovery process need to only replicate " residual quantity " (reverse process of incremental backup) relative to current time, during recoveryBetween it is very fast;Disk after recovery does not have snapshot, and performance is with suitable before recovery;Multiple restoration points can be supported.
In the present embodiment, by the reduction instruction for receiving, determine backup and reduction point and determine that the restoration point is correspondingIncremental backup, extracts corresponding data block and recovers into data disks, efficiently rapidly reduce the Backup Data of formulation, thisInvention is realized faster recovering Backup Data, and the disk recovered after data does not affect performance, and can support multiple data alsoOrigin.
In a preferred embodiment of the present invention, if backup and reduction instruction be virtual machine is restored to it is the last standbyDuring part, methods described also includes:
Obtain current backup increment bitmap;And the corresponding data block transmission of the current backup bitmap is extracted from back-up diskTo former data disks, so that virtual machine is restored to the last backup in former data disk startup virtual machine.Also, in the backup alsoWhen former instruction is that virtual machine is restored to the last backup, start virtual machine to be restored to virtual machine recently from backup imageOnce back up.
With reference to Fig. 2, Fig. 2 is the schematic flow sheet of the second embodiment of the backup and reduction method of virtual machine of the present invention.It is based onThe first embodiment of said method, it is described that the restoration point is determined according to current backup increment bitmap and history backup increment bitmapAfter corresponding increment bitmap, also include:
Step S4, judges whether former data disks damage;
Corresponding restoration point and reduction are determined in the increment bitmap backed up according to current backup increment bitmap and historyAfter the corresponding increment bitmap of point, need to judge whether former data disks have damage, whether the former data disks damage, by reading former numberJudged according to the data of disk, if the former data of data discs for reading is complete, former data disks are not damaged;If the former number for readingError can not be read or is read according to disk data, then former data disks have been damaged.Or carried out by the data storage of former data disksJudge, if data can normal storage enter former data disks, former data disks are not damaged.
Step S5, when former data disks are damaged, extract from back-up disk the corresponding data block of the increment bitmap send toBackup image disk, so that virtual machine is restored to the restoration point in backup image disk startup virtual machine;
If former data disks are damaged, the former data disks for representing current cannot be used for data backup reduction, start backup mirrorAs disk carries out data storage and backup as data disks.The corresponding data of increment bitmap being backed up described in extracting in back-up diskBlock is sent to backup image disk, and on the basis of the data block, in backup image disk startup virtual machine, is covered by the data blockCover data corresponding to current delta bitmap, will virtual machine be restored to the restoration point.Using this kind of mode restoring data, alsoVirtual machine performance after original is suitable with former data disks, and data convert speed is fast.
The main body of the backup and reduction method and device of the virtual machine of above-mentioned the first to second embodiment can be deposited for dataThe electronic equipment of storage.Further, this quickly can have data storage by being arranged on from the method for Backup and Restore virtual machineElectronic equipment realization, wherein, the electronic equipment of the data storage can include but is not limited to electronic equipment.The testing equipment bagInclude but be not limited to mobile phone, pad, notebook computer etc..
The present invention further provides a kind of backup and reduction device of virtual machine.
With reference to Fig. 3, Fig. 3 is the high-level schematic functional block diagram of the first embodiment of the backup and reduction device of virtual machine of the present invention.
In one embodiment, described device includes:Receiver module 10, determining module 20, acquisition module 30 and recovery module40。
The receiver module 10, for receiving backup and reduction instruction;
The instruction of the backup and reduction that reception is sent from user, the backup and reduction instruction that the user sends, is user's baseData cases in data disks are sent in the hardware device that former data disks are located;
The determining module 20, for determining that the backup and reduction instructs corresponding restoration point;
Confirm that user needs the restoration point corresponding to the backup instruction of reduction in data disks;The restoration point, is former numberAccording to the Backup Data for having been stored in disk, it is identified using restoration point as mark, the Backup Data in former data disks, per part of backupData have corresponding restoration point.
The acquisition module 30, for obtaining current backup increment bitmap and history backup increment bitmap;
When user reduces Backup Data, the increment bitmap for backing up increment bitmap and history that acquisition is currently backed upPosition, it is determined that the increment bitmap being currently backed up and history increment bitmap.
The determining module 20, is additionally operable to according to current backup increment bitmap and history backup increment bitmap determine alsoThe corresponding increment bitmap of origin;
Corresponding restoration point is instructed according to the reduction confirmed by determining module 20, and confirms the corresponding increment position of the restoration pointPosition of the figure in history increment bitmap.The difference of contrast current delta bitmap increment bitmap corresponding with restoration point, and according toDifference generates a new increment data bitmap block.
The recovery module 40, sends to former data for the corresponding data block of the increment bitmap is extracted from back-up diskDisk, so that virtual machine is restored to the restoration point in former data disk startup virtual machine.
According to the operation of acquisition module 30, the corresponding increasing that current delta bitmap is generated with backup increment bitmap difference is extractedAmount data bitmap block is sent into former data disks.And in former data disk startup virtual machine, the data block is covered to former dataIn the corresponding data of the current delta bitmap in disk, current delta data bitmap is updated, data backup is completed.Virtual machine is reducedTo the restoration point.
The receiver module 10, is additionally operable to receive the data block that back-up disk sends, and covers into former data disks;Based on originalThe data of data disks, after data corresponding with the data block that back-up disk is sended over are covered, in former data of data discs moreIt is newly the corresponding Backup Data of the restoration point;The recovery module 40, the data after being additionally operable to according to covering start virtual machine,So that virtual machine is restored to the restoration point.
As the time point for recovering is typically closer to current time, so do subtraction to tend to return to backup fasterObject time point.Recovery process need to only replicate " residual quantity " (reverse process of incremental backup) relative to current time, during recoveryBetween it is very fast;Disk after recovery does not have snapshot, and performance is with suitable before recovery;Multiple restoration points can be supported.
In the present embodiment, by the reduction instruction for receiving, determine backup and reduction point and determine that the restoration point is correspondingIncremental backup, extracts corresponding data block and recovers into data disks, efficiently rapidly reduce the Backup Data of formulation, thisInvention is realized faster recovering Backup Data, and the disk recovered after data does not affect performance, and can support multiple data alsoOrigin.
The acquisition module 30, is additionally operable to obtain current backup increment bitmap;The recovery module 40, is additionally operable to from backupExtract the corresponding data block of the current backup bitmap to send to former data disks in disk, with former data disk startup virtual machine by voidPlan machine is restored to the last backup.Also, when backup and reduction instruction is that virtual machine is restored to the last backup,Start virtual machine virtual machine is restored to the last backup from backup image.
With reference to Fig. 4, Fig. 4 is the high-level schematic functional block diagram of the second embodiment of the backup and reduction device of virtual machine of the present invention.Described device also includes judge module 50.
Judge module 50, for judging whether former data disks damage;
Corresponding restoration point and reduction are determined in the increment bitmap backed up according to current backup increment bitmap and historyAfter the corresponding increment bitmap of point, need to judge whether former data disks have damage, whether the former data disks damage, by reading former numberJudged according to the data of disk, if the former data of data discs for reading is complete, former data disks are not damaged;If the former number for readingError can not be read or is read according to disk data, then former data disks have been damaged.Or carried out by the data storage of former data disksJudge, if data can normal storage enter former data disks, former data disks are not damaged.
The recovery module 40, is additionally operable to, when former data disks are damaged, the increment bitmap correspondence be extracted from back-up diskData block send to backup image disk, so that virtual machine is restored to the restoration point in backup image disk startup virtual machine.
If former data disks are damaged, the former data disks for representing current cannot be used for data backup reduction, start backup mirrorAs disk carries out data storage and backup as data disks.The corresponding data of increment bitmap being backed up described in extracting in back-up diskBlock is sent to backup image disk, and on the basis of the data block, in backup image disk startup virtual machine, is covered by the data blockCover data corresponding to current delta bitmap, will virtual machine be restored to the restoration point.Using this kind of mode restoring data, alsoVirtual machine performance after original is suitable with former data disks, and data convert speed is fast.
The preferred embodiments of the present invention are these are only, the scope of the claims of the present invention is not thereby limited, it is every using thisEquivalent structure or equivalent flow conversion that bright description and accompanying drawing content are made, or directly or indirectly it is used in other related skillsArt field, is included within the scope of the present invention.