Re: [ovirt-users] oVirt VM backup and restore

2017-03-10 Thread Gianluca Cecchi
On Thu, Mar 9, 2017 at 11:23 AM, Juan Hernández  wrote:

>
> > Very good point Gialuca, you are right, the 'persist_memorystate'
> flag
> > is 'true' by default, and that makes the pause longer. Would you be
> so
> > kind to add it to the 'vm_backup.py' example that is part of version
> 4
> > of the SDK?
> >
> >
> > https://github.com/oVirt/ovirt-engine-sdk/blob/master/
> sdk/examples/vm_backup.py#L143-L151
> >  sdk/examples/vm_backup.py#L143-L151>
> >
> > (Note that that Gibhub is just a mirror, the change needs to be
> submited
> > using gerrit.ovirt.org ).
> >
> >
> >
> > I already verified (on a 4.1 infra) that changing vm_backup.py
> > downloaded yesterday from master this way (apart connection paramters):
> >
> > $ diff vm_backup.py vm_backup.py.orig
> >  150d149
> > < persist_memorystate=False,
> >
> > I get the backup result and snapshot is correctly without memory saved
> > (and no pause at VM side)
> >
>
> [snip]

>
> I see that you already have a gerrit.ovirt.org, so it shouldn't be
> difficult. The initial setup should be like this:
>
>   $ git config --global user.name youruser
>   $ git config --global user.email your@email
>   $ git clone ssh://youru...@gerrit.ovirt.org:29418/ovirt-engine-sdk
>   $ gitdir=$(git rev-parse --git-dir); scp -p -P 29418
> youru...@gerrit.ovirt.org:hooks/commit-msg ${gitdir}/hooks/
>
> Then, to submit the patch:
>
>   $ cd ovirt-engine-sdk
>   $ Edit the vm_backup.py file, and make your changes.
>   $ git commit -a -s
>   $ git push origin HEAD:refs/for/master
>
>
Ok. I found the time to try and apparently it worked as expected.
The master (you? jenkins CI? ;-) should see my change...
Just learnt (a little...) another thing

sys admins often try to put an eye inside devs field but the reverse seldom
happens ;-)
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] oVirt VM backup and restore

2017-03-09 Thread Juan Hernández
On 03/09/2017 02:10 PM, Nathanaël Blanchet wrote:
> 
> 
> Le 09/03/2017 à 12:10, Juan Hernández a écrit :
>> On 03/09/2017 11:57 AM, Gianluca Cecchi wrote:
>>> On Thu, Mar 9, 2017 at 11:39 AM, Nathanaël Blanchet >> > wrote:
>>>
>>>
>>>
>>>  Le 09/03/2017 à 10:25, Gianluca Cecchi a écrit :
  On Wed, Mar 8, 2017 at 6:05 PM, Gianluca Cecchi
  >
 wrote:



  NOTE: during the snapshot creation I see in web admin console
  the VM in paused state and also not responsive in both console
  and ssh session.
  After a couple of seconds it comes back and as a confirmation
  I see this in its messages:

  Mar  8 17:38:57 T-ORACLE73 chronyd[616]: System clock wrong by
  19.077230 seconds, adjustment started

  Is this expected?




  Possibly the default changed at some point in time, so that now it
  saves memory and so this implies pause of VM
>>>  Saving memory is essential in some apàplications like DB, so you
>>>  won't bypass vm pauses for such a stuff
>>>
>>>
>>> Yes, indeed, the important thing is to have an option so that you can
>>> set it True or False, depending on the VM you are saving, the
>>> application that is running isnide it and the way you want to do backup
>>> of the application.
>>> Nevertheless, RDBMS and also other applications often have some
>>> mechanism to be "frozen in a consistent state" so that you can save what
>>> you have on disk without need to save memory to have a consistent
>>> backup.
>>> Oracle for example has functionality to be put in "backup mode" where
>>> you issue "begin backup" before the snapshot and "end backup" right
>>> after snapshot completion.
>>> I see that POstgreSQL has similar functionality (not tested myself):
>>> https://www.postgresql.org/docs/9.4/static/continuous-archiving.html#BACKUP-LOWLEVEL-BASE-BACKUP
>>>
>>> and the same for other ones.
>>>
>>> Gianluca
>>>
>> Just wanted to add that freezing activity is not only important for
>> databases, but also for plain file systems. In order to do a consistent
>> backup it is important to freeze the file systems before creating a live
>> snapshot, and thaw it afterwards. oVirt does that automatically, but
>> only if the guest agent is installed and running. So, remember to have
>> the guest agent installed and running in the virtual machines that you
>> plan to backup using this mechanism.
> Very useful piece of information, so does that mean memory save feature
> not to be really useful? if so, it shouldn't be the default, so that vm
> never go into pause state unusefully.

I didn't mean that saving memory isn't useful. It is very useful, for
certain use cases. For the backup use case I think it is better to
disable it.

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


Re: [ovirt-users] oVirt VM backup and restore

2017-03-09 Thread Nathanaël Blanchet



Le 09/03/2017 à 12:10, Juan Hernández a écrit :

On 03/09/2017 11:57 AM, Gianluca Cecchi wrote:

On Thu, Mar 9, 2017 at 11:39 AM, Nathanaël Blanchet > wrote:



 Le 09/03/2017 à 10:25, Gianluca Cecchi a écrit :

 On Wed, Mar 8, 2017 at 6:05 PM, Gianluca Cecchi
 > wrote:



 NOTE: during the snapshot creation I see in web admin console
 the VM in paused state and also not responsive in both console
 and ssh session.
 After a couple of seconds it comes back and as a confirmation
 I see this in its messages:

 Mar  8 17:38:57 T-ORACLE73 chronyd[616]: System clock wrong by
 19.077230 seconds, adjustment started

 Is this expected?




 Possibly the default changed at some point in time, so that now it
 saves memory and so this implies pause of VM

 Saving memory is essential in some apàplications like DB, so you
 won't bypass vm pauses for such a stuff


Yes, indeed, the important thing is to have an option so that you can
set it True or False, depending on the VM you are saving, the
application that is running isnide it and the way you want to do backup
of the application.
Nevertheless, RDBMS and also other applications often have some
mechanism to be "frozen in a consistent state" so that you can save what
you have on disk without need to save memory to have a consistent backup.
Oracle for example has functionality to be put in "backup mode" where
you issue "begin backup" before the snapshot and "end backup" right
after snapshot completion.
I see that POstgreSQL has similar functionality (not tested myself):
https://www.postgresql.org/docs/9.4/static/continuous-archiving.html#BACKUP-LOWLEVEL-BASE-BACKUP
and the same for other ones.

Gianluca


Just wanted to add that freezing activity is not only important for
databases, but also for plain file systems. In order to do a consistent
backup it is important to freeze the file systems before creating a live
snapshot, and thaw it afterwards. oVirt does that automatically, but
only if the guest agent is installed and running. So, remember to have
the guest agent installed and running in the virtual machines that you
plan to backup using this mechanism.
Very useful piece of information, so does that mean memory save feature 
not to be really useful? if so, it shouldn't be the default, so that vm 
never go into pause state unusefully.




--
Nathanaël Blanchet

Supervision réseau
Pôle Infrastrutures Informatiques
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5   
Tél. 33 (0)4 67 54 84 55
Fax  33 (0)4 67 54 84 14
blanc...@abes.fr

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


Re: [ovirt-users] oVirt VM backup and restore

2017-03-09 Thread Gianluca Cecchi
On Thu, Mar 9, 2017 at 12:11 PM, Maton, Brett 
wrote:

> Good point
>
>
>> Just wanted to add that freezing activity is not only important for
>> databases, but also for plain file systems. In order to do a consistent
>> backup it is important to freeze the file systems before creating a live
>> snapshot, and thaw it afterwards. oVirt does that automatically, but
>> only if the guest agent is installed and running. So, remember to have
>> the guest agent installed and running in the virtual machines that you
>> plan to backup using this mechanism.
>>
>>
>> ___
>> Users mailing list
>> Users@ovirt.org
>> http://lists.ovirt.org/mailman/listinfo/users
>>
>
>
Yes, indeed.
I forgot to write it before, but I did verify that my VM with guest agent
installed had this inside its /var/log/messages file:

Mar  9 10:49:36 T-ORACLE73 qemu-ga: info: guest-fsfreeze called
Mar  9 10:49:36 T-ORACLE73 qemu-ga: info: executing fsfreeze hook with arg
'freeze'
Mar  9 10:49:37 T-ORACLE73 qemu-ga: info: executing fsfreeze hook with arg
'thaw'

Also, with vm_backup.py utility, I verified that inside the VM where the
snapshotted disk was attached (c7testovn1), I got this:

Mar  9 10:49:42 c7testovn1 kernel: pci :00:09.0: BAR 4: assigned [mem
0x4000-0x40003fff 64bit pref]
Mar  9 10:49:42 c7testovn1 kernel: pci :00:09.0: BAR 1: assigned [mem
0x40004000-0x40004fff]
Mar  9 10:49:42 c7testovn1 kernel: pci :00:09.0: BAR 0: assigned [io
 0x1000-0x103f]
Mar  9 10:49:42 c7testovn1 kernel: virtio-pci :00:09.0: enabling device
( -> 0003)
Mar  9 10:49:42 c7testovn1 kernel: vdb: vdb1 vdb2
Mar  9 10:49:42 c7testovn1 systemd: Starting LVM2 PV scan on device
252:18...
Mar  9 10:49:42 c7testovn1 lvm: 2 logical volume(s) in volume group
"mainvg" now active
Mar  9 10:49:42 c7testovn1 systemd: Started LVM2 PV scan on device 252:18.
Mar  9 10:49:44 c7testovn1 systemd: Stopping LVM2 PV scan on device
252:18...
Mar  9 10:49:44 c7testovn1 lvm: Device 252:18 not found. Cleared from
lvmetad cache.
Mar  9 10:49:44 c7testovn1 systemd: Stopped LVM2 PV scan on device 252:18.

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


Re: [ovirt-users] oVirt VM backup and restore

2017-03-09 Thread Maton, Brett
Good point

On 9 March 2017 at 11:10, Juan Hernández  wrote:

> On 03/09/2017 11:57 AM, Gianluca Cecchi wrote:
> > On Thu, Mar 9, 2017 at 11:39 AM, Nathanaël Blanchet  > > wrote:
> >
> >
> >
> > Le 09/03/2017 à 10:25, Gianluca Cecchi a écrit :
> >> On Wed, Mar 8, 2017 at 6:05 PM, Gianluca Cecchi
> >> >
> wrote:
> >>
> >>
> >>
> >> NOTE: during the snapshot creation I see in web admin console
> >> the VM in paused state and also not responsive in both console
> >> and ssh session.
> >> After a couple of seconds it comes back and as a confirmation
> >> I see this in its messages:
> >>
> >> Mar  8 17:38:57 T-ORACLE73 chronyd[616]: System clock wrong by
> >> 19.077230 seconds, adjustment started
> >>
> >> Is this expected?
> >>
> >>
> >>
> >>
> >> Possibly the default changed at some point in time, so that now it
> >> saves memory and so this implies pause of VM
> > Saving memory is essential in some apàplications like DB, so you
> > won't bypass vm pauses for such a stuff
> >
> >
> > Yes, indeed, the important thing is to have an option so that you can
> > set it True or False, depending on the VM you are saving, the
> > application that is running isnide it and the way you want to do backup
> > of the application.
> > Nevertheless, RDBMS and also other applications often have some
> > mechanism to be "frozen in a consistent state" so that you can save what
> > you have on disk without need to save memory to have a consistent backup.
> > Oracle for example has functionality to be put in "backup mode" where
> > you issue "begin backup" before the snapshot and "end backup" right
> > after snapshot completion.
> > I see that POstgreSQL has similar functionality (not tested myself):
> > https://www.postgresql.org/docs/9.4/static/continuous-
> archiving.html#BACKUP-LOWLEVEL-BASE-BACKUP
> > and the same for other ones.
> >
> > Gianluca
> >
>
> Just wanted to add that freezing activity is not only important for
> databases, but also for plain file systems. In order to do a consistent
> backup it is important to freeze the file systems before creating a live
> snapshot, and thaw it afterwards. oVirt does that automatically, but
> only if the guest agent is installed and running. So, remember to have
> the guest agent installed and running in the virtual machines that you
> plan to backup using this mechanism.
>
>
> ___
> 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


Re: [ovirt-users] oVirt VM backup and restore

2017-03-09 Thread Juan Hernández
On 03/09/2017 11:57 AM, Gianluca Cecchi wrote:
> On Thu, Mar 9, 2017 at 11:39 AM, Nathanaël Blanchet  > wrote:
> 
> 
> 
> Le 09/03/2017 à 10:25, Gianluca Cecchi a écrit :
>> On Wed, Mar 8, 2017 at 6:05 PM, Gianluca Cecchi
>> > wrote:
>>
>>
>>
>> NOTE: during the snapshot creation I see in web admin console
>> the VM in paused state and also not responsive in both console
>> and ssh session.
>> After a couple of seconds it comes back and as a confirmation
>> I see this in its messages:
>>
>> Mar  8 17:38:57 T-ORACLE73 chronyd[616]: System clock wrong by
>> 19.077230 seconds, adjustment started
>>
>> Is this expected?
>>
>>
>>
>>
>> Possibly the default changed at some point in time, so that now it
>> saves memory and so this implies pause of VM
> Saving memory is essential in some apàplications like DB, so you
> won't bypass vm pauses for such a stuff
> 
> 
> Yes, indeed, the important thing is to have an option so that you can
> set it True or False, depending on the VM you are saving, the
> application that is running isnide it and the way you want to do backup
> of the application.
> Nevertheless, RDBMS and also other applications often have some
> mechanism to be "frozen in a consistent state" so that you can save what
> you have on disk without need to save memory to have a consistent backup.
> Oracle for example has functionality to be put in "backup mode" where
> you issue "begin backup" before the snapshot and "end backup" right
> after snapshot completion.
> I see that POstgreSQL has similar functionality (not tested myself):
> https://www.postgresql.org/docs/9.4/static/continuous-archiving.html#BACKUP-LOWLEVEL-BASE-BACKUP
> and the same for other ones.
> 
> Gianluca 
> 

Just wanted to add that freezing activity is not only important for
databases, but also for plain file systems. In order to do a consistent
backup it is important to freeze the file systems before creating a live
snapshot, and thaw it afterwards. oVirt does that automatically, but
only if the guest agent is installed and running. So, remember to have
the guest agent installed and running in the virtual machines that you
plan to backup using this mechanism.


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


Re: [ovirt-users] oVirt VM backup and restore

2017-03-09 Thread Maton, Brett
My 2cents

  I think it would be very handy to be able to choose to save the memory
state or not.

  As for anything requiring the memory state depends very much on what your
recovery procedure is.

  Gianluca, PostgreSQL pg_start / end backup works very well.  I can't
remember exactly how it works but it's something along the lines of
stopping (disk) writes to the database and storing change in WAL (redo in
oracle speak) until the backup is complete then applying any changes to the
database files on disk.
  Basically means that the database files won't change during the backup
process.

On 9 March 2017 at 10:57, Gianluca Cecchi  wrote:

