Wednesday, 24 April 2013

NetApp VSC 4.1 Series - Part 6/7: Rolling-Back to a Datastore Snapshot

In Part 5, we restored the contents of a Datastore Entity back into itself after having “accidently deleted” the VMs inside, and this took time to complete. There are use cases where this restore approach may not be necessary, and we can simply roll back the datastore to a snapshot which takes hardly any time at all. Here’s how we do it.

vSphere Client > Home > Inventory > Datastore and Datastore Clusters
- Right-click the datastore and choose Unmount, and follow the ‘Remove Datastore Wizard’ to complete the task.
Note: All VMs must be either moved, unregistered, or deleted first!

Image: Unmount datastore

vSphere Client > Home > Solutions and Applications > NetApp
Backup and Recovery > Backup
- Right-click the backup job, click ‘Suspend’, and click Yes to the warning

Image: VSC 4.1 Suspend Backup

vSphere Client > Home > Solutions and Applications > NetApp
Backup and Recovery > Restore
- Take a note of your backups

Note: Depending on how far you roll back, you may want to delete some of these backups first (the future backups after the restore point won’t work!) Here we’re just rolling back to the latest so nothing to delete.

Image: VSC 4.1 Backups List

Data ONTAP CLI
- Enter the following commnds to list the snapshots, and then roll back to the latest SMVI snapshot:

snap list VOLUMENAME
snap restore -t vol -s smvi__BACKUPJOBNAME_recent VOLUMENAME

Example output:

LONNTP01> snap list -V LONNFSVOL3

  %/used       %/total  date          name
----------  ----------  ------------  --------
 97% (97%)    2% ( 2%)  Apr 24 08:00  smvi__TEST01_recent
 97% (38%)    2% ( 0%)  Apr 24 07:00  smvi__TEST01_20130424080000
 97% (38%)    2% ( 0%)  Apr 24 06:00  smvi__TEST01_20130424070000
 97% (38%)    2% ( 0%)  Apr 24 05:00  smvi__TEST01_20130424060000
 97% (38%)    2% ( 0%)  Apr 24 04:00  smvi__TEST01_20130424050000
 97% (38%)    2% ( 0%)  Apr 24 03:00  smvi__TEST01_20130424040000
 97% (38%)    2% ( 0%)  Apr 24 02:00  smvi__TEST01_20130424030000

LONNTP01> snap restore -t vol -s smvi__TEST01_recent LONNFSVOL3

WARNING! This will revert the volume to a previous snapshot. All modifications to the volume after the snapshot will be irrevocably lost. Volume LONNFSVOL3 will be made restricted briefly before coming back online.
Are you sure you want to do this? y
You have selected volume LONNFSVOL3, snapshot smvi__TEST01_recent
Proceed with revert? y
Wed Apr 24 12:17:06 GMT [LONNTP01:wafl.snaprestore.revert:notice]: Reverting volume LONNFSVOL3 to a previous snapshot.
Volume LONNFSVOL3: revert successful.

vSphere Client > Home > Inventory > Hosts and Clusters
- Click a host > Configuration tab > Hardware: Storage > and Add Storage…

Add Storage Wizard:
- Storage Type = NFS and click Next >
- Enter NFS Server, Folder, Datastore Name, and click Next >
- Then click Finish

Image: Add Storage - Locate Network File System

And repeat adding in the NFS datastore using the method above for the remaining hosts, or use the ‘Mount datastores’ button as below.

Note i: The ‘Mount datastore’ button only works if at least one host can already see the datastore to be mounted.
Note ii: The VSC doesn’t have a Mount datastores button when the Cluster object is selected.

Image: VSC - ‘Mount datastores’ button

Image: Mount datastores - “No datastores available to mount” when no hosts know about the datastore to be mounted!

vSphere Client > Home > Inventory > Datastores and Datastore Clusters
- Select the NFS volume and click ‘Browse Datastore…’
- Select a VM folder
- Right-click the .vmx file, select ‘Add to Inventory’, and follow through the wizard
- Repeat for all the VMs to be added

Image: Datastore Browser - Add to Inventory

Final steps you might want to do are power-on the VMs, and resume the VSC backup job. The VSC backup job should be completely unaffected after following the above process (the same snapshots exist as before - since here we only rolled back to the latest one.)

APPENDIX: Some Useful snap commands

snap list VOLUMENAME
snap create VOLUMENAME MYSNAP
snap rename VOLUMENAME MYSNAP MYSNAPOLD
snap restore -t vol -s MYSNAP VOLUMENAME
snap delete VOLUMENAME MYSNAP

1 comment:

  1. Whenever i want some drawback relating this issue I return to your web site and obtain terribly informative stuff thanks plenty for your article . Keep it up.
    access Bee MP3 in UK

    ReplyDelete