VMware Cloud Community
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Unable to remove Perennially Reserved on device

Hi,

Using the below script, I am unable to Perennially Reserved on device. 

Please help.

$myhost = "10.10.10.3"
$rdm = "naa.624578bdfgdf454455690001109e"
$myesxcli = get-esxcli -VMHost $myhost
$myesxcli.storage.core.device.setconfig($false, $rdm, $false)

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

No, like this

$myhost = "10.10.10.3"
$rdm = "naa.624578bdfgdf454455690001109e"

$myesxcli = Get-EsxCli -VMHost $myhost -V2
$myesxcli.storage.core.device.setconfig.Invoke(@{device=$rdm;perenniallyreserved=$false})


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

View solution in original post

0 Kudos
6 Replies
LucD
Leadership
Leadership
Jump to solution

Works for me, are you sure?


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

0 Kudos
ganapa2000
Hot Shot
Hot Shot
Jump to solution

LucD,

The device size shows Zero. I am assuming that disk might have removed incorrectly.

When I execute the below command on the ESXi, it works but the script dont work through PowerCLI

esxcli storage core device setconfig -d naa.624578bdfgdf454455690001109e --perennially-reserved=false

Tags (1)
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Then it is probably a problem with LUNs with size 0.
Did you also try the V2 version of Get-EsxCli?


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

0 Kudos
ganapa2000
Hot Shot
Hot Shot
Jump to solution

LucD,

you mean like this ?

$myhost = "10.10.10.3"
$rdm = "naa.624578bdfgdf454455690001109e"
$myesxcli = get-esxcli -VMHost $myhost -V2
$myesxcli.storage.core.device.setconfig.invoke($false, $rdm, $false)

0 Kudos
LucD
Leadership
Leadership
Jump to solution

No, like this

$myhost = "10.10.10.3"
$rdm = "naa.624578bdfgdf454455690001109e"

$myesxcli = Get-EsxCli -VMHost $myhost -V2
$myesxcli.storage.core.device.setconfig.Invoke(@{device=$rdm;perenniallyreserved=$false})


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

0 Kudos
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Perfect 🙂 Thank you so much.

0 Kudos