VMware Cloud Community
Nicodemus555
Contributor
Contributor

Which script commands would be needed to check vSphere Host multipathing?

Trying to understand how to create a script to check multipathing in our vSphere 4 environment... can anyone point me to the right command structure to do such a task?

Thanks, - Nicodemus

0 Kudos
8 Replies
LucD
Leadership
Leadership

You use the Get-ScsiLun cmdlet for that.

The MultipathPolicy property will show you the setting

Get-VMHost | Get-ScsiLun

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Nicodemus555
Contributor
Contributor

Just to be clear.. do you mean that running the 'MultipathPolicy property' will display the policy or the actual results..?

I can imagine where the policy says it is to be dual or multi-pathed .. but one path is not present so in reality it is not multi-pathed.. ?

Hope that makes sense.. - Nicodemus

0 Kudos
LucD
Leadership
Leadership

I ment something like this

Get-VMHost | Get-ScsiLun | select @{N="Host";E={$_.VMHost.Name}},canonicalname,MultipathPolicy

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Nicodemus555
Contributor
Contributor

So far so good.. that command works pretty well... but one thing I noticed was that it does not report the key HBA's needed, i.e., LP10000 2GB Fibre HBA. -- Only came back with the vmhba3 =NVidia NForce and vmhba0 = Smart Array P400

The result showed:

vsmelab6.uhclab.lab mpx.vmhba3:C0:T0:L0

vsmelab6.uhclab.lab naa.60060e8005c003000000c0030000470e

vsmelab6.uhclab.lab naa.60060e8005c003000000c0030000470f

vsmelab6.uhclab.lab naa.60060e8005c003000000c00300004710

vsmelab6.uhclab.lab naa.60060e8005c003000000c00300004b00

vsmelab6.uhclab.lab naa.60060e8005c003000000c00300004711

vsmelab6.uhclab.lab naa.60060e8005c003000000c00300004b01

vsmelab6.uhclab.lab naa.60060e8005c003000000c00300004b02

vsmelab6.uhclab.lab naa.60060e8005c003000000c00300004712

vsmelab6.uhclab.lab mpx.vmhba0:C0:T0:L0

vsmelab6.uhclab.lab naa.60060e8006cfb4000000cfb400008100

vsmelab6.uhclab.lab naa.60060e8005c003000000c00300004300

So is there a way to specify which HBAs are collected or at least to insure they are all reported..? Like vmhba 1 and 2 ?

Thank you very much for your help... the depths and fine points on PowerCLI are yet beyond my grasp.. but learning fast.

- Nicodemus

0 Kudos
LucD
Leadership
Leadership

This will give you the HBA name as well.

foreach($esx in Get-VMHost){
	foreach($hba in (Get-VMHostHba -VMHost $esx)){
		Get-ScsiLun -LunType disk -Hba $hba -ea SilentlyContinue | `
			Select @{N="Host";E={$esx.Name}},@{N="HBA";E={$hba.Name}},canonicalname,MultipathPolicy
	}
}

Note that I only get the Scsi Luns of type 'disk'.

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Nicodemus555
Contributor
Contributor

Coming late to this party but...

When I run this script it returns the " naa. " CanonicalName results:

naa.60060e8005c003000000c00300004300 RoundRobin

naa.60060e8005c003000000c00300004301 RoundRobin

naa.60060e8005c003000000c00300004302 RoundRobin

naa.60060e8005c003000000c00300004303 Fixed

naa.60060e8005c003000000c00300004304 Fixed

But what I am after ( I think ) is to know if my multi-pathing is working or configured correctly ( after SAN team maintanence ) and would like to see results more like 'Runtime Name':

vmhba1:C0:T0:Lx

vmhba1:C0:T1:Lx

vmhba2:C0:T0:Lx

vmhba2:C0:T1:lX

How can I change this script to return the vmhba type results..?

Appreciate any help, - Nicodemus

P.S. Assuming I am correct in thinking that multipathing is verified via the difference in HBA & tunnel numbers ( 0 & 1 ) ?

0 Kudos
Nicodemus555
Contributor
Contributor

Well slap my face.. low & behold this has already been addressed by the brilliant Mr. LucD ...

http://www.lucd.info/2010/10/17/runtime-name-via-extensiondata-and-new-viproperty/

One of the demos we did in our VMworld 2010 US and Europe sessions, showed the use of the new Extensiondata property and of the new New-VIProperty cmdlet. Both features were introduced with PowerCLI 4.1. In my PowerCLI 4.1 brings the New-VIProperty cmdlet post I already showed the interesting possibilities this new cmdlet offers.

On my return from VMworld Europe there was a new thread in the PowerCLI Community that asked how one could get at the Runtime Name property as it is shown in the vSphere Client. The Get-ScsiLun and Get-ScsiLunPath cmdlets unfortunately do not return that property. So I guessed it was time to show once more the strength of the New-VIProperty cmdlet

Now I just need a little help figuring how to actually use this new found power command.. Smiley Happy

- Nicodemus

0 Kudos
LucD
Leadership
Leadership

You run the New-VIProperty cmdlet from my post before you do the Get-ScsiLun cmdlet.

Make sure to select the mew property (RuntimeName) !

You can also store the New-VIProperty cmdlet in one of your profile files.

That way you will have the new property in all your sessions.

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos