■ Memory state. Contents of the virtual machine’s memory.
■ Settings state. Virtual machine settings.
■ Disk state. State of all the virtual machine’s virtual disks.When you revert to a snapshot, you return these items to the state they were in at the time that you took the snapshot. If you want the virtual machine to be running or to be shut down when you start it, make sure that it is in that state when you take the snapshot.You can use snapshots as restoration points when you install update packages, or during a branching process, such as installing different versions of a program. Taking snapshots ensures that each installation begins from an identical baseline. The vSphere Virtual Machine Administration documentation discusses snapshots in detail.
Important Use the vSphere Web Client to revert to a named snapshot. vmware-cmd only supports reverting to the current snapshot.You can take a snapshot while a virtual machine is running, shut down, or suspended. If you are in the process of suspending a virtual machine, wait until the suspend operation has finished before taking a snapshot.If a virtual machine has multiple disks in different disk modes, you must shut down the virtual machine before taking a snapshot. For example, if you have a special-purpose configuration that requires you to use an independent disk, you must shut down the virtual machine before taking a snapshot.
1 vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx stop softvmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx getstate
3
4 Check that the virtual machine has a snapshot by using the hassnapshot option.vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx hassnapshotYou can use vmware-cmd to revert to the current snapshot or to remove a snapshot.
Important You cannot use vmware-cmd to revert to a named snapshot. Use the vSphere Web Client to revert to a named snapshot.Run vmware-cmd with the revertsnapshot option to revert to the current snapshot. If no snapshot exists, the command does nothing and leaves the virtual machine state unchanged.vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx revertsnapshotRun vmware-cmd with the removesnapshots option to remove all snapshots associated with a virtual machine. If no snapshot exists, the command does nothing.vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx removesnapshots