You are on page 1of 9

ESXi 5.

0 Command Cheat Sheet


vSphere CLI vihostupdate.pl commands are no longer supported on ESXi 5.0
(vihostupdate

<conn_options> --nosigcheck --install --bundle <offline-bundle>.zip)

Esxupdate commands are no longer supported on ESXi 5.0

(esxupdate

--bundle=<offline-bundle>.zip update)

Qlogic Driver Installation/Removal


Note: Putty SSH session logged into ESXi 5.0 host as root:

# esxcli software vib install v /tmp/net-qlge-1.0.0.471vmw.500.0.0.406165.x86_64.vib


# esxcli software vib remove -n

net-qlge --dry-run*

Removal Result
Message: Dryrun only, host not changed. The following installers will be applied:
[BootBankInstaller]
Reboot Required: true
VIBs Installed:
VIBs Removed: VMware_bootbank_net-qlge_1.0.0.47-1vmw.500.0.0.406165
*Do not use the -dry-run if you intend to remove the driver.

Driver Version Queries:


# esxcli software vib get -n net-qlge
VMware_bootbank_net-qlge_1.0.0.47-1vmw.500.0.0.406165

# esxcli software vib get n scsi-qla2xxx


VMware_bootbank_scsi-qla2xxx_901.k1.1-14vmw.500.0.0.469512

# esxcli software vib get n scsi-qla4xxx


VMware_bootbank_scsi-qla4xxx_5.01.03.2-3vmw.500.0.0.469512

Firmware version Queries:


# esxcli network nic get -n vmnic2
Driver: qlge
Firmware Version: v1.35.11
Version: v1.00.00.47-051711

Software Queries:
# esxcli software vib list | grep qla2xxx
# esxcli software vib list | more
# esxcli -help

Hardware Queries
Note: Qlogic serial number is NOT listed in these commands

# esxcli fcoe adapter list


# esxcli fcoe nic list
# esxcli hardware memory get
# esxcli hardware pci list
# esxcli hardware cpu list
# esxcli hardware bootdevice list
# esxcli hardware clock get
# esxcli hardware platform get

(or qla4xxx)

Network Queries
# esxcli network ip connection list
# esxcli network nic list
# esxcli network nic get -n vmnic2
# esxcli network nic set n vmnic2
# esxcli network vswitch standard list
# esxcli network vswitch standard portgroup list
# esxcli network vswitch standard policy shaping get v vSwitch0
# esxcli network vswitch standard policy security get -v vSwitch0
# esxcli network vswitch standard policy failover get -v vSwitch0

Network Commands
Set MTU to 9000 for vSwitchx:

# esxcli network vswitch standard set -m 9000 -v vSwitch0


Add a Standard vSwitch:

# esxcli network vswitch standard add -v vSwitch1


Add an Uplink to a Standard vSwitch
# esxcli network vswitch standard uplink add -u vmnic2 -v vSwitch1
Remove an Uplink from a Standard vSwitch
# esxcli network vswitch standard uplink remove -u vmnic2 -v vSwitch1
Bring network NIC down/up

# esxcli network nic down -n vmnic2


# esxcli network nic up -n vmnic2
Set NIC Speed and Duplex

# esxcli network nic set -S 10000 -D full -n vmnic2


Set NIC speed and Duplex to Auto-negotiate

# esxcli network nic set -a -n vmnic0

Storage Queries
# esxcli storage core adapter list
vmhba4 qla2xxx link-n/a fc.200000c0dd1077d9:210000c0dd1077d9 (0:2:0.2) QLogic Corp ISP81xxbased 10 GbE FCoE to PCI Express CAN
vmhba5 qla2xxx link-n/a fc.200000c0dd1077db:210000c0dd1077db (0:2:0.3) QLogic Corp ISP81xxbased 10 GbE FCoE to PCI Express CNA

# esxcli storage core adapter stats get -a vmhba4


# esxcli storage core device list
# esxcli storage nmp device list
# esxcli storage filesystem list
# esxcli storage nfs list

Storage Commands
Rescan a specific adapter

# esxcli storage core adapter rescan --adapter vmhba4


Rescan All adapters

# esxcli storage core adapter rescan --all


List all Scsi paths in the system

# esxcli storage core path list


