You are on page 1of 108

vSphere Command-Line Interface

Installation and Reference Guide


ESX/ESXi 4.0
vCenter Server 4.0
EN-000111-00
VMware, Inc.
3401 Hillview Ave.
Palo Alto, CA 94304
www.vmware.com
2 VMware, Inc.
vSphere Command-Line Interface Installation and Reference Guide

You can find the most up-to-date technical documentation on the VMware Web site at:
http://www.vmware.com/support/
The VMware Web site also provides the latest product updates.
If you have comments about this documentation, submit your feedback to:
docfeedback@vmware.com
2008, 2009 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual
property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents.
VMware, the VMware boxes logo and design, Virtual SMP, and VMotion are registered trademarks or trademarks of
VMware, Inc. in the United States and/or other jurisdictions. All other marks and names mentioned herein may be trademarks
of their respective companies.
VMware, Inc. 3

Contents
AboutThisBook 7
1 vSphereCLIInstallation,Execution,andCommandOverviews 9
InstallingandUsingvSphereCLICommands 9
InstallingvSphereCLIandRunningCommandsonLinux 10
UnpackingandInstallingthevSphereCLIPackage 11
RunningvSphereCLICommands 11
UninstallingthevSphereCLIPackage 12
InstallingvSphereCLIandRunningCommandsonWindows 12
UninstallingthevSphereCLIPackage 13
InstallingvMAandRunningCommandsfromvMA 13
SpecifyingAuthenticationInformation 13
OrderofPrecedence 14
UsingaSessionFile 14
UsingEnvironmentVariables 15
UsingaConfigurationFile 15
UsingCommandLineOptions 15
UsingMicrosoftWindowsSecuritySupportProviderInterface(SSPI) 16
AvailableOptionsforvSphereCLIExecution 16
UsingvSphereCLICommandsinScripts 18
ListofAvailableCommands 19
SupportedPlatformsforCommands 20
CommandswithanesxcfgPrefix 22
2 vSphereCLIReference 25
StorageManagementCommands 25
DiagnosticPartitionManagementwithvicfgdumppart 25
BasicStorageArrayManagementwithvicfgmpath 27
NASFileSystemManagementwithvicfgnas 28
AvailableLUNDiscoverywithvicfgscsidevs 29
RescanOperationswithvicfgrescan 30
NetworkingCommands 31
DNSConfigurationSpecificationwithvicfgdns 31
PhysicalNICManagementwithvicfgnics 32
NTPServerSpecificationwithvicfgntp 33
RouteEntryManipulationwithvicfgroute 34
VMkernelNICsManagementwithvicfgvmknic 35
VirtualSwitchManagementwithvicfgvswitch 36
SystemManagementCommands 39
UsingresxtopforPerformanceMonitoring 39
ConfigurationInformationBackupwithvicfgcfgbackup 39
SNMPManagementwithvicfgsnmp 40
SyslogServerSpecificationwithvicfgsyslog 41
UpdateManagementwithvihostupdate 42
VirtualMachineManagementCommands 44
VirtualMachineMigrationwithsvmotion 44
vSphere Command-Line Interface Installation and Reference Guide
4 VMware, Inc.

MiscellaneousManagementCommands 46
AdvancedManagementwithvicfgadvcfg 46
VMkernelModuleManipulationwithvicfgmodule 47
UserandGroupManagementwithvicfguser 48
VolumeManagementwithvicfgvolume 49
FileSystemManipulationwithvifs 50
3 FileSystemManagementwithvmkfstools 53
vmkfstoolsCommandSyntax 53
SupportedCommandSpecificOptions 54
SupportedTargets 55
FileSystemTarget 55
DiskPartitionTarget 55
DeviceTarget 55
vmkfstoolsFileSystemOptions 55
VMFSFileSystemCreation 55
AttributeListingforaVMFSVolume 56
FileSystemPartitionExtensionbySpanning 57
vmkfstoolsVirtualDiskOptions 57
SupportedDiskFormats 57
CreatingVirtualDisks 58
InitializingVirtualDisks 58
InflatingThinVirtualDisks 59
DeletingVirtualDisks 59
RenamingVirtualDisk 59
CloningVirtualorRawDisks 59
MigratingVMwareWorkstationandVMwareGSXServerVirtualMachines 60
ExtendingVirtualDisks 60
CreatingVirtualCompatibilityModeRawDeviceMappings 61
CreatingPhysicalCompatibilityModeRawDeviceMappings 61
ListingRDMAttributes 61
DisplayingVirtualDiskGeometry 62
4 iSCSIStorageManagementwithvicfgiscsi 63
vicfgiscsiCommandSyntax 63
vicfgiscsiOptions 64
vicfgiscsiDiscoveryTargetOptions 67
ListingDynamicorStaticDiscoveryTargets 67
AddingDynamicorStaticDiscoveryTargets 67
RemovingDynamicorStaticDiscoveryTargets 68
vicfgiscsiAuthenticationOptions 69
ListingSupportedandEnabledAuthenticationMethods 69
EnablingAuthentication 70
EnablingMutual(Bidirectional)Authentication 70
ReturningAuthenticationtoDefaultInheritance 71
vicfgiscsiInformationRetrievalOptions 71
ExternalHBAProperties 71
TargetInformation 72
LUNInformation 72
vicfgiscsiPhysicalNetworkPortalOptions 72
ListingPhysicalNetworkPortalInformation 72
SettingPhysicalNetworkPortalInformation 72
vicfgiscsiNetworkOptions 73
ListingNetworkProperties 73
SettingNetworkProperties 73
VMware, Inc. 5
Contents

vicfgiscsiInitiatorOptions 73
ListingInitiatorProperties 73
SettingInitiatoriSCSINameorAliasName 74
vicfgiscsiiSCSIParameterOptions 74
ListingiSCSIParameterOptions 74
ListingiSCSIParameterOptionDetails 74
SettingiSCSIParameterOptions 75
ReturningParameterstoDefaultInheritance 75
vicfgiscsiSoftwareiSCSIOptions 76
ListingSoftwareiSCSILoadingStatus 76
EnablingSoftwareiSCSI 76
DisablingSoftwareiSCSI 76
TasksRequiredforSoftwareiSCSISetup 76
TasksRequiredforHardwareiSCSISetup 77
5 VirtualMachineManagementwithvmwarecmd 79
ConnectionOptionsforvmwarecmd 79
GeneralOptionsforvmwarecmd 80
ServerOptionsforvmwarecmd 80
VirtualMachineOptionsforvmwarecmd 80
SoftandHardPowerOperations 82
vmwarecmdExamples 82
6 StoragePathandStoragePluginManagementwithesxcli 83
esxcliCommandSyntax 83
Helpforesxcli 84
ManagingNMPwithesxclinmp 84
DeviceManagementwithesxclinmpdevice 85
esxclinmpdevicelist 85
esxclinmpdevicesetpolicy 85
FixedPathSelectionPolicyOperationswithesxclinmpfixed 85
esxclinmpfixedgetpreferred 85
esxclinmpfixedsetpreferred 86
PathOperationswithesxclinmppath 86
esxclinmppathlist 86
PSPOperationswithesxclinmppsp 86
esxclinmppspgetconfig 86
esxclinmppsplist 87
esxclinmppspsetconfig 87
RoundRobinOperationswithesxclinmproundrobin 87
esxclinmproundrobingetconfig 87
esxclinmproundrobinsetconfig 88
SATPOperationswithesxclinmpsatp 88
esxclinmpsatpaddrule 88
esxclinmpsatpdeleterule 89
esxclinmpsatpgetconfig 89
esxclinmpsatplist 89
esxclinmpsatplistrules 90
esxclinmpsatpsetconfig 90
esxclinmpsatpsetdefaultpsp 90
vSphere Command-Line Interface Installation and Reference Guide
6 VMware, Inc.

UsingesxcliswiscsinicforNICBinding 90
esxcliswiscsinicadd 90
esxcliswiscsinicremove 91
esxcliswiscsiniclist 91
PathClaimingwithesxclicorestorageclaiming 91
esxclicorestorageclaimingreclaim 91
esxclicorestorageclaimingunclaim 92
ManagingClaimRuleswithesxclicorestorageclaimrule 92
esxclicorestorageclaimruleadd 93
esxclicorestorageclaimruleconvert 94
esxclicorestorageclaimruledelete 95
esxclicorestorageclaimrulelist 95
esxclicorestorageclaimruleload 95
esxclicorestorageclaimrulemove 95
esxclicorestorageclaimrulerun 96
PathMaskingwithesxclicorestorageclaimrule 96
Appendix:CommandsforManagingLegacyServers 99
StorageArrayConfigurationforVMware Infrastructure 3.5Systemswithvicfgmpath35 99
PerformingMaintenanceonVMwareInfrastructure 3.5Systemswithvihostupdate35 101
Index 103
VMware, Inc. 7

ThevSphereCommandLineInterfaceInstallationandReferenceGuide,explainshowtoinstallandusethe
VMware

vSphereCommandLineInterface(vSphereCLI)andincludesreferencedocumentationand
examplesforeachcommand.
ThevSphereCommandLineInterfaceInstallationandReferenceGuidecoversESX,ESXi,andvCenterServer.
Chapter 1explainshowtoinstallvSphereCLIandhowtorunvSphereCLIcommandsonWindowsor
Linux.Thechapteralsoincludesareferencetoconnectionoptionsandotheroptionsyoucanusewith
eachofthevSphereCLIcommands.
Chapter 2providesreferencedocumentationformostofthevSphereCLIcommands,organizedby
subjectarea.Foreachcommand,thechapterlistsanddiscusseseachoptionandgivesexamples.
Chapters36providereferencedocumentationformorecomplexvSphereCLIcommands.
Chapter 3discussesvmkfstools.Itincludesinformationaboutthecommandsyntax,filesystem
options,andvirtualdiskoptions.
Chapter 4discussesvicfg-iscsi,whichyoucanuseforiSCSImonitoringandmanagement
operations.
Chapter 5discussesvmware-cmd.Itincludesinformationaboutconnectionoptions,generaloptions,
serveroptions,andvirtualmachineoptions.
Chapter 6discussesesxcli,whichyoucanusetoconfiguretheNativeMultipathingPlugin(NMP),
thePluggableStorageArchitecture(PSA),andNICbindings.
Appendix Adiscussesthevihostupdate35andvicfg-mpath35legacycommands,whichareavailable
forESX/ESXi3.5systems.
Intended Audience
ThisbookisforexperiencedWindowsorLinuxsystemadministratorswhoarefamiliarwithvSphere
administrationtasksanddatacenteroperationsandknowhowtousecommandsinscripts.
Document Feedback
VMwarewelcomesyoursuggestionsforimprovingourdocumentation.Ifyouhavecomments,sendyour
feedbacktodocfeedback@vmware.com.
About This Book
vSphere Command-Line Interface Installation and Reference Guide
8 VMware, Inc.

Related Documentation
ThevSpheredocumentationconsistsofthecombinedVMwarevCenterServerandESX/ESXidocumentation
set.Thedocumentationsetcontainsbackgroundinformationforthecommandsdiscussedinthisdocument.
ThevSphereSDKforPerldocumentationexplainshowyoucanusethevSphereSDKforPerlandrelated
utilityapplicationstomanageyourvSphereenvironmentandincludesinformationaboutthevSphereSDK
forPerlUtilityApplications.
ThevSphereManagementAssistantGuideexplainshowtoinstallandusethevSphereManagementAssistant
(vMA).vMAisavirtualmachinethatincludesthevSphereCLIandotherprepackagedsoftware.See
InstallingvMAandRunningCommandsfromvMAonpage 13.
Technical Support and Education Resources
Thefollowingsectionsdescribethetechnicalsupportresourcesavailabletoyou.Toaccessthecurrentversion
ofthisbookandotherbooks,gotohttp://www.vmware.com/support/pubs.
Online and Telephone Support
Touseonlinesupporttosubmittechnicalsupportrequests,viewyourproductandcontractinformation,and
registeryourproducts,gotohttp://www.vmware.com/support.
Customerswithappropriatesupportcontractsshouldusetelephonesupportforthefastestresponseon
priority1issues.Gotohttp://www.vmware.com/support/phone_support.
Support Offerings
TofindouthowVMwaresupportofferingscanhelpmeetyourbusinessneeds,goto
http://www.vmware.com/support/services.
VMware Professional Services
VMwareEducationServicescoursesofferextensivehandsonlabs,casestudyexamples,andcoursematerials
designedtobeusedasonthejobreferencetools.Coursesareavailableonsite,intheclassroom,andlive
online.Foronsitepilotprograms andimplementationbestpractices,VMwareConsultingServicesprovides
offeringsto helpyouassess,plan,build,andmanageyourvirtualenvironment.Toaccessinformationabout
educationclasses,certificationprograms,andconsultingservices,gotohttp://www.vmware.com/services.
VMware, Inc. 9

1
ThevSphereCLIcommandsetallowsyoutoruncommonsystemadministrationcommandsagainst
ESX/ESXIsystemsfromanadministrationserverofyourchoice.YoucanrunmostvSphereCLIcommands
againstavCenterServersystemandtargetanyESX/ESXisystemthatsystemmanages.vSphereCLI
commandsareespeciallyusefulforESXihostsbecausetheydonotincludeaserviceconsole.
vSphereCLIcommandsrunontopofthevSphereSDKforPerl.ThevSphereCLI,vSphereSDKforPerl,and
someprerequisitesoftwareareincludedintheinstallationpackageonWindowsandonsupportedLinux
distributions.
Thischapterincludesthefollowingtopics:
InstallingandUsingvSphereCLICommandsonpage 9
InstallingvSphereCLIandRunningCommandsonLinuxonpage 10
InstallingvSphereCLIandRunningCommandsonWindowsonpage 12
InstallingvMAandRunningCommandsfromvMAonpage 13
SpecifyingAuthenticationInformationonpage 13
AvailableOptionsforvSphereCLIExecutiononpage 16
UsingvSphereCLICommandsinScriptsonpage 18
ListofAvailableCommandsonpage 19
SupportedPlatformsforCommandsonpage 20
CommandswithanesxcfgPrefixonpage 22
Installing and Using vSphere CLI Commands
YoucaninstallavSphereCLIpackageoneitherLinuxorMicrosoftWindows,ordeploythevSphere
ManagementAssistant(vMA).
vSphereCLIpackagesYoucaninstallavSphereCLIpackageonaphysicalorvirtualmachine,which
couldbecometheremoteadministrationserverforallESX/ESXihosts.SeeInstallingvSphereCLIand
RunningCommandsonLinuxonpage 10andInstallingvSphereCLIandRunningCommandson
Windowsonpage 12.
Afteryouhaveinstalledthepackage,whichincludesthevSphereSDKforPerl,youcanrunvSphereCLI
commandsorrunscriptsfromtheoperatingsystemcommandline.Eachtimeyourunacommand,you
specifytheconnectionoptionsdirectlyorindirectly.SeeSpecifyingAuthenticationInformationon
page 13.
vSphere CLI Installation, Execution,
and Command Overviews 1
vSphere Command-Line Interface Installation and Reference Guide
10 VMware, Inc.

vMAAvirtualmachinethatadministratorscanusetorunscriptstomanageESX/ESXiservers.vMA
includesvSphereCLIandotherprepackagedsoftwareinaLinuxenvironment.
OneimportantfunctionofvMAisnoninteractivelogin.IfyouestablishanESX/ESXihostasatarget
server,youcanexecutevSphereCLIcommandsagainstthatserverwithoutadditionalauthentication.If
youestablishavCenterServersystemasatargetserver,youcanexecutemostvSphereCLIcommands
againstallESX/ESXisystemsitmanageswithoutadditionalauthentication.SeeInstallingvMAand
RunningCommandsfromvMAonpage 13.
YoucanusevSphereCLIcommandsinteractivelyorinscripts,asfollows:
OpenacommandpromptonaLinuxorWindowssystemwhereyouinstalledthevSphereCLI.Enter
commandsinthatcommandprompt.
AccessthevMALinuxconsole.EntervSphereCLIcommandsthere.
PreparescriptswithsetsofvSphereCLIcommands.Thenrunthescriptsfromaremoteadministration
serverthathasthevSphereCLIpackageinstalledorfromthevMALinuxconsole.SeeUsingvSphere
CLICommandsinScriptsonpage 18.
Whenyouruncommands,youmustspecifytheESX/ESXihostagainstwhichyouwanttorunthecommand
andtheusernameandpasswordforauthentication.SeeSpecifyingAuthenticationInformationonpage 13.
Installing vSphere CLI and Running Commands on Linux
TheinstallationscriptforthevSphereCLIissupportedondefaultinstallationsofthefollowingLinux
distributions:
RedHatEnterpriseLinux(RHEL)5.2(64bit)
RedHatEnterpriseLinux(RHEL)5.2(32bit)
SUSEEnterpriseServer10SP132bit
Ubuntu8.0432bit
ThevSphereCLIpackageinstallerinstallsthevSphereCLIscriptsandthevSphereSDKforPerl.Ifyouarenot
usingoneofthesupportedLinuxdistributions,youmustmakesureyoursystemhasallrequiredlibraries
installed.SeethevSphereSDKforPerlInstallationGuideforinformationaboutrequiredlibraries.
IfyouhaveuninstalledapreviousversionofthevSphereCLI(oldproductnameisRemoteCLI),andinstall
vSphereCLIinadifferentdirectory,youmustresetthePATHenvironmentvariable.Youcandosobeforeor
aftertheinstallation,usingthecommandappropriateforyourdistributionorshell(setenv,export,andso
on).IfyoudonotresetthePATH,thesystemmightstillgototheoldlocationtofindvSphereCLIcommands.
CAUTIONSpecifyingthepasswordinplaintextrisksexposingthepasswordtootherusers.Thepassword
mightalsobecomeexposedinbackupfiles.Donotprovideplaintextpasswordsonproductionsystems.
Youhavethefollowingalternatives:
IfyouuseavSphereCLIcommandinteractivelyanddonotspecifyausernameandpassword,youare
promptedforthem.Thescreendoesnotechothepasswordyoutype.
Fornoninteractiveuse,youcancreateasessionfileusingthesave_session.plscriptincludedinthe
apps/sessiondirectoryofthevSphereSDKforPerl.SeeUsingaSessionFileonpage 14.
IfyouarerunningonWindowssystems,youcanusethe--passthroughauthcommand.Iftheuserwho
runsthecommandisknown,nopasswordisrequired.
IfyouarerunningvMA,youcansetuptargetserversandexecutemostvSphereCLIcommandsagainst
targetserverswithoutadditionalauthentication.
VMware, Inc. 11
Chapter 1 vSphere CLI Installation, Execution, and Command Overviews

Unpacking and Installing the vSphere CLI Package
YoumustdownloadthevSphereCLIpackagefromtheVMwareWebsitebeforeyoucaninstallvSphereCLI.
To download and unpack the vSphere CLI package
1 DownloadtheinstallerpackagefromtheVMwareWebsite.
YoucanfindtheinstallerintheDriversandToolstabofthevSphere4.0downloadpage.
2 Openashellpromptandnavigatetothedirectorytowhichyoudownloadedthepackage.
3 Unzipandunpackthedownloadedpackage.
To install the vSphere CLI package
1 Starttheinstaller(vmware-install.pl).
2 TypeyesattheprompttoacceptthelicenseagreementtermsandpressEntertocontinue.
3 Whenprompted,specifyaninstallationdirectory,orpressEntertoacceptthedefault(/usr/bin).
4 (Optional)IfpromptedtoremoveolderversionsofvSphereSDKforPerlorvSphereCLI,youcaneither
accepttheofferorinstallthepackageonadifferentsystem.
Theinstallerindicatescompletionoftheprocessasfollows:
Asuccessmessageappearsandthepromptreturnstotheshellprompt.
Theinstallerlistsdifferentversionnumbersforrequiredmodules(ifany).
ThevSphereCLIscriptsareintheinstallationdirectory.Thedefaultis/usr/bin.
YoucanrunavSphereCLIcommandtoverifythatinstallationwassuccessful.SeeRunningvSphereCLI
Commandsonpage 11.
vSphereSDKforPerlutilityapplicationsandsamplescriptsthatperformcommonoperationsonESX/ESXi
hostsandonvirtualmachinesareincludedwiththeinstallationatthefollowinglocations:
Utilityapplications/usr/lib/vmware-vcli/apps
Samplescripts/usr/share/doc/vmware-vcli/samples
SeethevSphereSDKforPerldocumentationforareferencetoallutilityapplications.
Running vSphere CLI Commands
AfteryouhaveinstalledthevSphereCLI,youcanruncommandsdirectlyontheLinuxcommandpromptor
includetheminscripts(seeUsingvSphereCLICommandsinScriptsonpage 18).
To run a vSphere CLI command on Linux
1 Openacommandprompt.
2 ChangetothedirectorywhereyouinstalledthevSphereCLI.Thedefaultis/usr/bin.
3 Runthecommand,includingtheconnectionoptions.
<command> <conn_options> <params>
Specifyconnectionoptionsinaconfigurationfileorpassthemonthecommandline.Theextension.pl
isnotrequiredonLinux.
Example
vicfg-nas --server my_esxserver --username u42 --password mypwd --list
SeeTable 12,vSphereCLIConnectionOptions,onpage 17foracompletelistofconnectionoptions.
IMPORTANTTheinstallerreplacesboththevSphereSDKforPerlandthevSphereCLI.Installthepackage
onadifferentsystemtokeepanolderversion.
vSphere Command-Line Interface Installation and Reference Guide
12 VMware, Inc.

Uninstalling the vSphere CLI Package
YoucanuninstallthevSphereCLIpackageusingascriptincludedintheinstallation.
To uninstall the vSphere CLI on a Linux system
1 ConnecttothedirectorywhereyouinstalledthevSphereCLI(defaultis/usr/bin).
2 Runthevmware-uninstall-vSphere-CLI.pl script.
ThecommanduninstallsthevSphereCLIandthevSphereSDKforPerl.
Installing vSphere CLI and Running Commands on Windows
ThevSphereCLIinstallationpackageforWindowsincludestheActivePerlruntimefromActiveStateSoftware
andrequiredPerlmodulesandlibraries.ThevSphereCLIissupportedonthefollowingWindowsplatforms:
WindowsXPSP232bit
WindowsXPSP264bit
WindowsVistaEnterpriseSP132bit
WindowsVistaEnterpriseSP164bit
To install the vSphere CLI Package on Windows
1 DownloadthevSphereCLIWindowsinstallerpackage.
YoucanfindtheinstallerintheDriversandToolstabofthevSphere4.0downloadpage.
2 Starttheinstaller.
3 (Optional)IfpromptedtoremoveolderversionsofvSphereSDKforPerlorvSphereCLI,youcaneither
accepttheofferorinstallthepackageonadifferentsystem.
4 ClickNextintheWelcomepagetocontinue.
5 IfyoudowanttoinstallthevSphereCLIinanondefaultdirectory,clickChangeandselectthedirectory.
ThedefaultlocationisC:\Program Files\VMware\VMware vSphere CLI.
6 ClickNexttocontinue.
7 ClickInstalltoproceedwiththeinstallation.
Theinstallationmighttakeseveralminutestocomplete.
AfteryouinstallthevSphereCLI,youcanruncommandsfromtheWindowscommandpromptorinclude
theminscripts(seeUsingvSphereCLICommandsinScriptsonpage 18).
To run a vSphere CLI command on Windows
1 Openacommandprompt.
2 NavigatetothedirectoryinwhichthevSphereCLIisinstalled.
cd C:\Progrsam Files\VMware\VMware vSphere CLI\bin
3 Runthecommand,passingintheconnectionoptionsandanyotheroptions.
<command>.pl <conn_options> <params>
Theextension.plisrequiredformostcommands,butnotforesxcli.
Example
vicfg-nas.pl --server my_vcserver --username u42 --password mypwd --vihost my_esxhost --list
SeeTable 12,vSphereCLIConnectionOptions,onpage 17foracompletelistofconnectionoptions.
IMPORTANTTheinstallerreplacesboththevSphereSDKforPerlandthevSphereCLI.Installthis
packageonadifferentsystemtokeepanolderversion.
VMware, Inc. 13
Chapter 1 vSphere CLI Installation, Execution, and Command Overviews

Uninstalling the vSphere CLI Package
YoucanuninstallthevSphereCLIpackageasyouwouldanyotherpackage.
To uninstall the vSphere CLI on a Windows system
1 SelectStart>Settings>ControlPanel>AddorRemovePrograms.
2 Inthepanelthatappears,selectvSphereCLI,andclickRemove.
3 ClickYeswhenprompted.
ThesystemuninstallsboththevSphereSDKforPerlandthevSphereCLI.
Installing vMA and Running Commands from vMA
Asanalternativetoapackageinstallation,youcandeployvMAonanESX/ESXihostandrunvSphereCLI
commandsfromthere.vMAisavirtualmachinethatadministratorscanusetorunscriptstomanage
ESX/ESXisystems.vMAincludesvSphereCLIandotherprepackagedsoftwareinaLinuxenvironment.
SettingupvMAconsistsofafewtasks.ThevSphereManagementAssistantAdministratorsandDevelopersGuide
discusseseachtaskindetail.
1 DeployvMAtoanESX/ESXisystemofyourchoice.
YoucanuseavSphereClientconnecteddirectlytotheESX/ESXisystem,oravSphereClientconnected
toavCenterServersystem.YoucandeployvMAfromaURLordownloadafile,unzipit,andpointto
theOVFfileduringthedeployprocess.
2 ConfigurevMA.
WhenyoubootvMA,itpromptsyouforthefollowingrequiredconfigurationinformation:
Networkinformation(thedefaultisoftenacceptable)
AhostnameforvMA.
Apasswordfortheviadminuser.TherootuserisdisabledonvMA.
3 (Optional)AddavCenterServersystemormoreESX/ESXisystemstovMAasvifastpasstargetsandcall
vifpinittoinitializevifastpass.
Afteryouhavespecifiedahostasavifastpasstarget,specifyingconnectionoptionsisnolongerrequired
becauseauthenticationhasalreadyoccurred.YoucanrunvSphereCLIcommandsagainstanyESX/ESXi
systemwithoutspecifyingconnectionoptionsforthatsystemexplicitly.IfyousetupavCenterServersystem
asatargetserver,youcanspecifyanyoftheESX/ESXihoststhatvCenterServersystemmanagesusingthe
--vihostoption.
Specifying Authentication Information
WhenyourunavSphereCLIcommand,youmustspecifyataminimumthenameoftheexecutionserverand
thenameandpasswordofauserwithloginprivileges.vSphereCLIallowsyoutorunagainstmultiple
executionserversfromthesameadministrationserver,butyoumusthavethecorrectprivilegestoperform
theactionsoneachexecutionserver.
vSphere Command-Line Interface Installation and Reference Guide
14 VMware, Inc.

Order of Precedence
WhenyourunavSphereCLIcommand,authenticationhappensintheorderofprecedencepresentedin
Table 11.
Thisorderofprecedencealwaysapplies.Thatmeans,forexample,thatyoucannotoverrideanenvironment
variablesettinginaconfigurationfile.
Using a Session File
Youcancreateasessionfileusingthesave_session.plscript.Thescriptisinthe/apps/sessiondirectory
ofthevSphereSDKforPerl,whichisincludedinthevSphereCLIpackage.Youcanusethesessionfile,which
doesnotrevealpasswordinformation,whenyourunvSphereCLIcommands.Ifthesessionfileisnotused
for30 minutes,itexpires.
Ifyouuseasessionfile,anyotherconnectionoptionsareignored.
To create and use a session file
1 Connecttothedirectorywherethescriptislocated.
Forexample:
2 Callsave_session.pl.
Youmustspecifytheservertoconnecttoandthenameofasessionfileinwhichthescriptsavesan
authenticationcookie.
save_session.pl --savesessionfile <location> --server <server>
Forexample:
Ifyouspecifyaserver,butnousernameorpassword,thescriptpromptsyou.
Table 1-1. vSphere CLI Authentication Precedence
Authentication Description See
Commandline Password(--password),sessionfile
(--sessionfile),orconfigurationfile
(--config)specifiedonthecommandline.
UsingaSessionFileonpage 14
Configurationfile Passwordspecifiedina.visdkrcconfiguration
file.
UsingaConfigurationFileonpage 15
Environment
variable
Passwordspecifiedinanenvironmentvariable. UsingEnvironmentVariablesonpage 15
Credentialstore Passwordretrievedfromthecredentialstore. vSphereWebServicesSDKProgrammingGuide
andvSphereSDKforPerlProgrammingGuide.
Currentaccount
(ActiveDirectory)
Currentaccountinformationusedtoestablish
anSSPIconnection.AvailableonlyonWindows.
UsingMicrosoftWindowsSecuritySupport
ProviderInterface(SSPI)onpage 16
Prompttheuserfor
apassword.
Passwordisnotechoedtoscreen.
Windows: cd C:\Program Files\VMware\VMware vSphere CLI\Perl\apps\session
Linux: cd /usr/share/doc/vmware-vcli/samples/session
Windows: save_session.pl --savesessionfile C:\Temp\my_session --server my_server
Linux: save_session.pl --savesessionfile /tmp/vimsession --server
<servername_or_address> --username <username> --password <password>
VMware, Inc. 15
Chapter 1 vSphere CLI Installation, Execution, and Command Overviews

3 Passinthesessionfileusingthe--sessionfileoptionwhenyourunvSphereCLIcommands,
as follows:
<command> --sessionfile <sessionfile_location> <command_options>
Forexample:
Using Environment Variables
YoucansetenvironmentvariablesinaLinuxprofile,intheEnvironmentpropertiesdialogboxoftheSystem
controlpanelonWindows,or,forthecurrentsession,atthecommandline.Forexample:
set VI_SERVER=<your_server_name_or_address>
SeeUsingvSphereCLICommandsinScriptsonpage 18foranexample.
Using a Configuration File
Youcanuseatextfilethatcontainsvariablenamesandsettingsasaconfigurationfile.Variablescorresponding
totheoptionsareshowninTable 12,vSphereCLIConnectionOptions,onpage 17.
PassintheconfigurationfilewhenyourunvSphereCLIcommands,asfollows:
<command> --config <my_saved_config> <option>
Forexample:
vicfg-mpath --config <my_saved_config> --list
IfyouhavemultiplevCenterServerorESX/ESXisystemsandyouadministereachsystemindividually,you
cancreatemultipleconfigurationfileswithdifferentnames.Torunacommandorasetofcommandsona
server,youpassinthe--configoptionwiththeappropriatefilenameatthecommandline.
Thefollowingexampleillustratesthecontentsofaconfigurationfile:
VI_SERVER = NN.NNN.NNN.NN
VI_USERNAME = root
VI_PASSWORD = my_password
VI_PROTOCOL = https
VI_PORTNUMBER = 443
Ifyouhavesetupyoursystemtorunthisfile,youcanrunscriptsonthespecifiedserverafterwards.
Using Command-Line Options
Youcanpassincommandlineoptionsusingoptionnameandoptionvaluepairs.
--<optionname optionvalue>
Someoptions,suchas--help,havenovalue.
Thefollowingsyntaxresults:
<command> --server <vc_server> --username <privileged_user> --password <pw> --vihost <esx_host>
--<option_name option_value>
Windows: vicfg-mpath.pl --sessionfile C:\Temp\my_session --list
Linux: vicfg-mpath --sessionfile /tmp/vimsession --list
IMPORTANTDonotuseescapecharactersinenvironmentvariables.
CAUTIONLimitreadaccesstoaconfigurationfilethatcontainsusercredentials.
IMPORTANTThepasswordisinplaintext,soyoumustlimitaccesstothisfile.
vSphere Command-Line Interface Installation and Reference Guide
16 VMware, Inc.

Examples
Thefollowingexamplesconnecttotheserverasusersnow-whitewithpassworddwarf$.Theexamplecalls
vicfg-mpathwithnooptions.Thesystemdisplayshelpinformationforthecommandinthatcase.
Thefirstexample(Linux)usesthe\escapecharacter,theothertwousesinglequotes(Linux)anddouble
quotes(Windows).
Linux
vicfg-mpath --server <server> --username snow\-white --password dwarf\$
vicfg-mpath --server <server> --username snow-white --password dwarf$
Windows
vicfg-mpath.pl --server <server> --username snow-white --password dwarf$
Using Microsoft Windows Security Support Provider Interface (SSPI)
The--passthroughoutoption,whichisavailableifyourunvSphereCLIcommandsfromaMicrosoft
Windowssystem,allowsyoutousetheMicrosoftWindowsSecurityProviderInterface(SSPI).Seethe
MicrosoftWebsiteforadetaileddiscussionofSSPI.
Youcanuse--passthroughauthtoestablishaconnectionwithavCenterServersystem(vCenterServer
systemorVirtualCenterServer3.5Update2orlater).Aftertheconnectionhasbeenestablished,authentication
forthevCenterServersystemoranyESX/ESXisystemitmanagesisnolongerrequired.Using
--passthroughauthpassesthecredentialsoftheuserwhorunsthecommandtothetargetvCenterServer
system.IftheuserwhorunsthecommandisknownbyboththemachinefromwhichyouaccessthevCenter
ServersystemandthemachinerunningthevCenterServersoftware,noadditionalauthenticationisrequired.
IfvSphereCLIcommandsandthevCenterServersoftwarerunonthesamemachine,alocalaccountforthe
userwhorunsthecommandworks.Iftheyrunondifferentmachines,theuserwhorunsthecommandmust
haveanaccountinadomaintrustedbybothmachines.
SSPIsupportsanumberofprotocols.Bydefault,itselectstheNegotiateprotocol,whereclientandserver
attempttofindaprotocolthatbothsupport.Youcanuse--passthroughauthpackagetoexplicitlyspecifya
protocolsupportedbySSPI.Kerberos,theWindowsstandardfordomainlevelauthentication,isused
frequently.IfthevCenterServersystemisconfiguredtoacceptonlyaspecificprotocol,specifyingtheprotocol
with --passthroughauthpackagemightberequiredforsuccessfulauthentication.Ifyouuse
--passthroughauth,youdonothavetospecifyauthenticationinformationinanyotherway.
Example
vicfg-mpath --server <vc_server> --passthroughauth --passthroughauthpackage Kerberos
--vihost my_esx --list
ConnectstoaserverthathasbeensetuptouseSSPI.Whenyourunthecommand,thesystemcalls
vicfg-mpathwiththe--listoption.Thesystemdoesnotpromptforausernameandpassword.
Available Options for vSphere CLI Execution
Table 12listsoptionsthatareavailableforallvSphereCLIcommandsinalphabeticalorder.Thetableincludes
optionsforuseonthecommandlineandvariablesforuseinconfigurationfiles.
SpecifyingAuthenticationInformationonpage 13explainshowtousetheoptions.
IMPORTANTEnclosepasswordsandothertextwithspecialcharactersinquotationmarks.
OnLinux,usesinglequotes( ),onWindows,usedoublequotes( ).OnLinux,youcanalsouseabackslash
(\)asanescapecharacter.
IMPORTANTForconnections,vSphereCLIsupportsonlytheIPv4protocol,nottheIPv6protocol.Youcan,
however,performIPv6configurationonthetargethostwithseveralofthenetworkingcommands.
VMware, Inc. 17
Chapter 1 vSphere CLI Installation, Execution, and Command Overviews

