[Engine-devel] Tweaking backup/restore of engine

2014-03-03 Thread Sven Kieske
Hi,

currently all events are stored in the table audit_log
which all gets saved when you use the engine-backup
shell script.


the event log is full of these login lines (engine 3.3.2):

25652   fdfc627c-d875-11e0-90f0-83df133b58ccadmin@internal
----\N  \N  \N  \N  \N  
2014-01-20
06:39:17.222+01 USER_VDC_LOGIN  30  0   User admin@internal
logged in.  f   \N  \N  
----\N  \N  \N
\N  ----\N  oVirt   -1  30  
f   \N

this makes the log and db grow very large when you use the REST-API
to query ovirt for various data.

Is this necessary for a working restore?
It would be cool if we could tweak the engine-backup
tool to just dump necessary tables so you don't have
to restore events from the past no one is interested
in.

How does ovirt react, if I do not restore the content of the audit_log
table?

If this works (restore without audit_log) I would prefer to have
this code upstream in ovirt git so I don't have to maintain
my own backupscript.

Would it be possible to extend the existing backupscript
with a switch to not backup logs?
Currently it's just "all" or "just db".

I also recall that there shouldn't occur multiple login events any
more since ovirt 3.3. but it still seems to be the case.

I also do not understand how you would manage a stored authentication
via REST as REST is stateless.

I would appreciate any feedback or thoughts on this topic.
-- 
Mit freundlichen Grüßen / Regards

Sven Kieske

Systemadministrator
Mittwald CM Service GmbH & Co. KG
Königsberger Straße 6
32339 Espelkamp
T: +49-5772-293-100
F: +49-5772-293-333
https://www.mittwald.de
Geschäftsführer: Robert Meyer
St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine

2014-03-03 Thread Yair Zaslavsky


- Original Message -
> From: "Sven Kieske" 
> To: engine-devel@ovirt.org
> Sent: Monday, March 3, 2014 6:25:39 PM
> Subject: [Engine-devel] Tweaking backup/restore of engine
> 
> Hi,
> 
> currently all events are stored in the table audit_log
> which all gets saved when you use the engine-backup
> shell script.
> 
> 
> the event log is full of these login lines (engine 3.3.2):
> 
> 25652 fdfc627c-d875-11e0-90f0-83df133b58ccadmin@internal
> ----  \N  \N  \N  \N  \N  
> 2014-01-20
> 06:39:17.222+01   USER_VDC_LOGIN  30  0   User admin@internal
> logged in.f   \N  \N  
> ----\N  \N  \N
> \N----\N  oVirt   -1  30  
> f   \N
> 
> this makes the log and db grow very large when you use the REST-API
> to query ovirt for various data.
> 
> Is this necessary for a working restore?
> It would be cool if we could tweak the engine-backup
> tool to just dump necessary tables so you don't have
> to restore events from the past no one is interested
> in.
> 
> How does ovirt react, if I do not restore the content of the audit_log
> table?
> 
> If this works (restore without audit_log) I would prefer to have
> this code upstream in ovirt git so I don't have to maintain
> my own backupscript.
> 
> Would it be possible to extend the existing backupscript
> with a switch to not backup logs?
> Currently it's just "all" or "just db".
> 
> I also recall that there shouldn't occur multiple login events any
> more since ovirt 3.3. but it still seems to be the case.

Hi Sven,
This is not entirely accurate -
The solution introduced at commit hash  
cb56de8808cec33b7599828ead890f52e32bcaea solves the problem for a specific case 
in which we have a multiple login in a very short interval of time -
mainly due to attempt to login from webadmin, while UI plugin tries to login as 
well.
We have an "anti flood" mechanism for events, allowing us to define an 
interval, in which an event will not be logged twice. In the case of the login 
event this is set to 5 seconds, which is enough to solve the above described 
scenario.