Get scsi statistics for all scsi paths

# esxcli storage core path stats get


List SCSI device statistics

# esxcli storage core device stats get

System Queries
# esxcli system version get
Product: VMware ESXi
Version: 5.0.0
Build: Releasebuild-469512

# esxcli system module list


Name

Is Loaded

Is Enabled

qla2xxx

true

true

qlge

true

true

# esxcli system hostname get


# esxcli system settings advanced list |more

System Commands
List parameter options for the Qlogic qlge driver

# esxcli system module parameters list -m qlge


Set debug level for Qlogic qlge driver

# esxcli system module parameters set m qlge p debug=1 (0=none,


16=all)
MPI firmware dump for Qlogic qlge driver
# esxcli system module parameters set m qlge p qlge_force_coredump=1
# esxcli system module parameters set -m qlge -p qlge_spool_coredump=1
Disable/Enable the Qlogic qlge driver

# esxcli system module set -m qlge -e false


# esxcli system module list
Name

Is Loaded

qlge

true

Is Enabled
false

# esxcli system module set -m qlge -e true


# esxcli system module list
Name

Is Loaded

Is Enabled

qlge

true

true

List parameter options for the qla2xxx driver

# esxcli system module parameters list -m qla2xxx


Enable extended error logging for the qla2xxx driver

# esxcli system module parameters set m qla2xxx p


ql2xextended_error_logging=1

VM Queries
List running virtual machines
# esxcli vm process list
Esxcli General Help
esxcli --help
Usage: esxcli [options] {namespace}+ {cmd} [cmd options]
--debug

Enable debug or internal use options

--version

Display version information for the script

-?, --help

Display usage information for the script

esxcli

Commands that operate on the esxcli system itself allowing users to get additional
information.

fcoe
hardware

VMware FCOE commands.


VMKernel hardware properties and commands for configuring hardware.

iscsi

VMware iSCSI commands.

network

Operations that pertain to the maintenance of networking on an ESX host. This


includes a wide variety of commands to manipulate virtual networking components
(vswitch, portgroup, etc) as well as local host IP, DNS and general host networking
settings.

software
storage
system

Manage the ESXi software image and packages


VMware storage commands.
VMKernel system properties and commands for configuring properties of the kernel
core system.
A small number of operations that allow a user to Control Virtual Machine operations.

vm

Qlogic Fibre Channel Driver qla2xxx parameters


# esxcli system module parameters list -m qla2xxx
# esxcli system module parameters set m qla2xxx p <parameter name=integer>

Parameter Name

Type

Parameter Description

heap_initial
heap_max
ql2xallocfwdump

integer
integer
integer

ql2xcmdtimeout
ql2xcmdtimermin
ql2xdevdiscgoldfw

integer
integer
integer

ql2xenablemsi

integer

ql2xenablemsi2422

integer

ql2xexecution_throttle

integer

ql2xextended_error_logging

integer

ql2xfdmienable

integer

ql2xfwloadbin

integer

ql2xiidmaenable
ql2xintrdelaytimer

integer
integer

ql2xioctltimeout

integer

ql2xloginretrycount

integer

Initial heap size allocated for the driver.


Maximum attainable heap size for the driver.
Option to enable allocation of memory for a firmware dump during
HBA initialization. Memory allocation requirements vary by ISP
type. Default is 1 - allocate memory.
Timeout value in seconds for scsi command, default is 20
Minimum command timeout value. Default is 30 seconds.
Option to enable device discovery with golden firmware Default is
0 - no discovery. 1 - discover device.
Enables MSI-X/MSI interrupt scheme Default is 1 - enable MSIX/MSI. 0 - disable MSI-X/MSI.
Enables MSI interrupt scheme on 2422sDefault is 0 - disable MSIX/MSI. 1 - enable MSI-X/MSI.
IOCB exchange count for HBA. Default is 0, set intended value to
override Firmware defaults
Option to enable extended error logging, Default is 0 - no logging.
1 - log errors
Enables FDMI registratons Default is 0 - no FDMI. 1 - perfom
FDMI.
Option to specify location from which to load ISP firmware:
2 -- load firmware via the request_firmware() (hotplug)
interface.
1 -- load firmware from flash.
0 -- use default semantics.
Enables iIDMA settings Default is 1 - perform iIDMA. 0 - no iIDMA.
ZIO: Waiting time for Firmware before it generates an interrupt to
the host to notify completion of request.
IOCTL timeout value in seconds for pass-thur commands. Default
is 66 sec seconds.
Specify an alternate value for the NVRAM login retry count.

