vsphere esxi vcenter server 51 command line management for service console users

Upload: danial-tan

Post on 03-Apr-2018

249 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    1/30

    Technical Note

    VMware, Inc. 1

    Command-Line Management in vSphere 5 forService Console UsersESXi 5.1

    StartingwithvSphere5.0,theserviceconsole(alsocalledconsoleOSorCOS)withitsassociatedLinux

    installationisnolongeravailable.IfyouarecurrentlyusingESXserviceconsolecommands,scripts,agents,or

    logs,thistechnicalnotehelpsyoutransitiontoanoffhostimplementationortousetheESXiShellinspecial

    cases.

    Introductiononpage 1

    TransitioningServiceConsoleCommandsonpage 2

    ESXiShellAccessonpage 5

    ReplacingAgentsonpage 10

    LogginginvSphere5onpage 11

    RetrievingNetworkingInformationonpage 13

    AddingThirdPartyExtensionstoHostsonpage 14

    ReferencetoReplacementsforServiceConsoleCommandsonpage 14

    Introduction

    InvSphere5.0andvSphere5.1,VMwareoffersthefollowingtools,CLIs,andAPIsthatreplaceESX4.xservice

    consolecomponents.

    IMPORTANT ChangesmadetothehostusingtheDCUI,thevSphereClient,ESXCLI,orotheradministrativetoolsarecommittedtopermanentstorageeveryhourorupongracefulshutdown.Changesmightbelostifthe

    hostfailsbeforetheyarecommitted.

    CLI or Tool Description Availability

    vCLI Includes

    ESXCLI

    commands,

    vicfg-

    commands,andafewothercommandsformanagingvSphere.

    Install

    a

    vCLI

    package

    on

    a

    Windows

    or

    Linux

    systemorruncommandsfromvMA.

    PowerCLI PowerCLIcmdletsformanagingESXihostsandvirtualmachines.

    InstallMicrosoftPowerShellonaWindowssystem,andinstallvSpherePowerCLItorunbothPowerShellandPowerCLIcmdletfromthePowerCLIprompt.

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    2/30

    VMware, Inc. 2

    Command-Line Management in vSphere 5 for Service Console Users

    Transitioning Service Console Commands

    Ifyouarecurrentlymanagingyourenvironmentwithserviceconsolecommands,youcanperformthesame

    managementtasksinvSphere5.0andvSphere5.1inoneofthefollowingways.

    UseoneofthevSphereClientinterfaces.

    InstallvCLIorPowerCLIonamanagementserver,writescriptswiththosecommands,andrunthescripts

    againsttargethosts.SeeRunningvCLIorPowerCLICommandsfromRemoteHostsonpage 3.

    Forcertaintroubleshootingandadvancedmanagementcommands,usecommandsfromtheESXCLI

    command

    set

    directly

    the

    ESXi

    Shell.

    See

    Using

    the

    ESXi

    Shell

    on

    page 5.

    Figure 1illustratesthedifferencesbetweenCLIsinESXi4.1andESXi5.0andlater.

    InESX4.1,afairlylargesetofserviceconsolecommandsisavailable.AsmallsetofESXCLIcommands

    isavailableinboththeserviceconsoleandaspartofthevCLIpackage.ThevCLIpackageincludes,in

    additiontoESXCLIcommands,asetofvicfg-commandsandothercommandsforhostmanagement.

    ESXi5.0andlaterdoesnotincludeaserviceconsole.IntheESXiShell,youcanrunamuchexpandedset

    ofESXCLIcommandsandasmallsetofothercommands.ThesameESXCLIcommands,aswellasafew

    othercommands,areincludedinthevCLIpackageforoffhostmanagement.

    vMA ALinuxvirtualappliancethatincludesthevSphereSDKforPerlandthevCLIpackage.Alsosupportsthevifastpassauthenticationcomponent.

    DeployvMAonanESXisystemandruncommandsagainstauthenticatedtargetserversfromvMA.

    ESXiShellcommands

    SetoftroubleshootingcommandstousewhenvCLIcannotaccessyourESXisystem.Includes

    ESXCLI

    commands

    and

    esxcfg-

    commands

    (deprecated).

    TheESXiShellisdisabledbydefault.YoucanenabletheShellforlocalorremoteaccess.

    CLI or Tool Description Availability

    ESX 4.x Service Console vSphere 5.0 and vSphere 5.1 See

    Serviceconsolecommands OffhostmanagementwithvCLI.

    InstallonWindowsorLinuxorusevMA.

    TransitioningServiceConsoleCommandsonpage 2.ReferencetoReplacementsforServiceConsoleCommandsonpage 14listsvCLIorESXCLIreplacementsforserviceconsolecommandsandpointstomigrationlistsinthistechnicalnote.

    Serviceconsolecommands OffhostmanagementwithVMwarePowerCLIcmdletsfromaWindowssystem.

    GettingStartedwithvSphereCommandLineInterfaces

    vSphereCommandLineInterfaceSolutions

    and

    ExamplesServiceconsolecommands OnhostmanagementintheESXiShellis

    possibleifsystemfailuresorotherissuespreventyoufromusingoffhostmanagementcommands.

    ESXiShellisdisabledbydefault

    SeeESXiShellLocalAccessonpage 5andRemoteAccesstoESXiShellUsingSSHonpage 8.

    Agents IfyourunagentsintheESX4.xserviceconsole,youcanreplacethemwithinfrastructureservicesinmanycases.

    RunningthirdpartyagentsintheESXiShellisnotsupported.

    ReplacingAgentsonpage 10.

    Linuxnetworkingcommands.

    NotavailableintheESXiShell.UseESXCLIcommandsinstead.

    SeeRetrievingNetworkingInformationonpage 13.

    Serviceconsolelogs Finegrainedcontroloversystemlogsisavailable.Youcansendlogstothelocalsystemortoaremotehost.

    LogginginvSphere5onpage 11

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    3/30

    VMware, Inc. 3

    Command-Line Management in vSphere 5 for Service Console Users

    Figure 1. Command-Line Interfaces in ESX 4.1 and ESXi 5.0 and later

    Using vSphere Client Interfaces

    MosttasksyouperformintheESXServiceConsolecanbeperformedbyoneofthegraphicaluserinterfaces

    toESXiorvCenterServersystems.Theinterfacesallowyoutomanageyourinfrastructure,andtoperform

    operationsonmultiplehostsatthesametime.

    InstallthevSphereClientontheWindowssystemofyourchoiceandconnecttoanESXiorvCenterServer

    system.Performmanagementoperationsusingtheclient.

    UsethevSphereWebClientfromoneofthesupportedbrowsers.ThevSphereWebClientisanew

    interfaceandsupportsprimarilyoperationsonvirtualmachines.

    vSphere5documentation

    explains

    how

    to

    perform

    tasks

    by

    using

    one

    of

    the

    client

    UIs.

    Online

    help

    is

    available

    frombothclientUIs.

    Running vCLI or PowerCLI Commands from Remote Hosts

    IfyouhavescriptsthatuseESX4.xserviceconsolecommandsorruncommandsintheESX4.xserviceconsole

    directly,runningvCLIcommandsorPowerCLIcmdletsfromthehostonwhichyouinstalledthosepackages

    givesthebestresults.Runningoffhostishighlyrecommendedbecauseitfacilitatesscripting.

    YoucanusevCLIevenifhostsareinlockdownmodebytargetingthevCenterServersystemandspecifying

    thetargetESXihostwiththe--vihostparameter,forexample:

    esxcli --server --vihost [] storage nfs list

    Ifyou

    do

    not

    specify

    additional

    authentication

    parameters,

    the

    vCLI

    infrastructure

    prompts

    for

    ausername

    andpasswordforthevCenterServersystemspecifiedby--server.

    vCLI Command Set

    ThevCLIcommandsetincludescommonsystemadministrationcommandswhichyoucanrunagainstESXi

    systemsfromanymachinewithnetworkaccesstothosesystems.YoucanalsorunmostvCLIcommands

    againstavCenterServersystemandtargetanyESXisystemthatvCenterServersystemmanages.

    InstallthevCLIcommandsetonasupportedversionsofWindowsorLinux.Theuserrunningacommand

    againstaservermustbeauthenticatedforthatserver.ThevCLIpackageincludesseveralcommandsets.

    ESXCLIESXCLI

    vCLI

    ESXCLI ESXCLI vicfg-and othercommands

    vicfg-and other commandsService console commands

    esxcfg-(deprecated)

    POSIX(subset)

    ESX 4.1

    ESXi 5

    Commands running on host

    vCLICommands running on host

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    4/30

    VMware, Inc. 4

    Command-Line Management in vSphere 5 for Service Console Users

    ThefollowingdocumentationhelpsyouworkwithvCLIcommands.

    GettingStartedwithvSphereCommandLineInterfacesgivesoverviewsofavailablecommandsandincludes

    instructionsforinstallingvCLIonWidowsorLinuxanddetailedinformationaboutconnectionoptions.

    vSphereCommandLineInterfaceConceptsandExamplespresentsusageexamplesformanycommands,such

    assettingupsoftwareandhardwareiSCSI,addingvirtualswitches,settingupActiveDirectory

    authentication,andsoon.Thedocumentincludesthesameexamplewiththevicfg-commandandthe

    ESXCLIcommandwheresupported.

    vSphereCommandLineInterfaceReferenceisareferencetobothvicfg-commandsandESXCLIcommands.

    Thevicfg-commandhelpisgeneratedfromthePODavailableforeachcommand,runpod2htmlfor

    anyvicfg-commandtogenerateindividualHTMLfilesinteractively.TheESXCLIreferenceinformation

    isgeneratedfromtheESXCLIhelp.

    Running ESXCLI Commands Against ESXi 4.x Hosts

    WhenyourunanESXCLIvCLIcommand,youmustknowthecommandssupportedonthetargethost

    specifiedwith

    --server

    or

    as

    avMA

    target.

    IfyouruncommandsagainstESXi4.xhosts,ESXCLI4.xcommandsaresupported.

    IfyouruncommandsagainstESXi5.0hosts,ESXCLI5.0commandsandmostESXCLI5.1commandsare

    supported.CommandsthatarenewinESXCLI5.1arenotsupported.

    IfyouruncommandsagainstESX5.1hosts,ESXCLI5.0commandsandallESXCLI5.1commandsare

    supported.

    VMwarepartnersmightdevelopcustomESXCLIcommandsthatyoucanrunonhostswherethepartnerVIB

    hasbeeninstalled.

    Runesxcli --server --helpforalistofnamespacessupportedonthetarget.Youcandrill

    downintothenamespacesforadditionalhelp.

    PowerCLI Cmdlet Set

    VMwareoffersacomprehensivesetofPowerCLIcmdlets.YoucaninstallthePowerCLIpackageona

    WindowssystemonwhichMicrosoftPowerShellisinstalledandusePowerCLIcmdletstomanagehostsand

    virtualmachines.PowerCLIcmdletsandvCLIcommandsoverlapinfunctionality. ThePowerCLIfocusison

    virtualmachinemanagement.ThevCLIfocusisonhostmanagement.

    SeethevSpherePowerCLIdocumentationset,availableintheVMwareAdministrationAutomationProducts

    sectionofhttp://www.vmware.com/support/pubs.

    Command Set Description

    ESXCLIvCLIcommands

    ExtensiblecommandframeworkformanagingmanyaspectsofvSphere.

    Runesxcli --helptoseealltop-levelnamespaces.Youcanrun--helpatanylevelofthehierarchy.

    TheesxclicommandsetintheESXiShellandtheesxclivCLIcommandsetsupportthesamefunctionality.WhenrunningvCLIcommands,youmustspecifythetargetserverandauthenticationoptions.

    vicfg- (esxcfg-)vCLIcommands

    Setof

    commands

    for

    managing

    many

    aspects

    of

    vSphere.

    For

    each

    vicfg-

    vCLI

    command,

    the

    packageincludesanesxcfg-vCLIcommandthatisequivalentofthevicfg-vCLIcommand.

    Important:esxcfg-vCLIcommandsarenotalwaysequivalenttocorrespondingesxcfg-serviceconsoleorESXiShellcommands.

    vicfg-commandswillbedeprecatedinfuturereleases.Useesxclicommandsinsteadwherepossible.

    Managementcommands

    Asmallsetofmanagementcommandsisavailable.Commandsincludevifsforfilemigration,vmware-cmdformanagingvirtualmachines,andvmkfstoolsforVMFSfilemanagement.

    IMPORTANT ESXCLIonESX4.xhostsdoesnotsupporttargetingavCenterServersystem.Youcanthereforenotruncommandswith--serverpointingtoavCenterServersystemevenifyouinstallvCLI5.0orvCLI5.1.

    http://www.vmware.com/support/pubshttp://www.vmware.com/support/pubs
  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    5/30

    VMware, Inc. 5

    Command-Line Management in vSphere 5 for Service Console Users

    Using the ESXi Shell

    EachESXihostincludesanESXiShell,whichisdisabledbydefault.Administratorscanusethatshellto

    performtroubleshootingandadvancedtaskssuchastestingscriptsinnonproductionenvironments.

    Youcanaccesstheshellasfollows:

    Enablelocalaccessandusethelocalshellonthephysicalconsoleorusingaserialport.SeeESXiShell

    LocalAccessonpage 5.

    EnableSSHaccessandusetheshelloveramanagementnetworkwithSSH.SeeESXiShellAccesson

    page 5.

    TheESXiShellincludesthefollowingcommandsets.

    ESXi Shell Access

    AnESXisystemincludesadirectconsolethatallowsyoutostartandstopthesystemandtoperformalimited

    setofmaintenanceandtroubleshootingtasks.ThedirectconsoleincludestheESXiShell.TheESXiShell

    includesasetoffullysupportedESXCLIcommandsandasetofcommandsfortroubleshootingand

    remediation.YoumustenableaccesstotheESXiShellfromthedirectconsoleofeachsystem.Youcanenable

    access

    to

    the

    local

    ESXi

    Shell

    or

    access

    to

    the

    ESXi

    Shell

    with

    SSH.

    ESXi Shell Local Access

    TheESXiShellisdisabledbydefault.YoucanenabletheESXiShellfortroubleshootingfromthedirectconsole.

    AllESXCLIcommandsthatareavailableintheESXiShellarealsoincludedinthevCLIpackage.Installthe

    vCLIpackageordeploythevMAvirtualappliance,andruncommandsagainstyourESXihosts,insteadof

    runningcommandsintheESXiShellitself.SeeGettingStartedwithvSphereCommandLineInterfaces.

    IMPORTANT ESXiShellisintendedforexperiencedCLIusers.Minorerrorsintheshellcanresultinseriousproblems.InsteadofrunningcommandsdirectlyintheESXiShell,usevCLIcommandsorPowerCLIcmdlets.

    Command Set Description

    ESXCLIcommands ExtensiblecommandframeworkformanagingmanyaspectsofvSphere.

    Runesxcli --helptoseealltop-levelnamespaces.Youcanrun--helpatanylevelofthehierarchy.

    Theesxcli

    command

    set

    in

    the

    ESXi

    Shell

    and

    the

    esxcli

    vCLI

    command

    set

    support

    the

    same

    functionality.WhenrunningvCLIcommands,youmustspecifythetargetserverandauthenticationoptions.

    esxcfg-commands

    (deprecated)

    SetofcommandsformanagingmanyaspectsofvSphere.Mostesxcfg-commandsavailableintheESX4.xserviceconsoleareavailableintheESXiShellbutaredeprecatedinESXi5.0andwillberemovedinafuturerelease.

    UseESXCLIcommandsinsteadofesxcfg-commands.IfnoESXCLIcommandexists,usethevicfg-commandsinthevCLIcommandset.

    Othercommands AsmallsetofPOSIX-stylecommandsisincludedintheshell(seeShellCommandsonpage 10).ThesecommandsarenotsupportedbyVMwarebutareincludedforuseintroubleshootingsituations.UsethevSphereClientorVMwarecommandsinsteadwherepossible.

    localclicommands SetoftroubleshootingcommandsforusewithVMwareTechnicalSupport.localclicommandsequivalenttoESXCLIcommandsbutbypassthehostdaemon(hostd).

    Warning:localclicommandsareonlyforsituationswhenhostdisunavailableandcannotberestarted.Afteryourunalocalclicommand,youmustrestarthostd.Usinglocalclicommandsinothersituationsisnotsupported.Aninconsistentsystemstateandpotentialfailurecanresult.

    NOTE Forsecurityreasons,youshouldenableESXiShellonlywhenrequired.

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    6/30

    VMware, Inc. 6

    Command-Line Management in vSphere 5 for Service Console Users

    Enabling the ESXi Shell

    YoucanenabletheESXiShellfromthedirectconsoleandfromthevSphereClient.EnablingtheESXiShell

    meansmakingitaccessibleasalocalconsoleavailabledirectlyoroveranout-of-bandnetwork.

    To enable the ESXi Shell from the Direct Console

    1 AccessthedirectconsoleoftheESXihost,pressF2,andprovidecredentialswhenprompted.

    2 Scroll

    to

    TroubleshootingOptions,

    and

    press

    Enter.3 SelectEnableESXiShellandpressEnter.

    Ontheleft,EnableESXiShellchangestoDisableESXiShell.Ontheright,ESXiShellisDisabledchangestoESXiShellisEnabled.

    4 (Optional)Configurethetime-outfortheESXiShell

    a SelectModifyESXiShelltimeoutandpressEnter.b Enterthetime-outvalueinminutesandpressEnter.

    5 PressEscuntilyoureturntothemaindirectconsolescreen.

    YoucanenabletheESXiShellfromthevSphereClient.

    To enable the local or remote ESXi Shell from the vSphere Client

    1 Selectthehost,clicktheConfigurationtab,andclickSecurityProfileintheSoftwarepanel.2 IntheServicessection,clickProperties.3 SelectESXiShellandclickOptions.4 ChangetheESXiShelloptions.

    Totemporarilystartorstoptheservice,clicktheStartorStopbutton.

    Toenableaccesspermanently,clickStartandstopwithhost.Thechangewilltakeeffectthenexttimeyourebootthehost.

    5 Click

    OK.

    AfteryouhaveenabledtheESXiShell,youcanuseitfromthatmonitororthroughanout-of-bandnetwork

    connection.

    To enable to local or remote ESXi Shell from the vSphere Web Client

    1 Selectthehost,clicktheManagetab,andclickSettings.

    2 UnderSystem,selectSecurityProfile.3 IntheServicespanel,clickEdit.4 Selectaservicefromthelist.

    ESXiShell

    SSH

    DirectConsoleUI

    5 ClickServiceDetailsandselectthestartuppolicyStartandstopmanually.WhenyouselectStartandstopmanually,theservicedoesnotstartwhenyourebootthehost.Ifyouwanttheservicetostartwhenyourebootthehost,selectStartandstopwithhost.

    6 SelectStarttoenabletheservice.

    7 ClickOK.

    AfteryouhaveenabledtheESXiShell,youcanuseitfromthatmonitororthroughanout-of-bandnetwork

    connection.

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    7/30

    VMware, Inc. 7

    Command-Line Management in vSphere 5 for Service Console Users

    Setting Timeouts for the ESXi Shell

    TheESXiShellsupportsavailabilitytimeoutandidletimeouts.Bydefault,eachtimeoutisdisabled.

    Availabilitytimeout.TheamountoftimethatcanelapsebeforeyoumustloginaftertheESXiShellisenabled.Afterthetimeoutperiod,theserviceisdisabledandusersarenotallowedtologin.

    Idletimeout.Theamountoftimethatcanelapsebeforetheuserisloggedoutofanidleinteractivesessions.ChangestotheidletimeoutapplythenexttimeauserlogsintotheESXiShellanddonotaffect

    existingsessions.

    To set ESXi Shell timeouts from the Direct Console

    1 FromtheTroubleshootingModeOptionsmenu,selectModifyESXiShellandSSHtimeoutsandpressEnter.

    2 EntertheavailabilitytimeoutandpressEnter.

    3 EntertheidletimeoutandpressEnter.

    4 PressEscuntilyoureturntothemainmenuoftheDirectConsoleInterface.

    To set ESXi Shell timeouts from the vSphere Client

    1 SelectthehostintheinventoryandclicktheConfigurationtab.

    2 IntheConfigurationtabsSoftwarepanel,clickAdvancedSettings.3 Intheleftpanel,clickUserVars.

    4 IntheUserVars.ESXiShellTimeOutentertheavailabilitytimeoutinminutes.

    YoumustrestarttheSSHserviceandtheESXiShellserviceforthetimeouttotakeeffect.

    5 IntheUserVars.ESXiShellInteractiveTimeOut field,entertheidletimeoutsetting.

    YoumustrestarttheSSHserviceandtheESXiShellserviceforthetimeouttotakeeffect.

    6 ClickOK.

    To set ESXi Shell timeouts from the vSphere Web Client

    1 Selectthehostintheinventory,clicktheManagetab,andclickSettings.

    2 UnderSystem,selectAdvancedSystemSettings.3 Intheleftpanel,clickUserVars.

    4 SelectUserVars.ESXiShellTimeOutandclicktheEditicon

    5 Entertheavailabilitytimeoutinminutes.

    YoumustrestarttheSSHserviceandtheESXiShellserviceforthetimeouttotakeeffect.

    6 SelectUserVars.ESXiShellInteractiveTimeOut andclicktheEditicon

    7 Entertheavailabilitytimeoutinminutes.

    YoumustrestarttheSSHserviceandtheESXiShellserviceforthetimeouttotakeeffect.

    8 ClickOK.

    Accessing the ESXi Shell with the Direct Console

    AfteryouenableESXiShellaccess,youcanaccessthelocalshell.

    To access the local ESXi Shell

    1 Atthemaindirectconsolescreen,pressAlt-F1toopenavirtualconsolewindowtothehost.

    2 Providecredentialswhenprompted.

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    8/30

    VMware, Inc. 8

    Command-Line Management in vSphere 5 for Service Console Users

    Whenyoutypethepassword,charactersarenotdisplayedontheconsole.

    3 Tologout,typeexitintheshell.

    4 Toreturntothedirectconsole,pressAlt-F2.

    Setting ESXi Shell Timeout

    TheESXiShelltimeoutsettingspecifieshowlong,inminutes,youcanleaveanunusedsessionopen.By

    default,the

    timeout

    for

    the

    ESXi

    Shell

    is

    0,

    which

    means

    the

    session

    remains

    open

    even

    if

    it

    is

    unused.

    If

    you

    changethetimeout,forexample,to30minutes,youhavetologinagainafterthetimeoutperiodhaselapsed.

    YoucanmodifythetimeoutfromtheDirectConsoleorfromthevSphereClient.

    To modify the ESXi Shell Timeout

    IntheDirectConsole,followthesesteps.

    a SelectModifyESXiShelltimeoutandpressEnter.b Enter

    the

    time-out

    value

    in

    minutes

    and

    press

    Enter. InthevSphereClient,followthesesteps.

    a IntheConfigurationtabsSoftwarepanel,clickAdvancedSettings.b Intheleftpanel,clickUserVars.

    c LocateUserVars.ESXiShellTimeOutandenterthetimeoutvalueinminutes.

    d ClickOK.

    Remote Access to ESXi Shell Using SSH

    IfSecureShellisenabledfortheESXiShell,youcanrunshellcommandsbyusingaSecureShellclientsuch

    as

    SSH

    or

    PuTTY.

    Enabling SSH for the ESXi Shell

    Bydefault,youcannotaccesstheESXiShellusingaSecureShellclient.YoucanenableSSHaccessfromthe

    directconsole.

    To enable SSH access in the direct console

    1 AtthedirectconsoleoftheESXihost,pressF2andprovidecredentialswhenprompted.

    2 ScrolltoTroubleshootingOptions,andpressEnter.3 SelectEnableSSHandpressEnteronce.

    Ontheleft,EnableSSHchangestoDisableSSH.Ontheright,SSHisDisabledchangestoSSHisEnabled.

    4 PressEscuntilyoureturntothemaindirectconsolescreen.

    YoucanenableremotecommandexecutionfromthevSphereClient.

    To enable SSH from the vSphere Client

    1 SelectthehostandclicktheConfigurationtab.

    2 ClickSecurityProfileintheSoftwarepanel.3 IntheServicessection,clickProperties.4 SelectSSHandclickOptions.

    NOTE Ifyouareloggedinwhenthetimeoutperiodelapses,yoursessionwillpersist.However,theESXiShellwillbedisabled,preventingotherusersfromloggingin.

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    9/30

    VMware, Inc. 9

    Command-Line Management in vSphere 5 for Service Console Users

    5 ChangetheSSHoptions.

    Totemporarilystartorstoptheservice,clicktheStartorStopbutton.

    ToenableSSHpermanently,clickStartandstopwithhost.Thechangetakeseffectthenexttimeyourebootthehost.

    6 ClickOK.

    AfteryouhaveenabledSSH,youcanuseanSSHclienttologintotheESXiShellandrunESXiShell

    commands.

    Accessing the ESXi Shell with SSH

    IfSSHisenabledonyourESXihost,youcanuseanSSHclienttoruncommandsonthatshell.

    To access the ESXi Shell with SSH

    1 OpenanSSHclient.

    2 SpecifytheIPaddressordomainnameoftheESXihost.

    PrecisedirectionsvarydependingontheSSHclientyouuse.Seevendordocumentationandsupport.

    3 Providecredentialswhenprompted.

    ESXi Shell Commands

    TheESXiShellincludesseveralsetsofcommands.

    ESXCLI Commands

    TheESXiShellinESXi5includesalargesetofnewESXCLInamespacesandcommands.ThecompleteESXCLI

    commandset

    is

    also

    part

    of

    the

    vCLI

    package.

    The

    ESXCLI

    command

    syntax

    in

    ESXi

    5is

    more

    flexible

    than

    thesyntaxinESXi4andsupportsmultiplenamespaces.

    esxcli [dispatch_option] [namespace, ...] [cmd_options]

    Eachcommandcanuseanarbitrarynumberofnamespaces,anddifferentcommandshaveadifferentnumber

    ofelements.Allcommandshavealsobeenreviewedforconsistencyandmostcommandshavebeenrenamed.

    Forexample:

    Eachgetcommandreturnssinglevalues.

    esxcli hardware memory get

    Thelistcommandsareusedformultiplereturnvalues.

    esxcli hardware cpu list

    Table 1. ESXi Shell Commands

    Command Set Description

    ESXCLIcommands AlargesetofnewESXCLIcommandssupportsmanyadministrative tasks.ThecommandsarefullysupportedandtestedbyVMwareandincludecommand-linehelp.SeeGettingStartedwithvSphereCommandLineInterfaces.

    esxcfg-commands Theesxcfg- commandsavailableintheserviceconsolearedeprecated.ThecommandswillberemovedfromtheESXiShellinafuturerelease.SeeReferencetoReplacementsforService

    ConsoleCommands

    on

    page 14.

    POSIX-likecommands

    SeeShellCommandsonpage 10.

    localclicommands SetoftroubleshootingcommandsforusewithVMwareTechnicalSupport.localclicommandsareequivalenttoESXCLIcommandsbutbypassthehostdaemon(hostd).

    Warning:localclicommandsareonlyforsituationswhenhostdisunavailableandcannotberestarted.Afteryourunalocalclicommand,youmustrestarthostd.Usinglocalclicommandsinothersituationsisnotsupported.Aninconsistentsystemstateandpotentialfailurecanresult.

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    10/30

    VMware, Inc. 10

    Command-Line Management in vSphere 5 for Service Console Users

    Manycommandshaveoptions.Useanequalsignoraspacebetweentheoptionandtheoptionvalue.

    esxcli storage nfs add --host= --share= --volume=

    esxcli storage nfs add --host --share --volume

    Shell Commands

    IncontrasttoVMwareESX,VMwareESXidoesnotincludeaconsoleOSwithalargesetofshellcommands

    andothersoftware.However,asmallsetofshellcommandsisavailableintheESXiShell.

    Youcanseealistofcommandsin/usr/bin.Whenyoulistthecommandswithls -al,noticethatseveralof

    theutilitiesareredirectedtocommandsappropriateinthevSphereenvironment.Thefollowingcommands

    producedifferentresultsthantypicalshellcommands.

    Severalcommandsareredirectedtovmkvsitools.

    Pingcommandsareredirectedtovmkping.

    SomeadditionalcommandsareavailableintheESXiShellforcertaintroubleshootingtasks.Usethese

    commandswheninstructedbyaVMwareKnowledgeBasearticleorVMwareTechnicalSupportstaff.

    Usermanagementcommandsaredeprecated.

    Goto/usr/binandrunls -atoseeacompletelist.

    Replacing Agents

    WithESX4.x,managementagentsandhardwaremonitoringandmanagementagentsrunintheservice

    console.WithESXi5,agentsareimplementedinotherways.

    Managementagents.VMwarepartnerscreatemanagementagentsbyusingoneofthevSphereAPIs. Hardwareagents.DevelopersuseCIM(CommonInformationModel)agents.CIMisastandards-based

    approachtomonitoringhardwareresources.CIMoutputisreadablebythird-partymanagementtools.

    TheVMkernelcanincludebothVMwareCIMprovidersandPartnerCIMproviders.UseavSphereClient

    loggedintoavCenterServersystemtoviewhardwareinformationincludingalarms.UsethevSphere

    ClientextensionframeworkorthevSphereCIMSDKforcustomization.

    Infrastructureserviceagents.AdministratorscanuseagentsavailableintheESXiShell.Agentsincludehostd(hostdaemon),vpxa,NTP,syslog,SNMP,andsoon.UsethevSphereSDK,vCLIcommands,or

    ESXCLIcommands

    to

    manage

    the

    agents.

    IMPORTANT ForacompletelistofESXCLIcommands,seethevSphereCommandLineInterfaceReference.ThevSphereCommandLineInterfaceConceptsandExamplesdocumentillustrateshowtoperformcommontaskswith

    ESXCLIorvicfg-commands.

    IMPORTANT ThecommandsarenottestedorsupportedbyVMware.UseVMwarecommandssuchasESXCLI,vicfg-commands,andsoon,instead.

    IMPORTANT vmkvsitoolsisintendedforusewithVMwareTechnicalSupport.Donotusevmkvsitoolstomanageyoursystem.

    Table 2. Infrastructure Services for Production Environments

    Function ESX ESXi Management

    Timesynchronization NTPagentinserviceconsole

    Built-inNTPservice vicfg-ntpcommand

    Centralizedlogcollection Syslogagentinserviceconsole

    Built-inSyslogservice esxcli system syslogcommands

    vSphereClient

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    11/30

    VMware, Inc. 11

    Command-Line Management in vSphere 5 for Service Console Users

    Logging in vSphere 5

    LogginginvSphere5hasbeensignificantlyenhanced.Younowhavefine-grainedcontroloversystemlogs,

    thelocationwherelogsaresent,and,foreachlog,defaultsizeandrotationpolicy.Youcansetuploggingwith

    thevSphereClientorwiththeesxcli system syslogcommand.Youcanalsosetuploggingbehaviorfora

    hostbyusingtheHostProfilesinterfaceinthevSphereClientandcanthenimportthathostprofileintoother

    hosts.

    Remote Logging Setup in ESXi

    YoucanmovemostESXilogginginformationoffthehost.Collectingdatatoacentrallocationisespecially

    usefulfor

    hosts

    provisioned

    with

    Auto

    Deploy.

    You

    can

    perform

    these

    tasks:

    SetupNTPontheESXihostsyouaremonitoringandonthesystemsthathosttheloggingservicesorstore

    thelogs.YoucanusethevSphereClientorthevicfg-ntpvCLIcommandtosetupNTP.

    Configuresyslogtosavelogstoaremotehost.Youcansendlogstoaspecificdirectory,andconfigure

    subloggers.SeeUsingESXCLIforSyslogConfigurationonpage 11.

    vCenterServerandESXihaveSNMPagents.YoucansetupthevCenterServerSNMPagentwiththe

    vSphereClient.YoucansetuptheESXiSNMPagentwiththevSphereClientortheesxcli system snmp

    commands.SeevSphereCommandLineInterfaceSolutionsandExamples.

    ListenforCIMindications.

    Using ESXCLI for Syslog Configuration

    Theesxcli system syslogcommandallowsyoutoconfiguretheloggingbehaviorofyourESXisystem.

    YoucanperformthesamecustomizationswiththevSphereclient,asdiscussedinthevCenterServerandHost

    Managementdocumentation.Thecommandhasthefollowingoptions:

    SNMPmonitoring SNMPagentinserviceconsole

    Built-inSNMPservice esxcli system snmpcommand

    Localaccessauthentication

    ActiveDirectory(AD)agentinserviceconsoleBuiltinActiveDirectory

    service

    Built-inActiveDirectoryservice

    vSphereClientvicfg-authconfigvCLIcommand.

    Table 2. Infrastructure Services for Production Environments (Continued)

    Function ESX ESXi Management

    Table 3. esxcli syslog Options

    Option Description

    mark Markalllogswiththespecifiedstring.

    reload Reloadtheconfigurationandupdateanyconfigurationvaluesthathavechanged.

    config get Retrievethecurrentconfiguration.

    config set Settheconfiguration.Useoneofthefollowingoptions.

    --logdir=Savelogstoagivenpath.

    --loghost=Sendlogstoagivenhost(seediscussiononloghostformatbelow)

    --logdir-unique=Specifywhetherthelogshouldgotoauniquesubdirectoryofthedirectoryspecifiedinlogdir.

    --default-rotate=Defaultnumberoflogrotationstokeep

    --default-size=Sizebeforerotatinglogs,inkilobytes.

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    12/30

    VMware, Inc. 12

    Command-Line Management in vSphere 5 for Service Console Users

    esxcli system syslog Examples

    Thefollowingworkflowillustrateshowyoumightuseesxcli system syslogforlogconfiguration.

    1 Showconfigurationoptions.

    esxcli system syslog config get

    Default Rotation Size: 1024

    Default Rotations: 8

    Log Output: /scratch/log

    Logto Unique Subdirectory: falseRemote Host:

    2 Setalllogstokeeptwentyversions,thenstartoverwritingtheoldestlog.

    esxcli system syslog config set --default-rotate=20

    3 SettherotationpolicyforVMkernellogsto10rotations,rotatingat2MB.

    esxcli system syslog config logger --id=vmkernel --size=2048 --rotate=10

    4 Sendlogstoremotehostmyhost.mycompany.com.ThelogswillusethedefaultUDPport,514.

    esxcli system syslog config set --loghost='myhost.mycompany.com'

    5 Sendlogs/scratch/mylogsontheremotehostmyhost.mycompany.comusingTCP/IPport1514.

    esxcli system syslog config set --loghost='tcp://myhost.mycompany.com:1514'

    --logdir='/scratch/mylogs'

    6 Sendalogmessageintoalllogssimultaneously.

    esxcli system syslog mark --message="this is a message!"

    7 Reloadthesyslogdaemonandapplyconfigurationchanges.

    esxcli system syslog reload

    Viewing Logs in the ESXi Shell

    IntheESX4.xshell,thelocationforlogsis/var/log.IntheESXiShell,youcanalsofindallcurrentlogsinthe

    /var/logdirectory.Someofthelogsaresymboliclinkstothe/var/run/logdirectory.

    Mostlogs

    are

    at

    top

    level

    and

    not

    inside

    adirectory

    under

    /var/run/log.

    Available

    logs

    depend

    on

    which

    pluginsareinstalledandwhatotherchangesmighthavebeenmadetothesystem.Thefollowingtablelists

    somefrequentlyusedlogsintheESXiShell.

    config logger list Showcurrentlyconfiguredsub-loggers.

    config logger set Setconfigurationoptionsforaspecificsublogger.Useoneofthefollowingoptions:

    --id=IDoftheloggertoconfigure(required)

    --reset=Resetvaluestodefault

    --rotate=Numberofrotatedlogstokeepforaspecificlogger(requires--id)

    --size=Setsizeoflogsbeforerotationforaspecificlogger,inkilobytes(requires--id)

    Table 3. esxcli syslog Options (Continued)

    Option Description

    ESX 4.x shell ESXi 5.x shell Description

    /var/log/vmware/hostd.log /var/log/hostd.log Logforthehostdaemon.

    /var/log/vmkwarning /var/log/vmkwarning.log

    /var/log/vmksummary /var/log/vmksummary.log

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    13/30

    VMware, Inc. 13

    Command-Line Management in vSphere 5 for Service Console Users

    Core Dump Setup for ESXi

    Acore

    dump

    can

    be

    used

    to

    determine

    the

    reason

    for

    system

    failure.

    With

    ESX,

    the

    core

    dump

    was

    placed

    on

    thelocaldiskinmanycases.WithESXi,youhavetwooptionsformanagingcoredumps.

    CreateadiagnosticpartitiononSANstorage.Eachhostmusthaveadiagnosticpartitionof100MB.IfmultiplehostsshareaSAN,configureadiagnosticpartitionwith100MBforeachhost.

    InstallandconfigureESXiDumpCollector.NewinESXi,theDumpCollectorserviceallowsyoutosendcoredumpstoanetworkserver.ESXiDumpCollectorisespeciallyusefulfordeterminingreasonsfor

    failureofESXihostsprovisionedwithAutoDeploy.

    Youcanuseesxcli system coredumptoconfigurearemoteorlocalcoredumppartition.Youcanalsouse

    theNetworkConfigurationhostprofiletosetuphoststouseESXiDumpCollector.Foreithercase,youcan

    applythehostprofileofahostthatusesESXiDumpCollectortootherhosts.

    To use ESXi Dump Collector

    1 InstalltheESXiDumpCollectorserviceonthevCenterServersystemoraWindowsorLinuxsystemof

    yourchoice.

    ESXiDumpCollectorisoneoftheservicesyoucaninstallusingthevCenterServersysteminstallation

    package.SeevSphereInstallationandSetup.

    IfyouusethevCenterServeronLinuxappliance,ESXiDumpCollectorispreinstalled.

    2 SetupESXisystemsthatshoulduseESXiDumpCollectorwithcommandsintheesxcli system

    coredumpnamespace.

    Twonamespacesaresupportedinsidethisnamespace.

    esxcli system coredump partition

    get:Retrieveoneofthedumppartitionvalues.

    list:ListallpartitionsonthesystemthathaveapartitiontypematchingtheVMwareCore

    partitiontype.

    set:Setthecoredumppartitionforthissystem.

    esxcli system coredump network

    get:GetthecurrentlyconfigureparametersforESXiDumpCollector(networkcoredump),if

    enabled.

    set:Settheparametersusedfornetworkcoredump.

    ThefollowingexamplesetsupthenetworkandenablesESXiDumpCollectorwiththeESXCLIvCLI

    command.

    esxcli --server MyESXiHost system coredump network set --interface-name vmk0 --server-ipv4 10XX...

    --port 6500esxcli --server MyESXiHost system coredump network get --enable true --type networkYouarepromptedforausernameandpasswordfortheESXihost.

    Retrieving Networking Information

    LinuxcommandsforretrievingnetworkinginformationarenotincludedintheESXiShell.Youcaninstead

    useESXCLIcommands.

    /var/log/messages /var/log/vmkernel.log VMkernelwarningsandVMkernelevents.

    /var/log/vmware/vpx/vpxa.log /var/log/vpxa.log vCenterServeragentlog.

    ESX 4.x shell ESXi 5.x shell Description

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    14/30

    VMware, Inc. 14

    Command-Line Management in vSphere 5 for Service Console Users

    OnESXi5,ifconfiginformationistheinformationfortheVMkernelNICthatattachestotheManagement

    Networkportgroup.YoucanretrievethatinformationbyusingESXCLIcommands.

    esxcli network ip interface list

    esxcli network ip interface ipv4 get -n vmk

    esxcli network ip interface ipv6 get -n vmk

    esxcli network ip interface ipv6 address list

    YoucanretrieveinformationaboutDNSwiththeesxcli network ip dnscommandinthefollowingtwo

    namespaces:esxcli network ip dns search

    esxcli network ip dns server

    ForinformationcorrespondingtotheLinuxnetstatcommand,usethefollowingESXCLIcommand.

    esxcli network ip connection list

    Adding Third-Party Extensions to Hosts

    TheprocessofaddingpatchesissimplifiedinESXi5.Allpatchesandthird-partyextensionscanbemade

    availableasVIBpackages.WhenaVMwarepartnerreleasesathird-partyextensionasaVIBpackage,the

    partnercanmakethepackageavailableasaZIPdepot(offlinedepot).

    1 Downloadthe

    ZIP

    depot

    to

    your

    ESXi

    system

    but

    do

    not

    unpack

    it.

    2 Runesxcli software vibtoaddthepackagetoyoursystem.

    3 RebootyourESXisystem

    Rebootisalwaysrecommended.Somepatchesdonotrequirereboot.

    TheVIBsystemrefreshesthehostdaemonafteryourebootyoursystem.IftheVIBrequiresanexceptionto

    thefirewallrules,rebootingalsoupdatesthefirewallruleset.

    Youcaninsteaduseafirewallconfigurationfiletospecifyportrulesforhostservicesyouwanttoenablefor

    theextension.

    vSphereSecuritydocumentationdiscusseshowtoadd,apply,andrefreshafirewallrulesetandliststheesxcli

    network firewallcommands.TheESXi5ruleset.xmlformatisthesameasinESX/ESXi4.x,buthastwo

    additionaltags,enabledandrequired.ThefirewallonESXi5.0andonESXi5.1stillsupportstheoldformat.

    vSphereUpgradedocumentationdiscussesusingesxcli software sourcesandesxcli software vibto

    exploreandinstallpatchesandextensions.

    Insomesituations,youmightusevSphereUpdateManagerinsteadoftheesxclicommandtoinstall

    third-partyextensions.Theextensionvendorprovidesinformationontheinstallorupgradeprocess.

    Reference to Replacements for Service Console Commands

    Table 4listscommonESX/ESXi4.xserviceconsolecommandsandcorrespondingESXi5shellcommands.

    ThelinksintheCommandcolumnofthetablepointtomoredetailedinformationforeachcommand,with

    correspondingESXCLIcommandsforeachoptionwhereavailable.ClickthelinkintheMoreInformation

    columnforatablewithdetailedinformationaboutthatcommand.

    IMPORTANT ThisdocumentdoesnotpresentacompletelistofESXCLIcommands.Thefocusisonreplacingexisting

    service

    console

    commands.

    See

    the

    vSphere

    Command

    Line

    Interface

    Reference

    for

    acomplete

    list

    of

    commands.

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    15/30

    VMware, Inc. 15

    Command-Line Management in vSphere 5 for Service Console Users

    Table 4. Replacements for Service Console Commands

    Service Console

    Command ESXi 5 Replacement More Information

    Deprecated

    ESXi Shell

    esxcli SyntaxformostESXCLIcommandshaschanged. ESXCLICommandSyntaxonpage 16

    No

    esxcfg-advcfg esxcli system settings advanced esxcfg-advcfgonpage 18 Yes

    esxcfg-dumppart esxcli system coredump esxcfg-dumppart

    on

    page 19 Yes

    esxcfg-firewall InESX4.x,protectstheserviceconsole.InESXi5.x,esxcfg-firewallisnotnecessarybecausenoserviceconsoleexists.

    Theesxcli network firewallcommandisavailableforESXifirewallmanagement.

    vSphereSecurity

    documentation.N.A.

    esxcfg-info ProvidesaviewoftheinternalstateoftheVMkernelandserviceconsolecomponents.SomeofthefunctionalityiscoveredbycertainESXCLIcommands.

    esxcfg-infoonpage 20 No

    esxcfg-ipsec esxcli network ip ipsec esxcfg-ipseconpage 21 No

    esxcfg-swiscsi

    esxcfg-hwiscsi

    esxcli iscsi esxcfg-swiscsiandesxcfg-hwiscsionpage 22

    Yes

    esxcfg-module esxcli system module esxcfg-moduleonpage 24

    Yes

    esxcfg-mpath esxcli storage core pathcommands. esxcfg-mpathonpage 24 Yes

    esxcfg-nas esxcli storage nfs esxcfg-nasonpage 25 Yes

    esxcfg-nics esxcli network nic esxcfg-nicsonpage 25 Yes

    esxcfg-rescan esxcli storage corecommands. esxcfg-rescanonpage 26 Yes

    esxcfg-route esxcli network ip routecommands esxcfg-routeonpage 23 Yes

    esxcfg-scsidevs Useesxcli storage coreandesxcli storage corefilesystemcommands.

    esxcfg-scsidevsonpage 23

    Yes

    esxcfg-vmknic esxcli network ip interfacecoversmostoptionsandincludesanumberofoptionsnotavailableintheesxcfg-vmkniccommand.

    esxcfg-vmkniconpage 26

    Yes

    esxcfg-volume esxcli storage filesystem esxcfg-volumeonpage 27

    Yes

    esxcfg-vswif Usedtoconfigureserviceconsolenetworkingin4.xsystems.NotneededandnotavailableintheESXi5.xESXiShell.

    Yes

    esxcfg-vswitch esxcli network vswitch standardforstandardswitches.

    esxcli network vswitch dvsfordistributedswitches.

    esxcfg-vswitchonpage 28

    Yes

    esxtop SupportedintheESXi5.xESXiShell.IfyoudonothaveaccesstotheESXiShell,usetheresxtopremotevCLIcommandfromasupportedLinuxsystemorfromvMA.

    esxtoponpage 29 No

    esxupdate esxclisoftware vib

    Note:BothesxupdateandvihostupdatearenotsupportedagainstESXi5.0andESXi5.1hosts.

    esxupdateon

    page 29 Yes

    vmkfstools ThevmkfstoolscommandisavailableintheESXi5.xESXiShell.ThevmkfstoolsvCLIcommandoptionsdifferslightlyfromtheshellcommandoptions.

    vmkfstoolsonpage 30 No

    vmkping Nochangeandnotdeprecated. Usevmkping --helpforinformation.

    No

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    16/30

    VMware, Inc. 16

    Command-Line Management in vSphere 5 for Service Console Users

    ESXCLI Command Syntax

    InESXi4.x,allESXCLIcommandsmustfollowthesamesyntax.

    esxcli [cmd_options]

    InESXi5.0andESXi5.1,theESXCLIcommandsyntaxismoreflexible.Eachcommandcanuseanarbitrary

    numberofnamespaces.Differentcommandshaveadifferentnumberofelements.

    esxcli [namespace, ...] [cmd_options]

    Updates to ESXCLI 4.x Commands

    Thefollowingtablelistsequivalentcommandsforesxclicorestoragecommands.

    vmware-cmd NotavailableinESXiShell.AvailableinvCLI.Inmanycases,VMwarePowerCLIcmdletsperformthesametasksasvmware-cmd.

    Usevmware-cmd--helpforinformation.

    Yes

    vm-support Createsatararchivecontainingdebugginginformationfor

    the

    server.

    ThiscommandisintendedforusewithVMwareSupport.NoequivalentvCLIcommandexists.

    Usevm-support --help

    for

    more

    information.

    No

    Table 4. Replacements for Service Console Commands (Continued)

    Service Console

    Command ESXi 5 Replacement More Information

    Deprecated

    ESXi Shell

    IMPORTANT YoumustupdateallESXCLIcommandsexplicitly;noscriptsareavailableforthetask.StartingwithvSphere5.0,mostmanagementcommandswillbeESXCLIcommands.

    Table 5. esxcli 4.x corestorage namespace

    ESXCLI in ESXi 4.x ESXCLI in ESXi 5.x

    corestorage claiming reclaim --

    corestorage claiming unclaim --

    storage core claiming reclaim --

    storage core claiming unclaim --

    corestorage claimrule add --

    corestorage claimrule convert --commit

    corestorage claimrule delete --

    corestorage claimrule list --claimrule

    corestorage claimrule load --claimrule-class

    corestorage claimrule move --

    corestorage claimrule run --

    storage core claimrule add --

    Severalnewoptionsforthiscommandareavailable.SeethevSphereCommandLineInterfaceReference,orrunthecommandwith--help.

    storage core claimrule convert --commit

    storage core claimrule remove --

    storage core claimrule list --claimrule-class

    storage core claimrule load --claimrule-class

    storage core claimrule move --

    storage core claimrule run --

    corestorage device list --device storage core device stats get

    storage core device list --device

    Otherlistcommandsareincludedinthisnamespace.

    corestorage plugin list --plugin-class storage core plugin list --plugin-class

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    17/30

    VMware, Inc. 17

    Command-Line Management in vSphere 5 for Service Console Users

    Thefollowingtablelistsequivalentcommandsforesxcli storage nmpcommands.

    Theesxcli networkcommandsincludedinESXCLI4.1havebeenrenamed.Manyadditionalnetworking

    commandsareavailableinESXCLI5.x

    Theesxcli swiscsinamespacesupportsafewmanagementcommandsforsoftwareiSCSIinESXi4.1.The

    commandshavebeenrenamed.ESXCLIequivalentshavealsobeenaddedfortheesxcfg-swiscsiand

    esxcfg-hwiscsicommands.

    Table 6. esxcli nmp namespace

    esxcli storage nmp commands in ESXi 4.x esxcli storage nmp commands in ESXi 5.x

    nmp device list --list

    nmp device list --device

    nmp device setpolicy

    nmp path list [--device|--path]

    nmp fixed getpreferred

    nmp psp list

    nmp psp getconfig [--device|--path]

    nmp psp setconfig

    [--config|--device|--path]

    nmp roundrobin getconfig

    nmp roundrobin setconfig

    nmp satp list

    nmp satp listrules

    nmp satp addrule

    nmp satp deleterule

    nmp satp getconfig --device

    nmp satp getconfig --path

    nmp satp setconfig --config --device

    nmp satp setconfig --config --path

    nmp satp setdefaultpsp [--boot | --psp |

    --satp]

    nmp device list

    nmp device list --device

    nmp device set

    nmp psp generic deviceconfig get --device

    nmp psp fixed deviceconfig set

    nmp psp generic deviceconfig get [--device]

    nmp psp generic deviceconfig set

    [--config|--path]

    nmp psp roundrobin deviceconfig get

    nmp psp roundrobin deviceconfig set

    nmp satp list

    nmp satp rule list

    nmp satp rule add

    nmp satp rule remove

    nmp satp generic deviceconfig get --device

    nmp satp generic pathconfig get --path

    nmp psp generic deviceconfig set

    nmp psp generic pathconfig set

    nmp satp set [--boot | --psp | --satp]

    Table 7. esxcli network namespace

    esxcli 4.x esxcli 5.x Comment

    network neighbors list network ip neighbor list ListARPtableentries.

    network connection list network ip connection list ListactiveTCP/IPconnections.

    Table 8. esxcli swiscsi namespace

    ESXCLI 4.x esxcli 5.x Comment

    swiscsi nic [--add |

    --list | --remove]

    iscsi networkportal [add | list

    | remove]

    PerformoperationsontheiSCSInetworkportal(iSCSIVMkernelNIC).

    swiscsi vmknic --list iscsi logicalnetworkportal list PerformoperationsontheiSCSIlogicalnetworkportal.

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    18/30

    VMware, Inc. 18

    Command-Line Management in vSphere 5 for Service Console Users

    The4.1esxcli vmsnamespaceallowsyoutolistvirtualmachinesandforciblystopthem.Thenamespacehas

    beenrenamed.

    esxcfg-advcfg

    Insteadofesxcfc-advcfg,useesxcli system settings advanced.Thefollowingcommandsare

    supported.

    swiscsi vmnic --list iscsi physicalnetworkportal

    list

    PerformoperationsontheiSCSIphysicalnetworkportal(uplink).

    swiscsi session [--add |

    --list | --remove]

    iscsi session [add | list |

    remove]

    PerformoperationsoniSCSIsessions.

    Note:TheaddandremovecommandsareintendedonlyforusebyVMware

    partners.Usetheiscsi session connectionnamespacetoperformoperationsontheiSCSIconnection.

    esxcli 4.x esxcli 5.x Comment

    vms vm kill vm process kill Forciblykillvirtualmachinesthatarenotrespondingtonormalstopoperations.Requiresthetypeofkilloperation(soft,hard,force)andtheworldIDofthevirtualmachinetokill.

    vms vm list vm process list Displaythe

    world

    ID

    of

    virtual

    machines

    on

    the

    host.

    Table 9. esxcfg-advcfg Replacement Commands

    esxcfg-advcfg option ESXCLI Command Description

    -g|--get system settings advanced list

    -o=option

    GetthevalueoftheVMkerneladvancedconfigurationoption.Us--optiontoretrieveinformationforasingleoption,or--treetolimitthelisttoaspecificsubtree.

    -s|--set system settings advanced set Setthe

    value

    of

    the

    VMkernel

    advanced

    configurationoption.

    -d|--default system settings advanced set

    -d|--default

    ResetaVMkerneladvancedconfigurationoptiontodefault.

    -l|--list system settings advanced list ListallVMkerneladvancedconfigurationoptions.

    -q|--quiet Nolongersupported

    -k|--set-kernel system settings kernel set SetaVMkernelloadtimeoptionvalueforthenextboot.

    -j|--get-kernel system settings kernel list GetaVMkernelloadtimeoptionvalueforthenextboot.

    -c|--get-config Notsupported

    -m|--set-message system welcomemsg set Setthewelcomemessageforthedirectconsole.Youcanretrievethemessagewithsystem welcomemsg get.

    -u|--uuid system uuid get EnsuretheVMkernelsystemUUIDissetandprintit.

    -G|--get-user-var system settings advanced list | grep

    Getthevalueofauser-specifiedgenericvalue.

    -S|--set-user-var system settings advanced set Setthevalueofauser-specifiedgenericvalue.

    Table 8. esxcli swiscsi namespace (Continued)

    ESXCLI 4.x esxcli 5.x Comment

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    19/30

    VMware, Inc. 19

    Command-Line Management in vSphere 5 for Service Console Users

    esxcfg-dumppart

    WhenusingtheESXiShell,youcanconfigureyoursystemtosavecoredumpstoalocalpartitionortousethe

    ESXiDumpCollectorandsavecoredumpstoaprespecifiedlocalorremotepartition.

    Useesxcli coredump partitioncommandstoconfigurealocaldumppartition.

    InstallESXiDumpCollectortosupportsendingcoredumpstoaremotehostandrunesxcli coredump

    networkcommandstoconfiguretheremotedumppartition.

    Thefollowing

    table

    lists

    the

    esxcfg-dumppart

    command

    options

    and

    corresponding

    ESXCLI

    commands.

    -D|--del-user-var Addingordeletinguservariablesisnolongersupported.

    -U|--user-var --option= Nameoftheuservariabletouseforwhenretrievingandsettinguservariables.

    -A|--add-option

    Nolongersupported.

    ThisoptionwasusedtoaddCIMoptions.UsetheCIMSDKinstead.

    -T|--add-type Addingordeletinguservariablesisnolongersupported.

    -E|--add-desc Addingordeletinguservariablesisnolongersupported.

    -F|--add-default Addingordeletinguservariablesisnolongersupported.

    -N|--add-min Addingordeletinguservariablesisnolongersupported.

    -M|--add-max Addingordeletinguservariablesisnolonger

    supported.

    -H|--add-hidden

    Addingordeletinguservariablesisnolongersupported.

    -L|--del-option

    Nolongersupported.

    ThisoptionwasusedtoaddCIMoptions.UsetheCIMSDKinstead.

    -V|--has-option

    Useesxcli system settings advancedlisttolistalloptionsinstead.

    TheESXCLIcommandliststhevalueoftheVMkerneladvancedconfigurationoptions.Theoutputincludesthecurrentsettingforeachoption.

    -r|--restore Nolongeravailable.Internaluseonlyinpreviousversions.

    IMPORTANT Youcannolongeruseesxcfg-dumpparttoenablecoredumps.UseESXCLIinstead.

    Table 9. esxcfg-advcfg Replacement Commands (Continued)

    esxcfg-advcfg option ESXCLI Command Description

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    20/30

    VMware, Inc. 20

    Command-Line Management in vSphere 5 for Service Console Users

    -

    esxcfg-info

    No

    comprehensive

    set

    of

    equivalent

    ESXCLI

    commands

    corresponding

    toesxcfg-info

    is

    available

    yet.

    The

    followingcommandsareofferingsomeoftheesxcfg-infocapability.

    Table 10. esxcfg-dumppart Replacement Commands

    esxcfg-dumppart Option ESXCLI Command Description

    -l | --list system coredump partition list ListallpartitionsontheESXisystemthathavetheappropriatepartitiontypetoactasadiagnosticpartition.

    Important:Executionmighttakeseveralminutesandslowdownyour

    ESXi

    host

    because

    the

    command

    scans

    allLUNsonthesystem.

    -t | --get-active system coredump partition get Displaytheactivediagnosticpartitionforthissystem.RunningtheESXCLIcommandreturnstheactiveconfiguredpartition.

    Ifanactivepartitionexists,thecommandreturnsthenaanumberoftheLUNandthecorrespondingpartition,intheformat naa.xx...:p.

    -c | --get-config system coredump partition get Gettheconfigureddiagnosticpartitionforthesystem.

    -S | --smart-activate system coredump partition set

    --smart --enable= true

    Runthesmartactivatealgorithmto

    activate

    the

    configured

    dump

    partition,orifnopartitionisconfigured,selectthebestpossiblecandidatebasedonthemediaoftheavailabledumppartitions.

    -a | --activate system coredump partition set

    --enable=true

    Makethespecifiedpartitionthecurrentdiagnostic partition.

    -d | --deactivate system coredump partition set

    --enable=false

    DeactivatetheactivediagnosticpartitionordeactivateESXiDumpCollector.

    CAUTION:Ifyourunthiscommand,yoursystemcannotwriteerrorstoafileuntilanotherpartitionisactivated.Youloseanyerrorrecordiferrors

    occur.

    -s | --set

    system coredump partition set

    --partition xxx.xxx

    Setandactivatethediagnosticpartition.Specifythepartitionusingnaa.xxx:1oreui.xxxsyntax.

    -C | --copy [-n |

    --newonly] [-z |

    --zdumpname] [-o |

    --slot]

    NocorrespondingESXCLIcommand.

    -L --log NocorrespondingESXCLIcommand.

    Table 11. ESXCLI Information Retrieval Commands

    Command Description

    hardware bootdevice list Listthebootdeviceorderforthishost,ifavailable.

    hardware clock get Displaythecurrenthardwareclocktime.

    hardware cpu cpuid get GetinformationfromtheCPUIDinstructiononeachCPUonthishost.

    harware cpu cpuid get --cpu= GetinformationfromtheCPUIDinstructiononCPUnumber.

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    21/30

    VMware, Inc. 21

    Command-Line Management in vSphere 5 for Service Console Users

    esxcfg-ipsec

    InvSphere

    5.1,

    you

    can

    use

    commands

    in

    the

    esxcli network ip ipsec

    namespace

    in

    place

    of

    the

    esxcfg-ipseccommand.

    hardware cpu global get ListinformationandconfigurationglobaltoallCPUs.

    hardware cpu list ListallCPUsonthishost.

    hardware memory get Getinformationaboutmemory.

    hardware pci list ListallthePCIdevicesonthishost.

    hardware platform get Getinformationabouttheplatform.

    network vswitch standard list ListthevirtualswitchesontheESXihost.

    network vswitch standard policy shaping get Retrievethenetworkshapinginformationforthevirtualswitch.

    network vswitch standard policy failover get Retrievethefailoverpolicyinformationforthevirtualswitch.

    network vswitch standard policy security get Retrievethesecuritypolicyinformationforthevirtualswitch.

    network vswitch standard portgroup policy shaping

    get

    Retrievethenetworkshapinginformationfortheportgroup.

    network vswitch standard portgroup policy failover

    get

    Retrievethefailoverpolicyinformationfortheport

    group.

    network vswitch standard portgroup policy security

    get

    Retrievethesecuritypolicyinformationfortheportgroup.

    network nic list ListthephysicalNICscurrentlyinstalledandloadedonthesystem.

    network ip interface list ListtheVMkernelnetworkinterfacescurrentlyknowntothesystem.

    network ip dns server list PrintalistoftheDNSservercurrentlyconfiguredonthesystemintheorderinwhichtheywillbeused.

    Table 12. esxcfg-ipsec Replacement Commands

    vicfg-ipsec Option esxcli Command or Option

    --action [none|discard|ipsec] | network ip ipsec sp add --action

    --add-sa | network ip ipsec sa add

    --add-sp | network ip ipsec sp add

    --dir [in | out] | network ip ipsec sp add --flowdirection

    --dst-port | network ip ipsec sp add --destinationport

    --flush-sa | network ip ipsec sp remove --removeall

    --flush-sp | network ip ipsec sa remove --removeall

    --ealgo [null | 3des-cbc | aes128-cbc]| network ip ipsec sa add --encryptionalgorithm

    --ekey | network ip ipsec sa add --encryptionkey

    --ialgo [hmac-sha1 | hmac-sha2-256] | network ip ipsec sa add --integrityalgorithm

    --ikey | network ip ipsec sa add --integritykey

    --list-sa | network ip ipsec sa list

    --list-sp | network ip ipsec sp list

    --remove-sa | network ip ipsec sa remove

    Table 11. ESXCLI Information Retrieval Commands (Continued)

    Command Description

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    22/30

    VMware, Inc. 22

    Command-Line Management in vSphere 5 for Service Console Users

    esxcfg-swiscsi and esxcfg-hwiscsi

    TheESX4.xserviceconsoleincludestwocommandsforiSCSImanagement.

    Theesxcfg-swiscsicommandmanagessoftwareiSCSI.EquivalentESXCLIcommandsareavailablein

    vSphere5.

    Theesxcfg-hwiscsicommandmanagedhardwareiSCSI.

    --remove-sp | network ip ipsec sp remove

    --sa-dst network ip ipsec sa add --sadestination

    network ip ipsec sa remove --sadestination

    --sa-src | network ip ipsec sa add --sasource

    network ip ipsec sa remove --sasource

    --sa-name | network ip ipsec sa add --saname

    network ip ipsec sa remove --saname

    --sp-dst | network ip ipsec sp add --spdestination

    --spi | network ip ipsec sa add --saspi

    network ip ipsec sa remove --saspi

    --sp-src | network ip ipsec sp add --spsource

    --spmode | network ip ipsec sp add --spmode

    --src-port | network ip ipsec sp add --sourceport

    --ulproto [any | tcp | udp | icmp6] network ip ipsec sp add --sourceport

    --upperlayerprotocol

    Table 13. esxcfg-swiscsi Replacement Commands

    esxcfg-swiscsi Option ESXCLI Command Description

    -e --enable iscsi software set --enabled=true EnableSoftwareiSCSIonthesystem,ifdisabled.

    -D --disable iscsi software set--enabled=false

    DisableSoftware

    iSCSI

    on

    the

    system,

    if

    enabled.

    -q --query iscsi software get CheckifSoftwareiSCSIisenabledordisabledonthesystem.

    -s --scan iscsi adapter discovery rediscover

    -A

    storage core adapter rescan [-A

    | -all]

    ScanthesystemfordisksavailablethroughSoftwareiSCSIinterface.Callthetwocommandsinorder.

    -k --kill Notsupported

    -r --restore Notsupported

    Table 12. esxcfg-ipsec Replacement Commands

    vicfg-ipsec Option esxcli Command or Option

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    23/30

    VMware, Inc. 23

    Command-Line Management in vSphere 5 for Service Console Users

    esxcfg-route

    Theesxcfg-routecommandhasequivalentESXCLIcommands.Thenewcommandsethasenhanced

    functionality.

    esxcfg-scsidevs

    Theesxcfg-scsidevscommandhasequivalentESXCLIcommandsforsomeoftheoptions.

    Table 14. esxcfg-hwiscsi Replacement Commands

    esxcfg-hwiscsi Option ESXCLI Command Description

    -l iscsi physicalnetworkportal param get Listcurrentconfiguration

    -a [allow | deny]

    1.Findtheadapter.

    iscsi adapter list

    2.GetARPredirectioninformation.

    iscsi physicalnetworkportal param get -A vmhba4

    3.EnableARPredirect.

    iscsi physicalnetworkportal param set --option

    ArpRedirect=true -A vmhba4

    AllowordenyARPredirectionontheadapter.

    -j [enable | disable]

    1.Findtheadapter.

    iscsi adapter list

    2.Getjumboframeinformation.

    iscsi physicalnetworkportal param get -A vmhba4

    3.Enablejumboframesupport.

    iscsi physicalnetworkportal param set --option

    ArpRedirect=true --adapter=vmhba4

    Enableordisablejumboframesupport.

    Table 15. esxcfg-rout Replacement Commands

    esxcfg-route Option ESXCLI Command Description

    add network ip route ipv4 add

    network ip route ipv6 add

    AddsanIPv4orIPv6route.Youspecifythegatewayandthenetwork.

    del network ip route ipv4

    remove

    network ip route ipv6

    remove

    RemoveanIPv4orIPv6route.Youspecifythegatewayandthenetwork.

    list network ip route ipv4 list

    network ip route ipv6 list

    ListsconfiguredIPv4orIPv6routs

    --family Includedinthecommandasanamespace.

    Table 16. esxcfg-scsidevs Replacement Commands

    esxcfg-scsidevs Option ESXCLI Command Description

    -a |--hbas storage core adapterlist Print

    the

    mappings

    for

    each

    SCSI

    host

    bus

    adapter

    (HBA)

    to

    theinformationaboutthatadapter.

    -l | --list storage core device

    list

    Listallthestoragedevicesknowntothesystem,includingbothSCSIandnon-SCSIdevices.Thelistcanbefilteredusingthe--deviceoptiontolimittheoutputtospecificdevice.

    -c

    -u

    storage core device

    list

    Listallthedeviceuniqueidentifiers.Includethemappingfromprimaryidentifiertoallsecondaryidentifiers.Thelistcanbefilteredusingthe--deviceoptiontolimittheoutputtospecificdevice.

    -m

    -f

    storage filesystem

    list

    PrintthemappingsfromaVMFSvolumetothedeviceandpartitionsusedinthatVMFS.

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    24/30

    VMware, Inc. 24

    Command-Line Management in vSphere 5 for Service Console Users

    ESXCLIdoesnothaveequivalentoptionsforthe--device,--vfat,and--hba-device-listfiltering

    options.

    The-o|--offline-cos-devand-n|--online-cos-devoptionsareserviceconsolespecificoptionsandnot

    applicabletoESXi5.x.

    esxcfg-module

    Theesxcfg-modulecommandsupportsmanipulationoftheVMkernelloadablemodulesanddevice

    drivers.Forthe

    following

    esxcfg-module

    options,

    ESXCLI

    commands

    are

    available.

    esxcfg-mpath

    Theesxcfg-mpathcommandsupportslistinginformationaboutFibreChanneloriSCSILUNsandchanging

    apathsstate.InvSphere5,equivalentESXCLIcommandsareavailable.

    Table 17. esxcfg-module Replacement Commands

    esxcfg-module Option ESXCLI Command Description

    --get-options

    -g

    system module parameters

    list

    Returnstheoptionstringconfiguredtobepassedtothemodulewhenthemoduleisloaded.

    --set-options

    -s

    system module parameters

    set

    Specifiestheoptionstringtobepassedtothemodulewhenthemoduleisloaded.

    -e --enable system module set

    --enabled=true

    Enablethegivenmodule,indicatingthatitshouldloadatboottime.

    -d --disable system module set

    --enabled=false

    Disablethe

    given

    module

    and

    prevent

    it

    from

    loadingatboot.Disablingthemodulehasnoimmediateeffectonthemodulestateonarunningsystem.

    -q --query system module list

    --enabled=[true|false]

    Querythesystemforthemodulestoloadatboot.

    -m --mod-name - Notsupported.

    -u --unload Notsupported.

    --list

    -l

    system module list

    --loaded=[true|false]

    ListthesetofcurrentlyloadedVMkernelmodules.

    -i --show-info system module get

    system module parameterslist

    Showinformationaboutthemodule.Thiscommandcanberunagainstamodulefile.

    -f --force system module

    --force

    Skipmodulevalidationforalloptions.Thegetandlistcommandsdonotsupport--force.

    -v --verbose - Not supported Displaymoreverboseinformation.

    Table 18. esxcfg-mpath Replacement Commands

    esxcfg-mpath Option ESXCLI Command Description

    -l --list |

    storage core path list

    storage core device list

    Listdetailedinformationforallpathsonthesystemorforthespecifiedpathordevice.

    -L --list-compact Notsupported

    -m --list-map storage core device list FordevicescurrentlyregisteredwiththePSA,listthefiltersattachedtothem.(Notanexactequivalent)

    -b --list-paths storage core path list Listalldeviceswiththeircorrespondingpaths,orlistpathsforthespecifieddevice.

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    25/30

    VMware, Inc. 25

    Command-Line Management in vSphere 5 for Service Console Users

    esxcfg-nas

    Theesxcfg-nascommandmanipulatesNASfilesystemsassociatedwithESXisystems.InvSphere5,

    equivalentESXCLIcommandsareavailable.

    ESXCLIalsoincludescommandstomountandunmounttheNASfilesystem.

    esxcfg-nics

    The

    esxcfg-nics

    command

    manages

    physical

    NICs

    (uplink

    adapters)

    used

    by

    an

    ESXi

    host.

    In

    vSphere

    5,

    equivalentESXCLIcommandsareavailable.

    -G --list-plugins storage core plugin list Listallmultipathingpluginsloadedintothesystem.Ataminimum,thiscommandreturnsNMP(NativeMultipathingPlugin).Ifothermultipathingpluginshavebeenloaded,theyarelistedaswell.

    -s --state storage core path setstate

    --path=--state=[active|off]

    SetthestateofagivenLUNpathtoeitheractiveor

    off.

    This

    option

    requires

    that

    the

    --path

    options

    is

    set

    andspecifieseitherthepathUIDorthepathruntimename.

    Ifyouarechangingapathsstate,thechangeoperationfailsifI/Oisactivewhenthepathsettingischanged.Reissuethecommand.YoumustsuccessfullyperformatleastoneI/Ooperationbeforethechangetakeseffect.

    Table 19. esxcfg-nas Replacement Commands

    esxcfg-nas Option ESXCLI Command Description

    --add

    -a

    storage nfs add AddanewNASfilesystemtotheESXihost.

    YoumustspecifythehostnameorIPaddressoftheNFSvolumetoadd,thesharenameontheremotesystem,andthevolumenametousefortheNFSmount.

    --delete

    -d

    storage nfs remove

    --volume-name=

    RemoveanexistingNFSvolumefromtheESXihost.

    ThiscommandunmountstheNASfilesystemandremovesitfromthelistofknownfilesystems.

    --list

    -l

    storage nfs list ListallknownNASfilesystemswiththeirmountname,sharename,andhostname.Indicatethemount

    status

    for

    each

    file

    system.

    --host

    -o

    storage nfs add --host AddorremoveaspecifiedNAShost(notESXihost).Usedwithotheroptions.

    --readonly

    -y

    storage nfs add --readonly AddthenewNFSfilesystemwithread-onlyaccess.

    --share

    -s

    storage nfs add --share= AddorremoveaspecifiedNAShost(notESXihost.Usedwithotheroptions.

    Table 20. esxcfg-nics Replacement Commands

    esxcfg-nics Option ESXCLI Command Description

    --auto

    -a

    network nic set

    --auto

    Setthespecifiednetworkadaptertoautonegotiateitsspeedandduplexsettings.

    --duplex

    [full|half]

    -d [full|half]

    network nic set

    --duplex

    Settheduplexvalueatwhichagivennetworkadaptershouldruntoeitherfull(transmitdatainbothdirectionsatthesametime)orhalf(transmitdatainonedirectionatatime).

    Table 18. esxcfg-mpath Replacement Commands (Continued)

    esxcfg-mpath Option ESXCLI Command Description

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    26/30

    esxcfg-rescan

    Theesxcfg-rescancommandrescansthestorageconfiguration.InvSphere5,equivalentESXCLIcommands

    areavailable.

    Inaddition,ESXCLIsupportsseveralotherrescancommand.Runesxcli storage core adapter rescan

    --help.

    esxcfg-vmknic

    Theesxcfg-vmkniccommandadds,deletes,andmodifiesVMkernelnetworkinterfaces.InvSphere5,

    equivalent

    ESXCLI

    commands

    are

    available.

    --list

    -l

    network nic list

    network nic get

    Listinformationaboutallthenetworkadapters.Usenetwork nicget tolistinformationaboutonespecificadapter,forexampleesxcli network nic get -n vmnic0

    --speed

    -s

    network nic set

    --speed=

    Setthespeedatwhichagivennetworkadaptershouldrun.Validvaluesforspeedare10,100,1000,or10000.

    Table 21. esxcfg-rescan Replacement Commands

    esxcfg-rescan Option ESXCLI Command Description

    -a|--add storage core adapter rescan

    --type=add

    Scanforaddeddevices.

    -d|--delete storage core adapter rescan

    --type=delete --adapter

    Scanremovingdeaddevices

    -A|--all storage core adapter rescan Scanalladapters.Bydefault,thecommandscansalladapters.Youcanspecifyindividualadaptersbyusingthe--adapteroption.

    -u|--update storage core adapter rescan

    --type=update --adapter

    Scanexistingpathsandupdatetheirstate.

    Table 22. esxcfg-vmknic Replacement Commands

    esxcfg- option ESXCLI Command Description

    --add --ip

    --netmask

    network ip interface add AddaVMkernelNICtothesystem.Whenthecommandcompletessuccessfully,thenewlyaddedVMkernelNICisenabled.

    --delete network ip interface remove RemoveaVMkernelNIC.

    --disable -D network ip interface set

    --interface-name=

    --enabled=[true|false]

    TheESXCLIcommandenablesordisablesthespecifiedVMkernelNIC.

    --dvs-name -s

    Notsupported.

    --dvport_id

    Notsupported.

    Table 20. esxcfg-nics Replacement Commands (Continued)

    esxcfg-nics Option ESXCLI Command Description

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    27/30

    VMware, Inc. 27

    Command-Line Management in vSphere 5 for Service Console Users

    esxcfg-volume

    Theesxcfg-volumecommandmanagesLVMsnapshotorreplicavolumes.InvSphere5,equivalentESXCLI

    commandsareavailableintheesxcli storage filesystemandintheesxcli storage vmfsnamespaces.

    --enable network ip interface ipv4 set

    --interface-name=

    SetandenablethespecifiedVMkernelNICifitisdisabled.

    --enable-ipv6 -6

    [true | false]

    network ip interface ipv6 set

    --enable-dhcpv6

    network ip interface ipv6 address

    [list|add|remove]

    EnableIPv6forthenextboot;managetheIPv6address.

    --ip -i

    network ip interface ipv4 set

    --interface-name=

    network ip interface ipv6 set

    --interface-name=

    TheIPaddresstobeusedfortheVMkernelNIC.

    IfyousetastaticIPv4address,youmustspecifythe--netmaskoptioninsamecommand.

    --list -l network ip interface list

    network ip interface ipv4 list

    network ip interface ipv6 list

    ListVMkernelnetworkinterfaces.

    ListIPv4addressesassignedtothesystem.

    ListIPv6addressesassignedtothesystem.

    --mtu network ip interface set

    --interface-name= --mtu=

    MTUfortheinterfacebeingcreated.Usedatthetop-levelipnamespace,notinsidetheipv4oripv6namespace.

    --netmask

    -n

    network ip interface ipv4 set

    --interface= --netmask=

    network ip interface ipv4 set

    --interface= --netmask=

    IPnetmask(X.X.X.X)tobeusedfortheVMkernelNIC.SettinganIPnetmaskrequiresthatthe--interfaceoptionbegiveninsamecommand.

    --peerdns -p network ip interface ipv4 set

    --interface=

    --peer-dns=[true|false]

    network ip interface ipv6 set

    --interface=

    --peer-dns=[true|false]

    SetpeerDNS.Ifset,thesystemusesthehostname,IPaddressanddomainreturnedbyDHCP.ValidonlyforDHCP.

    --portgroup

    Notneeded.

    --unset-ip

    -U

    Notneeded.

    Table 23. esxcfg-volume Replacement Commands

    esxcfg-volume Option ESXCLI Command Description

    --list -l storage vmfs snapshot

    list

    ListunresolvedsnapshotLUNsorreplicasofVMFSvolumes.

    --mount -m

    --persistent -M

    storage vmfs snapshot

    mount

    MountasnapshotorreplicaofaVMFSvolume.Usethe--nopersistoptiontomountthevolumenon-persistently.

    --resignature

    storage vmfs snapshot

    resignature

    Resignatureasnapshotorreplicavolume.

    --umount -u

    storage vmfs snapshot

    unmount

    DisconnectandunmountanexistingVMFSorNASvolume.Thecommanddoesnotdeletetheconfigurationforthevolume,butremovesthevolumefromthelistofmountedvolumesandhaltsallI/Oornetworktrafficforthisvolume.

    Table 22. esxcfg-vmknic Replacement Commands (Continued)

    esxcfg- option ESXCLI Command Description

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    28/30

    esxcfg-vswitch

    Theesxcfg-vswitchcommandmanagesvirtualswitches.InvSphere5,equivalentESXCLIcommandsare

    available.

    Table 24. esxcfg-vswitch Replacement Commands

    esxcfg-vswitch Option ESXCLI Command Description

    --add | -a

    network vswitch standard add Addanewvirtualswitch.

    --add-pg | -A

    network vswitch standard portgroup add

    portgroup-name=

    vswitch-name=

    Addaportgrouptothespecifiedvirtualswitch.

    --add-dvp-uplink |

    -P

    Notsupported. Addanuplinkadaptertoadistributedvirtualport(DVP).

    --add-pg-uplink |

    -M

    esxcli network vswitch standard

    portgroup policy failover set

    --active-uplinks=vmnic1,vmnic6,vminic7

    Updatethelistofactiveuplinksfortheportgroup.Thiscommandfailssilentlyiftheuplinkadapterdoesnotexist.

    --check | -c

    network vswitch standard list Checkwhetheravirtualswitchexists.Print1iftheswitchexistsandprint0otherwise.Usethevirtualswitchname,

    e.g.

    vSwitch0

    or

    vSwitch1,

    to

    specify

    the

    virtualswitch.

    --check-pg | -C

    network vswitch standard portgroup list Checkwhetherthespecifiedportgroupexistsornot.

    --delete | -d

    network vswitch standard remove

    --vswitch-name=

    Removeavirtualswitch.RunningthecommandwiththisoptionfailsifanyportsonthevirtualswitchareinusebyVMkernelnetworksorvirtualmachines.

    --del-pg | -D

    network vswitch standard portgroup

    remove --vswitch-name=

    --portgroup-name=

    Removeaportgroupfromthevirtualswitch.Runningthecommandwiththisoptionfailsiftheportgroupisinuse,forexample,byavirtualmachineora

    VMkernel

    network.--del-dvp-uplink |

    -Q

    --dvp

    ESXCLIdoesnotsupportdistributedswitches.UsethevSphereClienttoconfiguredistributedswitches.

    --del-pg-uplink |

    -N

    network vswitch standard portgroup

    policy failover set

    --active-uplinks=vmnic1,vmnic6,vminic7

    Updatethelistofactiveuplinksfortheportgroup.

    --dvp | -V ESXCLIdoesnotsupportdistributedswitches.UsethevSphereClienttoconfiguredistributedswitches.

    --get-cdp | -b

    network vswitch standard listincludes

    CDPinformation.

    PrintthecurrentCDP(CiscoDiscovery

    Protocol)setting

    for

    this

    virtual

    switch

    (validforvSphere4.0andlater).

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    29/30

    VMware, Inc. 29

    Command-Line Management in vSphere 5 for Service Console Users

    esxtop

    TheesxtopcommandisavailableandsupportedintheESXiShell.SearchthevSphereDocumentationCenter,

    orseethevSphereResourceManagementdocumentation.

    esxupdate

    TheesxupdatecommandallowsyoutomanageESX4.0andlatersystems.Usethecommandsintheesxcli

    softwarenamespacetoinstall,update,remove,ordisplayindividualVIBs(softwarepackages).Use

    commandsintheesxcli software sourcesnamespacetoquerydepotcontentsforVIBsandimageprofiles.

    AnimageprofiledefinesanESXiimageandconsistsofVIBs.

    --link | -L

    network vswitch standard uplink add

    --uplink --vswitch

    Addanuplinkadapter(physicalNIC)toavirtualswitch.Runningthecommandwiththisoptionattachesanewunusedphysicalnetworkadaptertoavirtualswitch.

    --list | -l network vswitch standard list List

    all

    virtual

    switches

    and

    their

    port

    groups.

    --mtu | -m

    network vswitch standard set

    --mtu=

    SettheMTU(maximumtransmissionunit)ofthevirtualswitch.ThisoptionaffectsallphysicalNICsassignedtothevirtualswitch.

    --pg | -p

    network vswitch standard portgroup set

    --vlan-id=

    Providethenameoftheportgroupforthe--vlanoption.SpecifyALLtosetVLANIDsonallportgroupsofavirtualswitch.

    --set-cdp | -B

    [down | listen |

    advertise | both]

    network vswitch standard set

    --cpd-status=

    SettheCDPstatusforagivenvirtualswitch(validforvSphere4.0andlater).Toset,specifydown,listen,advertise,

    or

    both.--unlink | -U

    network vswitch standard uplink remove

    --uplink= --vswitch=

    Removeanuplinkadapterfromavirtualswitch.AnuplinkadaptercorrespondstoaphysicalEthernetadaptertowhichthevirtualswitchisconnected.Ifyouremovethelastuplinkadapter,youlosephysicalnetworkconnectivityforthatswitch.

    --vlan | -v --pg

    network vswitch standard portgroup set

    --portgroup-name=

    --vlan-id=

    SettheVLANIDforaspecificportgroupofavirtualswitch.Settingtheoptionto0disablestheVLANforthisportgroup.Ifyouspecifythisoption,youmustalsospecifythe--portgroupoption.

    -X --set-maxactive network vswitch standard portgrouppolicy failover set

    --active-uplinks=vmnic1,vmnic6,vminic7

    Explicitly

    specify

    the

    maximum

    number

    ofactiveuplinks.

    Atanytime,thereisoneportgroupNICarray,andacorrespondingsetofactiveuplinks.Forexample,assumetheportgroupnicarrayis[vmnic1,vmnic0,vmnic3,vmnic5,vmnic6,vmnic7]andactive-uplinksissettothreeuplinks(vmnic1,vmnic0,vmnic3),andtherestarestandbyuplinks.Ifyousettheactiveuplinkswithnewset[vmnic3,vmnic5],thoseuplinksoverridetheoldset.TheNICarraychangesto[vmnic3,vmnic5,vmnic6,vmnic7]andmax-activebecomes2.

    Table 24. esxcfg-vswitch Replacement Commands (Continued)

    esxcfg-vswitch Option ESXCLI Command Description

  • 7/28/2019 Vsphere Esxi Vcenter Server 51 Command Line Management for Service Console Users

    30/30

    Command-Line Management in vSphere 5 for Service Console Users

    If you have comments about this documentation, submit your feedback to: [email protected]

    VMware, Inc. 3401 Hillview Ave., Palo Alto, CA 94304 www.vmware.com

    Copyright 20102012 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. VMware products arecovered 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 UnitedStates and/orother jurisdictions. All other marks and names mentioned herein may be trademarks of their respective companies.

    Item: EN-000888-00

    vicfg-snmp

    InvSphere5,youcanusethevicfg-snmpcommandtomanagetheESXiSNMPagent.InvSphere5.1,the

    esxcli system snmpnamespacehascorrespondingcommands.

    vmkfstools

    vmkfstoolsis

    supported

    in

    the

    ESXi

    Shell

    and

    as

    avCLI

    command.

    Some

    differences

    exist

    between

    the

    ESXi

    Shellvmkfstoolscommandandthevmkfstools.plvCLIcommand.

    NoequivalentESXCLIcommandexists.

    vmware-cmd

    Thevmware-cmdcommandisincludedinthevCLIpackage,butisnotavailableintheESXiShell.

    vm-support

    Thevm-supportcommandisavailableintheESXiShell.ThecommandisnotincludedinthevCLIpackage.

    IMPORTANT TheupdateprocessinthevSphere5environmenthasbeensimplifiedanddiffersfromtheprocessinvSphere4.1.Severalcommandoptionsdonothavedirectequivalents.SeetheUpgradeGuide.

    Table 25. esxupdate Replacement Commands

    esxupdate

    Command ESXCLI Command Description

    query esxcli software vib list ListallinstalledVIBpackages.

    info vSphere5doesnotsupportbulletins.Instead,youupdateyoursystemwithindividualVIBsorimageprofiles.SeetheUpgradedocumentation.

    esxcli software vib get --vibname=

    esxcli software profile get

    DisplayinformationononeormoreVIBs.

    update esxcli software vib update

    esxcli software profile update

    esxcli software vib install

    esxcli software profile install

    TheupdatecommandupdatesVIBpackagesbutdoesnotinstallnewVIBs.

    TheinstallcommandinstallsVIBpackagesfromaURLordepot.Thecommandinstalls,upgrades,ordowngradesVIBs.

    remove esxcli software vib remove RemoveselectedVIBsfromthehost.

    stage Nolongernecessary.

    scan Nolongernecessary.

    Runesxcli software sources profile toqueryforimageprofilesinadepot.

    Runesxcli software sources vibtodisplayinformationaboutVIBURLsandfiles.

    IMPORTANT ThevSphereClientnowsupportsalloptionstovm-support.IfyoucannotusethevSphereClienttoaccessyourESXisystem,youcanusethevm-supportcommand.

    mailto:[email protected]:[email protected]://www.vmware.com/go/patentshttp://www.vmware.com/go/patentshttp://www.vmware.com/go/patentsmailto:[email protected]://www.vmware.com/go/patents