2

If I create a snapshot with: 'vim-cmd vmsvc/snapshot.create' I can then transfer the file that creates to another system, or even to another vmware ESXi system.

Setting aside the fact that snapshots are not the best backup practice, how viable is this snapshot ? Is it, indeed, a snapshot of the entire system that I can then run on a different ESXi system (or on the same one, if I pull it from backup storage) ?

Let's assume that my command has a "1" at the end, which tells vim-cmd to quiesce the VM first before snapshotting...

user227963
  • 199
  • 1
  • 2
  • 11

2 Answers2

3

It will be pretty useless and you won't be able to transport a snapshot to another system for use. They depend entirely on the original VMDK's.

Again, this isn't the purpose of VMware snapshots. They're really meant to be temporary and have major implications for storage performance and disk space.

ewwhite
  • 194,921
  • 91
  • 434
  • 799
  • Thank you. So if I take the VMDK by itself, that's a functional backup (regardless of how good or bad that practice may be) ? – user227963 Jul 02 '14 at 00:30
  • I probably wouldn't do that... but yeah, a VMDK is 98% of the virtual machine. There is also the virtual machine's configuration file... (.vmx) – ewwhite Jul 02 '14 at 01:01
1

Snapshotting a VM means that the original VMDKs are fixed, all changes will go to a diff file. So you would have to copy the VMDK files themselves. (As far as I know there are two: A vmdk file describing the virtual disk and a "flat" file containing the data.)

However, I would consider this a pretty crude and unprofessional way to do backups of VMs. It might be OK for test or development VMs, but not for VMs that host production workloads.

Did you have a look at VDP? I think it comes with vSphere... it's a bit limited but maybe it's good enough for you.

edit: Similar question: Why don't people just use rsync to back up vmware guests?

Mario Lenz
  • 1,612
  • 9
  • 13
  • VDP is included with the vSphere Essentials Plus suite. It's actually EMC Avamar, integrated into the vSphere Web Client interface. – ewwhite Jul 02 '14 at 21:22
  • If you properly back up both the VMDK and the .vmx config file ... and later, possibly back up one or more snapshots you create with vim-cmd ... what else is there ? What would make it more professional ? – user227963 Jul 03 '14 at 15:20
  • @user227963 I don't think you should back up the diff as it "lives" and changes. So you would take a snapshot and back up the whole VMDK, not just the changes. Try to do this on a daily basis (not uncommon) with hundreds of VMs. It just doesn't scale. From a professional solution I expect support for http://searchvmware.techtarget.com/definition/Changed-Block-Tracking-CBT Integration into vCenter and the ability to recover single files easily would help, too. More answers: http://serverfault.com/questions/607962/why-dont-people-just-use-rsync-to-back-up-vmware-guests – Mario Lenz Jul 03 '14 at 19:11
  • Is the CBT an actual file that you can see in the service console environment ? Or is it something you can only query via the API ? – user227963 Jul 03 '14 at 22:30
  • I don't know how or where the information which blocks changed is stored. But it's available via the API: "The CBT feature can be accessed by third-party applications as part of the vSphere APIs for Data Protection (VADP). Applications call VADP to request that the VMkernel return blocks of data that have changed on a virtual disk since the last backup snapshot." http://kb.vmware.com/kb/1020128 – Mario Lenz Jul 04 '14 at 17:00
  • Is the use of vmware APIs (like VADP) free, or do you have to pay for some kind of license to build a tool using their APIs ? – user227963 Jul 07 '14 at 05:26
  • To me, it looks like it's free. At least I can't find a mention of "license" in http://www.vmware.com/support/developer/vddk/vadp_vsphere_backup111.pdf But I'm no expert on that topic. If you want a definitive answer you should ask VMware. – Mario Lenz Jul 07 '14 at 16:25