Useful VMware vSAN commands

Spread The Knowledge

In this blog, I’ll be discussing some useful VMware vSAN commands for vSAN health checks and monitoring. These esxcli vsan commands will also help you to troubleshoot any issue that occurred in the environment related to vSAN. Let’s start.

ESXCLI vSAN Commands

esxcli vsan health cluster list

The above commands will provide a list of overall health of vSAN components such as Network, Physical disk, Data, Cluster, Limits, and Performance health services. It has three types of status:

  1. Green: It means your vSAN cluster system is healthy.
  2. Yellow: Some of the components are not compliant with the health policy. This is not a serious problem but It is recommended to fix it as soon as possible.
  3. Red: It means one of the vSAN components is not healthy and in a degraded state. This needs immediate attention.

Here is the output for the ‘esxcli vsan health cluster list ‘command:

~ # esxcli vsan health cluster list
Health Test Name                                    Status
--------------------------------------------------  ----------------------------                                                                          --
Overall health                                      green
Network                                             green
  Hosts disconnected from VC                        green
  Hosts with connectivity issues                    green
  vSAN cluster partition                            green
  All hosts have a vSAN vmknic configured           green
  vSAN: Basic (unicast) connectivity check          green
  vSAN: MTU check (ping with large packet size)     green
  vMotion: Basic (unicast) connectivity check       green
  vMotion: MTU check (ping with large packet size)  green
  Network latency check                             green
Physical disk                                       green
  Operation health                                  green
  Disk capacity                                     green
  Congestion                                        green
  Component limit health                            green
  Component metadata health                         green
  Memory pools (heaps)                              green
  Memory pools (slabs)                              green
Data                                                green
  vSAN object health                                green
Cluster                                             green
  ESXi vSAN Health service installation             green
  vSAN Health Service up-to-date                    green
  Advanced vSAN configuration in sync               green
  vSAN CLOMD liveness                               green
  vSAN Disk Balance                                 green
  Resync operations throttling                      green
  Software version compatibility                    green
  Disk format version                               green
Limits                                              green
  Current cluster situation                         green
  After 1 additional host failure                   green
  Host component limit                              green
Performance service                                 green
  Stats DB object                                   green
  Stats master election                             green
  Performance data collection                       green
  All hosts contributing stats                      green
  Stats DB object conflicts                         green
~ #
esxcli vsan network list

The above command checks the VMKernel Adapter that is configured for vSAN traffic in the cluster.

esxcli vsan storage list

The ‘esxcli vsan storage list’ command lists the all storage disks that were claimed and used for vSAN.

To get the information about vSAN Cluster configuration, you need to run the following command:

esxcli vsan cluster get

There are also so many commands available for use while working on vSAN issues. I’ll be giving you an example of how you can get and execute the esxcli vsan commands by not remembering them all. If you love the command-line task, you would prefer this. In order to run the esxcli vsan command, you need to log in the any of the ESXi hosts with root credentials and follow the below steps as in SSH console:

~ # esxcli
Usage: esxcli [options] {namespace}+ {cmd} [cmd options]

Options:
  --formatter=FORMATTER
                        Override the formatter to use for a given command.
                        Available formatter: xml, csv, keyvalue
  --debug               Enable debug or internal use options
  --version             Display version information for the script
  -?, --help            Display usage information for the script

Available Namespaces:
  device                Device manager commands
  elxmgmt               esxcli commands for Emulex FC adapters management
  esxcli                Commands that operate on the esxcli system itself
                        allowing users to get additional information.
  fcoe                  VMware FCOE commands.
  graphics              VMware graphics commands.
  hardware              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.
  nvme                  VMware NVMe driver esxcli extensions
  rdma                  Operations that pertain to remote direct memory access
                        (RDMA) protocol stack on an ESX host.
  sched                 VMKernel system properties and commands for
                        configuring scheduling related functionality.
  software              Manage the ESXi software image and packages
  storage               VMware storage commands.
  system                VMKernel system properties and commands for
                        configuring properties of the kernel core system and
                        related system services.
  vm                    A small number of operations that allow a user to
                        Control Virtual Machine operations.
  vsan                  VMware vSAN commands

~ # esxcli vsan
Usage: esxcli vsan {cmd} [cmd options]

Available Namespaces:
  cluster               Commands for vSAN host cluster configuration
  cmmds                 Commands for vSAN CMMDS (Cluster monitoring,
                        membership, and directory service).
  dataprotection        Commands for vSAN data protection configuration
  datastore             Commands for vSAN datastore configuration
  debug                 Commands for vSAN debugging
  health                Commands for vSAN Health
  iscsi                 Commands for vSAN iSCSI target configuration
  network               Commands for vSAN host network configuration
  perf                  Commands for vSAN performance service configuration.
  resync                Commands for vSAN resync configuration
  storage               Commands for vSAN physical storage configuration
  faultdomain           Commands for vSAN fault domain configuration
  maintenancemode       Commands for vSAN maintenance mode operation
  policy                Commands for vSAN storage policy configuration
  trace                 Commands for vSAN trace configuration

~ # esxcli vsan cluster
Usage: esxcli vsan cluster {cmd} [cmd options]

Available Namespaces:
  preferredfaultdomain  Commands for configuring a preferred fault domain for
                        vSAN.
  unicastagent          Commands for configuring unicast agents for vSAN.

Available Commands:
  get                   Get information about the vSAN cluster that this host
                        is joined to.
  join                  Join the host to a vSAN cluster.
  leave                 Leave the vSAN cluster the host is currently joined
                        to.
  new                   Create a vSAN cluster with current host joined. A
                        random sub-cluster UUID will be generated.
  restore               Restore the persisted vSAN cluster configuration.
~ # esxcli vsan health
Usage: esxcli vsan health {cmd} [cmd options]

Available Namespaces:
  cluster               Commands for vSAN Cluster Health

~ # esxcli vsan health cluster
Usage: esxcli vsan health cluster {cmd} [cmd options]

Available Commands:
  get                   Get a specific health check status and its details
  list                  List a cluster wide health check across all types of
                        health checks
~ # esxcli vsan health cluster get
Error: Missing required parameter -t|--test

Usage: esxcli vsan health cluster get [cmd options]

Description:
  get                   Get a specific health check status and its details

Cmd options:
  -t|--test=<str>       Test full name prefix or short test id of the health
                        check. The test full names are shown in health UI and
                        can be listed with 'esxcli vsan health cluster list'
                        (Note: use the TEST NAME, not GROUP NAME). If the
                        prefix matchs more than one test, all the matched
                        tests will be displayed. The short test ids can be
                        seen with 'esxcli vsan health cluster list -w'.
                        (required)
~ # esxcli vsan health cluster list

There are tons of VMware vSAN commands available for troubleshooting vSAN related issues. If you want, can explore other available namespaces but make sure that you are not at production servers.

You’ll Also Like


Spread The Knowledge

Leave a Comment