Skip to main content

CLI madness Part II Useful storage esxcli com mands

CLI madness Part II Useful storage esxcli commands


EUI identifier association with datastore name
A good number of folks have been asking about the cryptic device names appearing in VI Client, connected to vCenter Server.  For example,

How in the world do I know which datastore does that correspond to?  The eui identifier is a mile long!  If you do have a need to correspond the device and the datastore as you see in vSphere, easiest way is to right click on the given LUN, then select “Manage Paths”.  In this view, the volume/datastore name is available in multiple places, but somewhat hidden:

If you really don’t want to look at the hideous eui identifier for your datastores, you could easily rename each after discovering the datastore name:

The cool thing about renaming the display name is that it makes lives easier for CLI results as well.  For example, if you want to find out quickly in the CLI what a given datastore’s working path(canonical name) and SATP/PSP plugins, the following command would do:

# esxcli storage nmp device list | grep -A 7 view5
Device Display Name: view5 (this is what we entered as the new label)
Storage Array Type: VMW_SATP_ALUA
Storage Array Type Device Config: {implicit_support=on;explicit_support=off; explicit_allow=on;alua_followover=on;{TPG_id=0,TPG_state=AO}}
Path Selection Policy: NIMBLE_PSP_DIRECTED
Path Selection Policy Device Config: {policy=rr iops=0 bytes=0 useANO=0 BIN_MAP_CHANGED=0 NUM_OF_MEM_ARRAY=1 lastPathIndex=0 NumIOsPending=0 numBytesPending=0 path[0]=vmhba37:C0:T2:L0;maGid=1 path[1]=vmhba37:C1:T2:L0;maGid=2 }
Path Selection Policy Device Custom Config:
Working Paths: vmhba37:C0:T2:L0, vmhba37:C1:T2:L0
Otherwise, you’d have to run the #esxcli storage nmp device list, and sort through the output!  Another use case is with esxtop.  Remember the useful toggle key of ‘u’ to display the stats on a per LUN basis?

Let’s say one of the datastores is exhibiting interesting stats, and you want to drill down on which volume that is, it could be a bit of a challenge if you don’t label the device name in vCenter.  However, if you labelled it like I did above, then it is a simple highlight of the device eui identifier, and execution of the following command to find the corresponding datastore name:
# esxcli storage nmp device list | grep -A 7 eui.a35390c4baa8698f6c9ce900179b8b4c
How to find SCSI reservation conflict stats
If you have a large environment with good number of ESX hosts (say 5+) sharing access to VMFS volumes, and the storage array is not running a version of microcode or OS that supports VAAI ATS (hardware assisted offload), then it’d be a good idea to check whether SCSI-2 reservation conflict is impacting your vSphere environment (note: Nimble OS 1.4 has full support for VAAI ATS).  Below is a quick command to check whether your ESX hosts are experiencing LUN locking conflicts (as result of operations such as vMotion of VM, VM power on, taking vmware snapshot, extending VMDK disk for a given VM, etc.)
Easiest thing to do is the find the datastore of interest (now that you have labeled the device name with datastore name in vCenter), right click on the device corresponding to the datastore, select “Copy Identifier to Clipboard), then execute the following command in the ESX server(s):
#esxcli storage core device stats get | grep –A 14 eui.a35390c4baa8698f6c9ce900179b8b4c
The output will look something like this:

Or if you want to just get the reservation conflicts across the board, run this simple command instead (quick spot check to see if there’s any)








How to find paths stats
Ever wonder how many commands/blocks were read/written for a given path?  Here’s a quick command to find out:
#esxcli storage core path stats get | grep –A 10 view5 (view5 is the datastore name of interest – this command can be run with/without device name labeling)
Sample output is below with lots of great stats:


Comments

Popular posts from this blog

Quick Guide to VCF Automation for VCD Administrators

  Quick Guide to VCF Automation for VCD Administrators VMware Cloud Foundation 9 (VCF 9) has been  released  and with it comes brand new Cloud Management Platform –  VCF Automation (VCFA)  which supercedes both Aria Automation and VMware Cloud Director (VCD). This blog post is intended for those people that know VCD quite well and want to understand how is VCFA similar or different to help them quickly orient in the new direction. It should be emphasized that VCFA is a new solution and not just rebranding of an old one. However it reuses a lot of components from its predecessors. The provider part of VCFA called Tenenat Manager is based on VCD code and the UI and APIs will be familiar to VCD admins, while the tenant part inherist a lot from Aria Automation and especially for VCD end-users will look brand new. Deployment and Architecture VCFA is generaly deployed from VCF Operations Fleet Management (former Aria Suite LCM embeded in VCF Ops. Fleet Management...
  Issue with Aria Automation Custom form Multi Value Picker and Data Grid https://knowledge.broadcom.com/external/article?articleNumber=345960 Products VMware Aria Suite Issue/Introduction Symptoms: Getting  error " Expected Type String but was Object ", w hen trying to use Complex Types in MultiValue Picker on the Aria for Automation Custom Form. Environment VMware vRealize Automation 8.x Cause This issue has been identified where the problem appears when a single column Multi Value Picker or Data Grid is used. Resolution This is a known issue. There is a workaround.  Workaround: As a workaround, try adding one empty column in the Multivalue picker without filling the options. So we can add one more column without filling the value which will be hidden(there is a button in the designer page that will hide the column). This way the end user will receive the same view.  
  "Cloud zone insights not available yet, please check after some time" message on Aria Automation https://knowledge.broadcom.com/external/article?articleNumber=314894 Products VMware Aria Suite Issue/Introduction Symptoms: The certificate for Aria operations has been replaced since it was initially added to Aria Automation as an integration. When accessing the Insights pane under  Cloud Assembly  ->  Infrastructure  ->  Cloud Zone  ->  Insights  the following message is displayed:   "Cloud zone insights not available yet, please check after some time." The  /var/log/services-logs/prelude/hcmp-service-app/file-logs/hcmp-service-app.log  file contains ssl errors similar to:   2022-08-25T20:06:43.989Z ERROR hcmp-service [host='hcmp-service-app-xxxxxxx-xxxx' thread='Thread-56' user='' org='<org_id>' trace='<trace_id>' parent='<parent_id>' span='<span_id>'] c.v.a.h.a.common.AlertEnu...