VMware Cloud Community
imveldi
Contributor
Contributor

Set Device Off-pCLI

Hello All,

we have device that's wrongly presented for about 200 hosts, we need to disable to device to un-present  from SAN side.

How can i run : esxcli storage core device set --state=off -d <NAA ID> this command pCLI.

any recommendations greatly appreciated.

Thank you,

Veldi.

0 Kudos
2 Replies
LucD
Leadership
Leadership

Try like this.

Note1: it assumes you are running PowerCLI 6.3 R1

Note2: it assumes that by "hosts" you mean ESXi hosts

$arguments = @{

    device = 'naa.60050768018085af1800000000000024'

    state = 'off'

}

foreach($esx in Get-VMHost){

    $esxcli = Get-EsxCli -VMHost $esx -V2

    $esxcli.storage.core.device.set.Invoke($arguments)

}


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

0 Kudos
imveldi
Contributor
Contributor

This worked perfect, Thank you LucD.

0 Kudos