Skip to content

New ESXCLI Commands in vSphere 8.0

In vSphere 8.0 the command line interface esxcli has been extended with new features. This article introduces the new and extended namespaces.

Quick Summary
21 new ESXCLI commands including:

  • 3 Daemon
  • 1 Graphics
  • 5 NVMe
  • 6 Storage
  • 6 vSAN

esxcli daemon

With the deprecation of the Common Information Model (CIM) in ESXi 8.0 due to security issues, an alternative solution is required. The replacement for CIM Provider Development Kit (CIMPDK) and the vSphere APIs for I/O Filtering (VAIO) Development Kit is the Daemon Software Development Kit (DSDK).

esxcli daemon entitlement [add|list|remove]
Commands to control entitlements for partner users. Users can be granted read or write access.

# esxcli daemon entitlement add --help
Usage: esxcli daemon entitlement add [cmd options]

Description:
  add                   Add Partner REST entitlements to the partner user.

Cmd options:
  -p|--partner-user-name=
                        Specifies the partner's user name. (required)
  -r|--read-acccess     Grant read access to the partner.
  -w|--write-acccess    Grant write access to the partner.


# esxcli daemon entitlement add -p EMULEX -w
# esxcli daemon entitlement list -p EMULEX
Username  Entitlement
--------  -----------
EMULEX    PARTNER_REST_WRITE


# esxcli daemon entitlement remove -p EMULEX -w

 

esxcli graphics

esxcli graphics device [set]
Command to set graphics device sharing type. If the sharing type has been changed, run "/etc/init.d/xorg restart" for changes to take effect.

# esxcli graphics device set --help
Usage: esxcli graphics device set [cmd options]

Description:
  set                   Set graphics device property. If setting "type", restart Xorg e.g. "/etc/init.d/xorg restart" for change to take effect.

Cmd options:
  -d|--device-id=  The bus ID of the PCI device (e.g., 0000:0a:00.1). (required)
  -t|--type=       Device graphics type. Allowed types are
                            Shared: Shared graphics.
                            SharedPassthru: SharedPassthru graphics.
                         (required)

# esxcli graphics device list
0000:00:02.0
   Vendor Name: Intel Corporation
   Device Name: Iris Plus Graphics 650
   Module Name: vmkernel
   Graphics Type: Shared
   Memory Size in KB: 0
   Number of VMs: 0


# esxcli graphics device set -d 0000:00:02.0 -t SharedPassthru

 

esxcli nvme

esxcli nvme device config [list|set]
Command to set NVMe device plugin configuration.

# esxcli nvme device config list
Name          Default   Current   Description
------------  --------  --------  -----------
logLevel      0         0         Log level of this plugin.
adminTimeout  60000000  60000000  Timeout in microseconds of the admin commands issued by this plugin.


# esxcli nvme device config set --help
Usage: esxcli nvme device config set [cmd options]

Description:
  set                   Set the plugin's parameter

Cmd options:
  -p|--parameter=  Parameter name (required)
  -v|--value=      Parameter value (required)


# esxcli nvme device config set -p logLevel -v 1
logLevel set successfully!

 

esxcli nvme device feature [get|set]
Command to view and configure NVMe device feature settings.

# esxcli nvme device feature get --help
Usage: esxcli nvme device feature get [cmd options]

Description:
  get                   Get NVMe device feature

Cmd options:
  -A|--adapter=    Adapter to operate on (required)
  -c|--cdw11=      Command Dword 11
  -w|--cdw12=      Command Dword 12
  -x|--cdw13=      Command Dword 13
  -y|--cdw14=      Command Dword 14
  -z|--cdw15=      Command Dword 15
  -f|--fid=        Feature ID (required)
  -l|--length=     Feature data length.
  -n|--namespace=  Namespace to operate on
  -p|--path=       Data path. If set, the raw feature data will be wrote to the specified file. If not set, the feature data will be printed in hex format.
  -S|--select=     specify which value of the attributes to return, "current", "default", "saved"


# esxcli nvme device feature set --help
Usage: esxcli nvme device feature set [cmd options]

Description:
  set                   Set NVMe device feature

Cmd options:
  -A|--adapter=    Adapter to operate on (required)
  -c|--cdw11=      Command Dword 11
  -w|--cdw12=      Command Dword 12
  -x|--cdw13=      Command Dword 13
  -y|--cdw14=      Command Dword 14
  -z|--cdw15=      Command Dword 15
  -f|--fid=        Feature ID (required)
  -n|--namespace=  Namespace to operate on
  -p|--path=       Feature data file path
  -S|--save        save the attribute

 