> 
> I also do not understand how you would manage a stored authentication
> via REST as REST is stateless.
> 
> I would appreciate any feedback or thoughts on this topic.
> --
> Mit freundlichen Grüßen / Regards
> 
> Sven Kieske
> 
> Systemadministrator
> Mittwald CM Service GmbH & Co. KG
> Königsberger Straße 6
> 32339 Espelkamp
> T: +49-5772-293-100
> F: +49-5772-293-333
> https://www.mittwald.de
> Geschäftsführer: Robert Meyer
> St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
> Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
> ___
> Engine-devel mailing list
> Engine-devel@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
>
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine

2014-03-04 Thread Sven Kieske
Thanks for the clarification,

I couldn't find this change any more, but I knew
there was something done.

However this makes me think about an RFE:
It would be cool if ovirt could provide a way
to use the REST-API without always have to login
and logout.

Maybe something like a hook into
some message passing queue like rabbitMQ or zeroMQ
or a similar process for receiving and submitting
messages. So you could register once with an API
consumer and use that.

What do you think?

Am 04.03.2014 07:53, schrieb Yair Zaslavsky:
> Hi Sven,
> This is not entirely accurate -
> The solution introduced at commit hash  
> cb56de8808cec33b7599828ead890f52e32bcaea solves the problem for a specific 
> case in which we have a multiple login in a very short interval of time -
> mainly due to attempt to login from webadmin, while UI plugin tries to login 
> as well.
> We have an "anti flood" mechanism for events, allowing us to define an 
> interval, in which an event will not be logged twice. In the case of the 
> login event this is set to 5 seconds, which is enough to solve the above 
> described scenario.

-- 
Mit freundlichen Grüßen / Regards

Sven Kieske

Systemadministrator
Mittwald CM Service GmbH & Co. KG
Königsberger Straße 6
32339 Espelkamp
T: +49-5772-293-100
F: +49-5772-293-333
https://www.mittwald.de
Geschäftsführer: Robert Meyer
St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine

2014-03-04 Thread Yair Zaslavsky


- Original Message -
> From: "Sven Kieske" 
> To: engine-devel@ovirt.org
> Sent: Tuesday, March 4, 2014 10:25:31 AM
> Subject: Re: [Engine-devel] Tweaking backup/restore of engine
> 
> Thanks for the clarification,
> 
> I couldn't find this change any more, but I knew
> there was something done.
> 
> However this makes me think about an RFE:
> It would be cool if ovirt could provide a way
> to use the REST-API without always have to login
> and logout.
> 
> Maybe something like a hook into
> some message passing queue like rabbitMQ or zeroMQ
> or a similar process for receiving and submitting
> messages. So you could register once with an API
> consumer and use that.
> 
> What do you think?

CC'ing Juan - the maintainer of the REST API
> 
> Am 04.03.2014 07:53, schrieb Yair Zaslavsky:
> > Hi Sven,
> > This is not entirely accurate -
> > The solution introduced at commit hash
> > cb56de8808cec33b7599828ead890f52e32bcaea solves the problem for a
> > specific case in which we have a multiple login in a very short interval
> > of time -
> > mainly due to attempt to login from webadmin, while UI plugin tries to
> > login as well.
> > We have an "anti flood" mechanism for events, allowing us to define an
> > interval, in which an event will not be logged twice. In the case of the
> > login event this is set to 5 seconds, which is enough to solve the above
> > described scenario.
> 
> --
> Mit freundlichen Grüßen / Regards
> 
> Sven Kieske
> 
> Systemadministrator
> Mittwald CM Service GmbH & Co. KG
> Königsberger Straße 6
> 32339 Espelkamp
> T: +49-5772-293-100
> F: +49-5772-293-333
> https://www.mittwald.de
> Geschäftsführer: Robert Meyer
> St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
> Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
> ___
> Engine-devel mailing list
> Engine-devel@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
> 
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine

2014-03-04 Thread Juan Hernandez
On 03/04/2014 09:38 AM, Yair Zaslavsky wrote:
> 
> 
> - Original Message -
>> From: "Sven Kieske" 
>> To: engine-devel@ovirt.org
>> Sent: Tuesday, March 4, 2014 10:25:31 AM
>> Subject: Re: [Engine-devel] Tweaking backup/restore of engine
>>
>> Thanks for the clarification,
>>
>> I couldn't find this change any more, but I knew
>> there was something done.
>>
>> However this makes me think about an RFE:
>> It would be cool if ovirt could provide a way
>> to use the REST-API without always have to login
>> and logout.
>>
>> Maybe something like a hook into
>> some message passing queue like rabbitMQ or zeroMQ
>> or a similar process for receiving and submitting
>> messages. So you could register once with an API
>> consumer and use that.
>>
>> What do you think?
> 
> CC'ing Juan - the maintainer of the REST API

Using the RESTAPI without repeated login/logout is already supported,
and it is what the SDKs do by default. In order to use it you need to
add the "Prefer: persistent-auth" header to the HTTP request, and keep
track of the cookies returned by the engine. For, example, the following
example sends events to the engine, without repeatedly performing the
login process:

#!/bin/sh -x

# The details to connect to the engine:
url="https://whatever/ovirt-engine/api";
user="admin@internal"
password=""

# The file where we store the cookies, including the
# session id:
cookies="cookies.txt"

curl \
--insecure \
--request POST \
--header "Accept: application/xml" \
--header "Content-Type: application/xml" \
--header "Prefer: persistent-auth" \
--user "${user}:${password}" \
--cookie "${cookies}" \
--cookie-jar "${cookies}" \
--data "

  myorigin
  normal
  Something from me
  $(date +%s)

" \
${url}/events

This will keep a session alive in the server. If you want to explicitly
close it just send an additional request, with the same cookies and
without the "Prefer" header.

It is described in more detail here:

http://www.ovirt.org/Features/RESTSessionManagement

>>
>> Am 04.03.2014 07:53, schrieb Yair Zaslavsky:
>>> Hi Sven,
>>> This is not entirely accurate -
>>> The solution introduced at commit hash
>>> cb56de8808cec33b7599828ead890f52e32bcaea solves the problem for a
>>> specific case in which we have a multiple login in a very short interval
>>> of time -
>>> mainly due to attempt to login from webadmin, while UI plugin tries to
>>> login as well.
>>> We have an "anti flood" mechanism for events, allowing us to define an
>>> interval, in which an event will not be logged twice. In the case of the
>>> login event this is set to 5 seconds, which is enough to solve the above
>>> described scenario.
>>
>> --
>> Mit freundlichen Grüßen / Regards
>>
>> Sven Kieske
>>
>> Systemadministrator
>> Mittwald CM Service GmbH & Co. KG
>> Königsberger Straße 6
>> 32339 Espelkamp
>> T: +49-5772-293-100
>> F: +49-5772-293-333
>> https://www.mittwald.de
>> Geschäftsführer: Robert Meyer
>> St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
>> Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
>> ___
>> Engine-devel mailing list
>> Engine-devel@ovirt.org
>> http://lists.ovirt.org/mailman/listinfo/engine-devel
>>


-- 
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine

2014-03-04 Thread Sven Kieske
Hi,

I forgot to mention a crucial
point:

How long does the engine store past events, are they
stored forever or is there some kind of rotation?

We mainly use the engine as a REST provider for managing
the virtual machines.

-- 
Mit freundlichen Grüßen / Regards

Sven Kieske

Systemadministrator
Mittwald CM Service GmbH & Co. KG
Königsberger Straße 6
32339 Espelkamp
T: +49-5772-293-100
F: +49-5772-293-333
https://www.mittwald.de
Geschäftsführer: Robert Meyer
St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine

2014-03-05 Thread Itamar Heim

On 03/04/2014 12:00 PM, Sven Kieske wrote:

Hi,

I forgot to mention a crucial
point:

How long does the engine store past events, are they
stored forever or is there some kind of rotation?

We mainly use the engine as a REST provider for managing
the virtual machines.



audit log gets deleted after 30 days by default. you can change that via 
config:


packaging/dbscripts/upgrade/pre_upgrade/_config.sql:select 
fn_db_add_config_value('AuditLogAgingThreshold','30','general');
packaging/etc/engine-config/engine-config.properties:AuditLogAgingThreshold.description="Audit 
Log Aging Threshold (in days)"

p
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine

2014-03-05 Thread Sven Kieske
Wouldn't engine-config -s AuditLogAgingThreshold=X suffice?

Am 05.03.2014 10:19, schrieb Itamar Heim:
> On 03/04/2014 12:00 PM, Sven Kieske wrote:
>> Hi,
>>
>> I forgot to mention a crucial
>> point:
>>
>> How long does the engine store past events, are they
>> stored forever or is there some kind of rotation?
>>
>> We mainly use the engine as a REST provider for managing
>> the virtual machines.
>>
> 
> audit log gets deleted after 30 days by default. you can change that via
> config:
> 
> packaging/dbscripts/upgrade/pre_upgrade/_config.sql:select
> fn_db_add_config_value('AuditLogAgingThreshold','30','general');
> packaging/etc/engine-config/engine-config.properties:AuditLogAgingThreshold.description="Audit
> Log Aging Threshold (in days)"
> p
> 
> 
> 

-- 
Mit freundlichen Grüßen / Regards

Sven Kieske

Systemadministrator
Mittwald CM Service GmbH & Co. KG
Königsberger Straße 6
32339 Espelkamp
T: +49-5772-293-100
F: +49-5772-293-333
https://www.mittwald.de
Geschäftsführer: Robert Meyer
St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine

2014-03-05 Thread Itamar Heim

On 03/05/2014 01:52 PM, Sven Kieske wrote:

Wouldn't engine-config -s AuditLogAgingThreshold=X suffice?



yes. I just sent the line with current value and the description


Am 05.03.2014 10:19, schrieb Itamar Heim:

On 03/04/2014 12:00 PM, Sven Kieske wrote:

Hi,

I forgot to mention a crucial
point:

How long does the engine store past events, are they
stored forever or is there some kind of rotation?

We mainly use the engine as a REST provider for managing
the virtual machines.



audit log gets deleted after 30 days by default. you can change that via
config:

packaging/dbscripts/upgrade/pre_upgrade/_config.sql:select
fn_db_add_config_value('AuditLogAgingThreshold','30','general');
packaging/etc/engine-config/engine-config.properties:AuditLogAgingThreshold.description="Audit
Log Aging Threshold (in days)"
p







___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine

2014-03-05 Thread Eli Mesika


- Original Message -
> From: "Sven Kieske" 
> To: engine-devel@ovirt.org
> Sent: Monday, March 3, 2014 6:25:39 PM
> Subject: [Engine-devel] Tweaking backup/restore of engine
> 
> Hi,
> 
> currently all events are stored in the table audit_log
> which all gets saved when you use the engine-backup
> shell script.
> 
> 
> the event log is full of these login lines (engine 3.3.2):
> 
> 25652 fdfc627c-d875-11e0-90f0-83df133b58ccadmin@internal
> ----  \N  \N  \N  \N  \N  
> 2014-01-20
> 06:39:17.222+01   USER_VDC_LOGIN  30  0   User admin@internal
> logged in.f   \N  \N  
> ----\N  \N  \N
> \N----\N  oVirt   -1  30  
> f   \N
> 
> this makes the log and db grow very large when you use the REST-API
> to query ovirt for various data.
> 
> Is this necessary for a working restore?
> It would be cool if we could tweak the engine-backup
> tool to just dump necessary tables so you don't have
> to restore events from the past no one is interested
> in.
> 
> How does ovirt react, if I do not restore the content of the audit_log
> table?
> 
> If this works (restore without audit_log) I would prefer to have
> this code upstream in ovirt git so I don't have to maintain
> my own backupscript.
> 
> Would it be possible to extend the existing backupscript
> with a switch to not backup logs?
> Currently it's just "all" or "just db".

Hi Sven 

