Revert to snapshot from within a VM
For a couple of ThinApp packaging machines I didn’t want that the packagers had access to the vCenter Client, but still let them revert to a previous snapshot.
So I wrote a couple of lines to accomplish just that from within the packaging machine itself.
The script below reverts the virtual machine back to the snapshot that was created earlier.
$snap=Get-Snapshot -vm (get-vm -name $vmname) -name $snapname
set-vm -vm (get-vm -name $vmname) -Snapshot $snap -confirm:$false
Prequisites for this are that PowerShell is installed on the machine as is the PowerCLI. You also need a user account that has just enough permissions in vCenter to connect, do some VM actions like reboot and revert to snapshot.
- Unable to backup iSCSI volume with Veeam Agent for Windows by Edwin Weijdema
- Using VMware and Veeam? Update VBR 9.5 to Update 3a now by Edwin Weijdema
- Customizing your CAS deployment using Cloud-Init by Erik Scholten
- Getting started with Photon OS by Anne Jan Elsinga
- How to use remote access authentication in your… by Erik Scholten