VMware Cloud Community
js40687
Contributor
Contributor

PowerCLi against ESXi 5.1 mount SCSI LUN

Hi All

I have a script working fine against ESXi 5.0 hosts using the following command to mount currently unmounted COW SCSI LUNs

this is a workaround for some failings in SRM......I have now introduced some ESXi 5.1 hosts and for some reason the same commend doesn't work?

I have tried multiple versions of PowerCLi, even 5.5

The existing command is as follows

$myesxcli = get-esxcli -VMHost xxxx

$myesxcli.storage.core.device.set($naa_lun, $null, $false, 'on')

the $naa_lun is correctly derived higher in the script

the error I get is

A specified parameter was not correct.

argument[2]

At xxxxxxx

+      $myesxcli.storage.core.device.set <<<< ($naa_lun, $null, $false, 'on')

it seems at first glance the syntax has simply changed between 5.0 host and 5.1 host

has anyone else come across this? got any ideas?

Thanks

Jim

0 Kudos
4 Replies
RvdNieuwendijk
Leadership
Leadership

The syntax of the esxcli command you are using changed between ESXi 5.0 and ESXi 5.1.

The ESXi 5.0 syntax is:

$myesxcli.storage.core.device.set(string device, string name, boolean nopersist, string state)

The ESXi 5.1 syntax is:

$myesxcli.storage.core.device.set(string device, string name, boolean nopersist, long queuefullsamplesize, long queuefullthreshold, string state)

The description of the new queuefullsamplesize parameter is:

"Set device's queue full sample size. IO samples to monitor for detecting non-transient queue full condition. Should be non zero to enable queue depth throttling."

The description of the new queuefullthreshold parameter is:

"Set device's queue full threshold. BUSY or QFULL threshold,upon which LUN queue depth will be throttled. Should be <= queue-full-sample-size if throttling is enabled."

If you don't want to enable throttling then you can use:

$myesxcli.storage.core.device.set($naa_lun, $null, $false, 0, 0,  'on')

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
js40687
Contributor
Contributor

Spot on, thanks

The same script also does the perennial setting for MSCS RDMs...........what is the new syntax of that as that fails also

I currently use

$myesxcli.storage.core.device.setconfig($false, $naa_lun, $True)

Thanks

Jim

0 Kudos
RvdNieuwendijk
Leadership
Leadership

The syntax of that command has not changed between ESXi 5.0 and 5.1. You can find the syntax yourself by typing the command without parameters.

PowerCLI C:\> $myesxcli.storage.core.device.setconfig

TypeNameOfValue     : VMware.VimAutomation.ViCore.Util10Ps.EsxCliExtensionMethod
OverloadDefinitions : {void setconfig(boolean detached, string device, boolean perenniallyreserved)}
MemberType          : CodeMethod
Value               : void setconfig(boolean detached, string device, boolean perenniallyreserved)
Name                : setconfig
IsInstance          : True

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
js40687
Contributor
Contributor

So it seems before I introduced 5.1 hosts I could use the line

$myesxcli.storage.core.device.setconfig($false, $naa_lun, $true)

It seems now I have to use

$myesxcli.storage.core.device.setconfig($false, "$naa_lun", $true)

If the new line works fine on 5.0 hosts job done

Cheers for the help

0 Kudos