6.0

Table Of Contents
Getting Started with vSphere Command-Line Interfaces
110 VMware, Inc.
Softpoweroperations.Whenyouspecifysoftasthepowerop_modevalue,theresultofthecalldepends
ontheoperation.
Hardpoweroperations.vmware-cmdimmediatelyandunconditionallyshutsdown,resets,orsuspends
thevirtualmachine.
Thefollowingexamplesillustratehowtousevmware-cmd.
Start.Usethestartoptiontopoweronavirtualmachineortoresumeasuspendedvirtualmachine.The
powerop_mode,eitherhardorsoft,isrequired.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx start soft
Reset.Whenyouresetthevirtualmachinewiththesoftpower_opmode(thedefault),theguest
operatingsystemisshutdownbeforethereset.
IfVMwareToolsisnotcurrentlyinstalledonthevirtualmachine,youcanperformonlyahardreset
operation.
aCheckthatVMwaretoolsisinstalledsothat
youcanresetthevirtualmachinewiththedefault
power_opmode,whichissoft.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx gettoolslastactive
See“RetrievingVirtualMachineAttributes”onpage 107.
bUsetheresetoptiontoshutdownandrestartthevirtualmachine.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx reset soft
Suspend.Youhavetwooptionsforsuspendingavirtualmachine.
Thesuspendoptionwiththehardpoweropmodeunconditionallyshutsdownavirtualmachine.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx suspend hard
Thesuspendoptionwiththesoftpoweropmoderunsscriptsthatresultinagracefulshutdownof
theguestoperatingsystemandshutsdownthevirtualmachine.VMwareToolsmustbeinstalledfor
softpowerop_mode.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx suspend soft
Connecting and Disconnecting Virtual Devices
Thevmware-commandoptionsconnectdeviceanddisconnectdeviceallowyoutoconnectthefollowing
typesofdevicestoyourvirtualmachinesandtodisconnectthem:
Networkadapters
CD/DVDdrives
Floppydrives
Thesedevicesmustalreadybedefinedinthevirtualmachinevirtualhardwarelist.
Operation Result
Stop vmware-cmdattemptstoshutdowntheguestoperatingsystemandpowersoffthevirtualmachine.
Reset vmware-cmdattemptstoshutdowntheguestoperatingsystemandrebootsthevirtualmachine.
Suspend vmware-cmdattemptstorunascriptintheguestoperatingsystembeforesuspendingthevirtual
machine.