Sunteți pe pagina 1din 2

Procedure for Restoring a NFS VM From a Snapshot

Here are the steps to be followed to restore a VM from a Snapshot copy.

1. Obtain the name and location (datacenter) of the VM. Ask the customer
to power off the VM.
2. Figure out the name of the datastore that the machine's VMDK files are
located in.
3. Log in to the appropriate Linux machine so you can perform the restore.
4. Become super-user (root) if you logged in as yourself in step 3.
5. Mount up the filesystem/datastore:

(you can snag a look at the filesystems being exported using showmount)
[root@aectellin09 ~]# showmount -e 192.168.100.21
(Pit Clariion - 192.168.100.10, Dal Clariion 192.168.100.10)

/vol/TEL_NFS_NTA_SAT_NREPL_MGMT_002 192.168.100.0/24
/vol/TELVF02_ROOT (everyone)
/vol/TEL_NFS_NTA_SAT_NREPL_TMPL_004 192.168.100.0/24

Let's say that our datastore is TEL_NFS_NTA_SAT_NREPL_MGMT_002.

# mkdir /mnt/TEL_NFS_NTA_SAT_NREPL_MGMT_002 (makes a directory for the mount next)


# mount 192.168.100.21:/vol/TEL_NFS_NTA_SAT_NREPL_MGMT_002 /mnt/TEL_NFS_NTA_SAT_NREPL_MGMT_002
#mount 192.168.100.10:/NFS_PITEMC_DS6 /mnt/NFS_PITEMC_DS6 (EMC example)

6. Now find the VM directory:


(rename a directory - mv <old_name> <new_name>)
(remove all files from a directory: rm -rf * (removes all files from subdirectories and forces)
# cd /mnt/TEL_NFS_NTA_SAT_NREPL_MGMT_002/
# ls -l
total 8
drwxr-xr-x. 2 root root 4096 Feb 1 14:41 aectellin09
drwxrwxrwx. 2 root root 4096 Jan 27 19:01 aectellin20
# cd aectellin09
# ls -l
total 3.5G
-rw-------. 1 root root 2.0G Feb 1 14:41 aectellin09-16e0ffff.vswp
-rw-------. 1 root root 75G Feb 1 18:57 aectellin09-flat.vmdk
-rw-------. 1 root root 8.5K Feb 1 14:41 aectellin09.nvram
-rw-------. 1 root root 525 Feb 1 14:41 aectellin09.vmdk
-rw-r--r--. 1 root root 0 Feb 1 14:23 aectellin09.vmsd
-rwxr-xr-x. 1 root root 3.7K Feb 1 14:41 aectellin09.vmx
-rw-r--r--. 1 root root 266 Feb 1 14:41 aectellin09.vmxf
-rw-r--r--. 1 root root 68K Feb 1 14:40 vmware-1.log
-rw-r--r--. 1 root root 68K Feb 1 17:30 vmware.log

Observe here that though the flat.vmdk file is showing 75G as it's size, it is a sparse file that is efficiently
stored.
7. Let's say we want to copy these files from the snapshot to a new location.
#cd .ckpt (for Celerra)
# cd .snapshot/nightly.0 (for NetApp)
# mkdir ../../../aectellin09.RESTORED
(also #mkdir /mnt/NFS_PITEMC_DS6/HCSWIN2K81166 use absolute pathing to create the folder)
# cp --sparse=always --preserve=all * ../../../aectellin09.RESTORED/ (from within the folder)
(also #cp --sparse=always --preserve=all * /mnt/NFS_PITEMC_DS6/HCSWIN2K81166)
# cd ../../../aectellin09.RESTORED/
# ls -lh
total 3.5G
-rw-------. 1 root root 2.0G Feb 1 14:41 aectellin09-16e0ffff.vswp
-rw-------. 1 root root 75G Feb 1 23:59 aectellin09-flat.vmdk
-rw-------. 1 root root 8.5K Feb 1 14:41 aectellin09.nvram
-rw-------. 1 root root 525 Feb 1 14:41 aectellin09.vmdk
-rw-r--r--. 1 root root 0 Feb 1 14:23 aectellin09.vmsd
-rwxr-xr-x. 1 root root 3.7K Feb 1 14:41 aectellin09.vmx
-rw-r--r--. 1 root root 266 Feb 1 14:41 aectellin09.vmxf
-rw-r--r--. 1 root root 68K Feb 1 14:40 vmware-1.log
-rw-r--r--. 1 root root 68K Feb 1 17:30 vmware.log

You can now proceed with renaming the old directory to say, aectellin09.OLD, then rename
aectellin09.RESTORED to aectellin09 and power up the VM.

Don't forget to unmount the directories from the linux box, for example:

cd /
umount /mnt/TEL_NFS_NTA_SAT_NREPL_MGMT_002

S-ar putea să vă placă și