Create 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

Procedure

  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. Initialize the virtual disk library and open the redo log to obtain its parent handle.
  3. Create a child disk with the VixDiskLib_Create() function, and attach it to the parent:
    vixError = VixDiskLib_Attach(parent.Handle(), child.Handle());
  4. Read and write the virtual disk of the attached child.

    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.