> On Thu, Mar 9, 2017 at 11:39 AM, Nathanaël Blanchet 
> wrote:
>
>>
>>
>> Le 09/03/2017 à 10:25, Gianluca Cecchi a écrit :
>>
>> On Wed, Mar 8, 2017 at 6:05 PM, Gianluca Cecchi <
>> gianluca.cec...@gmail.com> wrote:
>>
>>>
>>>
>>> NOTE: during the snapshot creation I see in web admin console the VM in
>>> paused state and also not responsive in both console and ssh session.
>>> After a couple of seconds it comes back and as a confirmation I see this
>>> in its messages:
>>>
>>> Mar  8 17:38:57 T-ORACLE73 chronyd[616]: System clock wrong by 19.077230
>>> seconds, adjustment started
>>>
>>> Is this expected?
>>>
>>>
>>>
>>>
>> Possibly the default changed at some point in time, so that now it saves
>> memory and so this implies pause of VM
>>
>> Saving memory is essential in some apàplications like DB, so you won't
>> bypass vm pauses for such a stuff
>>
>>
> Yes, indeed, the important thing is to have an option so that you can set
> it True or False, depending on the VM you are saving, the application that
> is running isnide it and the way you want to do backup of the application.
> Nevertheless, RDBMS and also other applications often have some mechanism
> to be "frozen in a consistent state" so that you can save what you have on
> disk without need to save memory to have a consistent backup.
> Oracle for example has functionality to be put in "backup mode" where you
> issue "begin backup" before the snapshot and "end backup" right after
> snapshot completion.
> I see that POstgreSQL has similar functionality (not tested myself):
> https://www.postgresql.org/docs/9.4/static/continuous-
> archiving.html#BACKUP-LOWLEVEL-BASE-BACKUP
> and the same for other ones.
>
> 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


Re: [ovirt-users] oVirt VM backup and restore

2017-03-09 Thread Gianluca Cecchi
On Thu, Mar 9, 2017 at 11:39 AM, Nathanaël Blanchet 
wrote:

>
>
> Le 09/03/2017 à 10:25, Gianluca Cecchi a écrit :
>
> On Wed, Mar 8, 2017 at 6:05 PM, Gianluca Cecchi  > wrote:
>
>>
>>
>> NOTE: during the snapshot creation I see in web admin console the VM in
>> paused state and also not responsive in both console and ssh session.
>> After a couple of seconds it comes back and as a confirmation I see this
>> in its messages:
>>
>> Mar  8 17:38:57 T-ORACLE73 chronyd[616]: System clock wrong by 19.077230
>> seconds, adjustment started
>>
>> Is this expected?
>>
>>
>>
>>
> Possibly the default changed at some point in time, so that now it saves
> memory and so this implies pause of VM
>
> Saving memory is essential in some apàplications like DB, so you won't
> bypass vm pauses for such a stuff
>
>
Yes, indeed, the important thing is to have an option so that you can set
it True or False, depending on the VM you are saving, the application that
is running isnide it and the way you want to do backup of the application.
Nevertheless, RDBMS and also other applications often have some mechanism
to be "frozen in a consistent state" so that you can save what you have on
disk without need to save memory to have a consistent backup.
Oracle for example has functionality to be put in "backup mode" where you
issue "begin backup" before the snapshot and "end backup" right after
snapshot completion.
I see that POstgreSQL has similar functionality (not tested myself):
https://www.postgresql.org/docs/9.4/static/continuous-archiving.html#BACKUP-LOWLEVEL-BASE-BACKUP
and the same for other ones.

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


Re: [ovirt-users] oVirt VM backup and restore

2017-03-09 Thread Yaniv Kaul
On Thu, Mar 9, 2017 at 12:40 PM Nathanaël Blanchet  wrote:

>
>
> Le 09/03/2017 à 10:25, Gianluca Cecchi a écrit :
>
> On Wed, Mar 8, 2017 at 6:05 PM, Gianluca Cecchi  > wrote:
>
>
>
> NOTE: during the snapshot creation I see in web admin console the VM in
> paused state and also not responsive in both console and ssh session.
> After a couple of seconds it comes back and as a confirmation I see this
> in its messages:
>
> Mar  8 17:38:57 T-ORACLE73 chronyd[616]: System clock wrong by 19.077230
> seconds, adjustment started
>
> Is this expected?
>
>
>
>
> Possibly the default changed at some point in time, so that now it saves
> memory and so this implies pause of VM
>
> Saving memory is essential in some apàplications like DB, so you won't
> bypass vm pauses for such a stuff
>

In a database, you actually want to ensure all transactions are complete
for an application-complete snapshot. I don't think memory is needed.
Y.


