How to Restore a Virtual Machine from a Netapp Snapshot

Step 1. SSH into the Netapp Filer to which contains the virtual machine that you wish to restore.

Step 2. Once SSH into the Filer check to see what snapshots are available. Run a…

df -h

..to display all the volumes, which should display something like.

/vol/vmware0/ 200GB 143GB 56GB 72% /vol/vmware0/
/vol/vmware0/.snapshot 50GB 975MB 49GB 2% /vol/vmware0/.snapshot
/vol/vmware1/ 200GB 143GB 56GB 72% /vol/vmware1/
/vol/vmware1/.snapshot 50GB 975MB 49GB 2% /vol/vmware1/.snapshot
/vol/vmware2/ 640GB 253GB 386GB 40% /vol/vmware2/
/vol/vmware2/.snapshot 0GB 17GB 0GB —% /vol/vmware2/.snapshot
/vol/vmware3/ 640GB 187GB 452GB 29% /vol/vmware3/
/vol/vmware3/.snapshot 0MB 11MB 0MB —% /vol/vmware3/.snapshot

Step 3. Now run snap list plus the volume name to display the snapshot of that volume.

snap list vmware3

Output should like something like.

Volume vmware3
working…
%/used %/total date name
———- ———- ———— ——–
0% ( 0%) 0% ( 0%) Mar 13 12:00 hourly.0
0% ( 0%) 0% ( 0%) Mar 13 11:00 hourly.1
0% ( 0%) 0% ( 0%) Mar 13 10:00 hourly.2
0% ( 0%) 0% ( 0%) Mar 13 09:00 hourly.3
0% ( 0%) 0% ( 0%) Mar 13 08:00 hourly.4
0% ( 0%) 0% ( 0%) Mar 13 07:00 hourly.5
0% ( 0%) 0% ( 0%) Mar 13 00:00 nightly.0
0% ( 0%) 0% ( 0%) Mar 12 00:00 nightly.1

Pick a snapshot that you believe was the last known good data.

* Note: your volume name may differ.

Step 4. Now list the current luns and the their path.

lun show all

This should display something like the following.

/vol/vmware0/vmware0/vmware0.lun 200g (214748364800) (r/w, online, mapped)
/vol/vmware1/vmware1/vmware1.lun 200g (214748364800) (r/w, online, mapped)
/vol/vmware2/vmware2/vmware2.lun 320.0g (343645618176) (r/w, online, mapped)
/vol/vmware3/vmware3/vmware3.lun 320.0g (343645618176) (r/w, online, mapped)

Step 5. With the source LUN path we’ll now let create a cloned lun of the vmware volume from the snapshot. Since this is a cloned volume it will consume no space as it uses the block pointers from the snapshot from the base lun. The command to create the lun clone is…

lun clone create [-o noreserve] -b

Example:

lun clone create /vol/vmware3/restore.lun -o noreserve -b /vol/vmware3/vmware3/vmware3.lun nightly.1

* Note: be sure to use the “-o noreserve” otherwise this may cause issues with space.

Step 6. To make the cloned lun viewable by the VMware vCenter interface it needs to be added to an igroup viewable to the ESX host servers/clusters. Now it is possible to create a new igroup and add the new storage and ESX hosts to it but it is much easier to just use the one currently in use. To view the igroups on a Filer the command is…

igroup show

…this should display something like:

vmware (iSCSI) (ostype: vmware):
iqn.1998-01.com.vmware:elm-30c07ddd (logged in on: prod1, iscsi1)
iqn.1998-01.com.vmware:teak-5f0894ae (logged in on: prod1, iscsi1)
iqn.1998-01.com.vmware:bamboo-7434706b (logged in on: prod1, iscsi1)

Step 7. So from the above there is a “vmware” igroup that several ESX hosts are attaching to. So to map the cloned lun to the “vmware” igroup the command is as follows:

lun map /vol/vmware3/restore.lun vmware

Step 8. Now from the VMware vCenter select a ESX host server.

Step 9. Click on the “Configuration” Tab.

Step 10. Select “Storage Adapters.”

Step 11. Click “Rescan.”

Step 12. Now click “Storage” and the cloned lun should be listed.

Step 13. Right click on the new cloned datastore it should start with “snapXXXXXXXXX” and select open.

Step 14. At this point the all the virtual machines that are in the clone should be listed in the new window. In the window’s right pane you should be able to right click on the directory containing the VM(s) that you want to restore and copy them.

Step 15. Now go back to the vCenter interface and Right click on the datastore that you want to copy the restored VM to and select open.

Step 16. In the new window right pane select paste. This should copy the VM from the cloned lun to the production lun storage.


Advertisement

~ by gcleric on March 13, 2009.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.