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
Post a Comment