Embracing ESXi snapshots

I like virtualization and have been using vmware server for several years now.  There is something called vmware esxi which is free and a lot better and managing resources. Vmware server is good in that it runs on top of an operating system.  In my case Linux.  I use the Linux tools of LVM, snapshots and software RAID to prevent data loss on the virtual machines in case of disk failure.

ESXi is its own OS, it has strict hardware requirements and will not do software raid or snapshots.  Although I do run production VM’s on ESXi, I treat the VM’s like physical machines and back them up the same way.

I have found a way to back them up using snapshots using the tools built into ESXi

Here are the commands I used to back up a VM to an NFS mount

cp /vmfs/volumes/datastore1/myvm/*.vmx* /vmfs/volumes/nfs/myvm/
vim-cmd vmsvc/snapshot.create /vmfs/volumes/datastore1/myvm/myvm.vmx backup \
"Temp Backup Created for copying" quiesced
vmkfstools -d thin -i /vmfs/volumes/datastore1/myvm/myvm.vmdk \
/vmfs/volumes/nfs/myvm/myvm.vmdk
vim-cmd vmsvc/snapshot.remove /vmfs/volumes/datastore1/myvm/myvm.vmx backup

Still feeling sick and I think this is a relapse, will go to bed early.  Got so much work to do.  I really should get some sleep though.

Just doing pushups and situps.

This entry was posted in Technical, Training, Virtualization. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.