Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 231085

Re: Esx5.5 attach detached lun via powercli

$
0
0

So I figured it out and wanted to come back and share for anyone else that may experience the same issue.

 

Pretty simple to figure out in retrospect, but the fact that others were saying it was working for them with the 8 parameters as displayed is what kept throwing me off.

In my case it was in fact requiring 9 parameters.


This can be easily determined by entering the "set" command with no parameters...

PowerCLI C:\scripts\storage> $esxcli.storage.core.device.set()

...which gives you the following error:

 

The method 'set' is invoked with '0' parameters, but the expected parameter count is '9'.

At line:1 char:1

+ $esxcli.storage.core.device.set()

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : OperationStopped: (:) [], InvalidArgument

    + FullyQualifiedErrorId : VMware.VimAutomation.ViCore.Types.V1.ErrorHandling.InvalidArgument


It flat out tells you that the expected parameter count is '9'.

Repeating the command without the parenthesis shows you what those parameters are:

PowerCLI C:\scripts\storage> $esxcli.storage.core.device.set

TypeNameOfValue    : VMware.VimAutomation.ViCore.Util10Ps.EsxCliExtensionMethod

OverloadDefinitions : {void set(boolean defaultname, string device, boolean force, string name, boolean nopersist, long queuefullsamplesize, long

                      queuefullthreshold, long schednumreqoutstanding, string state)}

MemberType          : CodeMethod

Value              : void set(boolean defaultname, string device, boolean force, string name, boolean nopersist, long queuefullsamplesize, long

                      queuefullthreshold, long schednumreqoutstanding, string state)

Name                : set

IsInstance          : True


So long story short, the command that worked for me was:


Foreach($device in $devices){$esxcli.storage.core.device.set($null,$device,$null,$null,$null,$null,$null,$null,"off")}


Hope this helps...


Viewing all articles
Browse latest Browse all 231085

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>