PowerCLI

 View Only

 Re-signaturing snapshotted LUNs

vmpwcliuser31's profile image
vmpwcliuser31 posted Aug 20, 2025 09:42 AM

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

a_p_'s profile image
a_p_

Maybe just a typo.
Unless I'm mistaken, resignature takes two options, either "volumelabel" or "volumeuuid".

André

a_p_'s profile image
a_p_

$esxcli.storage.vmfs.snapshot.resignature.Help()

===========================================================================================================================================================
vim.EsxCLI.storage.vmfs.snapshot.resignature
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Resignature a snapshot/replica of a VMFS volume.

Param
-----------------------------------------------------------------------------------------------------------------------------------------------------------
- volume-label       | The VMFS volume label of the snapshot to resignature.

- volume-uuid        | The VMFS volume uuid of the snapshot to resignature.