APIT snapshots on Windows
APIT snapshots on Windows
APIT snapshot creation process
Creating an Any Point In Time snapshot on Windows involves passing down of a timestamp for the point in time for which the snapshot is to be taken from the NetBackup requester to the RealTime VSS provider. The RealTime VSS provider implements an interface called 'SetSnapshotTime' which gets called from the requester to set the point in time for which the snapshot is to be taken. Once the timestamp is set, the provider will use it to create the snapshot of the production lun for that time instance.
The RealTime VSS provider uses the timestamp string passed from the requester to the 'create annotation' command which gets called to create a marker in the RealTime timeline. Creating the annotation with the timestamp argument will create a marker at that point in time on the RealTime timeline; the subsequent creation of the shadow copy will be a snapshot of the production lun for that instance in time.
Currently, taking a Any Point In Time snapshot from NetBackup after setting the image time using the 'SetSnapshotTime' interface fails on a Windows host. (The snapshot creation process fails with the generic status 156 error)
Problem Description
Prior to the creation of the actual snapshot, the Windows VSS service sets certain flags on the production lun; one of these flags is the hidden flag which is set by VSS on the lun to be shadow copied. During the 'CommitSnapshots' step of the snapshot creation process where the shadow copy is created, these flag settings get copied over to the shadow copy lun; since the hidden flag is set by VSS on the production lun, the shadow copy lun also has the hidden flag set and gets exported as a hidden volume.
The RealTime VSS provider implements the 'CommitSnapshots' method by creating an annotation in the RealTime timeline for the snapshot. For the case where the snapshot is being taken for the current point in time, the flag settings made by VSS would be captured in the RTP timeline and the shadow copy lun which would subsequently be exported using the annotation created above will have these flags set. However if the snapshot of the production lun is taken for a previous point in time, the flag settings made by VSS will not be captured in the RTP timeline for that instance and the shadow copy lun created would also not have the flags set by VSS on the production lun. Consequently, the shadow copy that is created for this case does not get exported as a hidden volume.
During snapshot import, VSS scans the bus and searches for the shadow copy as a hidden volume. For APIT snapshots, this scan does not succeed as VSS cannot find the hidden shadow copy due to which it fails the entire snapshot creation process.
Problem Solution
Setting the hidden flag manually on the shadow copy lun from the VSS provider prevents the snapshot creation failure for APIT snapshots.
Windows has a Virtual Disk Service (VDS) API 'SetFlags' which can be used to set the hidden flag on the shadow copy. Using this API requires getting a reference to the shadow copy volume object which involves walking through the VDS object hierarchy of providers, packs, disks and volumes. This setting of the hidden flag using 'SetFlags' is done in the RealTime VSS provider immediately after the shadow copy (timeimage in RealTime terminology) is created using the annotation previously set.
This setting of the hidden flag for APIT snapshots currently works only on Windows 2003. For Windows 2008, VSS sets additional flags on the production lun which cause the snapshot import to fail as these flag settings are not present on the shadow copy lun . Currently it is not clear what exactly these flag settings are and how these flags are to be set; more work needs to be done to resolve this issue on Windows 2008.
Links:
VSS snapshot creation process: http://msdn.microsoft.com/en-us/library/aa384589(VS.85).aspx
VDS: http://msdn.microsoft.com/en-us/library/bb986750(VS.85).aspx
SetFlags API: http://msdn.microsoft.com/en-us/library/aa383031(VS.85).aspx
Need an essay? You can buy essay help from us today!



