VMware/vSphere/esxcli

From Omnia
(Redirected from Esxcli)
Jump to navigation Jump to search

esxcli

ESXi 5.0 Replacements

esxcfg-* commands being replaced with esxcli commands.

Reference to Replacements for Service Console Commands

Replacements for Service Console Commands lists common ESX/ESXi 4.x service console commands and corresponding ESXi 5.0 shell commands.

"Important This document does not present a complete list of ESXCLI commands. The focus is on replacing existing service console commands. See the vSphere Command-Line Interface Reference for a complete list of commands.

The links in the Command column of the table point to more detailed information for each command, with corresponding ESXCLI commands for each option where available. Click the link in the More Information column for a table with detailed information about that command."

Version

esxcli system version get
# esxcli system version get
   Product: VMware ESXi
   Version: 5.1.0
   Build: Releasebuild-2323236
   Update: 3

Network

Show vmkernel IP addresses:

esxcli network ip interface ipv4 get

Firewall

List rules:

esxcli network firewall ruleset list

Enable SSH and NTP:

esxcli network firewall ruleset set --ruleset-id sshServer --enabled true
esxcli network firewall ruleset set --ruleset-id ntpClient --enabled true

Storage

List table of storage adapters (HBA Name, adapter UID): (compare to: esxcfg-scsidevs -a)

esxcli storage core adapter list

List devices () (does not show adapter mapping): (compare to: esxcfg-scsidevs -l)

esxcli storage core device list
esxcli storage core device list --device [device|eui.*]

List device paths and adapter to device mapping (mpath, runtime name, device, adapter UID, CTL, transport - device to adapter mapping): (very loose compare to: esxcfg-scsidevs -A)

esxcli storage core path list
esxcli storage core path list --device [device|eui.*]

List table of VMFS volumes (volume, device, and partition): (compare to: esxcfg-scsidevs -m)

esxcli storage vmfs extent list

List table of partitions (device, partition, size):

esxcli storage core device partition list

List table of file systems (path, volume, size):

esxcli storage filesystem list

Show if a device is being used (in use if listed, idle means indirectly used):

esxcli storage core device world list -d [device|eui.*]

Rescan adapters:

esxcli storage core adapter rescan

Unmap: vmkfstools#UNMAP

esxcli storage vmfs unmap -l [mydatastore]

References:

System

Modules

Operations that allow manipulation of the VMkernel loadable modules and device drivers.

List all modules:

esxcli system module list
esxcli system module list --enabled  # (-e) list enabled modules
esxcli system module list --loaded  # (-l) list loaded modules

Get module details: (version, path)

esxcli system module get --module iomemory-vsl  # (-m)

Enable / disable module:

esxcli system module set --enabled true --module iomemory-vsl  # (-e/-m)
esxcli system module set --enabled false --module iomemory-vsl  # (-e/-m)

List module parameters, in huge table: (and if they are set, under value column)

esxcli system module parameters list --module iomemory-vsl  # (-m)

Set module parameters:

esxcli system module parameters set --module iomemory-vsl --parameter-string ""
esxcli system module parameters set --module iomemory-vsl --parameter-string "auto_attach=1"  # (-m,-p)

Custom Plugins

See VMware/vSphere/esxcli/Custom Plugins

keywords