esxcli nvme device log [get]
Command to view NVMe log pages.

# ] esxcli nvme device log get --help
Usage: esxcli nvme device log get [cmd options]

Description:
  get                   Get NVMe log page

Cmd options:
  -A|--adapter=    Adapter to operate on (required)
  -l|--length=    Log page length. (required)
  -i|--lid=        Log page ID. Both decimal number and hexadecimal number are accepted. Hexadecimal number should start with '0x' or '0X'. (required)
  -I|--lsi=       Log specific ID. The default value is 0.
  -s|--lsp=       Log specific field. The default value is 0.
  -n|--namespace= Namespace ID. The default value is 0xFFFFFFFF.
  -o|--offset=    Log page offset. The default value is 0.
  -p|--path=       Log path. If set, the raw log data will be wrote to the specified file. If not set, the log data will be printed in hex format.
  -r|--rae=       Retain asynchronous event. The default value is 0.
  -u|--uuid=      UUID index. The default value is 0.

 

esxcli storage core

esxcli storage core nvme device [list]
List the NVMe devices currently registered with the PSA.

# esxcli storage core nvme device list
t10.NVMe____INTEL_MEMPEK1W016GA_____________________PHBT714605SA016D____00000001
   Display Name: Local NVMe Disk (t10.NVMe____INTEL_MEMPEK1W016GA_____________________PHBT714605SA016D____00000001)
   Has Settable Display Name: true
   Size: 13736
   Device Type: Direct-Access
   Multipath Plugin: HPP
   Devfs Path: /vmfs/devices/disks/t10.NVMe____INTEL_MEMPEK1W016GA_____________________PHBT714605SA016D____00000001
   Vendor: NVMe
   Model: INTEL MEMPEK1W01
   Sub NQN:
   NVMe spec revision:
   Is dispersed namespace: false
   Is Pseudo: false
   Status: on
   Is RDM Capable: false
   Is Local: true
   Is Removable: false
   Is VVOL PE: false
   Is Offline: false
   Is Perennially Reserved: false
   Thin Provisioning Status: yes
   VAAI Status: unsupported
   Other UIDs: vml.0595b820b1ffabf0d682c548aaf536cd294a6cf4265a0c710428fcdc7e209a64b6
   Is Shared Clusterwide: false
   Is USB: false
   Is Boot Device: false
   Device Max Queue Depth: 127
   IOs with competing worlds: 32

 

esxcli storage core nvme path [list]
List all the NVMe paths on the system.

# esxcli storage core nvme path list
pcie.200-pcie.0:0-t10.NVMe____INTEL_MEMPEK1W016GA_____________________PHBT714605SA016D____00000001
   UID: pcie.200-pcie.0:0-t10.NVMe____INTEL_MEMPEK1W016GA_____________________PHBT714605SA016D____00000001
   Runtime Name: vmhba1:C0:T0:L0
   Device: t10.NVMe____INTEL_MEMPEK1W016GA_____________________PHBT714605SA016D____00000001
   Device Display Name: Local NVMe Disk (t10.NVMe____INTEL_MEMPEK1W016GA_____________________PHBT714605SA016D____00000001)
   Adapter: vmhba1
   Controller: Not Applicable
   ANA group ID: 0
   Channel: 0
   Target: 0
   NSID: 0
   Plugin: HPP
   State: active
   Transport: pcie
   Adapter Identifier: pcie.200
   Target Identifier: pcie.0:0
   Adapter Transport Details: Unavailable or path is unclaimed
   Target Transport Details: Unavailable or path is unclaimed
   Maximum IO Size: 131072

 

esxcli storage core scsi device [list]
List the SCSI devices currently registered with the PSA.