>
> In the mean time I verified changing backup.py this way solves the problem
> (the 3.6 api deprecation still in place... ;-):
>
> $ diff backup.py backup.py.orig
> 123c123
> <
> vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(),
> vm=vm,persist_memorystate=False))
> ---
> >
> vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(),
> vm=vm))
>
> The snapshot doesn't include memory and no problem at VM OS side now
>
> Tested also getting the parameter from config file
>
> Modifications needed in this case:
>
> 1)
> $ diff backup.py backup.py.orig
> 123c123
> <
> vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(),
> vm=vm,persist_memorystate=config.get_persist_memorystate()))
> ---
> >
> vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(),
> vm=vm))
>
>
> 2)
> $ diff config.py config.py.orig
> 34d33
> < self.__persist_memorystate =
> config_parser.getboolean(section, "persist_memorystate")
> 113,116d111
> <
> <
> < def get_persist_memorystate(self):
> < return self.__persist_memorystate
>
>
> And in config file called add:
>
> # Save Memory in snapshot
> persist_memorystate=False
>
> It could be further improved if one wants to differentiate save memory for
> some VMs and not for other ones
>
> HIH other ones,
> Gianluca
>
>
> --
> Nathanaël Blanchet
>
> Supervision réseau
> Pôle Infrastrutures Informatiques
> 227 avenue Professeur-Jean-Louis-Viala
> 34193 MONTPELLIER CEDEX 5 
> Tél. 33 (0)4 67 54 84 55
> Fax  33 (0)4 67 54 84 14blanc...@abes.fr
>
> ___
> 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


Re: [ovirt-users] oVirt VM backup and restore

2017-03-09 Thread Nathanaël Blanchet



Le 09/03/2017 à 10:25, Gianluca Cecchi a écrit :
On Wed, Mar 8, 2017 at 6:05 PM, Gianluca Cecchi 
> wrote:




NOTE: during the snapshot creation I see in web admin console the
VM in paused state and also not responsive in both console and ssh
session.
After a couple of seconds it comes back and as a confirmation I
see this in its messages:

Mar  8 17:38:57 T-ORACLE73 chronyd[616]: System clock wrong by
19.077230 seconds, adjustment started

Is this expected?




Possibly the default changed at some point in time, so that now it 
saves memory and so this implies pause of VM
Saving memory is essential in some apàplications like DB, so you won't 
bypass vm pauses for such a stuff
In the mean time I verified changing backup.py this way solves the 
problem (the 3.6 api deprecation still in place... ;-):


$ diff backup.py backup.py.orig
123c123
< 
vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(), 
vm=vm,persist_memorystate=False))

---
> 
vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(), 
vm=vm))


The snapshot doesn't include memory and no problem at VM OS side now

Tested also getting the parameter from config file

Modifications needed in this case:

1)
$ diff backup.py backup.py.orig
123c123
< 
vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(), 
vm=vm,persist_memorystate=config.get_persist_memorystate()))

---
> 
vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(), 
vm=vm))



2)
$ diff config.py config.py.orig
34d33
< self.__persist_memorystate = 
config_parser.getboolean(section, "persist_memorystate")

113,116d111
<
<
< def get_persist_memorystate(self):
< return self.__persist_memorystate


And in config file called add:

# Save Memory in snapshot
persist_memorystate=False

It could be further improved if one wants to differentiate save memory 
for some VMs and not for other ones


HIH other ones,
Gianluca


--
Nathanaël Blanchet

Supervision réseau
Pôle Infrastrutures Informatiques
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5   
Tél. 33 (0)4 67 54 84 55
Fax  33 (0)4 67 54 84 14
blanc...@abes.fr

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


Re: [ovirt-users] oVirt VM backup and restore

2017-03-09 Thread Juan Hernández
On 03/09/2017 11:11 AM, Gianluca Cecchi wrote:
> On Thu, Mar 9, 2017 at 10:58 AM, Juan Hernández  > wrote:
> 
> 
> 
> Very good point Gialuca, you are right, the 'persist_memorystate' flag
> is 'true' by default, and that makes the pause longer. Would you be so
> kind to add it to the 'vm_backup.py' example that is part of version 4
> of the SDK?
> 
> 
> 
> https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/vm_backup.py#L143-L151
> 
> 
> 
> (Note that that Gibhub is just a mirror, the change needs to be submited
> using gerrit.ovirt.org ).
> 
> 
> 
> I already verified (on a 4.1 infra) that changing vm_backup.py
> downloaded yesterday from master this way (apart connection paramters):
> 
> $ diff vm_backup.py vm_backup.py.orig 
>  150d149
> < persist_memorystate=False,
> 
> I get the backup result and snapshot is correctly without memory saved
> (and no pause at VM side)
> 
> In engine events I get:
> 
> Mar 9, 2017 10:50:39 AM Snapshot
> 'Oracle7-backup-c6bf637e-cdeb-4923-a39f-55a14d7bad7b' deletion for VM
> 'Oracle7' has been completed.
> Mar 9, 2017 10:49:48 AM Backup of virtual machine 'Oracle7' using
> snapshot 'Oracle7-backup-c6bf637e-cdeb-4923-a39f-55a14d7bad7b' is completed.
> Mar 9, 2017 10:49:48 AM Snapshot
> 'Oracle7-backup-c6bf637e-cdeb-4923-a39f-55a14d7bad7b' deletion for VM
> 'Oracle7' was initiated by admin@internal-authz.
> Mar 9, 2017 10:49:47 AM  Disk Oracle7_Disk1 was successfully detached
> from VM c7testovn1 by admin@internal-authz.
> Mar 9, 2017 10:49:45 AM Disk Oracle7_Disk1 was successfully attached to
> VM c7testovn1 by admin@internal-authz.
> Mar 9, 2017 10:49:41 AM Snapshot
> 'Oracle7-backup-c6bf637e-cdeb-4923-a39f-55a14d7bad7b' creation for VM
> 'Oracle7' has been completed.
> Mar 9, 2017 10:49:29 AM Snapshot
> 'Oracle7-backup-c6bf637e-cdeb-4923-a39f-55a14d7bad7b' creation for VM
> 'Oracle7' was initiated by admin@internal-authz.
> Mar 9, 2017 10:49:28 AM Backup of virtual machine 'Oracle7' using
> snapshot 'Oracle7-backup-c6bf637e-cdeb-4923-a39f-55a14d7bad7b' is starting.
> 
> 
> I have almost no experience in gerrit/github, unfortunately... only a
> beginner experience in svn ... ;-)
> If you give me some pointers I can try to apply what you asked...
> 
> Gianluca

