VMware Cloud Community
Bit101
Enthusiast
Enthusiast

Automate: mass revert GuestVM to BaseSnapshot for a certain host in VCenter

VMware 6.5

I want to revert to "BaseSnapshot" for all the GuestVM servers on a certain host with Powershell.

In other words i want to get rid of all the Changes for all the GuestVM and go back to BaseSnapshot (snapshot 1)

Anyone?

Really appreciate our answer

Reply
0 Kudos
3 Replies
jburen
Expert
Expert

Perhaps something like this:

Connect-VIServer -Server <vCenter Server>

Get-VMHost -Name <Host> | Get-VM | % {Get-Snapshot -Name 'BaseSnapshot' | Set-Snapshot}

Consider giving Kudos if you think my response helped you in any way.
Reply
0 Kudos
Bit101
Enthusiast
Enthusiast

Looks promising in theory.

Do you belive your example code is working if I´m having 30 servers that I´ll revert to BaseSnapshot?

Or should i modify the code with some "plural" syntax?

But anyway If you belive this is gonna work, I´m gonna ty this code in a lab with 3 servers. Than we´ll see if this is working

I´ll be back.

Smiley Happy

Reply
0 Kudos
jburen
Expert
Expert

You could always try to add -WhatIf to the command line.

Consider giving Kudos if you think my response helped you in any way.
Reply
0 Kudos