Escolar Documentos
Profissional Documentos
Cultura Documentos
EN-001406-00
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
Copyright 2008-2014 VMware, Inc. All rights reserved. Copyright and trademark information
VMware, Inc.
3401 Hillview Ave.
Palo Alto, CA 94304
www.vmware.com
VMware, Inc.
Contents
AboutThisBook
1 vSphereCLICommandOverviews 11
Introduction 11
Documentation 12
CommandLineHelp 12
ListofAvailableCommands 12
SupportedProtocolsandPlatformsforCommands 14
RunningESXCLICommandsAgainstESXi4.xHosts 16
CommandswithanesxcfgPrefix 16
UsingESXCLIOutput 17
ConnectionOptions 17
vCLIandLockdownMode 19
2 ManagingHosts 21
Stopping,Rebooting,andExaminingHosts 21
StoppingandRebootingHostswithESXCLI 21
Stopping,Rebooting,andExaminingHostswithvicfghostops 21
EnteringandExitingMaintenanceMode 22
EnteringandExitingMaintenanceModewithESXCLI 22
EnteringandExitingMaintenanceModewithvicfghostops 23
BackingUpConfigurationInformationwithvicfgcfgbackup 23
BackupTasks 23
BackingUpConfigurationData 24
RestoringConfigurationData 24
UsingvicfgcfgbackupfromvMA 24
ManagingVMkernelModules 24
ManagingModuleswithesxclisystemmodule 25
ManagingModuleswithvicfgmodule 25
UsingvicfgauthconfigforActiveDirectoryConfiguration 25
UpdatingHosts 26
3 ManagingFiles 27
IntroductiontoVirtualMachineFileManagement 27
ManagingtheVirtualMachineFileSystemwithvmkfstools 28
UpgradingVMFS3VolumestoVMFS5 29
ManagingVMFSVolumes 29
ManagingDuplicateVMFSDatastores 29
MountingDatastoreswithExistingSignatures 29
MountingandUnmountingwithESXCLI 30
MountingandUnmountingwithvicfgvolume 30
ResignaturingVMFSCopies 30
ResignaturingaVMFSCopywithESXCLI 31
ResignaturingaVMFSCopywithvicfgvolume 31
ReclaimingUnusedStorageSpace 31
DetachingDevicesandRemovingaLUN 32
VMware, Inc.
WorkingwithPermanentDeviceLoss 33
UsingvifstoManipulateFilesonRemoteESXiHosts
Examples 35
ExampleScenario 37
33
4 ManagingStorage 39
IntroductiontoStorage 39
HowVirtualMachinesAccessStorage 40
Datastores 41
StorageDeviceNaming 41
ExaminingLUNs 42
TargetandDeviceRepresentation 42
ExaminingLUNswithesxclistoragecore 42
ExaminingLUNswithvicfgscsidevs 43
ManagingPaths 44
MultipathingwithLocalStorageandFCSANs 44
ListingPathInformation 45
ListingPathInformationwithESXCLI 45
ListingPathInformationwithvicfgmpath 46
ChangingtheStateofaPath 47
ChangingPathStatewithESXCLI 47
ChangingPathStatewithvicfgmpath 47
ManagingPathPolicies 47
MultipathingConsiderations 48
ChangingPathPolicies 49
ChangingPathPolicieswithESXCLI 49
ChangingPathPolicieswithvicfgmpath 49
SettingPolicyDetailsforDevicesthatUseRoundRobin 50
ManagingNFS/NASDatastores 50
CapabilitiesSupportedbyNFS/NAS 51
AddingandDeletingNASFileSystems 51
ManagingNASFileSystemswithESXCLI 51
ManagingNASFileSystemswithvicfgnas 51
MonitoringandManagingSANStorage 52
MigratingVirtualMachineswithsvmotion 52
StoragevMotionUses 52
StoragevMotionRequirementsandLimitations 53
RunningsvmotioninInteractiveMode 53
RunningsvmotioninNoninteractiveMode 53
ConfiguringFCoEAdapters 54
ScanningStorageAdapters 55
RetrievingSMARTInformation 55
5 ManagingiSCSIStorage 57
iSCSIStorageOverview 57
DiscoverySessions 58
DiscoveryTargetNames 59
ProtectinganiSCSISAN 59
ProtectingTransmittedData 59
SecuringiSCSIPorts 60
SettingiSCSICHAP 60
CommandSyntaxforesxcliiscsiandvicfgiscsi
esxcliiscsiCommandSyntax 61
KeytoesxcliiscsiShortOptions 62
61
VMware, Inc.
Contents
vicfgiscsiCommandSyntax 63
iSCSIStorageSetupwithESXCLI 66
SettingUpSoftwareiSCSIwithESXCLI 66
SettingUpDependentHardwareiSCSIwithESXCLI 68
SettingUpIndependentHardwareiSCSIwithESXCLI 70
iSCSIStorageSetupwithvicfgiscsi 71
SettingUpSoftwareiSCSIwithvicfgiscsi 71
SettingUpDependentHardwareiSCSIwithvicfgiscsi 73
SettingUpIndependentHardwareiSCSIwithvicfgiscsi 74
ListingandSettingiSCSIOptions 75
ListingiSCSIOptionswithESXCLI 75
SettingMTUwithESXCLI 75
ListingandSettingiSCSIOptionswithvicfgiscsi 76
ListingandSettingiSCSIParameters 76
ListingandSettingiSCSIParameterswithESXCLI 77
ReturningParameterstoDefaultInheritance 78
ListingandSettingiSCSIParameterswithvicfgiscsi 78
ReturningParameterstoDefaultInheritance 79
EnablingiSCSIAuthentication 80
EnablingiSCSIAuthenticationwithESXCLI 80
EnablingiSCSIAuthenticationwithvicfgiscsi 81
SettingUpPortsforiSCSIMultipathing 81
ManagingiSCSISessions 82
IntroductiontoiSCSISessionManagement 82
ListingiSCSISessions 83
LoggingintoiSCSISessions 83
RemovingiSCSISessions 83
6 ManagingThirdPartyStorageArrays 85
ManagingNMPwithesxclistoragenmp 85
DeviceManagementwithesxclistoragenmpdevice 86
esxclistoragenmpdevicelist 86
esxclistoragenmpdeviceset 86
ListingPathswithesxclistoragenmppath 86
ManagingPathSelectionPolicyPluginswithesxclistoragenmppsp 86
RetrievingPSPInformation 87
SettingConfigurationParametersforThirdPartyExtensions 87
FixedPathSelectionPolicyOperations 88
RetrievingthePreferredPath 88
SettingthePreferredPath 88
CustomizingRoundRobinSetup 88
RetrievingPathSelectionSettings 89
SpecifyingConditionsforPathChanges 89
ManagingSATPs 89
RetrievingInformationAboutSATPs 89
AddingSATPRules 90
RemovingSATPRules 91
RetrievingandSettingSATPConfigurationParameters 91
PathClaimingwithesxclistoragecoreclaiming 92
UsingtheReclaimTroubleshootingCommand 92
UnclaimingPathsorSetsofPaths 92
ManagingClaimRules 93
AddingClaimRules 93
ConvertingESX3.5LUNMaskstoClaimRuleFormat 95
RemovingClaimRules 96
VMware, Inc.
ListingClaimRules 96
LoadingClaimRules 96
MovingClaimRules 97
RunningPathClaimingRules 97
7 ManagingUsers 99
UsersinthevSphereEnvironment 99
vicfguserCommandSyntax 99
ManagingUserswithvicfguser 100
102
8 ManagingVirtualMachines 103
vmwarecmdOverview 103
ConnectionOptionsforvmwarecmd 104
GeneralOptionsforvmwarecmd 104
FormatforSpecifyingVirtualMachines 104
ListingandRegisteringVirtualMachines 104
RetrievingVirtualMachineAttributes 105
ManagingVirtualMachineSnapshotswithvmwarecmd 106
TakingVirtualMachineSnapshots 107
RevertingandRemovingSnapshots 107
PoweringVirtualMachinesOnandOff 107
ConnectingandDisconnectingVirtualDevices 108
WorkingwiththeAnswerVMAPI 109
ForciblyStoppingVirtualMachineswithEXCLI 109
9 ManagingvSphereNetworking 111
IntroductiontovSphereNetworking 111
NetworkingUsingvSphereStandardSwitches 112
NetworkingUsingvSphereDistributedSwitches 113
RetrievingBasicNetworkingInformation 113
NetworkTroubleshooting 114
SettingUpvSphereNetworkingwithvSphereStandardSwitches 115
SettingUpVirtualSwitchesandAssociatingaSwitchwithaNetworkInterface 115
RetrievingInformationAboutVirtualSwitches 116
RetrievingInformationaboutVirtualSwitcheswithESXCLI 116
RetrievingInformationaboutVirtualSwitcheswithvicfgvswitch 116
AddingandDeletingVirtualSwitches 117
AddingandDeletingVirtualSwitcheswithESXCLI 117
AddingandDeletingVirtualSwitcheswithvicfgvswitch 117
SettingSwitchAttributeswithesxclinetworkvswitchstandard 117
SettingSwitchAttributeswithvicfgvswitch 118
Checking,Adding,andRemovingPortGroups 118
ManagingPortGroupswithESXCLI 118
ManagingPortGroupswithvicfgvswitch 118
ManagingUplinksandPortGroups 119
ConnectingandDisconnectingUplinkAdaptersandPortGroupswithESXCLI 119
ConnectingandDisconnectingUplinksandPortGroupswithvicfgvswitch 119
SettingthePortGroupVLANID 119
SettingthePortGroupVLANIDwithESXCLI 119
SettingthePortGroupVLANIDwithvicfgvswitch 120
ManagingUplinkAdapters 120
ManagingUplinkAdapterswithesxclinetworknic 120
VMware, Inc.
Contents
SpecifyingMultipleUplinkswithESXCLI 121
ManagingUplinkAdapterswithvicfgnics 122
LinkingandUnlinkingUplinkAdapterswithESXCLI 122
LinkingandUnlinkingUplinkAdapterswithvicfgvswitch 122
AddingandModifyingVMkernelNetworkInterfaces 123
ManagingVMkernelNetworkInterfaceswithESXCLI 123
ManagingVMkernelNetworkInterfaceswithvicfgvmknic 124
SettingUpvSphereNetworkingwithvSphereDistributedSwitch 126
ManagingStandardNetworkingServicesinthevSphereEnvironment 126
SettingtheDNSConfiguration 126
SettingtheDNSConfigurationwithESXCLI 126
SettingtheDNSConfigurationwithvicfgdns 128
AddingandStartinganNTPServer 129
ManagingtheIPGateway 129
SettingUpIPsec 130
UsingIPsecwithESXi 130
ManagingSecurityAssociations 131
ManagingSecurityPolicies 132
ManagingtheESXiFirewall 133
10 MonitoringESXiHosts 135
UsingresxtopforPerformanceMonitoring 135
ManagingDiagnosticPartitions 135
DiagnosticPartitionCreation 136
DiagnosticPartitionManagement 136
ManagingCoreDumps 136
ManagingLocalCoreDumpswithESXCLI 136
ManagingCoreDumpswithESXiDumpCollector 137
ManagingCoreDumpswithvicfgdumppart 137
ConfiguringESXiSyslogServices 138
ManagingESXiSNMPAgents 139
ConfiguringSNMPCommunities 140
ConfiguringtheSNMPAgenttoSendTraps 140
ConfiguringtheSNMPAgentforPolling 141
RetrievingHardwareInformation 141
ESX,ESXi,andVirtualMachineLogs 142
Index 143
VMware, Inc.
Contents
VMware, Inc.
ThevSphereCommandLineInterfaceConceptsandExamplesdocumentationexplainshowtousetheVMware
vSphereCommandLineInterface(vCLI)andincludescommandoverviewsandexamples.
Intended Audience
ThisbookisforexperiencedWindowsorLinuxsystemadministratorswhoarefamiliarwithvSphere
administrationtasksanddatacenteroperationsandknowhowtousecommandsinscripts.
Document Feedback
VMwarewelcomesyoursuggestionsforimprovingourdocumentation.Ifyouhavecomments,sendyour
feedbacktodocfeedback@vmware.com.
Related Documentation
ThevSphereCommandLineInterfaceReference,availableinthevSphereDocumentationCenter,includes
referenceinformationforvicfg-commandsandESXCLIcommands.
GettingStartedwithvSphereCommandLineInterfacesincludesinformationaboutavailableCLIs,enablingthe
ESXiShell,andinstallingandrunningvCLIcommands.AnappendixsuppliestheESXCLInamespaceand
commandhierarchies.
CommandLineManagementinvSphere5forServiceConsoleUsersisforcustomerswhocurrentlyusethe
ESX ServiceConsole.
ThevSphereSDKforPerldocumentationexplainshowyoucanusethevSphereSDKforPerlandrelated
utilityapplicationstomanageyourvSphereenvironment.ThedocumentationincludesanInstallationGuide,a
ProgrammingGuide,andareferencetothevSphereSDKforPerlUtilityApplications.
BackgroundinformationforthetasksdiscussedinthismanualisavailableinthevSpheredocumentationset.
ThevSpheredocumentationconsistsofthecombinedvCenterServerandESXidocumentationandincludes
informationaboutmanagingstorage,networkingvirtualmachines,andmore.
VMware, Inc.
Support Offerings
TofindouthowVMwaresupportofferingscanhelpmeetyourbusinessneeds,goto
http://www.vmware.com/support/services.
10
VMware, Inc.
Thischapterintroducesthecommandset,presentssupportedcommandsfordifferentversionsofvSphere,
listsconnectionoptions,anddiscussesvCLIandlockdownmode.
Thischapterincludesthefollowingtopics:
Introductiononpage 11
ListofAvailableCommandsonpage 12
SupportedProtocolsandPlatformsforCommandsonpage 14
RunningESXCLICommandsAgainstESXi4.xHostsonpage 16
CommandswithanesxcfgPrefixonpage 16
UsingESXCLIOutputonpage 17
ConnectionOptionsonpage 17
vCLIandLockdownModeonpage 19
Introduction
ThevSphereCLIcommandset,availablesinceESX/ESXi3.5,allowsyoutoperformvSphereconfiguration
tasksusingavCLIpackageinstalledonsupportedplatforms,orusingvMA.Thesetconsistsofseveral
commandsets.
Table 1-1. Components of the vSphere CLI Command Set
vCLI Commands
Description
ESXCLIcommands
ComprehensivesetofcommandsformanagingmostaspectsofvSphere.InvSphere5.0,this
commandsethasbeenunified.Eventually,ESXCLIcommandswillreplaceothercommands
inthevCLIset.
CompletelyequivalentESXCLIcommandsareavailableintheESXiShell.UsevCLIESXCLI
commandsforasaferenvironment.
vicfg- commands
SetofcommandsformanyaspectsofvSphere.InvSphere5.0,onlyminorchangesweremade
tothiscommandset.Eventually,thesecommandswillbereplacedbyESXCLIcommands.
Asetofesxcfg-commandsthatpreciselymirrorsthevicfg-commandsisalsoincludedin
thevCLIpackage.
Othercommands
(vmware-cmd,vifs,
vmkfstools)
CommandsimplementedinPerlthatdonothaveavicfg-prefix.AllvCLIcommandsare
scheduledtobereplacedbyESXCLIcommands.
YoucaninstallthevSphereCLIcommandsetonasupportedLinuxorWindowssystem.SeeGettingStarted
withvSphereCommandLineInterfaces.YoucanalsodeploythevSphereManagementAssistant(vMA)toan
ESXisystemofyourchoice.ManageESXihostsfromtheLinuxorWindowssystemorfromvMAbyrunning
vCLIcommandswithconnectionoptionssuchasthetargethost,user,andpasswordoraconfigurationfile.
SeeConnectionOptionsonpage 17.
VMware, Inc.
11
Title
Documentation
GettingStartedwithvSphereCommandLineInterfacesincludesinformationaboutavailableCLIs,enablingthe
ESXiShell,andinstallingandrunningvCLIcommands.Anappendixsuppliesthenamespaceandcommand
hierarchiesforESXCLI.
ReferenceinformationforvCLIcommandsisavailableonthevCLIdocumentationpage
http://www.vmware.com/support/developer/vcli/.
vSphereCommandLineInterfaceReferenceisareferencetovicfg-andrelatedvCLIcommandsand
includesreferenceinformationforESXCLIcommands.Allreferenceinformationisgeneratedfromthe
help.
AreferencetoesxtopandresxtopisincludedintheResourceManagementdocumentation.
Command-Line Help
Availablecommandlinehelpdiffersforthedifferentcommands.
Command set
vicfgcommands
ESXCLIcommands
Run--helpatanylevelofthehierarchyforinformationaboutbothcommandsand
namespacesavailablefromthatlevel.
Comment
esxcli
esxcli(newsyntax)
AllvCLI4.1commandshavebeenrenamed.Significantadditionshavebeen
madetoESXCLI.Manytaskspreviouslyperformedwithavicfg-command
isnowperformedwithESXCLI.
resxtop
resxtop(NoESXCLI
equivalent)
MonitorsinrealtimehowESXihostsuseresources.Runsininteractiveor
batchmode.
Supportedonlyon
Linux.
SeeUsingresxtopforPerformanceMonitoringonpage 135.SeethevSphere
ResourceManagementdocumentationforadetailedreference.
svmotion(NoESXCLI
Movesavirtualmachinesconfigurationfile,and,optionally,itsdisks,while
thevirtualmachineisrunning.
svmotion
equivalent)
Mustrunagainsta
vCenterServersystem.
vicfg-advcfg
esxcli system
settings advanced
SeeMigratingVirtualMachineswithsvmotiononpage 52.
Performsadvancedconfiguration.
TheadvancedsettingsareasetofVMkerneloptions.Theseoptionsare
typicallyinplaceforspecificworkaroundsordebugging.
UsethiscommandasinstructedbyVMware.
vicfg-authconfig
vicfg-cfgbackup
12
vicfg-authconfig(No
ESXCLIequivalent).
vicfg-cfgbackup(No
ESXCLIequivalent),
Cannotrunagainsta
vCenterServersystem.
RemotelyconfiguresActiveDirectorysettingsforanESXihost.
SeeUsingvicfgauthconfigforActiveDirectoryConfigurationonpage 25.
BacksuptheconfigurationdataofanESXisystemandrestorespreviously
savedconfigurationdata.
SeeBackingUpConfigurationInformationwithvicfgcfgbackupon
page 23.
VMware, Inc.
Comment
vicfg-dns
esxcli network ip
dns
SpecifiesanESXihostsDNS(DomainNameServer)configuration.See
SettingtheDNSConfigurationonpage 126.
vicfg-dumppart
esxcli system
coredump
vicfg-hostops
vicfg-ipsec
esxcli system
maintenancemode
Manageshosts.
esxcli system
shutdown
EnteringandExitingMaintenanceModeonpage 22.
esxcli network ip
ipsec
SetsupIPsec(InternetProtocolSecurity),whichsecuresIPcommunications
comingfromandarrivingatESXihosts.ESXihostssupportIPsecusingIPv6.
Stopping,Rebooting,andExaminingHostsonpage 21.
SeeSettingUpIPseconpage 130.
vicfg-iscsi
esxcli iscsi
ManageshardwareandsoftwareiSCSIstorage.
SeeManagingiSCSIStorageonpage 57.
vicfg-module
esxcli system
module
EnablesVMkerneloptions.Usethiscommandwiththeoptionslistedinthis
document,orasinstructedbyVMware.
SeeManagingVMkernelModulesonpage 24.
Configuresstoragearrays.
vicfg-mpath35
vicfg-nas
ManagesNAS/NFSfilesystems.SeeManagingNFS/NASDatastoreson
page 50.
vicfg-nics
ManagestheESXihostsuplinkadapters.SeeManagingUplinkAdapters
onpage 120.
vicfg-ntp
vicfg-ntp(NoESXCLI
equivalent)
DefinestheNTP(NetworkTimeProtocol)server.SeeAddingandStartingan
NTPServeronpage 129.
vicfg-rescan
Rescansthestorageconfiguration.SeeScanningStorageAdapterson
page 55.
vicfg-route
esxcli network ip
route)
ManagestheESXihostsrouteentry.SeeManagingtheIPGatewayon
page 129.
vicfg-scsidevs
FindsandexaminesavailableLUNs.SeeExaminingLUNsonpage 42.
vicfg-snmp
ManagestheSNMPagent.ManagingESXiSNMPAgentsonpage 139.
UsingSNMPinavSphereenvironmentisdiscussedindetailinthevSphere
MonitoringandPerformancedocumentation.
vicfg-mpath
ManagingPathsonpage 44.
NewoptionsaddedinvCLI5.0.
ExpandedSNMPsupportaddedinvCLI5.1.
vicfg-syslog
esxcli system
syslog
SpecifieslogsettingsforESXihostsincludinglocalstoragepoliciesandserver
andportinformationfornetworklogging.SeeConfiguringESXiSyslog
Servicesonpage 138.
ThevCenterServerandHostManagementdocumentationexplainshowtosetup
systemlogsusingthevSphereWebClient.
vicfg-user
vicfg-user(No
ESXCLIequivalent)
Creates,modifies,deletes,andlistslocaldirectaccessusersandgroupsof
users.SeeManagingUsersonpage 99.
ThevSphereSecuritydocumentationdiscussessecurityimplicationsofuser
managementandcustomroles.
vicfg-vmknic
esxcli network ip
interface.
Adds,deletes,andmodifiesVMkernelnetworkinterfaces.SeeAddingand
ModifyingVMkernelNetworkInterfacesonpage 123.
vicfg-volume
esxcli storage
filesystem
SupportsresignaturingthecopyofaVMFSvolume,andmountingand
unmountingthecopy.SeeManagingDuplicateVMFSDatastoreson
page 29.
VMware, Inc.
13
Title
Comment
vicfg-vswitch
esxcli network
vswitch
Addsorremovesvirtualswitchesormodifiesvirtualswitchsettings.See
SettingUpVirtualSwitchesandAssociatingaSwitchwithaNetwork
Interfaceonpage 115.
vifs
vifs(NoESXCLI
equivalent)
Performsfilesystemoperationssuchasretrievinganduploadingfilesonthe
ESXisystem.SeeManagingtheVirtualMachineFileSystemwith
vmkfstoolsonpage 28.
vihostupdate
Runesxcli software
vibagainstESXi5.0and
later.
vihostupdate35
Runvihostupdate
againstESX/ESXi4.x.
UpdatesESXihoststoadifferentversionofthesamemajorrelease.
YoucannotrunvihostupdateagainstESXi5.0andlaterhosts.
SeeManagingVMkernelModulesonpage 24.
Runvihostupdate35
againstESX/ESXi3.5.
vmkfstools
vmkfstools(No
ESXCLIequivalent)
Createsandmanipulatesvirtualdisks,filesystems,logicalvolumes,and
physicalstoragedevicesonanESXihost.SeeManagingtheVirtualMachine
FileSystemwithvmkfstoolsonpage 28.
vmware-cmd
vmware-cmd(No
ESXCLIequivalent)
Performsvirtualmachineoperationsremotely.Thisincludes,forexample,
creatingasnapshot,poweringthevirtualmachineonoroff,andgetting
informationaboutthevirtualmachine.SeeManagingVirtualMachineson
page 103.
vicfg-snmp
vifs
vicfg-user
vicfg-cfgbackup
vihostupdate
vmkfstools
vicfg-ipsec
YoucannotrunthevihostupdatecommandagainstanESXi5.0orlatersystem.
Youcannotrunthevihostupdateandvicfg-mpathcommandsthatareinavCLI4.0orlaterinstallation
againstESX/ESXi3.5orvCenter2.5systems.Instead,runvihostupdate35andvicfg-mpath35,includedin
thevCLI4.xinstallation,againstthosesystems.vihostupdate35issupportedforESXi,butnotforESX.
Youcannotrunvicfg-syslog --setserverorvicfg-syslog --setportwithanESXi5.0orlatertarget.
14
VMware, Inc.
IMPORTANTIfyourunvCLI4.xcommandsagainstESX/ESXi3.5systems,youcanuseonlytheoptions
supportedbythosesystems.
SeetheVMwareInfrastructureRemoteCommandLineInterfaceInstallationandReferenceGuideforESX/ESXi3.5
Update2foralistofsupportedoptions.Toaccessthatdocument,selectResources>Documentationfromthe
VMwarewebsite.FindthevSpheredocumentationsetandopenthearchive.AfewvCLI4.xoptionsare
supportedagainsthostsrunningESX/ESXi3.5Update2orlatereventhoughtheywerenotsupportedinRCLI
version3.5.
RunavCLI4.xcommandwith--helpforinformationaboutoptionsupportwithESX/ESXi3.5Update 2,or
seetheVMwareknowledgebasearticleathttp://kb.vmware.com/kb/1008940formoredetail.
Table 13listsplatformsupportforthedifferentvCLI5.xcommands.Thesecommandshavenotbeentested
againstVirtualCenter2.5Update2systems.Youcan,however,connecttoavCenterServer4.xsystemand
targetESX/ESXi3.5Update2hosts.
Table 1-3. Platform Support for vCLI 5.x Commands
Command
ESXi 5.x
VC 5.x
ESXi 4.x
ESX 4.x
VC 4.x
esxcli
Yes
Yes
Yes
Yes
No
No
No
resxtop
Yes(from
Linux)
Yes(from
Linux)
Yes(from
Linux)
Yes(from
Linux)
Yes(from
Linux)
Yes(from
Linux)
Yes(from
Linux)
svmotion
No
Yes
No
No
Yes
No
No
vicfg-advcfg
Yes
Yes
Yes
Yes
Yes
Yes
Yes
vicfg-authconfig
Yes
Yes
Yes
Yes
Yes
No
No
vicfg-cfgbackup
Yes
No
Yes
No
No
Yes
No
vicfg-dns
Yes
Yes
Yes
Yes
Yes
Yes
Yes
vicfg-dumppart
Yes
Yes
Yes
Yes
Yes
Yes
Yes
vicfg-hostops
Yes
Yes
Yes
Yes
Yes
No
No
vicfg-ipsec
Yes
No
Yes
Yes
No
No
No
vicfg-iscsi
Yes
Yes
Yes
Yes
Yes
No
No
vicfg-module
Yes
Yes
Yes
Yes
Yes
Yes
Yes
vicfg-mpath
Yes
Yes
Yes
Yes
Yes
Usevicfg-mpath35instead.
vicfg-nas
Yes
Yes
Yes
Yes
Yes
Yes
Yes
vicfg-nics
Yes
Yes
Yes
Yes
Yes
Yes
Yes
vicfg-ntp
Yes
Yes
Yes
Yes
Yes
Yes
Yes
vicfg-rescan
Yes
Yes
Yes
Yes
Yes
Yes
Yes
vicfg-route
Yes
Yes
Yes
Yes
Yes
Yes
Yes
vicfg-scsidevs
Yes
Yes
Yes
Yes
Yes
No
No
vicfg-snmp
Yes
No
Yes
Yes
No
Yes
Yes
vicfg-syslog
No
Nofor5.0
target
Yes
No
Yes
Yes
No
vicfg-user
Yes
No
Yes
Yes
No
Yes
Yes
vicfg-vmhbadevs
NotincludedinvCLI4.xandvCLI5.0.Usevicfg-scsidevsinstead.
Yes
Yes
vicfg-vmknic
Yes
Yes
Yes
Yes
Yes
Yes
Yes
vicfg-volume
Yes
Yes
Yes
Yes
Yes
No
No
vicfg-vswitch
Yes
Yes
Yes
Yes
Yes
Yes
Yes
vifs
Yes
No
Yes
Yes
No
Yes
Yes
VMware, Inc.
15
Title
ESXi 5.x
vihostupdate
VC 5.x
ESXi 4.x
ESX 4.x
VC 4.x
Useesxcli software
vibinstead.
Yes
Yes
No
Use
vihostupdate35
instead
No
vmkfstools
Yes
No
Yes
Yes
No
Yes
Yes
vmware-cmd
Yes
Yes
Yes
Yes
Yes
Yes
Yes
vicfg-mpath35
No
No
No
No
No
Yes
Yes
vihostupdate35
No
No
No
No
No
Yes
No
IfyouruncommandsagainstESXi4.xhosts,ESXCLI4.xcommandsaresupported.
IfyouruncommandsagainstESXi5.0hosts,ESXCLI5.0commandsaresupported.
Youspecifythetargethostwith--serverorsetupavMAtarget.
Somecommandsorcommandoutputsaredeterminedbythehosttype.Inaddition,VMwarepartnersmight
developcustomESXCLIcommandsthatyoucanrunonhostswherethepartnerVIBhasbeeninstalled.
Runesxcli --server <target> --helpforalistofnamespacessupportedonthetarget.Youcandrill
downintothenamespacesforadditionalhelp.
IMPORTANTESXCLIonESX4.xhostsdoesnotsupporttargetingavCenterServersystem.Youcantherefore
notrunESXCLIcommandswith--serverpointingtoavCenterServersystemevenifyouinstallvCLI5.0.
16
vicfg-advcfg
esxcfg-advcfg
vicfg-cfgbackup
esxcfg-cfgbackup
vicfg-dns
esxcfg-dns
vicfg-dumppart
esxcfg-dumppart
vicfg-module
esxcfg-module
vicfg-mpath
esxcfg-mpath
vicfg-nas
esxcfg-nas
vicfg-nics
esxcfg-nics
vicfg-ntp
esxcfg-ntp
VMware, Inc.
vicfg-rescan
esxcfg-rescan
vicfg-route
esxcfg-route
vicfg-scsidevs
esxcfg-scsidevs
vicfg-snmp
esxcfg-snmp
vicfg-syslog
esxcfg-syslog
vicfg-vmknic
esxcfg-vmknic
vicfg-volume
esxcfg-volume
vicfg-vswitch
esxcfg-vswitch
ListsallfilesysteminformationinCSVformat.
Youcanpipetheoutputtoafile.
esxcli --formatter=keyvalue storage filesystem list > myfilesystemlist.txt
IMPORTANTAlwaysuseaformatterforconsistentoutput.
Connection Options
Table 15listsoptionsthatareavailableforallvCLIcommandsinalphabeticalorder.Examplesinthisbook
use<conn_options>toindicatethepositionofconnectionoptions.
Forexample,esxcli <conn_options> filesystem nfs listmeansthatyoucoulduseaconfiguration
file,asessionfile,orjustspecifyatargetserverandrespondwithausernameandpasswordwhenprompted.
Thetableincludesoptionsforuseonthecommandlineandvariablesforuseinconfigurationfiles.
IMPORTANTForconnections,vCLIsupportsonlytheIPv4protocol,nottheIPv6protocol.Youcan,however,
configureIPv6onthetargethostwithseveralofthenetworkingcommands.
SeetheGettingStartedwithvSphereCommandLineInterfacesdocumentationforadditionalinformationand
examples.
Table 1-5. vCLI Connection Options
Option and Environment Variable
Description
--cacertsfile <certsfile>
ESXCLIcommandsonly.
-t <certs_file>
VI_CACERTFILE=<cert_file_path>
UsedtospecifytheCA(CertificateAuthority)certificatefile,inPEMformat,
toverifytheidentityofthevCenterServersystemorESXisystemtorunthe
commandon.Canbeused,forexample,topreventmaninthemiddleattack.
--config <cfg_file_full_path>
Usestheconfigurationfileatthespecifiedlocation.
VI_CONFIG=<cfg_file_full_path>
Specifyapaththatisreadablefromthecurrentdirectory.
VMware, Inc.
17
Title
Description
--credstore <credstore>
Nameofacredentialstorefile.Defaultsto
<HOME>/.vmware/credstore/vicredentials.xmlonLinuxand
<APPDATA>/VMware/credstore/vicredentials.xmlonWindows.
CommandsforsettingupthecredentialstoreareincludedinthevSphere
SDKforPerl,whichisinstalledwithvCLI.ThevSphereSDKforPerl
ProgrammingGuideexplainshowtomanagethecredentialstore.
--encoding <encoding>
Specifiestheencodingtobeused.Thefollowingencodingsaresupported.
VI_ENCODING=<encoding>
cp936(SimplifiedChinese)
shftjis(Japanese)
cp850(GermanandFrench).
Youcanuse--encodingtospecifytheencodingvCLIshouldmaptowhenit
isrunonaforeignlanguagesystem.
--passthroughauth
VI_PASSTHROUGHAUTH
Ifyouspecifythisoption,thesystemusestheMicrosoftWindowsSecurity
SupportProviderInterface(SSPI)forauthentication.Trustedusersarenot
promptedforausernameandpassword.SeetheMicrosoftWebsitefora
detaileddiscussionofSSPI.
ThisoptionissupportedonlyifyouarerunningvCLIonaWindowssystem
andareconnectingtoavCenterServersystem.
--passthroughauthpackage
<package>
VI_PASSTHROUGHAUTHPACKAGE=
<package>
Usethisoptionwith--passthroughauthtospecifyadomainlevel
authenticationprotocoltobeusedbyWindows.Bydefault,SSPIusesthe
Negotiateprotocol,whichmeansthatclientandservertrytonegotiatea
protocolthatbothsupport.
IfthevCenterServersystemtowhichyouareconnectingisconfiguredtouse
aspecificprotocol,youcanspecifythatprotocolusingthisoption.
ThisoptionissupportedonlyifyouarerunningvCLIonaWindowssystem
andconnectingtoavCenterServersystem.
--password <passwd>
Usesthespecifiedpassword(usedwith--username)tologintotheserver.
VI_PASSWORD=<passwd>
If--serverspecifiesavCenterServersystem,theusernameand
passwordapplytothatserver.IfyoucanlogintothevCenterServer
system,youneednoadditionalauthenticationtoruncommandsonthe
ESXihoststhatservermanages.
If--serverspecifiesanESXihost,theusernameandpasswordapplyto
thatserver.
Usesthespecifiedporttoconnecttothesystemspecifiedby--server.
Defaultis443.
Usesthespecifiedprotocoltoconnecttothesystemspecifiedby--server.
DefaultisHTTPS.
Savesasessiontothespecifiedfile.Thesessionexpiresifitisnotusedfor30
minutes.
--server <server>
UsesthespecifiedESXiorvCenterServersystem.Defaultislocalhost.
VI_SERVER=<server>
If--serverpointstoavCenterServersystem,youusethe--vihostoption
tospecifytheESXihostonwhichyouwanttorunthecommand.Acommand
issupportedforvCenterServerifthe--vihostoptionisdefined.
--servicepath <path>
UsesthespecifiedservicepathtoconnecttotheESXihost.Defaultis
/sdk/webService.
VI_SERVICEPATH=<path>
VI_SESSIONFILE=<file>
Usesthespecifiedsessionfiletoloadapreviouslysavedsession.Thesession
mustbeunexpired.
--url <url>
ConnectstothespecifiedvSphereWebServicesSDKURL.
--sessionfile <file>
VI_URL=<url>
18
VMware, Inc.
Description
--username <u_name>
Usesthespecifiedusername.
VI_USERNAME=<u_name>
If--serverspecifiesavCenterServersystem,theusernameand
passwordapplytothatserver.IfyoucanlogintothevCenterServer
system,youneednoadditionalauthenticationtoruncommandsonthe
ESXihoststhatservermanages.
If--serverspecifiesanESXisystem,theusernameandpasswordapply
tothatsystem.
Ifyoudonotspecifyausernameandpasswordonthecommandline,the
systempromptsyouanddoesnotechoyourinputtothescreen.
--vihost <host>
-h <host
WhenyourunavSphereCLIcommandwiththe--serveroptionpointing
toavCenterServersystem,use--vihosttospecifytheESXihosttorunthe
commandagainst.
NOTE:Thisoptionisnotsupportedforeachcommand.Ifsupported,the
optionisincludedintheindividualcommandoptionlist.
UsersthatwereloggedintotheESXiShellbeforelockdownmodewasenabledremainloggedinandcan
runcommands,however,thoseuserscannotdisablelockdownmode.
Nootherusers,includingtherootusers,canlogintoanESXiShellinlockdownmode.Youcannolonger
accesstheshellfromthedirectconsoleorbyusingaremoteshell.
Youcandisablelockdownmodeasfollows.
TheadministratoruseronthevCenterServersystemcandisablelockdownmodeforhostsitmanages
fromthevCenterServersystem.
TherootusercanalwayslogindirectlytotheESXihostsdirectconsoletodisablelockdownmode.Ifthe
directconsoleisdisabled,theadministratoronthevCenterServersystemcandisablelockdownmode.If
thehostisnotmanagedbyavCenterServersystemorifthehostisunreachable,youmustreinstallESXi.
TomakechangestoESXisystemsinlockdownmode,youmustgothroughavCenterServersystemthat
managestheESXisystemastheuservpxuser.
esxcli --server MyVC --vihost MyESXi storage filesystem list
ThecommandpromptsforthevCenterServersystemusernameandpassword.
YoucanusethevSphereClient,thevSphereWebClient,orvCLIcommandsthatsupportthe--vihostoption.
ThefollowingcommandscannotrunagainstvCenterServersystemsandarethereforenotavailablein
lockdownmode:
vicfg-snmp
vifs
vicfg-user
vicfg-cfgbackup
vihostupdate
vmkfstools
vicfg-ipsec
IfyouhaveproblemsrunningacommandonanESXihostdirectly(withoutspecifyingavCenterServer
target),checkwhetherlockdownmodeisenabledonthathost.
ThevSphereSecuritydocumentationdiscusseslockdownmodeindetail.
VMware, Inc.
19
Title
20
VMware, Inc.
Managing Hosts
HostmanagementcommandscanstopandrebootESXihosts,backupconfigurationinformation,andmanage
hostupdates.YoucanalsouseahostmanagementcommandtomakeyourhostjoinanActiveDirectory
domainorexitfromadomain.
Thechapterincludesthefollowingtopics:
Stopping,Rebooting,andExaminingHostsonpage 21
EnteringandExitingMaintenanceModeonpage 22
BackingUpConfigurationInformationwithvicfgcfgbackuponpage 23
ManagingVMkernelModulesonpage 24
UsingvicfgauthconfigforActiveDirectoryConfigurationonpage 25
UpdatingHostsonpage 26
ForinformationonupdatingESXi5.0hostswiththeesxcli softwarecommandandonchangingthehost
acceptanceleveltomatchthelevelofaVIBthatyoumightwanttouseforanupdate,seethevSphereUpgrade
documentation.
VMware, Inc.
21
ShuttingdownamanagedhostdisconnectsitfromthevCenterServersystem,butdoesnotremovethehost
fromtheinventory.Youcanshutdownasinglehostorallhostsinadatacenterorcluster.Specifyoneofthe
optionslistedinConnectionOptionsonpage 17inplaceof<conn_options>.
Singlehost.Runvicfg-hostopswith--operationshutdown.
Ifthehostisinmaintenancemode,runthecommandwithoutthe--forceoption.
vicfg-hostops <conn_options> --operation shutdown
Ifthehostisnotinmaintenancemode,use--forcetoshutdownthehostandallrunningvirtual
machines.
vicfg-hostops <conn_options> --operation shutdown --force
Allhostsindatacenterorcluster.Toshutdownallhostsinaclusterordatacenter,specify--clusteror
--datacenter.
vicfg-hostops <conn_options> --operation shutdown --cluster <my_cluster>
vicfg-hostops <conn_options> --operation shutdown --datacenter <my_datacenter>
Youcanrebootasinglehostorallhostsinadatacenterorcluster.
Singlehost.Runvicfg-hostopswith--operationreboot.
Ifthehostisinmaintenancemode,runthecommandwithoutthe--forceoption.
vicfg-hostops <conn_options> --operation reboot
Ifthehostisnotinmaintenancemode,use--forcetoshutdownthehostandallrunningvirtual
machines.
vicfg-hostops <conn_options> --operation reboot --force
Allhostsindatacenterorcluster.Youcanspecify--clusteror--datacentertorebootallhostsina
clusterordatacenter.
vicfg-hostops <conn_options> --operation reboot --cluster <my_cluster>
vicfg-hostops <conn_options> --operation reboot --datacenter <my_datacenter>
Youcandisplayinformationaboutahostbyrunningvicfg-hostopswith--operationinfo.
vicfg-hostops <conn_options> --operation info
Thecommandreturnsthehostname,manufacturer,model,processortype,CPUcores,memorycapacity,and
boottime.ThecommandalsoreturnswhethervMotionisenabledandwhetherthehostisinmaintenance
mode.
22
VMware, Inc.
Ifyouattempttoexitmaintenancemodewhenthehostisnolongerinmaintenancemode,anerrorinforms
youthatmaintenancemodeisalreadydisabled.
Afterallvirtualmachinesonthehosthavebeensuspendedormigrated,thehostentersmaintenancemode.
Youcannotdeployorpoweronavirtualmachineonhostsinmaintenancemode.
Youcanputallhostsinaclusterordatacenterinmaintenancemodebyusingthe--clusteror--datacenter
option.Donotusethoseoptionsunlesssuspendingallvirtualmachinesinthatclusterordatacenterisno
problem.
Youcanlaterrunvicfg-hostops <conn_options> --operation exittoexitmaintenancemode.
Backup Tasks
Duringaconfigurationbackup,theserialnumberisbackedupwiththeconfiguration.Thenumberisrestored
whenyourestoretheconfiguration.ThenumberisnotpreservedwhenyouruntheRecoveryCD(ESXi
Embedded)orperformarepairoperation(ESXiInstallable).
Youcanbackupandrestoreconfigurationinformationasfollows.
1
Backuptheconfigurationbyusingthevicfg-cfgbackupcommand.
RuntheRecoveryCDorrepairoperation
Restoretheconfigurationbyusingthevicfg-cfgbackupcommand.
Whenyourestoreaconfiguration,youmustmakesurethatallvirtualmachinesonthehostarestopped.
VMware, Inc.
23
Forthebackupfilename,includethenumberofthebuildthatisrunningonthehostthatyouarebackingup.
IfyouarerunningvCLIonvMA,thebackupfileissavedlocallyonvMA.Backupfilescansafelybestored
locallybecausevirtualappliancesarestoredinthe/vmfs/volumes/<datastore>directoryonthehost,
whichisseparatefromtheESXiimageandconfigurationfiles.
Poweroffallvirtualmachinesthatarerunningonthehostthatyouwanttorestore.
LogintoahostonwhichvCLIisinstalled,orlogintovMA.
Runvicfg-cfgbackupwiththe-lflagtoloadthehostconfigurationfromthespecifiedbackupfile.
SpecifyoneoftheoptionslistedinConnectionOptionsonpage 17inplaceof<conn_options>.
Ifyourunthefollowingcommand,youarepromptedforconfirmation.
vicfg-cfgbackup <conn_options> -l /tmp/ESXi_181842_backup.tgz
Ifyourunthefollowingcommand,youarenotpromptedforconfirmation.
vicfg-cfgbackup <conn_options> -l /tmp/ESXi_181842_backup.tgz -q
Torestorethehosttofactorysettings,runvicfg-cfgbackupwiththe-roption:
vicfg-cfgbackup <conn_options> -r
Tobackuponeofthehostsconfiguration(host1orhost2),runvicfg-cfgbackupfromthevMA
appliancerunningoneitherhost1orhost2.Usethe--serveroptiontospecifythehostforwhichyou
wantbackupinformation.TheinformationisstoredonvMA.
Torestorethehost1configuration,runvicfg-cfgbackupfromthevMAappliancerunningonhost2.Use
the--serveroptiontopointtohost1torestoretheconfigurationtothathost.
Torestorethehost2configuration,runvicfg-cfgbackupfromthevMAappliancerunningonhost1.Use
the--serveroptiontopointtohost2torestoretheconfigurationtothathost.
24
VMware, Inc.
Listinformationaboutthemodule.
esxcli <conn_options> system module list -module=module_name
Thesystemreturnsthename,type,value,anddescriptionofthemodule.
2
(Optional)Listallenabledorloadedmodules.
esxcli <conn_options> system module list --enabled=true
esxcli <conn_options> system module list --loaded=true
Enablethemodel.
esxcli <conn_options> system module set --module=module_name --enabled=true
Settheparameter.
esxcli system module parameters set --module module_name
--parameter-string="parameter_string"
Verifythatthemoduleisconfigured.
esxcli <conn_options> system module parameters list --module=module_name
Runvicfg-module --listtolistthemodulesonthehost.
vicfg-module <conn_options> --list
Runvicfg-module --set-optionswithconnectionoptions,theoptionstringtobepassedtoamodule,
andthemodulename.Forexample:
vicfg-module <conn_options> --set-options 'parameter_name=value' module_name
Toretrievetheoptionstringthatisconfiguredtobepassedtoamodulewhenthemoduleisloaded,run
vicfg-module --get-options.Thisstringisnotnecessarilytheoptionstringcurrentlyinusebythe
module.
vicfg-module <conn_options> --get-options module_name
Verifiesthatamoduleisconfigured.
VMware, Inc.
25
vicfg-authconfigallowsyoutoremotelyconfigureActiveDirectorysettingsonESXihosts.Youcanlist
supportedandactiveauthenticationmechanisms,listthecurrentdomain,andjoinorpartfromanActive
Directorydomain.BeforeyourunthecommandonanESXihost,youmustpreparethehost.
IMPORTANTAllhoststhatjoinActiveDirectorymustalsobemanagedbyanNTPServertoavoidissueswith
clockskewsandKerberostickets.
To prepare ESXi hosts for Active Directory Integration
1
MakesuretheESXisystemandtheActiveDirectoryserverareusingthesametimezonebyconfiguring
ESXiandADtousesameNTPserver.
TheESXisystemstimezoneisalwayssettoUTC.
ConfiguretheESXisystemsDNStobeintheActiveDirectorydomain.
Youcanrunvicfg-authconfigtoaddthehosttothedomain.Auserwhorunsvicfg-authconfigto
configureActiveDirectorysettingsmusthavetheappropriateActiveDirectorypermissions,andmusthave
administrativeprivilegesontheESXihost.Youcanrunthecommanddirectlyagainstthehostoragainsta
vCenterServersystem,specifyingthehostwith--vihost.
To set up Active Directory
1
InstalltheESXihost,asexplainedinthevSphereInstallationandSetupdocumentation.
InstallWindowsActiveDirectoryonaWindowsServerthatrunsWindows2000,Windows2003,or
Windows2008.SeetheMicrosoftWebsiteforinstructionsandbestpractices.
SynchronizetimebetweentheESXisystemandWindowsActiveDirectory(AD).
TestthattheWindowsADServercanpingtheESXihostbyusingthehostname.
ping <ESX_hostname>
Runvicfg-authcofigtoaddthehosttotheActiveDirectorydomain.
vicfg-authconfig --server=<ESXi Server IP Address>
--username=<ESXi Server Admin Username>
--password=<ESXi Server Admin User's Password>
--authscheme AD --joindomain <AD Domain Name>
--adusername=<Active Directory Administrator User Name>
--adpassword=<Active Directory Administrator User's Password>
Thesystempromptsforusernamesandpasswordsifyoudonotspecifythemonthecommandline.
Passwordsarenotechoedtothescreen.
6
VerifytheESXihostisintheintendedWindowsADdomain.
vicfg-authconfig --server XXX.XXX.XXX.XXX --authscheme AD -c
YouarepromptedforausernameandpasswordfortheESXisystem.
Updating Hosts
Whenyouaddcustomdriversorpatchestoahost,theprocessiscalledanupdate.
26
UpdateESXi4.0andESXi4.1hostswiththevihostupdatecommand,asdiscussedinthevSphere
CommandLineInterfaceInstallationandReferenceGuideincludedinthevSphere4.1documentationset.
VMware, Inc.
Managing Files
ThevSphereCLIincludestwocommandsforfilemanipulation.vmkfstoolsallowsyoutomanipulateVMFS
(VirtualMachineFileSystem)andvirtualdisks.vifssupportsremoteinteractionwithfilesonyourESXihost.
NOTESeeManagingStorageonpage 39forinformationaboutstoragemanipulationcommands.
Thischapterincludesthefollowingtopics:
IntroductiontoVirtualMachineFileManagementonpage 27
ManagingtheVirtualMachineFileSystemwithvmkfstoolsonpage 28
UpgradingVMFS3VolumestoVMFS5onpage 29
ManagingVMFSVolumesonpage 29
ReclaimingUnusedStorageSpaceonpage 31
DetachingDevicesandRemovingaLUNonpage 32
WorkingwithPermanentDeviceLossonpage 33
UsingvifstoManipulateFilesonRemoteESXiHostsonpage 33
VirtualMachineFileSystem(VMFS).Highperformancefilesystemthatisoptimizedforstoringvirtual
machines.YourhostcandeployaVMFSdatastoreonanySCSIbasedlocalornetworkedstoragedevice,
includingFibreChannelandiSCSISANequipment.AsanalternativetousingtheVMFSdatastore,your
virtualmachinecanhavedirectaccesstorawdevicesanduseamappingfile(RDM)asaproxy.
YoumanageVMFSandRDMswiththevSphereWebClient,orthevmkfstoolscommand.
NetworkFileSystem(NFS).FilesystemonaNASstoragedevice.ESXisupportsNFSversion3over
TCP/IP.ThehostcanaccessadesignatedNFSvolumelocatedonanNFSserver,mountthevolume,and
useitforanystorageneeds.
YoumanageNASstoragedeviceswiththeesxcli storage nfscommand.
VMware, Inc.
27
virtual
machine
virtual
machine
virtual
machine
virtual
machine
local
ethernet
SCSI
fibre
channel
HBA
VMFS
SAN
software
initiator
iSCSI
hardware
initiator
ethernet
NIC
LAN
ethernet
NIC
LAN
LAN
Key
physical
disk
datastore
virtual
disk
VMFS
fibre array
VMFS
iSCSI array
NFS
NAS appliance
28
--breaklock -B
--chainConsistent -e
--eagerzero -k
--fix -x
--lock -L
--migratevirtualdisk -M
--parseimage -Y
--punchzero -K
--snapshotdisk -I
--verbose -v
VMware, Inc.
ManagingVMFSvolumes
esxcli storage filesystem listshowsallvolumes,mountedandunmounted,thatareresolved,
thatis,thatarenotsnapshotvolumes.
esxcli storage filesystem unmountunmountsacurrentlymountedfilesystem.Usethiscommand
forsnapshotvolumesorresolvedvolumes.
Managingsnapshotvolumes
esxcli storage vmfs snapshotcommandscanbeusedforlisting,mounting,andresignaturing
snapshotvolumes.SeeMountingDatastoreswithExistingSignaturesonpage 29andResignaturing
VMFSCopiesonpage 30.
VMware, Inc.
29
Listallvolumesthathavebeendetectedassnapshots.
esxcli <conn_options> storage filesystem list
Thiscommandfailsiftheoriginalcopyisonline.
Youcanlaterrunesxcli storage filesystem volume unmounttounmountthesnapshotvolume.
esxcli <conn_options> storage filesystem volume unmount
--volume-label=<label>|--volume-uuid=<VMFS-UUID>
Listallvolumesthathavebeendetectedassnapshotsorreplicas.
vicfg-volume <conn_options> --list
Thiscommandfailsiftheoriginalcopyisonline.
Youcanlaterrunvicfg-volume --unmounttounmountthesnapshotorreplicavolume.
vicfg-volume <conn_options> --unmount <VMFS-UUID|label>
Thevicfg-volumecommandsupportsresignaturingasnapshotvolumeandmountingandunmountingthe
volume.Youcanalsomakethemountedvolumepersistentacrossrebootsandqueryalistofsnapshot
volumesandoriginalvolumes.
30
Datastoreresignaturingisirreversible.
TheLUNcopythatcontainstheVMFSdatastorethatyouresignatureisnolongertreatedasaLUNcopy.
VMware, Inc.
Aspanneddatastorecanberesignaturedonlyifallitsextentsareonline.
Theresignaturingprocessiscrashandfaulttolerant.Iftheprocessisinterrupted,youcanresumeitlater.
YoucanmountthenewVMFSdatastorewithoutariskofitsUUIDconflictingwithUUIDsofanyother
datastore,suchasanancestororchildinahierarchyofLUNsnapshots.
YoucanresignatureaVMFScopywithESXCLI(seeResignaturingaVMFSCopywithESXCLIonpage 31)
orwithvicfg-volumeseeResignaturingaVMFSCopywithvicfgvolumeonpage 31.
Listunresolvedsnapshotsorreplicavolumes.
esxcli <conn_options> storage vmfs snapshot list
(Optional)Unmountthecopy.
esxcli <conn_options> storage filesystem unmount
Runtheresignaturecommand.
esxcli <conn_options> storage vmfs snapshot resignature
--volume-label=<label>|--volume-uuid=<id>
Thecommandreturnstothepromptorsignalsanerror.
Afterresignaturing,youmighthavetodothefollowing:
Iftheresignatureddatastorecontainsvirtualmachines,updatereferencestotheoriginalVMFSdatastore
inthevirtualmachinefiles,including.vmx,.vmdk,.vmsd,and.vmsn.
Topoweronvirtualmachines,registerthemwiththevCenterServersystem.
Makesurethecopyisnotmounted.
Runvicfg-volumewiththeresignatureoption.
vicfg-volume <conn_options> --resignature <VMFS-UUID|label>
Thecommandreturnstothepromptorsignalsanerror.
VMware, Inc.
31
Migratevirtualmachinesfromthedeviceyouplantodetach.
Forinformationonmigratingvirtualmachines,seethevCenterServerandHostManagement
documentation.
Unmountthedatastoredeployedonthedevice.SeeMountingDatastoreswithExistingSignatureson
page 29.
Iftheunmountfails,ESXCLIreturnsanerror.Ifyouignorethaterror,youwillgetanerrorinstep4when
youattempttodetachadevicewithaVMFSpartitionstillinuse.
Iftheunmountfailed,checkwhetherthedeviceisinuse.
esxcli storage core device world list -d <device>
IfaVMFSvolumeisusingthedeviceindirectly,theworldnameincludesthestringidle0.Ifavirtual
machineusesthedeviceasanRDM,thevirtualmachineprocessnameisdisplayed.Ifanyotherprocess
isusingtherawdevice,theinformationisdisplayed.
4
Detachthestoragedevice.
esxcli storage core device set -d naa.xxx... --state=off
Detachispersistentacrossrebootsanddeviceunregistration.Anydevicethatisdetachedremains
detacheduntilamanualattachoperation.Rescandoesnotbringpersistentlydetacheddevicesback
online.Apersistentlydetacheddevicecomesbackintheoffstate.
ESXimaintainsthepersistentinformationaboutthedevicesofflinestateevenifthedeviceis
unregistered.Youcanremovethedeviceinformationbyrunningesxcli storage core device
detached remove -d naa.12.
5
(Optional)Totroubleshootthedetachoperation,listalldevicesthatweredetachedmanually.
esxcli storage core device detached list
Performarescan.
esxcli <conn_options> storage core adapter rescan
Whenyouhavecompletedstoragereconfiguration,youcanreattachthestoragedevice,mountthedatastore,
andrestartthevirtualmachines.
To reattach the device
1
(Optional)Checkthatthedeviceisdetached.
esxcli storage core device detached list
Attachthedevice.
esxcli storage core device set -d naa.XXX --state=on
32
Mountthedatastoreandrestartvirtualmachines.SeeMountingDatastoreswithExistingSignatureson
page 29.
VMware, Inc.
IftheLUNthatgoesintoPDLisnotinusebyanyuserprocessorbytheVMkernel,theLUNdisappears
byitselfafteraPDL.
IftheLUNwasinusewhenitenteredPDL,deletetheLUNmanuallybyfollowingtheprocessdescribed
inDetachingDevicesandRemovingaLUNonpage 32.
ReturntheLUNtoworkingorder.
Removeanyusersofthedevice.
Youcannotbringadevicebackwithoutremovingactiveusers.TheESXihostcannotknowwhetherthe
devicethatwasaddedbackhaschanged.ESXimustbeabletotreatthedevicesimilarlytoanewdevice
beingdiscovered.
Performarescantogetthedevicebackinworkingorder.
YoucanviewdatacenteranddatastoredirectoriesfromthisrootURL.Forexample:
http://<ESXi_addr>/folder?dcPath=ha-datacenter
http://<ESXi_host_name>/folder?dcPath=ha-datacente
VMware, Inc.
33
TheESXihostpromptsforausernameandpassword.
Thevifscommandsupportsdifferentoperationsforthefollowinggroupsoffilesanddirectories.Different
operationsareavailableforeachgroup,andyouspecifylocationswithadifferentsyntax.Thebehaviordiffers
forvSphere4.xandvSphere5.0.
Host
vSphere 4.x
vSphere 5.0
Hostconfigurationfiles.Youmustspecifythe
filesuniquenameidentifier.
Hostconfigurationfiles.Youmustspecifythe
filesuniquenameidentifier.
Specifyhostlocationsbyusingthe
/host/<path>syntax.
Specifyhostlocationsbyusingthe
/host/<path>syntax.
Youcannotlistsubdirectoriesof/host.
Temp
The/tmpdirectoryandfilesinthatdirectory.
Notsupported.
Specifytemplocationsbyusingthe
/tmp/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)
"/folder/testvms/VM1/VM1.vmx?dsName=myStorage1" (Windows)
Thetwoexamplepathsrefertoavirtualmachineconfigurationfileforthevirtualmachine
VM1inthetestvms/VM1directoryofthemyStorage1datastore.
Toavoidproblemswithdirectorynamesthatusespecialcharactersorspaces,enclosethepathinquotesfor
bothoperatingsystems.
Whenyourunvifs,youcanspecifytheoperationnameandargumentandoneofthestandardconnection
options.Usealiases,symboliclinks,orwrapperscriptstosimplifytheinvocationsyntax.
IMPORTANTTheconceptsofworkingdirectoryandlastdirectoryorfileoperatedonarenotsupportedwith
vifs.
Options
vifscommandspecificoptionsallowyoutoretrieveanduploadfilesfromtheremotehostandperforma
numberofotheroperations.Allvifsoptionsworkondatastorefilesordirectories.Someoptionsalsowork
onhostfilesandfilesinthetempdirectory.Youmustalsospecifyconnectionoptions.
Command
Description
Target
Syntax
--copy
-c <source>
<target>
Copiesafileinadatastoretoanotherlocation
inadatastore.The<source>mustbearemote
sourcepath,the<target>aremotetarget
pathordirectory.
Datastore
Temp
copy src_file_path
dst_directory_path
[force]
copy src_file_path
dst_file_path [force]
The--forceoptionreplacesexisting
destinationfiles.
34
--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>
DownloadsafilefromtheESXihosttothe
machineonwhichyourunvCLI.This
operationusesHTTP GET.
Datastore
Host
get src_dstore_file_path
dst_local_file_path
--listdc
-C
ListsthedatacenterpathsavailableonanESXi
system.
Datastore
Host
VMware, Inc.
Command
Description
Target
Syntax
--listds
-S
ListsthedatastorenamesontheESXisystem.
Whenmultipledatacentersareavailable,use
the--dc (-Z)argumenttospecifythename
ofthedatacenterfromwhichyouwanttolist
thedatastore.
Datastore
Host
vifs --listds
--mkdir
-M <remote_dir>
Createsadirectoryinadatastore.This
operationfailsiftheparentdirectoryof
dst_datastore_file_pathdoesnotexist.
Datastore
Temp
mkdir dst_directory_path
--move
-m <source>
<target>
Movesafileinadatastoretoanotherlocation
inadatastore.The<source>mustbearemote
sourcepath,the<target>aremotetarget
pathordirectory.
Datastore
Temp
move src_file_path
dst_directory_path
[force]
move src_file_path
dst_file_path [force]
The--forceoptionreplacesexisting
destinationfiles.
--put
-p <local_path>
<remote_path>
Uploadsafilefromthemachineonwhichyou
runvCLItotheESXihost.Thisoperationuses
HTTP PUT.
Datastore
Host
Temp
put src_local_file_path
dst_file_path
Thiscommandcanreplaceexistinghostfiles
butcannotcreatenewfiles.
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
Examples
YoucanusevifstointeractwiththeremoteESXiorvCenterServersysteminavarietyofways.Specifyone
oftheconnectionoptionslistedinConnectionOptionsonpage 17inplaceof<conn_options>.The
examplesillustrateuseonaLinuxsystem,usedoublequotesinsteadofsinglequoteswhenonaWindows
system.
Listing Remote Information
ListalldatacentersonavCenterServersystemwith--listdc,using--servertopointtothevCenter
Serversystem.
vifs --server <my_vc>--username administrator --password <pswd> --listdc
ListalldatastoresonavCenterServersystemwith--listds.
vifs --server <my_vc> --username administrator --password <pswd> --dc kw-dev --listds
ListalldatastoresonanESXihostwith--listds.
vifs --server <my_ESXi> --username root --password <pswd> --listds
Thecommandliststhenamesofalldatastoresonthespecifiedserver.
Youcanuseeachnamethathasbeenreturnedtorefertodatastorepathsbyusingsquarebracketnotation,
asfollows:
'[my_datastore] dir/subdir/file'
Listthecontentofadirectoryinadatastore.
vifs --server <my_ESXi> --username root --password <pswd>--dir '[Storage1]'
vifs --server <my_ESXi> --username root --password <pswd> --dir '[Storage1] WindowsXP'
Thecommandliststhedirectorycontent.Inthisexample,thecommandliststhecontentsofavirtual
machinedirectory.
Content Listing
_________________
vmware-37.log
VMware, Inc.
35
vmware-38.log
...
vmware.log
...
winxpPro-sp2.vmdk
winxpPro-sp2.vmx
winxpPro-sp2.vmxf
...
Listthecontentsofoneofthedatastores.
vifs <conn_options> --dir '[osdc-cx700-02]'
Thecommandliststhecompletecontentsofthedatastore.
Working with Directories and Files on the Remote Server
Createanewdirectoryinadatastorewith--mkdir <remote_dir>.
vifs --server <my_ESXi> --username root --password <pswd> --mkdir '[Storage1] test'
Removeadirectorywith--rmdir <remote_dir>.
vifs --server <my_ESXi> --username root --password <pswd> --rmdir '[Storage1] test'.
Deleteafileontheremoteserverwith-rm <remote_path>.
vifs --server <my_ESXi> --username root --password <pswd> --rm '[Storage1] test2/testfile'
Moveafilefromonelocationontheremoteservertoanotherlocationwith--move
<remote_source_path> <remote_target_path>.Ifyouspecifyafilename,thefileismovedand
renamedatthesametime.
vifs --server <my_ESXi> --username root --password <pswd> --move '[Storage1] test/tfile'
'[Storage1] newfile'
Ifthetargetfilealreadyexistsontheremoteserver,thecommandfailsunlessyouuse--force.
vifs --server <my_ESXi> --username root --password <pswd> --move '[Storage1] test/tfile2'
'[Storage1] test2/tfile' --force
Createacopyofafileontheremoteserveratadifferentlocationontheremoteserver.
vifs --server <my_ESXi> --username root --password <pswd> --copy '[Storage1] test/tfile'
'[Storage1] test/tfile2'
Ifthetargetfilealreadyexistsontheremoteserver,thecommandfailsunlessyouuse--force.
vifs --server <my_ESXi> --username root --password <pswd> --copy '[Storage1] test/tfile'
'[Storage1] test/tfile2' --force
36
VMware, Inc.
Example Scenario
Thefollowingexamplescenarioillustratesotherusesofvifs.Specifyoneoftheconnectionoptionslistedin
ConnectionOptionsonpage 17inplaceof<conn_options>.
To manage files and directories on the remote ESXi system
1
Createadirectoryinthedatastore.
vifs <conn_options> --mkdir '[osdc-cx700-03] vcli_test'
Youmustspecifytheprecisepath;thereisnoconceptofarelativepath.
2
Placeafilethatisonthesystemfromwhichyouarerunningthecommandsintothenewlycreated
directory.
vifs <conn_options> --put /tmp/test_doc '[osdc-cx700-03] vcli_test/test_doc'
Moveafileintoavirtualmachinedirectory.
vifs <conn_options> --move '[osdc-cx700-03] vcli_test/test_doc'
'[osdc-cx700-03] winxpPro-sp2/test_doc
Amessageindicatessuccessorfailure.
4
RetrieveoneofthefilesfromtheremoteESXisystem.
Thefollowingexampleretrievesalogfileforanalysis.
vifs <conn_options> --get '[osdc-cx700-03] winxpPro-sp2/vmware.log' ~user1/vmware.log
Cleanupbyremovingthefileanddirectoryyoucreatedearlier.
vifs <conn_options> --rm '[osdc-cx700-03] vcli_test/test_doc'
vifs <conn_options> --rmdir '[osdc-cx700-03] vcli_test'
VMware, Inc.
37
38
VMware, Inc.
Managing Storage
Avirtualmachineusesavirtualdisktostoreitsoperatingsystem,programfiles,andotherdataassociated
withitsactivities.Avirtualdiskisalargephysicalfile,orasetoffiles,thatcanbecopied,moved,archived,
andbackedup.
Tostorevirtualdiskfilesandmanipulatethefiles,ahostrequiresdedicatedstoragespace.ESXistorageis
storagespaceonavarietyofphysicalstoragesystems,localornetworked,thatahostusestostorevirtual
machinedisks.
Thischapterincludesthefollowingtopics:
IntroductiontoStorageonpage 39
ExaminingLUNsonpage 42
ManagingPathsonpage 44
ManagingPathPoliciesonpage 47
ManagingNFS/NASDatastoresonpage 50
MonitoringandManagingSANStorageonpage 52
MigratingVirtualMachineswithsvmotiononpage 52
ConfiguringFCoEAdaptersonpage 54
ScanningStorageAdaptersonpage 55
RetrievingSMARTInformationonpage 55
Introduction to Storage
FibreChannelSANarrays,iSCSISANarrays,andNASarraysarewidelyusedstoragetechnologiessupported
byVMwarevSpheretomeetdifferentdatacenterstorageneeds.Thestoragearraysareconnectedtoand
sharedbetweengroupsofserversthroughstorageareanetworks.Thisarrangementallowsaggregationofthe
storageresourcesandprovidesmoreflexibilityinprovisioningthemtovirtualmachines.
VMware, Inc.
39
Web access
vSphere Client
server
group 1
server
group 2
terminal
server
group 3
virtual machines
VM
VM
VM
VM
VM
VM
ESX/ESXi
fibre channel
storage array
iSCSI
storage array
NAS
storage array
virtual
machine
virtual
machine
virtual
machine
virtual
machine
local
ethernet
SCSI
fibre
channel
HBA
VMFS
SAN
software
initiator
iSCSI
hardware
initiator
ethernet
NIC
LAN
ethernet
NIC
LAN
LAN
Key
physical
disk
datastore
virtual
disk
40
VMFS
fibre array
VMFS
iSCSI array
NFS
NAS appliance
VMware, Inc.
YoucanusevCLIcommandstomanagethevirtualmachinefilesystemandstoragedevices.
VMFS.Usevmkfstoolstocreate,modify,andmanageVMFSvirtualdisksandrawdevicemappings.
SeeManagingtheVirtualMachineFileSystemwithvmkfstoolsonpage 28foranintroductionandthe
vSphereStoragedocumentationforadetailedreference.
Datastores.Severalcommandsallowyoutomanagedatastoresandareusefulformultipleprotocols.
Storagedevices.Severalcommandsmanageonlyspecificstoragedevices.
iSCSIstorage.Useesxcli iscsiorvicfg-iscsitomanagebothhardwareandsoftwareiSCSI.
SeeManagingiSCSIStorageonpage 57.
Datastores
ESXihostsusestoragespaceonavarietyofphysicalstoragesystems,includinginternalandexternaldevices
andnetworkedstorage.Ahostcandiscoverstoragedevicestowhichithasaccessandformatthemas
datastores.Eachdatastoreisaspeciallogicalcontainer,analogoustoafilesystemonalogicalvolume,where
thehostplacesvirtualdiskfilesandothervirtualmachinefiles.Datastoreshidespecificsofeachstorage
productandprovideauniformmodelforstoringvirtualmachinefiles.
Dependingonthetypeofstorageyouuse,datastorescanbebackedbythefollowingfilesystemformats:
VirtualMachineFileSystem(VMFS).Highperformancefilesystemoptimizedforstoringvirtual
machines.YourhostcandeployaVMFSdatastoreonanySCSIbasedlocalornetworkedstoragedevice,
includingFibreChannelandiSCSISANequipment.
AsanalternativetousingtheVMFSdatastore,yourvirtualmachinecanhavedirectaccesstorawdevices
anduseamappingfile(RDM)asaproxy.SeeManagingtheVirtualMachineFileSystemwith
vmkfstoolsonpage 28.
NetworkFileSystem(NFS).FilesystemonaNASstoragedevice.ESXisupportsNFSversion3over
TCP/IP.ThehostcanaccessadesignatedNFSvolumelocatedonanNFSserver,mountthevolume,and
useitforanystorageneeds.
Name.AfriendlynamethattheESXihostassignstoadevicebasedonthestoragetypeandmanufacturer,
forexample,DGCFibreChannelDisk.ThisnameisvisibleinthevSphereWebClient.
DeviceUID.Auniversallyuniqueidentifierassignedtoadevice.Thetypeofstoragedeterminesthe
algorithmusedtocreatetheidentifier.Theidentifierispersistentacrossrebootsandisthesameforall
hostssharingthedevice.Theformatisoftennaa.xxxxxxxoreui.xxxxxxxx.
VMLName.AlegacySCSIdevicenamespecifictoVMware.UsethedeviceUIDinstead.
Theruntimenameofthefirstpathtothedeviceisapathidentifierandnotareliableidentifierforthedevice.
Runtimenamesarecreatedbythehost,andarenotpersistent.Theruntimenamehastheformat
vmhba#:C#:T#:L#.YoucanviewtheruntimenameusingthevSphereWebClient.
VMware, Inc.
41
Examining LUNs
ALUN(LogicalUnitNumber)isanidentifierforadiskvolumeinastoragearraytarget.
LUN
storage array
LUN
target
target
target
LUN
LUN
LUN
storage array
InFigure 43,threeLUNsareavailableineachconfiguration.Ontheleft,thehostseesonetarget,butthat
targethasthreeLUNsthatcanbeused.EachLUNrepresentsanindividualstoragevolume.Ontheright,the
hostseesthreedifferenttargets,eachhavingoneLUN.
Listalllogicaldevicesknownonthissystemwithdetailedinformation.
esxcli <conn_options> storage core device list
Thecommandlistsdeviceinformationforalllogicaldevicesonthissystem.Theinformationincludesthe
name(UUID),devicetype,displayname,andmultipathingplugin.Specifythe--deviceoptiontoonly
listinformationaboutaspecificdevice.
naa.5000c50006ee9cc7
Display Name: Local SEAGATE Disk (naa.5000c50006ee9cc7)
Has Settable Display Name: true
Size: 286102
Device Type: Direct-Access
Multipath Plugin: NMP
Devfs Path: /vmfs/devices/disks/naa.5000c50006ee9cc7
Vendor: SEAGATE
Model: ST3300555SS
Revision: T211
SCSI Level: 5
Is Pseudo: false
Status: on
Is RDM Capable: true
Is Local: true
Is Removable: false
Is SSD: false
Thin Provisioning Status: unknown
Attached Filters:
VAAI Status: unknown
VAAI Plugin Name:
Other UIDs: vml.02000000005000c50006ee9cc7535433333030
mpx.vmhba0:C0:T0:L0
42
VMware, Inc.
...
Attached Filters:
VAAI Status: unsupported
VAAI Plugin Name:
Other UIDs: vml.0005000000766d686261303a303a30
Listaspecificlogicaldevicewithitsdetailedinformation.
esxcli <conn_options> storage core device list -d mpx.vmhba32:C0:T1:L0
Listalldeviceuniqueidentifiers.
esxcli <conn_options> storage core device list
ThecommandliststheprimaryUIDforeachdevice(naa.xxxorotherprimaryname)andanyotherUIDs
foreachUID(VMLname).Youcanspecify--devicetoonlylistinformationforaspecificdevice.
PrintmappingsforVMFSvolumestothecorrespondingpartition,pathtothatpartition,VMFSUUID,
extentnumber,andvolumenames.
esxcli <conn_option> storage filesystem list
PrintHBAdeviceswithidentifyinginformation.
esxcli <conn_options> storage core adapter list
ThereturnvalueincludesadapterandUIDinformation.
PrintamappingbetweenHBAsandthedevicesitprovidespathsto.
esxcli <conn_options> storage core path list
Listalllogicaldevicesknownonthissystemwithdetailedinformation.
vicfg-scsidevs <conn_options> --list
Thecommandlistsdeviceinformationforalllogicaldevicesonthissystem.Theinformationincludesthe
name(UUID),devicetype,displayname,andmultipathingplugin.Specifythe--deviceoptiontoonly
listinformationaboutaspecificdevice.Thefollowingexampleshowsoutputfortwodevices;theactual
listingmightincludemultipledevicesandthepreciseformatdiffersbetweenreleases.
mpx.vmhba2:C0:T1:L0
Device Type: cdrom
Size: 0 MB
Display Name: Local HL-DT-ST (mpx.vmhba2:C0:T1:L0)
Plugin: NMP
Console Device: /vmfs/devices/cdrom/mpx.vmhba2:C0:T1:L0
Devfs Path: /vmfs/devices/cdrom/mpx.vmhba2:C0:T1:L0
Vendor: SONY
Model: DVD-ROM GDRXX8XX Revis: 3.00
SCSI Level: 5 Is Pseudo:
Status:
Is RDM Capable: Is Removable:
Other Names:
vml.000N000000XXXdXXXXXXXXaXXXaXX
VAAI Status: nnnn
naa.60060...
Device Type: disk
Size: 614400 MB
Display Name: DGC Fibre Channel Disk (naa.60060...)
...
VMware, Inc.
43
Listalllogicaldeviceswithabbreviatedinformation.
vicfg-scsidevs <conn_options> --compact-list
TheinformationincludesthedeviceID,devicetype,size,plugin,anddevicedisplayname.
Listalldeviceuniqueidentifiers.
vicfg-scsidevs <conn_options> --uids
ThecommandliststheprimaryUIDforeachdevice(naa.xxxorotherprimaryname)andanyotherUIDs
foreachUID(VMLname).Youcanspecify--devicetoonlylistinformationforaspecificdevice.
Listaspecificlogicaldevicewithitsdetailedinformation.
vicfg-scsidevs <conn_options> -l -d mpx.vmhba32:C0:T1:L0
PrintmappingsforVMFSvolumestothecorrespondingpartition,pathtothatpartition,VMFSuuid,
extentnumber,andvolumenames.
vicfg-scsidevs <conn_options> --vmfs
PrintHBAdeviceswithidentifyinginformation.
vicfg-scsidevs <conn_options> --hbas
ThereturnvalueincludestheadapterID,driverID,adapterUID,PCI,vendor,andmodel.
PrintamappingbetweenHBAsandthedevicesitprovidespathsto.
vicfg-scsidevs <conn_options> --hba-device-list
Managing Paths
TomaintainaconstantconnectionbetweenanESXihostanditsstorage,ESXisupportsmultipathing.With
multipathingyoucanusemorethanonephysicalpathfortransferringdatabetweentheESXihostandthe
externalstoragedevice.
IncaseoffailureofanelementintheSANnetwork,suchasanHBA,switch,orcable,theESXihostcanfail
overtoanotherphysicalpath.Onsomedevices,multipathingalsooffersloadbalancing,whichredistributes
I/Oloadsbetweenmultiplepathstoreduceoreliminatepotentialbottlenecks.
ThestoragearchitectureinvSphere4.0andlatersupportsaspecialVMkernellayer,PluggableStorage
Architecture(PSA).ThePSAisanopenmodularframeworkthatcoordinatesthesimultaneousoperationof
multiplemultipathingplugins(MPPs).YoucanmanagePSAusingESXCLIcommands.SeeManaging
ThirdPartyStorageArraysonpage 85.ThissectionassumesyouareusingonlyPSApluginsincludedin
vSpherebydefault.
44
VMware, Inc.
HBA2
Host 2
HBA1
HBA3
HBA4
switch
switch
SP1
SP2
storage array
IfSP1orthelinkbetweenSP1andtheswitchbreaks,SP2takesoverandprovidestheconnectionbetweenthe
switchandthestoragedevice.ThisprocessiscalledSPfailover.ESXimultipathingsupportsHBAandSP
failover.
Afteryouhavesetupyourhardwaretosupportmultipathing,youcanusethevSphereWebClientorvCLI
commandstolistandmanagepaths.Youcanperformthefollowingtasks.
ChangepathpolicieswithESXCLI.SeeSettingPolicyDetailsforDevicesthatUseRoundRobinon
page 50.
MaskpathswithESXCLI.SeethevSphereStoragedocumentation.
Manipulatetherulesthatmatchpathstomultipathingpluginstonewlydiscovereddeviceswithesxcli
claimrule.SeeManagingClaimRulesonpage 93.
Runorrerunclaimrulesorunclaimpaths.SeeManagingClaimRulesonpage 93.
Rescanwithvicfg-rescan.SeeScanningStorageAdaptersonpage 55.
VMware, Inc.
45
Listalldeviceswiththeircorrespondingpaths,stateofthepath,adaptertype,andotherinformation.
esxcli <conn_options> storage core path list
Limitthedisplaytoonlyaspecifiedpathordevice.
esxcli <conn_options> storage core path list --path <path>
esxcli <conn_options> storage core path list --device <device>
ListthestatisticsfortheSCSIpathsinthesystem.Youcanlistallpathsorlimitthedisplaytoaspecific
path.
esxcli <conn_options> storage core path stats get
esxcli <conn_options> storage core path stats get --path <path
Listdetailedinformationforthepathsforthedevicespecifiedwith--device.
esxcli <conn_options> storage core path list -d <naa.xxxxxx>
Listalladapters.
esxcli <conn_options> storage core adapter list
Rescanalladapters.
esxcli <conn_options> storage core adapter rescan
Listalldeviceswiththeircorrespondingpaths,stateofthepath,adaptertype,andotherinformation.
vicfg-mpath <conn_options> --list-paths
Displayashortlistingofallpaths.
vicfg-mpath <conn_options> --list-compact
Listallpathswithadapteranddevicemappings.
vicfg-mpath <conn_options> --list-map
ListpathsanddetailedinformationbyspecifyingthepathUID(longpath).ThepathUIDisthefirstitem
inthevicfg-mpath --listdisplay.
vicfg-mpath <conn_options> --list
-P sas.5001c231c79c4a00-sas.1221000001000000-naa.5000c5000289c61b
Listpathsanddetailedinformationbyspecifyingthepathruntimename.
vicfg-mpath <conn_options> -l -P vmhba32:C0:T0:L0
Thereturninformationincludestheruntimename,device,devicedisplayname,adapter,adapter
identifier,targetidentifier,plugin,state,transport,andadapterandtargettransportdetails.
Listdetailedinformationforthepathsforthedevicespecifiedwith--device.
vicfg-mpath <conn_options> -l -d mpx.vmhba32:C0:T1:L0
vicfg-mpath <conn_options> --list --device naa.60060...
46
VMware, Inc.
(Optional)Listalldevicesandcorrespondingpaths.
esxcli <conn_options> storage core path list
Thedisplayincludesinformationabouteachpathsstate.
2
SetthestateofaLUNpathtooff.
esxcli <conn_options> storage core path set --state off --path vmhba32:C0:T1:L0
Whenyouareready,setthepathstatetoactiveagain.
esxcli <conn_options> storage core path set --state active --path vmhba32:C0:T1:L0
(Optional)Listalldevicesandcorrespondingpaths.
vicfg-mpath <conn_options> --list-paths
Thedisplayincludesinformationabouteachpathsstate.
2
SetthestateofaLUNpathtooff.
vicfg-mpath <conn_options> --state off --path vmhba32:C0:T1:L0
Whenyouareready,setthepathstatetoactiveagain.
vicfg-mpath <conn_options> --state active --path vmhba32:C0:T1:L0
VMware, Inc.
47
Description
VMW_PSP_FIXED
Thehostusesthedesignatedpreferredpath,ifithasbeenconfigured.Otherwise,thehost
selectsthefirstworkingpathdiscoveredatsystemboottime.Ifyouwantthehosttousea
particularpreferredpath,specifyitthroughthevSphereWebClient,orbyusingesxcli
storage nmp psp fixed deviceconfig set.SeeChangingPathPoliciesonpage 49.
ThedefaultpolicyforactiveactivestoragedevicesisVMW_PSP_FIXED.
VMW_PSP_MRU
Thehostselectsthepaththatitusedmostrecently.Whenthepathbecomesunavailable,the
hostselectsanalternativepath.Thehostdoesnotrevertbacktotheoriginalpathwhenthat
pathbecomesavailableagain.ThereisnopreferredpathsettingwiththeMRUpolicy.MRU
isthedefaultpolicyforactivepassivestoragedevices.
VMW_PSP_RR
Thehostusesanautomaticpathselectionalgorithmthatrotatesthroughallactivepaths
whenconnectingtoactivepassivearrays,orthroughallavailablepathswhenconnectingto
activeactivearrays.Automaticpathselectionimplementsloadbalancingacrossthephysical
pathsavailabletoyourhost.LoadbalancingistheprocessofspreadingI/Orequestsacross
thepaths.ThegoalistooptimizethroughputperformancesuchasI/Opersecond,megabytes
persecond,orresponsetimes.
VMW_PSP_RRisthedefaultforanumberofarraysandcanbeusedwithbothactiveactiveand
activepassivearraystoimplementloadbalancingacrosspathsfordifferentLUNs.
Thetypeofarrayandthepathpolicydeterminethebehaviorofthehost.
Table 4-2. Path Policy Effects
Policy
Active/Active Array
Active/Passive Array
MostRecentlyUsed
Administratoractionisrequiredtofail
backafterpathfailure.
Administratoractionisrequiredtofailback
afterpathfailure.
Fixed
VMkernelresumesusingthepreferred
pathwhenconnectivityisrestored.
VMkernelattemptstoresumebyusingthe
preferredpath.Thisactioncancausepath
thrashingorfailurewhenanotherSPnow
ownstheLUN.
RoundRobin
Nofailback.
Nextpathinroundrobinschedulingis
selected.
Multipathing Considerations
Thefollowingconsiderationshelpyouwithmultipathing:
48
IfnoSATPisassignedtothedevicebytheclaimrules,thedefaultSATPforiSCSIorFCdevicesis
VMW_SATP_DEFAULT_AA.ThedefaultPSPisVMW_PSP_FIXED.
WhenthesystemsearchestheSATPrulestolocateaSATPforagivendevice,itsearchesthedriverrules
first.Ifthereisnomatch,thevendor/modelrulesaresearched,andfinallythetransportrulesare
searched.Ifnomatchoccurs,NMPselectsadefaultSATPforthedevice.
IfVMW_SATP_ALUAisassignedtoaspecificstoragedevice,butthedeviceisnotALUAaware,noclaim
rulematchoccursforthisdevice.ThedeviceisclaimedbythedefaultSATPbasedonthedevices
transporttype.
ThedefaultPSPforalldevicesclaimedbyVMW_SATP_ALUAisVMW_PSP_MRU.TheVMW_PSP_MRUselectsan
active/optimizedpathasreportedbytheVMW_SATP_ALUA,oranactive/unoptimizedpathifthereis
noactive/optimizedpath.Thispathisuseduntilabetterpathisavailable(MRU).Forexample,ifthe
VMW_PSP_MRUiscurrentlyusinganactive/unoptimizedpathandanactive/optimizedpathbecomes
available,theVMW_PSP_MRUwillswitchthecurrentpathtotheactive/optimizedone.
VMware, Inc.
WhileVMW_PSP_MRUistypicallyselectedforALUAarraysbydefault,certainALUAstoragearraysneed
touseVMW_PSP_FIXED.TocheckwhetheryourstoragearrayrequiresVMW_PSP_FIXED,seetheVMware
CompatibilityGuideorcontactyourstoragevendor.WhenusingVMW_PSP_FIXEDwithALUAarrays,
unlessyouexplicitlyspecifyapreferredpath,theESXihostselectsthemostoptimalworkingpathand
designatesitasthedefaultpreferredpath.Ifthehostselectedpathbecomesunavailable,thehostselects
analternativeavailablepath.However,ifyouexplicitlydesignatethepreferredpath,itwillremain
preferrednomatterwhatitsstatusis.
Bydefault,thePSAclaimrule101masksDellarraypseudodevices.Donotdeletethisrule,unlessyou
wanttounmaskthesedevices.
EnsureyourdeviceisclaimedbytheNMPplugin.OnlyNMPdevicesallowyoutochangethepathpolicy.
esxcli <conn_options> storage nmp device list
Retrievethelistofpathselectionpoliciesonthesystemtoseewhichvaluesarevalidforthe--pspoption
whenyousetthepathpolicy.
esxcli storage core plugin registration list --plugin-class="PSP"
Setthepathpolicyusingesxcli.
esxcli <conn_options> storage nmp device set --device naa.xxx --psp VMW_PSP_RR
(Optional)IfyouspecifiedtheVMW_PSP_FIXEDpolicy,youmustmakesurethepreferredpathisset
correctly.
a
Checkwhichpathisthepreferredpathforadevice.
esxcli <conn_options> storage nmp psp fixed deviceconfig get --device naa.xxx
Ifnecessary,changethepreferredpath.
esxcli <conn_options> storage nmp psp fixed deviceconfig set --device naa.xxx --path
vmhba3:C0:T5:L3
Thecommandsetsthepreferredpathtovmhba3:C0:T5:L3.Runthecommandwith--defaultto
clearthepreferredpathselection.
Listallmultipathingpluginsloadedintothesystem.
vicfg-mpath <conn_options> --list-plugins
Ataminimum,thiscommandreturnsNMP(NativeMultipathingPlugin)andMASK_PATH.IfotherMPP
pluginshavebeenloaded,theyarelistedaswell.
2
SetthepathpolicybyusingESXCLI.
esxcli <conn_options> nmp device set --device naa.xxx --psp VMW_PSP_RR
VMware, Inc.
49
(Optional)IfyouspecifiedtheVMW_PSP_FIXEDpolicy,youmustmakesurethepreferredpathisset
correctly.
a
Firstcheckwhichpathisthepreferredpathforadevice.
esxcli <conn_options> storage nmp psp fixed deviceconfig get -d naa.xxxx
Ifnecessary,changethepreferredpath.
esxcli <conn_options> storage nmp psp fixed deviceconfig set --device naa.xxx --path
vmhba3:C0:T5:L3
Thecommandsetsthepreferredpathtovmhba3:C0:T5:L3
RetrievepathselectionsettingsforadevicethatisusingtheroundrobinPSP.
esxcli <conn_options> storage nmp psp roundrobin deviceconfig get --device na.xxx
Setthepathselection.Youcanspecifywhenthepathshouldchange,andwhetherunoptimizedpaths
shouldbeincluded.
Use--bytesor--iopstospecifywhenthepathshouldchange,asinthefollowingexamples:
esxcli <conn_options> storage nmp psp roundrobin deviceconfig set --type "bytes" -B 12345
--device naa.xxx
Setsthedevicespecifiedby--devicetoswitchtothenextpatheachtime12345byteshavebeensent
alongthecurrentpath.
esxcli <conn_options> storage nmp psp roundrobin deviceconfig set --type=iops --iops
4200 --device naa.xxx
Setsthedevicespecifiedby--devicetoswitchafter4200I/Ooperationshavebeenperformedona
path.
UseuseanotospecifythattheroundrobinPSPshouldincludepathsintheactive,unoptimizedstate
intheroundrobinset(1)orthatthePSPshoulduseactive,unoptimizedpathsonlyifnoactive
optimizedpathsareavailable(0).Ifyoudonotincludethisoption,thePSPincludesonlyactive
optimizedpathsintheroundrobinpathset.
50
VMware, Inc.
VMwarevMotion
VMwareDRSandVMwareHA
ISOimages,whicharepresentedasCDROMstovirtualmachines
Virtualmachinesnapshots
NASstoresvirtualmachinefilesonremotefileserversthatareaccessedoverastandardTCP/IPnetwork.The
NFSclientbuiltintotheESXisystemusesNFSversion3tocommunicatewithNAS/NFSservers.Fornetwork
connectivity,thehostrequiresastandardnetworkadapter.
InadditiontostoringvirtualdisksonNFSdatastores,youcanalsouseNFSasacentralrepositoryforISO
images,virtualmachinetemplates,andsoon.
TouseNFSasasharedrepository,youcreateadirectoryontheNFSserverandthenmountthedirectoryasa
datastoreonallhosts.IfyouusethedatastoreforISOimages,youcanconnectthevirtualmachinesCDROM
devicetoanISOfileonthedatastoreandinstallaguestoperatingsystemfromtheISOfile.
ListallknownNASfilesystems.
esxcli <conn_options> storage nfs list
ForeachNASfilesystem,thecommandliststhemountname,sharename,andhostnameandwhether
thefilesystemismounted.
IfnoNASfilesystemsareavailable,thesystemdoesnotreturnaNASfilesystemandreturnstothe
commandprompt.
2
AddanewNASfilesystemtotheESXihost.SpecifytheNASserverwith--host,thevolumetousefor
themountwith--volume-name,andthesharenameontheremotesystemtouseforthisNASmount
pointwith--share.
esxcli <conn_options> storage nfs add --host=dir42.eng.vmware.com --share=/<mount_dir>
--volume-name=nfsstore-dir42
ThiscommandaddsanentrytotheknownNASfilesystemlistandsuppliesthesharenameofthenew
NASfilesystem.Youmustsupplythehostname,sharename,andvolumenameforthenewNASfile
system.
3
AddasecondNASfilesystemwithreadonlyaccess.
esxcli <conn_options> storage nfs add --host=dir42.eng.vmware.com --share=/home
--volume-name=FileServerHome2 --readonly
DeleteoneoftheNASfilesystems.
esxcli <conn_options> storage nfs remove --volume-name=FileServerHome2
ThiscommandunmountstheNASfilesystemandremovesitfromthelistofknownfilesystems.
VMware, Inc.
51
ListallknownNASfilesystems.
vicfg-nas <conn_options> -l
ForeachNASfilesystem,thecommandliststhemountname,sharename,andhostnameandwhether
thefilesystemismounted.IfnoNASfilesystemsareavailable,thesystemreturnsthefollowingmessage:
No NAS datastore found
AddanewNASfilesystemtotheESXihost.
vicfg-nas <conn_options --add
nfsstore-dir42
ThiscommandaddsanentrytotheknownNASfilesystemlistandsuppliesthesharenameofthenew
NASfilesystem.YoumustsupplythehostnameandthesharenameforthenewNASfilesystem.
3
AddasecondNASfilesystemwithreadonlyaccess.
vicfg-nas <conn_options> -a -y --n esx42nas2 -s /home FileServerHome2
DeleteoneoftheNASfilesystems.
vicfg-nas <conn_options> -d FileServerHome1
ThiscommandunmountstheNASfilesystemandremovesitfromthelistofknownfilesystems.
RetrievealleventsforaFibreChannelI/Odevice.
esxcli storage san fc events get
ClearallI/ODeviceManagementeventsforthespecifiedadapter.
esxcli storage san fc events clear --adapter adapter
52
UpgradeESXiwithoutvirtualmachinedowntimeinsituationswherevirtualmachinedisksmustbe
movedtosharedstoragetoallowmigrationwithvMotion.
VMware, Inc.
Performstoragemaintenanceandreconfiguration.YoucanuseStoragevMotiontomovevirtual
machinesoffastoragedevicetoallowmaintenanceorreconfigurationofthestoragedevicewithout
virtualmachinedowntime.
Redistributestorageload.YoucanuseStoragevMotiontomanuallyredistributevirtualmachinesor
virtualdiskstodifferentstoragevolumestobalancecapacityorimproveperformance.
ForESXi5.0hosts,youcanmigratevirtualmachinesthathavesnapshots.ForearlierversionsofESXi,you
cannotmigratevirtualmachinesthathavesnapshots.
Virtualmachinedisksmustbeinpersistentmodeorberawdevicemappings(RDMs).Forphysicaland
virtualcompatibilitymodeRDMs,youcanmigratethemappingfileonly.Forvirtualcompatibilitymode
RDMs,youcanusethevSphereWebClienttoconverttothickprovisionedorthinprovisioneddisks
duringmigrationaslongasthedestinationisnotanNFSdatastore.Youcannotusethesvmotion
commandtoperformthisconversion.
ThehostonwhichthevirtualmachineisrunningmusthavealicensethatincludesStoragevMotion.
ESX/ESXi3.5hostsmustbelicensedandconfiguredforvMotion.ESX/ESXi4.0andlaterhostsdonot
requirevMotionconfigurationtoperformmigrationwithStoragevMotion.
Thehostthevirtualmachineisrunningonmusthaveaccesstoboththesourceandtargetdatastores.
AparticularhostcanbeinvolvedinuptofourmigrationswithvMotionorStoragevMotionatonetime.
SeeLimitsonSimultaneousMigrationsinthevCenterServerandHostManagementdocumentationfor
details.
IfyouusethevSphereWebClientformigrationwithsvmotion,thesystemperformsseveralcompatibility
checks.ThesechecksarenotsupportedbythesvmotionvCLIcommand.
Whenyouuse--interactive,allotheroptionsareignored.
IMPORTANTWhenrespondingtotheprompts,usequotesaroundinputstringswithspecialcharacters.
Squarebracketsindicateoptionalelements,notdatastores.
The--vmoptionspecifiesthevirtualmachineanditsdestination.Bydefault,allvirtualdisksarerelocatedto
thesamedatastoreasthevirtualmachine.Thisoptionrequiresthecurrentvirtualmachineconfigurationfile
location.SeeTodeterminethepathtothevirtualmachineconfigurationfileanddiskfileonpage 54.
VMware, Inc.
53
The--disksoptionrelocatesindividualvirtualdiskstodifferentdatastores.The--disksoptionrequiresthe
currentvirtualdiskdatastorepathasanoption.SeeTodeterminethepathtothevirtualmachine
configurationfileanddiskfileonpage 54.
To determine the path to the virtual machine configuration file and disk file
1
Runvmware-cmd -ltolistallvirtualmachineconfigurationfiles(VMXfiles).
vmware-cmd -H <vc_server> -U <login_user> -P <login_password> -h <esx_host> -l
ChoosetheVMXfileforthevirtualmachineofinterest.
Bydefault,thevirtualdiskfilehasthesamenameastheVMXfilebuthasa.vmdkextension.
(Optional)UsevifstoverifythatyouareusingthecorrectVMDKfile.
Determinethepathtothevirtualmachineconfigurationfile.
Runsvmotion:
svmotion
--url=https://myvc.mycorp.com/sdk --datacenter=DC1
--vm=[storage1] myvm/myvm.vmx:new_datastore
TheexampleisforWindows.UsesinglequotesonLinux.
To relocate a virtual machines configuration file, but leave virtual disks
1
Determinethepathtothevirtualdiskfilesandthevirtualmachineconfigurationfile.
Runsvmotion,forexample:
svmotion
<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'
Thiscommandrelocatesthevirtualmachinesconfigurationfiletonew_datastore,butleavesthetwodisks
(myvm_1.vmdkandmyvm_2.vmdk)inold_datastore.TheexampleisforLinux.Usedoublequoteson
Windows.Thesquarebracketssurroundthedatastorenameanddonotindicateanoptionalelement.
54
HardwareFCoEAdapters.HardwareFCoEadaptersincludecompletelyoffloadedspecialized
ConvergedNetworkAdapters(CNAs)thatcontainnetworkandFibreChannelfunctionalitiesonthe
samecard.Whensuchanadapterisinstalled,yourhostdetectsandcanusebothCNAcomponents.In
thevSphereWebClient,thenetworkingcomponentappearsasastandardnetworkadapter(vmnic)and
theFibreChannelcomponentasaFCoEadapter(vmhba).YoudonothavetoconfigureahardwareFCoE
adaptertobeabletouseit.
SoftwareFCoEAdapters.AsoftwareFCoEadapterisasoftwarecodethatperformssomeoftheFCoE
processing.TheadaptercanbeusedwithanumberofNICsthatsupportpartialFCoEoffload.Unlikethe
hardwareFCoEadapter,thesoftwareadaptermustbeactivated.
VMware, Inc.
-a|--allor-A|--adapter=<string>Scanalladaptersoraspecifiedadapter.
-S|--skip-claimSkipclaimingofnewdevicesbytheappropriatemultipathplugin.
-F|--skip-fs-scanSkipfilesystemscan
-t|--typeSpecifythetypeofscantoperform.Thecommandeitherscansforallchanges(all)or
foradded,deleted,orupdatedadapters(add,delete,update)
vicfg-rescansupportsonlyasimplerescanoperationonaspecifiedadapter.
Thecommandreturnsanindicationofsuccessorfailure,butnodetailedinformation.
To rescan a storage adapter with ESXCLI
Thefollowingcommandscansaspecificadapterandskipsthefilesystemscanthatisperformedbydefault.
esxcli <conn_options> storage core adapter rescan --adapter=vmhba33 --skip-claim
Thecommandreturnsanindicationofsuccessorfailure,butnodetailedinformation.
WhatthecommandreturnsdependsonthelevelofSMARTinformationthatthedevicesupports.Ifno
informationisavailableforaparameter,theoutputdisplaysN/A,asinthefollowingsampleoutput.
Parameter
Value Threshold Worst
----------------------------------------------------Health Status
OK
N/A
N/A
Media Wearout Indicator
N/A
N/A
N/A
Write Error Count
N/A
N/A
N/A
Read Error Count
119
6
74
Power-on Hours
57
0
57
Power Cycle Count
100
20
100
Reallocated Sector Count
100
36
100
Raw Read Error Rate
119
6
74
Drive Temperature
38
0
49
Driver Rated Max Temperature 62
45
51
Write Sectors TOT Count
200
0
200
Read Sectors TOT Count
100
0
253
Initial Bad Block Count
N/A
N/A
N/A
VMware, Inc.
55
56
VMware, Inc.
53
ESXisystemsincludeiSCSItechnologytoaccessremotestorageusinganIPnetwork.YoucanusethevSphere
WebClient,commandsintheesxcliiscsinamespace,orthevicfg-iscsicommandtoconfigureboth
hardwareandsoftwareiSCSIstorageforyourESXisystem.
Thischapterincludesthefollowingtopics:
iSCSIStorageOverviewonpage 57
ProtectinganiSCSISANonpage 59
CommandSyntaxforesxcliiscsiandvicfgiscsionpage 61
iSCSIStorageSetupwithESXCLIonpage 66
iSCSIStorageSetupwithvicfgiscsionpage 71
ListingandSettingiSCSIOptionsonpage 75
ListingandSettingiSCSIParametersonpage 76
EnablingiSCSIAuthenticationonpage 80
SettingUpPortsforiSCSIMultipathingonpage 81
ManagingiSCSISessionsonpage 82
SeethevSphereStoragedocumentationforadditionalinformation.
SoftwareiSCSIadapter.VMwarecodebuiltintotheVMkernel.AllowsanESXihosttoconnecttothe
iSCSIstoragedevicethroughstandardnetworkadapters.ThesoftwareinitiatorhandlesiSCSIprocessing
whilecommunicatingwiththenetworkadapter.
HardwareiSCSIadapter.OffloadsalliSCSIandnetworkprocessingfromyourhost.HardwareiSCSI
adaptersarebrokenintotwotypes.
DependenthardwareiSCSIadapter.LeveragestheVMwareiSCSImanagementandconfiguration
interfaces.
IndependenthardwareiSCSIadapter.LeveragesitsowniSCSImanagementandconfiguration
interfaces.
SeethevSphereStoragedocumentationfordetailsonsetupandfailoverscenarios.
VMware, Inc.
57
YoumustconfigureiSCSIinitiatorsforthehosttoaccessanddisplayiSCSIstoragedevices.
Figure 51depictshoststhatusedifferenttypesofiSCSIinitiators.
ThehostontheleftusesanindependenthardwareiSCSIadaptertoconnecttotheiSCSIstoragesystem.
ThehostontherightusessoftwareiSCSI.
DependenthardwareiSCSIcanbeimplementedindifferentwaysandisnotshown.iSCSIstoragedevices
fromthestoragesystembecomeavailabletothehost.YoucanaccessthestoragedevicesandcreateVMFS
datastoresforyourstorageneeds.
Figure 5-1. iSCSI Storage
hardware
iSCSI
software
iSCSI
host 1
host 2
software
adapter
HBA2
HBA1
NIC2
NIC1
IP network
SP
iSCSI storage
Discovery Sessions
AdiscoverysessionispartoftheiSCSIprotocol.Thediscoverysessionreturnsthesetoftargetsthatyoucan
accessonaniSCSIstoragesystem.ESXisystemssupportdynamicandstaticdiscovery.
Dynamicdiscovery.AlsoknownasSendTargetsdiscovery.EachtimetheESXihostcontactsaspecified
iSCSIstorageserver,itsendsaSendTargetsrequesttotheserver.Inresponse,theiSCSIstorageserver
suppliesalistofavailabletargetstotheESXihost.Monitorandmanagewithesxcli iscsi adapter
discovery sendtargetorvicfg-iscsicommands.
Staticdiscovery.TheESXihostdoesnothavetoperformdiscovery.Instead,theESXihostusestheIP
addressesordomainnamesandiSCSItargetnames(IQNorEUIformatnames)tocommunicatewiththe
iSCSItarget.Monitorandmanagewithesxcli iscsi adapter discovery statictargetor
vicfg-iscsicommands.
Foreithercase,yousetuptargetdiscoveryaddressessothattheinitiatorcandeterminewhichstorage
resourceonthenetworkisavailableforaccess.Youcandothissetupwithdynamicdiscoveryorstatic
discovery.Withdynamicdiscovery,alltargetsassociatedwithanIPaddressorhostnameandtheiSCSIname
arediscovered.Withstaticdiscovery,youmustspecifytheIPaddressorhostnameandtheiSCSInameofthe
targetyouwanttoaccess.TheiSCSIHBAmustbeinthesameVLANasbothportsoftheiSCSIarray.
58
VMware, Inc.
TheIQNnameusesthefollowingformat:
iqn.yyyy-mm.{reversed domain name}:id_string
Forexample:iqn.2007-05.com.mydomain:storage.tape.sys3.abc
TheESXihostgeneratesanIQNnameforsoftwareiSCSIanddependenthardwareiSCSIadapters.You
canchangethatdefaultIQNname.
TheEUInameisdescribedinIETFrfc3720asfollows:
TheIEEERegistrationAuthorityprovidesaserviceforassigninggloballyuniqueidentifiers[EUI].The
EUI64formatisusedtobuildaglobalidentifierinothernetworkprotocols.Forexample,FibreChannel
definesamethodofencodingitintoaWorldWideName.
Theformatiseui.followedbyanEUI64identifier(16ASCIIencodedhexadecimaldigits).
Forexample:
Type EUI-64 identifier (ASCII-encoded hexadecimal)
+--++--------------+
| ||
|
eui.02004567A425678D
TheIEEEEUI64iSCSInameformatcanbeusedwhenamanufacturerisregisteredwiththeIEEE
RegistrationAuthorityandusesEUI64formattedworldwideuniquenamesforitsproducts.
CheckintheUIofthestoragearraywhetheranarrayusesanIQNnameoranEUIname.
IfyouuseanindependenthardwareiSCSIadapter,makesurethattheiSCSIadapterandESXiphysical
networkadapterarenotinadvertentlyconnectedoutsidethehost.Suchaconnectionmightresultfrom
sharingaswitch.
Ifyouusedependenthardwareorsoftwareiscsiadapter,whichusesESXinetworking,configureiSCSI
storagethroughadifferentvirtualswitchthantheoneusedbyyourvirtualmachines.
YoucanalsoconfigureyouriSCSISANonitsownVLANtoimproveperformanceandsecurity.Placingyour
iSCSIconfigurationonaseparateVLANensuresthatnodevicesotherthantheiSCSIadaptercansee
transmissionswithintheiSCSISAN.WithadedicatedVLAN,networkcongestionfromothersourcescannot
interferewithiSCSItraffic.
VMware, Inc.
59
Description
Supported
chapProhibited
HostdoesnotuseCHAPauthentication.Ifauthenticationis
enabled,specifychapProhibitedtodisableit.
SoftwareiSCSI
DependenthardwareiSCSI
IndependenthardwareiSCSI
chapDiscouraged
chapPreferred
HostusesanonCHAPconnection,butallowsaCHAP
connectionasfallback.
SoftwareiSCSI
HostusesCHAPiftheCHAPconnectionsucceeds,butuses
nonCHAPconnectionsasfallback.
SoftwareiSCSI
DependenthardwareiSCSI
DependenthardwareiSCSI
IndependenthardwareiSCSI
chapRequired
60
HostrequiressuccessfulCHAPauthentication.Theconnection
failsifCHAPnegotiationfails.
SoftwareiSCSI
DependenthardwareiSCSI
VMware, Inc.
IfyouusethevSphereWebClienttomodifyauthenticationsettings,youmustdeselecttheInheritfrom
Parentcheckboxbeforeyoucanmakeachangetothediscoveryaddressordiscoverytarget.
Ifyouusevicfg-iscsi,thevalueyousetoverridestheinheritedvalue.
Ifyouuseesxcli iscsicommands,thevalueyousetoverridestheinheritedvalue.YoucansetCHAP
attheselevels:
Inheritanceisrelevantonlyifyouwanttoreturnadynamicdiscoveryaddressorastaticdiscoverytargetto
itsinheritedvalue.Inthatcase,useoneofthefollowingcommands:
NOTEYoucansettargetlevelCHAPauthenticationpropertiestobeinheritedfromthesendtargetleveland
setsendtargetlevelCHAPauthenticationpropertiestobeinheritedfromtheadapterlevel.Resetting
adapterlevelpropertiesisnotsupported.
auth
chap[set|get]
discovery
[rediscover]
sendtarget
[add|list|remove]
auth
chap[get|set]
param[get|set]
statictarget
[add|list|remove]
statusget
target[list]
portal[list]
auth
chap[get|set]
param[get|set]
capabilitiesget
firmware[get|set]
param[get|set]
VMware, Inc.
61
ipconfig[get|set]
physicalnetworkportal
[list]
param[get|set]
session[add|list|remove]
connectionlist
ibftboot[get|import]
logicalnetworkportallist
pluginlist
software[get|set]
62
Lower-case Option
Option
Upper-case Option
Option
Number
Option
--address, alias
--adapter
--dns1
--cid
--dns2
--direction
--file, force
--gateway
--ip
--key
--level
--default
--inherit
--method
--module
--nic
--authname,
--name
--option
--plugin
--isid, subnet,
switch
--state, secret
--value
VMware, Inc.
Suboptions
Description
-A --authentication
-c <level>
-m <auth_method> -b
-v <ma_username>
-x <ma_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]]
<adapter_name>
Enablesmutualauthentication.
Youmustenableauthentication
beforeyoucanenablemutual
authentication.
--level <level>
--method <auth_method> --mutual
--mchap_username <ma_username>
--mchap_password <ma_password>
[--ip <stor_ip_addr|stor_hostname> [:<portnum>]
[--name <iscsi_name>]] <adapter_name>
-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>
Enablesauthenticationusingthe
specifiedoptions.
--level <level>
--method <auth_method>
--chap_password <auth_u_name>
--chap_username <chap_password>
[--ip <stor_ip_addr|stor_hostname> [:<portnum>]
[--name <iscsi_name>]] <adapter_name>
-A --authentication
-l <adapter_name>
--list <adapter_name>
Listssupportedauthentication
methods.
-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.
-l [<adapter_name>]
--list [<adapter_name>]
ListsalliSCSIadaptersora
specifiedadapter.
-l <adapter_name>
--list <adapter_name>
ListsLUNinformation.
-H
-L --lun
VMware, Inc.
63
Suboptions
Description
-l -t <target_ID> <adapter_name>
--list --target_id <target_id> <adapter_name>
ListsLUNinformationfora
specifictarget.
-L --lun
Listsnetworkproperties.
SetstheHBAIPv4addressto
ip_addr.
SetstheHBAnetworkmaskto
subnet_mask.
SetstheHBAgatewayto
default_gateway.
SetstheIPaddress,subnetmask,
anddefaultgatewayinone
command.
Listsphysicalnetworkportal
options.
Setsphysicalnetworkportal
options.
-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.
-p -M <mtu_size> <adapter_name>
--pnp --mtu <mtu-size> <adapter_name>
SetsMTUsize.Usedwiththe
--pnpoption.
-M --mtu
-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>
64
Removesastaticdiscovery
address.
VMware, Inc.
Suboptions
Description
-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.
-l <adapter_name>
--list <adapter_name>
Listsexternal,vendorspecific
propertiesofaniSCSIadapter.
-P --phba
-T --target
-l <adapter_name>
--list <adapter_name>
Liststargetinformation.
-W parameter
-l [-i <stor_ip_addr|stor_hostname> [:<portnum>]
[-n <iscsi_name]] <adapter_name>
ListsiSCSIparameter
information.
ListsiSCSIparameterdetails.
--list --detail
[--ip <stor_ip_addr|stor_hostname> [:<portnum>]
[--name <iscsi_name]] <adapter_name>
-W parameter
-W -j <name>=<value>
-i <stor_ip_addr|stor_hostname> [:port_num>] [-n <iscsi_name>]]
<adapter_name>
SetsiSCSIparameters.
Returnsparametersindiscovery
targetorsendtargettodefault
inheritancebehavior.
Resetstargetlevelauthentication
propertiestobeinheritedfrom
adapterlevel.Usedwiththe
--authenticationoption.
--authentication --reset_auth
--method <auth_method>
[--ip <stor_ip_addr|stor_hostname> [:<portnum>]
[--name <iscsi_name>]] <adapter_name>
VMware, Inc.
65
EnablesoftwareiSCSI.
esxcli <conn_options> iscsi software set --enabled=true
Checkwhetheranetworkportal,thatis,aboundport,existsforiSCSItraffic.
esxcli <conn_options> iscsi adapter list
Ifnoadapterexists,addone.SoftwareiSCSIdoesnotrequireportbinding,butrequiresthatatleastone
VMkernelNICisavailableandcanbeusedasaniSCSINIC.Youcannametheadapterasyouaddit.
esxcli <conn_options> iscsi networkportal add -n <portal_name> -A <vmhba>
(Optional)Checkthestatus.
esxcli <conn_options> iscsi software get
ThesystemprintstrueifsoftwareiSCSIisenabled,orfalseifitisnotenabled.
5
(Optional)SettheiSCSInameandalias.
esxcli <conn_options> iscsi adapter set --adapter=<iscsi adapter> --name=<name>
esxcli <conn_options> iscsi adapter set --adapter=<iscsi adapter> --alias=<alias>
Addadynamicdiscoveryaddressorastaticdiscoveryaddress.
Thetwotypesoftargetdifferasfollows:
Withdynamicdiscovery,allstoragetargetsassociatedwithahostnameorIPaddressarediscovered.
Yourunthefollowingcommand.
esxcli <conn_options> iscsi adapter discovery sendtarget add --address=<ip/dns[:port]>
--adapter=<adapter_name>
Withstaticdiscovery,youmustspecifythehostnameorIPaddressandtheiSCSInameofthestorage
target.Yourunthefollowingcommand.
esxcli <conn_options> iscsi adapter discovery statictarget add --address=<ip/dns[:port]>
--adapter=<adapter_name> --name=<target_name>
Whenyoulaterremoveadiscoveryaddress,itmightstillbedisplayedastheparentofastatictarget.You
canaddthediscoveryaddressandrescantodisplaythecorrectparentforthestatictargets.
7
66
(Optional)SettheauthenticationinformationforCHAP(seeSettingiSCSICHAPonpage 60and
EnablingiSCSIAuthenticationonpage 80).YoucansetpertargetCHAPforstatictargets,peradapter
CHAP,orapplythecommandtothediscoveryaddress.
VMware, Inc.
Adapterlevel
CHAP
Discoverylevel
CHAP
Targetlevel
CHAP
Discoverylevel
CHAP
Targetlevel
CHAP
IMPORTANTYouareresponsibleformakingsurethatCHAPissetbeforeyousetmutualCHAP,andfor
usingcompatiblelevelsforCHAPandmutualCHAP.
9
(Optional)SetiSCSIparameters.
Adapterlevel
parameters
Discoverylevel
parameters
Targetlevel
parameters
SeeListingandSettingiSCSIParametersonpage 76
10
Aftersetupiscomplete,performrediscoveryandrescanallstoragedevices.Forexample:
esxcli <conn_options> iscsi adapter discovery rediscover
esxcli <conn_options> storage core adapter rescan --adapter=vmhba36
VMware, Inc.
67
11
(Optional)IfyouwanttomakeadditionaliSCSIloginparameterchanges(seeListingandSettingiSCSI
Parametersonpage 76),youmustlogoutofthecorrespondingiSCSIsessionandlogbackin.
a
DeterminetheiSCSIadaptertypeandretrievetheiSCSIadapterID.
esxcli <conn_options> iscsi adapter list
(Optional)SettheiSCSInameandalias.
esxcli <conn_options> iscsi adapter set --adapter <adapter_name> --name=<name>
esxcli <conn_options> iscsi adapter set --adapter <adapter_name> --alias=<alias>
Setupportbindingbyfollowingthesesteps:
a
IdentifytheVMkernelportofthedependenthardwareiSCSIadapter.
esxcli <conn_options> iscsi logicalnetworkportal list --adapter=<adapter_name>
ConnectthedependenthardwareiSCSIinitiatortotheiSCSIVMkernelportsbyrunningthe
followingcommandforeachport.
esxcli <conn_options> iscsi networkportal add --nic=<bound_vmknic>
--adapter=<iscsi_adapter>
VerifythattheportswereaddedtothedependenthardwareiSCSIinitiator.
esxcli <conn_options> iscsi physicalnetworkportal list --adapter=<adapter_name>
Addadynamicdiscoveryaddressorastaticdiscoveryaddress.
Thetwotypesoftargetdifferasfollows:
Withdynamicdiscovery,allstoragetargetsassociatedwithahostnameorIPaddressarediscovered.
Yourunthefollowingcommand.
esxcli <conn_options> iscsi adapter discovery sendtarget add --address=<ip/dns[:port]>
--adapter=<adapter_name>
Withstaticdiscovery,youmustspecifythehostnameorIPaddressandtheiSCSInameofthestorage
target.Yourunthefollowingcommand.
esxcli <conn_options> iscsi adapter discovery statictarget add --address=<ip/dns[:port]>
--adapter=<adapter_name> --name=<target_name>
Whenyoulaterremoveadiscoveryaddress,itmightstillbedisplayedastheparentofastatictarget.You
canaddthediscoveryaddressandrescantodisplaythecorrectparentforthestatictargets.
5
68
(Optional)SettheauthenticationinformationforCHAP(seeSettingiSCSICHAPonpage 60and
EnablingiSCSIAuthenticationonpage 80).YoucansetpertargetCHAPforstatictargets,peradapter
CHAP,orapplythecommandtothediscoveryaddress.
VMware, Inc.
Adapterlevel
CHAP
Discoverylevel
CHAP
Targetlevel
CHAP
Discoverylevel
CHAP
Targetlevel
CHAP
IMPORTANTYouareresponsibleformakingsurethatCHAPissetbeforeyousetmutualCHAP,andfor
usingcompatiblelevelsforCHAPandmutualCHAP.
7
(Optional)SetiSCSIparameters.
Adapterlevel
parameters
Discoverylevel
parameters
Targetlevel
parameters
SeeListingandSettingiSCSIParametersonpage 76
8
Aftersetupiscomplete,performrediscoveryandrescanallstoragedevices.Forexample:
esxcli <conn_options> iscsi adapter discovery rediscover
esxcli <conn_options> storage core adapter rescan --adapter=vmhba36
VMware, Inc.
69
(Optional)IfyouwanttomakeadditionaliSCSIloginparameterchanges(seeListingandSettingiSCSI
Parametersonpage 76),youmustlogoutofthecorrespondingiSCSIsessionandlogbackin.
a
DeterminetheiSCSIadaptertypeandretrievetheiSCSIadapterID.
esxcli <conn_options> iscsi adapter list
iSCSIadaptername.(required).
-1|--dns1=<str>
iSCSInetworkportalprimaryDNSaddress.
-2|--dns2=<str>
iSCSInetworkportalsecondaryDNSaddress.
-g|--gateway=<str>
iSCSInetworkportalgatewayaddress.
-i|--ip=<str>
iSCSInetworkportalIPaddress(required).
-n|--nic=<str>
iSCSInetworkportal(vmknic).
-s|--subnet=<str>
iSCSInetworkportalsubnetmask(required).
(Optional)SettheiSCSInameandalias.
esxcli <conn_options> iscsi adapter set --adapter <adapter_name> --name=<name>
esxcli <conn_options> iscsi adapter set --adapter <adapter_name> --alias=<alias>
Addadynamicdiscoveryaddressorastaticdiscoveryaddress.
Thetwotypesoftargetdifferasfollows:
Withdynamicdiscovery,allstoragetargetsassociatedwithahostnameorIPaddressarediscovered.
Yourunthefollowingcommand.
esxcli <conn_options> iscsi adapter discovery sendtarget add --address=<ip/dns[:port]>
--adapter=<adapter_name>
Withstaticdiscovery,youmustspecifythehostnameorIPaddressandtheiSCSInameofthestorage
target.Yourunthefollowingcommand.
esxcli <conn_options> iscsi adapter discovery statictarget add --address=<ip/dns[:port]>
70
(Optional)SettheauthenticationinformationforCHAP(seeSettingiSCSICHAPonpage 60and
EnablingiSCSIAuthenticationonpage 80).YoucansetpertargetCHAPforstatictargets,peradapter
CHAP,orapplythecommandtothediscoveryaddress.
VMware, Inc.
Adapterlevel
CHAP
Discoverylevel
CHAP
Targetlevel
CHAP
MutualCHAPisnotsupportedforindependenthardwareiSCSIstorage.
6
(Optional)SetiSCSIparameters.
Adapterlevel
parameters
Discoverylevel
parameters
Targetlevel
parameters
SeeListingandSettingiSCSIParametersonpage 76
7
Aftersetupiscomplete,performrediscoveryandrescanallstoragedevices.Forexample:
esxcli <conn_options> iscsi adapter discovery rediscover
esxcli <conn_options> storage core adapter rescan --adapter=vmhba36
DeterminetheHBAtypeandretrievetheHBAID.
vicfg-iscsi <conn_options> --adapter --list
EnablesoftwareiSCSIfortheHBA.
vicfg-iscsi <conn_options> --swiscsi --enable
VMware, Inc.
71
(Optional)Checkthestatus.
vicfg-iscsi <conn_options> --swiscsi --list
(Optional)SettheiSCSInameandalias.
vicfg-iscsi
vicfg-iscsi
vicfg-iscsi
vicfg-iscsi
<conn_options>
<conn_options>
<conn_options>
<conn_options>
-I -n <iscsi_name> <adapter_name>
--iscsiname --name <iscsi_name> <adapter_name>
-I -a <alias_name> <adapter_name>
--iscsiname --alias <alias_name> <adapter_name>
Addadynamicdiscoveryaddressorastaticdiscoveryaddress.
Thetwotypesoftargetdifferasfollows:
Withdynamicdiscovery,allstoragetargetsassociatedwithahostnameorIPaddressarediscovered.
Yourunthefollowingcommand:
vicfg-iscsi <conn_options> --discovery --add --ip <ip_addr | domain_name> <adapter_name>
Withstaticdiscovery,youmustspecifythehostnameorIPaddressandtheiSCSInameofthestorage
target.Yourunthefollowingcommand:
vicfg-iscsi <conn_options> --static --add --ip <ip_addr | domain_name>
--name <iscsi_name> <adapter_name>
Whenyoulaterremoveadiscoveryaddress,itmightstillbedisplayedastheparentofastatictarget.You
canaddthediscoveryaddressandrescantodisplaythecorrectparentforthestatictargets.
6
(Optional)SettheauthenticationinformationforCHAP(seeSettingiSCSICHAPonpage 60and
EnablingiSCSIAuthenticationonpage 80).
vicfg-iscsi <conn_options> -A -c <level> -m <auth_method> -u <auth_u_name> -w <chap_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name]] <adapter_name>
vicfg-iscsi <conn_options> --authentication --level <level> --method <auth_method>
--chap_username <auth_u_name> --chap_password <chap_password>
[--ip <stor_ip_addr|stor_hostname> [:<portnum>] [-name <iscsi_name]]
<adapter_name>
Thetarget(-i)andname(-n)optiondeterminewhatthecommandappliesto.
Option
Result
-iandn
CommandappliestopertargetCHAPforstatictargets.
Onlyi
Commandappliestothediscoveryaddress.
Neither-inorn
CommandappliestoperadapterCHAP.
(Optional)SettheauthenticationinformationformutualCHAPbyrunningvicfg-iscsi -Aagainwith
the-boptionandadifferentauthenticationusernameandpassword.
For<level>,specifychapProhibitedorchapRequired.
chapProhibitedThehostdoesnotuseCHAPauthentication.Ifauthenticationisenabled,specify
chapProhibitedtodisableit.
chapRequiredThehostrequiressuccessfulCHAPauthentication.TheconnectionfailsifCHAP
negotiationfails.YoucansetthisvalueformutualCHAPonlyifCHAPissettochapRequired.
For<auth_method>,CHAPistheonlyvalidvalue.
IMPORTANTYouareresponsibleformakingsurethatCHAPissetbeforeyousetmutualCHAP,andfor
usingcompatiblelevelsforCHAPandmutualCHAP.
72
(Optional)SetiSCSIparametersbyrunningvicfg-iscsi -W.
Aftersetupiscomplete,runvicfg-rescantorescanallstoragedevices.
VMware, Inc.
DeterminetheHBAtypeandretrievetheHBAID.
vicf-iscsi <conn_options> --adapter --list
(Optional)SettheiSCSInameandalias.
vicfg-iscsi
vicfg-iscsi
vicfg-iscsi
vicfg-iscsi
<conn_options>
<conn_options>
<conn_options>
<conn_options>
-I -n <iscsi_name> <adapter_name>
--iscsiname --name <iscsi_name> <adapter_name>
-I -a <alias_name> <adapter_name>
--iscsiname --alias <alias_name> <adapter_name>
Setupportbindingbyfollowingthesesteps:
a
IdentifytheVMkernelportofthedependenthardwareiSCSIadapter.
esxcli <conn_options> swiscsi vmknic list -d <vmhba>
ConnectthedependenthardwareiSCSIinitiatortotheiSCSIVMkernelportsbyrunningthe
followingcommandforeachport.
esxcli <conn_options> swiscsi nic add -n <port_name> -d <vmhba>
VerifythattheportswereaddedtothedependenthardwareiSCSIinitiator.
esxcli <conn_options> swiscsi nic list -d <vmhba>
RescanthedependenthardwareSCSIinitiator.
vicfg-rescan <conn_options> <vmhba>
Addadynamicdiscoveryaddressorastaticdiscoveryaddress.
Thetwotypesoftargetdifferasfollows:
Withdynamicdiscovery,allstoragetargetsassociatedwithahostnameorIPaddressarediscovered.
Yourunthefollowingcommand:
vicfg-iscsi <conn_options> --discovery --add --ip <ip_addr | domain_name> <adapter_name>
Withstaticdiscovery,youmustspecifythehostnameorIPaddressandtheiSCSInameofthestorage
target.Yourunthefollowingcommand:
vicfg-iscsi <conn_options> --static --add --ip <ip_addr | domain_name>
--name <iscsi_name> <adapter_name>
Whenyoulaterremoveadiscoveryaddress,itmightstillbedisplayedastheparentofastatictarget.You
canaddthediscoveryaddressandrescantodisplaythecorrectparentforthestatictargets.
5
(Optional)SettheauthenticationinformationforCHAP(seeSettingiSCSICHAPonpage 60and
EnablingiSCSIAuthenticationonpage 80).
vicfg-iscsi <conn_options> -A -c <level> -m <auth_method> -u <auth_u_name> -w <chap_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name]] <adapter_name>
vicfg-iscsi <conn_options> --authentication --level <level> --method <auth_method>
--chap_username <auth_u_name> --chap_password <chap_password>
[--ip <stor_ip_addr|stor_hostname> [:<portnum>] [-name <iscsi_name]]
<adapter_name>
Thetarget(-i)andname(-n)optiondeterminewhatthecommandappliesto.
VMware, Inc.
Option
Result
-iandn
CommandappliestopertargetCHAPforstatictargets.
Onlyi
Commandappliestothediscoveryaddress.
Neither-inorn
CommandappliestoperadapterCHAP.
73
(Optional)SettheauthenticationinformationformutualCHAPbyrunningvicfg-iscsi -Aagainwith
the-boptionandadifferentauthenticationusernameandpassword.
For<level>,specifychapProhibitedorchapRequired.
chapProhibitedThehostdoesnotuseCHAPauthentication.Ifauthenticationisenabled,specify
chapProhibitedtodisableit.
chapRequiredThehostrequiressuccessfulCHAPauthentication.TheconnectionfailsifCHAP
negotiationfails.YoucansetthisvalueformutualCHAPonlyifCHAPissettochapRequired.
For<auth_method>,CHAPistheonlyvalidvalue.
IMPORTANTYouareresponsibleformakingsurethatCHAPissetbeforeyousetmutualCHAP,andfor
usingcompatiblelevelsforCHAPandmutualCHAP.
7
(Optional)SetiSCSIparametersbyrunningvicfg-iscsi -W.
Aftersetupiscomplete,runvicfg-rescantorescanallstoragedevices.
DeterminetheHBAtypeandretrievetheHBAID.
vicf-iscsi <conn_options> --adapter --list
Configurethehardwareinitiator(HBA)byrunningvicfg-iscsi -Nwithoneormoreofthefollowing
options.
--listListnetworkproperties.
--ip <ip_addr>SetHBAIPv4address.
--subnetmask <subnet_mask>SetHBAnetworkmask.
--gateway <default_gateway>SetHBAgateway.
--set ARP=true|falseEnableordisableARPredirect.
YoucanalsosettheHBAIPv4addressandnetworkmaskandgatewayinonecommand.
vicfg-iscsi <conn_options> --ip <ip_addr> --subnetmask <subnet_mask> --gateway
<default_gateway>
(Optional)SettheiSCSInameandalias.
vicfg-iscsi
vicfg-iscsi
vicfg-iscsi
vicfg-iscsi
<conn_options>
<conn_options>
<conn_options>
<conn_options>
-I -n <iscsi_name> <adapter_name>
--iscsiname --name <iscsi_name> <adapter_name>
-I -a <alias_name> <adapter_name>
--iscsiname --alias <alias_name> <adapter_name>
Addadynamicdiscoveryaddressorastaticdiscoveryaddress.
Thetwotypesoftargetdifferasfollows:
Withdynamicdiscovery,allstoragetargetsassociatedwithanIPaddressarediscovered.Runthe
followingcommand:
vicfg-iscsi <conn_options> --discovery --add --ip <ip_addr> <adapter_name>
74
VMware, Inc.
Withstaticdiscovery,youmustspecifytheIPaddressandtheiSCSInameofthestoragetargettobe
added.Runthefollowingcommand:
vicfg-iscsi <conn_options> --static --add --ip <ip_addr>
--name <iscsi_name> <adapter_name>
Whenyoulaterremoveadiscoveryaddress,itmightstillbedisplayedastheparentofastatictarget.You
canlateraddthediscoveryaddressandrescantodisplaythecorrectparentforthestatictargets.
5
(Optional)SettheauthenticationinformationforCHAPbyrunningvicfg-iscsi -A.
Youcansettheinformationforperadapter,perdiscovery,andpertargetCHAP.SeeSettingiSCSI
CHAPonpage 60andEnablingiSCSIAuthenticationonpage 80.
vicfg-iscsi <conn_options> --authentication --level <level> --method <auth_method>
--chap_username <auth_u_name> --chap_password <chap_password>
[--ip <stor_ip_addr|stor_hostname> [:<portnum>] [-name <iscsi_name]]
<adapter_name>
Thetarget(-i)andname(-n)optiondeterminewhatthecommandappliesto.
Option
Result
-iandn
CommandappliestopertargetCHAPforstatictargets.
Onlyi
Commandappliestothediscoveryaddress.
Neither-inorn
CommandappliestoperadapterCHAP.
MutualCHAPisnotsupportedforindependenthardwareiSCSIstorage.
6
(Optional)SetadditionaliSCSIparametersbyrunningvicfg-iscsi -W.
Aftersetupiscomplete,callvicfg-rescantorescanallstoragedevices.
Thesystemreturnsinformationaboutthevendor,model,description,andserialnumberoftheHBA.
VMware, Inc.
75
Runvicfg-iscsi -P|--phbatolistexternal(vendorspecific)propertiesofaniSCSIadapter.
vicfg-iscsi <conn_options> -P -l <adapter_name>
vicfg-iscsi <conn_options> --phba --list <adapter_name>
Thesystemreturnsinformationaboutthevendor,model,description,andserialnumberoftheHBA.
Thesystemreturnsinformationabouttargetsforthespecifiedadapter,includingtheiSCSIname(IQNor
EUIformat)andalias.SeeDiscoveryTargetNamesonpage 59.
Runvicfg-iscsi -L|--luntolistLUNinformation.
vicfg-iscsi <conn_options> -L -l <adapter_name>
vicfg-iscsi <conn_options> --lun --list <adapter_name>
Thecommandreturnstheoperatingsystemdevicename,busnumber,targetID,LUNID,andLUNsize
fortheLUN.
Runvicfg-iscsi -Lwith-ttolistonlyLUNsonaspecifiedtarget.
vicfg-iscsi <conn_options> -L -l -t <target_ID> <adapter_name>
vicfg-iscsi <conn_options> --lun --list --target_id <target_id> <adapter_name>
ThesystemreturnstheLUNsonthespecifiedtargetandthecorrespondingdevicename,devicenumber,
LUNID,andLUNsize.
Runvicfg-iscsi -p|--pnptolistphysicalnetworkportalinformationforindependenthardwareiSCSI
devices.Youalsousethisoptionwith--mtu.
vicfg-iscsi <conn_options> -p -l <adapter_name>
vicfg-iscsi <conn_options> --pnp --list <adapter_name>
ThesystemreturnsinformationabouttheMACaddress,MTU,andcurrenttransferrate.
Runvicfg-iscsi -I -ltolistinformationabouttheiSCSIinitiator.ESXisystemsuseasoftwarebased
iSCSIinitiatorintheVMkerneltoconnecttostorage.ThecommandreturnstheiSCSIname,aliasname,
andaliassettablebitfortheinitiator.
vicfg-iscsi <conn_options> -I -l vmhba42
Runvicfg-iscsi -p -MtosettheMTUfortheadapter.Youspecifythesizeandadaptername.
vicfg-iscsi <conn_options> -p -M <mtu_size> <adapter_name>
vicfg-iscsi <conn_options> --pnp --mtu <mtu-size> <adapter_name>
76
VMware, Inc.
Targetlevel
parameters
Discoverylevel
parameters
Table 56listsallsettableparameters.TheseparametersarealsodescribedintheIETFrfc3720.Youcanrun
esxcli iscsi adapter param gettodeterminewhetheraparameterissettableornot.
TheparametersinTable 56applytosoftwareiSCSIanddependenthardwareiSCSI.
Table 5-5. Settable iSCSI Parameters
Parameter
Description
DataDigestType
Increasesdataintegrity.Whendatadigestisenabled,thesystemperformsachecksumover
eachPDUsdatapartandverifiesusingtheCRC32Calgorithm.
Note:SystemsthatuseIntelNehalemprocessorsoffloadtheiSCSIdigestcalculationsfor
softwareiSCSI,thusreducingtheimpactonperformance.
ValidvaluesaredigestProhibited,digestDiscouraged,digestPreferred,or
digestRequired.
HeaderDigest
Increasesdataintegrity.Whenheaderdigestisenabled,thesystemperformsachecksumover
theheaderpartofeachiSCSIProtocolDataUnit(PDU)andverifiesusingtheCRC32C
algorithm.
MaxOutstandingR2T
MaxOutstandingR2TdefinestheReadytoTransfer(R2T)PDUsthatcanbeintransitionbefore
anacknowledgementPDUisreceived.
FirstBurstLength
MaximumamountofunsoliciteddataaniSCSIinitiatorcansendtothetargetduringthe
executionofasingleSCSIcommand,inbytes.
MaxBurstLength
MaximumSCSIdatapayloadinaDataInorasolicitedDataOutiSCSIsequence,inbytes.
MaxRecvDataSegLen
Maximumdatasegmentlength,inbytes,thatcanbereceivedinaniSCSIPDU.
NoopOutInterval
Timeinterval,inseconds,betweenNOPOutrequestssentfromyouriSCSIinitiatortoaniSCSI
target.TheNOPOutrequestsserveasthepingmechanismtoverifythataconnectionbetween
theiSCSIinitiatorandtheiSCSItargetisactive.
Supportedonlyattheinitiatorlevel.
NoopOutTimeout
Amountoftime,inseconds,thatcanlapsebeforeyourhostreceivesaNOPInmessage.The
messageissentbytheiSCSItargetinresponsetotheNOPOutrequest.Whenthe
NoopTimeoutlimitisexceeded,theinitiatorterminatesthecurrentsessionandstartsanew
one.
Supportedonlyattheinitiatorlevel.
RecoveryTimeout
Amountoftime,inseconds,thatcanlapsewhileasessionrecoveryisperformed.Ifthetimeout
exceedsitslimit,theiSCSIinitiatorterminatesthesession.
DelayedAck
Allowssystemstodelayacknowledgmentofreceiveddatapackets.
YoucanusethefollowingESXCLIcommandstolistparameteroptions.
Runesxcli iscsi adapter discovery sendtarget param getoresxcli iscsi adapter target
portal param settoretrieveinformationaboutiSCSIparametersandwhethertheyaresettable.
Runesxcli iscsi adapter discovery sendtarget param getoresxcli iscsi adapter target
portal param settosetiSCSIparameteroptions.
Ifspecialcharactersareinthe<name>=<value>sequence,forexample,ifyouaddaspace,youmustsurround
thesequencewithdoublequotes(<name> = <value>).
VMware, Inc.
77
IfyouusethevSphereWebClienttomodifyauthenticationsettings,youdeselecttheInheritfromParent
checkboxbeforeyoucanmakeachangetothediscoveryaddressordiscoverytarget.
Ifyouuseesxcli iscsi,thevalueyousetoverridestheinheritedvalue.
Inheritanceisrelevantonlyifyouwanttoreturnadynamicdiscoveryaddressorastaticdiscoverytargetto
itsinheritedvalue.Inthatcase,usethefollowingcommand,whichrequiresthe--nameoptionforstatic
discoveryaddresses,butnotfordynamicdiscoverytargets.
Description
DataDigestType
Increasesdataintegrity.Whendatadigestisenabled,thesystemperformsachecksumover
eachPDUsdatapartandverifiesusingtheCRC32Calgorithm.
Note:SystemsthatuseIntelNehalemprocessorsoffloadtheiSCSIdigestcalculationsfor
softwareiSCSI,thusreducingtheimpactonperformance.
ValidvaluesaredigestProhibited,digestDiscouraged,digestPreferred,or
digestRequired.
HeaderDigest
Increasesdataintegrity.Whenheaderdigestisenabled,thesystemperformsachecksumover
theheaderpartofeachiSCSIProtocolDataUnit(PDU)andverifiesusingtheCRC32C
algorithm.
MaxOutstandingR2T
MaxOutstandingR2TdefinestheReadytoTransfer(R2T)PDUsthatcanbeintransitionbefore
anacknowledgementPDUisreceived.
FirstBurstLength
MaximumamountofunsoliciteddataaniSCSIinitiatorcansendtothetargetduringthe
executionofasingleSCSIcommand,inbytes.
MaxBurstLength
MaximumSCSIdatapayloadinaDataInorasolicitedDataOutiSCSIsequence,inbytes.
MaxRecvDataSegLen
Maximumdatasegmentlength,inbytes,thatcanbereceivedinaniSCSIPDU.
NoopOutInterval
Timeinterval,inseconds,betweenNOPOutrequestssentfromyouriSCSIinitiatortoaniSCSI
target.TheNOPOutrequestsserveasthepingmechanismtoverifythataconnectionbetween
theiSCSIinitiatorandtheiSCSItargetisactive.
Supportedonlyattheinitiatorlevel.
NoopOutTimeout
Amountoftime,inseconds,thatcanlapsebeforeyourhostreceivesaNOPInmessage.The
messageissentbytheiSCSItargetinresponsetotheNOPOutrequest.Whenthe
NoopTimeoutlimitisexceeded,theinitiatorterminatesthecurrentsessionandstartsanew
one.
Supportedonlyattheinitiatorlevel.
78
RecoveryTimeout
Amountoftime,inseconds,thatcanlapsewhileasessionrecoveryisperformed.Ifthetimeout
exceedsitslimit,theiSCSIinitiatorterminatesthesession.
DelayedAck
Allowssystemstodelayacknowledgmentofreceiveddatapackets.
VMware, Inc.
Youcanusethefollowingvicfg-iscsioptionstolistparameteroptions.Specifyoneoftheoptionslistedin
ConnectionOptionsonpage 17inplaceof<conn_options>.
Runvicfg-iscsi -W -ltolistparameteroptionsfortheHBA.
vicfg-iscsi <conn_options> -W -l
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]] <adapter_name>
vicfg-iscsi <conn_options> --parameter --list
[--ip <stor_ip_addr|stor_hostname> [:<portnum>] [--name <iscsi_name>]] <adapter_name>
Thetarget(-i)andname(-n)optiondeterminewhatthecommandappliesto.
Option
Result
-iandn
Commandappliestostatictargets.
Onlyi
Commandappliestothediscoveryaddress.
Neither-inorn
Commandappliestoperadapterparameters.
Runvicfg-iscsi -W -l -k tolistiSCSIparametersandwhethertheyaresettable.
vicfg-iscsi <conn_options> -W -l -k
[-i <stor_ip_addr|stor_hostname>[:<port_num>] [-n <iscsi_name>]]
<adapter_name>
Runvicfg-iscsi -W -jtosetiSCSIparameteroptions.
vicfg-iscsi <conn_options> -W -j <name>=<value>
-i <stor_ip_addr|stor_hostname>[:port_num>][-n <iscsi_name>]] <adapter_name>
vicfg-iscsi <conn_options> --parameter --set <name>=<value>
--ip <stor_ip_addr|stor_hostname>[:port_num>][--name <iscsi_name>]] <adapter_name>
Thetarget(-i)andname(-n)optiondeterminewhatthecommandappliesto.
Option
Result
-iandn
CommandappliestopertargetCHAPforstatictargets.
Onlyi
Commandappliestothediscoveryaddress.
Neither-inorn
CommandappliestoperadapterCHAP.
Ifspecialcharactersareinthe<name>=<value>sequence,forexample,ifyouaddaspace,youmustsurround
thesequencewithdoublequotes(<name> = <value>).
IfyouusethevSphereWebClienttomodifyauthenticationsettings,youdeselecttheInheritfromParent
checkboxbeforeyoucanmakeachangetothediscoveryaddressordiscoverytarget.
Ifyouusevicfg-iscsi,thevalueyousetoverridestheinheritedvalue.
Inheritanceisrelevantonlyifyouwanttoreturnadynamicdiscoveryaddressorastaticdiscoverytargetto
itsinheritedvalue.Inthatcase,usethe--reset <param_name>option,whichrequiresthe--nameoptionfor
staticdiscoveryaddresses,butnotfordynamicdiscoverytargets.
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>
VMware, Inc.
79
(Optional)SettheauthenticationinformationforCHAP.
esxcli <conn_options> iscsi adapter auth chap set --direction=uni --chap_username=<name>
--chap_password=<pwd> --level=[prohibited, discouraged, preferred, required]
--secret=<string> --adapter=<adapter_name>
YoucansetpertargetCHAPforstatictargets,peradapterCHAP,orapplythecommandtothediscovery
address.
Forexample:
esxcli <conn_options> iscsi adapter auth chap set --direction=uni --chap_username=User1
--chap_password=MySpecialPwd --level=preferred --secret=uni_secret
--adapter=vmhba33
For<level>,specifyprohibitedorrequired.
prohibitedThehostdoesnotuseCHAPauthentication.Ifauthenticationisenabled,specify
chapProhibitedtodisableit.
requiredThehostrequiressuccessfulCHAPauthentication.TheconnectionfailsifCHAP
negotiationfails.YoucansetthisvalueformutualCHAPonlyifCHAPissettochapRequired.
Fordirection,specifymutual.
IMPORTANTYouareresponsibleformakingsurethatCHAPissetbeforeyousetmutualCHAP,andfor
usingcompatiblelevelsforCHAPandmutualCHAP.UseadifferentsecretinCHAPandmutualCHAP.
To enable mutual authentication
1
Enableauthentication.
esxcli <conn_options> iscsi adapter auth chap set --direction=uni --chap_username=<name>
--chap_password=<pw> --level=[prohibited, discouraged, preferred, required]
--secret=<string> --adapter=<adapter_name>
Thespecifiedchap_usernameandsecretmustbesupportedonthestorageside.
2
ListpossibleVMkernelNICstobind.
esxcli <conn_options> iscsi logicalnetworkportal list
80
VMware, Inc.
Enablemutualauthentication.
esxcli <conn_options> iscsi adapter auth chap set --direction=mutual
--mchap_username=<m_name> --mchap_password=<m_pwd> --level=[prohibited,
required] --secret=<string> --adapter=<adapter_name>
Thespecifiedmchap_usernameandsecretmustbesupportedonthestorageside.
Makesurethefollowingrequirementsaremet.
CHAPauthenticationisalreadysetupwhenyoustartsettingupmutualCHAP.
CHAPandmutualCHAPusedifferentusernamesandpasswords.Thesecondusernameand
passwordaresupportedformutualauthenticationonthestorageside.
CHAPandmutualCHAPusecompatibleCHAPlevels.
Aftersetupiscomplete,performrediscoveryandrescanallstoragedevices.Forexample:
esxcli <conn_options> iscsi adapter discovery rediscover
esxcli <conn_options> storage core adapter rescan --adapter=vmhba36
EnableauthenticationontheESXihost.
vicfg-iscsi <conn_options> -A -c <level> -m <auth_method> -u <auth_u_name> -w <chap_password>
[-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name]] <adapter_name>
Thespecifiedusernameandpasswordmustbesupportedonthestorageside.
2
EnablemutualauthenticationontheESXihost.
vicfg-iscsi <conn_options> -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>
Makesurethefollowingrequirementsaremet.
CHAPauthenticationisalreadysetupwhenyoustartsettingupmutualCHAP.
CHAPandmutualCHAPusedifferentusernamesandpasswords.Thesecondusernameand
passwordaresupportedformutualauthenticationonthestorageside.
CHAPandmutualCHAPusecompatibleCHAPlevels.
Aftersetupiscomplete,performrediscoveryandrescanallstoragedevices.
VMware, Inc.
81
FindoutwhichuplinksareavailableforusewithiSCSIadapters.
esxcli <conn_options> iscsi physicalnetworkportal list --adapter=<adapter_name>
ConnectthesoftwareiSCSIordependenthardwareiSCSIinitiatortotheiSCSIVMkernelportsbyrunning
thefollowingcommandforeachport.
esxcli <conn_options> iscsi networkportal nic add --adapter=<adapter_name> --nic=<bound_nic>
VerifythattheportswereaddedtotheiSCSIinitiatorbyrunningthefollowingcommand:
esxcli <conn_options> iscsi networkportal list --adapter=<adapter_name>
(Optional)IfthereareactiveiSCSIsessionsbetweenyourhostandtargets,discontinuethem.See
RemovingiSCSISessionsonpage 83.
RescantheiSCSIinitiator.
esxcli <conn_options> storage core adapter rescan --adapter <iscsi adapter>
TodisconnecttheiSCSIinitiatorfromtheports,runthefollowingcommand.
esxcli <conn_options> iscsi networkportal remove --adapter=<adapter_name> --nic=<bound_nic>
Cloningsessions.SomeiSCSIarrayssupportmultiplesessionsbetweentheiSCSIadapterandtarget
ports.Ifyoucloneanexistingsessionononeofthesearrays,thearraypresentsmoredatapathsforyour
adapter.Duplicatesessionsdonotpersistacrossreboot.Additionalsessionstothetargetmighthave
performancebenefits,buttheresultofcloningdependsentirelyonthearray.Youmustlogoutfroman
iSCSIsessionifyouwanttocloneasession.Youcanusetheesxcli iscsi session addcommandto
cloneasession.
EnablingHeaderandDataDigest.IfyouareloggedintoasessionandwanttoenabletheHeaderand
DataDigestparameters,youmustsettheparameter,removethesession,andaddthesessionbackforthe
parameterchangetotakeeffect.YoumustlogoutfromaniSCSIsessionifyouwanttocloneasession.
Establishingtargetspecificsessions.Youcanestablishasessiontoaspecifictargetport.Thiscanbe
usefulifyourhostconnectstoasingleportstoragesystemthat,bydefault,presentsonlyonetargetport
toyourinitiator,butcanredirectadditionalsessionstoadifferenttargetport.Establishinganewsession
betweenyouriSCSIinitiatorandanothertargetportcreatesanadditionalpathtothestoragesystem.
CAUTIONSomestoragesystemsdonotsupportmultiplesessionsfromthesameinitiatornameorendpoint.
AttemptstocreatemultiplesessionstosuchtargetscanresultinunpredictablebehaviorofyouriSCSI
environment.
Thefollowingexamplescenariousestheavailablecommands.Runesxcli iscsi session --helpandeach
commandwith--helpforreferenceinformation.Theexampleusesaconfigurationfiletologintothehost.
SpecifyoneoftheoptionslistedinConnectionOptionsonpage 17inplaceof<conn_options>.
IMPORTANTTheESX/ESXi4.xESXCLIcommandsformanagingiSCSIsessionsarenotsupportedagainst
ESXi5.0hosts.
82
VMware, Inc.
ListasoftwareiSCSIsessionattheadapterlevel.
esxcli <conn_options> iscsi session list --adapter=<iscsi_adapter>
ListasoftwareiSCSIsessionatthetargetlevel.
esxcli <conn_options> iscsi session list --name=<target> --adapter=<iscsi_adapter>
LogintoasessiononthecurrentsoftwareiSCSIordependenthardwareiSCSIconfigurationatthe
adapterlevel.
esxcli <conn_options> iscsi session add --adapter=<adapter_name>
Forexample:
esxcli --config /host-config-file iscsi session add --adapter=vmhba36
LogintoasessiononthecurrentsoftwareiSCSIordependenthardwareiSCSIconfigurationatthetarget
level.
esxcli <conn_options> iscsi session add --name=<target> --adapter=<adapter_name>
Forexample:
esxcli --config /host-config-file iscsi session add -name=iqn.xxx --adapter=vmhba36
AddduplicatesessionswithtargetandsessionIDsincurrentsoftwareiSCSIordependenthardware
iSCSIconfiguration.
esxcli <conn_options> iscsi session add --name=<iqn.xxxx> --isid=<session_id>
--adapter=<iscsi_adapter>
iqn.xxxxisthetargetIQN,whichyoucandeterminebylistingallsessions.session_idisthesessions
iSCSIID.Forexample:
esxcli --config /host-config-file iscsi session add -name=iqn.xxx --isid='00:02:3d:00:00:01'
--adapter=vmhba36
RemovesessionsfromthecurrentsoftwareiSCSIordependenthardwareiSCSIconfigurationatthe
adapterlevel.
esxcli <conn_options> iscsi session remove --adapter=<iscsi_adapter>
Forexample:
esxcli iscsi session remove --adapter=vmhba36
RemovesessionsfromthecurrentsoftwareiSCSIordependenthardwareiSCSIconfigurationatthetarget
level.
esxcli <conn_options> iscsi session remove --name=<iqn> --adapter=<iscsi_adapter>
Forexample:
esxcli <conn_options> iscsi session remove --name=iqn.xxx --adapter=vmhba38
VMware, Inc.
83
RemovesessionsfromthecurrentsoftwareiSCSIordependenthardwareiSCSIconfigurationwithtarget
andsessionID.
esxcli <conn_options> iscsi session remove --name=<iqn.xxxx> --isid=<session id>
--adapter=<iscsi_adapter>
iqn.xxxxisthetargetIQN,whichyoucandeterminebylistingallsessions.session_idisthesessions
iSCSIID.
Forexample:
esxcli --config /host-config-file iscsi session remove --name=iqn.xxx
--session='00:02:3d:01:00:01' --adapter=vmhba36
84
VMware, Inc.
VMwarepartnersandcustomerscanoptimizeperformanceoftheirstoragearraysinconjunctionwith
VMwarevSphereusingVMwarePSA(pluggablestoragearchitecture).Theesxcli storage core
namespacemanagesVMwarePSAandtheesxcli storage nmpnamespacemanagestheVMwareNMP
plugin.
ThevSphereStoragedocumentationdiscussesPSAfunctionalityindetailandexplainshowtousethevSphere
ClientorthevSphereWebClienttomanagethePSA,theassociatednativemultipathingplugin(NMP)and
thirdpartyplugins.
Thischapterusesthefollowingacronyms.
Acronym
Meaning
PSA
PluggableStorageArchitecture.
NMP
NativeMultipathingPlugin.GenericVMwaremultipathingmodule.
PSP
PathSelectionPlugin.Handlespathselectionforagivendevice.
SATP
StorageArrayTypePlugin.Handlespathfailoverforagivenstoragearray.
Thischapterincludesthesetopics:
ManagingNMPwithesxclistoragenmponpage 85
PathClaimingwithesxclistoragecoreclaimingonpage 92
ManagingClaimRulesonpage 93
VMware, Inc.
85
Description
--device <device>
-d <device>
Filterstheoutputofthecommandtoshowinformationaboutasingledevice.Defaultisall
devices.
IfadevicedoesnothaveaspecificPSPset,italwaysusesthePSPassignedtotheSATP.IfthedefaultPSP
fortheSATPchanges,thePSPassignedtothedevicechangesonlyafterrebootorafteradeviceis
reclaimed.Adeviceisreclaimedwhenyouunclaimallpathsforthedeviceandreclaimthepaths.
Usethe--defaultoptiontoreturnthedevicetousingtheSATPsPSP.
Options
Description
--default
-E
SetsthePSPbacktothedefaultfortheSATPassignedtothisdevice.
--device <device>
-d <device>
DevicetosetthePSPfor.
--psp <PSP>
-P <PSP>
TosetthepathpolicyforthespecifieddevicetoVMW_PSP_FIXED,runthefollowingcommand:
esxcli <conn_options> storage nmp device set --device naa.xxx --psp VMW_PSP_FIXED
Managing Path Selection Policy Plugins with esxcli storage nmp psp
Useesxcli storage nmp psptomanageVMwarepathselectionpolicypluginsincludedwiththeVMware
NMPpluginandtomanagethirdpartyPSPs.
IMPORTANTWhenusedwiththirdpartyPSPs,thesyntaxdependsonthethirdpartyPSPimplementation.
86
VMware, Inc.
ToretrievePSPconfigurationparameters,usetheappropriatecommandforthePSP.
Deviceconfigurationinformation.
esxcli <conn_options> storage nmp psp generic deviceconfig get --device=<device>
esxcli <conn_options> storage nmp psp fixed deviceconfig get --device=<device>
esxcli <conn_options> storage nmp psp roundrobin deviceconfig get --device=<device>
Pathconfigurationinformation.
esxcli <conn_options> storage nmp psp generic pathconfig get --path=<path>
RetrievethePSPconfigurationforthespecifiedpath.
esxcli <conn_options> nmp psp pathconfig generic get --path vmhba4:C1:T2:L23
Description
--config <config_string>
-c <config_string>
Configurationstringtosetforthedeviceorpathspecifiedby--deviceor--path.See
Table 41,SupportedPathPolicies,onpage 48.
--device <device>
-d <device>
Deviceforwhichyouwanttocustomizethepathpolicy.
--path <path>
-p <path>
Pathforwhichyouwanttocustomizethepathpolicy.
VMware, Inc.
87
Description
--device <device>
-d <device>
Deviceforwhichyouwanttogetthepreferredpath.Thisdevicemustbecontrolledbythe
VMW_PSP_FIXEDPSP.
Toreturnthepathconfiguredasthepreferredpathforthespecifieddevice,runthefollowingcommand.
SpecifyoneoftheoptionslistedinConnectionOptionsonpage 17inplaceof<conn_options>.
esxcli <conn_options> storage nmp fixed deviceconfig get --device naa.xxx
Description
--device <device>
-d <device>
Deviceforwhichyouwanttosetthepreferredpath.Thisdevicemustbecontrolledbythe
VMW_PSP_FIXEDPSP.
Useesxcli storage nmp device --listtolistthepoliciesforalldevices.
--path <path>
-p <path>
Pathtosetasthepreferredpathforthespecifieddevice.
Tosetthepreferredpathforthespecifieddevicetovmhba3:C0:T5:L3,runthefollowingcommand.Specify
oneoftheoptionslistedinConnectionOptionsonpage 17inplaceof<conn_options>.
esxcli <conn_options> storage nmp fixed deviceconfig set --device naa.xxx --path vmhba3:C0:T5:L3
Setthepathpolicytoroundrobin.
esxcli <conn_options> storage nmp device set --device naa.xxx --psp VMW_PSP_RR
Specifywhentoswitchpaths.
YoucanchoosethenumberofI/Ooperations,numberofbytes,andsoon.Forexample:
esxcli <conn_options> storage nmp psp roundrobin deviceconfig set --type "bytes" -B 12345
--device naa.xxx
Setsthedevicespecifiedby--devicetoswitchtothenextpatheachtime12345byteshavebeensent
alongthecurrentpath.
esxcli <conn_options> storage nmp psp roundrobin deviceconfig set --type=iops --iops 4200
--device naa.xxx
Setsthedevicespecifiedby--devicetoswitchafter4200I/Ooperationshavebeenperformedonapath.
88
VMware, Inc.
Description
-d <device>
--device <device>
Devicetogetroundrobinpropertiesfor.
Description
--bytes
-B
NumberofbytestosendalongonepathforthisdevicebeforethePSPswitchestothenextpath.
Youcanusethisoptiononlywhen--typeissettobytes.
--device
-d
Devicetosetroundrobinpropertiesfor.Thisdevicemustbecontrolledbytheroundrobin
(VMW_PSP_RR)PSP.
--iops
-I
NumberofI/OoperationstosendalongonepathforthisdevicebeforethePSPswitchestothe
nextpath.Youcanusethisoptiononlywhen--typeissettoiops.
--type
-t
Typeofroundrobinpathswitchingtoenableforthisdevice.Thefollowingvaluesfortypeare
supported:
bytes:Setthetriggerforpathswitchingbasedonthenumberofbytessentdownapath.
default:Setthetriggerforpathswitchingbacktodefaultvalues.
iops:SetthetriggerforpathswitchingbasedonthenumberofI/Ooperationsonapath.
Anequalsign(=)beforethetypeordoublequotesaroundthetypeareoptional.
--useANO
-U
Ifsetto1,theroundrobinPSPincludespathsintheactive,unoptimizedstateintheroundrobin
set.Ifsetto0,thePSPusesactive,unoptimizedpathsonlyifnoactiveoptimizedpathsare
available.Otherwise,thePSPincludesonlyactiveoptimizedpathsintheroundrobinpathset.
Managing SATPs
Theesxcli storage nmp satpcommandsmanageSATPs.Youcanusethesecommandstoperformthe
followingtasks:
Retrieveandsetconfigurationparameters
AddandremoverulesfromthelistofclaimrulesforaspecifiedSATP
SetthedefaultPSPforaspecifiedSATP
ListSATPsthatarecurrentlyloadedintoNMPandtheassociatedclaimrules
ThedefaultSATPforanactiveactiveFCarraywithavendorandmodelnotlistedintheSATPrulesis
VMW_SATP_DEFAULT_AA.
Therule listcommandliststheclaimrulesforSATPs.
esxcli <conn_options> storage nmp satp rule list
VMware, Inc.
89
Description
--driver
DriverstringtosetwhenaddingtheSATPclaimrule.
-D
-d
DevicetosetwhenaddingSATPclaimrules.Devicerulesaremutuallyexclusivewith
vendor/modelanddriverrules.
--force
Forceclaimrulestoignorevaliditychecksandinstalltheruleevenifchecksfail.
--device
-f
--model
-M
ModelstringtosetwhenaddingtheSATPclaimrule.Canbethemodelnameorapattern
^mod*,whichmatchesalldevicesthatstartwithmod.Thatis,thepatternsuccessfullymatches
mod1andmodz,butnotmymod1.
Thecommandsupportsthestart/end(^)andwildcard(*)functionalitybutnootherregular
expressions.
-R
TransportstringtosetwhenaddingtheSATPclaimrule.DescribesthetypeofstorageHBA,
forexample,iscsiorfc.
--vendor
VendorstringtosetwhenaddingtheSATPclaimrule.
--transport
-V
--satp
SATPforwhichtheruleisadded.
-s
--claim-option
ClaimoptionstringtosetwhenaddingtheSATPclaimrule.
-c
--description
DescriptionstringtosetwhenaddingtheSATPclaimrule.
-e
-o
OptionstringtosetwhenaddingtheSATPclaimrule.Surroundtheoptionstringindouble
quotes,anduseaspace,notacomma,whenspecifyingmorethanoneoption.
enable_local enable_ssd.
--psp
DefaultPSPfortheSATPclaimrule.
--option
-P
--psp-option
PSPoptionsfortheSATPclaimrule.
-O
--type
SettheclaimtypewhenaddingaSATPclaimrule.
-t
ThefollowingexamplesillustrateaddingSATPrules.SpecifyoneoftheoptionslistedinConnection
Optionsonpage 17inplaceof<conn_options>.
AddaSATPrulethatspecifiesthatdiskswithvendorstringVMWAREandmodelstringVirtualshouldbe
addedtoVMW_SATP_LOCAL.
esxcli <conn_options> storage nmp satp rule add --satp="VMW_SATP_LOCAL" --vendor="VMWARE"
--model="Virtual" --description="VMware virtual disk"
AddaSATPrulethatspecifiesthatdiskswiththedriverstringsomedrivershouldbeaddedto
VMW_SATP_LOCAL.
esxcli <conn_options> storage nmp satp rule add --satp="VMW_SATP_LOCAL"
--driver="somedriver"
90
VMware, Inc.
AddarulethatspecifiesthatallstoragedeviceswithvendorstringABCandamodelnamethatstartswith
120shoulduseVMW_SATP_DEFAULT_AA(VMW_SATP_DEFAULT_AAisanexample).
esxcli <conn_options> storage nmp satp rule add --satp VMW_SATP_DEFAULT_AA --vendor="ABC"
--model="^120*
Description
--config
-c
YoucansettheconfigurationforthefollowingSATPs:
Configurationstringtosetforthepathspecifiedby--pathorthedevicespecifiedby--device.
VMW_SATP_ALUA_CX
VMW_SATP_ALUA
VMW_SATP_CX
VMW_SATP_INV
Youcanspecifyoneofthefollowingdeviceconfigurationstrings:
navireg_onstartsautomaticregistrationofthedevicewithNavisphere.
navireg_offstopstheautomaticregistrationofthedevice.
ipfilter_onstopsthesendingofthehostnameforNavisphereregistration.Usedifhostis
knownaslocalhost.
ipfilter_offenablesthesendingofthehostnameduringNavisphereregistration.
--device
-d
DevicetosetSATPconfigurationfor.NotallSATPssupportthesetconfigoptionondevices.
--path
-p
PathtosetSATPconfigurationfor.NotallSATPssupportthesetconfigoptiononpaths.
VMware, Inc.
91
Attemptstounclaimallpathstoadevice.
Runstheloadedclaimrulesoneachoftheunclaimedpathstoreclaimthosepaths.
Itisnormalforthiscommandtofailifadeviceisinuse.
IMPORTANTThereclaimcommandunclaimspathsassociatedwithadevice.
YoucannotusethecommandtoreclaimpathscurrentlyassociatedwiththeMASK_PATHpluginbecause
--deviceistheonlyoptionforreclaimandMASK_PATHpathsarenotassociatedwithadevice.
YoucanusethecommandtounclaimpathsforadeviceandhavethosepathsreclaimedbytheMASK_PATH
plugin.
Options
Description
--device <device>
Nameofthedeviceonwhichallpathsarereclaimed.
-d <device>
--help
Displaysthehelpmessage.
92
Options
Description
--adapter <adapter>
-A <adapter>
If--typeissettolocation,specifiesthenameoftheHBAforthepathsthatyouwant
tounclaim.Ifyoudonotspecifythisoption,unclaimingrunsonpathsfromall
adapters.
--channel <channel>
-C <channel>
If--typeissettolocation,specifiestheSCSIchannelnumberforthepathsthatyou
wanttounclaim.Ifyoudonotspecifythisoption,unclaimingrunsonpathsfromall
channels.
--claimrule-class <cl>
-c <cl>
Claimruleclasstouseinthisoperation.YoucanspecifyMP(Multipathing),Filter,or
VAAI.Multipathingisthedefault.FilterisusedonlyforVAAI.Specifyclaimrulesfor
bothVAAI_FILTERandVAAIplugintouseit.
VMware, Inc.
Options
Description
--device <device>
-d <device>
If--typeissettodevice,attemptstounclaimallpathstothespecifieddevice.Ifthere
areactiveI/Ooperationsonthespecifieddevice,atleastonepathcannotbeunclaimed.
--driver <driver>
-D <driver>
If--typeisdriver,unclaimsallpathsspecifiedbythisHBAdriver.
--lun <lun_number>
-L <lun_number>
If--typeislocation,specifiestheSCSILUNforthepathstounclaim.Ifyoudonot
specify--lun,unclaimingrunsonpathswithanyLUNnumber.
--model <model>
-m <model>
If--typeisvendor,attemptstounclaimallpathstodeviceswithspecificmodel
information(formultipathingplugins)orunclaimthedeviceitself(forfilterplugins).If
thereareactiveI/Ooperationsonthisdevice,atleastonepathfailstounclaim.
--path <path>
-p <path>
If--typeispath,unclaimsapathspecifiedbyitspathUIDorruntimename.
--plugin <plugin>
-P
If--typeisplugin,unclaimsallpathsforaspecifiedmultipathplugin.
<plugin>canbeanyvalidPSApluginonthesystem.BydefaultonlyNMPand
MASK_PATHareavailable,butadditionalpluginsmightbeinstalled.
--target <target>
-T <target>
If--typeislocation,unclaimsthepathswiththeSCSItargetnumberspecifiedby
target.Ifyoudonotspecify--target,unclaimingrunsonpathsfromalltargets.
--type <type>
-t <type>
Typeofunclaimoperationtoperform.Validvaluesarelocation,path,driver,
device,plugin,andvendor.
--vendor <vendor>
-v <vendor>
If--typeisvendor,attemptstounclaimallpathstodeviceswithspecificvendorinfo
formultipathingpluginsorunclaimthedeviceitselfforfilterplugins.Ifthereareany
activeI/Ooperationsonthisdevice,atleastonepathfailstounclaim
Thefollowingtroubleshootingcommandtriestounclaimallpathsonvmhba1.
esxcli <conn_options> storage core claiming unclaim --type location -A vmhba1
VMware, Inc.
93
Options
Description
--adapter <adapter>
Adapterofthepathstouse.Validonlyif--typeislocation.
-A <adapter>
--autoassign
-u
Addsaclaimrulebasedonitscharacteristics.Therulenumberisnotrequired.
--channel <channel>
Channelofthepathstouse.Validonlyif--typeislocation.
-C <channel>
--claimrule-class <cl>
-c <cl>
Claimruleclasstouseinthisoperation.YoucanspecifyMP(default),Filter,orVAAI.
--driver <driver>
DriverfortheHBAofthepathstouse.Validonlyif--typeisdriver.
Toconfigurehardwareaccelerationforanewarray,addtwoclaimrules,oneforthe
VAAIfilterandanotherfortheVAAIplugin.SeevSphereStoragefordetailed
instructions.
-D <driver>
--force
Forceclaimrulestoignorevaliditychecksandinstalltherule.
-f
--lun <lun_number>
LUNofthepathstouse.Validonlyif--typeislocation.
-L <lun_number>
--model <model>
Modelofthepathstouse.Validonlyif--typeisvendor.
-M <model>
ValidvaluesarevaluesoftheModelstringfromtheSCSIinquirystring.Run
vicfg-scsidevs <conn_options> -loneachdevicetoseemodelstringvalues.
--plugin
PSAplugintouse.Currently,thevaluesareNMPorMASK_PATH,butthirdpartiescan
shiptheirownPSApluginsinthefuture.
-P
MASK_PATHreferstothepluginMASK_PATH_PLUGIN.Thecommandaddsclaimrules
forthispluginiftheuserwantstomaskthepath.
ESX3.5includestheMaskLUNsadvancedconfigurationoption.Thisoptionisnot
availableinESX/ESXi4.xandESXi5.0.Ithasbeenreplacedbythe
MASK_PATH_PLUGIN.YoucanaddaclaimrulethatcausestheMASK_PATH_PLUGINto
claimthepathtomaskapathorLUNfromthehost.SeethevSphereStorage
documentationfordetails.
-r <rule_ID>
--target <target>
Targetofthepathstouse.Validonlyif--typeislocation.
--rule <rule_ID>
-T <target>
--transport <transport>
-R <transport>
--type <type>
-t <type>
--vendor
-V
94
Transportofthepathstouse.Validonlyif--typeistransport.Thefollowingvalues
aresupported:
blockblockstorage
fcFibreChannel
iscsivendoriSCSI
iscsinotcurrentlyused
ideIDEstorage
sasSASstorage
sataSATAstorage
usbUSBstorage
parallelparallel
unknown
Typeofmatchingtousefortheoperation.Validvaluesarevendor,location,driver,
andtransport.
Vendorofthepathstouse.Validonlyif--typeisvendor.
ValidvaluesarevaluesofthevendorstringfromtheSCSIinquirystring.Run
vicfg-scsidevs <conn_options> -loneachdevicetoseevendorstringvalues.
--wwnn
WorldWideNodeNumberforthetargettouseinthisoperation.
--wwpn
WorldWidePortNumberforthetargettouseinthisoperation.
VMware, Inc.
Claimrulesarenumberedasfollows.
Rules0100arereservedforinternalusebyVMware.
Rules10165435areavailableforgeneraluse.Anythirdpartymultipathingpluginsinstalledonyour
systemuseclaimrulesinthisrange.Bydefault,thePSAclaimrule101masksDellarraypseudodevices.
Donotremovethisrule,unlessyouwanttounmaskthesedevices.
Rules6543665535arereservedforinternalusebyVMware.
Whenclaimingapath,thePSArunsthroughtherulesstartingfromthelowestnumberanddeterminesisa
pathmatchestheclaimrulespecification.IfthePSAfindsamatch,itgivesthepathtothecorresponding
plugin.Thisisworthnoticingbecauseagivenpathmightmatchseveralclaimrules.
Thefollowingexamplesillustrateaddingclaimrules.SpecifyoneoftheoptionslistedinConnection
Optionsonpage 17inplaceof<conn_options>.
Addrule321,whichclaimsthepathonadaptervmhba0,channel0,target0,LUN0fortheNMPplugin.
esxcli <conn_options> storage core claimrule add -r 321 -t location -A vmhba0 -C 0 -T 0 -L 0
-P NMP
Addrule429,whichclaimsallpathsprovidedbyanadapterwiththemptscsidriverfortheMASK_PATH
plugin.
esxcli <conn_options> storage core claimrule add -r 429 -t driver -D mptscsi -P MASK_PATH
Addrule914,whichclaimsallpathswithvendorstringVMWAREandmodelstringVirtualfortheNMP
plugin.
esxcli <conn_options> storage core claimrule add -r 914 -t vendor -V VMWARE -M Virtual -P NMP
Addrule1015,whichclaimsallpathsprovidedbyFCadaptersfortheNMPplugin.
esxcli <conn_options> storage core claimrule add -r 1015 -t transport -R fc -P NMP
VMware, Inc.
Plugin
MASK_PATH
MASK_PATH
MASK_PATH
HbaName
vmhba11
vmhba11
vmhba4
Controller
0
0
0
Target
0
0
2
LUN
11
10
1
95
WhenyouconvertLUNmaskingtotheclaimruleformatafteranupgradefromESX/ESXi3.5toESX/ESXi4.x,
thiscommandconvertsthe/adv/Disk/MaskLUNsadvancedconfigurationentryintheesx.conffiletoclaim
ruleswithMASK_PATHastheplugin.
IMPORTANTThisconversiondoesnotworkforallinputMaskLUNvariations.Forexample,roleconversion
forsoftwareiSCSILUNsisnotsupported.
Inspectthelistofgeneratedclaimrulescarefullybeforeyoucommitthembyusing--commit.
Table 6-1. esxcli storage core claimrule convert Options
Options
Description
--commit
-C
ForcesLUNmaskconfigurationchangestobesaved.Ifyoucallthecommandwithoutthis
parameter,changesarenotsaved,andyoucanfirstinspectthegeneratedclaimrules.
Description
--rule <rule_ID>
-r <rule_ID>
Thefollowingexampleremovesrule1015.
esxcli <conn_options> storage core claimrule remove -r 1015
Description
--claimrule-class <cl>
-c <cl>
Claimruleclasstouseinthisoperation.YoucanspecifyMP(Multipathing),Filter,or
VAAI.Multipathingisthedefault.FilterisusedonlyforVAAI.Specifyclaimrulesfor
bothVAAI_FILTERandVAAIplugintouseit.SeevSphereStorageforinformationabout
VAAI.
Youcanrunthecommandasfollows.Theequalsignisoptional,sobothformsofthecommandhavethesame
result.SpecifyoneoftheoptionslistedinConnectionOptionsonpage 17inplaceof<conn_options>.
esxcli <conn_options> storage core claimrule list -c Filter
esxcli <conn_options> storage core claimrule list --claimrule-class=Filter
96
VMware, Inc.
Description
--claimrule-class <cl>
-c <cl>
Claimruleclasstouseinthisoperation.
--new-rule <rule_ID>
-n <rule_ID>
NewruleIDyouwanttogivetotherulespecifiedbythe--ruleoption.
--rule <rule_ID>
-r <rule_ID>
Thefollowingexamplerenamesrule1016torule1015andremovesrule1016.Specifyoneoftheoptionslisted
inConnectionOptionsonpage 17inplaceof<conn_options>.
esxcli <conn_options> storage core claimrule move -r 1015 -n 1016
Modifyrulesandloadthem.
esxcli <conn_options> storage core claimrule load
Quiescethedevicesthatusepathsforwhichyouwanttochangetheruleandunclaimthosepaths.
esxcli <conn_options> storage core claiming unclaim --device=<device>
Runpathclaimingrules.
esxcli <conn_options> storage core claimrule run
Thiscommandisalsousedfortroubleshootingandboottimeconfiguration.
Options
Description
--adapter <adapter>
-A <adapter>
If--typeislocation,nameoftheHBAforthepathstoruntheclaimruleson.To
runclaimrulesonpathsfromalladapters,omitthisoption.
--channel <channel>
-C <channel>
If--typeislocation,valueoftheSCSIchannelnumberforthepathstorunthe
claimruleson.Torunclaimrulesonpathswithanychannelnumber,omitthis
option.
--claimrule-class
-c
Claimruleclasstouseinthisoperation.
--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
VMware, Inc.
97
Options
Description
--type
<location|path|all>
-t <location|path|all>
Typeofclaimtoperform.Bydefault,usesall,whichmeansclaimrulesrunwithout
restrictiontospecificpathsorSCSIaddresses.Validvaluesarelocation,path,and
all.
--wait
-w
Youcanusethisoptiononlyifyoualsouse--typeall.
Iftheoptionisincluded,theclaimwaitsforpathstosettlebeforerunningtheclaim
operation.Inthatcase,thesystemdoesnotstarttheclaimingprocessuntilitislikely
thatallpathsonthesystemhaveappearedbeforestartingtheclaimprocess.
Aftertheclaimingprocesshasstarted,thecommanddoesnotreturnuntildevice
registrationhascompleted.
Ifyouaddorremovepathsduringtheclaimingorthediscoveryprocess,thisoption
mightnotworkcorrectly.
98
VMware, Inc.
Managing Users
AnESXisystemgrantsaccesstoitsresourceswhenaknownuserwithappropriatepermissionslogsontothe
systemwithapasswordthatmatchestheonestoredforthatuser.YoucanusethevSphereClientorthe
vSphereSDKforallusermanagementtasks.YoucannotcreateESXiuserswiththevSphereWebClient.
Youcanusethevicfg-usercommandtocreate,modify,delete,andlistlocaldirectaccessusersonanESXi
host.YoucannotrunthiscommandagainstavCenterServersystem.
IMPORTANTStartingwithvSphere5.1,youcannolongermanagegroupswithvicfg-user.
Thischapterincludesthefollowingtopics:
UsersinthevSphereEnvironmentonpage 99
vicfguserCommandSyntaxonpage 99
ManagingUserswithvicfguseronpage 100
Ifyoucreateauserwithoutspecifyingtherole(--role),theuserhasnopermissions.Youcannotchangethe
usersrole,youcanonlychangetheuserspermission.
VMware, Inc.
99
IMPORTANTIfyoucreateauserwiththevSphereClient,youcannotmakechangestothatuserwiththe
vicfg-usercommand.
Options
Thevicfg-usercommandspecificoptionsmanipulateusers.Youmustalsospecifyconnectionoptions.See
ConnectionOptionsonpage 17.
Option
Description
--adduser <user_list>
-u <user_list>
Addsthespecifiedusers.Takesacommaseparatedlistofusers.
--entity <user>
-e <user>
Entitytoperformtheoperationon.StartingwithvSphere5.1,entityis
alwaysuser.
--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.
--role <admin|read-only|no-access>
-r <admin|read-only|no-access>
Roleforthetargetuser.Specifyoneofadmin,read-only,orno-access.
--shell
-s
Grantshellaccesstothetargetuser.Defaultisnoshellaccess.Usethis
commandtochangethedefaultortorevokeshellaccessrightsafterthey
havebeengranted.
Usersthatyoucreatewithoutassigningpermissionshavenopermissions.
Validvaluesareyesandno.
ThisoptionisnotsupportedagainstvSphere5.0systems.Theoptionis
supportedonlyagainstESX.TheoptionisnotsupportedagainstESXi.
ManageusersdefinedonESXiwiththevSphereClient,thevSphereWebServicesSDK,orvicfg-user.
ManagevCenterServeruserswiththevSphereClient,thevSphereWebClient,orthevSphereWeb
ServicesSDK.
IMPORTANTYoucannotmodifyuserscreatedwiththevSphereClientwiththevicfg-usercommand.
EveniftheuserlistsofahostandavCenterServersystemappeartohavecommonusers(forinstance,auser
calleddevuser),theseusersareseparateuserswiththesamename.TheattributesofdevuserinvCenter
Server,includingpermissions,passwords,andsoforth,areseparatefromtheattributesofdevuserontheESXi
host.IfyoulogintovCenterServerasdevuser,youmighthavepermissiontoviewanddeletefilesfroma
datastore.IfyoulogintoanESXihostasdevuser,youmightnothavethesepermissions.
UsersauthorizedtoworkdirectlyonanESXihostareaddedtotheinternaluserlistwhenESXiisinstalledor
canbeaddedbyasystemadministratorafterinstallation.Youcanusevicfg-usertoaddusers,removeusers,
changepasswords,andconfigurepermissions.
100
VMware, Inc.
CAUTIONSeetheAuthenticationandUserManagementchapterofvSphereSecurityforinformationaboutroot
usersbeforeyoumakeanychangestothedefaultusers.Mistakesregardingrootuserscanhaveseriousaccess
consequences.
EachESXihosthasseveraldefaultusers:
Therootuserhasfulladministrativeprivileges.Administratorsusethisloginanditsassociatedpassword
tologintoahostthroughthevSphereClient.Rootuserscancontrolallaspectsofthehostthattheyare
loggedonto.Rootuserscanmanipulatepermissions,creatingusers(onESXihostsonly),workingwith
events,andsoon.
ThevpxuseruserisavCenterServerentitywithrootrightsontheESXihost,allowingittomanage
activitiesforthathost.ThesystemcreatesvpxuserwhenanESXihostisattachedtovCenterServer.
vpxuserisnotpresentontheESXihostunlessthehostisbeingmanagedthroughvCenterServer.
Otherusersmightbedefinedbythesystem,dependingonthenetworkingsetupandotherfactors.
Thefollowingexamplescenarioillustratessomeofthetasksthatyoucanperform.Specifyoneoftheoptions
listedinConnectionOptionsonpage 17inplaceof<conn_options>.
To create, modify, and delete users
1
Listtheexistingusers.
vicfg-user <conn_options> -e user -o list
Thelistdisplaysallusersthatarepredefinedbythesystemandallusersthatwereaddedlater.
IMPORTANTThecommandlistsamaximumof100users.
2
Addanewuser,specifyingaloginIDandpassword.
vicfg-user <conn_options> -e user -o add -l user27 -p 27_password
Thecommandcreatestheuser.Bydefault,thecommandautogeneratesaUIDfortheuser.
3
ListtheusersagaintoverifythatthenewuserwasaddedandaUIDwasgenerated.
vicfg-user <conn_options> -e user -o list
USERS
------------------Principal -: root
Full Name -: root
UID -: 0
Shell Access -> 1
------------------...
-------------------Principal -: user27
Full Name -:
UID -: 501
Shell Access -> 0
Modifythepasswordforuseruser27.
vicfg-user <conn_options> -e user -o modify -l user27 -p 27_password2
Assignreadonlyprivilegestotheuser(whocurrentlyhasnoaccess).
vicfg-user <conn_options> -e user -o modify -l user27 --role read-only
Thesystempromptswhetheryouwanttochangethepassword,whichmightbeadvisableiftheuserdoes
notcurrentlyhaveapassword.Answeryorn.Thesystemthenupdatestheuser.
Updated user user27 successfully.
Assigned the role read-only
6
VMware, Inc.
RemovetheuserwithloginIDuser27.
101
Thesystemremovestheuserandprintsamessage.
Removed the user user27 successfully.
102
VMware, Inc.
YoucanmanagevirtualmachineswiththevSphereWebClientorthevmware-cmdvCLIcommand.Using
vmware-cmdyoucanregisterandunregistervirtualmachines,retrievevirtualmachineinformation,manage
snapshots,turnthevirtualmachineonandoff,addandremovevirtualdevices,andpromptforuserinput.
Thechapterincludesthesetopics:
vmwarecmdOverviewonpage 103
ListingandRegisteringVirtualMachinesonpage 104
RetrievingVirtualMachineAttributesonpage 105
ManagingVirtualMachineSnapshotswithvmwarecmdonpage 106
PoweringVirtualMachinesOnandOffonpage 107
ConnectingandDisconnectingVirtualDevicesonpage 108
WorkingwiththeAnswerVMAPIonpage 109
ForciblyStoppingVirtualMachineswithEXCLIonpage 109
SomevirtualmachinemanagementutilityapplicationsareincludedinthevSphereSDKforPerl.
ThevSpherePowerCLIcmdlets,whichyoucaninstallforusewithMicrosoftPowerShell,managemany
aspectsofvirtualmachines.
vmware-cmd Overview
vmware-cmdwasincludedinearlierversionoftheESXServiceConsole.Avmware-cmdcommandhasbeen
availableinthevCLIpackagesinceESXiversion3.0.
IMPORTANTvmware-cmdisnotavailableintheESXiShell.Runthevmware-cmdvCLIcommandinstead.
Olderversionsofvmware-cmdsupportasetofconnectionoptionsandgeneraloptionsthatdifferfromthe
optionsinothervCLIcommands.Thevmware-cmdvCLIcommandsupportstheseoptions.ThevCLI
commandalsosupportsthestandardvCLI--server,--username,--password,and--vihostoptions.
vmware-cmddoesnotsupportotherconnectionoptions.
IMPORTANTvmware-cmdisalegacytoolandsupportstheusageofVMFSpathsforvirtualmachine
configurationfiles.Asarule,usedatastorepathstoaccessvirtualmachineconfigurationfiles.
VMware, Inc.
103
Description
--server <host>
TargetESXiorvCenterServersystem.
-H <host>
-h <target>
Whenyourunvmware-cmdwiththe-HoptionpointingtoavCenterServersystem,use
--vihosttospecifytheESXihosttorunthecommandagainst.
-O <port>
Alternativeconnectionport.Thedefaultportnumberis902.
username <username>
Userwhoisauthorizedtologintothehostspecifiedby--serveror--vihost.
--vihost <target>
-U <username>
password <password>
Passwordfortheuserspecifiedby-U.
-P <password>
-Q <protocol>
Protocoltouse,eitherhttporhttps.Defaultishttps.
Description
--help
Printsahelpmessagethatliststheoptionsforthiscommand.
-q
Runsinquietmodewithminimaloutput.Theoutputdoesnotdisplaythespecifiedoperationand
arguments.
-v
Runsinverbosemode.
Datastoreprefixstyle:'[ds_name] relative_path',forexample:
'[myStorage1] testvms/VM1/VM1.vmx'(Linux)
UUIDbasedpath: folder/subfolder/file,forexample:
'/vmfs/volumes/mystorage/testvms/VM1/VM1.vmx'(Linux)
"/vmfs/volumes/mystorage/testvms/VM1/VM1.vmx"(Windows)
104
VMware, Inc.
Runvmware-cmd -ltolistallregisteredvirtualmachinesonaserver.
vmware-cmd -H <vc_server> -U <login_user> -P <login_password> --vihost <esx_host> -l
ThecommandliststheVMXfileforeachvirtualmachine.
/vmfs/volumes/<storage>/winxpPro-sp2/winxpPro-sp2.vmx
/vmfs/volumes/<storage>/RHEL-lsi/RHEL-lsi.vmx
/vmfs/volumes/<storage>/VIMA0809/VIMA0809.vmx
.....
Runvmware-cmd -s unregistertoremoveavirtualmachinefromtheinventory.
vmware-cmd -H <vc_server> -U <login_user> -P <login_password> --vihost <esx_host>
-s unregister /vmfs/volumes/Storage2/testvm/testvm.vmx
Thesystemreturns0toindicatesuccess,1toindicatefailure.
NOTEWhenyourunagainstavCenterServersystem,youmustspecifythedatacenterandtheresource
pooltoregisterthevirtualmachinein.Thedefaultdatacenterisha-datacenterandthedefaultresource
poolisResources.
WhenyourunagainstanESXihost,youusuallydonotspecifytheresourcepoolanddatacenter.
However,iftwovirtualmachineswiththesamenameexistintworesourcepools,youmustspecifythe
resourcepool.
3
Runvmware-cmd -lagaintoverifythatthevirtualmachinewasremovedfromtheinventory.
Runvmware-cmd -s registertoaddthevirtualmachinebacktotheinventory.
vmware-cmd -H <vc_server> -U <login_user -P <login_password --vihost <esx_host> -s register
/vmfs/volumes/Storage2/testvm/testvm.vmx
Thesystemreturns0toindicatesuccess,1toindicatefailure.
Theguestinfooptionallowsyoutoretrieveinformationabouttheguestoperatingsystem.Forexample,
youcanretrievethenumberofremoteconsolesallowedbyavirtualmachinebyusingguestinforwith
theRemoteDisplay.maxConnectionsvariable.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx getguestinfo RemoteDisplay.maxConnections
TheHardeningGuideincludesadditionalinformationaboutvariablesyoucanuseinconjunctionwith
guestinfo.Acompletelistisnotavailable.
Thegetuptimeoptionretrievestheuptimeoftheguestoperatingsystemonthevirtualmachine,in
seconds.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx getuptime
getuptime() = 17921
Thegetproductinfo productoptionliststheVMwareproductthatthevirtualmachinerunson.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx getproductinfo product
VMware, Inc.
105
Thereturnvalueisesx(VMwareESX),embeddedESX(VMwareESXi),orunknown.
Thegetproductinfo platformoptionliststheplatformthatthevirtualmachinerunson.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx getproductinfo platform
Thereturnvalueiswin32-x86(x86basedWindowssystem),linux-x86(x86basedLinuxsystem),or
vmnix-x86(x86basedESXimicrokernel).
Thegetstateoptionretrievestheexecutionstateofthevirtualmachine,whichcanbeon,off,
suspended,orunknown.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx getstate
getstate() = on
ThegettoolslastactiveoptionindicateswhetherVMwareToolsisinstalledandwhethertheguest
operatingsystemisrespondingnormally.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx gettoolslastactive
Thecommandreturnsanintegerindicatinghowmuchtimehaspassed,inseconds,sincethelast
heartbeatwasdetectedfromtheVMwareToolsservice.Thisvalueisinitializedtozerowhenavirtual
machinepowerson.Thevaluestaysatzerountilthefirstheartbeatisdetected.Afterthefirstheartbeat,
thevalueisalwaysgreaterthanzerountilthevirtualmachineispowercycledagain.Thecommand
returnsoneofthefollowingvalues:
0VMwareToolsisnotinstalledornotrunning.
1Guestoperatingsystemisrespondingnormally.
5Intermittentheartbeat.Theremightbeaproblemwiththeguestoperatingsystem.
100Noheartbeat.Guestoperatingsystemmighthavestoppedresponding.
NOTEYouusuallyusethevmware-cmd guestinfooptiononlywhenVMwareSupportinstructsyoutodo
so.Thecommandisthereforenotdiscussedinthisdocument.
Memorystate.Contentsofthevirtualmachinesmemory.
Settingsstate.Virtualmachinesettings.
Diskstate.Stateofallthevirtualmachinesvirtualdisks.
Whenyoureverttoasnapshot,youreturntheseitemstothestatetheywereinatthetimethatyoutookthe
snapshot.Ifyouwantthevirtualmachinetoberunningortobeshutdownwhenyoustartit,makesurethat
itisinthatstatewhenyoutakethesnapshot.
Youcanusesnapshotsasrestorationpointswhenyouinstallupdatepackages,orduringabranchingprocess,
suchasinstallingdifferentversionsofaprogram.Takingsnapshotsensuresthateachinstallationbeginsfrom
anidenticalbaseline.ThevSphereVirtualMachineAdministrationdocumentationdiscussessnapshotsindetail.
IMPORTANTUsethevSphereWebClienttoreverttoanamedsnapshot.vmware-cmdonlysupportsreverting
tothecurrentsnapshot.
106
VMware, Inc.
(Optional)Ifthevirtualmachinehasmultipledisksindifferentdiskmodes,shutdownthevirtual
machine.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx stop soft
(Optional)Checkthattheshutdownoperationhasbeencompleted.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx getstate
Runvmware-cmdwiththecreatesnapshotoption.
Youmustspecifythedescription,quiesceflag(0or1)andmemoryflag(0or1).
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx createsnapshot VM1Aug09
test snapshot August 09 0 0
Checkthatthevirtualmachinehasasnapshotbyusingthehassnapshotoption.
Thecallreturns1ifthevirtualmachinehasasnapshotandreturns0otherwise.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx hassnapshot
hassnapshot () = 1
Runvmware-cmdwiththeremovesnapshotsoptiontoremoveallsnapshotsassociatedwithavirtual
machine.Ifnosnapshotexists,thecommanddoesnothing.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx removesnapshots
VMware, Inc.
107
Softpoweroperations.Whenyouspecifysoftasthepowerop_modevalue,theresultofthecalldepends
ontheoperation.
Operation
Result
Stop
vmware-cmdattemptstoshutdowntheguestoperatingsystemandpowersoffthevirtualmachine.
Reset
vmware-cmdattemptstoshutdowntheguestoperatingsystemandrebootsthevirtualmachine.
Suspend
vmware-cmdattemptstorunascriptintheguestoperatingsystembeforesuspendingthevirtual
machine.
Hardpoweroperations.vmware-cmdimmediatelyandunconditionallyshutsdown,resets,orsuspends
thevirtualmachine.
Thefollowingexamplesillustratehowtousevmware-cmd.
Start.Usethestartoptiontopoweronavirtualmachineortoresumeasuspendedvirtualmachine.The
powerop_mode,eitherhardorsoft,isrequired.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx start soft
Reset.Whenyouresetthevirtualmachinewiththesoftpower_opmode(thedefault),theguest
operatingsystemisshutdownbeforethereset.
IfVMwareToolsisnotcurrentlyinstalledonthevirtualmachine,youcanperformonlyahardreset
operation.
a
CheckthatVMwaretoolsisinstalledsothatyoucanresetthevirtualmachinewiththedefault
power_opmode,whichissoft.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx gettoolslastactive
SeeRetrievingVirtualMachineAttributesonpage 105.
b
Usetheresetoptiontoshutdownandrestartthevirtualmachine.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx reset soft
Suspend.Youhavetwooptionsforsuspendingavirtualmachine.
Thesuspendoptionwiththehardpoweropmodeunconditionallyshutsdownavirtualmachine.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx suspend hard
Thesuspendoptionwiththesoftpoweropmoderunsscriptsthatresultinagracefulshutdownof
theguestoperatingsystemandshutsdownthevirtualmachine.VMwareToolsmustbeinstalledfor
softpowerop_mode.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx suspend soft
Networkadapters
CD/DVDdrives
Floppydrives
Thesedevicesmustalreadybedefinedinthevirtualmachinevirtualhardwarelist.
108
VMware, Inc.
ThecommandoptionsconnectanddisconnectadefinedISOorFLPfileoraphysicaldeviceonthehost.After
youconnectadevice,itscontentcanbeaccessedfromtheGuestOS.Fornetworkadapters,theoptionsconnect
thevirtualNICtoitsdefinedportgroupordisconnecttheNIC.Thisisequivalenttoselectingordeselecting
theConnectedcheckboxinthevSphereWebClient.
NOTEThetermsCD/DVD drive,Floppy drive.andNetwork adapter arecasesensitive.
Youcanconnectordisconnectdevicesifthefollowingconditionsaremet:
Thevirtualmachinehasaguestoperatingsystemthatsupportshotplugfunctionality.SeetheOperating
SystemInstallationdocumentation.
Thevirtualmachineisusinghardwareversion7orlater.
Thevirtualmachineispoweredon
Thefollowingexamplesillustrateconnectinganddisconnectingavirtualdevice.Devicenamesarecase
sensitive.
TheconnectdeviceoptionconnectsthevirtualIDEdeviceCD/DVDDrive2tothespecifiedvirtual
machine.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx connectdevice "CD/DVD drive 2"
Thedisconnectdeviceoptiondisconnectsthevirtualdevice.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host>
/vmfs/volumes/Storage2/testvm/testvm.vmx disconnectdevice "CD/DVD drive 2"
Theuserclonesavirtualmachineandprovidesthedefaultvirtualdisktype.
Whentheuserpowersonthevirtualmachine,itpromptsforthedesiredvirtualdisktype.
ListallrunningvirtualmachinesonthesystemtoseetheWorldIDofthevirtualmachinethatyouwant
tostop.
esxcli <conn_options> vm process list
Stopthevirtualmachinebyrunningthefollowingcommand.
esxcli <conn_options> vm process kill --type <kill_type> --world-id <ID>
Thecommandsupportsthree--typeoptions.Trythetypessequentially(softbeforehard,hardbefore
force).Thefollowingtypesaresupportedthroughthe--typeoption:
VMware, Inc.
soft.GivestheVMXprocessachancetoshutdowncleanly(likekillorkill -SIGTERM)
109
force.StopstheVMXprocesswhenotheroptionsdonotwork.
Ifallthreeoptionsdonotwork,rebootyourESXihosttoresolvetheissue.
110
VMware, Inc.
ThevSphereCLInetworkingcommandsallowyoutomanagethevSpherenetworkservices.Youcanconnect
virtualmachinestothephysicalnetworkandtoeachotherandconfigurevSpherestandardswitches.Limited
configurationofvSpheredistributedswitchesisalsosupported.YoucanalsosetupyourvSphere
environmenttoworkwithexternalnetworkssuchasSNMPorNTP.
Thischapterincludesthefollowingtopics:
IntroductiontovSphereNetworkingonpage 111
RetrievingBasicNetworkingInformationonpage 113
NetworkTroubleshootingonpage 114
SettingUpvSphereNetworkingwithvSphereStandardSwitchesonpage 115
SettingUpvSphereNetworkingwithvSphereDistributedSwitchonpage 126
ManagingStandardNetworkingServicesinthevSphereEnvironmentonpage 126
SettingtheDNSConfigurationonpage 126
AddingandStartinganNTPServeronpage 129
ManagingtheIPGatewayonpage 129
SettingUpIPseconpage 130
ManagingtheESXiFirewallonpage 133
Whentwoormorevirtualmachinesareconnectedtothesamevirtualswitch,andthosevirtualmachines
arealsoonthesameportgrouporVLAN,networktrafficbetweenthemisroutedlocally.
Whenvirtualmachinesareconnectedtoavirtualswitchthatisconnectedtoanuplinkadapter,each
virtualmachinecanaccesstheexternalnetworkthroughthatuplink.Theadaptercanbeanuplink
connectedtoastandardswitchoradistributeduplinkportconnectedtoadistributedswitch.
VirtualswitchesallowyourESXihosttomigratevirtualmachineswithVMwarevMotionandtouseIPstorage
throughVMkernelnetworkinterfaces.
VMware, Inc.
UsingvMotion,youcanmigraterunningvirtualmachineswithnodowntime.YoucanenablevMotion
withvicfg-vmknic --enable-vmotion.YoucannotenablevMotionwithESXCLI.
111
IPstoragereferstoanyformofstoragethatusesTCP/IPnetworkcommunicationasitsfoundationand
includesiSCSIandNFSforESXi.Becausethesestoragetypesarenetworkbased,theycanusethesame
VMkernelinterfaceandportgroup.
ThenetworkservicesthattheVMkernelprovides(iSCSI,NFS,andvMotion)useaTCP/IPstackinthe
VMkernel.TheVMkernelTCP/IPstackisalsoseparatefromtheguestoperatingsystemsnetworkstack.Each
ofthesestacksaccessesvariousnetworksbyattachingtooneormoreportgroupsononeormorevirtual
switches.
VM
VM
VM
VM
Network
C
port
groups
Host1
Host1
physical network adapters
Host2
virtual
Host2 physical
physical network
Figure 91showstherelationshipbetweenthephysicalandvirtualnetworkelements.Thenumbersmatch
thoseinthefigure.
112
AssociatedwitheachESXihostareoneormoreuplinkadapters(1).Uplinkadaptersrepresentthe
physicalswitchestheESXihostusestoconnecttothenetwork.Youcanmanageuplinkadaptersusingthe
esxcli network nicorvicfg-nicsvCLIcommand.SeeManagingUplinkAdaptersonpage 120.
Eachuplinkadapterisconnectedtoastandardswitch(2).Youcanmanageastandardswitchand
associateitwithuplinkadaptersbyusingtheesxcli network vswitchorvicfg-vswitchvCLI
command.SeeSettingUpVirtualSwitchesandAssociatingaSwitchwithaNetworkInterfaceon
page 115.
Associatedwiththestandardswitchareportgroups(3).Portgroupisauniqueconceptinthevirtual
environment.Youcanconfigureportgroupstoenforcepoliciesthatprovideenhancednetworking
security,networksegmentation,betterperformance,highavailability,andtrafficmanagement.Youcan
usetheesxcli network vswitch standard portgrouporvicfg-vswitchcommandtoassociatea
standardswitchwithaportgroup,andtheesxcli network ip interfaceorvicfg-vmkniccommand
toassociateaportgroupwithaVMkernelnetworkinterface.
TheVMkernelTCP/IPnetworkingstacksupportsiSCSI,NFS,andvMotionandhasanassociated
VMkernelnetworkinterface.YouconfigureVMkernelnetworkinterfaceswithesxcli network ip
interfaceorvicfg-vmknic.SeeAddingandModifyingVMkernelNetworkInterfacesonpage 123.
SeparateVMkernelnetworkinterfacesareoftenusedforseparatetasks,forexample,youmightdevote
oneVMkernelNetworkinterfacecardtovMotiononly.VirtualmachinesruntheirownsystemsTCP/IP
stacksandconnecttotheVMkernelattheEthernetlevelthroughvirtualswitches.
VMware, Inc.
VM
VM
VM
VM
Network
C
distributed port group
A
uplink
uplink
Host1
Host2
virtual
Host2 physical
physical network
Eachphysicalnetworkadapter(1)onthehostispairedwithadistributeduplinkport(2),which
representstheuplinktothevirtualmachine.Withdistributedswitches,thevirtualmachinenolonger
dependsonthehostsphysicaluplinkbutonthe(virtual)uplinkport.Youmanageauplinkports
primarilyusingthevSphereWebClient,orvSphereAPIs.
Thedistributedswitchitself(3)functionsasasinglevirtualswitchacrossallassociatedhosts.Becausethe
switchisnotassociatedwithasinglehost,virtualmachinescanmaintainconsistentnetwork
configurationastheymigratefromonehosttoanother.
Likeastandardswitch,eachdistributedswitchisanetworkhubthatvirtualmachinescanuse.A
distributedswitchcanroutetrafficinternallybetweenvirtualmachinesorlinktoanexternalnetworkby
connectingtophysicalnetworkadapters.YoucreateadistributedswitchusingthethevSphereWeb
ClientUI,butcanmanagesomeaspectsofadistributedswitchwithvicfg-vswitch.Youcanlist
distributedvirtualswitcheswiththeesxcli network vswitchcommand.SeeSettingUpVirtual
SwitchesandAssociatingaSwitchwithaNetworkInterfaceonpage 115.
<conn_options>
<conn_options>
<conn_options>
<conn_options>
network
network
network
network
ip
ip
ip
ip
interface
interface
interface
interface
list
ipv4 get -n vmk<X>
ipv6 get -n vmk<X>
ipv6 address list
ForinformationcorrespondingtotheLinuxnetstatcommand,usethefollowingESXCLIcommand.
esxcli <conn_options> network ip connection list
VMware, Inc.
113
Network Troubleshooting
YoucanusevCLInetworkcommandstoviewnetworkstatisticsandtroubleshootyournetworkingsetup.The
nestedhierarchyofcommandsallowsyoutodrilldowntopotentialtroublespots.
1
Listallvirtualmachinenetworksonahost.
esxcli network vm list
ThecommandreturnsforeachvirtualmachinetheWorldID,name,numberofports,andnetworks,asin
thefollowingexample.
World ID Name
Num Ports Networks
---------------------------------------------------10374 ubuntu-server-11.04-1
2 VM Network,
10375 ubuntu-server-11.04-2
2 VM Network,
10376 ubuntu-server-11.04-3
2 VM Network,
10408 ubuntu-server-11.04-4
3 VM Network,
dvportgroup-19
dvportgroup-19
dvportgroup-19
VM Network 10Gbps, dvportgroup-19
ListtheportsforoneoftheVMsbyspecifyingitsWorldID.
esxcli network vm port list -w 10408
Thecommandreturnsportinformation,asinthefollowingexample.
Port:
Port ID: XXXXXXXX
vSwitch: vSwitch0
Portgroup: VM Network
DVPort ID:
MAC Address: 00:XX:XX:aa:XX:XX
IP Address: 10.XXX.XXX.XXX
Team Uplink: vmnic0
Uplink Port ID: 12345678
Active Filters:
Retrievetheswitchstatisticsforaport.
esxcli network port stats get -p 12345678
Thecommandreturnsdetailedstatistics,asinthefollowingexample.
Packet statistics for port 12345678:
Packets received: 517631
Packets sent: 18937
Bytes received: 100471874
Bytes sent: 1527233
Broadcast packets received: 474160
Broadcast packets sent: 107
Multicast packets received: 8020
Multicast packets sent: 8
Unicast packets received: 35451
Unicast packets sent: 18822
Receive packets dropped: 45
Transmit packets dropped: 0
Retrievethefilterinformationfortheport.
esxcli network port filter stats get -p 12345678
Thecommandreturnsdetailedstatistics,asinthefollowingexample.
Filter statistics for dvfilter-test:
Filter direction: Receive
Packets in: 202080
Packets out: 202080
Packets dropped: 0
114
VMware, Inc.
Packets filtered: 0
Packets faulted: 0
Packets queued: 0
Packets injected: 0
Packet errors: 0
RetrievecompletestatisticsforaNIC.
esxcli network nic stats get -n vmnic0
GetaperVLANpackedbreakdownonaNIC.
esxcli network nic vlan stats get -n vmnic0
ThecommandreturnsthenumberofpacketssentandreceivedfortheVLANyouspecified.
10
11
YoucanconnectonevirtualmachinenetworkadaptertoeachportbyusingthevSphereWebClientUI.
Youcanconnecttheuplinkadaptertothevirtualswitchesbyusingvicfg-vswitchoresxcli network
vswitch standard uplink.SeeLinkingandUnlinkingUplinkAdapterswithvicfgvswitchon
page 122.
Whentwoormorevirtualmachinesareconnectedtothesamevirtualswitch,networktrafficbetweenthemis
routedlocally.Ifanuplinkadapterisattachedtothevirtualswitch,eachvirtualmachinecanaccessthe
externalnetworkthattheadapterisconnectedto.
Thissectiondiscussesworkinginastandardswitchenvironment.SeeNetworkingUsingvSphere
DistributedSwitchesonpage 113forinformationaboutdistributedswitchenvironments.
VMware, Inc.
115
Whenworkingwithvirtualswitchesandportgroups,performthefollowingtasks:
1
Findoutwhichvirtualswitchesareavailableand(optionally)whattheassociatedMTUandCDP(Cisco
DiscoveryProtocol)settingsare.SeeRetrievingInformationaboutVirtualSwitcheswithESXCLIon
page 116andRetrievingInformationaboutVirtualSwitcheswithvicfgvswitchonpage 116.
Addavirtualswitch.SeeAddingandDeletingVirtualSwitcheswithESXCLIonpage 117andAdding
andDeletingVirtualSwitcheswithvicfgvswitchonpage 117.
Foranewlyaddedswitch,performthesetasks:
a
Addaportgroup.SeeManagingPortGroupswithESXCLIonpage 118andManagingPort
Groupswithvicfgvswitchonpage 118.
(Optional)SettheportgroupVLANID.SeeSettingthePortGroupVLANIDwithESXCLIon
page 119andSettingthePortGroupVLANIDwithvicfgvswitchonpage 120.
Addanuplinkadapter.SeeLinkingandUnlinkingUplinkAdapterswithESXCLIonpage 122and
LinkingandUnlinkingUplinkAdapterswithvicfgvswitchonpage 122.
(Optional)ChangetheMTUorCDPsettings.SeeSettingSwitchAttributeswithesxclinetwork
vswitchstandardonpage 117andSettingSwitchAttributeswithvicfgvswitchonpage 118.
Listallvirtualswitchesandassociatedportgroups.
esxcli <conn_options> network vswitch standard list
Thecommandprintsinformationaboutthevirtualswitch,whichmightincludeitsname,numberof
ports,MTU,portgroups,andotherinformation.TheoutputincludesinformationaboutCDPsettingsfor
thevirtualswitch.Thepreciseinformationdependsonthetargetsystem.Thedefaultportgroupsare
Management NetworkandVM Network.
Listthenetworkpolicysettings(securitypolicy,trafficshapingpolicy,andfailoverpolicy)forthevirtual
switch.Thefollowingcommandsaresupported.
esxcli <conn_options> network vswitch standard policy failover get
esxcli <conn_options> network vswitch standard policy security get
esxcli <conn_options> network vswitch standard policy shaping get
CheckwhethervSwitch1exists.
vicfg-vswitch <conn_options> -c vSwitch1
Listallvirtualswitchesandassociatedportgroups.
vicfg-vswitch <conn_options> -l
Thecommandprintsinformationaboutthevirtualswitch,whichmightincludeitsname,numberof
ports,MTU,portgroups,andotherinformation.ThedefaultportgroupsareManagement Networkand
VM Network.
116
RetrievethecurrentCDP(CiscoDiscoveryProtocol)settingforthisvirtualswitch.
VMware, Inc.
IfCDPisenabledonavirtualswitch,ESXiadministratorscanfindoutwhichCiscoswitchportis
connectedtowhichvirtualswitchuplink.CDPisalinklevelprotocolthatsupportsdiscoveryof
CDPawarenetworkhardwareateitherendofadirectconnection.CDPisbitforwardedthrough
switches.CDPisasimpleadvertisementprotocolwhichbeaconsinformationabouttheswitchorhostand
someportinformation.
vicfg-vswitch <conn_options> --get-cdp vSwitch1
Addavirtualswitch.
esxcli <conn_options> network vswitch standard add --vswitch-name=vSwitch42
Youcanspecifythenumberofportgroupswhileaddingthevirtualswitch.Ifyoudonotspecifyavalue,
thedefaultvalueisused.Thesystemwideportcountcannotbegreaterthan4096.
esxcli <conn_options> network vswitch standard add --vswitch-name=vSwitch42 --ports=8
Afteryouhaveaddedavirtualswitch,youcansetswitchattributes(SettingSwitchAttributeswithesxcli
networkvswitchstandardonpage 117)andaddoneormoreuplinkadapters(LinkingandUnlinking
UplinkAdapterswithESXCLIonpage 122).
Deleteavirtualswitch.
esxcli <conn_options> network vswitch standard remove --vswitch-name=vSwitch42
YoucannotdeleteavirtualswitchifanyportsontheswitcharestillinusebyVMkernelnetworksor
virtualmachines.Runesxcli network vswitch standard list todeterminewhetheravirtualswitch
isinuse.
Addavirtualswitch.
vicfg-vswitch <conn_options> --add vSwitch2
Afteryouhaveaddedavirtualswitch,youcansetswitchattributes(SettingSwitchAttributeswith
vicfgvswitchonpage 118)andaddoneormoreuplinkadapters(LinkingandUnlinkingUplink
Adapterswithvicfgvswitchonpage 122).
Deleteavirtualswitch.
vicfg-vswitch <conn_options> --delete vSwitch1
YoucannotdeleteavirtualswitchifanyportsontheswitcharestillinusebyVMkernelnetworks,virtual
machines,orvswifs.Runvicfg-vswitch --listtodeterminewhetheravirtualswitchisinuse.
SettheMTUforavSwitch.
esxcli <conn_options> network vswitch standard set --mtu=9000 --vswitch-name=vSwitch1
VMware, Inc.
117
TheMTUisthesize,inbytes,ofthelargestprotocoldataunittheswitchcanprocess.Whenyousetthis
option,itaffectsalluplinksassignedtothevirtualswitch.
SettheCDPvalueforavSwitch.Youcansetstatustodown,listen,advertise,orboth.
esxcli <conn_options> network vswitch standard set --cdp-status=listen
--vswitch-name=vSwitch1
SettheMTUforavSwitch.
vicfg-vswitch <conn_options> -m 9000 vSwitch1
TheMTUisthesize(inbytes)ofthelargestprotocoldataunittheswitchcanprocess.Whenyousetthis
option,itaffectsalluplinksassignedtothevirtualswitch.
SettheCDPvalueforavSwitch.Youcansetstatustodown,listen,advertise,orboth.
vicfg-vswitch <conn_options> --set-cdp listen
Listportgroupscurrentlyassociatedwithavirtualswitch.
esxcli <conn_options> network vswitch standard portgroup list
Liststheportgroupname,associatedvirtualswitch,activeclients,andVLANID.
Addaportgroup.
esxcli <conn_options> network vswitch standard portgroup add --portgroup-name=<name>
--vswitch-name=vSwitch1
Deleteoneoftheexistingportgroups.
esxcli <conn_options> network vswitch standard portgroup remove --portgroup-name=<name>
--vswitch-name=vSwitch1
Checkwhetherportgroupsarecurrentlyassociatedwithavirtualswitch.
vicfg-vswitch <conn_options> --check-pg <port_group> vSwitch1
Thecommandreturns0ifthespecifiedportgroupisassociatedwiththevirtualswitch,andreturns1
otherwise.Usevicfg-vswitch --listtolistallportgroups.
118
VMware, Inc.
Addaportgroup.
vicfg-vswitch <conn_options> --add-pg <port_group_name> vSwitch1
Deleteoneoftheexistingportgroups.
vicfg-vswitch <conn_options> --del-pg <port_group_name> vSwitch1
Connecting and Disconnecting Uplink Adapters and Port Groups with ESXCLI
Ifyoursetupincludesoneormoreportgroups,youcanassociateeachportgroupwithoneormoreuplink
adapters(andremovetheassociation).Thisfunctionalityallowsyoutofiltertrafficfromaportgrouptoa
specificuplink,evenifthevirtualswitchisconnectedwithmultipleuplinks.Specifyoneoftheoptionslisted
inConnectionOptionsonpage 17inplaceof<conn_options>.
Connectaportgroupwithanuplinkadapter.
esxcli <conn_options> network vswitch standard portgroup policy failover set
--active-uplinks=vmnic1,vmnic6,vmnic7
Thiscommandfailssilentlyiftheuplinkadapterdoesnotexist.
Makesomeoftheadaptersstandbyinsteadofactive.
esxcli <conn_options> network vswitch standard portgroup policy failover set
--standby-uplinks=vmnic1,vmnic6,vmnic7
Connectaportgroupwithanuplinkadapter.
vicfg-vswitch <conn_options> --add-pg-uplink <adapter_name> --pg <port_group> <vswitch_name>
Thiscommandfailssilentlyiftheuplinkadapterdoesnotexist.
Removeaportgroupfromanuplinkadapter.
vicfg-vswitch <conn_options> --del-pg-uplink <adapter_name> --pg <port_group> <vswitch_name>
SettheVLANIDto4095toallowaportgrouptoreachportgroupslocatedonotherVLAN.
SettheVLANIDto0todisabletheVLANforthisportgroup.
IfyouuseVLANIDs,youmustchangetheportgrouplabelsandVLANIDstogethersothatthelabels
properlyrepresentconnectivity.VLANIDsareoptional.
YoucanusethefollowingcommandsforVLANmanagement:
VMware, Inc.
AllowportgroupstoreachportgroupslocatedonotherVLANs.
119
esxcli <conn_options> network vswitch standard portgroup set -p <pg_name> --vlan-id 4095
CallthecommandmultipletimestoallowallportstoreachportgroupslocatedonotherVLANs.
DisableVLANforportgroupg42
esxcli <conn_options> network vswitch standard portgroup set --vlan-id 0 -p <pg_name>
SettheVLANIDto4095toallowaportgrouptoreachportgroupslocatedonotherVLAN.
SettheVLANIDto0todisabletheVLANforthisportgroup.
IfyouuseVLANIDs,youmustchangetheportgrouplabelsandVLANIDstogethersothatthelabels
properlyrepresentconnectivity.VLANIDsareoptional.
YoucanusethefollowingcommandsforVLANmanagement:
AllowallportgroupstoreachportgroupslocatedonotherVLANs.
vicfg-vswitch <conn_options> --vlan 4095 --pg ALL vSwitch2
DisableVLANforportgroupg42.
vicfg-vswitch <conn_options> --vlan 0 --pg g42 vSwitch2
Runvicfg-vswitch -ltoretrieveinformationaboutVLANIDscurrentlyassociatedwiththevirtual
switchesinthenetwork.
Runesxcli network vswitch standard portgroup listtolistallportgroupsandassociatedVLANIDs.
Listalluplinksandinformationabouteachdevice.
esxcli <conn_options> network nic list
(Optional)Bringdownoneoftheuplinkadapters.
esxcli <conn_options> network nic down --nic-name=vmnic0
Changeuplinkadaptersettings.
esxcli <conn_options> network nic set <option>
120
VMware, Inc.
Specifyoneofthefollowingoptions.
-a|--auto
Setthespeedandduplexsettingstoautonegotiate.
-D|--duplex=<str>
DuplextosetthisNICto.Acceptablevaluesarefullandhalf.
-P | --phy-address
SettheMACaddressofthedevice
-l|--message-level=<long>
Setthedrivermessagelevel.Messagelevelsandwhattheyimplydifferper
driver.
-n|--nic-name=<str>
NameoftheNICtoconfigured.Mustbeoneofthecardslistedinthenic list
command(required).
-p|--port=<str>
Selectsthedeviceport.Thefollowingdeviceportsareavailable.
auiSelectauiasthedeviceport
bncSelectbncasthedeviceport
fibreSelectmiiasthedeviceport
miiSelectmiiasthedeviceport
tpSelecttpasthedeviceport
-S|--speed=<long>
SpeedtosetthisNICto.Acceptablevaluesare10,100,1000,and10000.
-t|--transceiver-type=<str>
Selecttransceivertype.Thefollowingtransceivertypesareavailable.
-w|--wake-on-lan=<str>
externalSetthetransceivertypetoexternal
internalSetthetransceivertypetointernal
SetWake-on-LANoptions.Notalldevicessupportthisoption.Theoptionvalue
isastringofcharactersspecifyingwhichoptionstoenable.
pWakeonphyactivity
uWakeonunicastmessages
mWakeonmulticastmessages
bWakeonbroadcastmessages
aWakeonARP
gWakeonMagicPacket
sEnableSecureOnpasswordforMagicPacket
(Optional)Bringtheuplinkadapterbackup.
esxcli <conn_options> network nic up --nic-name=vmnic0
Theportgroupnicarrayis[vmnic1,vmnic0,vmnic3,vmnic5,vmnic6,vmnic7]andactive-uplinksis
settothreeuplinks(vmnic1,vmnic0,vmnic3).Theotheruplinksarestandbyuplinks.
Yousettheactiveuplinkstoanewset[vmnic3,vmnic5].
Thenewuplinksoverridetheoldset.TheNICarraychangesto[vmnic3,vmnic5,vmnic6,vmnic7].
vmnic0andvmnic1areremovedfromtheNICarrayandmax-activebecomes2.
Ifyouwanttokeepvmnic0andvmnic1inthearray,youcanmakethoseNICsstandbyuplinksinthe
commandthatchangestheactiveuplinks.
esxcli network vswitch standard portgroup policy failover set -p testPortgroup --active-uplinks
vmnic3,vmnic5 --standby-uplinks vmnic1,vmnic0,vmnic6,vmnic7
VMware, Inc.
121
Listsettings.
vicfg-nics <conn_options> -l
Liststheuplinksinthesystem,theircurrentandconfiguredspeed,andtheirduplexsetting.
2
Setthesettingsforvmnic0tofullandthespeedto100.
vicfg-nics <conn_options> -d full -s 100 vmnic0
Setvmnic2toautonegotiateitsspeedandduplexsettings.
vicfg-nics <conn_options> -a vmnic2
Listuplinkadapters.
esxcli <conn_options> network vswitch standard list
TheuplinkadaptersarereturnedintheUplinkitem.
Addanewuplinkadaptertoavirtualswitch.
esxcli <conn_options> network vswitch standard uplink add --uplink-name=vmnic15
vswitch-name=vSwitch0
Removeanuplinkadapterfromavirtualswitch.
esxcli <conn_options> network vswitch standard uplink remove --uplink-name=vmnic15
vswitch-name=vSwitch0
VMware, Inc.
Addanewuplinkadaptertoavirtualswitch.
vicfg-vswitch <conn_options> --link vmnic15 vSwitch0
Removeanuplinkadapterfromavirtualswitch.
vicfg-vswitch <conn_options> --unlink vmnic15 vSwitch0
AddanewVMkernelnetworkinterface.
esxcli <conn_options> network ip interface add --interface-name=vmk<x>
--portgroup-name=<my_portgroup>
YoucanspecifytheMTUsettingafteryouhaveaddedthenetworkinterfacebyusingesxcli network
ip interface set --mtu.
2
ConfiguretheinterfaceasanIPv4interface.YoumustspecifytheIPaddressusing--ip,thenetmask,and
thename.Forthefollowingexamples,assumethatVMSFVMK363isaportgrouptowhichyouwantto
addaVMkernelnetworkinterface.
esxcli <conn_options> network ip interface ipv4 set --ipv4=<ip_address>
--netmask=255.255.255.0 --interface-name=vmk<X>
Youcansettheaddressasfollows.
<X.X.X.X>StaticIPv4address.
DHCPUseIPv4DHCP.
TheVMkernelsupportsDHCPonlyforESXi4.0andlater.
Whenthecommandfinishessuccessfully,thenewlyaddedVMkernelnetworkinterfaceisenabled.
3
ListinformationaboutallVMkernelnetworkinterfacesonthesystem.
esxcli <conn_options> network ip interface list
VMware, Inc.
123
Thecommanddisplaysthenetworkinformation,portgroup,MTU,andcurrentstateforeachvirtual
networkadapterinthesystem.
YoucanaddandconfigureanIPv6VMkernelNICwithESXCLI.
To add and configure a VMkernel Network Interface for IPv6
1
YoucanspecifytheMTUsettingafteryouhaveaddedthenetworkinterfacebyusingesxcli network
ip interface set --mtu.
Whenthecommandfinishessuccessfully,thenewlyaddedVMkernelnetworkinterfaceisenabled.
2
Youcansettheaddressasfollows.
<X:X:X::/X>:StaticIPv6address
--enable-dhcpv6:EnablesDHCPv6onthisinterfaceandattemptstoacquireanIPv6addressfrom
thenetwork.
--enable-router-adv:UsetheIPv6addressadvertisedbytherouter.Theaddressisaddedwhen
theroutersendsthenextrouteradvert.
TheVMkernelsupportsDHCPonlyforESXi4.0andlater.
Whenthecommandcompletessuccessfully,thenewlyaddedVMkernelnetworkinterfaceisenabled.
3
ListinformationaboutallVMkernelnetworkinterfacesonthesystem.
esxcli <conn_options> network ip interface list
Thelistcontainsthenetworkinformation,portgroup,MTU,andcurrentstateforeachVMkernel
NetworkInterfaceonthesystem.
4
YoucanlaterremovetheIPv6addressanddisableIPv6.
esxcli <conn_options> network ip interface ipv6 address remove --interface-name=<VMK_NIC>
--ipv6=<ipv6_addr>
esxcli <conn_options> network ip set --ipv6-enabled=false
Runvicfg-vmknic --addtoaddaVMkernelnetworkinterface.
YoumustspecifytheIPaddressbyusing--ip,thenetmask,andthename.Forthefollowingexamples,
assumethatVMSFVMK363isaportgrouptowhichyouwanttoaddaVMkernelnetworkinterface.
vicfg-vmknic <conn_options> --add --ip <ip_address> -n 255.255.255.0 VMSF-VMK-363
YoucanspecifytheMTUsettingwhenaddingaVMkernelnetworkinterface.Youcannotchangethat
settingatalatertime.
Whenthecommandcompletessuccessfully,thenewlyaddedVMkernelnetworkinterfaceisenabled.
124
VMware, Inc.
ChangetheIPaddressasneeded.
vicfg-vmknic <conn_options> --ip <address> VMSF-VMK-363
ForIPv4,chooseoneofthefollowingformats:
<X.X.X.X>StaticIPv4address.
DHCPUseIPv4DHCP.
TheVMkernelsupportsDHCPonlyforESXi4.0andlater.
3
(Optional)EnablevMotion.
Bydefault,vMotionisdisabled.
vicfg-vmknic <conn_options> --enable-vmotion VMSF-VMK-363
Youcanlateruse--disable-vmotiontodisablevMotionforthisVMkernelnetworkinterface.
4
ListinformationaboutallVMkernelnetworkinterfacesonthesystem.
vicfg-vmknic <conn_options> --list
Thecommanddisplaysthenetworkinformation,portgroup,MTU,andcurrentstateforeachvirtual
networkadapterinthesystem.
To add and configure an IPv6 VMkernel Network Interface with vicfg-vmknic
1
Runvicfg-vmknic --addtoaddaVMkernelnetworkinterface.
YoumustspecifytheIPaddressbyusing--ip,thenetmask,andtheportgroupname.Forthefollowing
examples,assumethatVMSFVMK363isaportgrouptowhichyouwanttoaddaVMkernelnetwork
interface.
YoucanspecifytheMTUsettingwhenyouaddaVMkernelnetworkinterface.Youcannotchangethat
settingatalatertime.
Whenthecommandcompletessuccessfully,thenewlyaddedVMkernelnetworkinterfaceisenabled.
EnableIPv6.
vicfg-vmknic <conn_options> --enable-ipv6 true VMSF-VMK-363
SupplyanIPv6address.
vicfg-vmknic <conn_options> --ip <ip_address> VMSF-VMK-363
ForIPv6,theIPaddresscanhaveoneofthefollowingformats:
<X:X:X::/X>StaticIPv6address
DHCPV6UseDHCPIPv6address.TheVMkernelsupportsDHCPonlyforESX/ESXi4.0andlater.
AUTOCONFUsetheIPv6addressadvertisedbytherouter.IfyoucreateaVMkernelnetworkinterface
withAUTOCONF,anaddressisassignedimmediately.IfyouaddAUTOCONFtoanexisting
vmknic,theaddressisaddedwhentheroutersendsthenextrouteradvert.
(Optional)EnablevMotion.
Bydefault,vMotionisdisabled.
vicfg-vmknic <conn_options> --enable-vmotion VMSF-VMK-363
Youcanlateruse--disable-vmotiontodisablevMotionagain.
5
ListinformationaboutallVMkernelnetworkinterfacesonthesystem.
vicfg-vmknic <conn_options> --list
Thelistcontainsthenetworkinformation,portgroup,MTU,andcurrentstateforeachvirtualnetwork
adapterinthesystem.
6
VMware, Inc.
YoucanlaterremovetheIPv6addressanddisableIPv6.
125
Addanuplinkport.
vicfg-vswitch <conn_options> --add-dvp-uplink <adapter_name> --dvp <DVPort_id>
<dvswitch_name>
Removeanuplinkport.
vicfg-vswitch <conn_options> --del-dvp-uplink <adapter> --dvp <DVPort_id> <dvswitch_name>
126
VMware, Inc.
InnetworkenvironmentswhereaDHCPserverandaDNSserverareavailable,ESXihostsareautomatically
assignedDNSnames.
InnetworkenvironmentswhereautomaticDNSisnotavailableoryoudonotwanttouseautomaticDNS,you
canconfigurestaticDNSinformation,includingahostname,primarynameserver,secondarynameserver,
andDNSsuffixes.
Theesxcli network ip dnsnamespaceincludestwonamespaces.
ThefollowingexampleillustratessettingupaDNSserver.SpecifyoneoftheoptionslistedinConnection
Optionsonpage 17inplaceof<conn_options>.
To set up a DNS Server
1
PrintalistofDNSserversconfiguredonthesystemintheorderinwhichtheywillbeused.
esxcli <conn_options> network ip dns server list
IfDNSisnotsetupforthetargetserver,thecommandreturnsanemptystring.
2
SpecifytheDNSserverusingthe--dnsoptionandtheDNShost.
esxcli <conn_options> network ip dns server add --server=<server>
RunthecommandmultipletimestospecifymultipleDNShosts.
ConfiguretheDNShostnamefortheserverspecifiedby--server(or--vihost).
esxcli <conn_options> system hostname set --host=<new_host_name>
ConfiguretheDNSdomainnamefortheserverspecifiedby--server(or--vihost).
esxcli <conn_options> system hostname --domain=mydomain.biz
ToturnonDHCP,enableDHCPandsettheVMkernelNIC.
TurnonDHCPforIPv4
TurnonDHCPforIPv6
DisplayDNSpropertiesforthespecifiedserverasfollows:
Listthehostanddomainname.
esxcli <conn_options> system hostname get
ListavailableDNSservers
esxcli <conn_options> network ip dns server list
ListtheDHCPsettingsforindividualVMkernelNICs.
esxcli <conn_options> network ip interface ipv4 get
esxcli <conn_options> network ip interface ipv6 get
VMware, Inc.
127
IftheDNSpropertiesareset,andyouwanttochangetheDHCPsettings,youmustspecifythevirtual
networkadaptertousewhenoverridingthesystemDNS.OverridetheexistingDHCPsettingasfollows:
esxcli <conn_options> network ip interface ipv4 set --type dhcp/none/static
esxcli <conn_options> network ip interface ipv6 set --enable-dhcpv6=true/false
Runvicfg-dnswithoutcommandspecificoptionstodisplayDNSpropertiesforthespecifiedserver.
vicfg-dns <conn_options>
IfDNSisnotsetupforthetargetserver,thecommandreturnsanerror.
2
Tochangethesettings,usevicfg-dnswith--dns,--domain,or--hostname.
SpecifytheDNSserverbyusingthe--dnsoptionandacommaseparatedlistofhosts,inorderof
preference.
vicfg-dns <conn_options --dns <dns1,dns2>
ConfiguretheDNShostnamefortheserverspecifiedby--server(or--vihost).
vicfg-dns <conn_options> -n dns_host_name
ConfiguretheDNSdomainnamefortheserverspecifiedby--server(or--vihost).
vicfg-dns <conn_options> -d mydomain.biz
ToturnonDHCP,usethe--DHCPoption.
vicfg-dns <conn_options> --dhcp yes
Runvicfg-dnswithoutcommandspecificoptionstodisplayDNSpropertiesforthespecifiedserver.
vicfg-dns <conn_options>
Theinformationincludesthehostname,domainname,DHCPsetting(trueorfalse),andDNSserverson
theESXihost.
2
IftheDNSpropertiesareset,andyouwanttochangetheDHCPsettings,youmustspecifythevirtual
networkadaptertousewhenoverridingthesystemDNS.v_nicmustbeoneoftheVMkernelnetwork
adapters.
OverridetheexistingDHCPsettingasfollows:
vicfg-dns <conn_options> --dhcp yes --v_nic <vnic>
128
VMware, Inc.
Runvicfg-ntp--add toaddanNTPservertothehostspecifiedin<conn_options>anduseahostname
orIPaddresstospecifyanalreadyrunningNTPserver.
vicfg-ntp <conn_options> -a 192.XXX.XXX.XX
Runvicfg-ntp --starttostarttheservice.
vicfg-ntp <conn_options> --start
Runvicfg-ntp --listtolisttheservice.
vicfg-ntp <conn_options> --list
Runvicfg-ntp --stoptostoptheservice.
vicfg-ntp <conn_options> --stop
Runvicfg-ntp --deletetoremovethespecifiedNTPserverfromthehostspecifiedin<conn_options>.
vicfg-ntp <conn_options> --delete 192.XXX.XXX.XX
AddarouteentrytotheVMkernelandmakeitthedefault.
ForIPv4networks,noadditionaloptionsarerequired.
vicfg-route <conn_options> --add <network_ip> <netmask_IP> <gateway_ip>
Forexample,toaddarouteto192.XXX.100.0through192.XXX.0.1:
vicfg-route <conn_options> -a 192.XXX.100.0/24 192.XXX.0.1
or
vicfg-route <conn_options> -a 192.XXX.100.0 255.255.255.0 192.XXX.0.1
ForIPv6networks,use--family v6
vicfg-route <conn_options> -f V6 --add <network_ip_and_mask> <gateway_ip>
Forexample:
vicfg-route <conn_options> -f V6 --add 2001:10:20:253::/64 2001:10:20:253::1
VMware, Inc.
Listrouteentriestocheckthatyourroutewasaddedbyrunningthecommandwithoutoptions.
129
vicfg-route <conn_options>
Theoutputlistsallnetworksandcorrespondingnetmasksandgateways.
3
Setthedefaultgateway.
ForIPv4,usethissyntax:
vicfg-route <conn_options> 192.XXX.0.1
or
vicfg-route <conn_options> -a default 192.XXX.0.1
ForIPv6,usethissyntax:
vicfg-route <conn_options> -f V6 -a default 2001:10:20:253::1
Runvicfg-route --deletetodeletetheroute.Specifyfirstthegateway,andthenthenetwork.
vicfg-route <conn_options> -d 192.XXX.100.0/24 192.XXX.0.1
Setting Up IPsec
YoucansetInternetProtocolSecuritywithesxcli network ip ipseccommandsorwiththevicfg-ipsec
command.whichsecuresIPcommunicationscomingfromandarrivingatESXihosts.Administratorswho
performIPsecsetupmusthaveasolidunderstandingofbothIPv6and IPsec.
ESXihostssupportIPseconlyforIPv6traffic,butnotforIPv4traffic.
IMPORTANTInESX/ESXi4.1,ESXi5.0,andESXi5.1,IPv6isbydefaultdisabled.YoucanturnonIPv6by
runningoneofthefollowingvCLIcommands:
esxcli <conn_options> network ip interface ipv6 set --enable-dhcpv6
esxcli <conn_options> network ip interface ipv6 address add
vicfg-vmknic <conn_options> --enable-ipv6
Youcannotrunvicfg-ipsecwithavCenterServersystemasthetarget(usingthe--vihostoption).
Youcanrunesxcli network ip ipseccommandswithavCenterServersystemasatarget(usingthe
--vihostoption).
TheVMwareimplementationofIPsecadherestothefollowingIPv6RFCs:
4301SecurityArchitecturefortheInternetProtocol
4303IPEncapsulatingSecurityPayload(ESP)
4835CryptographicAlgorithmImplementationRequirementsforESP
2410TheNULLEncryptionAlgorithmandItsUseWithIPsec
2451TheESPCBCModeCipherAlgorithms
3602TheAESCBCCipherAlgorithmandItsUsewithIPsec
2404TheUseofHMACSHA196withinESPandAH
4868UsingHMACSHA256,HMACSHA384,andHMACSHA512
130
AnSAdetermineshowthesystemprotectstraffic.WhenyoucreateanSA,youspecifythesourceand
destination,authentication,andencryptionparameters,andanidentifierfortheSAwiththefollowing
options.
vicfg-ipsec
sa-srcandsa-dst
--sa-sourceand--sa-destination
spi(securityparameterindex)
--sa-spi
VMware, Inc.
vicfg-ipsec
sa-mode(tunnelortransport)
--sa-mode
ealgoandekey
-encryption-algorithmand--encryption-key
ialgoandikey
--integrity-algorithmand--integrity-key
AnSPidentifiesandselectstrafficthatmustbeprotected.AnSPconsistsoftwologicalsections,aselector,
andanaction.
Theselectorisspecifiedbythefollowingoptions.
vicfg-ipsec
src-addrandsrc-port
--sa-sourceand--source-port
dst-addranddst-port
--destination-port
ulproto
--upper-layer-protocol
direction(inorout)
--flow-direction
Theactionisspecifiedbythefollowingoptions
vicfg-ipsec
sa-name
--sa-name
sp-name
--sp-name
--action
BecauseIPsecallowsyoutotargetpreciselywhichtrafficshouldbeencrypted,itiswellsuitedforsecuring
yourvSphereenvironment.Forexample,youcansetuptheenvironmentsoallvMotiontrafficisencrypted.
esxcli Option
Description
sa-src <source_IP>
sa-source <source_IP>
SourceIPfortheSA.
sa-dst
<destination_IP>
sa-destination
<destination_IP>
DestinationIPfortheSA.
spi
sa-spi
SecurityParameterIndex(SPI)fortheSA.Mustbea
hexadecimalnumberwitha0xprefix.
WhenIPsecisinuse,ESXiusestheESPprotocol(RFC43030),
whichincludesauthenticationandencryptioninformationand
theSPI.TheSPIidentifiestheSAtouseatthereceivinghost.
EachSAyoucreatemusthaveauniquecombinationofsource,
destination,protocol,andSPI.
sa-mode [tunnel |
transport]
sa-mode [tunnel |
transport]
Eithertunnelortransport.
ealgo [null |
3des-cbc |
aes128-cbc]
encryption-algorithm
[null | 3des-cbc |
aes128-cbc]
Encryptionalgorithmtobeused.Choose3des-cbcor
aes128-cbc,ornullfornoencryption.
ekey <key>
encryption-key <key>
Encryptionkeytobeusedbytheencryptionalgorithm.A
seriesofhexadecimaldigitswitha0xprefixoranASCIIstring.
VMware, Inc.
Intunnelmode,theoriginalpacketisencapsulatedinanother
IPv6packet,wheresourceanddestinationaddressesarethe
SAendpointaddresses.
131
vicfg-ipsec Option
esxcli Option
Description
ialgo [hmac-sha1 |
hmac-sha2-256 ]
integrity-algorithm
[hmac-sha1 |
hmac-sha2-256 ]
Authenticationalgorithmtobeused.Choosehmac-sha1or
hmac-sha2-256.
ikey
integrity-key
Authenticationkeytobeused.Aseriesofhexadecimaldigitsor
anASCIIstring.
YoucanperformthesemaintaskswithSAs:
CreateanSA.Youspecifythesource,thedestination,andtheauthenticationmode.Youalsospecifythe
authenticationalgorithmandauthenticationkeytouse.Youmustspecifyanencryptionalgorithmand
key,butyoucanspecifynullifyouwantnoencryption.Authenticationisrequiredandcannotbenull.
Thefollowingexampleincludesextralinebreaksforreadability.Thelastoption(sa_2intheexample)is
thenameoftheSA.
esxcli network ip ipsec sa add
--sa-source 2001:DB8:1::121
--sa-destination 2001:DB8:1::122
--sa-mode transport
--sa-spi 0x1000
--encryption-algorithm 3des-cbc
--encryption-key 0x6970763672656164796c6f676f336465736362636f757432
--integrity-algorithm hmac-sha1
--integrity-key 0x6970763672656164796c6f67736861316f757432
--sa-name sa_2
132
vicfg-ipsec Option
esxcli Option
Description
sp-src <ip>/<p_len>
sp-source
<ip>/<p_len>
SourceIPaddressandprefixlength.
sp-dst <ip>/<p_len>
sp-destination
<ip>/<p_len>
DestinationIPaddressandprefixlength.
src-port <port>
source-port <port>
Sourceport(065535).Specifyanyforanyports.
dst-port <port>
destination-port
<port>
Destinationport(065535).Specifyanyforanyports.Ifulproto
isicmp6,thisnumberreferstotheicmp6type.Otherwise,this
numberreferstotheport.
upper-layer-protocol
[any | tcp | udp |
icmp6]
Upperlayerprotocol.UsethisoptiontorestricttheSPtoonly
certainprotocols,oruseanytoapplytheSPtoallprotocols.
flow-direction [in |
out]
Directioninwhichyouwanttomonitorthetraffic.Tomonitor
trafficinbothdirections,createtwopolicies.
VMware, Inc.
vicfg-ipsec Option
esxcli Option
Description
action [none |
discard | ipsec]
action [none |
discard | ipsec]
Actiontotakewhentrafficwiththespecifiedparametersis
encountered.
noneTakenoaction,thatis,allowtrafficunmodified.
discardDonotallowdatainorout.
ipsecUsetheauthenticationandencryptioninformation
specifiedintheSAtodeterminewhetherthedatacomefroma
trustedsource.
sp-mode [tunnel |
transport]
sp-mode [tunnel |
transport]
Mode,eithertunnelortransport.
sa-name
sa-name
NameoftheSAtousebythisSP.
YoucanperformthesemaintaskswithSPs:
CheckfirewallstatusandsshServerrulesetstatus.
esxcli <conn_options> network firewall get
Default Action: DROP
Enabled: true
Loaded: true
esxcli <conn_options> network firewall ruleset list --ruleset-id sshServer
VMware, Inc.
133
Name
--------sshServer
Enabled
------true
EnablethesshServerrulesetifitisdisabled.
esxcli <conn_options> network firewall ruleset set --ruleset-id sshServer --enabled true
ObtainaccesstotheESXiShellandcheckthestatusoftheallowedAllflag.
esxcli <conn_options> network firewall ruleset allowedip list --ruleset-id sshServer
Ruleset
Allowed IP Addresses
--------- -------------------sshServer All
SeeGettingStartedwithvSphereCommandLineInterfacesforinformationonaccessingtheESXiShell.
4
SetthestatusoftheallowedAllflagtofalse.
esxcli <conn_options> network firewall ruleset set --ruleset-id sshServer --allowed-all false
AddthelistofallowedIPaddresses.
esxcli <conn_options> network firewall ruleset allowedip add --ruleset-id sshServer
--ip-address 192.XXX.1.0/24
esxcli <conn_options> network firewall ruleset allowedip add --ruleset-id sshServer
--ip-address 192.XXX.10.10
ChecktheallowedIPaddresslist.
esxcli <conn_options> network firewall ruleset allowedip list --ruleset-id sshServer
Ruleset
Allowed IP Addresses
--------- ----------------------------sshServer 192.XXX.10.10, 192.XXX.1.0/24
134
VMware, Inc.
10
10
StartingwiththevSphere4.0release,thevCenterServermakesperformancechartsforCPU,memory,diskI/O,
networking,andstorageavailable.YoucanviewtheseperformancechartsbyusingthevSphereWebClient
andreadabouttheminthevSphereMonitoringdocumentation.Youcanalsoperformsomemonitoringofyour
ESXisystemusingvCLIcommands.
Thischapterincludesthesetopics:
UsingresxtopforPerformanceMonitoringonpage 135
ManagingDiagnosticPartitionsonpage 135
ManagingCoreDumpsonpage 136
ConfiguringESXiSyslogServicesonpage 138
ManagingESXiSNMPAgentsonpage 139
RetrievingHardwareInformationonpage 141
ESX,ESXi,andVirtualMachineLogsonpage 142
VMware, Inc.
AdiagnosticpartitioncannotbelocatedonaniSCSILUNaccessedthroughthesoftwareiSCSIor
dependenthardwareiSCSIadapter.FormoreinformationaboutdiagnosticpartitionswithiSCSI,see
GeneralBootfromiSCSISANRecommendationsinthevSphereStoragedocumentation.
135
Astandalonehostmusthaveadiagnosticpartitionof110MB.
IfmultiplehostsshareadiagnosticpartitiononaSANLUN,configurealargediagnosticpartitionthat
thehostsshare.
Ifahostthatusesashareddiagnosticpartitionfails,rebootthehostandextractlogfilesimmediatelyafter
thefailure.Otherwise,thesecondhostthatfailsbeforeyoucollectthediagnosticdataofthefirsthost
mightnotbeabletosavethecoredump.
ShowthediagnosticpartitiontheVMkernelusesanddisplayinformationaboutallpartitionsthatcanbe
usedasdiagnosticpartitions.
esxcli <conn_options> system coredump partition list
Deactivatethecurrentdiagnosticpartition.
esxcli <conn_options> system coredump partition set --unconfigure
TheESXisystemisnowwithoutadiagnosticpartition,andyoumustimmediatelysetanewone.
3
Settheactivepartitiontonaa.<naa_ID>.
esxcli <conn_options> system coredump partition set --partition=naa.<naa_ID>
136
Listpartitionsagaintoverifythatadiagnosticpartitionisset.
VMware, Inc.
Ifadiagnosticpartitionisset,thecommanddisplaysinformationaboutit.Otherwise,thecommand
showsthatnopartitionisactivatedandconfigured.
YoumustspecifyaVMkernelportwith--interface-name,andtheIPaddressandportoftheserverto
sendthecoredumpsto.IfyouconfigureanESXisystemthatisrunninginsideavirtualmachine,you
mustchooseaVMkernelportthatisinpromiscuousmode.
2
EnableESXiDumpCollector.
esxcli <conn_options> system coredump network set --enable=true
(Optional)CheckthatESXiDumpCollectorisconfiguredcorrectly.
esxcli <conn_options> system coredump network get
ThehostonwhichyouhavesetupESXiDumpCollectorsendscoredumpstothespecifiedserverbyusing
thespecifiedVMkernelNICandoptionalport.
ShowthediagnosticpartitiontheVMkerneluses.
vicfg-dumppart <conn_options> -t
Displayinformationaboutallpartitionsthatcanbeusedasdiagnosticpartitions.Use-ltolistall
diagnosticpartitions,-ftolistalldiagnosticpartitionsinorderofpriority.
vicfg-dumppart <conn_options> -f
Theoutputmightappearasfollows.
Partition name on vml.mpx.vmhba36:C0:T0:L0:7 -> mpx.vmhba36:C0:T0:L0:7
Deactivatethediagnosticpartition.
vicfg-dumppart <conn_options> -d
TheESXisystemisnowwithoutadiagnosticpartition,andyoumustimmediatelysetanewone.
4
Settheactivepartitiontonaa.<naa_ID>.
vicfg-dumppart <conn_options> -s naa.<naa_ID>
VMware, Inc.
137
Runvicfg-dumppart -tagaintoverifythatadiagnosticpartitionisset.
vicfg-dumppart <conn_options> -t
Ifadiagnosticpartitionisset,thecommanddisplaysinformationaboutit.Otherwise,thecommand
informsyouthatnopartitionisset.
Remotehostandport.RemotehosttowhichSyslogmessagesareforwardedandportonwhichthe
remotehostreceivesSyslogmessages.Theremotehostmusthavealoglistenerserviceinstalledand
correctlyconfiguredtoreceivetheforwardedsyslogmessages.Seethedocumentationforthesyslog
serviceinstalledontheremotehostforinformationonconfiguration.
Transportprotocol.LogscanbesentbyusingUDP(default),TCPorSSLtransports.
Localloggingdirectory.Directorywherelocalcopiesofthelogsarestored.Thedirectorycanbelocated
onmountedNFSorVMFSvolumes.Onlythe/scratchdirectoryonthelocalfilesystemispersistent
acrossreboots.
Uniquedirectorynameprefix.SettingthisoptiontotruecreatesasubdirectorywiththenameofESXi
hostunderthespecifiedloggingdirectory.ThismethodisespeciallyusefulifthesameNFSdirectoryis
usedbymultipleESXihosts.
Logrotationpolicies.Setsmaximumlogsizeandthenumberofarchivestokeep.Policiescanbespecified
bothglobally,andforindividualsubloggers.Forexample,youcansetalargersizelimitforthevmkernel
log.
138
Option
Description
mark
Marksalllogswiththespecifiedstring.
reload
Reloadstheconfiguration,andupdatesanychangedconfigurationvalues.
config get
Retrievesthecurrentconfiguration.
config set
Setstheconfiguration.Useoneofthefollowingoptions.
--logdir=<path>Savelogstoagivenpath.
--loghost=<host>Sendlogstoagivenhost.SeeesxclisystemsyslogExampleson
page 139.
--logdir-unique=<true|false>Specifywhetherthelogshouldgotoaunique
subdirectoryofthedirectoryspecifiedinlogdir.
--default-rotate=<int>Defaultnumberoflogrotationstokeep.
--default-size=<int>Sizebeforerotatinglogs,inKB.
VMware, Inc.
Option
Description
Showcurrentlyconfiguredsubloggers.
Setconfigurationoptionsforaspecificsublogger.Useoneofthefollowingoptions.
--id=<str>IDoftheloggertoconfigure(required).
--reset=<str>Resetvaluestodefault.
--rotate=<long>Numberofrotatedlogstokeepforaspecificlogger(requires--id).
--size=<long>Sizeoflogsbeforerotationforaspecificlogger,inKB(requires--id).
Showconfigurationoptions.
esxcli <conn_options> system syslog config get
Default Rotation Size: 1024
Default Rotations: 8
Log Output: /scratch/log
Logto Unique Subdirectory: false
Remote Host: <none>
Setalllogstokeeptwentyrotationsbeforeoverwritingtheoldestlog.
esxcli <conn_options> system syslog config set --default-rotate=20
SettherotationpolicyforVMkernellogsto10rotations,rotatingat2MB.
esxcli <conn_options> system syslog config logger --id=vmkernel --size=2048 --rotate=10
Sendlogstoremotehostmyhost.mycompany.com.Thelogswillusethedefaulttransport(UDP)andport
(514).
esxcli system syslog config set --loghost='myhost.mycompany.com'
Savethelocalcopyoflogsto/scratch/mylogsandsendanothercopytotheremotehost.
esxcli <conn_options> system syslog config set --loghost='tcp://myhost.mycompany.com:1514'
--logdir='/scratch/mylogs'
Yousetthedirectoryontheremotehostbyconfiguringtheclientrunningonthathost.Youcanusethe
vSphereWebClienttoredirectsystemlogstoaremotehostbychangingtheSystem.global.logHost
advancedsetting.
6
Sendalogmessagetoalllogssimultaneously.
esxcli <conn_options> system syslog mark --message="this is a message!"
Reloadthesyslogdaemonandapplyconfigurationchanges.
esxcli <conn_options> system syslog reload
VMware, Inc.
139
vCenterServerSNMPagent.TheSNMPagentincludedwithvCenterServercansendtrapswhenthe
vCenterServersystemisstartedorwhenanalarmistriggeredonvCenterServer.ThevCenterServer
SNMPagentfunctionsonlyasatrapemitteranddoesnotsupportotherSNMPoperations(forexample,
GET).
YoucanmanagethevCenterServeragentwiththevSphereWebClientbutnotwiththevCLIcommand.
HostbasedembeddedSNMPagent.ESXi4.0andlaterincludesanSNMPagentembeddedinthehost
daemon(hostd)thatcansendtrapsandreceivepollingrequestssuchasGETrequests.
YoucanmanageSNMPonESXihostswiththevicfg-snmpvCLIcommand,butnotwiththevSphere
ClientorwiththeESXCLIcommand.
NetSNMPbasedagent.VersionsofESXreleasedbeforeESX/ESXi4.0includeaNetSNMPbasedagent.
YoucancontinuetousethisNetSNMPbasedagentinESX4.xwithMIBssuppliedbyyourhardware
vendorandotherthirdpartymanagementapplications.However,tousetheVMwareMIBfiles,youmust
usethehostbasedembeddedSNMPagent.
TousetheNETSNMPbasedagentandhostbasedembeddedSNMPagentatthesametime,makeoneofthe
agentslistenonanondefaultport.Bydefault,bothagentsusethesameport.
ThehostbasedembeddedSNMPagentisdisabledbydefault.Configuringandenablingtheagentrequires
thatyouperformthefollowingtasks:
1
ConfigureSNMPCommunities.SeeConfiguringSNMPCommunitiesonpage 140.
ConfiguretheSNMPAgent.Youhavethefollowingchoices:
ConfiguringtheSNMPAgenttoSendTrapsonpage 140
ConfiguringtheSNMPAgentforPollingonpage 141
Eachtimeyouspecifyacommunitywiththiscommand,thesettingsthatyouspecifyoverwritetheprevious
configuration.
Makesureacommunityissetup.
vicfg-snmp <conn_options> --show
Current SNMP agent settings:
Enabled: 1
UDP port: 161
Communities: public
Notification targets:
140
VMware, Inc.
Runvicfg-snmp --targetwiththetargetaddress,portnumber,andcommunity.
vicfg-snmp <conn_options> -t target.example.com@163/public
Eachtimeyouspecifyatargetwiththiscommand,thesettingsyouspecifyoverwriteallpreviously
specifiedsettings.Tospecifymultipletargets,separatethemwithacomma.
YoucanchangetheportthattheSNMPagentsendsdatatoonthetargetusingthe--targetsoption.
ThatportisUDP162bydefault.
(Optional)EnabletheSNMPagentifitisnotyetrunning.
vicfg-snmp <conn_options> --enable
(Optional)Sendatesttraptoverifythattheagentisconfiguredcorrectly.
vicfg-snmp <conn_options> --test
TheagentsendsawarmStarttraptotheconfiguredtarget.
Runvicfg-snmp --targetwiththetargetaddress,portnumber,andcommunity.
vicfg-snmp <conn_options> -c public -t target.example.com@163/public
Eachtimeyouspecifyatargetwiththiscommand,thesettingsyouspecifyoverwriteallpreviously
specifiedsettings.Tospecifymultipletargets,separatethemwithacomma.
YoucanchangetheportthattheSNMPagentsendsdatatoonthetargetbyusingthe--targetsoption.
ThatportisUDP162bydefault.
(Optional)Specifyaportforlisteningforpollingrequests.
vicfg-snmp <conn_options> -p <port>
(Optional)IftheSNMPagentisnotenabled,enableit.
vicfg-snmp <conn_options> --enable
Runvicfg-snmp --testtovalidatetheconfiguration.
Thefollowingexampleshowshowthecommandsareruninsequence.
vicfg-snmp <conn_options> c public t example.com@162/private --enable
# next validate your config by doing these things:
vicfg-snmp <conn_options> -test
walk v1 c public esx-host
VMware, Inc.
141
YoucanalsousetheipminamespacetoretrieveIPMIsystemeventlogs(SEL)andsensordatarecords(SDR).
Thecommandsupportsbothget(singlereturnvalue)andlist(multiplereturnvalues)commandsandreturns
rawsensorinformation.
142
Component
Location
ESXServer3.xorESXservicelog
/var/log/vmware/hostd.log
vSphereclientagentlog
/var/log/vmware/vpx/vpxa.log
Virtualmachinekernelcorefile
Afteryourebootyourmachine,files/root/vmkernel-log.<date>and
/root/vmkernel-core.<date>arepresent.
Sysloglog
/var/log/messages
Serviceconsoleavailabilityreport
/var/log/vmkernel
VMkernelmessages,alerts,and
availabilityreport
/var/log/vmkernel
VMkernelwarning
/var/log/vmkwarning
Virtualmachinelogfile
vmware.loginthesamedirectoryastheVMXfileforthevirtualmachine
Virtualmachineconfigurationfile
<virtual_machine_name>/<virtual_machine_name>.vmxlocatedona
datastoreassociatedwiththemanagedhost.Usethevirtualmachinesummary
pageinthevSphereWebClienttodeterminethedatastoreonwhichthisfileis
located.
VMware, Inc.
Index
Numerics
3.5 LUN masks 95
A
Active Directory 25, 26
active path 47
ARP redirect 74
authentication
algorithm (IPsec) 132
default inheritance 61
key (IPsec) 132
returning to default inheritance 61
AUTOCONF 125
B
backing up configuration data 24
C
CDP 116, 117, 118
Challenge Handshake Authentication Protocol 60
changing IP gateway 129
CHAP 60
chapDiscouraged 60
chapPreferred 60
chapProhibited 60
chapRequired 60
Cisco Discovery Protocol 116
claim rules
adding 93
converting 95
deleting 96
from 3.5 systems 95
from LUN mask 95
listing 96
loading 96
moving 97
rule IDs 95
running 97
commands with esxcfg prefix 12
configuration data
backing up 24
restoring 24
configuration files, path 54
copying files 34
core dumps 136
ESXi Dump Collector 137
VMware, Inc.
local 136
managing 137
cp850 encoding 18
cp936 encoding 18
creating directories 35
D
datastores
mounting 30
NFS 50
overview 41
default gateway 130
default inheritance 61, 78, 79
default port groups 116
dependent hardware iSCSI 57, 68, 73
device 41
device management 44, 86
device mappings 43, 44
device naming
device UID 41
runtime name 41
VML name 41
Device UID 41
DHCP 127, 128
DHCPV6 125
diagnostic partitions
creating 136
example 136, 137
managing 135
directory management 37
directory names with special characters 34
discovery sessions 58
discovery targets 59
disk file path 54
distributed switches 111, 112, 113, 115
DNS 126, 127, 128
downloading files 34
duplicate datastores 29
dynamic discovery 58
E
encoding
cp936 18
Shift_JIS 18
encodings
cp850 18
143
F
failover 44
144
FC LUNs 41
Fibre Channel LUNs 41
file management
introduction 27
vifs 28, 37
file path, configuration file 54
file systems
NAS 51
VMFS 29
fixed path selection policy 88
G
gateway, IP 129
groups 99, 102
H
hard power operations 108
hardware iSCSI setup tasks 70, 74
HBA mappings 44
HBA properties 76
hosts
managing 21
shutdown or reboot 21
I
ifconfig, ESXCLI equivalents 113
independent hardware iSCSI
definition 57
setup tasks 70, 74
inheritance 79
IP gateway 129
IP storage 112
IPsec 130
IPv4 123, 124
IPv6 124, 125
IQN name 59
iSCSI
authentication 61, 80, 81
default inheritance 78, 79
dependent hardware iSCSI 68, 73
discovery target names 59
independent hardware iSCSI 70, 74
LUNs 41
mutual authentication 80, 81
options 75
overview 57
parameters 77, 78
parameters, returning to default inheritance 78,
79
port binding 68, 73
ports for multipathing 81
remove sessions 83
securing ports 60
VMware, Inc.
Index
security 59
sessions 82, 83
setup examples 66, 68, 71, 73
Kerberos 129
offload iSCSI 57
orphaned virtual machine 104
license 53
listing available LUNs 42, 43
listing IP gateway 129
loading claim rules 96
lockdown mode 19
logical devices, listing 44
logs 142
LUN masks, convert to claim rule 95
LUNs
listing available 42, 43
names 45, 46
overview 42
parameters
default inheritance (iSCSI) 79
setting (iSCSI) 78
partitions, diagnostic 136
path change conditions for round robin 89
path claiming 92
path operations 86
path policies 47, 88, 89
path state, changing 47
paths
active 47
changing state 47
disabling 47
identifier 41
listing 46
listing with ESXCLI 45
managing 44
preferred 49, 50, 88
performance monitoring 135
physical network interfaces 120
platform support 14
Pluggable Storage Architecture 44
port binding 68, 73, 82
port groups 112, 119, 120
adding 118
and uplink adapter 119
default 116
removing 118
ports, iSCSI multipathing 81
power operations 108
powerop_mode 108
preferred path 49, 50, 88
PSA 44
acronym 85
managing claim rules 93
PSP
acronym 85
information 87
operations 86
M
MAC address, VMkernel NIC 123
MagicPacket 121
maintenance mode 22, 23
Managing 44, 57, 120
managing 136
managing local core dumps 136
managing NMP 85
managing paths 44
managing physical network interfaces 120
migrating virtual machines,svmotion 52
mount datastores 30
MTU 117, 118
multipathing 44, 45
mutual authentication 80, 81
mutual CHAP 67, 69, 72, 74, 80, 81
N
naa.xxx device name 45, 46
NAS datastores, datastores, NAS 50
NAS file systems 51
NetQueue VMkernel modules 25
network adapters
duplex value 120
managing 120
speed 120
network interfaces 115, 120
networking
vDS 126
vSS 115
NFS datastores 50
NFS, capabilities 51
VMware, Inc.
R
raw devices 41
rebooting hosts 21
register virtual machines 105
removing snapshots 107
145
rescanning adapters 55
rescanning storage 41, 55
rescanning storage adapters 55
resignature VMFS copy 31
restoring configuration data 24
resxtop 12, 135
reverting snapshots 107
RFCs (vicfg-ipsec) 130
roles 99
round robin
operations 50, 88
path change conditions 89
retrieve settings 89
route entry setup 129
rule IDs 95
rules 91
claim rules 93
SATP rules 91
runtime name 41
S
SATP
configuration parameters 91
deleting rules 91
retrieve settings 89
rules, adding 90
securing iSCSI ports 60
security associations (IPsec) 131
security policies (IPsec) 132
sessions, iSCSI 83
Shift_JIS encoding 18
Simple Network Management Protocol 139
snapshots 106, 107
SNMP
communities 140
management 139
polling 141
traps 140
soft power operations 108
software iSCSI setup tasks 66, 68, 71, 73
spaces in directory names 34
special characters
in directories 34
vicfg-iscsi 77, 79
standard networking services 126
starting NTP server 129
state of path, changing 47
static discovery 58
stopping virtual machines 109
storage
creating directories with vifs 35
overview 39
path claiming 92
146
rescanning 41, 55
virtual machines 40
storage array target 42
storage device naming 41
supported platforms 14
svmotion 52
interactive Mode 53
license for storage vMotion 53
limitations 53
noninteractive mode 53
requirements 53
special characters 53
switch attributes 117, 118
syslog server specification 138
T
TCP Segmentation Offload 123
TCP/IP 70, 74, 112
transport mode 131
TSO 123
tunnel mode 131
U
unregister virtual machines 105
uplink adapters 112, 120
and port groups 119
setup 122
useANO (round robin) 50
user input 109
users
creating 101
in vSphere environment 99
modifying 101
V
VDS 111
vicfg-authconfig 25
vicfg-cfgbackup 23, 24
vicfg-dumppart 136, 137
vicfg-hostops 21, 22
vicfg-ipsec 131, 132
vicfg-iscsi
command syntax 61
default inheritance for authentication 61
default inheritance for parameters 78, 79
iscsi parameter options 79
vicfg-module 24
vicfg-mpath 46
vicfg-nas 50, 51
vicfg-nics 122
vicfg-ntp 129
vicfg-rescan 55, 72, 73
vicfg-scsidevs
VMware, Inc.
Index
3.5 support 43
list options 43
vicfg-snmp 139
vicfg-syslog 138
vicfg-user 99, 100, 102
vicfg-vmhbadevs 42, 43
vicfg-vmknic 123
vicfg-volume 29
vicfg-vswitch 115, 118
vifs 28, 33
virtual devices 108
virtual machine configuration file path 54
virtual machines
attributes 105
file management 27
listing 104, 105
logs 142
managing 105
migration with svmotion 52
network settings 113
orphaned 104
path 104
registering 104, 105
starting 107
stopping 109
storage VMotion 52
vmware-cmd 105
virtual switches 111, 115, 116
MTU 117, 118
retrieving information 116
vicfg-vswitch 115
VLAN ID 119, 120
VMFS
duplicate datastores 29
resignature copy 30
resignaturing 31
VMFS3 to VMFS5 conversion 29
VMkernel modules 24
VMkernel network interfaces 123
VMkernel NIC 123
enable VMotion 125
IPv4 123, 124
IPv6 124, 125
VMkernel NICs 123
vmkfstools 28
VML LUN names 45, 46
VMotion 112, 125
VMW_PSP_FIXED 48
VMW_PSP_MRU 48
VMW_PSP_RR 48
vmware-cmd
connection options 104
VMware, Inc.
W
Windows Active Directory 26
147
148
VMware, Inc.