I see that you already have a gerrit.ovirt.org, so it shouldn't be
difficult. The initial setup should be like this:

  $ git config --global user.name youruser
  $ git config --global user.email your@email
  $ git clone ssh://youru...@gerrit.ovirt.org:29418/ovirt-engine-sdk
  $ gitdir=$(git rev-parse --git-dir); scp -p -P 29418
youru...@gerrit.ovirt.org:hooks/commit-msg ${gitdir}/hooks/

Then, to submit the patch:

  $ cd ovirt-engine-sdk
  $ Edit the vm_backup.py file, and make your changes.
  $ git commit -a -s
  $ git push origin HEAD:refs/for/master

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


Re: [ovirt-users] oVirt VM backup and restore

2017-03-09 Thread Gianluca Cecchi
On Thu, Mar 9, 2017 at 10:58 AM, Juan Hernández  wrote:

>
>
> Very good point Gialuca, you are right, the 'persist_memorystate' flag
> is 'true' by default, and that makes the pause longer. Would you be so
> kind to add it to the 'vm_backup.py' example that is part of version 4
> of the SDK?
>
>
> https://github.com/oVirt/ovirt-engine-sdk/blob/master/
> sdk/examples/vm_backup.py#L143-L151
>
> (Note that that Gibhub is just a mirror, the change needs to be submited
> using gerrit.ovirt.org).
>
>
>
I already verified (on a 4.1 infra) that changing vm_backup.py downloaded
yesterday from master this way (apart connection paramters):

$ diff vm_backup.py vm_backup.py.orig
 150d149
< persist_memorystate=False,

I get the backup result and snapshot is correctly without memory saved (and
no pause at VM side)

In engine events I get:

Mar 9, 2017 10:50:39 AM Snapshot
'Oracle7-backup-c6bf637e-cdeb-4923-a39f-55a14d7bad7b' deletion for VM
'Oracle7' has been completed.
Mar 9, 2017 10:49:48 AM Backup of virtual machine 'Oracle7' using snapshot
'Oracle7-backup-c6bf637e-cdeb-4923-a39f-55a14d7bad7b' is completed.
Mar 9, 2017 10:49:48 AM Snapshot
'Oracle7-backup-c6bf637e-cdeb-4923-a39f-55a14d7bad7b' deletion for VM
'Oracle7' was initiated by admin@internal-authz.
Mar 9, 2017 10:49:47 AM  Disk Oracle7_Disk1 was successfully detached from
VM c7testovn1 by admin@internal-authz.
Mar 9, 2017 10:49:45 AM Disk Oracle7_Disk1 was successfully attached to VM
c7testovn1 by admin@internal-authz.
Mar 9, 2017 10:49:41 AM Snapshot
'Oracle7-backup-c6bf637e-cdeb-4923-a39f-55a14d7bad7b' creation for VM
'Oracle7' has been completed.
Mar 9, 2017 10:49:29 AM Snapshot
'Oracle7-backup-c6bf637e-cdeb-4923-a39f-55a14d7bad7b' creation for VM
'Oracle7' was initiated by admin@internal-authz.
Mar 9, 2017 10:49:28 AM Backup of virtual machine 'Oracle7' using snapshot
'Oracle7-backup-c6bf637e-cdeb-4923-a39f-55a14d7bad7b' is starting.


I have almost no experience in gerrit/github, unfortunately... only a
beginner experience in svn ... ;-)
If you give me some pointers I can try to apply what you asked...

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


Re: [ovirt-users] oVirt VM backup and restore