Table 1-2. vSphere CLI Connection Options
Option and Environment
Variable
Description
--config <config_file>
VI_CONFIG=<config_file>
Usestheconfigurationfileatthespecifiedlocation.
Specifyapaththatisreadablefromthecurrentdirectory.
--credstore <credstore> Nameofacredentialstorefile.Defaultsto
<HOME>/.vmware/credstore/vicredentials.xmlonLinuxand
<APPDATA>/VMware/credstore/vicredentials.xmlonWindows.Commands
forsettingupthecredentialstoreareincludedinthevSphereSDKforPerl,whichis
installedwiththevSphereCLI.ThevSphereSDKforPerlProgrammingGuideexplains
howtousethecredentialstore.
--encoding <encoding>
VI_ENCODING=<encoding>
Specifiestheencodingtobeused.Oneofcp936(SimplifiedChinese)ISO-8859-1
(German),orShift_JIS(Japanese).
Youcanuse--encodingtospecifytheencodingthevSphereCLIshouldmapto
whenitisrunonaforeignlanguagesystem.
--passthroughauth
VI_PASSTHROUGHAUTH
Ifyouspecifythisoption,thesystemusestheMicrosoftWindowsSecuritySupport
ProviderInterface(SSPI)forauthentication.Youarenotpromptedforausername
andpassword.SeetheMicrosoftWebsiteforadetaileddiscussionofSSPI.
ThisoptionissupportedonlyifyouarerunningthevSphereCLIonaWindows
systemandareconnectingtoavCenterServersystem.
--passthroughauthpackage
<package>
VI_PASSTHROUGHAUTHPACKAGE=
<package>
Usethisoptionwith--passthroughauthtospecifyadomainlevelauthentication
protocoltobeusedbyWindows.Bydefault,SSPIusestheNegotiateprotocol,
whichmeansthatclientandserverattempttonegotiateaprotocolthatboth
support.
IfthevCenterServersystemtowhichyouareconnectingisconfiguredtousea
specificprotocol,youcanspecifythatprotocolusingthisoption.
ThisoptionissupportedonlyifyouarerunningthevSphereCLIonaWindows
systemandconnectingtoavCenterServersystem.
--password <passwd>
VI_PASSWORD=<passwd>
Usesthespecifiedpassword(usedwith--username)tologintotheserver.
If--serverspecifiesavCenterServersystem,theusernameandpassword
applytothatserver.Youneednoauthenticationtoruncommandsonthe
ESX/ESXihoststhatservermanages.
If--serverspecifiesanESX/ESXihost,theusernameandpasswordapplyto
thatserver.
Usetheemptystring(' 'onLinuxand onWindows)toindicatenopassword.
Ifyoudonotspecifyausernameandpasswordonthecommandline,thesystem
promptsyouanddoesnotechoyourinputtothescreen.
--portnumber <number>
VI_PORTNUMBER=<number>
UsesthespecifiedporttoconnecttotheESX/ESXihost.Defaultis443.
--protocol <HTTP|HTTPS>
VI_PROTOCOL=<HTTP|HTTPS>
UsesthespecifiedprotocoltoconnecttotheESX/ESXihost.DefaultisHTTPS.
--savesessionfile <file>
VI_SAVESESSIONFILE=<file>
Savesasessiontothespecifiedfile.Thesessionexpiresifithasbeenunusedfor
thirtyminutes.
--server <server>
VI_SERVER=<server>
UsesthespecifiedESX/ESXiorvCenterServersystem.Defaultislocalhost.
If--serverpointstoavCenterServersystem,youusethe--vihostoptionto
specifytheESX/ESXihostonwhichyouwanttorunthecommand.Acommandis
supportedforvCenterServerifthe--vihostoptionisdefined.
--servicepath <path>
VI_SERVICEPATH=<path>
UsesthespecifiedservicepathtoconnecttotheESX/ESXihost.Defaultis
/sdk/webService.
--sessionfile <file>
VI_SESSIONFILE=<file>
Usesthespecifiedsessionfiletoloadapreviouslysavedsession.Thesessionmust
beunexpired.
--url <url>
VI_URL=<url>
ConnectstothespecifiedvSphereWebServicesSDKURL.
vSphere Command-Line Interface Installation and Reference Guide
18 VMware, Inc.

Table 13listsoptionsnotusedasconnectionoptionsthatyoucanusewhenyourunavSphereCLIcommand.
Using vSphere CLI Commands in Scripts
Mostadministratorsrunscriptstoperformthesametaskrepeatedlyortoperformataskonmultiplehosts.
YoucanrunvSphereCLIcommandsfromoneadministrationserveragainstmultipletargetservers.
Forexample,whenanewdatastorebecomesavailableinyourenvironment,youmustmakethatdatastore
availabletoeachESX/ESXihost.ThefollowingsamplescriptillustrateshowtomakeaNASdatastoreavailable
tothreehosts(esxi_server_a,esx_server_b,andesxi_server_c).
Thesampleassumesthataconfigurationfile/home/admin/.visdkrc.<hostname>existsforeachhost.For
example,theconfigurationfileforesxi_server_ahasthefollowingcontents:
VI_SERVER = esxi_server_a
VI_USERNAME = root
VI_PASSWORD = xysfdjkat
ThescriptitselfaddstheNASdatastorebycallingthedifferentconfigurationfiles.
#!bin/sh
for i in {"esxi_server_a","esx_server_b","esxi_server_c"}
do
echo "Adding NAS datastore for $i..."
vicfg-nas --config /home/admin/.visdkrc.$i -a -o mainnas.x.com -s /shared nas_ds
vicfg-nas --config /home/admin/.visdkrc.$i -l
done
--username <u_name>
VI_USERNAME=<u_name>
Usesthespecifiedusername.
If--serverspecifiesavCenterServersystem,theusernameandpassword
applytothatserver.Youneednoauthenticationtoruncommandsonthe
ESX/ESXisystemsthatservermanages.
If--serverspecifiesanESX/ESXisystem,theusernameandpasswordapply
tothatsystem.
Ifyoudonotspecifyausernameandpasswordonthecommandline,thesystem
promptsyouanddoesnotechoyourinputtothescreen.
--vihost <host>
-h <host
WhenyourunavSphereCLIcommandwiththe--serveroptionpointingtoa
vCenterServersystem,use--vihosttospecifytheESX/ESXihosttorunthe
commandagainst.
NOTE:Thisoptionisnotsupportedforeachcommand.Ifsupported,theoptionis
includedintheindividualcommandoptionlist.
Table 1-3. vSphere CLI Common Options
Option Description
--help Printsabriefusagemessage.Themessagelistsfirsteachcommandspecificoptionandthen
eachofthecommonoptions.
--verbose Displaysadditionaldebugginginformation.
--version Displaysversioninformation.
--vihost WhenyourunavSphereCLIcommandwiththe--serveroptionpointingtoavCenterServer
system,use--vihosttospecifytheESX/ESXihosttorunthecommandagainst.Usethehost
nameorIPaddress,dependingonwhatyouspecifiedwhenyouaddedthehosttothevCenter
Serversystem.
Thisoptionisnotsupportedforallcommandsandlistedintheoptiontableofeachcommand
itappliesto.
Table 1-2. vSphere CLI Connection Options (Continued)
Option and Environment
Variable
Description
VMware, Inc. 19
Chapter 1 vSphere CLI Installation, Execution, and Command Overviews

List of Available Commands
Table 14listsallvSphereCLIcommandsinalphabeticalorderandpointstothevSphereCLIdiscussioninthis
documentandrelateddocumentation.
Table 1-4. vSphere CLI Commands Supported by ESX/ESXi
Command Description See
esxcli Managepluggablestoragearchitecture(PSA)
andnativemultipathing(NMP).
StoragePathandStoragePluginManagement
withesxclionpage 83.
resxtop MonitorsinrealtimehowESXhostsuse
resources.Runsininteractiveorbatchmode.
ThiscommandissupportedonlyonLinux.
SeeUsingresxtopforPerformance
Monitoringonpage 39foranintroduction.
SeetheResourceManagementGuidefora
detailedreference.
svmotion Movesavirtualmachinesconfigurationfileand
optionallyitsdiskswhilethevirtualmachineis
running.
MustrunagainstavCenterServersystem.
VirtualMachineMigrationwithsvmotion
onpage 44foranintroduction.SeetheBasic
SystemAdministrationguideforanindepth
discussionthatincludesexamples.
vicfg-advcfg Performsadvancedconfigurationincluding
enablinganddisablingCIMproviders.Usethis
commandasinstructedbyVMware.
AdvancedManagementwithvicfgadvcfg
onpage 46.
vicfg-cfgbackup BacksuptheconfigurationdataofanESXi
systemandrestorespreviouslysaved
configurationdata.
ConfigurationInformationBackupwith
vicfgcfgbackuponpage 39.Seethe
ESXi EmbeddedandvCenterServerSetupGuide
foranindepthdiscussionthatincludes
stepbystepinstructions.
vicfg-dns SpecifiesanESX/ESXihostsDNS(Domain
NameServer)configuration.
DNSConfigurationSpecificationwith
vicfgdnsonpage 31.
vicfg-dumppart Managesdiagnosticpartitions. DiagnosticPartitionManagementwith
vicfgdumppartonpage 25.
vicfg-iscsi ManagesiSCSIstorage. iSCSIStorageManagementwithvicfgiscsi
onpage 63.
vicfg-module EnablesVMkerneloptions.Usethiscommand
withtheoptionslistedinthisdocument,oras
instructedbyVMware.
VMkernelModuleManipulationwith
vicfgmoduleonpage 47.
vicfg-mpath
vicfg-mpath35
Configuresstoragearrays.
Usevicfg-mpath35forESX/ESXi3.5hosts.
BasicStorageArrayManagementwith
vicfgmpathonpage 27.
StorageArrayConfigurationfor
VMware Infrastructure 3.5Systemswith
vicfgmpath35onpage 99
vicfg-nas ManagesNASfilesystems. NASFileSystemManagementwith
vicfgnasonpage 28.
vicfg-nics ManagestheESX/ESXihostsphysicalNICs. PhysicalNICManagementwithvicfgnics
onpage 32.
vicfg-ntp SpecifiestheNTP(NetworkTimeProtocol)
server.
NTPServerSpecificationwithvicfgntpon
page 33.
vicfg-rescan Rescansthestorageconfiguration. RescanOperationswithvicfgrescanon
page 30.
vicfg-route ManipulatestheESX/ESXihostsrouteentry. RouteEntryManipulationwithvicfgroute
onpage 34.
vicfg-scsidevs FindsavailableLUNs. AvailableLUNDiscoverywith
vicfgscsidevsonpage 29.
vicfg-snmp ManagestheSimpleNetworkManagement
Protocol(SNMP)agent.
SNMPManagementwithvicfgsnmpon
page 40.UsingSNMPinavSphere
environmentisdiscussedindetailintheBasic
SystemAdministrationmanual.
vSphere Command-Line Interface Installation and Reference Guide
20 VMware, Inc.

Supported Platforms for Commands
vSphereCLI4.0supportsmorefunctionalitythanvSphereCLI3.5.Differentcommandssupportadifferent
rangeoftargetservers.
MostcommandscanrunagainstanESX/ESXisystemandhavevCenterServersupport.vCenterServer
supportmeansthatyoucanconnecttoavCenterServersystem,anduse--vihosttospecifytheESX/ESXi
hosttorunthecommandagainst.Theonlyexceptionissvmotion,whichyoucanrunagainstvCenterServer
systemsbutnotagainstESX/ESXisystems.
ThefollowingcommandsmusthaveanESX/ESXisystem,notavCenterServersystemtarget:
vicfg-snmp
vifs
vicfg-user
vicfg-cfgbackup
vihostupdate
vmkfstools
esxcli
Youcannotrunthevihostupdateandvicfg-mpathcommandsthatareinthevSphereCLI4.0installation
againstESX/ESXi3.5orvCenter2.5systems.Instead,runvihostupdate35andvicfg-mpath35,includedin
thevSphereCLI4.0installation,againstthosesystems.vihostupdate35issupportedforESXibutnotESX.
vicfg-syslog Specifiesthesyslogserverandtheportto
connecttothatserverforESXihosts.
SyslogServerSpecificationwithvicfgsyslog
onpage 41.TheBasicSystemAdministration
documentdiscussessystemlogsinmoredetail
andexplainshowtosetthemupusingthe
vSphereClient.
vicfg-user Creates,modifies,deletes,andlistslocaldirect
accessusersandgroupsofusers.
UserandGroupManagementwith
vicfguseronpage 48.
vicfg-vmknic Adds,deletes,andmodifiesvirtualnetwork
adapters(VMkernelNICs).
VMkernelNICsManagementwith
vicfgvmkniconpage 35.
vicfg-volume SupportsresignaturingaVMFSsnapshot
volumeandmountingandunmountingthe
snapshotvolume.
VolumeManagementwithvicfgvolumeon
page 49.
vicfg-vswitch Addsorremovesvirtualswitchesormodifies
virtualswitchsettings.
VirtualSwitchManagementwith
vicfgvswitchonpage 36.
vifs Performsfilesystemoperationssuchas
retrievinganduploadingfilesontheremote
server.
FileSystemManipulationwithvifson
page 50.
vihostupdate
vihostupdate35
ManagesupdatesofESX/ESXihosts.Use
vihostupdate35forESXi3.5hosts.
SeealsotheESXiUpgradeGuide.
UpdateManagementwithvihostupdateon
page 42.
PerformingMaintenanceonVMware
Infrastructure 3.5Systemswith
vihostupdate35onpage 101
vmkfstools Createsandmanipulatesvirtualdisks,file
systems,logicalvolumes,andphysicalstorage
devicesonanESX/ESXihost.
FileSystemManagementwithvmkfstools
onpage 53.
vmware-cmd Performsvirtualmachineoperationsremotely.
Thisincludes,forexample,creatingasnapshot,
poweringthevirtualmachineonoroff,and
gettinginformationaboutthevirtualmachine.
VirtualMachineManagementwith
vmwarecmdonpage 79.
Table 1-4. vSphere CLI Commands Supported by ESX/ESXi (Continued)
Command Description See
VMware, Inc. 21
Chapter 1 vSphere CLI Installation, Execution, and Command Overviews

Table 15listsplatformsupportforthedifferentvSphereCLI4.0commands.Thesecommandshavenotbeen
testedagainstVirtualCenter2.5Update2systems.Youcan,however,connecttoavCenterServer4.0system
andtargetESX/ESXi3.5Update2hosts.
IMPORTANTIfyourunvSphereCLI4.0commandsagainstESX/ESXi3.5systems,youcanuseonlytheoptions
supportedbythosesystems.
SeetheVMwareInfrastructureRemoteCommandLineInterfaceInstallationandReferenceGuideforESX/ESXi
Update2foralistofsupportedoptions.Toaccessthatdocument,selectResources,thenDocumentationfrom
theVMwarewebsite.FindthevSpheredocumentationsetandopenthearchive.AsmallnumberofvSphere
CLI4.0optionsaresupportedagainstESX/ESXi3.5Updatehostseventhoughtheywerenotsupportedin
RCLIversion3.5.
RunavSphereCLI4.0commandwith--helpforinformationonoptionsupportwithESX/ESXi3.5Update 2,
orseeVMwareKBarticle1008940formoredetail.
Table 1-5. Platform Support for vSphere CLI 4.0 Commands
Command ESXi 4.0 ESX 4.0 VC 4.0 ESXi 3.5 U2+ ESX 3.5 U2+
esxcli Yes Yes No No No
resxtop Yes Yes Yes Yes Yes
svmotion No No Yes No No
vicfg-advcfg Yes Yes Yes Yes Yes
vicfg-cfgbackup Yes No No Yes No
vicfg-dns Yes Yes Yes Yes Yes
vicfg-dumppart Yes Yes Yes Yes Yes
vicfg-iscsi Yes Yes Yes No No
vicfg-module Yes Yes Yes Yes Yes
vicfg-mpath Yes Yes Yes Usevicfg-mpath35instead.
vicfg-nas Yes Yes Yes Yes Yes
vicfg-nics Yes Yes Yes Yes Yes
vicfg-ntp Yes Yes Yes Yes Yes
vicfg-rescan Yes Yes Yes Yes Yes
vicfg-route Yes Yes Yes Yes Yes
vicfg-scsidevs Yes Yes Yes No No
vicfg-snmp Yes Yes No Yes Yes
vicfg-syslog Yes No Yes Yes No
vicfg-user Yes Yes No Yes Yes
vicfg-vmhbadevs NotincludedinvSphereCLI4.0.Usevicfg-scsidevsinstead.
vicfg-vmknic Yes Yes Yes Yes Yes
vicfg-volume Yes Yes Yes No No
vicfg-vswitch Yes Yes Yes Yes Yes
vifs Yes Yes No Yes Yes
vihostupdate Yes Yes No Use
vihostupdate35
instead
No
vmkfstools Yes Yes No Yes Yes
vmware-cmd Yes Yes Yes Yes Yes
vSphere Command-Line Interface Installation and Reference Guide
22 VMware, Inc.

Table 16listsplatformsupportforthedifferentvSphereCLI3.5commands.Thesecommandsarenot
supportedagainstvSphere4.0systems.
Commands with an esxcfg Prefix
FormanyofthevSphereCLIcommandsyoumighthaveusedscriptswithcorrespondingserviceconsole
commandsstartingwithanesxcfgprefixtomanageESX3.xhosts.TofacilitateeasymigrationfromESX3.x
toESX/ESXi,thecommandswiththeesxcfgprefixareavailableasvSphereCLIcommands.
vicfg-mpath35 No No No Yes Yes
vihostupdate35 No No No Yes No
Table 1-6. Platform Support for vSphere CLI 4.0 Commands
Command ESXi 3.5 U2+ ESX 3.5 U2+ VC 2.5 U2+
esxcli No No No
resxtop Yes Yes No
svmotion N.A. N.A. Yes
vicfg-advcfg Yes Yes Yes
vicfg-cfgbackup Yes No No
vicfg-dns Yes Yes Yes
vicfg-dumppart Yes Yes Yes
vicfg-iscsi No No No
vicfg-module Yes Yes Yes
vicfg-mpath Yes Yes Yes
vicfg-nas Yes Yes Yes
vicfg-nics Yes Yes Yes
vicfg-ntp Yes Yes Yes
vicfg-rescan Yes Yes Yes
vicfg-route Yes Yes Yes
vicfg-scsidevs No No No
vicfg-snmp Yes Yes No
vicfg-syslog Yes No Yes
vicfg-user Yes Yes No
vicfg-vmhbadevs Yes Yes Yes
vicfg-vmknic Yes Yes Yes
vicfg-volume No No No
vicfg-vswitch Yes Yes Yes
vifs Yes Yes No
vihostupdate Yes No No
vmkfstools Yes Yes No
vmware-cmd Yes Yes Yes
Table 1-5. Platform Support for vSphere CLI 4.0 Commands (Continued)
Command ESXi 4.0 ESX 4.0 VC 4.0 ESXi 3.5 U2+ ESX 3.5 U2+
IMPORTANTVMwarerecommendsthatyouusethevSphereCLIcommandswiththevicfgprefix.
Commandswiththeesxcfgprefixareavailablemainlyforcompatibilityreasonsandmightbecomeobsolete.
VMware, Inc. 23
Chapter 1 vSphere CLI Installation, Execution, and Command Overviews

Table 17listsallvSphereCLIcommandsforwhichacommandwithanesxcfgprefixisavailable.
Table 1-7. Commands with an esxcfg Prefix
Command with
vicfg prefix
Command with
esxcfg prefix See
vicfg-advcfg esxcfg-advcfg AdvancedManagementwithvicfgadvcfgonpage 46.
vicfg-cfgbackup esxcfg-cfgbackup ConfigurationInformationBackupwithvicfgcfgbackuponpage 39.
vicfg-dns esxcfg-dns DNSConfigurationSpecificationwithvicfgdnsonpage 31.
vicfg-dumppart esxcfg-dumppart DiagnosticPartitionManagementwithvicfgdumppartonpage 25.
vicfg-module esxcfg-module VMkernelModuleManipulationwithvicfgmoduleonpage 47.
vicfg-mpath esxcfg-mpath BasicStorageArrayManagementwithvicfgmpathonpage 27.
vicfg-nas esxcfg-nas NASFileSystemManagementwithvicfgnasonpage 28.
vicfg-nics esxcfg-nics PhysicalNICManagementwithvicfgnicsonpage 32.
vicfg-ntp esxcfg-ntp NTPServerSpecificationwithvicfgntponpage 33.
vicfg-rescan esxcfg-rescan RescanOperationswithvicfgrescanonpage 30.
vicfg-route esxcfg-route RouteEntryManipulationwithvicfgrouteonpage 34.
vicfg-scsidevs esxcfg-scsidevs AvailableLUNDiscoverywithvicfgscsidevsonpage 29.
vicfg-snmp esxcfg-snmp SNMPManagementwithvicfgsnmponpage 40.
vicfg-syslog esxcfg-syslog SyslogServerSpecificationwithvicfgsyslogonpage 41.
vicfg-vmknic esxcfg-vmknic VMkernelNICsManagementwithvicfgvmkniconpage 35.
vicfg-vswitch esxcfg-vswitch VirtualSwitchManagementwithvicfgvswitchonpage 36.
vSphere Command-Line Interface Installation and Reference Guide
24 VMware, Inc.

VMware, Inc. 25

2
vSphereCLIincludescommandsforstorage,network,system,andvirtualmachinemanagementdiscussed
here.Somecommandswithmanyoptionsarediscussedinseparatechapters.
Thischapterincludesthefollowingtopics:
StorageManagementCommandsonpage 25
NetworkingCommandsonpage 31
SystemManagementCommandsonpage 39
VirtualMachineManagementCommandsonpage 44
MiscellaneousManagementCommandsonpage 46
FileSystemManipulationwithvifsonpage 50
Storage Management Commands
Table 21liststhevSphereCLIstoragemanagementcommands.
Diagnostic Partition Management with vicfg-dumppart
Thevicfg-dumppartcommandqueries,sets,andscansanESX/ESXihostsdiagnosticpartitions.TheESX
ConfigurationGuideandtheESXiConfigurationGuidediscussdiagnosticpartitionsindetail.
vSphere CLI Reference 2
Table 2-1. Storage Management Commands
Command See
esxcli Chapter 6,StoragePathandStoragePluginManagementwithesxcli,onpage 83.
vicfg-dumppart DiagnosticPartitionManagementwithvicfgdumppartonpage 25.
vicfg-iscsi Chapter 4,iSCSIStorageManagementwithvicfgiscsi,onpage 63.
vicfg-mpath BasicStorageArrayManagementwithvicfgmpathonpage 27.
vicfg-nas NASFileSystemManagementwithvicfgnasonpage 28.
vicfg-rescan RescanOperationswithvicfgrescanonpage 30.
vicfg-scsidevs AvailableLUNDiscoverywithvicfgscsidevsonpage 29.
vmkfstools .Chapter 3,FileSystemManagementwithvmkfstools,onpage 53
vSphere Command-Line Interface Installation and Reference Guide
26 VMware, Inc.

Options
Table 22liststhecommandspecificoptionsforvicfg-dumppart.Youmustalsospecifyconnectionoptions.
SeevSphereCLIConnectionOptionsonpage 17.
Examples
Thefollowingexamplesforvicfg-dumppartrequireconnectionoptions,indicatedby<conn_options>.See
SpecifyingAuthenticationInformationonpage 13.
vicfg-dumppart.pl <conn_options> -t
ShowsthecurrentdiagnosticpartitiontheVMkerneluses.
vicfg-dumppart.pl <conn_options> -s naa.<naa_ID>
Setstheactivepartitiontonaa.<naa_ID>.Afterthecommandhasbeenrun,-treportsnaa.<naa_ID>asthe
activepartition.
vicfg-dumppart.pl <conn_options> -l
Displaysinformationonallpartitionsthatcanbeusedasdiagnosticpartitions.
vicfg-dumppart.pl <conn_options> -d
Deactivatesthediagnosticpartition.Afterthiscommandhasrun,nodiagnosticpartitionisset.
vicfg-dumppart.pl <conn_options> -f
Findsallpartitionsthatcouldbeusedasdiagnosticpartitionsanddisplaysdetailedinformation.Theoutput
mightlookasfollows.
Partition name on vml.mpx.vmhba36:C0:T0:L0:7 -> mpx.vmhba36:C0:T0:L0:7
Table 2-2. Options for vicfg-dumppart
Option Description
--activate <partition>
-a <partition>
Makesthespecifiedpartitionthecurrentdiagnosticpartition.
Thisoptionhasthesameeffectas--set.
--deactivate [<partition>]
-d [<partition>]
Deactivatestheactivediagnosticpartition.Theoptionalsounsetsthediagnostic
partition.Specifyingthenameofthepartitionisoptional.
WARNING:Ifyourunvicfg-dumppartwiththisoption,yoursystemcannotwrite
errorstoafileuntilanotherpartitionisactivated.Youloseanyerrorrecordiferrors
occur.
--find
-f
FindsalldiagnosticpartitionsontheESX/ESXihostandprintsthem.Thepartitions
caninclude,inorderofsuitability,paralleladapter,blockadapter,FibreChannel,
hardwareiSCSI,softwareiSCSIpartitions.
--get-active
-t
Displaystheactivediagnosticpartitionforthissystem.Runningvicfg-dumppart
withthisoptionreturnstheinternalnameofthepartition(vmbhaX:X:X:X)ornone
ifnopartitionisset.
--list
-l
ListsallpartitionsontheESX/ESXisystemthathavetheappropriatepartitiontype
toactasadiagnosticpartition.
CAUTION:ExecutionmighttakeseveralminutesandslowdownyourESX/ESXi
hostbecausethecommandscansallLUNsonthesystem.
--set vmbha<partition>
-s vmbha<partition>
Setsandactivatesthediagnosticpartition,whichyoumustspecifyusingnaa.xxx:1
oreui.xxxsyntax.
--vihost <host>
-h <host
WhenyourunavSphereCLIcommandwiththe--serveroptionpointingtoa
vCenterServersystem,use--vihosttospecifytheESX/ESXihosttorunthe
commandagainst.
VMware, Inc. 27
Chapter 2 vSphere CLI Reference

Basic Storage Array Management with vicfg-mpath
Thevicfg-mpathcommandsupportslistinginformationaboutFibreChanneloriSCSILUNsandchanging
apathsstate.Usetheesxclicommandformanagingpluggablestoragearchitecture(PSA)andnative
multipathing(NMP),includingpathpolicymodification.SeeStoragePathandStoragePluginManagement
withesxclionpage 83.
NamesofvirtualmachineHBAsarenotguaranteedtobevalidacrossreboots.Useindustrystandarddevice
names,withformateui.xxxandnaa.xxxtobesureofconsistency.DonotuseVMLLUNnamesunlessdevice
namesarenotavailable.
Options
Table 23liststhecommandspecificoptionsforvicfg-mpath.Youmustalsospecifyconnectionoptions.See
Table 12,vSphereCLIConnectionOptions,onpage 17.
Examples
Thefollowingexamplesforvicfg-mpathrequireconnectionoptions.TheservermustbeanESX/ESXi4.x
host.SeeSpecifyingAuthenticationInformationonpage 13.
vicfg-mpath.pl <conn_options> --state off --path vmhba32:C0:T1:L0
Setsthestateforaspecificpath.Requiresthat--pathisspecified.
IMPORTANTThiscommandisavailableonlyforESX/ESXi4.0orlater.Usethevicfg-mpath35commandto
performstoragemanagementonESX/ESXi3.5hosts.SeeStorageArrayConfigurationfor
VMware Infrastructure 3.5Systemswithvicfgmpath35onpage 99.
Table 2-3. Options for vicfg-mpath
Option Description
--device
-d
Usedwiththe--listoptiontodisplayonlyaspecificdevice.
--list [-P | -d]
-l [-P | -d]
Listsdetailedpathinformationforthespecifiedpathordevice.
--list-compact [-P | -d]
-L [-P | -d]
Presentsashortlistingofallpaths.
--list-map [-P | -d]
-m [-P | -d]
Listsallpathsandthecorrespondingadaptersanddevicemappings.
--list-paths [-P | -d]
-b [-P | -d]
Listsalldevicesandthecorrespondingpaths.
--list-plugins [-P | -d]
-G [-P | -d]
Listsallmultipathingpluginsloadedintothesystem.Ataminimum,this
commandreturnsNMP(NativeMultipathingPlugin).IfotherMPPpluginshave
beenloaded,theyarelistedaswell.Forinformationaboutstoragearrayplugins,
seetheESXConfigurationGuideandtheESXiConfigurationGuide.SeeChapter 6,
StoragePathandStoragePluginManagementwithesxcli,onpage 83forplugin
managementcommands.
--path
-P
Usedwithlistcommandstodisplayonlyinformationforaspecificpath.Thepath
namecanbethelongpathUIDortheshorterruntimenameofthepath.
--state [active|off]
-s [active|off]
SetsthestateofagivenLUNpathtoeitheractiveoroff.
Thisoptionrequiresthatthe--pathoptionsissetandspecifieseitherthepathUID
orthepathruntimename.
Ifyouarechangingapathsstate:
ThechangeoperationfailsifI/Oisactivewhenthepathsettingischanged.
Reissuethecommand.
YoumustissueatleastoneI/Ooperationbeforethechangetakeseffect.
--vihost <host>
-h <host>
WhenyourunavSphereCLIcommandwiththe--serveroptionpointingtoa
vCenterServersystem,use--vihosttospecifytheESX/ESXihosttorunthe
commandagainst.
vSphere Command-Line Interface Installation and Reference Guide
28 VMware, Inc.

vicfg-mpath.pl <conn_options> -m
Listsallpathswithadapteranddevicemappings.
vicfg-mpath.pl <conn_options> -l
Listsallpathsonthesystemwiththeirdetailedinformation.
vicfg-mpath.pl <conn_options> -l -P vmhba32:C0:T0:L0
Listsdetailedinformationaboutthepathspecifiedby-P.Youcanspecifythepathusingtheruntimenameor
thefirstiteminthevicfg-mpath -ldisplay.Seetheprecedingexampleforvicfg-mpath -l.
vicfg-mpath.pl <conn_options> -l -d mpx.vmhba32:C0:T1:L0
Listsdetailedinformationforthepathsforthedevicespecifiedin-d.
NAS File System Management with vicfg-nas
Thevicfg-nascommandmanipulatesNASfilesystemsassociatedwithESX/ESXisystems.Formore
informationonworkingwithNASfilesystems,seetheESXConfigurationGuideandtheESXiConfiguration
Guide.
Options
Table 24listscommandspecificoptionsforvicfg-nas.Youmustalsospecifyconnectionoptions.See
vSphereCLIConnectionOptionsonpage 17.
Examples
Thefollowingexamplesforvicfg-nasrequireconnectionoptions.SeeSpecifyingAuthentication
Informationonpage 13.
vicfg-nas.pl <conn_options> -l
ListsallknownNASfilesystemswiththeirmountname,sharename,andhostname.Indicatesforeachfile
systemwhetheritismounted.
vicfg-nas.pl <conn_options> -a
AddsanewNASfilesystemtotheESX/ESXihost.ThiscommandaddsanentrytotheknownNASfilesystem
list.
Table 2-4. Options for vicfg-nas
Option Description
--add <name>
-a <name>
AddsanewNASfilesystemtotheESX/ESXihost.
Whenyouusethisoption,youmustalsousethe-oand-soptions,andmustspecifya
labelnameforthenewfilesystem.
--delete <name>
-d <name>
DeletesaNASfilesystem.
ThiscommandunmountstheNASfilesystemandremovesitfromthelistofknownfile
systems.
--list
-l
ListsallknownNASfilesystemswiththeirmountname,sharename,andhostnameand
indicatesforeachfilesystemwhetheritismounted.
--nasserver <n_host>
-o <n_host>
Usedwiththe-aoptiontosupplythehostnameforanewNASfilesystem.
--readonly
-y
AddsthenewNASfilesystemwithreadonlyaccess.
--share <share>
-s <share>
Usedwiththe-aoptiontosupplythesharenameforanewNASfilesystem.
--vihost <host>
-h <host>
WhenyourunavSphereCLIcommandwiththe--serveroptionpointingtoavCenter
Serversystem,use--vihosttospecifytheESX/ESXihosttorunthecommandagainst.
VMware, Inc. 29
Chapter 2 vSphere CLI Reference

vicfg-nas.pl <conn_options> -d
DeletesaNASfilesystem.ThiscommandunmountstheNASfilesystemandremovesitfromthelistofknown
filesystems.
vicfg-nas.pl <conn_options> -a -s new_share
AddsanewNASfilesystemtotheESX/ESXihost.ThiscommandaddsanentrytotheknownNASfilesystem
listandsuppliesthesharenameofthenewNASfilesystem.
Available LUN Discovery with vicfg-scsidevs
Thevicfg-scsidevscommanddisplaysinformationaboutavailableLUNsonESX/ESXi 4.0hosts.
Youcanrunvicfg-scsidevs --queryandvicfg-scsidevs --vmfsagainstESX/ESXiversion3.5.The
otheroptionsaresupportedonlyagainstESX/ESXiversion4.0.
Inpreviousreleasesofthiscommandlineinterface,thecorrespondingcommandisvicfg-vmhbadevs.
Options
Youcanrunvicfg-scsidevswiththefollowingoptions.Foradditionaloptions,seevSphereCLI
ConnectionOptionsonpage 17.
Examples
Thefollowingexamplesforvicfg-scsidevsrequireconnectionoptions.SeeSpecifyingAuthentication
Informationonpage 13.
vicfg-scsidevs.pl <conn_options> -l
Listsdetailedinformationaboutalllogicaldevicesonthissystem.Hereistheoutputforjustonedevice;the
actuallistingincludesmultipledevices.
mpx.vmhba2:C0:T1:L0
Device Type: cdrom
Size: 0 MB
Display Name: Local SONY CD-ROM (mpx.vmhba2:C0:T1:L0)
Plugin: NMP
Table 2-5. Options for vicfg-scsidevs
Option Description
--compact-list
-c
Listsalllogicaldevices,eachonasingleline,withlimitedinformation.Theinformation
includesthedeviceID,devicetype,size,andpluginanddevicedisplayname.
Youcanspecifythe--deviceoptiontolistinformationaboutaspecificdevice.
--device <device>
-d <device>
Usedwithotheroptionstospecifythedeviceforwhichyouwantinformation.
--hba-device-list
-A
ForeachHBA,printsamappingbetweentheHBAandthedevicesforwhichitprovidespaths.
--hbas
-a
PrintsHBAdeviceswithidentifyinginformation.ThisincludestheadapterID,driverID,
adapterUID,PCI,vendor,andmodel.
--list
-l
Listsdeviceinformationforalllogicaldevicesonthissystem.Theinformationincludesthe
name(UUID),devicetype,displayname,andmultipathingplugin.
Youcanspecifythe--deviceoptiontolistinformationaboutaspecificdevice.
--query
-q
Printsmappingsin2.5compatibilitymodetomimicacalltovmkpcidivy -q vmhba_devs.
--uids
-u
ListstheprimaryUIDforeachdeviceandanyotherUIDs(aliases)foreachUID.
Youcanspecifythe--deviceoptiontolistinformationaboutaspecificdevice.
--vihost <host>
-h <host>
WhenyourunavSphereCLIcommandwiththe--serveroptionpointingtoavCenterServer
system,use--vihosttospecifytheESX/ESXihosttorunthecommandagainst.
--vmfs
-m
PrintsmappingsforeachVMFSvolumetoitscorrespondingpartition,pathtothatpartition,
VMFSUUID,extentnumberandvolumenames.
vSphere Command-Line Interface Installation and Reference Guide
30 VMware, Inc.

Console Device: /vmfs/devices/genscsi/mpx.vmhba2:C0:T1:L0
Devfs Path: /vmfs/devices/genscsi/mpx.vmhba2:C0:T1:L0
Vendor: SONY Model: DVD RW AW-Q170A Revis: 1.70
SCSI Level: 5 Is Pseudo: Status:
Is RDM Capable: Is Removable:
Other Names:vml.000N000000NNNdNNNNNNNNaNNNaNN
vicfg-scsidevs.pl <conn_options> -c
Listsabbreviatedinformationaboutalllogicaldevicesonthissystem.
vicfg-scsidevs.pl <conn_options> -u
Listsalldeviceuniqueidentifierswiththeirprimaryname.
vicfg-scsidevs.pl <conn_options> -l -d mpx.vmhba32:C0:T1:L0
Listsdetailedinformationforaspecificlogicaldevice.
vicfg-scsidevs.pl <conn_options> -m
PrintsmappingsforVMFSvolumestothecorrespondingpartition,pathtothatpartition,VMFSUUID,extent
numberandvolumenames.
vicfg-scsidevs.pl <conn_options> -a
PrintsHBAdeviceswithidentifyinginformation.
vicfg-scsidevs.pl <conn_options> -A
PrintsamappingbetweenHBAsandthedevicestheyprovidepathsto.
Rescan Operations with vicfg-rescan
Youcanusevicfg-rescanorthevSphereClienttoperformarescan.Performarescanoperationeachtime
youreconfigureyourstoragesetup.SeetheESXConfigurationGuideandtheESXiConfigurationGuide.The
FibreChannelSANConfigurationGuidediscussesrescanonFibreChannelstorage.TheiSCSISANConfiguration
GuidediscussesrescanoniSCSIstorage.
WhenyourescananESX/ESXihost,thecommandreturnsonlyanindicationofsuccessorfailureandno
detailedinformation.
Options
Table 26liststhecommandspecificoptionsforvicfg-rescan.Youmustalsospecifyconnectionoptions.See
vSphereCLIConnectionOptionsonpage 17.
Example
Thefollowingexampleforvicfg-rescanrequiresconnectionoptions.SeeTable 12,vSphereCLI
ConnectionOptions,onpage 17.
vicfg-rescan.pl <conn_options> vmbha0
Scansvmhba0andresultsinoutputlikethefollowing:
Scan operation succeeded
Table 2-6. Options for vicfg-rescan
Option Description
<vmkernel_SCSI_adapter_name> Nameoftheadaptertoscan,forexample,vmhba0.
--vihost <host>
-h <host>
WhenyourunavSphereCLIcommandwiththe--serveroptionpointingtoa
vCenterServersystem,use--vihosttospecifytheESX/ESXihosttorunthe
commandagainst.
VMware, Inc. 31
Chapter 2 vSphere CLI Reference

Networking Commands
Table 27listsvSphereCLInetworkingcommands.ForanintroductiontovSpherenetworking,seethe
networkingchaptersintheESXConfigurationGuideandtheESXiConfigurationGuide.
DNS Configuration Specification with vicfg-dns
Thevicfg-dnscommandlistsandspecifiestheDNSconfigurationofyourESX/ESXihost.Callthecommand
withoutcommandspecificoptionstolisttheexistingDNSconfiguration.
IfyouattempttochangethehostordomainnameortheDNSserveronhoststhatuseDHCP(dynamichost
protocol),anerrorresults.
Options
Table 28liststhecommandspecificoptionsforvicfg-dns.Youmustalsospecifyconnectionoptions.See
vSphereCLIConnectionOptionsonpage 17.
Examples
Thefollowingexamplesforvicfg-dnsrequireconnectionoptions.SeeSpecifyingAuthentication
Informationonpage 13.
vicfg-dns.pl <conn_options> -n dns_host_name
Configuresthehostnameforthespecifiedserver.
Table 2-7. vSphere CLI Networking Commands
Command See
vicfg-dns DNSConfigurationSpecificationwithvicfgdnsonpage 31
vicfg-nics PhysicalNICManagementwithvicfgnicsonpage 32
vicfg-ntp NTPServerSpecificationwithvicfgntponpage 33
vicfg-route RouteEntryManipulationwithvicfgrouteonpage 34
vicfg-vmknic VMkernelNICsManagementwithvicfgvmkniconpage 35
vicfg-vswitch VirtualSwitchManagementwithvicfgvswitchonpage 36
esxcli swiscsi nic UsingesxcliswiscsinicforNICBindingonpage 90
Table 2-8. Options for vicfg-dns
Option Description
--dhcp yes|no
-H yes|no
SpecifieswhetherornottheESX/ESXihostshoulduseDHCPtodetermineDNS
configuration.Youmustspecifyyesorno.
--dns <server_list>
-D <server_list>
DNSserverorserverstobeused.SpecifyacommaseparatedlistofDNSservers,in
orderofpreference.
--domain <d_name>
-d <d_name>
DomainnameportionforthisESX/ESXihost.Forexample,comp-xyz.com.
--hostname <h_name>
-n <h_name>
HumanreadablehostnameportionoftheDNSname.Forexample,esx01.
--vihost
-h
WhenyourunavSphereCLIcommandwiththe--serveroptionpointingtoa
vCenterServersystem,use--vihosttospecifytheESX/ESXihosttorunthe
commandagainst.
--vnic <v_nic>
-V <v_nic>
ThevirtualnetworkadaptertousewhenoverridingthesystemDNS.
Thisoptionisrequiredwhen--dhcpisyes.ForESXhosts,v_nicmustbeoneof
theserviceconsolenetworkadapters.ForESXihosts,v_nicmustbeoneofthe
VMkernelnetworkadapter.
ThespecifiedvirtualnetworkadaptermusthaveDHCPconfigured.
vSphere Command-Line Interface Installation and Reference Guide
32 VMware, Inc.

vicfg-dns.pl <conn_options> -d mydomain.biz
Configuresthedomainnameforthespecifiedserver.
vicfg-dns.pl <conn_options> -H yes
SpecifiesthatthehostshoulduseDHCPtodeterminetheDNSconfiguration.
vicfg-dns.pl <conn_options>
DisplaysDNSpropertiesforthespecifiedserver.Theinformationincludesthehostname,domainname,
DHCPsetting(trueorfalse),andDNSserversontheESX/ESXihost.Forexample:
Host Name localhost
Domain Name localdomain
DHCP true
DNS Servers 10.NN.NNN.1
10.NN.NNN.2
Physical NIC Management with vicfg-nics
Thevicfg-nicscommandmanagesphysicalNICs(uplinkadapters),thatis,theEthernetswitchesusedby
anESX/ESXihost.
Youcanusevicfg-nicstolistinformationandtospecifyspeedandduplexsettingforaNIC.
Options
Table 29liststhecommandspecificoptionsforvicfg-nics.Youmustalsospecifyconnectionoptions.See
vSphereCLIConnectionOptionsonpage 17.
Examples
Thefollowingexamplesforvicfg-nicsrequireconnectionoptions.SeeSpecifyingAuthentication
Informationonpage 13.
vicfg-nics.pl <conn_options> -d full -s 100 vmnic0
Setstheduplexsettingofvmnic0tofullandthespeedto100.
vicfg-nics.pl <conn_options> -a vmknic2
Setsvmknic2toautonegotiateitsspeedandduplexsettings.
vicfg-nics.pl <conn_options> -l
ListstheNICsinthesystem,andprintstheircurrentandconfiguredspeedandduplexsetting.
Table 2-9. Options for vicfg-nics
Option Description
--auto
-a
Setsthespecifiednetworkadaptertoautonegotiateitsspeedandduplexsettings.
--duplex [full|half] <nic>
-d [full|half] <nic>
Setstheduplexvalueatwhichagivennetworkadaptershouldruntoeitherfull
(transmitdatainbothdirectionsatthesametime)orhalf(transmitdatainone
directionatatime).
--list
-l
ListsthenetworkadaptersVMkernelname,itsPCIID,driver,linkstate,speed,
duplexsetting,andashortPCIdescriptionofthecard.
--speed <speed> <nic>
-s <speed> <nic>
Setsthespeedatwhichagivennetworkadaptershouldrun.Validvaluesfor
<speed>are10,100,1000,or10000.
--vihost <host>
-h <host>
WhenyourunavSphereCLIcommandwiththe--serveroptionpointingtoa
vCenterServersystem,use--vihosttospecifytheESX/ESXihosttorunthe
commandagainst.
VMware, Inc. 33
Chapter 2 vSphere CLI Reference

Thesystemreturnsatablethatincludesthename,PCI,driver,linkspeed,duplexMTU,anddescription
information,forexample:

NTP Server Specification with vicfg-ntp


Thevicfg-ntpcommandsupportsspecifyingtheNTP(NetworkTimeProtocol)serverforanESX/ESXihost.
Someprotocols,suchasKerberos,musthaveaccurateinformationaboutthecurrenttime.
NTPsetuprequiresthesecallstovicfg-ntp.
1 Acalltovicfg-ntp--add toaddtheNTPserver.
2 Acalltovicfg-ntp --starttostarttheservice.
3 Acalltovicfg-ntp --listtolisttheservice.
Options
Table 210liststhecommandspecificoptionsforvicfg-ntp.Youmustalsospecifyconnectionoptions.See
vSphereCLIConnectionOptionsonpage 17.
Examples
Thefollowingexamplesforvicfg-ntprequireconnectionoptions.SeeSpecifyingAuthentication
Informationonpage 13.
vicfg-ntp.pl <conn_options> -l
DisplaysalistofNTPserversusedbythishost,orNo NTP Servers configured.
vicfg-ntp.pl <conn_options> --start
StartstheNTPserviceonthespecifiedhost.
vicfg-ntp.pl <conn_options> -a 192.XXX.XXX.XX
Addsthehostspecifiedby192.XXX.XXX.XXasaremoteNTPserver.
Name PCI Driver Link Speed Duplex MTU Description
vmnic1 02:02.0 e1000 <driver> Up 1000Mbps Full 1500 <desc>
vmnic2 02:04.0 e1000 <driver> Down <desc>
vmnic0 00:02.0 e1000 <driver> Up 1000Mbps Full 1500 <desc>
Table 2-10. Option for vicfg-ntp
Option Description
--add <ntp_server>
-a <ntp_server>
AddstheNTPserverthatthehostnameorIPaddressspecifies.
--delete <ntp_server>
-d <ntp_server>
DeletestheNTPserverthatthehostnameorIPaddressspecifies.
--list
-l
DisplaysalistofallNTPserversusedbythishost.
--start
-r
StartstheNTPserviceonthehost.
--stop
-s
StopstheNTPserviceonthehost.
--vihost <host>
-h <host>
WhenyourunavSphereCLIcommandwiththe--serveroptionpointingtoavCenter
Serversystem,use--vihosttospecifytheESX/ESXihosttorunthecommandagainst.
vSphere Command-Line Interface Installation and Reference Guide
34 VMware, Inc.

Route Entry Manipulation with vicfg-route
Thevicfg-routecommandlistsorsetsthedefaultIPgateway.Changingthegatewaymightberequiredif
youmoveyourESX/ESXihosttoanewphysicallocation.Thevicfg-routecommandsupportsasubsetof
theLinuxroutecommandsoptions.
Ifyourunvicfg-routewithnooptions,thecommanddisplaysthedefaultgateway.Youcanuse--family
toprintthedefaultIPv4orthedefaultIPv6gateway.Bydefault,thecommanddisplaysthedefaultIPv4
gateway.
Options
Table 211liststhecommandspecificoptionsforvicfg-route.Youmustalsospecifyconnectionoptions.See
vSphereCLIConnectionOptionsonpage 17.
Examples
Thefollowingexamplesforvicfg-routerequireconnectionoptions.SeeSpecifyingAuthentication
Informationonpage 13.
vicfg-route.pl --server <server name> --username <user name> --password <password> <new_gateway>
SetstheIPstackoftheVMkerneldefaultgatewayentry,changingthedefaultgatewaytoadifferentgateway.
vicfg-route.pl <conn_options> -a 192.NNN.100.0/24 192.NNN.0.1
vicfg-route.pl <conn_options> -a 192.NNN.100.0 255.255.255.0 192.NNN.0.1
Addsarouteentryto192.NNN.100.0networkthrough192.NNN.0.1
vicfg-route.pl <conn_options> 192.NNN.0.1
vicfg-route.pl <conn_options> -a default 192.NNN.0.1
SetstheVMkerneldefaultgatewayto192.NNN.0.1
vicfg-route.pl <conn_options> -d 192.NNN.100.0/24 192.NNN.0.1
Deletesthe192.NNN.100.0routeentryfromtheVMkernel.
vicfg-route.pl <conn_options> -f V6 -a 2001:NN:NN:253::/64 2001:NN:NN:253::1
Addsarouteto2001:NN:NN:253::/64networkthrough2001:NN:NN:253::1
vicfg-route.pl <conn_options> -f V6 -a default 2001:NN:NN:253::1
SetstheVMkerneldefaultgatewayto2001:NN:NN:253::1.
vicfg-route.pl <conn_options> -f V6 -d 2001:NN:NN:253::/64 2001:NN:NN:253::1
Deletesa2001:NN:NN:253::routeentryfromtheVMkernel.
Table 2-11. Options for vicfg-route
Option Description
<gateway> TheIPaddressorthehostnameofthemachinethatshouldbesetasthegatewayforthe
VMkernelIPstack.
--add <route>
-a <route>
AddsarouteentrytotheVMkernel.
Use--add <route> defaulttoaddarouteentryandmakeitthedefault.
--delete <route>
-d <route>
DeletesarouteentryfromtheVMkernel.
--list
-l
Listsrouteinformation.
--family v4|v6
-f v4|v6
Addressfamily,eitherv4forIPv4orv6forIPv6.Defaultstov4.
--vihost <host>
-h <host>
WhenyourunavSphereCLIcommandwiththe--serveroptionpointingtoavCenterServer
system,use--vihosttospecifytheESX/ESXihosttorunthecommandagainst.
VMware, Inc. 35
Chapter 2 vSphere CLI Reference

VMkernel NICs Management with vicfg-vmknic
Thevicfg-vmkniccommandconfiguresVMkernelNICs(virtualnetworkadapters).
The<port_group>argumentusedwiththe--deleteand--enableoptionsspecifiestheportgroupthe
VMkernelNICisassociatedwith.
Usetheesxcli swisis niccommandtospecifyNICbindingsforVMkernelNICs.SeeUsingesxcliswiscsi
nicforNICBindingonpage 90.
Options
Table 212liststhecommandspecificoptionsforvicfg-vmknic.Youmustalsospecifyconnectionoptions.
SeevSphereCLIConnectionOptionsonpage 17.
Table 2-12. Options for vicfg-vmknic
Option Description
<port_group> Specifiestheportgroup.ThenameisthesameastheVMkernelNICname.
Requiredargument.
--add
-a
AddsaVMkernelNICtothesystem.YoumustspecifytheIPaddressusing
--ip,thenetmask,andtheportgroupname.Whenthecommand
completessuccessfully,thenewlyaddedVMkernelNICisenabled.
YoucannotspecifythedvsNameanddvportIdparameterswiththisoption.
--delete <port_group>
-d <port_group>
DeletestheVMkernelNIConthespecifiedportgroup.
--disable-vmotion <port_group>
-u <port_group>
DisablesVMotionfortheVMkernelNIConaspecifiedportgroup.
--dvs-name
-s
Specifiesthedistributedvirtualswitch(DVS)nametouseasaconnection
point.DVSisalsoknownasvNetworkDistributedSwitch(VDS).Requires
that--dvport-idisalsospecified.
--dvport-id
-v
SpecifiesthedistributedvirtualportIDoftheconnectionpoint.Requires
that--dvs-nameisalsospecified.
--enable-ipv6 true|false
-6 true|false
EnablesordisablesIPv6forthisVMkernelNICforthenextboot.
--enable-vmotion <port_group>
-E <port_group>
EnablesVMotionfortheVMkernelNIConaspecifiedportgroup.
Bydefault,VMotionisdisabledforaportgroup.Toperformmigrationwith
VMotionoverthenetwork,youhavetoenableVMotion.
--ip <ip_address> | DHCP
-i <ip_address> | DHCP
Optional.SetstheIPaddressforthisVMkernelNIC.TheIPaddresscan
haveoneofthefollowingformats:
<X.X.X.X>UsethespecifiedstaticIPv4address.
DHCPUseIPv4DHCP.
<X:X:X::/X>UsethespecifiedstaticIPv6address
DHCPV6EnabletheIPv6DHCPaddress
AUTOCONFEnabletheIPv6addressadvertisedbytherouter
IfyouspecifyDHCP,theVMkernelmustsupportDHCP.
--list
-l
Listsvirtualnetworkadaptersonthesystem.Thelistcontainsthenetwork
information,portgroup,MTU,andcurrentstateforeachvirtualnetwork
adapterinthesystem.
--mtu <mtu>
-m <mtu>
Maximumtransmissionunitfortheinterfacebeingcreated.
--netmask <netmask>
-n <netmask>
IPnetmask(X.X.X.X)tobeusedforthevirtualnetworkadapter.Whenyou
setanetmask,youmustspecifythe--ipoptioninthesamecommand.
--portgroup <group>
-P <group>
Specifiestheportgrouptouseasaconnectionpoint.
--tso
-t
DisablesTCPSegmentOffloading(TSO)fortheVMkernelNICbeing
created.
vSphere Command-Line Interface Installation and Reference Guide
36 VMware, Inc.

Examples
Thefollowingexamplesforvicfg-vmknicrequireconnectionoptions.SeeSpecifyingAuthentication
Informationonpage 13.
vicfg-vmknic <conn_options> -a --ip <IP address> -n <net mask> "VMkernel NIC Name"
AddsaVMkernelNICtothesystem.
vicfg-vmknic <conn_options> -d "VMkernel NIC Name"
DeletesaNIC.
vicfg-vmknic <conn_options> -d --dvs-name "dvs-001" --dvport-id 1
DeletesaNIC.
vicfg-vmknic <conn_options> -l
ListsalltheVMkernelNICs.
vicfg-vmknic <conn_options> --ip <IP address> -n <net mask> "VMkernel NIC Name"
ModifiesaNICsIPaddressandnetmask.
vicfg-vmknic <conn_options>--ip DHCP "VMkernel NIC Name"
SetstheNICtouseDHCP.
vicfg-vmknic <conn_options>--enable-ipv6 true
EnablesIPv6fornextboot.
vicfg-vmknic <conn_options>--enable-vmotion "portgroup name"
EnablesVMotionfortheVMkernelNIConaspecifiedportgroup.
vicfg-vmknic <conn_options> --disable-vmotion "portgroup name"
DisablesVMotionfortheVMkernelNIConaspecifiedportgroup.
Virtual Switch Management with vicfg-vswitch
Thevicfg-vswitchcommandaddsorremovesvirtualswitchesormodifiesvirtualswitchsettings.Avirtual
switchisanabstractednetworkdevice.Itcanroutetrafficinternallybetweenvirtualmachinesandlinkto
externalnetworks.TheESXConfigurationGuideandtheESXiConfigurationGuidediscussvirtualswitches,
distributedvirtualswitches(DVS/VDS),portgroups,andDVS/VDSportgroups.
Bydefault,eachESX/ESXihosthasasinglevirtualswitchcalledvSwitch0.
--unset-ip <ip_addr>
-U <ip_addr>
UnsetstheIPaddressforthisVMkernelNIC.Theaddresscanhaveoneof
thefollowingformats:
<X:X:X::/X>UsethespecifiedstaticIPv6address
DHCPV6EnableIPv6DHCPaddress
AUTOCONFEnabletheIPv6addressadvertisedbytherouter
--vihost <host>
-h <host>
WhenyourunavSphereCLIcommandwiththe--serveroptionpointing
toavCenterServersystem,use--vihosttospecifytheESX/ESXihostto
runthecommandagainst.
Table 2-12. Options for vicfg-vmknic (Continued)
Option Description
VMware, Inc. 37
Chapter 2 vSphere CLI Reference

Options
Table 213liststhecommandspecificoptionsforvicfg-vswitch.Youmustalsospecifyconnectionoptions.
SeevSphereCLIConnectionOptionsonpage 17.
Table 2-13. Options for vicfg-vswitch
Option Description
--add <vswitch_name>
-a<vswitch_name>
Addsthespecifiedvirtualswitchtothesystem.
--add-pg <portgroup> <vswitch_name>
-A <portgroup> <vswitch_name>
Addsaportgrouptothespecifiedvirtualswitch.
--add-dvp-uplink <adapter_name>
--dvp <DVPort_id> <dvswitch_name>
-P <adapter_name> -V <DVPort_id>
<dvswitch_name>
Addsanuplinkadapter(physicalnetworkadapter)toa
distributedvirtualport(DVP).
--add-pg-uplink <adapter_name>
--pg <port_group> <vswitch_name>
-M <adapter name>
-p <port_group> <vswitch_name>
Addsanuplinkadapter(physicalnetworkadapter)toaport
group.
Thiscommandfailssilentlyiftheuplinkadapterdoesnotexist.
--check <vswitch_name>
-c<vswitch_name>
Checkswhetheravirtualswitchexists.Prints1iftheswitch
existsandprints0otherwise.
Usethevirtualswitchname,e.g.vSwitch0orvSwitch1,to
specifythevirtualswitch.
--check-pg <port_group> <vswitch_name>
-C <port_group> <vswitch_name>
Checkswhetherthespecifiedportgroupexists.
--delete <vswitch_name>
-d <vswitch_name>
Deletesavirtualswitch.Runningthecommandwiththisoption
failsifanyportsonthevirtualswitcharestillinusebyVMkernel
networks,vswifs,orvirtualmachines.
--del-pg <port_group> <vswitch_name>
-D <port_group> <vswitch_name>
Deletesaportgroupfromthevirtualswitch.Runningthe
commandwiththisoptionfailsiftheportgroupisinuse,for
example,byavirtualmachineoraVMkernelnetwork.
--del-dvp-uplink <adapter>
--dvp <DVPort_id> <dvswitch_name>
-Q <adapter_name>
-V <DVPort id> <dvswitch name>
Deletesanuplinkadapter(physicalnetworkadapter)fromaport
onaDVS(distributedvirtualswitch),alsocalledvNetwork
DistributedSwitch(VDS).
--del-pg-uplink <portgroup>
-pg <port_group> <vswitch_name>
-N <adapter_name>
-p <port_group> <vswitch_name>
Deletesanuplinkadapterfromaportgroup.
--dvp
-V
Nameofadistributedvirtualport.
--link <pnic>
-L <pnic>
Addsanuplinkadapter(physicalNIC)toavirtualswitch.
Runningthecommandwiththisoptionattachesanewunused
physicalnetworkadaptertoavirtualswitch.
--list
-l
Listsallvirtualswitchesandtheirportgroups.
--mtu <vswitch_name>
-m <vswitch_name>
SetstheMTU(maximumtransmissionunit)ofthevirtualswitch.
ThisoptionaffectsallphysicalNICsassignedtothevirtual
switch.
--pg <port_group>
-p <port_group>
Providesthenameoftheportgroupforthe--vlanoption.
SpecifyALLtosetVLANIDsonallportgroupsofavirtual
switch.
--unlink <pnic>
-U <pnic>
RemovesaphysicalNICfromavirtualswitch.AphysicalNICis
aphysicalEthernetadaptertowhichthevirtualswitchis
connected.IfyouremovethelastNIC,youlosephysicalnetwork
connectivityforthatswitch.
vSphere Command-Line Interface Installation and Reference Guide
38 VMware, Inc.

Examples
Thefollowingexamplesforvicfg-vswitchrequireconnectionoptions.SeeSpecifyingAuthentication
Informationonpage 13.
vicfg-vswitch.pl <conn_options> --add vSwitch1
AddsvSwitch1asavirtualswitch.
vicfg-vswitch.pl <conn_options> --add-pg group1 vSwitch1
AddsaportgrouptovSwitch1.
vicfg-vswitch.pl <conn_options> -c vSwitch1
CheckswhethervSwitch1exists.Prints1iftheswitchexists,0iftheswitchdoesnotexist.
vicfg-vswitch.pl <conn_options> -m 9000 vSwitch1
SetstheMTUofthevirtualswitchvSwitch1to9000.
vicfg-vswitch -P vmnic1 -V 11 dvs-functional-Pos001
Addsanuplinkadapter(vmnic1)totheDVS11atthedvs-funtional-Pos001.
vicfg-vswitch.pl <conn_options> -l
Printsinformationaboutthevirtualswitch.SeeSampleOutputfromvicfgvswitchl.
Sample Output from vicfg-vswitch -l
Thefollowingoutputmightresultfromacalltovicfg-vswitch -l.
--vihost <host>
-h <host>
WhenyourunavSphereCLIcommandwiththe--server
optionpointingtoavCenterServersystem,use--vihostto
specifytheESX/ESXihosttorunthecommandagainst.
--vlan <port_group>
-v <port_group>
SetstheVLANIDforaspecificportgroupofavirtualswitch.
Settingtheoptionto0disablestheVLANforthisportgroup.
Ifyouspecifythisoption,youmustalsospecifythe--pgoption.
Switch Name Num Ports Used Ports MTU Uplinks
vSwitch0 64 4 1500 vmnic2,vmnic0
PortGroup Name VLAN ID Used Ports Uplinks
VM Network 0 0 vmnic0
VMkernel2 0 1 vmnic0
Management Network 0 1 vmnic0
Switch Name Num Ports Used Ports MTU Uplinks
vSwitch1 64 3 1500 vmnic1
PortGroup Name VLAN ID Used Ports Uplinks
bldg1 0 1 vmknic1
bldg2 0 0
Table 2-13. Options for vicfg-vswitch (Continued)
Option Description
VMware, Inc. 39
Chapter 2 vSphere CLI Reference

System Management Commands
vSphereCLIsystemmanagementcommandsperformsystemconfiguration.
Using resxtop for Performance Monitoring
TheresxtopvSphereCLIcommandallowsyoutoexaminehowESX/ESXisystemsuseresources.Youcanuse
thecommandininteractivemode(default)orinbatchmode.TheResourceManagementGuideexplainshowto
useresxtopandprovidesinformationaboutavailablecommandsanddisplaystatistics.
Configuration Information Backup with vicfg-cfgbackup
Thevicfg-cfgbackupcommandbacksupESXiconfigurationdataandrestoresthemlater.
BackupyourhostconfigurationbeforeyouchangetheconfigurationorupgradetheESXiimage.
TheUpgradeGuidediscussesbackingupandrestoringtheESXiconfiguration.
Options
Table 215liststhecommandspecificoptionsforvicfg-cfgbackup.Youmustalsospecifyconnection
options.SeevSphereCLIConnectionOptionsonpage 17.
Table 2-14. System Management Commands
Command See
resxtop UsingresxtopforPerformanceMonitoringonpage 39andtheResourceManagementGuide.
vicfg-cfgbackup ConfigurationInformationBackupwithvicfgcfgbackuponpage 39
vicfg-snmp SNMPManagementwithvicfgsnmponpage 40
vicfg-syslog SyslogServerSpecificationwithvicfgsyslogonpage 41
vihostupdate UpdateManagementwithvihostupdateonpage 42
IMPORTANTresxtopissupportedonlyonLinux.
IMPORTANTThiscommandisavailableonlyforESXihosts.ThecommandisnotavailableforESXhostsand
isnotavailablethroughavCenterServersystemconnection.
Table 2-15. Options for vicfg-cfgbackup
Option Description
--force
-f
Forcestherestorationoftheconfiguration.
--load <backupfile>
-l <backupfile>
Restoresconfigurationfrom<backupfile>ontothehost.
--quiet
-q
Doesnotpromptforuserconfirmation.
--reset
-r
Resetsthehost,thatis,restorestofactorysettings.
--save <backupfile>
-s <backupfile>
Backsupthehostconfigurationto<backupfile>.
Includethenumberofthebuildthatisrunningonthehostthatyouarebackingupinthe
backupfilename.IfyouarerunningthevSphereCLIfromvMA,thebackupfileissaved
locallyonvMA.LocalstorageforbackupfilesissafebecausevMAisstoredinthe
/vmfs/volumes/<datastore>directory,whichisseparatefromtheESXiimageand
configurationfiles.
vSphere Command-Line Interface Installation and Reference Guide
40 VMware, Inc.

Examples
Thefollowingexamplesforvicfg-cfgbackuprequireconnectionoptions.SeeSpecifyingAuthentication
Informationonpage 13.
vicfg-cfgbackup.pl <conn_options> -s C:\backup.txt
Backsupthehostconfiguration.
vicfg-cfgbackup.pl <conn_options> -r
Restoresthehosttofactorysettings.
vicfg-cfgbackup.pl <conn_options> -l C:\backup.txt
Restoresthehosttoaconfigurationyoupreviouslysavedtoafile.
vicfg-cfgbackup.pl <conn_options> -l C:\backup.txt -q
Restoresthehosttoaconfigurationyoupreviouslysavedtoafile,anddoesnotpromptforconfirmation.
SNMP Management with vicfg-snmp
SimpleNetworkManagementProtocol(SNMP)allowsmanagementprogramstomonitorandcontrol
networkeddevices.TheBasicSystemAdministrationmanualdiscussesusingSNMPinyourvSphere
environmentinsomedetail.
SettingupanSNMPagentforpollingandnotificationrequiresthatyoumakethefollowingcalls:
1 Acalltovicfg-snmp --communitiestospecifyatleastonecommunity.
2 Acalltovicfg-snmp --targetstoconfigureatrapdestination.
3 Acalltovicfg-snmp --enabletoenabletheSNMPservice.
SettingupanSNMPagentforpollingandnotificationrequiresthatyoumakethefollowingcalls:
1 Acalltovicfg-snmp --communitiestospecifyatleastonecommunity.
2 Acalltovicfg-snmp --enabletoenabletheSNMPservice.
Whenaddingorchangingthenotificationconfiguration,runvicfg-snmp --testtovalidatethe
configuration.
Options
Table 215liststhecommandspecificoptionsforvicfg-snmp.Youmustalsospecifyconnectionoptions.See
vSphereCLIConnectionOptionsonpage 17.
Table 2-16. vicfg-snmp Command Options
Option Description
--communities <comm1>[,...]
-c <comm1>[,...]
Specifiescommunities,separatedbycommas.Thesettingsspecifiedusingthis
optionoverwriteanyprevioussettings.
--disable
-D
StopstheSNMPservice.
--enable
-E
StartstheSNMPservice.
--port <port-number>
-p <port-number>
SetstheportusedbytheSNMPagent.ThedefaultisUDP161.Thisistheport
thattheSNMPserviceusestolistenonforpollingrequests,suchasGETrequests.
YoucanalsoconfiguretheportthattheSNMPagentsendsdatatoonthetarget
systemusingthe--targetsoption.ThatportisUDP162bydefault.
--reset
-r
Clearsallpreviouslyspecifiedcommunitiesandtargets.
--show
-s
DisplaysthecurrentSNMPconfiguration.
VMware, Inc. 41
Chapter 2 vSphere CLI Reference

Examples
Thefollowingexamplesforvicfg-snmprequireconnectionoptions.SeevSphereCLIConnectionOptions
onpage 17.
vicfg-snmp.pl <conn_options> -c public
Setsthecommunitytopublic.
vicfg-snmp.pl <conn_options> -c my_comm1,my_comm2
Setsmy_comm1andmy_comm2asthecommunities,overwritinganyexistingcommunities.
vicfg-snmp.pl <conn_options> -E
EnablestheSNMPservice.
vicfg-snmp.pl <conn_options> -p 163
SetstheSNMPagentporttoport163.
vicfg-snmp.pl <conn_options> -s
DisplaystheSNMPagentconfiguration.Returnsinformationlikethefollowing:
Current SNMP agent settings:
Enabled: 0
UDP port: 161
Communities:
Notification targets:
Thefollowingexampleshowshowthecommandsareruninsequence:
vicfg-snmp c public t example.com@162/private --enable
# next validate your config by doing these things:
vicfg-snmp test
walk v1 c public esx-host
Syslog Server Specification with vicfg-syslog
Thevicfg-syslogcommandspecifiesaremotesyslogserverforanESXihost.
YoucannotrunthiscommandagainstanESXhost.ForESXhosts,userseditthesyslogconfigurationfileto
customizethesyslogserver.TheBasicSystemAdministrationmanualdiscussessystemlogsinmoredetailand
explainshowtosetthemupusingthevSphereClient.
--targets <hostname[@port]>
</community>[,...]
-t <hostname[@port]>
</community>[,...]
Setsthedestinationfor(notifications)traps.Thesettingsspecifiedusingthisflag
overwriteanyprevioussettings.
--test
-T
SendsatestnotificationthatcanbeusedtovalidatetheSNMPconfiguration.
--vihost
-h
WhenyourunavSphereCLIcommandwiththe--serveroptionpointingtoa
vCenterServersystem,use--vihosttospecifytheESX/ESXihosttorunthe
commandagainst.
Table 2-16. vicfg-snmp Command Options (Continued)
Option Description
vSphere Command-Line Interface Installation and Reference Guide
42 VMware, Inc.

