VMware Cloud Community
jingleharish
Contributor
Contributor

SMVI Snapshot removal.

We are using SMVI as a backup solution for our VS-FARM. Currently we are facing issues with our VC server, which is causing the VC to go down during backup. Which as resulted in lot number of pending SMVI snapshots for each VM. We are currently using the attched scipt for removal of these SMVI snapshots. This scipt is having a limitaion of removal of snapshot for each VM at a time. Which is time consuming. We need some modifications to this script which will help us to remove snapshot for multiple VM's at a time.

Your help is much appreciated.

Tags (3)
0 Kudos
3 Replies
RvdNieuwendijk
Leadership
Leadership

You can change line 36 of the script:

Remove-Snapshot $(Get-VIObjectByVIView -MORef $snaptree[0].snapshot) -Confirm:$false

into:

Remove-Snapshot $(Get-VIObjectByVIView -MORef $snaptree[0].snapshot) -Confirm:$false -RunAsync

The -RunAsync parameter indicates that the command returns immediately without waiting for the task to complete. The removal of the snapshot will run as a task in the background and your script will continue with the next snapshot.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
jingleharish
Contributor
Contributor

Since there are over 2000VM's in our VS-FARM. Will this be ok to run?. Doesnt it end up in running too many tasks at a time for removal of snapshot. Which will again be a burden on our VC.

Thanks for your response.

0 Kudos
LucD
Leadership
Leadership

You can use method I described in .

You start up to a maximum number of tasks in async and you use a hash table to monitor till the number of async task goes below the maximum number again.

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos