6.0

Table Of Contents
Getting Started with vSphere Command-Line Interfaces
108 VMware, Inc.
Thereturnvalueisesx(VMwareESX),embeddedESX(VMwareESXi),orunknown.
Thegetproductinfo platformoptionliststheplatformthatthevirtualmachinerunson.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx getproductinfo platform
Thereturnvalueiswin32-x86(x86basedWindowssystem),linux-x86(x86basedLinuxsystem),or
vmnix-x86(x86basedESXimicrokernel).
Thegetproductinfo build,getproductinfo majorversion,orgetproductinfo minorversion
optionsretrieveversioninformation.
Thegetstateoptionretrievestheexecutionstateofthevirtualmachine,whichcanbeon,off,
suspended,orunknown.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx getstate
getstate() = on
ThegettoolslastactiveoptionindicateswhetherVMwareToolsisinstalledandwhethertheguest
operatingsystemisrespondingnormally.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx gettoolslastactive
Thecommandreturnsanintegerindicatinghowmuchtimehaspassed,inseconds,sincethelast
heartbeatwasdetectedfromtheVMwareToolsservice.Thisvalueisinitializedtozerowhenavirtual
machinepowerson.Thevaluestaysatzerountilthefirstheartbeatisdetected.Afterthefirstheartbeat,
thevalueisalwaysgreaterthanzerountilthevirtualmachineispowercycledagain.Thecommand
returnsoneofthefollowingvalues:
0VMwareToolsisnotinstalledornotrunning.
1Guestoperatingsystemisrespondingnormally.
5Intermittentheartbeat.Theremightbeaproblemwiththeguestoperatingsystem.
100Noheartbeat.Guestoperatingsystemmighthavestoppedresponding.
Managing Virtual Machine Snapshots with vmware-cmd
Asnapshotcapturestheentirestateofthevirtualmachineatthetimeyoutakethesnapshot.
Virtualmachinestateincludesthefollowingaspectsofthevirtualmachine.
Memorystate.Contentsofthevirtualmachine’smemory.
Settingsstate.Virtualmachinesettings.
Diskstate.Stateofallthevirtualmachine’svirtualdisks.
Whenyoureverttoasnapshot,youreturntheseitemstothestatetheywereinatthetimethatyoutookthe
snapshot.Ifyouwantthevirtualmachinetoberunningortobeshutdownwhenyoustart
it,makesurethat
itisinthatstatewhenyoutakethesnapshot.
Youcanusesnapshotsasrestorationpointswhenyouinstallupdatepackages,orduringabranchingprocess,
suchasinstallingdifferentversionsofaprogram.Takingsnapshotsensuresthateachinstallationbeginsfrom
anidenticalbaseline.The
vSphereVirtualMachineAdministrationdocumentationdiscussessnapshotsindetail.
N
OTEYouusuallyusethevmware-cmd guestinfooptiononlywhenVMwareSupportinstructsyoutodo
so.Thecommandisthereforenotdiscussedinthisdocument.
IMPORTANTUsethevSphereWebClienttoreverttoanamedsnapshot.vmware-cmdonlysupportsreverting
tothecurrentsnapshot.