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

2018-03-08 Thread Gianluca Cecchi
On Thu, Mar 8, 2018 at 9:47 AM, Yaniv Kaul  wrote:

>
>
>>
>> Now I would like to do something similar for a Windows 2008 R2 x64 VM.
>>
>
> Windows is somewhat different. In fact, it's a bit better than Linux
> (ARGH! but it's true) with its support for VSS - an API for applications to
> register to events such as backup.
> You should have the QEMU guest agent VSS provider installed (Note: need to
> see where's the latest bits - I found[1]).
>
> Then, if your application supports VSS, you are all good (I believe).
> Y.
>
> [1] https://fedorapeople.org/groups/virt/virtio-win/direct-
> downloads/archive-qemu-ga/qemu-ga-win-7.4.5-1/
>
>>
>>

Yes, I see that there are some VSS events intercepted in event viewer when
I run a snapshot.
But in my particulr case I have an Oracle database used for Business
Intelligence that for performance reasons is not in archive log mode, so it
can't interact with VSS layer.
Due to its nature I can shutdown this database during the evening and then
reopen it before the ETL processing happens during the night.
So in that time frame I would like to have a pre-snapshot operation of
shutdown db and post-snapshot operation of start db.
And then I clone the snapshot and export it in case I have to restore the
"blob" as a consistent whole

It is for this reason that I'm trying to verify if the freeze-hook is
usable also in WIndows environments (based on some threads I find it should
be...)

Thanks,
Gianluca
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


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

2018-03-08 Thread Yaniv Kaul
On Thu, Mar 8, 2018 at 12:47 AM, Gianluca Cecchi 
wrote:

> On Tue, Mar 6, 2018 at 7:54 PM, Yaniv Kaul  wrote:
>
>>
>>
>> On Mar 6, 2018 7:02 PM, "Gianluca Cecchi" 
>> 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.
>

Windows is somewhat different. In fact, it's a bit better than Linux (ARGH!
but it's true) with its support for VSS - an API for applications to
register to events such as backup.
You should have the QEMU guest agent VSS provider installed (Note: need to
see where's the latest bits - I found[1]).

Then, if your application supports VSS, you are all good (I believe).
Y.

[1]
https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-qemu-ga/qemu-ga-win-7.4.5-1/

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
>
> 
>   
>state='connected'/>
>   
>   
> 
>
> 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
>
>
>
>
>
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


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

2018-03-07 Thread Gianluca Cecchi
On Tue, Mar 6, 2018 at 7:54 PM, Yaniv Kaul  wrote:

>
>
> On Mar 6, 2018 7:02 PM, "Gianluca Cecchi" 
> 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


  
  
  
  


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
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


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

2018-03-06 Thread Yaniv Kaul
On Mar 6, 2018 7:02 PM, "Gianluca Cecchi"  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

Y.


Can I leverage this kind of functionality with the oVirt guest agent?
Or is it mandatory to consider a remote connection to the VM (via ssh or
what for windows?) and execute the script/command/bat file?

What are you curently doing in this respect?

Thanks,

Gianluca

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users