[libvirt] ESX snapshot deletion

Hey Mattias, I'm currently working on the semantics of virDomainSnapshotDelete(), which has been renamed from the earlier virDomainSnapshotDeactivate(). In qemu/kvm, it seems like it is possible to delete a snapshot at any time, even while that snapshot is running (though I'm not yet sure exactly what happens in that case). Talking to Jirka, it seems like the virtualbox GUI doesn't allow you to do any operations at all on snapshots while a domain is running, although we don't know yet if this is a restriction in the API as well. My questions for you are about how ESX handles this situation: 1) Can you manipulate a domain's snapshots while that domain is running? 2) If so, can you delete the snapshot that is currently running? If so, what happens? -- Chris Lalancette

2010/3/29 Chris Lalancette <clalance@redhat.com>:
Hey Mattias, I'm currently working on the semantics of virDomainSnapshotDelete(), which has been renamed from the earlier virDomainSnapshotDeactivate(). In qemu/kvm, it seems like it is possible to delete a snapshot at any time, even while that snapshot is running (though I'm not yet sure exactly what happens in that case). Talking to Jirka, it seems like the virtualbox GUI doesn't allow you to do any operations at all on snapshots while a domain is running, although we don't know yet if this is a restriction in the API as well. My questions for you are about how ESX handles this situation:
1) Can you manipulate a domain's snapshots while that domain is running?
Yes, ESX allows to freely delete snapshots and switch between them while the domain is running.
2) If so, can you delete the snapshot that is currently running? If so, what happens?
Yes, ESX allows to delete any snapshot at any time, no restrictions. For example base -> A -> B -> C -> current state C is the snapshot "that is currently running". If I delete C it gets merged into its parent B base -> A -> B ------> current state and everything is fine. I tested this and some other scenarios, everything works as expected. Some words about the MERGE and DISCARD flags for virDomainSnapshotDelete: ESX has RemoveSnapshot and RevertToSnapshot functions. RemoveSnapshot merges a snapshot into its parent, so the MERGE flag is simple. In order to DISCARD a snapshot, you need to go back to it first using RevertToSnapshot and then discard it and its children (if any) using RemoveSnapshot. A minor problem here is that RevertToSnapshot may start the domain if the domain was running at the time the snapshot was created. With ESX4 VMware added a flag to the RevertToSnapshot function to suppress a possible strat of the domain. Matthias

On 03/29/2010 07:25 PM, Matthias Bolte wrote:
2010/3/29 Chris Lalancette <clalance@redhat.com>:
Hey Mattias, I'm currently working on the semantics of virDomainSnapshotDelete(), which has been renamed from the earlier virDomainSnapshotDeactivate(). In qemu/kvm, it seems like it is possible to delete a snapshot at any time, even while that snapshot is running (though I'm not yet sure exactly what happens in that case). Talking to Jirka, it seems like the virtualbox GUI doesn't allow you to do any operations at all on snapshots while a domain is running, although we don't know yet if this is a restriction in the API as well. My questions for you are about how ESX handles this situation:
1) Can you manipulate a domain's snapshots while that domain is running?
Yes, ESX allows to freely delete snapshots and switch between them while the domain is running.
OK, interesting. Virtualbox only allows you to manipulate snapshots while the VM is shutoff (except for taking them, of course). Qemu seems to allow you to do stuff at runtime, though exactly what isn't yet 100% clear.
2) If so, can you delete the snapshot that is currently running? If so, what happens?
Yes, ESX allows to delete any snapshot at any time, no restrictions.
For example
base -> A -> B -> C -> current state
C is the snapshot "that is currently running". If I delete C it gets merged into its parent B
base -> A -> B ------> current state
and everything is fine.
I tested this and some other scenarios, everything works as expected.
Some words about the MERGE and DISCARD flags for virDomainSnapshotDelete:
ESX has RemoveSnapshot and RevertToSnapshot functions. RemoveSnapshot merges a snapshot into its parent, so the MERGE flag is simple. In order to DISCARD a snapshot, you need to go back to it first using RevertToSnapshot and then discard it and its children (if any) using RemoveSnapshot.
OK, yeah. That's a little annoying in terms of implementation, but should fit into our API. The question is whether this sort of usage is in line with what users expect. Does this API still seem reasonable? Along those lines, I've gone back and surveyed the API's of ESX, VirtualBox, and qemu to get a better idea if we are missing anything from our API. I'll be sending out another updated document with some API additions, along with notes and questions about semantics that I compiled during my survey. -- Chris Lalancette
participants (2)
-
Chris Lalancette
-
Matthias Bolte