[ovirt-users] Pre-snapshot scripts to run before live snapshot

Gianluca Cecchi gianluca.cecchi at gmail.com
Wed Mar 7 22:47:18 UTC 2018


On Tue, Mar 6, 2018 at 7:54 PM, Yaniv Kaul <ykaul at redhat.com> wrote:

>
>
> On Mar 6, 2018 7:02 PM, "Gianluca Cecchi" <gianluca.cecchi at gmail.com>
> wrote:
>
> Hello,
> this thread last year (started by me... ;-) was very useful in different
> aspects involved
>
> http://lists.ovirt.org/pipermail/users/2017-March/080322.html
>
> We did cover memory save or not and fsfreeze automatically done by guest
> agent if installed inside the VM.
> What about pre-snapshot scripts/operations to run inside guest, to have
> application consistency?
> Eg if I have a database inside the VM and I have scripted my backup job
> involving live-snapshot (eg with the backup.py utility of the thread)
>
>
> https://github.com/guillon/qemu-plugins/blob/master/scripts/
> qemu-guest-agent/fsfreeze-hook.d/mysql-flush.sh.sample
>
>
>
Hello Yaniv,
thanks for the information and the example file link.
So I have understood that the freeze-hook script is run with the "freeze"
option before snapshot and again but with the "thaw" option after the
snapshot.
So I can manage what to do, parsing the argument given
So far so good.
I have tested with a Fedora 27 guest and all is ok there.

Now I would like to do something similar for a Windows 2008 R2 x64 VM.
I see that the qemu-guest-agent has been installed under
C:\Programs\qemu-ga and that the "QEMU Guest Agent" service is run as
"C:\Program Files\qemu-ga\qemu-ga.exe" -d

In fact I see I have a registry key in

HKLM\SYSTEM\CurrentControlSet\services\QEMU-GA

with the same value above for ImagePath ;
"C:\Program Files\qemu-ga\qemu-ga.exe" -d

What should I do to enable a freeze-hook script on Windows now?

BTW: searching around while trying to understand more, I found that:

on hypervisor running the VM I have

# vdsClient -s 0 getVmStats vm_guid

that works and gives me information that confirms agent seems to
communicate and I get also
appsList = [.... , 'QEMU guest agent', ...]

Also, the dump of the dynamic xml for the guest contains

# virsh -r dumpxml VM_NAME

    <channel type='unix'>
      <source mode='bind'
path='/var/lib/libvirt/qemu/channels/420e5014-9b26-a4c0-9d79-ed9b123304de.org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0'
state='connected'/>
      <alias name='channel1'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>

I tried to get its settings from qemu guest agent using socat and unix
domain sockets but I don't receive answer

# socat unix-connect:/
var/lib/libvirt/qemu/channels/420e5014-9b26-a4c0-9d79-ed9b123304de.org.qemu.guest_agent.0
readline

and then in the interactive prompt

{"execute":"guest-info"}

to get and verify information about fsfreeze, something like
...., {"enabled": true, "name": "guest-fsfreeze-freeze"}, ... ....,
{"enabled": true, "name": "guest-fsfreeze-thaw"}, ...

But I didn't get any line....
Is this communication from OS disabled by design out of oVirt mgmt?

Thanks again for any info to configure freeze-hook in Windows guest.

Gianluca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20180307/22dab3b6/attachment.html>


More information about the Users mailing list