ql2xlogintimeout

integer

Login timeout value in seconds.

ql2xmaxqdepth

integer

Maximum queue depth to report for target devices.

ql2xmaxsgs

integer

ql2xmqcpuaffinity

integer

qlport_down_retry

integer

ql2xoperationmode

integer

ql2xplogiabsentdevice

integer

ql2xqfullrampup

integer

ql2xqfulltracking

integer

ql2xusedefmaxrdreq

integer

ql2xusedrivernaming

integer

Maximum scatter/gather entries per request,Default is the Max the


OS Supports.
Enables CPU affinity settings for the driver Default is 0 for no
affinity of request and response IO. Set it to 1 to turn on the cpu
affinity.
Maximum number of command retries to a port that returns a
PORT-DOWN status.
Option to disable ZIO mode for ISP24XX: Default is 1, set 0 to
disable
Option to enable PLOGI to devices that are not present after a
Fabric scan. This is needed for several broken switches. Default is
0 - no PLOGI. 1 - perfom PLOGI.
Number of seconds to wait to begin to ramp-up the queue depth
for a device after a queue-full condition has been detected.
Default is 120 seconds.
Controls whether the driver tracks queue full status returns and
dynamically adjusts a scsi device's queue depth. Default is 1,
perform tracking. Set to 0 to disable dynamic tracking and
adjustment of queue depth.
Default is 0 - adjust PCIe Maximum Read Request Size. 1 - use
system default.
Enables Consistent Device Naming feature Default is 0, set 1 to
enable.

Qlogic iSCSI Driver qla4xxx Parameters


# esxcli system module parameters list -m qla4xxx
# esxcli system module parameters set m qla4xxx p <parameter name=integer>

Parameter Name

Type

cmd_timeout
extended_error_logging

Integer
Integer

gratuitous_arp
heap_initial

Integer
Integer

heap_max
ioctl_timeout
ka_timeout
ql4xdiscoverywait
ql4xdontresethba

Integer
Integer
Integer
Integer

recovery_tmo
ql4xmaxqdepth

Integer
Integer

Integer

Parameter Description
Command Timeout
Option to enable extended error logging, Default is 0 - no
logging, 1 - debug logging
Gratuitous ARP
Initial heap size allocated for the driver.
Maximum attainable heap size for the driver
IOCTL Timeout
Keep Alive Timeout
Discovery wait time
Dont reset the HBA when the driver gets 0x8002 AEN
default it will reset hba :0 set to 1 to avoid resetting HBA
Recovery Timeout
Maximum queue depth to report for target devices

Qlogic 81xx Network Driver qlge Parameters


# esxcli system module parameters list -m qlge
# esxcli system module parameters set m qlge p <parameter name=integer>

Parameter Name

Type

debug
max_msix_vectors

Integer
Integer

qlge_force_coredump

Integer

heap_initial

Integer

heap_max
qlge_irq_type
qlge_mpi_coredump

Integer
Integer
Integer

qlge_spool_coredump

Integer

rx_desc_count

Array of
Integers
Array of
Integers
Integer
Integer

rx_ring_count
skb_mpool_initial
skb_mpool_max
tx_desc_count

array of
Integers

Parameter Description
Debug level (0-16: 0=none,16=all)
Option to limit number of MSX-X vectors used by
this function, Default is system assigned.
Option to force MPI coredump when msglevel is updated.
Default is 0
Initial heap size allocated for the driver.
Maximum attainable heap size for the driver
0 = MSI-X, 1 = MSI, 2 = Legacy.
Option to enable allocation of memory for an MPI
firmware dump. Default is 1 - allocate memory.
Option to enable spooling of firmware dump. to log.
Default is 0 - do not spool.
Number of RX descriptors, default is 512
Number of receive queues, default is 2
Driver's minimum private socket buffer memory pool size.
Maximum attainable private socket buffer memory pool
size for the driver.
Number of TX descriptors, default is 1024

You might also like