Options
Table 217liststhecommandspecificoptionsforvicfg-syslog.Youmustalsospecifyconnectionoptions.
SeevSphereCLIConnectionOptionsonpage 17.
Examples
Thefollowingexamplesforvicfg-syslogrequireconnectionoptions.SeeSpecifyingAuthentication
Informationonpage 13.
vicfg-syslog.pl <conn_options> -i
Displaysthesyslogserverconfiguration.
vicfg-syslog.pl <conn_options> -s mysyslogserver
Makesmysyslogserverthesyslogserverfortheserverspecifiedin<conn_options>.
vicfg-syslog.pl <conn_options> -p <port>
Setstheportnumberusedbythesyslogserver.
Update Management with vihostupdate
ThevihostupdatecommandappliessoftwareupdatestoESX/ESXiimagesandinstallsandupdates
ESX/ESXiextensionssuchasVMkernelmodules,drivers,andCIMproviders.
Thevihostupdatecommandworkswithbulletins.EachbulletinconsistsofoneormorevSpherebundlesand
addressesoneormoreissues.AbulletinisconsideredtobeincludedinanotherbulletinifeveryvSphere
bundleinthefirstbulletinmeetsoneofthesecriteria:
ThevSpherebundleisincludedinthesecondbulletin.
ThevSpherebundleisobsoletedbyanotherbundleinthesecondbulletin.
Towardstheendofarelease,bulletinsincludealargenumberofotherbulletins.
Bulletinsareavailableinbundlesandindepotswithassociatedmetadata.zipfiles.
Ifyouusebundles,allpatchesandcorrespondingmetadataareavailableasoneZIPfile.
Ifyouusedepots,themetadata.zipfilepointstometadata.Themetadatadescribesthelocationofthe
files.
Thecommandsupportsqueryingsoftwareinstalledonahost,listingsoftwareinapatch,scanningfor
bulletinsthatapplytoahost,andinstallingallorselectivebulletinsinthepatch.Youcanspecifyapatchby
usingabundleZIPfileorthemetadataZIPfileofadepot.Thedepotcanbeontheremoteserver,oryoucan
downloadabundleZIPfileandusealocaldepot.
vihostupdatesupportshttps://,http://,andftp://downloads.Youcanspecifytheprotocolsinthedownload
URLforthebundleormetadatafile.
Table 2-17. Options for vicfg-syslog
Option Description
--setport
-p
Setstheportforthesyslogserver.Canbeusedwith-s.
--setserver <sys_server>
-s <sys_server>
HostnameorIPaddressoftheremotesyslogserver.Canbeusedwith-p.
--show
-i
Displaystheremotesyslogserver,ifasyslogserverhasbeensetup.
IMPORTANTRunvihostupdateagainstESX/ESXi4.0hosts.Runvihostupdate35againstESX/ESXi3.5
hosts.SeePerformingMaintenanceonVMwareInfrastructure 3.5Systemswithvihostupdate35on
page 101.
YoucannotrunvihostupdateagainstvCenterServersystems.
VMware, Inc. 43
Chapter 2 vSphere CLI Reference

SeetheESXiUpgradeGuideforsomeadditionalinformation.FormoreinformationaboutInstalling,
Removing,andUpdating3rdPartyExtensionsinvSphere4.0,seetheInstallationGuide.Anexampleisinthe
Examplessection.
Options
Table 218liststhecommandspecificoptionsforvihostupdate.Youmustalsospecifyconnectionoptions.
SeevSphereCLIConnectionOptionsonpage 17.
Examples
Youcanusevihostupdatewithbundlesorwithdepots.Thefollowingexamplesrequireconnectionoptions.
SeeTable 12,vSphereCLIConnectionOptions,onpage 17.
YoucanupdateanESX/ESXihostusingbundlesbyrunningthefollowingcommandsinsequence:
1 FindoutwhichbulletinsareinstalledonyourESX/ESXihost.
vihostupdate.pl <conn_options> --query
2 Findoutwhichbulletinsareavailableinthebundle.
vihostupdate.pl <conn_options> --list --bundle http://<webserver>/rollup.zip
3 FindoutwhichbulletinsinthebundleareapplicabletoyourESX/ESXihost.
vihostupdate.pl <conn_options> --scan --bundle http://<webserver>/rollup.zip
IMPORTANTDonotspecifymorethanonebundleormetadataZIPfileatthecommandlineeachtimeyou
runthecommand.Ifyouspecify-bor-mmorethanonce,thecommandonlyprocessesthelastfilethatis
specified.
Table 2-18. Options for vihostupdate
Option Description
--bulletin [<bulletin>]
-B [<bulletin>]
Bulletinstoinstall.Useacommaseparatedlist.Ifthisoptionisnotspecified,
vihostupdateinstallsallbulletins.
--bundle <location>
-b <location>
Locationoftheofflinebundle.Youcanspecifyeither-bor-mbutnotboth.
Youcanspecifythisparameteronlyonce.
--install
[<bundle>|<metadata>]
-i [<bundle>|<metadata>]
Installsselectivebulletinsfromthebundleorthedepotonthehost.Requires
either-bor-mbutnotboth.
--list [<bundle>|<metadata>]
-l [<bundle>|<metadata>]
Liststhebulletinsinthespecifiedbundleordepot.Requireseither-bor-m
butnotboth.
--metadata
-m
Parametertospecifythelocationofthedepotmetadata.zipfile.Youcan
specifyeither-bor-mbutnotboth.Youcanspecifythisparameteronlyonce.
--query
-q
Displaysallbulletinsthatarealreadyinstalledonthehost.
--remove
-r
Removesthespecifiedbulletinfromthehost.
UsethisoptionforremovingbulletinsthatarethirdpartyorVMware
extensions.
DonotremovebulletinsthatareVMwarepatchesorupdates.
--scan [<bundle>|<metadata>]
-s [<bundle>|<metadata>]
Scansthehostforthebundleorthedepotforapplicablebulletins.Requires
either-bor-mbutnotboth.
vSphere Command-Line Interface Installation and Reference Guide
44 VMware, Inc.

4 InstallallorsomebulletinsfromthebundleontheESX/ESXihost.
vihostupdate.pl <conn_options> --install --bundle http://<webserver>/rollup.zip
TheESX/ESXihostisupdatedtothespecifiedpatchlevel.
5 Ifnecessary,youcanremoveindividualbulletins.
UsethisoptiononlyforremovingbulletinsthatarethirdpartyorVMwareextensions.Donotremove
bulletinsthatareVMwarepatchesorupdates.
vihostupdate.pl <conn_options> --remove --bulletin bulletin1
YoucanupdateyourESX/ESXihostusingdepotsbyrunningthefollowingcommandsinsequence:
1 Listallbulletinsinthedepotgiventhemetadata.zipfilelocation.
vihostupdate.pl --list --metadata http://<webserver>/depot/metadata.zip
2 Scanthedepotforbulletinsthatareapplicabletothehost.
vihostupdate.pl --scan --metadata http://<webserver>/depot/metadata.zip
3 Installbulletinsinthedepotonthehost:
Toinstallallbulletins,call:
vihostupdate.pl --install --metadata http://<webserver>/depot/metadata.zip
Toinstallselectedbulletinsinthespecifieddepotonthehost,useacommaseparatedlist.Spacesafterthe
commentarenotsupported.
vihostupdate.pl --install --metadata http://<webserver>/depot/metadata.zip
--bulletin bulletin1,bulletin3
Youcandeployathirdpartybundlethatyouhavedownloadedonyourwebserver,forexample:
vihostupdate.pl <conn_options> --install --bundle https://<3rdParty_webserver>/Cisco_Swordfish.zip
Virtual Machine Management Commands
AnumberofvSphereCLIcommandsperformvirtualmachinemanagement.
Virtual Machine Migration with svmotion
Thesvmotioncommandmovesavirtualmachinesconfigurationfile,and,optionally,itsdisks,whilethe
virtualmachineisrunning.BasicSystemAdministrationdiscusseshowtousestoragevMotion.Youcanuse
svmotiontoinitiatemigrationsforvirtualmachinesrunningoneitherESXorESXihosts.
The--vmoptionspecifiesthevirtualmachineanditsdestination.Bydefault,allvirtualdisksarerelocatedto
thesamedatastoreasthevirtualmachine.The--disksoptionrelocatesindividualvirtualdiskstodifferent
datastores.
Youcannotrelocateavirtualdiskwithoutrelocatingthevirtualmachineconfigurationfile.
Table 2-19. Virtual Machine Management Commands
Command See
svmotion VirtualMachineMigrationwithsvmotiononpage 44.
vmware-cmd Chapter 5,VirtualMachineManagementwithvmwarecmd,onpage 79.
IMPORTANTWhenyourunsvmotion,--servermustpointtoavCenterServersystem.
VMware, Inc. 45
Chapter 2 vSphere CLI Reference

Thesvmotioncommandsupportsbothinteractiveornoninteractivemode.
Tousethecommandininteractivemode,typesvmotion --interactive.Thecommandpromptsyou
fortheinformationnecessarytocompletethestoragemigration.Whenyourunthecommandin
interactivemode,allotheroptionsareignored.
Innoninteractivemode,thesvmotioncommandusesthefollowingsyntax:
svmotion [standard vSphere CLI options] --datacenter=<datacenter_name>
--vm <VM config datastore path>:<new datastore>
[--disks <virtual disk datastore path>:<new datastore>,
<virtual disk datastore path>:<new datastore>]
Squarebracketsindicateoptionalelements.
Options
Table 220liststhecommandspecificoptionsforsvmotion.Youmustalsospecifyconnectionoptions.See
vSphereCLIConnectionOptionsonpage 17.Withsvmotion,the--serveroptionmustpointtoavCenter
Serversystem.
Youmustspecifythedatastorepathtothevirtualmachineconfigurationfileinthe<VM config datastore
path>argument.
To determine the path to the virtual machine configuration file
1 InthevSphereClientinventory,selectthevirtualmachineandclicktheSummarytab.
2 ClickEditSettingstodisplaytheVirtualMachinePropertiesdialogbox.
3 ClicktheOptionstab,andselectGeneralOptions.
TheVirtualMachineConfigurationFiletextboxdisplaysthepathtothevirtualmachineconfiguration
file.
Youmustspecifythevirtualdiskdatastorepathinthe<virtual disk datastore path>option.
IMPORTANTOnWindows,usequotesaroundspecialcharacters.
Table 2-20. Options for svmotion
Option Description
--datacenter
<datacenter_name>
Datacenterthatcontainsthevirtualmachinetobemigrated.Surroundthename
inquotesifitcontainswhitespacesorspecialcharacters.
disks
<virtual_disk_datastore_path>
:<new_datastore>...
Locationsofindividualdisks.Theformatisdatastorepathofthedisk,colon,
nameofthedestinationdatastore.Ifthepathcontainsspacesorspecial
characters,youmustquoteit.
Youcanspecifymultipledatastoreanddestinationpairs,separatedbycommas.
Ifyoudonotspecifythisoption,allvirtualdisksassociatedwithavirtual
machinearerelocatedtothesamedatastoreasthevirtualmachineconfiguration
file.Specifythisoptiontolocateindividualvirtualdiskstodifferentdatastores.
Tokeepavirtualdiskonitscurrentdatastore,usethe--disksoptionforthat
disk,withitscurrentdatastoreasthe<new datastore>.
SeeTodeterminethepathtoavirtualdiskfileonpage 46.
--interactive Startsinteractivemode,wheresvmotionpromptsyouforallarguments.In
interactivemode,svmotiondoesasanitytestoneachoption.
--vm
<VM_config_ds_path>:<new_ds>
Specifieswhichvirtualmachinetomoveandtowhichdatastore.
<VM config datastore path>isthepathtothevirtualmachineconfiguration
file.Ifthepathcontainsspacesorotherspecialcharacters,youmustquoteit.See
Todeterminethepathtothevirtualmachineconfigurationfileonpage 45.
<new datastore>isthenameofthenewdatastoreforthevirtualmachine
configurationfileordisk.
vSphere Command-Line Interface Installation and Reference Guide
46 VMware, Inc.

To determine the path to a virtual disk file
1 InthevSphereClientinventory,selectthevirtualmachinetowhichthevirtualdiskbelongs,andclickthe
Summarytab.
2 ClickEditSettingstodisplaytheVirtualMachinePropertiesdialogbox.
3 ClicktheHardwaretabandselectthevirtualdiskfromthelistofdevices.
TheDiskFiletextboxdisplaysthepathtothevirtualdiskfile.
Examples
Thefollowingexamplesforsvmotionrequireconnectionoptions.SeeTable 12,vSphereCLIConnection
Options,onpage 17.Linebreaksintheexamplesareincludedforlegibilityonly.Squarebracketsinthe
examplesindicateadatastore,notanoptionalelement.
svmotion.pl <conn_options> --interactive
Startstheinteractiveversionofthesvmotioncommand.
svmotion.pl
--url=https://myvc.mycorp.com/sdk --datacenter=DC1
--vm=[old_datastore] myvm/myvm.vmx:new_datastore
Relocatesavirtualmachinesstorage(includingdisks)tonew_datastore.
svmotion.pl
<conn_options>
--datacenter=My DC
--vm=[old_datastore] myvm/myvm.vmx:new_datastore
--disks=[old_datastore] myvm/myvm_1.vmdk:old_datastore, [old_datastore] myvm/myvm_2.vmdk:
old_datastore
Relocatesavirtualmachinesconfigurationfiletonew_datastore,butleavethetwodisks(myvm_1.vmdkand
myvm_2.vmdk)inold_datastore.TheexampleisforWindows.ForLinux,usesinglequotesinsteadof
doublequotes.
svmotion.pl <conn_options>
--datacenter RcliTstDc
--vm="[storage1] testvm/testvm.vmx:storage2
Migratesthevirtualmachinetestvmfromstorage1tostorage2.
Miscellaneous Management Commands
ThevSphereCLIincludescommandsforusermanagementandVMkernelmodulemanipulation,aswellas
thevicfg-advcfgcommand.vicfg-advcfgcanenableordisableCIMproviders,andmightbeusedinsome
othersituations.
Advanced Management with vicfg-advcfg
Thevicfg-advcfgcommandoffersanumberoflowleveladvancedoptions.Mostoptionsarenotintended
forcustomeruse.YoumightusethiscommandwhenVMwareTechnicalSupportoraVMwareKnowledge
Basearticleinstructyoutodoso.
Youcanusethevicfg-advcfg-soptiontoenableanddisableCIMproviders.
Table 2-21. Miscellaneous Management Commands
Command See
vicfg-advcfg AdvancedManagementwithvicfgadvcfgonpage 46
vicfg-module VMkernelModuleManipulationwithvicfgmoduleonpage 47
vicfg-user UserandGroupManagementwithvicfguseronpage 48
VMware, Inc. 47
Chapter 2 vSphere CLI Reference

Options
YoucanenableordisableCIMprovidersusingthefollowingoptionandvaluecombinations:
Examples
vicfg-advcfg.pl <conn_options> -s 1 UserVars.CIMEnabled
EnablesallCIMproviders.
vicfg-advcfg.pl <conn_options> -s 1 UserVars.CIMOEMProvidersEnabled
EnablesOEMCIMproviders.
vicfg-advcfg.pl <conn_options> -s 0 UserVars.CIMCustomProvidersEnabled
DisablesIHVCIMproviders.
VMkernel Module Manipulation with vicfg-module
Thevicfg-modulecommandsupportssettingandretrievingVMkernelmoduleoptions.Thiscommandisa
vSphereCLIimplementationoftheesxcfg-moduleserviceconsolecommandbutsupportsonlysomeofthe
optionsesxcfg-modulesupports.ThecommandiscommonlyusedwhenVMwareTechnicalSupport,a
KnowledgeBasearticle,orVMwaredocumentationinstructyoutodoso.
Options
Table 223liststhecommandspecificoptionsforvicfg-module.Youmustalsospecifyconnectionoptions.
SeevSphereCLIConnectionOptionsonpage 17.
Examples
ThefollowingexamplesillustrateNetQueueconfiguration.TheESXConfigurationGuideandtheESXi
ConfigurationGuideexplainNetQueueconfigurationinmoredetail.Thefollowingexamplesrequire
connectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vicfg-module.pl <conn_options> -s intr_type_2 rx_ring_num=8 s2io
ConfiguresasupportedNICtouseNetQueue.
vicfg-module.pl <conn_options> -g s2io
VerifiesthattheNetQueuemodulehasbeenconfigured.
Table 2-22. vicfg-advcfg Options for enabling CIM providers
Option Description
-s 0|1 UserVars.CIMEnabled EnablesordisablesallCIMproviders.
s 0|1 UserVars.CIMOEMProvidersEnabled EnablesordisablesOEMCIMproviders.
-s 0|1 UserVars.CIMCustomProvidersEnabled EnablesordisablesIHVCIMproviders.
Table 2-23. Options for vicfg-module
Option Description
--get-options <module_name>
-g <module_name>
Returnstheoptionstringconfiguredtobepassedtothemodulewhen
themoduleisloaded.Thisstringisnotnecessarilytheoptionstring
currentlyinusebythemodule.
--list
-l
Liststhesetofmodulesonthehost.
--set-options <options> <module_name>
-s <options> <module_name>
Specifiestheoptionstringtobepassedtothemodulewhenthe
moduleisloaded.
--vihost <host>
-h <host>
WhenyourunavSphereCLIcommandwiththe--serveroption
pointingtoavCenterServersystem,use--vihosttospecifythe
ESX/ESXihosttorunthecommandagainst.
vSphere Command-Line Interface Installation and Reference Guide
48 VMware, Inc.

User and Group Management with vicfg-user
AnESX/ESXisystemgrantsaccesstoitsresourceswhenaknownuserwithappropriatepermissionslogson
tothesystemwithapasswordthatmatchestheonestoredforthatuser.Thevicfg-usercommandsupports
creating,modifying,deleting,andlistinglocaldirectaccessusersandgroupsofusersonanESX/ESXihost.
YoucannotrunthiscommandagainstavCenterServersystem.
UsermanagementisdiscussedindetailintheESXConfigurationGuide,theESXiConfigurationGuide,andthe
BasicSystemAdministrationdocument.
ThesyntaxofthiscommanddiffersfromthesyntaxofothervSphereCLIcommands.Youspecifyoperations
asfollows:
vicfg-user <conn_options> -e <user | group> -o <add | modify | delete | list>
Options
Table 224liststhecommandspecificoptionsforvicfg-user.Youmustalsospecifyconnectionoptions.See
vSphereCLIConnectionOptionsonpage 17.
IMPORTANTIfyoucreateauserwithoutspecifyingtherole(--role),theuserhasnopermissions.
Table 2-24. Options for vicfg-user
Option Description
--addgroup <group_list>
-g <group_list>
Addstheusertoacommaseparatedlistofgroups.
--adduser <user_list>
-u <user_list>
Addsthespecifieduserstoaspecifiedgroup.Takesa
commaseparatedlistofusers.
--entity <group|user>
-e <group|user>
Entitytoperformtheoperationon.Specifyeitheruseror
group.
--group <name>
-d <name>
Groupnameofthegroup.
--groupid <group_id>
-D <group_id>
GroupIDofthegroup.
--login <login_id>
-l <login_id>
LoginIDoftheuser.
--newpassword <p_wd>
-p <p_wd>
Passwordforthetargetuser.
--newuserid <UUID>
-i <UUID>
NewUUIDforthetargetuser.
--newusername <name>
-n <name>
Newusernameforthetargetuser.
--operation
-o
Operationtoperform.Specifyadd,modify,delete,orlist.
--removegroup <group_list>
-G <group_list>
Commaseparatedlistofgroupstoremovethetargetuser
from.
--removeuser <user_list>
-U <user_list>
Commaseparatedlistofuserstoberemovedfromthetarget
group.
VMware, Inc. 49
Chapter 2 vSphere CLI Reference

Examples
Thefollowingexamplesforvicfg-userrequireconnectionoptions.SeeSpecifyingAuthentication
Informationonpage 13.
vicfg-user.pl <conn_options> -e user -o add -l user27 -p 27_password
AddstheuserwithloginIDuser27.
vicfg-user.pl <conn_options> -e user -o modify -l user27 -p 27_password -i <new user id>
-n <new user name>
Modifiesthepassword,userID,andusernamefortheuserwithloginIDuser27.
vicfg-user.pl <conn_options> -e user -o modify -l user27 -g test
AddstheuserwithloginIDuser27toagrouptest.
vicfg-user.pl <conn_options> -e user -o delete -l user27
RemovestheuserwithloginIDuser27.
vicfg-user.pl <conn_options> -e group -o add -d group42 -D <group id>
Addsgroup42asagroup.
vicfg-user.pl <conn_options> -e group -o modify -d group42 -u test
Addsausertesttothegroupgroup42.
vicfg-user.pl <conn_options> -e group -o delete -d group42
Removesthegroupgroup42.
vicfg-user.pl <conn_options> --entity group --operation add --group group42 --groupid 501
--role read-only
Addsgroupgroup42,withgroupID501androleread-only.
Volume Management with vicfg-volume
Thevicfg-volumecommandsupportsresignaturingasnapshotvolumeandmountingandunmountingthe
volume.Youcanalsomakethemountedvolumepersistentacrossrebootsandqueryalistofsnapshot
volumesandoriginalvolumes.
TheESXConfigurationGuideandtheESXiConfigurationGuidediscussvolumeresignaturingindetail.
--role <administrator|read-only|no-access>
-r <administrator|read-only|no-access>
Roleforthetargetuserorgroup.Specifyoneof
administrator,read-only,orno-access.
Ifyoucreateauserwithoutassigningpermissions,theuserhas
nopermissions.
--shell
-s
Grantshellaccesstothetargetuser.Defaultisnoshellaccess.
Usethiscommandtochangethedefault,ortorevokeshell
accessrightsaftertheyhavebeengranted.
Validvaluesareyesandno.
ThisoptionissupportedonlyagainstESX.Theoptionisnot
supportedagainstESXi.
Table 2-24. Options for vicfg-user (Continued)
Option Description
vSphere Command-Line Interface Installation and Reference Guide
50 VMware, Inc.

Options
Table 225listscommandspecificoptionsforvicfg-volume.Youmustalsospecifyconnectionoptions.See
vSphereCLIConnectionOptionsonpage 17.
Examples
vicfg-volume.pl <conn_options> -l
Listsallvolumesthathavebeendetectedassnapshotsorreplicas.
vicfg-volume.pl -M my_sample_vol
Mountsasnapshot/replicavolumepersistently.
vicfg-volume.pl -r my_sample_vol
Resignaturesasnapshot/replicavolume.
vicfg-volume.pl -u 48c826a3-12815d67-0ac6-0030485cd343
Unmountsasnapshot/replicavolume.
File System Manipulation with vifs
Thevifscommandperformscommonoperationssuchascopy,remove,get,andputonfilesanddirectories.
ThecommandissupportedagainstESX/ESXihostsbutnotagainstvCenterServersystems.
Insteadofusingthiscommand,youcanbrowsedatastorecontentsandhostfilesusingaWebbrowser.
Connecttothefollowinglocation:
http://ESX_host_IP_Address/host
http://ESX_host_IP_Address/folder
YoucanviewdatacenteranddatastoredirectoriesfromthisrootURL.
Filesanddirectoriescanbeclassifiedintothreegroups.Thevifscommandsupportsallthreegroups,but
differentoperationsareavailableforeachgroup.
Table 2-25. Options for vicfg-volume
Option Description
--list
-l
Listsallvolumesthathavebeendetectedassnapshotsorreplicas.
--persistent-mount <VMFS-UUID|label>
-M <VMFS-UUID|label>
Mountsasnapshot/replicavolumepersistentlyifitsoriginalcopyis
notonline.
--resignature <VMFS-UUID|label>
-r <VMFS-UUID|label>
Resignaturesasnapshot/replicavolume.
--umount <VMFS-UUID|label>
-u <VMFS-UUID|label>
Unmountsasnapshot/replicavolume.
--vihost <host>
-h <host
WhenyourunavSphereCLIcommandwiththe--serveroption
pointingtoavCenterServersystem,use--vihosttospecifythe
ESX/ESXihosttorunthecommandagainst.
IMPORTANTWhiletherearesomesimilaritiesbetweenvifsandDOSorUnixfilesystemmanagement
utilities,therearealsomanydifferences.Forexample,vifsdoesnotsupportwildcardcharactersorcurrent
directoriesand,asaresult,relativepathnames.Usevifsonlyasdocumented.
Group Description
Host Hostconfigurationfiles.Youmustspecifythefilesuniquenameidentifier.
Youspecifyhostlocationsusingthehost/<path>syntax.
VMware, Inc. 51
Chapter 2 vSphere CLI Reference

Enclosethepathinquotesforbothoperatingsystemstoavoidproblemswithdirectorynamesthatusespecial
charactersorspaces.
Whenyourunvifs,youcanspecifytheoperationnameandargumentandalsooneofthestandard
connectionoptionsdiscussedinTable 12.Usealiases,symboliclinks,orwrapperscriptstosimplifythe
invocationsyntax.
Options
Table 226liststhecommandspecificoptionsforvifs.Allvifsoptionsworkondatastorefilesordirectories.
Someoptionsalsoworkonhostfilesandfilesinthetempdirectory.Youmustalsospecifyconnectionoptions.
SeevSphereCLIConnectionOptionsonpage 17.
Temp The/tmpdirectoryandfilesinsidethatdirectory.
Youspecifytemplocationsusingthetmp/dir/subdirsyntax.
Datastores Datastorefilesanddirectories.Youhavetwochoicesforspecifyingadatastore:
Datastoreprefixstyle:[ds_name] relative_path.Forexample:
[myStorage1] testvms/VM1/VM1.vmx(Linux)or[myStorage1] testvms\VM1\VM1.vmx
(Windows)
URLstyle:/folder/dir/subdir/file?dsName=<name>.Forexample:
/folder/testvms/VM1/VM1.vmx?dsName=myStorage1(Linux)or
/folder/testvms/VM1/VM1.vmx?dsName=myStorage1(Windows)
ThetwoexamplepathsrefertothesamevirtualmachineconfigurationfileforthevirtualmachineVM1
insidethetestvms/VM1directoryofthemyStorage1datastore.
IMPORTANTTheconceptsofworkingdirectoryandlastdirectoryorfileoperatedonarenotsupportedby
vifs.
Table 2-26. Options for vifs
Command Description For... Syntax
--copy
-c <source>
<target>
Copiesafileinadatastoretoanotherlocation
inadatastore.The<source>mustbearemote
sourcepath,the<target>aremotetarget
pathordirectory.
The--forceoptionreplacesexisting
destinationfiles.
Datastore
Temp
copy src_file_path
dst_directory_path
[force]
copy src_file_path
dst_file_path [force]
--dir
-D <remote_dir>
Liststhecontentsofadatastoredirectory. Datastore
Temp
dir
datastore_directory_path
--force
-F
Overwritesthedestinationfile.Usedwith
--moveand--copy.
Datastore
Temp
copy src_file_path
dst_file_path [force]
--get
-g <remote_path>
<local_path>
DownloadsafilefromtheESX/ESXihostto
themachineonwhichyourunthevSphere
CLI.ThisoperationusesHTTP GET.
Datastore
Host
get src_dstore_file_path
dst_local_file_path
get src_d store_dir_path
dst_local_file_path
--listdc
-C
Liststhedatacenterpathsavailableonan
ESX/ESXisystem.
Datastore
Host
--listds
-S
ListsthedatastorenamesontheESX/ESXi
system.Whenmultipledatacentersare
available,youcanusethe--dc (-Z)
argumenttospecifythenameofthe
datacenterfromwhichyouwanttolistthe
datastore.
Datastore
Host
vifs --listds
--mkdir
-M <remote_dir>
Createsadirectoryinadatastore.This
operationfailsiftheparentdirectoryof
dst_datastore_file_pathdoesnotexist.
Datastore
Temp
mkdir dst_directory_path
Group Description
vSphere Command-Line Interface Installation and Reference Guide
52 VMware, Inc.

Examples
RunningvifsworksonlywhenyouareconnecteddirectlytoanESX/ESXihost.Thecommanddoesnotwork
whenyouconnecttoavCenterServersystemandattempttoconnecttotheESX/ESXihostthroughthevCenter
Serversystem.OnLinux,usesinglequotesfordirectorynames.OnWindows,usedoublequotes.
vifsexamplesrequireconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vifs.pl <conn_options> --copy '[myvmfs] dir_1/my_text' '[myvmfs] dir_3/my_text'
Copiesthemy_textfilefromdir_1todir_3.
vifs.pl <conn_options> --dir '[myvmfs] dir_3'
Liststhecontentsofdirectorydir_3.
vifs.pl <conn_options> --copy '[myvmfs] dir_1/my_text' '[myvmfs] dir_3/my_text' --force
Copiesthemy_textfileintodir_3.Ifyouusethiscommand,andafilenamedmy_textalreadyexistsin
dir_3,thecommandoverwritestheexistingfilebecauseofthe--forceoption.
vifs.pl <conn_options> --mkdir '[myvmfs] new_dir'
Createsthedirectorycallednew_dir.
vifs.pl <conn_options> --put /root/test_put '[myvmfs] new_dir/test_put'
Placesacopyofthelocaltest_putfileintothenew_dirdirectoryofthespecifiedESX/ESXihost.
vifs.pl <conn_options> --rm '[myvmfs] new_dir/test_put'
Removesthetest_putfilefromthenew_dirfolder.
vifs.pl <conn_options> --rmdir '[myvmfs] new_dir'
Removesthenew_dirfolder.
vifs.pl <conn_options> --get '[myvmfs] dir_1/my_text' /root/my_text
Retrievesthefilemy_textfromtheESX/ESXihostandplacesitinthelocalmachinesrootfolder.
vifs.pl <conn_options> --move '[myvmfs] dir_1/my_text' '[myvmfs] dir_3/my_text'
Movesthemy_textfilefromdir_1todir_3.
vifs.pl <conn_options> --listds
Liststhenamesofalldatastoresontheserverspecifiedintheconfigurationfile.Youcanuseeachnamethat
hasbeenreturnedtorefertodatastorepathsusingsquarebracketnotation,asfollows:
[my_datastore] dir/subdir/file
--move
-m <source>
<target>
Movesafileinadatastoretoanotherlocation
inadatastore.The<source>mustbearemote
sourcepath,the<target>aremotetarget
pathordirectory.
The--forceoptionreplacesexisting
destinationfiles.
Datastore
Temp
move src_file_path
dst_directory_path
[force]
move src_file_path
dst_file_path [force]
--put
-p <local_path>
<remote_path>
Uploadsafilefromthemachineonwhichyou
runthevSphereCLItotheESX/ESXihost.
ThisoperationusesHTTP PUT.
Thiscommandcanreplaceexistinghostfiles
butcannotcreatenewfiles.
Datastore
Host
Temp
put src_local_file_path
dst_file_path
put src_local_file_path
dst_directory_path
--rm
-r <remote_path>
Deletesadatastorefile. Datastore
Temp
rm dst_file_path
--rmdir
-R <remote_dir>
Deletesadatastoredirectory.Thisoperation
failsifthedirectoryisnotempty.
Datastore
Temp
rmdir dst_directory_path
Table 2-26. Options for vifs (Continued)
Command Description For... Syntax
VMware, Inc. 53

3
YouusethevmkfstoolsvSphereCLItocreateandmanipulatevirtualdisks,filesystems,logicalvolumes,and
physicalstoragedevicesonanESX/ESXihost.Youcanusevmkfstoolstocreateandmanageavirtual
machinefilesystem(VMFS)onaphysicalpartitionofadiskandtomanipulatefiles,suchasvirtualdisks,
storedonVMFS3andNFS.
YoucanrunthevmkfstoolsvSphereCLIasyouwouldothervSphereCLIcommands.SpecifytheESX/ESXi
hosttorunthecommandagainstandspecifyadditionalconnectionoptionsasdiscussedinSpecifying
AuthenticationInformationonpage 13.
Inmostcases,youdonothavetologinastherootusertorunthevmkfstoolscommand.However,some
commands,suchasthefilesystemcommands,mightrequirerootuserlogin.
YoucanperformmostvmkfstoolsoperationsusingthevSphereClientinsteadofthecommandline.Seethe
ESXConfigurationGuideandtheESXiConfigurationGuide.
Thischapterincludesthefollowingtopics:
vmkfstoolsCommandSyntaxonpage 53
vmkfstoolsFileSystemOptionsonpage 55
vmkfstoolsVirtualDiskOptionsonpage 57
vmkfstools Command Syntax
Thevmkfstoolscommandsupportsspecifyingoneormorecommandlineoptions,associatedarguments,
andthetarget.
vmkfstools <conn_options> <options> <target>
Thelongandshort(singleletter)formsofoptionsareequivalent.Forexample:
vmkfstools --createfs vmfs3 --blocksize 2m naa.<naa_ID>:1
vmkfstools -C vmfs3 -b 2m naa.<naa_ID>:1
File System Management with
vmkfstools 3
IMPORTANTThevmkfstoolsvSphereCLIsupportsmostbutnotalltheoptionssupportedbythe
vmkfstoolsserviceconsolecommand.SeeVMwareKnowledgeBasearticle1008194.
Youcannotrunvmkfstoolswith--serverpointingtoavCenterServersystem.
Option Description See
<conn_options> Connectionparameters. vSphereCLIConnectionOptionsonpage 17.
<options> Oneormorecommandlineoptionsand
associatedvalues.
SupportedCommandSpecificOptionson
page 54.
<target> Partition,device,orpathtoapplythe
commandto.
SupportedTargetsonpage 55.
vSphere Command-Line Interface Installation and Reference Guide
54 VMware, Inc.

