Background technology
Intel Virtualization Technology refer to computing element on the basis of virtual rather than real on the basis of run.Intel Virtualization Technology
The capacity of hardware can be expanded, simplify the re-configuration process of software.The Intel Virtualization Technology of CPU can single CPU mould
Intend multi-CPU parallel, it is allowed to a platform runs multiple operating system simultaneously, and application program can be the most solely
Run in vertical space and be independent of each other, thus significantly improve the work efficiency of computer.
Along with the increasingly maturation of Intel Virtualization Technology, particularly prestige farsighted (vmware) company runs business big and strong, and is proposed one
Series virtualizes relevant product, the most well helps user to solve hardware resource waste, IT complex management etc. and is
A row difficult problem.Migrate, soon additionally, virtualization more can solve the insurmountable difficult problem of current device, such as DynamicHost
Prompt deletion data, unified desktop management, even create the enterprise integration environment etc. of blue screen never.
Bringing under the offensive that can not keep out temptation in virtualization to user, a lot of enterprises and some other organization all open
Begin or application moved on virtual platform.Protect the production on virtual platform the most expeditiously
Data, so that creation data does not occur destructive loss when by disaster, become with application virtualization
Another hot issue.
Vmware self is also in the performance constantly promoting virtual machine Backup and Restore.Vmware introduces for data protection
Virtual memory application programming interface (VADP, vStorage API for Data Protection), for back-up application
Program provides application programming interface (API, the Application of the standard directly accessing virtual machine file
Programming Interface) set.If backup tool manufacturer selects to use VADP, then the change of VADP
Block tracer technique enables virtual platform to follow the trail of the data block that after Last Backup completes, virtual machine file changes, when
So the most this change block tracer technique will lose efficacy, and the most again magnetic disk of virtual machine being done incremental backup will
Perform backup totally.Based on VADP, magnetic disk of virtual machine is backed up, be by calling virtual disk research and development tool kit
(VDDK, Virtual Disk Development Kit) API reads the binary content of magnetic disk of virtual machine, not
There is the function resolving magnetic disk of virtual machine, therefore can only select one of the following two kinds operation: otherwise by magnetic disk of virtual machine from
Head all backs up to all sectors of tail, or gets magnetic disk of virtual machine according to the change block tracer technique of VADP
The data block of change, the then corresponding data sector changing block of backup.
Therefore, will there are the following problems the when of virtual machine backup based on VADP: finish full backup and
In the case of VADP change block tracer technique lost efficacy, doing incremental backup can be by the number of all sectors of whole virtual disk
According to all backing up, even the actual amount of data of magnetic disk of virtual machine is the least, the even situation of blank diskette.The most not only
The BACKUP TIME that virtual machine can be made to back up is elongated, and virtual machine backup can affect the property of virtual platform itself for a long time
Can, End-Customer also to provide the storage medium of costliness for the most useless data, has an effect on contingent the most extensive
Multiple duration.
Summary of the invention
This application provides a kind of disk backup method of virtue machine, so that the duration of Backup and Restore window shortens, subtracts
To the resource occupation of virtual platform and save a lot of memory space for client less.
A kind of disk backup method of virtue machine that the embodiment of the present application provides, including:
Virtual machine on virtual platform is initiated backup by A, backup server;
B, backup server and virtual platform communicate, and notice virtual platform performs snapshot to described virtual machine
Operation;
Virtual machine is performed after snapshot operation by C, virtual platform, the stamper of described virtual machine is carried out parsing and obtains magnetic
Dish real data sector is distributed, and virtual platform returns the distribution of disk real data sector to backup server;
D, backup server get the distribution of each disk real data sector, are then backed up by corresponding sector data
In media server.
It is preferred that backup server is to back up completely or VADP the backup that the virtual machine on virtual platform is initiated
Change block follows the trail of the incremental backup lost efficacy.
Obtain the distribution of disk real data sector include it is preferred that the stamper of described virtual machine to be carried out parsing:
Read first sector data of the stamper of described virtual machine;
Judge that according to the magic number in described first sector data the stamper of virtual machine is the most effective, if so, according to described
Overhead field in first sector data determines master boot sector position;
The partition list of the stamper according to described master boot sector position acquisition virtual machine and the file system of each subregion;
Acquisition of information according to each subregion is distributed to the real data sector of subregion.
It is preferred that described being backuped to by corresponding sector data in media server is:
Tool kit is researched and developed by the virtual disk of virtual memory application programming interface VADP for data protection
Corresponding sector data is backuped in media server by VDDK API.
As can be seen from the above technical solutions, resolved before backup and obtain the distribution of disk real data sector, and
Accordingly real data is backed up, thus improve backup efficiency, and reduce in backup procedure flat to virtualization
The internal memory of platform, network, the I/O read-write consumption of resource and the internal memory of backup server, network, I/O read and write money
Source consumes, and saves the memory space of media server.Additionally, due to backup data quantity diminishes, then
The when of needing to recover data, the duration of recovery just shortens, and helps user to improve the RTO of recovery.
Detailed description of the invention
Although the type of magnetic disk of virtual machine has multiple, but it is identical for having a bit, that is, each virtual machine magnetic
First sector of dish file can record the information that whole disk structure is relevant.Table 1 shows a kind of magnetic disk of virtual machine first
The description of data structure each field of body of individual sector:
Data name |
Length or type |
Describe |
MagicNumber |
4 bytes |
Evil spirit number, represents that this magnetic disk of virtual machine is the most effective, and " KDMV " is effective |
Version |
4 bytes |
Version number |
Flags |
4 bytes |
Flag bit, whether mark has redundancy granularity table, if the information such as compression |
Capacity |
8 bytes |
The capacity of magnetic disk of virtual machine file, in units of sector |
grainSize |
8 bytes |
The size of each granularity, in units of sector |
DescriptorOffset |
8 bytes |
Embedded disk describes the initial sector of information |
DescriptorSize |
8 bytes |
The size of description information |
NumGTEsPerGT |
4 bytes |
Each granularity table has how many granularity entities |
RgdOffset |
8 bytes |
The initial sector of redundancy granularity directory |
gdOffset |
8 bytes |
The initial sector of granularity directory |
overHead |
8 bytes |
The initial sector of data |
uncleanShutdown |
1 byte |
It is used for arranging file the most normally to exit last time, normally exits and be set to false, otherwise be true |
singleEndLineChar |
Character |
It is used for verifying whether file has exception in the transmitting procedure of ftp |
nonEndLineChar |
Character |
|
DoubleEndLineChar1 |
Character |
|
DoubleEndLineChar2 |
Character |
|
CompressAlgorithm |
2 bytes |
For judging whether each grain of magnetic disk of virtual machine is compressed |
Pad |
|
Filler |
Wherein, the magic number (MagicNumber) of 4 byte representation magnetic disk of virtual machine of first sector beginning, evil spirit number is
Being used for judging that magnetic disk of virtual machine is the most effective, general value then represents it is an effective magnetic disk of virtual machine for " KMDV ",
It it is otherwise an invalid magnetic disk of virtual machine.The overhead field of the 64th~72 byte of first sector
(overHead), record is the position of initial data sector of magnetic disk of virtual machine, can according to the value in these 8 bytes
To determine the position of magnetic disk of virtual machine initial data sector, just can be as resolving common hard disc file after getting this value
Equally the content of magnetic disk of virtual machine is resolved.
The application scheme is by resolving the form of magnetic disk of virtual machine, it can be determined that whether current virtual machine disk is one has
The virtual disk of effect, if this virtual disk is an effective virtual disk.Just can correctly get this disk
All partitioning scenario, and the sector auxiliary information that the file system type of each subregion and this subregion real data are distributed
Deng.
The storage organization of magnetic disk of virtual machine and the file system of the same race structure on true hard disk are the same.Resolve true
The when of filesystem information on hard disk, point of penetration is MBR district (MBR), then magnetic disk of virtual machine
The location determining method of MBR is: read the 64th~72 byte overHead of first sector of vmdk file
Field, can navigate to the position of the MBR of magnetic disk of virtual machine by the value of overHead field.MBR totally 512
Individual byte, last 64 bytes are hard disk partition table (Disk Partition Table, DPT), the byte of skew 0x04
Being the file system type of this subregion, 4 bytes that skew 0x08 rises are the sector number that this subregion has used, last 4
Individual byte is the total bytes of this sector.After getting the partition table information of DISK to Image, it is possible to know each subregion
Position, initial sector and terminate sector position and this partitioned file system type (a subregion list item account for 16 words
Joint, the content of the 1st byte is the guiding mark of subregion, represents whether this subregion is boot partition;2nd~4 word
Joint represents the initial magnetic head of subregion, sector, cylinder, can obtain the initial sector of subregion according to the value of these three byte
Position;5th byte represents divisional type, and such as 07 represents NTFS partition;6th~the 8 end magnetic representing subregion
Head, sector, cylinder, just can obtain the end sector position of subregion according to these three value).Then according to subregion not
With file system type, the file system of this subregion is resolved, the institute inside this partitioned file system can be parsed
(sector position at the All Files place resolving various file system is one and becomes very much the sector position at some file places
Ripe technology, is no longer described in detail).Thus can obtain the description information in magnetic disk of virtual machine and All Files
The concrete sector position at place.
A kind of disk backup method of virtue machine flow process that the application provides is as it is shown in figure 1, include:
Step 101: some virtual machine on virtual platform is initiated backup by backup server.
If this type of backup is the incremental backup that backup completely or VADP change block follow the trail of inefficacy, continue executing with
Step 102.If other situations, i.e. VADP change block follows the trail of effective incremental backup, then according in prior art
Incremental backup method carry out subsequent backup step.
Step 102: the virtual platform virtual machine to back up performs snapshot operation.
When creating snapshot, can be the newly-built sub-disk of each disk of virtual machine, and that original disk is relative to soon
According to being exactly stamper for dish.
Step 103: after virtual platform performs snapshot operation to virtual machine, the stamper of described virtual machine is resolved
Obtaining the distribution of disk real data sector, virtual platform returns the distribution of disk real data sector to backup server.
It is preferred that this step specifically includes:
Read first sector data of the stamper of described virtual machine;
Judge that according to the magic number in described first sector data the stamper of virtual machine is the most effective, if so, according to described
Overhead field in first sector data determines master boot sector position;
The partition list of the stamper according to described master boot sector position acquisition virtual machine and the file system of each subregion;
Acquisition of information according to each subregion is distributed to the real data sector of subregion.
Step 104: backup server gets the distribution of each disk real data sector, then by corresponding sector number
According to backuping in media server.
VDDK API provides the interface reading vmdk disk sector, as long as telling this interface vmdk to be read disk
Those sectors the most permissible, just can be directly obtained the data message of corresponding sector by this interface.
For making the know-why of technical scheme, feature and technique effect clearer, below in conjunction with concrete real
Execute example technical scheme is described in detail.
The magnetic disk of virtual machine backup that Fig. 2 provides for the embodiment of the present application realizes flow process, comprises the steps:
Step 201: select a virtual machine A on virtual platform.
This virtual machine A has two disk disk1 and disk2, disk1 and disk2 Disk Quotas sizes to be 100GB,
Disk1 be system disk actual amount of data be 20GB, disk2 be application data disks actual amount of data be 40GB.
Step 202: backup server initiates backup to virtual platform, virtual machine A is performed by notice virtual platform
Snapshot.
Step 203: backup server judges whether current type of backup is to back up completely, or VADP change
The incremental backup that block tracking technique lost efficacy, if so, continues executing with step 204.
Step 204: female disk of virtual machine A is resolved by backup server, gets the reality of disk1 and disk2
The quantity of data sector, border and position, return result to backup server.
Step 205: after backup server gets the sector auxiliary information of these disks, by the VDDK API of VADP
Corresponding sector data is read out, backups in media server.
Step 206: after having backed up, backup server confirms that this backup data quantity size is 60GB.
Technical scheme can realize following Advantageous Effects:
1, in magnetic disk of virtual machine backup procedure, it is only necessary to the size of backup virtual machine disk actual amount of data, it will
Improve backup efficiency.
2, owing to having only to the size of the actual amount of data of backup virtual machine disk, relative total backup data volume meeting
Reduce, then backup procedure consumes the internal memory of virtual platform, network, I/O read-write resource just minimizing.
3, diminish due to the data volume of backup, then the internal memory of backup server, network, I/O read-write resource disappears
Consumption also can reduce, and most notably the data volume of media server storage reduces, and saves more storage for user
Space.
4, diminishing due to backup data quantity, then data are recovered by needs when, the duration of recovery is just
Shorten, help user to improve target recovery time (RTO, Recovery Time Objective) of recovery.
The foregoing is only the preferred embodiment of the application, not in order to limit the protection domain of the application,
Within all spirit in technical scheme and principle, any modification, equivalent substitution and improvement etc. done,
Should be included within the scope of the application protection.