Libvirt: Support instance snapshots with no downtime

Registered by Rafi Khardalian

The current implementation of snapshots via the libvirt driver operates completely externally to libvirtd. This is accomplished by suspending (virDomainManagedSave) the instance, then manipulating the underlying backing files via qemu-img or similar tools. The limitation of this approach is that the instance being snapshotted must be shutdown (qemu/kvm process stopped), as operating live has the possibility to corrupt the backing file. There was no other option at the time of implementation, keeping in mind the goal remains to always have instance_dir/disk be the active backing root.

With Qemu 1.3 and Libvirt 1.0, functionality was introduced to allow us to execute snapshots of running instances. There are several new block management API calls, such as virDomainBlockRebase, virDomainBlockCommit, virDomainBlockPull and so on. Using these new methods and associated Qemu functionality, we can perform snapshots without changing the instance's power state (running or stopped).

We cannot expect to have the latest versions of Qemu and Libvirt available in all deployments. Thus, the current snapshot approach will also be preserved. Users who do satisfy the dependencies will be able to enable the new live snapshot functionality via a configuration option. If this option is set to True, we will additionally validate the appropriate Qemu/Libvirt are available to us and fall back to the legacy snapshot method accordingly. Live snapshots will be disabled by default.

Blueprint information

Status:
Complete
Approver:
Vish Ishaya
Priority:
Low
Drafter:
Rafi Khardalian
Direction:
Approved
Assignee:
Rafi Khardalian
Definition:
Approved
Series goal:
Accepted for grizzly
Implementation:
Implemented
Milestone target:
milestone icon 2013.1
Started by
Vish Ishaya
Completed by
Vish Ishaya

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/libvirt-live-snapshots,n,z

Addressed by: https://review.openstack.org/20545
    Libvirt: Add support for live snapshots

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.