Supported Command-Specific Options
Table 31listsvmkfstoolsfilesystemoptions,abriefdescription,andapointertowheretheoptionis
discussed.
Table 32listsvmkfstoolsvirtualdiskoptions,abriefdescription,andapointertowhereeachoptionis
discussed.
Table 3-1. vmkfstools File System Option Overview
Option Description See
--blocksize
-b
Usesthespecifiedsizeforfilesystem
creation.Usedwith--createfs.
VMFSFileSystemCreationonpage 55.
--createfs
-C
CreatesaVMFSfilesystem. VMFSFileSystemCreationonpage 55.
--queryfs
-P
Listsattributesofafilesystem. AttributeListingforaVMFSVolumeon
page 56.
--setfsname
-S
Setsthelabelforthefilesystem.Used
with--createfs.
VMFSFileSystemCreationonpage 55.
--extendfs
-Z
ExtendstheVMFSfilesystem. FileSystemPartitionExtensionbySpanningon
page 57.
Table 3-2. vmkfstools Virtual Disk Option Overview
Option Description See
--adaptertype
-a
Usesthespecifiedtypefordisk
creation.Usedwith-cand-i.
CreatingVirtualDisksonpage 58.
--clonevirtualdisk
-i
Clonesthespecifiedvirtualdisk. CloningVirtualorRawDisksonpage 59.
--createrdm
-r
MapsarawdisktoafileonaVMFSfile
system.
CreatingVirtualCompatibilityModeRaw
DeviceMappingsonpage 61.
--createrdmpassthru
-z
Mapsapassthroughrawdisktoafile
onaVMFSfilesystem.
CreatingPhysicalCompatibilityModeRaw
DeviceMappingsonpage 61.
--createvirtualdisk
-c
Createsavirtualdisk. CreatingVirtualDisksonpage 58.
--deletevirtualdisk
-U
Deletesthespecifiedvirtualdisk. DeletingVirtualDisksonpage 59.
--diskformat
-d
Usesthespecifiedformatfordisk
creation.Usedwith-cand-i.
SupportedDiskFormatsonpage 57.
--extendvirtualdisk
-X
Extendsthespecifiedvirtualdisk. ExtendingVirtualDisksonpage 60.
--geometry
-g
Displaysvirtualdiskgeometry. DisplayingVirtualDiskGeometryonpage 62.
--inflatedisk
-j
Convertsathinvirtualdiskto
eagerzeroedthickformat,preserving
allexistingdata.
InflatingThinVirtualDisksonpage 59.
--queryrdm
-q
Liststheattributesofarawdisk
mapping.
ListingRDMAttributesonpage 61.
--renamevirtualdisk
-E
Renamesthespecifiedvirtualdisk. RenamingVirtualDiskonpage 59.
--writezeros
-w
Cleansthevirtualdiskbywritingzeros
overallitsdata.
InitializingVirtualDisksonpage 58.
VMware, Inc. 55
Chapter 3 File System Management with vmkfstools

Supported Targets
Youcanspecifythetargetoftheoperationspecifiedin<options>asafilesystem,partition,orvirtualdisk.You
canusearelativeorabsolutepathnameinthe/vmfshierarchy.
File System Target
SpecifyaVMFSfilesystemorfileusinganabsoluteorrelativepaththatnamesadirectorysymboliclink,raw
devicemapping,orafileunder/vmfs.
SeevmkfstoolsFileSystemOptionsonpage 55.
Disk Partition Target
Specifyadiskpartitionusingnaa.<naa_ID>:Pwherenaa.<naa_ID>isthedeviceIDreturnedbythestorage
arrayandPisanintegerthatrepresentsthepartitionnumber.Thepartitiondigitmustbegreaterthanzero
andmustcorrespondtoavalidVMFSpartitionoftypefb.
SeevmkfstoolsVirtualDiskOptionsonpage 57.
Device Target
SpecifyadeviceorlogicalvolumeusingapathnameinanESX/ESXidevicefilesystem.Thenamebeginswith
/vmfs/devices,whichisthemountpointofthedevicefilesystem.Eachdevicetypehassubmounts,for
example:
/vmfs/devices/disksforlocalorSANbaseddisks.
/vmfs/devices/lvmforESX/ESXilogicalvolumes.
/vmfs/devices/genericforgenericSCSIdevices,suchastapedrives.
vmkfstools File System Options
Usingvmkfstoolsfilesystemcommands,youcancreate,query,andextendaVMFSfilesystem.Theoptions
donotapplytoNFSfilesystems.Youmustalsospecifyconnectionoptions.SeevSphereCLIConnection
Optionsonpage 17.
Thelongandshort(singleletter)formsofoptionsareequivalent.Forexample,thefollowingcommandsare
identical:
vmkfstools.pl <conn_options> --createfs vmfs3 --blocksize 2m naa.<naa_ID>:1
vmkfstools.pl <conn_options> -C vmfs3 -b 2m naa.<naa_ID>:1
YoucanperformmanyoffilesystemmanagementtasksthroughthevSphereClient.
VMFS File System Creation
The-CoptioncreatesaVMFSfilesystemonthespecifiedpartition,suchasnaa.<naa_ID>:1.Thepartition
becomesthefilesystemsheadpartition.YoucanhaveonlyoneVMFSvolumeforaLUN.
-C --createfs vmfs3
-b --blocksize <block_size>kK|mM
-S --setfsname <fsName>
VMFSfilesystem /vmfs/volumes/<file_system_UUID>
/vmfs/volumes/<file_system_label>
VMFSfile /vmfs/volumes/<file system label|file system UUID>/[dir]/myDisk.vmdk
Youmustuseanabsolutepathnamestartingwith/vmfs/volumes.For
example,/vmfs/volumes/datastore1/rh9.vmdk
IMPORTANTThispromptdoesnotaskforconfirmation.Checkcarefullybeforeyourunthecommandto
avoiderasingimportantdata.
vSphere Command-Line Interface Installation and Reference Guide
56 VMware, Inc.

VMFS2filesystemsarereadonlyonanyESX/ESXihost.YoucannotcreateormodifyVMFS2filesystems
butyoucanreadfilesstoredonVMFS2filesystems.
Table 33liststhesuboptionsyoucanusewiththe-Coption.
Examples
Thefollowingexamplesrequireconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vmkfstools.pl <conn_options> -C vmfs3 -b 1m -S my_vmfs /vmfs/devices/disks/naa.<naa_ID>:1
CreatesanewVMFS3filesystemnamedmy_vmfs.Thefileblocksizeis1MB.
vmkfstools.pl <conn_options> -C vmfs3 -S my_vmfs naa.<naa_ID>:4
vmkfstools.pl <conn_options> --createfs vmfs3 --setfsname my_vmfs naa.<naa_ID>:4
vmkfstools.pl <conn_options> --createfs vmfs3 --blocksize 1m --setfsname my_vmfs naa.<naa_ID>:4
vmkfstools.pl <conn_options> --createfs vmfs3 -b 4m --setfsname my_vmfs naa.<naa_ID>:4
Attribute Listing for a VMFS Volume
The-PoptionliststheattributesofafileordirectoryonaVMFSvolume.
-P --queryfs
ThelistedattributesincludetheVMFSversionnumber(VMFS2orVMFS3),thenumberofextentsinthe
specifiedVMFSvolume,thevolumelabelifany,theUUID,andalistingofthedevicenameswhereeachextent
resides.
Example
Thefollowingexamplerequiresconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vmkfstools.pl <conn_options> --queryfs /vmfs/volumes/my_vmfs
Thiscommandmightreturnthefollowing:
VMFS-3.33 file system spanning 1 partitions.
Capacity : 65229815808, 64641564672 avail
File system label : my_vmfs
UUID : 46fd1460-6ec4e2b8-e048-000e0c7f4088
Path : /vmfs/volumes/46fd1460-6ec4e2b8-e048-000e0c7f4088
Partitions spanned: naa.xxxxxxxxxxxxxxxxxxxxxx:3
IfanydevicebackingVMFSfilesystemgoesoffline,thenumberofextentsandtheavailablespacechange
accordingly.
Table 3-3. Suboptions for vmkfstools -C
Option Description
-b blocksize DefinestheblocksizefortheVMFS3filesystem.Thedefaultfileblocksizeis1MB.Validblocksizes
forVMFS3are1,2,4,8MB
Whenenteringasize,indicatetheunittypebyaddingasuffixsuchasmorM.Theunittypeisnot
casesensitivevmkfstoolsinterpretseithermorMtomeanmegabytesandkorKtomean
kilobytes.
-S setfsname DefinesthevolumelabelofaVMFSvolumefortheVMFS3filesystemyouarecreating.Usethis
suboptiononlywiththe-Coption.Thelabelyouspecifycanbeupto128characterslongand
cannotcontainanyleadingortrailingblankspaces.
Afteryouhavedefinedavolumelabel,youcanuseitwheneveryouspecifytheVMFSvolumeina
calltovmkfstools.ThevolumelabelappearsinlistingsgeneratedfortheLinuxls -lcommand
andasasymboliclinktotheVMFSvolumeunderthe/vmfs/volumesdirectory.
YoucanchangetheVMFSvolumelabelusingthevSphereClientUI.
VMware, Inc. 57
Chapter 3 File System Management with vmkfstools

File System Partition Extension by Spanning
The-ZoptionextendstheVMFSfilesystemwiththespecifiedheadpartitionbyspanningitacrossthe
partitionspecifiedby<span-partition>.
-Z | --extendfs <span-partition>
Theoperationerasesexistingdataonthespannedpartition.AVMFSfilesystemcanhaveatmost32partitions.
ThisoptionsdoesnotworkonVMFS2volumesbecauseVMFS2volumesarereadonlyinESX/ESXi3.0and
later.
Example
Thefollowingexamplerequiresconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vmkfstools.pl <conn_options> -Z /vmfs/devices/disks/naa.<naa_id_1>:1
/vmfs/devices/disks/naa.<naa_id_2>:3
Extendsthelogicalfilesystembyallowingittospantoanewpartition.Theextendedfilesystemspanstwo
partitions,naa.<naa_id_1>:1andnaa.<naa_id_2>:3.Inthisexample,
/vmfs/devices/disks/naa.<naa_id_2>:3istheheadpartitionoftheexistingVMFS3filesystem.
naa.<naa_id_1>:1isthepartitiontobeadded.
vmkfstools Virtual Disk Options
Virtualdiskoptionssupportsetup,migration,andmanagementofvirtualdisksstoredinVMFS2,VMFS3,
andNFSfilesystems.YoucanalsoperformmostofthesetasksthroughthevSphereClient.
Supported Disk Formats
Whenyoucreateorcloneavirtualdisk,youcanusethe-d --diskformatsuboptiontospecifytheformat
foryourdisk.Table 34liststhesupportedformats.
With -c --createvirtualdisk,vmkfstoolsacceptszeroedthick,eagerzeroedthick,andthin.
With-i clonevirtualdisk,vmkfstoolsacceptszeroedthick,thin,eagerzeroedthick,
rdm:<device>,rdmp:<device>,and2gbsparse.
WithNFSfiles,vmkfstoolssupportsonlythin,zeroedthick,and2gbsparse.BecausetheNFSserverand
nottheESX/ESXisystemdecidestheallocationpolicy,zeroedthick,andthinusuallyhavethesameresult.
ThedefaultallocationpolicyonmostNFSserversisthin.
CAUTIONWhenyourunthisoption,youlosealldataontheSCSIdeviceyouspecifiedin<span_partition>.
Table 3-4. Supported Disk Formats
Format Description
zeroedthick
(default)
Spacerequiredforthevirtualdiskisallocatedduringcreation.Anydataremainingonthe
physicaldeviceisnoterasedduringcreation,butwillbezeroedoutondemandatalatertime
onfirstwritefromthevirtualmachine.Thevirtualmachinedoesnotreadstaledatafromdisk.
eagerzeroedthick Spacerequiredforthevirtualdiskisallocatedatcreationtime.Incontrasttozeroedthick
format,thedataremainingonthephysicaldeviceiszeroedoutduringcreation.Itmighttake
muchlongertocreatedisksinthisformatthantocreateothertypesofdisks.
thin Thinprovisionedvirtualdisk.Spacerequiredforthevirtualdiskisnotallocatedduring
creationbutissupplied,zeroedout,ondemandatalatertime.
rdm Virtualcompatibilitymoderawdiskmapping.
rdmp Physicalcompatibilitymode(passthrough)rawdiskmapping.
2gbsparse Sparsediskwith2GBmaximumextentsize.YoucanusedisksinthisformatwithotherVMware
productssuchasVMwareWorkstation.YoucannotpoweronasparsediskonanESX/ESXihost
unlessyoufirstreimportthediskinacompatibleformat,suchasthin,withvmkfstools.
vSphere Command-Line Interface Installation and Reference Guide
58 VMware, Inc.

Creating Virtual Disks
The-coptioncreatesavirtualdiskatthespecifiedlocationonaVMFSvolume.Youmustspecifythesizeof
thevirtualdisk.
-c --createvirtualdisk <size>[kK|mM|gG]
-a --adaptertype [buslogic|lsilogic|ide] <srcfile>
-d --diskformat [thin|zeroedthick|eagerzeroedthick]
Whenyourunvmkfstools -c,--adaptertypedefaultstobuslogicand--diskformatdefaultsto
zeroedthick.
Indicatetheunittypefor<size>byaddingasuffixofk(kilobytes),m(megabytes),org(gigabytes).Theunit
typeisnotcasesensitivevmkfstoolsinterpretseitherkorKtomeankilobytes.Ifyoudonotspecifyaunit
type,vmkfstoolsdefaultstobytes.
Thevmkfstoolscommandsupportsthefollowingsuboptionsinconjunctionwith-c.
-aspecifiesthedevicedriverthatisusedtocommunicatewiththevirtualdisks.YoucanselectBusLogic,
LSILogicSCSI,orIDEdrivers.
-dspecifiesdiskformats,oneofzeroedthick,thin,eagerzeroedthick.SupportedDiskFormatson
page 57discussesallsupporteddiskformats,includingthosesupportedbycreatevirtualdisk.
Examples
Thefollowingexamplesrequireconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vmkfstools.pl <conn_options> -c 2g /vmfs/volumes/my_vmfs/myOS.vmdk
CreatesatwogigabytevirtualdiskfilenamedmyOS.vmdkontheVMFSfilesystemnamedmyVMFS.Thisfile
representsanemptyvirtualdiskavirtualmachinecanaccess.
vmkfstools.pl <conn_options> --createvirtualdisk 20m /vmfs/volumes/store1/test.vmdk
Createsa20MBvirtualdisknamedtest.vmdk.
vmkfstools.pl <conn_options> --createvirtualdisk 20m -d thin -a lsilogic /vmfs/volumes/M1/test.vmdk
Createsavirtualdiskassociatedwiththespecifiedadapter.
vmkfstools.pl <conn_options> -c 200m /vmfs/volumes/my_vmfs/test01.vmdk
Createsa200MBvirtualdisknamedtest01.vmdkontheVMFSfilesystemnamedmy_vmfs.
Initializing Virtual Disks
The-woptioncleansthevirtualdiskbywritingzerosoverallitsdata.
-w --writezeros
DependingonthesizeofyourvirtualdiskandtheI/Obandwidthtothedevicehostingthevirtualdisk,
completingthiscommandmighttakealongtime.
Examples
Thefollowingexamplesrequireconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vmkfstools.pl <conn_options> -w /vmfs/volumes/my_vmfs/test01.vmdk
vmkfstools.pl <conn_options> --writezeros /vmfs/volumes/my_vmfs/text02.vmdk
CAUTIONWhenyouusethiscommand,youloseanyexistingdataonthevirtualdisk.
VMware, Inc. 59
Chapter 3 File System Management with vmkfstools

Inflating Thin Virtual Disks
The-joptionconvertsathinvirtualdisktoeagerzeroedthickformat,andpreservesallexistingdata.Any
blocksthatwerenotallocatedareallocatedandzeroedout.
-j --inflatedisk
SeeSupportedDiskFormatsonpage 57.
Examples
Thefollowingexamplerequiresconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vmkfstools.pl <conn_options> --inflatedisk /vmfs/volumes/myvmfs/thin.vmdk
Deleting Virtual Disks
The-UoptiondeletesfilesassociatedwiththevirtualdiskatthespecifiedpathontheVMFSvolume.
-U --deletevirtualdisk
Example
Thefollowingexamplerequiresconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vmkfstools.pl <conn_options> -U /vmfs/volumes/store/test.vmdk
Deletesthevirtualdisktest.vmdk.
Renaming Virtual Disk
The-Eoptionrenamesthevirtualdiskfile.
-E --renamevirtualdisk <oldName> <newName>
Youmustspecifytheoriginalfilenameorfilepath<oldName>andthenewfilenameorfilepath<newName>.
Examples
Thefollowingexamplesrequireconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vmkfstools.pl <conn_options> -E /vmfs/volumes/myvmfs/test.vmdk /vmfs/volumes/store/renamed.vmdk
vmkfstools.pl <conn_options> -E /vmfs/volumes/myvmfs/my_OS.vmdk
/vmfs/volumes/myvmfs/my_new_OS.vmdk
vmkfstools.pl <conn_options> --renamevirtualdisk
/vmfs/volumes/myvmfs/my_OS.vmdk /vmfs/volumes/myvmfs/my_new_OS.vmdk
Cloning Virtual or Raw Disks
The-ioptioncreatesacopyofavirtualdiskorarawdiskthatyouspecify.
-i --clonevirtualdisk <srcfile> <destfile>
-d --diskformat [zeroedthick| thin| eagerzeroedthick| rdm:<device>|rdmp:<device>| 2gbsparse]
-a --adaptertype <type>
The--diskformatoptionspecifiesthediskformatforthecopy.Ifyoudonotspecify--diskformat,it
defaultstozeroedthick.Ifyoudonotspecify--adaptertype,itdefaultstobuslogic.SeeSupportedDisk
Formatsonpage 57.
IMPORTANTToclonetheredologsofanESXihostwhilepreservingtheirhierarchy,usethevifs -C
commandinstead.
vSphere Command-Line Interface Installation and Reference Guide
60 VMware, Inc.

Example
Thefollowingexamplerequiresconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vmkfstools <conn_options> -i /vmfs/volumes/templates/gold-master.vmdk
/vmfs/volumes/myVMFS/myOS.vmdk -d thin -a lsilogic
Clonesthecontentsofamastervirtualdiskfromthetemplaterepositorytoavirtualdiskfilenamed
myOS.vmdkonthefilesystemmyVMFS.
Migrating VMware Workstation and VMware GSX Server Virtual Machines
YoucannotusethevSphereClienttomigratevirtualmachinescreatedwithVMwareWorkstationor
VMware GSXServertoyourESX/ESXisystem.However,youcanusethevmkfstools -icommandtoimport
thevirtualdiskintoyourESX/ESXisystem.Youcanthenattachthisdisktoanewvirtualmachinethatyou
createintheESX/ESXisystem.Youmustimportthevirtualdiskfirst,becauseyoucannotpowerondisks
exportedin2gbsparseformatonanESX/ESXihost.
MigratingVMwareWorkstationandGSXServerVirtualMachinesrequiresthefollowingtasks:
1 ImportingaVMwareWorkstationorGSXServerdiskintoyour/vmfs/volumes/myVMFS/directoryor
anysubdirectoryusingvmkfstools.
2 CreatinganewvirtualmachineusingtheCustomconfigurationoptioninthevSphereClient.
3 SelectingUseanexistingvirtualdiskandattachingtheVMwareWorkstationorGSXServerdiskthatyou
importedduringdiskconfiguration.
Extending Virtual Disks
The-Xoptionextendsthesizeofadiskallocatedtoavirtualmachineafterthevirtualmachinehasbeen
created.
-X --extendvirtualdisk [-d eagerzeroedthick] <newSize>[kK|mM|gG]
Youmustpoweroffthevirtualmachinethatusesthisdiskfilebeforeyouenterthiscommand.Youmighthave
toupdatethefilesystemonthedisksothattheguestoperatingsystemcanrecognizeandusethenewsizeof
thediskandtakeadvantageoftheextraspace.
YouspecifythenewSizeoptioninkilobytes,megabytes,orgigabytesbyaddingasuffixofk(kilobytes),
m (megabytes),org(gigabytes).Theunittypeisnotcasesensitive.vmkfstoolsinterpretseitherkorKtomean
kilobytes.Ifyoudonotspecifyaunittype,vmkfstoolsdefaultstokilobytes.
Donotextendthebasediskofavirtualmachinethathassnapshotsassociatedwithit.Ifyoudo,youcanno
longercommitthesnapshotorrevertthebasedisktoitsoriginalsize.
Bydefault,anydisk,regardlessofformat,isextendedaszeroedthick.Youcanspecify-d eagerzeroedthick
tochangetheformattoeagerzeroedthick.Typically,itmakessenseonlytoextendeagerzeroedthick
disksaseagerzeroedthickbecausethesevirtualdisksareusedforfaulttoleranceandclusteringandhave
tobepreallocatedandzeroedoutupfront.-dallowsonlyeagerzeroedthick,itdoesnotallowotherdisk
formats.
Examples
Thefollowingexamplerequiresconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vmkfstools.pl <conn_options> -X 5g <disk name>.vmdk
Extendsa4GBvirtualdiskby1GB.
vmkfstools.pl <conn_options> -X 50M /vmfs/volumes/my_newVMFS/my_disk.vmdk
IMPORTANTnewSizedefinestheentirenewsize,notjusttheincrementyouaddtothedisk.
VMware, Inc. 61
Chapter 3 File System Management with vmkfstools

Creating Virtual Compatibility Mode Raw Device Mappings
The-roptioncreatesaRawDeviceMapping(RDM)fileinvirtualcompatibilitymodeonaVMFS3volume
andmapsarawdisktothisfile.
-r --createrdm <device>
Afterthismappingisestablished,youcanaccesstherawdiskasyouwouldanormalVMFSvirtualdisk.The
filelengthofthemappingisthesameasthesizeoftherawdiskitpointsto.
Whenyouspecifynaa.<naa_id>,theentirerawdiskisused.Usethefollowingformat:
/vmfs/devices/disks/naa.<naa_id>
FordetailsonconfiguringandusingRDMs,seetheESXConfigurationGuideandtheESXiConfigurationGuide.
AllVMFS3filelockingmechanismsapplytoRDMs.
Examples
Thefollowingexamplesrequireconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vmkfstools.pl <conn_options> -r /vmfs/devices/disks/naa.<naa_id>
/vmfs/volumes/storage1/rdm210.vmdk
CreatesavirtualcompatibilitymodeRDMfile/vmfs/volumes/storage1/rdm210.vmdkandmapsthe
/vmfs/devices/disks/naa.<naa_id>rawdisktothatfile.
vmkfstools.pl <conn_options> -r /vmfs/devices/disks/naa.<naa_id> my_rdm.vmdk
CreatesanRDMfilenamedmy_rdm.vmdkandmapsthenaa.<naa_id>rawdisktothatfile.Youcanconfigure
avirtualmachinetousethemy_rdm.vmdkmappingfilebyaddingthefollowinglinestothevirtualmachine
configurationfile:
scsi0:0.present = TRUE
scsi0:0.fileName = /vmfs/volumes/myVMFS/my_rdm.vmdk
Creating Physical Compatibility Mode Raw Device Mappings
The-zoptionletsyoumapaphysicalcompatibilitymoderawdevicetoafileonaVMFSvolume.
-z --createrdmpassthru <device>
ThemappingletsavirtualmachinebypassESX/ESXiSCSIcommandfilteringwhenaccessingitsvirtualdisk.
ThistypeofmappingisusefulwhenthevirtualmachineneedstosendproprietarySCSIcommands,for
example,whenthevirtualmachinerunsSANawaresoftware.
Afteryouestablishthistypeofmapping,youcanusethemappingtoaccesstherawdiskjustasyouwould
anyotherVMFSvirtualdisk.Theentirerawdeviceisused.Usethefollowingformat:
/vmfs/devices/disks/naa.<naa_id>
Example
Thefollowingexamplerequiresconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vmkfstools.pl <conn_options> -z /vmfs/devices/disks/naa.<naa_id>
/vmfs/volumes/storage1/rdmpass.vmdk
CreatesaphysicalcompatibilitymodeRDMfilenamedrdmpass.vmdkandmapsthenaa.<naa_id>tothat
file.Youcannotusethenameofafilethatalreadyexists.
Listing RDM Attributes
The-qoptionliststheattributesofanRDM.
-q --queryrdm
ThisoptionprintsthenameoftherawdiskRDM.Theoptionalsoprintsotheridentificationinformation,like
thediskID,fortherawdisk.
vSphere Command-Line Interface Installation and Reference Guide
62 VMware, Inc.

Displaying Virtual Disk Geometry
The-goptiongetsinformationaboutthegeometryofavirtualdisk.
-g --geometry
TheformisGeometry information C/H/S,whereCisthenumberofcylinders,Histhenumberofheads,
andSisthenumberofsectors.
IMPORTANTWhenimportingVMwareWorkstationvirtualdiskstoESX/ESXihost,youmightseeadisk
geometrymismatchmessage.Geometrymismatchmightalsocauseproblemsloadingaguestoperating
systemorrunninganewlycreatedvirtualmachine.
VMware, Inc. 63

4
ESX/ESXisystemsincludeiSCSItechnologytoaccessremotestorageusinganIPnetwork.WithiSCSI,SCSI
storagecommandsthatyourvirtualmachineissuestoitsvirtualdiskareconvertedintoTCP/IPprotocol
packetsandtransmittedtoaremotedevice,ortarget,onwhichthevirtualdiskislocated.Fromthepointof
viewofthevirtualmachine,thedeviceappearsasalocallyattachedSCSIdrive.
YoucanmanageiSCSIstorageusingthevSphereClientUI,asdiscussedintheESXConfigurationGuide,the
ESXiConfigurationGuideandtheiSCSISANConfigurationGuide,orusingthevicfg-iscsivSphereCLI
commanddiscussedinthischapter.
Thechapterincludesthefollowingtopics.
vicfgiscsiCommandSyntaxonpage 63
vicfgiscsiOptionsonpage 64
vicfgiscsiDiscoveryTargetOptionsonpage 67
vicfgiscsiAuthenticationOptionsonpage 69
vicfgiscsiInformationRetrievalOptionsonpage 71
vicfgiscsiPhysicalNetworkPortalOptionsonpage 72
vicfgiscsiNetworkOptionsonpage 73
vicfgiscsiInitiatorOptionsonpage 73
vicfgiscsiiSCSIParameterOptionsonpage 74
vicfgiscsiSoftwareiSCSIOptionsonpage 76
TasksRequiredforSoftwareiSCSISetuponpage 76
vicfg-iscsi Command Syntax
CommandsforiSCSImanagementusuallyincludeanoption,asuboption,anoptionalparameter,andthe
adaptername.Foreachoption,theshortandthelongformsareequivalent.Thecommandshavethefollowing
syntax:
vicfg-iscsi <conn-params> [option][suboption][parameters][<adapter_name>]
Optionisoneofthefollowing:
-D --discovery
-S --static
-A --authentication
-P --phba
-T --target
-L --lun
iSCSI Storage Management with
vicfg-iscsi 4
vSphere Command-Line Interface Installation and Reference Guide
64 VMware, Inc.

-N --network (Hardware iSCSI only)
-p --pnp (Hardware iSCSI only)
-I --iscsiname
-W --parameter
-E --swiscsi
-H --adapter
Suboptionisoneofthefollowingoperations:
-l --list
-a --add
-r --remove
Parametersdifferdependingontheoptionandsuboptionused.
Withtheexceptionof--adapterand--help,allcommandsrequirethe<adapter_name>argument.The
adapternameshouldbethenamethattheESX/ESXihostassignedorconfiguredforthesoftwareorhardware
iSCSIinitiator.TheESXConfigurationGuideandtheESXiConfigurationGuidediscussesiSCSIinitiatorsina
vSphereenvironment.
Youcanuse--listtofindtheadaptername.
vicfg-iscsi --adapter --list
vicfg-iscsi -H -l
vicfg-iscsi Options
vicfg-iscsisupportsacomprehensivesetofoptions,listedinTable 41.Eachoptionisdiscussedinmore
detaillaterinthechapter.
Table 4-1. Options for vicfg-iscsi
Option Suboptions Description
-A --authentication
-c <level>
-m <auth_method> -b
-u <ma_username>
-w <ma_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]]
<adapter_name>
--level <level>
--method <auth_method> --mutual
--auth_username <ma_username>
--auth_password <ma_password>
[--ip <stor_ip_addr|stor_hostname> [:<portnum>]
[--name <iscsi_name>]] <adapter_name>
Enablesmutualauthentication.
Youmustenableauthentication
beforeyoucanenablemutual
authentication.
-A --authentication
-c <level>
-m <auth_method>
-u <auth_u_name>
-w <a_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]]
<adapter_name>
--level <level>
--method <auth_method>
--auth_username <auth_u_name>
--auth_password <auth_password>
[--ip <stor_ip_addr|stor_hostname> [:<portnum>]
[--name <iscsi_name>]] <adapter_name>
Enablesauthenticationusingthe
specifiedoptions.
VMware, Inc. 65
Chapter 4 iSCSI Storage Management with vicfg-iscsi

-A --authentication
-l <adapter_name>
--list <adapter_name>
Listssupportedandenabled
authenticationmethods.
-D --discovery
-a -i <stor_ip_addr|stor_hostname[:<portnum>] <adapter_name>
--add --ip <stor_ip_addr|stor_hostname> [:<portnum>]
<adapter_name>
Addsadynamicdiscovery
address.
-D --discovery
-l <adapter_name>
--list <adapter_name>
Listsdynamicdiscovery
addresses.
-D --discovery
-r -i <stor_ip_addr|stor_hostname>[:<portnum>] <adapter_name>
--remove --ip <stor_ip_addr|stor_hostname> [:<portnum>]
<adapter_name>
Removesadynamicdiscovery
address.
-H
-l [<adapter_name>]
--list [<adapter_name>]
ListsalliSCSIadaptersora
specifiedadapter.
-L --lun
-l <adapter_name>
--list <adapter_name>
ListsLUNinformation.
-L --lun
-l -t <target_ID> <adapter_name>
--list --target_id <target_id> <adapter_name>
ListsLUNinformationfora
specifictarget.
-N --network (Hardware iSCSI only)
-l <adapter_name>
--list <adapter_name>
Listsnetworkproperties.
-N --network (Hardware iSCSI only)
-i <ip_addr> <adapter_name>
--ip <ip_addr> <vmhba>
SetstheHBAIPv4addressto
ip_addr.
-N --network (Hardware iSCSI only)
-s <subnet_mask> <adapter_name>
--subnetmask <subnet_mask> <adapter_name>
SetstheHBAnetworkmaskto
subnet_mask.
-N --network (Hardware iSCSI only)
-g <default_gateway> <adapter_name>
--gateway <default_gateway> <adapter_name>
SetstheHBAgatewayto
default_gateway.
-N --network (Hardware iSCSI only)
-i <ip_addr> -s <subnet mask>
-g <default_gateway> <adapter_name>
--ip <ip_addr> --subnetmask <subnet_mask>
--gateway <default_gateway> <adapter_name>
SetstheIPaddress,subnetmask,
anddefaultgatewayinone
command.
-p --pnp (Hardware iSCSI only)
-l <adapter_name>
--list <adapter_name>
Listsphysicalnetworkportal
options.
-p --pnp (Hardware iSCSI only)
-M <mtu_size> <adapter_name>
--mtu <mtu-size> <adapter_name>
Setsphysicalnetworkportal
options.
Table 4-1. Options for vicfg-iscsi (Continued)
Option Suboptions Description
vSphere Command-Line Interface Installation and Reference Guide
66 VMware, Inc.

-I --iscsiname
-a <alias_name> <adapter_name>
--alias <alias_name> <adapter_name>
SetstheiSCSIinitiatoralias.
-I --iscsiname
-n <iscsi_name> <adapter_name>
--name <iscsi_name> <adapter_name>
SetstheiSCSIinitiatorname.
-I --iscsiname
-l <adapter_name>
--list <adapter_name>
ListsiSCSIinitiatoroptions.
-S --static
-l <adapter_name>
--list <adapter_name>
Listsstaticdiscoveryaddresses.
-S --static
-r -i <stor_ip_addr|stor_hostname> [:<portnum>] -n <target_name>
<adapter_name>
--remove --ip <stor_ip_addr|stor_hostname> [:<portnum>] -name
<target_name> <adapter_name>
Removesastaticdiscovery
address.
-S --static
-a -i <stor_ip_addr|stor_hostname> [:<portnum>]
-n <target_name> <adapter_name>
--add --ip <stor_ip_addr|stor_hostname> [:<portnum>]
-name <target_name> <adapter_name>
Addsastaticdiscoveryaddress.
-P --phba
-l <adapter_name>
--list <adapter_name>
Listsexternal,vendorspecific
propertiesofaniSCSIadapter.
-T --target
-l <adapter_name>
--list <adapter_name>
Liststargetinformation.
-W parameter
-l [-i <stor_ip_addr|stor_hostname> [:<portnum>]
[-n <iscsi_name]] <adapter_name>
--list [--ip <stor_ip_addr|stor_hostname> [:<portnum>]
[--name <iscsi_name]] <adapter_name>
ListsiSCSIparameter
information.
-W parameter
-l -k [-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n
<iscsi_name]] <adapter_name>
--list --detail
[--ip <stor_ip_addr|stor_hostname> [:<portnum>]
[--name <iscsi_name]] <adapter_name>
ListsiSCSIparameterdetails.
-W parameter
-W -j <name>=<value>
-i <stor_ip_addr|stor_hostname> [:port_num>] [-n <iscsi_name>]]
<adapter_name>
--parameter --set <name>=<value>
--ip <stor_ip_addr|stor_hostname> [:port_num>]
[--name <iscsi_name>]] <adapter_name>
SetsiSCSIparameters.
Table 4-1. Options for vicfg-iscsi (Continued)
Option Suboptions Description
VMware, Inc. 67
Chapter 4 iSCSI Storage Management with vicfg-iscsi

