6.0

Table Of Contents
Getting Started with vSphere Command-Line Interfaces
106 VMware, Inc.
Connection Options for vmware-cmd
Thevmware-cmdvCLIcommandsupportsonlythefollowingconnectionoptions.OthervCLIconnection
optionsarenotsupported,forexample,youcannotusevariablesbecausethecorrespondingoptionisnot
supported.
General Options for vmware-cmd
Thevmware-cmdvCLIcommandsupportsthefollowinggeneraloptions.
Format for Specifying Virtual Machines
Whenyourunvmware-cmd,thevirtualmachinepathisusuallyrequired.Youcanspecifythevirtualmachine
usingoneofthefollowingformats:
Datastoreprefixstyle:'[ds_name] relative_path',forexample:
'[myStorage1] testvms/VM1/VM1.vmx'(Linux)
"[myStorage1] testvms/VM1/VM1.vmx" (Windows)
UUIDbasedpath: folder/subfolder/file,forexample:
'/vmfs/volumes/mystorage/testvms/VM1/VM1.vmx'(Linux)
"/vmfs/volumes/mystorage/testvms/VM1/VM1.vmx"(Windows)
Listing and Registering Virtual Machines
RegisteringorunregisteringavirtualmachinemeansaddingthevirtualmachinetothevCenterServerorESXi
inventoryorremovingthevirtualmachine.
ThefollowingexamplescenariolistsallregisteredvirtualmachinesonavCenterServer ,unregistersavirtual
machine,andreregistersthevirtualmachine.
Option Description
--server <host>
-H <host>
TargetESXiorvCenterServersystem.
--vihost <target>
-h <target>
Whenyourunvmware-cmdwiththe-HoptionpointingtoavCenterServersystem,use
--vihosttospecifytheESXihosttorunthecommandagainst.
-O <port> Alternativeconnectionport.Thedefaultportnumberis902.
‐‐username <username>
-U <username>
Userwhoisauthorizedtolog
intothehostspecifiedby--serveror--vihost.
‐‐password <password>
-P <password>
Passwordfortheus erspecifiedby-U.
-Q <protocol> Protocoltouse,eitherhttporhttps.Defaultishttps.
Option Description
--help Printsahelpmessagethatliststheoptionsforthiscommand.
-q Runsinquietmodewithminimaloutput.Theoutputdoesnotdisplaythespecifiedoperationand
arguments.
-v Runsinverbosemode.
IMPORTANTIfyouregisteravirtualmachinewithavCenterServersystem,andthenremoveitfromtheESXi
host,anorphanedvirtualmachineresults.Callvmware-cmd -s unregisterwiththevCenterServersystem
asthetargettoresolvetheissue.