engine-backup is calling eventually a postgres utility named pg_dump
this utility supports the following flag :

--exclude-table-data=TABLE   do NOT dump data for the named table(s)


I think that a RFE for adding support for this flag in engine-backup will 
easily solve your problem

Eli

> 
> I also recall that there shouldn't occur multiple login events any
> more since ovirt 3.3. but it still seems to be the case.
> 
> I also do not understand how you would manage a stored authentication
> via REST as REST is stateless.
> 
> I would appreciate any feedback or thoughts on this topic.
> --
> Mit freundlichen Grüßen / Regards
> 
> Sven Kieske
> 
> Systemadministrator
> Mittwald CM Service GmbH & Co. KG
> Königsberger Straße 6
> 32339 Espelkamp
> T: +49-5772-293-100
> F: +49-5772-293-333
> https://www.mittwald.de
> Geschäftsführer: Robert Meyer
> St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
> Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
> ___
> Engine-devel mailing list
> Engine-devel@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
> 
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine

2014-03-05 Thread Yedidyah Bar David
- Original Message -
> From: "Eli Mesika" 
> To: "Sven Kieske" 
> Cc: engine-devel@ovirt.org
> Sent: Wednesday, March 5, 2014 4:50:42 PM
> Subject: Re: [Engine-devel] Tweaking backup/restore of engine
> 
> 
> 
> - Original Message -
> > From: "Sven Kieske" 
> > To: engine-devel@ovirt.org
> > Sent: Monday, March 3, 2014 6:25:39 PM
> > Subject: [Engine-devel] Tweaking backup/restore of engine
> > 
> > Hi,
> > 
> > currently all events are stored in the table audit_log
> > which all gets saved when you use the engine-backup
> > shell script.
> > 
> > 
> > the event log is full of these login lines (engine 3.3.2):
> > 
> > 25652   fdfc627c-d875-11e0-90f0-83df133b58ccadmin@internal
> > ----\N  \N  \N  \N  
> > \N  2014-01-20
> > 06:39:17.222+01 USER_VDC_LOGIN  30  0   User admin@internal
> > logged in.  f   \N  \N  
> > ----\N  \N  \N
> > \N  ----\N  oVirt   -1  30  
> > f   \N
> > 
> > this makes the log and db grow very large when you use the REST-API
> > to query ovirt for various data.
> > 
> > Is this necessary for a working restore?
> > It would be cool if we could tweak the engine-backup
> > tool to just dump necessary tables so you don't have
> > to restore events from the past no one is interested
> > in.
> > 
> > How does ovirt react, if I do not restore the content of the audit_log
> > table?
> > 
> > If this works (restore without audit_log) I would prefer to have
> > this code upstream in ovirt git so I don't have to maintain
> > my own backupscript.
> > 
> > Would it be possible to extend the existing backupscript
> > with a switch to not backup logs?
> > Currently it's just "all" or "just db".
> 
> Hi Sven
> 
> engine-backup is calling eventually a postgres utility named pg_dump
> this utility supports the following flag :
> 
> --exclude-table-data=TABLE   do NOT dump data for the named table(s)

Oh, didn't notice that one. Added in 9.2, so not for el6.

> 
> 
> I think that a RFE for adding support for this flag in engine-backup will
> easily solve your problem

Perhaps better to allow passing arbitrary options to pg_dump. Or something
like that.
-- 
Didi
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine

2014-03-06 Thread Eli Mesika


