18.08.2013 Views

Virtual Disk API Programming Guide - Documentation - VMware

Virtual Disk API Programming Guide - Documentation - VMware

Virtual Disk API Programming Guide - Documentation - VMware

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

To re-create data for any given day<br />

1 Locate the -.vmdk redo log for the day in question.<br />

is a sequence number. You can identify this redo log or snapshot by its timestamp.<br />

2 Initialize the virtual disk library and open the redo log to obtain its parent handle.<br />

3 Create a child disk with the Vix<strong>Disk</strong>Lib_Create() function, and attach it to the parent:<br />

vixError = Vix<strong>Disk</strong>Lib_Attach(parent.Handle(), child.Handle());<br />

4 Read and write the virtual disk of the attached child.<br />

Practical <strong>Programming</strong> Tasks<br />

This is just an example. On managed disk, multiple snapshots are not recommended for performance reasons.<br />

Backup software on vSphere usually takes a snapshot, saves data to backup media, then deletes the snapshot.<br />

<strong>Virtual</strong> <strong>Disk</strong> in Snapshots<br />

The <strong>Virtual</strong> <strong>Disk</strong> <strong>API</strong> provides the following features to deal with the disk component of snapshots:<br />

Attaching an arbitrary child in a disk chain<br />

Opening read‐only virtual disks<br />

Ability to open snapshot disk on ESX/ESXi hosts through <strong>VMware</strong> vCenter<br />

Windows 2000 Read-Only File System<br />

Another use of parent‐child disk chaining is to create read‐only access for Windows 2000, which has no option<br />

for mounting a read‐only file system. In Figure 6‐1, the gray circle represents a virtual disk that must remain<br />

read‐only because it has children. In this example, you want the Windows 2000 virtual machine to use that<br />

virtual disk, rather than the newer ones C1 and C2. Create new child disk RO, attach to the gray virtual disk<br />

as parent, and mount RO as the (mostly empty) read‐only virtual disk of the Windows 2000 guest OS.<br />

Figure 6-1. Attaching <strong>Virtual</strong> Read/Write <strong>Disk</strong> for Windows 2000<br />

RDM <strong>Disk</strong>s and <strong>Virtual</strong> BIOS<br />

This section outlines low‐level procedures for restoring raw device mapping (RDM) disks and NVRAM.<br />

Restoring RDM <strong>Disk</strong>s<br />

C1 C2 RO<br />

Backing up and restoring RDM disks presents unusual challenges. The original backed‐up RDM configuration<br />

might not apply, and is probably not appropriate, if users restore:<br />

A virtual machine to a different host or datastore.<br />

Windows 2000<br />

A virtual machine that was deleted, when its originally mapped RDM was also deleted, or the containing<br />

LUN was repurposed and rewritten.<br />

The RDM to a different virtual machine, even if that virtual machine is on the same host and datastore.<br />

Users might do this to access files on the disk, or to test a restore.<br />

<strong>VMware</strong>, Inc. 53

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!