Triggering a virtual machine (VM) snapshot initiates the backup process; however, it does not directly create file- or app-consistent OpenStack backups. A QEMU agent is required to ensure snapshot consistency.
Step 1: Set image metadata properties
Configure the following metadata properties on the Glance image to ensure correct behavior for file system and application-consistent snapshots:
| Enable this property in the image metadata to allow OpenStack to communicate with the QEMU agent inside the VM. If not set, the agent will not function and file system freeze/thaw operations will be disabled. |
| Enable this property to attempt to quiesce applications by pausing running processes to ensure all in-memory application data is flushed to disk. |
Step 2: Create or configure instances
You can create a new instance with these properties or modify an existing instance.
Option A: Configure image for new instances
Perform the following to create a new instance and set these properties:
In OpenStack Horizon, go to Project > Compute > Images.
Locate the target image, click the dropdown next to Launch, and select Update Metadata.
In the Update Metadata modal:
From Available Metadata (left column), click + on:
libvirt Driver Options for Images > QEMU Guest Agent (
hw_qemu_guest_agent)Instance Config Data > Require Quiescent File system (
os_require_quiesce) (optional)
In Existing Metadata (right column), configure the values:
hw_qemu_guest_agent: yesos_require_quiesce: yes (strict consistency) or no (best-effort with crash-consistent fallback)
Click Save.
Once these properties are set on an image, and any new instances created from this image have the QEMU guest agent installed, application-consistent snapshots can be taken.
Option B: Configure existing instances
If an instance was created without the necessary metadata properties, reconfigure it using the following steps:
Add the required metadata properties (
hw_qemu_guest_agentandos_require_quiesce) to the image used to create the instance. Ensure that the Qemu agent and quiescing functionalities are enabled.Rebuild the instance using the updated image.
Step 3: Verify QEMU agent on the instance
Once the instance is running, log in to the VM and verify whether the QGA is active and running.
Log into the Guest VM.
Check the status of the QGA service:
Evaluate the status:
sudo systemctl status qemu-guest-agentIf active (running): The guest agent is functioning properly.
If not installed or running: Run the following commands to install, enable, and start it:
# Install QGA (Debian/Ubuntu)
sudo apt-get install qemu-guest-agent
# Enable and start service
sudo systemctl enable qemu-guest-agent
sudo systemctl start qemu-guest-agent
After completing these steps, the QEMU agent should be running inside the VM, ensuring file system freeze/thaw operations can occur during snapshot creation.
Step 4: Verify snapshot consistency
After creating a snapshot, verify whether the QEMU agent successfully triggered the file system freeze and thaw operations inside the guest VM:
Log in to the virtual machine.
Check the
journalctllogs for QEMU Guest Agent actions:sudo journalctl -u qemu-guest-agentConfirm snapshot creation by looking for the following log entries:
info: guest-fsfreeze called
info: executing fsfreeze hook with arg 'freeze'
info: executing fsfreeze hook with arg 'thaw’
Considerations and Limitations
Snapshot Failure on Quiesce Failure: If os_require_quiesce is set to yes and the agent fails to quiesce the OS, snapshot creation will fail. This prevents potential data corruption from inconsistent snapshots.
Manual Verification Required: OpenStack does not provide a method to externally verify whether the QEMU agent is active inside the VM before taking a snapshot. You must manually verify that the agent is running.
Application Consistency Scripts: The QEMU agent handles file system freeze and thaw operations, but it does not handle application-specific quiescing (such as database flushing for MySQL/Postgres). Depending on the applications running inside the VM, additional scripts are required for complete application consistency.