VMware ESXI ESXI 6.0 Getting Started

Category
Software manuals
Type
Getting Started

This manual is also suitable for

Getting Started with vSphere
Command-Line Interfaces
ESXi 6.0
vCenter Server 6.0
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--001469-00
VMware, Inc.
3401 Hillview Ave.
Palo Alto, CA 94304
www.vmware.com
2 VMware, Inc.
Getting Started with vSphere Command-Line Interfaces
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 © 2007–2015 VMware, Inc. All rights reserved. Copyright and trademark information
VMware, Inc. 3
Contents
AboutThisBook 5
1 ManagingvSpherewithCommandLineInterfaces 7
OverviewofvSphereCommandLineInterfaces 8
UsingESXCLIforHostManagement 10
ESXCLISyntax 10
RunningESXCLIvCLICommands 10
ESXCLICommandSupportwhenHostandvCLIVersionDoNotMatch 11
UsingPowerCLItoManageHostsandVirtualMachines 11
UsingDCLItoManagevCenterServices 11
DCLISyntax 12
vCLIPackageContents 12
2 InstallingvCLI 15
InstallationOverview 15
OverviewofLinuxInstallationProcess 16
InstallingthevCLIPackageonRedHatEnterpriseLinux 18
InstallingRequiredPrerequisiteSoftwareforRedHatEnterpriseLinux 18
InstallingthevCLIPackageonRHEL(NoInternetAccess) 18
InstallingvCLIonLinuxSystemswithInternetAccess 19
InstallingRequiredPrerequisiteSoftwareforLinuxSystemswithInternetAccess 19
Installingthe
vCLIPackageonaLinuxSystemwithInternetAccess 20
UninstallingthevCLIPackageonLinux 21
InstallingandUninstallingvCLIonWindows 21
UninstallingthevCLIPackageonWindows 22
EnablingCertificateVerification 22
DeployingvMA 22
3 RunningHostManagementCommandsintheESXiShell 23
ESXiShellAccesswiththeDirectConsole 23
EnablingLocalESXiShellAccess 23
ESXiShellTimeout 24
UsingtheESXiShell 24
RemoteESXiShellAccesswithSSH 24
EnablingSSHfortheESXiShell 25
UsingtheESXiShellwithSSH 25
LockdownMode 26
RunningESXCLICommandsintheESXiShell 26
4 RunningvCLIHostManagementCommands 27
OverviewofRunningvCLIHostManagementCommands 27
TargetingtheHostDirectly 27
TargetaHostThatisManagedbyavCenterServerSystem 28
ProtectingPasswords 28
OrderofPrecedenceforvCLIHostManagementCommands 29
AuthenticatingThroughvCenterServerandvCenterSingleSignOn 29
Examples 29
Getting Started with vSphere Command-Line Interfaces
4 VMware, Inc.
AuthenticatingDirectlytotheHost 30
UsingaSessionFile 30
UsingEnvironmentVariables 30
UsingaConfigurationFile 31
UsingCommandLineOptions 31
UsingMicrosoftWindowsSecuritySupportProviderInterface 32
vCLIandLockdownMode 32
TrustRelationshipRequirementforESXCLICommands 33
DownloadingandInstallingthevCenterServerCertificate 33
Usingthe‐‐cacertsfileOption 33
Usingthe‐‐thumbprintOption 33
UsingtheCredentialStore 34
Common
OptionsforvCLIHostManagementCommandExecution 34
UsingvCLICommandsinScripts 36
RunningHostManagementCommandsfromaWindowsSystem 37
RunningHostManagementCommandsfromaLinuxSystem 37
5 RunningDCLICommands 39
OverviewofRunningDCLICommands 39
DCLISyntax 40
DCLIOptions 40
RunningDCLICommands 41
DisplayingHelpInformationforDCLICommands 41
RunningDCLICommandsIncludedinthevCLIPackage 42
RunningDCLICommandsonthevCenterServerAppliance 42
UsingDCLIwithaCredentialStoreFile 42
OrderofPrecedenceforDCLIAuthentication 43
Input,Output,andReturnCodes 43
UsingDCLIwithVariables 43
DCLIHistoryFile 44
VMware, Inc. 5
GettingStartedwithvSphereCommandLineInterfacesgivesanoverviewofcommandlineinterfacesin
vSphere 5.0andlaterandgetsyoustartedwithESXiShellcommandsandvCLI(VMware
®
vSphere
CommandLineInterface)commands.ThisbookalsoincludesinstructionsforinstallingvCLIandareference
toconnectionparameters.
Intended Audience
ThisbookisforexperiencedWindowsorLinuxsystemadministratorswhoarefamiliarwithvSphere
administrationtasksanddatacenteroperations.
VMware Technical Publications Glossary
VMwareTechnicalPublicationsprovidesaglossaryoftermsthatmightbeunfamiliartoyou.Fordefinitions
oftermsastheyareusedinVMwaretechnicaldocumentation,gotohttp://www.vmware.com/support/pubs.
Document Feedback
VMwarewelcomesyoursuggestionsforimprovingourdocumentation.Ifyouhavecomments,sendyour
feedbacktodocfeedback@vmware.com.
Related Documentation
ThedocumentationforvCLIisavailableinthevSphereDocumentationCenterandonthevCLI
documentationpage.Gotohttp://www.vmware.com/support/developer/vcli.
CommandLineManagementinvSphere5andvSphere6forServiceConsoleUsersisatechnicalnoteforusers
whoarecurrentlyusingESXserviceconsolecommands,scripts,agents,orlogs.Youlearnhowto
transitiontoanoffhostimplementationortousetheESXiShellinspecialcases.
vSphereCommandLineInterfaceConceptsandExamplespresentsusageexamplesformanyhost
managementcommands,andexplainshowtosetupsoftwareandhardwareiSCSI,addvirtualswitches,
placehostsinmaintenancemode,andsoon.ThedocumentincludesthesameexamplewiththeESXCLI
commandandwiththevicfg-command.
vSphereCommandLineInterfaceReferenceisareferencetobothESXCLIcommandsandvicfg-commands.
Thevicfg-commandhelpisgeneratedfromthePODavailableforeachcommand,runpod2htmlfor
anyvicfg-commandtogenerateindividualHTMLfilesinteractively.TheESXCLIreferenceinformation
isgeneratedfromtheESXCLIhelp.
DCLIReferenceisareferencetoDCLIcommandsformanagingvCenterservices.
ThedocumentationforPowerCLIisavailableinthevSphereDocumentationCenterandonthePowerCLI
documentationpage.
About This Book
Getting Started with vSphere Command-Line Interfaces
6 VMware, Inc.
ThevSphereSDKforPerldocumentationexplainshowyoucanusethevSphereSDKforPerlandrelated
utilityapplicationstomanageyourvSphereenvironment.
ThevSphereManagementAssistantGuideexplainshowtoinstallandusethevSphereManagementAssistant
(vMA).vMAisavirtualmachinethatincludesvCLIandother
prepackagedsoftware.See“DeployingvMA”
onpage 22.
BackgroundinformationforthetasksdiscussedinthisbookisavailableinthevSpheredocumentationset.The
vSpheredocumentationconsistsofthecombinedVMwarevCenterServerandESXidocumentation.
Technical Support and Education Resources
Thefollowingsectionsdescribethetechnicalsupportresourcesavailabletoyou.Toaccessthecurrentversion
ofthisbookandotherbooks,gotohttp://www.vmware.com/support/pubs.
Online and Telephone Support
Touseonlinesupporttosubmittechnicalsupportrequests,viewyourproductandcontractinformation,and
registeryourproducts,gotohttp://www.vmware.com/support.
Customerswithappropriatesupportcontractsshouldusetelephonesupportforthefastestresponseon
priority1issues.Gotohttp://www.vmware.com/support/phone_support.
Support Offerings
TofindouthowVMwaresupportofferingscanhelpmeetyourbusinessneeds,goto
http://www.vmware.com/support/services.
VMware Professional Services
VMwareEducationServicescoursesofferextensivehandsonlabs,casestudyexamples,andcoursematerials
designedtobeusedasonthejobreferencetools.Coursesareavailableonsite,intheclassroom,andlive
online.Foronsitepilotprograms andimplementationbestpractices,VMwareConsultingServicesprovides
offeringsto helpyouassess,plan,
build,andmanageyourvirtualenvironment.Toaccessinformationabout
educationclasses,certificationprograms,andconsultingservices,gotohttp://www.vmware.com/services.
VMware, Inc. 7
1
vSpheresupportsseveralcommandlineinterfacesformanagingyourvirtualinfrastructureincludingasetof
ESXiShellcommands,PowerCLIcommands,andDCLIcommandsformanagementofvCenterservices.You
canruncommandslocally,fromanadministrationserver,orfromscripts.
YoucanchoosetheCLIbestsuitedforyourneeds,and
writescriptstoautomateyourmanagementtasks.
Thischapterincludesthefollowingtopics:
“OverviewofvSphereCommandLineInterfaces”onpage 8
“UsingESXCLIforHostManagement”onpage 10
“UsingPowerCLItoManageHostsandVirtualMachines”onpage 11
“UsingDCLItoManagevCenterServices”onpage 11
“vCLIPackageContents”onpage 12
Managing vSphere with
Command-Line Interfaces
1
Getting Started with vSphere Command-Line Interfaces
8 VMware, Inc.
Overview of vSphere Command-Line Interfaces
vSphereincludescommandsformanagingdifferentaspectsofyourenvironment.ThefollowingCLIsare
availableformanaginghosts,eitherdirectlyorthroughthevCenterServersystemthatmanagesthehost.
Figure 1-1. vSphere CLIs for host management.
ThefollowingcommandsetsareavailableandarediscussedeitherinthismanualorotherVMware
documentation.
Command set Description See
ESXCLIcommands ManagemanyaspectsofanESXihost.YoucanrunESXCLI
commandsremotelyorintheESXiShell.
vCLIpackage.InstallthevCLIpackageontheserverofyour
choice,ordeployavMAvirtualmachineandtargettheESXi
systemthatyouwantmanipulate.Youcanrun
ESXCLI
commandsagainstavCenterServersystemandtargetthe
hostindirectly.RunningagainstvCenterServersystemsby
usingthe-vihostparameterisrequiredifthehostisin
lockdownmode.
ESXiShell.RunESXCLIcommandsinthelocalESXishell
tomanagethathost.
YoucanalsorunESXCLIcommandsfromthevSpherePowerCLI
promptbyusingtheGet-EsxClicmdlet.
“UsingESXCLIforHost
Management”onpage 10
“InstallingvCLI”on
page 15
vSphereCommandLine
ConceptsandExamples
vSphereManagement
AssistantGuide
vSphereCommandLine
InterfaceReference
vicfg-
andother
vCLIcommands
Allowuserstomanagehostsremotely.InstallthevCLIpackage
onaWindowsorLinuxsys temordeployavMAvirtualmachine,
andtargettheESXisystemthatyouwantmanipulate.
YoucanrunthecommandsagainstESXisystemsoragainsta
vCenterServersystem.Ifyou
targetavCenterServersystem,use
the--vihostoptiontospecifythetargetESXisystem.
Note:IftheESXisystemisinstrictlockdownmode,youmustrun
commandsagainstthevCenterServersystemthatmanagesyour
ESXisystem.
“InstallingvCLI”onpage 15
vSphereCommandLine
ConceptsandExamples
vSphereCommand
Line
InterfaceReference
ESXi ESXi
vCenter Server
API
API API
ESXCLI
esxcfg-*
ESXCLI
esxcfg-*
Linux vSphere
Management
Assistant
Windows
vCLI
vicfg-*
ESXCLI
Others (esxtop, vimcmd, vsish, rvc...)
PowerCLI
VMware, Inc. 9
Chapter 1 Managing vSphere with Command-Line Interfaces
esxcfg-commands AvailableintheESXiShell.esxcfg-commandsarestillincluded
inthisreleasebutaredeprecated.Migrateto
ESXCLIwhere
possible.
CommandLineManagement
ofvSphere5andvSphere6
forServiceConsoleUsers
DCLIcommands ManageVMwareSDDCservices.
DCLIisaCLIclienttothevCloudSuiteSDKinterfacefor
managingVMwareSDDCservices.ADCLIcommandtalkstoa
vCloudSuiteAPIendpointtolocaterelevantinformation,and
thenexecutesthecommandanddisplaysresulttotheuser.
YoucanrunDCLIcommandsasfollows.
vCenterServerappliance.RunDCLIcommandsfromthe
vCenterServerApplianceshell.See“RunningDCLI
CommandsonthevCenterServerAppliance”onpage 42.
vCenterServerWindowscommandprompt.InstallvCenter
ServeronasupportedWindowssystemandrunDCLI
commandsfromthecommandprompt.
vCLIpackage.
OpenacommandpromptonaLinuxorWindows
systemonwhichyouinstalledvCLI.Entercommands
intothatcommandprompt,specifyingconnection
options.See“RunningDCLICommands”onpage 41.
AccessthevMALinuxconsole.DCLIdoesnotsupport
thevifastpassconnections.
PreparescriptsthatincludeDCLIcommandsandrunthe
scriptsasvCLIscriptsfromthevCenterServerWindows
commandpromptorfromthevCenterServerAppliance
shell.
“RunningDCLI
Commands”onpage 39
SeethevCloudSuiteSDK
documentationfor
informationabout
currentlysupported
servicesandhowthey
interact.
VMwarePowerCLI
cmdlets
VMware
vSpherePowerCLIprovidesaWindowsPowerShell
interfacetothevSphereAPI.vSpherePowerCLIincludes
PowerShellcmdletsforadministeringvSpherecomponents.
vSpherePowerCLIincludesmorethan370cmdlets,asetof
samplescripts,andafunctionlibraryformanagementand
automation.ThevSphereImageBuilderPowerCLIandthe
vSphereAutoDeploy
PowerCLIareincludedwhenyouinstall
vSpherePowerCLI.
VMwarePowerCLI
documentationset.
localclicommands SetofcommandsforusewithVMwareTechnicalSupport.
localclicommandsareequivalentto
ESXCLIcommands,but
bypassthehostedaemon(hostd).Thelocalclicommandsare
onlyforsituationswhenhostdisunavailableandcannotbe
restarted.Afteryourunalocalclicommand,youmustrestart
hostd.Run
ESXCLIcommandsaftertherestart.
Warning:Ifyouusealocalclicommand,aninconsistent
systemstateandpotentialfailurecanresult.
pktcap-uwutility Enablesyoutomonitorthetrafficthatflowsthroughphysical
networkadapters,VMkerneladapters,andvirtualmachine
adapters,andtoanalyze thepacketinformationbyusing
conventionalnetworkanalysis
toolssuchasWireshark.
vSphereNetworking
documentation
dir-cli
vecs-cli
certool
CommandsformanagingthevCenterSingleSignOnand
certificateinfrastructure.
vSphereSecurity
documentation
appliancesh EnablesyoutoconfigureandtroubleshootthevCenterServer
Applianceandtomonitortheprocessesandservicesrunningin
theappliance.
vCenterServerAppliance
Configuration
documentation
Command set Description See
Getting Started with vSphere Command-Line Interfaces
10 VMware, Inc.
Using ESXCLI for Host Management
YoucanmanagemanyaspectsofanESXihostwithcommandsintheESXCLIcommandset.Youcanrun
ESXCLIcommandsasvCLIcommands,orrunthemintheESXiShellintroubleshootingsituations.
YoucanalsorunESXCLIcommandsfromthePowerCLIshellbyusingtheGet-EsxClicmdlet.Seethe
vSphere
PowerCLIAdministrationGuideandthevSpherePowerCLIReference.
ThesetofESXCLIcommandsthatareavailableonahostdependsonthehostconfiguration.ThevSphere
CommandLineInterfaceReferencelistshelpinformationforallESXCLIcommands.Youcanrunesxcli
--server <MyESXi> --helpbeforeyourunacommandona
hosttomakesurethatthecommandisdefined
onthehostyouaretargeting.
ESXCLI Syntax
EachESXCLIcommandusesthesamesyntax.
esxcli [dispatcher options] <namespace> [<namespace> ...] <cmd> [cmd options]
dispatcheroptions.Predefinedoptionsforconnectioninformationsuchastargethost,username,andso
on.SeeChapter 4,“RunningvCLIHostManagementCommands,”onpage 27.Notrequiredwhenyou
runthecommandintheESXiShell.IfthetargetserverisavCenterServersystem,specifythetargetESXi
host
beforeanyESXCLInamespaces,commands,andsupportedoptions.
ManyESXCLIcommandsgenerateoutputyoumightwanttouseinyourapplication.Youcanrunesxcli
withthe--formatterdispatcheroptionandsendtheresultingoutputasinputtoaparser.
namespace.GroupsESXCLIcommands.vSphere5.0andlatersupportnestednamespaces.
command.Reportsonormodifiesstateonthesystem.
Examples
esxcli --server myESXi --username user1 --password 'my_password' storage nfs list
esxcli --server myVCServer --username user1 --password 'my_pwd' --vihost myESXi.mycompany.com
storage nfs list
options.Manycommandssupportoneormoreoptions,displayedinthehelporthevCLIReference.For
somecommands,multipleoptionvalues,separatedbyspaces,arepossible.
Example
esxcli system module parameters set -m <module> -p "a=1 b=1 c=1"
Running ESXCLI vCLI Commands
YoucanrunanESXCLIvCLIcommandintheESXiShellfortroubleshootingandremotelyagainstaspecific
hostoragainstavCenterServersystem.Youhavethefollowingchoices:
DeploythevMAapplianceonanESXisystemandauthenticateagainstasetoftargetservers.Youcan
thenrunESXCLIcommandsagainstanytargetserverbyspecifyingthe--hostdispatcheroption.No
additionalauthenticationisrequired.SeethevSphereManagementAssistantGuide.
I
MPORTANTStartingwithvSphere6.0,ESXCLIexpectsatrustrelationshipbetweenthetargethostand
thesystemonwhichyourunthecommand.Youcanestablishthisrelationshipinoneoftheseways:
Usethe--cacertsfileoptionorVI_CACERTFILE variable
Storethethumbprintinthesessionfile.
Specifythethumbprintwiththe--thumbprintoptionorVI_THUMBPRINTvariable.
Youcanpassinthethumbprintthatisreturnedintheerrorifyoutrustthehostyouaretargeting.See
“TrustRelationshipRequirementforESXCLICommands”onpage 33foranexample.
VMware, Inc. 11
Chapter 1 Managing vSphere with Command-Line Interfaces
InstallthevCLIpackageononeofthesupportedWindowsorLinuxsystems.TheESXCLIcommandset
isincluded.SpecifyconnectionoptionstoruncommandsagainstanESXihostdirectly,ortargetavCenter
ServersystemandspecifytheESXihosttorunthecommandagainst.See“InstallingvCLI”onpage 15.
SeeChapter 4,“RunningvCLIHostManagementCommands,”onpage 27.
ESXCLI Command Support when Host and vCLI Version Do Not Match
WhenyourunanESXCLIvCLIcommand,youmustknowthecommandssupportedonthetargethost
specifiedwith--serverorasavMAtarget.Forexample:
IfyouruncommandsagainstESXi4.xhosts,ESXCLI4.xcommandsaresupported.
IfyouruncommandsagainstESXi5.0hosts,ESXCLI5.0commandsaresupported.ESXCLI5.1
commandsthatwereincludedinESXCLI5.0arealsosupported.
IfyouruncommandsagainstESXi5.1hosts,ESXCLI5.1andESXCLI5.0commandsaresupported.
VMwarepartnersmightdevelopcustomESXCLIcommandsthatyoucanrunonhostswherethepartnerVIB
isinstalled.
Runesxcli --server <target> --helpforalistofnamespacessupportedonthetarget.Youcandrill
downinto
thenamespacesforadditionalhelp.
Using PowerCLI to Manage Hosts and Virtual Machines
VMwarevSpherePowerCLIcontainssnapinsandmodulesbasedonMicrosoftPowerShellforautomating
vSphereandvCloudDirectoradministration.PowerCLIprovidesC#andPowerShellinterfacestovSphere
andotherVMwareproductadministration.
vSpherePowerCLIisbasedonMicrosoftPowerShellandusesthePowerShellbasicsyntaxandconcepts.
MicrosoftPowerShellisboth
acommandlineandscriptingenvironment,designedforWindows.Itusesthe
.NETobjectmodelandprovidesadministratorswithsystemadministrationandautomationcapabilities.To
workwithPowerShell,youruncommands,whicharecalledcmdlets.
PowerShellsupportsfeaturessuchaspipelines,wildcards,andeasyaccesstocommandlinehelp.
Youcan
useESXCLIcommandsfromthevSpherePowerCLIconsole,asfollows:
Throughthecmdlet,whichprovidesdirectaccesstotheESXCLInamespaces,applications,and
commands.
Through.NETmethods,whichyouusetocreatemanagedobjectsthatcorrespondtospecificESXCLI
applications.ToaccesstheESXCLI,youcancallmethodsonthesemanagedobjects.
SeethevSpherePowerCLIUser’sGuideinthevSpheredocumentationcenter.
Using DCLI to Manage vCenter Services
TheDCLIcommandsetallowsyoutomanagevCenterservicesthatarenewinvSphere6.0.Youcannot
manageservicesthatwerepartofvSphere5.5fromDCLI.DCLIisnotahostmanagementCLI.
DCLI(DatacenterCLI)isaCLIclientofthevCloudSuiteSDK.DCLIworkslikethis:
1TheuserrunsacommandintheDCLIdirectoryandspecifiesausername.
N
OTEStartingwithvSphere6.0,atrustrelationshipmustexistbetweenthehostfromwhichyourun
ESXCLIcommandsandthetargetESXihostorvCenterServersystem.SeeAppendix 4,“Trust
RelationshipRequirementforESXCLICommands,”onpage 33.
NOTETorunanESXCLIcommandfromPowerCLI,youmustprovidevaluesforallparameters.Ifyou
wanttoomitagivenparameter,pass$nullasitsargument.
Getting Started with vSphere Command-Line Interfaces
12 VMware, Inc.
2Iftheuserisnotyetauthenticated,DCLIpromptsforapassword.
3Theuserspecifiesapassword.
4ThecommandconnectstothevCenterSingleSignOnserviceandcheckswhethertheuserspecifiedon
thecommandlineorinacertificatestorefilecanauthenticate.
5Iftheusercanauthenticate,DCLI
communicateswiththevCenterServerandexecutethevCloudSuite
SDKcommandthatcorrespondstotheDCLIcommand.DifferentvCenterServersystemssupport
differentservices.
6DCLIdisplaystheresultoranerrortotheuser.
YoucanrunDCLIcommandsasfollows.
vCLIpackage.InstallthevCLIpackageontheserverofyourchoice,ordeployavMAvirtualmachine.
YoucanthenrunDCLIcommandsagainstanendpoint.See“RunningDCLICommands”onpage 41.
vCenterServerappliance.RunDCLIcommandsfromthevCenterServerApplianceshell.See“Running
DCLICommandsonthevCenterServerAppliance”onpage 42.
vCenterServerWindowscommandprompt.InstallvCenterServeronasupportedWindowssystemand
runDCLIcommandsfromthecommandprompt.
DCLI Syntax
EachDCLIcommandusesthesamesyntax.
Thecommandnamecanbefollowedbyconnectionandformattingoptions,eachprecededbya+sign.You
alsospecifythenamespace,thecommand,andthecommandoptions.Namespacesarenested.
dcli +[DCLI options] <namespace> [<namespace> ...] <cmd> --[cmd option] [option value]
DCLIoptions.PredefinedoptionsforconnectioninformationincludingthevCloudSuiteSDKendpoint
andformattingoptions.Alwaysprecededbya+sign.
NotrequiredwhenyourunthecommandinthevCenterServerApplianceshellorfromthecommand
promptofavCenterServerWindowsinstallation.
namespace.GroupsDCLIcommands.NamespacescorrespondtothevCloudSuiteSDKnamespacesand
arenested.
command.Reportsonormodifiesstateonthesystem.
optionandvalue.Commandoptionandvaluepairs.
Example
$dcli +server <vcenter-IP> com vmware cis tagging tag list
vCLI Package Contents
vCLIisnotacommandsetbutapackageofseveralcommandsets.YouusuallyinstallvCLIonan
administrationserverandrunscriptsfromthereagainstotherhostsor,forDCLI,againstvCenterServer
systems.SomevCLIcommandscanalsoberunlocallyontheESXihostorthevCenter
Serversystem.
WhenyouinstallthevCLIpackage,thefollowingcommandsetsbecomeavailable.
DCLICommands.TheDCLIcommandsarenewinvSphere6.0,andareavailableformanagingvCenter
servicesthatarenewinvSphere6.0.ThesecommandsareavailableaspartofvCLI,fromthevCenter
ServerVirtualAppliance,andfromthecommandpromptofavCenterServerWindowsinstallation.
HostManagementCommands.Includesthefollowingcommandsets.
NOTETheorderinwhichDCLIoptionsareprovidedonthecommandlineisnotimportant.However,you
mustspecifyDCLIoptionswithaplus(+)andcommandspecificoptionswithaminus().
VMware, Inc. 13
Chapter 1 Managing vSphere with Command-Line Interfaces
ESXCLIcommands.TheESXCLIcommandsincludedinthevCLIpackageareequivalenttothe
ESXCLIcommandsavailableintheESXiShell.
vicfg‐commands.Thevicfg-commandsetissimilartothedeprecatedesxcfg-commandsetin
theESXiShell.
Miscellaneouscommands.AsmallsetofcommandsformanagingandmonitoringESXihosts,
includingvmkfstoolsandresxtop.Inmanycases,equivalentbutslightlydifferentcommandsare
availableintheESXiShell.
YoucanrunvCLIcommandsfromaWindowsorLinuxsystem,orusevMA.
InstallthevCLIcommandsetontheWindowsorLinuxsystemfromwhichyouwanttoadministeryour
ESXisystemsandrunvCLIcommands.See“InstallingvCLI”onpage 15.
DeployavMAvirtualmachinetoanESXisystemandrunvCLIcommandsfromthere.
AfteryouhaveinstalledthevCLIpackage,youcanrunthehostmanagementcommandsinthesetagainst
ESXihosts.YoucanruntheDCLIcommandsagainstaserverbyspecifyingtheIPaddressandcan
managethe
servicesassociatedwiththatserver.
YoumustspecifyconnectionparameterswhenyourunavCLIcommand.Theconnectionparametersdiffer
forDCLIcommandsandforothercommands.See“RunningvCLIHostManagementCommands”onpage 27
and“RunningDCLICommands”onpage 41.
I
MPORTANTESXiShellisintendedforexperiencedusersonly.Minorerrorsintheshellcanresultin
seriousproblems.InsteadofrunningcommandsdirectlyintheESXiShell,usevCLIorPowerCLI.
Getting Started with vSphere Command-Line Interfaces
14 VMware, Inc.
VMware, Inc. 15
2
YoucaninstallavCLIpackageonaLinuxoraMicrosoftWindowssystem,ordeploythevSphere
ManagementAssistant(vMA)onanESXihost.
Thischapterincludesthefollowingtopics:
“InstallationOverview”onpage 15
“OverviewofLinuxInstallationProcess”onpage 16
“InstallingthevCLIPackageonRedHatEnterpriseLinux”onpage 18
“InstallingvCLIonLinuxSystemswithInternetAccess”onpage 19
“UninstallingthevCLIPackageonLinux”onpage 21
“InstallingandUninstallingvCLIonWindowsonpage 21
“UninstallingthevCLIPackageonWindowsonpage 22
“EnablingCertificateVerificationonpage 22
“DeployingvMA”onpage 22
Installation Overview
YoucaninstallavCLIpackageonasupportedplatformordeploythevMAvirtualmachineonanESXihost.
InstallablePackage.InstallavCLIpackageonaphysicalorvirtualmachine.See“InstallingthevCLI
PackageonRedHatEnterpriseLinux”onpage 18,“InstallingvCLIonLinuxSystemswithInternet
Access”onpage 19,and“InstallingandUninstallingvCLIonWindowsonpage 21.
ThevCLIinstallerinstallsbothvSphereSDKfor
PerlandvCLIbecausemanyvCLIcommandsrunontop
ofthevSphereSDKforPerl.Thecontentsoftheinstallerpackagediffersfordifferentplatforms.
Installing vCLI
2
Platform Installation Process
Windows TheinstallationpackageincludesvCLI,vSphereSDKforPerl,andprerequisitePerl
modules.
RedHatEnterprise
Linux
Youmustinstallrequiredsoftware.See“InstallingRequiredPrerequisiteSoftwareforRed
HatEnterpriseLinux”onpage 18.
TheinstallerforRHELpromptsyouwhetheryouwanttoinstallothermissingmodules
fromtheInternet
orfromthepackage.
IfyouhaveInternetaccess,youcanhavetheinstallerdownloadPerlmodulesfrom
CPAN.
TheinstallercaninsteadinstallPerlmodulesthatitdoesnotfindonyoursystemfrom
theinstallerpackage.
SLESandUbuntu YoumustinstallrequiredsoftwareandyoumusthaveInternetaccess.See“Installing
RequiredPrerequisiteSoftwareforLinuxSystemswithInternetAccess”onpage 19.
TheinstallerdownloadsotherPerlmodules
fromCPAN.
Getting Started with vSphere Command-Line Interfaces
16 VMware, Inc.
Afterinstallation,youcanrunvCLIcommandsandvSphereSDKforPerlutilityapplicationsfromthe
operatingsystemcommandline.Eachtimeyourunacommand,youspecifythetargetserverconnection
optionsdirectlyorindirectly.YoucanalsowritescriptsandmanageyourvSphereenvironmentusing
thosescripts.
vSphereManagementAssistant(vMA).DeployvMA,avirtualmachinethatadministratorscanuseto
runscriptsthatmanagevSphere,onanESXihost.vMAincludesvCLI,vSphereSDKforPerl,andother
prepackagedsoftwareinaLinuxenvironment.
vMAsupportsnoninteractivelogin.IfyouestablishanESXihostasatarget
server,youcanrunvCLIhost
managementcommandsandvSphereSDKforPerlcommandsagainstthatserverwithoutadditional
authentication.IfyouestablishavCenterServersystemasatargetserver,youcanrunmostvCLI
commandsagainstallESXisystemsthatservermanageswithoutadditionalauthentication.See
“DeployingvMA”
onpage 22.
Overview of Linux Installation Process
TheinstallationscriptforvCLIissupportedontheLinuxdistributionsthatarelistedintheReleaseNotes.
ThevCLIpackageinstallerinstallsthevCLIscriptsandthevSphereSDKforPerl.Theinstallationproceedsas
follows.
1Theinstallercheckswhetherthefollowingrequiredprerequisitepackagesareinstalledonthesystem:
2Iftherequiredsoftwareisfound,theinstallerproceeds.Otherwise,theinstallerstopsandinformsyou
thatyoumustinstallthesoftware.See“InstallingRequiredPrerequisiteSoftwareforRedHatEnterprise
Linux”onpage 18and“InstallingRequiredPrerequisiteSoftwa reforLinuxSystemswithInternet
Access”onpage 19forinstructions.
3Theinstaller
checkswhetherthefollowingPerlmodulesarefound,andwhetherthecorrectversionis
installed.
CryptSSLeay0.55(0.550.9.7or0.550.9.8)
IOCompressBase2.037
CompressZlib2.037
IOCompressZlib2.037
CompressRawZlib2.037
ArchiveZip1.28
DataDumper2.121
XMLLibXML1.63
libwwwperl5.805
LWPProtocolhttps6.02
XMLLibXMLCommon0.13
XMLNamespaceSupport1.09
Perl Perlversion5.8.8orversion5.10mustbeinstalledonyoursystem.
OpenSSL ThevCLIrequiresSSLbecausemostconnectionsbetweenthesystemonwhichyourunthecommand
andthetargetvSpheresystemareencryptedwithSSL.
TheOpenSSLlibrary(libssl-develpackage)isnotincludedinthedefaultLinuxdistribution.See
“InstallingRequiredPrerequisiteSoftwareforRedHatEnterpriseLinuxonpage 18and“Installing
RequiredPrerequisiteSoftwareforLinuxSystemswithInternetAccess”onpage 19.
LibXML2 UsedforXMLparsing.ThevCLIclientrequires2.6.26orhigherversion.Ifyouhaveanolderversion
installed,pleaseupgradeto2.6.26orhigher.
Thelibxml2
packageisnotincludedinthedefaultLinuxdistribution.See“InstallingRequired
PrerequisiteSoftwareforRedHatEnterpriseLinux”onpage 18and“InstallingRequiredPrerequisite
SoftwareforLinuxSystemswithInternetAccessonpage 19.
uuid Includedinuuid-develforSLES11andine2fsprogs-develforotherLinuxplatforms.Requiredby
theUUID
Perlmodule.
VMware, Inc. 17
Chapter 2 Installing vCLI
XMLSAX0.16
DataDump1.15
URI1.37
UUID0.03
SOAPLite0.710.08
HTMLParser3.60
version0.78
ClassMethodMaker2.10
JSONPP2.27203
DevelStackTrace131
ClassDataInheritable0.08
ConvertASN10.26
CyrptOpenSSLRSA0.28
CryptX5090.51
ExceptionClass1.37
MIMEBase643.14
UUIDRandom0.04
Socket6023
IOSocketINET62.71
NetINET6Glue0.600_1
EarlierversionsoflibwwwperlincludetheLWPProtocolhttpsmodule.Morerecentversionsof
libwwwperldonotincludetheLWPProtocolhttpsmoduleandyouhavetoinstallthatmodule.
4TheinstallerproceedsdependingontheLinuxdistribution.
NOTEIfyouintendtorunvCLIcommandswithSSLcertification,be suretocheckthatLWP::UserAgent
6.00orlaterisinstalled.Theinstallerdoesnotcheckthismodule,andearlierversionsdonotworkwith
SSL.
Linux distribution Installer behavior
RHEL(NoInternet
access)
OnRHEL,theinstallerallowsyoutoinstallPerlmoduleswithCPANifInternetaccessis
available.
IfnoInternetaccessisavailable,andamoduleisnotcurrentlyonyoursystem,theinstaller
installsit.Ifadifferentversionofamoduleisfound,theinstaller
doesnotinstallitand
proceedswithinstallation.Attheendoftheinstallationprocess,theinstallerinformsyou
iftheversiononthesystemdoesnotmatchtherecommendedversion,andrecommends
thatyouinstalltheversionthatvCLIwastestedwith.Youcaninstallthemodulesusingthe
packageinstallerforyourplatform,theinstallationCD,orCPAN.
Note:TheinstallerdoesnotoverwriteexistingversionsofrecommendedPerlmodules.
Youmustexplicitlyupdatethosemodulesyourself.
AllLinux
distributions
(Internetaccess)
TheinstallerproceedsdependingonwhetherthePerlmodulesarefound.
IfarecommendedPerlmoduleisnotfoundatall,theinstallerinstallsitusingCPAN.
YoumustmeettheinstallationprerequisitesortheinstallercannotinstallthePerl
modulesandstops.See“InstallingvCLIonLinuxSystemswithInternetAccess”on
page 19.
Ifalowerversionofarecommendedmoduleisfound,theinstallerdoesnotinstalla
differentversionfromCPANandproceedswithinstallation.Aftercompleting
installation,theinstallerdisplaysamessagethattheversiononthesystemdoesnot
matchtherecommendedversion,andrecommendsthatyouinstalltheversion
vCLI
wastestedwith.Youcaninstallthemodulesusingthepackageinstallerforyour
platform,theinstallationCD,orCPAN.
Ifahigherversionofarecommendedmoduleisfound,theinstallerproceedswith
installationanddoesnotdisplayamessageafterinstallation.
Note:TheinstallerdoesnotoverwriteexistingversionsofrecommendedPerlmodules.
Youmustexplicitlyupdatethosemodulesyourself.
Getting Started with vSphere Command-Line Interfaces
18 VMware, Inc.
5AfterallrequiredsoftwareandallprerequisitePerlmodulesareinstalled,youcaninstallvCLI.See
“InstallingthevCLIPackageonRedHatEnterpriseLinux”onpage 18and“InstallingthevCLIPackage
onaLinuxSystemwithInternetAccess”onpage 20.
IfapreviousversionofvCLI,RemoteCLI,orvSphere
SDKforPerlisinstalledonyoursystem,andyouinstall
vCLIinadifferentdirectory,youmustresetthePATHenvironmentvariable.Youcandosobeforeorafterthe
installation,usingthecommandappropriateforyourdistributionandshell(setenv,export,andsoon).If
youdo
notresetthepath,thesystemmightstilllookforexecutablesintheoldlocation.
Installing the vCLI Package on Red Hat Enterprise Linux
vCLIissupportedonRedHatEnterpriseLinuxversionsthatarelistedintheReleaseNotes.OnRHEL,the
vSphereSDKforPerlinstallerpromptsyouwhetheryouwanttoinstallrequiredPerlmodulesfromthe
installationpackageorfromCPAN.Followthesestepstoinstallthesoftware.
1Installrequired
prerequisitesoftware.See“InstallingRequiredPrerequisiteSoftwareforRedHat
EnterpriseLinux”onpage 18.
2Whenprompted,directtheinstallertoinstalladditionalprerequisitesfromtheinstallationpackage(see
“InstallingthevCLIPackageonRHEL(NoInternetAccess)”onpage 18)orfromCPAN(see“Installing
thevCLIPackageonaLinuxSystem
withInternetAccess”onpage 20).
Installing Required Prerequisite Software for Red Hat Enterprise Linux
PrerequisitesoftwareonRHELincludesrequiredsoftwareandrecommendedPerlmodules.
Required Software
Ifrequiredsoftwareisnotinstalled,thevCLIinstallerstops.Youcaninstallprerequisitesusingyum,theRHEL
packageinstaller(recommended),orfromtheinstallationDVD,asfollows:
Recommended Perl Modules
Whentheinstallerfinishes,itmightissueawarningthatthe
versionofamoduleinstalledonyoursystemdoes
notmatchtheversionwithwhichvCLIwastested.InstallthatversionusingyumorCPANtoresolvetheissue.
See“OverviewofLinuxInstallationProcess”onpage 16foracompletelistofmodules.
Installing the vCLI Package on RHEL (No Internet Access)
BeforeyouinstallvCLI,youmustremoveallpreviousversionsofthatsoftware.Theprocessdiffersfrom
simplyuninstallingvCLI.
To remove previous versions of vCLI
1Runtheuninstallscript,forexample,ifyouinstalledvCLIinthedefaultlocation,runthefollowing
command:
/usr/bin/vmware-uninstall-vSphere-CLI.pl
2 DeleteexistingversionsofvSphere-CLI.xxxx.tar.gzanddeletethevmware-vsphere-cli-distrib
directory.
RHEL6.332bit
yum install e2fsprogs-devel libuuid-devel
yum install perl-XML-LibXML
RHEL6.364bit
yum install e2fsprogs-devel libuuid-devel
yum install glibc.i686
yum install perl-XML-LibXML
NOTETheinstallerdoesnotoverwriteexistingPerlmodules.
VMware, Inc. 19
Chapter 2 Installing vCLI
To install vCLI on RHEL
1UntarthevCLIbinarythatyoudownloaded.
tar –zxvf VMware-vSphere-CLI-6.X.X-XXXXX.XXXX.x86_64.tar.gz
Avmware-vsphere-vcli-distribdirectoryiscreated.
2Loginassuperuserandruntheinstaller:
/<location>/sudo vmware-vsphere-cli-distrib/vmware-install.pl
3Toacceptthelicenseterms,typeyesandpressEnter.
4ToinstallPerlmoduleslocally,typeyesandpressEnter.
5Specifyaninstallationdirectory,orpressEntertoacceptthedefault,whichis/usr/bin.
Acompleteinstallationprocesshasthefollowingresult:
Asuccessmessageappears.
Theinstallerlistsdifferentversionnumbersforrequiredmodules(ifany).
Thepromptreturnstotheshellprompt.
Ifyouacceptedthedefaultsduringinstallation,youcanfindtheinstalledsoftwareinthefollowinglocations:
vCLIscripts/usr/bin
vSphereSDKforPerlutilityapplications/usr/lib/vmware-vcli/apps
vSphereSDKforPerlsamplescripts/usr/share/doc/vmware-vcli/samples
SeethevSphereSDKforPerldocumentationforareferencetoallutilityapplications.
AfteryouinstallthevCLI,youcantesttheinstallationbyrunningacommandfromthecommandprompt.See
“RunningHostManagementCommandsfromaLinuxSystem”onpage 37.
Installing vCLI on Linux Systems with Internet Access
BeforeyoucaninstallthevCLIpackageonaLinuxsystemwithInternetaccess,thatsystemmustmeet
followingprerequisites.
Internetaccess.YoumusthaveInternetaccesswhenyouruntheinstallerbecausetheinstallerusesCPAN
toinstallprerequisitePerlmodules.
DevelopmentToolsandLibraries.YoumustinstalltheDevelopmentToolsandLibrariesfortheLinux
platformthatyouareworkingwithbeforeyouinstallvCLIandprerequisitePerlmodules.
Proxysettings.IfyoursystemisusingaproxyforInternetaccess,youmustsetthehttp://andftp://
proxies,asfollows:
export http_proxy=<proxy_server>:port
export ftp_proxy=<proxy_server>:port
Installing Required Prerequisite Software for Linux Systems with Internet
Access
Ifrequiredprerequisitesoftwareisnotinstalled,theinstallerstopsandrequeststhatyouinstallit.Installation
ofprerequisitesoftwaredependsontheplatformthatyouareusing.SeetheReleaseNotesforthesupported
versionsofeachLinuxplatform.
Getting Started with vSphere Command-Line Interfaces
20 VMware, Inc.
Installing the vCLI Package on a Linux System with Internet Access
InstallthevCLIpackageandrunacommandtoverifyinstallationwassuccessful.
To install vCLI
1Loginasroot.
2UntarthevCLIbinarythatyoudownloaded.
tar –zxvf VMware-vSphere-CLI-6.X.X-XXXXX.i386.tar.gz
Avmware-vsphere-vcli-distribdirectoryiscreated.
3 (Optional)IfyourserverusesaproxytoaccesstheInternet,andifyourhttp://andftp://proxywere
notsetwhenyouinstalledprerequisitesoftware,setthemnow.
export http_proxy=<proxy_server>:port
export ftp_proxy=<proxy_server>:port
4Runtheinstaller:
sudo vmware-vsphere-cli-distrib/vmware-install.pl
5Toacceptthelicenseterms,typeyesandpressEnter.
TheinstallerconnectstoCPANandinstallsprerequisitesoftware.Establishingaconnectionmighttakea
longtime.
6OnRHEL,whenpromptedtoinstallprecompiledPerlmodules,typenoandpressEntertouseCPAN
TheinstallerconnectstoCPANandinstallsprerequisitesoftware.Establishingaconnectionmighttakea
longtime.
7Specifyaninstallationdirectory,orpressEntertoacceptthedefault,whichis/usr/bin.
Table 2-1. Installing Required Prerequisite Software
Platform Installation
RHEL6.332bit FindtherequiredmodulesontheinstallationDVD,oruseyumtoinstallthem.
yum install e2fsprogs-devel libuuid-devel
yum install perl-XML-LibXML
RHEL6.364bit FindtherequiredmodulesontheinstallationDVD,oruseyumtoinstallthem.
yum install e2fsprogs-devel libuuid-devel
yum install glibc.i686
yum install perl-XML-LibXML
SUSEEnterprise InstalltheprerequisitepackagesfromtheSLESSDKDVD.WhenyouinserttheDVD,itoffersto
autorun.CanceltheautorundialogboxandusetheyastpackageinstallertoinstallOpenSSLor
othermissingrequiredpackages.
SLES1164bit.yast -i openssl-devel libuuid-devel libuuid-devel-32bit
SLES1132bit.yast -i openssl-devel libuuid-devel
SomeusersmightbeauthorizedtousetheNovellCustomerCenteranduseyasttoretrieve
missingpackagesfromthere.
Ubuntu 1.ConnecttotheInternet.
2.Updatethelocalrepositoryoflibrariesfromaterminalwindow.
sudo apt-get update
3.Installtherequiredlibrariesfromaterminalwindow.
32bit.sudo apt-get install build-essential gcc uuid uuid-dev perl libssl-dev
perl-doc liburi-perl libxml-libxml-perl libcrypt-ssleay-perl
64bit.sudo apt-get install ia32-libs build-essential gcc uuid uuid-dev perl
libssl-dev perl-doc liburi-perl libxml-libxml-perl libcrypt-ssleay-perl
ForUbuntu10.0464bit,theresxtopand
ESXCLIcommandsdonotworkifyoudonotinstall
the32bitcompatibilitylibraries.
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46

VMware ESXI ESXI 6.0 Getting Started

Category
Software manuals
Type
Getting Started
This manual is also suitable for

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI