
Getting Started with vSphere Command-Line Interfaces
26 VMware, Inc.
PassintheconfigurationfilewhenyourunvCLIcommands,asfollows:
<command> --config <my_saved_config> <option>
Forexample:
esxcli --config <my_saved_config> network ip interface list
vicfg-mpath --config <my_saved_config> --list
IfyouhavemultiplevCenterServerorESXisystemsandyouadministereachsystemindividually,youcan
createmultipleconfigurationfileswithdifferentnames.Torunacommandorasetofcommandsonaserver,
youpassinthe
--configoptionwiththeappropriatefilenameatthecommandline.
Thefollowingexampleillustratesthecontentsofaconfigurationfile:
VI_SERVER = XX.XXX.XXX.XX
VI_USERNAME = root
VI_PASSWORD = my_password
VI_PROTOCOL = https
VI_PORTNUMBER = 443
Ifyouhavesetupyoursystemtorunthisfile,youcanrunscriptsonthespecifiedserverafterwards.
Using Command-Line Options
Youcanpassincommand‐lineoptionsusingoptionnameandoptionvaluepairsinmostcases.ForESXCLI
commands,youcanuselongorshortoptions.Anequalsignbetweenoptionnameandoptionvalueis
optional.
esxcli --server <vc_server> --username <privileged_user> --password <pw> --vihost <esx_host>
<namespace> [<namespace]...> <command> --<option_name=option_value>
ForothervCLIcommands,uselongorshortoptions.Anequalsignisnotsupported.
<vicfg- command> --server <vc_server> --username <privileged_user> --password <pw>
--vihost <esx_host> --<option_name option_value>
Someoptions,suchas--help,havenovalue.
Thefollowingexamplesconnecttotheserverasusersnow-whitewithpassworddwarf$.
Linux
esxcli --server <server> --username snow\-white --password dwarf\$ network ip interface list
esxcli --server <server> --username snow\-white --password ‘dwarf$’ network ip interface list
vicfg-mpath --server <server> --username snow\-white --password dwarf\$ --list
vicfg-mpath --server <server> --username ‘snow-white’ --password ‘dwarf$’ --list
Windows
esxcli --server <server> --username “snow-white” --password “dwarf$” network ip interface list
vicfg-mpath.pl --server <server> --username “snow-white” --password “dwarf$” --list
IMPORTANTEnclosepasswordsandothertextwithspecialcharactersinquotationmarks.
WhenrunningcommandsonWindows,usedoublequotes(“ “).WhenrunningcommandsonLinux,use
singlequotes(‘ ‘)orabackslash(\)asanescapecharacter.
Comentarios a estos manuales