vicfg-iscsi Discovery Target Options
AdiscoverysessionispartoftheiSCSIprotocol.Thediscoverysessionreturnsthesetoftargetsyoucanaccess
onaniSCSIstoragesystem.ESX/ESXisystemssupportdynamicandstaticdiscovery.
DynamicdiscoveryAlsoknownasSendTargetsdiscovery.EachtimetheESX/ESXihostcontactsa
specifiediSCSIserver,itsendsaSendTargetsrequesttotheserver.Inresponse,theiSCSIserversupplies
alistofavailabletargetstotheESX/ESXihost.
StaticDiscoveryTheESX/ESXihostdoesnothavetoperformanydiscovery.Instead,theESX/ESXihost
usestheIPaddressesordomainnamesandiSCSItargetnames(IQNorEUIformatnames)to
communicatewiththeiSCSItarget.
The-Dand-Soptionsmonitorandmanagetargetdiscoveryaddresses.YoucanalsousethevSphereClient
toperformthesametask.
Foreithercase,yousetuptargetdiscoveryaddressessothattheinitiatorcandeterminewhichstorage
resourceonthenetworkisavailableforaccess.Youcandothissetupwithdynamicdiscoveryorstatic
discovery.Withdynamicdiscovery,alltargetsassociatedwithanIPaddressorhostnameandtheiSCSIname
arediscovered.Withstaticdiscovery,youmustspecifytheIPaddressorhostnameandtheiSCSInameofthe
targettobeseen.TheiSCSIHBAmustbeinthesameVLANasbothportsoftheiSCSIarray.
Listing Dynamic or Static Discovery Targets
The-l --listoptionlistsdynamicorstaticdiscoverytargetsandrelatedproperties,asfollows:
vicfg-iscsi -D -l <adapter_name>
vicfg-iscsi --discovery --list <adapter_name>
vicfg-iscsi -S -l <adapter_name>
vicfg-iscsi --static --list <adapter_name>
Example
Thefollowingexamplerequiresconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vicfg-iscsi.pl <conn_options> --discovery --list vmhba42
Listsdynamicdiscoverytargetsandrelatedproperties.
Adding Dynamic or Static Discovery Targets
The-a --addoptionaddsdynamicorstaticdiscoverytargets.Youcanperformthesameoperationusingthe
vSphereClient,asdiscussedintheESXConfigurationGuideandtheESXiConfigurationGuide.Thetwotypes
oftargetdifferasfollows:
Withdynamicdiscovery,allstoragetargetsassociatedwithanIPaddressarediscovered.
Withstaticdiscovery,youmustspecifytheIPaddressandtheiSCSInameofthestoragetargettobeseen.
-W parameter
-W -o <param_name>
-i <stor_ip_addr|stor_hostname> [:port_num>] [-n <iscsi_name>]]
<adapter_name>
-parameter --reset <param_name>
-ip <stor_ip_addr|stor_hostname> [:port_num>]
[-name <iscsi_name>]] <adapter_name>
Returnsparametersindiscovery
orsendtargettodefault
inheritancebehavior.
Table 4-1. Options for vicfg-iscsi (Continued)
Option Suboptions Description
vSphere Command-Line Interface Installation and Reference Guide
68 VMware, Inc.

Usethefollowingsyntaxtoaddadynamicdiscoverytarget.If<portnum>isnotspecified,itdefaultsto3260.
vicfg-iscsi -D -a -i <stor_ip_addr|stor_hostname> [:<portnum>] <adapter_name>
vicfg-iscsi --discovery --add --ip <stor_ip_addr|stor_hostname> [:<portnum>] <adapter_name>
Usethefollowingsyntaxtoaddastaticdiscoverytarget.Incontrasttodynamicdiscovery,theiSCSInameis
required.
vicfg-iscsi -S -a -i <stor_ip_addr|stor_hostname> [:<portnum>] -n <target_name>
<adapter_name>
vicfg-iscsi --static --add --ip <stor_ip_addr|stor_hostname> [:<portnum>] --name <target_name>
<adapter_name>
IQN Name and EUI Name
ThetargetnameiseitheranIQNnameoranEUIname.
TheIQNnameusesthefollowingformat:
iqn.yyyy-mm.{reversed domain name}:id_string
Forexample,iqn.2007-05.com.mydomain:storage.tape.sys3.abc
WhenyouenablesoftwareiSCSIonanESX/ESXihost,thehostgeneratesanIQNname.Youcanchange
thatdefaultIQNname.
TheEUInameisdescribedinIETFrfc3720asfollows:
TheIEEERegistrationAuthorityprovidesaserviceforassigninggloballyuniqueidentifiers[EUI].The
EUI64formatisusedtobuildaglobalidentifierinothernetworkprotocols.Forexample,FibreChannel
definesamethodofencodingitintoaWorldWideName.
Theformatiseui.followedbyanEUI64identifier(16ASCIIencodedhexadecimaldigits).
Forexample:
Type EUI-64 identifier (ASCII-encoded hexadecimal)
+--++--------------+
| || |
eui.02004567A425678D
TheIEEEEUI64iSCSInameformatcanbeusedwhenamanufacturerisalreadyregisteredwiththeIEEE
RegistrationAuthorityandusesEUI64formattedworldwideuniquenamesforitsproducts.
CheckintheUIofthestoragearraywhetheranarrayusesanIQNnameoranEUIname.
Examples
Thefollowingexamplesrequireconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vicfg-iscsi.pl <conn_options> --discovery --add --ip <stor_ip_addr|stor_hostname> vmhba42
Addsadynamicdiscoveryaddress.
vicfg-iscsi.pl <conn_options> --static --add
--ip <stor_ip_addr|stor_hostname> --name <target_name> vmhba42
Addsastaticdiscoveryaddress.
Removing Dynamic or Static Discovery Targets
The-r --removeoptionremovesadynamicorstatictarget.Youcanperformthesameoperationusingthe
vSphereClient,asdiscussedintheiSCSISANConfigurationGuide.
Usethefollowingsyntaxtoremoveadynamicdiscoverytarget.
vicfg-iscsi -D -r -i <stor_ip_addr|stor_hostname> [:<portnum>] <adapter_name>
vicfg-iscsi --discovery --remove
--ip <stor_ip_addr|stor_hostname> [:<portnum>] <adapter_name>
VMware, Inc. 69
Chapter 4 iSCSI Storage Management with vicfg-iscsi

Whenyouremoveadiscoveryaddress,itmightstillbedisplayedastheparentofastatictarget.Youcanlater
addthediscoveryaddressandrescantodisplaythecorrectparentforthestatictargets.
Usethefollowingsyntaxtoremoveastaticdiscoverytarget.Youcanuse<stor_ip_addr>or
<stor_hostname>andoptionally<portnum>.If<port_num>isnotspecified,itdefaultsto3260.Youspecify
therequiredtargetnameinIQNorEUIformat.SeeIQNNameandEUINameonpage 68.
vicfg-iscsi -S -r -i <stor_ip_addr|stor_hostname> [:<portnum>]
-n <target_name> <adapter_name>
vicfg-iscsi --static --remove --ip <stor_ip_addr|stor_hostname> [:<portnum>]
--name <target_name> <adapter_name>
Example
Thefollowingexamplerequiresconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vicfg-iscsi.pl <conn_options> --discovery --remove --ip <stor_ip_addr|stor_hostname> vmhba42
vicfg-iscsi Authentication Options
ThissectiondiscussesiSCSIauthenticationoptions.YoucanalsosettheseoptionsusingthevSphereClient,as
discussedintheiSCSISANConfigurationGuide.
iSCSIstoragesystemsauthenticateaninitiatorusinganameandkeypair.ESX/ESXisystemssupportCHAP
(ChallengeHandshakeAuthenticationProtocol),whichVMwarerecommendsforyourSANimplementation.
TheESX/ESXihostandtheiSCSIstoragesystemmusthaveCHAP(ChallengeHandshakeAuthentication
Protocol)enabled,andmusthavecommoncredentials.DuringiSCSIlogin,theiSCSIstoragesystem
exchangesitscredentialswiththeESX/ESXisystemandchecksthem.
TouseCHAPauthentication,youmustenableCHAPonboththeinitiatorsideandthestoragesystemside.
Afterauthenticationisenabled,itappliesfortargetstowhichnoconnectionhasbeenestablished,butdoesnot
applytotargetstowhichaconnectionisalreadyestablished.Afterthediscoveryaddressisset,thenew
volumestowhichyouaddaconnectionareexposedandcanbeused.
ESX/ESXihostssupportonlyonesetofCHAPcredentialsperinitiator.YoucannotassigndifferentCHAP
credentialsfordifferenttargets.
WhenyouconfigurehardwareiSCSIinitiators,ensurethattheCHAPconfigurationmatchesyouriSCSI
storage.IfCHAPisenabledonthestoragearray,itmustbeenabledontheinitiator.IfCHAPisenabled,you
mustsetuptheCHAPauthenticationcredentialsontheESX/ESXihosttomatchthecredentialsontheiSCSI
storage.
Listing Supported and Enabled Authentication Methods
The--authentication--listoptionslistsupportedandenabledauthenticationmethods,asfollows:
vicfg-iscsi -A -l <adapter_name>
vicfg-iscsi --authentication --list <adapter_name>
Example
Thefollowingexamplerequiresconnectionoptions.SeeSpecifyingAuthenticationInformationonpage 13.
vicfg-iscsi.pl <conn_options> --authentication --list vmhba42
Theexamplefirstreturnssupportedinitiatorauthenticationmethods,andthensupportedmutual
authenticationmethods.
vSphere Command-Line Interface Installation and Reference Guide
70 VMware, Inc.

Enabling Authentication
YoucanenableauthenticationontheESX/ESXihostbyspecifyingtheauthenticationmethodandlevelandthe
usernameandpasswordtobeusedforauthentication,asfollows:
vicfg-iscsi -A -c <level> -m <auth_method>
-u <auth_u_name> -w <auth_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>]
[-n <target_iscsi_name]]
<adapter_name>
vicfg-iscsi --authentication --level <level> --method <auth_method>
--auth_username <auth_u_name> --auth_password <auth_password>
[--ip <stor_ip_addr|stor_hostname> [:<portnum>]
[-name <target_iscsi_name]]
<adapter_name>
For<level>,specifyoneofthevaluesinTable 42.
For<auth_method>,CHAPistheonlyvalidvalue.
Thetarget(-i)andname(-n)optiondeterminewhatthecommandappliesto.
Enabling Mutual (Bidirectional) Authentication
ESX/ESXisystemssupportmutualauthenticationforsoftwareiSCSIbutnotforhardwareiSCSI.
YouenablemutualauthenticationbyusingthesyntaxdiscussedinEnablingAuthenticationonpage 70but
addingthe-b (or--mutual)option,asfollows:
vicfg-iscsi -A -c <level> -m <auth_method> -b -u <ma_username> -w <ma_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name]] <adapter_name>
ThecommandisnotsupportedforhardwareiSCSI.
For<level>,specifychapProhibitedorchapRequired.
chapProhibitedThehostdoesnotuseCHAPauthentication.Ifauthenticationisenabled,specify
chapProhibitedtodisableit.
chapRequiredThehostrequiressuccessfulCHAPauthentication.TheconnectionfailsifCHAP
negotiationfails.YoucansetthisvalueonlyifCHAPissettochapRequired.
For<auth_method>,CHAPistheonlyvalidvalue.
Table 4-2. Supported Levels for CHAP
Level Description Supported
chapProhibited ThehostdoesnotuseCHAPauthentication.Ifauthentication
iscurrentlyenabled,specifychapProhibitedtodisableit.
SoftwareiSCSI
HardwareiSCSI
chapDiscouraged ThehostusesanonCHAPconnection,butallowsaCHAP
connectionasfallback.
SoftwareiSCSI
chapPreferred ThehostusesCHAPiftheCHAPconnectionsucceeds,but
usesnonCHAPconnectionsasfallback.
SoftwareiSCSI
HardwareiSCSI
chapRequired ThehostrequiressuccessfulCHAPauthentication.The
connectionfailsifCHAPnegotiationfails.
SoftwareiSCSI
Option Result
-iandn CommandappliestopertargetCHAPforstatictargets.
Onlyi Commandappliestothediscoveryaddress.
Neither-inorn CommandappliestoperadapterCHAP.
VMware, Inc. 71
Chapter 4 iSCSI Storage Management with vicfg-iscsi

Thetarget(-i)andname(-n)optiondeterminewhatthecommandappliesto.
To enable mutual authentication
1 EnableauthenticationontheESX/ESXihost.
vicfg-iscsi -A -c <level> -m <auth_method> -u <auth_u_name> -w <auth_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name]] <adapter_name>
Thespecifiedusernameandpasswordmustbesupportedonthestorageside.
2 EnablemutualauthenticationontheESX/ESXihost.
vicfg-iscsi -A -c <level> -m <auth_method> -b -u <ma_username> -w <ma_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name]] <adapter_name>
3 Makesurethat:
Thesecondusernameandpasswordaresupportedformutualauthenticationonthestorageside.
CHAPandmutualCHAPusedifferentpasswords.
CHAPisrequiredwhenyousetmutualCHAPtorequired.
Returning Authentication to Default Inheritance
TheiSCSIauthenticationsettingvaluesofadynamicdiscoveryaddressorastaticdiscoverytargetare
inheritedfromthecorrespondingsettingsoftheparent.Foradynamicdiscoverytarget,theadapteristhe
parent.Forastatictarget,theadapterorthediscoverytargetistheparent.
IfyouusethevSphereClienttomodifyauthenticationsettings,youmustdeselecttheInheritfromParent
checkboxbeforeyoucanmakeachangetothediscoveryaddressordiscoverytarget.
Ifyouusevicfg-iscsi,thevalueyousetoverridestheinheritedvalue.
Inheritanceisrelevantonlyifyouwanttoreturnadynamicdiscoveryaddressorastaticdiscoverytargetto
itsinheritedvalue.Inthatcase,usethe--reset_authoption,whichrequiresthe--nameoptionforstatic
discoveryaddressesbutnotfordynamicdiscoverytargets.
vicfg-iscsi <conn_options> -A --reset_auth --method <auth_method>
--ip <stor_ip_addr|stor_hostname> <adapter_name>
vicfg-iscsi <conn_options> --authentication --reset_auth --method <auth_method>
--ip <stor_ip_addr|stor_hostname> --name <iscsi_name> <adapter_name>
vicfg-iscsi Information Retrieval Options
Informationretrievaloptionstovicfg-iscsilistexternalHBAproperties,informationabouttargets,and
LUNs.
Youcanalsolistdiscoveryaddressesandauthenticationinformation.SeevicfgiscsiDiscoveryTarget
Optionsonpage 67andvicfgiscsiAuthenticationOptionsonpage 69.
External HBA Properties
The-Poptionlistsexternal(vendorspecific)propertiesofaniSCSIadapter,asfollows:
vicfg-iscsi -P -l <adapter_name>
vicfg-iscsi --phba --list <adapter_name>
Thesystemreturnsinformationaboutthevendor,model,description,andserialnumberoftheHBA.
Option Result
-iandn CommandappliestopertargetCHAPforstatictargets.
Onlyi Commandappliestothediscoveryaddress.
Neither-inorn CommandappliestoperadapterCHAP.
vSphere Command-Line Interface Installation and Reference Guide
72 VMware, Inc.

Target Information
The-Toptionliststargetinformation,asfollows:
vicfg-iscsi -T -l <adapter_name>
vicfg-iscsi --target --list <adapter_name>
Thesystemreturnsinformationabouttargetsforthespecifiedadapter,includingtheiSCSIname(IQNorEUI
format)andalias.SeeIQNNameandEUINameonpage 68.
LUN Information
The-LoptionlistsLUNinformation,asfollows:
vicfg-iscsi -L -l <adapter_name>
vicfg-iscsi --lun --list <adapter_name>
ThesystemreturnstheOSdevicename,busnumber,targetID,LUNID,andLUNsizefortheLUN.
Youuse-Linconjunctionwith-ttolistonlyLUNsonaspecifiedtarget,asfollows:
vicfg-iscsi -L -l -t <target_ID> <adapter_name>
vicfg-iscsi --lun --list --target_id <target_id> <adapter_name>
ThesystemreturnstheLUNsonthespecifiedtargetandthecorrespondingdevicename,devicenumber,LUN
ID,andLUNsize.
vicfg-iscsi Physical Network Portal Options
The-p --pnpoptionlistsandsetsphysicalnetworkportalinformation.
Listing Physical Network Portal Information
The-p -loptionslistphysicalnetworkportalinformation,asfollows:
vicfg-iscsi -p -l <adapter_name>
vicfg-iscsi --pnp --list <adapter_name>
ThesystemreturnswhethertheMACaddressissettable,themaximumandcurrenttransferrate,theMTU
size,andtheMACaddress.
Example
vicfg-iscsi.pl <conn_options> -p -l vmhba42
Setting Physical Network Portal Information
The-p -Moptionssetthemaximumtransmissionunit(MTU)valueoftheiSCSIHBA.
vicfg-iscsi -p -M <mtu_size> <adapter_name>
vicfg-iscsi --pnp --mtu <mtu-size> <adapter_name>
Example
vicfg-iscsi.pl <conn_options> -p -M 1500 vmhba42
IMPORTANTThisoptionissupportedonlyforhardwareiSCSI.
MAC ADDRESS SETTABLE
MAX TRANSFER RATE (Mbps) 1024
CURRENT TRANSFER RATE (Mbps) 1024
MAX FRAME SIZE 1500
MAC ADDRESS 00:c0:dd:0a:94:13
VMware, Inc. 73
Chapter 4 iSCSI Storage Management with vicfg-iscsi

vicfg-iscsi Network Options
The-NoptionmonitorsandmanagesiSCSIproperties.
Listing Network Properties
The-N loptionslistnetworkinformation,asfollows:
vicfg-iscsi -N -l <adapter_name>
vicfg-iscsi --network --list <adapter_name>
ThesystemreturnsinformationabouttheIPaddress,subnetmask,defaultgateway,primaryDNS,and
alternativeDNS.
Setting Network Properties
The-i,-s,and-goptionssetnetworkproperties.
-i --ipSetstheIPv4addressfortheHBA
-s --subnetmaskSetsthesubnetmaskfortheHBA
-g --gatewaySetsthedefaultgatewayfortheHBA
The-ioptionsetstheHBAIPv4address,asfollows:
vicfg-iscsi -N -i <stor_ip_addr> <adapter_name>
vicfg-iscsi --network --ip <stor_ip_addr> <adapter_name>
The-soptionsetstheHBAnetworkmask,asfollows:
vicfg-iscsi -N -s <subnet_mask> <adapter_name>
vicfg-iscsi --network --subnetmask <subnet_mask> <adapter_name>
The-goptionsetstheHBAdefaultgateway,asfollows:
vicfg-iscsi -N -g <default_gateway> <adapter_name>
vicfg-iscsi --network --gateway <default_gateway> <adapter_name>
YoucansettheIPaddress,subnetmask,anddefaultgatewayinonecommand,asfollows:
vicfg-iscsi -N -i <ip_addr> -s <subnet mask> -g <default_gateway> <adapter_name>
vicfg-iscsi --network --ip <ip_addr> --subnetmask <subnet_mask>
--gateway <default_gateway> <adapter_name>
vicfg-iscsi Initiator Options
ESX/ESXisystemsuseasoftwarebasediSCSIinitiatorintheVMkerneltoconnecttostorage.Initiatoroptions
listinformationabouttheiSCSIinitiatorandsettheiSCSInameandaliasfortheinitiator.
Listing Initiator Properties
The-I -loptionslistinformationabouttheiSCSIinitiator,asfollows:
vicfg-iscsi -I -l <adapter_name>
vicfg-iscsi --iscsiname --list <adapter_name>
Example
vicfg-iscsi.pl <conn_options> -I -l vmhba42
ReturnstheiSCSIname,aliasname,andaliassettablebit.
IMPORTANTThisoptionissupportedonlyforhardwareiSCSI.
vSphere Command-Line Interface Installation and Reference Guide
74 VMware, Inc.

Setting Initiator iSCSI Name or Alias Name
The-I -nand-I -aoptionssettheiSCSInameoraliasfortheiSCSIinitiatorasfollows:
vicfg-iscsi -I -n <iscsi_name> <adapter_name>
vicfg-iscsi --iscsiname --name <iscsi_name> <adapter_name>
vicfg-iscsi -I -a <alias_name> <adapter_name>
vicfg-iscsi --iscsiname --alias <alias_name> <adapter_name>
Example
vicfg-iscsi.pl <conn_options> -I -a acme-pdp242.dept.comp.com vmhba42
SetstheiSCSIaliasforvmhba42toacme-pdp242.dept.comp.com.
vicfg-iscsi iSCSI Parameter Options
The-WoptionlistsandsetsiSCSIparameteroptions.
Listing iSCSI Parameter Options
The-W -loptionslistiSCSIparameteroptionsfortheHBA.
Thetarget(-i)andname(-n)optiondeterminewhatthecommandappliesto.
vicfg-iscsi -W -l [-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]]
<adapter_name>
vicfg-iscsi --parameter --list
[--ip <stor_ip_addr|stor_hostname> [:<portnum>] [--name <iscsi_name>]] <adapter_name>
Listing iSCSI Parameter Option Details
The-W -l -k optionslistiSCSIparametersandwhethertheyaresettable.
Thetarget(-i)andname(-n)optiondeterminewhatthecommandappliesto.
vicfg-iscsi -W -l -k
[-i <stor_ip_addr|stor_hostname>[:<port_num>] [-n <iscsi_name>]] <adapter_name>
vicfg-iscsi --parameter --list --detail
[--ip <stor_ip_addr|stor_hostname>[:<port_num>][--name <iscsi_name>]] <adapter_name>
Option Result
-iandn CommandappliestopertargetCHAPforstatictargets.
Onlyi Commandappliestothediscoveryaddress.
Neither-inorn CommandappliestoperadapterCHAP.
Option Result
-iandn CommandappliestopertargetCHAPforstatictargets.
Onlyi Commandappliestothediscoveryaddress.
Neither-inorn CommandappliestoperadapterCHAP.
VMware, Inc. 75
Chapter 4 iSCSI Storage Management with vicfg-iscsi

Setting iSCSI Parameter Options
The-W -joptionssetiSCSIparameteroptionsfortheHBA.
Thetarget(-i)andname(-n)optiondeterminewhatthecommandappliesto.
vicfg-iscsi -W -j <name>=<value>
-i <stor_ip_addr|stor_hostname>[:port_num>][-n <iscsi_name>]] <adapter_name>
vicfg-iscsi --parameter --set <name>=<value>
--ip <stor_ip_addr|stor_hostname>[:port_num>][--name <iscsi_name>]] <adapter_name>
Ifspecialcharactersareinthe<name>=<value>sequence,forexample,ifyouaddaspace,youmustsurround
thesequencewithdoublequotes(<name> = <value>).
Table 43listsallsettableparameters.TheseparametersarealsodescribedintheIETFrfc3720.Youcanalso
runvicfg-iscsi --parameter --list --detailstodeterminewhetheraparameterissettableornot.
Returning Parameters to Default Inheritance
ThevaluesofiSCSIparametersassociatedwithadynamicdiscoveryaddressorastaticdiscoverytargetare
inheritedfromthecorrespondingsettingsoftheparent.Forthedynamicdiscoveryaddress,theparentisthe
adapter.Forthestatictarget,theparentistheadapterordiscoveryaddress.
IfyouusethevSphereClienttomodifyauthenticationsettings,youdeselecttheInheritfromParentcheck
boxbeforeyoucanmakeachangetothediscoveryaddressordiscoverytarget.
Ifyouusevicfg-iscsi,thevalueyousetoverridestheinheritedvalue.
Inheritanceisrelevantonlyifyouwanttoreturnadynamicdiscoveryaddressorastaticdiscoverytargetto
itsinheritedvalue.Inthatcase,usethe--reset <param_name>option,whichrequiresthe--nameoptionfor
staticdiscoveryaddressesbutnotfordynamicdiscoverytargets.
vicfg-iscsi <conn_options> --parameter --reset <param_name>
--ip <stor_ip_addr | stor_hostname>[:port_num>] <adapter_name>
vicfg-iscsi <conn_options> -W -o <param_name>
-i <stor_ip_addr|stor_hostname>[:port_num>] <adapter_name>
Option Result
-iandn CommandappliestopertargetCHAPforstatictargets.
Onlyi Commandappliestothediscoveryaddress.
Neither-inorn CommandappliestoperadapterCHAP.
Table 4-3. Settable iSCSI Parameters
Parameter Description
dataDigestType Enablingheaderdigestincreasesdataintegrity.Whenenabled,thesystemperformsachecksum
overiSCSIPDUdata.
ValidvaluesaredigestProhibited,digestDiscouraged,digestPreferred,or
digestRequired.
Correspondstothedata_digestandheader_digestparametersinserviceconsole
commands.
MaxOutstandingR2T MaxOutstandingR2TdefinestheR2T(ReadytoTransfer)PDUsthatcanbeintransitionbefore
anacknowledgementPDUisreceived.
Correspondstothemax_outstabdubg_r2tparameterinserviceconsolecommands.
FirstBurstLength MaximumamountofunsoliciteddataaniSCSIinitiatorcansendtothetargetduringthe
executionofasingleSCSIcommand,inbytes.
Correspondstothefirst_burst_lenparameterinserviceconsolecommands.
MaxBurstLength MaximumSCSIdatapayloadinaDataInorasolicitedDataOutiSCSIsequence,inbytes.
Correspondstothemax_burst_lenparameterinserviceconsolecommands.
MaxRecvDataSegLen Maximumdatasegmentlength,inbytes,thatcanbereceivedinaniSCSIPDU.
Correspondstothemax_rev_data_seg_lenparameterinserviceconsolecommands.
vSphere Command-Line Interface Installation and Reference Guide
76 VMware, Inc.

vicfg-iscsi Software iSCSI Options
The-EoptionmonitorsandmanagessoftwareiSCSI.
Listing Software iSCSI Loading Status
SomesetupisrequiredbeforeyoucansuccessfullyenableiSCSIsoftwareonyoursystem.The-E -loption
listssoftwareiSCSIloadingstatus,asfollows:
vicfg-iscsi -E -l
vicfg-iscsi --swiscsi --list
ThesystemprintsSoftware iSCSI is enabledorSoftware iSCSI is not enabled.
Enabling Software iSCSI
The-E -eoptionenablessoftwareiSCSIasfollows:
vicfg-iscsi -E -e
vicfg-iscsi --swiscsi --enable
ThesystemenablessoftwareiSCSIforthespecifiedhostandprintsEnabling software iSCSI.
Disabling Software iSCSI
The-E -doptiondisablessoftwareiSCSI,asfollows:
vicfg-iscsi -E -d
vicfg-iscsi --swiscsi --disable
ThesystemdisablessoftwareiSCSIandprintsDisabling software iSCSI for next boot.
Tasks Required for Software iSCSI Setup
ThissectionliststhetasksrequiredforsoftwareiSCSIsetup.Itdoesnotgivestepbystepinstruction.Foreach
task,seethediscussionofthecorrespondingcommandlineoptioninthischapterformoreinformation.
1 DeterminetheHBAtypeandretrievetheHBAIDbyrunningvicfg-iscsi -H -l.
vicf-iscsi.pl --adapter --list
2 EnablesoftwareiSCSIfortheHBAbyrunningvicfg-iscsi -E -e.
vicfg-iscsi.pl --swiscsi --enable
3 (Optional)SettheiSCSInameandaliasbyrunningvicfg-iscsi -I.
vicfg-iscsi -I -n <iscsi_name> <adapter_name>
vicfg-iscsi --iscsiname --name <iscsi_name> <adapter_name>
vicfg-iscsi -I -a <alias_name> <adapter_name>
vicfg-iscsi --iscsiname --alias <alias_name> <adapter_name>
4 Addadynamicdiscoveryaddressbyrunningvicfg-iscsi -Dorastaticdiscoveryaddressbyrunning
vicfg-iscsi -S.
vicfg-iscsi -D -a -i <stor_ip_addr|stor_hostname> [:<portnum>] <adapter_name>
vicfg-iscsi --discovery --add --ip <stor_ip_addr|stor_hostname> [:<portnum>] <adapter_name>
vicfg-iscsi -S -a -i <stor_ip_addr|stor_hostname> [:<portnum>] --n <target_name>
<adapter_name>
vicfg-iscsi --static --add --ip <stor_ip_addr|stor_hostname> [:<portnum>] --name
<target_name> <adapter_name>
VMware, Inc. 77
Chapter 4 iSCSI Storage Management with vicfg-iscsi

5 (Optional)SettheauthenticationinformationforCHAPbyrunningvicfg-iscsi -A.
vicfg-iscsi -A -c <level> -m <auth_method> -u <auth_u_name> -w <auth_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name]] <adapter_name>
vicfg-iscsi --authentication --level <level> --method <auth_method>
--auth_username <auth_u_name> --auth_password <auth_password>
[--ip <stor_ip_addr|stor_hostname> [:<portnum>] [-name <iscsi_name]]
<adapter_name>
6 (Optional)SettheauthenticationinformationformutualCHAPbyrunningvicfg-iscsi -Aagainwith
adifferentauthenticationusernameandpasswordandthe-boption.
7 (Optional)SetiSCSIparametersbyrunningvicfg-iscsi -W.
8 Aftersetupiscomplete,callvicfg-rescantorescanallstoragedevices.
Tasks Required for Hardware iSCSI Setup
ThissectionliststhetasksrequiredforhardwareiSCSIsetup.Itdoesnotgivestepbystepinstruction.Foreach
task,seethediscussionofthecorrespondingcommandlineoptionformoreinformation.
1 DeterminetheHBAtypeandretrievetheHBAIDbyrunningvicfg-iscsi -H -l.
vicf-iscsi.pl --adapter --list
2 Configurethehardwareinitiatorbyrunningvicfg-iscsi -N.
3 (Optional)SettheiSCSInameandaliasbyrunningvicfg-iscsi -I.
vicfg-iscsi -I -n <iscsi_name> <adapter_name>
vicfg-iscsi --iscsiname --name <iscsi_name> <adapter_name>
vicfg-iscsi -I -a <alias_name> <adapter_name>
vicfg-iscsi --iscsiname --alias <alias_name> <adapter_name>
4 Addadynamicdiscoveryaddressbyrunningvicfg-iscsi -Dorsetastaticdiscoveryaddressby
runningvicfg-iscsi -S.
5 (Optional)SettheauthenticationinformationforCHAPbyrunningvicfg-iscsi -A.Youcansetthe
informationforperadapter,perdiscovery,andpertargetCHAP.
MutualCHAPisnotsupportedforhardwareiSCSIstorage.
6 (Optional)SetadditionaliSCSIparametersbyrunningvicfg-iscsi -W.
7 Aftersetupiscomplete,callvicfg-rescantorescanallstoragedevices.
vSphere Command-Line Interface Installation and Reference Guide
78 VMware, Inc.

VMware, Inc. 79

5
Thischapterdiscussesvmware-cmd,avSphereCLIcommandforvirtualmachinemanagement.Youcanuse
vmware-cmdforregisteringavirtualmachineonthelocalserver,gettingthepowerstateofavirtualmachine,
settingconfigurationvariables,andsomeothertasks.
Thischapterincludesthefollowingtopics:
ConnectionOptionsforvmwarecmdonpage 79
GeneralOptionsforvmwarecmdonpage 80
ServerOptionsforvmwarecmdonpage 80
VirtualMachineOptionsforvmwarecmdonpage 80
vmwarecmdExamplesonpage 82
Connection Options for vmware-cmd
Thevmware-cmdvSphereCLIcommandsupportsonlythefollowingconnectionoptions.Otherconnection
optionsarenotsupported.
Virtual Machine Management with
vmware-cmd 5
IMPORTANTOlderserviceconsoleversionsofvmware-cmdsupportasetofconnectionoptionsandgeneral
optionsthatdifferfromtheoptionsinothervSphereCLIcommands.Thevmware-cmdvSphereCLI
commandsupportstheseoptions.ThevSphereCLIcommandalsosupportsthestandardvSphereCLI
--server,--username,and--passwordoptions,butnoneoftheotherconnectionoptions.
Table 5-1. vmware-cmd Connection Options
Option Description
--server <host>
-H <host>
TargetESX/ESXihostorvCenterServersystem.
-T <target> Whenyourunvmware-cmd withthe-HoptionpointingtoavCenterServersystem,use
-TtospecifytheESX/ESXihosttorunthecommandagainst.
-O <port> Alternativeconnectionport.Thedefaultportnumberis902.
username <username>
-U <username>
Userwhoisauthorizedtologintothehostspecifiedby-Hor-T.
password <password>
-P <password>
Passwordfortheuserspecifiedby-U.
-Q <protocol> Protocoltouse,eitherhttporhttps.Defaultishttps.
vSphere Command-Line Interface Installation and Reference Guide
80 VMware, Inc.

General Options for vmware-cmd
Thevmware-cmdvSphereCLIcommandsupportsthefollowinggeneraloptions.
Server Options for vmware-cmd
ThefollowingoptionsperformoperationsontheESX/ESXihostyouareconnectedto.Whenspecifying
vm-path,chooseoneofthefollowingformats:
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)
Virtual Machine Options for vmware-cmd
ThefollowingoptionsperformoperationsonvirtualmachinesontheESX/ESXihostyouareconnectingto.
Theseoptionsarenotprecededbyminus()onthecommandline.Therearenoshortoptions.
Whenspecifyingvm-path,chooseoneofthefollowingformats:
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)
Table 5-2. vmware-cmd General Options
Option Description
-h Printsahelpmessage,listingtheoptionsforthiscommand.
-q Runsinquietmodewithminimaloutput.Theoutputdoesnotdisplaythespecifiedoperationand
arguments.
-v Runsinverbosemode.
Table 5-3. vmware-cmd Server Operations
Server Operation Description
-l Liststheregisteredvirtualmachinesontheserver.
-s register <vm-path>
<datacenter> <resource_pool>
Registersavirtualmachinespecifiedby<vm-path>ontheserver.
WhenyourunagainstavCenterServersystem,youmustspecifythedatacenter
andtheresourcepooltoregisterthevirtualmachinein.Thedefaultdatacenter
isha-datacenterandthedefaultresourcepoolisResources.
WhenyourunagainstanESX/ESXihost,youusuallydonotspecifytheresource
poolanddatacenter.However,iftwovirtualmachineswiththesamenameexist
intworesourcepools,youmustspecifytheresourcepool.
-s unregister <vm-path> Unregistersavirtualmachinespecifiedby<vm-path>ontheserver.
VMware, Inc. 81
Chapter 5 Virtual Machine Management with vmware-cmd

