5 using the vsm api to traverse the snapshot tree – HP SAN Virtualization Services Platform User Manual
Page 62
5 Using the VSM API to traverse the snapshot tree
This chapter explains how to traverse the snapshot tree using the VSM API (CLI commands or APIs).
The snapshot tree used to explain the following examples is shown below.
In the figure above, the solid line between the circles represents a parent-child (or source-child)
relationship between the two objects. The GetSnapshotData command (or
VSMGetSnapshotData
API) returns (as the source name) the name of the parent node (virtual
disk, snapshot, or PiT) as determined by the above defintions.
•
The source of a snapshot can only be a PiT.
•
The source of a PiT can be a virtual disk, PiT, or snapshot.
The traversal algorithm is as follows:
1.
Find a virtual disk by name.
Run the ListVirtualDisks command and find the required virtual disk name in the returned
list.
2.
Find a snapshot or PiT by name.
Run the ListSnapshots command, and find the required snapshot or PiT name in the
returned list.
The ListSnapshots command returns an unordered list with the objects “PiT1, . . .,PiT12,
snapshot1, . . . , snapshot6,” including all snapshots or PiT objects. Each returned object has
a master flag property that is TRUE for a PiT, and FALSE for a snapshot.
3.
Find all PiTs of the whole SAN.
Run the ListSnapshots command, and select all objects that have their master flag set to
TRUE.
The output is an unordered list of “PiT1 . . . PiT12.”
4.
Find all snapshots of the whole SAN.
Run the ListSnapshots command, and select all objects that have their master flag set to
FALSE.
The output is an unordered list of “snapshot1 . . . snapshot6.”
5.
Find the branch of PiTs for VirtualDisk1.
Run the ListPiTsChain command with the input “VirtualDisk1.”
The output is an ordered list of “PiT1, PiT2, PiT3” (by time of the PiT, from oldest to newest).
62
Using the VSM API to traverse the snapshot tree