Hello all,
I'm trying to re-signature some snapshotted LUNs in our DR environment and I'm getting close but not sure what I'm missing.
Right now, I'm running the esxcli cmds on a single ESXi host and this is the code snippet for the re-signaturing part.
Write-Host -ForegroundColor Yellow "Listing the snapshotted LUNs, please wait...."
$snapshots = $esxcli.storage.vmfs.snapshot.list.Invoke()
foreach ($snap in $snapshots) {
if ($snap.CanResignature -eq $true) {
Write-Host -ForegroundColor Yellow "Resignaturing $($snap.VolumeName) on ESXi host"
$esxcli.storage.vmfs.snapshot.resignature.Invoke(@{ volume = $snap.VolumeName })
}
else {
Write-Host "Skipping $($snap.VolumeName) — cannot resignature" -ForegroundColor DarkGray
}
}
When I run the script, I'm getting this error:
"Index (zero based) must be greater than or equal to zero and less than the size of the argument list."
I can see from the output that it sees the LUN volume name/volume label, there are no null values that I can see; what am I missing?
Edit:
Not sure why I don't see a 'reply' button anywhere, but thanks a_p_, I changed:
$esxcli.storage.vmfs.snapshot.resignature.Invoke(@{ volume = $snap.VolumeName })
to
$esxcli.storage.vmfs.snapshot.resignature.Invoke(@{ volumelabel = $snap.VolumeName })
And it worked. It still displayed an error/fault in the powershell window that I ran the script on but it did actually re-signature the LUNs and mount them (they're visible within the vCenter GUI). Not sure what the error is but for now, I'm happier. :)
Error is:
Message: EsxCLI.CLIFault.summary;
InnerText: No unresolved VMFS snapshots with volume label 'xxxx' found.EsxCLI.CLIFault.summary