kluken
Contributor
Contributor

Setting LVM.EnableResignature issue with PowerCLI in vpshere 5.1 and Powercli 5.1 U2

We use SRM and like to make sure that when done with test that the LVM.EnableResignature is set back to 0 since we do relocate hosts often. I have tried 2 different ways to do this and both fail with "A specified parameter was not correct" All the samples I see online are for esx 4.x and below, I have not seen anyone verify this in 5.x.  We are 5.1U1 and latest powercli.

Any help would be greatly appreciated.

Method 1:

$vh contains the name of the host to be reset:

if ((Get-VMHostAdvancedConfiguration -vmhost $vh -Name LVM.EnableResignature).Values -ne 0){

     Set-VMHostAdvancedConfiguration -vmhost $vh -Name LVM.EnableResignature -Value 0 -Confirm:$false

}

Method 2:

Borrows code from functions I have seen online:

if ((Get-VMHostAdvancedConfiguration -vmhost $vh -Name LVM.EnableResignature).Values -ne 0){

$esx = Get-View (Get-VMHost $vh).ID
$optmgrMoRef = $esx.configManager.advancedOption
$optmgr = Get-View $optmgrMoRef

$optarray = $optmgr.QueryOptions("LVM.Enableresignature")
$optarray[0].Value = 0
$optmgr.UpdateOptions($optarray)

}

Reply
0 Kudos