Cannot create a snapshot via qemu when Zenarmor is installed

Started by deajan, February 20, 2024, 06:09:01 PM

Previous topic - Next topic
So, I've got a couple of OPNSenses running with Zenarmor (23.7 to 24.1.2).
I've installed the qemu-guest-agent plugin into OPNSense.

When I try to make a snapshot with quiescing eg `virsh snapshot-create myvm.local --disky-only --atomic --quiesce`, I get the following error:

Quoteerror: internal error: unable to execute QEMU agent command 'guest-fsfreeze-freeze': failed to freeze /usr/local/zenarmor/output/active/temp: Resource deadlock avoided

As far as I understand, the qemu-agent freeze / thaw scripts would need to exclude that path, which is basically a RAM disk.

I've searched for the freeze / thaw scripts in OPNsense but couldn't find them.
Any idea where to configure this exception perhaps ?

Best regards.
The world has 6 strings, and I got a pick ;)

New files are constantly written to the RAM disk space. The problem may be caused by this. You can switch it to Engine Bypass or stop mode during the snapshot.

I understood that this is a RAM disk, which for obvious reasons cannot be quiesced.

Of course I could temporarily disable Zenarmor for backups, but automating this would be some kind of hell.

There must be a way to exclude specific disks somewhere, I just cannot find the freeze scripts to configure so.
Any help would be appreciated.
The world has 6 strings, and I got a pick ;)

Hi,

You can write a cron script like the one below

before the process starts
Service esstpect stop

When the process is finished
Service eastpect Start

Found where to add the fsfreeze hook, see https://github.com/opnsense/core/issues/7681

Nevertheless, there is a bug in qemu-guest-agent that doesn't launch thaw script properly :(
The world has 6 strings, and I got a pick ;)

It sounds like the RAM disk path is causing the issue. Try looking for qemu-agent config files in /etc/qemu/ or /usr/lib/qemu/ and add an exception for that path.