Professional Documents
Culture Documents
This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition. To check for more recent editions of this document, see http://www.vmware.com/support/pubs.
EN-000489-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 20082011 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at http://www.vmware.com/go/patents. VMware is a registered trademark or trademark of VMware, Inc. in the United States and/or other jurisdictions. All other marks and names mentioned herein may be trademarks of their respective companies.
VMware, Inc.
Contents
AboutThisBook
1 vSphereCLICommandOverviews 11
Introduction 11 Documentation 12 CommandLineHelp 12 ListofAvailableCommands 12 SupportedPlatformsforCommands 14 RunningESXCLICommandsAgainstESXi4.xHosts CommandswithanesxcfgPrefix 16 UsingESXCLIOutput 17 ConnectionOptions 17 vCLIandLockdownMode 18
16
2 ManagingHosts 21
Stopping,Rebooting,andExaminingHostswithvicfghostops 21 EnteringandExitingMaintenanceModewithvicfghostops 22 BackingUpConfigurationInformationwithvicfgcfgbackup 22 BackupTasks 23 BackingUpConfigurationData 23 RestoringConfigurationData 23 UsingvicfgcfgbackupfromvMA 23 ManagingVMkernelModules 24 ManagingModuleswithesxclisystemmodule 24 ManagingModuleswithvicfgmodule 24 UsingvicfgauthconfigforActiveDirectoryConfiguration 25 UpdatingHosts 26
3 ManagingFiles 27
IntroductiontoVirtualMachineFileManagement 27 ManagingtheVirtualMachineFileSystemwithvmkfstools 28 UpgradingVMFS3VolumestoVMFS5 29 ManagingVMFSVolumes 29 ManagingDuplicateVMFSDatastores 29 MountingDatastoreswithExistingSignatures 29 MountingandUnmountingwithESXCLI 29 MountingandUnmountingwithvicfgvolume 30 ResignaturingVMFSCopies 30 ResignaturingaVMFSCopywithESXCLI 31 ResignaturingaVMFSCopywithvicfgvolume 31 DetachingDevicesandRemovingaLUN 32 WorkingwithPermanentDeviceLoss 32 UsingvifstoManipulateFilesonRemoteESXiHosts 33
VMware, Inc.
4 ManagingStorage 37
IntroductiontoStorage 37 HowVirtualMachinesAccessStorage 38 Datastores 39 StorageDeviceNaming 39 ExaminingLUNs 40 TargetandDeviceRepresentation 40 ExaminingLUNswithesxclistoragecore 40 ExaminingLUNswithvicfgscsidevs 41 ManagingPaths 42 MultipathingwithLocalStorageandFCSANs 42 ListingPathInformation 43 ListingPathInformationwithESXCLI 43 ListingPathInformationwithvicfgmpath 44 ChangingtheStateofaPath 44 ChangingPathStatewithESXCLI 45 ChangingPathStatewithvicfgmpath 45 ManagingPathPolicies 45 ChangingPathPolicies 46 ChangingPathPolicieswithESXCLI 46 ChangingPathPolicieswithvicfgmpath 47 SettingPolicyDetailsforDevicesthatUseRoundRobin 47 ManagingNFS/NASDatastores 48 CapabilitiesSupportedbyNFS/NAS 48 AddingandDeletingNASFileSystems 48 ManagingNASFileSystemswithESXCLI 48 ManagingNASFileSystemswithvicfgnas 49 MigratingVirtualMachineswithsvmotion 49 StoragevMotionUses 50 StoragevMotionRequirementsandLimitations 50 RunningsvmotioninInteractiveMode 50 RunningsvmotioninNoninteractiveMode 51 ConfiguringFCoEAdapters 51 ScanningStorageAdapters 52
5 ManagingiSCSIStorage 53
iSCSIStorageOverview 53 DiscoverySessions 54 DiscoveryTargetNames 55 ProtectinganiSCSISAN 55 ProtectingTransmittedData 55 SecuringiSCSIPorts 56 SettingiSCSICHAP 56 CommandSyntaxforesxcliiscsiandvicfgiscsi 57 esxcliiscsiCommandSyntax 57 KeytoesxcliiscsiShortOptions 58 vicfgiscsiCommandSyntax 59 iSCSIStorageSetupwithESXCLI 62 SettingUpSoftwareiSCSIwithESXCLI 62 SettingUpDependentHardwareiSCSIwithESXCLI 64 SettingUpIndependentHardwareiSCSIwithESXCLI 66
VMware, Inc.
Contents
iSCSIStorageSetupwithvicfgiscsi 67 SettingUpSoftwareiSCSIwithvicfgiscsi 67 SettingUpDependentHardwareiSCSIwithvicfgiscsi 69 SettingUpIndependentHardwareiSCSIwithvicfgiscsi 70 ListingandSettingiSCSIOptions 71 ListingiSCSIOptionswithESXCLI 71 SettingMTUwithESXCLI 71 ListingandSettingiSCSIOptionswithvicfgiscsi 72 ListingandSettingiSCSIParameters 72 ListingandSettingiSCSIParameterswithESXCLI 72 ReturningParameterstoDefaultInheritance 74 ListingandSettingiSCSIParameterswithvicfgiscsi 74 ReturningParameterstoDefaultInheritance 75 EnablingiSCSIAuthentication 76 EnablingiSCSIAuthenticationwithESXCLI 76 EnablingiSCSIAuthenticationwithvicfgiscsi 77 SettingUpPortsforiSCSIMultipathing 77 ManagingiSCSISessions 78 IntroductiontoiSCSISessionManagement 78 ListingiSCSISessions 79 LoggingintoiSCSISessions 79 RemovingiSCSISessions 79
6 ManagingThirdPartyStorageArrays 81
ManagingNMPwithesxclistoragenmp 81 DeviceManagementwithesxclistoragenmpdevice 82 esxclistoragenmpdevicelist 82 esxclistoragenmpdeviceset 82 ListingPathswithesxclistoragenmppath 82 ManagingPathSelectionPolicyPluginswithesxclistoragenmppsp 82 RetrievingPSPInformation 83 SettingConfigurationParametersforThirdPartyExtensions 83 FixedPathSelectionPolicyOperations 83 RetrievingthePreferredPath 83 \SettingthePreferredPath 84 CustomizingRoundRobinSetup 84 RetrievingPathSelectionSettings 84 SpecifyingConditionsforPathChanges 85 ManagingSATPs 85 RetrievingInformationAboutSATPs 85 AddingSATPRules 85 RemovingSATPRules 86 RetrievingandSettingSATPConfigurationParameters 87 PathClaimingwithesxclistoragecoreclaiming 87 UsingtheReclaimTroubleshootingCommand 88 UnclaimingPathsorSetsofPaths 88 ManagingClaimRules 89 AddingClaimRules 89 ConvertingESX3.5LUNMaskstoClaimRuleFormat 91 RemovingClaimRules 92 ListingClaimRules 92 LoadingClaimRules 92 MovingClaimRules 92 RunningPathClaimingRules 93
VMware, Inc.
7 ManagingUsers 95
UsersandGroupsinthevSphereEnvironment 95 vicfguserCommandSyntax 95 ManagingUserswithvicfguser 96 ManagingGroupswithvicfguser 98
8 ManagingVirtualMachines 101
vmwarecmdOverview 101 ConnectionOptionsforvmwarecmd 102 GeneralOptionsforvmwarecmd 102 FormatforSpecifyingVirtualMachines 102 ListingandRegisteringVirtualMachines 102 RetrievingVirtualMachineAttributes 103 ManagingVirtualMachineSnapshotswithvmwarecmd 104 TakingVirtualMachineSnapshots 104 RevertingandRemovingSnapshots 105 PoweringVirtualMachinesOnandOff 105 ConnectingandDisconnectingVirtualDevices 106 WorkingwiththeAnswerVMAPI 107 ForciblyStoppingVirtualMachineswithEXCLI 107
9 ManagingvSphereNetworking 109
IntroductiontovSphereNetworking 109 NetworkingUsingvSphereStandardSwitches 110 NetworkingUsingvSphereDistributedSwitches 111 RetrievingBasicNetworkingInformation 111 SettingUpvSphereNetworkingwithvSphereStandardSwitches 112 SettingUpVirtualSwitchesandAssociatingaSwitchwithaNetworkInterface 112 RetrievingInformationAboutVirtualSwitches 113 RetrievingInformationaboutVirtualSwitcheswithESXCLI 113 RetrievingInformationaboutVirtualSwitcheswithvicfgvswitch 113 AddingandDeletingVirtualSwitches 113 AddingandDeletingVirtualSwitcheswithESXCLI 113 AddingandDeletingVirtualSwitcheswithvicfgvswitch 114 SettingSwitchAttributeswithesxclinetworkvswitchstandard 114 SettingSwitchAttributeswithvicfgvswitch 114 Checking,Adding,andRemovingPortGroups 115 ManagingPortGroupswithESXCLI 115 ManagingPortGroupswithvicfgvswitch 115 ManagingUplinksandPortGroups 115 ConnectingandDisconnectingUplinkAdaptersandPortGroupswithESXCLI 115 ConnectingandDisconnectingUplinksandPortGroupswithvicfgvswitch 116 SettingthePortGroupVLANID 116 SettingthePortGroupVLANIDwithESXCLI 116 SettingthePortGroupVLANIDwithvicfgvswitch 116 ManagingUplinkAdapters 117 ManagingUplinkAdapterswithesxclinetworknic 117 SpecifyingMultipleUplinkswithESXCLI 118 ManagingUplinkAdapterswithvicfgnics 118 LinkingandUnlinkingUplinkAdapterswithESXCLI 119 LinkingandUnlinkingUplinkAdapterswithvicfgvswitch 119
VMware, Inc.
Contents
AddingandModifyingVMkernelNetworkInterfaces 119 ManagingVMkernelNetworkInterfaceswithESXCLI 120 ManagingVMkernelNetworkInterfaceswithvicfgvmknic 121 SettingUpvSphereNetworkingwithvSphereDistributedSwitch 122 ManagingStandardNetworkingServicesinthevSphereEnvironment 123 SettingtheDNSConfiguration 123 SettingtheDNSConfigurationwithESXCLI 123 SettingtheDNSConfigurationwithvicfgdns 124 AddingandStartinganNTPServer 125 ManagingtheIPGateway 126 UsingvicfgipsecforSecureNetworking 126 UsingIPsecwithESXi 127 ManagingSecurityAssociationswithvicfgipsec 128 ManagingSecurityPolicieswithvicfgipsec 129 UsingesxclinetworkfirewallforESXiFirewallManagement 130
10 MonitoringESXiHosts 131
UsingresxtopforPerformanceMonitoring 131 ManagingDiagnosticPartitions 131 DiagnosticPartitionCreation 132 DiagnosticPartitionManagement 132 ManagingCoreDumps 132 ManagingLocalCoreDumpswithESXCLI 132 ManagingCoreDumpswithESXiDumpCollector 133 ManagingCoreDumpswithvicfgdumppart 133 ConfiguringESXiSyslogServices 134 ManagingESXiSNMPAgentswithvicfgsnmp 135 ConfiguringSNMPCommunities 136 ConfiguringtheSNMPAgenttoSendTraps 136 ConfiguringtheSNMPAgentforPolling 137 ESX,ESXi,andVirtualMachineLogs 137
Index 139
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. CommandLineManagementofvSphere5.0forServiceConsoleUsersisforcustomerswhocurrentlyusethe 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.
Introduction
ThevSphereCLIcommandset,availablesinceESX/ESXi3.5,allowsyoutoperformvSphereconfiguration tasksusingavCLIpackageinstalledonsupportedplatforms,orusingvMA.Thesetconsistsofseveral commandsets. Table 1-1. Components of the vSphere CLI Command Set
vCLI Commands ESXCLIcommands Description 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.
Documentation
GettingStartedwithvSphereCommandLineInterfacesincludesinformationaboutavailableCLIs,enablingthe ESXiShell,andinstallingandrunningvCLIcommands.Anappendixsuppliesthenamespaceandcommand hierarchiesforESXCLI. ReferenceinformationforvCLIcommandsisavailableonthevCLIdocumentationpage http://www.vmware.com/support/developer/vcli/.
Command-Line Help
Availablecommandlinehelpdiffersforthedifferentcommands.
Command set vicfgcommands Available Command-Line Help Run<vicfg-cmd> --helpforanoverviewofeachoptions. RunPod2Htmlwithavicfgcommandasinputandpipetheoutputtoafileformoredetailed helpinformation. pod2html vicfg-authconfig.pl > vicfg-authconfig.html ThisoutputcorrespondstotheinformationavailableinthevSphereCommandLineInterface Reference. ESXCLIcommands Run--helpatanylevelofthehierarchyforinformationaboutbothcommandsand namespacesavailablefromthatlevel.
resxtop
svmotion
vicfg-advcfg
vicfg-cfgbackup
12
vicfg-vswitch
VMware, Inc.
13
vihostupdate vihostupdate35
vmware-cmd
YoucannotrunthevihostupdatecommandagainstanESXi5.0system. Youcannotrunthevihostupdateandvicfg-mpathcommandsthatareinavCLI4.0orlaterinstallation againstESX/ESXi3.5orvCenter2.5systems.Instead,runvihostupdate35andvicfg-mpath35,includedin thevCLI4.xinstallation,againstthosesystems.vihostupdate35issupportedforESXi,butnotforESX. Youcannotrunvicfg-syslog --setserverorvicfg-syslog --setportwithanESXi5.0target. 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.
14
VMware, Inc.
Table 13listsplatformsupportforthedifferentvCLI5.xcommands.Thesecommandshavenotbeentested againstVirtualCenter2.5Update2systems.Youcan,however,connecttoavCenterServer4.xsystemand targetESX/ESXi3.5Update2hosts. Table 1-3. Platform Support for vCLI 5.x Commands
Command esxcli resxtop svmotion vicfg-advcfg vicfg-authconfig vicfg-cfgbackup vicfg-dns vicfg-dumppart vicfg-hostops vicfg-ipsec vicfg-iscsi vicfg-module vicfg-mpath vicfg-nas vicfg-nics vicfg-ntp vicfg-rescan vicfg-route vicfg-scsidevs vicfg-snmp vicfg-syslog vicfg-user vicfg-vmhbadevs vicfg-vmknic vicfg-volume vicfg-vswitch vifs vihostupdate ESXi 5.0 Yes Yes(from Linux) No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes VC 5.0 Yes Yes(from Linux) Yes Yes Yes No Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes No Nofor5.0 target No ESXi 4.x Yes Yes(from Linux) No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes ESX 4.x Yes Yes(from Linux) No Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes VC 4.x No Yes(from Linux) Yes Yes Yes No Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes No ESXi 3.5 U2+ No Yes(from Linux) No Yes No Yes Yes Yes No No No Yes ESX 3.5 U2+ No Yes(from Linux) No Yes No No Yes Yes No No No Yes
Usevicfg-mpath35instead. Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes No Yes Yes Use vihostupdate35 instead Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes Yes Yes No Yes Yes No
NotincludedinvCLI4.xandvCLI5.0.Usevicfg-scsidevsinstead. Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No No
Yes Yes No No
Yes Yes No No
No Yes No No
VMware, Inc.
15
IfyouruncommandsagainstESXi4.xhosts,ESXCLI4.xcommandsaresupported. IfyouruncommandsagainstESXi5.0hosts,ESXCLI5.0commandsaresupported.
16
VMware, Inc.
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 --cacertsfile <certsfile> -t <certs_file> VI_CACERTFILE=<cert_file_path> --config <cfg_file_full_path> VI_CONFIG=<cfg_file_full_path> --credstore <credstore> Description ESXCLIcommandsonly. UsedtospecifytheCA(CertificateAuthority)certificatefile,inPEMformat, toverifytheidentityofthevCenterServersystemorESXisystemtorunthe commandon.Canbeused,forexample,topreventmaninthemiddleattack. Usestheconfigurationfileatthespecifiedlocation. Specifyapaththatisreadablefromthecurrentdirectory. Nameofacredentialstorefile.Defaultsto <HOME>/.vmware/credstore/vicredentials.xmlonLinuxand <APPDATA>/VMware/credstore/vicredentials.xmlonWindows. CommandsforsettingupthecredentialstoreareincludedinthevSphere SDKforPerl,whichisinstalledwithvCLI.ThevSphereSDKforPerl ProgrammingGuideexplainshowtomanagethecredentialstore. Specifiestheencodingtobeused.Thefollowingencodingsaresupported.
Youcanuse--encodingtospecifytheencodingvCLIshouldmaptowhenit isrunonaforeignlanguagesystem. --passthroughauth VI_PASSTHROUGHAUTH Ifyouspecifythisoption,thesystemusestheMicrosoftWindowsSecurity SupportProviderInterface(SSPI)forauthentication.Trustedusersarenot promptedforausernameandpassword.SeetheMicrosoftWebsitefora detaileddiscussionofSSPI. ThisoptionissupportedonlyifyouarerunningvCLIonaWindowssystem andareconnectingtoavCenterServersystem.
VMware, Inc.
17
Usetheemptystring(' 'onLinuxand onWindows)toindicateno password. Ifyoudonotspecifyausernameandpasswordonthecommandline,the systempromptsyouanddoesnotechoyourinputtothescreen. --portnumber <number> VI_PORTNUMBER=<number> --protocol <HTTP|HTTPS> VI_PROTOCOL=<HTTP|HTTPS> --savesessionfile <file> VI_SAVESESSIONFILE=<file> --server <server> VI_SERVER=<server> Usesthespecifiedporttoconnecttothesystemspecifiedby--server. Defaultis443. Usesthespecifiedprotocoltoconnecttothesystemspecifiedby--server. DefaultisHTTPS. Savesasessiontothespecifiedfile.Thesessionexpiresifitisnotusedfor30 minutes. UsesthespecifiedESXiorvCenterServersystem.Defaultislocalhost. If--serverpointstoavCenterServersystem,youusethe--vihostoption tospecifytheESXihostonwhichyouwanttorunthecommand.Acommand issupportedforvCenterServerifthe--vihostoptionisdefined. UsesthespecifiedservicepathtoconnecttotheESXihost.Defaultis /sdk/webService. Usesthespecifiedsessionfiletoloadapreviouslysavedsession.Thesession mustbeunexpired. ConnectstothespecifiedvSphereWebServicesSDKURL. Usesthespecifiedusername.
--servicepath <path> VI_SERVICEPATH=<path> --sessionfile <file> VI_SESSIONFILE=<file> --url <url> VI_URL=<url> --username <u_name> VI_USERNAME=<u_name>
Ifyoudonotspecifyausernameandpasswordonthecommandline,the systempromptsyouanddoesnotechoyourinputtothescreen. --vihost <host> -h <host WhenyourunavSphereCLIcommandwiththe--serveroptionpointing toavCenterServersystem,use--vihosttospecifytheESXihosttorunthe commandagainst. NOTE:Thisoptionisnotsupportedforeachcommand.Ifsupported,the optionisincludedintheindividualcommandoptionlist.
18
VMware, Inc.
Youcandisablelockdownmodeasfollows.
TomakechangestoESXisystemsinlockdownmode,youmustgothroughavCenterServersystemthat managestheESXisystemastheuservpxuser. esxcli --server MyVC --vihost MyESXi storage filesystem list ThecommandpromptsforthevCenterServersystemusernameandpassword. YoucanusethevSphereClientorvCLIcommandsthatsupportthe--vihostoption.Thefollowing commandscannotrunagainstvCenterServersystemsandarethereforenotavailableinlockdownmode:
VMware, Inc.
19
20
VMware, Inc.
Managing Hosts
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.
VMware, Inc.
21
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
22
VMware, Inc.
Backup Tasks
Duringaconfigurationbackup,theserialnumberisbackedupwiththeconfiguration.Thenumberisrestored whenyourestoretheconfiguration.ThenumberisnotpreservedwhenyouruntheRecoveryCD(ESXi Embedded)orperformarepairoperation(ESXiInstallable). Youcanbackupandrestoreconfigurationinformationasfollows. 1 2 3 Backuptheconfigurationbyusingthevicfg-cfgbackupcommand. RuntheRecoveryCDorrepairoperation Restoretheconfigurationbyusingthevicfg-cfgbackupcommand.
Whenyourestoreaconfiguration,youmustmakesurethatallvirtualmachinesonthehostarestopped.
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
VMware, Inc.
Thesystemreturnsthename,type,value,anddescriptionofthemodule. 2 (Optional)Listallenabledorloadedmodules.
esxcli <conn_options> system module list --enabled=true esxcli <conn_options> system module list --loaded=true
EnabletheNetQueuemodel.
esxcli <conn_options> system module set --module=s2io --enabled=true
Settheparameter.
esxcli system module parameters set --module s2io --parameter-string="rx_ring_num=8"
VerifythattheNetQueuemoduleisconfigured.
esxcli <conn_options> system module parameters list --module=s2io
ConfiguresasupportednetworkinterfacetouseNetQueue.
24
VMware, Inc.
VerifiesthattheNetQueuemoduleisconfigured.
Youcanrunvicfg-authconfigtoaddthehosttothedomain.Auserwhorunsvicfg-authconfigto configureActiveDirectorysettingsmusthavetheappropriateActiveDirectorypermissions,andmusthave administrativeprivilegesontheESXihost.Youcanrunthecommanddirectlyagainstthehostoragainsta vCenterServersystem,specifyingthehostwith--vihost. To set up Active Directory 1 2 3 4 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>
YouarepromptedforausernameandpasswordfortheESXisystem.
VMware, Inc.
25
Updating Hosts
Whenyouaddcustomdriversorpatchestoahost,theprocessiscalledanupdate.
26
VMware, Inc.
Managing Files
VMware, Inc.
27
local ethernet SCSI bre channel HBA SAN iSCSI hardware initiator LAN software initiator ethernet NIC LAN ethernet NIC LAN
VMFS
Key
physical disk
datastore VMFS fibre array VMFS iSCSI array NFS NAS appliance
virtual disk
--breaklock -B --chainConsistent -e --eagerzero -k --fix -x --lock -L --migratevirtualdisk -M --parseimage -Y --punchzero -K --snapshotdisk -I --verbose -v
28
VMware, Inc.
ManagingVMFSvolumes esxcli storage filesystem listshowsallvolumes,mountedandunmounted,thatareresolved, thatis,thatarenotsnapshotvolumes. esxcli storage filesystem unmountunmountsacurrentlymountedfilesystem.Usethiscommand forsnapshotvolumesorresolvedvolumes.
VMware, Inc.
29
Datastoreresignaturingisirreversible. TheLUNcopythatcontainstheVMFSdatastorethatyouresignatureisnolongertreatedasaLUNcopy.
30
VMware, Inc.
(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:
Thecommandreturnstothepromptorsignalsanerror.
VMware, Inc.
31
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
Attachthedevice.
esxcli storage core device set -d naa.XXX --state=on
32
VMware, Inc.
YoucanviewdatacenteranddatastoredirectoriesfromthisrootURL.Forexample:
http://<ESXi_addr>/folder?dcPath=ha-datacenter http://<ESXi_host_name>/folder?dcPath=ha-datacente
VMware, Inc.
33
Datastorefilesanddirectories.Youhavetwochoicesforspecifyingadatastore:
Toavoidproblemswithdirectorynamesthatusespecialcharactersorspaces,enclosethepathinquotesfor bothoperatingsystems. Whenyourunvifs,youcanspecifytheoperationnameandargumentandoneofthestandardconnection options.Usealiases,symboliclinks,orwrapperscriptstosimplifytheinvocationsyntax. IMPORTANTTheconceptsofworkingdirectoryandlastdirectoryorfileoperatedonarenotsupportedwith vifs. Options vifscommandspecificoptionsallowyoutoretrieveanduploadfilesfromtheremotehostandperforma numberofotheroperations.Allvifsoptionsworkondatastorefilesordirectories.Someoptionsalsowork onhostfilesandfilesinthetempdirectory.Youmustalsospecifyconnectionoptions.
Command --copy -c <source> <target> Description Copiesafileinadatastoretoanotherlocation inadatastore.The<source>mustbearemote sourcepath,the<target>aremotetarget pathordirectory. The--forceoptionreplacesexisting destinationfiles. --dir -D <remote_dir> --force -F --get -g <remote_path> <local_path> Liststhecontentsofadatastoredirectory. Overwritesthedestinationfile.Usedwith --moveand--copy. DownloadsafilefromtheESXihosttothe machineonwhichyourunvCLI.This operationusesHTTP GET. ListsthedatacenterpathsavailableonanESXi system. Datastore Temp Datastore Temp Datastore Host Target Datastore Temp Syntax copy src_file_path dst_directory_path [force] copy src_file_path dst_file_path [force]
dir datastore_directory_path copy src_file_path dst_file_path [force] get src_dstore_file_path dst_local_file_path get src_d store_dir_path dst_local_file_path
--listdc -C
Datastore Host
34
VMware, Inc.
Command --listds -S
Description ListsthedatastorenamesontheESXisystem. Whenmultipledatacentersareavailable,use the--dc (-Z)argumenttospecifythename ofthedatacenterfromwhichyouwanttolist thedatastore. Createsadirectoryinadatastore.This operationfailsiftheparentdirectoryof dst_datastore_file_pathdoesnotexist. Movesafileinadatastoretoanotherlocation inadatastore.The<source>mustbearemote sourcepath,the<target>aremotetarget pathordirectory. The--forceoptionreplacesexisting destinationfiles.
mkdir dst_directory_path
Listthecurrentdatastores.
vifs <conn_options> --listds.
Thecommandliststhenamesofalldatastoresonthespecifiedserver.Forexample:
osdc-cx700-02 osdc-cx700-03 osdc-cx700-02 osdc-cx700-03 osdc-cx700-04 osdc-cx700-05
Youcanuseeachnamethathasbeenreturnedtorefertodatastorepathsbyusingsquarebracketnotation, asfollows:
'[my_datastore] dir/subdir/file'
Listthecontentsofonedirectoryinthedatastore.
vifs <conn_options> --dir '[osdc-cx700-02] winxpPro-sp2'
Thecommandliststhedirectorycontent.Inthisexample,thecommandliststhecontentsofavirtual machinedirectory.
Content Listing _________________ vmware-37.log vmware-38.log ... vmware.log ... winxpPro-sp2.vmdk winxpPro-sp2.vmx winxpPro-sp2.vmxf ...
VMware, Inc.
35
Listthecontentsofoneofthedatastores.
vifs <conn_options> --dir '[osdc-cx700-02]'
Thecommandliststhecompletecontentsofthedatastore. 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'
Moveafileintoavirtualmachinedirectory.
vifs <conn_options> --move '[osdc-cx700-03] vcli_test/test_doc' '[osdc-cx700-03] winxpPro-sp2/test_doc
Cleanupbyremovingthefileanddirectoryyoucreatedearlier.
vifs <conn_options> --rm '[osdc-cx700-03] vcli_test/test_doc' vifs <conn_options> --rmdir '[osdc-cx700-03] vcli_test'
36
VMware, Inc.
Managing Storage
Introduction to Storage
FibreChannelSANarrays,iSCSISANarrays,andNASarraysarewidelyusedstoragetechnologiessupported byVMwarevSpheretomeetdifferentdatacenterstorageneeds.Thestoragearraysareconnectedtoand sharedbetweengroupsofserversthroughstorageareanetworks.Thisarrangementallowsaggregationofthe storageresourcesandprovidesmoreflexibilityinprovisioningthemtovirtualmachines.
VMware, Inc.
37
server group 1
server group 2
server group 3
ESX/ESXi
local ethernet SCSI bre channel HBA SAN iSCSI hardware initiator LAN software initiator ethernet NIC LAN ethernet NIC LAN
VMFS
Key
physical disk
datastore VMFS fibre array VMFS iSCSI array NFS NAS appliance
virtual disk
38
VMware, Inc.
YoucanusevCLIcommandstomanagethevirtualmachinefilesystemandstoragedevices.
LUNs.Useesxcli storage coreorvicfg-scsidevscommandstodisplayavailableLUNsand mappingsforeachVMFSvolumetoitscorrespondingpartition.SeeExaminingLUNsonpage 40. Pathmanagement.Useesxcli storage coreorvicfg-mpathcommandstolistinformationabout FibreChanneloriSCSILUNsandtochangeapathsstate.SeeManagingPathsonpage 42.Usethe ESXCLIcommandtoviewandmodifypathpolicies.SeeManagingPathPoliciesonpage 45. Rescan.Useesxcli storage coreorvicfg-rescanadapter rescantoperformarescan operationeachtimeyoureconfigureyourstoragesetup.SeeScanningStorageAdapterson page 52.
Storagedevices.Severalcommandsmanageonlyspecificstoragedevices.
Datastores
ESXihostsusestoragespaceonavarietyofphysicalstoragesystems,includinginternalandexternaldevices andnetworkedstorage.Ahostcandiscoverstoragedevicestowhichithasaccessandformatthemas datastores.Eachdatastoreisaspeciallogicalcontainer,analogoustoafilesystemonalogicalvolume,where thehostplacesvirtualdiskfilesandothervirtualmachinefiles.Datastoreshidespecificsofeachstorage productandprovideauniformmodelforstoringvirtualmachinefiles. Dependingonthetypeofstorageyouuse,datastorescanbebackedbythefollowingfilesystemformats:
VMware, Inc.
39
Examining LUNs
ALUN(LogicalUnitNumber)isanidentifierforadiskvolumeinastoragearraytarget.
storage array
storage array
Listalllogicaldevicesknownonthissystemwithdetailedinformation.
esxcli <conn_options> storage core device list
... 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
VMware, Inc.
41
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 81.ThissectionassumesyouareusingonlyPSApluginsincludedin vSpherebydefault.
42
VMware, Inc.
HBA2
HBA1
HBA3
HBA4
switch
switch
SP1
SP2
storage array
Listpathinformationwithvicfg-mpathoresxcli storage core path.SeeListingPathInformation onpage 43. Changepathstatewithvicfg-mpathoresxcli storage core path.SeeChangingtheStateofaPath onpage 45. IMPORTANTUseESXCLIforESXi5.0.Usevicfg-mpathforESX/ESXi4.0orlater.Usevicfg-mpath35 forESX/ESXi3.5.
ChangepathpolicieswithESXCLI.SeeSettingPolicyDetailsforDevicesthatUseRoundRobinon page 47. MaskpathswithESXCLI.SeethevSphereStoragedocumentation. Manipulatetherulesthatmatchpathstomultipathingpluginstonewlydiscovereddeviceswithesxcli claimrule.SeeManagingClaimRulesonpage 89. Runorrerunclaimrulesorunclaimpaths.SeeManagingClaimRulesonpage 89. Rescanwithvicfg-rescan.SeeScanningStorageAdaptersonpage 52.
VMware, Inc.
43
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
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...
44
VMware, Inc.
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
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.
45
VMW_PSP_RR
RoundRobin
Nofailback.
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
46
VMware, Inc.
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.
Ifnecessary,changethepreferredpath.
esxcli <conn_options> storage nmp psp fixed deviceconfig set --device naa.xxx --path vmhba3:C0:T5:L3
Thecommandsetsthepreferredpathtovmhba3:C0:T5:L3
VMware, Inc.
47
To view and manipulate round robin path selection settings with ESXCLI 1 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.
48
VMware, Inc.
DeleteoneoftheNASfilesystems.
esxcli <conn_options> storage nfs remove --volume-name=FileServerHome2
ThiscommandunmountstheNASfilesystemandremovesitfromthelistofknownfilesystems.
ForeachNASfilesystem,thecommandliststhemountname,sharename,andhostnameandwhether thefilesystemismounted.IfnoNASfilesystemsareavailable,thesystemreturnsthefollowingmessage:
No NAS datastore found
AddanewNASfilesystemtotheESXihost.
vicfg-nas <conn_options --add nfsstore-dir42
DeleteoneoftheNASfilesystems.
vicfg-nas <conn_options> -d FileServerHome1
ThiscommandunmountstheNASfilesystemandremovesitfromthelistofknownfilesystems.
VMware, Inc.
49
ForESXi5.0hosts,youcanmigratevirtualmachinesthathavesnapshots.ForearlierversionsofESXi,you cannotmigratevirtualmachinesthathavesnapshots. Virtualmachinedisksmustbeinpersistentmodeorberawdevicemappings(RDMs).Forphysicaland virtualcompatibilitymodeRDMs,youcanmigratethemappingfileonly.Forvirtualcompatibilitymode RDMs,youcanusethevSphereClienttoconverttothickprovisionedorthinprovisioneddisksduring migrationaslongasthedestinationisnotanNFSdatastore.Youcannotusethesvmotioncommandto performthisconversion. ThehostonwhichthevirtualmachineisrunningmusthavealicensethatincludesStoragevMotion. ESX/ESXi3.5hostsmustbelicensedandconfiguredforvMotion.ESX/ESXi4.0andlaterhostsdonot requirevMotionconfigurationtoperformmigrationwithStoragevMotion. Thehostthevirtualmachineisrunningonmusthaveaccesstoboththesourceandtargetdatastores. AparticularhostcanbeinvolvedinuptofourmigrationswithvMotionorStoragevMotionatonetime. SeeLimitsonSimultaneousMigrationsinthevCenterServerandHostManagementdocumentationfor details.
IfyouusethevSphereClientformigrationwithsvmotion,thesystemperformsseveralcompatibilitychecks. ThesechecksarenotsupportedbythesvmotionvCLIcommand.
Whenyouuse--interactive,allotheroptionsareignored. IMPORTANTWhenrespondingtotheprompts,usequotesaroundinputstringswithspecialcharacters.
50 VMware, Inc.
Squarebracketsindicateoptionalelements,notdatastores. The--vmoptionspecifiesthevirtualmachineanditsdestination.Bydefault,allvirtualdisksarerelocatedto thesamedatastoreasthevirtualmachine.Thisoptionrequiresthecurrentvirtualmachineconfigurationfile location.SeeTodeterminethepathtothevirtualmachineconfigurationfileanddiskfileonpage 51. The--disksoptionrelocatesindividualvirtualdiskstodifferentdatastores.The--disksoptionrequiresthe currentvirtualdiskdatastorepathasanoption.SeeTodeterminethepathtothevirtualmachine configurationfileanddiskfileonpage 51. 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.
TheexampleisforWindows.UsesinglequotesonLinux. To relocate a virtual machines configuration file, but leave virtual disks 1 2 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'
TouseFCoE,youneedtoinstallFCoEadapters.TheadaptersthatVMwaresupportsgenerallyfallintotwo categories,hardwareFCoEadaptersandsoftwareFCoEadapters.
vicfg-rescansupportsonlyasimplerescanoperationonaspecifiedadapter.
Thecommandreturnsanindicationofsuccessorfailure,butnodetailedinformation.
52
VMware, Inc.
53
iSCSIStorageOverviewonpage 53 ProtectinganiSCSISANonpage 55 CommandSyntaxforesxcliiscsiandvicfgiscsionpage 57 iSCSIStorageSetupwithESXCLIonpage 62 iSCSIStorageSetupwithvicfgiscsionpage 67 ListingandSettingiSCSIOptionsonpage 71 ListingandSettingiSCSIParametersonpage 72 EnablingiSCSIAuthenticationonpage 76 SettingUpPortsforiSCSIMultipathingonpage 77 ManagingiSCSISessionsonpage 78
SeethevSphereStoragedocumentationforadditionalinformation.
SeethevSphereStoragedocumentationfordetailsonsetupandfailoverscenarios.
VMware, Inc.
53
ThehostontheleftusesanindependenthardwareiSCSIadaptertoconnecttotheiSCSIstoragesystem. ThehostontherightusessoftwareiSCSI.
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.
54
VMware, Inc.
TheIQNnameusesthefollowingformat:
iqn.yyyy-mm.{reversed domain name}:id_string
VMware, Inc.
55
chapDiscouraged
chapPreferred
chapRequired
56
VMware, Inc.
esxcli iscsi adapter auth chap [get|set] esxcli iscsi adapter discovery sendtarget auth chap [get|set] esxcli iscsi adapter target portal auth chap [get|set]
Inheritanceisrelevantonlyifyouwanttoreturnadynamicdiscoveryaddressorastaticdiscoverytargetto itsinheritedvalue.Inthatcase,useoneofthefollowingcommands:
Dynamicdiscovery:esxcli iscsi adapter discovery sendtarget auth chap set --inherit Staticdiscovery:esxcli iscsi adapter target portal auth chap set --inherit.
VMware, Inc.
57
58
VMware, Inc.
-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> --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> --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> -D --discovery -a -i <stor_ip_addr|stor_hostname[:<portnum>] <adapter_name> --add --ip <stor_ip_addr|stor_hostname> [:<portnum>] <adapter_name> -D --discovery -l <adapter_name> --list <adapter_name> -D --discovery -r -i <stor_ip_addr|stor_hostname>[:<portnum>] <adapter_name> --remove --ip <stor_ip_addr|stor_hostname> [:<portnum>] <adapter_name> -H -l [<adapter_name>] --list [<adapter_name>] -L --lun -l <adapter_name> --list <adapter_name> ListsLUNinformation. ListsalliSCSIadaptersora specifiedadapter. Removesadynamicdiscovery address. Listsdynamicdiscovery addresses. Addsadynamicdiscovery address. Listssupportedauthentication methods. Enablesauthenticationusingthe specifiedoptions. Enablesmutualauthentication. Youmustenableauthentication beforeyoucanenablemutual authentication.
VMware, Inc.
59
60
VMware, Inc.
-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> -P --phba -l <adapter_name> --list <adapter_name> -T --target -l <adapter_name> --list <adapter_name> -W parameter -l [-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name]] <adapter_name> --list [--ip <stor_ip_addr|stor_hostname> [:<portnum>] [--name <iscsi_name]] <adapter_name> -W parameter -l -k [-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name]] <adapter_name> --list --detail [--ip <stor_ip_addr|stor_hostname> [:<portnum>] [--name <iscsi_name]] <adapter_name> -W parameter -W -j <name>=<value> -i <stor_ip_addr|stor_hostname> [:port_num>] [-n <iscsi_name>]] <adapter_name> --parameter --set <name>=<value> --ip <stor_ip_addr|stor_hostname> [:port_num>] [--name <iscsi_name>]] <adapter_name> -W parameter -W -o <param_name> -i <stor_ip_addr|stor_hostname> [:port_num>] [-n <iscsi_name>]] <adapter_name> -parameter --reset <param_name> -ip <stor_ip_addr|stor_hostname> [:port_num>] [-name <iscsi_name>]] <adapter_name> -z --reset_auth -a -z -m <auth_method> -b [-i <stor_ip_addr|stor_hostname> [:<portnum>] [-n <iscsi_name>]] <adapter_name> --authentication --reset_auth --method <auth_method> [--ip <stor_ip_addr|stor_hostname> [:<portnum>] [--name <iscsi_name>]] <adapter_name> Resetstargetlevelauthentication propertiestobeinheritedfrom adapterlevel.Usedwiththe --authenticationoption. Returnsparametersindiscovery targetorsendtargettodefault inheritancebehavior. SetsiSCSIparameters. ListsiSCSIparameterdetails. ListsiSCSIparameter information. Liststargetinformation. Listsexternal,vendorspecific propertiesofaniSCSIadapter. Addsastaticdiscoveryaddress.
VMware, Inc.
61
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>
62
VMware, Inc.
Adapterlevel CHAP
esxcli iscsi adapter auth chap set --direction=uni --chap_username=<name> --chap_password=<pwd> --level=[prohibited, discouraged, preferred, required] --secret=<string> --adapter=<vmhba> esxcli iscsi adapter discovery sendtarget auth chap set --direction=uni --chap_username=<name> --chap_password=<pwd> --level=[prohibited, discouraged, preferred, required] --secret=<string> --adapter=<vmhba> --address<sendtarget_address> esxcli iscsi adapter target portal auth chap set --direction=uni --chap_username=<name> --chap_password=<pwd> --level=[prohibited, discouraged, preferred, required] --secret=<string> --adapter=<vmhba> --name<iscsi_iqn_name>
Discoverylevel CHAP
Targetlevel CHAP
(Optional)SettheauthenticationinformationformutualCHAPbyrunningesxcli iscsi adapter auth chap set againwith--directionsettomutualandadifferentauthenticationusernameand secret. Adapterlevel CHAP
esxcli iscsi adapter auth chap set --direction=mutual --mchap_username=<name2> --mchap_password=<pwd2> --level=[prohibited required] --secret=<string2> --adapter=<vmhba> esxcli iscsi adapter discovery sendtarget auth chap set --direction=mutual --mchap_username=<name2> --mchap_password=<pwd2> --level=[prohibited, required] --secret=<string2> --adapter=<vmhba> --address=<sendtarget_address> eesxcli iscsi adapter target portal auth chap set --direction=mutual --mchap_username=<nam2e> --mchap_password=<pwd2> --level=[prohibited required] --secret=<string2> --adapter=<vmhba> --name=<iscsi_iqn_name>
Discoverylevel CHAP
Targetlevel CHAP
SeeListingandSettingiSCSIParametersonpage 72 10 Aftersetupiscomplete,performrediscoveryandrescanallstoragedevices.Forexample:
esxcli <conn_options> iscsi adapter discovery rediscover esxcli <conn_options> storage core adapter rescan --adapter=vmhba36
VMware, Inc.
63
11
(Optional)IfyouwanttomakeadditionaliSCSIloginparameterchanges(seeListingandSettingiSCSI Parametersonpage 72),youmustlogoutofthecorrespondingiSCSIsessionandlogbackin. a b Runesxcli iscsi session removetologout. Runesxcli iscsi session addorrescantheadaptertoaddthesessionback.
(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>
64
VMware, Inc.
Adapterlevel CHAP
esxcli iscsi adapter auth chap set --direction=uni --chap_username=<name> --chap_password=<pwd> --level=[prohibited, discouraged, preferred, required] --secret=<string> --adapter=<vmhba> esxcli iscsi adapter discovery sendtarget auth chap set --direction=uni --chap_username=<name> --chap_password=<pwd> --level=[prohibited, discouraged, preferred, required] --secret=<string> --adapter=<vmhba> --address<sendtarget_address> esxcli iscsi adapter target portal auth chap set --direction=uni --chap_username=<name> --chap_password=<pwd> --level=[prohibited, discouraged, preferred, required] --secret=<string> --adapter=<vmhba> --name<iscsi_iqn_name>
Discoverylevel CHAP
Targetlevel CHAP
(Optional)SettheauthenticationinformationformutualCHAPbyrunningesxcli iscsi adapter auth chap set againwith--directionsettomutualandadifferentauthenticationusernameand secret. Adapterlevel CHAP
esxcli iscsi adapter auth chap set --direction=mutual --mchap_username=<name> --mchap_password=<pwd> --level=[prohibited required] --secret=<string2> --adapter=<vmhba> esxcli iscsi adapter discovery sendtarget auth chap set --direction=mutual --mchap_username=<name> --mchap_password=<pwd> --level=[prohibited, required] --secret=<string2> --adapter=<vmhba> --address=<sendtarget_address> esxcli iscsi adapter target portal auth chap set --direction=mutual --mchap_username=<name> --mchap_password=<pwd> --level=[prohibited required] --secret=<string2> --adapter=<vmhba> --name=<iscsi_iqn_name>
Discoverylevel CHAP
Targetlevel CHAP
SeeListingandSettingiSCSIParametersonpage 72 8 Aftersetupiscomplete,performrediscoveryandrescanallstoragedevices.Forexample:
esxcli <conn_options> iscsi adapter discovery rediscover esxcli <conn_options> storage core adapter rescan --adapter=vmhba36
VMware, Inc.
65
(Optional)IfyouwanttomakeadditionaliSCSIloginparameterchanges(seeListingandSettingiSCSI Parametersonpage 72),youmustlogoutofthecorrespondingiSCSIsessionandlogbackin. a b Runesxcli iscsi session removetologout. Runesxcli iscsi session addorrescantheadaptertoaddthesessionback.
(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]>
66
VMware, Inc.
Adapterlevel CHAP
esxcli iscsi adapter auth chap set --direction=uni --chap_username=<name> --chap_password=<pwd> --level=[prohibited, discouraged, preferred, required] --secret=<string> --adapter=<vmhba> esxcli iscsi adapter discovery sendtarget auth chap set --direction=uni --chap_username=<name> --chap_password=<pwd> --level=[prohibited, discouraged, preferred, required] --secret=<string> --adapter=<vmhba> --address<sendtarget_address> esxcli iscsi adapter target portal auth chap set --direction=uni --chap_username=<name> --chap_password=<pwd> --level=[prohibited, discouraged, preferred, required] --secret=<string> --adapter=<vmhba> --name<iscsi_iqn_name>
Discoverylevel CHAP
Targetlevel CHAP
EnablesoftwareiSCSIfortheHBA.
vicfg-iscsi <conn_options> --swiscsi --enable
VMware, Inc.
67
(Optional)Checkthestatus.
vicfg-iscsi <conn_options> --swiscsi --list
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>
Thetarget(-i)andname(-n)optiondeterminewhatthecommandappliesto.
Option -iandn Onlyi Neither-inorn Result CommandappliestopertargetCHAPforstatictargets. Commandappliestothediscoveryaddress. CommandappliestoperadapterCHAP.
68
VMware, Inc.
(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>
Thetarget(-i)andname(-n)optiondeterminewhatthecommandappliesto.
Option -iandn Onlyi Neither-inorn Result CommandappliestopertargetCHAPforstatictargets. Commandappliestothediscoveryaddress. CommandappliestoperadapterCHAP.
VMware, Inc.
69
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>
70
VMware, Inc.
Withstaticdiscovery,youmustspecifytheIPaddressandtheiSCSInameofthestoragetargettobe added.Runthefollowingcommand:
vicfg-iscsi <conn_options> --static --add --ip <ip_addr> --name <iscsi_name> <adapter_name>
Thetarget(-i)andname(-n)optiondeterminewhatthecommandappliesto.
Option -iandn Onlyi Neither-inorn Result CommandappliestopertargetCHAPforstatictargets. Commandappliestothediscoveryaddress. CommandappliestoperadapterCHAP.
Thesystemreturnsinformationaboutthevendor,model,description,andserialnumberoftheHBA.
esxcli iscsi adapter target portallistsandsetsauthenticationandportalparameters. esxcli iscsi adapter target listlistsLUNinformation.
VMware, Inc.
71
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.
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.
ThesystemreturnsinformationabouttheMACaddress,MTU,andcurrenttransferrate.
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>
72
VMware, Inc.
esxcli iscsi adapter target portal param set --adapter=<vmhba> --key=<key> --value=<value> --address=<address> --name=<iqn.name> esxcli iscsi adapter discovery sendtarget param set --adapter=<vmhba> --key=<key> --value=<value> --address=<address>
Table 56listsallsettableparameters.TheseparametersarealsodescribedintheIETFrfc3720.Youcanrun esxcli iscsi adapter param gettodeterminewhetheraparameterissettableornot. TheparametersinTable 56applytosoftwareiSCSIanddependenthardwareiSCSI. Table 5-5. Settable iSCSI Parameters
Parameter DataDigestType Description Increasesdataintegrity.Whendatadigestisenabled,thesystemperformsachecksumover eachPDUsdatapartandverifiesusingtheCRC32Calgorithm. Note:SystemsthatuseIntelNehalemprocessorsoffloadtheiSCSIdigestcalculationsfor softwareiSCSI,thusreducingtheimpactonperformance. ValidvaluesaredigestProhibited,digestDiscouraged,digestPreferred,or digestRequired. HeaderDigest Increasesdataintegrity.Whenheaderdigestisenabled,thesystemperformsachecksumover theheaderpartofeachiSCSIProtocolDataUnit(PDU)andverifiesusingtheCRC32C algorithm. MaxOutstandingR2TdefinestheReadytoTransfer(R2T)PDUsthatcanbeintransitionbefore anacknowledgementPDUisreceived. MaximumamountofunsoliciteddataaniSCSIinitiatorcansendtothetargetduringthe executionofasingleSCSIcommand,inbytes. MaximumSCSIdatapayloadinaDataInorasolicitedDataOutiSCSIsequence,inbytes. Maximumdatasegmentlength,inbytes,thatcanbereceivedinaniSCSIPDU. Timeinterval,inseconds,betweenNOPOutrequestssentfromyouriSCSIinitiatortoaniSCSI target.TheNOPOutrequestsserveasthepingmechanismtoverifythataconnectionbetween theiSCSIinitiatorandtheiSCSItargetisactive. Supportedonlyattheinitiatorlevel. NoopTimeout Amountoftime,inseconds,thatcanlapsebeforeyourhostreceivesaNOPInmessage.The messageissentbytheiSCSItargetinresponsetotheNOPOutrequest.Whenthe NoopTimeoutlimitisexceeded,theinitiatorterminatesthecurrentsessionandstartsanew one. Supportedonlyattheinitiatorlevel. RecoveryTimeout DelayedAck Amountoftime,inseconds,thatcanlapsewhileasessionrecoveryisperformed.Ifthetimeout exceedsitslimit,theiSCSIinitiatorterminatesthesession. Allowssystemstodelayacknowledgmentofreceiveddatapackets.
YoucanusethefollowingESXCLIcommandstolistparameteroptions.
Runesxcli iscsi adapter param gettolistparameteroptionsfortheiSCSIadapter. 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.
Dynamictarget:esxcli iscsi adapter discovery sendtarget param set Statictarget:esxcli iscsi adapter target portal param set
74
VMware, Inc.
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 -iandn Onlyi Neither-inorn Result Commandappliestostatictargets. Commandappliestothediscoveryaddress. 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 -iandn Onlyi Neither-inorn Result CommandappliestopertargetCHAPforstatictargets. Commandappliestothediscoveryaddress. CommandappliestoperadapterCHAP.
VMware, Inc.
75
YoucansetpertargetCHAPforstatictargets,peradapterCHAP,orapplythecommandtothediscovery address.
peradapterCHAP:esxcli iscsi adapter auth chap set perdiscoveryCHAP:esxcli iscsi adapter discovery sendtarget auth chap set pertargetCHAP:esxcli iscsi adapter target portal auth chap set
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.
Thespecifiedchap_usernameandsecretmustbesupportedonthestorageside. 2 ListpossibleVMkernelNICstobind.
esxcli <conn_options> iscsi logicalnetworkportal list
76
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.
Aftersetupiscomplete,performrediscoveryandrescanallstoragedevices.Forexample:
esxcli <conn_options> iscsi adapter discovery rediscover esxcli <conn_options> storage core adapter rescan --adapter=vmhba36
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.
Aftersetupiscomplete,performrediscoveryandrescanallstoragedevices.
VMware, Inc.
77
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>
4 5
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.
78 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.
79
RemovesessionsfromthecurrentsoftwareiSCSIordependenthardwareiSCSIconfigurationwithtarget andsessionID.
esxcli <conn_options> iscsi session remove --name=<iqn.xxxx> --isid=<session id> --adapter=<iscsi_adapter>
80
VMware, Inc.
VMwarepartnersandcustomerscanoptimizeperformanceoftheirstoragearraysinconjunctionwith VMwarevSphereusingVMwarePSA(pluggablestoragearchitecture).Theesxcli storage core namespacemanagesVMwarePSAandtheesxcli storage nmpnamespacemanagestheVMwareNMP plugin. ThevSphereStoragedocumentationdiscussesPSAfunctionalityindetailandexplainshowtousethevSphere ClienttomanagethePSA,theassociatednativemultipathingplugin(NMP)andthirdpartypluginswiththe vSphereClient. Thischapterusesthefollowingacronyms.
Acronym PSA NMP PSP SATP Meaning PluggableStorageArchitecture. NativeMultipathingPlugin.GenericVMwaremultipathingmodule. PathSelectionPlugin.Handlespathselectionforagivendevice. StorageArrayTypePlugin.Handlespathfailoverforagivenstoragearray.
Thischapterincludesthesetopics:
VMware, Inc.
81
IfadevicedoesnothaveaspecificPSPset,italwaysusesthePSPassignedtotheSATP.IfthedefaultPSP fortheSATPchanges,thePSPassignedtothedevicechangesonlyafterrebootorafteradeviceis reclaimed.Adeviceisreclaimedwhenyouunclaimallpathsforthedeviceandreclaimthepaths. Ifyouuseesxcli storage nmp device settooverridetheSATPsdefaultPSPwithaspecificPSP,the PSPchangesimmediatelyandremainstheuserdefinedPSPacrossreboots.AchangeintheSATPsPSP hasnoeffect.
Usethe--defaultoptiontoreturnthedevicetousingtheSATPsPSP.
Options --default -E --device <device> -d <device> --psp <PSP> -P <PSP> Description SetsthePSPbacktothedefaultfortheSATPassignedtothisdevice. DevicetosetthePSPfor. PSPtoassigntothespecifieddevice.Callesxcli storage nmp psp listtodisplayall currentlyavailablePSPs.SeeTable 41,SupportedPathPolicies,onpage 46. SeevSphereStorageforadiscussionofpathpolicies.
TosetthepathpolicyforthespecifieddevicetoVMW_PSP_FIXED,runthefollowingcommand:
esxcli <conn_options> storage nmp device set --device naa.xxx --psp VMW_PSP_FIXED
Onlyshowpathstoasingedevice(esxcli storage nmp path list --device <device>). Onlyshowinformationforasinglepath(esxcli storage nmp path list --path=<path>.
Managing Path Selection Policy Plugins with esxcli storage nmp psp
Useesxcli storage nmp psptomanageVMwarepathselectionpolicypluginsincludedwiththeVMware NMPpluginandtomanagethirdpartyPSPs. IMPORTANTWhenusedwiththirdpartyPSPs,thesyntaxdependsonthethirdpartyPSPimplementation.
82
VMware, Inc.
Usenmp pspgeneric deviceconfig getforPSPsthataresettoVMW_PSP_RR,VMW_PSP_FIXEDor VMW_PSP_MRU. Usenmp pspgeneric pathconfig getforPSPsthataresettoVMW_PSP_FIXEDorVMW_PSP_MRU.No pathconfigurationinformationisavailableforVMW_PSP_RR.
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
VMware, Inc.
83
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.
84
VMware, Inc.
Managing SATPs
Theesxcli storage nmp satpcommandsmanageSATPs.Youcanusethesecommandstoperformthe followngtasks:
ThedefaultSATPforanactiveactiveFCarraywithavendorandmodelnotlistedintheSATPrulesis VMW_SATP_DEFAULT_AA.
VMware, Inc.
85
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"
86
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*
Youcanspecifyoneofthefollowingdeviceconfigurationstrings:
--device -d --path -p
DevicetosetSATPconfigurationfor.NotallSATPssupportthesetconfigoptionondevices. PathtosetSATPconfigurationfor.NotallSATPssupportthesetconfigoptiononpaths.
VMware, Inc.
87
Attemptstounclaimallpathstoadevice. Runstheloadedclaimrulesoneachoftheunclaimedpathstoreclaimthosepaths.
88
VMware, Inc.
Options --device <device> -d <device> --driver <driver> -D <driver> --lun <lun_number> -L <lun_number> --model <model> -m <model> --path <path> -p <path> --plugin <plugin> -P
Description If--typeissettodevice,attemptstounclaimallpathstothespecifieddevice.Ifthere areactiveI/Ooperationsonthespecifieddevice,atleastonepathcannotbeunclaimed. If--typeisdriver,unclaimsallpathsspecifiedbythisHBAdriver. If--typeislocation,specifiestheSCSILUNforthepathstounclaim.Ifyoudonot specify--lun,unclaimingrunsonpathswithanyLUNnumber. If--typeisvendor,attemptstounclaimallpathstodeviceswithspecificmodel information(formultipathingplugins)orunclaimthedeviceitself(forfilterplugins).If thereareactiveI/Ooperationsonthisdevice,atleastonepathfailstounclaim. If--typeispath,unclaimsapathspecifiedbyitspathUIDorruntimename. If--typeisplugin,unclaimsallpathsforaspecifiedmultipathplugin. <plugin>canbeanyvalidPSApluginonthesystem.BydefaultonlyNMPand MASK_PATHareavailable,butadditionalpluginsmightbeinstalled. If--typeislocation,unclaimsthepathswiththeSCSItargetnumberspecifiedby target.Ifyoudonotspecify--target,unclaimingrunsonpathsfromalltargets. Typeofunclaimoperationtoperform.Validvaluesarelocation,path,driver, device,plugin,andvendor. If--typeisvendor,attemptstounclaimallpathstodeviceswithspecificvendorinfo formultipathingpluginsorunclaimthedeviceitselfforfilterplugins.Ifthereareany activeI/Ooperationsonthisdevice,atleastonepathfailstounclaim
Thefollowingtroubleshootingcommandtriestounclaimallpathsonvmhba1.
esxcli <conn_options> storage core claiming unclaim --type location -A vmhba1
VMware, Inc.
89
Options --adapter <adapter> -A <adapter> --autoassign -u --channel <channel> -C <channel> --claimrule-class <cl> -c <cl>
Description Adapterofthepathstouse.Validonlyif--typeislocation. Addsaclaimrulebasedonitscharacteristics.Therulenumberisnotrequired. Channelofthepathstouse.Validonlyif--typeislocation. Claimruleclasstouseinthisoperation.YoucanspecifyMP(default),Filter,orVAAI. Toconfigurehardwareaccelerationforanewarray,addtwoclaimrules,oneforthe VAAIfilterandanotherfortheVAAIplugin.SeevSphereStoragefordetailed instructions. DriverfortheHBAofthepathstouse.Validonlyif--typeisdriver. Forceclaimrulestoignorevaliditychecksandinstalltherule. LUNofthepathstouse.Validonlyif--typeislocation. Modelofthepathstouse.Validonlyif--typeisvendor. ValidvaluesarevaluesoftheModelstringfromtheSCSIinquirystring.Run vicfg-scsidevs <conn_options> -loneachdevicetoseemodelstringvalues. PSAplugintouse.Currently,thevaluesareNMPorMASK_PATH,butthirdpartiescan shiptheirownPSApluginsinthefuture. MASK_PATHreferstothepluginMASK_PATH_PLUGIN.Thecommandaddsclaimrules forthispluginiftheuserwantstomaskthepath. ESX3.5includestheMaskLUNsadvancedconfigurationoption.Thisoptionisnot availableinESX/ESXi4.xandESXi5.0.Ithasbeenreplacedbythe MASK_PATH_PLUGIN.YoucanaddaclaimrulethatcausestheMASK_PATH_PLUGINto claimthepathtomaskapathorLUNfromthehost.SeethevSphereStorage documentationfordetails.
--driver <driver> -D <driver> --force -f --lun <lun_number> -L <lun_number> --model <model> -M <model> --plugin -P
RuleIDtouse.Runesxcli storage core claimrule listtoseetheruleID.The ruleIDindicatestheorderinwhichtheclaimruleistobeevaluated.Userdefined claimrulesareevaluatedinnumericorderstartingwith101. Targetofthepathstouse.Validonlyif--typeislocation. Transportofthepathstouse.Validonlyif--typeistransport.Thefollowingvalues aresupported:
blockblockstorage fcFibreChannel iscsivendoriSCSI iscsinotcurrentlyused ideIDEstorage sasSASstorage sataSATAstorage usbUSBstorage parallelparallel unknown
--wwnn --wwpn
90
VMware, Inc.
Claimrulesarenumberedasfollows.
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.
91
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 --commit -C Description ForcesLUNmaskconfigurationchangestobesaved.Ifyoucallthecommandwithoutthis parameter,changesarenotsaved,andyoucanfirstinspectthegeneratedclaimrules.
Thefollowingexampleremovesrule1015.
esxcli <conn_options> storage core claimrule remove -r 1015
92
VMware, Inc.
Quiescethedevicesthatusepathsforwhichyouwanttochangetheruleandunclaimthosepaths.
esxcli <conn_options> storage core claiming unclaim --device=<device>
Runpathclaimingrules.
esxcli <conn_options> storage core claimrule run
Thiscommandisalsousedfortroubleshootingandboottimeconfiguration.
Options --adapter <adapter> -A <adapter> --channel <channel> -C <channel> --claimrule-class -c --lun <lun> -L <lun> --path <path_UID> -p <path_UID> --target <target> -T <target> Description If--typeislocation,nameoftheHBAforthepathstoruntheclaimruleson.To runclaimrulesonpathsfromalladapters,omitthisoption. If--typeislocation,valueoftheSCSIchannelnumberforthepathstorunthe claimruleson.Torunclaimrulesonpathswithanychannelnumber,omitthis option. Claimruleclasstouseinthisoperation. If--typeislocation,valueoftheSCSILUNforthepathstorunclaimruleson.To runclaimrulesonpathswithanyLUN,omitthisoption. If--typeispath,thisoptionindicatestheuniquepathidentifier(UID)orthe runtimenameofapathtorunclaimruleson. If--typeislocation,valueoftheSCSItargetnumberforthepathstorunclaim ruleson.Torunclaimrulesonpathswithanytargetnumber,omitthisoption
VMware, Inc.
93
Description Typeofclaimtoperform.Bydefault,usesall,whichmeansclaimrulesrunwithout restrictiontospecificpathsorSCSIaddresses.Validvaluesarelocation,path,and all. Youcanusethisoptiononlyifyoualsouse--typeall. Iftheoptionisincluded,theclaimwaitsforpathstosettlebeforerunningtheclaim operation.Inthatcase,thesystemdoesnotstarttheclaimingprocessuntilitislikely thatallpathsonthesystemhaveappearedbeforestartingtheclaimprocess. Aftertheclaimingprocesshasstarted,thecommanddoesnotreturnuntildevice registrationhascompleted. Ifyouaddorremovepathsduringtheclaimingorthediscoveryprocess,thisoption mightnotworkcorrectly.
94
VMware, Inc.
Managing Users
VMware, Inc.
95
ManageusersdefinedonESXiwiththevSphereClient,thevSphereWebServicesSDK,orvicfg-user. ManagevCenterServeruserswiththevSphereClientorthevSphereWebServicesSDK.
96
VMware, Inc.
EveniftheuserlistsofahostandavCenterServersystemappeartohavecommonusers(forinstance,auser calleddevuser),theseusersareseparateuserswiththesamename.TheattributesofdevuserinvCenter Server,includingpermissions,passwords,andsoforth,areseparatefromtheattributesofdevuserontheESXi host.IfyoulogintovCenterServerasdevuser,youmighthavepermissiontoviewanddeletefilesfroma datastore.IfyoulogintoanESXihostasdevuser,youmightnothavethesepermissions. UsersauthorizedtoworkdirectlyonanESXihostareaddedtotheinternaluserlistwhenESXiisinstalledor canbeaddedbyasystemadministratorafterinstallation.Youcanusevicfg-usertoaddusers,removeusers, changepasswords,setgroupmembership,andconfigurepermissions. CAUTIONSeetheAuthenticationandUserManagementchapterofvSphereSecurityforinformationaboutroot usersbeforeyoumakeanychangestothedefaultusers.Mistakesregardingrootuserscanhaveseriousaccess consequences. EachESXihosthasseveraldefaultusers:
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
Listtheexistinggroups.
vicfg-user <conn_options> -e group -o list
Thesystemprintsanextensivelistofallgroupsandtheusersineachgroup. 7 Createagroup.
vicfg-user <conn_options> -e group -o add -d test
Thesystemaddsthegroup,andassignsagroupID.Whenyounowlistallgroups,thenewgroupis included.
---------Group Information: Principal -: test Full Name -: GID -: 500 ----------
Adduseruser27tothenewgroup.
vicfg-user <conn_options> -e user -o modify -l user27 -g test
Thesystemassignstheusertothegrouptest.Whenyounowlistallgroups,thenewgroupandthe assigneduserareincluded.
---------Group Information: Principal -: test Full Name -: GID -: 500 Users in group test: Principal -: user27 Full Name -: ___________
RemovetheuserwithloginIDuser27.
vicfg-user <conn_options> -e user -o delete -l user27
Thesystemremovestheuserandprintsamessage.
Removed the user user27 successfully.
UsetheUsersandGroupstabinavSphereClientconnecteddirectlytothehost. Usethevicfg-uservCLIcommand.
IMPORTANTManageausereitherwiththevSphereClientorwiththevCLIcommand.
98
VMware, Inc.
Addgroup40totheexistinggroups.IfyoudonotspecifyagroupID,thesystemassignsanIDforthe group.
vicfg-user <conn_options> -e group -o add -d group40 -D 55
Createagroupwithpredefinedreadonlyprivilegesthatyoucanlaterusetoassignreadonlyprivileges tomultipleusers.
vicfg-user <conn_options> --entity group --operation add --group group42 --groupid 4242 --role read-only
Youcanthenaddandremoveusersfromthegroup,asinthefollowingexamplescenario.Specifyoneofthe optionslistedinConnectionOptionsonpage 17inplaceof<conn_options>. To add and remove users from groups 1 Addauserwithusernametesttoagroupgroup42.
vicfg-user <conn_options> -e group -o modify -d group42 --adduser test
Youmustspecifytheusernametoaddausertoagroup.TheuserIDisnotacceptable. 2 Adduserswithusernamesu1,u2,andu3togroup45,whichhasreadonlyprivileges.
vicfg-user <conn_options> -e group -o modify -d group45 --adduser u1,u2,u3
Removetheuserwithusernameu3fromthegroup.
vicfg-user <conn_options> -e group -o modify -d group45 --removeuser u3
Removethegroupwithgroupnamegroup45.
vicfg-user <conn_options> -e group -o delete -d group45
Youcanonlyremovegroupsthatdonothaveusers.
VMware, Inc.
99
100
VMware, Inc.
vmwarecmdOverviewonpage 101 ListingandRegisteringVirtualMachinesonpage 102 RetrievingVirtualMachineAttributesonpage 103 ManagingVirtualMachineSnapshotswithvmwarecmdonpage 104 PoweringVirtualMachinesOnandOffonpage 105 ConnectingandDisconnectingVirtualDevicesonpage 106 WorkingwiththeAnswerVMAPIonpage 107 ForciblyStoppingVirtualMachineswithEXCLIonpage 107
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.
101
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)
102
VMware, Inc.
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 4 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.
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
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).
VMware, Inc.
103
ThegettoolslastactiveoptionindicateswhetherVMwareToolsisinstalledandwhethertheguest operatingsystemisrespondingnormally.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx gettoolslastactive
104
VMware, Inc.
(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
Softpoweroperations.Whenyouspecifysoftasthepowerop_modevalue,theresultofthecalldepends ontheoperation.
Operation Stop Reset Suspend Result vmware-cmdattemptstoshutdowntheguestoperatingsystemandpowersoffthevirtualmachine. vmware-cmdattemptstoshutdowntheguestoperatingsystemandrebootsthevirtualmachine. vmware-cmdattemptstorunascriptintheguestoperatingsystembeforesuspendingthevirtual machine.
VMware, Inc.
105
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
Suspend.Youhavetwooptionsforsuspendingavirtualmachine.
Thesuspendoptionwiththehardpoweropmodeunconditionallyshutsdownavirtualmachine.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx suspend hard
Thefollowingexamplesillustrateconnectinganddisconnectingavirtualdevice.
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"
106
VMware, Inc.
Stopthevirtualmachinebyrunningthefollowingcommand.
esxcli <conn_options> vm process kill --type <kill_type> --world-id <ID>
Thecommandsupportsthree--typeoptions.Trythetypessequentially(softbeforehard,hardbefore force).Thefollowingtypesaresupportedthroughthe--typeoption:
Ifallthreeoptionsdonotwork,rebootyourESXihosttoresolvetheissue.
VMware, Inc.
107
108
VMware, Inc.
IntroductiontovSphereNetworkingonpage 109 RetrievingBasicNetworkingInformationonpage 111 SettingUpvSphereNetworkingwithvSphereStandardSwitchesonpage 112 SettingUpvSphereNetworkingwithvSphereDistributedSwitchonpage 122 ManagingStandardNetworkingServicesinthevSphereEnvironmentonpage 123 SettingtheDNSConfigurationonpage 123 AddingandStartinganNTPServeronpage 125 ManagingtheIPGatewayonpage 126 UsingvicfgipsecforSecureNetworkingonpage 126 UsingesxclinetworkfirewallforESXiFirewallManagementonpage 130
VirtualswitchesallowyourESXihosttomigratevirtualmachineswithVMwarevMotionandtouseIPstorage throughVMkernelnetworkinterfaces.
VMware, Inc.
109
Host2
virtual
Host2 physical
physical network
AssociatedwitheachESXihostareoneormoreuplinkadapters(1).Uplinkadaptersrepresentthe physicalswitchestheESXihostusestoconnecttothenetwork.Youcanmanageuplinkadaptersusingthe esxcli network nicorvicfg-nicsvCLIcommand.SeeManagingUplinkAdaptersonpage 117. Eachuplinkadapterisconnectedtoastandardswitch(2).Youcanmanageastandardswitchand associateitwithuplinkadaptersbyusingtheesxcli network vswitchorvicfg-vswitchvCLI command.SeeSettingUpVirtualSwitchesandAssociatingaSwitchwithaNetworkInterfaceon page 112. 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 119. SeparateVMkernelnetworkinterfacesareoftenusedforseparatetasks,forexample,youmightdevote oneVMkernelNetworkinterfacecardtovMotiononly.VirtualmachinesruntheirownsystemsTCP/IP stacksandconnecttotheVMkernelattheEthernetlevelthroughvirtualswitches.
110
VMware, Inc.
uplink
Host2
virtual
Host2 physical
physical network
Eachphysicalnetworkadapter(1)onthehostispairedwithadistributeduplinkport(2),which representstheuplinktothevirtualmachine.Withdistributedswitches,thevirtualmachinenolonger dependsonthehostsphysicaluplinkbutonthe(virtual)uplinkport.Youmanageauplinkports primarilyusingthevSphereClientorvSphereAPIs. Thedistributedswitchitself(3)functionsasasinglevirtualswitchacrossallassociatedhosts.Becausethe switchisnotassociatedwithasinglehost,virtualmachinescanmaintainconsistentnetwork configurationastheymigratefromonehosttoanother. Likeastandardswitch,eachdistributedswitchisanetworkhubthatvirtualmachinescanuse.A distributedswitchcanroutetrafficinternallybetweenvirtualmachinesorlinktoanexternalnetworkby connectingtophysicalnetworkadapters.YoucreateadistributedswitchusingthevSphereClientUI,but canmanagesomeaspectsofadistributedswitchwithvicfg-vswitch.Youcanlistdistributedvirtual switcheswiththeesxcli network vswitchcommand.SeeSettingUpVirtualSwitchesand AssociatingaSwitchwithaNetworkInterfaceonpage 112.
ForinformationcorrespondingtotheLinuxnetstatcommand,usethefollowingESXCLIcommand.
esxcli <conn_options> network ip connection list
VMware, Inc.
111
2 3 4
Whentwoormorevirtualmachinesareconnectedtothesamevirtualswitch,networktrafficbetweenthemis routedlocally.Ifanuplinkadapterisattachedtothevirtualswitch,eachvirtualmachinecanaccessthe externalnetworkthattheadapterisconnectedto. Thissectiondiscussesworkinginastandardswitchenvironment.SeeNetworkingUsingvSphere DistributedSwitchesonpage 111forinformationaboutdistributedswitchenvironments. Whenworkingwithvirtualswitchesandportgroups,performthefollowingtasks: 1 Findoutwhichvirtualswitchesareavailableand(optionally)whattheassociatedMTUandCDP(Cisco DiscoveryProtocol)settingsare.SeeRetrievingInformationaboutVirtualSwitcheswithESXCLIon page 113andRetrievingInformationaboutVirtualSwitcheswithvicfgvswitchonpage 113. Addavirtualswitch.SeeAddingandDeletingVirtualSwitcheswithESXCLIonpage 113andAdding andDeletingVirtualSwitcheswithvicfgvswitchonpage 114. Foranewlyaddedswitch,performthesetasks: a b c d Addaportgroup.SeeManagingPortGroupswithESXCLIonpage 115andManagingPort Groupswithvicfgvswitchonpage 115. (Optional)SettheportgroupVLANID.SeeSettingthePortGroupVLANIDwithESXCLIon page 116andSettingthePortGroupVLANIDwithvicfgvswitchonpage 116. Addanuplinkadapter.SeeLinkingandUnlinkingUplinkAdapterswithESXCLIonpage 119and LinkingandUnlinkingUplinkAdapterswithvicfgvswitchonpage 119. (Optional)ChangetheMTUorCDPsettings.SeeSettingSwitchAttributeswithesxclinetwork vswitchstandardonpage 114andSettingSwitchAttributeswithvicfgvswitchonpage 114.
VMware, Inc.
2 3
112
Listallvirtualswitchesandassociatedportgroups.
esxcli <conn_options> network vswitch standard list
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
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
VMware, Inc. 113
Deleteavirtualswitch.
esxcli <conn_options> network vswitch standard remove --vswitch-name=vSwitch42
Addavirtualswitch.
vicfg-vswitch <conn_options> --add vSwitch2
Deleteavirtualswitch.
vicfg-vswitch <conn_options> --delete vSwitch1
SettheMTUforavSwitch.
esxcli <conn_options> network vswitch standard set --mtu=9000 --vswitch-name=vSwitch1
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
114
VMware, Inc.
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
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.
VMware, Inc. 115
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.
AllowportgroupstoreachportgroupslocatedonotherVLANs.
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.
AllowallportgroupstoreachportgroupslocatedonotherVLANs.
vicfg-vswitch <conn_options> --vlan 4095 --pg ALL vSwitch2
116
VMware, Inc.
DisableVLANforportgroupg42.
vicfg-vswitch <conn_options> --vlan 0 --pg g42 vSwitch2
Changeuplinkadaptersettings.
esxcli <conn_options> network nic set <option>
Specifyoneofthefollowingoptions.
-a|--auto -D|--duplex=<str> -P | --phy-address -l|--message-level=<long>
-n|--nic-name=<str>
-p|--port=<str>
-S|--speed=<long>
SpeedtosetthisNICto.Acceptablevaluesare10,100,1000,and10000.
VMware, Inc.
117
-t|--transceiver-type=<str>
Selecttransceivertype.Thefollowingtransceivertypesareavailable.
externalSetthetransceivertypetoexternal internalSetthetransceivertypetointernal
-w|--wake-on-lan=<str>
SetWake-on-LANoptions.Notalldevicessupportthisoption.Theoptionvalue isastringofcharactersspecifyingwhichoptionstoenable.
(Optional)Bringtheuplinkadapterbackup.
esxcli <conn_options> network nic up --nic-name=vmnic0
Ifyouwanttokeepvmnic0andvmnic1inthearray,youcanmakethoseNICsstandbyuplinksinthe commandthatchangestheactiveuplinks.
esxcli network vswitch standard portgroup policy failover set -p testPortgroup --active-uplinks vmnic3,vmnic5 --standby-uplinks vmnic1,vmnic0,vmnic6,vmnic7
Liststheuplinksinthesystem,theircurrentandconfiguredspeed,andtheirduplexsetting. 2 Setthesettingsforvmnic0tofullandthespeedto100.
vicfg-nics <conn_options> -d full -s 100 vmnic0
Setvmnic2toautonegotiateitsspeedandduplexsettings.
vicfg-nics <conn_options> -a vmnic2
118
VMware, Inc.
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
Addanewuplinkadaptertoavirtualswitch.
vicfg-vswitch <conn_options> --link vmnic15 vSwitch0
Removeanuplinkadapterfromavirtualswitch.
vicfg-vswitch <conn_options> --unlink vmnic15 vSwitch0
Youcansettheaddressasfollows.
<X.X.X.X>StaticIPv4address. DHCPUseIPv4DHCP.
Thecommanddisplaysthenetworkinformation,portgroup,MTU,andcurrentstateforeachvirtual networkadapterinthesystem. YoucanaddandconfigureanIPv6VMkernelNICwithESXCLI. To add and configure a VMkernel Network Interface for IPv6 1 Runesxcli network ip interface addtoaddanewVMkernelnetworkinterface.
esxcli <conn_options> network ip interface add --interface-name=vmk<x> --portgroup-name=<my_portgroup>
YoucanspecifytheMTUsettingafteryouhaveaddedthenetworkinterfacebyusingesxcli network ip interface set --mtu. Whenthecommandfinishessuccessfully,thenewlyaddedVMkernelnetworkinterfaceisenabled. 2 Runesxcli network ip interface ipv6 address add toconfiguretheinterfaceasanIPv6interface. YoumustspecifytheIPaddressusing--ipandthename.Forthefollowingexamples,assumethat VMSFVMK363isaportgrouptowhichyouwanttoaddaVMkernelnetworkinterface.
esxcli <conn_options> network ip interface ipv6 address add --ip=<X:X:X::/X> --interface-name=vmk<X>
120
VMware, Inc.
Youcansettheaddressasfollows.
ForIPv4,chooseoneofthefollowingformats:
<X.X.X.X>StaticIPv4address. DHCPUseIPv4DHCP.
Youcanlateruse--disable-vmotiontodisablevMotionforthisVMkernelnetworkinterface. 4 ListinformationaboutallVMkernelnetworkinterfacesonthesystem.
vicfg-vmknic <conn_options> --list
Thecommanddisplaysthenetworkinformation,portgroup,MTU,andcurrentstateforeachvirtual networkadapterinthesystem.
VMware, Inc. 121
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. 2 EnableIPv6.
vicfg-vmknic <conn_options> --enable-ipv6 true VMSF-VMK-363
SupplyanIPv6address.
vicfg-vmknic <conn_options> --ip <ip_address> VMSF-VMK-363
ForIPv6,theIPaddresscanhaveoneofthefollowingformats:
(Optional)EnablevMotion. Bydefault,vMotionisdisabled.
vicfg-vmknic <conn_options> --enable-vmotion VMSF-VMK-363
Youcanlateruse--disable-vmotiontodisablevMotionagain. 5 ListinformationaboutallVMkernelnetworkinterfacesonthesystem.
vicfg-vmknic <conn_options> --list
122
VMware, Inc.
YoucancreatedistributedswitchesbyusingthevSphereClient.Afteryouhavecreatedadistributedswitch, youcanaddhostsbyusingthevSphereClient,createdistributedportgroups,andeditdistributedswitch propertiesandpolicieswiththevSphereClient.Youcanaddandremoveuplinkportsbyusing vicfg-vswitch. IMPORTANTInvSphere5.0,youcannotcreatedistributedvirtualswitcheswithESXCLI. SeethevSphereNetworkingdocumentationandthewhitepaperavailablethroughtheResourceslinkat http://www.vmware.com/go/networkingforinformationaboutdistributedswitchesandhowtoconfigure themusingthevSphereClient. Youcanaddandremovedistributedswitchuplinkportswithvicfg-vswitch. IMPORTANTYoucannotaddandremoveuplinkportswithESXCLI. Afterthedistributedswitchhasbeensetup,youcanusevicfg-vswitchtoaddorremoveuplinkports. SpecifyoneoftheoptionslistedinConnectionOptionsonpage 17inplaceof<conn_options>.
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>
VMware, Inc.
123
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
esxcli <conn_options> network ip interface ipv4 set --type dhcp/none/static esxcli <conn_options> network ip interface ipv4 set --peer-dns=<str>
TurnonDHCPforIPv6
esxcli <conn_options> network ip interface ipv6 set --enable-dhcpv6=true/false esxcli <conn_options> network ip interface ipv6 set --peer-dns=<str>
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
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
124
VMware, Inc.
InnetworkenvironmentswhereaDHCPserverandaDNSserverareavailable,ESXihostsareautomatically assignedDNSnames. InnetworkenvironmentswhereautomaticDNSisnotavailableornotdesirable,youcanconfigurestaticDNS information,includingahostname,primarynameserver,secondarynameserver,andDNSsuffixes. ThefollowingexampleillustratessettingupaDNSserver.SpecifyoneoftheoptionslistedinConnection Optionsonpage 17inplaceof<conn_options>. To set up DNS 1 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
VMware, Inc.
125
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
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
Listrouteentriestocheckthatyourroutewasaddedbyrunningthecommandwithoutoptions.
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
126
VMware, Inc.
Youcannotrunvicfg-ipsecwithavCenterServersystemasthetarget(usingthe--vihostoption). TheVMwareimplementationofIPsecadherestothefollowingIPv6RFCs:
Theactionisspecifiedbythefollowingoptionstovicfg-ipsec.
BecauseIPsecallowsyoutotargetpreciselywhichtrafficshouldbeencrypted,itiswellsuitedforsecuring yourvSphereenvironment.Forexample,youcansetuptheenvironmentsoallvMotiontrafficisencrypted.
VMware, Inc. 127
ealgo [null | 3des-cbc | aes128-cbc] ekey <key> ialgo [hmac-sha1 | hmac-sha2-256 ] ikey
YoucanperformthesemaintaskswithSAs:
ListanSAwithvicfg-ipsec --list-sa.ThiscommandreturnsSAscurrentlyavailableforusebyan SP.ThelistincludesSAsyoucreatedusingvicfg-ipsec. RemoveasingleSAwithvicfg-ipsec --remove-sa.IftheSAisinusewhenyourunthiscommand, thecommandcannotperformtheremoval. RemoveallSAswithvicfg-ipsec --flush-sa.ThisoptionremovesallSAsevenwhentheyareinuse. CAUTIONRunningvicfg-ipsec --flush-saremovesallSAsonyoursystemandmightleaveyour systeminaninconsistentstate.
128
VMware, Inc.
YoucanperformthesemaintaskswithSPs:
ListanSPwithvicfg-ipsec --list-sp.ThiscommandreturnsSPscurrentlyavailable.AllSPsare createdbytheadministrator. RemoveanSPwithvicfg-ipsec --remove-sp.IftheSPisinusewhenyourunthiscommand,the commandcannotperformtheremoval.Youcanrunvicfg-ipsec --flush-spinsteadtoremovetheSP evenwhenitisinuse. CAUTIONRunningvicfg-ipsec --flush-spremovesallSPsonyoursystemandmightleaveyour systeminaninconsistentstate.
VMware, Inc.
129
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
130
VMware, Inc.
10
10
UsingresxtopforPerformanceMonitoringonpage 131 ManagingDiagnosticPartitionsonpage 131 ManagingCoreDumpsonpage 132 ConfiguringESXiSyslogServicesonpage 134 ManagingESXiSNMPAgentswithvicfgsnmponpage 135 ESX,ESXi,andVirtualMachineLogsonpage 137
VMware, Inc.
131
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>
Listpartitionsagaintoverifythatadiagnosticpartitionisset.
esxcli <conn_options> system coredump partition list
Ifadiagnosticpartitionisset,thecommanddisplaysinformationaboutit.Otherwise,thecommand showsthatnopartitionisactivatedandconfigured.
132
VMware, Inc.
(Optional)CheckthatESXiDumpCollectorisconfiguredcorrectly.
esxcli <conn_options> system coredump network get
ThehostonwhichyouhavesetupESXiDumpCollectorsendscoredumpstothespecifiedserverbyusing thespecifiedVMkernelNICandoptionalport.
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>
Runvicfg-dumppart -tagaintoverifythatadiagnosticpartitionisset.
vicfg-dumppart <conn_options> -t
Ifadiagnosticpartitionisset,thecommanddisplaysinformationaboutit.Otherwise,thecommand informsyouthatnopartitionisset.
VMware, Inc.
133
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.
IMPORTANTTheesxcli system syslogcommandistheonlysupportedcommandforchangingESXi5.0 loggingconfiguration.Thevicfg-syslogcommandandeditingconfigurationfilesisnotsupportedforESXi 5.0andcanresultinerrors. Aftermakingconfigurationchanges,restartthesyslogservice(vmsyslogd)byrunningesxcli system syslog reload. Theesxcli system syslogcommandallowsyoutoconfiguretheloggingbehaviorofyourESXisystem. WithvSphere5.0,youcanmanagethetoplevelloggerandsubloggers.Thecommandhasthefollowing options.
Option mark reload config get config set Description Marksalllogswiththespecifiedstring. Reloadstheconfiguration,andupdatesanychangedconfigurationvalues. Retrievesthecurrentconfiguration. Setstheconfiguration.Useoneofthefollowingoptions.
Showcurrentlyconfiguredsubloggers. Setconfigurationoptionsforaspecificsublogger.Useoneofthefollowingoptions.
134
VMware, Inc.
esxcli system syslog Examples Thefollowingworkflowillustrateshowyoumightuseesxcli system syslogforlogconfiguration.Specify oneoftheoptionslistedinConnectionOptionsonpage 17inplaceof<conn_options>. 1 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'
Reloadthesyslogdaemonandapplyconfigurationchanges.
esxcli <conn_options> system syslog reload
TousetheNETSNMPbasedagentandhostbasedembeddedSNMPagentatthesametime,makeoneofthe agentslistenonanondefaultport.Bydefault,bothagentsusethesameport.
VMware, Inc.
135
Eachtimeyouspecifyacommunitywiththiscommand,thesettingsthatyouspecifyoverwritetheprevious configuration.
(Optional)EnabletheSNMPagentifitisnotyetrunning.
vicfg-snmp <conn_options> --enable
(Optional)Sendatesttraptoverifythattheagentisconfiguredcorrectly.
vicfg-snmp <conn_options> --test
TheagentsendsawarmStarttraptotheconfiguredtarget.
136
VMware, Inc.
(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.
137
138
VMware, Inc.
Index
Numerics
3.5 LUN masks 91
A
Active Directory 25 active path 45 ARP redirect 70 authentication algorithm (IPsec) 128 default inheritance 57 key (IPsec) 128 returning to default inheritance 57 AUTOCONF 122
configuration files, path 51 copying files 34 core dumps 132 ESXi Dump Collector 133 local 132 managing 133 cp850 encoding 17 cp936 encoding 17 creating directories 35
D
datastores mounting 30 NFS 48 overview 39 default gateway 126 default inheritance 57, 74, 75 default port groups 113 dependent hardware iSCSI 53, 64, 69 device 39 device management 42, 82 device mappings 41, 42 device naming device UID 39 runtime name 39 VML name 39 Device UID 39 DHCP 124, 125 DHCPV6 122 diagnostic partitions creating 132 example 132, 133 managing 131 directory management 36 directory names with special characters 34 discovery sessions 54 discovery targets 55 disk file path 51 distributed switches 109, 110, 111, 112
B
backing up configuration data 23
C
CDP 113, 114 Challenge Handshake Authentication Protocol 56 changing IP gateway 126 CHAP 56 chapDiscouraged 56 chapPreferred 56 chapProhibited 56 chapRequired 56 Cisco Discovery Protocol 113 claim rules adding 89 converting 91 deleting 92 from 3.5 systems 91 from LUN mask 91 listing 92 loading 92 moving 92 rule IDs 91 running 93 commands with esxcfg prefix 12 configuration data backing up 23 restoring 23
VMware, Inc.
139
DNS 123, 124, 125 downloading files 34 duplicate datastores 29 dynamic discovery 54
E
encoding cp936 17 Shift_JIS 17 encodings cp850 17 encryption algorithm (IPsec) 128 encryption key (IPsec) 128 ESX/ESXi logs 137 esxcfg prefix 12 esxcli network ip commands 120 esxcli network ip dns 124 esxcli network nic commands 117 esxcli network vswitch commands 113, 115, 119 esxcli scsi session commands 78 esxcli storag nfs commands 49 esxcli storage core claiming commands 87 claimrule commands 89 claimrule convert commands 91 claimrule delete command 92 claimrule list command 92 claimrule load command 92 claimrule move command 92 claimrule run command 93 device list 40 esxcli storage core adapter rescan 52 esxcli storage core claiming reclaim command 88 unclaim command 88 esxcli storage core path 43, 45 esxcli storage nmp 81 device list command 82 device set command 82 fixed deviceconfig commands 83 path list command 82 psp commands 82, 83 psp roundrobin commands 84 roundrobin 47, 84 satp commands 85 esxcli system coredump 132 ESXi Dump Collector 131, 133 EUI name 43, 44, 55
examples backup with vMA 23 configure VMkernel NIC for IPv4 120 configure VMkernel NIC for IPv6 120 DNS setup 123 enable and set NetQueue modules 24 entering maintenance mode 22 iSCSI storage setup 62, 64, 67, 69 managing groups 99 managing users 97 route entry setup 126 svmotion 51 uplink adapter setup 117 external HBA properties 72
F
failover 42 FC LUNs 39 Fibre Channel LUNs 39 file management introduction 27 vifs 28, 36 file path, configuration file 51 file systems NAS 48 VMFS 29 fixed path selection policy 83
G
gateway, IP 126 groups 95, 98, 99
H
hard power operations 106 hardware iSCSI setup tasks 66, 70 HBA mappings 42 HBA properties 72 hosts managing 21 shutdown or reboot 21
I
ifconfig, ESXCLI equivalents 111 independent hardware iSCSI definition 53 setup tasks 66, 70 inheritance 75 IP gateway 126 IP storage 109 IPsec 126, 127 IPv4 120, 121 IPv6 120, 122 IQN name 55
140
VMware, Inc.
Index
iSCSI authentication 57, 76, 77 default inheritance 74, 75 dependent hardware iSCSI 64, 69 discovery target names 55 independent hardware iSCSI 66, 70 LUNs 39 mutual authentication 76, 77 options 71 overview 53 parameters 72, 74 parameters, returning to default inheritance 74, 75 port binding 64, 69 ports for multipathing 77 remove sessions 79 securing ports 56 security 55 sessions 79 setup examples 62, 64, 67, 69
MTU 114 multipathing 42, 43 mutual authentication 76, 77 mutual CHAP 63, 65, 68, 70, 76, 77
N
naa.xxx device name 43, 44 NAS datastores, datastores, NAS 48 NAS file systems 48 NetQueue VMkernel modules 24 network adapters duplex value 117 managing 117 speed 117 network interfaces 112, 117 networking IPsec 126 vDS 122 vSS 112 NFS datastores 48 NFS, capabilities 48 NMP 42, 81, 82 NTP server 125
K
Kerberos 125
L
license 50 listing available LUNs 40, 41 listing IP gateway 126 loading claim rules 92 lockdown mode 18 logical devices, listing 42 logs 137 LUN masks, convert to claim rule 91 LUNs listing available 40, 41 names 43, 44 overview 40
O
offload iSCSI 53 orphaned virtual machine 102
P
parameters default inheritance (iSCSI) 75 setting (iSCSI) 74 partitions, diagnostic 132 path change conditions for round robin 85 path claiming 87 path operations 82 path policies 45, 83, 84 path state, changing 44 paths active 45 changing state 44 disabling 45 identifier 39 listing 44 listing with ESXCLI 43 managing 42 preferred 46, 47, 83 performance monitoring 131 physical network interfaces 117 platform support 14 Pluggable Storage Architecture 42 port binding 64, 69, 77
M
MAC address, VMkernel NIC 119 MagicPacket 118 maintenance mode 22 Managing 42, 53, 117 managing 132 managing local core dumps 132 managing NMP 81 managing paths 42 managing physical network interfaces 117 migrating virtual machines,svmotion 49 mount datastores 30
VMware, Inc.
141
port groups 110, 116 adding 115 and uplink adapter 115, 116 default 113 removing 115 ports, iSCSI multipathing 77 power operations 106 powerop_mode 105 preferred path 46, 47, 83 PSA 42 acronym 81 managing claim rules 89 PSP acronym 81 information 83 operations 82
R
raw devices 39 rebooting hosts 21 register virtual machines 103 removing snapshots 105 rescanning adapters 52 rescanning storage 39, 52 rescanning storage adapters 52 resignature VMFS copy 31 restoring configuration data 23 resxtop 12, 131 reverting snapshots 105 RFCs (vicfg-ipsec) 127 roles 95 round robin operations 47, 84 path change conditions 85 retrieve settings 84 route entry setup 126 rule IDs 91 rules 86 claim rules 89 SATP rules 86 runtime name 39
Shift_JIS encoding 17 Simple Network Management Protocol 135 snapshots 104, 105 SNMP communities 136 management 135 polling 137 traps 136 soft power operations 105 software iSCSI setup tasks 62, 64, 67, 69 spaces in directory names 34 special characters in directories 34 vicfg-iscsi 73, 75 standard networking services 123 starting NTP server 125 state of path, changing 44 static discovery 54 stopping virtual machines 107 storage creating directories with vifs 35 overview 37 path claiming 87 rescanning 39, 52 virtual machines 38 storage array target 40 storage device naming 39 supported platforms 14 svmotion 49 interactive Mode 50 license for storage vMotion 50 limitations 50 noninteractive mode 51 requirements 50 special characters 50 switch attributes 114 syslog server specification 134
T
TCP Segmentation Offload 119 TCP/IP 66, 70, 109 transport mode 128 TSO 119 tunnel mode 128
S
SATP configuration parameters 87 deleting rules 86 retrieve settings 85 rules, adding 85 secure networking 126 securing iSCSI ports 56 security associations (IPsec) 128 security policies (IPsec) 129 sessions, iSCSI 79
142
U
unregister virtual machines 103 uplink adapters 110, 117 and port groups 115, 116 setup 118 useANO (round robin) 48 user input 107
VMware, Inc.
Index
users adding to groups 99 creating 97 in vSphere environment 95 modifying 97 removing from groups 99
V
VDS 109 vicfg-authconfig 25 vicfg-cfgbackup 22, 23 vicfg-dumppart 132, 133 vicfg-hostops 21, 22 vicfg-ipsec 126, 128, 129 vicfg-iscsi command syntax 57 default inheritance for authentication 57 default inheritance for parameters 74, 75 iscsi parameter options 75 vicfg-module 24 vicfg-mpath 44 vicfg-nas 48, 49 vicfg-nics 118 vicfg-ntp 125 vicfg-rescan 52, 68, 69 vicfg-scsidevs 3.5 support 41 list options 41 vicfg-snmp 135 vicfg-syslog 134 vicfg-user 95, 96, 98 vicfg-vmhbadevs 40, 41 vicfg-vmknic 119 vicfg-volume 29 vicfg-vswitch 112, 115 vifs 28, 33 virtual devices 106 virtual machine configuration file path 51 virtual machines attributes 103 file management 27 listing 102, 103 logs 137 managing 103 migration with svmotion 49 network settings 111 orphaned 102 path 102 registering 102, 103 starting 105 stopping 107 storage VMotion 50 vmware-cmd 103
VMware, Inc.
virtual switches 109, 112, 113 MTU 114 retrieving information 113 vicfg-vswitch 112 VLAN ID 116 VMFS duplicate datastores 29 resignature copy 30 resignaturing 31 VMFS3 to VMFS5 conversion 29 VMkernel modules 24 VMkernel network interfaces 119 VMkernel NIC 119 enable VMotion 121 IPv4 120, 121 IPv6 120, 122 VMkernel NICs 119 vmkfstools 28 VML LUN names 43, 44 VMotion 110, 121 VMW_PSP_FIXED 45 VMW_PSP_MRU 46 VMW_PSP_RR 46 vmware-cmd connection options 102 general options 102 server options 102 snapshots 104 virtual machine options 103 VMware Tools 106 vSphere distributed switches 111, 122 VSS 109
W
Windows Active Directory 25
143
144
VMware, Inc.