On 05/20/11 14:19, Stefan Hajnoczi wrote:
> I'm interested in what the API for snapshots would look like.

I presume you're talking external snapshots here? The API is really what
should be defined by libvirt, so you get a unified API that can work
both on QEMU level snapshots as well as enterprise storage, host file
system snapshots etc.

> Specifically how does user software do the following:
> 1. Create a snapshot

There's a QMP patch out already that is still not applied, but it is
pretty simple, similar to the hmp command.

Alternatively you can do it the evil way by pre-creating the snapshot
image file and feeding that the snapshot command. In this case QEMU
won't create the snapshot file.

> 2. Delete a snapshot

This is still to be defined.

> 3. List snapshots

Again this is tricky as it depends on the type of snapshot. For QEMU
level ones they are files, so 'ls' is your friend :)

> 4. Access data from a snapshot

You boot the snapshot file.

> 5. Restore a VM from a snapshot

We're talking snapshots not checkpointing here, so you cannot restore a
VM from a snapshot.

> 6. Get the dirty blocks list (for incremental backup)

Good question

> We've discussed image format-level approaches but I think the scope of
> the API should cover several levels at which snapshots are
> implemented:
> 1. Image format - image file snapshot (Jes, Jagane)
> 2. Host file system - ext4 and btrfs snapshots
> 3. Storage system - LVM or SAN volume snapshots
> 
> It will be hard to take advantage of more efficient host file system
> or storage system snapshots if they are not designed in now.
> 
> Is anyone familiar enough with the libvirt storage APIs to draft an
> extension that adds snapshot support?  I will take a stab at it if no
> one else want to try it.

I believe the libvirt guys are already looking at this. Adding to the CC
list.

Cheers,
Jes

Reply via email to