Table 5-4. Commands That Apply to Any vSphere Host
Command Description
<vm-path> answer Promptstheusertoansweraquestionforavirtualmachinewaitingforuserinput.
<vm-path> connectdevice
<device_name>
Connectsthespecifiedvirtualdevicetoavirtualmachine.
<vm-path> createsnapshot
<name> <description>
<quiesce> <memory>
Createsasnapshotofthespecifiedvirtualmachine,providinganameand
descriptionforthesnapshot.
Ifthe<quiesce>flagis1andthevirtualmachineispoweredonwhenthe
snapshotistaken,VMwareToolsisusedtoquiescethefilesysteminthevirtual
machine.Quiescingafilesystemisaprocessofbringingtheondiskdataofa
physicalorvirtualcomputerintoastatesuitableforbackups.Thisprocessmight
includesuchoperationsasflushingdirtybuffersfromtheoperatingsystems
inmemorycachetodisk,orotherhigherlevelapplicationspecifictasks.
Ifthe<memory>flagis1,adumpoftheinternalstateofthevirtualmachineis
includedinthesnapshot.Memorysnapshotstakelongertocreate.
<vm-path> disconnectdevice
<device_name>
Disconnectsthespecifiedvirtualdevicefromthevirtualmachine.
<vm-path> getconfigfile Returnsastringcontainingthenameofthevirtualmachineconfigurationfile.This
commandfailsifthevirtualmachineisnotconnected.
<vm-path> getguestinfo
<variable>
RetrievesthevalueforaGuestInfovariable.
Thevariablecontainstheattributesoftheguestoperatingsystemofavirtual
machine.Forexample,youcanrunvmware-cmd <vm-path> getguestinfo ipto
retrievetheIPaddressofavirtualmachine.
YouusuallyusethiscommandwhenVMwareTechnicalSupportoraVMware
KnowledgeBasearticleinstructyoutodoso.
<vm-path> getproductinfo
<prodinfo>
Returnsinformationabouttheproduct,where<prodinfo>isproduct,platform,
build,majorversion(productmajorversionnumber),orminorversion(product
minorversionnumber).
Ifproductisspecified,thereturnvalueisoneofthefollowing:
gsxVMwareServerorGSXServer
esxVMwareESX
embeddedESXVMwareESXi
vpx VMwarevCenterServer
unknown(unknownproducttype)
Ifplatformisspecified,thereturnvalueisoneofthefollowing:
win32-x86x86basedWindowssystem
linux-x86x86basedLinuxsystem
vmnix-x86x86ESX/ESXimicrokernel
<vm-path> getstate Retrievestheexecutionstateofavirtualmachine.Thestatecanbeon,off,
suspended,orunknown.
<vm-path>
gettoolslastactive
Returnsanintegerindicatinghowmuchtimehaspassed,inseconds,sincethelast
heartbeatwasdetectedfromtheVMwareToolsservice.Thisvalueisinitializedto
zerowhenthevirtualmachinepowerson.Itstaysatzerountilthefirstheartbeatis
detected.Afterthefirstheartbeat,thevalueisalwaysgreaterthanzerountilthe
virtualmachineispowercycledagain.
Thecommandcanreturnoneofthefollowing:
0VMwareToolsarenotinstalledornotrunning.
1Guestoperatingsystemisrespondingnormally.
5Intermittentheartbeat.Theremightbeaproblemwiththeguestoperating
system.
100Noheartbeat.Guestoperatingsystemmighthavestoppedresponding.
<vm-path> getuptime Returnstheuptime(inseconds)oftheguestoperatingsystemonthevirtual
machine.
<vm-path> hassnapshot Returns1ifthevirtualmachinealreadyhasasnapshot.Returns0otherwise.
<vm-path> removesnapshots Removesallsnapshotsbelongingtothevirtualmachine.Ifnosnapshotexists,does
nothing.
vSphere Command-Line Interface Installation and Reference Guide
82 VMware, Inc.

Soft and Hard Power Operations
Whenyoucallvmware-cmdtostart,stop,reset,orsuspendavirtualmachine,youmustsupplyavalueforthe
powerop_modeflag.Thissectiondescribeswhathappenswhenthatvalueissoftorhard.
soft Power Operations
Whenyouspecifysoftasthepowerop_modevalue,thecommandperformsthefollowingoperations:
StopAttemptstoshutdowntheguestoperatingsystem,andthenpowersoffthevirtualmachine.
ResetAttemptstoshutdowntheguestoperatingsystem,andthenrebootsthevirtualmachine.
SuspendAttemptstorunascriptintheguestoperatingsystembeforesuspendingthevirtualmachine.
hard Power Operations
Whenyouspecifyhardasthepowerop_modevalue,thecommandimmediatelyandunconditionallypowers
off,resets,orsuspendsthevirtualmachine.
vmware-cmd Examples
Thefollowingexamplesforvmware-cmdrequireconnectionoptions.SeeConnectionOptionsfor
vmwarecmdonpage 79.
vmware-cmd.pl <conn_options> C:\home\vmware\win2000.vmx getstate
Retrievestheexecutionstateofavirtualmachine.C:\home\vmware\win2000.vmxisthepathtothevirtual
machineconfigurationfile.
vmware-cmd.pl <conn_options> -q C:\home\vmware\win2000.vmx reset hard
Performsahardreset,thatis,thevirtualmachineisresetimmediatelyandunconditionally.
-qindicatesthequietoption(onlytheresultsoftheoperationareprinted).
C:\home\vmware\win2000.vmxisthepathtothevirtualmachineconfigurationfile.
vmware-cmd.pl <conn_options> D:\dir.vmx connectdevice "CD/DVD Drive 2"
ConnectsthevirtualIDEdeviceCD/DVD Drive 2inaWindowsguestoperatingsystem.
vmware-cmd.pl <conn_options>
/vmfs/volumes/4654bb7d-37601c39-9c29-00145e5a8a9d/padellvm2/padellvm2.vmx getproductinfo product
Returns,forexample,getproductinfo(product) = esx.
<vm-path> reset
<powerop_mode>
Shutsdown,andthenrebootsavirtualmachine.Thepowerop_modecanbehardor
soft.Defaultissoft.SeeSoftandHardPowerOperationsonpage 82.
<vm-path> revertsnapshot Revertsthevirtualmachinetothecurrentsnapshot.Ifnosnapshotexists,does
nothingandleavesthevirtualmachinestateunchanged.
<vm-path> setguestinfo
<variable> <value>
WritesaGuestInfovariableintomemory.Thisisanadvancedcommand.You
usuallyusethiscommandwhenVMwareTechnicalSupportoraVMware
KnowledgeBasearticleinstructyoutodoso.
<vm-path> start Powersonapreviouslypoweredoffvirtualmachineorresumesasuspendedvirtual
machine.
<vm-path> stop
<powerop_mode>
Shutsdownandpowersoffavirtualmachine.Thepowerop_modecanbehardor
soft.Defaultissoft.SeeSoftandHardPowerOperationsonpage 82.
<vm-path> suspend
<powerop_mode>
Suspendsavirtualmachine.Thepowerop_modecanbehardorsoft.Defaultis
soft.SeeSoftandHardPowerOperationsonpage 82.
Table 5-4. Commands That Apply to Any vSphere Host (Continued)
Command Description
IMPORTANTYoumusthavethecurrentversionofVMwareToolsinstalledandrunningintheguestoperating
systemtouseasoftpoweroperation.
VMware, Inc. 83

6
Theesxclicommandisavailableasaserviceconsolecommand(noauthentication)andasavSphereCLI.
ThecommandisprimarilyusedforPSA(pluggablestoragearchitecture)management.TheESXConfiguration
GuideandtheESXiConfigurationGuidediscussPSAfunctionalityindetail.Thosedocumentsexplainhowto
usethevSphereClienttomanagethePSA,theassociatednativemultipathingplugin(NMP)andthirdparty
pluginsusingthevSphereClient.
Table 61liststheacronymsthischapteruses.
Thechapterincludesthesetopics:
esxcliCommandSyntaxonpage 83
ManagingNMPwithesxclinmponpage 84
UsingesxcliswiscsinicforNICBindingonpage 90
PathClaimingwithesxclicorestorageclaimingonpage 91
ManagingClaimRuleswithesxclicorestorageclaimruleonpage 92
PathMaskingwithesxclicorestorageclaimruleonpage 96
esxcli Command Syntax
TheesxclivSphereCLIcommandhasthefollowingsyntax:
esxcli <conn_options> <namespace> <app> <cmd> [cmd options]
Storage Path and Storage Plugin
Management with esxcli 6
Table 6-1. Pluggable Storage Architecture Acronyms
Acronym Meaning
PSA PluggableStorageArchitecture.
NMP NativeMultipathingPlugin.GenericVMwaremultipathingmodule.
PSP PathSelectionPlugin.Handlespathselectionforagivendevice.
SATP StorageArrayTypePlugin.Handlespathfailoverforagivenstoragearray.
Option Description
<conn_options> ConnectionparametersforthevSphereCLImustprecedeallotherparameters,oryoumust
performauthenticationinotherways.Forexample,youcanperformauthenticationusing
vifastpassonvMA,orusingenvironmentvariables.SeeSpecifyingAuthentication
Informationonpage 13.esxclidoesnotsupportthecredentialstore.
<namespace> Namespace.Oneofthefollowing:
nmpVMwarenativemultipathingcommands.
swiscsiCommandsinthesoftwareiSCSInamespace.
corestorageVMwarecorestoragecommands.
vSphere Command-Line Interface Installation and Reference Guide
84 VMware, Inc.

IncontrasttoothervSphereCLIcommands,esxcliisnotaPerlscriptanddoesnotrunwitha.plextension.
Onlythecommandoptionssupportcorrespondingshortoptions,therearenoshortoptionsforotherelements
(namespace,app,orcommand).
Help for esxcli
CommandlinehelpfortheesxclivSphereCLIisavailableonaperlevelbasis.Youcancallhelpasfollows:
Managing NMP with esxcli nmp
TheNMP(NativeMultipathingPlugin)isanextensiblemultipathingmodulethatESX/ESXisupportsby
default.Youcanuseesxcli nmptosetpathpolicies.
TheNMPsupportsallstoragearrayslistedontheVMwarestorageHardwareCompatibilityList(HCL)and
providesapathselectionalgorithmbasedonthearraytype.TheNMPassociatesasetofphysicalpathswith
aspecificstoragedevice(LUN).AStorageArrayTypePlugin(SATP)determineshowpathfailoverishandled
foraspecificstoragearray.APathSelectionPlugin(PSP)determineswhichphysicalpathisusedtoissuean
I/Orequesttoastoragedevice.SATPsandPSPsarepluginswithintheNMPplugin.
<app> Areawithinthenamespacetowhichthecommandapplies.
<cmd> Commandtobecalled.
<cmd options> Commandoptions.
IMPORTANTYoucanrunesxcliwith--serverpointingtoanESX/ESXihost,butnotwith--server
pointingtoavCenterServersystem.
esxclidoesnotsupportcredentialstoreauthenticationorthe--credstoreoption.
Option Description
Command Example Output
esxcli --help
esxcli -?
esxcli --help
esxcli -?
Displayshelpforsupported
connectionoptions.
esxcli <conn_options> --help
esxcli <conn_options> -?
esxcli --server S1 --help
esxcli --server S1 -?
Displayshelpforsupportedname
spaces.
esxcli <conn_parms> <namespace>
--help
esxcli <conn_parms> <namespace>
-?
esxcli --server S1 nmp --help
esxcli --server S1 nmp -?
Displayshelpforsupportedapps
forthisnamespace.
esxcli <conn_options>
<namespace> <app> --help
esxcli <conn_options>
<namespace> <app> -?
esxcli --server S1 nmp device
--help
esxcli --server S1 nmp device
-?
Displayshelpforsupported
commandsforthisapp.
esxcli <conn_options>
<namespace> <app> <command>
--help
esxcli <conn_options>
<namespace> <app> <command> -?
esxcli --server S1 nmp device
setpolicy --help
esxcli --server S1 nmp device
setpolicy -?
Displayshelpforsupportedoptions
forthiscommand.
IMPORTANTTheesxcli nmp bootoptionisinternaluseonlyandnotdiscussedinthisdocument.
VMware, Inc. 85
Chapter 6 Storage Path and Storage Plugin Management with esxcli

Device Management with esxcli nmp device
ThedeviceoptionperformsoperationsondevicescurrentlyclaimedbytheVMwareNMPplugin.
esxcli nmp device list
ThelistcommandliststhedevicescontrolledbyVMwareNMPandshowstheSATPandPSPinformation
associatedwitheachdevice.ToshowthepathsclaimedbyNMP,callesxcli nmp path list.
esxcli nmp device setpolicy
ThesetpolicycommandsetsthePathSelectionPolicy(PSP)forthespecifieddevicetooneofthepolicies
loadedonthesystem.
Examples
esxcli <conn_options> nmp device setpolicy --device naa.xxx --psp VMW_PSP_FIXED
SetsthepathpolicyforthespecifieddevicetoVMW_PSP_FIXED.
Fixed Path Selection Policy Operations with esxcli nmp fixed
ThefixedoptiongetsandsetsthepreferredpathpolicyforNMPdevicesconfiguredtouseVMW_PSP_FIXED.
esxcli nmp fixed getpreferred
ThegetpreferredcommandretrievesthepreferredpathonaspecifieddevicethatisusingNMPandthe
VMW_PSP_FIXEDPSP.
Example
esxcli <conn_options> nmp device getpreferred --device naa.xxx
Returnsthepathconfiguredasthepreferredpathforthespecifieddevice.
Table 6-2. esxcli nmp device list Options
Options Description
--device <device>
-d <device>
Filterstheoutputofthecommandtoshowinformationaboutasingledevice.Defaultisall
devices.
Table 6-3. esxcli nmp device setpolicy Options
Options Description
--default
-E
SetsthePSPbacktothedefaultfortheSATPassignedtothisdevice.
--device <device>
-d <device>
DevicetosetthePSPfor.
--psp <PSP>
-P <PSP>
PSPtoassigntothespecifieddevice.Callesxcli nmp psp listtodisplayallcurrently
availablePSPs.
ThefollowingPSPsarecurrentlysupported:
VMW_PSP_FIXEDFixedpathpolicy.Ifyouusethatpolicy,useesxcli nmp fixedtoset
orgetthepreferredpath.
VMW_PSP_MRUMostrecentlyusedpathpolicy.
VMW_PSP_RRRoundrobinpathpolicy.
SeetheESXConfigurationGuideandtheESXiConfigurationGuideforadiscussionofpath
policies.
Table 6-4. esxcli nmp fixed getpreferred Options
Options Description
--device <device>
-d <device>
Deviceforwhichyouwanttogetthepreferredpath.Thisdevicemustbecontrolledbythe
FixedPSP.
vSphere Command-Line Interface Installation and Reference Guide
86 VMware, Inc.

esxcli nmp fixed setpreferred
ThesetpreferredcommandsetsthepreferredpathonaspecifieddevicethatisusingNMPandthefixed
pathpolicy.
Example
esxcli <conn_options> nmp fixed setpreferred --device naa.xxx --path vmhba3:C0:T5:L3
Setsthepreferredpathforthespecifieddevicetovmhba3:C0:T5:L3.
Path Operations with esxcli nmp path
ThepathoptionlistspathsclaimedbyNMP.Toshowthedevices,callesxcli nmp device list.
esxcli nmp path list
ThelistcommandlistspathsclaimedbytheVMwareNMPandshowstheSATPandPSPinformation
associatedwitheachpath.
PSP Operations with esxcli nmp psp
ThepspoptionperformsoperationsonpathselectionpolicypluginsincludedwiththeVMwareNMPplugin.
ThisoptioncanbeusedtomanageVMwarePSPsandthirdpartyPSPs.WhenusedwiththirdpartyPSPs,the
syntaxdependsonthethirdpartyPSPimplementation.
esxcli nmp psp getconfig
ThegetconfigcommandretrievesPSPconfigurationparameters.ThetypeofPSPdetermineswhetheryou
specify--device,--path,orboth.
Examples
esxcli <conn_options> nmp psp getconfig --device naa.xxx
ReturnsthePSPconfigurationforthespecifieddevice.
Table 6-5. esxcli nmp fixed setpreferred Options
Options Description
--device <device>
-d <device>
Deviceforwhichyouwanttosetthepreferredpath.Thisdevicemustbecontrolledbythe
FixedPSP.
Useesxcli nmp device --listtolistthepoliciesforalldevices.
--path <path>
-p <path>
Pathtosetasthepreferredpathforthespecifieddevice.
Table 6-6. esxcli nmp path list Options
Options Description
--device <device>
-d <device>
Filtertheoutputofthiscommandtoonlyshowpathstoasingledevice.
--path <path>
-p <path>
Filtertheoutputofthiscommandtoonlyshowinformationforasinglepath.
Bydefault,the--list commanddisplaysinformationaboutallpaths.
Table 6-7. esxcli nmp psp getconfig Options
Options Description
--device <device>
-d <device>
DeviceyouwanttogetPSPconfigurationinformationfor.
Use--deviceforPSPsthataresettoVMW_PSP_RR,VMW_PSP_FIXEDorVMW_PSP_MRU.
--path <path>
-p <path>
PathyouwanttogetPSPconfigurationinformationfor.
Use--pathtoretrieveinformationaboutaPSPthatissettoVMW_PSP_FIXEDorVMW_PSP_MRU.
NopathconfigurationinformationisavailableforVMW_PSP_RR.
VMware, Inc. 87
Chapter 6 Storage Path and Storage Plugin Management with esxcli

esxcli <conn_options> nmp psp getconfig --path vmhba4:C1:T2:L23
ReturnsthePSPconfigurationforthespecifiedpath.
esxcli nmp psp list
ShowsthelistofPathSelectionPluginsonthesystemandabriefdescriptionofeach.
esxcli nmp psp setconfig
ThiscommandsupportsfuturethirdpartyPSAexpansion.ThesetconfigcommandsetsPSPconfiguration
parametersforthosethirdpartyextensions.
Theoptionsdependonthecurrentlysetpathpolicy.
Examples
esxcli <conn_options> nmp psp setconfig --path vnhba42:C1:T1:L1 --config preferred
Setsthepreferredpathtothespecifiedpath.SupportedonlyifthedeviceusesVMW_PSP_FIXED.
esxcli <conn_options> nmp psp setconfig --device naa.xxx --config policy=iops;iops=4200
Setsthespecifieddevicetochangepathseachtime4200I/Ooperationshavebeencompleted.Thepolicyand
thesettingofiopsareseparatedbyasemicolon.SupportedonlyifthedeviceissetuptouseVMW_PSP_RR.
Useesxcli nmp roundrobin setconfigtosetthevalueofroundrobinparameters.
Round Robin Operations with esxcli nmp roundrobin
TheroundrobinoptionsetsroundrobinpathoptionsonadevicecontrolledbytheroundrobinPSP.
esxcli nmp roundrobin getconfig
ThegetconfigcommandretrievespathselectionsettingsforadevicethatisusingtheroundrobinPSP.
NOTEUseesxcli roundrobin setconfigforotherpathpolicyconfiguration.
Table 6-8. esxcli nmp psp setconfig Options
Options Description
--config <config_string>
-c <config_string>
Configurationstringtosetforthedevicespecifiedby--path.
VMW_PSP_FIXEDIfthecurrentpathpolicyisVMW_PSP_FIXED,youcanspecifythe
preferredpathusingthepreferredconfigurationstring.
VMW_PSP_RRIfthecurrentpathpolicyisVMW_PSP_RR,youcanspecifyapolicy
string.Thestringcanbeiops,bytes,orrr(roundrobin).Usethisoptiontospecifyhow
theroundrobinPSPdetermineswhentoswitchpaths.
iops =<number>SwitchtothenextpathassoonasthespecifiednumberofI/O
operationshasbeenperformed.
bytes=<number>Numberofbytesbeforepathswitching.
useANO=<number>Ifsetto1,theroundrobinPSPincludespathsintheactive,
unoptimizedstateintheroundrobinset.If0,thePSPusesactive,unoptimized
pathsonlyifnoactiveoptimizedpathsareavailable.Otherwise,thePSPincludes
onlyactiveoptimizedpathsintheroundrobinpathset.
--device <device>
-d <device>
Deviceforwhichyouwanttocustomizethepathpolicy.
--path <path>
-p <path>
Pathforwhichyouwanttocustomizethepathpolicy.
Table 6-9. esxcli nmp roundrobin getconfig Options
Options Description
-d <device>
--device <device>
Devicetogetroundrobinpropertiesfor.
vSphere Command-Line Interface Installation and Reference Guide
88 VMware, Inc.

esxcli nmp roundrobin setconfig
ThesetconfigcommandspecifiesunderwhichconditionsadevicethatisusingtheroundrobinPSP
changestoadifferentpath.Youcanuse--bytesor--iopstospecifywhenthepathshouldchange.
Examples
esxcli <conn_options> nmp roundrobin setconfig --type "bytes" -B 12345 --device naa.xxx
Setsthedevicespecifiedby--devicetoswitchtothenextpatheachtime12345byteshavebeensentalong
thecurrentpath.
esxcli <conn_options> nmp roundrobin setconfig --type=iops --iops 4200 --device naa.xxx
Setsthedevicespecifiedby--devicetoswitchafter4200I/Ooperationshavebeenperformedonapath.
SATP Operations with esxcli nmp satp
ThesatpoptionmanagesSATPsandallowsyoutoperformanumberoftasks.
Retrieveandsetconfigurationparameters
AddanddeleterulesfromthelistofclaimrulesforaspecifiedSATP
SetthedefaultPSPforaspecifiedSATP
ListSATPsthatarecurrentlyloadedintoNMPandtheassociatedclaimrules
Bydefault,thedefaultSATPforanactiveactivearraywithavendorandmodelnotlistedintheSATPrulesis
VMW_SATP_LOCAL.
esxcli nmp satp addrule
TheaddrulecommandaddsaruletothelistofclaimrulesforthespecifiedSATP.Theoptionsyouspecify
definetherule.Forexample,thefollowingcommandspecifiesthatifapathhasvendorVMWAREandmodel
Virtual,thePSAassignsittotheVMW_SATP_LOCALSATP.
esxcli nmp satp addrule --satp="VMW_SATP_LOCAL" --vendor="VMWARE" --model="Virtual"
--description="VMware virtual disk
d
Table 6-10. esxcli nmp roundrobin setconfig Options
Options Description
--bytes
-B
NumberofbytestosendalongonepathforthisdevicebeforethePSPswitchestothenextpath.
Youcanusethisoptiononlywhen--typeissettobytes.
--device
-d
Devicetosetroundrobinpropertiesfor.ThisdevicemustbecontrolledbytheroundrobinPSP
(VMW_PSP_RR).
--iops
-I
NumberofI/OoperationstosendalongonepathforthisdevicebeforethePSPswitchestothe
nextpath.Youcanusethisoptiononlywhen--typeissettoiops.
--type
-t
Typeofroundrobinpathswitchingtoenableforthisdevice.Eitherbytesoriops.
Anequalsign(=)beforethetypeordoublequotesaroundthetypeareoptional.
--useANO
-U
Ifsetto1,theroundrobinPSPincludespathsintheactive,unoptimizedstateintheroundrobin
set.Ifsetto0,thePSPusesactive,unoptimizedpathsonlyifnoactiveoptimizedpathsare
available.Otherwise,thePSPincludesonlyactiveoptimizedpathsintheroundrobinpathset.
Table 6-11. esxcli nmp satp addrule Options
Options Description
--claim-option
-c
ClaimoptionstringtosetwhenaddingtheSATPclaimrule.
--description
-e
DescriptionstringtosetwhenaddingtheSATPclaimrule.
--driver
-D
DriverstringtosetwhenaddingtheSATPclaimrule.
Youcanspecify--driver,--vendor,--transport,or--model.
VMware, Inc. 89
Chapter 6 Storage Path and Storage Plugin Management with esxcli

Examples
esxcli <conn_options> nmp satp addrule --satp="VMW_SATP_LOCAL" --vendor="VMWARE"
--model="Virtual" --description="VMware virtual disk"
AddsarulethatspecifiesthatdiskswithvendorstringVMWAREandmodelstringVirtualshouldbeaddedto
VMW_SATP_LOCAL.
esxcli <conn_options> nmp satp addrule --satp="VMW_SATP_LOCAL" --driver="somedriver"
AddsarulethatspecifiesthatdiskswiththedriverstringsomedrivershouldbeaddedtoVMW_SATP_LOCAL.
esxcli <conn_options> nmp satp addrule --satp VMW_SATP_DEFAULT_AA --vendor="ABC" --model="^120*
AddsarulethatspecifiesthatallstoragedeviceswithvendorstringABCandamodelnamethatstartswith
120shoulduseVMW_SATP_DEFAULT_AA.VMW_SATP_DEFAULT_AAisanexample.
esxcli nmp satp deleterule
ThedeleterulecommanddeletesarulefromthelistofclaimrulesforthespecifiedSATP.Youcancallthis
commandwiththesameoptionsasaddrule,showninTable 611.
Example
C:\WINDOWS\system32>esxcli <conn_options> nmp satp deleterule
--satp="VM_VMW_SATP_LOCAL" --vendor="VMWARE" --model="Virtual"
DeletestherulethatassignsdeviceswithvendorstringVMWAREandmodelstringVirtualto
VM_VMW_SATP_LOCAL.
esxcli nmp satp getconfig
ThegetconfigcommandretrievesperpathorperdeviceSATPconfigurationparameters.ForeachSATP,
specifyeither--deviceor--path,butnotboth.
esxcli nmp satp list
ThelistcommandliststheSATPsthatarecurrentlyloadedintotheNMPsystemanddisplaysinformation
aboutthoseSATPs.Thiscommandsupportsnooptions.
--model
-M
ModelstringtosetwhenaddingtheSATPclaimrule.Canbethemodelnameorapattern
^mod*,whichmatchesalldevicesthatstartwithmod.Thatis,thepatternsuccessfullymatches
mod1andmodz,butnotmymod1.
Youcanspecify--driver,--vendor,--transport,or--model.
--option
-o
OptionstringtosetwhenaddingtheSATPclaimrule.
--satp
-s
SATPforwhichthenewruleisadded.
--transport
-R
TransportstringtosetwhenaddingtheSATPclaimrule.DescribesthetypeofstorageHBA,for
example,iscsiorfc.
Youcanspecify--driver,--vendor,--transport,or--model.
--vendor
-V
VendorstringtosetwhenaddingtheSATPclaimrule.
Youcanspecify--driver,--vendor,--transport,or--model.
Table 6-12. esxcli nmp satp getconfig Options
Options Description
--device <device>
-d <device>
DevicetoretrieveSATPconfigurationfor.NotallSATPssupportthegetconfigoptionfor
devices.
--path
-p
PathtoretrieveSATPconfigurationfor.NotallSATPssupportthegetconfigoptionforpaths.
Table 6-11. esxcli nmp satp addrule Options (Continued)
Options Description
vSphere Command-Line Interface Installation and Reference Guide
90 VMware, Inc.

esxcli nmp satp listrules
ThelistrulescommandliststheclaimrulesforSATPs.
esxcli nmp satp setconfig
ThesetconfigcommandsetsperpathorperdeviceSATPconfigurationparameters.Thiscommandsetsthe
configurationforaspecifieddeviceorpath,regardlessoftheSATPcurrentlyassociatedwiththatdeviceor
path.
ThiscommandisintendedforusewiththirdpartySATPsloadedintothesystem.
esxcli nmp satp setdefaultpsp
ThesetdefaultpspcommandsetsthedefaultPSPforaspecifiedSATP.
Using esxcli swiscsi nic for NIC Binding
Theesxcli swiscsi niccommandspecifiesNICbindingsforVMkernelNICs.
esxcli swiscsi nic add
TheaddcommandaddsasoftwareiSCSINICtothespecifiedadapter.
Table 6-13. esxcli nmp satp listrules Options
Options Description
--satp
-s
DisplaystheSATPrulesforthespecifiedSATP.
Ifyouusethisoption,itmustspecifyavalidloadedSATPplugin,asdisplayedbyesxcli nmp
satp list.
Table 6-14. esxcli nmp satp setconfig Options
Options Description
--config
-c
Configurationstringtosetforthepathspecifiedby--pathorthedevicespecifiedby
--device.
YoucansettheconfigurationforthefollowingSATPs:
VMW_SATP_ALUA_CX
VMW_SATP_ALUA
VMW_SATP_CX
VMW_SATP_INV
Youcanspecifyoneofthefollowingdeviceconfigurationstrings:
navireg_onstartsautomaticregistrationofthedevicewithNavisphere.
navireg_offstopstheautomaticregistrationofthedevice.
ipfilter_onstopsthesendingofthehostnameforNavisphereregistration.Usedifhost
isknownaslocalhost.
ipfilter_offenablesthesendingofthehostnameduringNavisphereregistration.
--device
-d
DevicetosetSATPconfigurationfor.NotallSATPssupportthesetconfigoptionondevices.
--path
-p
PathtosetSATPconfigurationfor.NotallSATPssupportthesetconfigoptiononpaths.
Table 6-15. esxcli nmp satp setdefaultpsp Options
Options Description
--psp
-P
DefaultpathselectionpolicytosetfortheSATPspecifiedby--satp.
--satp
-s
SATPnameforthepluginforwhichyouwanttosetthedefaultPSP.
VMware, Inc. 91
Chapter 6 Storage Path and Storage Plugin Management with esxcli

esxcli swiscsi nic remove
TheremovecommandremovesaVMkerneliSCSINICfromthecurrentiSCSIconfiguration.
esxcli swiscsi nic list
ThelistcommandlistsexistingsoftwareiSCSINICsforthespecifiedadapter.
Examples
esxcli <conn_options> swiscsi nic list -d vmhba34
ListsexistingsoftwareiSCSINICsonadaptervmhba34.
esxcli <conn_options> swiscsi nic add -n vmk2 -d vmhba34
AddsasoftwareiSCSINICcalledvmk2toadaptervmhba34.
esxcli --server 10.NN.NNN.NNN swiscsi nic remove -n vmk2 -d vmhba34
RemovesthesoftwareiSCSINICvmk2fromadaptervmhba34.
Path Claiming with esxcli corestorage claiming
Theesxcli corestorage claimingoptionincludesanumberoftroubleshootingcommands.These
commandsarenotpersistentandareusefulonlytodeveloperswhoarewritingPSApluginsor
troubleshootingasystem.IfI/Oisactiveonthepath,unclaimeventsfailandreclaimingalsodoesnotwork.
esxcli corestorage claiming reclaim
Thereclaimtroubleshootingcommandfirstattemptstounclaimallpathstoadevice.Thecommandthen
runstheloadedclaimrulesoneachoftheunclaimedpathstoreclaimthosepaths.Itisnormalforthis
commandtonotsucceedifthedeviceisinuse.OnlyPSAplugindevelopersoradministratorswho
troubleshootPSApluginsusethiscommand.
Table 6-16. esxcli swiscis nic add Options
Options Description
--adapter
-d
Device(adapter)toperformtheoperationon.
-n
--nic
NameoftheiSCSINICtobeaddedorremoved.
Table 6-17. esxcli swiscis nic remove Options
Options Description
--adapter
-d
Device(adapter)toperformtheoperationon.
-n
--nic
NameoftheiSCSINICtobeaddedorremoved.
Table 6-18. esxcli swiscis nic remove Options
Options Description
--adapter
-d
Device(adapter)toperformtheoperationon.
IMPORTANTThe--helpcommandforesxcli corestorage claiming includestheautoclaimcommand.
DonotusethiscommandunlessinstructedtodosobyVMwaresupportstaff.
vSphere Command-Line Interface Installation and Reference Guide
92 VMware, Inc.

esxcli corestorage claiming unclaim
Theunclaimcommandunclaimsapathorsetofpaths,anddisassociatesthosepathsfromaPSAplugin.Itis
normalforthiscommandstonotsucceedifthedeviceisinuse.
YoucanonlyunclaimactivepathswithnoI/O.YoucannotunclaimtheESXiUSBpartitionordeviceswith
VMFSvolumesonthem.Itisthereforenormalforthiscommandtofail,especiallywhenyouspecifyaplugin
oradaptertounclaim.
Unclaimingdoesnotpersist.Periodicpathclaimingreclaimsunclaimedpathsunlessclaimrulesare
configuredtomaskapath.
Example
esxcli <conn_options> corestorage claiming unclaim --type location -A vmhba1
Troubleshootingcommandtounclaimallpathstovmhba1.Runvicfg-mpath.pl <conn_options> -lto
verifythecommandsucceeded.
Managing Claim Rules with esxcli corestorage claimrule
ThePSAusesclaimrulestodeterminewhichmultipathingmoduleshouldclaimthepathstoaparticular
deviceandtomanagethedevice.esxclicorestorage claimrulemanagesclaimrules.
ClaimrulemodificationdoesnotoperateontheVMkerneldirectly.Insteaditoperatesontheconfiguration
filebyaddingandremovingrules.
Table 6-19. esxcli corestorage claiming reclaim Options
Options Description
--device <device>
-d <device>
Nameofthedeviceonwhichallpathsarereclaimed.
--help Displaysthehelpmessage.
Table 6-20. esxcli corestorage claiming unclaim Options
Options Description
--adapter <adapter>
-A <adapter>
If--typeissettolocation,specifiesthenameoftheHBAforthepathsyouwantto
unclaim.Ifyoudonotspecifythisoption,unclaimingrunsonpathsfromalladapters.
--channel <channel>
-C <channel>
If--typeissettolocation,specifiestheSCSIchannelnumberforthepathsyouwantto
unclaim.Ifyoudonotspecifythisoption,unclaimingrunsonpathsfromallchannels.
--device <device>
-d <device>
If--typeissettodevice,attemptstounclaimallpathstothespecifieddevice.Ifthereare
activeI/Ooperationsonthespecifieddevice,atleastonepathcannotbeunclaimed.
--driver <driver>
-D <driver>
If--typeisdriver,unclaimsallpathsspecifiedbythisHBAdriver.
--lun <lun_number>
-L <lun_number>
If--typeislocation,specifiestheSCSILUNforthepathstounclaim.Ifyoudonotspecify
--lun,unclaimingrunsonpathswithanyLUNnumber.
--path <path>
-p <path>
If--typeispath,unclaimsapathspecifiedbyitspathUIDorruntimename.
--plugin <plugin>
-P
If--typeisplugin,unclaimsallpathsforaspecifiedmultipathplugin.
<plugin>canbeanyvalidPSApluginonthesystem.BydefaultonlyNMPandMASK_PATH
areavailable,butadditionalpluginsmightbeinstalled.
--target <target>
-T <target>
If--typeislocation,unclaimsthepathswiththeSCSItargetnumberspecifiedbytarget.
Ifyoudonotspecify--target,unclaimingrunsonpathsfromalltargets.
--type <type>
-t <type>
Typeofunclaimoperationtoperform.Validvaluesarelocation,path,driver,device,
andplugin.
VMware, Inc. 93
Chapter 6 Storage Path and Storage Plugin Management with esxcli

