opnsense / opnsense/plugins

emulators/qemu-guest-agent: qemu-ga will not launch thaw operation

Open
#4,148 4 comments 0 reactions 1 assignee View on GitHub

@fraenki is already working on this.

Since Aug 4, 2024.

bug upstream
Dominant language
PHP
Stars
1.2k
Forks
863
Avg merge
2d 6h
Merged PRs (30d)
10

Description

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug
I'm trying to make a fsfreeze-hook script for OPNSense to have quiesce when backing up on KVM hosts.
I've noticed that qemu-ga will launch the fsfreeze-hook with freeze argument, but won't run it again with thaw argument until a new snapshot is made, hence rendering the script useless.

To Reproduce
Steps to reproduce the behavior:

  1. Create the following file in /usr/local/etc/qemu/fsfreeze-hook
#!/bin/sh

case "$1" in
        "freeze")
                echo "FREEZE" >> /tmp/fsfreze
                ;;
        "thaw")
                echo "THAW" >> /tmp/fsfreze
                ;;
esac
  1. Make the file executable
  2. Stop qemu-guest-agent service
  3. Run it manually in order to add -F option which will call the above script, eg run /usr/local/bin/qemu-ga -F -d -v -l /var/log/qemu-ga.log
  4. On the KVM host, run virsh snapshot-create <domain> --disk-only --atomic --quiesce
  5. Look into file /tmp/fsfreeze, it will contain FREEZE
  6. Run the snapshot command again on KVM host
  7. libvirt will complain with error: internal error: unable to execute QEMU agent command 'guest-fsfreeze-freeze': filesystems have already frozen
  8. Look into file tmp/fsfreeze, it will contain
FREEZE
FREEZE
THAW

Expected behavior
At the end of the snapshot process, qemu-ga should call fsfreeze-hook script with thaw argument.
But it runs it only on second (failed) attempt.

Running the freeze/thaw hooks on other guests work.

Environment
OPNsense 24.7_9 (amd64)
qemu-guest-agent 9.0.1

Host:
AlmaLinux 9.4
libvirt-daemon-kvm 10.0.0-6.6
qemu-kvm 8.2.0-11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.