Hi all,
I have the following script which sets the PerenniallyReserved value to TRUE on selected esxi hosts
The storage device id is stored as a variable called $Device and applied as follows:
$PostEsxcli.storage.core.device.setconfig.invoke($false,$Device,$true)
However I receive the following error:
Many thanks
When you use Get-EsxCli with the V2 switch, the parameters need to be contained in hash table.
See for example Setting RDM on each Host to “PerenniallyReserve... |VMware Communities
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
When you use Get-EsxCli with the V2 switch, the parameters need to be contained in hash table.
See for example Setting RDM on each Host to “PerenniallyReserve... |VMware Communities
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD,
Many thanks for your reply and I see now how the three values are applied and what they actually do
Therefore I assume the first value 'sharedclusterwide' will set the RDM to either the individual ESXi host or all ESXi hosts in the cluster based on its value?
Is there any way I can capture this first value per host and keep it current in the set-config per host
or is there a way to simply skip the value completely?
Many thanks for your help!
The shared-clusterwide parameter is a way to indicate that the specific LUN is shared.
This is for example used by HostProfiles, see Compliance failures with Storage Host Profiles
For the perennially reserved setting, this value has no impact afaik, and you can leave it out (it is marked as optional).
To find all LUNs that are set to SharedClusterwide, you could do
ForEach-Object -Process {
$esxcli = Get-EsxCli -VMHost $esx -V2
$esxcli.storage.core.device.list.Invoke() |
where{$_.IsSharedClusterWide} | Select Device
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD,
I now see how the config objects are passed using the array -V2 and have success!
Thank you so much