ChangingthecurrentclaimrulesintheVMkernelrequiresthesecalls:
1 Acalltooneoftheesxcli corestorageclaimrulemodificationcommands(add,remove,ormove).
2 Acalltoesxcli corestorage claimrule loadtoreplacethecurrentrulesintheVMkernelwiththe
modifiedrulesfromtheconfigurationfile.
esxcli corestorage claimrule add
Theaddcommandaddsaclaimruletothesetofclaimrulesonthesystem.Youcanusethiscommandtoadd
newclaimrulesortomaskapathusingtheMASK_PATHclaimrule.SeePathMaskingwithesxclicorestorage
claimruleonpage 96.
Table 6-21. esxcli corestorage claimrule add Options
Options Description
--adapter <adapter>
-A <adapter>
Adapterofthepathstouse.Validonlyif--typeislocation.
--channel <channel>
-C <channel>
Channelofthepathstouse.Validonlyif--typeislocation.
--driver <driver>
-D <driver>
DriverfortheHBAofthepathstouse.Validonlyif--typeisvendor.
--force
-f
Forceclaimrulestoignorevaliditychecksandinstalltherule.
--lun <lun_number>
-L <lun_number>
LUNofthepathstouse.Validonlyif--typeislocation.
--model <model>
-M <model>
Modelofthepathstouse.Validonlyif--typeisvendor.
ValidvaluesarevaluesoftheModelstringfromtheSCSIinquirystring.Run
vicfg-scsidevs.pl <conn_options> -loneachdevicetoseemodelstringvalues.
--plugin
-P
PSAplugintouse.Currently,thevaluesareNMPorMASK_PATH,butthirdparties
canshiptheirownPSApluginsinthefuture.
MASK_PATHreferstothepluginMASK_PATH_PLUGIN.Thecommandadds
claimrulesforthispluginiftheuserwantstomaskthepath.
ESX3.5includestheMaskLUNsadvancedconfigurationoption.Thisoptionisnot
availableinESX/ESXi4.IthasbeenreplacedbytheMASK_PATH_PLUGIN.Youcan
addaclaimrulethatcausestheMASK_PATH_PLUGINtoclaimthepathtomaska
pathorLUNfromtheESX/ESXihost.SeePathMaskingwithesxclicorestorage
claimruleonpage 96.
--rule <rule_ID>
-r <rule_ID>
RuleIDtouse.Runesxcli corestorage claimrule listtoseetheruleID.The
ruleIDindicatestheorderinwhichtheclaimruleistobeevaluated.Userdefined
claimrulesareevaluatedinnumericorderstartingwith101.
--target <target>
-T <target>
Targetofthepathstouse.Validonlyif--typeislocation.
--transport <transport>
-R <transport>
Transportofthepathstouse.Validonlyif--typeistransport.Validvaluesare
blockblockstorageconnection
fcFibreChanneltransmission
iscsivendoriSCSIconnection
iscsinotcurrentlyused
ideIDEstorageconnection
sasSASstorageconnection
sataSATAstorageconnection
usbUSBstorageconnection
parallelparalleltransmission
unknown
vSphere Command-Line Interface Installation and Reference Guide
94 VMware, Inc.

Examples
esxcli <conn_options> corestorage claimrule add -r 321 -t location -A vmhba0 -C 0 -T 0 -L 0 -P NMP
Addsrule321,whichclaimsthepathonadaptervmhba0,channel0,target0,LUN0fortheNMPplugin.
esxcli <conn_options> corestorage claimrule add -r 429 -t driver -D mptscsi -P MASK_PATH
Addsrule429toclaimallpathsprovidedbyanadapterwiththemptscsidriverfortheMASK_PATHplugin.
esxcli <conn_options> corestorage claimrule add -r 914 -t vendor -V VMWARE -M Virtual -P NMP
Addsrule914toclaimallpathswithavendorstringthatmatchesVMWAREandamodelstringVirtualforthe
NMPplugin.
esxcli <conn_options> corestorage claimrule add -r 1015 -t transport -R fc -P NMP
Addsrule1015toclaimallpathsprovidedbyFibreChanneladaptersfortheNMPplugin.
esxcli corestorage claimrule convert
TheconvertcommandconvertsLUNmasksinESX3.5format(/adv/Disk/MaskLUNs)toclaimruleformat.
ThecommandwritestheconvertedlistanderasestheoldLUNmaskdata.
Youusethiscommandasfollows:
1 Callesxcli corestorage claimrule convertwithoutoptions.Thatcalldisplaysthelistofclaimrules
thatresultfromtheconversion.Forexample:
2 Callesxcli corestorage claimrule convert --committoactuallycommitthechange.
WhenyouconvertLUNmaskingtotheclaimruleformatafteranESX/ESXiupgradefromESX/ESXi3.5to
ESX/ESXi4.0,thiscommandconvertsthe/adv/Disk/MaskLUNsadvancedconfigurationentryinthe
esx.conffiletoclaimruleswithMASK_PATHastheplugin.
--type <type>
-t <type>
Typeofmatchingtousefortheoperation.Validvaluesarevendor,location,driver,
andtransport.
--vendor
-V
Vendorofthepathstouse.Validonlyif--typeisvendor.
ValidvaluesarevaluesoftheVendorstringfromtheSCSIinquirystring.Run
vicfg-scsidevs.pl <conn_options> -loneachdevicetoseevendorstring
values.
Table 6-21. esxcli corestorage claimrule add Options (Continued)
Options Description
Rule Plugin HbaName Controller Target LUN
120 MASK_PATH vmhba11 0 0 11
121 MASK_PATH vmhba11 0 0 10
122 MASK_PATH vmhba4 0 2 1
IMPORTANTThisconversiondoesnotworkforallinputMaskLUNvariations.Forexample,roleconversion
isnotsupportedforsoftwareiSCSILUNs.
Inspectthelistofgeneratedclaimrulescarefullybeforeyoucommitthembyusing--commit.
Table 6-22. esxcli corestorage claimrule convert Options
Options Description
--commit
-C
ForcesLUNmaskconfigurationchangestobesaved.Ifyoucallthecommandwithoutthis
parameter,changesarenotsavedandyoucanfirstinspectthegeneratedclaimrules.
VMware, Inc. 95
Chapter 6 Storage Path and Storage Plugin Management with esxcli

esxcli corestorage claimrule delete
Thedeletecommanddeletesaclaimrulefromthesetofclaimrulesonthesystem.
Example
esxcli <conn_options> corestorage claimrule delete -r 1015
Deletesrule1015.
esxcli corestorage claimrule list
Thelistcommandlistsallclaimrulesonthesystem.Thiscommandtakesnooptions.
Example
esxcli <conn_options> corestorage claimrule list
Mightdisplaysomethinglikethefollowing:
esxcli corestorage claimrule load
Theloadcommandloadsclaimrulesfromtheesx.confconfigurationfileintotheVMkernel.Developersand
experiencedstorageadministratorsmightusethiscommandforboottimeconfiguration.
Thiscommandhasnooptions,italwaysloadsallclaimrulesfromesx.conf.
esxcli corestorage claimrule move
ThemovecommandmovesaclaimrulefromoneruleIDtoanother.
IMPORTANTBydefault,thePSAclaimrule101masksDellarraypseudodevices.Donotdeletethisrule,
unlessyouwanttounmaskthesedevices.
Table 6-23. esxcli corestorage claimrule delete Options
Options Description
--rule <rule_ID>
-r <rule_ID>
IDoftheruletobedeleted.Runesxcli corestorage claimrule listtoseetheruleID.
Rule Class Type Plugin Matches
0 runtime transport NMP transport=usb
1 runtime transport NMP transport=sata
2 runtime transport NMP transport=ide
3 runtime transport NMP transport=block
101 runtime vendor MASK_PATH vendor=<VENDOR> model =<model>
101 file vencor MASK_PATH vendor=<VENDOR> model =<model>
55535 runtime vendor NMP vendor=*
model=*
Table 6-24. esxcli corestorage claimrule move Options
Options Description
--new-rule <rule_ID>
-n <rule_ID>
NewruleIDyouwanttogivetotherulespecifiedbythe--ruleoption.
--rule <rule_ID>
-r <rule_ID>
IDoftheruletobedeleted.Runesxcli corestorage claimrule listtodisplaythe
ruleID.
vSphere Command-Line Interface Installation and Reference Guide
96 VMware, Inc.

Example
esxcli <conn_options> corestorage claimrule move -r 1015 -n 1016
Renamesrule1016torule1015.Deletesrule1016.
esxcli corestorage claimrule run
Theruncommandrunspathclaimingrules.Thiscommandisfortroubleshootingandboottime
configuration.
Path Masking with esxcli corestorage claimrule
WithESX/ESXi4.0,youusetheMASK_PATHplugininsteadofanadvancedconfigurationoptiontomask
paths.
Maskingapathrequiresthesecalls:
1 Acalltoesxcli corestorage claimrule list.
YourunthiscommandtoseewhatthenextavailableruleIDis.UserruleIDsstartat101.Ifthiscommand
showsthatrule101and102alreadyexist,youcanspecify103fortheruletoadd.
Theclaimrulesareevaluatedinnumericalorderstartingfrom0.
Rules0100arereservedforinternalusebyVMware.
Rules10165435areavailableforgeneraluse.
Rules6543665535arereservedforinternalusebyVMware.
Other3rdpartysuppliedMultipathingPluginsinstalledonyoursystemmightuseclaimrulesinthe
rangeof10165435.
Whenaddingordeletingclaimrules,besuretoworkwithrulesinthecorrectnumericrange.Whenyou
addaMASK_PATHclaimrule,choosearulewitharuleIDlowerthantheruleIDthatcausesNMPorsome
othermultipathingplugintoclaimthepath.
Table 6-25. esxcli corestorage claimrule run Options
Options Description
--adapter <adapter>
-A <adapter>
If--typeislocation,nameoftheHBAforthepathstoruntheclaimruleson.To
runclaimrulesonpathsfromalladapters,omitthisoption.
--channel <channel>
-C <channel>
If--typeislocation,valueoftheSCSIchannelnumberforthepathstorunthe
claimruleson.Torunclaimrulesonpathswithanychannelnumber,omitthis
option.
--lun <lun>
-L <lun>
If--typeislocation,valueoftheSCSILUNforthepathstorunclaimruleson.To
runclaimrulesonpathswithanyLUN,omitthisoption.
--path <path_UID>
-p <path_UID>
If--typeispath,thisoptionindicatestheuniquepathidentifier(UID)orthe
runtimenameofapathtorunclaimruleson.
--target <target>
-T <target>
If--typeislocation,valueoftheSCSItargetnumberforthepathstorunclaim
ruleson.Torunclaimrulesonpathswithanytargetnumber,omitthisoption
--type
<location|path|all>
-t <location|path|all>
Typeofclaimtoperform.Bydefault,usesall,whichmeansclaimrulesrunwithout
restrictiontospecificpathsorSCSIaddresses.Validvaluesarelocation,path,and
all.
--wait
-w
Ifthisoptionisincluded,theclaimwaitsforpathstosettlebeforerunningtheclaim
operation.Inthatcase,thesystemdoesnotstarttheclaimingprocessuntilitislikely
thatallpathsonthesystemhaveappearedbeforestartingtheclaimprocess.
Aftertheclaimingprocesshasstarted,thecommanddoesnotreturnuntildevice
registrationhascompleted.
Ifyouaddorremovepathsduringtheclaimingorthediscoveryprocess,thisoption
mightnotworkcorrectly.Youcanusethisoptiononlyifyoualsouse--typeall.
VMware, Inc. 97
Chapter 6 Storage Path and Storage Plugin Management with esxcli

2 Acalltoesxcli corestorage claimrule add --plugin MASK_PATH --rule <ruleID> --type
<type> -A <adapter>.
3 Acalltoesxcli corestorage claimrule listtoverifythattheclaimrulewasaddedcorrectly.
4 Acalltoesxcli corestorage claimrule loadtoloadthepathclaimingrules.
5 Acalltocorestorage claiming unclaimforeachpathtothemaskeddevicetoremovetheoldrules.
6 Acalltoesxcli corestorage claimrule runtorunthepathclaimingrules,whichincludethenewly
addedrules.
Unmaskingapathrequiresthesecalls:
1 Acallto esxcli corestorage claimrule deletetoremovetheMASK_PATHclaimrule.
2 Acalltoesxcli corestorage claimrule listtoverifythattheclaimrulewasdeletedcorrectly.
3 Acalltoesxcli corestorage claimrule loadtoreloadthepathclaimingrulesfromtheconfiguration
fileintotheVMkernel.
4 Acalltoesxcli corestorage claiming unclaimforeachpathtothemaskeddevice.Forexample:
esxcli corestorage claiming unclaim -t location -A vmhba0 -C 0 -T 0 -L 149
5 Acalltoesxcli corestorage claimrule runtorunthepathclaimingrules.
Examples
esxcli <conn_options> corestorage claimrule add --plugin MASK_PATH --rule 103
--type location -A vmhba0 -C 0 -T 0 -L 3
Addsrule103tomaskpathvmhba0:C0:T0:L3.
esxcli <conn_options> corestorage claimrule add --plugin MASK_PATH --rule 103
--type location -A vmhba0 -C 0 -L 3
Addsrule103tomaskallpathstoLUN3onvmhba0andchannel0.
esxcli <conn_options> corestorage claimrule add --plugin MASK_PATH --rule 103
--type vendor -V ACME -M SuperDisk
Addsrule103tomaskallpathstoaLUNwithvendorACMEandmodelSuperDisk.
vSphere Command-Line Interface Installation and Reference Guide
98 VMware, Inc.

VMware, Inc. 99

MostvSphereCLIcommandsaresupportedagainstbothESX3.5Update2andlaterandagainstESX4.x
systems.Thetwoexceptions,vicfg-mpathandvihostupdatearesupportedonlyagainstESX4.xsystem.
Forthosetwocommands,the3.5versionsareincludedinthevSphereCLIpackageasvicfg-mpath35and
vihostupdate35.
Thisappendixisareferencetovicfg-mpath35andvihostupdate35.Theinformationisequivalenttothe
vicfg-mpathandvihostupdatedocumentationinthedocumentationsetforVMwareInfrastructure3.5.
Theappendixincludesthesetopics:
StorageArrayConfigurationforVMware Infrastructure 3.5Systemswithvicfgmpath35onpage 99
PerformingMaintenanceonVMwareInfrastructure 3.5Systemswithvihostupdate35onpage 101
Storage Array Configuration for VMware Infrastructure 3.5 Systems
with vicfg-mpath35
Thevicfg-mpath35commandcanconfiguremultipathsettingsforFibreChanneloriSCSILUNs.Formore
informationonmultipathing,seetheESXServerConfigurationGuideandtheESXServer3iConfigurationGuide
forversion3.5.TheFibreChannelSANConfigurationGuideandtheiSCSISANConfigurationGuidediscusssome
storagespecificaspectsofmultipathing.
NamesofvirtualmachineHBAsarenotguaranteedtobevalidacrossreboots.UseVMLLUNnamestobe
sureofconsistency.TheVMLnameofaLUNistheuniquenamegiventothatLUNbyVMware.Thisnameis
uniquetoaLUNandremainsassociatedwithaLUNacrossreboots.
Options
Table A1liststhecommandspecificoptionsforvicfg-mpath35.
Youmustalsospecifyconnectionoptions.Runvicfg-mpath35foralistofsupportedconnectionoptions.
Appendix: Commands for Managing Legacy
Servers
IMPORTANTIfyouarechangingthepreferredpathorifyouchangethestateofapath:
ThechangeoperationfailsifI/Oisactivewhenthepathsettingischanged.Reissuethecommand.
YoumustissueatleastoneI/Ooperationbeforethechangetakeseffect.
Table A-1. Options for vicfg-mpath35
Option Description
--bulk
-b
ShowsallLUNsandpathsinaformatthatscriptscanparseeasily.
--detailed
-d
ShowsallinformationaboutaLUNanditspathsincludingtheVMLnameoftheLUN.
ALUNsVMLnameisauniquenameVMwareassignstotheLUN.Thisnameisglobally
uniquetoaLUNandremainsassociatedwithaLUNacrossreboots.
vSphere Command-Line Interface Installation and Reference Guide
100 VMware, Inc.

Examples
Thefollowingexamplesforvicfg-mpath35requireconnectionoptions.Runvicfg-mpath35 --helpfora
listofsupportedconnectionoptions.
vicfg-mpath35.pl <conn_options> -l
Displaysallavailablepaths.
vicfg-mpath35.pl <conn_options> -q --lun=vml.123456
Displaysthepathsfordiskvml.123456.
vicfg-mpath35.pl <conn_options> --policy=mru --lun=vmhba0:0:1
Setsthepathpolicyfordiskvmhba0:0:1tomru.
vicfg-mpath35.pl <conn_options> --path=vmhba1:0:1 --lun=vmhba0:0:1 --state=on
Enablesapathfordiskvmhba0:0:1.
vicfg-mpath35.pl <conn_options> --path=vmhba0:1:1 --state=off --lun=vmhba0:0:1 -p fixed
Disablesapathandsetsthepolicytofixedfordiskvmhba0:0:1.
vicfg-mpath35.pl <conn_options> -l
ListsallLUNsonthesystemandthepathstotheseLUNsthroughadapters.
vicfg-mpath35.pl <conn_options> -a
DisplaysLUNinformation.Resultsinoutputlikethefollowing.
vmhba2 2305843973628581845 42:2.0
vmhba3 2305843973628747050 4c:00.0
vmhba4 2306125448607554858 4c:00.1
vmhba5 50:1.1
--hbas
-a
PrintsthelistofHBAsthatareidentifiablebyauniqueID.ThisincludesFibreChannel
andiSCSIdevices.Parallelandblockdevicesdonotappearinthislist.
--list
-l
ListsallLUNsonthesystemandthepathstotheseLUNsthroughadapters.Foreach
LUN,thiscommanddisplaysthetype,internalname,consolename,size,paths,andpath
selectionpolicy.
--lun=<lun>
-L=<lun>
RequiredtospecifytheLUNtouseinoperations.Thisoptionisarequiredparameterfor
otheroptionsandisnotusedbyitself.
--path=<path>
-P=<path>
Requiredtospecifythepathtouseinoperations.Thisoptionisarequiredparameterfor
otheroptionsandisnotusedbyitself.
ThepathnamecanbeeitherthelongpathUIDortheshorterruntimenameofthepath.
Youcanuse--pathtofilterwhatthelistcommandsreturn.
--policy [mru|fixed]
-p [mru|fixed]
SetthepolicyforagivenLUNtomruorfixed.Thisoptionrequiresthe--lunoption.
MostRecentlyUsed(mru)selectsthemostrecentlyusedpathtosendI/Otoadevice.
Fixed(fixed)usesonlytheactivepath.
Twoadditionalpolicies,roundrobin(rr)andcustomareavailableonanexperimental
basis.SeethetechnicalnoteRoundRobinLoadBalancing.
--preferred
-f
SetthespecifiedpathtobethepreferredpathforaspecifiedLUN.Whenyousetthis
option,youmustalsosetthe--lunand--pathoptions.
--query
-q
QueryaspecificLUNforitsinformationandprinttheinformation.Whenyousetthis
option,youmustalsosetthe--lunoption.
--state [on|off]
-s [on|off]
SetthestateofagivenLUNpathtoeitheronoroff.
Thisoptionrequiresthatboththe--lunand--pathoptionsarealsoset.
--vihost <host>
-h <host>
WhenyourunaRemoteCLIwiththe--serveroptionpointingtoavCenterServer
system,use--vihosttospecifytheESX/ESXisystemhosttorunthecommandagainst.
Table A-1. Options for vicfg-mpath35 (Continued)
Option Description
VMware, Inc. 101
Appendix: Commands for Managing Legacy Servers

vicfg-mpath35.pl <conn_options> -b
Returnsabulkpathlistsuitableforparsing.
vicfg-mpath35.pl <conn_options> --policy fixed --path vmhba2:0:1 --lun vmhba2:0:1 --preferred
Setsthepreferredpath.Resultsinoutputlikethefollowing:
Setting vmhba2:0:1 -- vmhba2:0:1 as preferred path
Setting vmhba2:0:1 policy to fixed
Performing Maintenance on VMware Infrastructure 3.5 Systems with
vihostupdate35
Thevihostupdate35commandperformsmaintenanceofyourESXServer3ihosts.Thecommandcaninstall
softwareupdates,enforcesoftwareupdatepolicies,andtrackinstalledsoftware.
Softwareupdatesmightbepatchesforaddressingcriticalsecurityissuesorurgentbugfixes,ortheymightbe
generalupdatesormaintenancereleases.Updatesmightalsobeupdatestothirdpartydrivers,modules,or
CIMproviders.TheymightbelocatedonthelocalfilesystemoronanNFS,FTP,orHTTPserver.Eachupdate
consistsofadescriptorfileandasetofpackages.Thedescriptorcontrolstheinstallationprocessandchecks
thatrequirementsaremet.Forexample,youmightberequiredtopoweroffallvirtualmachinesrunningon
theserveryouareabouttoupdate,oryoumighthavetoreboottheserveraftertheupdate.
Foradetaileddiscussionofvihostupdate35,seetheESXServer3iSetupGuide.
To update the firmware of an ESX Server 3i host
1 Downloadtheupdatebundletothemachinewhereyourunthevihostupdate35command.
2 Callthevihostupdate35command.
Thevihostupdate35optionseitherworkwiththebundledirectly,orpointtoametadatafile.
Theupdateprocessfirstpushestheupdatebundletothehost,andthenrequeststhatthehostperformthe
update.
Options
Table A2liststhecommandspecificoptionsforvihostupdate35.Youmustalsospecifyconnectionoptions.
Runvihostupdate35foralistofsupportedconnectionoptions.
IMPORTANTThevihostupdate35commandissupportedonlyonESXServer3i.Formaintenanceofyour
ESX Server3version3.5host,usetheesxupdatecommand.ThiscommandisnotsupportedonvCenter
Serversystems.
Table A-2. Options for vihostupdate35
Option Description
--bundle <bundle_file_name>
-b <bundle_file_name>
UnpackthedownloadedbundleZIPfile. Ifyouspecifythisoption,you
cannotspecify--metadata.
--install
-i
Patchthehostwithapplicablepackagesintheupdatebundle.Thisoption
takesnoarguments,butyoumustalsoincludeeither-btospecifyabundle,
or-mtospecifyametadatafile.
--metadata <metadata_xml_file>
-m <metadata_xml_file>
Pathtothe metadata.xmlfilethatcontainsinformationabouttheupdate
bundle.Ifyouspecifythisoption,youcannotspecify--bundle.
--query
-q
Listpackagesinstalledonthehost.Thisoptionreturnsversioninformation
fortheESXihostandforallinstalledpackages.
--scan <dir>
-s <dir>
Scanforpackagesthatapplytothehostinthedirectoryspecifiedby<dir>.
vSphere Command-Line Interface Installation and Reference Guide
102 VMware, Inc.

Examples
Thefollowingexamplesforvihostupdate35requireconnectionoptions.Runvihostupdate35foralistof
supportedconnectionoptions.
AssumethepathtoanupdatebundleisEESX-142-test-release.zip.Ifyouthengotothedirectorywhere
youcopiedthatbundle,youcanrunthefollowingcommands:
vihostupdate35.pl <conn_options> -i -b EESX-142-test-release.zip
Unpacksandpatchesthehost
vihostupdate35.pl <conn_options> -b EESX-142-test-release.zip
Unpacksthefile,butdoesnotpatchthehost.
vihostupdate35.pl <conn_options> -i -m EESX-142-test-release.zip/metadata.xml
PatchesahostusingthefileEESX-142-test-release.zip.
Runningthefirstexampleisequivalenttorunningthesecondandthirdinsequence.
VMware, Inc. 103

Index
Numerics
2gbsparse disk format 57
A
authentication
default inheritance 71
information 13
iSCSI 70
methods 69
mutual, iSCSI 70
returning to default inheritance 71
B
backing up configuration information 39
bulletins 42
bundles, third-party 44
C
claim rules 92
adding 93
converting 94
deleting 95
from 3.5 systems 94
listing 95
loading 95
moving 95
running 96
cloning virtual disks 59
command-line connection parameters 15
commands with esxcfg prefix 19
configuration backup 39
configuration file for authentication 15
configuration file path 45
configuration files 15
configuration information 39
connection options 13
copying files 51
cp936 encoding 17
creating directories 51
creating pass-through RDM 61
creating session files 14
creating VMFS 56
credential store
esxcli 84
precedence 14
D
default inheritance 71, 75
deleting virtual disks 59
depots 42, 44
device management 85
device target 55
DHCP 31
diagnostic partitions
activating 26
deactivating 26
managing 25
vicfg-dumppart 25
disabling software iSCSI 76
discovery targets 67
adding 67
listing 67
disk attributes 56
disk formats supported by vmkfstools 57
disk partition target 55
disks See Also virtual disks
disks, cloning 59
displaying virtual disks 62
distributed virtual switches 36
DNS configuration 31
downloading files 51
downloading vSphere CLI package 11
dump partitions, vicfg-dumppart 25
DVS port groups 36
dynamic discovery targets 67
adding 67
listing 67
removing 68
E
eagerzeroedthick disk format 57
enabled authentication methods 69
enabling iSCSI authentication 70
enabling mutual iSCSI authentication 70
enabling software iSCSI 76
encoding
cp936 17
ISO-8859-1 17
Shift_JIS 17
environment variables for authentication 15
esxcfg prefix 19
esxcfg-mpath35 99
vSphere Command-Line Interface Installation and Reference Guide
104 VMware, Inc.

esxcfg-nas 28
esxcfg-nics 32
esxcfg-rescan 30
esxcfg-snmp 40
esxcfg-vmhbadevs 29
esxcli
command syntax 83
credential store authentication 84
help 84
esxcli corestorage claiming reclaim 91
esxcli corestorage claiming unclaim 92
esxcli corestorage claimrule
add command 93
convert command 94
delete command 95
list command 95
load command 95
move command 95
run command 96
esxcli nmp device
list command 85
setpolicy command 85
esxcli nmp fixed
getpreferred command 85
setpreferred command 86
esxcli nmp path list command 86
esxcli nmp psp 86
getconfig command 86
list command 87
setconfig command 87
esxcli nmp roundrobin 87
getconfig command 87
setconfig command 88
esxcli nmp satp 88
addrule command 88
deleterule command 89
getconfig command 89
list command 89
listrules command 90
setconfig command 90
setdefaultpsp command 90
esxcli swiscsi nic 90
add command 90
list command 91
remove command 91
eui.xxx device name 27
examples
cloning raw disk 60
cloning virtual disk 60
deleting a virtual disk 59
extending virtual disks 60
extending VMFS volume 57
inflating virtual disks 59
initializing virtual disks 58
iSCSI storage setup 76
listing attributes 56
physical compatibility mode RDM 61
renaming virtual disks 59
svmotion 46
vicfg-cfgbackup 40
vicfg-dns 31
vicfg-dumppart 26
vicfg-module 47
vicfg-mpath 27
vicfg-mpath35 100
vicfg-nas 28
vicfg-nics 32
vicfg-ntp 33
vicfg-rescan 30
vicfg-route 34
vicfg-snmp 41
vicfg-syslog 42
vicfg-user 49
vicfg-vmknic 36
vicfg-vswitch 38
vifs 52
virtual compatibility mode RDM 61
virtual disks 58
VMFS file system 56
execution options 16
extendfs 53
extending file system partition, vmkfstools 57
extending virtual disks 60
extending volumes 57
external HBA properties 71
F
Fibre Channel LUNs 27
Fibre Channel storage 99
file management, vifs 50
file path
configuration file 45
virtual disk file 46
file system targets 55
file systems
NAS 28
VMFS 56
finding available LUNs 29
fixed path selection policy 85
G
getting help for esxcli 84
getting preferred path 85
groups 48
GSX Server 60
VMware, Inc. 105
Index

H
hard power operations 82
hardware iSCSI setup tasks 77
HBA properties 71
help for esxcli 84
host maintenance, vihostupdate35 101
I
inflating thin virtual disks 59
inheritance 75
initializing virtual disks 58
initiator alias 74
initiator iSCSI name 74
installing vMA 13
installing vSphere CLI
Linux 10
Windows 12
iSCSI
alias 74
authentication 71
disabling 76
initiator properties 73
LUNs 27
network portal information 72
network properties 73
parameter options 75
parameters, returning to default inheritance 75
path masking 96
setup examples 76
storage 99
ISO-8859-1 encoding 17
K
Kerberos 33
L
Linux
executing commands 11
installing vSphere CLI 10
vSphere CLI 10
listing available LUNs 29
listing disk attributes 56
listing dynamic discovery targets 67
listing iSCSI initiator properties 73
listing iSCSI network portal information 72
listing iSCSI network properties 73
listing iSCSI parameter options 74
listing RDM attributes 61
listing software iSCSI loading status 76
listing static discovery targets 67
listing VMFS volume attributes 56
loading status, software iSCSI 76
logs 41
LUNs
discovery 29
information 72
listing available 29
names 27
rescanning 30
VML names 99
M
managing claim rules 92
managing diagnostic partitions 25
managing groups 48
managing NAS file systems 28
managing NMP 84
managing physical NICs 32
managing updates 42
managing users 48
managing virtual switches 36
managing VMkernel NICs 35
manipulating route entry 34
masking a path 96
Microsoft Windows Security Support Provider
Interface 16
migrating virtual machines
GSX Server 60
svmotion 44
vmkfstools 60
VMware Workstation 60
miscellaneous management commands 46
module options 47
multipathing 27, 99
mutual authentication, iSCSI 70
N
naa.xxx device name 27
NAS datastores
accessing 28
adding to ESX host 28
removing from ESX host 28
vicfg-nas 28
NetQueue configuration 47
network adapters
duplex value 32
managing 32
speed 32
vicfg-nics 32
vicfg-vmknic 35
network portal information 72
networking commands 31
NIC binding, esxcli swiscsi nic 90
NICs 32
NMP 84, 85
NTP server specification 33
vSphere Command-Line Interface Installation and Reference Guide
106 VMware, Inc.

O
options 16
order of precedence 14
P
parameters
command line 15
default inheritance (iSCSI) 75
partitions, diagnostic 25
path masking 96
path operations 86
path policies 85, 86, 87, 88
performance monitoring 39
Perl 9
physical compatibility mode RDM 57, 61
physical network adapters 32
physical network portal information 72
physical NICs 32
platform support 20
port groups 37
power operations
hard 82
soft 82
powerop_mode values 82
precedence 14
preferred path 85, 86
PSA
acronym 83
managing claim rules 93
PSP 87
PSP operations 86
R
raw device mapping
physical compatibility mode 61
virtual compatibility mode 61
raw disks
cloning 59
RDM format 57
rdm format 57
RCLI See vSphere CLI
RDMs
attributes 61
disk format 57
physical compatibility mode 61
virtual compatibility mode 61
removing dynamic targets 68
removing static targets 68
renaming virtual disks 59
required parameters 13
rescanning adapters 30
rescanning LUNs 30
rescanning storage 30
resxtop 19, 39
round robin operations 87
round robin path policy 87, 88
route manipulation 34
running commands
Linux 10, 11
Windows 12
running commands from vMA 13
S
SATP operations 88
scripts with vSphere CLI commands 18
session file for authentication 14
setting initiator alias 74
setting initiator iSCSI name 74
setting iSCSI network portal information 72
setting iSCSI network properties 73
setting iSCSI parameter options 75
setting preferred path 86
Shift_JIS encoding 17
Simple Network Management Protocol 40
snapshots 60
SNMP management 40
soft power operations 82
software iSCSI
loading status 76
setup tasks 76
spanning partitions, vmkfstools 57
SSPI protocol 16
static targets, removing 68
storage
commands 25
creating directories with vifs 51
rescanning 30
storage arrays, vicfg-mpath 27
storage management commands 25
supported authentication methods 69
supported disk formats 57
supported platforms 20
svmotion 44
syslog server specification 41
system logs 41
system management commands 39
T
target information, vicfg-iscsi 72
target, for vmkfstools 55
thin virtual disks
format 57
inflating 59
vmkfstools 59
third-party bundle 44
VMware, Inc. 107
Index

U
uninstalling vSphere CLI package
Linux 12
Windows 13
unpacking vSphere CLI package 11
updates with vihostupdate 42
updating ESX Server 3i 101
updating VI 3.5 systems 101
uplink adapter 37
user management 48
using session files 14
V
vicfg-advcfg 46
vicfg-cfgbackup 39
vicfg-dns 31
vicfg-dumppart 25
vicfg-iscsi
authentication methods 69
authentication options 69
command syntax 63
default inheritance for authentication 71
default inheritance for parameters 75
discovery target options 67
information retrieval options 71
initiator options 73
iscsi parameter options 74
network options 73
options 64
physical network portal options 72
software iscsi options 76
target information 72
vicfg-module
NetQueue configuration 47
uses 47
vicfg-mpath 27
vicfg-mpath35 99
vicfg-nas 28
vicfg-nics 32
vicfg-ntp 33
vicfg-rescan 30
vicfg-route 34
vicfg-scsidevs 29
vicfg-snmp 40
vicfg-syslog 41
vicfg-user 48
vicfg-vmhbadevs 29
vicfg-vmknic 35
vicfg-volume 49
vicfg-vswitch 36
vifs 50
vihost parameter 18
vihostupdate
bulletins 42
depots 42, 44
third-party bundle 44
update management 42
vihostupdate35 101
virtual compatibility mode RDM 61
virtual disks
cloning 59
creating 58
deleting 59
extending 60
file path 46
geometry 62
inflating 59
initializing 58
options 57
renaming 59
virtual machines
HBA names 99
management commands 44
managing 80
migration with svmotion 44
vmware-cmd 80
virtual switches
port groups 37
vicfg-vswitch 36
vMA
environment variables 15
installing 13
multiple configuration files 15
VMFS
creating with vmkfstools 55, 56
extending volumes 57
listing attributes 56
vmkfstools 53
volume attributes 56
VMkernel 35, 47
VMkernel module options 47
VMkernel NICs 35
vmkfstools
command syntax 53
command-specific options 54
creating pass-through RDM 61
creating virtual disk 58
creating VMFS 55
creating VMFS example 56
deleting virtual disk 59
device target 55
disk formats 57
disk partition target 55
display disk geometry 62
vSphere Command-Line Interface Installation and Reference Guide
108 VMware, Inc.

extending virtual disk 60
extending volumes 57
file system options 55
file system targets 55
inflating thin virtual disk 59
initializing virtual disk 58
options 55
overview 53
RDM attributes 61
renaming virtual disk 59
snapshots 60
supported targets 55
syntax 53
target 55
virtual disk options 57
VMFS volume attributes 56
VML LUN names 27, 99
VMware Workstation 60
vmware-cmd
connection options 79
examples 82
general options 80
server options 80
virtual machine options 80
volume management 49
vSphere CLI
command-line 15
configuration files 15
environment variables 15
execution options 16
installing on Linux 10
installing on Windows 12
vicfg-iscsi 63
vSphere CLI package
downloading 11
installing on Linux 10
installing on Windows 12
uninstalling 12, 13
unpacking 11
vSphere Management Assistant 13
vSphere SDK for Perl 9
W
Windows
executing commands 12
installing vSphere CLI 12
using vSphere CLI 12
Z
zeroedthick disk format 57

You might also like