Virtual Disk API Programming Guide - Documentation - VMware
Virtual Disk API Programming Guide - Documentation - VMware
Virtual Disk API Programming Guide - Documentation - VMware
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Virtual</strong> <strong>Disk</strong> <strong>Programming</strong> <strong>Guide</strong><br />
The data returned from the PropertyCollector is a container class called PropertyFilterUpdate, which<br />
contains an objectSet with an item‐by‐item list of changes to object properties. Every item in this container<br />
is identified with one of the following keys: enter (add), leave (delete), and modify. On the first data request,<br />
every data item is included, and “enter” is marked for every data item.<br />
The PropertyCollector presents its results in what amounts to random order. Since all managed objects<br />
have a “parent” property, you can reconstruct the configuration hierarchy by building a tree in memory, using<br />
the parent identification to organize. The root folder is identified as the only folder without a parent.<br />
Useful Property Information<br />
In the data returned from PropertyCollector, you can find most of the information that is useful for backup<br />
in the <strong>Virtual</strong> Machine managed object, including the following:<br />
<strong>Virtual</strong> <strong>Disk</strong>s – names, types, and capacities.<br />
<strong>Virtual</strong> Machine Type and Configuration – Whatever would be useful in (re)creating a virtual machine.<br />
This list might include such information as memory size and number of CPUs.<br />
Display Names – These names appear in <strong>VMware</strong> products such as the vSphere Client. You should keep<br />
track of these names and correlate them for consistency between your product and <strong>VMware</strong> products.<br />
<strong>VMware</strong> supports many virtual disk implementations. The disk implementation type is important because:<br />
On restore, you should re‐create virtual disk with the same disk type as the original virtual machine used.<br />
A disk backed by a pass‐through raw device mapping (RDM) mostly bypasses the ESXi storage stack. You<br />
cannot make a snapshot of this virtual disk type. Therefore, you cannot back up pass‐through RDM disk<br />
using the snapshot method described in this document.<br />
For more information about the Java <strong>API</strong>s, read the first several chapters of the <strong>VMware</strong> vSphere Web Services<br />
SDK <strong>Programming</strong> <strong>Guide</strong>, and related pages of the Web‐based <strong>VMware</strong> vSphere <strong>API</strong> Reference <strong>Documentation</strong>.<br />
Both are available at http://www.vmware.com/support/developer/vc‐sdk. Examples in this chapter assume<br />
that you have set up the vSphere SDK as described in documentation.<br />
Doing a Backup Operation<br />
After your program obtains information about what is available to back up, it can perform a backup. The three<br />
steps to the backup process are:<br />
“Create a Temporary Snapshot on the Target <strong>Virtual</strong> Machine” on page 60<br />
“Extract Backup Data from the Target <strong>Virtual</strong> Machine” on page 61, and save configuration information.<br />
“Delete the Temporary Snapshot” on page 61<br />
Prerequisites<br />
To complete a backup, the calling program requires the permissions shown in Table 7‐1.<br />
Table 7-1. Required Permissions to Complete a Backup<br />
Privilege Category Privilege Subcategory Privilege<br />
<strong>Virtual</strong> Machine Provisioning Allow <strong>Virtual</strong> Machine Download<br />
State Create Snapshot<br />
Remove Snapshot<br />
Configuration <strong>Disk</strong> Lease<br />
Create a Temporary Snapshot on the Target <strong>Virtual</strong> Machine<br />
The low‐level procedure for creating a snapshot of a virtual machine is documented in the section “Creating<br />
a Snapshot” on page 68. Set the quiesce flag True to make the file system quiescent, otherwise the snapshot<br />
might represent a transitional system state, with inconsistent data. Restoring such data might be destructive.<br />
60 <strong>VMware</strong>, Inc.