Quiescing filesystems with QEMU guest agent during image snapshotting¶
When QEMU Guest Agent is installed in a kvm instance, we can request the instance to freeze filesystems via libvirt during snapshotting to make the snapshot consistent.
Currently we need to quiesce filesystems (fsfreeze) manually before snapshotting an image of active instances to create consistent backups. This should be automated when QEMU Guest Agent is enabled.
When QEMU Guest Agent is enabled in an instance, Nova-compute libvirt driver will request the agent to freeze the filesystems (and applications if fsfreeze-hook is installed) before taking snapshot of the image. After taking snapshot, the driver will request the agent to thaw the filesystems.
The prerequisites of this feature are:
the hypervisor is ‘qemu’ or ‘kvm’
libvirt >= 1.2.5 (which has fsFreeze/fsThaw API) is installed in the hypervisor
‘hw_qemu_guest_agent=yes’ property in the image metadata is set to ‘yes’ and QEMU Guest Agent is installed and enabled in the instance
When quiesce is failed even though these conditions are satisfied (e.g. the agent is not responding), snapshotting may fail by exception not to get inconsistent snapshots.
Rewrite nova’s snapshotting with libvirt’s domain.reateSnapshot API with VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE flag, although it will change the current naming scheme of disk images. In addition, it cannot be leveraged to implement live snapshot of cinder volumes.
Data model impact¶
REST API impact¶
Other end user impact¶
While taking snapshots, disk writes from the instance are blocked.
Other deployer impact¶
- Primary assignee:
Implement the automatic quiesce during snapshotting when it is available. Now the code is ready to review: https://review.openstack.org/#/c/72038/
Live snapshotting with an image with qemu-guest-agent should be added to scenario tests. Note that it requires environment with libvirt >= 1.2.5.
Need to document how to use this feature in the operation guide (which currently recommends you use the fsfreze tool manually).