Snapshot copy a VM to USB attached to ESXi 5.1 host

backupsnapshotusbvmware-esxi

I was trying to script a snapshot backup of running VMs to a USB drive attached to the host. We are using the free hypervisor version of ESXi and do not want to purchase 3rd party products to do this.

As it appears that ESXi Shell doesn't have VM snapshot commands available on 5.1, I was trying to use vSphere PowerCLI on windows to connect to the host and make a snapshot of the VM then copy the snapshotted disk to USB mounted on the host. I can get the VM snapshot in place but I can't seem to get the USB drive to show up and format VMFS accordingly.

I understand I will need to disable the USB arbitrator to do this (which I did from ESXi shell). But I am struggling to get the USB mounted and formatted and also not sure what copy command I can use after this is mounted.

Any ideas/help much appreciated.

Adam

Best Answer

You're getting a "fault.RestrictedVersion.summary" error, right? PowerCLI and most of the SDK tools will not work on a free version of VMware ESXi. Their assumption is that people who want automation will pay the ~$500 for the most basic ESXi license...

SSH to the ESXi host and run:

vmware-cmd <vm-cfg-path> createsnapshot <name> <description> <quiesce> <memory>

For example:

vmware-cmd /vmfs/volume/datastore1/Windows2008/Windows2008.vmx createsnapshot "snap1"

Edit:

Direct USB drives are limited to FAT and FAT16-formatted drives. You're best off running USB passthrough to an actual VM if you need drive access. If you use the generic USB passthrough, I think you're limited to USB 1.1 speeds. If you pass the entire USB controller to the VM, you'll get 2.0 speeds.