2017-03-09 Thread Juan Hernández
On 03/09/2017 10:25 AM, Gianluca Cecchi wrote:
> On Wed, Mar 8, 2017 at 6:05 PM, Gianluca Cecchi
> > wrote:
> 
> 
> 
> NOTE: during the snapshot creation I see in web admin console the VM
> in paused state and also not responsive in both console and ssh session.
> After a couple of seconds it comes back and as a confirmation I see
> this in its messages:
> 
> Mar  8 17:38:57 T-ORACLE73 chronyd[616]: System clock wrong by
> 19.077230 seconds, adjustment started
> 
> Is this expected?
> 
> 
> 
> 
> Possibly the default changed at some point in time, so that now it saves
> memory and so this implies pause of VM
> 
> In the mean time I verified changing backup.py this way solves the
> problem (the 3.6 api deprecation still in place... ;-):
> 
> $ diff backup.py backup.py.orig 
> 123c123
> <
> vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(),
> vm=vm,persist_memorystate=False))
> ---
>>
> vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(),
> vm=vm))
> 
> The snapshot doesn't include memory and no problem at VM OS side now
> 
> Tested also getting the parameter from config file
> 
> Modifications needed in this case:
> 
> 1)
> $ diff backup.py backup.py.orig 
> 123c123
> <
> vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(),
> vm=vm,persist_memorystate=config.get_persist_memorystate()))
> ---
>>
> vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(),
> vm=vm))
> 
> 
> 2)
> $ diff config.py config.py.orig 
> 34d33
> < self.__persist_memorystate =
> config_parser.getboolean(section, "persist_memorystate")
> 113,116d111
> < 
> < 
> < def get_persist_memorystate(self):
> < return self.__persist_memorystate
> 
> 
> And in config file called add:
> 
> # Save Memory in snapshot
> persist_memorystate=False
> 
> It could be further improved if one wants to differentiate save memory
> for some VMs and not for other ones
> 
> HIH other ones,
> Gianluca
> 

Very good point Gialuca, you are right, the 'persist_memorystate' flag
is 'true' by default, and that makes the pause longer. Would you be so
kind to add it to the 'vm_backup.py' example that is part of version 4
of the SDK?


https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/vm_backup.py#L143-L151

(Note that that Gibhub is just a mirror, the change needs to be submited
using gerrit.ovirt.org).





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


Re: [ovirt-users] oVirt VM backup and restore

2017-03-09 Thread Gianluca Cecchi
On Wed, Mar 8, 2017 at 6:05 PM, Gianluca Cecchi 
wrote:

>
>
> NOTE: during the snapshot creation I see in web admin console the VM in
> paused state and also not responsive in both console and ssh session.
> After a couple of seconds it comes back and as a confirmation I see this
> in its messages:
>
> Mar  8 17:38:57 T-ORACLE73 chronyd[616]: System clock wrong by 19.077230
> seconds, adjustment started
>
> Is this expected?
>
>
>
>
Possibly the default changed at some point in time, so that now it saves
memory and so this implies pause of VM

In the mean time I verified changing backup.py this way solves the problem
(the 3.6 api deprecation still in place... ;-):

$ diff backup.py backup.py.orig
123c123
<
vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(),
vm=vm,persist_memorystate=False))
---
>
vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(),
vm=vm))

The snapshot doesn't include memory and no problem at VM OS side now

Tested also getting the parameter from config file

Modifications needed in this case:

1)
$ diff backup.py backup.py.orig
123c123
<
vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(),
vm=vm,persist_memorystate=config.get_persist_memorystate()))
---
>
vm.snapshots.add(params.Snapshot(description=config.get_snapshot_description(),
vm=vm))


2)
$ diff config.py config.py.orig
34d33
< self.__persist_memorystate =
config_parser.getboolean(section, "persist_memorystate")
113,116d111
<
<
< def get_persist_memorystate(self):
< return self.__persist_memorystate


And in config file called add:

# Save Memory in snapshot
persist_memorystate=False

It could be further improved if one wants to differentiate save memory for
some VMs and not for other ones

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


Re: [ovirt-users] oVirt VM backup and restore

2017-03-08 Thread Gianluca Cecchi
On Tue, Feb 7, 2017 at 6:05 PM, Beckman, Daniel <
daniel.beck...@ingramcontent.com> wrote:

> We’re been using oVirtBackup with our oVirt 4.0.5 environment and it’s
> worked well. It’s not the most efficient ( first creates a snapshot, then
> clone, then backup) but we can live with it.
>
>
>
> Has anyone tested oVirtBackup with oVirt 4.1? Does it still work? I want
> to know before we upgrade. I’d like to eventually use the new v4 API but I
> haven’t seen a lot of documentation on how it works in practice.
>
>
>
> Thanks,
>
> Daniel
>
>
>
> *From: *<users-boun...@ovirt.org> on behalf of Nathanaël Blanchet <
> blanc...@abes.fr>
> *Date: *Monday, January 30, 2017 at 3:44 AM
> *To: *"users@ovirt.org" <users@ovirt.org>
> *Subject: *Re: [ovirt-users] oVirt VM backup and restore
>
>
>
> Hello,
>
>- With ovirt <= 4.1 and ovirtsdk3 : https://github.com/wefixit-AT/
>oVirtBackup
>
> This workflow works fine but will be soon deprecated.
>
>- With ovirt > 4.0, jhernandez has recently posted a new python script
>based on the new v4 API : https://github.com/oVirt/
>ovirt-engine-sdk/blob/master/sdk/examples/vm_backup.py
>
> <https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/vm_backup.py>
>
> I personnally didn't try it, maybe someone could give a feedback.
>
>
>


I'm running some tests in a 4.1 testenvironment.
At the moment testing on a Oracle Linux 7.3 VM

- using oVirtBackup from master (version is on 3rd of July 2016)

