Skip to main content

OpenStack file system and application consistent backup requirements

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:

hw_qemu_guest_agent

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.

os_require_quiesce

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:

  1. In OpenStack Horizon, go to Project > Compute > Images.

  2. Locate the target image, click the dropdown next to Launch, and select Update Metadata.

    1. In the Update Metadata modal:

      1. From Available Metadata (left column), click + on:

      2. libvirt Driver Options for Images > QEMU Guest Agent (hw_qemu_guest_agent)

      3. Instance Config Data > Require Quiescent File system (os_require_quiesce) (optional)

    2. In Existing Metadata (right column), configure the values:

      1. hw_qemu_guest_agent: yes

      2. os_require_quiesce: yes (strict consistency) or no (best-effort with crash-consistent fallback)

  3. 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:

  1. Add the required metadata properties (hw_qemu_guest_agent and os_require_quiesce) to the image used to create the instance. Ensure that the Qemu agent and quiescing functionalities are enabled.

  2. 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.

  1. Log into the Guest VM.

  2. Check the status of the QGA service:

  3. Evaluate the status:
    sudo systemctl status qemu-guest-agent

    1. If active (running): The guest agent is functioning properly.

    2. 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:

  1. Log in to the virtual machine.

  2. Check the journalctl logs for QEMU Guest Agent actions:

    sudo journalctl -u qemu-guest-agent

  3. Confirm 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.

Did this answer your question?