Quick note on working with vmfsktools
So I’ve been restoring some Windows servers from NetApp snapshots today, specifically single hard disks that had been having problems (long story involving Windows problems, etc). I found this pretty easy to do once I got the syntax down – basically, all I was looking to do was to restore the C: of a server, but keep it’s D: intact – that way I’d keep the most recent data, in this case some SQL files, but could roll back to a point where the Windows OS was a little less hosed up. Mostly for my own quick reference in the future, this is how I cranked a bunch of these out.
So, found my snapshot and all the files of the VM (one line):
/vmfs/volumes/NFSSTORE/.snapshot/nightly.2010-01-31_0000/SERVERNAME
I then found my destination, or where the VM currently lives:
/vmfs/volumes/NFSSTORE/SERVERNAME
I’m particularly interested in SERVERNAME.vmdk, which is the C: in this case. In order to not run into myself, I renamed the current, not-booting SERVERNAME.vmdk using vmfsktools while in the working directory of the current VM:
vmkfstools -E SERVERNAME.vmdk SERVERNAME_old.vmdk
Then, this is as simple as importing the .vmdk from the .snapshot directory to the current working directory of the VM. Yes, you can use cp to do this, but vmfsktools is hella faster (one line):
vmkfstools -i /vmfs/volumes/NFSSTORE/.snapshot/nightly.2010-01-31_0000/SERVERNAME/SERVERNAME.vmdk /vmfs/volumes/NFSSTORE/SERVERNAME/SERVERNAME.vmdk
Since the .vmx file is still configured with the SERVERNAME.vmdk and SERVERNAME_1.vmdk disk files, there shouldn’t be any need to reconfigure the VM before powering it on. Finally, I verified that the machine was booting normally and deleted the _old file to save disk space.













Leave a comment