$ ./backup.py -c config_test.cfg
Mar 08 17:37:08: Start backup for: Oracle7
Mar 08 17:37:09: Snapshot creation started ...
Mar 08 17:38:23: Snapshot created
Mar 08 17:38:33: Clone into VM started ...
Mar 08 17:40:31: Cloning finished
Mar 08 17:40:32: Snapshot deletion started ...
Mar 08 17:41:53: Snapshots deleted
Mar 08 17:41:54: Export started ...
Mar 08 17:43:56: Exporting finished
Mar 08 17:43:57: Delete cloned VM started ...
Mar 08 17:44:01: Cloned VM deleted
Mar 08 17:44:01: Duration: 6:54 minutes
Mar 08 17:44:01: VM exported as Oracle7_BACKUP_20170308_173708
Mar 08 17:44:01: Backup done for: Oracle7
Mar 08 17:44:01: All backups done

NOTE: during the snapshot creation I see in web admin console the VM in
paused state and also not responsive in both console and ssh session.
After a couple of seconds it comes back and as a confirmation I see this in
its messages:

Mar  8 17:38:57 T-ORACLE73 chronyd[616]: System clock wrong by 19.077230
seconds, adjustment started

Is this expected?

Not yet used the vm_backup.py, I;m trying to get sdk4 on Fedora 25 before
(see the other thread I opened)...

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


Re: [ovirt-users] oVirt VM backup and restore

2017-02-07 Thread Beckman, Daniel
We’re been using oVirtBackup with our oVirt 4.0.5 environment and it’s worked 
well. It’s not the most efficient ( first creates a snapshot, then clone, then 
backup) but we can live with it.

Has anyone tested oVirtBackup with oVirt 4.1? Does it still work? I want to 
know before we upgrade. I’d like to eventually use the new v4 API but I haven’t 
seen a lot of documentation on how it works in practice.

Thanks,
Daniel

From: <users-boun...@ovirt.org> on behalf of Nathanaël Blanchet 
<blanc...@abes.fr>
Date: Monday, January 30, 2017 at 3:44 AM
To: "users@ovirt.org" <users@ovirt.org>
Subject: Re: [ovirt-users] oVirt VM backup and restore


Hello,

  *   With ovirt <= 4.1 and ovirtsdk3 : 
https://github.com/wefixit-AT/oVirtBackup

This workflow works fine but will be soon deprecated.

  *   With ovirt > 4.0, jhernandez has recently posted a new python script 
based on the new v4 API : 
https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/vm_backup.py

I personnally didn't try it, maybe someone could give a feedback.

Le 29/01/2017 à 16:42, raphael awadallah a écrit :
Dears Engineers,
I hope you are doing great,
I wish you can help me with a tutorial that shows how to take a scheduled 
backups for virtual machines running on oVirt node 4 and how to restore them.
Best regards




___

Users mailing list

Users@ovirt.org<mailto:Users@ovirt.org>

http://lists.ovirt.org/mailman/listinfo/users



--

Nathanaël Blanchet



Supervision réseau

Pôle Infrastrutures Informatiques

227 avenue Professeur-Jean-Louis-Viala

34193 MONTPELLIER CEDEX 5

Tél. 33 (0)4 67 54 84 55

Fax  33 (0)4 67 54 84 14

blanc...@abes.fr<mailto:blanc...@abes.fr>
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] oVirt VM backup and restore

2017-01-30 Thread Yedidyah Bar David
On Sun, Jan 29, 2017 at 5:42 PM, raphael awadallah
 wrote:
> Dears Engineers,
> I hope you are doing great,
> I wish you can help me with a tutorial that shows how to take a scheduled
> backups for virtual machines running on oVirt node 4 and how to restore
> them.

>From oVirt's project point of view, we only supply an API for this, no
actual end-user tools. See also:

https://www.ovirt.org/develop/release-management/features/storage/backup-restore-api-integration/

If you search the net for e.g. 'ovirt backup vms', you can find lots of stuff -
actual tools, blog posts, mailing lists/forum discussions, etc.

Many of these were also mentioned/discussed on this list over the years, so
you can search also the list archives.

Personally I do not have experience with any of the tools, so can't comment.

If you need help with something specific you are trying to do - such as use
one of the existing tools, or use the api directly, etc. - then please provide
more details about what you are trying to do and what problems you run into.

Best,
-- 
Didi
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] oVirt VM backup and restore

2017-01-30 Thread Nathanaël Blanchet

Hello,

 * With ovirt <= 4.1 and ovirtsdk3 :
   https://github.com/wefixit-AT/oVirtBackup

This workflow works fine but will be soon deprecated.

 * With ovirt > 4.0, jhernandez has recently posted a new python script
   based on the new v4 API :
   
https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/vm_backup.py

I personnally didn't try it, maybe someone could give a feedback.


Le 29/01/2017 à 16:42, raphael awadallah a écrit :

Dears Engineers,
I hope you are doing great,
I wish you can help me with a tutorial that shows how to take a 
scheduled backups for virtual machines running on oVirt node 4 and how 
to restore them.

Best regards


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


--
Nathanaël Blanchet

Supervision réseau
Pôle Infrastrutures Informatiques
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5   
Tél. 33 (0)4 67 54 84 55
Fax  33 (0)4 67 54 84 14
blanc...@abes.fr

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