- Original Message -
> From: "Yedidyah Bar David" 
> To: "Eli Mesika" 
> Cc: "Sven Kieske" , engine-devel@ovirt.org
> Sent: Wednesday, March 5, 2014 5:02:40 PM
> Subject: Re: [Engine-devel] Tweaking backup/restore of engine
> 
> - Original Message -
> > From: "Eli Mesika" 
> > To: "Sven Kieske" 
> > Cc: engine-devel@ovirt.org
> > Sent: Wednesday, March 5, 2014 4:50:42 PM
> > Subject: Re: [Engine-devel] Tweaking backup/restore of engine
> > 
> > 
> > 
> > - Original Message -----
> > > From: "Sven Kieske" 
> > > To: engine-devel@ovirt.org
> > > Sent: Monday, March 3, 2014 6:25:39 PM
> > > Subject: [Engine-devel] Tweaking backup/restore of engine
> > > 
> > > Hi,
> > > 
> > > currently all events are stored in the table audit_log
> > > which all gets saved when you use the engine-backup
> > > shell script.
> > > 
> > > 
> > > the event log is full of these login lines (engine 3.3.2):
> > > 
> > > 25652 fdfc627c-d875-11e0-90f0-83df133b58ccadmin@internal
> > > ----  \N  \N  \N  \N  
> > > \N  2014-01-20
> > > 06:39:17.222+01   USER_VDC_LOGIN  30  0   User admin@internal
> > > logged in.f   \N  \N  
> > > ----\N  \N  \N
> > > \N----\N  oVirt   -1  
> > > 30  f   \N
> > > 
> > > this makes the log and db grow very large when you use the REST-API
> > > to query ovirt for various data.
> > > 
> > > Is this necessary for a working restore?
> > > It would be cool if we could tweak the engine-backup
> > > tool to just dump necessary tables so you don't have
> > > to restore events from the past no one is interested
> > > in.
> > > 
> > > How does ovirt react, if I do not restore the content of the audit_log
> > > table?
> > > 
> > > If this works (restore without audit_log) I would prefer to have
> > > this code upstream in ovirt git so I don't have to maintain
> > > my own backupscript.
> > > 
> > > Would it be possible to extend the existing backupscript
> > > with a switch to not backup logs?
> > > Currently it's just "all" or "just db".
> > 
> > Hi Sven
> > 
> > engine-backup is calling eventually a postgres utility named pg_dump
> > this utility supports the following flag :
> > 
> > --exclude-table-data=TABLE   do NOT dump data for the named table(s)
> 
> Oh, didn't notice that one. Added in 9.2, so not for el6.
> 
> > 
> > 
> > I think that a RFE for adding support for this flag in engine-backup will
> > easily solve your problem
> 
> Perhaps better to allow passing arbitrary options to pg_dump. Or something
> like that.

So backup-engine will pass any additional parameters "as is" to the PG utility, 
Yes this would be great

> --
> Didi
> 
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine

2014-03-06 Thread Sven Kieske
I was just writing an RFE, when I read that it's not possible
for el6. thats sad :/

Am 05.03.2014 16:02, schrieb Yedidyah Bar David:
> Oh, didn't notice that one. Added in 9.2, so not for el6.

-- 
Mit freundlichen Grüßen / Regards

Sven Kieske

Systemadministrator
Mittwald CM Service GmbH & Co. KG
Königsberger Straße 6
32339 Espelkamp
T: +49-5772-293-100
F: +49-5772-293-333
https://www.mittwald.de
Geschäftsführer: Robert Meyer
St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine

2014-03-06 Thread Sven Kieske
Here's the RFE:

https://bugzilla.redhat.com/show_bug.cgi?id=1073421

-- 
Mit freundlichen Grüßen / Regards

Sven Kieske

Systemadministrator
Mittwald CM Service GmbH & Co. KG
Königsberger Straße 6
32339 Espelkamp
T: +49-5772-293-100
F: +49-5772-293-333
https://www.mittwald.de
Geschäftsführer: Robert Meyer
St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine and the table 'audit_log'

2014-03-03 Thread Yedidyah Bar David
- Original Message -
> From: "Sven Kieske" 
> To: engine-devel@ovirt.org
> Sent: Monday, March 3, 2014 6:25:39 PM
> Subject: [Engine-devel] Tweaking backup/restore of engine
> 
> Hi,
> 
> currently all events are stored in the table audit_log
> which all gets saved when you use the engine-backup
> shell script.
> 
> 
> the event log is full of these login lines (engine 3.3.2):
> 
> 25652 fdfc627c-d875-11e0-90f0-83df133b58ccadmin@internal
> ----  \N  \N  \N  \N  \N  
> 2014-01-20
> 06:39:17.222+01   USER_VDC_LOGIN  30  0   User admin@internal
> logged in.f   \N  \N  
> ----\N  \N  \N
> \N----\N  oVirt   -1  30  
> f   \N
> 
> this makes the log and db grow very large when you use the REST-API
> to query ovirt for various data.
> 
> Is this necessary for a working restore?

