VMware Cloud Community
d42d01
Contributor
Contributor

Best option for resignature multiple snapshot's

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

0 Kudos
5 Replies
LucD
Leadership
Leadership

Can't you just do

$esxName = 'MyEsx'

$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

0 Kudos
d42d01
Contributor
Contributor

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

0 Kudos
LucD
Leadership
Leadership

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

0 Kudos
d42d01
Contributor
Contributor

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

0 Kudos
LucD
Leadership
Leadership

My bad, didn't notice my typo in there :smileycry:


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

0 Kudos