How full backup data is obtained?

When performing a full backup, the target is the virtual disk and not the entire virtual machine. Below are the two main methods for obtaining a full backup of a VMware virtual machine:

Method 1: Direct backup using VixDiskLib

Procedure: Using the VixDiskLib utility enables a full copy of the virtual disk contents.

Caveat: This method is less efficient for “Thin provisioning” or “Thick provisioning with zero latency” virtual disks, because even unused space is included in the backup, leading to unnecessary resource consumption.

Method 2: Getting full size data via QueryChangedDiskAreas

Process:

Call the `QueryChangedDiskAreas` API with the `changeId=’*’` parameter, which will return information about all allocated areas in the virtual disk.

Combine this with VixDiskLib to read specific disk data.

Advantage: This approach allows to locate and backup the actual used data more precisely, avoiding the problem of backing up a lot of free space.

Applicability: This method has the same effect as the first one for “thick backup zero” type virtual disks.

The process of obtaining incremental backup data

1. Initial Snapshot and Full Backup: Take a snapshot of the VM for the first time, and complete a full backup. 2.

2. Get ChangeId: Get the ChangeId of the virtual disk corresponding to the previous snapshot via the vSphere Web Services API (`VirtualDisk.getBacking.getChangeId`).

3. Second Snapshot: takes another snapshot of the virtual machine to capture the latest changes.

4. QueryChangedAreas: Use the `QueryChangedDiskAreas` API to get the modified areas since the previous snapshot by entering the ChangeId of the last snapshot, the moRef of the new snapshot, and the unique identifier of the virtual disk.

5. Read the incremental data: Based on the change area information obtained in step 4, use VixDiskLib’s `VixDiskLib_Read` function to read the actual incremental data.

6. Handling multiple disks: If the VM contains multiple virtual disks, repeat steps 2 to 5 for each disk to ensure that incremental updates are collected for all disks.

Caution

In cases involving multiple virtual disks, a single snapshot file may record change information for all disks. Therefore, after connecting and opening the snapshot, you should extract the corresponding incremental data based on the specific change offsets of each disk.

In addition, choosing an appropriate backup strategy (e.g., combining full and incremental backups) is crucial for improving backup efficiency and reducing storage requirements.

Leave a Reply

Your email address will not be published. Required fields are marked *