I have no idea - I guess the data is not necessary.

I also guess that the schema is.

> It would be cool if we could tweak the engine-backup
> tool to just dump necessary tables so you don't have
> to restore events from the past no one is interested
> in.
> 
> How does ovirt react, if I do not restore the content of the audit_log
> table?
> 
> If this works (restore without audit_log) I would prefer to have
> this code upstream in ovirt git so I don't have to maintain
> my own backupscript.
> 
> Would it be possible to extend the existing backupscript
> with a switch to not backup logs?
> Currently it's just "all" or "just db".

It would be easy to let you pass an "extra options" argument for pg_dump.
This will allow adding '-T audit_log'. As I said, I am pretty certain
that you do need the table itself, so this will not help you much.

I personally think that this isn't the right way to go. If you do not need
the data, create a cron job that will periodically truncate it - say, keep
the last X days and delete the rest. Perhaps also archive before deleting
if you want. If you want, open a bug to provide a script to do that for you.
Or make the engine itself do that, etc.

Of course, after verifying that this does not have a significant impact on
the engine :-)

> 
> I also recall that there shouldn't occur multiple login events any
> more since ovirt 3.3. but it still seems to be the case.
> 
> I also do not understand how you would manage a stored authentication
> via REST as REST is stateless.
> 
> I would appreciate any feedback or thoughts on this topic.

Best regards,
-- 
Didi
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine and the table 'audit_log'

2014-03-04 Thread Sven Kieske
Thanks for your answer so far.

Is there anyone around who knows
if the audit_log data is needed for a successful restore?
I'd rather not try this out myself.

The reasoning behind this all is of course to keep backup
space as small as possible.

Am 03.03.2014 21:41, schrieb Yedidyah Bar David:
> I have no idea - I guess the data is not necessary.

-- 
Mit freundlichen Grüßen / Regards

Sven Kieske

Systemadministrator
Mittwald CM Service GmbH & Co. KG
Königsberger Straße 6
32339 Espelkamp
T: +49-5772-293-100
F: +49-5772-293-333
https://www.mittwald.de
Geschäftsführer: Robert Meyer
St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel


Re: [Engine-devel] Tweaking backup/restore of engine and the table 'audit_log'

2014-03-05 Thread Eli Mesika


- Original Message -
> From: "Sven Kieske" 
> To: engine-devel@ovirt.org
> Sent: Tuesday, March 4, 2014 10:10:31 AM
> Subject: Re: [Engine-devel] Tweaking backup/restore of engine and the table 
> 'audit_log'
> 
> Thanks for your answer so far.
> 
> Is there anyone around who knows
> if the audit_log data is needed for a successful restore?
> I'd rather not try this out myself.

only the table is needed, the data may be truncated and this not affect the way 
the engine will work, you will just loose the events/alerts history.


> 
> The reasoning behind this all is of course to keep backup
> space as small as possible.
> 
> Am 03.03.2014 21:41, schrieb Yedidyah Bar David:
> > I have no idea - I guess the data is not necessary.
> 
> --
> Mit freundlichen Grüßen / Regards
> 
> Sven Kieske
> 
> Systemadministrator
> Mittwald CM Service GmbH & Co. KG
> Königsberger Straße 6
> 32339 Espelkamp
> T: +49-5772-293-100
> F: +49-5772-293-333
> https://www.mittwald.de
> Geschäftsführer: Robert Meyer
> St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
> Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen
> ___
> Engine-devel mailing list
> Engine-devel@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
> 
___
Engine-devel mailing list
Engine-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-devel