# esxcli storage core scsi device list
t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RANX0H547670E_____
   Display Name: Local ATA Disk (t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RANX0H547670E_____)
   Has Settable Display Name: true
   Size: 476940
   Device Type: Direct-Access
   Multipath Plugin: HPP
   Devfs Path: /vmfs/devices/disks/t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RANX0H547670E_____
   Vendor: ATA
   Model: Samsung SSD 850
   Revision: 2B6Q
   SCSI Level: 5
   Is Pseudo: false
   Status: on
   Is RDM Capable: false
   Is Local: true
   Is Removable: false
   Is SSD: true
   Is VVOL PE: false
   Is Offline: false
   Is Perennially Reserved: false
   Queue Full Sample Size: 0
   Queue Full Threshold: 0
   Thin Provisioning Status: yes
   Attached Filters:
   VAAI Status: unsupported
   Other UIDs: vml.0100000000533252414e58304835343736373045202020202053616d73756e
   Is Shared Clusterwide: false
   Is SAS: false
   Is USB: false
   Is Boot Device: false
   Device Max Queue Depth: 31
   IOs with competing worlds: 31
   Drive Type: unknown
   RAID Level: unknown
   Number of Physical Drives: unknown
   Protection Enabled: false
   PI Activated: false
   PI Type: 0
   PI Protection Mask: NO PROTECTION
   Supported Guard Types: NO GUARD SUPPORT
   DIX Enabled: false
   DIX Guard Type: NO GUARD SUPPORT
   Emulated DIX/DIF Enabled: false

 

esxcli storage core scsi device [list]
List all the SCSI paths on the system.

# esxcli storage core scsi path list
sata.vmhba0-sata.0:0-t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RANX0H547670E_____
   UID: sata.vmhba0-sata.0:0-t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RANX0H547670E_____
   Runtime Name: vmhba0:C0:T0:L0
   Device: t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RANX0H547670E_____
   Device Display Name: Local ATA Disk (t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RANX0H547670E_____)
   Adapter: vmhba0
   Controller: Not Applicable
   Channel: 0
   Target: 0
   LUN: 0
   Plugin: HPP
   State: active
   Transport: sata
   Adapter Identifier: sata.vmhba0
   Target Identifier: sata.0:0
   Adapter Transport Details: Unavailable or path is unclaimed
   Target Transport Details: Unavailable or path is unclaimed
   Maximum IO Size: 33554432

 

esxcli storage osdata

esxcli storage osdata [create]
Command to create an OSData partition on a disk.

# esxcli storage osdata create --help
Usage: esxcli storage osdata create [cmd options]

Description:
  create                Create an OSData partition on a disk.

Cmd options:
  --clearpartitions     Erase existing partitions and force the operation.
  -d|--diskname=        Target disk device on which to create the OSData partition. (required)
  -m|--mediasize=       The size of the created partition.
                            default: 128 GB
                            max: Use whole device
                            min: 32 GB
                            small: 64 GB
                          (required)

# esxcli storage osdata create -d naa.6000c29f953fbe1d62408dcc570d4789 -m min

 

esxcli storage vvol vmstats

esxcli storage vvol vmstats [get]
Get the VVol information and statistics for a specific virtual machine.

# esxcli storage vvol vmstats get --help
Usage: esxcli storage vvol vmstats get [cmd options]

Description:
  get                   Get the VVol information and statistics for a specific virtual machine.

Cmd options:
  -c|--get-config-vvol  Get config VVol stats along with data VVols.
  -v|--vm-name=    Display name of the virtual machine. (required)

esxcli vsan storagepool

Commands to manage storage pool configuration, which is part of the new vSAN 8 Express Storage Architecture. The cluster must be vSAN ESA enabled (Error if not enabled: Unable to add device: vSAN ESA is disabled on this host. Please enable vSAN ESA to add storage pool disks.)

esxcli vsan storagepool [add|list|remove]
Commands to manage vSAN ESA Storage pool disks.

# esxcli vsan storagepool add --help
Usage: esxcli vsan storagepool add [cmd options]

Description:
  add                   Add physical disk for vSAN usage.

Cmd options:
  -d|--disk=            Name of disk devices to be added to single tier storage pool. Expects an empty device with no partitions as the device will be partitioned and
                        formatted. Otherwise this operation will fail. The command expects the device name for the disk to be provided, e.g.: mpx.vmhba2:C0:T1:L0.
                        Multiple devices can be provided using format -d device1 -d device2 -d device3. (required)


# esxcli vsan storagepool list
t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RANX0H547670E_____
   Device: t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RANX0H547670E_____
   Display Name: t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RANX0H547670E_____
   vSAN UUID: 52493221-454a-7cd9-b9c1-fdba6f8ebc91
   Used by this host: true
   In CMMDS: true
   On-disk format version: 17
   Checksum: 18423275358362453099
   Checksum Ok: true
   Is Mounted: true
   Is Encrypted: false
   Disk Type: singleTier
   Creation Time: Mon Oct 31 13:24:33 2022


