Managing Child Disks
In the Virtual Disk API, redo logs are managed as a parent-child disk chain, each child being the redo log of disk changes made since its inception. Trying to write on the parent after creating a child results in an error. The library expects you to write on the child instead. See Child Disks Created from Parent for a diagram.
Creating Redo Logs
A redo log is created by taking a virtual machine snapshot, which contains both disk data and virtual machine state. On hosted disk only, VixDiskLib_CreateChild() creates a redo log without virtual machine state.
You could write a simple application to create redo logs, or snapshots on managed disk, at 3:00 AM nightly. (although multiple snapshots have a performance impact). When you create a redo log while the virtual machine is running, the VMware host re-arranges file pointers so the primary VMDK, <vmname>.vmdk for example, keeps track of redo logs in the disk chain. Use the disk chain to re-create data for any given day.
To re-create data for any given day
1
Locate the <vmname>-<NNN>.vmdk redo log for the day in question.
<NNN> is a sequence number. You can identify this redo log or snapshot by its timestamp.
2
3
Create a child disk with the VixDiskLib_Create() function, and attach it to the parent:
vixError = VixDiskLib_Attach(parent.Handle(), child.Handle());
4
This is just an example. On managed disk, multiple snapshots are not recommended for performance reasons. Backup software on vSphere usually takes a snapshot, saves data to backup media, then deletes the snapshot.
Virtual Disk in Snapshots
The Virtual Disk API provides the following features to deal with the disk component of snapshots:
Windows 2000 Read-Only File System
Another use of parent-child disk chaining is to create read-only access for Windows 2000, which has no option for mounting a read-only file system.
In Attaching Virtual Read/Write Disk for Windows 2000, the gray circle represents a virtual disk that must remain read-only because it has children. In this example, you want the Windows 2000 virtual machine to use that virtual disk, rather than the newer ones C1 and C2. Create new child disk RO, attach to the gray virtual disk as parent, and mount RO as the (mostly empty) read-only virtual disk of the Windows 2000 guest OS.
Attaching Virtual Read/Write Disk for Windows 2000