6.5

Table Of Contents
n
100 – No heartbeat. Guest operating system might have stopped responding.
N You usually use the vmware-cmd guestinfo option only when VMware Support instructs you to do
so. The command is therefore not discussed in this document.
Managing Virtual Machine Snapshots with vmware-cmd
You can manage virtual machine snapshots by using vmware-cmd. A snapshot captures the entire state of the
virtual machine at the time you take the snapshot.
Virtual machine state includes the following aspects of the virtual machine.
n
Memory state - Contents of the virtual machine's memory.
n
Seings state - Virtual machine seings.
n
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 dierent 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.
I Use the vSphere Web Client to revert to a named snapshot. vmware-cmd only supports reverting
to the current snapshot.
Take a Virtual Machine Snapshot
You can take virtual machine snapshots by using vmware-cmd.
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 nished before taking a
snapshot.
If a virtual machine has multiple disks in dierent disk modes, you must shut down the virtual machine
before taking a snapshot. For example, if you have a special-purpose conguration that requires you to use
an independent disk, you must shut down the virtual machine before taking a snapshot.
Procedure
1 (Optional) If the virtual machine has multiple disks in dierent disk modes, shut down the virtual
machine.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost
<esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx stop soft
2 (Optional) Check that the shut down operation has been completed.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost
<esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx getstate
3
Run vmware-cmd with the createsnapshot option.
You must specify the description, quiesce ag (0 or 1) and memory ag (0 or 1).
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost
<esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx createsnapshot VM1Aug09 'test snapshot
August 09' 0 0
Chapter 8 Managing Virtual Machines
VMware, Inc. 127