# esxcli vsan storagepool remove --help
Usage: esxcli vsan storagepool remove [cmd options]

Description:
  remove                Remove physical disk from storage pool usage. Exactly one of --disk or --uuid param is required.

Cmd options:
  -d|--disk=       Specify individual vSAN disk to remove from storage pool. e.g.: mpx.vmhba2:C0:T1:L0.
  -m|--evacuation-mode= Action the vSAN service must take before the disk can be removed (default noAction). Allowed values are:
                        ensureObjectAccessibility: Evacuate data from the disk to ensure object accessibility in the vSAN cluster, before removing the disk.
                        evacuateAllData: Evacuate all data from the disk before removing it.
                        noAction: Do not move vSAN data out of the disk before removing it.
  -f|--force            Forcefully remove unhealthy disk that has run into permanent metadata read/write errors.
                        Use -f|--force option only if remove disk operation failed repeatedly without force option.
                        Only 'noAction' evacuation mode is supported with -f|--force option.
  -u|--uuid=       Specify UUID of vSAN disk to remove from storage pool. e.g.: 52afa1de-4240-d5d6-17f9-8af1ec8509e5.

# esxcli vsan storagepool remove -d t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RANX0H547670E_____

 

 

esxcli vsan storagepool [mount|unmount]
Commands to mount and unmount vSAN ESA Storage pool disks.

# esxcli vsan storagepool unmount --help
Usage: esxcli vsan storagepool unmount [cmd options]

Description:
  unmount               Unmount vSAN disk from storage pool.

Cmd options:
  -d|--disk=            Name of disk to unmount from storage pool. e.g.: mpx.vmhba2:C0:T1:L0.
  -m|--evacuation-mode= Action to take upon unmounting storage pool from vSAN (default noAction). Available modes are
                            EnsureObjectAccessibility: Evacuate data from the disk to ensure object accessibility in the vSAN cluster, before unmounting the disk.
                            EvacuateAllData: Evacuate all data from the disk before unmounting it.
                            NoAction: Do not move vSAN data out of the disk before unmounting it.
  -f|--force            Forcefully unmount unhealthy disk that has run into permanent metadata read/write errors.
                        Use -f|--force option only if unmount disk operation failed repeatedly without force option.
                        Only 'noAction' evacuation mode is supported with -f|--force option.
  -u|--uuid=           The vSAN UUID of disk to unmount from storage pool. e.g.: 52afa1de-4240-d5d6-17f9-8af1ec8509e5.

# esxcli vsan storagepool list
t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RANX0H547670E_____
   Device: t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RANX0H547670E_____
   Display Name: t10.ATA_____Samsung_SSD_850_EVO_500GB_______________S2RANX0H547670E_____
   vSAN UUID: 5216de4c-dfd1-b3b0-0f40-4b05830153c8
   Used by this host: true
   In CMMDS: true
   On-disk format version: 17
   Checksum: 7745942766875594805
   Checksum Ok: true
   Is Mounted: true
   Is Encrypted: false
   Disk Type: singleTier
   Creation Time: Mon Oct 31 13:34:16 2022

 

esxcli vsan storagepool [rebuild]
Command to rebuild vSAN storage pool disks.

# esxcli vsan storagepool rebuild --help
Usage: esxcli vsan storagepool rebuild [cmd options]

Description:
  rebuild               Rebuild vSAN storage pool disks.

Cmd options:
  -d|--disk=            Name of disk to rebuild for use by vSAN storage pool. E.g.: mpx.vmhba2:C0:T1:L0.
  -m|--evacuation-mode= Action to take upon removing storage pool from vSAN (default noAction). Available modes are
                            EnsureObjectAccessibility: Evacuate data from the disk to ensure object accessibility in the vSAN cluster, before removing the disk.
                            EvacuateAllData: Evacuate all data from the disk before removing it.
                            NoAction: Do not move vSAN data out of the disk before removing it.
  -u|--uuid=            The vSAN UUID of the disk to rebuild for use by vSAN storage pool. E.g.: 5291022a-ad03-df90-dd0f-b9f980cc005e.

# esxcli vsan storagepool rebuild -u 5216de4c-dfd1-b3b0-0f40-4b05830153c8

1 thought on “New ESXCLI Commands in vSphere 8.0”

Leave a Reply

Your email address will not be published. Required fields are marked *