Thursday, 14 April 2011

Storage debugging on ESX4.0 and ESX4.1 using "esxcfg-mpath "


One of the best esxcfg command that I most often use in my ESX4.0 and ESX4.1 environment is esxcfg-mpath.Though you would find a lot of variant in VMware's furture implementations, never the less, usecases  of this command are tonnes.

For instance you want to know, what is the path status of the devices in your esx setup. You can use
esxcfg-mpath -b -d naa.600a0b8000479284000004e94c8dc18c
naa.600a0b8000479284000004e94c8dc18c : IBM Fibre Channel Disk (naa.600a0b8000479284000004e94c8dc18c)
   vmhba2:C0:T0:L100 LUN:100 state:active fc Adapter: WWNN: 20:00:00:00:c9:6f:06:f0 WWPN: 10:00:00:00:c9:6f:06:f0  Target: WWNN: 20:04:00:a0:b8:26:4e:1a WWPN: 20:34:00:a0:b8:26:4e:1a
   vmhba3:C0:T0:L100 LUN:100 state:standby fc Adapter: WWNN: 20:00:00:00:c9:6f:06:f1 WWPN: 10:00:00:00:c9:6f:06:f1  Target: WWNN: 20:04:00:a0:b8:26:4e:1a WWPN: 20:35:00:a0:b8:26:4e:1a

This would not only give you details on how many redundant paths you have for the device but also status of the paths.Depending on your array type and path health , the possible path states can be Active,Standby and Dead states.

If you ever want to know, what is the protocol through which ESX is accessing the device, then below command would be the right choice.Observe the Transport filed indicating "fc".
It indicates that the device is Fibre channel device.If it was a SAS ,IDE or SATA then you would see sas,ide or sata respectively.
esxcfg-mpath -l -d naa.600a0b80002a071c0000499249cc2130
fc.20000000c96f06f0:10000000c96f06f0-fc.200400a0b8264e1a:203400a0b8264e1a-naa.600a0b80002a071c0000499249cc2130
   Runtime Name: vmhba2:C0:T0:L31
   Device: naa.600a0b80002a071c0000499249cc2130
   Device Display Name: IBM Fibre Channel Disk (naa.600a0b80002a071c0000499249cc2130)
   Adapter: vmhba2 Channel: 0 Target: 0 LUN: 31
   Adapter Identifier: fc.20000000c96f06f0:10000000c96f06f0
   Target Identifier: fc.200400a0b8264e1a:203400a0b8264e1a
   Plugin: NMP
   State: active
   Transport: fc
   Adapter Transport Details: WWNN: 20:00:00:00:c9:6f:06:f0 WWPN: 10:00:00:00:c9:6f:06:f0
   Target Transport Details: WWNN: 20:04:00:a0:b8:26:4e:1a WWPN: 20:34:00:a0:b8:26:4e:1a


The above command would provide complete details of the  device paths.
Depending on the number of paths, the information would span across multiple lines.
If you want a consolidated details then use.

 esxcfg-mpath -L -d naa.600a0b80002a071c0000499249cc2130
vmhba2:C0:T0:L31 state:active naa.600a0b80002a071c0000499249cc2130 vmhba2 0 0 31 NMP active san fc.20000000c96f06f0:10000000c96f06f0 fc.200400a0b8264e1a:203400a0b8264e1a
vmhba3:C0:T0:L31 state:active naa.600a0b80002a071c0000499249cc2130 vmhba3 0 0 31 NMP active san fc.20000000c96f06f1:10000000c96f06f1 fc.200400a0b8264e1a:203500a0b8264e1a


You can even find the total number of paths to all you devices. Just run
 esxcfg-mpath -m | wc -l
18


No comments:

Post a Comment