Restoring VM's and Files from Snapshots

Badge +1
  • Adventurer
  • 3 replies
Hello Community,

I work at a software company and I'm trying to automate all of our integration tests. Ideally what I'd like to be able to do is setup VM's within Nutanix and have them snapshotted at the place where we'd like the software to be installed and integration tests run. Within our Build/Release pipeline I'd like to restore the VM's back to their last snapshot and then install our software and run the tests. I've been looking in the API but can't seem to find the calls for Restoring a VM to a particular snapshot. Am I missing something?


5 replies

Userlevel 7
Badge +30
You're wanting to do this via a REST API call, right?

Also, I'm assuming you'd be running AHV on your system?

Side note: Have you seen ? Pretty slick dev portal that we just launched with our Nutanix AOS 5.0 launch (which went GA today).

Anyhow, I'll double check with the API team on how to do this and post back.
Badge +1
Hey Jon,

Thanks for the reply. Yes I'd like to be able to do this via the REST API / powershell.

Our IS team has an AHV setup within our network and I'm trying to interact with it for automated testing purposes. Ideally I'd like to have a bunch of VM's that I can restore to their last snapshots and then provision with software and run tests overtop of them.

I've already got my provisioning scripts working, I just need to figure out how to revert a vm back to its last snapshot.
Badge +1
Hey Jon

So I found a powershell cmdlet to do it. I'm not sure where it was documented, but it seems to be doing the trick.


Thanks for your help.
Userlevel 7
Badge +30
So, I dug into this, and the snapshot restore API for AHV hasn't been rolled up even into the v2 API in AOS 5.0.

This would be in the v0.8 API in AHV, also known as the "MGMT API", which you should be able to see the REST API explorer for that in Prism.
Badge +2
I see there is no document related vm snapshot restore(vms/uuid/restore) using Rest API . Can you kindly confirm if we can do restore of vm snapshots using Rest API v2 for Nutanix CE AHV.