Hi,
If I have multiple snapshot datastores presented to a host (ESXI 6.0) what's the best way to resignature the snapshots? Each snapshot has a different volume name.
I manually list the snapshots using $esxcli.storage.vmfs.snapshot.list() command. But would it be better to import a list of the volume names and pass them as a variable or could I use the list() output and pass those volume names?
Thanks,
D
Can't you just do
$esxcli = Get-EsxCli -VMHost $esxName -V2
$esxcli.storage.vmfs.snapshot.list.Invoke() |
ForEach-Object -Process {
$esxcli.storage.vmfs.snapshot.resignature.Invoke(@{volumelabel=$_.volumelabel})
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD,
I'm getting the following message when I run the command;
Message: EsxCLI.CLIFault.summary;
InnerText: A target VMFS volume must be specified by either volume label or uuid but not both.EsxCLI.CLIFault.summary
At line:5 char:4
+ $esxcli.storage.vmfs.snapshot.resignature.Invoke(@{volumelabel=$_. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], MethodFault
+ FullyQualifiedErrorId : VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.MethodFault
Thanks,
D
Strange, my snippet only uses the volumelabel.
Did you add a 2nd entry in the hash table?
Can you try the same with the volumeuuid instead?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD,
I think I got it working. I just changed the last volumelabel to volumename and it worked.
$esxcli.storage.vmfs.snapshot.resignature.Invoke(@{volumelabel=$_.volumename})
Thanks for your help,
D
My bad, didn't notice my typo in there :smileycry:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference