Restore an Existing Virtual Machine to a Previous State

The following steps restore a virtual machine to a certain saved state:

Procedure

  1. Shut down the virtual machine (if it is not already shut down).
  2. For SAN transport mode, a snapshot is required for restoring virtual disk data, and writes must go to the base disk only. The restore snapshot is optional (not necessary) for NBD(SSL) and HotAdd transport modes. On VVol datastores, if a snapshot was taken, writes must go to the leaf disk because the snapshot volume is read-only.
  3. Restore contents of the virtual disk(s). If there were no pre-existing snapshots at backup time, just the snapshot just created, restore only the base disks.

    Restoring disk data requires that you obtain the current names of virtual disks. This process is similar to the one described in Extract Backup Data from the Target Virtual Machine, except in this case you obtain this information directly from the virtual machine and not from a snapshot. The target for the saved disk data must be the actual disk name (including any sequence number) because the current incarnation of a virtual machine may be derived from one or more snapshots.

    Restoring disk data requires use of VixDiskLib. The VixDiskLib_Write() function opens the virtual disks so your program can write data. VixDiskLib functions transfer data to even-sector boundaries only, and transfer length must be an even multiple of the sector size.

    The virtual disk already exists, so it is not necessary to restore the disk configuration information mentioned in Extract Backup Data from the Target Virtual Machine.

  4. With SAN transport mode, revert-to and delete the snapshot that you created in step 2. Failing to perform this step with SAN mode could yield a virtual machine that cannot be powered on.