VMware Cloud Community
rajeshkongu
Enthusiast
Enthusiast

vcli snapshort error

hi all,

When i try to  create a snapshort by using vcli command but shows the error. i have attached the screen short.

vmware-cmd --server <vcenter ip> --vihost <ESXi host ip>
/vmfs/volumes/<volume name>/<vm>/<vm>.vmx createsnapshot
<name> <desc> 0 0

regards,

karthick

0 Kudos
3 Replies
lamw
Community Manager
Community Manager

You don't need to use "=" sign try: --username [USERNAME] --password [PASSWORD] and since you're using special characters, you need to also put them in single quotes. The path to your VMFS volume also needs to be in double quotes

0 Kudos
rajeshkongu
Enthusiast
Enthusiast

Hi Lamw,

Thanks for your reply i have an another doubte regarding snapshort. In gui mode we can take any number of snapshort and we can revert back to any of the snapshort but in command line how we can revert back for e.g if we have a 5 snapshort in  a tree i want to move to 3rd snapshort in that tree how i can revert back to that snapshort. and also how we commite these snapshort, in GUI we have a option for delete and delete all but here we have removesnapshort it removes all the snapshort and i want to commite 3 rd snapshort how i commite that snapshort.

Kindly guide me.

if you have any guides/links regrading these kindly post me.

Regards,

karthick V

0 Kudos
iw123
Commander
Commander

Hi,

I've never done that with vmware-cmd but it is possible with powercli:

see this link for more info on that:  http://boredwookie.net/index.php/blog/lab-automation-with-powercli-part-4-working-with-snapshots/

This vmware link details the vmware-cmd options: http://www.vmware.com/support/developer/vcli/vcli41/doc/reference/vmware-cmd.html

Determine if the virtual machine has snapshot.

 vmware-cmd -U <myuser> -P <mypassword> -H VCServerABC -h ESXHost
    /vmfs/volumes/storage1/MyVM/MyVM.vmx hassnapshot

Create a snapshot.

 vmware-cmd -U <myuser> -P <mypassword> -H VCServerABC -h ESXHost
    /vmfs/volumes/storage1/MyVM/MyVM.vmx createsnapshot  <name> <description>
       <quiesce> <memory>

Revert the virtual machine to the last snapshot.

 vmware-cmd -U <myuser> -P <mypassword> -H VCServerABC -h ESXHost
    /vmfs/volumes/storage1/MyVM/MyVM.vmx revertsnapshot

Remove all the snapshots of virtual machine

 vmware-cmd -U <myuser> -P <mypassword> -H VCServerABC -h ESXHost
    /vmfs/volumes/storage1/MyVM/MyVM.vmx removesnapshots

*Please, don't forget the awarding points for "helpful" and/or "correct" answers
0 Kudos