I am looking for a way to run a instance and have it revert back to its snapshot every 24 hours. I started toying around with the idea to use the vim-cmd features however there doesn’t seem to be a way to set a task for this.

So far here are the steps I used

Looked up the ID of the VM in question by running:

vim-cmd vmsvc/getallvms

View your VM’s snapshot tree by passing its ID to this command (this example uses the VM with ID 50):

vim-cmd vmsvc/get.snapshotinfo 80

And issues the command to revert the snapshot

vim-cmd vmsvc/snapshot.revert VM_ID 0 SNAPSHOT_ID suppressPowerOff

 

The output looks something like this in my testing

This works and now all I need is to somehow automate and schedule this.