ETL service sampling
by knarra
This is a multi-part message in MIME format.
--------------F69A7D129E2CC201BE9B2C9E
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Hi All,
I see the event below getting logged in the events tab . What is
this event related to ? Why does this get logged as an error ?
ETL service sampling has encountered an error. Please consult the
service log for more details.
Thanks
kasturi
--------------F69A7D129E2CC201BE9B2C9E
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi All,</p>
<p> I see the event below getting logged in the events tab .
What is this event related to ? Why does this get logged as an
error ?<br>
</p>
<div style="outline-style:none;" __gwt_cell="cell-gwt-uid-1324">
<div class="" style="overflow: hidden; text-overflow: ellipsis;
white-space: nowrap;" id="gwt-uid-411_col2_row0">ETL service
sampling has encountered an error. Please consult the service
log for more details.<br>
<br>
Thanks<br>
kasturi<br>
</div>
</div>
</body>
</html>
--------------F69A7D129E2CC201BE9B2C9E--
8 years, 3 months
Re: [ovirt-users] Problem starting VMs
by Wolfgang Bucher
This is a multi-part message in MIME format. Your mail reader does not
understand MIME message format.
--=_sRsL4clZsKi75Xw63uWLRBEzj1CUCAu8aTrk6zNwHYSPe0Ty
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hello=0D=0A=0D=0A=0D=0A=0D=0Ausing the kernel-lt from elrepo solves all p=
roblems!!=0D=0A=0D=0AMaybe it is a problem with the current kernel from c=
entos =3F=3F=0D=0A=0D=0A=0D=0A=0D=0AThanks=20=0D=0A=0D=0A=0D=0A=0D=0AWolf=
gang=0D=0A=0D=0A=0D=0A=0D=0A-----Urspr=C3=BCngliche Nachricht-----=0D=0AV=
on: Wolfgang Bucher=C2=A0<wolfgang.bucher(a)netland-mn.de>=0D=0AGesendet: D=
ie 23 August 2016 20:14=0D=0AAn: Yaniv Kaul <ykaul(a)redhat.com>=0D=0ACC: u=
sers(a)ovirt.org (users(a)ovirt.org) <users(a)ovirt.org>=0D=0ABetreff: Re: [ovi=
rt-users] Problem starting VMs=0D=0A=0D=0AHello=0D=0A=0D=0A=0D=0A=0D=0Ai =
just changed xfs to ext4 and defragmantion is much better then before, i =
will also try kernel lts from elrepo and test it again.=0D=0A=0D=0A=0D=0A=
=0D=0AThanks=0D=0A=0D=0A=0D=0A=0D=0AWolfgang=0D=0A=0D=0A=0D=0A=0D=0A-----=
Urspr=C3=BCngliche Nachricht-----=0D=0AVon: Yaniv Kaul=C2=A0<ykaul@redhat=
=2Ecom>=0D=0AGesendet: Die 23 August 2016 19:46=0D=0AAn: Wolfgang Bucher =
<wolfgang.bucher(a)netland-mn.de>=0D=0ACC: Charles Gruener <cgruener@gruene=
r.us>=0D=0ABetreff: Re: AW: [ovirt-users] Problem starting VMs=0D=0A=0D=0A=
=0D=0AOn Aug 23, 2016 7:33 PM, "Wolfgang Bucher" <wolfgang.bucher@netland=
-mn.de <mailto:wolfgang.bucher@netland-mn.de> > wrote:=0D=0A >=0D=0A > He=
llo=0D=0A >=0D=0A >=0D=0A > I am using local storage with adaptec raid co=
ntroller, disk format is raw=0D=0A=0D=0ARaw is always raw-sparse, so that=
may explain this somehow, yet still odd that Windows installation would =
cause so much fragmentation.=0D=0A I wonder if using the discard hook (an=
d IDE or virtio-scsi) would help - or perhaps using a qcow2 makes more se=
nse (create a snapshot right after disk creation for example).=0D=0A=0D=0A=
>=0D=0A >=0D=0A > image: e4d797d1-5719-48d0-891e-a36cd4a79c33=0D=0A > fil=
e format: raw=0D=0A > virtual size: 50G (53687091200 bytes)=0D=0A > disk =
size: 8.5G=0D=0A >=0D=0A >=0D=0A > this is a fresh installation of W2012 =
after installation i got with xfs_db -c frag -r=C2=A0 /dev/sdb1:=0D=0A >=0D=
=0A > aktuell 407974, ideal 35, Unterteilungsfaktor 99,99%=0D=0A=0D=0AAnd=
the XFS formatted with default parameters=3F=0D=0A Y.=0D=0A=0D=0A>=0D=0A=
>=0D=0A > Thanks=0D=0A >=0D=0A >=0D=0A > Wolfgang=0D=0A >=0D=0A >=0D=0A =
>> -----Urspr=C3=BCngliche Nachricht-----=0D=0A >> Von: Yaniv Kaul=C2=A0<=
ykaul(a)redhat.com <mailto:ykaul@redhat.com> >=0D=0A >> Gesendet: Die 23 Au=
gust 2016 17:56=0D=0A >> An: Wolfgang Bucher <wolfgang.bucher(a)netland-mn.=
de <mailto:wolfgang.bucher@netland-mn.de> >=0D=0A >> CC: Michal Skrivanek=
<michal.skrivanek(a)redhat.com <mailto:michal.skrivanek@redhat.com> >; use=
rs(a)ovirt.org <mailto:users@ovirt.org> (users(a)ovirt.org <mailto:users@ovir=
t.org> ) <users(a)ovirt.org <mailto:users@ovirt.org> >=0D=0A >>=0D=0A >> Be=
treff: Re: [ovirt-users] Problem starting VMs=0D=0A >>=0D=0A >>=0D=0A >>=0D=
=0A >> On Tue, Aug 23, 2016 at 6:40 PM, Wolfgang Bucher <wolfgang.bucher@=
netland-mn.de <mailto:wolfgang.bucher@netland-mn.de> > wrote:=0D=0A >>>=0D=
=0A >>> Hello=0D=0A >>>=0D=0A >>>=0D=0A >>> in var log messages i get fol=
lowing :=0D=0A >>>=0D=0A >>>=0D=0A >>> kernel: XFS: possible memory alloc=
ation deadlock in kmem_alloc (mode:0x250)=0D=0A >>>=0D=0A >>>=0D=0A >>> I=
have this problem on 4 different hosts.=0D=0A >>>=0D=0A >>>=0D=0A >>> Th=
is happens during copying files from network to a thin provisioned disk, =
no problems with preallocated disks.=0D=0A >>=0D=0A >>=0D=0A >> What kind=
of storage are you using=3F local storage=3F Even though, it makes littl=
e sense to me - the disk is a qcow2 disk, which shouldn't be very fragmen=
ted as you might think (qcow2 grows in 64K chunks).=0D=0A >> It may grow =
and grow and grow (until you sparsify it), but that's not going to cause =
fragmentation. What causes it to be fragmented=3F Perhaps the internal qc=
ow2 mapping is quite fragmented=3F=0D=0A >> Y.=0D=0A >> =C2=A0=0D=0A >>>=0D=
=0A >>>=0D=0A >>> Thanks=0D=0A >>>=0D=0A >>> Wolfgang=0D=0A >>>=0D=0A >>>=
=0D=0A >>>> -----Urspr=C3=BCngliche Nachricht-----=0D=0A >>>> Von: Michal=
Skrivanek=C2=A0<michal.skrivanek(a)redhat.com <mailto:michal.skrivanek@red=
hat.com> >=0D=0A >>>> Gesendet: Die 23 August 2016 17:11=0D=0A >>>> An: W=
olfgang Bucher <wolfgang.bucher(a)netland-mn.de <mailto:wolfgang.bucher@net=
land-mn.de> >=0D=0A >>>> CC: Milan Zamazal <mzamazal(a)redhat.com <mailto:m=
zamazal(a)redhat.com> >; users(a)ovirt.org <mailto:users@ovirt.org> (users@ov=
irt.org <mailto:users@ovirt.org> ) <users(a)ovirt.org <mailto:users@ovirt.o=
rg> >=0D=0A >>>> Betreff: Re: [ovirt-users] Problem starting VMs=0D=0A >>=
>>=0D=0A >>>>=0D=0A >>>>> On 23 Aug 2016, at 11:06, Wolfgang Bucher <wolf=
gang.bucher(a)netland-mn.de <mailto:wolfgang.bucher@netland-mn.de> > wrote:=
=0D=0A >>>>>=0D=0A >>>>> Thank's=0D=0A >>>>>=0D=0A >>>>> but what do you =
mean with "initialization is finished=E2=80=9D=0D=0A >>>>=0D=0A >>>>=0D=0A=
>>>> until it gets from WaitForLaunch to PoweringUp state, effectively u=
ntil the qemu process properly starts up=0D=0A >>>>=0D=0A >>>>>=0D=0A >>>=
>> sometimes the vm crashes while copying files!=0D=0A >>>>=0D=0A >>>>=0D=
=0A >>>> when exactly=3F Can you describe exactly what you are doing and =
what is reported as a reason for crash. When exactly does it crash and ho=
w=3F=0D=0A >>>>=0D=0A >>>> Thanks,=0D=0A >>>> michal=0D=0A >>>>=0D=0A >>>=
>>=0D=0A >>>>>=0D=0A >>>>>=0D=0A >>>>> Wolfgang=0D=0A >>>>>=0D=0A >>>>>=0D=
=0A >>>>>> -----Urspr=C3=BCngliche Nachricht-----=0D=0A >>>>>> Von: Milan=
Zamazal=C2=A0<mzamazal(a)redhat.com <mailto:mzamazal@redhat.com> >=0D=0A >=
>>>>> Gesendet: Die 23 August 2016 16:59=0D=0A >>>>>> An: Wolfgang Bucher=
<wolfgang.bucher(a)netland-mn.de <mailto:wolfgang.bucher@netland-mn.de> >=0D=
=0A >>>>>> CC: users(a)ovirt.org <mailto:users@ovirt.org> (users(a)ovirt.org =
<mailto:users@ovirt.org> ) <users(a)ovirt.org <mailto:users@ovirt.org> >=0D=
=0A >>>>>> Betreff: Re: AW: Problem starting VMs=0D=0A >>>>>>=0D=0A >>>>>=
> Wolfgang Bucher <wolfgang.bucher(a)netland-mn.de <mailto:wolfgang.bucher@=
netland-mn.de> > writes:=0D=0A >>>>>>=0D=0A >>>>>> > the problem is "wait=
ing for launch" takes up to 20 min.=0D=0A >>>>>> >=0D=0A >>>>>> >=0D=0A >=
>>>>> > I did a lot of tests with some vm's and th problem is:=0D=0A >>>>=
>> >=0D=0A >>>>>> >=0D=0A >>>>>> > 1.=C2=A0 create a win2012 server=0D=0A=
>>>>>> >=0D=0A >>>>>> > 2. attache a new disk (thin provision)=0D=0A >>>=
>>> >=0D=0A >>>>>> > 3. fill the disk from network share with about 100G=0D=
=0A >>>>>> >=0D=0A >>>>>> > 4. shutdown the vm=0D=0A >>>>>> >=0D=0A >>>>>=
> > 5. reboot host and try starting the vm (takes a lot of time until lau=
nch)=0D=0A >>>>>> >=0D=0A >>>>>> >=0D=0A >>>>>> >=0D=0A >>>>>> > It's bec=
ause of a high fragmented filessystem=20=0D=0A >>>>>>=0D=0A >>>>>> I see,=
thank you for the explanation. In such a case, it may take a lot=0D=0A >=
>>>>> of time before all the initialization is finished.=0D=0A >>>>>>=0D=0A=
>>>>>> Regards,=0D=0A >>>>>> Milan=0D=0A >>>>>=0D=0A >>>>> _____________=
__________________________________=0D=0A >>>>> Users mailing list=0D=0A >=
>>>> Users(a)ovirt.org <mailto:Users@ovirt.org>=20=0D=0A >>>>> http://lists=
=2Eovirt.org/mailman/listinfo/users <http://lists.ovirt.org/mailman/listi=
nfo/users>=20=0D=0A >>>>=0D=0A >>>>=0D=0A >>>=0D=0A >>> _________________=
______________________________=0D=0A >>> Users mailing list=0D=0A >>> Use=
rs(a)ovirt.org <mailto:Users@ovirt.org>=20=0D=0A >>> http://lists.ovirt.org=
/mailman/listinfo/users <http://lists.ovirt.org/mailman/listinfo/users>=20=
=0D=0A >>>=0D=0A >>=0D=0A=0D=0A=0D=0A____________________________________=
___________=0D=0A=0AUsers mailing list=0D=0A=0AUsers(a)ovirt.org=0D=0A=0Aht=
tp://lists.ovirt.org/mailman/listinfo/users=0D=0A=0A=0D=0A=0D=0A
--=_sRsL4clZsKi75Xw63uWLRBEzj1CUCAu8aTrk6zNwHYSPe0Ty
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://ww=
w.w3.org/TR/html4/loose.dtd"><html>=0A<head>=0A <meta name=3D"Generator"=
content=3D"Zarafa WebApp v7.2.4-28">=0A <meta http-equiv=3D"Content-Typ=
e" content=3D"text/html; charset=3Dutf-8">=0A <title>AW: [ovirt-users] P=
roblem starting VMs</title>=0A</head>=0A<body>=0A<p style=3D"padding: 0; =
margin: 0;"><span style=3D"font-size: 12pt; font-family: tahoma,arial,hel=
vetica,sans-serif;">Hello<br /></span></p>=0A<p style=3D"padding: 0; marg=
in: 0;"><span style=3D"font-size: 12pt; font-family: tahoma,arial,helveti=
ca,sans-serif;"><br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"><=
span style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-s=
erif;">using the kernel-lt from elrepo solves all problems!!<br /></span>=
</p>=0A<p style=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt=
; font-family: tahoma,arial,helvetica,sans-serif;">Maybe it is a problem =
with the current kernel from centos =3F=3F<br /></span></p>=0A<p style=3D=
"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; font-family: tah=
oma,arial,helvetica,sans-serif;"><br /></span></p>=0A<p style=3D"padding:=
0; margin: 0;"><span style=3D"font-size: 12pt; font-family: tahoma,arial=
,helvetica,sans-serif;">Thanks <br /></span></p>=0A<p style=3D"padding: 0=
; margin: 0;"><span style=3D"font-size: 12pt; font-family: tahoma,arial,h=
elvetica,sans-serif;"><br /></span></p>=0A<p style=3D"padding: 0; margin:=
0;"><span style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,=
sans-serif;">Wolfgang<br /></span></p>=0A<p style=3D"padding: 0; margin: =
0;"><span style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,s=
ans-serif;"><br /></span></p>=0A<blockquote style=3D"border-left: 2px sol=
id #325FBA; padding-left: 5px; margin: 0px 5px;"><span style=3D"font-fami=
ly: tahoma,arial,helvetica,sans-serif; font-size: 10pt;">-----Ursprü=
ngliche Nachricht-----<br /><span><strong>Von:</strong> Wolfgang Bucher&n=
bsp;<wolfgang.bucher(a)netland-mn.de></span><br /><span><strong>Gesen=
det:</strong> Die 23 August 2016 20:14</span><br /><span><strong>An:</str=
ong> Yaniv Kaul <ykaul(a)redhat.com></span><br /><span><strong>CC:</s=
trong> users(a)ovirt.org (users(a)ovirt.org) <users(a)ovirt.org></span><b=
r /><span><strong>Betreff:</strong> Re: [ovirt-users] Problem starting VM=
s</span><br /><br /></span><!-- begin sanitized html -->=0A<div class=3D"=
bodyclass">=0A<p style=3D"padding: 0; margin: 0;"><span style=3D"font-siz=
e: 12pt; font-family: tahoma,arial,helvetica,sans-serif;">Hello<br /></sp=
an></p>=0A<p style=3D"padding: 0; margin: 0;"><span style=3D"font-size: 1=
2pt; font-family: tahoma,arial,helvetica,sans-serif;"><br /></span></p>=0A=
<p style=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; font-=
family: tahoma,arial,helvetica,sans-serif;">i just changed xfs to ext4 an=
d defragmantion is much better then before, i will also try kernel lts fr=
om elrepo and test it again.<br /></span></p>=0A<p style=3D"padding: 0; m=
argin: 0;"><span style=3D"font-size: 12pt; font-family: tahoma,arial,helv=
etica,sans-serif;"><br /></span></p>=0A<p style=3D"padding: 0; margin: 0;=
"><span style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,san=
s-serif;">Thanks<br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"><=
span style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-s=
erif;"><br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"><span styl=
e=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-serif;">Wo=
lfgang<br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"><span style=
=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-serif;"><br=
/></span></p>=0A<blockquote style=3D"border-left: 2px solid #325FBA; pad=
ding-left: 5px; margin: 0px 5px;"><span style=3D"font-family: tahoma,aria=
l,helvetica,sans-serif; font-size: 10pt;">-----Ursprüngliche Nachric=
ht-----<br /><span><strong>Von:</strong> Yaniv Kaul <ykaul@redhat=
=2Ecom></span><br /><span><strong>Gesendet:</strong> Die 23 August 201=
6 19:46</span><br /><span><strong>An:</strong> Wolfgang Bucher <wolfga=
ng.bucher(a)netland-mn.de></span><br /><span><strong>CC:</strong> Charle=
s Gruener <cgruener(a)gruener.us></span><br /><span><strong>Betreff:<=
/strong> Re: AW: [ovirt-users] Problem starting VMs</span><br /><br /></s=
pan>=0A<p></p>=0A<p>On Aug 23, 2016 7:33 PM, "Wolfgang Bucher" <<a hre=
f=3D"mailto:wolfgang.bucher@netland-mn.de" target=3D"_blank" title=3D"Der=
externe Link wird in einem neuen Fenster geöffnet">wolfgang.bucher@=
netland-mn.de</a>> wrote:<br /> ><br /> > Hello<br /> ><br />=
><br /> > I am using local storage with adaptec raid controller, d=
isk format is raw</p>=0A<p>Raw is always raw-sparse, so that may explain =
this somehow, yet still odd that Windows installation would cause so much=
fragmentation.<br /> I wonder if using the discard hook (and IDE or virt=
io-scsi) would help - or perhaps using a qcow2 makes more sense (create a=
snapshot right after disk creation for example).</p>=0A<p>><br /> >=
;<br /> > image: e4d797d1-5719-48d0-891e-a36cd4a79c33<br /> > file =
format: raw<br /> > virtual size: 50G (53687091200 bytes)<br /> > d=
isk size: 8.5G<br /> ><br /> ><br /> > this is a fresh installat=
ion of W2012 after installation i got with xfs_db -c frag -r /dev/s=
db1:<br /> ><br /> > aktuell 407974, ideal 35, Unterteilungsfaktor =
99,99%</p>=0A<p>And the XFS formatted with default parameters=3F<br /> Y.=
</p>=0A<p>><br /> ><br /> > Thanks<br /> ><br /> ><br /> &=
gt; Wolfgang<br /> ><br /> ><br /> >> -----Ursprüngliche=
Nachricht-----<br /> >> Von: Yaniv Kaul <<a href=3D"mailto=
:ykaul@redhat.com" target=3D"_blank" title=3D"Der externe Link wird in ei=
nem neuen Fenster geöffnet">ykaul(a)redhat.com</a>><br /> >> =
Gesendet: Die 23 August 2016 17:56<br /> >> An: Wolfgang Bucher <=
;<a href=3D"mailto:wolfgang.bucher@netland-mn.de" target=3D"_blank" title=
=3D"Der externe Link wird in einem neuen Fenster geöffnet">wolfgang.=
bucher(a)netland-mn.de</a>><br /> >> CC: Michal Skrivanek <<a h=
ref=3D"mailto:michal.skrivanek@redhat.com" target=3D"_blank" title=3D"Der=
externe Link wird in einem neuen Fenster geöffnet">michal.skrivanek=
@redhat.com</a>>; <a href=3D"mailto:users@ovirt.org" target=3D"_blank"=
title=3D"Der externe Link wird in einem neuen Fenster geöffnet">use=
rs(a)ovirt.org</a> (<a href=3D"mailto:users@ovirt.org" target=3D"_blank" ti=
tle=3D"Der externe Link wird in einem neuen Fenster geöffnet">users@=
ovirt.org</a>) <<a href=3D"mailto:users@ovirt.org" target=3D"_blank" t=
itle=3D"Der externe Link wird in einem neuen Fenster geöffnet">users=
@ovirt.org</a>><br /> >><br /> >> Betreff: Re: [ovirt-user=
s] Problem starting VMs<br /> >><br /> >><br /> >><br /=
> >> On Tue, Aug 23, 2016 at 6:40 PM, Wolfgang Bucher <<a href=3D=
"mailto:wolfgang.bucher@netland-mn.de" target=3D"_blank" title=3D"Der ext=
erne Link wird in einem neuen Fenster geöffnet">wolfgang.bucher@netl=
and-mn.de</a>> wrote:<br /> >>><br /> >>> Hello<br /=
> >>><br /> >>><br /> >>> in var log messages =
i get following :<br /> >>><br /> >>><br /> >>>=
; kernel: XFS: possible memory allocation deadlock in kmem_alloc (mode:0x=
250)<br /> >>><br /> >>><br /> >>> I have this=
problem on 4 different hosts.<br /> >>><br /> >>><br /=
> >>> This happens during copying files from network to a thin p=
rovisioned disk, no problems with preallocated disks.<br /> >><br /=
> >><br /> >> What kind of storage are you using=3F local sto=
rage=3F Even though, it makes little sense to me - the disk is a qcow2 di=
sk, which shouldn't be very fragmented as you might think (qcow2 grows in=
64K chunks).<br /> >> It may grow and grow and grow (until you spa=
rsify it), but that's not going to cause fragmentation. What causes it to=
be fragmented=3F Perhaps the internal qcow2 mapping is quite fragmented=3F=
<br /> >> Y.<br /> >> <br /> >>><br /> >>=
;><br /> >>> Thanks<br /> >>><br /> >>> Wol=
fgang<br /> >>><br /> >>><br /> >>>> -----U=
rsprüngliche Nachricht-----<br /> >>>> Von: Michal Skriv=
anek <<a href=3D"mailto:michal.skrivanek@redhat.com" target=3D"_b=
lank" title=3D"Der externe Link wird in einem neuen Fenster geöffnet=
">michal.skrivanek(a)redhat.com</a>><br /> >>>> Gesendet: Di=
e 23 August 2016 17:11<br /> >>>> An: Wolfgang Bucher <<a =
href=3D"mailto:wolfgang.bucher@netland-mn.de" target=3D"_blank" title=3D"=
Der externe Link wird in einem neuen Fenster geöffnet">wolfgang.buch=
er(a)netland-mn.de</a>><br /> >>>> CC: Milan Zamazal <<a =
href=3D"mailto:mzamazal@redhat.com" target=3D"_blank" title=3D"Der extern=
e Link wird in einem neuen Fenster geöffnet">mzamazal(a)redhat.com</a>=
>; <a href=3D"mailto:users@ovirt.org" target=3D"_blank" title=3D"Der e=
xterne Link wird in einem neuen Fenster geöffnet">users(a)ovirt.org</a=
> (<a href=3D"mailto:users@ovirt.org" target=3D"_blank" title=3D"Der exte=
rne Link wird in einem neuen Fenster geöffnet">users(a)ovirt.org</a>) =
<<a href=3D"mailto:users@ovirt.org" target=3D"_blank" title=3D"Der ext=
erne Link wird in einem neuen Fenster geöffnet">users(a)ovirt.org</a>&=
gt;<br /> >>>> Betreff: Re: [ovirt-users] Problem starting VM=
s<br /> >>>><br /> >>>><br /> >>>>>=
; On 23 Aug 2016, at 11:06, Wolfgang Bucher <<a href=3D"mailto:wolfgan=
g.bucher(a)netland-mn.de" target=3D"_blank" title=3D"Der externe Link wird =
in einem neuen Fenster geöffnet">wolfgang.bucher(a)netland-mn.de</a>&g=
t; wrote:<br /> >>>>><br /> >>>>> Thank's<b=
r /> >>>>><br /> >>>>> but what do you mean=
with "initialization is finished”<br /> >>>><br /> >=
;>>><br /> >>>> until it gets from WaitForLaunch to =
PoweringUp state, effectively until the qemu process properly starts up<b=
r /> >>>><br /> >>>>><br /> >>>>&g=
t; sometimes the vm crashes while copying files!<br /> >>>><b=
r /> >>>><br /> >>>> when exactly=3F Can you desc=
ribe exactly what you are doing and what is reported as a reason for cras=
h. When exactly does it crash and how=3F<br /> >>>><br /> >=
;>>> Thanks,<br /> >>>> michal<br /> >>>>=
;<br /> >>>>><br /> >>>>><br /> >>>=
;>><br /> >>>>> Wolfgang<br /> >>>>><=
br /> >>>>><br /> >>>>>> -----Ursprü=
;ngliche Nachricht-----<br /> >>>>>> Von: Milan Zamazal=
<<a href=3D"mailto:mzamazal@redhat.com" target=3D"_blank" title=3D=
"Der externe Link wird in einem neuen Fenster geöffnet">mzamazal@red=
hat.com</a>><br /> >>>>>> Gesendet: Die 23 August 20=
16 16:59<br /> >>>>>> An: Wolfgang Bucher <<a href=3D=
"mailto:wolfgang.bucher@netland-mn.de" target=3D"_blank" title=3D"Der ext=
erne Link wird in einem neuen Fenster geöffnet">wolfgang.bucher@netl=
and-mn.de</a>><br /> >>>>>> CC: <a href=3D"mailto:us=
ers(a)ovirt.org" target=3D"_blank" title=3D"Der externe Link wird in einem =
neuen Fenster geöffnet">users(a)ovirt.org</a> (<a href=3D"mailto:users=
@ovirt.org" target=3D"_blank" title=3D"Der externe Link wird in einem neu=
en Fenster geöffnet">users(a)ovirt.org</a>) <<a href=3D"mailto:user=
s(a)ovirt.org" target=3D"_blank" title=3D"Der externe Link wird in einem ne=
uen Fenster geöffnet">users(a)ovirt.org</a>><br /> >>>>=
>> Betreff: Re: AW: Problem starting VMs<br /> >>>>>=
><br /> >>>>>> Wolfgang Bucher <<a href=3D"mailto=
:wolfgang.bucher@netland-mn.de" target=3D"_blank" title=3D"Der externe Li=
nk wird in einem neuen Fenster geöffnet">wolfgang.bucher(a)netland-mn.=
de</a>> writes:<br /> >>>>>><br /> >>>>&=
gt;> > the problem is "waiting for launch" takes up to 20 min.<br /=
> >>>>>> ><br /> >>>>>> ><br />=
>>>>>> > I did a lot of tests with some vm's and th=
problem is:<br /> >>>>>> ><br /> >>>>&g=
t;> ><br /> >>>>>> > 1. create a win2012=
server<br /> >>>>>> ><br /> >>>>>>=
; > 2. attache a new disk (thin provision)<br /> >>>>>&=
gt; ><br /> >>>>>> > 3. fill the disk from networ=
k share with about 100G<br /> >>>>>> ><br /> >>=
;>>>> > 4. shutdown the vm<br /> >>>>>> =
><br /> >>>>>> > 5. reboot host and try starting =
the vm (takes a lot of time until launch)<br /> >>>>>> =
><br /> >>>>>> ><br /> >>>>>> &=
gt;<br /> >>>>>> > It's because of a high fragmented=
filessystem <br /> >>>>>><br /> >>>>>&g=
t; I see, thank you for the explanation. In such a case, it may take a lo=
t<br /> >>>>>> of time before all the initialization is=
finished.<br /> >>>>>><br /> >>>>>> =
Regards,<br /> >>>>>> Milan<br /> >>>>><=
br /> >>>>> ______________________________________________=
_<br /> >>>>> Users mailing list<br /> >>>>>=
; <a href=3D"mailto:Users@ovirt.org" target=3D"_blank" title=3D"Der exter=
ne Link wird in einem neuen Fenster geöffnet">Users(a)ovirt.org</a><br=
/> >>>>> <a href=3D"http://lists.ovirt.org/mailman/listin=
fo/users" target=3D"_blank" title=3D"Der externe Link wird in einem neuen=
Fenster geöffnet">http://lists.ovirt.org/mailman/listinfo/users</a>=
<br /> >>>><br /> >>>><br /> >>><br /> &=
gt;>> _______________________________________________<br /> >>=
;> Users mailing list<br /> >>> <a href=3D"mailto:Users@ovirt=
=2Eorg" target=3D"_blank" title=3D"Der externe Link wird in einem neuen F=
enster geöffnet">Users(a)ovirt.org</a><br /> >>> <a href=3D"h=
ttp://lists.ovirt.org/mailman/listinfo/users" target=3D"_blank" title=3D"=
Der externe Link wird in einem neuen Fenster geöffnet">http://lists.=
ovirt.org/mailman/listinfo/users</a><br /> >>><br /> >></p=
>=0A</blockquote>=0A</div>=0A<pre>_______________________________________=
________<br />=0AUsers mailing list<br />=0AUsers(a)ovirt.org<br />=0Ahttp:=
//lists.ovirt.org/mailman/listinfo/users<br />=0A</pre>=0A<!-- end saniti=
zed html --></blockquote>=0A</body>=0A</html>
--=_sRsL4clZsKi75Xw63uWLRBEzj1CUCAu8aTrk6zNwHYSPe0Ty--
8 years, 3 months
Re: [ovirt-users] Problem starting VMs
by Wolfgang Bucher
This is a multi-part message in MIME format. Your mail reader does not
understand MIME message format.
--=_-89LOhi9uxXuidix+NtQpnNUfCRH9Jb8wmXVxJhh7R72h1cm
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hello=0D=0A=0D=0A=0D=0A=0D=0Ai just changed xfs to ext4 and defragmantion=
is much better then before, i will also try kernel lts from elrepo and t=
est it again.=0D=0A=0D=0A=0D=0A=0D=0AThanks=0D=0A=0D=0A=0D=0A=0D=0AWolfga=
ng=0D=0A=0D=0A=0D=0A=0D=0A-----Urspr=C3=BCngliche Nachricht-----=0D=0AVon=
: Yaniv Kaul=C2=A0<ykaul(a)redhat.com>=0D=0AGesendet: Die 23 August 2016 19=
:46=0D=0AAn: Wolfgang Bucher <wolfgang.bucher(a)netland-mn.de>=0D=0ACC: Cha=
rles Gruener <cgruener(a)gruener.us>=0D=0ABetreff: Re: AW: [ovirt-users] Pr=
oblem starting VMs=0D=0A=0D=0A=0D=0AOn Aug 23, 2016 7:33 PM, "Wolfgang Bu=
cher" <wolfgang.bucher(a)netland-mn.de <mailto:wolfgang.bucher@netland-mn.d=
e> > wrote:=0D=0A >=0D=0A > Hello=0D=0A >=0D=0A >=0D=0A > I am using loca=
l storage with adaptec raid controller, disk format is raw=0D=0A=0D=0ARaw=
is always raw-sparse, so that may explain this somehow, yet still odd th=
at Windows installation would cause so much fragmentation.=0D=0A I wonder=
if using the discard hook (and IDE or virtio-scsi) would help - or perha=
ps using a qcow2 makes more sense (create a snapshot right after disk cre=
ation for example).=0D=0A=0D=0A>=0D=0A >=0D=0A > image: e4d797d1-5719-48d=
0-891e-a36cd4a79c33=0D=0A > file format: raw=0D=0A > virtual size: 50G (5=
3687091200 bytes)=0D=0A > disk size: 8.5G=0D=0A >=0D=0A >=0D=0A > this is=
a fresh installation of W2012 after installation i got with xfs_db -c fr=
ag -r=C2=A0 /dev/sdb1:=0D=0A >=0D=0A > aktuell 407974, ideal 35, Untertei=
lungsfaktor 99,99%=0D=0A=0D=0AAnd the XFS formatted with default paramete=
rs=3F=0D=0A Y.=0D=0A=0D=0A>=0D=0A >=0D=0A > Thanks=0D=0A >=0D=0A >=0D=0A =
> Wolfgang=0D=0A >=0D=0A >=0D=0A >> -----Urspr=C3=BCngliche Nachricht----=
-=0D=0A >> Von: Yaniv Kaul=C2=A0<ykaul(a)redhat.com <mailto:ykaul@redhat.co=
m> >=0D=0A >> Gesendet: Die 23 August 2016 17:56=0D=0A >> An: Wolfgang Bu=
cher <wolfgang.bucher(a)netland-mn.de <mailto:wolfgang.bucher@netland-mn.de=
> >=0D=0A >> CC: Michal Skrivanek <michal.skrivanek(a)redhat.com <mailto:mi=
chal.skrivanek(a)redhat.com> >; users(a)ovirt.org <mailto:users@ovirt.org> (u=
sers(a)ovirt.org <mailto:users@ovirt.org> ) <users(a)ovirt.org <mailto:users@=
ovirt.org> >=0D=0A >>=0D=0A >> Betreff: Re: [ovirt-users] Problem startin=
g VMs=0D=0A >>=0D=0A >>=0D=0A >>=0D=0A >> On Tue, Aug 23, 2016 at 6:40 PM=
, Wolfgang Bucher <wolfgang.bucher(a)netland-mn.de <mailto:wolfgang.bucher@=
netland-mn.de> > wrote:=0D=0A >>>=0D=0A >>> Hello=0D=0A >>>=0D=0A >>>=0D=0A=
>>> in var log messages i get following :=0D=0A >>>=0D=0A >>>=0D=0A >>> =
kernel: XFS: possible memory allocation deadlock in kmem_alloc (mode:0x25=
0)=0D=0A >>>=0D=0A >>>=0D=0A >>> I have this problem on 4 different hosts=
=2E=0D=0A >>>=0D=0A >>>=0D=0A >>> This happens during copying files from =
network to a thin provisioned disk, no problems with preallocated disks.=0D=
=0A >>=0D=0A >>=0D=0A >> What kind of storage are you using=3F local stor=
age=3F Even though, it makes little sense to me - the disk is a qcow2 dis=
k, which shouldn't be very fragmented as you might think (qcow2 grows in =
64K chunks).=0D=0A >> It may grow and grow and grow (until you sparsify i=
t), but that's not going to cause fragmentation. What causes it to be fra=
gmented=3F Perhaps the internal qcow2 mapping is quite fragmented=3F=0D=0A=
>> Y.=0D=0A >> =C2=A0=0D=0A >>>=0D=0A >>>=0D=0A >>> Thanks=0D=0A >>>=0D=0A=
>>> Wolfgang=0D=0A >>>=0D=0A >>>=0D=0A >>>> -----Urspr=C3=BCngliche Nach=
richt-----=0D=0A >>>> Von: Michal Skrivanek=C2=A0<michal.skrivanek@redhat=
=2Ecom <mailto:michal.skrivanek@redhat.com> >=0D=0A >>>> Gesendet: Die 23=
August 2016 17:11=0D=0A >>>> An: Wolfgang Bucher <wolfgang.bucher@netlan=
d-mn.de <mailto:wolfgang.bucher@netland-mn.de> >=0D=0A >>>> CC: Milan Zam=
azal <mzamazal(a)redhat.com <mailto:mzamazal@redhat.com> >; users(a)ovirt.org=
<mailto:users@ovirt.org> (users(a)ovirt.org <mailto:users@ovirt.org> ) <us=
ers(a)ovirt.org <mailto:users@ovirt.org> >=0D=0A >>>> Betreff: Re: [ovirt-u=
sers] Problem starting VMs=0D=0A >>>>=0D=0A >>>>=0D=0A >>>>> On 23 Aug 20=
16, at 11:06, Wolfgang Bucher <wolfgang.bucher(a)netland-mn.de <mailto:wolf=
gang.bucher(a)netland-mn.de> > wrote:=0D=0A >>>>>=0D=0A >>>>> Thank's=0D=0A=
>>>>>=0D=0A >>>>> but what do you mean with "initialization is finished=E2=
=80=9D=0D=0A >>>>=0D=0A >>>>=0D=0A >>>> until it gets from WaitForLaunch =
to PoweringUp state, effectively until the qemu process properly starts u=
p=0D=0A >>>>=0D=0A >>>>>=0D=0A >>>>> sometimes the vm crashes while copyi=
ng files!=0D=0A >>>>=0D=0A >>>>=0D=0A >>>> when exactly=3F Can you descri=
be exactly what you are doing and what is reported as a reason for crash.=
When exactly does it crash and how=3F=0D=0A >>>>=0D=0A >>>> Thanks,=0D=0A=
>>>> michal=0D=0A >>>>=0D=0A >>>>>=0D=0A >>>>>=0D=0A >>>>>=0D=0A >>>>> W=
olfgang=0D=0A >>>>>=0D=0A >>>>>=0D=0A >>>>>> -----Urspr=C3=BCngliche Nach=
richt-----=0D=0A >>>>>> Von: Milan Zamazal=C2=A0<mzamazal(a)redhat.com <mai=
lto:mzamazal@redhat.com> >=0D=0A >>>>>> Gesendet: Die 23 August 2016 16:5=
9=0D=0A >>>>>> An: Wolfgang Bucher <wolfgang.bucher(a)netland-mn.de <mailto=
:wolfgang.bucher@netland-mn.de> >=0D=0A >>>>>> CC: users(a)ovirt.org <mailt=
o:users@ovirt.org> (users(a)ovirt.org <mailto:users@ovirt.org> ) <users@ovi=
rt.org <mailto:users@ovirt.org> >=0D=0A >>>>>> Betreff: Re: AW: Problem s=
tarting VMs=0D=0A >>>>>>=0D=0A >>>>>> Wolfgang Bucher <wolfgang.bucher@ne=
tland-mn.de <mailto:wolfgang.bucher@netland-mn.de> > writes:=0D=0A >>>>>>=
=0D=0A >>>>>> > the problem is "waiting for launch" takes up to 20 min.=0D=
=0A >>>>>> >=0D=0A >>>>>> >=0D=0A >>>>>> > I did a lot of tests with some=
vm's and th problem is:=0D=0A >>>>>> >=0D=0A >>>>>> >=0D=0A >>>>>> > 1.=C2=
=A0 create a win2012 server=0D=0A >>>>>> >=0D=0A >>>>>> > 2. attache a ne=
w disk (thin provision)=0D=0A >>>>>> >=0D=0A >>>>>> > 3. fill the disk fr=
om network share with about 100G=0D=0A >>>>>> >=0D=0A >>>>>> > 4. shutdow=
n the vm=0D=0A >>>>>> >=0D=0A >>>>>> > 5. reboot host and try starting th=
e vm (takes a lot of time until launch)=0D=0A >>>>>> >=0D=0A >>>>>> >=0D=0A=
>>>>>> >=0D=0A >>>>>> > It's because of a high fragmented filessystem=20=
=0D=0A >>>>>>=0D=0A >>>>>> I see, thank you for the explanation. In such =
a case, it may take a lot=0D=0A >>>>>> of time before all the initializat=
ion is finished.=0D=0A >>>>>>=0D=0A >>>>>> Regards,=0D=0A >>>>>> Milan=0D=
=0A >>>>>=0D=0A >>>>> _______________________________________________=0D=0A=
>>>>> Users mailing list=0D=0A >>>>> Users(a)ovirt.org <mailto:Users@ovirt=
=2Eorg>=20=0D=0A >>>>> http://lists.ovirt.org/mailman/listinfo/users <htt=
p://lists.ovirt.org/mailman/listinfo/users>=20=0D=0A >>>>=0D=0A >>>>=0D=0A=
>>>=0D=0A >>> _______________________________________________=0D=0A >>> =
Users mailing list=0D=0A >>> Users(a)ovirt.org <mailto:Users@ovirt.org>=20=0D=
=0A >>> http://lists.ovirt.org/mailman/listinfo/users <http://lists.ovirt=
=2Eorg/mailman/listinfo/users>=20=0D=0A >>>=0D=0A >>=0D=0A=0D=0A
--=_-89LOhi9uxXuidix+NtQpnNUfCRH9Jb8wmXVxJhh7R72h1cm
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://ww=
w.w3.org/TR/html4/loose.dtd"><html>=0A<head>=0A <meta name=3D"Generator"=
content=3D"Zarafa WebApp v7.2.4-28">=0A <meta http-equiv=3D"Content-Typ=
e" content=3D"text/html; charset=3Dutf-8">=0A <title>AW: AW: [ovirt-user=
s] Problem starting VMs</title>=0A</head>=0A<body>=0A<p style=3D"padding:=
0; margin: 0;"><span style=3D"font-size: 12pt; font-family: tahoma,arial=
,helvetica,sans-serif;">Hello<br /></span></p>=0A<p style=3D"padding: 0; =
margin: 0;"><span style=3D"font-size: 12pt; font-family: tahoma,arial,hel=
vetica,sans-serif;"><br /></span></p>=0A<p style=3D"padding: 0; margin: 0=
;"><span style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sa=
ns-serif;">i just changed xfs to ext4 and defragmantion is much better th=
en before, i will also try kernel lts from elrepo and test it again.<br /=
></span></p>=0A<p style=3D"padding: 0; margin: 0;"><span style=3D"font-si=
ze: 12pt; font-family: tahoma,arial,helvetica,sans-serif;"><br /></span><=
/p>=0A<p style=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt;=
font-family: tahoma,arial,helvetica,sans-serif;">Thanks<br /></span></p>=
=0A<p style=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; fo=
nt-family: tahoma,arial,helvetica,sans-serif;"><br /></span></p>=0A<p sty=
le=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; font-family=
: tahoma,arial,helvetica,sans-serif;">Wolfgang<br /></span></p>=0A<p styl=
e=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; font-family:=
tahoma,arial,helvetica,sans-serif;"><br /></span></p>=0A<blockquote styl=
e=3D"border-left: 2px solid #325FBA; padding-left: 5px; margin: 0px 5px;"=
><span style=3D"font-family: tahoma,arial,helvetica,sans-serif; font-size=
: 10pt;">-----Ursprüngliche Nachricht-----<br /><span><strong>Von:</=
strong> Yaniv Kaul <ykaul(a)redhat.com></span><br /><span><stron=
g>Gesendet:</strong> Die 23 August 2016 19:46</span><br /><span><strong>A=
n:</strong> Wolfgang Bucher <wolfgang.bucher(a)netland-mn.de></span><=
br /><span><strong>CC:</strong> Charles Gruener <cgruener(a)gruener.us&g=
t;</span><br /><span><strong>Betreff:</strong> Re: AW: [ovirt-users] Prob=
lem starting VMs</span><br /><br /></span><!-- begin sanitized html -->=0A=
<p></p>=0A<p>On Aug 23, 2016 7:33 PM, "Wolfgang Bucher" <<a href=3D"ma=
ilto:wolfgang.bucher@netland-mn.de" target=3D"_blank" title=3D"Der extern=
e Link wird in einem neuen Fenster geöffnet">wolfgang.bucher@netland=
-mn.de</a>> wrote:<br /> ><br /> > Hello<br /> ><br /> ><b=
r /> > I am using local storage with adaptec raid controller, disk for=
mat is raw</p>=0A<p>Raw is always raw-sparse, so that may explain this so=
mehow, yet still odd that Windows installation would cause so much fragme=
ntation.<br /> I wonder if using the discard hook (and IDE or virtio-scsi=
) would help - or perhaps using a qcow2 makes more sense (create a snapsh=
ot right after disk creation for example).</p>=0A<p>><br /> ><br />=
> image: e4d797d1-5719-48d0-891e-a36cd4a79c33<br /> > file format:=
raw<br /> > virtual size: 50G (53687091200 bytes)<br /> > disk siz=
e: 8.5G<br /> ><br /> ><br /> > this is a fresh installation of =
W2012 after installation i got with xfs_db -c frag -r /dev/sdb1:<br=
/> ><br /> > aktuell 407974, ideal 35, Unterteilungsfaktor 99,99%<=
/p>=0A<p>And the XFS formatted with default parameters=3F<br /> Y.</p>=0A=
<p>><br /> ><br /> > Thanks<br /> ><br /> ><br /> > Wol=
fgang<br /> ><br /> ><br /> >> -----Ursprüngliche Nachri=
cht-----<br /> >> Von: Yaniv Kaul <<a href=3D"mailto:ykaul@=
redhat.com" target=3D"_blank" title=3D"Der externe Link wird in einem neu=
en Fenster geöffnet">ykaul(a)redhat.com</a>><br /> >> Gesende=
t: Die 23 August 2016 17:56<br /> >> An: Wolfgang Bucher <<a hre=
f=3D"mailto:wolfgang.bucher@netland-mn.de" target=3D"_blank" title=3D"Der=
externe Link wird in einem neuen Fenster geöffnet">wolfgang.bucher@=
netland-mn.de</a>><br /> >> CC: Michal Skrivanek <<a href=3D"=
mailto:michal.skrivanek@redhat.com" target=3D"_blank" title=3D"Der extern=
e Link wird in einem neuen Fenster geöffnet">michal.skrivanek@redhat=
=2Ecom</a>>; <a href=3D"mailto:users@ovirt.org" target=3D"_blank" titl=
e=3D"Der externe Link wird in einem neuen Fenster geöffnet">users@ov=
irt.org</a> (<a href=3D"mailto:users@ovirt.org" target=3D"_blank" title=3D=
"Der externe Link wird in einem neuen Fenster geöffnet">users(a)ovirt.=
org</a>) <<a href=3D"mailto:users@ovirt.org" target=3D"_blank" title=3D=
"Der externe Link wird in einem neuen Fenster geöffnet">users(a)ovirt.=
org</a>><br /> >><br /> >> Betreff: Re: [ovirt-users] Prob=
lem starting VMs<br /> >><br /> >><br /> >><br /> >&=
gt; On Tue, Aug 23, 2016 at 6:40 PM, Wolfgang Bucher <<a href=3D"mailt=
o:wolfgang.bucher@netland-mn.de" target=3D"_blank" title=3D"Der externe L=
ink wird in einem neuen Fenster geöffnet">wolfgang.bucher@netland-mn=
=2Ede</a>> wrote:<br /> >>><br /> >>> Hello<br /> &g=
t;>><br /> >>><br /> >>> in var log messages i ge=
t following :<br /> >>><br /> >>><br /> >>> ke=
rnel: XFS: possible memory allocation deadlock in kmem_alloc (mode:0x250)=
<br /> >>><br /> >>><br /> >>> I have this pro=
blem on 4 different hosts.<br /> >>><br /> >>><br /> &g=
t;>> This happens during copying files from network to a thin provi=
sioned disk, no problems with preallocated disks.<br /> >><br /> &g=
t;><br /> >> What kind of storage are you using=3F local storage=
=3F Even though, it makes little sense to me - the disk is a qcow2 disk, =
which shouldn't be very fragmented as you might think (qcow2 grows in 64K=
chunks).<br /> >> It may grow and grow and grow (until you sparsif=
y it), but that's not going to cause fragmentation. What causes it to be =
fragmented=3F Perhaps the internal qcow2 mapping is quite fragmented=3F<b=
r /> >> Y.<br /> >> <br /> >>><br /> >>&=
gt;<br /> >>> Thanks<br /> >>><br /> >>> Wolfg=
ang<br /> >>><br /> >>><br /> >>>> -----Urs=
prüngliche Nachricht-----<br /> >>>> Von: Michal Skrivan=
ek <<a href=3D"mailto:michal.skrivanek@redhat.com" target=3D"_bla=
nk" title=3D"Der externe Link wird in einem neuen Fenster geöffnet">=
michal.skrivanek(a)redhat.com</a>><br /> >>>> Gesendet: Die =
23 August 2016 17:11<br /> >>>> An: Wolfgang Bucher <<a hr=
ef=3D"mailto:wolfgang.bucher@netland-mn.de" target=3D"_blank" title=3D"De=
r externe Link wird in einem neuen Fenster geöffnet">wolfgang.bucher=
@netland-mn.de</a>><br /> >>>> CC: Milan Zamazal <<a hr=
ef=3D"mailto:mzamazal@redhat.com" target=3D"_blank" title=3D"Der externe =
Link wird in einem neuen Fenster geöffnet">mzamazal(a)redhat.com</a>&g=
t;; <a href=3D"mailto:users@ovirt.org" target=3D"_blank" title=3D"Der ext=
erne Link wird in einem neuen Fenster geöffnet">users(a)ovirt.org</a> =
(<a href=3D"mailto:users@ovirt.org" target=3D"_blank" title=3D"Der extern=
e Link wird in einem neuen Fenster geöffnet">users(a)ovirt.org</a>) &l=
t;<a href=3D"mailto:users@ovirt.org" target=3D"_blank" title=3D"Der exter=
ne Link wird in einem neuen Fenster geöffnet">users(a)ovirt.org</a>>=
;<br /> >>>> Betreff: Re: [ovirt-users] Problem starting VMs<=
br /> >>>><br /> >>>><br /> >>>>> =
On 23 Aug 2016, at 11:06, Wolfgang Bucher <<a href=3D"mailto:wolfgang.=
bucher(a)netland-mn.de" target=3D"_blank" title=3D"Der externe Link wird in=
einem neuen Fenster geöffnet">wolfgang.bucher(a)netland-mn.de</a>>=
wrote:<br /> >>>>><br /> >>>>> Thank's<br =
/> >>>>><br /> >>>>> but what do you mean w=
ith "initialization is finished”<br /> >>>><br /> >&=
gt;>><br /> >>>> until it gets from WaitForLaunch to Po=
weringUp state, effectively until the qemu process properly starts up<br =
/> >>>><br /> >>>>><br /> >>>>>=
sometimes the vm crashes while copying files!<br /> >>>><br =
/> >>>><br /> >>>> when exactly=3F Can you descri=
be exactly what you are doing and what is reported as a reason for crash.=
When exactly does it crash and how=3F<br /> >>>><br /> >&=
gt;>> Thanks,<br /> >>>> michal<br /> >>>><=
br /> >>>>><br /> >>>>><br /> >>>&=
gt;><br /> >>>>> Wolfgang<br /> >>>>><br=
/> >>>>><br /> >>>>>> -----Ursprün=
gliche Nachricht-----<br /> >>>>>> Von: Milan Zamazal&n=
bsp;<<a href=3D"mailto:mzamazal@redhat.com" target=3D"_blank" title=3D=
"Der externe Link wird in einem neuen Fenster geöffnet">mzamazal@red=
hat.com</a>><br /> >>>>>> Gesendet: Die 23 August 20=
16 16:59<br /> >>>>>> An: Wolfgang Bucher <<a href=3D=
"mailto:wolfgang.bucher@netland-mn.de" target=3D"_blank" title=3D"Der ext=
erne Link wird in einem neuen Fenster geöffnet">wolfgang.bucher@netl=
and-mn.de</a>><br /> >>>>>> CC: <a href=3D"mailto:us=
ers(a)ovirt.org" target=3D"_blank" title=3D"Der externe Link wird in einem =
neuen Fenster geöffnet">users(a)ovirt.org</a> (<a href=3D"mailto:users=
@ovirt.org" target=3D"_blank" title=3D"Der externe Link wird in einem neu=
en Fenster geöffnet">users(a)ovirt.org</a>) <<a href=3D"mailto:user=
s(a)ovirt.org" target=3D"_blank" title=3D"Der externe Link wird in einem ne=
uen Fenster geöffnet">users(a)ovirt.org</a>><br /> >>>>=
>> Betreff: Re: AW: Problem starting VMs<br /> >>>>>=
><br /> >>>>>> Wolfgang Bucher <<a href=3D"mailto=
:wolfgang.bucher@netland-mn.de" target=3D"_blank" title=3D"Der externe Li=
nk wird in einem neuen Fenster geöffnet">wolfgang.bucher(a)netland-mn.=
de</a>> writes:<br /> >>>>>><br /> >>>>&=
gt;> > the problem is "waiting for launch" takes up to 20 min.<br /=
> >>>>>> ><br /> >>>>>> ><br />=
>>>>>> > I did a lot of tests with some vm's and th=
problem is:<br /> >>>>>> ><br /> >>>>&g=
t;> ><br /> >>>>>> > 1. create a win2012=
server<br /> >>>>>> ><br /> >>>>>>=
; > 2. attache a new disk (thin provision)<br /> >>>>>&=
gt; ><br /> >>>>>> > 3. fill the disk from networ=
k share with about 100G<br /> >>>>>> ><br /> >>=
;>>>> > 4. shutdown the vm<br /> >>>>>> =
><br /> >>>>>> > 5. reboot host and try starting =
the vm (takes a lot of time until launch)<br /> >>>>>> =
><br /> >>>>>> ><br /> >>>>>> &=
gt;<br /> >>>>>> > It's because of a high fragmented=
filessystem <br /> >>>>>><br /> >>>>>&g=
t; I see, thank you for the explanation. In such a case, it may take a lo=
t<br /> >>>>>> of time before all the initialization is=
finished.<br /> >>>>>><br /> >>>>>> =
Regards,<br /> >>>>>> Milan<br /> >>>>><=
br /> >>>>> ______________________________________________=
_<br /> >>>>> Users mailing list<br /> >>>>>=
; <a href=3D"mailto:Users@ovirt.org" target=3D"_blank" title=3D"Der exter=
ne Link wird in einem neuen Fenster geöffnet">Users(a)ovirt.org</a><br=
/> >>>>> <a href=3D"http://lists.ovirt.org/mailman/listin=
fo/users" target=3D"_blank" title=3D"Der externe Link wird in einem neuen=
Fenster geöffnet">http://lists.ovirt.org/mailman/listinfo/users</a>=
<br /> >>>><br /> >>>><br /> >>><br /> &=
gt;>> _______________________________________________<br /> >>=
;> Users mailing list<br /> >>> <a href=3D"mailto:Users@ovirt=
=2Eorg" target=3D"_blank" title=3D"Der externe Link wird in einem neuen F=
enster geöffnet">Users(a)ovirt.org</a><br /> >>> <a href=3D"h=
ttp://lists.ovirt.org/mailman/listinfo/users" target=3D"_blank" title=3D"=
Der externe Link wird in einem neuen Fenster geöffnet">http://lists.=
ovirt.org/mailman/listinfo/users</a><br /> >>><br /> >></p=
>=0A<!-- end sanitized html --></blockquote>=0A</body>=0A</html>
--=_-89LOhi9uxXuidix+NtQpnNUfCRH9Jb8wmXVxJhh7R72h1cm--
8 years, 3 months
Re: [ovirt-users] Problem starting VMs
by Wolfgang Bucher
This is a multi-part message in MIME format. Your mail reader does not
understand MIME message format.
--=_QV6LI6UZRcAokOAacyo2lZVUQloYIa8sREKAkSzjd-bHX7Yk
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hello=0D=0A=0D=0A=0D=0A=0D=0Ain var log messages i get following :=0D=0A=0D=
=0A=0D=0A=0D=0Akernel: XFS: possible memory allocation deadlock in kmem_a=
lloc (mode:0x250)=0D=0A=0D=0A=0D=0A=0D=0AI have this problem on 4 differe=
nt hosts.=0D=0A=0D=0A=0D=0A=0D=0AThis happens during copying files from n=
etwork to a thin provisioned disk, no problems with preallocated disks.=0D=
=0A=0D=0A=0D=0A=0D=0AThanks=0D=0A=0D=0AWolfgang=0D=0A=0D=0A=0D=0A=0D=0A--=
---Urspr=C3=BCngliche Nachricht-----=0D=0AVon: Michal Skrivanek=C2=A0<mic=
hal.skrivanek(a)redhat.com>=0D=0AGesendet: Die 23 August 2016 17:11=0D=0AAn=
: Wolfgang Bucher <wolfgang.bucher(a)netland-mn.de>=0D=0ACC: Milan Zamazal =
<mzamazal(a)redhat.com>; users(a)ovirt.org (users(a)ovirt.org) <users(a)ovirt.org=
>=0D=0ABetreff: Re: [ovirt-users] Problem starting VMs=0D=0A=0D=0A=0D=0AO=
n 23 Aug 2016, at 11:06, Wolfgang Bucher <wolfgang.bucher(a)netland-mn.de <=
mailto:wolfgang.bucher@netland-mn.de> > wrote:=0D=0A=0D=0AThank's=0D=0A=0D=
=0Abut what do you mean with "initialization is finished=E2=80=9D=0D=0A=0D=
=0Auntil it gets from WaitForLaunch to PoweringUp state, effectively unti=
l the qemu process properly starts up=0D=0A=0D=0A=0D=0Asometimes the vm c=
rashes while copying files!=0D=0A=0D=0Awhen exactly=3F Can you describe e=
xactly what you are doing and what is reported as a reason for crash. Whe=
n exactly does it crash and how=3F=0D=0A=0D=0AThanks,=0D=0Amichal=0D=0A=0D=
=0A=0D=0A=0D=0A=0D=0AWolfgang=0D=0A=0D=0A=0D=0A-----Urspr=C3=BCngliche Na=
chricht-----=0D=0AVon: Milan Zamazal=C2=A0<mzamazal(a)redhat.com <mailto:mz=
amazal(a)redhat.com> >=0D=0AGesendet: Die 23 August 2016 16:59=0D=0AAn: Wol=
fgang Bucher <wolfgang.bucher(a)netland-mn.de <mailto:wolfgang.bucher@netla=
nd-mn.de> >=0D=0ACC: users(a)ovirt.org <mailto:users@ovirt.org> (users@ovir=
t.org <mailto:users@ovirt.org> ) <users(a)ovirt.org <mailto:users@ovirt.org=
> >=0D=0ABetreff: Re: AW: Problem starting VMs=0D=0A=0D=0A=0D=0AWolfgang =
Bucher <wolfgang.bucher(a)netland-mn.de <mailto:wolfgang.bucher@netland-mn.=
de> > writes:=0D=0A=0D=0A> the problem is "waiting for launch" takes up t=
o 20 min.=0D=0A>=0D=0A>=0D=0A> I did a lot of tests with some vm's and th=
problem is:=0D=0A>=0D=0A>=0D=0A> 1.=C2=A0 create a win2012 server=0D=0A>=
=0D=0A> 2. attache a new disk (thin provision)=0D=0A>=0D=0A> 3. fill the =
disk from network share with about 100G=0D=0A>=0D=0A> 4. shutdown the vm=0D=
=0A>=0D=0A> 5. reboot host and try starting the vm (takes a lot of time u=
ntil launch)=0D=0A>=0D=0A>=0D=0A>=0D=0A> It's because of a high fragmente=
d filessystem=20=0D=0A=0D=0AI see, thank you for the explanation. In suc=
h a case, it may take a lot=0D=0Aof time before all the initialization is=
finished.=0D=0A=0D=0ARegards,=0D=0AMilan=0D=0A=0D=0A____________________=
___________________________=0D=0AUsers mailing list=0D=0AUsers(a)ovirt.org =
<mailto:Users@ovirt.org>=20=0D=0Ahttp://lists.ovirt.org/mailman/listinfo/=
users=0D=0A=0D=0A
--=_QV6LI6UZRcAokOAacyo2lZVUQloYIa8sREKAkSzjd-bHX7Yk
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://ww=
w.w3.org/TR/html4/loose.dtd"><html>=0A<head>=0A <meta name=3D"Generator"=
content=3D"Zarafa WebApp v7.2.4-28">=0A <meta http-equiv=3D"Content-Typ=
e" content=3D"text/html; charset=3Dutf-8">=0A <title>AW: [ovirt-users] P=
roblem starting VMs</title>=0A</head>=0A<body>=0A<p style=3D"padding: 0; =
margin: 0;"><span style=3D"font-size: 12pt; font-family: tahoma,arial,hel=
vetica,sans-serif;">Hello<br /></span></p>=0A<p style=3D"padding: 0; marg=
in: 0;"><span style=3D"font-size: 12pt; font-family: tahoma,arial,helveti=
ca,sans-serif;"><br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"><=
span style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-s=
erif;">in var log messages i get following :<br /></span></p>=0A<p style=3D=
"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; font-family: tah=
oma,arial,helvetica,sans-serif;"><br /></span></p>=0A<p style=3D"padding:=
0; margin: 0;"><span style=3D"font-size: 12pt; font-family: tahoma,arial=
,helvetica,sans-serif;">kernel: XFS: possible memory allocation deadlock =
in kmem_alloc (<a href=3D"mode:0x250">mode:0x250</a>)<br /></span></p>=0A=
<p style=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; font-=
family: tahoma,arial,helvetica,sans-serif;"><br /></span></p>=0A<p style=3D=
"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; font-family: tah=
oma,arial,helvetica,sans-serif;">I have this problem on 4 different hosts=
=2E<br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"><span style=3D=
"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-serif;"><br />=
</span></p>=0A<p style=3D"padding: 0; margin: 0;"><span style=3D"font-siz=
e: 12pt; font-family: tahoma,arial,helvetica,sans-serif;">This happens du=
ring copying files from network to a thin provisioned disk, no problems w=
ith preallocated disks.<br /></span></p>=0A<p style=3D"padding: 0; margin=
: 0;"><span style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica=
,sans-serif;"><br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"><sp=
an style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-ser=
if;">Thanks<br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"><span =
style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-serif;=
">Wolfgang<br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"><span s=
tyle=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-serif;"=
><br /></span></p>=0A<blockquote style=3D"border-left: 2px solid #325FBA;=
padding-left: 5px; margin: 0px 5px;"><span style=3D"font-family: tahoma,=
arial,helvetica,sans-serif; font-size: 10pt;">-----Ursprüngliche Nac=
hricht-----<br /><span><strong>Von:</strong> Michal Skrivanek <mi=
chal.skrivanek(a)redhat.com></span><br /><span><strong>Gesendet:</strong=
> Die 23 August 2016 17:11</span><br /><span><strong>An:</strong> Wolfgan=
g Bucher <wolfgang.bucher(a)netland-mn.de></span><br /><span><strong>=
CC:</strong> Milan Zamazal <mzamazal(a)redhat.com>; users(a)ovirt.org (=
users(a)ovirt.org) <users(a)ovirt.org></span><br /><span><strong>Betref=
f:</strong> Re: [ovirt-users] Problem starting VMs</span><br /><br /></sp=
an><!-- begin sanitized html -->=0A<div class=3D"bodyclass"><br class=3D"=
" />=0A<div>=0A<blockquote class=3D"">=0A<div class=3D"">On 23 Aug 2016, =
at 11:06, Wolfgang Bucher <<a href=3D"mailto:wolfgang.bucher@netland-m=
n.de" target=3D"_blank" title=3D"Der externe Link wird in einem neuen Fen=
ster geöffnet">wolfgang.bucher(a)netland-mn.de</a>> wrote:</div>=0A=
<br class=3D"Apple-interchange-newline" />=0A<div class=3D"">=0A<div clas=
s=3D"">=0A<div class=3D"" style=3D"padding: 0px; margin: 0px;"><span clas=
s=3D"" style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans=
-serif;">Thank's<br class=3D"" /></span></div>=0A<div class=3D"" style=3D=
"padding: 0px; margin: 0px;"><span class=3D"" style=3D"font-size: 12pt; f=
ont-family: tahoma,arial,helvetica,sans-serif;"><br class=3D"" /></span><=
/div>=0A<div class=3D"" style=3D"padding: 0px; margin: 0px;"><span class=3D=
"" style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-ser=
if;">but what do you mean with "</span><span class=3D"" style=3D"font-siz=
e: 12pt;">initialization is finished”</span></div>=0A</div>=0A</div=
>=0A</blockquote>=0A<div><br class=3D"" /></div>=0Auntil it gets from Wai=
tForLaunch to PoweringUp state, effectively until the qemu process proper=
ly starts up</div>=0A<div><br class=3D"" />=0A<blockquote class=3D"">=0A<=
div class=3D"">=0A<div class=3D"">=0A<div class=3D"" style=3D"padding: 0p=
x; margin: 0px;"><span class=3D"" style=3D"font-size: 12pt;"><br class=3D=
"" /></span></div>=0A<div class=3D"" style=3D"padding: 0px; margin: 0px;"=
><span class=3D"" style=3D"font-size: 12pt;">sometimes the vm crashes whi=
le copying files!<br class=3D"" /></span></div>=0A</div>=0A</div>=0A</blo=
ckquote>=0A<div><br class=3D"" /></div>=0Awhen exactly=3F Can you describ=
e exactly what you are doing and what is reported as a reason for crash. =
When exactly does it crash and how=3F</div>=0A<div><br class=3D"" /></div=
>=0A<div>Thanks,</div>=0A<div>michal</div>=0A<div><br class=3D"" />=0A<bl=
ockquote class=3D"">=0A<div class=3D"">=0A<div class=3D"">=0A<div class=3D=
"" style=3D"padding: 0px; margin: 0px;"><span class=3D"" style=3D"font-si=
ze: 12pt;"><br class=3D"" /></span></div>=0A<div class=3D"" style=3D"padd=
ing: 0px; margin: 0px;"><span class=3D"" style=3D"font-size: 12pt;"><br c=
lass=3D"" /></span></div>=0A<div class=3D"" style=3D"padding: 0px; margin=
: 0px;"><span class=3D"" style=3D"font-size: 12pt;"><br class=3D"" /></sp=
an></div>=0A<div class=3D"" style=3D"padding: 0px; margin: 0px;"><span cl=
ass=3D"" style=3D"font-size: 12pt;">Wolfgang<br class=3D"" /></span></div=
>=0A<div class=3D"" style=3D"padding: 0px; margin: 0px;"><span class=3D""=
style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-serif=
;"><br class=3D"" /></span></div>=0A<div class=3D"" style=3D"padding: 0px=
; margin: 0px;"><span class=3D"" style=3D"font-size: 12pt; font-family: t=
ahoma,arial,helvetica,sans-serif;"><br class=3D"" /></span></div>=0A<bloc=
kquote class=3D"" style=3D"border-left: 2px solid #325FBA; padding-left: =
5px; margin: 0px 5px;"><span class=3D"" style=3D"font-family: tahoma,aria=
l,helvetica,sans-serif; font-size: 10pt;">-----Ursprüngliche Nachric=
ht-----<br class=3D"" /><span class=3D""><strong class=3D"">Von:</strong>=
Milan Zamazal <<a href=3D"mailto:mzamazal@redhat.com" target=3D"=
_blank" title=3D"Der externe Link wird in einem neuen Fenster geöffn=
et">mzamazal(a)redhat.com</a>></span><br class=3D"" /><span class=3D""><=
strong class=3D"">Gesendet:</strong> Die 23 August 2016 16:59</span><br c=
lass=3D"" /><span class=3D""><strong class=3D"">An:</strong> Wolfgang Buc=
her <<a href=3D"mailto:wolfgang.bucher@netland-mn.de" target=3D"_blank=
" title=3D"Der externe Link wird in einem neuen Fenster geöffnet">wo=
lfgang.bucher(a)netland-mn.de</a>></span><br class=3D"" /><span class=3D=
""><strong class=3D"">CC:</strong> <a href=3D"mailto:users@ovirt.org" tar=
get=3D"_blank" title=3D"Der externe Link wird in einem neuen Fenster ge&o=
uml;ffnet">users(a)ovirt.org</a> (<a href=3D"mailto:users@ovirt.org" target=
=3D"_blank" title=3D"Der externe Link wird in einem neuen Fenster geö=
;ffnet">users(a)ovirt.org</a>) <<a href=3D"mailto:users@ovirt.org" targe=
t=3D"_blank" title=3D"Der externe Link wird in einem neuen Fenster ge&oum=
l;ffnet">users(a)ovirt.org</a>></span><br class=3D"" /><span class=3D"">=
<strong class=3D"">Betreff:</strong> Re: AW: Problem starting VMs</span><=
br class=3D"" /><br class=3D"" /></span>=0A<div class=3D"">=0A<pre class=3D=
"" style=3D"white-space: pre-wrap; word-wrap: break-word;">Wolfgang Buche=
r <<a href=3D"mailto:wolfgang.bucher@netland-mn.de" target=3D"_blank" =
title=3D"Der externe Link wird in einem neuen Fenster geöffnet">wolf=
gang.bucher(a)netland-mn.de</a>> writes:<br class=3D"" /><br class=3D"" =
/>> the problem is "waiting for launch" takes up to 20 min.<br class=3D=
"" />><br class=3D"" />><br class=3D"" />> I did a lot of tests =
with some vm's and th problem is:<br class=3D"" />><br class=3D"" />&g=
t;<br class=3D"" />> 1. create a win2012 server<br class=3D"" />=
><br class=3D"" />> 2. attache a new disk (thin provision)<br class=
=3D"" />><br class=3D"" />> 3. fill the disk from network share wit=
h about 100G<br class=3D"" />><br class=3D"" />> 4. shutdown the vm=
<br class=3D"" />><br class=3D"" />> 5. reboot host and try startin=
g the vm (takes a lot of time until launch)<br class=3D"" />><br class=
=3D"" />><br class=3D"" />><br class=3D"" />> It's because of a =
high fragmented filessystem <br class=3D"" /><br class=3D"" />I see, than=
k you for the explanation. In such a case, it may take a lot<br class=3D=
"" />of time before all the initialization is finished.<br class=3D"" /><=
br class=3D"" />Regards,<br class=3D"" />Milan<br class=3D"" /></pre>=0A<=
/div>=0A</blockquote>=0A</div>=0A________________________________________=
_______<br class=3D"" />Users mailing list<br class=3D"" /><a href=3D"mai=
lto:Users@ovirt.org" target=3D"_blank" title=3D"Der externe Link wird in =
einem neuen Fenster geöffnet">Users(a)ovirt.org</a><br class=3D"" />ht=
tp://lists.ovirt.org/mailman/listinfo/users<br class=3D"" /></div>=0A</bl=
ockquote>=0A</div>=0A<br class=3D"" /></div>=0A<!-- end sanitized html --=
></blockquote>=0A</body>=0A</html>
--=_QV6LI6UZRcAokOAacyo2lZVUQloYIa8sREKAkSzjd-bHX7Yk--
8 years, 3 months
Re: [ovirt-users] Problem starting VMs
by Wolfgang Bucher
This is a multi-part message in MIME format. Your mail reader does not
understand MIME message format.
--=_dq6LXbbY-ODtOTVZvHDEVpccL7zdG742CCS7a5hk75xhhN46
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Thank's=0D=0A=0D=0A=0D=0A=0D=0Abut what do you mean with "initialization =
is finished"=0D=0A=0D=0A=0D=0A=0D=0Asometimes the vm crashes while copyin=
g files!=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0AWolfgang=0D=0A=0D=
=0A=0D=0A=0D=0A=0D=0A=0D=0A-----Urspr=C3=BCngliche Nachricht-----=0D=0AVo=
n: Milan Zamazal=C2=A0<mzamazal(a)redhat.com>=0D=0AGesendet: Die 23 August =
2016 16:59=0D=0AAn: Wolfgang Bucher <wolfgang.bucher(a)netland-mn.de>=0D=0A=
CC: users(a)ovirt.org (users(a)ovirt.org) <users(a)ovirt.org>=0D=0ABetreff: Re:=
AW: Problem starting VMs=0D=0A=0D=0A=0D=0AWolfgang Bucher <wolfgang.buch=
er(a)netland-mn.de> writes:=0D=0A=0D=0A> the problem is "waiting for launch=
" takes up to 20 min.=0D=0A>=0D=0A>=0D=0A> I did a lot of tests with some=
vm's and th problem is:=0D=0A>=0D=0A>=0D=0A> 1.=C2=A0 create a win2012 s=
erver=0D=0A>=0D=0A> 2. attache a new disk (thin provision)=0D=0A>=0D=0A> =
3. fill the disk from network share with about 100G=0D=0A>=0D=0A> 4. shut=
down the vm=0D=0A>=0D=0A> 5. reboot host and try starting the vm (takes a=
lot of time until launch)=0D=0A>=0D=0A>=0D=0A>=0D=0A> It's because of a =
high fragmented filessystem=20=0D=0A=0D=0AI see, thank you for the explan=
ation. In such a case, it may take a lot=0D=0Aof time before all the ini=
tialization is finished.=0D=0A=0D=0ARegards,=0D=0AMilan=0D=0A=0D=0A
--=_dq6LXbbY-ODtOTVZvHDEVpccL7zdG742CCS7a5hk75xhhN46
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://ww=
w.w3.org/TR/html4/loose.dtd"><html>=0A<head>=0A <meta name=3D"Generator"=
content=3D"Zarafa WebApp v7.2.4-28">=0A <meta http-equiv=3D"Content-Typ=
e" content=3D"text/html; charset=3Dutf-8">=0A <title>AW: AW: Problem sta=
rting VMs</title>=0A</head>=0A<body>=0A<p style=3D"padding: 0; margin: 0;=
"><span style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,san=
s-serif;">Thank's<br /></span></p>=0A<p style=3D"padding: 0; margin: 0;">=
<span style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-=
serif;"><br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"><span sty=
le=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-serif;">b=
ut what do you mean with "</span><span style=3D"font-size: 12pt;">initial=
ization is finished"</span></p>=0A<p style=3D"padding: 0; margin: 0;"><sp=
an style=3D"font-size: 12pt;"><br /></span></p>=0A<p style=3D"padding: 0;=
margin: 0;"><span style=3D"font-size: 12pt;">sometimes the vm crashes wh=
ile copying files!<br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"=
><span style=3D"font-size: 12pt;"><br /></span></p>=0A<p style=3D"padding=
: 0; margin: 0;"><span style=3D"font-size: 12pt;"><br /></span></p>=0A<p =
style=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt;"><br /><=
/span></p>=0A<p style=3D"padding: 0; margin: 0;"><span style=3D"font-size=
: 12pt;">Wolfgang<br /></span></p>=0A<p style=3D"padding: 0; margin: 0;">=
<span style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-=
serif;"><br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"><span sty=
le=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-serif;"><=
br /></span></p>=0A<blockquote style=3D"border-left: 2px solid #325FBA; p=
adding-left: 5px; margin: 0px 5px;"><span style=3D"font-family: tahoma,ar=
ial,helvetica,sans-serif; font-size: 10pt;">-----Ursprüngliche Nachr=
icht-----<br /><span><strong>Von:</strong> Milan Zamazal <mzamaza=
l(a)redhat.com></span><br /><span><strong>Gesendet:</strong> Die 23 Augu=
st 2016 16:59</span><br /><span><strong>An:</strong> Wolfgang Bucher <=
wolfgang.bucher(a)netland-mn.de></span><br /><span><strong>CC:</strong> =
users(a)ovirt.org (users(a)ovirt.org) <users(a)ovirt.org></span><br /><sp=
an><strong>Betreff:</strong> Re: AW: Problem starting VMs</span><br /><br=
/></span>=0A<div>=0A<pre style=3D"white-space: pre-wrap; word-wrap: brea=
k-word;">Wolfgang Bucher <wolfgang.bucher(a)netland-mn.de> writes:<br=
/><br />> the problem is "waiting for launch" takes up to 20 min.<br =
/>><br />><br />> I did a lot of tests with some vm's and th pro=
blem is:<br />><br />><br />> 1. create a win2012 server<b=
r />><br />> 2. attache a new disk (thin provision)<br />><br />=
> 3. fill the disk from network share with about 100G<br />><br />&=
gt; 4. shutdown the vm<br />><br />> 5. reboot host and try startin=
g the vm (takes a lot of time until launch)<br />><br />><br />>=
<br />> It's because of a high fragmented filessystem <br /><br />I se=
e, thank you for the explanation. In such a case, it may take a lot<br /=
>of time before all the initialization is finished.<br /><br />Regards,<b=
r />Milan<br /></pre>=0A</div>=0A</blockquote>=0A</body>=0A</html>
--=_dq6LXbbY-ODtOTVZvHDEVpccL7zdG742CCS7a5hk75xhhN46--
8 years, 3 months
Join Windows Domain
by JC Clark
Dear Team,
Please detail the steps for allowing Pool Windows 7 VM's to join AD
Domain automatically. Ovirt 4.0
8 years, 3 months
Re: [ovirt-users] Problem starting VMs
by Wolfgang Bucher
This is a multi-part message in MIME format. Your mail reader does not
understand MIME message format.
--=_2+4LeC46yCgxKGSe3mcSRJNzkVVkdPVLYqRPA2RhZXP+cg5w
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hello,=0D=0A=0D=0A=0D=0Athe problem is "waiting for launch" takes up to 2=
0 min.=0D=0A=0D=0A=0D=0AI did a lot of tests with some vm's and th proble=
m is:=0D=0A=0D=0A=0D=0A1.=C2=A0 create a win2012 server=0D=0A=0D=0A2. att=
ache a new disk (thin provision)=0D=0A=0D=0A3. fill the disk from network=
share with about 100G=0D=0A=0D=0A4. shutdown the vm=0D=0A=0D=0A5. reboot=
host and try starting the vm (takes a lot of time until launch)=0D=0A=0D=
=0A=0D=0A=0D=0AIt's because of a high fragmented filessystem=20=0D=0A=0D=0A=
Thanks=0D=0A=0D=0A=0D=0A=0D=0AWolfgang=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=
=0D=0A=0D=0A-----Urspr=C3=BCngliche Nachricht-----=0D=0AVon: Milan Zamaza=
l=C2=A0<mzamazal(a)redhat.com>=0D=0AGesendet: Die 23 August 2016 15:17=0D=0A=
An: Wolfgang Bucher <wolfgang.bucher(a)netland-mn.de>=0D=0ACC: Users(a)ovirt.=
org=0D=0ABetreff: Re: Problem starting VMs=0D=0A=0D=0A=0D=0AWolfgang Buch=
er <wolfgang.bucher(a)netland-mn.de> writes:=0D=0A=0D=0A> After reboot i ca=
nnot start some vms, and i get the following warnings in vdsm.log:=0D=0A>=
=0D=0A> periodic/6::WARNING::2016-08-18=0D=0A> 19:26:10,244::periodic::26=
1::virt.periodic.VmDispatcher::(__call__) could not=0D=0A> run <class 'vi=
rt.periodic.DriveWatermarkMonitor'> on=0D=0A> [u'5c868b6a-db8e-4c67-a2b7-=
8bcdefc3350a']=0D=0A=0D=0A[...]=0D=0A=0D=0A> vmId=3D`5c868b6a-db8e-4c67-a=
2b7-8bcdefc3350a`::could not run on=0D=0A> 5c868b6a-db8e-4c67-a2b7-8bcdef=
c3350a: domain not connected=0D=0A> periodic/3::WARNING::2016-08-18=0D=0A=
=0D=0AThose messages may be present on VM start and may (or may not) be=0D=
=0Aharmless.=0D=0A=0D=0A[...]=0D=0A=0D=0A> sometimes the vm starts after =
15 min and more.=0D=0A=0D=0ADo you mean that some VMs start after long ti=
me and some don't start at=0D=0Aall=3F If a VM doesn't start at all then=
there should be some ERROR=0D=0Amessage in the log. If all the VMs even=
tually start sooner or later,=0D=0Athen it would be useful to see the who=
le piece of the log from the=0D=0Ainitial VM.create call to the VM start.=
=0D=0A=0D=0AAnd what do you mean exactly by the VM start=3F Is it that a=
VM is not=0D=0Abooting in the meantime, is inaccessible, is indicated as=
starting or=0D=0Anot running in Engine, something else=3F=0D=0A=0D=0A
--=_2+4LeC46yCgxKGSe3mcSRJNzkVVkdPVLYqRPA2RhZXP+cg5w
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://ww=
w.w3.org/TR/html4/loose.dtd"><html>=0A<head>=0A <meta name=3D"Generator"=
content=3D"Zarafa WebApp v7.2.4-28">=0A <meta http-equiv=3D"Content-Typ=
e" content=3D"text/html; charset=3Dutf-8">=0A <title>AW: Problem startin=
g VMs</title>=0A</head>=0A<body>=0A<p style=3D"padding: 0; margin: 0;"><s=
pan style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-se=
rif;">Hello,</span></p>=0A<p style=3D"padding: 0; margin: 0;"><span style=
=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-serif;"></s=
pan></p>=0A<p style=3D"padding: 0; margin: 0;"><span style=3D"font-size: =
12pt; font-family: tahoma,arial,helvetica,sans-serif;">the problem is "wa=
iting for launch" takes up to 20 min.</span></p>=0A<p style=3D"padding: 0=
; margin: 0;"><span style=3D"font-size: 12pt; font-family: tahoma,arial,h=
elvetica,sans-serif;"></span></p>=0A<p style=3D"padding: 0; margin: 0;"><=
span style=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-s=
erif;">I did a lot of tests with some vm's and th problem is:</span></p>=0A=
<p style=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; font-=
family: tahoma,arial,helvetica,sans-serif;"></span></p>=0A<p style=3D"pad=
ding: 0; margin: 0;"><span style=3D"font-size: 12pt; font-family: tahoma,=
arial,helvetica,sans-serif;">1. create a win2012 server</span></p>=0A=
<p style=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; font-=
family: tahoma,arial,helvetica,sans-serif;">2. attache a new disk (thin p=
rovision)<br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"><span st=
yle=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-serif;">=
3. fill the disk from network share with about 100G<br /></span></p>=0A<p=
style=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; font-fa=
mily: tahoma,arial,helvetica,sans-serif;">4. shutdown the vm<br /></span>=
</p>=0A<p style=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt=
; font-family: tahoma,arial,helvetica,sans-serif;">5. reboot host and try=
starting the vm (takes a lot of time until launch)<br /></span></p>=0A<p=
style=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; font-fa=
mily: tahoma,arial,helvetica,sans-serif;"><br /></span></p>=0A<p style=3D=
"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; font-family: tah=
oma,arial,helvetica,sans-serif;">It's because of a high fragmented filess=
ystem <br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"><span style=
=3D"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-serif;">Tha=
nks<br /></span></p>=0A<p style=3D"padding: 0; margin: 0;"><span style=3D=
"font-size: 12pt; font-family: tahoma,arial,helvetica,sans-serif;"><br />=
</span></p>=0A<p style=3D"padding: 0; margin: 0;"><span style=3D"font-siz=
e: 12pt; font-family: tahoma,arial,helvetica,sans-serif;">Wolfgang<br /><=
/span></p>=0A<p style=3D"padding: 0; margin: 0;"><span style=3D"font-size=
: 12pt; font-family: tahoma,arial,helvetica,sans-serif;"><br /></span></p=
>=0A<p style=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; f=
ont-family: tahoma,arial,helvetica,sans-serif;"><br /></span></p>=0A<p st=
yle=3D"padding: 0; margin: 0;"><span style=3D"font-size: 12pt; font-famil=
y: tahoma,arial,helvetica,sans-serif;"><br /></span></p>=0A<blockquote st=
yle=3D"border-left: 2px solid #325FBA; padding-left: 5px; margin: 0px 5px=
;"><span style=3D"font-family: tahoma,arial,helvetica,sans-serif; font-si=
ze: 10pt;">-----Ursprüngliche Nachricht-----<br /><span><strong>Von:=
</strong> Milan Zamazal <mzamazal(a)redhat.com></span><br /><spa=
n><strong>Gesendet:</strong> Die 23 August 2016 15:17</span><br /><span><=
strong>An:</strong> Wolfgang Bucher <wolfgang.bucher(a)netland-mn.de>=
</span><br /><span><strong>CC:</strong> Users(a)ovirt.org</span><br /><span=
><strong>Betreff:</strong> Re: Problem starting VMs</span><br /><br /></s=
pan>=0A<div>=0A<pre style=3D"white-space: pre-wrap; word-wrap: break-word=
;">Wolfgang Bucher <wolfgang.bucher(a)netland-mn.de> writes:<br /><br=
/>> After reboot i cannot start some vms, and i get the following war=
nings in vdsm.log:<br />><br />> periodic/6::WARNING::2016-08-18<br=
/>> 19:26:10,244::periodic::261::virt.periodic.VmDispatcher::(<span s=
tyle=3D"text-decoration: underline;">__call__</span>) could not<br />>=
run <class 'virt.periodic.DriveWatermarkMonitor'> on<br />> [u'=
5c868b6a-db8e-4c67-a2b7-8bcdefc3350a']<br /><br />[...]<br /><br />> v=
mId=3D`5c868b6a-db8e-4c67-a2b7-8bcdefc3350a`::could not run on<br />> =
5c868b6a-db8e-4c67-a2b7-8bcdefc3350a: domain not connected<br />> peri=
odic/3::WARNING::2016-08-18<br /><br />Those messages may be present on V=
M start and may (or may not) be<br />harmless.<br /><br />[...]<br /><br =
/>> sometimes the vm starts after 15 min and more.<br /><br />Do you m=
ean that some VMs start after long time and some don't start at<br />all=3F=
If a VM doesn't start at all then there should be some ERROR<br />messa=
ge in the log. If all the VMs eventually start sooner or later,<br />the=
n it would be useful to see the whole piece of the log from the<br />init=
ial VM.create call to the VM start.<br /><br />And what do you mean exact=
ly by the VM start=3F Is it that a VM is not<br />booting in the meantim=
e, is inaccessible, is indicated as starting or<br />not running in Engin=
e, something else=3F<br /></pre>=0A</div>=0A</blockquote>=0A</body>=0A</h=
tml>
--=_2+4LeC46yCgxKGSe3mcSRJNzkVVkdPVLYqRPA2RhZXP+cg5w--
8 years, 3 months
3.6.x to 4.0.2 issues + gluster + move storage domains
by Gervais de Montbrun
--Apple-Mail=_EB775E1A-FC47-42AA-9215-C7F2FC973E04
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=us-ascii
Hey Folks,
I setup an oVirt 3.6.x cluster with one of my host nodes as the NFS =
server. I did this because I was waiting for true Gluster integration =
(ie oVirt 4.0) and wanted to go ahead with setting up my test =
environment. I'd like to now move my existing 3 server oVirt cluster to =
4.0 with Gluster setup as for all backend Storage Domains and then =
destroy/remove the NFS server that is running on one of my nodes.
I've upgraded my servers to 4.0.2 with my existing setup, but I am =
having all kinds of issues. I would like to try to clear them all up =
prior to trying to go to Gluster for the Storage Domains and would love =
some help. At the risk of overwhelming all of y'all, I'm going to try to =
list the issues I am seeing below and hope that folks will let me know =
what they would like to see in terms of logs, etc. If these are known =
issues that will be cleared up soon (or eventually) then I will wait and =
apply updates are they come, but want to make sure that the problems I =
am having are not unique to me.
1. The beautiful new dashboard shows that my cluster is N/A:
=09
and I see the following events:
=09
I don't know which log file to search for a solution.
2. My hosted engine never seems to start properly unless I manually set =
my hosts to Global Maintenance mode. I then have to re-run =
"engine-setup" and accept all the defaults and it will start and =
function. It does throw an error about starting ovirt-imageio-proxy when =
running engine-setup
[ ERROR ] Failed to execute stage 'Closing up': Failed to start service =
'ovirt-imageio-proxy'
2(a). Can I just disable ovirt-imageio-proxy somewhere? Is this just =
supposed to make uploading ISO images simpler? I don't really need this.
2(b). Do I need to have DWH enabled? I am not certain when this was =
added into my hosted-engine setup, but I don't think I need it.
3. My vdsm.log is full of entries like, "JsonRpc =
(StompReactor)::ERROR::2016-08-18 =
12:59:56,783::betterAsyncore::113::vds.dispatcher::(recv) SSL error =
during reading data: unexpected eof"
4. Commands throwing deprecation warning. Example:
[root@cultivar2 ~]# hosted-engine --vm-status
=
/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/lib/storage_backen=
ds.py:15: DeprecationWarning: vdscli uses xmlrpc. since ovirt 3.6 xmlrpc =
is deprecated, please use vdsm.jsonrpcvdscli
import vdsm.vdscli
or in the logs:
Aug 18 13:56:17 cultivar3 ovirt-ha-agent: =
/usr/lib/python2.7/site-packages/yajsonrpc/stomp.py:352: =
DeprecationWarning: Dispatcher.pending is deprecated. Use =
Dispatcher.socket.pending instead.
5. This error in the console: "ETL service sampling has encountered an =
error. Please consult the service log for more details." ETL service =
sampling log? Where's that?
6. The host that is running the NFS server had network issues on Monday =
and I have had to remove it from the cluster. It was working fine up =
until I did the lastest yum updates. The networking just stopped working =
when vdsm restarted. Could this be related to my switching the cluster =
"Switch type" to OVS from Legacy? I have since switched it back to =
Legacy. I'm going to completely remove oVirt and reinstall/re-add it to =
the cluster. As it is the NFS server, I do need the network to continue =
to function throughout the process. Any advice would be appreciated.
Lastly... If I clear up the above, how feasible is it to GoGO GlusterFS =
instead of my existing straight NFS server setup that I have now? Any =
advice on how to best move my hosted_engine, data, ISO, export Storage =
Domains to Gluster?
Cheers,
Gervais
--Apple-Mail=_EB775E1A-FC47-42AA-9215-C7F2FC973E04
Content-Type: multipart/mixed;
boundary="Apple-Mail=_C1BE0CFC-CBE4-404A-90F6-90FC379EF629"
--Apple-Mail=_C1BE0CFC-CBE4-404A-90F6-90FC379EF629
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=us-ascii
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" =
class=3D""><div class=3D"">Hey Folks,</div><div class=3D""><br =
class=3D""></div><div class=3D"">I setup an oVirt 3.6.x cluster with one =
of my host nodes as the NFS server. I did this because I was waiting for =
true Gluster integration (ie oVirt 4.0) and wanted to go ahead with =
setting up my test environment. I'd like to now move my existing 3 =
server oVirt cluster to 4.0 with Gluster setup as for all backend =
Storage Domains and then destroy/remove the NFS server that is running =
on one of my nodes.</div><div class=3D""><br class=3D""></div><div =
class=3D"">I've upgraded my servers to 4.0.2 with my existing setup, but =
I am having all kinds of issues. I would like to try to clear them all =
up prior to trying to go to Gluster for the Storage Domains and would =
love some help. At the risk of overwhelming all of y'all, I'm going to =
try to list the issues I am seeing below and hope that folks will let me =
know what they would like to see in terms of logs, etc. If these are =
known issues that will be cleared up soon (or eventually) then I will =
wait and apply updates are they come, but want to make sure that the =
problems I am having are not unique to me.</div><div class=3D""><br =
class=3D""></div><div class=3D"">1. The beautiful new dashboard shows =
that my cluster is N/A:</div><div class=3D""><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> =
</span></div></body></html>=
--Apple-Mail=_C1BE0CFC-CBE4-404A-90F6-90FC379EF629
Content-Disposition: inline;
filename=PastedGraphic-2.png
Content-Type: image/png;
x-unix-mode=0666;
name="PastedGraphic-2.png"
Content-Transfer-Encoding: base64
iVBORw0KGgoAAAANSUhEUgAAAPUAAABdCAYAAAB9/iDmAAAKsGlDQ1BJQ0MgUHJvZmlsZQAASImV
lgdUE9kax+/MpBcIJCAgJfSO9Cq9hi4dbIQESCgxJAQVO7K4gmtBRQQVAVeagqtSZC2IBSuKvW+Q
RUFdFws21OwAj/D2vfPeO+8/55v7O1/ufPPNzb3n/AGg3GMLhVkwDYBsQa4oKtCHmZCYxMRLAQFg
gQJgAkM2Ryz0jowMBaimxr/rwx0AjY83Lcdr/fvv/1VK3FQxBwAoEuUUrpiTjfJRNLo4QlEuAAga
QH9xrnCcy1FmiNAGUT4wzumT3DXOKZN8a2JOTJQvykMAEChstigdAPJ7NM/M46SjdSgMlK0FXL4A
ZT+UPTg8NhflQpQtsrMXjfMhlE1S/qlO+t9qpshrstnpcp78lgkR/PhiYRZ76f+5HP9b2VmSqXfo
oUHhiYKi0FENXbP6zEUhchakhEdMMZ87MX+CeZKg2CnmiH2TppjL9guZYklmrPcUs0XTz/JzWTFT
LFoUJa8vyAoPlddPZck5VewfPcVp/ADWFOfzYuKnOI8fFz7F4szokOk5vvK8SBIl7zlNFCD/xmzx
dG8c9vS7cnkxQdM9JMj74ab6+cvzglj5fGGuj7ymMCtyuv+sQHlenBctfzYX3WBTnMEOjpyuEylf
H+AH/EEoejGBLbAH1sABBIBIEJ+bumR8TwPfRcKlIn46L5fpjZ6aVCZLwLGyYNpa2zgCMH4GJ//i
d9cmzhakljKdy0H3ocsDdC/WTOeSzwHQVgaA6onpnMFVABQ3A9BxlSMR5U3mMOM3LCABRcAA6kAb
6AMTYIl26AjcgBfacTCIADEgESwAHMAD2UAEFoPlYA0oAiVgM9gOKkAVqAX14CA4DNrBcXAanAeX
wXVwGzwEUjAIXoIR8AGMQRCEh6gQHVKHdCBDyByyhZwhD8gfCoWioEQoGUqHBJAEWg6thUqgUqgC
qoYaoF+gY9Bp6CLUB92H+qFh6C30BUZgCsyAtWAjeBbsDHvDIXAMPB9Oh3PgfLgQ3giXwzXwAbgN
Pg1fhm/DUvglPIoAhIyoIrqIJeKM+CIRSBKShoiQlUgxUobUIM1IJ9KD3ESkyCvkMwaHoWOYGEuM
GyYIE4vhYHIwKzEbMBWYekwb5izmJqYfM4L5jqViNbHmWFcsC5uATccuxhZhy7D7sa3Yc9jb2EHs
BxwOp4ozxjnhgnCJuAzcMtwG3G5cC64L14cbwI3i8Xh1vDneHR+BZ+Nz8UX4nfgD+FP4G/hB/CcC
maBDsCUEEJIIAkIBoYzQSDhJuEF4Thgj0oiGRFdiBJFLXErcRNxH7CReIw4Sx0hKJGOSOymGlEFa
QyonNZPOkR6R3pHJZD2yC3kOmU9eTS4nHyJfIPeTP1OUKWYUX8o8ioSykVJH6aLcp7yjUqlGVC9q
EjWXupHaQD1DfUL9pEBXsFJgKXAVVilUKrQp3FB4rUhUNFT0VlygmK9YpnhE8ZriKxqRZkTzpbFp
K2mVtGO0u7RRJbqSjVKEUrbSBqVGpYtKQ8p4ZSNlf2WucqFyrfIZ5QE6Qten+9I59LX0ffRz9EEG
jmHMYDEyGCWMg4xexoiKsoq9SpzKEpVKlRMqUlVE1UiVpZqlukn1sOod1S8ztGZ4z0idsX5G84wb
Mz6qzVTzUktVK1ZrUbut9kWdqe6vnqm+Rb1d/bEGRsNMY47GYo09Guc0Xs1kzHSbyZlZPPPwzAea
sKaZZpTmMs1azSuao1raWoFaQq2dWme0XmmrantpZ2hv0z6pPaxD1/HQ4ets0zml84KpwvRmZjHL
mWeZI7qaukG6Et1q3V7dMT1jvVi9Ar0Wvcf6JH1n/TT9bfrd+iMGOgZhBssNmgweGBINnQ15hjsM
eww/GhkbxRutM2o3GjJWM2YZ5xs3GT8yoZp4muSY1JjcMsWZOptmmu42vW4GmzmY8cwqza6Zw+aO
5nzz3eZ9FlgLFwuBRY3FXUuKpbdlnmWTZb+VqlWoVYFVu9XrWQazkmZtmdUz67u1g3WW9T7rhzbK
NsE2BTadNm9tzWw5tpW2t+yodgF2q+w67N7Ym9un2u+xv+dAdwhzWOfQ7fDN0clR5NjsOOxk4JTs
tMvprjPDOdJ5g/MFF6yLj8sql+Mun10dXXNdD7v+6WbplunW6DY023h26ux9swfc9dzZ7tXuUg+m
R7LHXg+pp64n27PG86mXvhfXa7/Xc29T7wzvA96vfax9RD6tPh99XX1X+Hb5IX6BfsV+vf7K/rH+
Ff5PAvQC0gOaAkYCHQKXBXYFYYNCgrYE3WVpsTisBtZIsFPwiuCzIZSQ6JCKkKehZqGi0M4wOCw4
bGvYo3DDcEF4ewSIYEVsjXgcaRyZE/nrHNycyDmVc55F2UQtj+qJpkcvjG6M/hDjE7Mp5mGsSawk
tjtOMW5eXEPcx3i/+NJ4acKshBUJlxM1EvmJHUn4pLik/Umjc/3nbp87OM9hXtG8O/ON5y+Zf3GB
xoKsBScWKi5kLzySjE2OT25M/sqOYNewR1NYKbtSRji+nB2cl1wv7jbucKp7amnq8zT3tNK0oXT3
9K3pwzxPXhnvFd+XX8F/kxGUUZXxMTMisy5TlhWf1ZJNyE7OPiZQFmQKzi7SXrRkUZ/QXFgklOa4
5mzPGRGFiPaLIfF8cUcuAzU7VyQmkh8k/XkeeZV5nxbHLT6yRGmJYMmVpWZL1y99nh+Q//MyzDLO
su7lusvXLO9f4b2ieiW0MmVl9yr9VYWrBlcHrq5fQ1qTueZqgXVBacH7tfFrOwu1ClcXDvwQ+ENT
kUKRqOjuOrd1VT9ifuT/2Lvebv3O9d+LucWXSqxLykq+buBsuPSTzU/lP8k2pm3s3eS4ac9m3GbB
5jtbPLfUlyqV5pcObA3b2raNua142/vtC7dfLLMvq9pB2iHZIS0PLe/YabBz886vFbyK25U+lS27
NHet3/VxN3f3jT1ee5qrtKpKqr7s5e+9Vx1Y3VZjVFNWi6vNq322L25fz8/OPzfs19hfsv9bnaBO
Wh9Vf7bBqaGhUbNxUxPcJGkaPjDvwPWDfgc7mi2bq1tUW0oOgUOSQy9+Sf7lzuGQw91HnI80HzU8
uquV3lrcBrUtbRtp57VLOxI7+o4FH+vudOts/dXq17rjuscrT6ic2HSSdLLwpOxU/qnRLmHXq9Pp
pwe6F3Y/PJNw5tbZOWd7z4Wcu3A+4PyZHu+eUxfcLxy/6Hrx2CXnS+2XHS+3XXG40nrV4Wprr2Nv
2zWnax3XXa539s3uO3nD88bpm343z99i3bp8O/x2353YO/fuzrsrvce9N3Q/6/6bB3kPxh6ufoR9
VPyY9rjsieaTmt9Mf2uROkpP9Pv1X3ka/fThAGfg5e/i378OFj6jPit7rvO8Ych26PhwwPD1F3Nf
DL4Uvhx7VfSH0h+7Xpu8Pvqn159XRhJGBt+I3sjebnin/q7uvf377tHI0Scfsj+MfSz+pP6p/rPz
554v8V+ejy3+iv9a/s30W+f3kO+PZNkymZAtYk9YAQQNOC0NgLd1AFATAaBfB4CkMOmRJwRN+voJ
Av+JJ330hFDnUtsFQMxqAELRsRIdjbxQD4LGuEVCrRFsZyePf0icZmc7WYuigVqTLpnsrQwAfDIA
33plsrFymewb6msQ1F+fCp/05uOiof5/L80m3Cn65NMI8K/6C5KVB/9BQLnUAAABnGlUWHRYTUw6
Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4
bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cu
dzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9u
IHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29t
L2V4aWYvMS4wLyI+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4yNDU8L2V4aWY6UGl4
ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+OTM8L2V4aWY6UGl4
ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6
eG1wbWV0YT4KX7RjVwAADt5JREFUeAHtnQtMVFcexj/aUUcFBV9bVIghUZfStFiwGlcKNSONValo
S1Yp1XUnrWC0EjfrI4atxmbFza7VdNG1o1GJkGCtXXztgmmkVFPFXWyVutWW1XFXrKxCK8hQpp09
5w4DDNx5AKPe234nGe+95/E/f37Hj/O6wwlqbGx0gIEESOBHQ+CRH81Pwh+EBEhAIWDoyOGHH37A
C8Vfd4ziPQmQgI4IHEv5Gdx66paWFh25T1dJgAQ6E5AaDuo4p7bZbBgyZEjnfHwmARLQCYE7d+64
99Q68ZtukgAJeCHgNvz2ko9JJEACOiFAUeukoegmCfhLgKL2lxTzkYBOCFDUOmkoukkC/hKgqP0l
xXwkoBMCFLVOGopukoC/BChqf0kxHwnohABFrZOGopsk4C8Bt3e//S3EfO4EiouLsW/fPjgcvr/w
NmjQIGzYsAERERHuRvhEAgEiwNdEewlSinnbtm3dsiJfxX3nnXcwbty4bpVjZhLwRUC+JkpR+6Lk
Jb2goADbt2/3ksNzUnBwMHbu3Mke2zMipvSAgBQ1h989AOcq8tRTT2HZsmWux25fBw4c6HeZy8e2
YmnOESzaewjpMcF+l2PGnx4BiroXbb5nzx5cuHABY8eOxaeffgopctf1ypUrGDVqFOrq6mC1Wttq
6du3L+Li4nDx4kX0798fs2fPbktTv6nHsc3LkFN0SUlubrGrZ+sca2/A5cp/4POrt9CCPggbNQYx
T/4c4cF27J6ehCPz9+L9xTGdS/H5R0CAq9+9bMSYmBisXr0aw4YNw5o1azB8+HDl+vjjj8NsNiMx
MdGthsGDByvpUvA+F9bs17F5ukkRdHxygmLnOzdr6g/1VQcwd3ISFmSuxMbcXOTmbsTq5WbMTi1A
gywSIj7fBea78/VVx7C/7Lq6I4x9KATYU/cCe0hICOTKd1lZmWIlJSXF7frRRx91sV5bWwtXvtDQ
0C7pbhGG4XgiIRLVo3Ow49UByCgpd0tWfag9jWULc2FFPDYVbIJpnLOOhprLuGEfiUAP3M9ZcrBl
jAXpiVzNV22PhxEp/0iC63P79m3ReTB0h4Ddbnf05PP99993pxqHo6nSkRoX59heWee13Nm3Ux1x
cSbH0RstHvLddexKjXOkbq9U0pu+OuQwxa1wXLzbIXvTRccK0wpHZWtc3cWjjhWijJg2KB/TK2sc
J611jtL1sq7WOFOcw7TikKNJMXPLcfTt19vSUtfscnzlTHC0WEsdr6TmOs5WCpuijCwvfyb1OloL
dXCNt94JSA2zp+7Fb1KLxYKSkpIeWQgKClKG7RMmTOhRefVCDbhQJubvyRuQHO5f09qbbqIO13DP
zWALrtVdE3NxEeyXsX5hDi4mZ2FbztPo881VHC/8DANCgjF0hhkJxTkojzdj/avRwIAoGGHDsbUz
kFMSBvOGbYgb+G9sW7kFadf74UR+Ogy3rbhkLUKmuQjxGauwaWwYosbcwnqTWh1GN6/44B8Bzqn9
46Sa64svvoAcQmdmZkKMdrB06VI0NTUhKysLcu6cmpqK8ePHo7q6uu0jF85kPtG74/r1+zMXjYwc
2Y1tjb7Kz9ZH9ScUkbZvhOSBJ2KexpTYWExMnIOcHTmYGGpA1MRpiI8EIp9JwJQpiSI9AvaaD4Wg
gYztB7DkhSkifzretZiBS3vweb0w1FpRwqoC7HjjZZheMCHK4KkOT04x3hsBitobHT/SpEjPnz8P
+ffdKisrFVHLZxkvRV9TU+Nmpbm5Wcl375573+iWqdcPHiXafcvBE/AbczzKt5gRH5+BHQdOo8bm
MmNHs7ztsOhm+/qmkpi/9mXMnTtX+Uw1W0RcHSquSFU7w/TJUa5bwGsd7dl45x8B/8Zo/tn6yeVK
Tk7GmTNnlF76ueeeQ0NDA5KSkpRrrOjVZBgzZozy6QhH5ps6daqyBdYxPlD31lNn0LAkpseLYjZr
lVhoc3WqBkxZsgMnZp7H0cK92JK7HJbcSPzxcBESw1U8bv19kvbaKkwKg3MI30dEirF8VLRYppPd
PqIxcnjH/3re6uiYT6U+RnUhQGJdkPgfIbetjMaezfvknHrEiBH+V+ZXzmBMnZ+AvNw87CqbgTdU
VdfZkHOTrOMGl+1//+2cCaERsUj/rfi8dh5LTGb8vbJGiFqoVoa+7SMDQ3+5Xwb0GzsZibFd19qV
LTU0irm6ks3tH/U6uKruBsmPB4raD0iesmzdulXpqeUe9Y0bNzBy5EhluB0eHg65dSXn23KYXV/f
Pux89NFHMXr0aCXf2rVrMWvWLE/mexQ/LnUZUnLLkb9yNq5mrIN59pPo0/Qtaq5UoWXsTJhinE1+
t9W6sf9j4s6K3+d9gK2/+gVarp7C75YXiTix8CWDrQpbN5QjNn0axo0IwV1h5ysRPXKgtGNAiPi9
ZD1yFBVJg/CYEHRE1AxkR+diizkVIZv+gOnjB+Hbm9UovwC8stgkLXYNXuvomp0x3glQ1N75eE0V
mwvKMPrNN99Eeno6CgsLsWDBAuzfvx85OTlYtGgRysvL3d4Ply+nFBUVKS+myBNRuhP8eqnUEIWc
Tw7jyT+tx8b8jSjPb68hYdVEIeqRSsRjIc7e1RA1C9uzzyJzy0akSi2LkGJOw03LBefQ2dAf31RY
sLJEzoudITptHTJbRwFJv87GzswtyEwThcPMOFm6BOnvHkLzhjeQt9qMvNYyYcnrsEjcOzvoTj+J
jzpaTfDiJwF+ocNPUGrZZE/b0y0tae+tt97C888/r2Y6MHG2BvEGmQEGsdJuEF8g8fobXOYVijMY
g2FUyWgT6cIMDAaR3nnGYbcpZY0Go0hvd90uytiUMkZRpkNCexa3O691uOXkgycC/JaWJzJ+xsuh
tYTYkyDn1HKY/sgj3IDoCT+WUSfAb2mpc/E7dsCAAZAfBhLQEgF2E1pqDfpCAgEgQFEHACJNkICW
CFDUWmoN+kICASBAUQcAIk2QgJYIUNRaag36QgIBIEBRBwAiTZCAlghQ1FpqDfpCAgEgQFEHACJN
kICWCFDUWmoN+kICASBAUQcAIk2QgJYIUNRaag36QgIBIEBRBwAiTZCAlghQ1FpqDfpCAgEgQFEH
ACJNkICWCFDUWmoN+kICASBAUQcAIk2QgJYIUNRaag36QgIBIEBRBwAiTZCAlghQ1FpqDfpCAgEg
QFEHACJNkICWCFDUWmoN+kICASBAUQcA4v03Ycfp3RuQvXYHqtsOp/Nca83p/cjO9p33/IHNwuZu
XHf+hX0VgzXYsSQDm49Vq6QxSqsEKGqttoybXzb860gxysUpGa9vPqF2DJVb7q8/OyhOBinBbY9i
FdnFudN7c4uEzf/I03NUQ33FX2E5dwlFW96D+9mdqtkZqRECFLVGGsKXG/1az9KrK14NS0X72Vxq
5fr0lcfaDHQdBa2WBbVnj6NcpMRnz4P6EXQ2nCywOMvWFeHDKufRdqrGGKkpAhS1pprDP2csmetR
5ccw3LM1Idh98pCtMLyUHKOerfYM/ixV3xr2HPzEdcurxglQ1BpvIJd7zeL0V9GtYlN2grgpxwo/
huGusl2u9f9E4TkRG70Ik4d3SVUiqg4XimPiAfO2veIUS3FkfPFeVLCzVoelsViKWmMN4smdfjLh
FjA1/XfIEMdC+zMM92SruvSAcqh8inmah4Ppr+NgnlR9MpKnxODZecni/hIOneCCmSemWoqnqLXU
Gj59aRaLZKFY+pd1Ss6eDcNrcbhQmU1j3qRw1RrrK46iWKREZqQiSlwjkmYhUlxL9pXA+2xe1Rwj
HzABivoBA+9tdXJB2xA1B5aseHHX/WG4vfok8q1iNp0yHzGdj6RVnLOhtHWBzDx3gtPd0GdglqN+
qwWll3s1mXfa47/3lQBFfV/xBt64a/cpdnHPhuGVYq4sw/x5cerOiQWynbIjj87CsxGu2gyYssCs
5N/5wRn1cozVDAGKWjNN0V1HwrF0dzeH4WJv+pDsppGGGTHBqhW6FsgyMue6zbdDJ76INDmXLyrs
5cq7arWMDCAB16/iAJqkqQdFwBAxB3uz/oaFec5h+PEck6f3SBSX6iuPo0TcRWfNhPps2rVABuTv
2wZ8bESzLClH3INtKJLL4TiHgx/XIMakbkHmYHi4BCjqh8u/17XHyGF44Wzky5dSZpzAkomhHmzK
l0mce9MLZ4xXzeNaIJP712HnipEvF8A7hDDZUwthF+89juWmxWLJjkGLBDj81mKrdMsn92H4ZVG2
j1p5sTe9T5kri73pcLXf5WKBbJfzDbJVRYdReu4cznX6lJaegFkug1/Kw0nPL4yr1c64B0iAon6A
sO9XVc5huHM1fPXWMtwLGdalquqTR5x70wufdZsrt2Ws/Rg7Zc8cacb0KNVlcZEYihezUpQi+96v
bCvKG20RoKi11R499kYZhovhsTV/Jcy5skuW73+7Qr2yxyxeSUPKZPU3vasOv6e8QZZsnul1WB0+
NUVYkfUU4LLcX2PQHAGKWnNN0lOHnMNwoesuwX79JCxWuTf9EmJVF72rsV95gyweadPURd9m1BiL
+WlyDF6OD07VtkXzRjsEKGrttIVXT5RVaJHDW+coh+FvKy+lSFONaGm1WHn0oHI3P2Vya4z7pfb0
YWVVXL6QEutp5N2hyKQ585WnIksJGjrE81YbBChqbbSDTy9ClG9T9vO6ZSWNyGG4WXwBo/2rlw24
fOqS6KbTMF29m8aVijJZAK/9cpJy9fWPcVxS64JZOa7xBTNfuB54elBjY6PDVavNZsOQIUNcj7yS
AAnojMCdO3fAnlpnjUZ3ScAXAYraFyGmk4DOCFDUOmswuksCvghQ1L4IMZ0EdEaAotZZg9FdEvBF
gKL2RYjpJKAzAhS1zhqM7pKALwIUtS9CTCcBnRGgqHXWYHSXBHwRoKh9EWI6CeiMAEWtswajuyTg
iwBF7YsQ00lAZwQoap01GN0lAV8EKGpfhJhOAjojQFHrrMHoLgn4IkBR+yLEdBLQGQGKWmcNRndJ
wBcBitoXIaaTgM4IUNQ6azC6SwK+CFDUvggxnQR0RsDt/JWgoCB8+eWXkH+AkIEESEBfBIxGI4YO
HYr/Aw4KlRdPlwxWAAAAAElFTkSuQmCC
--Apple-Mail=_C1BE0CFC-CBE4-404A-90F6-90FC379EF629
Content-Transfer-Encoding: 7bit
Content-Type: text/html;
charset=us-ascii
<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><div class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span> and I see the following events:</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span></div></body></html>
--Apple-Mail=_C1BE0CFC-CBE4-404A-90F6-90FC379EF629
Content-Disposition: inline;
filename=PastedGraphic-1.tiff
Content-Type: image/tiff;
name="PastedGraphic-1.tiff"
Content-Transfer-Encoding: base64
TU0AKgAAwiSAMtmNhvgCDQeEQmFQuGQ2HQ+IREAP9/v4AO12OsABQKheJR+QSGRSOSSWTSeUSmVS
uWS2XS+YTGZTOaTWbTd4PB2gAFgsGgACgUDTeiUWjUekUmlUumU2nU+oVGpVOqVWrVesVmtVuuV2
vV+wWGxQ16PV7P+xymKRYAgEBWm4XG5XO6XW7XeFRWJ24AAG8X/AYHBYPCYXDYfEYnFYvGY3HY/I
UmzWfI5XLZfMZnNZvOZ3PZ/QaHRaPSaXTafUanVQfJ2jV6/YbHZbPabXbbfcbndbveb3fb/gUvW8
HicXjcfkcnlcvmc3nc/odHpdOFcPqdfsdntdvud3vd/weHxePyV3reX0en1ev2e33e/4fH5fP6Sv
z/X8fn9fv+f3/P/AEAwFAaXvvAkDwRBMFQXBkGwdB8IQiuMDJgaI7AAfxpGqhJqmmfoABaRRcLgf
x+H0ABsl0UYAFebChiyNAugAEIFMOfp8HmABvmMVQAGCf4hgAMYhhAhJ/n7E52m4ZIAFaVheAAcR
7xqFoeiOAAliOGAAJ+mC0H4fB4gAaZfxGW5kGeAB7gSDYAB6IgnAAIYaSKAaDn8fR7gAcBklsABU
l4aaDAWCgABsJwtzkFAIojG8cx3HsfyDIcirzNR3nMABmFyWIAF6aRzgACIRBdOQkyuFgNgclJ9H
gcoAGuZhggAbQFh+AAqhzNqIn2eU9mmZYAFwZJ8gAKAzCUAAMTskcPnkdZwAAYZYlgABlnAewAAu
FgeAAJ4oCCAANAQg5+2KdpyGtYRalyABvHmn4cCAIwABuGQSgABwCpEv0TnEatgmAXRgAAbp5gWA
AXiAIoAB+HIVgACV9oMfVfG8aRlAAXRfyYcZ7gOAAWBsIAACAHAXgADIIYmk53G7NJgmIZyJg6GI
ACCHgZVEoaEnydhugAYhgF+ABpHWn4eCBcIahSCyGn4dGZlSV9ZnuDAdAAJgg5QDAIXIua/H2ABq
FsU+igKFmShttIMgfni5X6ABjlSTV3A2JNvBrNpplgTm7bwJwahCAAGAOt6IHUY5UT+bQMAALIph
yAAJ8KvqbnabpsAAfoMBHyYFX2Aa/JUfkxHGdiDA2C1VgEAXRt0vx+AAZxVEyABcnNsQEoWf6g3E
D8th+Iod21kCan2dtonMAgOAAD4HgIpq/Hr2ZacWVBWT8Zh6L8FQV26KwuUSHoSgqra0TxMRynct
4OgxVarIsfZ62iVxNx6dAAa+g63TsBIEWnAoBaDcAAOgYJ1JiWgfQ9X8i+FGJcAAnRhKCA8DwOIA
BEBqB8UApa5h6LuGMLJjQ6gTAADMFcGgAABj7bEOwcLQABAeBQRtt5Kx/j7WyOYbYyEmirFepoaY
6oVASA8AAHgTQppYCKDhZT+yWD/dkPgfEHx4j1X2BcCjCIbj4AAPUeY74ugHacBEfhGhqjJGE2Mf
gKnHhKbS9ExY/h7DwAAPAfJFgBAKAgAACDhiWj9HvHQeI+CLADATHsB4CHDlfH4PJ/I7B/E/AgAx
GoCACOvJk2FsYuWzC8HAuQIgTEggnA2BMAEcCEjtGeLUAAshrlDB+EEGwAAQNtABIsrg+x0LBFIK
sYgAB5JgAAPhYpEzXAIAQAyPgHG0hBCK1gDgD2QOiO6P0dYzQACTE0NJLAbVEgjAaUN1xx0KEvGc
G1DAz5uEIGkNBD4MBJy/LERYfI7UNh9BYvQUIAihhkE7L8QoSAOmCSOicbAvhOgACQGoSSchACuA
AJ4LYKSDI3T2NJToOgnh5j4DUKQAAtgqWyJAUTRAVhnoaL0PTDFmKsHiq8WwiArgADiKpUISQxBp
AABUcsvxOi7G8AAJofRSgAEqFcD7RRaiNWMHUUgAAfBZC+AADg5RZgAFYM0iwhxVMECmChLqd35o
oGAKKhVDKHUQolRQgxaB5DlUEKkSEFxIi9joEYJoQpgDJqeNdeoABCCdcWEEDcTiIj8HrEIYArm6
hpEmL0AAVA+N+EOE5zxDR/J6HEM4WkGA0h7AANYCgVAACZFeIYAAJ7DEPIsO4cAxQACfEIokUwzw
JJYCErcaYopfj3BzOgTwqgsObGWLcAAhwrWgGSBhnQPwRrZGMMJE4RA5B0AAHQOjJAIS4IU7FWgv
xIgAEUIqpg6gFg1AACYAKdhkjDbEDwOAcwAB1DixAZgkhHgAEWI0Xb+gfLdBYB0cgABkC+jSB4JA
cL5h1usCtiRIh/R0F+I0RkGBFN1H2E0MgAA7h3QuEcE8eyEDqGbRARIiBD2xF6T8MwdQ7gADsHdK
4EruAAGwKq0AaBDVFH+EcQIABKBviSC0DUymwJqAALYNtMxQAPtIHgNFHwYgcyM3CLoABVBUg2KA
GePxPBreIMIOK9BXAxEQAASIYINgWAYywhw2BTBjAAFIPgLcsDBw2CoDsysaktH2OAVkBQnifAAI
AVNCQignccAaTC/AAInFoGuWYewPiQAAMIN4PV8gHpabl6dsQnL4DkMNPQOgqWkAyQceg1qri7Gy
h8AgBLhi2GwJMAAMsREsACPmvwXgShEAAC4Vy6g5g0AeUkAI/CCiVCwrcQIwIPhADQH8AARwREGG
cJsQoABYjnVWGoTLRA8hHoGVJL49idirDdXoRwMBQLWDYzoqqR4ujoGOAAMQNAq4EBircIwGZlQ4
dQNYXVsBwgNacC0NulhZhxYY7sldiF3DH0IEELuFQkhhDZEYGreAsBKYhKgpA+h52KEsG664pk4j
EGanEdgx93hRDeMMAAoxhip2Cwh0ivhqC/R6G8LwigADpAtLMJwV20jyG2MwAAqBZDZAADQHgawA
CaFSGgAAHrV4QIuNgYwABQiUESAAZ4PhF81CpEUbIxYRCREM4sIAkKihMAeQUWInamCnHPvsVQlF
k9bMDskjQrxICOAAMYdJPwoBxvkDoDTxiUD9dQLAR1TBjDqJ+FEOIcgAA5XGV0AI+xwgAEMFmnWG
fOBhCkyQDoDeRExL8noWwegsgAD8Ke2AJgziVAAIIMgTQAAjApxAg43hZh6AAGQQEyg7CSDCAAIg
O9U+vK0Pca9RQcBSD6jMHASAAArAqT8fwAWQRztgLAW1ftg4KFoKANX3wK58O0PgbCKwUBEh+KUZ
SKwcAZYQmoOMnKJcnOnSnWIOnaneniLCigWKHKGEEo1uCiuMCYCaeoGEHaDAAAGUFuDOYiSMImH4
bEjuTsAQAM06raIMH2HwROAEASKGpaIqROHWHQfyH8AEmUAqAwtuTxBYANBeIiLQSQHSWEE0xSDG
ECRWH4AOj2CqEWs6EuCyjYsQJ25gtADAEiUYFmGWD8lojqU0FeqYDEEadkFoGS0sBQRqJMhu6GG8
F8AAC0CU5QBqEas6D8CIiKkaUyFwEqDeAAD+FgCWAAFuFyckFKC632FgB4wqF8DuYYH2HY6gFGD0
pmFSAm6EF6EeCYluHoHGlaEwzODaES5xCVCZCcABCgjYAAH2joGKF2FCAADYEKWqDaEXFeCy1wAA
HIGIXaEwDwggAQEAE2AAEKCYsuaeAAHiHOQ2FKEqwqEAEus6AOA2jYDEENFeECCYBIISH43Q7IFm
0IDuDe6EGeHoKGBWBww2E+FmEAAABK4gLWc2H6dkH6H+eiAMwiaCFu0IDcEYquDkEgbMCoBOeiGm
F0cWEQEWlYCTIQAABEHCRWD2E4ZmEMFIU6ByAUHEAAESES7OGqH6cGD0D2DwAABgAkbDHoL6AEei
AIHqaAEUES22GIHYfMuqxeBwAkjAFMEWwqGGHWfMCqC2gIGWFS1sHGAYiYDmDyxeBEAWRyGIv2AA
FWGodkCAw6ceBmI8JAHyHKSYEQEIRWF2GWGghUA0hKCEChA6DsDEgI+IHWGcU6EKEIEIAAE2Fwc0
CQDKusD0D0xfKwXIACH6VCE2Ck+eEWF8l+A2DU1sEmDg32BW4ALo9iAAFqDqiSFMAapmDsDIiSBU
Aqmm1ic2jmjqHmROAMAaUYAXBclOAEQ/BUQ+ACAMX2daL8deu8HuHuIsAJBKlOdfG4IuHaV8HyH6
L8AWAcj2AaAWmmACeoFQC8ckFSBc6EEuDOXCAaHyTEH4AYj2AZN2lwYq6GHUTEAIAkfMHYFwguCg
EmhmFezitTMg0au6AAdkHeHSdQHvOGAAf+UKAcAQTsnGIuGgRWByCkxMFWoaCUBgoG05BSi+AAHc
Hoi4H6AEX2AmAqlMAMnGLedQE8CKZsE6CEoSFoDkr0AieMTyjxN3AAIQSQWy/Gd2AIALNoIOHwHc
I0HeHybEkMtuAokSlvPgJDN8HYHeg+H9BsAAAfQsABQxRkIORNFUg4eiT0IwTEACAQUYAlR6LaIk
L8g+FGCqcGDeHgD4AAG2FiDKf0IOSObEHmG0XaC4CC6wG8DMFNTIEY+8pau8HiHTCGHpPwAJCWAA
AsAnDSXKHYtgCWBE+8CKFwG4AADmB1Kyf5PlGRT2ABT6L9T+j3UFUIJEGeEqCi+gDwXaEQFuGpDe
BoTaAKcOH8nqAAFADMvQEKGSTiF8GwggBKbeIpFUHqdQHWHcdkANO0I2Ak+IIMu8H0ROKAAIIsHa
HWdQH3Bup2AqVWTsgUHmqCEwCW00FiCsh+F0DYgI07V0fnV7V/SVWEApWIITWOHyLQAGH+g+HSHg
dkAgI5Py+oImQ+HqHW6+CwBguGCMFpVMDGBQeML0HwkcR8FFHYDaE8UE0MYIDIBgUZBQH8H6RyHY
HSTEH9WCcmAoUYZYXMV8GkFs1sCmDsXUFQGME8AABiAgeiKCLeg9N+RzQkKGAaAfO2ASlQLQihBE
H9BJBMUtFVBXHijAGKE0/eDgF8iSGMFc+AG4FwdsCmDmm4FWGMb8BmAqhqJKHuHYG0laEy7GseI8
EqFWtABMAYeiH+HvCGGAFmoSDcEo6+DkEubMDUBkUKorFU5JQcHYg/BaVWAiAiVWeibEHOGdF4D+
zOHSC6EwqMCioHILToESEOFaAACiEwFWVwBUmUHyHqeoLOd2AiAaX2SOQ+jwQwrGHiHiWKAQAbOO
AWzdTTb4WyIwV8AVdgAAAUAVa4AEAHP8JAmEHmHoRyHnNwcIAcVWAZNSL6HtIyFGEOxSGSHatuC2
Dy+QB0A6YQL8noi8mAHkg+H4kMS4AYJ+AWdAQwHtE6FKEOtQGPeqAAC6Dyo4V0d2H2H6LZd+lOAG
u4H7fwImIOAGAKTtMAi4HmHleNXaVEAkUZBKX3R+IYH8HjVMDuCpA6AOCmxeDOC0+8A6AcZ4osHg
Hig+H0bEcIAi2PgeluI/MkF0EACsxgIAnF+AG+9ROAEGo00AC6RhkAAgBgCAHCtDsADAmQeAD2gD
EACCMwyAAGAJM9ne7wA9n0+gAAQSDgADgYCAABQFE4m/QA+32/wABAJJng7XYAHu/ZsEwpMgMAwF
JqlU6pUnu2VMABiSlUAEas0iAB8IQtQZfJn++wA5WGnAASDQkAAdlKvgAXBsIwACqHZ3sAHY6XcA
HyAAOAAkFAnhqhZ6q+HfR3g+JcAgSEQAEwcCZJUbO/ABLZMBgM/sA6XVhH7hwoF8XT89VQA/Xs7Q
A73pLn8ApligUAJzE6m+9EBdJPXk6wA7XrpgaEQrewPUQDwqo+niAHQ7b/uwKAAqFcXOIm/37Lnc
7OyDQoFOA/XuAH/MKCBZ1sn29/jQZsBPs4CVgAdZ0KOfQAt+CbxAAAycsc2UHwhCMJQnCkKwoep7
HsoELQ4qhnDaAB/GeaSqGkaCeBgSZiQ7FkWwooB+NqABXDmHQADufhCgAW4zHkAAeCaQYAEkYZrg
ALQSs4856gAaBNDHI5JiYABlmyLiZn8lx2GiUAAByK5ZgAVhnliAAUH0aIAEeMInAASBjpcAIBqG
AoShQwxzg3MRoFEAAXt/CLzKQdhkAANAbiyAAZENIR3FOQ6KCqVwAFALgVNmezBmaUg9AAK5Fu+V
JjkerQEx8X5PD8AA1EozhbGkRYABMw8XKkoB9Hs5RnmMaqIBeHYABOCoDJ6ejlGESo3AANJPBiAB
VlcF6ECmOC3lQZQADIGAGxCfJ4AAaRZkcAApj+cwAFqZRLPAdBgLmJ9lBcPg8gBR1IHDSVKUs0J3
G8ABbFATs1FsEQAE8UgksIch0PkBoJAAC72gABYHN+BKcQifx6AAbBh0mSQ/k3WQsieABzmCWiTC
utxEieEiqHqcsjF4VBMR2AQaAAGYAGyABQlqtRQFmRIABIzgAHqc1sFgSFOlUbg2Z8UCHmMUxPgA
Q5WgYABRlsOQABAAqeHOaC7EyRBDOWKZKgARYkguwB2viCgOg7EJ0GcABCkLtJuAMFYAD0Pg+AAD
JvEyrxGGWmYa6iNQrsKRxDZSeYMWBwQm4gAR8SoUZFAATpkqOGAmi6sQKKAfoHT0EoTT0mz4mMTV
IE4Zbsh0Mw8AAMYapHCqeG2WtxkSV2egwHAigAfhrTCbwAzuPQ9DuAAYAo751mcVe2lTdxsHKb7D
AqD4AB6Jo6gANwhYKfJvTCKQvIWe52mYxAq0gQI0CoAAVg1rdav/gAhEiZ8Rah2CmAAU4DArlzDI
EtkwiwzgAEQN4ebPBsDgNmPA7J1SohnEQ1cNAQTMBrDWvQDwUSLhzCqEMAAHAHHfHUL1tISQ3jdK
8LFogKB2i8AAE0MogQADjHQYMqcHAABzE2LZZYRmXi0DMsAVQLVYiXDODcAAvwzBIgQDlIQmQxBA
YmOQXK2QtPTGKOY2xoCJj+H2X8fgLl6DGFQ1EEwF2tnWKoPZIwjwhhhAAJcb8GB5D/KBEYPAnoxh
eBANgAARQsL0GwN05QCQFgtAAKIYgpDDDDEoAAOAilJjqHgX8kxOgBBYRmMlSADRgSoCWHMuw7il
AAAiC1VQwRIGcCQFV7QmxhitAADsDDWwCABL+KIGEVh2CSFuAANYOzMDFE0GgAAZREl2HoPc0BLy
Jg4DeW4UAcotAPAOUOPBsh5jeFwXMJqIBaDtgqT+UoAmSihF+58IQJiNjgFKF6HopQFrBGvM0Zg+
XOE8JMEIOqfRLBsCETOcqDoigAY2KMKwIQABvHkjobouAzEQNkeYtQzhLBWLEH2gIyByyaBaPtNI
gApuZEyNQwqG5SkTBWG8UKOw8g4AAKQIQKZPDIW+AUBa3A+C4G0AAOII4MUwplTQ+URacU6p4EdB
aEgAj8G2AAOQG6fCnDAW4cAhgoILAHOctAAB5jcGKAAXo32thECIDAvY/DCjSFeuMJQbiwj+kISQ
A5vwZBgXGKAP8Dh+DOE89QJsQDqloH8aYkhNgIgzWUK4UcER4CkSmEsPC2B9gJPcB4HIhAADJFbA
sbdewAV9r/YEAdg1FWGUpYl5VjLHWQqmAEBFAQaiDFkAAWAXXAFUUEPUdYxlPAwlQFEXI1ndgtI2
VUng7xwuLEWFkLVcAhSdGIIGFg7hnxKDyFJZQth8kuJM1sC4HEribFotUCI1G2A8CyI1pBSQAAaB
ICZwInUwgwHFJoJQa79WTpsSYCQF27B/FFOsKQJCgDGEwHGI4qU2i/GXSYBo/GNjeGOl0KQca3if
FsXIdwpQ1UZF1FoU4d0mBECrEBDBUQQgoCNAgYYpwAAsUAi4fY8BwgAFyKFtIfBUVdEKJ7HwRwUt
wKGaYeg7jlDbGxkUBoI6hAjAgaYbAuyuiBDTEAYA+i1EmLKCwGwZAACEESD0AA3LNgADaJVIwAQI
VCBWCQH4AAbjyT6JwbB8QRA3jAG8PwfQAAIF2W4U41qzifEq+MXYoLUCCFiaYDA5BhgAGoPsngEw
QAsAAFsPJYQ7BOL0OgaQtQACODqtUUw0jQAEAsdEkzdgrhZDAAAOgdaTAZO+hAew5G8iMEaIyP4p
he29KCBZnYXw3tRjAM8AAmxFbMF2Ok0wQAxB0LmG50w+RdCXAAIwSgowADNHUaCmwFQchSq8HNqI
LRvCwAAIoQt+hdDqKAEEMIc3dhEA8AAYopbpAMBlAsOgdFnAEHcNBxNOx1ANWkGgLALoECR2YJYV
BdpCFAAKCBzIjRJOECYDQEBeySlUImxsWwcQtkcFOQMb4+1iBfEZj4NQOTDiqDsIAAAphl3SHdZQ
AIAowCBEyqoK+UAATkrUVKAa6A7wHFKPUErExsjCAAMwAtWBFCLDeAAIAKyRjlgKRgTQECOB+j8E
HjgABdCVaiIMTgxwADeHWTyI0jxJRHC8lMCo8uwBYDOIK1I0V/D/sntAAwJQvtcFGp0HQICNn/Qg
VfHxW5miUF3foH4Ijo7FKoPJJwAAahR6IG8UfYAvg4L0AYdj9BCBQmoKQcA5WkIb6WEoAAlRbCIA
AEwFzWxkihwwGsRM65ROcm4AAGgaPBiaDkm0CI6tYA+CpowcpgkQ2A6sXsJT0xXiNDKAAFoEibDX
FoJMAAUQ3FyHkPX6VkQUBg+MKIQC7oDwBA0AVAJwGoAAQQAjroeAZRxaNiNTpYAAQAVK5gMIHjlr
1TdgHgKwP4AAeAeiUgs4AwFDyoV4VaIAFAd4V5RQJZLoTaTIAAcgOqh4Q4CzxgYQQhKYCJi4kwdr
vgFAHJK4MgUJdwNADockA4I6PwVAdpb4fT4CehSgYbZgIYERbgAg2KAMLMLRDhDBDULZCJD5EJEZ
EpE56hFUL8NBCAf40Aegb4XaHoH4j4I4ULbAOAGZHwQYJAHxHYJaTQZYPgIgkwfRjYZoTS7oKgVj
egbAYDX4BI84AAdIZZkQF4KAuwW4aqnYdoSRNoMITRl4TwXzogGIA6DAUIPrDARYXqoQXYbpLoFy
gJF4fw0Ae4ehJgfIeZhgUQNqs4ZwKKYAUILpS4kw0Adgbq5gOIGbegXIA478K4oAAgBYzAJQRBSY
SoKaoStML51IfihBOYkgfwwodIZzWANgLJ3QcQLr+QV4LQ0wOwJrggI4VxQsYImQtJjYbQYBkQJQ
NjigWYZynYFIBAtQe4ew+IfIeQc6S8XYAEXsX8YJpAc66QVgSTs4NoShvIBQvg+SwIkxPQGQHLs4
TIVLX8AJCZ1Inw0KgwwAbZxYUgRq1Ad4KhkQRQKBl4qbyAngfg4g0JXIAAY4WTdgQAUY7JoRz5o0
QQeQ1IbIZZFYbIf4g4IgFQ0wWYTzZgVAeDegVYRhkrIIeYcjigVgTBWIVgeDmoVwShhIAofBb4bQ
X4VhVYMhVQaQBJGwNwOp84PAMynwfQcgaYAAZQaQcbRoDzjgEAfLsARoUZxYCAGjmoOwLpnIw4oA
c4ZDdgRITzbACgG5K4OgMCuwiQ6hBoeAbTsARIQxtIawBJnIOwPQPZH4Dpo5CYezIoT00wAAYIc4
xYMIOxZSuDwYSYX4dJ8h3KjIITrodgZwUptoVbbAfwCR8YfYbswQAoD0PYPQPBKYcoUqkwQ4cTjg
EocqJQbwDyCIOoLyA4Fx/sNM9ZDjq6AqA6BKBYOwMj4QdCLwuYUAiYLYQLggKQHxh4XwR4NYAATI
cLOQRYQgj4eQVbs4RgdsPYQ4OQj4HYEgmwVAKwHghADTggWwPRnYSIJpRIWIHpEAVQN5zIEYA4lQ
VYPaA4Rwdgj4WYTJ0wZgOsQIVaKSP4M4GwAAXwNbP4VQFxWITAMZl4TiXYAAXAF50wRYO6VADIeK
5gOwK7ggYgEyagXoUCOgCqO42QbwVrDAJgN40wRAV5r4HYEoqMUJKYP4abX4V4UTyoBIborIIYLw
VJG4TpdYJwDJNII4KhwgJwPSnYMwI7jgAgdAgYKoIxZQJwU7vgNQGYv4SQFh5IWQMAsIUQNKFgDA
dyYAEoIBSYVQaDHwHQDKYgAJJgUIIKoQdgQpFYNYFoo8zxNoFQRi4YM70pAQYxUgIoM7sAU4ZhMI
HiYYkitSrbIoPoFx5IUQEjyoUwSAj4EwAkI4TgNp/QSoZaagX4a5r4fYWDDAIAOgroMoRgroNIJI
g4bwWxogK4PcwVYKTVYigMbLmCihrii6jKjYAAcSjxiZCQegaJdYC4HJMIYodZMIeAQAvQKIS6LQ
WYaxtIFy6oagV5egI4OM4QYAcjfQFIc6JQJwGSVAHha4AAPII5l4Y4PBl9hth9iIAFiYk1iti9jI
AFjZMoGcWBCAerbAK4DbP4FQWKpYP4H4DBCofwngfaykK40wdoapSYGQJTggLQRB7QOQJTAAeAay
dYPILRVQBYQxMoRQEYuwEoI6IAGLnh0AO5hIq8FQIALL4wPIVQZJVYE0wQQwGLegYoOpLoVAMJnI
AgcqddqNqdqqr1rEDtrdk1rxidsLfdsgAAEoJCIAGAMpUgRwKx8YAYDKKwGQDgmy5Ani5S5gK65z
+a6K6a6q5AAAyCGwVAP6LQRweUDgW4QiSwTQITmoWYJJr4VAPYKIAABod7bAUYQhqIU4a5egXIYJ
hIbAV4uQLoP5vITQW5gQFQAIbirwJiCIb4M5cYWgMaKwfoczbATgPSCIWoCptIXgRzP4ZYTTFoOA
XyA4ZIWi7oBIfce4YAt0fZvIVoYRWIdoU1+QX5/QYoU8QIad6BI96bbIXDdgIQEg9yYqADEAAAbY
YwroP4NTggXYdRYgCwDTg4JAK5KAI4IUPYGQF5O4CQAwtRpSHj9RHQbIKjs4SYNIII+Qb6HgToRT
+QaYfhEAQgNoiYToOZtgeoOLZgRAJRuwcAX4rIRIR7WAJYR6nYKIDxb4WwTjZgUgcqkwUgQLroW4
SDcQQoXo7IOgRCToIgDov4WYUBxAVQaIDgrwSB/QZwRp3QUQbKnwTITxK4dwYorIRxIgAADoJSj8
1oKpwpYlewlwaAT6/QRgXl7QE4LJEANQGg74WQSDwYXodDuAKYMt4IdoWBxAYodozALYO56YD4cC
TQRoRCJQAQGyCIOAOaFgAIb2GQSK4YAgFRKYOoMpnb0ZSGVQzALQPBegFYeSdYRgTZvIB4GRK4PI
M5nYAAdRvJvbdmVaSwJYDU4QUwYKGwEwLJxwGY74RQLyagdgIREAOwMpzIEwCk2Mm4wgctuoO4Lj
s4AIJeTQLqnwXYNTs4TYeLroOYPr9cKg0AWoRRaoSoWpaQQYUjcQIwHWO2R9eyAiAwAAVACrmoM4
HAkoPwPZWIC4JB6YQYMxzIAgZMDgMDt7uKPwCwa5z4NoRMvwIwOIi4LgJRwAcgXxkQO4RoVAAAJ4
PxxALYE5HwL4Mk1wcgCaLQToRBEADIezvgIwKxegJ4Qp7QPoKCuwB4BELAqjzwrQJRegIwNDs4G4
DoDRBZBoeodyroRQRwhYcQcuRoXIas1wHAEA0AT4HSBwRoDZzISwQYj4F4CSCoW4RxRIQQVORoVg
XLP4R+E2RAOhxAMoIzjgeQZrdAKINogYRwWcDKK7QAJZ84A4IJr4TQPpROLRxYOILJ6YAYMzdAQo
HEwQKQMUDgHD61xhGwfQapMoHoLTRgGwPM5QUwMxZwWgMpZwNQWQHIAATAWpVQHgDZjYUANxzITQ
AM1wZAUrmoXgK0AwPoFMDgXoOqLQBwezigNoICPwBwQpMoQgFzigFgIlUQaArIDoZhHW4L3wV4Zp
xAGwDA34c4Whr4GgMJJgW15QAAYgIBhISAFyPwVIRCPxowo4WIQxNoP4VgNNmwatAbzQw7qs9nFh
FsLrBfFkMJEREgqZExFEM/FsNKNgv4aQVLs4I4OapYUoZhMoHYB5JgXgRTX4MgUQ6IWwaYrIGABM
QgTcQ4VqA4bAX1OUR8SMSYKDZ4WoZ5z4XQHMQIZgPTfQVQMhaQAccGbQZRgQFwKRdwXgbp7QFtnR
DooAeodJnoToNN4IZsXxn0h4fgfBHwZgVhWIKYOhq4JwN61AIYCowYVIPQuQa4HhEAVgUB84FAmX
FkNY+IcIZGo4LoLJHQd4FtAYVgU6j4CQdTsANAJZr4KIWFuseg+V/QAEfF/oNjbEfynYFXPPPfPp
0HQDdvQcYBS4eoc6RgV4SLcQPoWw5TxaTqJ5uAa4XJ7QRARhlIEgPRdYR4KyoRFgnjVwgYUDfhes
mTfcmpCgfvZiK4Vpq4QAURb8opopo7kb8beAf4kofAdYagAAWITZWIUgcyBYV4TBKd0MiBXoWATQ
uQUYc6B0sKs4BYfhJgdQcBEgWgV5SYWAWeWoFh/QPYPYi53omwfr8jpYkodoZ85QRITgZoiAGR0w
O4Moh+jYdYZoroRATZxYBoGakwPAMsA3hodYaoXRtoRRogX4eQvQN4Op6YK4HBgo8hCgdz+BrAQo
hYdoDSFmVzyoAgaXnwRTfQAoG50wPYPBRIAwayTQRIUpNICFSoAADAcaZoZ4d4xYL3ooAAYwNC7o
AoKpEACgaBxAXACCVAOQME9E9XHPyOjhdGj0+KBj4QcYSLyoUvwiI4Mx/QGADqgIcQWJVQMITwmw
jqPwF4fvpYK4N6HgLgQRegKoF5JgHsDRI4SnpYNYIDloeocbIoeAAwjYCAARJgdoc8wQYIUPEoRQ
bzyoXATqPwZwO1G9HKKlHgX4NlIFHIRwIYo4JoKh6YMwT7Z4MAHTAABarZKgTLegLgVeHQWW5xYN
U6iQqXWBWIHkdL9ggBRM4ALhQIoAFodCYABoTDIACgPBQAfTZUwAGJLVgAR6zSwAIQjBAAcbddQA
BIUBwAfz0eYAdLhZgARxcOAAHCpZYANA5CIAU5UFoAVhAUYAUxoHQAAjeUgAEQ/VoAVbQi45DIMp
gBeoAURDFIAdiDYgANYwdwALImJIAZQvKYAPpjKgAHoxD4ACAKhYTCoNAAGAQBAGFw2GfDaUoAE4
8NwAQS6bAAK4tCgABACfwAebPS4AExIXlAZmLCy/MAAIyZHIAYi0NAADwSBIAfbZT4AEA9V4AVTQ
U4AHVZAADwmHAGEegAUZWEIAN7yQoAcS4MwABfI7T5aiaAASGyuADFdS4AAjeDaADkecTDAVwjqc
7oADaYm5LBzdOudSrAAZAGZwACmDIgAAIBfnMAA2BirR5nI9T2Pc+AAPk+j7Pw/T+P9BrtMOAJ8G
eAAjgsHwACaYJxrMGIIQ9FztH6fR7AAZ5OjGAAkD8rpLFmQ4ABcBjNn4fp4AAV5BC0ABSAcRgAFs
ND9hwJ0fFEZRwxGDwCIoeJtgARYlCCABjC8WYAFkLgMAATQrNaXwploABUi6EgAGhG0cR0AEeR9I
EhSJI0kSVJknDQdacCcjZTmcXQACCDABsKAIBOKwbtH+foAHqdZjMoGAsAAKJcmsAAxhaB8XnyeM
FFsRgtrkZ4ut8P0tCIKI+gAJJAE8AA7h4C4AHufDlmyWhEgAPJSAlIxlEiwJkk2AAljbERZGaUAA
BSA57gAc5wHIAB7AUn4Hn6tJwm2aAAFqUI/SMAJAAAYRKiGABmE2NQADgX66mSWQspQfblm0YBOA
AJQ2REVxhEUsRTXxfS6mQVomvWX9oCVaczGaUIABWBjjxfkNLJYfh9AAd50nEABpmOYrXGHRhhGC
0ZnnK7IUhmJgAEISY7MKahUgAMA+6CKQ8EWAAyhmCtwHflRiFYTIAFQaYTgAQxCIOYpIumd4rO8R
QnIea5flUmhB6CJZNlg1QGS6WBN6QUhzCvJQ/ryXBN2MURxigohLikAAFH0c4AGAVtdj+UJ2sgPQ
iAAXY8kc2w7kwABFCgEqWHWZoAEKQqLnYCIZgAPY91cDADO0wh+AAahVYYQxEI2d4S4oLwxiOAAX
hGDgAAqCKfr2l5XEYRC3HWhYrDyPIABgBSXnWdZ5JYAnVACf7lnEaphgATJN5cBwXraPY7h6ABhk
bHxknb5Q7+aEJz7MRBNwEB4Y1cPIzdJCsBc+UcdwEQYAACeCRBQnhHn+HcCRigYHcgABmCUDwAAL
AVMuAsBZIzjMhACPk9QfgohkAAAUKqtwtA2HyAANoaA9gAByGwR7SQmoGAsbVYA2T/BODEmULAfQ
7mUCKUMBqWjkGEW2LUOxcRTgNbqHQMITgAD0FrD8OgkxrgAC8I0SajR/G9DYJoiYeQ+N+HaIYOQA
BXAdCeAAOocm6gyA8Ssf4+3CibCeF8AAwQZKxDmEsA4AA8B1OmEQNwkCzBRCEAABgAj9iWCggYWA
OWGCiDY7oDADnVIuHuNk4IMQlB1JgO4DRoATOFHEOFGY+h9GbA8GaGInA0N+BaB5U4Ax1DBggD2P
AGQunTEAE0FcigEETHcMVhgXg/knEoLYOZzAshlAAMgDqBg5BgCso0GoIwAATAasoCZESWDcFQRi
T4AA7CiGAZQG6dAFABH3NESjgYdoGEQEoZIAA4iOBUAAXIz5QAiAqdkAKMTxiSd0FsWDgRjC1C4A
AXwYQYpxBoKIAApQ3FLAeAgwg2RPR4CIJ8Gy9RbhhAAMcNkAwzC2BQWYP4XjVBAoiBsBpgAKAXaY
AEb5iwRlSKoVYAANwFDZAAFUFkawXiXnSHoJJlxRBNoiKEHLlhZBdH/BAHFDQWB0WgIUJAIjigEJ
GOwYIgahh6JeKsas4weAYOzBtkVb64VxrlXNFw9R7D2qrXSvQABnBtJYM8aRyBpDQUwDASZZa92J
sUYUzY+h6DdAAIwIwOHPDQhSAsBpWq3D9HyV0fQAjABiE2WURYTALAAGaJtJIVBWlxGwL6PACaCD
pGWtAF4UDRiyGIY8QwPqGhJFsNQngMCfgAUupkdKnAsg0kMIAbJUwZHZr3VUeo6ahCdDSFG1AUSp
ihC6WEeo6D1CbC64EUwQlmjBDkD8pg/0ZjeGeeIIQXRGueFcMdoQLjAWLO0P4fJyxpC6YKEgM8hg
JAwOuKoUkzQVAQMIOsbIvSeBQmaFEWZMwvAmImP8fRLxtC+akEoN4040DOY4C+6RhbqXWABdi7Qz
buAAu9Pseg5lRitEcH97w0GrCeFkIIAAKJ2snG8TsUokhBpOH3NAVYlYoYpripgdA0hfgAFAIo6Y
7gqLQcwnSt4/R6uFF+K03IgBRJFFALNhgJIbVvHsOoyYsRMRbE2McHhRBbr/WVVUeA3yyilEyrcX
wHVjCqDWDc4txrjD+M2PsfZXRlilaQJEXK3waheh+HIJdK1IHaHaNRtghhDsuAMCtvwew9A7IYSw
AA3hepNEaLmyAHwhygDoEeCY4RkNmEYIlyYyB+URDaHJnwWAeuaAOARSdcTljIE+wwQghFmjFHcp
AA21zkj+nePgfDJgVBMIGHrVFPx9C2AA/RAQEQZJJCaBPCQlRjrfBID1egvhFk7DUIRJIAxbQ/FU
AsKoAA5hkLiC4DRWr+cJ4Uh9YC6oklAAY3UOwZAlEkEhHgU/EY2cER/wcAA4YpgADCJolYeg/BiU
aCs5YiiBAAHkFGM4TQNDKAAF8NVVRT3qP+CE7IzhTrGDEIJjg6x3Ev0ZV4fg+4rgDB2Hg1woOUDO
Do48VYLWkCXDPSEX4bL2Cq6sAARoQFvhICvhISQt1mhBBK0wApxxtinNiE4Tc+xXil5QCc4jIDDj
/H4S8ZLcCOB5Eoa4eByx+gCUmD4NwkuwBuigBMcxvQZBKI2JAWhHwhAaHiV4QFDRGCwRUPAeymAS
A1vYNYYSjA+CwxJ1xZQqQrgsKoD0p5STWgDKcVCnhVSrnEAIAFIonghlDHeINlwawbSjHWNFMolB
HBxK8L0ro/h/qTAQDggYqBMM+BqBizXejCj3GuxwqO5hXDTV2DYC1bTjj8HILE2QMzrh6FoNEAAP
xqBrVwJ2RIyxbpoAMAGnVB8PxvdCpveIXDiK3OGDljmjnjojpjqjrsoEPBzBbunASgpl0hgDygAA
PhqDggzgpg6Joh+nWtGKqh/GSlwB8AjDxh1GzAYgCERESETAnBhEVA1AYEWh1BkQQwRwSwTvqGSG
TB7QWwXmzAYOEEXEQERApgML2B8hFCyhZgzAXK4B9h1rhBZheByj/gijWh1BTl8Agg7v4AEgGDat
OqvlIARgZnSAPAaCBhCAkGVAcAnjRhdBuDegXgGKqmAnChRAsDWhbAohZGpgrmmBOAsrKBegoBak
4guptBmhMjrwywzw0tEjCgBgCQ2w3jZQ5Gdw6icAnhfHIBuipgXQKGQrjlNFOArlPFQFRFSFTEPL
qB1D1BMgwmdBQAGwSBQgwnGAeApDpgCgDiJgEPfjCgCgCjMAQk6AbgPwXBAhKg3jkhlmCmDkRBZh
nFrgSB/iThahLF2g0hHP4HsEtB/B+nfB+ACFvgPgomGBfhFl6F7GHl9gAF+l/gEmAj6mCGDGEI0G
FmGx7mImJj1x/xtAARuGOAVRVq9Q/h6h3j1hwErh8AHk6ATALiRh+QVh8SJGVhcCNhJBDD/ABAzw
SAwgHmXApg2HLRjCJgDw1gEjagGgPGrAiAaIoAugsiwhhBJBCAAMtMuAnE0hphgH5hAJxgrBPDxA
iAFhvAAG4G5G6G7IJm8yqG6hXhMGdACswgAMxsyhQEVA6A4gZCiBFD/AohOiNgpgTCVp3EFBRBDi
jhyh/gNgAAug8qGgNpMmRswHChlBeNeBKCnhghnkrxOlfgigtv9A6g4ndBpBQJDBlnRCCHmAAAVB
+EuhUhGnJhLhUDzBxx1CWB+lMJVAQIsA4unA9HzAABehGhDC3B2EWguA8g9DdBzCNt0AAH7n8n9j
Ch1H/BCoAAIHSA7g4EwhxBhD/BGTCo8hnmVACACDng0BEGkA0ApjWwAxmwmB9Eug6gnEbgGgsHmg
tgZoUgzg0k4AuBAPoAqAhJggFtlh+h0pcAlArwSAZAyTZA3ApF6AMgFNljDIjOHIlONA6uOAVgHk
FBHgpCBhTAGs7gygeDlhSBfy8BBA7AaJ+BBlbgFAqunAyArHdAOIhjklwJ+A6OAhMgELtNbjsg/A
8k4Asg+mfAuAjAXgAADiuAABWgvClhSgXFjBLAzpEgLwBEXpNpOglGghChVr6ggASGmAAB0GXA8A
nv9BbgOFYhXBQpmgZgNCVulCngYAlofhzh3oUgEAC0BjCABgQHfS3jWhBhNF4APB4hkAABPBJpQB
QBdB2AAB8h9vrAaDUhOGegAIUFGAbAmE4BHBbpDAiO1jAjjhvBWjYglhLCwhFglhhJzBhM7hehSF
8PvI/mQBuhQqXAfhNnSBmBbqXBdKICiPaCkCepFSZD6hROAghBNL2P/JoAJh8FRhQBKr6hABMDRh
+QhgBgBGrBABUingsAJxTAUAhDxQEAdHUnIA+KVg2B4SghgA7llAeKri5BaLhAqACRIATgipQB7B
+FIAExlKq03gRIJgUgGtVBEBSEfAZIajivwOF2B2CDDq7K8WCkPBpg5r2AATTDkWHnnLD2E2KFLm
TB2hnCjgXAmHmg9BS1PgrgViJh8J3jkh+lDBXA9G/BFhkibhlhsCBhxLVAALWC4huLYIRrOCYBjn
LAXgqVPhahoL6hggpNVBegvk4BbAzqI2LEKhmldgYAnDRhahuiNrorEsVrrrsrtrurvlMhzjJhNg
trtBgAwCNhYAvPZLjIUhxhuBcoXAjwSBDhaCZgugVCVuEr/DlhqhdDPgmA3loAig2nJhDAyiDgJg
Fo/jjJ3h3Buiyg+gjP9AKhMFGBAAinfGAiThfhKA0izBQLKBgBrpQANu9WssW2tsYWup9h9h4krh
cBRoYhDBYIUhOBZjPgVgEqqh3huCyhPhEJmhegIlbhWhFmKCRq5spMqMrMsShMtnLgoMvGRTASwM
yAAMzM0M1AAM2K4iWkFBfhWHJg9BRKhBLhXkygZAHmTByBjW3hLA4oYh5g0oWghh2nuhOhjHNBPh
WlXGmHWhonYHLhWFRgVAqmfUVwry/DDh+B0CdhDHZDqAGqQtxIfgRgFDlhihFljBRhmiugdg6pmg
eB7W34MljBzgMAll8g5unAcATDLgDVmq6B+h2MSBEnPi3B5CHg2g3P9AVAJnVB/gAnWhthejvBKh
LlRgTAoQSAyAimVBJn6zen8IVAhiXtejghihonOgIgiJoBAAznAhyhKDUuMpr0EuCuPWKY0q4UCo
kUDuJOKOLOMUEOOODCtOQGfAwBNEWg9g/KSAggZFfhqBRDYg4BWkZgGBqidgIAzBKiaA1r2AIB4D
RgcAjq/T9ljA7AqL2ALJMVdXOguBXAakzBTEkhng8OqOvusOtOuDfOvhIgii0giApHmg4BRRTAvA
bqvAFIiBohPLtAshZM7hXhMiByNCtWBAABzBplOBtB6lfgWgSCFh+h6D9hkhcItg4BEkFBJBcHLA
eB/sJAbiNAABIBcCPgQBonjwRnGA7BMpmgjAai8wBEFA+AUwXBvA6GzBUA0vZBWglPZBWAoGzBSg
zZRABhslrgRAhm2BVwQIXAKitACB9rhArASCDgdhTJ7gyAVp3hkhjQvATAePZAFr/gABuhimzAkg
0Emg6CdDoAenfSZPwPxPyAfmfBHBeFRgqAWCF02jCh8BqFdgQghCNhUBnGggKheqSAjBNkw1gAAQ
AwBwCiowDqfCsPvnVoojmDnAAA5B/L6hxhWKXI/nVh+BvmdgPDWhHAVg+AABthdOUBZggJtA9ATj
phgBAmKALAFHVB9BpGCgQAjjRjyBbiMQZjVESgAAnBj1Ag2AVnWhQAfk6a66768oKa+CKa/jdbBQ
X7CwlIOB/oUhXg5JRgvBQjUhlBzr6gUayEXBmhMFPgohECdhOBgEBAIQqkThCiHheBsqyIJrGQTC
YBpiyhwgCmrAVgBsJAZgnsqheWqiEAFw/h6HCxFxGgoE4BTgrDLhOAlqQhfAxhdmpgsoJxKOUAm7
dgAbe7fjDR1HWh07iOP7jmO7lIIbm71boAWyHkXRWlNlOlPgoBfazgyAUYErjNHgABuBhjcghgxJ
DAthIRDgyALr8AfAtFjA/BWmXAsARpMttIos4F6htRmgdghpgh2hixsyAhZhlDPgEBrCjghguHJg
vhDqKA1iwDkh7lDBhhMJmg/BqG6hiBSJEx7F8x8Bml/IRsOj6sQGDMRyBGGB2GHcjyDGKBySE8Vh
pSG7WrFMpBkVPhJgwF2hrAkIfhUBIGdcutFB1BrHuhOBBpQBigMF8A3AdnCg5BGlGA9hNGzAlgPR
mu+Cuh2hyyohuh1iJgOgHC0hY4bB3gyFdhEglGmSjmzBDhAmzArBQkygigDorypklSqhSA/yrm49
QytSuIRyvyw3rBRVAhCBAHHhehEHjh5AwloBIgpmrB+B1kRBDBCinh1H7ljg9y+cDLGEZhzBuEuh
0B7xmgKANpRgCh7GVBjhUothQBgCXgeAtDUgKhvtzBnh2mmAug9QSADBaJDBGhaBqgAAOgqXOg1g
iiwgEB3P7BGhGCNh5gMjWzWnHheTYi3B39yA8HmgQByJxzeAI4pH9HSB/YGHPdgShAIvZAwArtEJ
3EtAJgOiHgCB6EVBZBEF8BOhyr2BFhDK/AegWE0w1kPzvgAA6TxCGT2iCAYDlgzg0MdAhpCgAAyA
nETAKKNVBBuv4AmgvGggr0bAAArAioBgG+WlIuG42uIG64zEf0AmThnj/Apg2njhpBr6zgBAYvsh
IuUB2hJjHhUAJprg+A1prgYqZWTBwAABBgoDUh0AfK/A0kwl8g4G2AtA/JQAtgiwr0eCuhUAvjWu
vGkUikw0kdjjDUlpyPKvLiQAUFfgCu+AAB1tnAAAeAuzZALAuL6hWI+iIB51PgWggIRAqBGm2ClK
vAGTuh+h4qhBiBmh8EfgaLThwBrVAgRAZmrAHB//chvhkDxApg3IYgwBJxIAzgPl0gfgoIWg/BWV
PgpAXoJjMjCmF0OAyhiOAhGAfuaA3hIwrhchpunARgHo/0BhjhEqVgrhhPoBlPYAABdAwIBhWVav
bCAAAGAcBgBsqIqAAhpoggBmLQpgBys5pgACicbAAPAt8gB2OSKqs9F8AJsBHoALw+gUADskrMAK
toKYADkMgwAPdpJkACUlKkAFYlPsAKdpEsAMhdHAAB15r8AB8Zl0AGtTskAGYYBQAAaCgB+vBrgB
gMuOjgkjsABgFgQAAIAXG5XO6XW7Xe8Xm9Xu+PV7PZ/3zBXh+vd6XwBgmcYPGY29vx8PIALhCjEA
GROF6kuM+1EBgG6P9+PcAOBcogADYxKEAIpaMgACxkmwAEpCvMAJpbTwcgdwABIEXNKB/EMALlrp
UAPZSmMAE9EVg/ppTgAegxxAA+lemMl/kYALtuqAAC4F4644F6ulsgBOmkogBmlFWgBQl0VAB8vH
srFCIiOxaA8ABJlQR6agqyRck6PwAD2URrAAThiGkAAfAWeIAGOVqaHQEyEiuHINryfx9I8bBeAA
NIhjIpIDhWABDk6P4ABAASiH4t4AACBAJgAFQSJwXZAoaQRgi0ABRFmNYAAW0yqjK1AOj2VT7DAF
8dLm9T2Pc+D5Po+z8LifrDmuX5WAAPA1uUy8GkcK4TAAZxYk+ABAlKY4ADQRSgDWHwMR2xp+gAdB
pKgUBFEKAB3CoTbWigEi+H6epzgAX5WzqP5RHg9xZkUAAUASuJ9HidAAGqZJhAAah+PyLIkBCABv
GCV8HDSSQAH8NZCAARwl0AXxPEOABMmEdgAEKThOreZpPAAMZDl9FRDVwK4Q04SRGEYABkn1OI7D
0PgACABrsmIZxxgABIPhg6wWgOABbkQRLgF8dNxjgpgrgwcwAEqRhGgAdoOIaNYtB8ABbE4RYAEw
7wACqLaSCoGwOR2fcTAEBgLgAEIRhEpoKAUux/NKYUDkKQtpAgHimDyPYiAACLQLkwJ7nAYlkELe
hsAQjIzCREZdFrCIHhiLc0i/QBXEPehEkfOomkrWo2CiHKHECKqigYK4ADqMiIhcDTFvRsuzMG0D
SFqOyIlPrgADsMglAAcZIJJt2u6/sOxgAcO1gAMBNAhBw/DCAAghmDIAH4b5cgAJovpQZBmJYS9a
AAKQZcUApypgFohDUAAjjtOo9iyjJ5GfWopDKzpzhJ0JgFAMQAGiOmYk+FtPlEM4bgAYI2B+93dP
sMkYFcH+5koDYpAAShG9oEh8mi54sjaABzBGNNLE+2gUgqnC4LqbBTCxiBA1MOZKEiAAnBtxRtFj
Ggsjy0hNGBbYbn0W7UiaPYAAyiLNYDoehNAuB7RyIgViDQkAoXgMITwdCsiDFoAAGogRbAAFMGgG
QABfB5BYAAN45wzoSD0+Ymx2QkAua6CYPB5A+BVPyNcUodQABfEILVuAsxqJ6A0M08oQymBKD+nU
PjVgAD7GsKgAAMwnQSDqK+HobAcqAIIzQuY/TfiBBE8IT4HiSCiE8bQFQBjsiRCM10TICwygAGUM
AOIAB8CwaQEQhgABli3jaBgBoBo5DXNZF0+pMiaE2JwZ8upoDDicCsCAAAbhcBHAAKQWLoQIgAHr
JgeCphcCTJQKUZA7gACAF6OGR4OVRCYBsiMQANhMAAGgI15oBh0DLRiDohIlh3rtF2OUXAAAdAFG
e6IDTCATiRTQG8JRlhdhNBLKOV0sJZFdlrLeXMuzwy+mBJcvg+BuJVB2DENAAByALRaKQWoZgAAr
cUAAbQvBRgACwHcngEAwCclgIM8A9BrClAACMH7/wmB9WcIsMLVx6DSVqD8LqNAMhyFIwkHCFQXh
QKgLwbqaAWgLMCPseilRNhZBwAAWAUCYC2Cy4oVIc4Oh/HySgVIegmFNHsL0ntAQAUDoLQcAFCaF
0NABQ+iItqJgAorRejIAKNmDH+oMew6xjOABe1oDog58BTBSeceY8TcDfGsMCUYiT6gMAk6EXA0Q
5AAAsO16ghwoBQAALUDwbz7CPJIBceaFRNhndCK4es6hbjKnGPMYE+AlBsmGK4ZQlgAANGmeQHYW
hHAADobpFQPZLjLFgJooIdVHAaCcsMXgjAiywEtOoMImjAiUFXZMFw+kIiQCg9cWYDgkgAFcMJGg
7BTOhDgL8hIyBWUzHIL5XARA0msEaKp/gSgXMcHOMYWQABdDqTiGcK4NAAFuLyPkdg3QAC0E2IEq
on4ehJDLBIMwRjLAMH2OQ8IrjyCbF2ukMgiTyBVscAARIbA8EGBgUwSAfAnFdG6tIS4dmAjYAy9s
R4i1IixEZBIXgFIJCSDQ1cfI2VpCADvZwHQf32BRBKaAZQrBJyTHM10Ugf0Bi4E2wwUmKwACvExT
MAqlFLKYlGpt5wmgwO1E7DYRovx8IxEMuIcAtCaCaE8NBCwbQ7AAD0HtrQGY/F0NAbgYIjUDiQFe
e0FwanrhpCMB1U4pVtiUGIO8moX8ggXGaK4yY1ZMhMDdXQCgzEqieGCN9UAYobBrB0A4AAxhIiQA
AI8SiqgUhrgkHp25ZBICGMmNaTISg2wSBqP4ZwABLCSniOoDMkg5BqPAOoU8+BHCUTyCoN06gdgH
vgKoWw2jYhpNpqhiwug8NIxS3MRweUWg7BGj6LBdB7jba8FA5w8AaVwC2FkIDtQ5Q2FCO5OIbxEP
XCKCZQYrQ1RxEsOEFyvRP1pCIDRixLJEk5ri2xrbeWwHlb4rnI4xRNm0DeIwWAABugVdoKwTBTAL
DUYCGkROdAghqXoGEJrVxzi7VwHMRBNAqiFniFkFUmQvhkSqFoP0NgthF3OAcAMmRUBfauJ14goQ
zhCqDH0vA9xsnVBiEpNAixaWMCOChjgBosD9HseERgVisiViAG4TgwSsg/AefYKm1RIDxPAI4R5T
ERGkFeG5pAiBiPCFIK13wZgzXkB0GphmViGgCG8LFw4Vw7gAC8JdFIZgN6fB8FDKYDwiBzAAJIO7
WgKDnVUFEMOUwbh0SqH0GQ3gABGCsjQGIa1tiJDG8IfY0j6hGC13MGwfpfidDACgAArQtbnFWD2i
MG2rkDIKQchJCyGjMFuE9JINWYieBmkwVIiSqAjAOv0TYWGYiSBZZMYYYDDg1CPdOQhNSbgAAGP6
LYIiGiWHgOsAAUxKdOEYFgywCwB/cEcEODokB+tIFAJkpgMAJZuFOGOuAhxlnxF0NoQQAASD6GwP
cE0ZyBeC8JIBqA2Aau2fEbPAXAYLsL8MBAaL2GiymH8GkGqLoGqGmUGd0l/AjA8LsHsHiQyDkBcR
gHoD2umFEDMg7AUNCUGHuHWmGDoBYrgGMDaWWGIDKPOEKC0CaNyGoj8AWAQLcCUC2aQGqFEHUOAG
0TqBWH+zcF4E8XEC6EEzoASAKZABsBS/+GMGs9wowTqqWPQS2PaPePiPmPqPuPyAANEAAVKygE+D
8gkEIFiLGAKAELcAWAaSwDwEqXoC+CIhCH0HUPaE2C86QFgCyOqGADCRgLuH+o8AAG2F8EugsCiR
oH6ACIKAQAUAQSyLkVEAsA4ISFYGIXoAsHWVUEkDUaQEsiAK6AVAQBeDCWGE0DwPiA2K8LtDIS7D
OTBDUZqiSHlCUGcFanwEIDuEojcACZKAkA2ZAC0DiYYDkCyB0SaAJBaMGUGUKUOUSUWUaUeUiL2U
mUqUuFETsFGNIFEFqEAY6yyHsHMh6FiE4W2FMHUeaFOEpB8AOHmVMGSFYs4DqDsOUG+fEAyBEBSk
eEOUcC6B8BGJyHS2YFSE0YCDsEk7gK8ZKBMB2rgDYDmymCYB0meHsGciYEWE8GYIEBoCya8DEg6H
+HMIqFEEWW2EqFKF0AAHUqaiaCUSRI+v+BSHsqiEQEOUUE4F0vAALKUK7GwLoA6B8M1IEymCwBuY
4LoH6WOFqEWWGFQGaKICWDo7mCuBuRG2SLmH4WOFwXmAAEiGCU4BoCOkcHuHMMkAgBi6QDuC6XaG
8FwXoEOE0GGfaDysYCZAM0OEAISFAAKIiDkDCb2bJA/MiMabS3iIiFQAgbyDCbmHGrs3ma83qbEJ
wHIF2RoDAFGVEDyDoJICABccU+qWOFKDQfMEcHmB4KKEmhsBKAoPOAEH8WOFYEIeuDuE7MCHoH0R
zEgZiDEDALgFCFQUGFAF6WGHSEKpmF0BwQOrsBmAAF6DUYQFoBuQOEcC+B6IEHSNgEECadCFQHYW
OHvEgAAAuHwRMHWB8/2F+E+nUBMAqPPLMTGHmh6E1DkAAEYFcIqHsHyUGH6H0RGDSEhGUDgCoBqA
AAgHsiADmoYJiHSzcDUEyYCHMEw0sFmGsU5QSMCBkCeKoBIHCNYFqBcsYGcEC9wHsGIsmBgC6fYH
8H+8AGcGyOcGyFK7mC6EKgqH8H8UGAOB4a0BeGAiYCIFg0+DQBuK4GME+/2C4ECniH7S3DYH6KIB
qDIsmEoD5JYA6AWj9GyLmZKHoGyrAEKDudoFIGUyOH5S4AEBsOcE0EMgkCMBWR8G8FIyCCMFWYQG
QFOKoAwAYj8HwkAAAi6ccJkUcJsPOkQy0p6AAFSDEZADCFQyOASAWXgLgMCH/R0n+CAjaD8D8rpE
CUBF1EkFaWGBgDGYCAaAQJYADJ2DKDeSYGMEQ0UCPKQbgd8AAFGDQPADaFYlMBkEAf4EwA0F2ABV
lVpVsR3VzV20PV8dFWCDqBwR8L4H8KIHUGnJwD7OWtwHGLhUqH8H4I6CwD0PIDmDOKQA+AYJYH6H
yMOGiFksYDMDSW2HJKaAGAILcBmC4UUEcD0a0AgG2OqBWCXMCowPIo2o6o+PcC0pGGMCnJwFAC0A
/EkFi/2BkNWqCAwvIGUGnJYHBX2KzX8nJYDYGibYMV7YSIEGsOqorYgPGqUPOMFJ3BgqiDMBNB8F
pDwIskQH/VIAAAQAW6iCgDgXoDeC6wKBEAoXgACNGAAHPX0RiDoNoFSGsILYEXgAiBa9wEgEevIC
GBIJYG4GATqCWDYOyFqGkXoA4HmLGE0Dye2EIFe/+AMAKJwAYAQOMCmCkyOFWFwAkriGUYYAqHQW
kEODESQFAGuJYAgAcZGCECcIiHCFw6KEKF+vIHkFQrSDiGatuGOE+eaHqGiJgDUCGnUGgA4ViD6F
GVqA6F8ymDmGKwKGEFaaRMhEeUGHiHSG4MmE60U0SPqG62SZKAqA4TiDGD2smDGCeIyAWH4QyG0G
EoiESECEGXiG4LgAEAO6iBIB9JYEMECrSBqAiHaMmE80sC6EIiACACCDy8CEQK4FADyNoE8HCY4C
UDENoB+Hkl+FKHdB8FEDkZAFyFAxTgQPiFaEWkkxzHKFbHOEAFENIE+FkQaAmHYQiFMEuUUECE4y
gBCAwUGH0H2JwB6CvfwD2ysLWyyLqPUHIQqFTJo1AFPJwHIfEACAuSwCoDOKYDoC3NsHiggv4EVG
UGeAsKQDKCbGsHIF+niE+FqKwANKaBoBtO2AqH4ZKAMBCd8C+DyDcsaGeniEOEUxSGgAtB8DqDgM
0BAGyniEYEiniGWHULgBaBoXaAcH4ViBcBy5kC4C+9MZOW2EuFRh8fEAEBGkkD4EFfwC0B4BPQoA
PTSLlVwMkF0EcroD2voLiCXHaEiCkZAGWFMvIE2Fw/+HYHoMCAEBYwKD2DsrSCyB9kwAiASK+LsN
ARMGEESISE+H+IjjnMfKuHq1wEsCkhKE0H5PKEgEkSYB+BMMCGAE6YCD6Es3+G+HSMlXWmeC6Dy8
ADcDAPAA0HuZyCWC03+CyD6No5KRg5Q5U5YAAFmBjOyDIYQfA3cLs5s5wCUf4EmFwYCCABIAqItP
8H6HmygD6BwfMFSAcSQFYFeKYBKH4h6EqbiWIGGlEHuH0ZKH8A1PKEMEaNQCwB0A0AAGeFQW2DGE
GTqHiHqyOLAKIBkC8UUEaD0KoA6HYumBoCUhsAwA+KIG7eYiSHsRMB4DU0UEWDcIiA8AgJYGuF6U
cDaSiIMHyKJSORMCSDUQOD8DmfMBBkCkmCoRg9W9awyIEII4AFUJICEFGIzUMOcAIGyumDeCkhsG
CHyI7pGR2BYSQE2EsRo5kl+BEB4JhUi+lUpGYVWFCe2CGDkWOFGGUPICEBFAQAJVwJyHFMCEUDeM
0E2GSyPS3pGYI0Wee+6lXDYGuPIBQCQJQDoFS0+DMBxVbUrMlt4MFAeMDt6LmGceuH8GeQqLmGkG
gUGBgEmZzuDA9aQZsHmNxaUPOAVVcL1aQUGMikyH4AOVFUUNAHyHsMOHmHsyPSMJYAcAgPPQWUGA
KAMRyGUE+U+GqBMJICyBoY4qbXCGIOUB6DMh6FuG6FWAABlZ4bLu0iSL8iSAMZHTPl8ZqZLvGMOH
oHiMOHuH6ZKAQAYcGAcAaZHi2LgH0HmXuGEFCv+EoAQgkFgeMUkH2yOHpQQbQLfaKAUAYZGLgRyH
wHoMOHiHeMkH6AFE8AeAocHCEj9P8NDJ2H3wYH3wcSbuwZqMDS8yOHsHqkzpqRzbEABvW0Nb+ILy
UMZSOKJxhsByhCvk3F2o6H2I7q4LiAVE6LeZpVIUGYwyOH2H8j9zjVvaQcWH1xiHkQyHpQTurARw
+JxxFDZaTxgNJywMPQSIKAPaWIEIGu2AGfEH4RNPmRyACAIXgAPF1GYUGHyHu6LumNwHyH8LhD00
MAYAWVE+qKIHxr+ABOOZKL3Dwj8AP15KZk2o6HwyOH0UGK6AQXgAL0xuyiT1rhYZLDwfFz9E0j8A
RF0H7XYP1zeALE50uNAH6Hw6KI6JZ2oJZ0xzFuf3OPScX1MP0AD3EAOLcH+HwNIHz3baVb++oAEN
BEgyOHqKIAB152Pt2o6L+jk+oAAAUATE9t3DYiT2+AAq2zdQQIKATw+Sbk11sH2MDU+VEjkkyH0A
JE8AV3ecWHqMP4/5CAPVvXWP0HqNwHiHgMOH6ANARE6NBE0XgAXCE+p3MPThX3l4eHlu7SMR2AKZ
GAcAcJx1DzDDaMMNJzzjEAT44H0kz6DsB1WSaAe0MAIH8I6H2MSsb2pS6I6Hp0EP0H+6iAmAkJZX
AI6HmHgU4HqI6XUAi6iARS8u3D118LB0AOWHozd6CKJ0+POAZ4r5FTR54S15X1K6Kq4QyH0H+XgA
aAb1cASj8AJ2TQW6L36ILxxVDzpQX4eHqRzxuVFGx8QMCH0HsMkHv391z0+XUASXh9MLp7Z6AQyH
uH8NB0wj8Ab0sMgI6AIAW0NCGLiH2MN4eHmYyAe6iAcAEUGHn7L9x90AF95991p7x+Hs6MbVIRyH
yHqQyHgHekyIt3IAGZGAaAgZH1DVuLtS8I7++U4Ht4yR308IFcuXV7CcX7GHsUGIACwaCgAAwCAA
A/3+/gA+3s9AA/AKCwACgMAgA/X2+QA9Hk8oaAQgAAmEgMAH9GwA9Xi8AA9n2/wAAQCBAADAgDgA
CQRJ4jHHo9n6AIFBINCKRSaVSYW/AA93m9YbS6VNIwBQOCAABwMBQAAoPSoW+qfQQA8nq95mAowB
wXOgYCq0BLBGZU9nxDAUDATBZQAHzD7O8pc+X4B6IDwbO69DadFbjX3++wA+HrUno93xCX/JwaDo
I/X5DARfIS+rU+H5NgYC58/bJD7U/bYAAQCYoAX69sq+5ODAZJ7DVKXCoY/Hzm3u9qk9czKAEA52
DQfRAVfa70oPMn8/Ni9d5Qc2AQHNgSDMWCwRiLBMuRasvmwABZ0DgZB8DUnxHAABAavoDn8oaYvM
BCMOQskCIqBKvAChSGpUfJ9uOd5xAAZJdFsAB4hSKAACOFQKIacxlAARpGlWs4Nh8AA9D2LYAA2n
ziJQoZ9Hy+DwMAmL5gOvrcII9bpIa2J7LUyivNvBp9M2er9oivwEq4/q6pm6QDPWmZ/LIfDnn0AT
zOu/rYJee79HyhgCywAADK6goBulNSbH8wKOx1CSZAOvaKgW7C6JnGimJ+tSHo4foEr64M5n2zZ5
nmeLKn6mwFAWBibp4+YCu1QKkPcfDeH0AKvAOAqvAHKqmIYwNQH+6Tbq1TSEO8jh7UeAB5nuhk9I
IBYFoIrkGsml57KcrCTuzTqGucAB9AIrQFVJQFAn/MigqcBExU04aqWoyqzH0f6vAUBrEJsobArU
eJ6Kkfx/JkAtxgABrIgNU6IyYp56pddSyAItyiXmoksnybRTgAGIlFoABGFcQYABsCy+1ak63sXa
CTyq7rYsIlZ9IYf4BK8BzFNtNqvwdZR5sAAleAMmyaIRLbwn26S4sQAKUsqeuVHkeyyIUjDSp1Xt
y2EqKnL2vq6W2jLUJWvKdsiAtUU6p1VgAeB5t4hV3reAAHT6+d7WosiorVbDFgLP+mU5tu3bfuEa
PAeyZbjuyEGgNoebcGBJmJu/AcDwXB8IhDYKkZJMi4AAlj8YQAC+O5DAAEh/GuAA7kUUgAA0MpPA
AaJFicivC9LwKhnmdpsAAUpEF0AAfEAOIABUinTdv3Hc913fed733f+B4PheH4ni+N4/keT5Xl+Z
5vnef6Ho+l6fqer63r+xwJ6HOaoAFaSI3AAQRYnWAAxDFGBnmCW4AF6d4NgAOo9j4AA6CUFM2ez/
X9/5/v/PGHuNYUTBwmCfAAIsWopgABGBQBkrbbH/wRgk8xubdYJwXeGdwfhEBnC6FaAAWYwBmobA
IBdg4QAlAACqEYGTpIMQvhhDGGUM4aQ1htDeHEOYdQ7h5D2H0P4gQzIYPUd45QADIF2LIAAuhmDg
XkB8GAAAihGCCwcEoGn8xBi1FuLj1B+jue6KwWY2QAAyCWEgAAIgJlGghF2Nz2IKxvjlHOOkdY7R
3jxHmPUe4+R9j9H+QEgZBSDkJIWQ0h4MRxkRIuRkjZHSPkhJGSUk5KSVktJeTEmZNSbk5HiRUnZQ
ShlFKOUkpZTSnlRKmVUq5WStldK96cn5YSzlpLWW0t5cS5l1LuXkvZfS/mBHyWUwZiTFmNMeZEyZ
lTLmZM2Z0z5oP/HKOYdEFpozXmxNmbU25uTdm9N+cE4ZxQTHWO8ec1pxzpnVOudk7Z3TvnhPGeU8
4/TlnPPSfE+Z9T7n5P2f0/6AUBm5PadFAqDUHoRQmhVC6GUNodQ9/tBKIUTopRWi1F6MUZo1Rugc
5qC0cpBSGkVI6SUlpNSelEO6JUppZS2l1L6YUxplTOlFK6aU3pxTmnVO6eU9p9L+m0jzukcGwLgT
oABWDVMQFoNYYnKH3h+PwfBIBujEgUMIfwRgABlCMCIpSAiODrG2Md7wqH2DhHwQQFwPgmAACaEq
FpOo2uEJkowd7oBei1AALYYkIx7gJfgD0I4U0Pg3BCX4g5sDeDeGQLMAFZhnkIAWBUAAOQpVOCIC
oCLbqpVUqsACrFWquVeOKS8dw5gADKFwKwAAvBnxGAkCMGIAAhhLhSC8Dp1XCj5HgOQAA1RlC+AA
NsBQQAABXB4B4qhQx4jqG8AAYAr7WDLG8RADALrjBPCkEQAAHQE1zbuUOIo2gADDF0MM+YNgqAAC
SCsCSyR7WntTau1o0x3AABGDUH4AAhA/BwAAD8a27j6UgNoaDfxcC+GMAAdo/LKA5CFGgHINATgA
AeAYsI/MCjMwQL3BY7QBwmB2EMJIAAdAxBKTcmzpR3DbGWAAXwwsXj/A8DS/gPwbEkRmUgfA6ryD
DF6LwAA0B2E6B+EMIrDwVQmOIPoc4zAACnFXkIe4Gm9hQCJjYDAECtQ3H6yoaQw2FCtFdY4a44iX
AMA8DW9gVArQLBqCbCyDAADrGjXoVYzCZBDCQDoAAJQN3vIw8YfI7ULDpAFCYDWF0qXgKQP0do0Q
ACdE1i8HQYs3goAsToAmjpGj8Hg6sT4iBD2PGMOwAAVhCCXAAGEHYHE2L2HwOEYDCxLXoB0GZ8IP
gRacZgjQeA0wACUEQKoAAIAwhowsMoVL7RsEgBmFkNt7AVXvaWjQbItajipGQO0AAPAwBnv4CO3T
gB2jVyEKATgqLyjKtQP8D+KQlhXcWFoJ+NlLaecAZsX4mBEAAHAC/ZQYQcgYVlXcb46CEAhA5Zsf
g5xigAEQJLSQWg/hpjSAjfUEz3D6vuMAUAjdhi34iBYHD9BJB3u4VrjZCV7kgGCKESoAB0AvDHcc
GBWuY8z5qGQAAW2IPFqGAAbQvIBi6HaC4AAZ+gFbWlT/qHUZ6VBd4AoaocCUDPGkUoaQ0ChgmEYM
GC5DB8Du62H0FF3BSpqAAGATWCxDBLBBDssYABri71YEYNAlL2CEFiAATYWwVEJH6WocI0BXgABq
EsOgAALg9cWF4FhEBGCbfYCUM2rBhB+CPYiuhlR4xGFsIMJ4AA4isfKE4NPWAMDj1qJcWo1r2B9g
+JgLfcxoiz3+E8ObmwjBh3EBscorrHjELUIUVoyIVAq3KzEfZEBsC+qP3rvgSe/eA8Esn0OkhTiN
DXsMX5EAlBSq0PMYtRxoD7xsIIUHfwi3ebsP0eo6X2is5mGkSIvwABYEBAYQoJwEgpAhgdob5x4T
wQC9YU4aaBwKIIwIZ0ATwXYs4GgN7SYWAMq7rDBwQfAdq54WoTgPwAAOwVAcL/YPb/wKgEZDYcr7
j7z8AiAJ4IjOQaQYMCQCAH7rAOoPAPQAAFwCbHYpYfyu4YQRYRQAARQRZDQBAIBFgEYAgca0AXgi
AIAOQPEEQOyFoZ4RsI0JD4kJaKoFQAjbwYoXhSAHIOIOx+IO7JICbFZuwfy+4XoRYRaA4RTVgfYJ
wM0EQPAPJD4E6zYpIdIZhFIRTUgAAUQXpSwMYO0PoOoO7EoCbQYpIawVENINYQ6BQAAJAQgAASYN
69YFgDRSyGgtQYIRoLAAAPITLWoCIHJGAH4GQD4AAcQUwUqJYbaJwKQRZgwN4KyrQewX5+gM4QAx
YOwSYMK/gHZ+ENx4Jgj0wHRDwCgQLZoNgIwFbCwi5tweyATEwKaAYQoV6AYIgE6LAA7lqQ4bITzN
4JAPYiALoODzoIAKQLp2AEazba4jrYQMxhAAAbgMgUIAAWQOJFhRRGgbwVapwIYN43gUoZgSQAAb
oOS/4PQXh8oBIM6BQZoPzEpckZgpAb4AAQYEgIQAATAdrVAOwWgagAAN4HcWRuIZoT7m4JAOTYwA
4HbjAQgLTpQdoacWwRATBv4BYJLmYaAU0egkcc5TgiAUC5IAAUAKp9gYAN4F6pALcWQPIF7v4bYO
y/4egaoTgAAEIHj4gXYcavQGCqCG5LYAAdQaAUAAAGAJUHgKINsHgHYGCrQKwJca5l5uAmQfQeoc
4AAUILrPwYAKZDQT4J4kYUAJwG8gIKoWAAAWgNIGZ4o2AiAXwRwMB+IUxDwYQaRGCuTqU0s0ydrq
h3bqzrAfzrTrjrwADsDsSCJagjgcoXwSBh4LbWoKgJwiAXIccVAYwXINQkjp4mQf45Al4iRgRIYs
Rbxfo4I/pTs5LmgcsKAf4kQAACwDYkaqQyhZwk8vxaZe7hQXISwQLtoQMWwBACLgwKgRLv4R4Krw
YfYerVAZIT8PoNQTTWAWgZ0EIDYfpSD3MIwLwQJlQVQZEh52spQsQsgdAbq4QLYJZ2YIATK4QPoI
CBwfQeb+gXgSrjAPIU0B4VoXQHYAAVQLgKoAAXIIoTDGAO6KsDi54UwPIJoAAT4BAQq1oST0oAQe
ZCwWQSphwNYRJFM9s98+IAE+bwYhqu4YwXUgANgRCxwOwShFILAF4xYcYY0CQTQOLkQfwPYTIAD/
8AJQIpweAczYQUoSLUoQATR9gCIEaKIL4QaAwPYJMAIf7QoAAYgWxz4OISB18VT4gKdNAagXrdgQ
oQrZoIYRaBQMYGxEQfYfgygfof48xeosVP1QBz6y4QQAFOlO1PAAAPYIgCYAFKNKdKsEVLD/YF4r
QYwRkIwVAZYkAHIOsNIK4GREQfQ0Yr5MAhAdqEYRYRByYcIBbNkR0PoEoAcEtY7UoZ4eqBwM4KbN
gXgTzkQdIC0kkR0HgEoBpSAXwRYRMyga4g4IQO0NIJizRuwfAcaslY8WwYIaMlYAYCsFQHgJrm4O
YMTPwgghAdYZ7v9czUoT4XJ7oIQMB2YO0HYAAGYC7LofqIwTiy4AASQYasgDoNUh4RgNi9YFIDEU
aGQe4bhFoKzm4AQJsKwM4LDJIDoB0NwlwVoKQLSA4cEa4QwTrrAEAdEh4NoVSygOYOYK4AAFoC4r
w0YrQkoxZZAn4l4fpV1TgsBpgfIeojgAYBQxodwZzpYIlnAE4QBgwNAJCKIBwA85y8Qc7+ge4AJS
wBId8CQIIKTdgRIV4SYAAIIE7g0DQs4dZ8oe4foodra94CIBpUxmFrA3lrYxAgxTYhFxghIAwxBU
lyIjJOofYAQxAlApwrgk4fQeR8odweghgBgCSygvlzBwQfgqQdIdoiBoDCwC69679tbIYT0VAKAP
bHIX4bLaYEABzlhTgY4STJILAQ0qoXAbVUQE40Ar4pT+gSYEoHIAATQKwSNVYPxFgXINjGwOQWDh
Qe4fhxYXIbrkQGACQgkSQeoa7ZoFoIzaYeY54QUlQAANMlxtwegbQUcsQG84oI4Q4XMp4NF608cj
4W4P5h4LQRwAANoWMkF7hESqQiA1YigBDTopSqQzYpwmwBABAzYUAJruYV4JbIQWINB+ATQHjOQU
wKphQXgN7P0vxLoiAAg1ohAywiIAmDGDQ4mGwhABGHzDIiAdAdCu4foAI34B5EQB4Bk5xTxBIA4m
wfgdswYeYfpSwCwC46uBAhE2sfoX83IIoMSEYV4aTZoGICAsIhYl4eDbwdxJwr4iYAACQC6zd4mM
Bbw3mHAvofwerhUwrPwX4JixwUwMQFsARZgeTbwdYd1rQBizYDACh2xGg7geyu4c4dZSAAwCVVQa
gUzaYOwXaFIYIVjN4glB00+VmVqZE1J3U1brLrYpLrrr7sJ/6uoe58oVwOC/4QQA97QWoMplQHoJ
QOriQXS8gLYFIihLYiAZoSxGAK4R70oZ4cMZAB8tktyo4GwKLxIVwap9gFYfLSQRoLrJIR4Y4ylY
Q+YEx/AAwcy5WcLZoGUtRGgoYewdSsgNQHEVAHoSIR4AAdwUeBYbQJ61jwLwYfge6+4Z4UwPpyAR
wg4UAX97QGABZSAYIT8EIOQTJSwVoZjUoE0cxwghhG4lwbIZy8gBoEzNgEACY6T558oYlMElgT0q
oUgVORQQoLIOYAAJ9W4AALQFQghLYkAbAXVvQKwPNlAVQY9GACodD/QPQKMCoHAQ0Tmgmg2hD7Dw
YfIdy54XAUCo4S4XbCoTIUEB4eYcK1AkSEwD4EADom9v5tofwiAa4YSD4SwQUsLm0VAcwXS1gfIK
YTdM0AAiIeRCwXYVEuAR4WKzYToWQNi7oAYhgdAaj/QUARRyYdAJzvgQoHJSAVoRoOQAAVIbWn4V
IWiwhSwylLuAgTQODf4coJr0oEoc+AgegJFMoPwHgjGsesus4AGtMB4eIcZ8oBgDDWADQDFVWDIg
4dIZOBwRQRL5QB4G201h8y4f4tAqZSZsAyocyyNg4AAbwA0a4LwIkWQXYWLSQB4GdnAOYMbNgrQj
lWkIwSQXhC1XWZANoIbCsSVNIAAbIWYRlJgWgbq7tfgiIaq1gbIfcFVh8PoGACok9ghFISIVxv4b
odEEoAYCCBwG4JDxu/8FVk7xIKoMsgAf4eDF4CQKByYPQMqwgFMUSGgfVlAQoKrnwcAFIKR8wMtn
AGemDWIg+XckAb4dog4DQDzgweAYMh4MoPtGAaAbp8o4gFgLkTgUQQsDAfAWb74KQPgFix4YUDAF
NmQhobzZoHAJmwwQoVzvgdQPdFgQoYaJweGdgNAUbBYOgH4voVQN70oRIWxCweI/gpckgUgY+wwI
IEAtQVoQL0oPwUS54eBugpQNISSxwOYKDWASYIIKK4YMGgQRgMK/YCofjSQKoHtnAfALTkQToNar
QCwAXBQMgHvUYEwQ9/wCgSzm4R4faygdIZzrdPvRIhAQWNAAAMYHsWRevARGgeQbivQOYI8PQWgd
wkAx4pHIHPs3IDIYFFgJ4QTF5JwhghDPwWHBwAAHADQxc5wpIfAbkyYFYIMPQNwVAaF/AHKBwi4g
/ejZve7aYP4WMlYLIGAggVcnYAAVwD0zoA4U4SzEwVAZKrYHK5XgAAAY4RLJIMIb+RQEYWd/wJIV
TKANl/RtoaQTCFIIYPLFIYodc3IE2H5Gh8oYYW7SQDAGK/4Erg24gDSw4eQWK8gOoGsQApHli/4J
AUcegbQYoL6pGEgAGEzIRhzZXl57opIAoFTf4aATQxAFYHksIW4cbIQagLLuYQAEaAwbgSCts8Yd
bWoCoE1HAPoYBCwKweKBQFoJ8Kw4mIYxYQQV3fgL3hS1IS1FgJwQLbwhBy4BIz8koYxCwJQDg6Qh
YjgdAY7kQFwJjUopItwxYPIVZx4DQXoO4AAMwRp14pZigBsDAWYaRyYE4AjhQTUx4AAXALhhQVwK
6ymQYAGQqxwUgLzFIaQVdc4IoNXA4pJkIvoGQMdvQUgQ7N4CRnIc4Y8uAKoJ2ZAbRdopYA6zYEQJ
cIwX4Tto+VWV39f9iaOWB3OWU1uWnpU2E2R/06oegb+AgJwIAgBnABQU7QABnF7yACOJg+ACrIKc
ADKP5HAACfT1ADNT5bABcV5UADOXBcAAKfz6ADoZaeAA5Ky/ACvZ0SdSOJIAMyjGQAU7HQwAGgGb
4ATx3gSIXoqACzasSFoMAIAqlVq1Xqz/AD0dTcACiNhRADPJ6qACbLdMqj8ADucbMAB5GhLACufU
qqwJCYZABTSK4ACPJYirGFw2HxAAf79fAAdLMWQANxbPmOMiXACpKj7AB8KZ1ABCU7EABaFQPAD+
fbzADbYSfvpwZ4AVTIlwqBdTqlarlesFislmtFMeroa11ShvABySrIxIaAAwHBzACaVxlAAhBO6x
NYf0rajBACkRaEADvKaZACFJwkAD1czTmagRd1eZWAClQ90BIAqb4PkV5NvqVh2CuABQkMGwAHKa
a4HAfwQgAIgeBOAB9HMaiHkiQraGqIyFkQwhdEYQYAHUKT1D0GyVFc5LluaxIagAMA4j0AA6jwIa
TnYbIAGgbJzAABAMwsGAUOgAj/NSehwAAWhFkSABGkqU4AGwCQiOWPEbjCHBxsCRJWAAe4QieAA7
DuKYAA0BKFGOT0pEcU0fBiMY7OWLIbyG7p6ycTxFEOABjHYC4ADEOw2qoXpKAASZeTAHAxjuAA2i
HCx2meUoAEiVxosUCbCH2bhxIuDc9jqO8znKUYpMCdk9hOcpataDQyAAOItVcFgNAY7tf2BYNhMO
lRpFZDo3EKUAAGqcB3AADwWiEAAjCaJ1qCQiwbBMvgFgOAYAHCW5FAAMg+kwAARiqPwADmMImAAf
JmFHSo/NIOhSEqAAQGkPIAC6TwYp8UAwAAEoMAcAB8G0VIAB0J5VgARJX0aHwIycNgji67I+FJSo
mhmABtEwKoAC+R2EkGVagiWFjOFSPFrkGVjCEqXxNAABhcIEMpHnuuJREkAAqB26BqFSQOTD4UQA
DoVDSBGZotAAOBfvwVBKoEDBxrMH4taSdgPoEXJSUUDhz4iH4rmHKZaEEAB4EksQ9FYFIAEMVm3i
IE6tFGNVpkeezQGIVDsAwBYESWwp+KKPYUiC2gYjY5A1AAE4DHC6ozospVbl8bzlHgU1bi2VIdgA
WRVjFdIKV8AyLsSdrqiRgRJBroRjj4ugGgOAoAGORMLC6W4vgAXZaDlfYGH6nwsBaABdCRdAmm4g
RAH6R9Bj/3YCcyOIU2mFZL3QZ4zIEFZRtINQdg+xJ6AAUAtsIPh5Q6bBZ1vXzuWGqv3lADwDwAB5
CVG6ZIF4ESrjXE+EoAAQxOquG0MQLAABWBNBATMJYvAACxDIBIAAjANshFoHoWCTw1p7AANlZYIQ
eCueMONWgFBhqUBiFpUouxxpWBgVIAA3xWBjAADYMqvhlDncqH0D4OAADJDmw0Z4dgigAAMO444m
A2BIAAJcfyHRlCiTWNgToaQABREILoAAexOi0AADwC4B1oAxBYAA1D+zFD9HyAAbgv3shEDFBoUI
xSzAkHGbAmAjQACCFcQYMANIEDqGrCULIS3khXFgNIAAYQTs/FCF0HQABfhMMiKAK4FEESck8EqF
wkAbjXAADEI4dAABoEuLtpoTQTAAHiNUwAcwmBrKoIYwAnAkmcDwC9eA2gyKNFGHmBg+xnpjDCFZ
G48gniIAALwSSBwFOKf5N2b035wThnFOOck5ZzTnnROmdU652TtndO+eE8Z5TznpPWe0958T5n0O
sd48ytTtAUNUOBqRnyWKsNIaDzATCMPFPpYRqh7AAGkKhyoTw9jkK+MdiIMwGEaGKJM7AZxNANMy
NJhoNQFEaI4R4kBIiSEmJQSolhLiYC9AAK0oDxgckWGmIYWx+Qtt2NSSodw0F6AyCiLkpo1WGlRj
osA3g6kfFgJEcEs5aQAD8HuPEiYrJrBZD6lYKgcT6hFAuOwAApg6TWGmDUNB+RQB4AAaep85R/D8
oiOAYopjShXbePsHVchXimiAAgchMg2hSOoE8VAxjSmnNSas1przYmzNqbc3JVTvlcG0V8NlVSy1
XKYPYdCPhYiUNAIUXSzwziGIkGgHqhhrC4r4IQQbDQNB0X0JF503XmDoGoTI8igj0HqPYe60h8hZ
CePqKgc6BxTiTgYf0qdpDj3LEiT4c0WBSiUCgzmbhVB+j1HOAAXorGhCDFIQYRgpVaAhHUMUnwjm
kjrCqJsAAegYkqtPam1ZB7XEHBtG4WAjFyCkGmAKMYdFKBhB3AGh4+B1wpGxKwaAxZaCxFhC4fYJ
0zh2Di8UcoqV9CLEcXAEISoGA0A/KwXYso1EGiiG0PC/g5BZZC4kxEVBYgAEUIgTsuAOxRDkHMkw
AhpitMCI2FwAgZNTRySYBA11NiPFOp8BwLYogZHILcsY7AIAACyHZW4xQ0BeAAA0LBygIjSXQLoB
yBw3BdV2r2h07h6DnK8M8ZDbBgC8hcKkXAyjHDuoiD8Nb2RDBsQOAcZ4jpYidSUHIPbBQggxA2am
GBfQwMNDYJVcgHV+kfYCwNgrB2EsLYaw9iLE1GhBBAs8O4O01ggEMK9Q4QlDC0CyQ4UgOXsidDMQ
4DADXXj5YYAAHDEGJCvRMOALkExehUXIJMNbkALbGKqOpRwM4ojDC2uQQ4N0wBTDGYARot1GgRF0
v4LwhxZmOHi6cUgy78APFoXQNY2wzF1EEWIZQdktCuBYIxTgZAfgA2y74bwpXVhIE4C8AAwRZtaA
Y4muo9Rrr0BaEZ5IixejbAAE8EuYQCG6HwNciQKwjbxE8MVjwFRhRACgJ5yAwRZBhAABji94TEjh
FqpQIAZlnioGeJAAANQHJgDnx0qggt4iGCq88BIBGfimt6K8JBZhHApPED8KaPhWDVeyCgcSywWh
KdkLUZK1xGA/CbK0UBpA1vsMSO9+ATQSmdAAoJ+7+efP8feJoHgHWFCVG9AaBBVoFQMgdBCCUFIL
QYg0LENB7hQeTFfBmDYaAYFbKedmFsL1aefU+E4EXCQainR8H0IcbhJg8MIK0KpgBgBvZCPEdF5R
5gEV8AkfG3BwjdR8L5soABOjzRNF0sQ2BPkmpaSMkoAAF+BMKP8f0d6ZkvJjUsVAAAVgGI0Occw8
AAAHAdG4eQ6h0AAHGNs5wnw4IdB+LAgz8pNSmk/KGUcpZOhegjPvg5h/tIAphCnmBIhYm3gTgCDO
B9gAn3hdhEmphQgDkpBYAznZAggqlBBMBjFSglAOFwB+h9DWBchGixA/hmjsBghWD8Jtq6s7wZQZ
waQawbQbwcQcwdQdweQewfQfwgQgp1J+J/J3KAqBh/KCirqEKFKGQfDvh8h6CvBGgjIlBHhrjODu
gCgElfArhIm2BGgngMCNiOiPiQvpKYCUiViWiXgqpaBUhflFBFAis0AmBYj5AwgWswrxD3h1NCAx
ActIA7hoizAZIeH+KoqprPixrQi0AUCth0LOhOgurvhYgmCXBfA3pOjUjGhxhrDIgggqA/jOhUjn
AwAXjUJzI7DWBohcF0AjgyukAOgeDqBWhTg4jsgDDOKpBfFKgrLFhWBljSgTJtjVDWBthfF0ApA6
DjhTjbAAAXLMiqLNh1LOqqRGDhKsD4DjhXBImkhQBpgVgABMhYA+gAASADCph5BxhnCHhKG3hZB6
nirurvn9FgrfrgjxhFriD0j1j2kyB1kfBaBNlGhPBjAcjxhZgsgAAJjdB4BvjSBUBNxzBhAQD6hR
gzAaAAFwDuR8CZBLA1EDhaB6AOCPgylbh8BthsAAOYMvB0gQk1g2g4SEB/BoGGsERxRyRzR0Cphy
BjCJBGhOxhAKAdIgA5gxkZuMJwiVBmhTlyBHhZivAXgslKA4gigJiRhbkxhPhTozB+ANHngXALry
hlByipgYgmJYA4AkELMFDDDWBjFAAABFhEGhBiB1jvjugVAlt+lUkbgbh+DABHBPx2gIAYGpgmAK
yPhjHMgQAbOEhghJkNA1hBoJgAhajQBWgGGSg3gwM6lfQhDDs8ivBthzGfgPgSjCAIgHPqyOh7nZ
BkBTkTA7hHhyidBJBAAAAZh7GmA6BQIEA6g9M0AfgYjoB9BvlaAqgxmGg2hLNQtRguNShTmCGDGE
GFNktWNmtXtYgAA1AdCxAWBDkxgxgdipg/AfmSgDA4Flg8AqGQgIuql4tNgcAjhQj1hSlbhTgxHJ
gZhEMlAxghRxAGgCy3AAKIhZAyJOhNgSETBNgyILhEgjkDgQBBNIB+g8pYAEhBjzB0A9g9uFBCkp
B8g+FKB7A/l6A2O9Jrg1AeqbgWJrBIgyFptsnXhshSj8AmhOubucudueuMuNgAOOqlBThml0AagL
FfUCh+ByI1ATyimmhVjZgeBtDlAphPlpucOdOeSlFgh4R2scF4AXBOhjiDgFoXAaAoiZBPBlFNge
gNKSFwCNOsHnhXAdkrBQgxlfAyAXEQAghSjSAVBfEQA1gBsghiA3ysAzOWAAAdhQrHA2O7DuhkBF
olAmhDIJhrh3jlJSQYn+gABhhTGGh/gaFXAfATHfH/oAh5BHoCg3AavFiqoFEDoHIooIoJoKoLvN
vKvLu81cvOPLPPh6PQoWIXIcPSnlgABfA9NMgwB2jMBphAnXgSAUyFhOBnMJgnkJVPhME8ApA8jY
CsKhACCigMAnpDBjBLPmvnwzKXPpzWlfvsPtQ2CYCZBZhqK+ATB5hmkpg4C6BHhdo7gBABklASAb
FphxBpDnBBBZENAtpMv/JPJQH4P+pNv/gjGGwBl9AlA9NcDDWBFwAUAenIATAbIgA+AhICggArJL
BbBsiJAUgECpiUiNBghMnKg7BgoGQWwXvrTQ2fWf2gWg2hWh2iWi2jWj2kWkwbwiJ/p2QjqCKDCq
wmAAKFqGwdw1B1BlllgZgpzcpENCAsAUvqh8h+p/h9q0BXA7oohCBenKhiBtHKhyhQCTAuwzhoPp
gDw1B0BjjMAcgtL5BXBkuDBjAtHThcAqsehaA0mQ14w1qaPuhXKmAARDVOjERErPLQRsxHh6RIn4
AvlXBiAvGIhUAtxxDFI7hxhuozAhAmk8BAhWjnDTRUpwvsjWBqBcLsglg3iXVvCJBDgznIQYCqjO
B3Bvr5BCAmFFAIhHlaA+gjIAwSh0uJhKq3g5hTAgAABchpA3AAC+DuRqRrRFqrDhqsh5IbhUGhBF
BXqIhJhXF9AWD+i2hujSBRhFk8BggI0Pj9D+WejCyPR9R+LjR/h/B7LyhhBXGhUTiDBHBUqfgZgI
DOBxhjKlBNA5rsh/g/L8BCAk1tCrnmB3xPAABahRL8Bih0nmF4o7h6h1sJhqhghgUDAORHgvg1jq
CmNCBH31lHX3AAX4CtBuBcuDE5iDAPAjjqA5AtCenXo6B4BspaMfjxABATktEcuEjUHmBqBXODBH
hWENASAjmpgegPwYAGNMgZgaD3HEjOXBD6hXBpiFAbg6VugWysDDB+B1FPhFBElBBoh8oLg5A5Rc
AVgJnXh/AAi2BthdrdhHi4AQS0pLgjzbBNTCAAAHTDgAA0ghmfhIhEFNhhhmr5AKAm3uA+AxCxBy
BKGChVgGiRA4gwE1leTQWiBzhglyAwA7F0AmA/T7AugjUWgIHfCrh7hsCzAqgzsegpA+lKAbB8FN
g6hQzgThAATiTjTkAATlTmTnAANRF/TomBBVTqARzrB7hrGmAdApjItXAANYFnzvTwBFo1AxgfDo
Bcg0HThEAPmkhYy1gAANv0l4tktltWhXighzg9k1hVAZkOhOg2iLNio3KsrOg4gcLvgDA3jYT2o4
hmhFuEg2BNrOh2h6HIBUBnD1ACBRi6A0hNuRB16REEBhr8AhgVFfBZgypOhW0XuD0ZttUbUcUdOJ
0eUtvrONOOOPG72Wi+gVoEUCD/hpioAlN4hRhkmPAIhfuaaf0s0e0uR7prg8m7A3h8N+g2h/lGhK
AEukBhg/oGAIgEHXiqU5Le06mmBQgzkFhhA7I4g5B1nIARBfoXAqBaEfAuAWKMAvAVCc1G1H1InY
hjtIAUAlRRoyiigzgapSY7BxtcAMgXM0AjhKi4BSAtNMvMoLhYApYYBYAwo4irBkBJIlAqBdogH7
yF1cPKPOvMIAAABYAxhhbc7UvQCJViPSDooeVhbgAeCJAvArCtBThqM0BrBinKgEBvmIgOgZIgAz
BNjSA+goAXAAACh/CNBlBJCPAwBeCRDILvvnPoQzqXvqX+isvs3HPuCZBYhniXB9BUlbgqBDAKif
BiETAbAPqSB9h5D5A8gWkzh1A/t4pRJSWK2Iv+cHJTQAQBB/rsgrZ8JPBwFBAQAA2ZB+jOByBnqb
BvgAjCATAA4YAbgnmkhJBiFSgoAPwRwS3shHixBApkJPBOptb32lcfcf8gcg8hch8ici8jcj2fWm
J3BtA6OEju2qweB+B8quBcBBHng2hSJfBiBwk8NMo6DFo7hyhfJDAcgwl9BABWNCAXBnqBwDFnhG
BYj1AeADPEhHghs0BVgEi6BYhoGhB9BXIxAog/IzA6hLslAeAHnMg/AqlFBqgErvinCoRDlh3Lxr
3xqgmFB5TbBbBFCRA8hWb+hEBULsgdgKQIhPDKhCBUivBLhfpLAcAEnZBjBVF6B0AUD8XCsIDDb4
h1hrIzZMogBpgISNBBBNEbgNB+DGiVMFABAEJSAVgUMwhiBDuEg+BbCRI0qBgGBvsvA2Azj6gThD
tcBNAqi1Cr3wXMRsLRRpqIhtYDjOg1ukB7gu0PhHAskLBoBYiXBB6SDJBHvvgyAbgLLfDwLhR9jz
x+rjjdmf35oShAA1OkB6Axl2BHAljoBgBQlBBOhkKuBEBRt4qUHZBphjCZBqB9imAtAnOJYljCjv
h1BqbeBThGEOkUGcBCgmFDd3IXA+d4kyd6CFgmoEBPBJGhBnh+pblUl/AagDIChhBmHMgEgPmBAe
gSH3hHhEJrBahuPqg2ZAukgGkwBKhHOkDZimA5g0lXBphYDMBfhyGEg3g5DlAQB4CZBIE57vZLkc
lb4x0CirDvhvhgj6sfm2AJggJYE03sGEisB8Bx0yS6CghqABmBAwgjn2hghcjj5LGpsjNMkoJrBF
BHjYAnBKNcAygnk9hmhBED5VmS5XZYM7WjB7pWBCgrq3hQhiIEAsA+GNgnFLj/B3j5BPg/FyBegA
iLBJBK3uARBxrsg2BOvqg6g9ogTiNMzjzkzllK5tNRDzArg8CDAzhJpDAoAUCtBTApIgBLhxD3BM
Bjr8AggOK0A1AfCxAEguF/Awgou4gChkxzCAFk9KwAGhJq4AFQYA4AKo9lcAJBcCYAJdgJsABRjH
cAF9BrMAGJFwQsj4RABqKU9AA2xIAIBXMsAFAYCAAPNmJgAEQvIUAO0Pm4AL1SGgAA1oJUAEg1pM
APEWHYALtNmMACQKAMAK4xjoAK0WIgAJEyEIABYGgYANlSlYAE1OkEAMFZGEABgGAgAAEAX2/X5y
ABFiQfABKhUqgBQqA4gAVAdwABHkO3KULG8AMRdmsAPVYl4AE643O63e83u/6nVX96tNRgAWko5T
d6PgAIhcNkAF4ahkAAUBXy+vUAKYsC2tjtRYozjkAPll04aFdCTd60JiuA6gASgduAAtCwkAAdqF
jAA2DsP6v2OsAJomigAHtiPoAHdNrkAFgeB2bm0YAAEKKqhFyfQpgAYBzowFYEOIUAmpsPgADmAB
ak2MgAAMapSAAHwqD8AAFiSRwAGgUwsgAWEIgAUAll3BI0BSABZDimw3HSqRTkAxIVH2/QSB4hBd
nGWoABgBjhAAcQAEGCwZgASR9tsMxTGjAQkpOfhvlUAAMhkqw3FAZAADqJb1mmWKnCUNESgwJ5Gg
AYRLCiABuE+LgAC4VwmgAZRcqsB7UPYv5/n8fIAHQZZPAAHIrF+ABWGfRh/lTDIqEOCoAFOYxAtg
Ap1AAWJJKEOpPGmt5GP0SgoApFouq8WQmFirYr00UFYRoJZWgAUQcmwxwhNmIA4E6ABGDKHYAHoa
hVw8K8Qg4PNeGOMLfEkFLCk4HjGlWR4tL2baQCGLLqhIKhFAAW5HigAB/G6ZQAFKVhqgAHQyDEAA
ZAsA9CX9f+AYDgWB4JguDYPhGE4VheGYbh2H4hiOJYnimK4ti+MYzjWN45juPY/kGQ4EdZ3nmf+R
ZRhZ7nkeIADgFrkH+Q0jE0LbkX8fwAHwdxpAAPwXCcABeDKS4AGONgMAARouiKyRjn234D36Ko2D
SABsE6coAEOadjBeA7bGKUSVimOlGAIAYTgAIAbMiY5qz6WZqk42Ek4Pk56HU3RRDYKgAGeJ8uk2
LYVL8foAHseBtAAUg+M4PZSpkvoCgACAKq8QJPkk8Adpseh0cWTovikABXivLpgDEFlCH8fZ5gAb
ZfJ0HgsEFgYEgAC4OIgVRkRKDp5mcio1CWwRf0QAoGgnRo1qUTg7iUAAI0G1Oc7zxe+b9wHBcI1J
+nudyUFlRhBjanxgn2fiMhAFYADGPalDcKgZQ16mCcOdBqUgUhFkOAA7wpiZQEE4Ej3h7jsAAM4W
TdA6hsf8NUfjOQOgpSgHcR5ywrg3A84gcyqBZCbXSKcdbpBSqsAAAx+zhlEv6U2I0RLiArCaPmEk
EIAHvvhGo+NJr5i5vpAACkIBEA5B3JWEwHENR4DMFMscTxMgGgzXAHMMaUB6DZGKAARQiIXifFgM
I1ILghrgDeHgPJSwaH+HaNAXsWBEFiFILlyQAFNBIC6HAAAdg8IZBaBoBS/h+KhFoItdIrhqOHCY
HUjgUgYNJdY+EXoixFgAEmL5UILgipaHUPQAADgYt+DkFkGKS5HtKE7FcJYdCnBGBkb4Y4hDEilA
KggNwXXSAsA1ChlLFB7jnGgAAUYig2AAEoK9no5x4snL+eIM6FA7GYCEC0DgAB1i7dsG0WhDA4hs
RSD4FLSR9DfSMFUMYtCWCWU8EEEEmhQhqT6IkWyTB4qIAAFINYZQADdFMqEOwtkSg/BOv0Xwgwug
ADiJsYgAAJhkFAV8OQOAADVE8HQAAaxHC2J+PJRAPwt0DHaLRlofRcCPAADwE4BAADDEkHuiYjle
DtHkPcvwNgAB5E2WIMwTZQgMAPSYp4zKCBBTyOsLgkDJBmLMBIeVBwrhHnsCAO0Sw9hUSgBEBJ9h
WFdK+WEsZZSzlpAAN4Va+QlCoBqAAX4oi7AYAWXpJR7B8DlGSscOSCBLi9ZaPpw6IgioVFCIgxoP
AQkMG4KYqwTxW1lF+KOtNa4UsEMCJQJCyhGjzmWLkXBswSgNrYak4gsQygwcYC8T6LQzHOAWPoa1
BAYvFHYHKJYmQxnOAUP61IZjYgABqKSuIZQbgaYMPwc5XxDR2DQI+ix7AUhJQmI4RpmAaAZL0X8e
I0TXhMCFMEbA/mcl9B6AALoSUyEIqINQUzpBWIsF4FkYLjAtPtHQL0sQLQqE+L6IOh4yXlgrBukZ
Igp0jt2L+NewiHg1nEFuN6/wNAIpKHeV8PK4A0CYoOX9qREJss5EmJsvgsRniRAAPoVpRgxjJdIM
oTidbNsAUMohRVCwdBWXqLYbCcQODpUgHoLKKRUDYPsAMAq/QdBYnsCUcRyxdgxboMgOgL1eheK8
MoLAt5hBKUEKLJyfgsC4AAJgKUNRuC6IwGELlKhtXaAAAMAzuAghqEoZIPZiQMADcOPN2IAA9A9x
0Po+wAi/AiAWq4AIUk4i6EaEQAA5RfObCaHAUqAhWjNAAFUFUfZc6V0tpfTGmdNab05p3T2n9Qah
1FqPUjH2SMmYwAoasdh/DPZ6X8aQ0HDgmEZevUrHGTj3HwcQfw/HcALAYVovrJx+D6ZaMUTJPhsA
uM4GcH5Nh/j9URoiogPAyaQFcNUVK+sAMfH+oYAA/B6D2cQP5w4CAFkMp3W3D49D3DGIdlsABmBU
Bifaym7TOR7DxZaP4AS/QHAP0ox1k4/R+tQHuPdqAA8fAAASAktWmNwbFNsPUfD6s0gL4cAbYXEo
bcHABwnjABi1ckp4wzXuH89YfH9SbkjlADAE3YanYuHx8G2H0AHmACS9AGODrfoGmR9cJAAPvgwA
GTlq4e5ThnM2Lj5HzuQfg+3KAJAXSY4PTjVbScOP8AxfABgBz4kofI9WWj4H2WoBoDi9AC5+wDaW
5B6D3ZyAoBzuACACK11roLBh6j0Hh0UABegH06NR3zvundxYNHg1DwYBXcAMNOwUfhth4DzpgAQB
oEIT8yYd5VnQAF+gI88xwfA9MG9ocoAwCPGqTeIZCyfgpnTamocpsBfrGvZD8URxZ9RfPb+GX97L
aJnR4yaACAhQVa/YeJ+d8/6H0fpfT+p9X631/sfZYbqeZDFtVas1canWOs9a/aY6P0fRxBlCdNAF
MQIwwABbDodUEY/RrgAD6I2JYGAx5JEOCYREsa1AfUHkHacWFUEYF0XsD4MwBUAW+a/NAjAlAnAp
ArAtAvAxAzA1A3A5A7A9A/BBBDBFBHBJBLBMYy+4YwG0DoB+YC1o1tBOYK4K3ERMF6V4FsGAGeAA
HkAIU0BgB8eKCgCKtA41AhBjCPCRCTCVCXCZCbCdCfChCjClCnCpCrCtCvCxArBTCzC5C7C9C/DB
DDDFDHDJDLDNDPDRDTDVDXDZA7C3DbDhDjDlDnDpDrDtDvDxDzD1D3D5D7D9DcZK+7D/EHEJELEN
EPERETEVEXEZEbEdEfEgYMICgDrd7zf4Ag0HhEJhULhkNh0PiERiUTikVi0XjEZjUbjkdj0fkEhk
Ujkklk0nlEplUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLgUEpdPqFRqVTql
Vq1XrFZrVbrldr1fsFhsVjslls1ntFptVicrmdEFtdxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw0G
XjJbNww+Nx2PyGRyWTymVy2XzGZzWbzmdz0yxOLz+j0ml02n1Gp1Wr1mt12v2Gx2UK0OM2e33G53
W73m932/4HB4XD4lD2vF5HJ5XL5nN53P6HR6XT6kh4/V7HZ7Xb7nd73f8Hh8XjkvX8nn9Hp9Xr9n
t93v+Hxqfm+X1+33/H5/X7/n9/zXvokgCAAfKDH6fqEwOgx/gMBSoADCAAAgCYIAACwEQQc5znkA
B5QQsAAgGAYAAYBwGgACYBnsABwHYfSFACAQAAOBIDgADQJgYAAEgEgp5x+ABzHhF5+n82yQgIAk
RgaBwFwsBgDAAAJ/wQeJ4HoAB1HqfgASKgoBTBHYHQcDgHgRA0uHadp5gAdx8QRIyHRDEcSxPFMV
xbF6GAIAwCgACIHycCYFwGfZ8xedx3SweJ9H8AE4oyAQCz9E0HAYf8VnId59oaA4DyiCQJROCEbA
AfB6nuAB0HbVJ8TjI6NANT8/zNLp5SwdlXITPk/UBQQFRGe9UAAdp41Sep9oLWCKxDAdRSiAR/TS
eUXn/JIAUDKIGAPEaIH+fkuHiesXnofMPouBAEzOCgITOAB7nwAB1nleJ80chNJT8CQHgTbACoKd
55VSd0toaAYDzODIJTOA5+xecp31bZKrRkCQKR1E9OHSeN4nxiaqxkCgMAcAADHpLB0nrRwIgvkm
TZRgp+2WhYGAgB4AAwA9OHIdlW5klMIACAACgPAZ/HzTh+ZmjUYxGBU/AAex9QQf+lssB19gADNg
UehmqwIfNUnSd8C6nZSS6EAYCwGBAAy5cerJXMEZAcCMTg4CMzgNGQAUNThznVDh3nxLmfqCAURR
3AYAHrcyf6EAU+AAD4MSdxaGn6flOHrcoAHYe1OS8koB2uCwKwqDIGRkevWAAbJzHqmu5gABoHx0
CYDU4cJ01Sf4BaFPkBn7j0upJEIAAUBUbAtHMJbbR59wQeFbgBsey1ekPgAJGQCx7d9GoNGOh+2A
HhAAfR/xGB4HX71VOHLXPirHoUQxlvcFn9BGppFMER7WQZ/KjnotxJ42lJTJVooEH2o5SBLAFomQ
sApoQ7R4OxHmm8ACy4HonAsAogo6x3IrHo+ApAAwEr9A6BNM6fmhNfRgQYfY+l4wgY6PyBhvwBJR
BABpJw8R0DwAAPBpUGTToBJGDkfYilHjPGkQkaQ0EED3DMKcqCSUzgoBSBUAAC0iodHWOoAA2B1q
cgISNoRCoykWdmAgBzJAVgcScPweA7QADPHIvFKTQgEAKR0CwETJECLkH03Rrg+h5jxAANEcbsY0
kRREgMCwHYtAeAW0IfDUm+uRi2txd47h1gAGsOpLgCQIgRAAC0DCZx8D3RePltUWwBkFHSOMdIAJ
Fr3IPGuNoAI3xxjnHWO6u1PNaAwBJnC/UCOESkAhaA/EXjnHHHQdC9iKuRQGA4CDJATAWSiPQdw7
5QTTISAZGqNwMgUAABQAqjh8D6S5ORPw/B7OxG4OGRA9pGkLUklECoFZTAeR054dEnxvjyUcASYY
GZizHINO1RwBQEIDHyPFLA5R0ociFGlCLv2KgTZuBwCiUR4rFAAOQdSqR+gHQcBsCqJ2RuXfChFG
MZ2w0lY2AAco8VOEUbSAACrLQAAbAsjoALJ6cOBeqPVc5BgBx7AAB2oAGQHIyHYOqRA4ktIEVgA8
C4EwAAhAkv0BEhgADVHKliC9SypIyA8CKLQFwArxGzWdDsGCGRniITKvBCGlojBGCgC6Ox2jsAAN
odqCANAji0Aod47gADbHci+BaMIzwuAkBsDIAASARS4NkbMdB5WTnyQevDcQBgLQqDEDyAxtjcsd
aFRyy69kHbjZcDFmgDpYGcOB2MNrRkYtmguMxC7fkJtKR8CwHwNgABGidUz+yEOIRGAN34AJYoFG
yNqwg7ohkQuDXkhQAkbAxBWBYAA/C2gAGmO6tVd7iEbRin4EYIrAgTAOQUfQ90CrUIKAsBqZ3nxB
HRGCyEZCH3fuKQi46MEwgVA3YED4A5EDLHAiu717yLYLwO+WpwMwSzGvOlxs0eSDXSutGcew8JwD
WHMitw17o0V3j0Atm4MAQI6HwPReJA0ODhHanq0mGHRwHAuBy24GgEIrGqNmRAAQHoVBVbcAA1Bs
WOjwR58QDQGpOBKB5m4Ah+IIHyPlLg/oDgLe6qaeYABvT2AAPRq2CCF0ISiBkC8pgHD8kQNUcyLw
GANQcCQDKTh5UDlsPlAYF2FAAAcpiwo4UOJcTlbQi+ciTaWfCgMDFQALgHUdgORDvGl6YuMiMDIF
mbgWASo4c9F0sj3lwSLUhGFJAABKCCrwCR7yIG6OteKW0j6zI0yydBAA+EwSAH+8neAG86XqAHm+
3+AIjEQiFwqABAE4i5HC8AA7Xq+wA/olJADEohJJTKpXJZPLJfKgKDwkABcGwUAAE+30AH1KJREg
GAAOBqEBH69gA0m7HXs/JHQJbKqjMJTJqnVZZV5TVKzEQDW5/XphYbHVpXXYiA5wMBIDwA6XC6bg
+JHI7NZq3JLTeL7fr/gJgvGS2b5gZWOX2ipEz2lKWk0H6AHuZlPh8vmLBJgOEIyMQ0BAA8XxJgYA
3wAGc24Q/K6AwEAq/EH8/YhQAFYAAAdxBX7dqDrwABALQgE/5G+4fBau/99IrzuQnFQAJAmBoL2H
u8XdSnI95yAqEEAuFAAIwfkms2HYAHt4QADgt5RMEMk2m17Hjd8wBgPBAsCEEGTOx7DXOxIXhUIF
QaRYHQKPkADWN5DAdCNFgKPV3DPON3wEh4AAeCEFgAfU8gANE3j0QVsAABR5AACIEnXbZk3bd132
6bEDgPA0AAmBcBwAOs5ztAA4jzRACQKAhFwcAwAD7O1HTbOxPFZcMBQABcF00BwD5ZSI/GiO9HTY
OhqE5UIDwOj0JAVdc6jmew41JAADJ3j4GUEO86HsN88mSANwUFbM/o0RJ7wPA+TwmBuPT/PpIZDO
sADhip8I8j6QJCkSRpIAAEwUA4AAYA5JjtOo8wAOg9GSbBJnHVBKABf2pAUj0GQQkxoZiOk6zxAA
4zrd9klVbkCgNk8HQWAtET0iqwoqPaxV4AN/gABwF49QNQnHZI7jwqo4zsd+hlqAdOAdBeowYA9o
T3PC0DqsA7j5rOWQfCBNAVAx1wCPWJjXOWqjzPl+2YwjCU5iAIEWBUAXfNo57SlZukQWBsQEANJj
9bVIm0ABvkma9JkmSNT0qZp4Kwc4/25q8AADxrMQBRA/cox1I21UIIwnBcAAIO17DaO5PD+btET+
zpQG5a9sQFcSYZiAx01uek23cSBUFV05OdRATNZQyhzdLSYCARRkLAZRE3TeR08z4mI/osyoBgEb
HSdiXbHngi22UXAOKjRORDHJxfG0Rc61EkoLeNKyFKGwbEAXBAZvKGZLN0QU9hkv01vMyULG0QPs
/GSP5rXPRHkm6djKgCzPIenubnF9BYHwbjBHgAMg4ZoSsBQKk8LQiBEAAFPRCDLOCKn713ocx47H
QA6bNrmAMCI9DQJYCPM5joAA2TuSHfPPzOg20ZL1chuZeASBvawnBFQjnOI5gAOA8sHogAAhCVtY
FABk8GyNhSiJnVsvOCcQ2JvnMseN8xd1p4WSuRZmyZ6jKGlEQZkaECwHERgbH+sAZw5Ckm0YvAlp
5wYGuyesRA3DJTeMleO2Ano+3MvtLOAQAxOAZPcAAPAcb9xtDyKoeE2IFUXgfAgaEdg5C5jeUARI
kyHmRqCJyccnpzoTm6iuA0CZGQTgSJMN4bqlB3wZdaoJkbMzjObZw499rXWLEiY8bc3JuyTOTVA3
8DgCDvjSG2iYBIFCMgmAkmIao2yOj4i2ZcAJwwAASAogIDwCzJDeG+dw/SiChANAgqOQ6WR3DpT8
PMu5uWNMZUGc1sShSILoIIBgCyowFj6RMNgdRIQGy8OoBY647FOjjHmmJvqhGPwvRZHRjDMXED+H
2b+FxKXoAFhq2R9hETjmzH+ocskepUnBfQc6G5d1rAAA2utFoBUxDlXmAAdg9ioNNODKqbL1n1LF
colkDYFi3nWTEOcdSJh1l1daSqCFBkcx7Ns+1FiHjYuIgwzqRxYwBw8AACcDxbwBsAfwO0pJDi1N
NAKbE3jIWcRbc6SwB4FyMghAikwBIBSIP1SKOUeSEDlAAAefJGEY0jDjI6O4kFCpmsjRZNcp8OCW
skN0VdyhxTns3LsuZ/ZMACgNJoC4DqTBzDdLmOofLmSVgLVCAAFIFzrjpHAXMcy02QxqcQ9AoRyI
MseP26xyhsXLMmla5p6kOYrF6OEh+BiUJoTIdVU6PSLADUkY+5l1NCCgONntF0oVj0oMtcUrNl6L
Jqx7ORYiDRz7BOJKgcFmsrzsVMoi482tpq5nPdK3s2bCrb24LMYMwtuSVGJMWP4xpjzImTMrb245
KjYFCA6CJtaIyOjTHOaEFwIFmjrG+OcAA354ngNiBRv4IAEoQGe+J6huQDAOeMDEDZ1xujbfAPAf
6TAQAhIyjJpJdzmmSQ+AC9z4B1khK8oI64IkYkFHesAfACkBAVH8QgZ45DUG7NiA8Ch5QSgSIgN8
bqRR4uURIBR4wHwGEjG0Nw9j+mEsySzKA64+x6FJHkT5NJoQJUtIuA0kI2hwk8BKCFUY8ByPgG7K
eooC5J1nAoSMa56wAD5AKkEEESyCjwRNgrBmDgAYQwlJEzqAgOgMJCN8caKnsLdZQPZuNgJulkAA
kpJgHAMJPH8PNYiSgAAKH0sAaw6EISQSzJMt4HAFGSbaQhS4AADAJSCB0DJNADj2IQaskYGQNkZA
eP8hg2k/5Oda8IggHgNFvAQPlCA+JIj5HUpQcA9zxATy/mG7WZDhAHKEckyQ9x8tyJQAlTKyycZ6
RMOQdR3wDKZVyllSBI4dmhHyPchg49iVwLIAbOAFkewBJDtFEy5KrFmJmW8Dd9x6twIKAQggEAAk
82isAd+M3sLpAsTgB4CTQj/J2AAdw7lVDkHgSEAYCVRgqA2QQBAB0sgBHswFiZDaC3I4eVU2IHmG
gAYexEc5SSKEZOsSa0CK6IABJHKQ7g4h5EmBABxAQAR6EdHAO07495igJyQCsC5sRwjePYPQAyzQ
SgcVGAg5hEmNEQHYOVIo340AAA+j9oDQgANEMkhVn4CR3tDaKQUBKTwUgd6BDJsLSrMMQAANNrAA
GtWsKsARIIIgPE0phHstQAiR9GSKOEepsQTr6TsAc2JzZ2DhPYPwByAuUpBNzYtmI/EIDZG+exFp
5XipMAK2Efo+yGDSG8hAFkPxzjefAOegpIyhAkBOBgoY7B1AAGwO5MQEQMeRAijOKZuR9jxIQNSt
yUIckwAIAgnAKQQPGAQ3gr7MR+oQHAONIqwyRgPA0z8EgCyID5AEllyzq0WD6HgkX3J35oUqIi7d
3IIgAncGRqwrwEANenBUBMkw2xrXZHaAFJgJwRkZAcaEkTkUWD7DwHcDQYRIwAoNrAVeUEFOPDuD
lPgDcD0JZf3f5f7UNf+gAAAgCEMbeEqHXApAsM/AODzJFDJDhJ1FVdrJMAXAMEQDpDtIQD9IsGdP
GAlAXEETaEpD8DzLADTDlJ1bnAAAxSHEFOlJpN4HMD5FJDYDfLAAIIMIwAPL+RZD6D5IqeZKqAMA
Tgyg0gJFUg4LAe5FJACAOEZAyAaGxD1D8JZa1fUDuKUDSDoMVEtQ7Q9Q/DwgMdQDwOLEpNQJBAkA
lHlAIDzEIgCHfAHALE4AlAdPGAJNhI0D+alXab9E9ALPGAqAZJMVND8HJEeDoJFDsACLNAmAaJPd
zTdM1JiDoDkU2D2EQAVQfTnAGGoSBGsNIAJAQICgeJZDhDgHsABJbLYAIGoDXDjIQAoUvaJN4D6D
4IQi6KUIHGHZ/AANoICAgKjAADnDmEIbEH7QbHBAJUyPUD2IQD1NHAAANAOJPAhAZdAiMHPD6D1H
fipHfSEPGJOJgOoRaEhD4ACJMLuEmD6D3GoDvDvKqD7ANPGFvEMDeehKgAYE0AYAIOkfWjHEoPTD
uDsEIc5E8AJALLNAdAbFvf6TZOPUmDxLxAARPKqD0gaFqAIJMIMI9LreHHYdzJiIEIqIdItS0AAA
LNhD2DxKqdHFJABAMI9aWEEfYRTEiD5GoDmKpZOaKLYAWJPAJN4D3DyKqDuJoAKAOJBD4DxIqDkD
rFJD/bVAALqKjAKD8HfDlDxE8YVFvAYANJgMuE5iOLBDkEIELJiN8XJTnAeHljqJBAERZDzDsckK
XAYAXFvAPAIFCQzACD9E8DoDpEdDnYyE9krEpAPewEXE4EFFENAl2DcDjbtFOHwU9IxEmDiVBRAD
3isAYICAaAOHXRrMLERDyDuEIDiLkdnD9JBjFICAMWPQwQIE5lqdQdJRAD6G/VXVZAAAvAdJBDmD
gKULDVjlJHCEzAAAtAZVqDgeqcYLFAHJMAjduHwgIFbdzEhDhfLTvjjU7AYUuAReHVPe1DyEdDXD
mEMGoJMAtYYNAKzfFOXD4IqDYmkdnYBRfE0AmAWJMFbMqD9UdDVDkKqa6GxAjAmenAQD/JifWb2O
tMaGSDom7JGDyIIjmAAAsAcI9f7FfMjnHabHcDvD9JMAyPyKrDeeqAHToItD+ImDPKWe7MXg+Avh
BD3DmFzDfanIwECjlFCEpnqXaeBEeD3M6cQpXGYW7fhGYW/GMGOEkGQa4XGpYW4cdLonPAkPdh2D
cDzekAnIjAND1EIDNd3VFXfenAhALGoDODXHcD8G5AIAQHlAuAZGhDgVfERAZp4AKEhNtJFDtD9H
XAjEYKgAFaFXvJCYBGAPQAVT8AAAZD9YPgDfGAGllAlAkHlANdzQYQbN4DxDqHsDZJVdppkGxkbf
2IBZUJlieopAgJPDjDdPgS6FfIsALGdVnAWFCDhrBAArDTTMzqdIjqgqiGoQ7HXAXAZHlorMcD9Q
xQvRZD2DzkJMDdne8F9AFcGKkmKjlD5Z7Z9MxAFHXAUAWICS/GohJImqaroJBmJFvANrtPhDsGSK
KLNAKD/IQDnlZG6AHJBAXAYPGARdjLCE8AZmyZODoKUjDGhrYraANrcWMMXj3DsDrb8UfEFktSSA
LHXD8D4HfDuD0Ehbej7bxE4ABD4bQbSh5e0IkASaCAUHXDyDtbCDsGomZOekSAak6AUAHGSlNPNJ
4AcARSjK/LBbuMxpnLLeTUGNIZOHfDiDqIqALIvAbAHJiD7AFEESXaacMNwtGpkW5cScUcWdQcYU
7Y3AZAMEmDsDomVZFAVAZPGAXAIJiDdTDNAs9AAAaAHEhDcDmKqDxmudLAienZKImDUDkEhAhPFj
leXIRazHfJZZSMOABImDRfpAbAjIjNBdXGSAegzdONDEIP9h+U7FIPhacD3iFAAAqAdFvAKs2dkD
cNZWIFpAMAVHlAprJLBDeidJoAZAfHlJvr3RRG6AOE0AqenXaNuGiFru7JOAAD4DtHcdJGoD/AJI
9AuAfFvD5mTAAp9GSAVAdenAeAEKqDSDiEML2JBo2PGDoefjWeiMxAAAlApenAGDqeqDYDxGhAwA
mEZD1DoeqFMEhAJNoHUAVGhDlo5JCnLWKFWHXAoAoEWAOD9GoDbnJImGhAhcUAUAEixNEZuAZIjp
pJZDzDrHsYnEhvGSGwtXaDaX/wdtGfjIwfmO8fpJXYVAAA1AeJBDgDYDlZOAWAawDAQuMJUb5YBA
TtJwDASGhDexPJCAEI9A1ppHtvtDTDrE8PvxTPcxWHsPjERxaIjYYxexgDpqaEsPBAAA3AoEZDyD
kxQDXDvtuTePHvnAAAyAiKjD2w3vuDrIQAEALJPArUaMhDtKUDUDuGhhAPGaZS4azlDFvcDE4Dxh
2REEmAaAeM/NrEdIbHfABAHJPyJyLyNDXyPHCySAAyUFvD+hserD4KjAwtkZOD0KqDgDvIQD/a5A
AbuFpRUUXQ+ICh1PgDah4EvPQAXN/uKHfDZDeFJuoEWALD5aaDjEIanEEZSf5D9KqDTDehWvHHUA
SFCDkVsb5D+JBf3cqDyheHeE5AJnknmAJD4EIDSDkIQXfM/R+HfDRDZGsrFrHvJFCDinUG6i+0Kd
kDbLAALzwAjARJiDYSLm9nMjPEmAKkcIwJek7pPTXD1D2HftCFJtCl7TcFDjeIwAePGL/KqXYKqo
0LNO4KjwuKqEKJiAYLtZuZ6PhrDALJsI+JvEeDpHcIcGxAYAaE0ICEMDdDmGoATAbHlAYqWrN1RF
0IKAXICwtJiDkmWZumcfvHfDbuGVYI9AeAWEED5LhknDpkpgaEmASAVaCARGhDxDslAKfHkbYAGo
iDwIQAFJ4S/TsDpImDyAEE4AbAVLNcJlADqJ10nLLI9ABD1EMDksKARAUFvJvGSbDLAD0vdLqE4r
tLi2bERtYLaNAD7GonvSShPRADtLAU3ERAiiJFDD3Iqc5FJEgGGACpnAou9PHD3KqDcxpAAAWAbP
GHWEjDkiRDtJWsVE0byEjDgDhEIUfJiUqEUHlAejAJGDxGxAZATJPAED5ImEKEMADwWAhU/DjmsD
+AMFv04JZD0kXknDvEhZH3+AUEEDzDnHsDkD0EmAhZTAPACE8DaDiLAD6c8UYc/JQDrwJdYWIEvV
YVaIOZODyIqDxWInpQ7jRAPJBAGsHPhvCGiD7GxAgAkIjAV4TEJDioyD8GhAbl/KkiwAADVDgIQA
mAgICD4yNNuE8bGE0IWJZFxKUS6HXArn/AJD8EMDXP5GTx6AqvqE5m4erc7u7AbJPD9gWDVDprV1
My6AdKP2DInDnJiAeAkM/VpJi0THcDpD6EmAfAfMOACFJDPDcImuoenAWo+gXDgEMD8PYy6q5D9D
uJFp9GxwNv9v/DvVlopAYEmDgxXxpEjAJAVEWAtAWGxDaesKgupKgadDbcuRAD+JZcTEWAXAE0LG
rZOR2tv69FZpapXpdXBpfESphXFGW6+SPIsARAWEWhBEJ3RzMD/GxASAYEWAhANGSDbDZeqDv7TN
+p4p6Gpp9XmNmqCE1qFKVc5Ik6tNBKUDQhvouHCAKPGAzAfxNDbXZx3GHzYqeAXqhZagDYTYgPGA
mAVJMcKEMb+19ARE4AFzjvuDfEdD1pbGBOsLofAAhFvGThIvbqRLNAsq+JGDcX/TF8DrGEZ0RXar
MjOrPFCAX7+8AZbPHmgaVEWndGSyXkYdKSfJP43EED0vidQ3S8Vh6rpfQFvziruyQ811WIkHtera
cr6rpr9rs9LEwMyIkARKjPFwZLCAAgPJMvyI9D44LjW4+JahN84EeDrkYRFqfAVLsAKEjUBImmW3
lF/bwlmbyERs3LBs5ErABrolRI9AS46bsb5IQGBAI0nLZI9AFD4FJbDKXAMLNAaAUJPcrKqtfIqZ
PLphasHE8X7Ik4vAAtOSSaWERk/EF1NICcXIqtt7JpYtxujcXcZnxSSaZX9DoUgMGU7U934ERDlo
HDzifwDAZJBDwDnEIZ9GhAsAjpqeqDgZFaKGhABHOodNAfYATAW3eAIE8DXDaLAAVAiEWAHdPdRI
guvurAADbD1HX8hFvDuDiPgOEPqESARfsxUJiDWEAbbuAD1fb+AD/AEKhYAA4RCYAFQYBAAfz3fA
AdrxesZe77AD7fUHfj+hIFBoSAAvDoBADYbbvgj+AQABYHmkhfoAAQFAgABQJA4ADwZBwAfDodIA
bTuj4PDgZAAkAbxADOcT3AD8AMUGYnCIAdDedAAc74g8HAYAEopDAAAzqdUueM0FgkClvf76ADrd
70jLxfgAfL9wT8fkJg8MxYAAIJBoAGgiB4AdTecwAcdnisJnYJCAAGYiBYAczdc+DCYXqQQj7RbD
to79hL/BGUGoj0mmslmtGMxYWD4bAAiAMDZDgrO/xYGB94GYeoTebDlADsAIGAAMAcHeuCn4HnwK
B1GEITAoAcHUsr+BQAGoqiD0cnVa7vtIG7Pb7vfBXhT95AAeZ6HqdU50fctCgFe4NgoRA8zjfU8G
KgljACAFLWNS0EgZasJAQTo4jhVU9oYTs/0tBMGkQBA+kxNBmAADAJGUOI22YOmCADAN6AkCcFmN
OZZDaPJCQUB1bgeP9AzNORewTh1rIhiMAIlS0AooACKkQBE+0xNM8HuC4GU+OA22ojmFWMS0BAGe
4MglaA8DlkM8E6cuO1qBUHZABwBj5AA2zjXsJ2TAA9DqQM5D3SaF1vAxRgdUYADfN06wAPcDUQCk
FlqpVZDtPxagLAlaj/P1OlbT4DAIT4FAXaBkD2AA1zcPIAANBxqwcAhWTRNlMT8AJNALBCm6dAA4
jgpcAQXruvQANI21VAYEEpCgFk6a9MYImq3priYBAEWoEAQaQE6sT8CU+AWGT6PmszkOQ82DAZpA
nBoCQAPE7FVOk+EJuOowOAyWgGTo5jnvQBgVZQDT5VU1ppA0DGQCUGVCO05zsaU+noBgGkpaBHDd
OagIqyJBEuN+tz7AJPgOBBlAjBFNDsOxfwNBhRj9O1AzZOyCAFvoHAWZADUWAA5DpvQ84UYtLQPB
JkNFZABT6Rg7TvrPW0fPk/KpP9PgZBZlAVAdHzmOmt9BTQCAFTRCGdsNP1AAAFgQvqVazOM61Zc5
RgUAdOjlOqJAFwUHQXe7EL0OM6qzQ17uKZACD7Vk8lbAAEgTaQBLvdY7qz6Je9fQc/Ult9O0UCgI
WgAQ9VVN89E0CDO2DOxAzjPKgD5YoAgIZAKQcwU9jrQM5e8AA+mdcsEQXXgHgJXs3zoX8A9SAAHw
Seg7zkQM9WPAAHASS04+7dreAABE/UcNw6EcPTzELT4IQiRADj6yQ606B4HCjD2HYPAzI8VAE6LU
CIE5qwEjtY4UwvZBkKknJSC4Dp7ifGJIYiYAajh9jwKqNsdDTR9mdAIvoF4JCUj/HjAMcY9U7upA
EeM4gFT0DlHBAMCgGzQAGACR+ARHCNNeMOSAxBFQBr6BgCUsA7xxFKHIPYnSd0tAbLcCIBpexzD3
IoBsBZexqjZNjFE2hC0jlRBIA41w2IBgcBIasBw9jYjRHKoAkhCQJRVLWBAwQ1RsEDAiB8ty+SEj
xHcRxfpGB5tgK0PuKQAl9FeLAWI3g+z0AtBMBUkA6ylRhIOB8EpbgJD3jkOkmgLoUlaHcQMcI9SD
pYISAIBZlASAVJ8OEbRZB0kiIq6qXsvpfzATULwZI2XmzBdUDkfYiiKjPGkYsaQ0CdD3DMKeY81p
rkKAGm0qQJTVs1LQ81DJCCFoZHuOpS41lQpaA4W4EICyMDOGuQMrZLQEAQLwmOWw3mOAQBEkAf6d
AADZHjFNNgBl9AxRoslM4AE0zWm0WoC4G0gAXH6TEZ45CMAFo2cQEaQAFj2JiVdyJjXJGQBaCBgo
8hylKG1QSbCawBFqAYA8yAKIulaHsrMbY4CYj0H8S0A4CjSAtA+UYdY4zUDhHoQkALdAEgRLwCyT
IABujdLkO1bpC6IAAolRSiwAKMEYTadkCwGCwAXAIYIbw4DYjxMUAUBBQgNAZLAA19pLhxL0O/L+
uNcwLmUAWxAAA1h0KAACAQ9AEgJGUA0Asj42RvlVL2gquQAAN11J+PeAdhSMHLAQ3YEIHyIALH8o
Ad9LwBAHLUwQ7I+x6qzZxZQBTBa01rravsxSxSjAcAmRQfA8VbjkHYRiKcvgB2gAAnw9xRyOOPKz
cYhYCgHlGA8BZfQ+R4K3b6VmvkwCaATArbwCrBQEABNpOEhRLSWj8p0aUdZVR1D7KE4pfQ/x8uYH
22MCJah6uZAAA4B5QhzsKJ+w0AAFQAkYG0Ocv48zN0wwjhIhZNAPAgkzgkrODFZgRAyRABo91bjf
HYVkex3wHgWLwCJ8qyRxwDHccoEb2wAAIHsrcc4/zSAhLwUsgQAJFEJAiBYlIILfAAJ8QqMlTi1A
DH6VkaY3CqgYBFJkA8DSljuf7N3GmVxvD9YKCtjBZRwlyfhFKMpUDiAPI+NYphBIIzGnIAEtQE31
AcAiUIAoA0r1OKOPBn451Zj9AUWAlZLSXkxHs2K5Wd27gKyQQtU8BwDHoHmkKgRTX15pBEVQqxWC
tFcNCV8sJYyymbLSVItpDS4ku0yAYBplARAXNIAldpO0TABH4VkbY3iBjvhJOMxgBFjGhA2dkcQ3
ClDpd9Lx+kkATSS1KPk1RrI1GxHwbMhESNRbRN5qdNRwThnFOOclb4CLwgABiBo9A3xsGYHcAgow
K3/gAXbGQhQ/tsgHOypTdx7D3A3PiAAeQ5DMH2J1q/eW9N7bBIrvrfm7TMIHTUAI7ILwVGrAGOwu
Qz7DcNTwAYigGAHk0HkPEjACgMxWAcTRVG9zGD/ISP0fJHBrDkMEC2NFC00I6R4WtH5CtLpEISBZ
JD40llWSdgjowIuWAA5dx8hnMenv6qqO47IKEyAAG9QwddWlvUGTenEACc063RIYAXSiAgQJAAYP
wv42R3FqgqaR1BB+pm/dOPkj44nvlHAWsdTw3SyDvH+WqsxEAOgQ346nJTdB+j4I4NVlgAAIK6fG
tBX6wW6LF8CslZZjVneYKytJai1gALYW0NhbmE6ZE0AYAo7OuS9jxHu08xtMsAARYLR5xg816DmH
wRQE4GV9b57uYt5pCeaEYHQO1WYCQJ2BsGxIj7FDIfEIoOsc6lxzMeAAyBlLJGTJaZD5VlQ2PKD7
z79cAFHjswNL+AsCxRh8fcPTT8hRPLLtGVxD4ABSw017cYxNoloBEaQBkBIe4Ao3BSUQljYX8ONc
QTVdRggAcYJSwVUO4P8dkBgBQUZyMdkWpvg78lgocO8vQOIOsRhPc4E4M0oOorcPYAUaQ4o4wPE4
45AQpUJcoBc5U5c0oO0RwAYwRZeApjQuMABBwToO4OoTEOIO0oBthnEYs8ARE64Ts7EskPkUIB8B
UvoPN86AAPNBA81cgRECBAAv0aU8o/Mgk889E9MpQ9ZwMPgWoCMCAWAecYIOwPkT4BAAoQcOEOMv
QAw+oApjYAAOEO1iVd4TQBwCAXgBcAEoANomkB0Bk8WGsONAV0+Ep+5AplxA4O5BCAN2gSgABBUR
QWIUoOhtgQhckCkB8aAwURh+kVUPIPoTpLEZQC8B4ZAASCZ3hzAY1vk0qCpwMAMwUrowUAxD1rde
trpVVT0AAO4PwUIC52MO0OIXIOZFGJ4QoBEBsasCUA8ToOgPYdkBcAYrMNIN0VUYRnEBUCAcMbko
ANRGsAABoCYasAUOoUpH4YJtk5tZgAACYa0AAa8bEPlz4B8BoaABNrUTso5nsYIOkOQbEOAPQT4D
FtBqRt4QePMBoAACAAYvQNAOEQoC4CMUYOoOEWQOYAEZADAB8wUS1egctU2MYsoXIOowBs1hOUGU
IYtMNMWUMYwDYPUIcRUNINUYsNUNNNJNSUeUciYAYAwWADIB4RQOwOQpcOFoqEohlUAWoB4B8Xg+
URgNINwTEA90YB8AcoAM4NobGLtjRVGKkBgWoOFPtgBrIT8O8pcNJx4igTSVcaADABwUImZzxNdV
xV5V1WBWJvUAUUICQCUXgAgPJHIOURgSVPUAcvoCgCMyM2ooEnaRMhl1M6kt8hgWoAoBBSdTgPdc
FYQOQX92dvUAQ6xEsSBOcrQ0EY0uJggBkXgB0AkoANANosEb+Y9ROZFRdRlNkegQ8aAB8A0QkiIb
EO9EYm5FwBkaAAgPkvQNgOQRyKYt5X6PpYATV9Rx6EoT4BEBKdYA6dkOFr4f0AwvoCBvQPwO0bEN
l14hpnwS12kdkBsBow43FU5OJUEAYWoP0PoXtEB2QT89qdgsmIsAAO8ncA0BEZABsBIUIPQO5cIO
8XtOJkk3KiqARclcsQp5EZkOpdCFU5tgcBwBATSE1cIPF19L4AFXGD0ZRfwoB9wRwPBEZecQoAyb
FZcBMUKZsrcOYvSPpdcQpfgWUVWeswUA4AgWoAKeMAANwWY+uAlghgoUtg1j9hCVSm0t5hVhemdh
poGmVh9iEpSBNiYQlihipiwOJi6NUQVgA9AgIA6TcAN7IPIQMxIVkPoAQwUDIoYPwPETENuCsUdE
YBEBoh4A8YINYtN+BlQQ1lcUxloasAiqQPQegCwCEZQO84+AAd4VpSWpokAh8Tpm0+BnAb8gsRRy
QToPEPYR82JWUrA+MA8egORqV3IZQCwBwTQNcN0QMASXgCYBQTQOkOMQMwoXsP2kCQYtiEoOkXJH
4R8BFptp0M8OMVkR8V1qMOcN6K2K8Tt1iuEAEOlS0PQS0BAAwTSpRAZnMAAA+k0CQBgaQPavgrRV
l0+FQ8CpCaQRkOEagOJC+wwmwA8RADIBwegOIN0UoPxtQh9tYbIbRttJGR9qYb4hVuEcQcYAAMkO
ERiilOQy8WsCYW4BAP4rcMsNkX8CICqSMBR28AANNZIodsAAMA4SkDYB8RQdMdUOke0ABwERAPIO
MZiPkVK0AAC0IX+0UVUPS0i0oAC0y04etQ4t4BkCIBwgIAqPcNcxxT+TheohsBgh4zUZlqUPpugC
MA8QcNMNgxx7ZU03QAgTYTVLwO+H5ulzojaY2Epz4CV0AaUkMkU3d0YBx0gM4OUXsBIBhJm323+4
Epg6lU4264cAwAEQcPO0mKl1p1waigJL12EAAnAnIOQWQNsPIQeg0o4AcAsUYC0BwvoPIOkbEN4P
dJYB8ZRUixNUwQgiaZUUKAoQcO+kgW9sQpwp6vFj+ERumTWhsOoxwNwO2ih7kBU0VZcAcVkNQN0r
eucatusRgNENwQOt4qMQ8AACkBUTQsosx6Irx6SqAtUtcBUQecpPMZ0hhnyCRy8mtjQAoRQCEB4a
AAIPWeQOWeeMODvBGPpWdjQPsX8OYPES1P4RQOkOV92WEP+4UAgfoAUToPYPkTQBWexYIVUNdfId
oAt9gBl9oOYpcgcegBd+YyNVV+Qyh+cRx+ky1+wxV+4BYdkzczlyMRUz4UuwukARQroZAAuNI0uA
IcsTQAkusAAAk3EPYR4QhNsBQBUZABa6kdZ88RVCZggAaBgOovQP4A01Sk9j8O0vQ99d3HU1UT+N
Jdw+uB+1yC9SyDK78+MBYaQPhdoZkOwrMAHI8nyD8VnIARgYgQcPgPdFKcMB1b05sAQRgNk+gPLK
IhWFYCqFgAIPQVVUsTSJgUYPwO+E8O8RgWcmxTR6gvlj+8aGyGUhWHAUOHI9UX8PIZsATDwAB8Q0
cqWMVgt5SIYaABEP8rMWMRw7xK5xUcQCASkAoPgrcN0O0QkB8BwrKJuJ1AeKCqeqSKQSCeggqKiK
oWEOCK2N9FMARrAAAC0BsZAAMPgTENVFApjJgSoCMRAPewlDgYKG5xUUIBQZAocRwTUAoS1yZHWJ
9gF7wBgwUPkOuuQPAWoCuxBE0pcOViZ08iYBROw9otAOcPovoBt24S6XRj9BEholp0x5kNwX8B6K
EXCuRpmQNHgVGQdGpAMeMegP0PQoAPIggAkAsRTKUyIP8rcMwN8YIC92NJOykY2bC7UCERQPMPU1
EAcXu/QQPDMUIDGZhj8OUagyw2F/oAYUJeIQoPC+U8thSWN42m7YQ6qUWFSUMAgKAGMt8PgGAJ3Y
VhEsMTQBd0YB4AoXsNK3Apgb/AsQ2XgC8BkdkOs0uNV9HNEBMS0OUOIQMOwqIgIB4RAA8ANWtVcV
oBJJkCQBET5xsbEOyo4gJDvGZrlVVCEXyj5ceEmZBRWdERgnlV2+kBsAmBgORAPb8TQBasYBg3oO
TPsXwP0T4BV/0AajEOKicmpUEAgRQCvXNWoRgOWlMSBBxSWCQToPJIrT8avdI9QN8TEPiVfNEBzJ
IzcAANUOpZSc3cqc/cxWGdJ/oTUA0e4CbTg8vfenh9YBBdWjkRkOkQMN4YFNaeqpt9MxGe9SUAvi
gWsB0wUPsPE7Ifc5sBQWABXHc0oOUbFlkWoBGAcTVfc0qBObkQzVYvqQ4ZAPfECIrWrhDhLhQPrh
ZT0Qk9AwUBAAMR84UVUPAP8UIBMA4T5e0RgOwPMR+KZcg5MBZcyjFc+OBeoT63YUYBcAgQcOiDFQ
0PbPYt5TRbzmc8uDijIRzcjmV/wUYaARgOe9csUUIYMVk48oDDUZQB0BQaQPF/cOHecBYB5JkBYA
GnNg6mzZHp8TsUOnFhmmlhxh4rindiMRinqwJikgJiw+di+oIVwaQCgBwZQBARSIq9yOhFIAgwUD
ACAZQPtKpVW4pvVDMCUBowUUJk8raqFlXPOqaKJlgQcBsCPpmmBVU+gPVI/NEpIT+JRYRj7VR8gY
wA8BckACUBMWraStusIrgBMRBisTQOAN4pcPFPbQEBsUIO8OhAMPM+ICABA+YOAQMO6T8BMBgSkB
1ngpiwkNbb95VHkCTZh1vfHLwWoC3XNwMQO3AU4BMWA9uiMOcWQNkPZEkCEUYPoO6gDX8dgmJUZw
OaZlGQLYhvWuBJnNooANwOJANW8T6HgXgA8AErMNENtAMAsBgW7UyQkbCyRtpJBqPWIb2UAcsBQc
IWsAcrOx6zJnufCdSh8doAQQkOoOMWR5QWsCoVEBTk4AAM07MgodkCKJE5sAUQcN4NkZgOgP8voD
UCcXgl6gBLo+Oze1z273AX9vX3P3U9z3j3oWHggt4AcwUDUh+EoPwRgN88l2Qd9gEzMBQdmeNReu
tkfr9unyoSAPATHDkoCDQwU8MwUPzX60QOsWpQkUa45Q1z0ei5IkC5QUu5YnsasB8AZrvBklUbWK
n6lB76wOr64Av7A8R08PEbENcPUZBPl1t13cggm7QC+R4P4O4VWusYIuIWoAekEBWiIRXKEUu/UY
OZUgICMXhGkVkN4OSDKQ0B0RAQAGP97gBsNx3gAAhAJgAUhYBgBwt50gB4gcHAAXBwFgB4Oh2ABw
PR/AAHA8HgASBgEgB+Ph6ABqN95AAFhYKykIAAAORyQh4P4CAAQBwJAAGAF9xFwSAAhcLgAOAiCN
JtvEAAUJQwVhYBABzOOEOl7PyjhCMBICvmQuiCP2d3C4zsBAUCgAIhQIgARBCIPd5vYAOh4PgAPs
BUIIhEGAAKgd/gB3uqEOV9XYQB6dAZ74FwuiYPwDggAB4NSgBvh6xFz4EIBqjBF/YFvuqCAIDSwS
BkFAB5O14V/VXcL3qdapuua1hPXgDjQWZ4YA14GgwGgARha7OZzzQBhOjBoE5Byup51gFywLhDRv
R3TRyOnzSO5XCvBQLRiigYAPN3eY5TvWUDQSYwGQOV47jvQRQUsBljAAOk60wPsCEsBgEF2PA7Hm
Oc81vBEEnWa9LD4PBNDjOtBAPBRKAXAoAQAOs7VXO4/QHAAGAVYwCD7QQ5juYUBgMRyIwAiVMD2P
+MASBF+zxhtXzwUoFgbQwFQEYU2jkeY8z4SR9FwASNwoB5egJP1BDiOthQOBdKATY9XznVc7WFAA
GQaXoFAHWU3DiVc8FkmB9ARBcFGkAk+gAN9n29l5cgSoZpASaMCQCWs2jfcA/QLdYHwTaM9zucA5
TwooCAQSgHQRjc8TpSA5TzV4JAgRg9jsVc4zxWtb0QCMJ1QAg7UgNo7qKPuX6DAWA0ZB1ozqOBFD
mPZb1vfQFQcVAH4YZF8AAn9kAaCJOAXARZTiqUALGjAGwcTgFQJUo2ziWsIQbdY+zxO4ADcO1az+
AVvArB11j2Oo6wAN08lCCkJFGAk/GqNg43maFjAnBtjD6sO/D3jcJwadYAj1cA1zpYUBAKRgKAbb
w/TuO0ADSOpSgiCcGAAAY6jqQU7lKP1kAABIGwZAAJQQUo0jYVcHQlTgEkDAA1zgTQ9T+RAIAh08
/XAM44mQC/R2CN46AAOej0kXYJQoBYAATAVXj3OnPDUOuvD/UIIQl21XVKN9YWRPxXgeB7bZ7oo2
DYwg8wDfsIIuuo53APE/GQ0Gg+Y5nmub5znS8Mk2eX53o1xUJawAP21lw6lOz/AZvOk7HsuYAMA1
eCoJs4upIDTOmiub7VowpCZRgEPNCDTOhkAlCNDAORAAD/9IAD5PZSgEAiMDjN7PDuP9XgTpIHwP
Xb0mQPk91lAkCleOE29lOlSuzXPtWNBqhwWP5wDTOXp5hTEAAD4Hy9ASAORAAKMAAD+H4WUdhkyQ
jvUUXU/YIwTE4AU8cADXjAuYOkAABQECdArAySx0g/B9lKHCOBng8wAksBCB8owED9vRemPkeZ5h
rMUJa5oAT9QKv3AA/l/b/T6Q+AAA8CB1gRAYI4XZ1o/SyjvHgVcb7J3UPzTCAc/YFwLEoAYPoq42
XfRGIhEkjAIzdgAAI0Efo+1FDrHUcBP5SgCxbAABcDJRiUGBG21QADv0wIwfWaMDiDnqDpZiOI+Y
AIjxJiXE0rDqx9GFHMOsmg6R4lKAQA86wGwKEsH0PI/6KYeRGAObxdxox/j4R8OwtxcQBl2AyBQ6
wEVzNmkuZGQLpAAkQAuBU6wFwFowHUlAdA8yyuZIgTc6wGQHkQPc/IupCR9GBHJKUBcSgAAbXgjE
cq+x3j2JIBcDpRiulrG6Og1Q9B8rJizPCeLmSvAbA6lYAJhRuDpRUBgvQDB7kwHGkAABZDIANAoU
ZbZXhyjmOAoEspkCIT1nOAcpQ2BwFXfS5ciAGpzI4AYfsAhXnWllHgPMkgDZiE8HAQgBQHCGAHHe
vsbo7y3riJwAmmTCYImGewAAE6ZSSgHK8AFoI/nLmyakN0q5ZCSOiLibeANQZQFCdsXB6Y8R1L7G
9QMfbKQAAofGUduCMR0FXAYBM6wCgDVEqMPotZ5j9gMH6TQaI4TVAHRBT8xxWFLkxGzS0C5DAPPk
AA7ZGA/x9FKH4AQoQ9UI07LKA8CxDAQgSP3Yd1pOx9j2hyOI8w+qjvRh668AAJltgAAaAVGECXoj
7LWOGgSMZ3HNAy20EIDClDWG6cAfLQHogDNGDAEhOh0DhZ4OptDmgJLZOuA4oTmx/j8LWOUci+zW
TvKOBQhhDjR2tLiPYeRhQCgOPYOQc4ABtk0NICEqAF1LQKHmzEbI9yOXdISmC8N47ygAHpee9I8r
svAASRwFRmQAAJugXJoI9x5FXS0TB/0CEYAOSY0a98jYEj/tEPwexMBsDhtAbgAALwQnWe2RQdb8
nal2BCCRQ4AR0M8G5gEkoFVDgmAo+VNBMRtHAAPhYEuGABYaw5h4AA2bPwKAeXoFi5VFvcAAO1+T
nUYONJYC4EhesFKDfMADBpMBvncoJO9GABT0WmA4XoBb0LNQnUUOa6yEE7AKr0CYhhIRvEghafsD
oHijAUARAeorqIon8HqZABYCDIDfz0AAeoAzc2WtS9DDb5x8FKLoTssC+wAgWUOBgAhaxqjeKuAI
BZjAUgfIwAMfhbx0jlJAP0ChOAMGbAANYbZwJeOaAJNQCoFSdAbSbI0uNRoGZSRmt9OrqIPMqI5E
wjACs2wKeoPeSqc11D9IgBMvMAQItxHsZ0dCigLgbhlLgzhgR4ACN4A4fxhTaGFAmhcktSRtjjNB
B5IZHAQAVP2WBmI9ACH7AsBYvSDihQnLfAgyFnTAjlPifzAVUDRJ3lqncB5+6Rw1ikO08w5h2kEv
IiIChjAFtRHYPRawByWAVAWUK1tryyrJumYUc46zzD9wJNwC1ah+mFHKO01VXiWP3I4AikY/B9Fv
MgSQehgEIDyKUA0CZGAMAOsxVeNzZh0EIHR1MltT0wFejyXoDAD0bgFHweYbQ7C3gTrS0LmFhqrx
vbNJkwQ9FFD84omAB1lAALOLWOIsZ/LaFy00CEDpOgIgIJIN9P5HR7mQAtM9HADzR1DsRoQeauCQ
jtMCl4/YJ9V5f2UOUeSilewBBJTinVNFj9+J2AQBuTQMn7HQOIkFyS39+qiCd5tqcv64OgPbTQJC
inN6TsWq5ZdYMxS2W8BwFSjAggKVgAeGrN5HGyOQmnlDRgtBKUYAz08M/okAPQmg2BykwHxb8BmQ
QLEsAL9qzUgB6k0G1vnL4/hXgIAJjbQBw7BIA2w7zPzQQEFthewDRb1uy+3Ox1gKgHBjFbFrHWyi
g4XuyMQ+iNwL1xBglxwAFyRJCyXgBOAJQEz2g3TCA6w+jlhcQBiNwJgHhDHGoGHzjZg4ysA9RbwA
mFRGQGSNw5y0Wc4Jk8oSYShcTnzoYSzmAOQ+wikCgzw0hcg0g0Bbw9wZgp4T4XoX08GvlVUWA+Q+
1Tx0iMAE3gQDQ+RVyf0ykCDOQEChwLhXS/A3DZWU4YDs0shEABIcXSxZTqlUD9SkRDAGD+hMW5Ie
zsVrXBBQhXhJA+VoYjDm0CBXljUUBkHfXY4lTsWRBEE1DqGrhLXs4nmVUHgBD0A/g/RJFv4p4sIs
Ysos4tItYtjmBdBQlqxkA+nTFo4syMHBEB2hopIv4SRdIoUCQ/Yvkyk8YwVbBCYrRLVv4nYuBXhE
IrmAkPooT0IvXTTpAAhXgB1IkCjrGroMYSkshQhQhJFilTot48B9RXn9iMIrC1Ypig0PlI40k744
X2Y9TrI0osABQBoY1m2yJAkvWxXBFiI0o54tY/o2DqGAiMImABpDRJJD48YlYjn9oxnC4Xo6ka2h
Ik4gzsYYndRb4ZY1ZGzsolxWFZENWhY94qIwY5GXkDI+I8ndY2RcECWRFIw/oSIlXBBdgExi0axf
3enDACBvEnyO1nBPHEjVpCkPmVpQVv4rZLIaBCTQWXiSpV1rIyo0n54locYcT0Vojl44Y12lWHIr
zmjthXpVhLYpJZU8ZbDrYJnYwA4qlhkCUDHvpLJLY1omIf0CiyHYpg5hIsWvkBxcJIJi0jY4o5I9
o046BO2kQAAMDYg60K4JC1mG4ro1DnI4o0IrBZYxZkoXowVZFiBLZiZq5jZHlrZkZjJtxO4TZsk8
ANg9Qh0Cg0g1Rcg1Q04WoXJuJyD8x0j4AGFtxfR/A8X7wACNwFi3A/A9BCA0A4RgZOpyRcgBUAAH
RGy6lsg8JJp3p6J6Z6p657J7Z7p758J8Z8p859J9Z9p95+J+Z+p+5/J/SYQBnBQGBDEJBOw8Q8xa
xuFckuA5neSpRSpu5/qEaEqE6FDmDAZmwIhKA7A4zPBrC1aFaIKISYJuopwCAoAYznA+AYAnaIot
kCG3AFHV1hQAz0w86Bi3w7BhYzaLaPKPaPqP6QKQaQqQ6RKRaRqR6SKSaSqS0a5BBjQExjCOhQlr
xayMhqk4ogqTKWqW6XERmfQGRow8yEhvYlJ3aXaZ4XqJKaKa6bKbabqb6cKcacqc6dKdadqd6eKe
aeqe6fKfafonqaqf6gqg6hKhahqh6iKiaiqi6jKjajqj6kKkakotqgak6lql6mKmamqm6nKnanqn
6oKoaoqo6pJhKlapaqKqaqqq6rKrarqr6sKsasqs6tKlwvwyw2qEKtau6vKvavqv6wKwawqw6xKx
axqhR2w6auqx6zKzazqz60K0a0q061K1a1qqw1ziQ36163K3a3q364K4a4q465K5a5otRAQADwEA
AAMAAAABAoAAAAEBAAMAAAABAFEAAAECAAMAAAAEAADC3gEDAAMAAAABAAUAAAEGAAMAAAABAAIA
AAERAAQAAAACAADC7gESAAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABADMAAAEXAAQAAAAC
AADC5gEcAAMAAAABAAEAAAE9AAMAAAABAAIAAAFSAAMAAAABAAEAAAFTAAMAAAAEAADC9odzAAcA
AHYgAADC/gAAAAAACAAIAAgACAAAgvYAAD8mAAAACAAAgv4AAQABAAEAAQAAdiBhcHBsBAAAAHNj
bnJSR0IgWFlaIAfgAAEAAQAAAAAAAGFjc3BBUFBMAAAAAEFQUEwAAAAAAAAAAAAAAAAAAAAAAAD2
1gABAAAAANMtYXBwbFR4QRZ8YESoVj/z8Dmw/6QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAACGRlc2MAAADkAAAAe2NwcnQAAAFgAAAAI3d0cHQAAAGEAAAAFEEyQjIAAAGYAAB0TGNoYWQA
AHXkAAAALGFhcHkAAHYQAAAADkEyQjAAAAGYAAB0TEEyQjEAAAGYAAB0TGRlc2MAAAAAAAAAIUFw
cGxlIFdpZGUgQ29sb3IgU2hhcmluZyBQcm9maWxlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0ZXh0
AAAAAENvcHlyaWdodCBBcHBsZSBJbmMuLCAyMDE2AABYWVogAAAAAAAA9tYAAQAAAADTOm1BQiAA
AAAAAwMAAAAAACAAAABQAAAAgAAAAOAAAHQcY3VydgAAAAAAAAACAAD//2N1cnYAAAAAAAAAAgAA
//9jdXJ2AAAAAAAAAAIAAP//AAA62gAALbcAABLaAAAdMwAAWtEAAAf9AAABNQAACk8AAF4XAAAA
AAAAAAAAAAAAcGFyYQAAAAAAAwAAAAJmZgAA8qoAAA1WAAAT0AAAChBwYXJhAAAAAAADAAAAAmZm
AADyqgAADVYAABPQAAAKEHBhcmEAAAAAAAMAAAACZmYAAPKqAAANVgAAE9AAAAoQERERAAAAAAAA
AAAAAAAAAAIAAAAAAAAAAAAAAAAAD6EAAAAAH3AAAAAALz8AAAAAPw4AAAAATtwAAAAAXqsAAAAA
bnoAAAAAfkkAAAAAjhgAAAAAneYAAAAArbUAAAAAvYUAAQAAzXcAAQAA3aYAAQAA7jgAAQAA//8A
sg/1AAAAABAQECUAAA/pIIMAAA++MIkAAA+XQF8AAA93UB0AAA9fX9IAAA9Nb4UAAA8/fzkAAA81
jvAAAA8tnqoAAA8nrmYAAA8jviYAAA8jzgoAAA8s3i0AAA8/7rQAAA9y//8B7x/xAAAAACA0DzwA
ACAaIDoAAB/1MKsAAB/KQNcAAB+fUNQAAB92YLEAAB9ScHoAAB8zgDcAAB8Zj+0AAB8En6AAAB7y
r1MAAB7jvwgAAB7ezuAAAB7m3vYAAB7+73EAAB9H//8D9S/tAAAAADBSDY8AADA/H3EAADAjME8A
AC//QMsAAC/WUQ4AAC+rYSYAAC+AcSAAAC9WgQEAAC8wkNEAAC8OoJUAAC7vsFAAAC7VwAkAAC7H
z98AAC7K3/AAAC7k8GMAAC9A//8G3T/oAAAAAEBuCtUAAEBgHjAAAEBKL5UAAEAtQGMAAEAKUOcA
AD/iYTkAAD+3cWUAAD+MgXQAAD9hkWsAAD83oU8AAD8QsSQAAD7swO4AAD7W0NEAAD7U4OkAAD7w
8V4AAD9c//8Kuk/kAAAAAFCIBr8AAFB9HGYAAFBsLoMAAFBUP7IAAFA3UHgAAFAUYQAAAE/tcV0A
AE/DgZkAAE+YkbgAAE9socEAAE9BsbYAAE8YwZ0AAE790ZUAAE764b4AAE8X8j4AAE+U//8O8l/g
AAAAAGCiAYoAAGCZGfMAAGCLLRUAAGB4PrwAAGBfT80AAGBAYI0AAGAecRkAAF/4gX4AAF/PkcUA
AF+kofIAAF95sgkAAF9Owg4AAF8y0iEAAF8u4l8AAF9P8u4AAF/c//8TKm/bAAAEy3CKAAAAAHC1
Fp4AAHCpKz0AAHCYPX8AAHCDTukAAHBpX+YAAHBKcKIAAHAogTAAAHACkZwAAG/aoewAAG+wsiMA
AG+GwkgAAG9q0nUAAG9o4skAAG+O82oAAHAr//8XYn/XAAAMEoBqAAAAAIDPEfgAAIDFKOkAAIC3
O/QAAICkTcoAAICNXw4AAIByb/4AAIBUgLcAAIAykUcAAIANobgAAH/lsg8AAH+9wlEAAH+i0pgA
AH+j4wEAAH/P87MAAIB6//8bmo/TAAASkJBQAAAAAJDpCugAAJDgJf0AAJDUOhQAAJDETG8AAJCw
XgUAAJCYby8AAJB8gBUAAJBdkMwAAJA8oV4AAJAXsdMAAI/xwjEAAI/Y0pAAAI/c4w0AAJAM884A
AJDD//8f0p/OAAAYRqA8AAAAAKEDAKAAAKD7Ik4AAKDwN9EAAKDiStEAAKDQXMkAAKC7bjYAAKCi
f04AAKCGkCwAAKBnoOEAAKBFsXQAAKAiwe4AAKAL0mQAAKAQ4vMAAKBD878AAKEC//8kC6/KAAAd
kbAqAAAK87DcAAAAALEVHZAAALEMNRwAALD/SOsAALDvW1cAALDcbREAALDGfmEAALCsj2oAALCQ
oEMAALBxsPUAALBQwYsAALA50hcAALA/4rYAALBz84sAALE1//8oQ7/GAAAimsAcAAAUfMC6AAAA
AMEwFysAAMEnMd4AAMEcRrQAAMEOWawAAMD8a78AAMDofU0AAMDRjocAAMC3n4YAAMCasFkAAMB7
wQoAAMBk0awAAMBo4loAAMCb8zcAAMFa//8sf8/QAAAnetAeAAAb69CrAAAAANFZDXcAANFRLfYA
ANFGRCYAANE5V8gAANEqakQAANEXfBsAANECjYsAANDqnrUAANDQr6wAANCzwH0AANCM0SYAANCL
4eIAANC68sQAANFv//8wwd/0AAAsQeA6AAAiauC6AAACduGQAAAAAOGTKTIAAOGKQTUAAOF+VakA
AOFwaKEAAOFfes0AAOFLjHwAAOE1ndcAAOEdrvYAAOECv+kAAODl0LgAAOCp4U8AAODP8jUAAOF0
//81D/BAAAAw+/CAAAAoZPD1AAASNvG3AAAAAPH/IzAAAPH2Pc8AAPHsU0oAAPHeZtcAAPHPeWYA
APG9i10AAPGonPAAAPGSrj0AAPF5v1cAAPFd0EgAAPFA4RoAAPDa8YsAAPFm//85ff//AAA1w///
AAAuIP//AAAcqf//AAAAAP//GyoAAP//OewAAP//ULkAAP//ZP8AAP//eAcAAP//ilYAAP//nC8A
AP//rbUAAP//vv8AAP//0BwAAP//4RUAAP//8fAAAP////8PcwAbAAAPjgAAEBMPZAAAH/EPRgAA
L7QPMgAAP3EPJgAATzAPHgAAXvIPGQAAbrYPFgAAfn0PFAAAjkUPEgAAng8PEQAArdkPEAAAvaUP
FAAAzZQPHwAA3cAPNAAA7lAPaQAA//8QBRAFAAAP/g/+D/4P/g/+H6MP/g/+L2EP/g/+PyYP/g/+
Tu8P/g/+XroP/g/+boYP/g/+flMP/g/+jiEP/g/+ne4P/g/+rbwP/g/+vYsQAxADzXwQDxAP3aoQ
JhAl7jsQXBBb//8Q7B/5AAARVx/ZEH4RUR/aH+0RSh/aL5wRPx/YP2QRLx/TTzoRHR/LXxURCR/B
bvEQ9B+2fswQ4B+qjqMQzR+enncQux+TrkgQqx+IvhkQoR+FzggQoB+O3jQQqh+n7sAQ1h/x//8S
Ti/yAAATJS/JEQMSsC/ZICgSoS/VL/YSjS/OP9UScy/ET7sSVi+3X6MSNi+pb4oSFC+Yf24R8S+G
j04Rzy9znygRri9hrv8Rjy9PvtIRdy9HzsMRZy9O3u0RZS9s73cRhS/K//8UKD/sAAAVRj/DEXAT
2z/uH+UTyz/nL/4Ttj/dQAwTmz/QUBMTfD/AYBQTWD+tcBATMT+ZgAQTCD+Cj/IS3z9rn9kStT9T
r7oSjD88v5YSaT8wz4wSTz8337kSQj9Y8EMSVz/K//8WbU/nAAAXtk+/EcsU3FAKHxMUzlACL50U
uk/3P+4UoU/pUCQUg0/YYEkUYE/DcGEUOk+tgG8UEU+UkHET5E96oGsTt09fsFwTi09DwEYTYU81
0EgTQU874HwTLE9h8QsTO0/m//8ZDV/iAAAabl+9EhoVvWApHaYVsWAhLtMVn2AWP30ViGAIT+4V
bV/3YD4VTl/icHkVKV/LgKMVAl+xkMAU11+WoNAUq195sNYUfV9bwNIUUl9L0OMUMF9T4SMUFl99
8bkUH2AT//8b9m/dAAAdYW+6El4WhXBJG4UWe3BBLZsWa3A3PrkWV3ApT3EWPnAYX/UWInAFcFgW
Am/ugKMV3W/UkNwVtW+5oQYVi2+bsSMVYG99wTQVNG9t0VcVEG924aUU+G+l8kQU/3BL//8fG3/Z
AAAgiH+4EpwXN4BoGH8XLoBhK+oXIYBYPZ8XEIBLTrEW+4A7X3EW44AocAIWxoASgHEWo3/6kMkW
fn/foQ4WVn/CsUQWLn+jwWwWCX+T0aAV43+e4f0VyX/T8qYVz4CH//8icI/UAAAj2I+1EtIaQJBj
FwAX0pCBKbIXx5B4PC0XuJBsTawXppBdXrQXkJBLb3gXd5A3gBEXW5AgkIoXN5AGoOwXEY/qsTsW
6o/MwXsWxI+90cMWpY/J4i4Wj5AB8uAWmJDA//8l65/PAAAnSp+zEwIeZKBRFo0YaaCgJtkYX6CY
OloYUaCNTGEYQKB/Xb4YLKBubr4YFKBbf4QX+qBFkCIX3aAtoKMXvqASsQ0XnZ/1wWQXfJ/m0b8X
WZ/y4jgXQKAt8vMXRKDz//8phK/LAAAq2q+wEzIinrBBFjUY+bC+IzkY8bC2OB8Y5rCsSs4Y2LCg
XI8YxrCQbdQYr7B+fswYlbBqj5IYd7BToDUYWLA6sLsYNrAfwSwYFLAP0ZsX97Aa4iEX4rBV8uIX
6bEd//8tNr/HAAAufr+uE1gm58AyFfwZcsDdHnsZasDWNWIZX8DMSOUZUsDBWyEZQcCzbLYZLsCi
fekZGcCPjt0ZAMB5n6MY5sBhsEkYycBHwNMYrcA10VUYlMA+4egYgsB28q4YisE7//8w/8/RAAAy
Os+5E3wrMtAyFcgbYtD7GasZ6NECMhsZ39D6Rq4Z1NDvWXwZx9Dha28Zt9DSfOUZpdDAjgsZkdCr
nvsZetCVr8IZYtB8wGoZRdBZ0PIZJtBe4ZAZDtCR8lsZDNFL//8039/0AAA2D9/eE6cvhuBOFaQh
o+EGGRQabuFHLikaZeE/RB0aWOE1V50aSeEpaf8aOOEbe8IaI+EKjSMaDOD3nkAZ8+Diry4Z2ODL
v/cZuuCx0KQZleB54R0Zf+Cj8eoZfeFM//842PBAAAA5//ArE9oz6vCTFZonefE+GJIazvG2KTca
xfGvQRkau/GlVXkarvGaaGIan/GMeoIajvF9jCcaevFrnXoaZfFXrpQaTfFBv4MaM/Ep0FEaF/EO
4QUZ7/Cs8VwZ6/E8//88/f//AAA+Gf//FBM4cP//Fa8tLf//GEsbRP//IwAbPf//PawbNP//Uyob
Kf//ZrkbHP//eUkbDv//i0Ia/f//nNga6v//rika1f//v0gav///0D8apv//4Rkajf//8dkaV///
//8fKQBLAAAfewAAEAofUgAAIB4fJwAAMAQfAgAAP9Ae5QAAT5Ee0AAAX04ewAAAbwwetQAAfsse
rAAAjowepgAAnk8eoQAArhQenQAAvdseoQAAzcUesQAA3e0e0AAA7nkfHwAA//8fghAlAAAfNxBA
EB4fNxBAH7UfNxBAL2wfNxBAPy8fNxA/TvkfNhA7XskfNRA2bpofMxAxfmsfMBAsjjsfLRAongof
KxAkrdgfKRAgvagfLhAizZgfPhAr3cUfXhA/7lUfrhBz//8gCSAJAAAf/h/+EJcf/h/+H/4f/h/+
L50f/h/+P1If/h/+TxEf/h/+XtUf/h/+bp0f/h/+fmYf/h/+jjEf/h/+nfwf/h/+rckf/h/+vZcg
BiAFzYYgGCAX3bIgOSA57kAgjCCM//8g2y/8AAAhHy/fERAhOS/WIHMhOS/WL+shOS/WP4shOS/W
Tz0hNi/WXv4hLy/UbskhJi/RfpwhGy/MjnIhDi/FnkshAS+9riQg8y+1vfwg7C+1zfQg8S/E3iYh
Bi/o7rchTDBM//8h/D/zAAAigj/REXci2T+8IQYitz/CMEkirz/BP+Uioz+/T50ilT+8X2Yigz+3
bzkibz+xfxMiWT+ojvEiQT+entAiJz+Srq4iDj+Gvo0h+z+Ezokh9D+T3r4h/T+871EiOEA0//8j
b0/sAAAkJk/JEc8ksk+uIYckEU/HMGYkBU/DQCEj9U++T/Ej4k+4X80jzE+wb64jsk+mf5Qjlk+b
j3sjd0+On2IjV09/r0gjNk9vvy4jG09rzy8jC09832cjC0+q7/sjPFA2//8lMV/mAAAmC1/EEh0m
wV+mIfglRl/ZMCAlOV/UQBQlKV/OUAwlFV/FYAUk/V+7b/8k4l+uf/ckw1+gj+4kol+Qn+Mkfl9/
r9UkWV9tv8QkOl9oz80kJF954AokHl+t8KAkSWBM//8nPG/hAAAoLm/AEmApBm+iIlwmXW/zL3Em
UW/tP7YmQG/lT+QmLW/cYAUmFm/QcB0l+m/CgC4l3G+ykDolum+hoEEllm+NsEMlcW95wEAlT29z
0FQlN2+G4JklLW+/8TIlU3Bt//8pin/cAAAqjX+8Ep0rfn+eIrYnWoAQLlEnToAKPwMnP4ACT3Yn
LX/3X8gnF3/rcAYm/X/cgDYm4H/MkFsmwH+5oHcmnH+lsIwmd3+QwJsmVX+J0LwmPH+c4QkmMX/Z
8acmU4CV//8sFI/WAAAtII+5EtMuJI+cIwcoQZAvLLYoNpApPfkoKZAgTsMoGJAWX1EoBJAJb7sn
64/7gA0n0I/qkE8nso/XoIUnkY/CsK8nbI+twNEnS4+l0QAnM4+54VgnJY/58fsnRZC///8u05/S
AAAv45+2EwIw9Z+ZI1EpFqBOKpEpDaBIPJIpAKBATcgo8aA2Xp4o3qApbzsoyKAbf7YosKAKkBko
kp/4oGkocp/jsKsoUJ/NwOIoMZ/E0SEoGZ/Y4YMoC6AZ8isoKKDl//8xwK/NAAAy0q+zEzMz66+X
I5UrJrBVKSUp1LBoOscpybBgTIQpu7BWXa8pq7BKbokplrA8fzIpfrAsj7gpYrAaoCcpRbAGsIMp
Ja/wwNApCK/m0SAo8a/34Y0o47A48jgo/LEF//801b/JAAA15L+wE1g3BL+VI9QuZMBIKLUqj8CI
OI0qhcCASvIqeMB3XIMqacBrbaQqVsBefoAqP8BOjzAqJsA9n8AqCsApsDgp7MAUwJ0pz8AH0P4p
t8AV4XUprMBT8iQpxMEc//84Ec/SAAA5G8+7E3w6P8+hJBMx3dBKKGIrP9C2NdUrNtCuSRArKtCl
Wx4rHNCabJErC9CNfaoq+dB/jokq5NBunz4qytBbr9YqrNBGwFYqi9Ao0L0qctAx4T4qY9Bo8e8q
dtEm//87ct/1AAA8ed/fE6c9m9/GJFA1h+BkKCsr6+D8Mosr4uD1Rtkr1+DtWX4ryuDia1QruuDW
fLQrqODIjcgrk+C4nqkrfOCmr2UrY+CSwAUrSOB80I4rJeBJ4OkrF+B28ZorJOEi//8++fBAAAA/
/PArE9pBHPATJJU5VPCoKAIsnPFrLpEslfFkREgsjPFcV6YsgPFSafIscvFHe6QsX/E5jPYsS/Eq
ngksNPEZru4sGvEGv7Er//Dx0Fkr4vDa4O0rs/B98SkrufEP//9Cuv//AABDt///FBJE0///JOU9
Xv//KAQv+///LI4tS///QVYtQf//VaEtNv//aH4tKP//epctGP//jDctB///nYks8///rqIs3f//
v5Msxf//0GMsrP//4RsskP//8b4sTv////8u3wCaAAAvYQAAD9gvQAAAIB0vFwAAMCou6wAAQBMu
wwAAT+cuoQAAX60uhQAAb20ubgAAfysuXQAAjuguTgAAnqYuQwAArmYuOwAAviguPQAAzgwuTwAA
3jAudgAA7rcu3wAA//8vHhBbAAAupBCrEFIupBCqH9IuphCoL4MuqRCjP0cuqxCbTxUuqxCRXuku
qRCGbr0uphB7fpEuohBwjmQunRBmnjQumRBdrgQulRBVvdMumhBSzcMurhBX3fAu1xBn7n4vQRCY
//8vfSAlAAAvMiA3ELkvKSA6IBsvKSA6L7AvKSA6P2AvKSA6TxwvKSA6Xt4vKSA6bqQvKSA5fm4v
KCA3jjsvJyA1ngovJiAyrdkvJCAvvaovLCAzzZsvQiBC3cgvbSBh7lcv2CCx//8wDTANAAAwAjAC
ESIv/i/+IJAv/i/+L/4v/i/+P5kv/i/+T0gv/i/+XwEv/i/+bsEv/i/+foUv/i/+jkwv/i/+nhQv
/i/+rd0v/i/+vakwCDAIzZUwIDAg3b4wTTBM7kgwujC6//8w1D//AAAxAT/nEYExIT/YIRgxKj/V
MG0xKj/VP+oxKj/VT4cxKj/VXzQxKj/VbusxKj/VfqkxKT/VjmwxJT/TnjcxHz/RrgcxGD/Nvdwx
GT/UzdIxJz/r3gMxSkAc7pQxrECc//8x10/1AAAyMU/ZEdYyeU/DIZIyq0+0MP4ypk+2QFMyok+2
T9wynU+2X4AylU+1bzYyjE+0fvgygU+yjsMyc0+unpUyZE+prmwyU0+jvkYySk+pzkEyT0/C3nUy
Z0/57wcywFCN//8zFV/tAAAzlF/PEiA0AF+2IgA0YV+gMYs0G1+sQKI0El+rUDI0B1+pX98z+l+n
b50z6l+jf2cz2F+ejzkzxF+YnxEzrl+Rru0zl1+Jvs0zh1+Nzsszg1+o3wAzlF/l75Ez42CM//80
kG/nAAA1Km/JEmM1tm+tImE2P2+TMgo1cW+0QKo1Zm+xUFg1WW+tYBw1SW+ob+w1N2+if8Y1Im+b
j6Q1Cm+Tn4c08G+Jr2w01W9/v1Q0wG+Cz1Y0t2+e3440wm/g8B41CnCX//82Rn/gAAA29X/DEp83
mn+nIro4Rn+LMn42rH/GQGQ2oH/CUD82k3+8YCU2gn+2cBE2bn+ugAA2WH+lj/E2P3+bn+M2JH+P
r9U2Bn+Cv8g173+Ez9I14n+g4A416H/m8J02K4Cq//84M4/bAAA48o+/EtU5rY+jIwo6dY+FMuc3
zo/dP8k3w4/YT+M3tY/SX/U3pY/LcAM3kY/CgA43e4+4kBY3Yo+soBs3Ro+fsB43KI+QwCA3D4+R
0DQ3AI+s4HU3BI/08QY3QJDC//86VJ/VAAA7Hp+7EwM76p+fI1M8y5+BM0g425/5PtY40Z/zT0E4
xJ/tX4s4tJ/kb8M4oZ/bf+84i5/QkBI4c5/DoC44WJ+1sEU4Op+mwFc4IZ+k0Hg4EJ++4MA4EaAH
8VE4SaDa//88p6/QAAA9ea+3EzQ+Uq+cI5c/Ra99M6E517AWPYY5zbAQTlc5wLAJXuY5sbABb085
nq/3f6I5iq/rj+Q5c6/eoBo5Wa/QsEc5PK/AwG05Iq+80Js5Ea/T4Os5D7Aa8X05QbDu//8/Jr/M
AAA//L+0E1hA4L+ZI9VB5L97M/Q6wsA1O9E6ucAvTSE6rcAoXgM6n8Agbqg6jcAWfyc6ecAKj406
Y7/9n+A6Sr/usCY6ML/dwGE6Fr/W0J46A7/q4PY5/8As8Yk6K8D7//9B08/UAABCq8++E3xDmM+k
JBREp8+GNEU8uNBJOtA7mtBcS6A7j9BVXOc7gtBNbdM7ctBDfoc7YNA3jxY7S9Aqn4s7NdAbr+47
GtALwEE6+s/y0II65s//4OI64NA78XU7BdD9//9Ert/2AABFht/hE6dGeN/IJFFHkd+rNJc/iOBn
Onw8d+CjSdI8beCcW5Q8YeCTbNM8UuCJfcU8QeB+joU8LuBxnyI8GOBir6U7/+BSwBU74+BB0HU7
veAS4K47tOBE8UE70OD0//9Ht/BAAABIkPArE9pJhPATJJVKo+/3NO9CmPCsOkE9VPERR7A9SvEK
Wgk9PvECa609MfD4fOc9IfDtjd89D/Dhnqo8+/DSr1Q85PDCv+U8yfCx0GI8rfCe4NE8e/BG8O48
jfDc//9LA///AABL2///FBBM0P//JOVN9///NV9F+f//OjU+Rf//RUQ+PP//WFs+Mf//ans+I///
fBA+FP//jU4+A///nlI98P//ry092///v+g9xP//0Iw9rP//4R09j///8Z49QP////8+lQEMAAA/
RAAAD4U/KgAAH/4/BQAAMC0+2wAAQDU+rwAAUCE+hgAAX/o+YAAAb8Y+QAAAf4s+JAAAj0o+DQAA
nwg9+gAArsU96wAAvoQ96QAAzmU9/AAA3oQ+KgAA7wY+qwAA//8+xRCqAAA+LhE1EJA+PRElH/o+
PxEeL6s+QhETP3E+QxEGT0I+QRD3Xxg+PhDmbu8+ORDVfsU+MxDFjpo+LBC1nmw+JRCmrjw+HxCY
vgw+JBCRzfw+OxCR3ic+bRCd7rQ+8BDK//8/DiBPAAA+oCCBEOA+gyCPIEQ+gyCPL8s+gyCPP3Q+
gyCPTys+gyCPXus+hCCNbrI+hSCJfn8+hSCEjk8+hCB+niE+giB3rfM+gCBxvcc+iSBxzbo+pCB9
3eg+2CCY7ng/XSDl//8/fDAnAAA/QDAwETk/ITA2ILY/IDA3MBk/IDA3P60/IDA3T1c/IDA3Xw4/
IDA3bsw/IDA3fo4/IDA3jlM/IDA3nho/IDA2reQ/IDA2vbE/KzA+zZ8/RzBT3co/fjB+7lVABDDp
//9AEUARAABABkAGEY9AAEAAITA//j/+MIg//j/+P/4//j/+T5Y//j/+X0E//j/+bvY//j/+frE/
/j/+jnI//j/+njU//j/+rfs//z/+vcNACkAKzaxAJ0An3dBAXkBe7lRA5UDl//9A01ADAABA8U/v
Ed5BC0/fIaJBH0/VMRRBIU/UQGpBIU/UT+pBIU/UX4RBIU/Uby1BIU/UfuFBIU/UjppBIU/UnllB
IU/UrhpBIU/UveBBKk/gzclBQ1AA3e9BdFA+7nVB81DZ//9Bwl/4AABCA1/gEiZCPF/LIgpCcF+5
MZtCil+xQPFCil+xUFNCiV+xX9lCiV+xb3RCh1+xfx9ChF+xjtRCf1+xnpNCeF+vrllCcF+uvidC
cF+5zhVCgF/b3j5CqWAf7sVDHmDN//9C4m/vAABDP2/VEmdDk2+9ImlD6G+nMhZEKm+WQYZEEG+b
UL1ECm+bYDpEA2+bb9ND+m+af35D8G+ZjzdD5G+XnvpD12+UrsVDyG+RvpZDwW+czodDyW+/3rBD
6nAI7zNEVnDG//9EMn/oAABEpH/NEqFFEn+0Ir9FhX+aMoZF63+EQhBFfH+YUPdFdH+XYIBFan+V
cCRFXn+Sf9lFT3+Pj5tFP3+Ln2ZFLX+HrzhFGn+BvxBFDn+LzwRFEX+u3yxFK3/776xFjoDH//9F
sY/hAABGNo/HEtdGuI+tIw5HRY+SMu1HzI94Qo5G0Y+hUPJGx4+eYJZGu4+bcE9GrY+XgBZGnY+S
j+dGi4+Nn79Gd4+Gr5xGYY9/v31GUY+Gz3dGT4+p36FGZI/48B5Gv5DM//9HX5/bAABH8Z/CEwVI
hp+oI1ZJK5+LM0xJzp9vQwNID5+yUKtIBZ+uYHVH+J+qcExH6Z+lgCxH2Z+fkBFHxZ+Xn/pHsJ+P
r+ZHmZ+Gv9RHh5+Lz9VHgp+s4AJHkZ/78H1H5KDU//9JOq/VAABJ2K+9EzVKe6+jI5lLM6+GM6RL
769pQ29JOa/IUB5JL6/EYBpJIq+/cBhJE6+5gBZJAq+ykBRI76+poBJI2q+gsBBIwq+WwA1Ir6+X
0BlIpq+14EpIsrAB8MJI+7Da//9LQb/QAABL5b+5E1hMlb+fI9dNX7+CM/ZOMb9kQ9RKUb/jT0lK
R7/eX4VKO7/Yb7FKLb/Rf9NKHL/Jj+9KCb/AoAVJ87+2sBhJ3b+rwCdJx7+p0D9Ju7/B4HZJxMAJ
8OtKBMDc//9Ndc/YAABOHs/CE31O2s+pJBVPss+MNEdQls9uRDhLX9AMTi5LVtAHXrhLStABbx1L
PM/6f2tLK8/xj6pLGc/on95LBM/dsAlK7s/RwC5K0s+90EZKw8/P4INKxtAP8PdK/tDV//9P2N/4
AABQht/jE6hRSd/LJFJSLt+vNJlTIt+QRJ1MZ+BPTMtMXuBKXbVMU+BEbmBMRuA8fuJMNuA0j0pM
JOAqn6BMD+Afr+lL+eATwCdL4uAF0F1Lvt/c4HFLu+AR8ONL5uDE//9SbfBAAABTIPArE9tT6PAU
JJRU1u/4NPBV2O/ZRQlOmPCdTFRNZvC1XH5NW/CvbXtNTvCnfjxNP/CfjtZNL/CVn1VNHPCKr8BN
CPB9wB1M8PBv0G1M1vBh4LRMovAO8LBMwvCm//9VTf//AABWAf//FA5Wzf//JORXxf//NV9Y0///
RZJRV///TEBOiP//WylOfv//bI5Ocv//fZ5OZP//jnZOVf//nylOQv//r8BOLf//wEROFv//0LdN
/v//4R5N4///8XtNj/////9OTAGjAABPJAAADxFPDwAAH8hO8QAAMBhOygAAQDtOoAAAUEBOdAAA
YC5OSQAAcAxOIgAAf9xN/wAAj6VN3wAAn2hNxAAArydNrQAAvuZNpwAAzsZNuQAA3uJN7gAA72FO
hAAA//9OcRETAABN0BHTEMpN+RGcIBdN+RGSL9FN+BGFP55N9hF1T3RN8hFiX05N7BFObyhN5BE5
fwFN2xEkjthN0hEPnqxNyBD7rn5NvhDovk9NwhDbzj9N3RDX3mpOFxDf7vVOshEI//9OrCCIAABO
KyDaEQhN9CD/IHtN9CD/L/BN9SD+P49N+CD7T0NN+iD3XwRN/SDxbs5N/yDpfp1N/yDgjnBN/iDW
nkRN/CDLrhlN+iDAve5OBCC9zeNOJCDE3hJOYiDc7qJPACEl//9PBTBLAABOrDBqEVNOdjB+IOFO
bjCCMD5ObjCCP8dObjCCT2xObjCCXx5ObjCCbtlObjCCfplObjCCjl1ObjCBniRObjB/rfBObjB8
vb9OezCCzbBOnTCV3dxO3TC97mlPfTEm//9PfEAqAABPTUAuEaBPK0AyIU1PGkA1MKxPGkA1QBlP
GkA1T6tPGkA1X1FPGkA1bwNPGkA1fr1PGkA1jnxPGkA1nj5PGkA1rgJPG0A1vcpPKEBBzbJPS0Bd
3dVPjECU7lhQLEEZ//9QFVAVAABQC1ALEepQBFAEIbZP/0//MTBP/k/+QIRP/k/+T/5P/k/+X5RP
/k/+bztP/k/+fuxP/k/+jqRP/k/+nmFP/k/+riJP/0//veZQDFAMzcpQLlAt3edQblBu7mNRDFEM
//9Q02AGAABQ6V/1Ei5Q/F/mIhhRD1/ZMa5RG1/TQQtRG1/TUGhRG1/TX+lRG1/Tb4JRG1/TfyhR
G1/TjthRG1/Tno9RG1/TrkpRG1/UvgpRKF/izehRSWAI3f9RiGBR7nNSIWED//9Rtm/7AABR52/m
EmtSFG/TInJSQm/AMiRSZ2+yQZpScm+vUOhScm+vYFFScm+vb9hScm+vf3FScm+vjxdScm+vnsZS
cm+vrntScG+vvjhSeW++zhZSk2/m3i1SynA07qBTWnD3//9Swn/xAABTCH/bEqRTTH/FIsZTlH+v
MpFT1X+bQh5UAH+QUX1T+n+RYMdT93+RcD1T83+Sf8tT7n+Sj2xT6H+RnxlT4X+RrtBT2H+QvpFT
2X+fznBT7H/I3oZUGoAa7vVUnoDq//9T9Y/pAABUTY/SEtpUpY+7IxNVBY+iMvVVYo+LQplVro95
Ug1Vdo+EYSFVcI+DcJdVaI+DgChVX4+Cj8tVVY+Bn31VSY9/rzlVPI99vv1VN4+Jzt5VQ4+y3vJV
aZAG71tV4pDf//9VUJ/iAABVt5/LEwZWIZ+zI1pWlp+ZM1JXDJ9/QwtXdp9oUpRW3Z+EYUpW1Z+D
cM5Wy5+BgGpWwJ9/kBlWs598n9RWpJ94r5hWlZ91v2VWi59/z0lWkZ+l311WsZ/578BXH6DX//9W
0q/bAABXRq/FEzhXvq+tI5xYSK+SM6lY1K92Q3ZZWq9cUxFYMK+OYTxYJ6+McNhYHK+JgIhYEK+F
kEhYAa+BoBFX8a98r+JX3693v7pX069+z6RX1K+g37hX7a/y8BZYULDP//9YfL/VAABY+L/AE1lZ
f7+oI9laGb+MM/pau79vQ9lbWL9UU4dZcb+fYPVZZ7+ccLJZXL+YgH1ZT7+UkFJZQL+OoC9ZL7+I
sBBZHL+Bv/VZDL+Ez+hZCb+h3/5ZHL/t8FdZcsDE//9aUc/cAABa1M/HE31bZs+wJBZcEM+UNEpc
xM93RDxdd89aU/taps/BYHhanM+9cGBakc+5gE1ahM+zkD9adc+toDNaY8+msChaUM+fwB9aOM+P
0BBaMM+l4ClaPc/p8H1ah9Cz//9cVN/6AABc3t/mE6hded/PJFNeL9+0NJte9N+WRKBfu994VHJb
1t/+X8lbzd/5b+Zbwd/0f/1bs9/vkBFbpN/ooCJbk9/gsDFbgd/YwD1ba9/O0EhbSd+q4DhbT9/j
8Idbi+CZ//9eiPA/AABfGfAsE9tfuvAVJJRgfO/6NPBhT+/cRQpiKO++VPFdBvBjXudc/PBeb0Zc
8fBZf5Jc5PBTj89c1fBLoANcxfBDsDBcsvA6wFdcnfAw0Hpch/Al4JhcVO/Z8HRcgfBz//9hCv//
AABhnv//FAtiRv//JONjE///NV5j8///RZFk2///VZBegf//XhleS///bqBeQP//fy1eM///j6Fe
JP//oAJeFP//sFdeAv//wKFd7v//0ORd2f//4SBdwP//8VddZv////9eAgJiAABfBAAADnle8wAA
H3xe2AAAL/BetwAAQC1ejwAAUEleZAAAYExeOAAAcDteDQAAgBxd5QAAj/BdvwAAn71dnQAAr4Nd
fwAAv0ZddQAAzyddhgAA30NdvwAA78FeawAA//9eIBGXAABdfhKEEQBdyhILIB9dxxIBL+pdwxHz
P8NdvhHhT6FdthHNX4FdrRG3b2BdohGffz1dlhGHjxhdiRFvnvBdfBFXrsRdbxFAvpddchEvzohd
jxEm3rJd0BEq7z1egxFO//9eUiDSAABdyCFCETFdeCGFILldgiF7MBpdhSF3P7ZdiCFxT2pdiyFo
XyxdjiFebvddjyFTfshdkCFGjpxdjiE4nnJdjCEprkhdiCEbvh9dlCETzhRduCEX3kRd/yEr7tRe
tiFw//9enDB6AABeMjCvEW9d6TDUIQ9d0jDgMGxd0jDgP+ld0jDgT4Zd0jDgXzNd0jDgbutd0zDg
fqld1DDejm1d1TDbnjdd1jDWrgVd1zDQvddd5jDTzcpeDjDj3fdeWDEI7oVfETFt//9e/0BLAABe
uEBfEbNegUBuIW1eX0B6MNleXkB6QDpeXkB6T8VeXkB6X2ZeXkB6bxVeXkB6fsxeXkB6joheXkB6
nkleXkB6rgxeX0B7vdNebkCGzbpelkCh3d1e4UDW7mFfmUFZ//9fflAtAABfV1AvEfZfN1AwIcxf
HVAzMVFfFlA0QKVfFlA0UBhfFlA0X6lfFlA0b0xfFlA0fvtfFlA0jrFfFlA0nm1fFlA0rixfF1A0
ve9fJlBBzdFfTVBj3e1fl1Cj7mdgTVFA//9gGWAZAABgEGAQEjZgCGAIIihgAmACMcZf/l/+QSpf
/l/+UIFf/l/+X/5f/l/+b5Nf/l/+fzdf/l/+juVf/l/+nppf/l/+rlRf/1//vhNgDWANzfBgM2Az
3gVge2B77ndhLWEt//9g1HAKAABg5G/7EnFg82/tIn5hA2/gMjVhEW/WQbFhF2/TUQFhF2/TYGZh
F2/Tb+lhF2/Tf4BhF2/TjyRhF2/TntFhF2/TroVhF2/Tvj5hJW/izhVhSXAL3iNhj3Ba7opiPHEf
//9hr3/+AABh1H/sEqhh+X/aIs9iIH/IMp5iRH+4Qi9iXn+uUZNiYX+tYOFiYX+tcFBiYX+tf9di
YX+tj29iYX+tnxNiYX+trr9iYX+uvnJibn+9zkJikH/o3kZi0oA97qJjeIEP//9irI/0AABi44/g
EtxjGo/MIxljV4+3Mv9jk4+jQqZjxY+TUh5j3Y+MYXFj3Y+McMdj3I+MgD1j24+Mj8hj2o+Mn2Jj
14+Mrwdj1I+Nvrdj24+czoRj9I/H3oVkLZAf7ttkxJD6//9jy5/rAABkEZ/XEwlkWZ/CI19kqp+q
M1pk/J+TQxZlRp9/UqFlfZ9xYgZlZZ92cTdlYZ92gKRlXJ92kCllVZ92n8FlTp91r2dlRp91vxhl
Rp+DzuRlWJ+s3uFliKAE7y9mEaDk//9lDK/jAABlX6/PEzlltq+5I6FmGa+gM69mgK+HQ35m4a9v
UxxnNK9cYpNm269ucYFm1K9tgPFmzK9skHxmw69roBlmua9qr8Vmrq9ov3tmqK9zz0hms6+Z30Fm
26/u74dnVrDO//9mb7/cAABmy7/IE1lnML+yI91npL+YM/9oHr9+Q+Bolr9kU5BpAr9NYxhoPr9x
cZxoNr9wgRxoLb9ukLNoIr9soFtoFr9psBBoCL9mv89n/79sz6BoBL+M35hoI7/c79Voj8C1//9n
+s/iAABoX8/OE35oz8+4JBhpUs+eNE1p3s+CREFqas9nVAJq7s9OY5tpl8+HcY5pjs+FgSRphM+C
kM9peM9/oIhpa898sExpXM93wBdpSM9sz+NpR8+F39tpXc/N8BFputCY//9psd/+AABqHd/qE6lq
l9/UJFVrJ9+6NJ1rw9+eRKNsYt+CVHds+99nZCJq6t+6cVhq4N+3gQ5q1t+zkNJqyt+voKJqvN+r
sHlqrN+mwFdqm9+g0Dlqfd+B4AZqit+98DRq1uB0//9rmPA/AABsC/AsE9xsjfAXJJRtKe/9NPJt
0+/gRQxug+/DVPNvL++mZLFsPvAWcP9sNPASgNxsKfAOkMNsHfAJoK9sD/AEsKBr/+/+wJNr7u/3
0Ilr2+/w4IFrqu+r8D1r4vBF//9tzv//AABuRf//FAhuz///JOJvdv//NVxwLv//RZFw7f//VZBx
rP//ZWVttP//cJ9tqv//gLNtoP//kMZtk///oNlthf//sOxtdf//wP9tZP//0RFtUf//4SNtPP//
8TVs3/////9tuANNAABu4wAADbdu1AAAHxtuvgAAL7huoAAAQA5ufAAAUD9uVAAAYFVuKQAAcFdt
/QAAgEht0QAAkCttqAAAoANtgQAAr9JtXgAAv51tTwAAz4NtYAAA36FtngAA8B9uXgAA//9t0RI1
AABtMhNIETFtpRJyIA9toRJoL/BtmxJaP9ltkxJJT8JtiBI0X6ttfBIdb5JtbhIEf3VtXxHrj1Vt
TxHQnzFtPhG1rwltLhGcvuBtMBGIztJtTxF73v5tlxF774luYBGc//9t/CEsAABtbyG5EVhtDyIY
IPZtLSH2MD9tLyHwP91tMiHnT5NtMyHcX1htNCHQbyZtNCHBfvltMyGxjs5tMCGgnqZtLSGPrn1t
KCF9vlZtNCFyzk1tXCFy3n1trCGC7wxueyHD//9uOzC1AABtyDD+EYxtcjE1IT1tRTFTMKRtRTFT
QBJtRTFTT6ZtRzFRX05tSTFPbwRtSzFLfsRtTjFGjoptUDE/nlZtUjE3riVtUzEvvfltZTEuzext
kjE73hpt5zFd7qhuuDG///9ukEB0AABuOkCXEcht9EC0IY9tv0DLMQltuUDPQGNtuUDPT+RtuUDP
X4BtuUDPbyptuUDPft5tuUDPjphtuUDPnlZtuUDPrhhtukDOvd9tzEDXzcdt+UDx3exuTkEj7nBv
H0Gk//9u/FBMAABuwlBZEgVukFBlIeVuZFBwMXVuUlB1QM5uUlB1UDhuUlB1X8NuUlB1b2JuUlB1
fw1uUlB1jsFuUlB1nnpuUlB1rjhuU1B2vfpuZFCCzdtuj1Ck3fVu41Dj7mxvsFF///9vgGAxAABv
YGAxEkBvQ2AxIjpvKGAxMeFvFmAzQU1vE2AzUKFvE2AzYBhvE2Azb6hvE2Azf0lvE2AzjvRvE2Az
nqdvFGAzrmBvFGAzvh1vJGBCzflvTmBn3g1voGCu7ntwaGFf//9wHXAdAABwFXAVEnlwDXANIoxw
BnAGMklwAHAAQctv/m/+USFv/m/+YH9v/m/+b/5v/m/+f5Jv/m/+jzNv/m/+nt9v/m/+rpFv/2//
vklwDnAOzh9wNnA23ipwhXCF7o9xR3FH//9w1oAOAABw4oABEq1w7n/0Itlw+3/nMq1xB3/bQkRx
En/TUa1xFH/SYPpxFH/ScGVxFH/Sf+lxFH/Sj39xFH/SnyFxFH/SrstxFH/Tvn1xIn/izktxSIAM
3k1xk4Bg7qZyToEx//9xq5ABAABxyI/xEt9x5o/hIyFyB4/QMwtyJ4+/QrZyRI+yUjJyVI+sYYly
VI+scNxyVI+sgE9yVI+sj9dyVI+sn25yVI+srw9yVY+svrpyYY+7zn9yhI/m3nZyy5A+7sFzfpEZ
//9ynZ/3AAByyZ/lEwxy95/TI2ZzK5+/M2NzX5+rQyJzkJ+ZUrFztZ+NYhpzwZ+JcWVzwZ+JgMNz
wZ+JkDxzwZ+Jn8ZzwZ+Jr15zwZ+KvwBzy5+Yzrxz6Z/C3qd0KaAb7uR0zqD7//9zra/tAABz5a/b
Ezp0Iq/II6Z0Z6+yM7Z0rq+bQ4h086+GUyl1L691YqN1Va9rcfx1Ta9sgUB1S69tkKl1SK9toCl1
RK9tr7p1P69uv1l1Qq96zxB1WK+i3vR1ja/57yV2ILDZ//902r/lAAB1Hb/TE1p1Z7+/I+B1vL+n
NAV2Fb+PQ+l2br93U5t2v79jYyV2/79Tco52zr9dgaJ2yb9dkQh2w79doIh2vL9dsBl2tL9cv7l2
sb9lz252vr+H30x26b/Z73F3a8Cz//92LM/oAAB2eM/WE392zc/CJBp3MM+qNFJ3m8+QREd4Bs93
VAp4a89fY6V4w89Lcx94Rc9kgeR4Ps9jkVJ4Ns9ioNl4Lc9hsHJ4I89gwBh4FM9Yz8R4Gs9z3514
Os+977d4qdCJ//93puABAAB3+t/vE6p4Wd/bJFd4yt/CNKF5RN+oRKh5wN+NVH16Od9zZCl6p99d
c7N5t9+Iggh5r9+HkYZ5pt+FoRt5nN+DsMF5kN+BwHR5g99+0DB5ad9k3955f9+i7+152uBZ//95
T/A+AAB5q/AtE916EvAYJJR6jvAANPN7F+/lRQ97o+/JVPZ8Lu+uZLV8se+VdFF7K+/XghJ7I+/V
kal7Ge/SoVN7Du/PsQx7Ae/MwNB69O/I0Jx65e/E4G96tu+G8A56+/Ag//97SP//AAB7qP//FAR8
F///JOF8n///NVt9NP//RZB90P//VZB+bP//ZWZ/Av//dRl8xP//giN8vP//kd18sf//oad8pv//
sXx8mf//wVp8i///0T98e///4Sh8av//8RZ8DP/d//99bgRmAAB+wQAADMR+tQAAHqR+oQAAL29+
hwAAP+F+ZwAAUCd+QQAAYE9+GAAAcGJ97QAAgGJ9wQAAkFR9lgAAoDl9bAAAsBR9RAAAv+d9MwAA
z9V9RQAA3/h9iAAA8Hh+XAAA//99hBLtAAB86RQfEV19hxLQH+V9ghLHL+R9ehK6P999cBKpT9Z9
YxKWX8l9VRJ/b7l9RRJmf6R9MxJMj4t9IBIwn219DBIUr0p8+RH5vyV8+hHhzxt9GhHT30l9ahHP
79R+SBHt//99qCGYAAB9HCI9EX18syK4ITB87SJtMFd87iJlP/x87iJbT7l87iJPX4N87SJBb1R8
6iIwfyp85yIfjwN84iILnt183SH3rrZ81iHjvpF84yHVzol9DiHS3rp9ZiHf70h+SyId//994DD8
AAB9aDFYEap9CDGiIWx8xTHXMOJ8zDHRQD98zzHNT8180jHJX3N81THDbyl82DG9ful82zG0jrF8
3jGrnn583zGgrk584TGVviN89DGRzhd9JjGb3kV9hDG67tF+bTIY//9+KkCnAAB9ykDZEd59eUED
IbN9NUEoMTp9IkEzQJR9IkEzUAp9IkEzX559IkEzb0N9IkEzfvN9IkEzjqp9I0Eynmh9JEEwrit9
JkEtvfR9O0E0zd59bkFL3gN9zUF67oZ+tkH4//9+iFByAAB+QFCKEhV+AVCgIgB9xlC2MZt9pVDD
QP59pFDDUF19pFDDX+F9pFDDb3t9pFDDfyJ9pFDDjtN9pFDDnop9pFDDrkZ9pVDEvgZ9uFDQzeZ9
6FDx3f1+RVEw7nJ/KVHJ//9++mBOAAB+ymBXEkx+nWBfIk5+cWBoMf5+UGBwQXN+SWByUMZ+SWBy
YDZ+SWByb8F+SWByf15+SWByjwd+SWBynrd+SWByrm5+SmByvip+W2CAzgR+imCl3hV+5GDs7oF/
wmGb//9/gnA1AAB/aHAzEoJ/TnAyIpt/M3AxMl9/HXAyQel/EXAyUUV/EXAyYJ1/EXAycBd/EXAy
f6d/EXAyj0Z/EXAynu9/EXAyrp9/EnAzvlZ/InBCzil/TnBp3jN/pXC37pSAfXF4//+AIYAhAACA
GoAaErSAEoASIuSACoAKMr6AA4ADQlt//3//Ucp//n/+YRh//n/+cH5//n/+f/5//n/+j5F//n/+
nzF//n/+rtl//3//voqADoAOzlaAN4A33laAioCK7quBWYFZ//+A2JASAACA4ZAGEuKA64/6IyqA
9Y/tMxiBAI/hQsiBCo/XUkmBEY/SYaWBEY/ScPWBEY/SgGSBEY/Sj+mBEY/Sn36BEY/Srx6BEo/S
vseBH4/hzoqBRZAL3n+BlJBi7saCWJE6//+BqKAFAACBwJ/3ExCB2Z/oI2yB9J/XM26CEZ/HQzGC
LJ+5UsSCQp+uYjCCS5+rcX6CS5+rgNmCS5+rkE6CS5+rn9aCS5+rr2yCS5+rvw2CVp+5zsaCeZ/i
3q6CwaA67uWDeqEY//+Ckq/6AACCtq/qEzqC3a/ZI6uDCa/GM7+DN6+zQ5SDZK+hUziDjK+SYrWD
p6+JchKDq6+HgVyDq6+HkMCDq6+HoDqDq6+Hr8WDq6+Iv1yDtK+TzwqD0q+63uSEFLAQ7wiEv7Du
//+Dlr/wAACDxb/gE1uD+L/OI+WEM7+5NAyEcr+kQ/KEsb+OU6eE6798YzSFGr9ucqCFMb9ngfCF
Mb9nkUCFML9noKuFL79osCmFLb9ov7aFMb9xz1mFR7+U3yWFfr/m7ziGFMC+//+Eu8/xAACE88/h
E4GFMc/OJB2Fe8+4NFiFyc+gRE6GGc+JVBSGZc90Y7GGqM9icy2G2M9VgoyGwc9akbqGvc9boR2G
uc9bsJeGtM9bwCGGqs9Wz7WGt89y33aG4s+873mHYtCH//+GBuAGAACGRt/2E6yGjt/jJFqG5N/M
NKWHQd+zRK2Hod+bVIOH/9+DZDGIVd9uc72InN9dgy2ITd9tkiGISN9toYeIQd9ssQSIOt9swJOI
Mt9r0DCIHN9W38SIOt+U77iIo+BL//+HffA+AACHxPAtE96IFfAaJJSIdvADNPWI4u/qRRGJUe/Q
VPqJv++2ZLqKJ++fdFeKg++Lg9iJ3u+rknaJ1++qoeiJz++psXCJxu+nwQqJvO+m0LKJse+k4GSJ
hu9t7+qJ1vAH//+JQ///AACJj///E/6J6P//JN+KVf//NVmKzf//RY6LS///VY+Lyf//ZWWMQ///
dRmMs///hK+Llf//ktyLjf//omWLhf//sgKLe///wbCLcP//0WuLY///4S+LV///8PuK+v+5//+N
JAWvAACOnwAAC5eOlAAAHhaOgwAALxiObAAAP6iOTwAAUAKOLQAAYDyOBgAAcF6N3QAAgG6NsQAA
kG2NhgAAoGCNWgAAsEaNMAAAwCWNHgAA0BqNMQAA4ESNeQAA8MiOYQAA//+NNxO9AACMohUIEYeN
bRMoH6CNZhMfL8SNXhMTP9WNUhMDT9yNRRLxX9uNNRLbb9WNIhLDf8mNDxKoj7eM+hKNn6CM5BJw
r4SMzhJUv2SMzRI7z1+M8BIr34+NRhIl8ByOORJB//+NVyIVAACMziLPEaGMXiNkIWaMuyLeMF6M
uiLWQA+MuCLMT9WMtiK/X6aMsiKwb36MriKef1iMqCKLjzWMoiJ3nxKMmiJhru+MkSJLvsyMnSI7
zsaMyyI13veNKyI/74aOJiJ6//+NiDFQAACNDzG9EcaMqTIYIZmMVTJlMSCMbDJNQGiMbzJIT/WM
cjJCX5yMdTI6b1OMeDIxfxSMejImjt2MfDIanquMfTINrn2MfTH/vlOMkjH5zkeMxzIB3nWNLjId
7wCOLTJ3//+NykDiAACNZEEiEfSNC0FbIdiMu0GOMW2MlUGnQM2MlUGnUDeMlkGnX8KMlkGmb2GM
mEGlfw6MmkGijsWMnUGfnoOMn0GarkiMo0GUvhKMukGYzfyM8kGs3iGNWkHZ7qSOWkJT//+OHVCf
AACNzFDDEiWNglDjIhyNPFEEMcONC1EbQTGNBlEeUImNBlEeYAWNBlEeb5mNBlEefzyNBlEejumN
BlEenp2NBlEerleNB1EevhWNG1ErzfKNUFFK3gmNtlGG7n2OslId//+OgmBxAACORmCDEliODWCU
ImSN1GClMh2NpWC1QZyNlGC7UPKNlGC7YFqNlGC7b9+NlGC7f3eNlGC7jxyNlGC7nsqNlGC7rn+N
lWC8vjmNqGDJzhGN22Dt3h+OPWEz7oiPMWHh//+O+nBRAACO0XBXEoqOqXBcIquOgHBjMniOW3Bq
QgmORHBvUW2OQnBvYMGOQnBvcDWOQnBvf8COQnBvj1uOQnBvnwKOQnBvrrCOQnBwvmWOVHB+zjaO
hHCl3j2O43Dy7puPznGw//+PhYA4AACPboA3Er2PV4A1IvGPPoAzMtGPJ4AyQnSPFoAyUeqPD4Ay
YTuPD4AycJuPD4AygBePD4Ayj6ePD4Ayn0SPD4AyruqPEIAzvpmPIIBBzmOPTYBq3mCPp4C87rKQ
iYGI//+QJZAlAACQHpAeEueQF5AXIzSQD5APMyeQCJAIQt2QApACUmOP/4//YcSP/o/+cRKP/o/+
gH2P/o/+j/6P/o/+n5CP/o/+ry6P/4//vtaQDZANzpeQNpA23omQi5CL7s2RYZFh//+Q26AVAACQ
4qALExWQ6aAAI3OQ8p/0M3qQ+p/nQ0GRA5/dUtiRC5/VYkmRD5/ScZuRD5/SgPGREJ/SkGOREJ/S
n+mREJ/Sr32REJ/SvxyRHJ/fztORQaAI3riRj6Bd7uuSWKE4//+Rp7AIAACRuq/8EzuRz6/uI7CR
56/fM8mSAK/PQ6GSGa/AU0mSL6+zYsqSP6+rciqSQ6+qgXWSQ6+qkNaSQ6+qoE2SQ6+qr9aSQ6+q
v2uSTa+1zxeSba/b3u6StLAw7w6TbbEK//+Si7/9AACSqL/vE12Syb/gI+uS77/ONBSTGL+7Q/2T
Qb+pU7WTZ7+ZY0WTh7+McrSTmb+GggiTmb+GkVaTmb+GoL6Tmb+GsDqTmb+Gv8SToL+Oz2OTur+w
3yqT+b//7zWUoMDT//+Ti8/7AACTss/sE4KT3s/cJCCUEc/INF2USc+0RFeUgc+fVB+UuM+MY7+U
6M97cz2VDM9wgp+VGM9tkeqVGM9toUGVGM9tsLCVGM9twDCVFc9oz7iVKc+D322VXc/M72GV79CT
//+Ur+AMAACU3t/9E62VFN/sJF2VVN/XNKiVmd/BRLOV4d+qVIyWJ9+UZDuWaN+Bc8mWn99ygzqW
wd9okpOWud9qodSWtt9rsTiWtN9rwLCWsN9r0DeWoN9a37qWxt+X75qXPeBK//+V/fA9AACWNPAu
E9+WcvAdJJSWvfAHNPeXEO/wRRSXZu/YVP+Xu+/AZMCYDe+qdF+YVe+Xg+CYju+Kk0mYYe+TomGY
XO+TscWYV++UwT6YUe+T0MiYS++T4GCYJO9j79SYf+/6//+Xmf//AACX1f//E/mYHP//JN6Ycf//
NVeY0f//RY2ZNP//VY2Zmf//ZWWZ+v//dRmaVP//hLCaof//lC2aMv//owiaLP//sneaJf//wfya
Hf//0ZOaFf//4TeaDP//8OaZs/+g//+c2gcpAACefQAACiOedAAAHW6eZQAALrCeUAAAP2GeNgAA
T9KeFgAAYB6d8gAAcE+dywAAgG2doQAAkHqddgAAoHmdSgAAsGydHwAAwFWdDQAA0FSdIQAA4ISd
cAAA8Q6ebAAA//+c6xSlAACcXRYDEaydUxN5H0CdTRNxL5CdRBNmP7udOBNYT9OdKRNGX+GdGBMx
b+adBRMbf+Oc8BMAj9qc2RLmn8ucwRLKr7acqhKsv5ycqBKUz5yczRKC39CdKhJ78F6eMRKV//+d
ByKjAACcgSNwEcOcDyQcIZqckSNKMFScjyNCQBWcjCM3T+eciCMqX8GcgiMbb5+cfCMJf4CcdCL2
j2KcayLgn0ScYSLKryScVyKyvwWcYiKgzwGckyKZ3zSc+iKh78KeCSLZ//+dMzGwAACcujItEeOc
UDKaIcab8TL8MVucIDLHQIicIjLBUBicIzK6X8KcJTKwb3ycJzKmf0CcKDKZjwucKDKMntucKDJ9
rq+cJzJtvoacPDJlznucdDJq3qic4zKD7zKd+DLb//+dbkEoAACdBUF1EgqcpkG7IfycTUH9MZ+c
E0IqQQucGEIlUGacG0IjX+ucHUIgb4ecIEIcfzKcJEIXjumcJ0IQnqicKkIJrm2cLkIBvjicRkID
ziOcg0IU3kec9EI+7sieCkK0//+duVDTAACdYlECEjedEFEtIjqcwFFZMeucglF9QWWcclGGULyc
clGGYC6cclGGb7ucclGGf1icclGGjwKcclGGnrOcclGGrmqcdFGFviici1GPzgacxVGs3hydNVHl
7pCeRlJ4//+eE2CbAACdzmC1EmadjGDPInudSGDqMj6dDWECQcac72EPUSSc72EPYIKc72EPcAGc
72EPf5Sc72EPjzWc72EPnuCc72EPrpKc8GEQvkqdBGEdziCdOmFA3iudpWGF7o+erGIx//+efnBy
AACeS3B/EpSeGHCMIr2d4nCaMpKdsXCoQiudjnCzUZedh3C1YOmdh3C1cFedh3C1f92dh3C1j3Sd
h3C1nxedh3C1rsOdiHC2vnadmnDEzkWdznDq3kieNHE17qOfM3Hx//+e+oBUAACe14BYEsKetIBc
Iv+ejYBgMuaeaIBlQpCeSoBqUgyePIBtYWSePIBtcL2ePIBtgDSePIBtj7+ePIBtn1mePIBtrv2e
PIBuvqqeTYB8znKefYCk3mye34D07rqf0oG9//+fiJA8AACfdJA6Eu2fX5A3Iz+fSJA1MzifMpAz
QvOfHpAyUn+fEZAyYeafDpAycTSfDpAygJmfDpAykBefDpAyn6afDpAyr0KfDpAyvuefHZBAzqaf
SZBo3pWfpZC77tSgi5GO//+gKaApAACgI6AjExygHKAcI3ygFKAUM4egDKAMQ1OgBaAFUu+gAaAB
YmWf/5//cbyf/5//gQ6f/5//kHyf/5//n/+f/5//r5Cf/5//vy2gC6ALzuKgM6Az3sSgh6CH7vOh
XqFe//+g3rAZAACg47AQEz2g6bAGI7ag8K/6M9Og96/uQ7Cg/q/jU1yhBq/ZYuGhDK/TckWhDq/S
gZGhDq/SkO6hDq/SoGOhDq/Sr+mhDq/Sv3yhGK/czyahOrAB3vmhhrBT7xaiS7Ep//+hp8AMAACh
t8ABE1+hyL/0I/Ch3b/lNByh87/WRAmiCb/HU8SiHr+6Y1iiML+vcsuiPL+qgiKiPb+pkW6iPb+p
oNOiPb+psE2iPb+pv9aiQ7+xz3KiX7/R3zWiocAf7z2jU8Du//+iitAHAACio8/6E4Wiv8/sJCWi
4M/bNGOjBM/JRGGjKc+3VCujTc+nY86jbc+Zc0+jhs+OgrSjkM+LkgGjkM+LoVWjkM+LsMGjkM+L
wD+jjs+Hz8ejos+h33ij2s/n72ikdtCp//+jjuATAACjr+AFE7Cj1d/2JF+kAt/kNKykM9/QRLmk
Zt+8VJSkmN+oZEakx9+Xc9ak79+Jg0qlCt+AkqWlD99/oe+lD99/sU2lD99/wMClD99/0EKlA99w
38GlMN+r75els+BZ//+kuvA9AACk4/AvE9+lEPAgJJSlSPAMNPqlhu/3RRelxu/hVQOmB+/LZMam
Re+3dGemfO+mg+qmqO+Zk1Smv++Toqimvu+Tsfimve+TwWCmvO+U0Nqmuu+U4GKmmu9q78ym/+/8
//+mMf//AACmX///E/Kmlv//JNym2P//NVWnIv//RYunb///VYynvv//ZWSoCv//dRmoUf//hLGo
jv//lC+ouv//o5aoo///ss2ooP//wjWonP//0bGomP//4T2ok///8NeoQP+W//+skAjYAACuWwAA
CGeuUgAAHKquRQAALjeuMgAAPw+uGwAAT5it/gAAX/Wt3QAAcDatuAAAgGGtkAAAkHutZgAAoIat
OgAAsIStDwAAwHis/QAA0ICtFQAA4LmtagAA8UeueQAA//+snxWiAACsFxcPEdCtOxPFHsOtNBO+
L0mtKxOzP5GtHxOmT76tEBOVX9qs/xOCb+us6xNtf/Ks1RNUj/KsvRM5n+yspBMer96sixMCv8us
iRLoz9GssBLW4AmtExLQ8JmuLhLn//+suCNCAACsNyQgEeKrxCThIcusbiOxMDasayOpQAysZiOe
T+ysYSORX9GsWiOCb7isUiNwf6CsSCNdj4isPSNHn2+sMSMwr1WsJSMYvzmsMCMFzzisYyL8322s
0CMD7/ut8yM5//+s4DIdAACsaTKoEf6r/DMlIfCrlTOdMZWr4TM+QJ2r4jM3UDOr4jMvX+Kr4zMl
b6Cr4zMZf2ir4jMLjzer4TL8nwqr3zLsruCr3TLbvrmr8TLRzq+sLTLU3t2sojLr72WtyjNA//+t
FUF3AACsrEHQEiGsSUIjIiCr6EJ1MdCrn0K0QUmrsUKjUJKrtEKfYBSrt0Kab6+rukKUf1urvUKN
jxKrwEKFntGrw0J8rperx0JyvmOr4EJxzk6sIEJ/3nGsmUKn7vCtw0Ma//+tWVEQAACs/lFJEkms
qFF/IlesT1G2MhWsBlHmQZmr5lH7UPar5lH7YFyr5lH7b+Gr51H7f3mr6FH6jx+r6VH4ns+r61H2
roar71HzvkSsCFH6ziKsR1IU3jisv1JK7qmt5FLZ//+tq2DKAACtYGDtEnOtF2EPIpOsymE0Ml+s
hWFWQfKsWGFsUVmsVGFvYLGsVGFvcCesVGFvf7WsVGFvj1KsVGFvnvmsVGFvrqisVWFvvl6sa2F8
zjCspGGe3jitFmHi7piuMWKK//+uC3CZAACt0HCtEqGtlXDBItGtVXDXMq2tGXDtQk+s6nD+UcOs
23EFYRis23EFcH2s23EFf/6s23EFj5Gs23EFnzCs23EFrtms3HEFvoqs8HESzlatJnE43latlHGC
7quupHI7//+ue4B0AACuT4B9EsmuIoCHIw6t8ICTMvytv4CeQq2tloCpUjCtfYCwYY+tfICxcOOt
fICxgFWtfICxj9ytfICxn3KtfICxrxOtfICxvr6tjoC/zoKtwYDl3nmuKYE07sKvLIH6//+u+5BX
AACu3ZBaEvSuvZBcI0uumZBfM0qudpBjQwuuVpBnUp2uPpBqYgquN5BscVquN5BsgLquN5BskDOu
N5Bsn7+uN5Bsr1euN5BsvvquR5B5zraudZCg3qKu1pDy7t2vy5HA//+vi6BAAACveqA+Ex+vZ6A7
I4evUqA4M5avPKA1Q2evJ6AzUwivF6AyYoOvDaAxcd+vDaAxgS6vDaAxkJivDaAxoBevDaAxr6av
DaAyv0CvGqA+zvKvQ6Bk3tGvnKC27vywgaGI//+wLbAtAACwJ7AnEz+wILAgI76wGbAZM9+wEbAR
Q8CwCbAJU3CwBLAEYvqwALAAcmOv/6//gbGv/6//kQqv/6//oHuv/6//r/+v/6//v5CwCLAIzzaw
LLAs3wawfLB87x6xTbFN//+w4cAdAACw5cAVE2Kw6sALI/Ww78AANCaw9b/0RBaw+7/pU9WxAb/f
Y22xCL/XcuSxDL/Sgj+xDb/RkYqxDb/RoOyxDb/RsGKxDb/Rv+mxE7/Yz4OxL7/330KxdcBC70Wy
McEM//+xrNAUAACxudAKE4ixyM/+JCqx2c/xNGux7M/iRGuyAM/TVDmyE8/FY96yJs+5c2OyNM+x
gsuyPM+tkhuyPM+toWyyPM+tsNWyPM+twFGyOs+rz9eyTs/C34WyidAG73CzLNDD//+ylOAaAACy
qeAPE7KyweACJGCy3t/yNLGy/t/hRMCzH9/QVJ6zQN+/ZFKzX9+wc+Wzet+kg1uzjd+ckrizkt+a
ogOzkt+asV6zkt+awM6zkt+a0E6ziN+O386ztt/G76C0P+Bu//+zovA9AACzv/AxE9mz3/AjJJW0
B/ARNPy0Mu/+RRu0YO/rVQi0ju/YZM20u+/GdG+04++2g/S1BO+rk2C1F++kora1GO+ksgW1GO+k
wWq1GO+k0OG1GO+k4Ga0/e+B79O1aPAM//+0+f//AAC1G///E+u1RP//JNq1dv//NVO1rf//RYm1
5///VYu2Iv//ZWO2XP//dRm2kv//hLG2wv//lC+25f//o5i28f//suy28f//wkm28f//0bq28f//
4Ty28f//8Mq2qP+b//+8SQq7AAC+OwAABnS+MwAAG8e+JwAALa6+FwAAPrC+AQAAT1S95wAAX8S9
yAAAcBS9pQAAgE29fwAAkHO9VwAAoIq9LQAAsJS9AAAAwJC87wAA0KK9CgAA4OG9ZQAA8XW+hwAA
//+8Vha1AAC71BgtEfG9JBQNHiq9HhQGLu69FRP8P1m9CRPvT5y8+hPgX8i86RPOb+a81RO5f/m8
vhOjkAO8phOKoAW8jBNur/+8cBNSv/K8bhM7z/28lxMp4Dm9ARMf8My+LRM3//+8bSPzAAC78CTe
EgG7fSWzIfq8USQSMAe8TSQLP/S8SCQAT+W8QSP0X9e8OSPlb8i8MCPTf7m8JSPAj6i8GCOrn5W8
CyOUr4G7+yN7v2i8BSNoz2u8OSNe36G8rSNk8DC94iOY//+8kDKXAAC8HDMvEhi7rzO8Ihq7QjRH
Mc27rzOxQKW7rzOqUES7rjOhX/u7rTOXb8C7rDOKf467qTN8j2G7pjNsnzi7ozNbrxG7nTNIvuu7
sTM9zuO77jM+3xC8aTNT75e9pDOl//+8wUHRAAC8WEI2Eji780KVIkS7jEL2MgG7N0NHQYe7XkMg
ULm7YEMbYDu7YkMVb9e7ZUMNf4W7aEMFjz27akL7nv+7bELwrse7bELkvpG7hkLhzn27yULt3p+8
SEMS7xu9hEOB//+8/1FVAAC8olGXElu8SFHYInW76VIcMj67llJYQc+7ZFJ+UTW7aFJ7YI+7alJ5
cA27bFJ2f6G7b1Jzj0W7clJwnvS7dVJrrqu7d1Jlvmi7klJpzkW71VKB3lq8VFK07si9i1M///+9
SWEBAAC8+2EsEoK8rGFXIqy8WGGGMoK8CmGxQh+70WHTUZC7xGHaYOa7xGHacFS7xGHaf9u7xGHa
j3O7xWHanxe7xWHarsO7w2HavnS72mHmzkS8GGIG3km8kmJH7qe9v2Lq//+9oXDGAAC9YHDhEqq9
HnD8IuW81nEaMsq8kXE4QnS8WHFSUfK8PXFfYUy8PXFfcKm8PXFfgCS8PXFfj7K8PXFfn068PXFf
rvO8PHFevqC8UHFrzmm8inGP3mW8/XHY7rW+HXKN//++B4CZAAC91ICpEtK9noC5Ix69Y4DLMxS9
KIDdQsy89YDvUle80oD7Yb28zID9cQ+8zID9gHq8zID9j/28zID9n4+8zID9ry28y4D9vtS83oEK
zpW9E4Ev3oi9gIF87sy+k4I+//++epB3AAC+VJB+Ev2+LJCGI1i9/pCPM129z5CYQyW9pJCiUr29
gpCqYjC9dJCucYW9dJCugN+9dJCukFS9dJCun9y9dJCur3G9c5CuvxC9g5C6zsm9s5Dg3rG+GZEv
7ua/HJH5//++/aBbAAC+46BdEyG+xqBeI5C+paBgM6W+g6BiQ3y+Y6BlUyO+SKBoYqO+NqBrcgW+
M6BrgVO+M6BrkLi+M6BroDO+M6Brr7++M6Brv1a+QKB2zwW+aqCa3uC+yKDq7wW/uaG4//+/j7BE
AAC/gLBCE0K/brA/I8i/W7A7M+y/RrA4Q9G/MrA1U4e/ILAzYxW/ErAycoO/DLAygda/DLAykSq/
DLAyoJe/DLAysBi/DLAxv6a/FbA6z0m/OrBc3xW/jbCp7yjAabF1///AMcAxAADALMAsE2XAJcAl
I/vAHcAeNDHAFsAWRCXADsAOU+jAB8AHY4PAAsACcv6//7//gl2//7//kam//7//oQe//7//sHu/
/7//v//ABMAEz5XAIcAh31HAasBq70/BLsEu///A59AkAADA6tAcE4vA7dATJDDA8tAINHPA9s/9
RHbA+8/xVEfBAM/nY/DBBs/ec3jBC8/XguTBDs/UkjfBDs/UoYbBDs/UsOzBDs/UwGTBDc/Sz+rB
Ic/o35PBXdAp73rCCNDf///Bt+AjAADBwuAaE7XBz+APJGLB3uACNLbB7t/0RMnCAN/lVKjCEd/Y
ZF/CI9/Lc/XCMt/Bg23CPt+6ks3CQd+4ohnCQd+4sXHCQd+4wN7CQd+40FvCOt+w393CaN/l76nC
9uCG///Cq/A9AADCvfAyE9LC0vAmJJXC6/AXNP3DCPAHRSDDJe/2VQ7DQ+/lZNTDYO/WdHjDe+/I
hADDku++k23DoO+4osXDou+4shLDou+4wXPDou+40OjDou+44GrDi++c793D+PAg///D4///AADD
+///E+PEGP//JNjEO///NVHEY///RYfEjP//VYrEtv//ZWLE4P//dRjFB///hLHFKv//lDDFRP//
o5nFUP//su7FUP//wkbFUP//0bTFUP//4TLFUP//8L3FDv+s///MSQyxAADOYwAABEvOXAAAGs/O
UQAALSbOQgAAPl7OLgAATyTOFgAAX67N+QAAcBPN2QAAgF7NtQAAkJbNjgAAoL7NZgAAsNjNOwAA
wOXM4AAA0LjM/gAA4P/NYQAA8ZjOlAAA///MVBfnAADL1xlmEhnNVRRaHX3NTxRULpPNRhRMPyvN
OhRAT4vNKxQxX8/NGhQgcADNBhQMgCPM8BP3kDzM2BPgoEzMvRPHsFTMoROswFXMVhOH0CDMgRN1
4GHM8BNu8PbOLhOG///MZyTEAADL7yW7EifLfCahIjXMfSR/L9bMeCR3P+bMciRuT/DMayRhX/XM
YiRTb/bMVyRCf/XMSyQvj/LMPiQan+vMLyQEr+HMHyPrv9XL3yPIz5bMFSO938/MjiPC8F7N1CP1
///MhjMyAADMFTPWEj3LqDRxIlHLNzUPMhfLyTQ1QLfLxzQuUGjLxTQlYC3LwzQab//LwDQNf9jL
vDP/j7XLuDPvn5bLsjPdr3nLrDPKv13LeDOozxPLtzOo30HMODO778fNgzQL///MsEJOAADMSEK8
ElfL4kMnInXLd0OXMkTLGUP7QdvLWUOyUPLLWkOtYH3LXEOmcCHLXkOdf9bLX0OUj5bLYUOJn1/L
YkN9ry7LYkNwvwHLN0NRzqzLe0Nc3s3MAEN+70bNTEPq///M5lG+AADMiVIJEnfMLFJTIqHLyVKj
MnrLblLtQhrLLVMjUY/LPFMVYN7LPlMScF3LQVMOf/TLRFMKj5vLSFMEn0/LS1L+rwvLTlL2vs7L
KFLbzm3LblLw3oDL81Mg7uvNO1On///NJmFdAADM1WGQEpvMg2HDItLMKWH7MrfL1GIxQmLLkGJe
UeHLdWJwYT7LdWJwcKfLdWJwgCvLdWJwj8LLdmJvn2bLd2JurxTLeWJsvsrLVGJVzl/LlmJz3mLM
F2Kw7r3NVWNO///NcnEXAADNLnE5Er3M5nFbIwXMl3GCMvjMSnGoQq/MCHHKUjjL4HHgYZ/L3XHi
cPrL3XHigHHL3XHij/3L3XHin5nL3XHirz/L3XHivu3LuXHNzn7L9XHw3nXMbnI37sDNnXLp///N
yYDiAADNkYD4EuTNVYEOIzvNEoEnMzrMz4FBQv7MkoFZUpTMZYFsYgXMWIFycVzMWIFygMPMWIFy
kEPMWIFyn9XMWIFyr3TMWIFyvxvMOIFdzqrMcIGB3pjM4oHM7tfOAoKK///OLJC4AADN/5DEEwzN
0JDRI3DNmZDgM37NYZDwQ0/NLJD/UvHNAZENYm7M6ZEVcczM6JEVgSPM6JEVkJbM6JEVoBzM6JEV
r7HM6JEVv1HMzZECzt7M/5Em3sHNaZFz7vHOeJI4///Om6CUAADOeqCZEyrOVaCfI6POK6CmM8DN
/qCuQ5/N1KC2U07Nr6C+YtfNlKDEckDNjaDGgZHNjaDGkPTNjaDGoG3NjaDGr/jNjaDGv4/Nd6C1
zxrNo6DX3vDOBKEl7xDPAKHt///PF7BzAADPALB0E0nO5bB1I9fOx7B2NAHOp7B3Q+3OiLB5U6nO
a7B7Yz7OVbB9crLOSLB/ggzOSLB/kV7OSLB/oMnOSLB/sEjOSLB/v9XOOLByz17OXbCR3yXOs7Dc
7zLPmLGi///Pn8BUAADPkcBRE2vPgsBOJAXPb8BLNEDPW8BHRDnPSMBDVALPNcBAY6LPJsA+cyPP
G8A+gofPGMA9kdXPGMA9oTDPGMA9sKHPGMA9wCPPEMA2z6rPLMBQ32HPd8CW71nQQ8FU///QNdA1
AADQMNAwE4/QKtAqJDfQItAiNH3QGtAaRIPQE9ATVFfQC9ALZATQBdAFc4/QAdABgv/P/8//klbP
/8//oaLP/8//sQXP/8//wHrP/8//z//QEtAS36TQT9BP74TQ/9D////Q8OAuAADQ8uAmE7nQ9eAe
JGTQ+OAUNLzQ/OAJRNHRAN/9VLPRBN/zZG3RCN/pdAbRDd/hg4HREd/ckuTRE9/aojLRE9/asYXR
E9/awO/RE9/a0GrRD9/V3+3RPeAH77PRzeCg///RzPA9AADR1fA0E8vR4PAqJJbR7fAeNP/R+/AQ
RSPSC/ACVRXSG+/0ZN3SK+/ndILSOe/chAvSRu/Tk3vST+/OotXSUe/NsiHSUe/NwX7SUe/N0O/S
Ue/N4G/SQO+67+fSrfA2///S5v//AADS9f//E9rTCP//JNbTH///NU/TOP//RYXTUv//VYfTbv//
ZWDTif//dRfTo///hLDTuv//lDDTzf//o5rT1v//su/T1v//wkPT1v//0a3T1v//4SfT1v//8K7T
n/++///czA63AADfDwAAAeXfCQAAGcTe/wAALKfe8QAAPiXe3gAATxneyAAAX8ferQAAcErejwAA
gLHebQAAkQLeSAAAoUPeIQAAsXXd+AAAwZrdzQAA0bTc8gAA4RLdWwAA8a/engAA///c1Bk/AADc
XRrEElLeCRS0HMPeAxSvLkHd+hSnPxPd7hScT57d4BSQYALdzxSBcE/duxRwgI3dpRRbkL3djRRD
oOTdcxQqsQPdVhQQwRndORP10SjcbBPB4IDc4RO78RfeLhPQ///c5CXAAADccCbBEl3b/ie4Iobd
LCUBL7HdJyT6P/DdISTwUBzdGCTlYD/dDyTXcFrdAyTHgHHc9iS0kIPc6CSgoJHc2CSKsJvcxiRy
wKLctCRZ0KXb9SQa3/fccyQd8IbdxyRP///c/DP8AADcjjSpEm7cITVTIp/brjYDMn/cZzTWQOLc
ZTTPUK/cYjTGYI3cXjS7cHTcWjSugGHcVTSfkFLcTzSPoEXcSDR9sDrcQDRqwC/cODRV0CTbhjQQ
327cDDQi7/LdZTRu///dHkL8AADct0NzEobcUUPqIr7b4kRpMqXbfUTeQlTb2kRrUVHb20RlYO3b
3ERdcKLb3ERUgGjb3URKkDnb3UQ+oBHb3UQxr/Db3EQjv9Lb20QUz7jbNkPK3vrbwEPq73HdGkRS
///dSFJdAADc6lKwEqPcjFMEIuTcJVNgMtTbw1O3Qovbd1P9Uhfbl1PeYV3bmVPZcObbnFPUgInb
n1POkD3bolPHn/3bpVPAr8bbqFO3v5fbq1Otz23bEVNh3qnbm1OP7xDc8VQQ///demHyAADdKGIs
EsDc0mJoIw/cdGKqMwncGGLrQsnby2MjUl3bn2NDYc7bomNBcTfbo2M/gMDbpWM+kF3bqGM7oArb
qmM4r8LbrWM0v4LbsGMwz0rbH2Lj3oHbpmMd7tjc82O2///dtHGmAADdbXHOEuDdInH4IzzczXIm
M0LceXJWQwzcL3KAUqnb+3KgYiPb8HKmcYbb8HKmgQDb8HKmkJHb8HKmoDLb8HKmr9/b8HKmv5Xb
8HKmz1HbZnJa3ofb5HKf7s3dIXNL///d94FqAADduoGFEwXdeoGhI2rdMYHCM3zc5oHjQ1LcoYID
Uvnca4IdYnzcUoIpceHcUoIpgUrcUoIpkM7cUoIpoGXcUoIpsAncUoIpv7jcUoIpz27b1IHb3qrc
SoIk7uLdd4Ld///eQpE4AADeEJFJEyPd2pFcI5ndnJFxM7jdXJGHQ5jdH5GdU0rc65GwYtbcypG9
ckTcxZHAgaHcxZHAkRbcxZHAoKDcxZHAsDrcxZHAv+DcxZHAz4/cVZFz3tPcw5G+7v3d3ZJ+///e
laEKAADebqEUEz7eQqEfI8feEKErM/Ld26E4Q97dp6FGU5vdeaFSYzHdVqFdcqfdSKFiggTdSKFi
kWjdSKFioOTdSKFisHPdSKFiwA7dSKFiz7Tc6aEb3wLdTaFl7xzeUaIo///e8bDcAADe1LDhE1ve
srDlI/Pei7DrNCreYbDxRCLeOLD4U+neErD+Y4nd87EFcwnd37EJgm7d3LEKkcXd3LEKoTHd3LEK
sLLd3LEKwELd3LEKz9/dkLDM3zjd6bEU7z7e1bHU///fVcCsAADfQcCsE3rfKcCsJB3fDcCtNGDe
78CtRGPe0cCuVDTetMCvY9/em8Cxc2jeicCygtbegcC0kizegcC0oYfegcC0sPnegcC0wH3egcC0
0A7eS8CF33Pel8DH72XfaMF+///fw9B2AADfttBzE5vfqNBwJEbfl9BsNJPfhNBoRKDfcdBkVHzf
XtBgZDDfTtBec8LfQdBcgznfOdBckpffN9BboeXfN9BbsUffN9BbwL3fN9Bb0EHfG9BB37bfWNB6
75DgC9Ei///gOeA5AADgNOA0E7zgLuAuJGfgJ+AnNMPgH+AfRNrgF+AXVMDgEOAQZHzgCeAJdBfg
BOAEg5bgAOAAkvzf/9//okzf/9//sZzf/9//wQLf/9//0Hrf/9//3//gLOAs77/gvuC+///g/vA9
AADhAPA2E8ThAvAuJJjhBPAlNQHhB/AaRSfhCvAPVRrhDfAEZOXhEe/6dI3hFe/xhBjhGe/qk4rh
HO/moubhHe/lsjHhHe/lwYrhHe/l0PjhHe/l4HThE+/b7/LhgPBO///h+v//AADiAv//E9HiDP//
JNTiF///NUziJP//RYHiMv//VYTiQP//ZV7iTv//dRbiXP//hLDiaf//lDDidP//o5riev//svDi
e///wkHie///0aXie///4Rvie///8J7iUv/R///uJxDYAADwewDJAADwkAAAGKfwhwAALD7wegAA
PhfwaQAAT0rwVAAAYCrwOwAAcNnwHwAAgWjv/wAAkeDv3AAAokXvtgAAspvvjgAAwuTvZAAA0yHv
OQAA41XtUwAA8b3upgAA///uLRrIAADtuhxREqDvlRUpHAPvjxUjLgfvhxUbPyfvfBURT+rvbhUF
YH7vXRT2cPXvShTkgVnvNBTRka7vHBS8ofjvARSmsjnu5RSOwnHuxxR20qHuqBRZ4svs0hP/8TDu
LhQU///uNyb0AADtxygAEqrtVikEIvvusyWmL6TuriWfQCTupyWWUIPuniWLYNDulCV+cRPuiCVu
gU7ueyVckYLuayVJobLuWiU0sd3uSCUcwgPuNSUD0ibuICTp4kTsWSR38KftuySm///uRzUEAADt
2zW8ErvtbzZyIw/s+Tc1MxTt3TWmQTjt2jWeUS/t1zWVYTPt0jWKcT7tzTV+gUztxzVvkV3tvzVf
oXDttzVNsYLtrjU5wZXtpDUk0aftmTUO4bjr5DSG8BntSjTQ///uXEPwAADt90RxEs3tkETzIynt
IEWAMzXstEYGQwftNEVdUentNEVXYaXtM0VPcXntM0VFgVztMkU6kUrtMUUuoT/tL0UhsTntLUUS
wTftK0UC0TftJ0Tw4TrrhURV75rs7ES6///udlNKAADuGlOlEuPtuVQDI0ntUFRqM1zs6FTPQzXs
klUlUuLsyFTrYiTsylTmccbszVTggYHsz1TZkU7s0VTRoSfs1FTIsQns1lS+wPLs2FSz0OHs2VSn
4NXrTFP97zbsrVR6///ulWLdAADuQWMeEv3t6WNiI23th2OuM4jtJmP5Q2ns0GQ9UxzslmRsYqzs
o2Rich3spWRfgbfsqGRckWjsq2RYoSnsrmRTsPfssWROwM7stWRI0KzsuGRB4JDrPmOM7vfsl2Qf
///ut3KQAADubXK+ExvuH3LvI5PtxnMmM7jtbHNeQ6DtGnOTU1vs23O8YvLsw3PMcm3sw3PMgfPs
w3PMkZLsxHPMoUPsxHPMsQHsxXPLwMnsxnPJ0JnsyHPH4G/rY3ML7uDsrXOx///u3YJTAADunYJz
EzjuWIKWI7zuCYK9M+ntuILmQ9rtbIMOU53tLYMvYzrtCINEcrrtBYNFgjHtBYNFkcLtBYNFoWft
BYNFsRvtBYNFwNntBYNF0KDtBYNF4G7ruIKF7u/s74M4///vBpIdAADu0JIzE0/ulpJKI+HuUZJl
NBruCpKCRBTtxZKfU9/tiZK5Y4TtXpLMcwrtUpLSgnntUpLSkfrtUpLSoZHtUpLSsTntUpLSwO3t
UpLS0KvtUpLS4HDsJJIQ7wrtRpLK///vM6HnAADvB6H1E2fu1aIEJAnunKIVNEnuX6IpREzuI6I8
VB/t7aJOY8ztwaJec1ntqqJmgsvtqaJnkjrtqaJnocHtqaJnsVvtqaJnwQTtqaJn0LftqaJn4HPs
n6Gs7yjtq6Jo///vYrGrAADvP7GzE4DvGLG8JCru6bHGNHfut7HRRILuhbHdVF3uVrHoZBHuLrHz
c6TuErH7gx3uC7H9koHuC7H9offuC7H9sYLuC7H9wR3uC7H90MTuDLH94HXtKrFR70vuHLIK///v
lMFmAADvesFqE5rvXMFtJE3vOMFyNKDvEMF2RLPu6cF8VJbuw8GBZFHuocGHc+vuh8GMg2nuecGP
ktDueMGPojLueMGPsazueMGPwTjueMGP0NLueMGP4HftxsD873Lum8Gr///vytEVAADvt9EVE7Xv
otEUJGnviNEUNMXvbNEUROHvTtETVMrvMtEUZIzvGNEVdCzvA9EWg7Du9NEXkxvu8NEYonTu8NEY
sdru8NEYwVbu8NEY0OHu8NEY4Hnuc9Cp75zvJ9FJ///wAuCzAADv9+CwE8Tv6uCtJIHv2eCoNOjv
yOCkRQnvteCgVPnvo+CcZMDvkuCYdGXvhOCWg+7veeCUk17vc+CUornvcuCUsg3vcuCUwXbvcuCU
0PHvcuCU4HrvMOBV78zvweDe///wPfA9AADwOfA5E7zwM/AzJJrwLPAsNQTwJPAkRSzwHPAcVSHw
FPAUZO3wDfANdJfwB/AHhCXwA/ADk5nwAPAAovfv/+//skLv/+//wZjv/+//0QHv/+//4Hrv/+//
7//wafBp///xGv//AADxHP//E8fxHf//JNLxH///NUnxIf//RX3xI///VYLxJv//ZVvxKP//dRPx
LP//hK7xL///lC/xMv//o5rxNf//svHxNf//wj3xNf//0Z3xNf//4Q7xNf//8I3xHv/n/////xNR
AAD//wPgAAD//wAAF63//wAALE3//wAAPrf//wAAUFj//wAAYZf//wAAcp7//wAAg4D//wAAlEj/
/wAApPz//wAAtZ///wAAxjX//wAA1r7//wAA5z3//wAA97L+qQAA/////xzNAAD//x5cE0H//xXw
G3f//xXrLkf//xXkP+j//xXbURP//xXQYgL//xXDcs7//xWzg4P//xWilCb//xWQpL3//xV4tUn/
/xVexcz//xVE1kf//xUo5rr//xUM9yb+KhRX/////yjBAAD//ynXE0f//yrsI+j//ybJMBf//ybD
QQj//ya6Ucb//yawYmn//yajcv3//yaTg4X//yaClAb//yZvpH///yZatPP//yZExWL//yYr1c3/
/yYQ5jP//yX19pT9riT7/////zbCAAD//zeDE1L//zhJI/f//zkeNEn//zcZQkD//zcSUoz//zcJ
Yt///zb+czX//zbxg47//zbjk+f//zbSpEH//zbAtJr//zatxPL//zaY1Un//zaB5Z///zZp9fT9
MDUv/////0W3AAD//0ZAE2D//0bOJAr//0drNGD//0gERHz//0cXU1z//0cQY2D//0cHc3n//0b+
g6H//0byk9P//0bmpAv//0bYtEj//0bIxIj//0a31Mv//0al5Q///0aS9VX8wEUh/////1UkAAD/
/1WHE3L//1XvJCL//1ZjNHz//1bWRJz//1c9VI7//1bfY+j//1bZc8n//1bTg8P//1bLk87//1bC
o+b//1a4tAf//1atxC///1ah1F3//1aU5I///1aG9MT8blTk/////2TNAAD//2UWE4f//2ViJDv/
/2W4NJv//2YQRL///2ZhVLX//2afZIf//2aFdB7//2aBg+///2Z8k9n//2Z3o9P//2Zxs9r//2Zr
w+z//2Zj1AT//2Zb5CP//2ZS9Ef8QWSJ/////3SUAAD//3TJE53//3UBJFb//3VBNLz//3WDROT/
/3XCVN7//3X2ZLP//3YTdGv//3YRhB3//3YQk+z//3YOo8///3YMs8D//3YKw73//3YH08P//3YD
49D//3X/8+T8PnQZ/////4RlAAD//4SLE6z//4SzJHD//4TiNNv//4UURQj//4VEVQf//4VuZN//
/4WMdJn//4WShED//4WSk/z//4WSo8///4WSs7H//4WSw6D//4WS05f//4WS45b//4WS85r8aIOb
/////5QzAAD//5ROE7v//5RrJIn//5SNNPn//5SxRSr//5TUVSz//5T1ZQj//5UPdMT//5UbhGb/
/5UblA7//5Ubo8///5Ubs6L//5Ubw4L//5Ub02z//5Ub41///5Ub81j8s5Md/////6P2AAD//6QI
E8r//6QcJJ7//6QzNRP//6RMRUn//6RmVU7//6R+ZSz//6STdOr//6ShhI3//6SjlCP//6Sjo8//
/6Sjs5D//6Sjw2D//6Sj0zz//6Sj4yD//6Sj8wz9CaKt/////7OmAAD//7OxE9n//7O+JLD//7PN
NSn//7PeRWL//7PvVWn//7P/ZUn//7QPdQn//7QbhK3//7QglDr//7Qgo9D//7Qgs3z//7Qgwzr/
/7Qg0wX//7Qg4tr//7Qg8rf9arJF/////8M9AAD//8NDE+j//8NLJML//8NTNTv//8NdRXX//8Nm
VX7//8NxZV///8N6dR///8ODhMP//8OJlFD//8OKo9D//8OKs2b//8OKww///8OK0sf//8OK4ov/
/8OK8lj918Hd/////9K2AAD//9K5E/f//9K7JMj//9K/NUb//9LCRYL//9LHVYv//9LLZWz//9LQ
dSz//9LUhM///9LYlFr//9Lao9D//9Las07//9LawuD//9La0oT//9La4jT//9La8e/+T9Fy////
/+INAAD//+IME+z//+ILJMz//+ILNUv//+IKRYf//+IJVZD//+IJZXD//+IJdS7//+IJhND//+IK
lFn//+ILo8z//+IMszP//+IMwq3//+IM0jr//+IM4dX//+IM8Xz+0+EB//////E8AAD///E6E9b/
//E2JM////EyNUr///EtRYT///EpVYv///EkZWn///EgdSX///EdhMT///EblEr///Eao7n///EZ
sxb///EZwnX///EZ0er///EZ4W7///EZ8P//Y/CG////////AAD/////E7z/////JM3/////NUP/
////RXn/////VX3/////ZVj/////dRD/////hKv/////lC3/////o5j/////svD/////wjr/////
0ZP/////4P//////8Hn///////8AAGN1cnYAAAAAAAAAAgAA//9jdXJ2AAAAAAAAAAIAAP//Y3Vy
dgAAAAAAAAACAAD//3NmMzIAAAAAAAEMPQAABdz///MoAAAHjwAA/ZL///ui///9ogAAA9sAAMB9
ZGF0YQAAAAABAAAAAwAAAA==
--Apple-Mail=_C1BE0CFC-CBE4-404A-90F6-90FC379EF629
Content-Transfer-Encoding: 7bit
Content-Type: text/html;
charset=us-ascii
<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><div class=""></div><div class="">I don't know which log file to search for a solution.</div><div class=""><br class=""></div><div class="">2. My hosted engine never seems to start properly unless I manually set my hosts to Global Maintenance mode. I then have to re-run "engine-setup" and accept all the defaults and it will start and function. It does throw an error about starting ovirt-imageio-proxy when running engine-setup</div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">[ ERROR ] Failed to execute stage 'Closing up': Failed to start service 'ovirt-imageio-proxy'</div></blockquote></body></html>
--Apple-Mail=_C1BE0CFC-CBE4-404A-90F6-90FC379EF629
Content-Disposition: attachment;
filename=ovirt-engine-setup-20160818125822-b8g6ku.log
Content-Type: application/octet-stream;
x-unix-mode=0644;
name="ovirt-engine-setup-20160818125822-b8g6ku.log"
Content-Transfer-Encoding: quoted-printable
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/log=3Dbool:'True'=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFileHandle=3Dfile:'<open=20file=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20mode=20'a'=20at=200x28bc1e0>'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFileName=3Dstr:'/var/log/ovirt-engine/setup/ovirt-engine-setup-201=
60818125822-b8g6ku.log'=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilter=3D_MyLoggerFilter:'filter'=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'[]'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFilterRe=3Dlist:'[<_sre.SRE_Pattern=20object=20at=200x2901ac0>]'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20CORE/logRemoveAtExit=3Dbool:'False'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
boot=20METHOD=20otopi.plugins.otopi.dialog.misc.Plugin._init=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20DIALOG/dialect=3Dstr:'human'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
boot=20METHOD=20otopi.plugins.otopi.dialog.human.Plugin._init=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
DIALOG/autoAcceptDefault=3Dbool:'False'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
DIALOG/boundary=3Dstr:'--=3D451b80dc-996f-432e-9e4f-2b29ef6d1141=3D--'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
boot=20METHOD=20otopi.plugins.otopi.dialog.machine.Plugin._init=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20boot=20=
METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.connection.Plugin._boot=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password']'=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20boot=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.connection.Plugin._b=
oot=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password',=20=
'OVESETUP_DWH_DB/password']'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20boot=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._boot=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password',=20=
'OVESETUP_DWH_DB/password',=20'OVESETUP_DB/password']'=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20boot=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._boot=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password',=20=
'OVESETUP_DWH_DB/password',=20'OVESETUP_DB/password',=20=
'OVESETUP_CONFIG/adminPassword']'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20boot=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._boot=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password',=20=
'OVESETUP_DWH_DB/password',=20'OVESETUP_DB/password',=20=
'OVESETUP_CONFIG/adminPassword',=20'OVESETUP_PKI/storePassword']'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
boot=20METHOD=20otopi.plugins.otopi.core.misc.Plugin._init=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:737=20SEQUENCE=20=
DUMP=20-=20BEGIN=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20boot=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.misc.Plugin._preinit=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.core.misc.Plugin._preinit=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.core.log.Plugin._init=20=
(otopi.core.log.init)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.dialog.misc.Plugin._init=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.dialog.human.Plugin._init=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.dialog.machine.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.connection.Plugin._boot=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.connection.Plugin._b=
oot=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._boot=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._boot=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._boot=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.misc.Plugin._init=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.packagers.dnfpackager.Plugin._boot=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.system.info.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._boot=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:739=20=
STAGE=20init=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.debug.force_fail.force_fail.Plugin._force_fail_do=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.config.Plugin._init=20(otopi.core.config.init)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.dnfpackager.Plugin._init=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._init=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.system.command.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.misc.Plugin._init=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.packagers.core.Plugin._init=20=
(otopi.packagers.detection)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.transaction.Plugin._init=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.dialog.cli.Plugin._init=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.network.firewalld.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.iptables.Plugin._init=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.network.ssh.Plugin._init=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.system.clock.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.system.reboot.Plugin._init=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.answerfile.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.offlinepackager.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.postinstall.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.reconfigure.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.uninstall.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager.Plugin._in=
it=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager_firewalld.=
Plugin._init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.hostname.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine.Plugin.=
_init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.hostile_services.Plugin._ini=
t=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.selinux.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.engine.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.fence_kdump_listener.P=
lugin._init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.config.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.connection.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.pgpass.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.config.java.Plugin._=
init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.core.protocols.Plugi=
n._init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.provisioning.postgre=
s.Plugin._init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.apache.Plugin=
._init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.environment.P=
lugin._init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.he.Plugin._in=
it=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.config.dwh_uuid.Plugin.=
_init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.core.misc.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.core.service.Plugin._in=
it=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.config.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.connection.Plugin._i=
nit=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.pgpass.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_imageio_proxy.core.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.websocket_proxy.core.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.core.misc.Plugin._init=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.dialog.preview.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._ini=
t=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.system.environment.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.engine.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.root.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.appmode.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.domain_type.Plugin._i=
nit=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.dwh_database.Plugin._=
init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.iso_domain.Plugin._in=
it=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.java.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.notifier.Plugin._init=
=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.public_glance_reposit=
ory.Plugin._init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.storage.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.advertise_dwh.Plugin._i=
nit=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.misc.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.distro-rpm.packages.Plugin._=
init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._init=
=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.image_upload.Plugin._=
init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.memcheck.Plugin._init=
=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks.Plugin._i=
nit=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dbvalidations.Plugin=
._init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dwh.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.core.Plugin._i=
nit=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.misc.Plugin._i=
nit=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._in=
it=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.config.jboss.Plugin._=
init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages.P=
lugin._init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl.Plugin.=
_init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.remote_engine.Plugi=
n._init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.single_etl.Plugin._=
init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.distro-rpm.packages.Plug=
in._init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._init=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.pki.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._ini=
t=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.system.Plugin._ini=
t=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.packages.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.pki.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.debug.wait_on_error.wait_on_error.Plugin._init=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20setup=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.dnfpackager.Plugin._setup_existence=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._setup_existence=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.config.Plugin._post_init=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.core.log.Plugin._setup=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.core.misc.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.dnfpackager.Plugin._setup=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._setup=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine_root_ss=
h.Plugin._setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._setup=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.network.hostname.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.services.openrc.Plugin._setup=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.services.rhel.Plugin._setup=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.services.systemd.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.system.clock.Plugin._setup=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.system.reboot.Plugin._setup=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager_firewalld.=
Plugin._setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager_human.Plug=
in._setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager_iptables.P=
lugin._setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.hostname.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine.Plugin.=
_setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine_manual_=
files.Plugin._setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.hostile_services.Plugin._set=
up=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.mem.Plugin._setup=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.selinux.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.misc.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.connection.Plugin._setup=
=20(osetup.db.connection.setup)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.core.misc.Plugin._se=
tup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.core.protocols.Plugi=
n._setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.apache.Plugin=
._setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.config.dwh_uuid.Plugin.=
_setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.core.misc.Plugin._setup=
=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.connection.Plugin._c=
ommands=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.connection.Plugin._s=
etup=20(osetup.dwh.db.connection.setup)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._setup_dbtransaction=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_imageio_proxy.core.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.vmconsole_proxy_helper.core.Plugin._setu=
p=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.websocket_proxy.core.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.root.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.jboss.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.misc.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.fence_kdump_listener.config.=
Plugin._setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._setu=
p=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.image_upload.Plugin._=
setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._se=
tup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages.P=
lugin._setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl.Plugin.=
_setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection.Plugin._se=
tup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.legacy.config.Plugin._se=
tup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._setup_engine_db_credentials=20(None)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._kee=
p_only_valid_firewall_managers=20=
(osetup.keep.only.valid.firewall.managers)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._setup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20internal_packages=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.core.transaction.Plugin._pre_prepare=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.hostname.Plugin._internal_packages=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.dnfpackager.Plugin._internal_packages_end=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._internal_packages_end=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.transaction.Plugin._pre_end=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:739=20=
STAGE=20programs=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.system.command.Plugin._programs=20=
(otopi.system.command.detection)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._programs=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.pki.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.services.openrc.Plugin._programs=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.services.rhel.Plugin._programs=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.services.systemd.Plugin._programs=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:739=20=
STAGE=20late_setup=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._late_setu=
p=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._late_s=
etup_service_state=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._late_setup=
_service_state=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20customization=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._customization=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.core.config.Plugin._customize1=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.dialog.cli.Plugin._customize=20=
(otopi.dialog.cli.customization)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.reconfigure.Plugin._customizat=
ion=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._versi=
on_lock_customization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.config.jboss.Plugin._=
version_lock_customization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.dialog.titles.Plugin._title_s_produ=
ct_options=20(osetup.dialog.titles.productoptions.start)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.misc.Plugin._customizat=
ion=20(osetup.engine.core.enable)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._custom=
ization=20(setup.config.imageio-proxy.customization)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._customizat=
ion=20(setup.config.websocket-proxy.customization)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._custo=
mization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.java.Plugin._customiz=
ation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.distro-rpm.packages.Plugin._=
customization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.misc.Plugin._custom=
ization=20(osetup.dwh.core.enable)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._cus=
tomization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.packages.Plugin._customiz=
ation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.dialog.titles.Plugin._title_e_produ=
ct_options=20(osetup.dialog.titles.productoptions.end)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.distro-rpm.packages.Plug=
in._customization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_packages=20(osetup.dialog.titles.packaging.start)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages.P=
lugin._customization=20(osetup.distro-rpm.package.update.check)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_packages=20(osetup.dialog.titles.packages.end)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_network=20(osetup.dialog.titles.network.start)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.hostname.Plugin._customizat=
ion=20(osetup.config.protocols.customization)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._cus=
tomization_is_requested=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._cus=
tomization=20(osetup.net.firewallmanager.available)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.protocols.Plugin._cus=
tomization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.firewall.Plugin._conf=
iguration=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.config.firewall.Plugi=
n._configuration=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_network_owners_config_customized=20=
(osetup.network.owners.config.customized)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.remote_engine.Plugi=
n._remote_engine_customization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._custom=
ization_network=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._cus=
tomizationNetwork=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._customizat=
ion_network=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_network=20(osetup.dialog.titles.network.end)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_database=20(osetup.dialog.titles.database.start)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection.Plugin._custom=
ization_enable=20(osetup.engine.db.connection.allow)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._customization_enable=20(osetup.engine.provisioning.pgsql.allow)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._customization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._customization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection.Plugin._cu=
stomization=20(osetup.dwh.db.connection.customization)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection.Plugin._custom=
ization=20(osetup.db.connection.customization)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._custom=
ization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_db_owners_connections_customized=20=
(osetup.db.owners.connections.customized)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.engine_connection.Plu=
gin._engine_customization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_database=20(osetup.dialog.titles.database.end)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_engine=20(osetup.dialog.titles.engine.start)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._customiza=
tion=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.appmode.Plugin._custo=
mization_enable=20(osetup.engine.config.appmode.allow)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.appmode.Plugin._custo=
mization=20(osetup.config.applicationMode.available)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.domain_type.Plugin._c=
ustomization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_engine=20(osetup.dialog.titles.engine.end)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_storage=20(osetup.dialog.titles.storage.start)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.storage.Plugin._confi=
gureSANWipeAfterDelete=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_storage=20(osetup.dialog.titles.storage.end)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_pki=20(osetup.dialog.titles.pki.start)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._customization=
=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._customization=
_upgrade=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.pki.Plugin._customiza=
tion=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.pki.Plugin._customization=
=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_pki=20(osetup.dialog.titles.pki.end)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_apache=20(osetup.dialog.titles.apache.start)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.root.Plugin._customiz=
ation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._cu=
stomization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_apache=20(osetup.dialog.titles.apache.end)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_system=20(osetup.dialog.titles.system.start)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.fence_kdump_listener.config.=
Plugin._customization_disable=20(osetup.engine.kdump.allow)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._customiza=
tion_enable=20(osetup.engine.system.nfs.allow)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._custom=
ization_firewall=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._customizat=
ion_firewall=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.fence_kdump_listener.config.=
Plugin._customization_firewall=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._customiza=
tion=20(osetup.system.nfs.available)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.iso_domain.Plugin._cu=
stomization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._firewall=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_system=20(osetup.dialog.titles.system.end)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_misc=20(osetup.dialog.titles.misc.start)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.scale.Plugin._custo=
mization=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_misc=20(osetup.dialog.titles.misc.end)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.config.Plugin._customize2=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._customization_firewall=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._customization_firewall=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:739=20STAGE=20validation=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.core.misc.Plugin._validation=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._vali=
dation_enable=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks.Plugin._v=
alidateEnv=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._va=
lidate_enable=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.hostname.Plugin._validation=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.network.ssh.Plugin._validation=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.selinux.Plugin._validation=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.engine.Plugin._validat=
ion=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.config.Plugin._validatio=
n=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.pgpass.Plugin._validatio=
n=20(osetup.db.connection.credentials.early)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.config.java.Plugin._=
validation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.he.Plugin._va=
lidate=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.config.Plugin._valid=
ation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._val=
idation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.notifier.Plugin._vali=
dation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._validation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._vali=
dation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.image_upload.Plugin._=
validation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._va=
lidate_ssl=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl.Plugin.=
_validation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.check_etl.Plugin._v=
alidation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.single_etl.Plugin._=
validation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._valida=
tion=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._validation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._validation=20=
(otopi.network.firewalld.validation)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.iptables.Plugin._validate=20=
(otopi.network.iptables.validation)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema.Plugin._validation=
=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.memcheck.Plugin._vali=
dateMemory=20(osetup.memory.check)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks.Plugin._v=
alidateZombies=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._rev=
iew_config=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.memcheck.Plugin._vali=
dateContinueLowMemory=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.dialog.preview.Plugin._customization=
=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._validatio=
n_late=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaakerbldap.Plugin._v=
alidation_late=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks.Plugin._v=
alidateAsyncTasks=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dbvalidations.Plugin=
._validation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaainternal.Plugin._v=
alidation=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20transaction-prepare=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.core.transaction.Plugin._main_prepare=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.engine.Plugin._transac=
tionBegin=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.fence_kdump_listener.P=
lugin._transactionBegin=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.core.service.Plugin._tr=
ansactionBegin=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_imageio_proxy.core.Plugin._transac=
tionBegin=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.websocket_proxy.core.Plugin._transaction=
Begin=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.hostile_services.Plugin._tra=
nsaction_begin=20(osetup.system.hostile.detection)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.single_etl.Plugin._=
transactionBegin=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:739=20STAGE=20early_misc=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._early_misc=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dbvalidations.Plugin=
._misc=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20packages=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.iptables.Plugin._packages=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages.P=
lugin.packages=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.system.Plugin._pac=
kages=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.dnfpackager.Plugin._packages=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._packages=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:739=20=
STAGE=20misc=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.config.jboss.Plugin._=
jboss=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.system.command.Plugin._misc=20=
(otopi.system.command.redetection)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl.Plugin.=
_misc=20(osetup.system.sysctl.available)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._misc=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.network.iptables.Plugin._store_iptables=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.ssh.Plugin._append_key=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.system.clock.Plugin._set_clock=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._pre=
pare_examples=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.engine.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.root.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaainternal.Plugin._m=
isc=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.database.Plugin._misc=
=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.dwh_database.Plugin._=
miscDWHConfig=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.java.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.jboss.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.protocols.Plugin._mis=
c=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.tools.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.advertise_dwh.Plugin._g=
et_dwh_host=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._miscUpgrade=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._misc=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.answerfile_fixup.Plu=
gin._misc=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dwh.Plugin._misc_sto=
p_remote_dwh=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.selinux.Plugin=
._misc=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._mi=
sc=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.config.Plugin._misc=
=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.scale.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._misc=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._misc_c=
onfig=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._mis=
cConfigVMConsoleHelper=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._mis=
cConfigVMConsoleProxy=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._misc_confi=
g=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.pgpass.Plugin._misc=20=
(osetup.db.connection.credentials.late)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.pgpass.Plugin._misc=20=
(osetup.dwh.db.connection.credentials)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._misc=20=
(osetup.pki.ca.available)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema.Plugin._misc=20=
(osetup.db.schema)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh.Plugin._misc=20=
(osetup.pki.ssh.available)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._misc=20=
(osetup.dwh.db.schema)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._check_=
separate=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._misc_V=
DC=20(setup.config.imageio-proxy.remote_vdc)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.pki.Plugin._misc_pki=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.pki.Plugin._miscPK=
IEngine=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.pki.Plugin._miscPK=
IProxy=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._check_sepa=
rate=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._misc_VDC=20=
(setup.config.websocket-proxy.remote_vdc)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.pki.Plugin._misc_pki=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection.Plugin._connec=
tion=20(osetup.db.connection.available)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection.Plugin._co=
nnection=20(osetup.dwh.db.connection.available)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._engine_connection=20(osetup.dwh.engine.db.connection.available)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._misc=20=
(osetup.aaa_jdbc.config.setup.admin.user)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.appmode.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.ca.Plugin._misc=20=
(osetup.config.encryption.available)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.domain_type.Plugin._m=
isc=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.iso_domain.Plugin._ad=
d_iso_domain_to_db=20(osetup.config.iso_domain.available)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.options.Plugin._miscA=
lways=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.options.Plugin._miscN=
ewDatabase=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.public_glance_reposit=
ory.Plugin._misc=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.sso.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.storage.Plugin._updat=
eSANWipeAfterDelete=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin.miscOptions=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._databa=
seOptions=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._setup=
AdminPassword=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._misc=
=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.image_upload.Plugin._=
misc=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.single_etl.Plugin._=
misc=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._misc=20=
(osetup.config.aaa.adminuser.setup)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.selinux.Plugin._misc=20=
(osetup.setup.selinux)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.misc.Plugin._m=
isc=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.postinstall.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20cleanup=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.transaction.Plugin._main_end=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:739=20=
STAGE=20closeup=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._closeup=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.iptables.Plugin._closeup=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.hostile_services.Plugin._clo=
seup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.fence_kdump_listener.config.=
Plugin._closeup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.engine.Plugin._closeu=
p=20(osetup.core.engine.start)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._closeup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.service.Plugin._clo=
seup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.legacy.config.Plugin._cl=
oseup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._closeu=
p=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.system.Plugin._clo=
seup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._closeup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.dialog.titles.Plugin._title_s_summa=
ry=20(osetup.dialog.titles.summary.start)=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.apache.Plugin=
._closeup=20(osetup.apache.core.restart)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._clo=
seup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._closeup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.dwh_database.Plugin._=
closeupDWHConfig=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.protocols.Plugin._clo=
seup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._closeup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh.Plugin._closeup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._closeup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._clos=
eup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.memcheck.Plugin._clos=
eup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dwh.Plugin._closeup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.remote_engine.Plugi=
n._closeupEngineAccess=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._closeup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.system.Plugin._dev=
env_closeup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.dialog.titles.Plugin._title_e_summa=
ry=20(osetup.dialog.titles.summary.end)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.system.reboot.Plugin._closeup=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:739=20STAGE=20=
cleanup=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.misc.Plugin._cleanup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine.Plugin.=
_cleanup=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.remote_engine.Plugi=
n._cleanupEngineAccess=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.pki.Plugin._cleanup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.pki.Plugin._cleanup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.uninstall.Plugin._cleanup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.answerfile.Plugin._cleanup=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._rollba=
ck=20(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20pre-terminate=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.misc.Plugin._preTerminate=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.dialog.cli.Plugin._pre_terminate=20=
(otopi.dialog.cli.termination)=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpSequence:739=20STAGE=20terminate=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.misc.Plugin._terminate=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.dialog.human.Plugin._terminate=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.dialog.machine.Plugin._terminate=20(None)=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.core.log.Plugin._terminate=20=
(None)=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20reboot=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.system.reboot.Plugin._reboot=20(None)=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpSequence:746=20SEQUENCE=20=
DUMP=20-=20END=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/aborted=3Dbool:'False'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/debug=3Dint:'0'=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
BASE/error=3Dbool:'False'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
BASE/exceptionInfo=3Dlist:'[]'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
BASE/executionDirectory=3Dstr:'/root'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
BASE/exitCode=3Dlist:'[{'priority':=2090001,=20'code':=200}]'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/log=3Dbool:'True'=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
BASE/pluginGroups=3Dstr:'otopi:ovirt-engine-common:ovirt-engine-setup'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
BASE/pluginPath=3Dstr:'/usr/share/otopi/plugins:/usr/share/ovirt-engine/se=
tup/bin/../plugins'=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
BASE/suppressEnvironmentKeys=3Dlist:'[]'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/configFileName=3Dstr:'/etc/ovirt-engine-setup.conf'=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/failOnPrioOverride=3Dbool:'True'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logDir=3Dstr:'/var/log/ovirt-engine/setup'=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFileHandle=3Dfile:'<open=20file=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20mode=20'a'=20at=200x28bc1e0>'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFileName=3Dstr:'/var/log/ovirt-engine/setup/ovirt-engine-setup-201=
60818125822-b8g6ku.log'=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFileNamePrefix=3Dstr:'ovirt-engine-setup'=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFilter=3D_MyLoggerFilter:'filter'=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password',=20=
'OVESETUP_DWH_DB/password',=20'OVESETUP_DB/password',=20=
'OVESETUP_CONFIG/adminPassword',=20'OVESETUP_PKI/storePassword']'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilterRe=3Dlist:'[<_sre.SRE_Pattern=20object=20at=200x2901ac0>]'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20CORE/logRemoveAtExit=3Dbool:'False'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20CORE/randomizeEvents=3Dbool:'False'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
DIALOG/autoAcceptDefault=3Dbool:'False'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
DIALOG/boundary=3Dstr:'--=3D451b80dc-996f-432e-9e4f-2b29ef6d1141=3D--'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20DIALOG/dialect=3Dstr:'human'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20INFO/PACKAGE_NAME=3Dstr:'otopi'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20INFO/PACKAGE_VERSION=3Dstr:'1.5.1'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/totalMemoryMB=3DNoneType:'None'=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20INFO/PACKAGE_NAME=3Dstr:'otopi'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20INFO/PACKAGE_VERSION=3Dstr:'1.5.1'=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:22=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
boot=20METHOD=20otopi.plugins.otopi.packagers.dnfpackager.Plugin._boot=0A=
2016-08-18=2012:58:22=20DEBUG=20=
otopi.plugins.otopi.packagers.dnfpackager=20dnfpackager._boot:163=20=
Cannot=20initialize=20minidnf=0ATraceback=20(most=20recent=20call=20=
last):=0A=20=20File=20=
"/usr/share/otopi/plugins/otopi/packagers/dnfpackager.py",=20line=20150,=20=
in=20_boot=0A=20=20=20=20constants.PackEnv.DNF_DISABLED_PLUGINS=0A=20=20=
File=20"/usr/share/otopi/plugins/otopi/packagers/dnfpackager.py",=20line=20=
60,=20in=20_getMiniDNF=0A=20=20=20=20from=20otopi=20import=20minidnf=0A=20=
=20File=20"/usr/lib/python2.7/site-packages/otopi/minidnf.py",=20line=20=
16,=20in=20<module>=0A=20=20=20=20import=20dnf=0AImportError:=20No=20=
module=20named=20dnf=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfDisabledPlugins=3Dlist:'[]'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfExpireCache=3Dbool:'True'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfRollback=3Dbool:'True'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfpackagerEnabled=3Dbool:'True'=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/keepAliveInterval=3Dint:'30'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20boot=20METHOD=20=
otopi.plugins.otopi.system.info.Plugin._init=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.plugins.otopi.system.info=20info._init:36=20SYSTEM=20=
INFORMATION=20-=20BEGIN=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.plugins.otopi.system.info=20info._init:37=20executable=20=
/bin/python=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.plugins.otopi.system.info=20info._init:38=20python=20/bin/python=0A=
2016-08-18=2012:58:22=20DEBUG=20otopi.plugins.otopi.system.info=20=
info._init:39=20platform=20linux2=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.plugins.otopi.system.info=20info._init:40=20distribution=20=
('CentOS=20Linux',=20'7.2.1511',=20'Core')=0A2016-08-18=2012:58:22=20=
DEBUG=20otopi.plugins.otopi.system.info=20info._init:41=20host=20=
'cultivar.grove.silverorange.com'=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.plugins.otopi.system.info=20info._init:47=20uid=200=20euid=200=20=
gid=200=20egid=200=0A2016-08-18=2012:58:22=20DEBUG=20=
otopi.plugins.otopi.system.info=20info._init:49=20SYSTEM=20INFORMATION=20=
-=20END=0A2016-08-18=2012:58:22=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20boot=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._boot=0ALoaded=20=
plugins:=20fastestmirror,=20versionlock=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20=
BEGIN=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/log=3Dbool:'True'=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFileHandle=3Dfile:'<open=20file=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20mode=20'a'=20at=200x223cf60>'=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFileName=3Dstr:'/var/log/ovirt-engine/setup/ovirt-engine-setup-201=
60818125822-b8g6ku.log'=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilter=3D_MyLoggerFilter:'filter'=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'[]'=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFilterRe=3Dlist:'[<_sre.SRE_Pattern=20object=20at=200x22bd2c0>]'=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20CORE/logRemoveAtExit=3Dbool:'False'=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
boot=20METHOD=20otopi.plugins.otopi.dialog.misc.Plugin._init=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20DIALOG/dialect=3Dstr:'human'=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
boot=20METHOD=20otopi.plugins.otopi.dialog.human.Plugin._init=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
DIALOG/autoAcceptDefault=3Dbool:'False'=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
DIALOG/boundary=3Dstr:'--=3D451b80dc-996f-432e-9e4f-2b29ef6d1141=3D--'=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
boot=20METHOD=20otopi.plugins.otopi.dialog.machine.Plugin._init=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20boot=20=
METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.connection.Plugin._boot=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password']'=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20boot=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.connection.Plugin._b=
oot=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password',=20=
'OVESETUP_DWH_DB/password']'=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20boot=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._boot=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password',=20=
'OVESETUP_DWH_DB/password',=20'OVESETUP_DB/password']'=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20boot=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._boot=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password',=20=
'OVESETUP_DWH_DB/password',=20'OVESETUP_DB/password',=20=
'OVESETUP_CONFIG/adminPassword']'=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20boot=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._boot=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password',=20=
'OVESETUP_DWH_DB/password',=20'OVESETUP_DB/password',=20=
'OVESETUP_CONFIG/adminPassword',=20'OVESETUP_PKI/storePassword']'=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
boot=20METHOD=20otopi.plugins.otopi.core.misc.Plugin._init=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:737=20SEQUENCE=20=
DUMP=20-=20BEGIN=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20boot=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.misc.Plugin._preinit=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.core.misc.Plugin._preinit=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.core.log.Plugin._init=20=
(otopi.core.log.init)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.dialog.misc.Plugin._init=20(None)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.dialog.human.Plugin._init=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.dialog.machine.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.connection.Plugin._boot=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.connection.Plugin._b=
oot=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._boot=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._boot=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._boot=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.misc.Plugin._init=20(None)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.packagers.dnfpackager.Plugin._boot=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.system.info.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._boot=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:739=20=
STAGE=20init=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.debug.force_fail.force_fail.Plugin._force_fail_do=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.config.Plugin._init=20(otopi.core.config.init)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.dnfpackager.Plugin._init=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._init=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.system.command.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.misc.Plugin._init=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.packagers.core.Plugin._init=20=
(otopi.packagers.detection)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.transaction.Plugin._init=20(None)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.dialog.cli.Plugin._init=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.network.firewalld.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.iptables.Plugin._init=20(None)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.network.ssh.Plugin._init=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.system.clock.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.system.reboot.Plugin._init=20(None)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.answerfile.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.offlinepackager.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.postinstall.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.reconfigure.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.uninstall.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager.Plugin._in=
it=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager_firewalld.=
Plugin._init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.hostname.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine.Plugin.=
_init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.hostile_services.Plugin._ini=
t=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.selinux.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.engine.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.fence_kdump_listener.P=
lugin._init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.config.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.connection.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.pgpass.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.config.java.Plugin._=
init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.core.protocols.Plugi=
n._init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.provisioning.postgre=
s.Plugin._init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.apache.Plugin=
._init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.environment.P=
lugin._init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.he.Plugin._in=
it=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.config.dwh_uuid.Plugin.=
_init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.core.misc.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.core.service.Plugin._in=
it=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.config.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.connection.Plugin._i=
nit=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.pgpass.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_imageio_proxy.core.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.websocket_proxy.core.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.core.misc.Plugin._init=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.dialog.preview.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._ini=
t=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.system.environment.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.engine.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.root.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.appmode.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.domain_type.Plugin._i=
nit=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.dwh_database.Plugin._=
init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.iso_domain.Plugin._in=
it=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.java.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.notifier.Plugin._init=
=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.public_glance_reposit=
ory.Plugin._init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.storage.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.advertise_dwh.Plugin._i=
nit=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.misc.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.distro-rpm.packages.Plugin._=
init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._init=
=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.image_upload.Plugin._=
init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.memcheck.Plugin._init=
=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks.Plugin._i=
nit=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dbvalidations.Plugin=
._init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dwh.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.core.Plugin._i=
nit=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.misc.Plugin._i=
nit=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._in=
it=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.config.jboss.Plugin._=
init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages.P=
lugin._init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl.Plugin.=
_init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.remote_engine.Plugi=
n._init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.single_etl.Plugin._=
init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.distro-rpm.packages.Plug=
in._init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._init=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.pki.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._ini=
t=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.system.Plugin._ini=
t=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.packages.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.pki.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.debug.wait_on_error.wait_on_error.Plugin._init=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20setup=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.dnfpackager.Plugin._setup_existence=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._setup_existence=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.config.Plugin._post_init=20(None)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.core.log.Plugin._setup=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.core.misc.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.dnfpackager.Plugin._setup=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._setup=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine_root_ss=
h.Plugin._setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._setup=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.network.hostname.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.services.openrc.Plugin._setup=20(None)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.services.rhel.Plugin._setup=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.services.systemd.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.system.clock.Plugin._setup=20(None)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.system.reboot.Plugin._setup=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager_firewalld.=
Plugin._setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager_human.Plug=
in._setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager_iptables.P=
lugin._setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.hostname.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine.Plugin.=
_setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine_manual_=
files.Plugin._setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.hostile_services.Plugin._set=
up=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.mem.Plugin._setup=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.selinux.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.misc.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.connection.Plugin._setup=
=20(osetup.db.connection.setup)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.core.misc.Plugin._se=
tup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.core.protocols.Plugi=
n._setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.apache.Plugin=
._setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.config.dwh_uuid.Plugin.=
_setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.core.misc.Plugin._setup=
=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.connection.Plugin._c=
ommands=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.connection.Plugin._s=
etup=20(osetup.dwh.db.connection.setup)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._setup_dbtransaction=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_imageio_proxy.core.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.vmconsole_proxy_helper.core.Plugin._setu=
p=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.websocket_proxy.core.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.root.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.jboss.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.misc.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.fence_kdump_listener.config.=
Plugin._setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._setu=
p=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.image_upload.Plugin._=
setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._se=
tup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages.P=
lugin._setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl.Plugin.=
_setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection.Plugin._se=
tup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.legacy.config.Plugin._se=
tup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._setup_engine_db_credentials=20(None)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._kee=
p_only_valid_firewall_managers=20=
(osetup.keep.only.valid.firewall.managers)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._setup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20internal_packages=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.core.transaction.Plugin._pre_prepare=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.hostname.Plugin._internal_packages=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.dnfpackager.Plugin._internal_packages_end=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._internal_packages_end=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.transaction.Plugin._pre_end=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:739=20=
STAGE=20programs=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.system.command.Plugin._programs=20=
(otopi.system.command.detection)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._programs=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.pki.Plugin._setup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.services.openrc.Plugin._programs=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.services.rhel.Plugin._programs=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.services.systemd.Plugin._programs=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:739=20=
STAGE=20late_setup=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._late_setu=
p=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._late_s=
etup_service_state=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._late_setup=
_service_state=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20customization=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._customization=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.core.config.Plugin._customize1=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.dialog.cli.Plugin._customize=20=
(otopi.dialog.cli.customization)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.reconfigure.Plugin._customizat=
ion=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._versi=
on_lock_customization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.config.jboss.Plugin._=
version_lock_customization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.dialog.titles.Plugin._title_s_produ=
ct_options=20(osetup.dialog.titles.productoptions.start)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.misc.Plugin._customizat=
ion=20(osetup.engine.core.enable)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._custom=
ization=20(setup.config.imageio-proxy.customization)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._customizat=
ion=20(setup.config.websocket-proxy.customization)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._custo=
mization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.java.Plugin._customiz=
ation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.distro-rpm.packages.Plugin._=
customization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.misc.Plugin._custom=
ization=20(osetup.dwh.core.enable)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._cus=
tomization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.packages.Plugin._customiz=
ation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.dialog.titles.Plugin._title_e_produ=
ct_options=20(osetup.dialog.titles.productoptions.end)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.distro-rpm.packages.Plug=
in._customization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_packages=20(osetup.dialog.titles.packaging.start)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages.P=
lugin._customization=20(osetup.distro-rpm.package.update.check)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_packages=20(osetup.dialog.titles.packages.end)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_network=20(osetup.dialog.titles.network.start)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.hostname.Plugin._customizat=
ion=20(osetup.config.protocols.customization)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._cus=
tomization_is_requested=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._cus=
tomization=20(osetup.net.firewallmanager.available)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.protocols.Plugin._cus=
tomization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.firewall.Plugin._conf=
iguration=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.config.firewall.Plugi=
n._configuration=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_network_owners_config_customized=20=
(osetup.network.owners.config.customized)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.remote_engine.Plugi=
n._remote_engine_customization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._custom=
ization_network=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._cus=
tomizationNetwork=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._customizat=
ion_network=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_network=20(osetup.dialog.titles.network.end)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_database=20(osetup.dialog.titles.database.start)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection.Plugin._custom=
ization_enable=20(osetup.engine.db.connection.allow)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._customization_enable=20(osetup.engine.provisioning.pgsql.allow)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._customization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._customization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection.Plugin._cu=
stomization=20(osetup.dwh.db.connection.customization)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection.Plugin._custom=
ization=20(osetup.db.connection.customization)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._custom=
ization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_db_owners_connections_customized=20=
(osetup.db.owners.connections.customized)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.engine_connection.Plu=
gin._engine_customization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_database=20(osetup.dialog.titles.database.end)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_engine=20(osetup.dialog.titles.engine.start)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._customiza=
tion=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.appmode.Plugin._custo=
mization_enable=20(osetup.engine.config.appmode.allow)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.appmode.Plugin._custo=
mization=20(osetup.config.applicationMode.available)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.domain_type.Plugin._c=
ustomization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_engine=20(osetup.dialog.titles.engine.end)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_storage=20(osetup.dialog.titles.storage.start)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.storage.Plugin._confi=
gureSANWipeAfterDelete=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_storage=20(osetup.dialog.titles.storage.end)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_pki=20(osetup.dialog.titles.pki.start)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._customization=
=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._customization=
_upgrade=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.pki.Plugin._customiza=
tion=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.pki.Plugin._customization=
=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_pki=20(osetup.dialog.titles.pki.end)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_apache=20(osetup.dialog.titles.apache.start)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.root.Plugin._customiz=
ation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._cu=
stomization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_apache=20(osetup.dialog.titles.apache.end)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_system=20(osetup.dialog.titles.system.start)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.fence_kdump_listener.config.=
Plugin._customization_disable=20(osetup.engine.kdump.allow)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._customiza=
tion_enable=20(osetup.engine.system.nfs.allow)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._custom=
ization_firewall=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._customizat=
ion_firewall=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.fence_kdump_listener.config.=
Plugin._customization_firewall=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._customiza=
tion=20(osetup.system.nfs.available)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.iso_domain.Plugin._cu=
stomization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._firewall=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_system=20(osetup.dialog.titles.system.end)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_misc=20(osetup.dialog.titles.misc.start)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.scale.Plugin._custo=
mization=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_misc=20(osetup.dialog.titles.misc.end)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.config.Plugin._customize2=20(None)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._customization_firewall=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._customization_firewall=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:739=20STAGE=20validation=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.core.misc.Plugin._validation=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._vali=
dation_enable=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks.Plugin._v=
alidateEnv=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._va=
lidate_enable=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.hostname.Plugin._validation=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.network.ssh.Plugin._validation=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.selinux.Plugin._validation=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.engine.Plugin._validat=
ion=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.config.Plugin._validatio=
n=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.pgpass.Plugin._validatio=
n=20(osetup.db.connection.credentials.early)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.config.java.Plugin._=
validation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.he.Plugin._va=
lidate=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.config.Plugin._valid=
ation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._val=
idation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.notifier.Plugin._vali=
dation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._validation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._vali=
dation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.image_upload.Plugin._=
validation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._va=
lidate_ssl=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl.Plugin.=
_validation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.check_etl.Plugin._v=
alidation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.single_etl.Plugin._=
validation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._valida=
tion=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._validation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._validation=20=
(otopi.network.firewalld.validation)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.iptables.Plugin._validate=20=
(otopi.network.iptables.validation)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema.Plugin._validation=
=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.memcheck.Plugin._vali=
dateMemory=20(osetup.memory.check)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks.Plugin._v=
alidateZombies=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._rev=
iew_config=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.memcheck.Plugin._vali=
dateContinueLowMemory=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.dialog.preview.Plugin._customization=
=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._validatio=
n_late=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaakerbldap.Plugin._v=
alidation_late=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks.Plugin._v=
alidateAsyncTasks=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dbvalidations.Plugin=
._validation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaainternal.Plugin._v=
alidation=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20transaction-prepare=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.core.transaction.Plugin._main_prepare=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.engine.Plugin._transac=
tionBegin=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.fence_kdump_listener.P=
lugin._transactionBegin=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.core.service.Plugin._tr=
ansactionBegin=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_imageio_proxy.core.Plugin._transac=
tionBegin=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.websocket_proxy.core.Plugin._transaction=
Begin=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.hostile_services.Plugin._tra=
nsaction_begin=20(osetup.system.hostile.detection)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.single_etl.Plugin._=
transactionBegin=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:739=20STAGE=20early_misc=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._early_misc=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dbvalidations.Plugin=
._misc=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20packages=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.iptables.Plugin._packages=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages.P=
lugin.packages=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.system.Plugin._pac=
kages=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.dnfpackager.Plugin._packages=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._packages=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:739=20=
STAGE=20misc=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.config.jboss.Plugin._=
jboss=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.system.command.Plugin._misc=20=
(otopi.system.command.redetection)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl.Plugin.=
_misc=20(osetup.system.sysctl.available)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._misc=20(None)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.network.iptables.Plugin._store_iptables=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.ssh.Plugin._append_key=20(None)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.system.clock.Plugin._set_clock=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._pre=
pare_examples=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.engine.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.root.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaainternal.Plugin._m=
isc=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.database.Plugin._misc=
=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.dwh_database.Plugin._=
miscDWHConfig=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.java.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.jboss.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.protocols.Plugin._mis=
c=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.tools.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.advertise_dwh.Plugin._g=
et_dwh_host=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._miscUpgrade=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._misc=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.answerfile_fixup.Plu=
gin._misc=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dwh.Plugin._misc_sto=
p_remote_dwh=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.selinux.Plugin=
._misc=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._mi=
sc=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.config.Plugin._misc=
=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.scale.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._misc=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._misc_c=
onfig=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._mis=
cConfigVMConsoleHelper=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._mis=
cConfigVMConsoleProxy=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._misc_confi=
g=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.pgpass.Plugin._misc=20=
(osetup.db.connection.credentials.late)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.pgpass.Plugin._misc=20=
(osetup.dwh.db.connection.credentials)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._misc=20=
(osetup.pki.ca.available)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema.Plugin._misc=20=
(osetup.db.schema)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh.Plugin._misc=20=
(osetup.pki.ssh.available)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._misc=20=
(osetup.dwh.db.schema)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._check_=
separate=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._misc_V=
DC=20(setup.config.imageio-proxy.remote_vdc)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.pki.Plugin._misc_pki=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.pki.Plugin._miscPK=
IEngine=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.pki.Plugin._miscPK=
IProxy=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._check_sepa=
rate=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._misc_VDC=20=
(setup.config.websocket-proxy.remote_vdc)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.pki.Plugin._misc_pki=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection.Plugin._connec=
tion=20(osetup.db.connection.available)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection.Plugin._co=
nnection=20(osetup.dwh.db.connection.available)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._engine_connection=20(osetup.dwh.engine.db.connection.available)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._misc=20=
(osetup.aaa_jdbc.config.setup.admin.user)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.appmode.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.ca.Plugin._misc=20=
(osetup.config.encryption.available)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.domain_type.Plugin._m=
isc=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.iso_domain.Plugin._ad=
d_iso_domain_to_db=20(osetup.config.iso_domain.available)=0A2016-08-18=20=
12:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.options.Plugin._miscA=
lways=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.options.Plugin._miscN=
ewDatabase=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.public_glance_reposit=
ory.Plugin._misc=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.sso.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.storage.Plugin._updat=
eSANWipeAfterDelete=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin.miscOptions=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._databa=
seOptions=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._setup=
AdminPassword=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._misc=
=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.image_upload.Plugin._=
misc=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.single_etl.Plugin._=
misc=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._misc=20=
(osetup.config.aaa.adminuser.setup)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.selinux.Plugin._misc=20=
(osetup.setup.selinux)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.misc.Plugin._m=
isc=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.postinstall.Plugin._misc=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20cleanup=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.transaction.Plugin._main_end=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:739=20=
STAGE=20closeup=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._closeup=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.otopi.network.iptables.Plugin._closeup=20(None)=0A=
2016-08-18=2012:58:23=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.hostile_services.Plugin._clo=
seup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.fence_kdump_listener.config.=
Plugin._closeup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.engine.Plugin._closeu=
p=20(osetup.core.engine.start)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._closeup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.service.Plugin._clo=
seup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.legacy.config.Plugin._cl=
oseup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._closeu=
p=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.system.Plugin._clo=
seup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._closeup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.dialog.titles.Plugin._title_s_summa=
ry=20(osetup.dialog.titles.summary.start)=0A2016-08-18=2012:58:23=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.apache.Plugin=
._closeup=20(osetup.apache.core.restart)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._clo=
seup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._closeup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.dwh_database.Plugin._=
closeupDWHConfig=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.protocols.Plugin._clo=
seup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._closeup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh.Plugin._closeup=20=
(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._closeup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._clos=
eup=20(None)=0A2016-08-18=2012:58:23=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.memcheck.Plugin._clos=
eup=20(None)=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dwh.Plugin._closeup=20=
(None)=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.remote_engine.Plugi=
n._closeupEngineAccess=20(None)=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._closeup=20(None)=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.system.Plugin._dev=
env_closeup=20(None)=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.dialog.titles.Plugin._title_e_summa=
ry=20(osetup.dialog.titles.summary.end)=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.system.reboot.Plugin._closeup=20(None)=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpSequence:739=20STAGE=20=
cleanup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.misc.Plugin._cleanup=20=
(None)=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine.Plugin.=
_cleanup=20(None)=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.remote_engine.Plugi=
n._cleanupEngineAccess=20(None)=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.pki.Plugin._cleanup=20=
(None)=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.pki.Plugin._cleanup=20=
(None)=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.uninstall.Plugin._cleanup=20=
(None)=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.answerfile.Plugin._cleanup=20=
(None)=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._rollba=
ck=20(None)=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20pre-terminate=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.core.misc.Plugin._preTerminate=20(None)=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.dialog.cli.Plugin._pre_terminate=20=
(otopi.dialog.cli.termination)=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpSequence:739=20STAGE=20terminate=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.misc.Plugin._terminate=20=
(None)=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.dialog.human.Plugin._terminate=20(None)=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20=
METHOD=20otopi.plugins.otopi.dialog.machine.Plugin._terminate=20(None)=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20context.dumpSequence:744=20=
=20=20=20=20METHOD=20otopi.plugins.otopi.core.log.Plugin._terminate=20=
(None)=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpSequence:739=20STAGE=20reboot=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpSequence:744=20=20=20=20=20METHOD=20=
otopi.plugins.otopi.system.reboot.Plugin._reboot=20(None)=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpSequence:746=20SEQUENCE=20=
DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/aborted=3Dbool:'False'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/debug=3Dint:'0'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
BASE/error=3Dbool:'False'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
BASE/exceptionInfo=3Dlist:'[]'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
BASE/executionDirectory=3Dstr:'/root'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
BASE/exitCode=3Dlist:'[{'priority':=2090001,=20'code':=200}]'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/log=3Dbool:'True'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
BASE/pluginGroups=3Dstr:'otopi:ovirt-engine-common:ovirt-engine-setup'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
BASE/pluginPath=3Dstr:'/usr/share/otopi/plugins:/usr/share/ovirt-engine/se=
tup/bin/../plugins'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
BASE/suppressEnvironmentKeys=3Dlist:'[]'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/configFileName=3Dstr:'/etc/ovirt-engine-setup.conf'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/failOnPrioOverride=3Dbool:'True'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logDir=3Dstr:'/var/log/ovirt-engine/setup'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFileHandle=3Dfile:'<open=20file=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20mode=20'a'=20at=200x223cf60>'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFileName=3Dstr:'/var/log/ovirt-engine/setup/ovirt-engine-setup-201=
60818125822-b8g6ku.log'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFileNamePrefix=3Dstr:'ovirt-engine-setup'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFilter=3D_MyLoggerFilter:'filter'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password',=20=
'OVESETUP_DWH_DB/password',=20'OVESETUP_DB/password',=20=
'OVESETUP_CONFIG/adminPassword',=20'OVESETUP_PKI/storePassword']'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilterRe=3Dlist:'[<_sre.SRE_Pattern=20object=20at=200x22bd2c0>]'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20CORE/logRemoveAtExit=3Dbool:'False'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20CORE/randomizeEvents=3Dbool:'False'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
DIALOG/autoAcceptDefault=3Dbool:'False'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
DIALOG/boundary=3Dstr:'--=3D451b80dc-996f-432e-9e4f-2b29ef6d1141=3D--'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20DIALOG/dialect=3Dstr:'human'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20INFO/PACKAGE_NAME=3Dstr:'otopi'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20INFO/PACKAGE_VERSION=3Dstr:'1.5.1'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/totalMemoryMB=3DNoneType:'None'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20INFO/PACKAGE_NAME=3Dstr:'otopi'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20INFO/PACKAGE_VERSION=3Dstr:'1.5.1'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
boot=20METHOD=20otopi.plugins.otopi.packagers.dnfpackager.Plugin._boot=0A=
2016-08-18=2012:58:24=20DEBUG=20=
otopi.plugins.otopi.packagers.dnfpackager=20dnfpackager._boot:163=20=
Cannot=20initialize=20minidnf=0ATraceback=20(most=20recent=20call=20=
last):=0A=20=20File=20=
"/usr/share/otopi/plugins/otopi/packagers/dnfpackager.py",=20line=20150,=20=
in=20_boot=0A=20=20=20=20constants.PackEnv.DNF_DISABLED_PLUGINS=0A=20=20=
File=20"/usr/share/otopi/plugins/otopi/packagers/dnfpackager.py",=20line=20=
60,=20in=20_getMiniDNF=0A=20=20=20=20from=20otopi=20import=20minidnf=0A=20=
=20File=20"/usr/lib/python2.7/site-packages/otopi/minidnf.py",=20line=20=
16,=20in=20<module>=0A=20=20=20=20import=20dnf=0AImportError:=20No=20=
module=20named=20dnf=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfDisabledPlugins=3Dlist:'[]'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfExpireCache=3Dbool:'True'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfRollback=3Dbool:'True'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfpackagerEnabled=3Dbool:'True'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/keepAliveInterval=3Dint:'30'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20boot=20METHOD=20=
otopi.plugins.otopi.system.info.Plugin._init=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.plugins.otopi.system.info=20info._init:36=20SYSTEM=20=
INFORMATION=20-=20BEGIN=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.plugins.otopi.system.info=20info._init:37=20executable=20=
/bin/python=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.plugins.otopi.system.info=20info._init:38=20python=20/bin/python=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.plugins.otopi.system.info=20=
info._init:39=20platform=20linux2=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.plugins.otopi.system.info=20info._init:40=20distribution=20=
('CentOS=20Linux',=20'7.2.1511',=20'Core')=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.plugins.otopi.system.info=20info._init:41=20host=20=
'cultivar.grove.silverorange.com'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.plugins.otopi.system.info=20info._init:47=20uid=200=20euid=200=20=
gid=200=20egid=200=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.plugins.otopi.system.info=20info._init:49=20SYSTEM=20INFORMATION=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20boot=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._boot=0ALoaded=20=
plugins:=20fastestmirror,=20versionlock=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20=
BEGIN=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumDisabledPlugins=3Dlist:'[]'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumEnabledPlugins=3Dlist:'[]'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumExpireCache=3Dbool:'True'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumRollback=3Dbool:'True'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumpackagerEnabled=3Dbool:'True'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20INFO=20otopi.context=20=
context.runSequence:687=20Stage:=20Initializing=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.runSequence:691=20STAGE=20init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.otopi.debug.force_fail.force_fail.Plugin._force_fail_do=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20init=20=
METHOD=20otopi.plugins.otopi.core.config.Plugin._init=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:760=20=
ENVIRONMENT=20DUMP=20-=20BEGIN=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configureRootRedirectionDefault=3Dbool:'True'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configured=3Dbool:'True'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUser=3Dstr:'admin@internal'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUserAuthzName=3Dstr:'internal-authz'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUserAuthzType=3Dstr:'ovirt-engine-extension-aaa-jdbc'=
=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUserId=3Dstr:'40cc61cd-b603-4067-b8c2-00c7fd39e241'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUserNamespace=3Dstr:'*'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/firewallManager=3Dstr:'firewalld'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/fqdn=3Dstr:'cultivar.grove.silverorange.com'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/imageioProxyConfig=3Dbool:'True'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainExists=3Dbool:'False'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossHome=3Dstr:'/usr/share/ovirt-engine-wildfly'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/sanWipeAfterDelete=3Dbool:'False'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/websocketProxyConfig=3Dbool:'True'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/generatedByVersion=3Dstr:'4.0.2.6'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CONFIG/remoteEngineConfigured=3Dbool:'False'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CONFIG/scale=3Dstr:'1'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CORE/enable=3Dbool:'True'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_ENGINE_CONFIG/fqdn=3Dstr:'cultivar.grove.silverorange.com'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_ENGINE_CORE/enable=3Dbool:'True'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_PKI/country=3Dstr:'US'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_PKI/organization=3Dstr:'grove.silverorange.com'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/jbossPackages=3Dstr:'ovirt-engine-wildfly,ovirt-engine-=
wildfly-overlay'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/nfsConfigEnabled_legacyInPostInstall=3Dbool:'False'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_VMCONSOLE_PROXY_CONFIG/vmconsoleProxyConfig=3Dbool:'True'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20otopi.plugins.otopi.packagers.dnfpackager.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20init=20=
METHOD=20otopi.plugins.otopi.packagers.yumpackager.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager._init:196=20=
Registering=20yum=20packager=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.otopi.system.command.Plugin._init=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20=
-=20BEGIN=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
SYSTEM/commandPath=3Dstr:'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bi=
n:/sbin:/bin'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.misc.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20=
otopi.plugins.ovirt_engine_common.base.core.misc=20misc._init:96=20=
Package:=20ovirt-engine-4.0.2.6=20(4.0.2.6-1.el7.centos)=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:760=20=
ENVIRONMENT=20DUMP=20-=20BEGIN=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/developerMode=3Dbool:'False'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/originalGeneratedByVersion=3Dstr:'4.0.2.6'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/setupAttributesModules=3Dlist:'[<module=20=
'ovirt_engine_setup.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/constants.pyc'>]'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/upgradeSupportedVersions=3Dstr:'3.6,4.0'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.otopi.packagers.core.Plugin._init=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20init=20=
METHOD=20otopi.plugins.otopi.core.transaction.Plugin._init=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:760=20=
ENVIRONMENT=20DUMP=20-=20BEGIN=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/internalPackageTransaction=3DTransaction:'transaction'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/mainTransaction=3DTransaction:'transaction'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/modifiedFiles=3Dlist:'[]'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.otopi.dialog.cli.Plugin._init=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20=
-=20BEGIN=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20DIALOG/cliVersion=3Dint:'1'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20DIALOG/customization=3Dbool:'False'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20otopi.plugins.otopi.network.firewalld.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
NETWORK/firewalldAvailable=3Dbool:'False'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/firewalldDisableServices=3Dlist:'[]'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/firewalldEnable=3Dbool:'False'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.otopi.network.iptables.Plugin._init=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:760=20=
ENVIRONMENT=20DUMP=20-=20BEGIN=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/iptablesEnable=3Dbool:'False'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.otopi.network.ssh.Plugin._init=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20=
-=20BEGIN=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20NETWORK/sshEnable=3Dbool:'False'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20NETWORK/sshUser=3Dstr:''=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20otopi.plugins.otopi.system.clock.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20SYSTEM/clockMaxGap=3Dint:'5'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20SYSTEM/clockSet=3Dbool:'False'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20otopi.plugins.otopi.system.reboot.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20SYSTEM/reboot=3Dbool:'False'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20SYSTEM/rebootAllow=3Dbool:'True'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20SYSTEM/rebootDeferTime=3Dint:'10'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.answerfile.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.offlinepackager.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/offlinePackager=3Dbool:'False'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.postinstall.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/generatePostInstall=3Dbool:'True'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.reconfigure.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.uninstall.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/registerUninstallGroups=3DRegisterGroups:'<otopi.plugins.ovi=
rt_engine_common.base.core.uninstall.RegisterGroups=20object=20at=20=
0x29bc450>'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/uninstallUnremovableFiles=3Dlist:'[]'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager.Plugin._in=
it=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/firewallManagers=3Dlist:'[]'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager_firewalld.=
Plugin._init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldServices=3Dlist:'[]'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldSubst=3Ddict:'{}'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.hostname.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/fqdnNonLoopback=3Dbool:'False'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/fqdnReverseValidation=3Dbool:'False'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine.Plugin.=
_init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password',=20=
'OVESETUP_DWH_DB/password',=20'OVESETUP_DB/password',=20=
'OVESETUP_CONFIG/adminPassword',=20'OVESETUP_PKI/storePassword',=20=
'OVESETUP_CONFIG/remoteEngineHostRootPassword']'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineSetupStyles=3Dlist:'[]'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.hostile_services.Plugin._ini=
t=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/hostileServices=3Dstr:'ovirt-engine-dwhd,ovirt-engine-noti=
fier'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.selinux.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/selinuxBooleans=3Dlist:'[]'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/selinuxContexts=3Dlist:'[]'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/selinuxRestorePaths=3Dlist:'[]'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.engine.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/engineServiceStopNeeded=3Dbool:'True'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.fence_kdump_listener.P=
lugin._init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/fenceKdumpListenerStopNeeded=3Dbool:'False'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.config.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/engineDbBackupDir=3Dstr:'/var/lib/ovirt-engine/backups'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.connection.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_DB/dumper=3Dstr:'pg_custom'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_DB/newDatabase=3Dbool:'True'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_DB/restoreJobs=3Dint:'2'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.pgpass.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.config.java.Plugin._=
init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/javaNeeded=3Dbool:'False'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.core.protocols.Plugi=
n._init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_CONFIG/httpPort=3Dint:'80'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_CONFIG/httpsPort=3Dint:'443'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossAjpPort=3Dint:'8702'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossDebugAddress=3Dstr:'127.0.0.1:8787'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossHttpPort=3Dint:'8080'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossHttpsPort=3Dint:'8443'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.provisioning.postgre=
s.Plugin._init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresConf=3Dstr:'/var/lib/pgsql/data/postgresql.c=
onf'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresLCMessages=3Dstr:''en_US.UTF-8''=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresListenAddress=3Dstr:''*''=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresMaxConn=3Dint:'150'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresPgHba=3Dstr:'/var/lib/pgsql/data/pg_hba.conf=
'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresPgVersion=3Dstr:'/var/lib/pgsql/data/PG_VERS=
ION'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresService=3Dstr:'postgresql'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.apache.Plugin=
._init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/httpdService=3Dstr:'httpd'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/needRestart=3Dbool:'False'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.environment.P=
lugin._init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_SYSTEM/groupKvm=3Dstr:'kvm'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userApache=3Dstr:'apache'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userPostgres=3Dstr:'postgres'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userRoot=3Dstr:'root'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userVdsm=3Dstr:'vdsm'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.he.Plugin._in=
it=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.config.dwh_uuid.Plugin.=
_init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.core.misc.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.core.service.Plugin._in=
it=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CONFIG/dwhServiceStopNeeded=3Dbool:'False'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.config.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CONFIG/dwhDbBackupDir=3Dstr:'/var/lib/ovirt-engine-dwh/backup=
s'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.connection.Plugin._i=
nit=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/dumper=3Dstr:'pg_custom'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/newDatabase=3Dbool:'True'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/restoreJobs=3Dint:'2'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.pgpass.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_imageio_proxy.core.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/imageioProxyStopNeeded=3Dbool:'False'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_common.websocket_proxy.core.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/websocketProxyStopNeeded=3Dbool:'False'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.core.misc.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_CORE/action=3Dstr:'setup'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.dialog.preview.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._ini=
t=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/validFirewallManagers=3Dstr:''=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.system.environment.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/groupEngine=3Dstr:'ovirt'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userEngine=3Dstr:'ovirt'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.engine.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configFileOvirtEngine=3Dstr:'/etc/httpd/conf.d/z-ovirt-eng=
ine-proxy.conf'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.root.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configFileOvirtRoot=3Dstr:'/etc/httpd/conf.d/ovirt-engine-=
root-redirect.conf'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/aaaJdbcPackage=3Dstr:'ovirt-engine-extension-aaa-jdbc'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.appmode.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.domain_type.Plugin._i=
nit=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/storageIsLocal=3Dbool:'False'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.dwh_database.Plugin._=
init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.iso_domain.Plugin._in=
it=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainDefaultMountPoint=3Dstr:'/var/lib/exports/iso'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.java.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.notifier.Plugin._init=
=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.public_glance_reposit=
ory.Plugin._init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/addOvirtGlanceRepository=3Dbool:'True'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.storage.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.advertise_dwh.Plugin._i=
nit=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DOCS/docsAreLocal=3Dbool:'False'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DOCS/dwhDocUrl=3Dstr:'http://www.ovirt.org/Ovirt_DWH'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DOCS/reportsDocUrl=3Dstr:'http://www.ovirt.org/Ovirt_Reports'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.misc.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.distro-rpm.packages.Plugin._=
init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/additionalPackages=3Dstr:'ovirt-host-deploy,ovirt-engin=
e-cli,ovirt-image-uploader,ovirt-iso-uploader,ovirt-engine-dashboard'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/enginePackages=3Dstr:'ovirt-engine'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/engineSetupPackages=3Dstr:'ovirt-engine-setup'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/upgradeYumGroup=3Dstr:'ovirt-engine-4.0'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/pkiRenewalDocUrl=3Dstr:'http://www.ovirt.org/OVirt_3.5.4_R=
elease_Notes#PKI'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PKI/storePassword=3Dstr:'**FILTERED**'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._init=
=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.image_upload.Plugin._=
init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoPathsToUpload=3Dlist:'[]'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.memcheck.Plugin._init=
=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/memCheckEnabled=3Dbool:'True'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/memCheckMinimumMB=3Dint:'4096'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/memCheckRecommendedMB=3Dint:'16384'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/memCheckThreshold=3Dint:'90'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks.Plugin._i=
nit=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_ASYNC/clearTasks=3Dbool:'True'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_ASYNC/clearTasksWait=3Dint:'20'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dbvalidations.Plugin=
._init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dwh.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.core.Plugin._i=
nit=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_APACHE/enable=3Dbool:'False'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.misc.Plugin._i=
nit=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._in=
it=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configFileSsl=3Dstr:'/etc/httpd/conf.d/ssl.conf'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.config.jboss.Plugin._=
init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossNeeded=3Dbool:'False'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages.P=
lugin._init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/versionLockApply=3Dlist:'[]'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/versionLockFilter=3Dlist:'[]'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/packagesSetup=3Dlist:'[]'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/packagesUpgradeList=3Dlist:'[]'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl.Plugin.=
_init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/shmmax=3Dint:'68719476736'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.remote_engine.Plugi=
n._init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.single_etl.Plugin._=
init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/restoreBackupLate=3Dbool:'True'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.distro-rpm.packages.Plug=
in._init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_RPMDISRO_PACKAGES=3Dstr:'ovirt-engine-dwh'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_RPMDISRO_PACKAGES_SETUP=3Dstr:'ovirt-engine-dwh-setup'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._init=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/imageioProxyHost=3Dstr:'localhost'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/imageioProxyPort=3Dint:'54323'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.pki.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_CONFIG/keySize=3Dint:'2048'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._ini=
t=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_VMCONSOLE_PROXY_CONFIG/vmconsoleProxyPort=3Dint:'2222'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.system.Plugin._ini=
t=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/groupVmConsole=3Dstr:'ovirt-vmconsole'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userVmConsole=3Dstr:'ovirt-vmconsole'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/websocketProxyHost=3Dstr:'localhost'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/websocketProxyPort=3Dint:'6100'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.packages.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_WSP_RPMDISTRO_PACKAGES=3Dstr:'ovirt-engine-websocket-proxy'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_WSP_RPMDISTRO_PACKAGES_SETUP=3Dstr:'ovirt-engine-setup-plugin-web=
socket-proxy'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
init=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.pki.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20init=20METHOD=20=
otopi.plugins.otopi.debug.wait_on_error.wait_on_error.Plugin._init=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:24=20=
INFO=20otopi.context=20context.runSequence:687=20Stage:=20Environment=20=
setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.runSequence:691=20STAGE=20setup=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.otopi.packagers.dnfpackager.Plugin._setup_existence=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20setup=20=
METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._setup_existence=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.otopi.core.config.Plugin._post_init=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20Configuration=20files:=20=
['/etc/ovirt-engine-setup.conf.d/10-packaging-jboss.conf',=20=
'/etc/ovirt-engine-setup.conf.d/10-packaging.conf',=20=
'/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf']=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
setup=20METHOD=20otopi.plugins.otopi.core.log.Plugin._setup=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20Log=20file:=20=
/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.otopi.core.misc.Plugin._setup=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20Version:=20=
otopi-1.5.1=20(otopi-1.5.1-1.el7.centos)=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.otopi.packagers.dnfpackager.Plugin._setup=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:134=20=
condition=20False=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._setup=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.plugins.otopi.packagers.yumpackager=20=
yumpackager.verbose:76=20Yum=20Cleaning=20caches:=20['expire-cache'].=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine_root_ss=
h.Plugin._setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineSetupStyles=3Dlist:'[<otopi.plugins.ovirt_engi=
ne_common.base.remote_engine.remote_engine_root_ssh._RootSshManager=20=
object=20at=200x29bcb10>]'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._setup=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
setup=20METHOD=20otopi.plugins.otopi.network.hostname.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.otopi.services.openrc.Plugin._setup=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
setup=20METHOD=20otopi.plugins.otopi.services.rhel.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.otopi.services.systemd.Plugin._setup=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
setup=20METHOD=20otopi.plugins.otopi.system.clock.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.otopi.system.reboot.Plugin._setup=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20setup=20=
METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager_firewalld.=
Plugin._setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/firewallManagers=3Dlist:'[<otopi.plugins.ovirt_engine_comm=
on.base.network.firewall_manager_firewalld._FirewalldManager=20object=20=
at=200x29bced0>]'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager_human.Plug=
in._setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/firewallManagers=3Dlist:'[<otopi.plugins.ovirt_engine_comm=
on.base.network.firewall_manager_firewalld._FirewalldManager=20object=20=
at=200x29bced0>,=20=
<otopi.plugins.ovirt_engine_common.base.network.firewall_manager_human._Hu=
manManager=20object=20at=200x29bcad0>]'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.firewall_manager_iptables.P=
lugin._setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/firewallManagers=3Dlist:'[<otopi.plugins.ovirt_engine_comm=
on.base.network.firewall_manager_firewalld._FirewalldManager=20object=20=
at=200x29bced0>,=20=
<otopi.plugins.ovirt_engine_common.base.network.firewall_manager_human._Hu=
manManager=20object=20at=200x29bcad0>,=20=
<otopi.plugins.ovirt_engine_common.base.network.firewall_manager_iptables.=
_IpTablesManager=20object=20at=200x29bcfd0>]'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.hostname.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine.Plugin.=
_setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/remoteEngine=3DRemoteEngine:'<ovirt_engine_setup.remote_engi=
ne.RemoteEngine=20object=20at=200x29bcd50>'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine_manual_=
files.Plugin._setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineSetupStyles=3Dlist:'[<otopi.plugins.ovirt_engi=
ne_common.base.remote_engine.remote_engine_root_ssh._RootSshManager=20=
object=20at=200x29bcb10>,=20=
<otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine_manual=
_files._ManualFiles=20object=20at=200x29bca10>]'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.hostile_services.Plugin._set=
up=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.mem.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20=
otopi.plugins.ovirt_engine_common.base.system.mem=20mem._setup:57=20=
Checking=20total=20memory=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20=
BEGIN=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/totalMemoryMB=3Dint:'7823'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.selinux.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.misc.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/setupAttributesModules=3Dlist:'[<module=20=
'ovirt_engine_setup.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine/constants.pyc'>]'=
=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.connection.Plugin._setup=
=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20select=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20',=20args:=20{}=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'?column?':=201}]=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20=
database.tryDatabaseConnect:329=20Connection=20succeeded=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20select=20count(*)=20as=20count=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20from=20pg_catalog.pg_tables=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20where=20schemaname=20=3D=20=
'public';=0A=20=20=20=20=20=20=20=20=20=20=20=20',=20args:=20{}=0A=
2016-08-18=2012:58:24=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'count':=20152L}]=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20=
BEGIN=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_DB/database=3Dstr:'engine'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_DB/host=3Dstr:'localhost'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_DB/newDatabase=3Dbool:'False'=
=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/password=3Dstr:'**FILTERED**'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/port=3Dstr:'5432'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/secured=3Dbool:'False'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/securedHostValidation=3Dbool:'False'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/user=3Dstr:'engine'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.core.misc.Plugin._se=
tup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/setupAttributesModules=3Dlist:'[<module=20=
'ovirt_engine_setup.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine_common.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine_common/constants.=
pyc'>]'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.core.protocols.Plugi=
n._setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/publicHttpPort=3Dint:'80'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/publicHttpsPort=3Dint:'443'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.apache.Plugin=
._setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.config.dwh_uuid.Plugin.=
_setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CORE/uuid=3Dstr:'86e6524b-9cc3-4693-988c-161a1af65356'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.core.misc.Plugin._setup=
=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.core.misc=20=
misc._setup:65=20dwh=20version:=20ovirt-engine-dwh-4.0.2=20(4.0.2)=0A=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/setupAttributesModules=3Dlist:'[<module=20=
'ovirt_engine_setup.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine_common.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine_common/constants.=
pyc'>,=20<module=20'ovirt_engine_setup.dwh.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/dwh/constants.pyc'>]'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_FILE_GROUP/ovirt_dwh_files=3Dlist:'[]'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_LINES_GROUP/ovirt_dwh_files=3Ddict:'{}'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.connection.Plugin._c=
ommands=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.connection.Plugin._s=
etup=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20select=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20',=20args:=20{}=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'?column?':=201}]=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20=
database.tryDatabaseConnect:329=20Connection=20succeeded=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20select=20count(*)=20as=20count=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20from=20pg_catalog.pg_tables=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20where=20schemaname=20=3D=20=
'public';=0A=20=20=20=20=20=20=20=20=20=20=20=20',=20args:=20{}=0A=
2016-08-18=2012:58:24=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'count':=2040L}]=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20=
BEGIN=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/database=3Dstr:'ovirt_engine_history'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/host=3Dstr:'localhost'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/newDatabase=3Dbool:'False'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/password=3Dstr:'**FILTERED**'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/port=3Dstr:'5432'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/secured=3Dbool:'False'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/securedHostValidation=3Dbool:'False'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/user=3Dstr:'ovirt_engine_history'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._setup_dbtransaction=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_imageio_proxy.core.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/setupAttributesModules=3Dlist:'[<module=20=
'ovirt_engine_setup.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine_common.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine_common/constants.=
pyc'>,=20<module=20'ovirt_engine_setup.dwh.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/dwh/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.ovirt_imageio_proxy.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/ovirt_imageio_proxy/cons=
tants.pyc'>]'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.vmconsole_proxy_helper.core.Plugin._setu=
p=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/setupAttributesModules=3Dlist:'[<module=20=
'ovirt_engine_setup.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine_common.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine_common/constants.=
pyc'>,=20<module=20'ovirt_engine_setup.dwh.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/dwh/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.ovirt_imageio_proxy.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/ovirt_imageio_proxy/cons=
tants.pyc'>,=20<module=20=
'ovirt_engine_setup.vmconsole_proxy_helper.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/vmconsole_proxy_helper/c=
onstants.pyc'>]'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
setup=20METHOD=20=
otopi.plugins.ovirt_engine_common.websocket_proxy.core.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/setupAttributesModules=3Dlist:'[<module=20=
'ovirt_engine_setup.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine_common.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine_common/constants.=
pyc'>,=20<module=20'ovirt_engine_setup.dwh.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/dwh/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.ovirt_imageio_proxy.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/ovirt_imageio_proxy/cons=
tants.pyc'>,=20<module=20=
'ovirt_engine_setup.vmconsole_proxy_helper.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/vmconsole_proxy_helper/c=
onstants.pyc'>,=20<module=20=
'ovirt_engine_setup.websocket_proxy.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/websocket_proxy/constant=
s.pyc'>]'=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.root.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.jboss.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/javaNeeded=3Dbool:'True'=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossNeeded=3Dbool:'True'=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.misc.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.fence_kdump_listener.config.=
Plugin._setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/fenceKdumpListenerStopNeeded=3Dbool:'True'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._setu=
p=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/uninstallUnremovableFiles=3Dlist:'['/etc/exports']'=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.image_upload.Plugin._=
setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoPathsToUpload=3Dlist:'['/usr/share/virtio-win/virtio-wi=
n_x86.vfd',=20'/usr/share/virtio-win/virtio-win_amd64.vfd',=20=
'/usr/share/virtio-win/virtio-win.iso',=20=
'/usr/share/ovirt-guest-tools-iso/ovirt-tools-setup.iso',=20=
'/usr/share/rhev-guest-tools-iso/rhev-tools-setup.iso']'=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._setup=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._se=
tup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages.P=
lugin._setup=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
util.getPackageManager:269=20Using=20Yum=20as=20package=20manager=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl.Plugin.=
_setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection.Plugin._se=
tup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.legacy.config.Plugin._se=
tup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20setup=20=
METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._setup_engine_db_credentials=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:134=20condition=20False=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._kee=
p_only_valid_firewall_managers=0A2016-08-18=2012:58:24=20DEBUG=20=
otopi.context=20context._executeMethod:134=20condition=20False=0A=
2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:24=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20setup=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:24=20=
INFO=20otopi.context=20context.runSequence:687=20Stage:=20Environment=20=
packages=20setup=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context.runSequence:691=20STAGE=20internal_packages=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
internal_packages=20METHOD=20=
otopi.plugins.otopi.core.transaction.Plugin._pre_prepare=0A2016-08-18=20=
12:58:24=20DEBUG=20otopi.transaction=20transaction._prepare:61=20=
preparing=20'Yum=20Transaction'=0ALoaded=20plugins:=20fastestmirror,=20=
versionlock=0A2016-08-18=2012:58:24=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20internal_packages=20METHOD=20=
otopi.plugins.otopi.network.hostname.Plugin._internal_packages=0A=
2016-08-18=2012:58:24=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
queue=20package=20iproute=20for=20install=0ALoading=20mirror=20speeds=20=
from=20cached=20hostfile=0A2016-08-18=2012:58:26=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Downloading:=20epel/x86_64/metalink=20(0%)=0A2016-08-18=2012:58:26=20=
DEBUG=20otopi.plugins.otopi.packagers.yumpackager=20=
yumpackager.verbose:76=20Yum=20Downloading:=20epel/x86_64/metalink=2011=20=
k(100%)=0A2016-08-18=2012:58:26=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Downloading:=20ovirt-4.0-epel/x86_64/metalink=20(0%)=0A2016-08-18=20=
12:58:26=20DEBUG=20otopi.plugins.otopi.packagers.yumpackager=20=
yumpackager.verbose:76=20Yum=20Downloading:=20=
ovirt-4.0-epel/x86_64/metalink=2011=20k(100%)=0A=20*=20base:=20=
less.cogeco.net=0A=20*=20epel:=20ca.mirror.babylon.network=0A=20*=20=
extras:=20mirror.its.dal.ca=0A=20*=20ovirt-4.0-epel:=20=
ca.mirror.babylon.network=0A=20*=20updates:=20centos.mirror.gtcomm.net=0A=
2016-08-18=2012:58:27=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Downloading:=20base/7/x86_64=20(0%)=0A2016-08-18=2012:58:27=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Downloading:=20base/7/x86_64=203.6=20k(100%)=0A2016-08-18=2012:58:27=20=
DEBUG=20otopi.plugins.otopi.packagers.yumpackager=20=
yumpackager.verbose:76=20Yum=20Downloading:=20centos-ovirt40-release=20=
(0%)=0A2016-08-18=2012:58:27=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Downloading:=20centos-ovirt40-release=203.4=20k(100%)=0A2016-08-18=20=
12:58:27=20DEBUG=20otopi.plugins.otopi.packagers.yumpackager=20=
yumpackager.verbose:76=20Yum=20Downloading:=20extras/7/x86_64=20(0%)=0A=
2016-08-18=2012:58:27=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Downloading:=20extras/7/x86_64=203.4=20k(100%)=0A2016-08-18=2012:58:27=20=
DEBUG=20otopi.plugins.otopi.packagers.yumpackager=20=
yumpackager.verbose:76=20Yum=20Downloading:=20ovirt-4.0/7=20(0%)=0A=
2016-08-18=2012:58:27=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Downloading:=20ovirt-4.0/7=202.9=20k(100%)=0A2016-08-18=2012:58:28=20=
DEBUG=20otopi.plugins.otopi.packagers.yumpackager=20=
yumpackager.verbose:76=20Yum=20Downloading:=20=
ovirt-4.0-centos-gluster37/x86_64=20(0%)=0A2016-08-18=2012:58:28=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Downloading:=20ovirt-4.0-centos-gluster37/x86_64=202.9=20k(100%)=0A=
2016-08-18=2012:58:28=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Downloading:=20ovirt-4.0-patternfly1-noarch-epel/x86_64=20(0%)=0A=
2016-08-18=2012:58:28=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Downloading:=20ovirt-4.0-patternfly1-noarch-epel/x86_64=203.0=20k(100%)=0A=
2016-08-18=2012:58:29=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Downloading:=20updates/7/x86_64=20(0%)=0A2016-08-18=2012:58:29=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Downloading:=20updates/7/x86_64=203.4=20k(100%)=0A2016-08-18=2012:58:29=20=
DEBUG=20otopi.plugins.otopi.packagers.yumpackager=20=
yumpackager.verbose:76=20Yum=20Downloading:=20virtio-win-stable=20(0%)=0A=
2016-08-18=2012:58:29=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Downloading:=20virtio-win-stable=203.0=20k(100%)=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
internal_packages=20METHOD=20=
otopi.plugins.otopi.packagers.dnfpackager.Plugin._internal_packages_end=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
internal_packages=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._internal_packages_end=0A=
2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Building=20transaction=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Empty=20transaction=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
Transaction=20Summary:=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20internal_packages=20METHOD=20=
otopi.plugins.otopi.core.transaction.Plugin._pre_end=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'Yum=20Transaction'=0ALoaded=20plugins:=20fastestmirror,=20=
versionlock=0A2016-08-18=2012:58:30=20INFO=20otopi.context=20=
context.runSequence:687=20Stage:=20Programs=20detection=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.context=20context.runSequence:691=20STAGE=20=
programs=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20programs=20METHOD=20=
otopi.plugins.otopi.system.command.Plugin._programs=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.context=20context.dumpEnvironment:760=20=
ENVIRONMENT=20DUMP=20-=20BEGIN=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/chkconfig=3Dstr:'/sbin/chkconfig'=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/chronyc=3Dstr:'/bin/chronyc'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/date=3Dstr:'/bin/date'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/dig=3Dstr:'/bin/dig'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/exportfs=3Dstr:'/sbin/exportfs'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/firewall-cmd=3Dstr:'/bin/firewall-cmd'=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/hwclock=3Dstr:'/sbin/hwclock'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/ip=3Dstr:'/sbin/ip'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/openssl=3Dstr:'/bin/openssl'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/pg_dump=3Dstr:'/bin/pg_dump'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/pg_restore=3Dstr:'/bin/pg_restore'=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/psql=3Dstr:'/bin/psql'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/reboot=3Dstr:'/sbin/reboot'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/restorecon=3Dstr:'/sbin/restorecon'=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/rpm=3Dstr:'/bin/rpm'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/selinuxenabled=3Dstr:'/sbin/selinuxenabled'=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/semanage=3Dstr:'/sbin/semanage'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/service=3Dstr:'/sbin/service'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/sysctl=3Dstr:'/sbin/sysctl'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/systemctl=3Dstr:'/bin/systemctl'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20programs=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh.Plugin._setup=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20programs=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._programs=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20programs=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.pki.Plugin._setup=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20programs=20METHOD=20=
otopi.plugins.otopi.services.openrc.Plugin._programs=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
programs=20METHOD=20otopi.plugins.otopi.services.rhel.Plugin._programs=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.plugins.otopi.services.rhel=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20=
'show-environment'),=20executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.plugins.otopi.services.rhel=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20=
'show-environment'),=20rc=3D0=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.services.rhel=20plugin.execute:921=20execute-output:=20=
('/bin/systemctl',=20'show-environment')=20stdout:=0ALANG=3Den_US.UTF-8=0A=
PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin=0A=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.plugins.otopi.services.rhel=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20=
'show-environment')=20stderr:=0A=0A=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20programs=20METHOD=20=
otopi.plugins.otopi.services.systemd.Plugin._programs=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20=
'show-environment'),=20executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20=
'show-environment'),=20rc=3D0=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show-environment')=20stdout:=0A=
LANG=3Den_US.UTF-8=0A=
PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin=0A=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20=
'show-environment')=20stderr:=0A=0A=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd._programs:49=20=
registering=20systemd=20provider=0A2016-08-18=2012:58:30=20INFO=20=
otopi.context=20context.runSequence:687=20Stage:=20Environment=20setup=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20context.runSequence:691=20=
STAGE=20late_setup=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20late_setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._late_setu=
p=0A2016-08-18=2012:58:30=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
systemd.exists:73=20check=20if=20service=20nfs-server=20exists=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'show',=20'-p',=20=
'LoadState',=20'nfs-server.service'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'nfs-server.service'),=20rc=3D0=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'nfs-server.service')=20stdout:=0ALoadState=3Dloaded=0A=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'LoadState',=20'nfs-server.service')=20stderr:=0A=0A=0A=
2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs=20=
plugin.executeRaw:813=20execute:=20('/sbin/exportfs',),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
12:58:30=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs=20=
plugin.executeRaw:863=20execute-result:=20('/sbin/exportfs',),=20rc=3D0=0A=
2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs=20=
plugin.execute:921=20execute-output:=20('/sbin/exportfs',)=20stdout:=0A=0A=
=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs=20=
plugin.execute:926=20execute-output:=20('/sbin/exportfs',)=20stderr:=0A=0A=
=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/nfsConfigEnabled=3Dbool:'False'=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/nfsServiceName=3Dstr:'nfs-server'=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20late_setup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._late_s=
etup_service_state=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.status:90=20check=20=
service=20ovirt-imageio-proxy=20status=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'status',=20'ovirt-imageio-proxy.service'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20'status',=20=
'ovirt-imageio-proxy.service'),=20rc=3D3=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'status',=20=
'ovirt-imageio-proxy.service')=20stdout:=0A=E2=97=8F=20=
ovirt-imageio-proxy.service=20-=20oVirt=20ImageIO=20Proxy=0A=20=20=20=
Loaded:=20loaded=20(/usr/lib/systemd/system/ovirt-imageio-proxy.service;=20=
disabled;=20vendor=20preset:=20disabled)=0A=20=20=20Active:=20failed=20=
(Result:=20start-limit)=20since=20Thu=202016-08-18=2011:02:17=20ADT;=20=
1h=2056min=20ago=0A=20=20Process:=2011050=20=
ExecStart=3D/usr/bin/ovirt-imageio-proxy=20(code=3Dexited,=20=
status=3D1/FAILURE)=0A=20Main=20PID:=2011050=20(code=3Dexited,=20=
status=3D1/FAILURE)=0A=0AAug=2018=2011:02:17=20=
cultivar.grove.silverorange.com=20systemd[1]:=20=
ovirt-imageio-proxy.service:=20main=20process=20exited,=20code=3Dexited,=20=
status=3D1/FAILURE=0AAug=2018=2011:02:17=20=
cultivar.grove.silverorange.com=20systemd[1]:=20Failed=20to=20start=20=
oVirt=20ImageIO=20Proxy.=0AAug=2018=2011:02:17=20=
cultivar.grove.silverorange.com=20systemd[1]:=20Unit=20=
ovirt-imageio-proxy.service=20entered=20failed=20state.=0AAug=2018=20=
11:02:17=20cultivar.grove.silverorange.com=20systemd[1]:=20=
ovirt-imageio-proxy.service=20failed.=0AAug=2018=2011:02:17=20=
cultivar.grove.silverorange.com=20systemd[1]:=20=
ovirt-imageio-proxy.service=20holdoff=20time=20over,=20scheduling=20=
restart.=0AAug=2018=2011:02:17=20cultivar.grove.silverorange.com=20=
systemd[1]:=20start=20request=20repeated=20too=20quickly=20for=20=
ovirt-imageio-proxy.service=0AAug=2018=2011:02:17=20=
cultivar.grove.silverorange.com=20systemd[1]:=20Failed=20to=20start=20=
oVirt=20ImageIO=20Proxy.=0AAug=2018=2011:02:17=20=
cultivar.grove.silverorange.com=20systemd[1]:=20Unit=20=
ovirt-imageio-proxy.service=20entered=20failed=20state.=0AAug=2018=20=
11:02:17=20cultivar.grove.silverorange.com=20systemd[1]:=20=
ovirt-imageio-proxy.service=20failed.=0A=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'status',=20=
'ovirt-imageio-proxy.service')=20stderr:=0A=0A=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20late_setup=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._late_setup=
_service_state=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.status:90=20check=20=
service=20ovirt-websocket-proxy=20status=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'status',=20'ovirt-websocket-proxy.service'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20'status',=20=
'ovirt-websocket-proxy.service'),=20rc=3D3=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'status',=20=
'ovirt-websocket-proxy.service')=20stdout:=0A=E2=97=8F=20=
ovirt-websocket-proxy.service=20-=20oVirt=20Engine=20websockets=20proxy=0A=
=20=20=20Loaded:=20loaded=20=
(/usr/lib/systemd/system/ovirt-websocket-proxy.service;=20enabled;=20=
vendor=20preset:=20disabled)=0A=20=20=20Active:=20inactive=20(dead)=20=
since=20Thu=202016-08-18=2011:00:28=20ADT;=201h=2058min=20ago=0A=20Main=20=
PID:=20467=20(code=3Dexited,=20status=3D0/SUCCESS)=0A=0AAug=2018=20=
10:45:01=20cultivar.grove.silverorange.com=20=
ovirt-websocket-proxy.py[467]:=20ovirt-websocket-proxy[467]=20INFO=20=
msg:871=20=20=20-=20Listen=20on=20*:6100=0AAug=2018=2010:45:01=20=
cultivar.grove.silverorange.com=20ovirt-websocket-proxy.py[467]:=20=
ovirt-websocket-proxy[467]=20INFO=20msg:871=20=20=20-=20Flash=20security=20=
policy=20server=0AAug=2018=2010:45:01=20cultivar.grove.silverorange.com=20=
ovirt-websocket-proxy.py[467]:=20ovirt-websocket-proxy[467]=20INFO=20=
msg:871=20=20=20-=20SSL/TLS=20support=0AAug=2018=2010:45:01=20=
cultivar.grove.silverorange.com=20ovirt-websocket-proxy.py[467]:=20=
ovirt-websocket-proxy[467]=20INFO=20msg:871=20=20=20-=20Deny=20=
non-SSL/TLS=20connections=0AAug=2018=2010:45:01=20=
cultivar.grove.silverorange.com=20ovirt-websocket[467]:=202016-08-18=20=
10:45:01,723=20ovirt-websocket-proxy:=20INFO=20msg:871=20=20=20-=20=
proxying=20from=20*:6100=20to=20targets=20generated=20by=20str=0AAug=20=
18=2010:45:01=20cultivar.grove.silverorange.com=20=
ovirt-websocket-proxy.py[467]:=20ovirt-websocket-proxy[467]=20INFO=20=
msg:871=20=20=20-=20proxying=20from=20*:6100=20to=20targets=20generated=20=
by=20str=0AAug=2018=2011:00:28=20cultivar.grove.silverorange.com=20=
ovirt-websocket[467]:=202016-08-18=2011:00:28,229=20=
ovirt-websocket-proxy:=20INFO=20msg:871=20In=20exit=0AAug=2018=20=
11:00:28=20cultivar.grove.silverorange.com=20systemd[1]:=20Stopping=20=
oVirt=20Engine=20websockets=20proxy...=0AAug=2018=2011:00:28=20=
cultivar.grove.silverorange.com=20ovirt-websocket-proxy.py[467]:=20=
ovirt-websocket-proxy[467]=20INFO=20msg:871=20In=20exit=0AAug=2018=20=
11:00:28=20cultivar.grove.silverorange.com=20systemd[1]:=20Stopped=20=
oVirt=20Engine=20websockets=20proxy.=0A=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'status',=20=
'ovirt-websocket-proxy.service')=20stderr:=0A=0A=0A2016-08-18=2012:58:30=20=
INFO=20otopi.context=20context.runSequence:687=20Stage:=20Environment=20=
customization=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.runSequence:691=20STAGE=20customization=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._customization=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
systemd.exists:73=20check=20if=20service=20firewalld=20exists=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'show',=20'-p',=20=
'LoadState',=20'firewalld.service'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'firewalld.service'),=20rc=3D0=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'firewalld.service')=20stdout:=0ALoadState=3Dloaded=0A=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'LoadState',=20'firewalld.service')=20stderr:=0A=0A=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
firewalld._get_firewalld_cmd_version:105=20firewalld=20version:=200.3.9=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
NETWORK/firewalldAvailable=3Dbool:'True'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.otopi.core.config.Plugin._customize1=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.otopi.dialog.cli.Plugin._customize=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context._executeMethod:134=20condition=20False=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.reconfigure.Plugin._customizat=
ion=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._versi=
on_lock_customization=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/versionLockApply=3Dlist:'['ovirt-engine-extension-aaa-jdb=
c']'=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/versionLockFilter=3Dlist:'['ovirt-engine-extension-aaa-jd=
bc']'=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/packagesUpgradeList=3Dlist:'[{'packages':=20=
['ovirt-engine-extension-aaa-jdbc']}]'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.config.jboss.Plugin._=
version_lock_customization=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20=
BEGIN=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/versionLockApply=3Dlist:'['ovirt-engine-extension-aaa-jdb=
c',=20'ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay']'=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/versionLockFilter=3Dlist:'['ovirt-engine-extension-aaa-jd=
bc',=20'ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay']'=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/packagesUpgradeList=3Dlist:'[{'packages':=20=
['ovirt-engine-extension-aaa-jdbc']},=20{'packages':=20=
['ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay']}]'=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.dialog.titles.Plugin._title_s_produ=
ct_options=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=3D=3D=20=
PRODUCT=20OPTIONS=20=3D=3D--=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.misc.Plugin._customizat=
ion=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_APACHE/enable=3Dbool:'True'=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._custom=
ization=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/imageioProxyStopNeeded=3Dbool:'True'=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20customization=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._customizat=
ion=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/websocketProxyStopNeeded=3Dbool:'True'=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20customization=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._custo=
mization=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.java.Plugin._customiz=
ation=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/engineHeapMax=3Dstr:'1955M'=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/engineHeapMin=3Dstr:'1955M'=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.distro-rpm.packages.Plugin._=
customization=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/versionLockApply=3Dlist:'['ovirt-engine-extension-aaa-jdb=
c',=20'ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay',=20=
'ovirt-engine',=20'ovirt-engine-backend',=20'ovirt-engine-dbscripts',=20=
'ovirt-engine-restapi',=20'ovirt-engine-tools',=20=
'ovirt-engine-tools-backup',=20'ovirt-engine-userportal',=20=
'ovirt-engine-webadmin-portal',=20'ovirt-engine-dashboard']'=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/versionLockFilter=3Dlist:'['ovirt-engine-extension-aaa-jd=
bc',=20'ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay',=20=
'ovirt-engine']'=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/packagesSetup=3Dlist:'['ovirt-engine-setup']'=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/packagesUpgradeList=3Dlist:'[{'packages':=20=
['ovirt-engine-extension-aaa-jdbc']},=20{'packages':=20=
['ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay']},=20=
{'packages':=20['ovirt-engine',=20'ovirt-host-deploy',=20=
'ovirt-engine-cli',=20'ovirt-image-uploader',=20'ovirt-iso-uploader',=20=
'ovirt-engine-dashboard'],=20'group':=20'ovirt-engine-4.0'}]'=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.misc.Plugin._custom=
ization=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CONFIG/dwhServiceStopNeeded=3Dbool:'True'=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20customization=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._cus=
tomization=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.packages.Plugin._customiz=
ation=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/packagesSetup=3Dlist:'['ovirt-engine-setup',=20=
'ovirt-engine-setup-plugin-websocket-proxy']'=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/packagesUpgradeList=3Dlist:'[{'packages':=20=
['ovirt-engine-extension-aaa-jdbc']},=20{'packages':=20=
['ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay']},=20=
{'packages':=20['ovirt-engine',=20'ovirt-host-deploy',=20=
'ovirt-engine-cli',=20'ovirt-image-uploader',=20'ovirt-iso-uploader',=20=
'ovirt-engine-dashboard'],=20'group':=20'ovirt-engine-4.0'},=20=
{'packages':=20['ovirt-engine-websocket-proxy']}]'=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20customization=20=
METHOD=20=
otopi.plugins.ovirt_engine_common.base.dialog.titles.Plugin._title_e_produ=
ct_options=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.distro-rpm.packages.Plug=
in._customization=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/versionLockApply=3Dlist:'['ovirt-engine-extension-aaa-jdb=
c',=20'ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay',=20=
'ovirt-engine',=20'ovirt-engine-backend',=20'ovirt-engine-dbscripts',=20=
'ovirt-engine-restapi',=20'ovirt-engine-tools',=20=
'ovirt-engine-tools-backup',=20'ovirt-engine-userportal',=20=
'ovirt-engine-webadmin-portal',=20'ovirt-engine-dashboard',=20=
'ovirt-engine-dwh']'=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/packagesSetup=3Dlist:'['ovirt-engine-setup',=20=
'ovirt-engine-setup-plugin-websocket-proxy',=20=
'ovirt-engine-dwh-setup']'=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/packagesUpgradeList=3Dlist:'[{'packages':=20=
['ovirt-engine-extension-aaa-jdbc']},=20{'packages':=20=
['ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay']},=20=
{'packages':=20['ovirt-engine',=20'ovirt-host-deploy',=20=
'ovirt-engine-cli',=20'ovirt-image-uploader',=20'ovirt-iso-uploader',=20=
'ovirt-engine-dashboard'],=20'group':=20'ovirt-engine-4.0'},=20=
{'packages':=20['ovirt-engine-websocket-proxy']},=20{'packages':=20=
['ovirt-engine-dwh']}]'=0A2016-08-18=2012:58:30=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:30=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_packages=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=3D=3D=20=
PACKAGES=20=3D=3D--=0A2016-08-18=2012:58:30=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:30=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages.P=
lugin._customization=0A2016-08-18=2012:58:30=20INFO=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages._customization:360=20Checking=20for=20product=20updates...=0A=
2016-08-18=2012:58:31=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages.verbose:196=20Yum=20queue=20package=20=
ovirt-engine-extension-aaa-jdbc=20for=20install/update=0A2016-08-18=20=
12:58:32=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages.verbose:196=20Yum=20queue=20package=20ovirt-engine-wildfly=20=
for=20install/update=0A2016-08-18=2012:58:32=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages.verbose:196=20Yum=20queue=20package=20=
ovirt-engine-wildfly-overlay=20for=20install/update=0A2016-08-18=20=
12:58:32=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages.verbose:196=20Yum=20queue=20package=20ovirt-engine=20for=20=
install/update=0A2016-08-18=2012:58:33=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages.verbose:196=20Yum=20queue=20package=20ovirt-host-deploy=20for=20=
install/update=0A2016-08-18=2012:58:33=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages.verbose:196=20Yum=20queue=20package=20ovirt-engine-cli=20for=20=
install/update=0A2016-08-18=2012:58:33=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages.verbose:196=20Yum=20queue=20package=20ovirt-image-uploader=20=
for=20install/update=0A2016-08-18=2012:58:34=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages.verbose:196=20Yum=20queue=20package=20ovirt-iso-uploader=20for=20=
install/update=0A2016-08-18=2012:58:34=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages.verbose:196=20Yum=20queue=20package=20ovirt-engine-dashboard=20=
for=20install/update=0A2016-08-18=2012:58:34=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages.verbose:196=20Yum=20queue=20package=20=
ovirt-engine-websocket-proxy=20for=20install/update=0A2016-08-18=20=
12:58:35=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages.verbose:196=20Yum=20queue=20package=20ovirt-engine-dwh=20for=20=
install/update=0A2016-08-18=2012:58:35=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages.verbose:196=20Yum=20Building=20transaction=0A2016-08-18=20=
12:58:35=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages.verbose:196=20Yum=20Empty=20transaction=0A2016-08-18=2012:58:35=20=
DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages.verbose:196=20Yum=20Transaction=20Summary:=0A2016-08-18=20=
12:58:35=20INFO=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
packages._customization:368=20No=20product=20updates=20found=0A=
2016-08-18=2012:58:35=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_packages=0A2016-08-18=2012:58:35=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_network=0A2016-08-18=2012:58:35=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:35=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=3D=3D=20=
NETWORK=20CONFIGURATION=20=3D=3D--=0A2016-08-18=2012:58:35=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:35=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.network.hostname.Plugin._customizat=
ion=0A2016-08-18=2012:58:35=20DEBUG=20=
otopi.plugins.ovirt_engine_common.base.network.hostname=20=
hostname.__init__:140=20Hostname=20initialized=20only=20at=20stage=206=20=
so=20the=20dection=20of=20the=20required=20commands=20is=20up=20to=20the=20=
caller=20object=0A2016-08-18=2012:58:35=20DEBUG=20=
otopi.plugins.ovirt_engine_common.base.network.hostname=20=
dialog.queryEnvKey:90=20queryEnvKey=20called=20for=20key=20=
OVESETUP_CONFIG/fqdn=0A2016-08-18=2012:58:35=20DEBUG=20=
otopi.plugins.ovirt_engine_common.base.network.hostname=20=
hostname._validateFQDNresolvability:245=20=
cultivar.grove.silverorange.com=20resolves=20to:=20=
set(['192.168.0.203'])=0A2016-08-18=2012:58:35=20DEBUG=20=
otopi.plugins.ovirt_engine_common.base.network.hostname=20=
plugin.executeRaw:813=20execute:=20['/bin/dig',=20=
'cultivar.grove.silverorange.com'],=20executable=3D'None',=20cwd=3D'None',=
=20env=3DNone=0A2016-08-18=2012:58:35=20DEBUG=20=
otopi.plugins.ovirt_engine_common.base.network.hostname=20=
plugin.executeRaw:863=20execute-result:=20['/bin/dig',=20=
'cultivar.grove.silverorange.com'],=20rc=3D0=0A2016-08-18=2012:58:35=20=
DEBUG=20otopi.plugins.ovirt_engine_common.base.network.hostname=20=
plugin.execute:921=20execute-output:=20['/bin/dig',=20=
'cultivar.grove.silverorange.com']=20stdout:=0A=0A;=20<<>>=20DiG=20=
9.9.4-RedHat-9.9.4-29.el7_2.3=20<<>>=20cultivar.grove.silverorange.com=0A=
;;=20global=20options:=20+cmd=0A;;=20Got=20answer:=0A;;=20->>HEADER<<-=20=
opcode:=20QUERY,=20status:=20NOERROR,=20id:=2012788=0A;;=20flags:=20qr=20=
aa=20rd=20ra;=20QUERY:=201,=20ANSWER:=201,=20AUTHORITY:=202,=20=
ADDITIONAL:=203=0A=0A;;=20OPT=20PSEUDOSECTION:=0A;=20EDNS:=20version:=20=
0,=20flags:;=20udp:=204096=0A;;=20QUESTION=20SECTION:=0A=
;cultivar.grove.silverorange.com.=20IN=09A=0A=0A;;=20ANSWER=20SECTION:=0A=
cultivar.grove.silverorange.com.=2010800=20IN=20A=09192.168.0.203=0A=0A=
;;=20AUTHORITY=20SECTION:=0Agrove.silverorange.com.=093600=09IN=09NS=09=
clementine.grove.silverorange.com.=0Agrove.silverorange.com.=093600=09IN=09=
NS=09rind-alias.grove.silverorange.com.=0A=0A;;=20ADDITIONAL=20SECTION:=0A=
clementine.grove.silverorange.com.=2010800=20IN=20A=09192.168.0.12=0A=
rind-alias.grove.silverorange.com.=2010800=20IN=20A=09192.168.0.1=0A=0A=
;;=20Query=20time:=201=20msec=0A;;=20SERVER:=20=
192.168.0.12#53(192.168.0.12)=0A;;=20WHEN:=20Thu=20Aug=2018=2012:58:35=20=
ADT=202016=0A;;=20MSG=20SIZE=20=20rcvd:=20158=0A=0A=0A2016-08-18=20=
12:58:35=20DEBUG=20=
otopi.plugins.ovirt_engine_common.base.network.hostname=20=
plugin.execute:926=20execute-output:=20['/bin/dig',=20=
'cultivar.grove.silverorange.com']=20stderr:=0A=0A=0A2016-08-18=20=
12:58:35=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._cus=
tomization_is_requested=0A2016-08-18=2012:58:35=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.exists:73=20check=20if=20=
service=20iptables=20exists=0A2016-08-18=2012:58:35=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'iptables.service'),=20executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A=
2016-08-18=2012:58:35=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20'show',=20=
'-p',=20'LoadState',=20'iptables.service'),=20rc=3D0=0A2016-08-18=20=
12:58:35=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:921=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'LoadState',=20'iptables.service')=20stdout:=0A=
LoadState=3Dnot-found=0A=0A2016-08-18=2012:58:35=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'iptables.service')=20stderr:=0A=0A=0A2016-08-18=2012:58:35=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20Setup=20can=20=
automatically=20configure=20the=20firewall=20on=20this=20system.=0A=
2016-08-18=2012:58:35=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20Note:=20automatic=20configuration=20of=20the=20firewall=20=
may=20overwrite=20current=20settings.=0A2016-08-18=2012:58:35=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20human.queryString:145=20query=20=
OVESETUP_UPDATE_FIREWALL=0A2016-08-18=2012:58:35=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20Do=20you=20want=20Setup=20=
to=20configure=20the=20firewall?=20(Yes,=20No)=20[Yes]:=20=0A2016-08-18=20=
12:58:37=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:RECEIVE=20=20=20=20yes=0A2016-08-18=20=
12:58:37=20DEBUG=20otopi.context=20context.dumpEnvironment:760=20=
ENVIRONMENT=20DUMP=20-=20BEGIN=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/updateFirewall=3Dbool:'True'=0A2016-08-18=2012:58:37=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._cus=
tomization=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.status:90=20check=20=
service=20firewalld=20status=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'status',=20'firewalld.service'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
12:58:37=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20'status',=20=
'firewalld.service'),=20rc=3D0=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'status',=20'firewalld.service')=20=
stdout:=0A=E2=97=8F=20firewalld.service=20-=20firewalld=20-=20dynamic=20=
firewall=20daemon=0A=20=20=20Loaded:=20loaded=20=
(/usr/lib/systemd/system/firewalld.service;=20enabled;=20vendor=20=
preset:=20enabled)=0A=20=20=20Active:=20active=20(running)=20since=20Thu=20=
2016-08-18=2010:45:01=20ADT;=202h=2013min=20ago=0A=20Main=20PID:=20479=20=
(firewalld)=0A=20=20=20CGroup:=20/system.slice/firewalld.service=0A=20=20=
=20=20=20=20=20=20=20=20=20=E2=94=94=E2=94=80479=20/usr/bin/python=20-Es=20=
/usr/sbin/firewalld=20--nofork=20--nopid=0A=0AAug=2018=2010:44:58=20=
cultivar.grove.silverorange.com=20systemd[1]:=20Starting=20firewalld=20-=20=
dynamic=20firewall=20daemon...=0AAug=2018=2010:45:01=20=
cultivar.grove.silverorange.com=20systemd[1]:=20Started=20firewalld=20-=20=
dynamic=20firewall=20daemon.=0AAug=2018=2011:00:28=20=
cultivar.grove.silverorange.com=20systemd[1]:=20Started=20firewalld=20-=20=
dynamic=20firewall=20daemon.=0A=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'status',=20'firewalld.service')=20=
stderr:=0A=0A=0A2016-08-18=2012:58:37=20INFO=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager=20=
firewall_manager._customization:219=20firewalld=20will=20be=20configured=20=
as=20firewall=20manager.=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.protocols.Plugin._cus=
tomization=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.firewall.Plugin._conf=
iguration=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldSubst=3Ddict:'{'@JBOSS_HTTP_PORT@':=20None,=20=
'@JBOSS_HTTPS_PORT@':=20None}'=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.config.firewall.Plugi=
n._configuration=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldServices=3Dlist:'[{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-http'},=20{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-https'}]'=0A2016-08-18=2012:58:37=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldSubst=3Ddict:'{'@HTTPS_PORT@':=20443,=20=
'@JBOSS_HTTP_PORT@':=20None,=20'@HTTP_PORT@':=2080,=20=
'@JBOSS_HTTPS_PORT@':=20None}'=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_network_owners_config_customized=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20customization=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.remote_engine.Plugi=
n._remote_engine_customization=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.context=20context._executeMethod:134=20condition=20False=0A=
2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._custom=
ization_network=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config=20=
hostname.__init__:140=20Hostname=20initialized=20only=20at=20stage=206=20=
so=20the=20dection=20of=20the=20required=20commands=20is=20up=20to=20the=20=
caller=20object=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config=20=
dialog.queryEnvKey:90=20queryEnvKey=20called=20for=20key=20=
OVESETUP_ENGINE_CONFIG/fqdn=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config=20=
hostname._validateFQDNresolvability:245=20=
cultivar.grove.silverorange.com=20resolves=20to:=20=
set(['192.168.0.203'])=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._cus=
tomizationNetwork=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config=20=
hostname.__init__:140=20Hostname=20initialized=20only=20at=20stage=206=20=
so=20the=20dection=20of=20the=20required=20commands=20is=20up=20to=20the=20=
caller=20object=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config=20=
dialog.queryEnvKey:90=20queryEnvKey=20called=20for=20key=20=
OVESETUP_ENGINE_CONFIG/fqdn=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config=20=
hostname._validateFQDNresolvability:245=20=
cultivar.grove.silverorange.com=20resolves=20to:=20=
set(['192.168.0.203'])=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldServices=3Dlist:'[{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-http'},=20{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-https'},=20{'directory':=20=
'vmconsole-proxy',=20'name':=20'ovirt-vmconsole-proxy'}]'=0A2016-08-18=20=
12:58:37=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldSubst=3Ddict:'{'@HTTPS_PORT@':=20443,=20=
'@JBOSS_HTTP_PORT@':=20None,=20'@HTTP_PORT@':=2080,=20=
'@VMCONSOLE_PROXY_PORT@':=202222,=20'@JBOSS_HTTPS_PORT@':=20None}'=0A=
2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:37=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._customizat=
ion_network=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config=20=
hostname.__init__:140=20Hostname=20initialized=20only=20at=20stage=206=20=
so=20the=20dection=20of=20the=20required=20commands=20is=20up=20to=20the=20=
caller=20object=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config=20=
dialog.queryEnvKey:90=20queryEnvKey=20called=20for=20key=20=
OVESETUP_ENGINE_CONFIG/fqdn=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config=20=
hostname._validateFQDNresolvability:245=20=
cultivar.grove.silverorange.com=20resolves=20to:=20=
set(['192.168.0.203'])=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_network=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_database=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:37=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=3D=3D=20=
DATABASE=20CONFIGURATION=20=3D=3D--=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:37=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection.Plugin._custom=
ization_enable=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._customization_enable=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:37=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._customization=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:37=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._customization=0A2016-08-18=2012:58:37=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:37=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection.Plugin._cu=
stomization=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection=20=
hostname.__init__:140=20Hostname=20initialized=20only=20at=20stage=206=20=
so=20the=20dection=20of=20the=20required=20commands=20is=20up=20to=20the=20=
caller=20object=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20dialog.queryEnvKey:90=20=
queryEnvKey=20called=20for=20key=20OVESETUP_DWH_DB/host=0A2016-08-18=20=
12:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection=20=
hostname._validateFQDNresolvability:245=20localhost=20resolves=20to:=20=
set(['127.0.0.1'])=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20dialog.queryEnvKey:90=20=
queryEnvKey=20called=20for=20key=20OVESETUP_DWH_DB/port=0A2016-08-18=20=
12:58:37=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
dialog.queryEnvKey:90=20queryEnvKey=20called=20for=20key=20=
OVESETUP_DWH_DB/database=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20dialog.queryEnvKey:90=20=
queryEnvKey=20called=20for=20key=20OVESETUP_DWH_DB/user=0A2016-08-18=20=
12:58:37=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
dialog.queryEnvKey:90=20queryEnvKey=20called=20for=20key=20=
OVESETUP_DWH_DB/password=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20=
database.getCredentials:1159=20dbenv:=20{'OVESETUP_DWH_DB/database':=20=
'ovirt_engine_history',=20'OVESETUP_DWH_DB/host':=20'localhost',=20=
'OVESETUP_DWH_DB/port':=20'5432',=20=
'OVESETUP_DWH_DB/securedHostValidation':=20False,=20=
'OVESETUP_DWH_DB/secured':=20False,=20'OVESETUP_DWH_DB/password':=20=
'**FILTERED**',=20'OVESETUP_DWH_DB/user':=20'ovirt_engine_history'}=0A=
2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20select=20count(*)=20as=20count=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20from=20pg_catalog.pg_tables=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20where=20schemaname=20=3D=20'public';=0A=20=20=20=20=20=
=20=20=20=20=20=20=20',=20args:=20{}=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'count':=2040L}]=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection=20=
plugin.executeRaw:813=20execute:=20('/bin/psql',=20'-V'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
12:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection=20=
plugin.executeRaw:863=20execute-result:=20('/bin/psql',=20'-V'),=20rc=3D0=0A=
2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection=20=
plugin.execute:921=20execute-output:=20('/bin/psql',=20'-V')=20stdout:=0A=
psql=20(PostgreSQL)=209.2.15=0A=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection=20=
plugin.execute:926=20execute-output:=20('/bin/psql',=20'-V')=20stderr:=0A=
=0A=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'show=20server_encoding',=20args:=20=
{}=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'server_encoding':=20'UTF8'}]=0A2016-08-18=2012:58:37=20=
DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'show=20=
max_connections',=20args:=20{}=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'max_connections':=20'150'}]=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'show=20lc_messages',=20args:=20{}=0A=
2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'lc_messages':=20'en_US.UTF-8'}]=0A2016-08-18=2012:58:37=20=
DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'show=20=
server_version',=20args:=20{}=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'server_version':=20'9.2.15'}]=0A2016-08-18=2012:58:37=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection.Plugin._custom=
ization=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection=20=
hostname.__init__:140=20Hostname=20initialized=20only=20at=20stage=206=20=
so=20the=20dection=20of=20the=20required=20commands=20is=20up=20to=20the=20=
caller=20object=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20dialog.queryEnvKey:90=20=
queryEnvKey=20called=20for=20key=20OVESETUP_DB/host=0A2016-08-18=20=
12:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection=20=
hostname._validateFQDNresolvability:245=20localhost=20resolves=20to:=20=
set(['127.0.0.1'])=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20dialog.queryEnvKey:90=20=
queryEnvKey=20called=20for=20key=20OVESETUP_DB/port=0A2016-08-18=20=
12:58:37=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
dialog.queryEnvKey:90=20queryEnvKey=20called=20for=20key=20=
OVESETUP_DB/database=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20dialog.queryEnvKey:90=20=
queryEnvKey=20called=20for=20key=20OVESETUP_DB/user=0A2016-08-18=20=
12:58:37=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
dialog.queryEnvKey:90=20queryEnvKey=20called=20for=20key=20=
OVESETUP_DB/password=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20=
database.getCredentials:1159=20dbenv:=20{'OVESETUP_DB/database':=20=
'engine',=20'OVESETUP_DB/host':=20'localhost',=20'OVESETUP_DB/user':=20=
'engine',=20'OVESETUP_DB/secured':=20False,=20=
'OVESETUP_DB/securedHostValidation':=20False,=20'OVESETUP_DB/password':=20=
'**FILTERED**',=20'OVESETUP_DB/port':=20'5432'}=0A2016-08-18=2012:58:37=20=
DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20select=20count(*)=20as=20count=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20from=20pg_catalog.pg_tables=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20where=20schemaname=20=3D=20=
'public';=0A=20=20=20=20=20=20=20=20=20=20=20=20',=20args:=20{}=0A=
2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'count':=20152L}]=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection=20=
plugin.executeRaw:813=20execute:=20('/bin/psql',=20'-V'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
12:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection=20=
plugin.executeRaw:863=20execute-result:=20('/bin/psql',=20'-V'),=20rc=3D0=0A=
2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection=20=
plugin.execute:921=20execute-output:=20('/bin/psql',=20'-V')=20stdout:=0A=
psql=20(PostgreSQL)=209.2.15=0A=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection=20=
plugin.execute:926=20execute-output:=20('/bin/psql',=20'-V')=20stderr:=0A=
=0A=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'show=20server_encoding',=20args:=20=
{}=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'server_encoding':=20'UTF8'}]=0A2016-08-18=2012:58:37=20=
DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'show=20=
max_connections',=20args:=20{}=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'max_connections':=20'150'}]=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'show=20lc_messages',=20args:=20{}=0A=
2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'lc_messages':=20'en_US.UTF-8'}]=0A2016-08-18=2012:58:37=20=
DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'show=20=
server_version',=20args:=20{}=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'server_version':=20'9.2.15'}]=0A2016-08-18=2012:58:37=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._custom=
ization=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'SELECT=20pg_database_size(%(db)s)=20=
as=20size',=20args:=20{'db':=20'ovirt_engine_history'}=0A2016-08-18=20=
12:58:37=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:177=20Creating=20own=20connection=0A2016-08-18=20=
12:58:37=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:222=20Result:=20[{'size':=20452850808L}]=0A2016-08-18=20=
12:58:37=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
human.queryString:145=20query=20OVESETUP_DWH_PERFORM_BACKUP=0A2016-08-18=20=
12:58:37=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20The=20detected=20DWH=20database=20size=20is=20431=20MB.=0A=
2016-08-18=2012:58:37=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20Setup=20can=20backup=20the=20existing=20database.=20The=20=
time=20and=20space=20required=20for=20the=20database=20backup=20depend=20=
on=20its=20size.=20This=20process=20takes=20time,=20and=20in=20some=20=
cases=20(for=20instance,=20when=20the=20size=20is=20few=20GBs)=20may=20=
take=20several=20hours=20to=20complete.=0A2016-08-18=2012:58:37=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20If=20you=20choose=20to=20=
not=20back=20up=20the=20database,=20and=20Setup=20later=20fails=20for=20=
some=20reason,=20it=20will=20not=20be=20able=20to=20restore=20the=20=
database=20and=20all=20DWH=20data=20will=20be=20lost.=0A2016-08-18=20=
12:58:37=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20Would=20you=20like=20to=20backup=20the=20existing=20database=20=
before=20upgrading=20it?=20(Yes,=20No)=20[Yes]:=20=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:760=20=
ENVIRONMENT=20DUMP=20-=20BEGIN=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/performBackup=3Dbool:'True'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_db_owners_connections_customized=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20customization=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.engine_connection.Plu=
gin._engine_customization=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.engine_connection=20=
hostname.__init__:140=20Hostname=20initialized=20only=20at=20stage=206=20=
so=20the=20dection=20of=20the=20required=20commands=20is=20up=20to=20the=20=
caller=20object=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20dialog.queryEnvKey:90=20=
queryEnvKey=20called=20for=20key=20OVESETUP_DB/host=0A2016-08-18=20=
12:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.engine_connection=20=
hostname._validateFQDNresolvability:245=20localhost=20resolves=20to:=20=
set(['127.0.0.1'])=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20dialog.queryEnvKey:90=20=
queryEnvKey=20called=20for=20key=20OVESETUP_DB/port=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
dialog.queryEnvKey:90=20queryEnvKey=20called=20for=20key=20=
OVESETUP_DB/database=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20dialog.queryEnvKey:90=20=
queryEnvKey=20called=20for=20key=20OVESETUP_DB/user=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
dialog.queryEnvKey:90=20queryEnvKey=20called=20for=20key=20=
OVESETUP_DB/password=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20=
database.getCredentials:1159=20dbenv:=20{'OVESETUP_DB/database':=20=
'engine',=20'OVESETUP_DB/host':=20'localhost',=20'OVESETUP_DB/user':=20=
'engine',=20'OVESETUP_DB/secured':=20False,=20=
'OVESETUP_DB/securedHostValidation':=20False,=20'OVESETUP_DB/password':=20=
'**FILTERED**',=20'OVESETUP_DB/port':=20'5432'}=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20select=20count(*)=20as=20count=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20from=20pg_catalog.pg_tables=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20where=20schemaname=20=3D=20=
'public';=0A=20=20=20=20=20=20=20=20=20=20=20=20',=20args:=20{}=0A=
2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'count':=20152L}]=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.engine_connection=20=
plugin.executeRaw:813=20execute:=20('/bin/psql',=20'-V'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
12:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.engine_connection=20=
plugin.executeRaw:863=20execute-result:=20('/bin/psql',=20'-V'),=20rc=3D0=0A=
2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.engine_connection=20=
plugin.execute:921=20execute-output:=20('/bin/psql',=20'-V')=20stdout:=0A=
psql=20(PostgreSQL)=209.2.15=0A=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.engine_connection=20=
plugin.execute:926=20execute-output:=20('/bin/psql',=20'-V')=20stderr:=0A=
=0A=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'show=20server_encoding',=20args:=20=
{}=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'server_encoding':=20'UTF8'}]=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'show=20=
max_connections',=20args:=20{}=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'max_connections':=20'150'}]=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'show=20lc_messages',=20args:=20{}=0A=
2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'lc_messages':=20'en_US.UTF-8'}]=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'show=20=
server_version',=20args:=20{}=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'server_version':=20'9.2.15'}]=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_database=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_engine=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=3D=3D=20=
OVIRT=20ENGINE=20CONFIGURATION=20=3D=3D--=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._customiza=
tion=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.appmode.Plugin._custo=
mization_enable=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.appmode.Plugin._custo=
mization=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.domain_type.Plugin._c=
ustomization=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_engine=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_storage=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=3D=3D=20=
STORAGE=20CONFIGURATION=20=3D=3D--=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.storage.Plugin._confi=
gureSANWipeAfterDelete=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_storage=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_pki=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=3D=3D=20=
PKI=20CONFIGURATION=20=3D=3D--=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._customization=
=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._customization=
_upgrade=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.executeRaw:813=20execute:=20('/bin/openssl',=20'pkcs12',=20'-in',=20=
'/etc/pki/ovirt-engine/keys/engine.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.executeRaw:863=20execute-result:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/engine.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys'),=20rc=3D0=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.execute:921=20execute-output:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/engine.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys')=20stdout:=0ABag=20Attributes=0A=20=20=20=
=20localKeyID:=2089=20E5=20AB=203D=207E=20A8=2092=20B5=20CC=20D0=2085=20=
C9=2072=2033=20D4=2096=201F=2056=20DA=20FF=20=0A=
subject=3D/C=3DUS/O=3Dgrove.silverorange.com/CN=3Dcultivar.grove.silverora=
nge.com=0A=
issuer=3D/C=3DUS/O=3Dgrove.silverorange.com/CN=3Dcultivar.grove.silveroran=
ge.com.10292=0A-----BEGIN=20CERTIFICATE-----=0A=
MIIEuDCCA6CgAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXjELMAkGA1UEBhMCVVMx=0A=
HzAdBgNVBAoTFmdyb3ZlLnNpbHZlcm9yYW5nZS5jb20xLjAsBgNVBAMTJWN1bHRp=0A=
dmFyLmdyb3ZlLnNpbHZlcm9yYW5nZS5jb20uMTAyOTIwHhcNMTYwMjAyMTk0NTE0=0A=
WhcNMjEwMTA3MTk0NTE0WjBYMQswCQYDVQQGEwJVUzEfMB0GA1UEChMWZ3JvdmUu=0A=
c2lsdmVyb3JhbmdlLmNvbTEoMCYGA1UEAxMfY3VsdGl2YXIuZ3JvdmUuc2lsdmVy=0A=
b3JhbmdlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALHxnjZj=0A=
J1JWfyrGA2TDMIJxmuuZ6jracpCofxj2aWLU7zSFG1Ss4wApX0YP8D9WskkwC/PT=0A=
suPH+lANoqKAsxYAooUPVT22slLLLGVgyjWi9jm5Np8Pzo+4jM2u2N0PRU82fQ5a=0A=
axgRcE/eh2K5ji+eagVKuMajkkTwxjhywok6K6Bwp3ycMs5ouOheuPnNOc4ttQ3K=0A=
0iunaRmJKhCkz1TZXtm5mTkb4Uf6J42eUTMJNkokRUikNBiOJSB4utTB+1upm49p=0A=
/qg/Ew36UNA0URDExLLnuUWONjvQmoYJSkjX+iTQUxlYyLgcrdu30Yuipc7VCoWV=0A=
ZimMRaoFZWMzoKUCAwEAAaOCAYQwggGAMB0GA1UdDgQWBBSs3rKhJytZgKp/WDVw=0A=
SVWpnouFfDCBlgYIKwYBBQUHAQEEgYkwgYYwgYMGCCsGAQUFBzAChndodHRwOi8v=0A=
Y3VsdGl2YXIuZ3JvdmUuc2lsdmVyb3JhbmdlLmNvbTo4MC9vdmlydC1lbmdpbmUv=0A=
c2VydmljZXMvcGtpLXJlc291cmNlP3Jlc291cmNlPWNhLWNlcnRpZmljYXRlJmZv=0A=
cm1hdD1YNTA5LVBFTS1DQTCBiAYDVR0jBIGAMH6AFAoj+gxGoTwVxi8F71fxj0mr=0A=
TtftoWKkYDBeMQswCQYDVQQGEwJVUzEfMB0GA1UEChMWZ3JvdmUuc2lsdmVyb3Jh=0A=
bmdlLmNvbTEuMCwGA1UEAxMlY3VsdGl2YXIuZ3JvdmUuc2lsdmVyb3JhbmdlLmNv=0A=
bS4xMDI5MoICEAAwCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMCBaAwIAYDVR0lAQH/=0A=
BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4IBAQCp13KD=0A=
2dWrxUwI8o/AHUuRgzIJWD2Y+GJuPu97OkTqV6GvSNDst2iMQdIhSMVz7WWgCynP=0A=
ju+bJDz8VWakzSCRZc0Tj8rIYkw1sCUuprf/iZ0pOCBm8CWnGPb2vxgDXgY0xspL=0A=
GmD0k9Fh7BxhQD1VPo9Ef2EnHsnTTRpQO6cuDZnHYje7JKpJIaTEUYUdM1vTo92R=0A=
Tn9kEb0wK5X7ajREy2a3Awl/tAMDrK/3bLNEMJNnKMmrcZaNrtHsKhyV6Eypwx5n=0A=
Rn6f/7ghCQ0vFoZpBgDDic0pQE8M4aXSj9uvISRsGguH/28wrhdgGhppjFxLuyX+=0A=
LIw32vYNj/WCTT5y=0A-----END=20CERTIFICATE-----=0A=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.execute:926=20execute-output:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/engine.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys')=20stderr:=0AMAC=20verified=20OK=0A=0A=
2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.executeRaw:813=20execute:=20('/bin/openssl',=20'pkcs12',=20'-in',=20=
'/etc/pki/ovirt-engine/keys/jboss.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.executeRaw:863=20execute-result:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/jboss.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys'),=20rc=3D0=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.execute:921=20execute-output:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/jboss.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys')=20stdout:=0ABag=20Attributes=0A=20=20=20=
=20localKeyID:=2028=20A4=20BE=2001=20C2=207C=20D0=20E9=2032=2057=204A=20=
20=20F3=20A7=2084=201C=209F=2064=20E5=20E1=20=0A=
subject=3D/C=3DUS/O=3Dgrove.silverorange.com/CN=3Dcultivar.grove.silverora=
nge.com=0A=
issuer=3D/C=3DUS/O=3Dgrove.silverorange.com/CN=3Dcultivar.grove.silveroran=
ge.com.10292=0A-----BEGIN=20CERTIFICATE-----=0A=
MIIEuDCCA6CgAwIBAgICEAIwDQYJKoZIhvcNAQEFBQAwXjELMAkGA1UEBhMCVVMx=0A=
HzAdBgNVBAoTFmdyb3ZlLnNpbHZlcm9yYW5nZS5jb20xLjAsBgNVBAMTJWN1bHRp=0A=
dmFyLmdyb3ZlLnNpbHZlcm9yYW5nZS5jb20uMTAyOTIwHhcNMTYwMjAyMTk0NTE0=0A=
WhcNMjEwMTA3MTk0NTE0WjBYMQswCQYDVQQGEwJVUzEfMB0GA1UEChMWZ3JvdmUu=0A=
c2lsdmVyb3JhbmdlLmNvbTEoMCYGA1UEAxMfY3VsdGl2YXIuZ3JvdmUuc2lsdmVy=0A=
b3JhbmdlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMXOUXV6=0A=
QIdYCZ8j39VD6eM2Ih77ZPlbfMuKNIdCAb4OlKX4u56Lm6/nvmVn+9g6qmKj9LtN=0A=
mfDAnkUKL0e0z1gBfZjtkXcUQk5sK63RQ/Dw0B994z/iRgddwTcTapPpw5g2Hp17=0A=
5Q3mNpo0Ag0dFRWKI3k2nV2r1RcmGNToSO8X/TzEbWs6R1mHvtttg7a7NmJ3JO5U=0A=
fOS5clByTia3VnukboV8fPBOErOAocxY++JEs3236EwnsujOJhXhHn953/b7YiOY=0A=
6MKSZhRloBWR39M9Apoh2eQdUrDLgrsyIAmvdDTLNLiKhR21xzmCPu/0SmfuXSef=0A=
4nuJnuEZbVQisH0CAwEAAaOCAYQwggGAMB0GA1UdDgQWBBS7GoXd9iAlOXKO7+WQ=0A=
Z0Gry0bpIzCBlgYIKwYBBQUHAQEEgYkwgYYwgYMGCCsGAQUFBzAChndodHRwOi8v=0A=
Y3VsdGl2YXIuZ3JvdmUuc2lsdmVyb3JhbmdlLmNvbTo4MC9vdmlydC1lbmdpbmUv=0A=
c2VydmljZXMvcGtpLXJlc291cmNlP3Jlc291cmNlPWNhLWNlcnRpZmljYXRlJmZv=0A=
cm1hdD1YNTA5LVBFTS1DQTCBiAYDVR0jBIGAMH6AFAoj+gxGoTwVxi8F71fxj0mr=0A=
TtftoWKkYDBeMQswCQYDVQQGEwJVUzEfMB0GA1UEChMWZ3JvdmUuc2lsdmVyb3Jh=0A=
bmdlLmNvbTEuMCwGA1UEAxMlY3VsdGl2YXIuZ3JvdmUuc2lsdmVyb3JhbmdlLmNv=0A=
bS4xMDI5MoICEAAwCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMCBaAwIAYDVR0lAQH/=0A=
BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4IBAQCD4uU7=0A=
d17zFLOWncmZv1S0J0+VmSLvoRZuc5lSqol9o22mmNtQPrJ0LvINxR4WJRXlRMjw=0A=
xTnSVENXQdJabM5U79fcr1gs6W0ZXl5d0AXADjsO16yAdNHsCSefatQI5HShRVSZ=0A=
S5Y4JxqQrLJrDFLnspyynYm/cDwEbxW9s1S5yke62AzyQeQR7OVPRwoL/husPiK/=0A=
DAjG5HEFdkwXFyoJv7RmuyB9KtqGB8TtRMwJ6+PoYxxkbnWMgksOixyGpK1r7IPF=0A=
BpVzQp5trgwi9ctn4bsrvGNCqL5vV429xSRzH9c3au7F0JUVHBJ9jp2wUyzEX3yg=0A=
dPuxv1bHt8yZKw3a=0A-----END=20CERTIFICATE-----=0A=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.execute:926=20execute-output:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/jboss.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys')=20stderr:=0AMAC=20verified=20OK=0A=0A=
2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.executeRaw:813=20execute:=20('/bin/openssl',=20'pkcs12',=20'-in',=20=
'/etc/pki/ovirt-engine/keys/websocket-proxy.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.executeRaw:863=20execute-result:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/websocket-proxy.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys'),=20rc=3D0=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.execute:921=20execute-output:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/websocket-proxy.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys')=20stdout:=0ABag=20Attributes=0A=20=20=20=
=20localKeyID:=2094=20FC=204B=204D=2093=20A9=2083=2068=2021=20A2=20F3=20=
E5=20CE=206D=2029=2006=20E8=202D=2095=20B2=20=0A=
subject=3D/C=3DUS/O=3Dgrove.silverorange.com/CN=3Dcultivar.grove.silverora=
nge.com=0A=
issuer=3D/C=3DUS/O=3Dgrove.silverorange.com/CN=3Dcultivar.grove.silveroran=
ge.com.10292=0A-----BEGIN=20CERTIFICATE-----=0A=
MIIEuDCCA6CgAwIBAgICEAMwDQYJKoZIhvcNAQEFBQAwXjELMAkGA1UEBhMCVVMx=0A=
HzAdBgNVBAoTFmdyb3ZlLnNpbHZlcm9yYW5nZS5jb20xLjAsBgNVBAMTJWN1bHRp=0A=
dmFyLmdyb3ZlLnNpbHZlcm9yYW5nZS5jb20uMTAyOTIwHhcNMTYwMjAyMTk0NTE1=0A=
WhcNMjEwMTA3MTk0NTE1WjBYMQswCQYDVQQGEwJVUzEfMB0GA1UEChMWZ3JvdmUu=0A=
c2lsdmVyb3JhbmdlLmNvbTEoMCYGA1UEAxMfY3VsdGl2YXIuZ3JvdmUuc2lsdmVy=0A=
b3JhbmdlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMQrNAEo=0A=
wkJA5xTNlnYbdKcyodFvUV7Ey329dzk8G81mqsh/c1igtXhdHtGJKEw8owU5Gk78=0A=
Wv3ui2l6BgLZ0qsliDZ5gjKm+Lt9O0fqhpaIPsyJDsv/0YwvG8jMzFWzb5XjVDL9=0A=
J6eUTYRykEW2XGbbPF0pESCKMLsfcAZ7dIaoHZBJwotToEEd3ChtKMupZpFrwBhf=0A=
43h1wcfC3Pqp+a4FcN4bnsMgZaRcv9+25rXRVFmIXh5oIBLWH0qfZSyr1Cncspi/=0A=
Txj5I2iEo4YJe/FOY2MGO2qhYbosaHbHYd0Mnv9FZeH40VR69rnS0bjhVkDkkk0M=0A=
aIf6fLB7HjFN3JkCAwEAAaOCAYQwggGAMB0GA1UdDgQWBBTyW/f64RvT3dV1ycjt=0A=
7u1tmY0MhjCBlgYIKwYBBQUHAQEEgYkwgYYwgYMGCCsGAQUFBzAChndodHRwOi8v=0A=
Y3VsdGl2YXIuZ3JvdmUuc2lsdmVyb3JhbmdlLmNvbTo4MC9vdmlydC1lbmdpbmUv=0A=
c2VydmljZXMvcGtpLXJlc291cmNlP3Jlc291cmNlPWNhLWNlcnRpZmljYXRlJmZv=0A=
cm1hdD1YNTA5LVBFTS1DQTCBiAYDVR0jBIGAMH6AFAoj+gxGoTwVxi8F71fxj0mr=0A=
TtftoWKkYDBeMQswCQYDVQQGEwJVUzEfMB0GA1UEChMWZ3JvdmUuc2lsdmVyb3Jh=0A=
bmdlLmNvbTEuMCwGA1UEAxMlY3VsdGl2YXIuZ3JvdmUuc2lsdmVyb3JhbmdlLmNv=0A=
bS4xMDI5MoICEAAwCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMCBaAwIAYDVR0lAQH/=0A=
BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4IBAQAcUKsS=0A=
9N9A4+kG57jRf7LC/Vzv2xSt4lG6bGDI2+h7lqWDzf3QrTv7Bj6TNtnhZnb6O75U=0A=
Fs6AzrWSZZP1KAMFas/JyVhKoMkTFd3oLVkqmsLkBXpLrS83Wv/MbishtlX7pZMx=0A=
FLaxYMIyESPg/MyGc2YNq/JIf0JwewHpGiOEdnnUiCikL2ckAWKa6A2bzSKbPypM=0A=
nAtkmO8pphngg9XovtT/nQawTzil4uatHhCenYEKoaGd5fHhUehm+4wC/ZLLqxSr=0A=
gfDXvnalbqLDERcs3gImyAY2UV73vUjMF3M7iLpasJHxsK4HS9xXsVqTkQzujgK8=0A=
/DqEybYMTtkxO6yc=0A-----END=20CERTIFICATE-----=0A=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.execute:926=20execute-output:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/websocket-proxy.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys')=20stderr:=0AMAC=20verified=20OK=0A=0A=
2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.executeRaw:813=20execute:=20('/bin/openssl',=20'pkcs12',=20'-in',=20=
'/etc/pki/ovirt-engine/keys/apache.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.executeRaw:863=20execute-result:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/apache.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys'),=20rc=3D0=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.execute:921=20execute-output:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/apache.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys')=20stdout:=0ABag=20Attributes=0A=20=20=20=
=20localKeyID:=2046=2072=20B8=20C4=2068=20A5=209B=209E=20F4=2068=20AE=20=
83=2070=2034=2033=20CF=2076=204D=20DF=208F=20=0A=
subject=3D/C=3DUS/O=3Dgrove.silverorange.com/CN=3Dcultivar.grove.silverora=
nge.com=0A=
issuer=3D/C=3DUS/O=3Dgrove.silverorange.com/CN=3Dcultivar.grove.silveroran=
ge.com.10292=0A-----BEGIN=20CERTIFICATE-----=0A=
MIIEuDCCA6CgAwIBAgICEAQwDQYJKoZIhvcNAQEFBQAwXjELMAkGA1UEBhMCVVMx=0A=
HzAdBgNVBAoTFmdyb3ZlLnNpbHZlcm9yYW5nZS5jb20xLjAsBgNVBAMTJWN1bHRp=0A=
dmFyLmdyb3ZlLnNpbHZlcm9yYW5nZS5jb20uMTAyOTIwHhcNMTYwMjAyMTk0NTE1=0A=
WhcNMjEwMTA3MTk0NTE1WjBYMQswCQYDVQQGEwJVUzEfMB0GA1UEChMWZ3JvdmUu=0A=
c2lsdmVyb3JhbmdlLmNvbTEoMCYGA1UEAxMfY3VsdGl2YXIuZ3JvdmUuc2lsdmVy=0A=
b3JhbmdlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJZ/P8GR=0A=
5Qdpx0hYF6/pkPW1+WTq3gew6xCIMHaidV51o7RnBuaDgv4zYlFm7jzWGXA1y9Ho=0A=
g3u5neiqk+lbT6wv47+/v5RcFjKQd7gWG9NIufFx/6lSRCvzJoZPHlNdCJXJ8ZgM=0A=
AJTwPDMlgJmDeqj8Def9NFFWt35q7kMRvwPfH19x5QllC3nb/FKhc2spOxYod6xd=0A=
0B3FTzVUaEAgzixUzHcMl6/Y+O1mDrjrRhevp1muSt0stPVJOYcv9kkahOKxeG3W=0A=
Goig6+ThEDAbB/Qd5nNYh+32uU6pblqeituLDMcCeN1MEFw2Irnp3H/cBhhQKqBO=0A=
J6h2AboiurIqwMECAwEAAaOCAYQwggGAMB0GA1UdDgQWBBSf68kAno9mdkRWvyrw=0A=
SX1cu5V2XTCBlgYIKwYBBQUHAQEEgYkwgYYwgYMGCCsGAQUFBzAChndodHRwOi8v=0A=
Y3VsdGl2YXIuZ3JvdmUuc2lsdmVyb3JhbmdlLmNvbTo4MC9vdmlydC1lbmdpbmUv=0A=
c2VydmljZXMvcGtpLXJlc291cmNlP3Jlc291cmNlPWNhLWNlcnRpZmljYXRlJmZv=0A=
cm1hdD1YNTA5LVBFTS1DQTCBiAYDVR0jBIGAMH6AFAoj+gxGoTwVxi8F71fxj0mr=0A=
TtftoWKkYDBeMQswCQYDVQQGEwJVUzEfMB0GA1UEChMWZ3JvdmUuc2lsdmVyb3Jh=0A=
bmdlLmNvbTEuMCwGA1UEAxMlY3VsdGl2YXIuZ3JvdmUuc2lsdmVyb3JhbmdlLmNv=0A=
bS4xMDI5MoICEAAwCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMCBaAwIAYDVR0lAQH/=0A=
BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4IBAQBSimAb=0A=
RaPsOkiMzNyesY1JElRkBtyneuFUqiElSfc9tn7O60ItT57zDNa+Th2HYIl9jCRX=0A=
ik7Ec8OEz6XHW6pzjInORFyrr7owr9RcK1G8pWR/DQBjkYAsArl8nZE3D+1BTAJD=0A=
ah7K4rstljCJr6XkdSUgbrQ3uWg7kzBhPb3gOg5LgwWHZkvGBLIhEd1Fk+r1SPEO=0A=
2jIhAujqQ29Ii8NGQ6O9klmH2o+KG25oNVm9eeSG+dLCvk4sABxNhnoGlgkBO/lN=0A=
m7p2O8qb2zaXhu4ZgDmJidw41TlRTDSO6yCIoEcpi3IMDbBtMUbDDjyISt/CZWoo=0A=
P1jgHfpK7XpNFl5h=0A-----END=20CERTIFICATE-----=0A=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.execute:926=20execute-output:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/apache.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys')=20stderr:=0AMAC=20verified=20OK=0A=0A=
2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.executeRaw:813=20execute:=20('/bin/openssl',=20'pkcs12',=20'-in',=20=
'/etc/pki/ovirt-engine/keys/reports.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.executeRaw:863=20execute-result:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/reports.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys'),=20rc=3D0=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.execute:921=20execute-output:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/reports.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys')=20stdout:=0ABag=20Attributes=0A=20=20=20=
=20localKeyID:=2079=2021=202D=20C0=20B8=207F=20C8=2028=2003=20B0=2064=20=
21=2035=2069=2051=20BA=20F8=2067=2007=2037=20=0A=
subject=3D/C=3DUS/O=3Dgrove.silverorange.com/CN=3Dcultivar.grove.silverora=
nge.com=0A=
issuer=3D/C=3DUS/O=3Dgrove.silverorange.com/CN=3Dcultivar.grove.silveroran=
ge.com.10292=0A-----BEGIN=20CERTIFICATE-----=0A=
MIIEuDCCA6CgAwIBAgICEAUwDQYJKoZIhvcNAQEFBQAwXjELMAkGA1UEBhMCVVMx=0A=
HzAdBgNVBAoTFmdyb3ZlLnNpbHZlcm9yYW5nZS5jb20xLjAsBgNVBAMTJWN1bHRp=0A=
dmFyLmdyb3ZlLnNpbHZlcm9yYW5nZS5jb20uMTAyOTIwHhcNMTYwMjAyMTk0NTE1=0A=
WhcNMjEwMTA3MTk0NTE1WjBYMQswCQYDVQQGEwJVUzEfMB0GA1UEChMWZ3JvdmUu=0A=
c2lsdmVyb3JhbmdlLmNvbTEoMCYGA1UEAxMfY3VsdGl2YXIuZ3JvdmUuc2lsdmVy=0A=
b3JhbmdlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALYpcH/T=0A=
ASCkv0A+Qaj/NCjXRgmzZfCI9pxIvQPVYrd9R56V2dIofgFPqcq83khjxNTi6xOA=0A=
1o8kMF0UGeCz5AFKHUX0WmiKk1Lns/BHmcP9lzbvIRMtEmOThbU9H5Z15tRVq6mR=0A=
hRKZSJUFbdppGhzk+Jkl1Zwc+r30thHOwfoA6IlEes1ADvmPa5X4EnX4NFxyqk39=0A=
QLI/7mbt+qY67vXxFtc5KCsAVWoAqrnG5fAveGRtJ1rt0cZweU2dIr4DMETH0L9p=0A=
md7luqR/P4/AGuwRuxschhR+KPGU0xE/jY7oB9IoD4zPum6pXq6CZtZGbkVNk0/F=0A=
/wbRSiddizqIJgsCAwEAAaOCAYQwggGAMB0GA1UdDgQWBBR0baOvGUpDsY0P8t1U=0A=
BxHH2Otg3jCBlgYIKwYBBQUHAQEEgYkwgYYwgYMGCCsGAQUFBzAChndodHRwOi8v=0A=
Y3VsdGl2YXIuZ3JvdmUuc2lsdmVyb3JhbmdlLmNvbTo4MC9vdmlydC1lbmdpbmUv=0A=
c2VydmljZXMvcGtpLXJlc291cmNlP3Jlc291cmNlPWNhLWNlcnRpZmljYXRlJmZv=0A=
cm1hdD1YNTA5LVBFTS1DQTCBiAYDVR0jBIGAMH6AFAoj+gxGoTwVxi8F71fxj0mr=0A=
TtftoWKkYDBeMQswCQYDVQQGEwJVUzEfMB0GA1UEChMWZ3JvdmUuc2lsdmVyb3Jh=0A=
bmdlLmNvbTEuMCwGA1UEAxMlY3VsdGl2YXIuZ3JvdmUuc2lsdmVyb3JhbmdlLmNv=0A=
bS4xMDI5MoICEAAwCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMCBaAwIAYDVR0lAQH/=0A=
BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4IBAQAdWkQ8=0A=
VpzO9hRMLCvQp8JP40jX3pqCJXuMFPadAVXPLoKwb6O+Rxx3YjCP7xuchZwgW2tB=0A=
zJrmgATBGRj9/nR67FkbdduHVZyID8bPuoK5HRjF7lAL5jtTHf4ldl0KcxS6JVr2=0A=
fhmuMBfi7N0VKutEqiF39lNxGIh/jByXluZyGxkgtUAUrTSk3XsN1Ajejo54QP0Z=0A=
FFb+UleTA+gGiUZ9LguI0EcSr/TZ3njhG0/tAFo4OgGmj5JqdxmDzjzm18k8O5om=0A=
mZUc83G2BTTT+CSbcwWQ5NXrR1a0CbJbbpu/n0f1sNXk5RcQe1UsAwwtnM1xd6Nc=0A=
tOB7lV9lW1bJSrQ3=0A-----END=20CERTIFICATE-----=0A=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
plugin.execute:926=20execute-output:=20('/bin/openssl',=20'pkcs12',=20=
'-in',=20'/etc/pki/ovirt-engine/keys/reports.p12',=20'-passin',=20=
'pass:**FILTERED**',=20'-nokeys')=20stderr:=0AMAC=20verified=20OK=0A=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.pki.Plugin._customiza=
tion=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.pki.Plugin._customization=
=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_pki=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_apache=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=3D=3D=20=
APACHE=20CONFIGURATION=20=3D=3D--=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.root.Plugin._customiz=
ation=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._cu=
stomization=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_apache=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_system=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=3D=3D=20=
SYSTEM=20CONFIGURATION=20=3D=3D--=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.fence_kdump_listener.config.=
Plugin._customization_disable=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20customization=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._customiza=
tion_enable=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._custom=
ization_firewall=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldServices=3Dlist:'[{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-http'},=20{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-https'},=20{'directory':=20=
'vmconsole-proxy',=20'name':=20'ovirt-vmconsole-proxy'},=20{'directory':=20=
'ovirt-imageio-proxy',=20'name':=20'ovirt-imageio-proxy'}]'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldSubst=3Ddict:'{'@HTTPS_PORT@':=20443,=20=
'@VMCONSOLE_PROXY_PORT@':=202222,=20'@HTTP_PORT@':=2080,=20=
'@IMAGEIO_PROXY_PORT@':=2054323,=20'@JBOSS_HTTPS_PORT@':=20None,=20=
'@JBOSS_HTTP_PORT@':=20None}'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._customizat=
ion_firewall=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldServices=3Dlist:'[{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-http'},=20{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-https'},=20{'directory':=20=
'vmconsole-proxy',=20'name':=20'ovirt-vmconsole-proxy'},=20{'directory':=20=
'ovirt-imageio-proxy',=20'name':=20'ovirt-imageio-proxy'},=20=
{'directory':=20'websocket-proxy',=20'name':=20=
'ovirt-websocket-proxy'}]'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldSubst=3Ddict:'{'@WEBSOCKET_PROXY_PORT@':=20=
6100,=20'@HTTPS_PORT@':=20443,=20'@VMCONSOLE_PROXY_PORT@':=202222,=20=
'@HTTP_PORT@':=2080,=20'@IMAGEIO_PROXY_PORT@':=2054323,=20=
'@JBOSS_HTTPS_PORT@':=20None,=20'@JBOSS_HTTP_PORT@':=20None}'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.fence_kdump_listener.config.=
Plugin._customization_firewall=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20=
BEGIN=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldServices=3Dlist:'[{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-http'},=20{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-https'},=20{'directory':=20=
'vmconsole-proxy',=20'name':=20'ovirt-vmconsole-proxy'},=20{'directory':=20=
'ovirt-imageio-proxy',=20'name':=20'ovirt-imageio-proxy'},=20=
{'directory':=20'websocket-proxy',=20'name':=20'ovirt-websocket-proxy'},=20=
{'directory':=20'ovirt-engine',=20'name':=20=
'ovirt-fence-kdump-listener'}]'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._customiza=
tion=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.iso_domain.Plugin._cu=
stomization=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._firewall=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_system=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_s_misc=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=3D=3D=20=
MISC=20CONFIGURATION=20=3D=3D--=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.scale.Plugin._custo=
mization=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.scale=20=
dialog.queryEnvKey:90=20queryEnvKey=20called=20for=20key=20=
OVESETUP_DWH_CONFIG/scale=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20customization=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.dialog.titles.Plugin.=
_title_e_misc=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=3D=3D=20=
END=20OF=20CONFIGURATION=20=3D=3D--=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.otopi.core.config.Plugin._customize2=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._customization_firewall=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldServices=3Dlist:'[{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-http'},=20{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-https'},=20{'directory':=20=
'vmconsole-proxy',=20'name':=20'ovirt-vmconsole-proxy'},=20{'directory':=20=
'ovirt-imageio-proxy',=20'name':=20'ovirt-imageio-proxy'},=20=
{'directory':=20'websocket-proxy',=20'name':=20'ovirt-websocket-proxy'},=20=
{'directory':=20'ovirt-engine',=20'name':=20=
'ovirt-fence-kdump-listener'},=20{'directory':=20'ovirt-common',=20=
'name':=20'ovirt-postgres'}]'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20customization=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._customization_firewall=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20=
BEGIN=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldServices=3Dlist:'[{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-http'},=20{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-https'},=20{'directory':=20=
'vmconsole-proxy',=20'name':=20'ovirt-vmconsole-proxy'},=20{'directory':=20=
'ovirt-imageio-proxy',=20'name':=20'ovirt-imageio-proxy'},=20=
{'directory':=20'websocket-proxy',=20'name':=20'ovirt-websocket-proxy'},=20=
{'directory':=20'ovirt-engine',=20'name':=20=
'ovirt-fence-kdump-listener'},=20{'directory':=20'ovirt-common',=20=
'name':=20'ovirt-postgres'},=20{'directory':=20'ovirt-common',=20'name':=20=
'ovirt-postgres'}]'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:39=20INFO=20otopi.context=20context.runSequence:687=20Stage:=20=
Setup=20validation=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.runSequence:691=20STAGE=20validation=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20validation=20=
METHOD=20otopi.plugins.otopi.core.misc.Plugin._validation=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:760=20=
ENVIRONMENT=20DUMP=20-=20BEGIN=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
BASE/aborted=3Dbool:'False'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20BASE/debug=3Dint:'0'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/error=3Dbool:'False'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/exceptionInfo=3Dlist:'[]'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/executionDirectory=3Dstr:'/root'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/exitCode=3Dlist:'[{'priority':=20=
90001,=20'code':=200}]'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/log=3Dbool:'True'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
BASE/pluginGroups=3Dstr:'otopi:ovirt-engine-common:ovirt-engine-setup'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
BASE/pluginPath=3Dstr:'/usr/share/otopi/plugins:/usr/share/ovirt-engine/se=
tup/bin/../plugins'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
BASE/suppressEnvironmentKeys=3Dlist:'[]'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/chkconfig=3Dstr:'/sbin/chkconfig'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/chronyc=3Dstr:'/bin/chronyc'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/date=3Dstr:'/bin/date'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/dig=3Dstr:'/bin/dig'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/exportfs=3Dstr:'/sbin/exportfs'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/firewall-cmd=3Dstr:'/bin/firewall-cmd'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/hwclock=3Dstr:'/sbin/hwclock'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/initctl=3DNoneType:'None'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/ip=3Dstr:'/sbin/ip'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/ntpq=3DNoneType:'None'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/openssl=3Dstr:'/bin/openssl'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/pg_dump=3Dstr:'/bin/pg_dump'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/pg_restore=3Dstr:'/bin/pg_restore'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/psql=3Dstr:'/bin/psql'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/rc=3DNoneType:'None'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/rc-update=3DNoneType:'None'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/reboot=3Dstr:'/sbin/reboot'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/restorecon=3Dstr:'/sbin/restorecon'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/rpm=3Dstr:'/bin/rpm'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/selinuxenabled=3Dstr:'/sbin/selinuxenabled'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/semanage=3Dstr:'/sbin/semanage'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/service=3Dstr:'/sbin/service'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/ssh-keygen=3DNoneType:'None'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/sysctl=3Dstr:'/sbin/sysctl'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/systemctl=3Dstr:'/bin/systemctl'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/configFileAppend=3DNoneType:'None'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/configFileName=3Dstr:'/etc/ovirt-engine-setup.conf'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/failOnPrioOverride=3Dbool:'True'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/internalPackageTransaction=3DTransaction:'transaction'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logDir=3Dstr:'/var/log/ovirt-engine/setup'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFileHandle=3Dfile:'<open=20file=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20mode=20'a'=20at=200x223cf60>'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFileName=3Dstr:'/var/log/ovirt-engine/setup/ovirt-engine-setup-201=
60818125822-b8g6ku.log'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFileNamePrefix=3Dstr:'ovirt-engine-setup'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFilter=3D_MyLoggerFilter:'filter'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password',=20=
'OVESETUP_DWH_DB/password',=20'OVESETUP_DB/password',=20=
'OVESETUP_CONFIG/adminPassword',=20'OVESETUP_PKI/storePassword',=20=
'OVESETUP_CONFIG/remoteEngineHostRootPassword']'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFilterRe=3Dlist:'[<_sre.SRE_Pattern=20object=20at=200x22bd2c0>]'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20CORE/logRemoveAtExit=3Dbool:'False'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/mainTransaction=3DTransaction:'transaction'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/modifiedFiles=3Dlist:'[]'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/randomizeEvents=3Dbool:'False'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
DIALOG/autoAcceptDefault=3Dbool:'False'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
DIALOG/boundary=3Dstr:'--=3D451b80dc-996f-432e-9e4f-2b29ef6d1141=3D--'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20DIALOG/cliVersion=3Dint:'1'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20DIALOG/customization=3Dbool:'False'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20DIALOG/dialect=3Dstr:'human'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20INFO/PACKAGE_NAME=3Dstr:'otopi'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20INFO/PACKAGE_VERSION=3Dstr:'1.5.1'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
NETWORK/firewalldAvailable=3Dbool:'True'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/firewalldDisableServices=3Dlist:'[]'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/firewalldEnable=3Dbool:'False'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/iptablesEnable=3Dbool:'False'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/iptablesRules=3DNoneType:'None'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/sshEnable=3Dbool:'False'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/sshKey=3DNoneType:'None'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/sshUser=3Dstr:''=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/enableUpgrade=3DNoneType:'None'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/requireRollback=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/versionLockApply=3Dlist:'['ovirt-engine-extension-aaa-jdb=
c',=20'ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay',=20=
'ovirt-engine',=20'ovirt-engine-backend',=20'ovirt-engine-dbscripts',=20=
'ovirt-engine-restapi',=20'ovirt-engine-tools',=20=
'ovirt-engine-tools-backup',=20'ovirt-engine-userportal',=20=
'ovirt-engine-webadmin-portal',=20'ovirt-engine-dashboard',=20=
'ovirt-engine-dwh']'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/versionLockFilter=3Dlist:'['ovirt-engine-extension-aaa-jd=
bc',=20'ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay',=20=
'ovirt-engine']'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configFileOvirtEngine=3Dstr:'/etc/httpd/conf.d/z-ovirt-eng=
ine-proxy.conf'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configFileOvirtRoot=3Dstr:'/etc/httpd/conf.d/ovirt-engine-=
root-redirect.conf'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configFileSsl=3Dstr:'/etc/httpd/conf.d/ssl.conf'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configureRootRedirection=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configureRootRedirectionDefault=3Dbool:'True'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configureSsl=3DNoneType:'None'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configured=3Dbool:'True'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/enable=3Dbool:'True'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/httpdService=3Dstr:'httpd'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/needRestart=3Dbool:'False'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_ASYNC/clearTasks=3Dbool:'True'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_ASYNC/clearTasksWait=3Dint:'20'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/addOvirtGlanceRepository=3Dbool:'True'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminPassword=3DNoneType:'None'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUser=3Dstr:'admin@internal'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUserAuthzName=3Dstr:'internal-authz'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUserAuthzType=3Dstr:'ovirt-engine-extension-aaa-jdbc'=
=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUserId=3Dstr:'40cc61cd-b603-4067-b8c2-00c7fd39e241'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUserNamespace=3Dstr:'*'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/applicationMode=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/continueSetupOnHEVM=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/engineDbBackupDir=3Dstr:'/var/lib/ovirt-engine/backups'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/engineHeapMax=3Dstr:'1955M'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/engineHeapMin=3Dstr:'1955M'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/engineServiceStopNeeded=3Dbool:'True'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/fenceKdumpListenerStopNeeded=3Dbool:'True'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/firewallChangesReview=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/firewallManager=3Dstr:'firewalld'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/firewallManagers=3Dlist:'[<otopi.plugins.ovirt_engine_comm=
on.base.network.firewall_manager_firewalld._FirewalldManager=20object=20=
at=200x29bced0>,=20=
<otopi.plugins.ovirt_engine_common.base.network.firewall_manager_human._Hu=
manManager=20object=20at=200x29bcad0>,=20=
<otopi.plugins.ovirt_engine_common.base.network.firewall_manager_iptables.=
_IpTablesManager=20object=20at=200x29bcfd0>]'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/fqdn=3Dstr:'cultivar.grove.silverorange.com'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/fqdnNonLoopback=3Dbool:'False'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/fqdnReverseValidation=3Dbool:'False'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/httpPort=3Dint:'80'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/httpsPort=3Dint:'443'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/ignoreVdsgroupInNotifier=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/imageioProxyConfig=3Dbool:'True'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/imageioProxyHost=3Dstr:'localhost'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/imageioProxyPort=3Dint:'54323'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/imageioProxyStopNeeded=3Dbool:'True'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainACL=3DNoneType:'None'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainDefaultMountPoint=3Dstr:'/var/lib/exports/iso'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainExists=3Dbool:'False'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainMountPoint=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainName=3DNoneType:'None'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainSdUuid=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainStorageDir=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoPathsToUpload=3Dlist:'['/usr/share/virtio-win/virtio-wi=
n_x86.vfd',=20'/usr/share/virtio-win/virtio-win_amd64.vfd',=20=
'/usr/share/virtio-win/virtio-win.iso',=20=
'/usr/share/ovirt-guest-tools-iso/ovirt-tools-setup.iso',=20=
'/usr/share/rhev-guest-tools-iso/rhev-tools-setup.iso']'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/javaHome=3DNoneType:'None'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/javaNeeded=3Dbool:'True'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossAjpPort=3Dint:'8702'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossDebugAddress=3Dstr:'127.0.0.1:8787'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossDirectHttpPort=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossDirectHttpsPort=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossHome=3Dstr:'/usr/share/ovirt-engine-wildfly'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossHttpPort=3Dint:'8080'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossHttpsPort=3Dint:'8443'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossNeeded=3Dbool:'True'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/keySize=3Dint:'2048'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/pkiOIPCSRFilename=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/pkiRenewalDocUrl=3Dstr:'http://www.ovirt.org/OVirt_3.5.4_R=
elease_Notes#PKI'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/pkiWSPCSRFilename=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/publicHttpPort=3Dint:'80'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/publicHttpsPort=3Dint:'443'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineHostClientKey=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineHostKnownHosts=3DNoneType:'None'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineHostRootPassword=3DNoneType:'None'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineHostSshPort=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineSetupStyle=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineSetupStyles=3Dlist:'[<otopi.plugins.ovirt_engi=
ne_common.base.remote_engine.remote_engine_root_ssh._RootSshManager=20=
object=20at=200x29bcb10>,=20=
<otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine_manual=
_files._ManualFiles=20object=20at=200x29bca10>]'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/sanWipeAfterDelete=3Dbool:'False'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/storageIsLocal=3Dbool:'False'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/storageType=3DNoneType:'None'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/totalMemoryMB=3Dint:'7823'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/updateFirewall=3Dbool:'True'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/validFirewallManagers=3Dstr:''=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/websocketProxyConfig=3Dbool:'True'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/websocketProxyHost=3Dstr:'localhost'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/websocketProxyPort=3Dint:'6100'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/websocketProxyStopNeeded=3Dbool:'True'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/action=3Dstr:'setup'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/answerFile=3DNoneType:'None'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/developerMode=3Dbool:'False'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/engineStop=3DNoneType:'None'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/generatePostInstall=3Dbool:'True'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/generatedByVersion=3Dstr:'4.0.2.6'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/offlinePackager=3Dbool:'False'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/originalGeneratedByVersion=3Dstr:'4.0.2.6'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/reconfigureOptionalComponents=3DNoneType:'None'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/registerUninstallGroups=3DRegisterGroups:'<otopi.plugins.ovi=
rt_engine_common.base.core.uninstall.RegisterGroups=20object=20at=20=
0x29bc450>'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/remoteEngine=3DRemoteEngine:'<ovirt_engine_setup.remote_engi=
ne.RemoteEngine=20object=20at=200x29bcd50>'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/setupAttributesModules=3Dlist:'[<module=20=
'ovirt_engine_setup.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine_common.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine_common/constants.=
pyc'>,=20<module=20'ovirt_engine_setup.dwh.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/dwh/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.ovirt_imageio_proxy.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/ovirt_imageio_proxy/cons=
tants.pyc'>,=20<module=20=
'ovirt_engine_setup.vmconsole_proxy_helper.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/vmconsole_proxy_helper/c=
onstants.pyc'>,=20<module=20=
'ovirt_engine_setup.websocket_proxy.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/websocket_proxy/constant=
s.pyc'>]'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/uninstallUnremovableFiles=3Dlist:'['/etc/exports']'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/upgradeSupportedVersions=3Dstr:'3.6,4.0'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_FILE_GROUP/ovirt_dwh_files=3Dlist:'[]'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_LINES_GROUP/ovirt_dwh_files=3Ddict:'{}'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/connection=3DNoneType:'None'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/database=3Dstr:'engine'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/dumper=3Dstr:'pg_custom'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/filter=3DNoneType:'None'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/fixDbViolations=3DNoneType:'None'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/host=3Dstr:'localhost'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/newDatabase=3Dbool:'False'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/password=3Dstr:'**FILTERED**'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/pgPassFile=3DNoneType:'None'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/port=3Dstr:'5432'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/restoreJobs=3Dint:'2'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/secured=3Dbool:'False'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/securedHostValidation=3Dbool:'False'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/statement=3DNoneType:'None'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/user=3Dstr:'engine'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DIALOG/confirmSettings=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DOCS/docsAreLocal=3Dbool:'False'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DOCS/dwhDocUrl=3Dstr:'http://www.ovirt.org/Ovirt_DWH'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DOCS/reportsDocUrl=3Dstr:'http://www.ovirt.org/Ovirt_Reports'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CONFIG/dwhDbBackupDir=3Dstr:'/var/lib/ovirt-engine-dwh/backup=
s'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CONFIG/dwhServiceStopNeeded=3Dbool:'True'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CONFIG/remoteEngineConfigured=3Dbool:'False'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CONFIG/scale=3Dstr:'1'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CORE/enable=3Dbool:'True'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CORE/uuid=3Dstr:'86e6524b-9cc3-4693-988c-161a1af65356'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/connection=3DNoneType:'None'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/database=3Dstr:'ovirt_engine_history'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/disconnectExistingDwh=3DNoneType:'None'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/dumper=3Dstr:'pg_custom'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/filter=3DNoneType:'None'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/host=3Dstr:'localhost'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/newDatabase=3Dbool:'False'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/password=3Dstr:'**FILTERED**'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/performBackup=3Dbool:'True'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/pgPassFile=3DNoneType:'None'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/port=3Dstr:'5432'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/restoreBackupLate=3Dbool:'True'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/restoreJobs=3Dint:'2'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/secured=3Dbool:'False'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/securedHostValidation=3Dbool:'False'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/statement=3DNoneType:'None'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/user=3Dstr:'ovirt_engine_history'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_PROVISIONING/postgresProvisioningEnabled=3DNoneType:'None'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_RPMDISRO_PACKAGES=3Dstr:'ovirt-engine-dwh'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_RPMDISRO_PACKAGES_SETUP=3Dstr:'ovirt-engine-dwh-setup'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_ENGINE_CONFIG/fqdn=3Dstr:'cultivar.grove.silverorange.com'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_ENGINE_CORE/enable=3Dbool:'True'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldServices=3Dlist:'[{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-http'},=20{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-https'},=20{'directory':=20=
'vmconsole-proxy',=20'name':=20'ovirt-vmconsole-proxy'},=20{'directory':=20=
'ovirt-imageio-proxy',=20'name':=20'ovirt-imageio-proxy'},=20=
{'directory':=20'websocket-proxy',=20'name':=20'ovirt-websocket-proxy'},=20=
{'directory':=20'ovirt-engine',=20'name':=20=
'ovirt-fence-kdump-listener'},=20{'directory':=20'ovirt-common',=20=
'name':=20'ovirt-postgres'},=20{'directory':=20'ovirt-common',=20'name':=20=
'ovirt-postgres'}]'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldSubst=3Ddict:'{'@WEBSOCKET_PROXY_PORT@':=20=
6100,=20'@HTTPS_PORT@':=20443,=20'@VMCONSOLE_PROXY_PORT@':=202222,=20=
'@HTTP_PORT@':=2080,=20'@IMAGEIO_PROXY_PORT@':=2054323,=20=
'@JBOSS_HTTPS_PORT@':=20None,=20'@JBOSS_HTTP_PORT@':=20None}'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_PKI/country=3Dstr:'US'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PKI/organization=3Dstr:'grove.silverorange.com'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_PKI/renew=3DNoneType:'None'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_PKI/storePassword=3Dstr:'**FILTERED**'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresConf=3Dstr:'/var/lib/pgsql/data/postgresql.c=
onf'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresLCMessages=3Dstr:''en_US.UTF-8''=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresListenAddress=3Dstr:''*''=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresMaxConn=3Dint:'150'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresPgHba=3Dstr:'/var/lib/pgsql/data/pg_hba.conf=
'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresPgVersion=3Dstr:'/var/lib/pgsql/data/PG_VERS=
ION'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresProvisioningEnabled=3DNoneType:'None'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresService=3Dstr:'postgresql'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/aaaJdbcPackage=3Dstr:'ovirt-engine-extension-aaa-jdbc'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/additionalPackages=3Dstr:'ovirt-host-deploy,ovirt-engin=
e-cli,ovirt-image-uploader,ovirt-iso-uploader,ovirt-engine-dashboard'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/enginePackages=3Dstr:'ovirt-engine'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/engineSetupPackages=3Dstr:'ovirt-engine-setup'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/jbossPackages=3Dstr:'ovirt-engine-wildfly,ovirt-engine-=
wildfly-overlay'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/packagesSetup=3Dlist:'['ovirt-engine-setup',=20=
'ovirt-engine-setup-plugin-websocket-proxy',=20=
'ovirt-engine-dwh-setup']'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/packagesUpgradeList=3Dlist:'[{'packages':=20=
['ovirt-engine-extension-aaa-jdbc']},=20{'packages':=20=
['ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay']},=20=
{'packages':=20['ovirt-engine',=20'ovirt-host-deploy',=20=
'ovirt-engine-cli',=20'ovirt-image-uploader',=20'ovirt-iso-uploader',=20=
'ovirt-engine-dashboard'],=20'group':=20'ovirt-engine-4.0'},=20=
{'packages':=20['ovirt-engine-websocket-proxy']},=20{'packages':=20=
['ovirt-engine-dwh']}]'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/upgradeYumGroup=3Dstr:'ovirt-engine-4.0'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/groupEngine=3Dstr:'ovirt'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/groupKvm=3Dstr:'kvm'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/groupVmConsole=3Dstr:'ovirt-vmconsole'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/hostileServices=3Dstr:'ovirt-engine-dwhd,ovirt-engine-noti=
fier'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/memCheckEnabled=3Dbool:'True'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/memCheckMinimumMB=3Dint:'4096'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/memCheckRecommendedMB=3Dint:'16384'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/memCheckThreshold=3Dint:'90'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/nfsConfigEnabled=3Dbool:'False'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/nfsConfigEnabled_legacyInPostInstall=3Dbool:'False'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/nfsServiceName=3Dstr:'nfs-server'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/selinuxBooleans=3Dlist:'[]'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/selinuxContexts=3Dlist:'[]'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/selinuxRestorePaths=3Dlist:'[]'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/shmmax=3Dint:'68719476736'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userApache=3Dstr:'apache'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userEngine=3Dstr:'ovirt'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userPostgres=3Dstr:'postgres'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userRoot=3Dstr:'root'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userVdsm=3Dstr:'vdsm'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userVmConsole=3Dstr:'ovirt-vmconsole'=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_VMCONSOLE_PROXY_CONFIG/vmconsoleProxyConfig=3Dbool:'True'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_VMCONSOLE_PROXY_CONFIG/vmconsoleProxyPort=3Dint:'2222'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_WSP_RPMDISTRO_PACKAGES=3Dstr:'ovirt-engine-websocket-proxy'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_WSP_RPMDISTRO_PACKAGES_SETUP=3Dstr:'ovirt-engine-setup-plugin-web=
socket-proxy'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfDisabledPlugins=3Dlist:'[]'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfExpireCache=3Dbool:'True'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfRollback=3Dbool:'True'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfpackagerEnabled=3Dbool:'True'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/keepAliveInterval=3Dint:'30'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumDisabledPlugins=3Dlist:'[]'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumEnabledPlugins=3Dlist:'[]'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumExpireCache=3Dbool:'True'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumRollback=3Dbool:'True'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumpackagerEnabled=3Dbool:'True'=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
SYSTEM/clockMaxGap=3Dint:'5'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
SYSTEM/clockSet=3Dbool:'False'=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
SYSTEM/commandPath=3Dstr:'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bi=
n:/sbin:/bin'=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20SYSTEM/reboot=3Dbool:'False'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20SYSTEM/rebootAllow=3Dbool:'True'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20SYSTEM/rebootDeferTime=3Dint:'10'=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._vali=
dation_enable=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20validation=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks.Plugin._v=
alidateEnv=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._va=
lidate_enable=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20validation=20=
METHOD=20otopi.plugins.otopi.network.hostname.Plugin._validation=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.plugins.otopi.network.hostname=20=
hostname._validation:61=20my=20name:=20cultivar.grove.silverorange.com=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.plugins.otopi.network.hostname=20=
plugin.executeRaw:813=20execute:=20('/sbin/ip',=20'addr',=20'show'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.plugins.otopi.network.hostname=20=
plugin.executeRaw:863=20execute-result:=20('/sbin/ip',=20'addr',=20=
'show'),=20rc=3D0=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.network.hostname=20plugin.execute:921=20=
execute-output:=20('/sbin/ip',=20'addr',=20'show')=20stdout:=0A1:=20lo:=20=
<LOOPBACK,UP,LOWER_UP>=20mtu=2065536=20qdisc=20noqueue=20state=20UNKNOWN=20=
=0A=20=20=20=20link/loopback=2000:00:00:00:00:00=20brd=20=
00:00:00:00:00:00=0A=20=20=20=20inet=20127.0.0.1/8=20scope=20host=20lo=0A=
=20=20=20=20=20=20=20valid_lft=20forever=20preferred_lft=20forever=0A=20=20=
=20=20inet6=20::1/128=20scope=20host=20=0A=20=20=20=20=20=20=20valid_lft=20=
forever=20preferred_lft=20forever=0A2:=20eth0:=20=
<BROADCAST,MULTICAST,UP,LOWER_UP>=20mtu=201500=20qdisc=20pfifo_fast=20=
state=20UP=20qlen=201000=0A=20=20=20=20link/ether=2000:16:3e:7f:d6:83=20=
brd=20ff:ff:ff:ff:ff:ff=0A=20=20=20=20inet=20192.168.0.203/24=20brd=20=
192.168.0.255=20scope=20global=20eth0=0A=20=20=20=20=20=20=20valid_lft=20=
forever=20preferred_lft=20forever=0A=20=20=20=20inet6=20=
fe80::216:3eff:fe7f:d683/64=20scope=20link=20=0A=20=20=20=20=20=20=20=
valid_lft=20forever=20preferred_lft=20forever=0A=0A2016-08-18=2012:58:39=20=
DEBUG=20otopi.plugins.otopi.network.hostname=20plugin.execute:926=20=
execute-output:=20('/sbin/ip',=20'addr',=20'show')=20stderr:=0A=0A=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.plugins.otopi.network.hostname=20=
hostname._validation:98=20my=20addresses:=20['192.168.0.203',=20=
'192.168.0.203',=20'192.168.0.203']=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.network.hostname=20hostname._validation:99=20local=20=
addresses:=20[u'192.168.0.203',=20u'fe80::216:3eff:fe7f:d683']=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.otopi.network.ssh.Plugin._validation=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.context=20context._executeMethod:134=20=
condition=20False=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.selinux.Plugin._validation=0A=
2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_common.base.system.selinux=20=
plugin.executeRaw:813=20execute:=20('/sbin/selinuxenabled',),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.plugins.ovirt_engine_common.base.system.selinux=20=
plugin.executeRaw:863=20execute-result:=20('/sbin/selinuxenabled',),=20=
rc=3D0=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_common.base.system.selinux=20=
plugin.execute:921=20execute-output:=20('/sbin/selinuxenabled',)=20=
stdout:=0A=0A=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.ovirt_engine_common.base.system.selinux=20=
plugin.execute:926=20execute-output:=20('/sbin/selinuxenabled',)=20=
stderr:=0A=0A=0A2016-08-18=2012:58:39=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.engine.Plugin._validat=
ion=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.exists:73=20check=20if=20=
service=20ovirt-engine=20exists=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine.service'),=20rc=3D0=0A2016-08-18=2012:58:39=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine.service')=20stdout:=0ALoadState=3Dloaded=0A=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'LoadState',=20'ovirt-engine.service')=20stderr:=0A=0A=0A=
2016-08-18=2012:58:39=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
systemd.status:90=20check=20service=20ovirt-engine=20status=0A2016-08-18=20=
12:58:39=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'status',=20=
'ovirt-engine.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:58:40=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'status',=20=
'ovirt-engine.service'),=20rc=3D0=0A2016-08-18=2012:58:40=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'status',=20=
'ovirt-engine.service')=20stdout:=0A=E2=97=8F=20ovirt-engine.service=20-=20=
oVirt=20Engine=0A=20=20=20Loaded:=20loaded=20=
(/usr/lib/systemd/system/ovirt-engine.service;=20enabled;=20vendor=20=
preset:=20disabled)=0A=20=20=20Active:=20active=20(running)=20since=20=
Thu=202016-08-18=2011:02:09=20ADT;=201h=2056min=20ago=0A=20Main=20PID:=20=
10800=20(ovirt-engine.py)=0A=20=20=20CGroup:=20=
/system.slice/ovirt-engine.service=0A=20=20=20=20=20=20=20=20=20=20=20=
=E2=94=9C=E2=94=8010800=20/usr/bin/python=20=
/usr/share/ovirt-engine/services/ovirt-engine/ovirt-engine.py=20=
--redirect-output=20--systemd=3Dnotify=20start=0A=20=20=20=20=20=20=20=20=
=20=20=20=E2=94=94=E2=94=8010856=20ovirt-engine=20-server=20=
-XX:+TieredCompilation=20-Xms1955M=20-Xmx1955M=20=
-Djava.awt.headless=3Dtrue=20-Dsun.rmi.dgc.client.gcInterval=3D3600000=20=
-Dsun.rmi.dgc.server.gcInterval=3D3600000=20=
-Djsse.enableSNIExtension=3Dfalse=20-XX:+HeapDumpOnOutOfMemoryError=20=
-XX:HeapDumpPath=3D/var/log/ovirt-engine/dump=20=
-Djava.util.logging.manager=3Dorg.jboss.logmanager=20=
-Dlogging.configuration=3Dfile:///var/lib/ovirt-engine/jboss_runtime/confi=
g/ovirt-engine-logging.properties=20-Dorg.jboss.resolver.warning=3Dtrue=20=
-Djboss.modules.system.pkgs=3Dorg.jboss.byteman=20=
-Djboss.modules.write-indexes=3Dfalse=20=
-Djboss.server.default.config=3Dovirt-engine=20=
-Djboss.home.dir=3D/usr/share/ovirt-engine-wildfly=20=
-Djboss.server.base.dir=3D/usr/share/ovirt-engine=20=
-Djboss.server.data.dir=3D/var/lib/ovirt-engine=20=
-Djboss.server.log.dir=3D/var/log/ovirt-engine=20=
-Djboss.server.config.dir=3D/var/lib/ovirt-engine/jboss_runtime/config=20=
-Djboss.server.temp.dir=3D/var/lib/ovirt-engine/jboss_runtime/tmp=20=
-Djboss.controller.temp.dir=3D/var/lib/ovirt-engine/jboss_runtime/tmp=20=
-jar=20/usr/share/ovirt-engine-wildfly/jboss-modules.jar=20-mp=20=
/var/lib/ovirt-engine/jboss_runtime/modules/00-ovirt-engine-wildfly-overla=
y-modules:/var/lib/ovirt-engine/jboss_runtime/modules/01-modules-common:/v=
ar/lib/ovirt-engine/jboss_runtime/modules/02-ovirt-engine-extension-aaa-jd=
bc-modules:/var/lib/ovirt-engine/jboss_runtime/modules/03-ovirt-engine-wil=
dfly-modules=20-jaxpmodule=20javax.xml.jaxp-provider=20=
org.jboss.as.standalone=20-c=20ovirt-engine.xml=0A=0AAug=2018=2011:02:07=20=
cultivar.grove.silverorange.com=20systemd[1]:=20Starting=20oVirt=20=
Engine...=0AAug=2018=2011:02:09=20cultivar.grove.silverorange.com=20=
systemd[1]:=20Started=20oVirt=20Engine.=0A=0A2016-08-18=2012:58:40=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'status',=20=
'ovirt-engine.service')=20stderr:=0A=0A=0A2016-08-18=2012:58:40=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20human.queryString:145=20query=20=
OVESETUP_CORE_ENGINE_STOP=0A2016-08-18=2012:58:40=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20During=20execution=20=
engine=20service=20will=20be=20stopped=20(OK,=20Cancel)=20[OK]:=20=0A=
2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_CORE/engineStop=3Dbool:'True'=
=0A2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:58:42=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
validation=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.config.Plugin._validatio=
n=0A2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.pgpass.Plugin._validatio=
n=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.pgpass=20=
plugin.executeRaw:813=20execute:=20('/bin/psql',=20'-V'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
12:58:42=20DEBUG=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.pgpass=20=
plugin.executeRaw:863=20execute-result:=20('/bin/psql',=20'-V'),=20rc=3D0=0A=
2016-08-18=2012:58:42=20DEBUG=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.pgpass=20=
plugin.execute:921=20execute-output:=20('/bin/psql',=20'-V')=20stdout:=0A=
psql=20(PostgreSQL)=209.2.15=0A=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.pgpass=20=
plugin.execute:926=20execute-output:=20('/bin/psql',=20'-V')=20stderr:=0A=
=0A=0A2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/pgPassFile=3Dstr:'/tmp/tmpGmniqO'=0A2016-08-18=2012:58:42=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.config.java.Plugin._=
validation=0A2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/javaHome=3Dunicode:'/usr/lib/jvm/jre'=0A2016-08-18=20=
12:58:42=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_common.system.he.Plugin._va=
lidate=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20select=20version,=20option_value=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20from=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20where=20option_name=20=3D=20%(name)s=0A=20=20=20=20=20=20=20=
=20=20=20=20=20',=20args:=20{'name':=20'HostedEngineVmName'}=0A=
2016-08-18=2012:58:42=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'version':=20'general',=20'option_value':=20'HostedEngine'}]=0A=
2016-08-18=2012:58:42=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=20vm_guid,=20run_on_vds=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20FROM=20vms=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20vm_name=20=3D=20%(HostedEngineVmName)s;=0A=20=20=20=20=20=20=
=20=20=20=20=20=20',=20args:=20{'HostedEngineVmName':=20'HostedEngine'}=0A=
2016-08-18=2012:58:42=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[]=0A2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.config.Plugin._valid=
ation=0A2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._val=
idation=0A2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20NETWORK/firewalldEnable=3Dbool:'True'=0A=
2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
NETWORK_FIREWALLD_SERVICE/ovirt-fence-kdump-listener=3Dstr:'<?xml=20=
version=3D"1.0"=20encoding=3D"utf-8"?>=0A<service>=0A=20=20=
<short>ovirt-fence-kdump-listener</short>=0A=20=20<description>oVirt=20=
configured=20fence_kdump=20listener=20service</description>=0A=20=20=
<port=20protocol=3D"udp"=20port=3D"7410"/>=0A</service>=0A'=0A2016-08-18=20=
12:58:42=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK_FIREWALLD_SERVICE/ovirt-http=3Dstr:'<?xml=20version=3D"1.0"=20=
encoding=3D"utf-8"?>=0A<service>=0A=20=20<short>ovirt-http</short>=0A=20=20=
<description>oVirt=20configured=20http=20service</description>=0A=20=20=
<port=20protocol=3D"tcp"=20port=3D"80"/>=0A</service>=0A'=0A2016-08-18=20=
12:58:42=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK_FIREWALLD_SERVICE/ovirt-https=3Dstr:'<?xml=20version=3D"1.0"=20=
encoding=3D"utf-8"?>=0A<service>=0A=20=20<short>ovirt-https</short>=0A=20=
=20<description>oVirt=20configured=20https=20service</description>=0A=20=20=
<port=20protocol=3D"tcp"=20port=3D"443"/>=0A</service>=0A'=0A2016-08-18=20=
12:58:42=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK_FIREWALLD_SERVICE/ovirt-imageio-proxy=3Dstr:'<?xml=20=
version=3D"1.0"=20encoding=3D"utf-8"?>=0A<service>=0A=20=20=
<short>ovirt-imageio-proxy</short>=0A=20=20<description>oVirt=20ImageIO=20=
Proxy=20service</description>=0A=20=20<port=20protocol=3D"tcp"=20=
port=3D"54323"/>=0A</service>=0A'=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK_FIREWALLD_SERVICE/ovirt-postgres=3Dstr:'<?xml=20version=3D"1.0"=20=
encoding=3D"utf-8"?>=0A<service>=0A=20=20<short>ovirt-postgres</short>=0A=
=20=20<description>oVirt=20configured=20postgres=20service</description>=0A=
=20=20<port=20protocol=3D"tcp"=20port=3D"5432"/>=0A</service>=0A'=0A=
2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
NETWORK_FIREWALLD_SERVICE/ovirt-vmconsole-proxy=3Dstr:'<?xml=20=
version=3D"1.0"=20encoding=3D"utf-8"?>=0A<service>=0A=20=20=
<short>ovirt-vmconsole-proxy</short>=0A=20=20<description>oVirt=20=
configured=20VM=20Console=20Proxy=20service</description>=0A=20=20<port=20=
protocol=3D"tcp"=20port=3D"2222"/>=0A</service>=0A'=0A2016-08-18=20=
12:58:42=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK_FIREWALLD_SERVICE/ovirt-websocket-proxy=3Dstr:'<?xml=20=
version=3D"1.0"=20encoding=3D"utf-8"?>=0A<service>=0A=20=20=
<short>ovirt-websocket-proxy</short>=0A=20=20<description>oVirt=20=
configured=20WebSocket=20Proxy=20service</description>=0A=20=20<port=20=
protocol=3D"tcp"=20port=3D"6100"/>=0A</service>=0A'=0A2016-08-18=20=
12:58:42=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.notifier.Plugin._vali=
dation=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.notifier=20=
notifier._validation:66=20filterStr:=20None=0A2016-08-18=2012:58:42=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20validation=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._validation=0A2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:42=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20validation=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._vali=
dation=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs=20=
exportfs._validation:166=20move=3DFalse,=20generate=3DFalse=0A2016-08-18=20=
12:58:42=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.image_upload.Plugin._=
validation=0A2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:42=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20validation=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._va=
lidate_ssl=0A2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:42=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20validation=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl.Plugin.=
_validation=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl=20=
plugin.executeRaw:813=20execute:=20('/sbin/sysctl',=20'-n',=20=
'kernel.shmmax'),=20executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A=
2016-08-18=2012:58:42=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl=20=
plugin.executeRaw:863=20execute-result:=20('/sbin/sysctl',=20'-n',=20=
'kernel.shmmax'),=20rc=3D0=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl=20=
plugin.execute:921=20execute-output:=20('/sbin/sysctl',=20'-n',=20=
'kernel.shmmax')=20stdout:=0A18446744073692774399=0A=0A2016-08-18=20=
12:58:42=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl=20=
plugin.execute:926=20execute-output:=20('/sbin/sysctl',=20'-n',=20=
'kernel.shmmax')=20stderr:=0A=0A=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.check_etl.Plugin._v=
alidation=0A2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:42=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20validation=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.single_etl.Plugin._=
validation=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
select=20*=20from=20GetDwhHistoryTimekeepingByVarName(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20%(name)s=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20=20=20=20=20',=20args:=20{'name':=20'dwhHostname'}=0A=
2016-08-18=2012:58:42=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'var_value':=20'cultivar.grove.silverorange.com',=20=
'var_datetime':=20None,=20'var_name':=20'dwhHostname'}]=0A2016-08-18=20=
12:58:42=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'=0A=20=20=20=20=
=20=20=20=20=20=20=20=20select=20*=20from=20=
GetDwhHistoryTimekeepingByVarName(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20%(name)s=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
=20=20=20=20',=20args:=20{'name':=20'dwhUuid'}=0A2016-08-18=2012:58:42=20=
DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:177=20Creating=20own=20connection=0A2016-08-18=20=
12:58:42=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:222=20Result:=20[{'var_value':=20=
'86e6524b-9cc3-4693-988c-161a1af65356',=20'var_datetime':=20None,=20=
'var_name':=20'dwhUuid'}]=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._valida=
tion=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20select=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20nsp.nspname=20as=20object_schema,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20cls.relname=20as=20object_name,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20rol.rolname=20as=20=
owner,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
case=20cls.relkind=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20when=20'r'=20then=20'TABLE'=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20when=20'i'=20then=20'INDEX'=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
when=20'S'=20then=20'SEQUENCE'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20when=20'v'=20then=20'VIEW'=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20when=20'c'=20=
then=20'TYPE'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20else=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20cls.relkind::text=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20end=20as=20object_type=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20from=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20pg_class=20cls=20join=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20pg_roles=20rol=20on=20rol.oid=20=3D=20cls.relowner=20=
join=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
pg_namespace=20nsp=20on=20nsp.oid=20=3D=20cls.relnamespace=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20where=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20nsp.nspname=20not=20in=20=
('information_schema',=20'pg_catalog')=20and=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20nsp.nspname=20not=20like=20'pg_%%'=20=
and=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
rol.rolname=20!=3D=20%(user)s=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20order=20by=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20nsp.nspname,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20cls.relname=0A=20=20=20=20=20=20=20=20=20=20=20=20',=20args:=20=
{'user':=20'ovirt_engine_history'}=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:42=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[]=0A2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._validation=0A2016-08-18=2012:58:42=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:58:42=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20validation=20=
METHOD=20otopi.plugins.otopi.network.firewalld.Plugin._validation=0A=
2016-08-18=2012:58:43=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.otopi.network.iptables.Plugin._validate=0A2016-08-18=20=
12:58:43=20DEBUG=20otopi.context=20context._executeMethod:134=20=
condition=20False=0A2016-08-18=2012:58:43=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema.Plugin._validation=
=0A2016-08-18=2012:58:43=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20select=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20nsp.nspname=20as=20object_schema,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20cls.relname=20as=20object_name,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20rol.rolname=20as=20=
owner,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
case=20cls.relkind=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20when=20'r'=20then=20'TABLE'=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20when=20'i'=20then=20'INDEX'=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
when=20'S'=20then=20'SEQUENCE'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20when=20'v'=20then=20'VIEW'=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20when=20'c'=20=
then=20'TYPE'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20else=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20cls.relkind::text=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20end=20as=20object_type=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20from=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20pg_class=20cls=20join=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20pg_roles=20rol=20on=20rol.oid=20=3D=20cls.relowner=20=
join=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
pg_namespace=20nsp=20on=20nsp.oid=20=3D=20cls.relnamespace=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20where=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20nsp.nspname=20not=20in=20=
('information_schema',=20'pg_catalog')=20and=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20nsp.nspname=20not=20like=20'pg_%%'=20=
and=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
rol.rolname=20!=3D=20%(user)s=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20order=20by=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20nsp.nspname,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20cls.relname=0A=20=20=20=20=20=20=20=20=20=20=20=20',=20args:=20=
{'user':=20'engine'}=0A2016-08-18=2012:58:43=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:43=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[]=0A2016-08-18=2012:58:43=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=20compatibility_version=20FROM=20storage_pool;=0A=20=20=
=20=20=20=20=20=20=20=20=20=20',=20args:=20{}=0A2016-08-18=2012:58:43=20=
DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:177=20Creating=20own=20connection=0A2016-08-18=20=
12:58:43=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:222=20Result:=20[{'compatibility_version':=20'4.0'}]=0A=
2016-08-18=2012:58:43=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=20table_name=20FROM=20information_schema.tables=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20table_name=20IN=20=
('vds_groups',=20'cluster');=0A=20=20=20=20=20=20=20=20=20=20=20=20',=20=
args:=20{}=0A2016-08-18=2012:58:43=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:43=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'table_name':=20'cluster'}]=0A2016-08-18=2012:58:43=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'SELECT=20compatibility_version=20=
FROM=20cluster;',=20args:=20{}=0A2016-08-18=2012:58:43=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:58:43=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'compatibility_version':=20'4.0'}]=0A2016-08-18=2012:58:43=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20validation=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.memcheck.Plugin._vali=
dateMemory=0A2016-08-18=2012:58:43=20WARNING=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.memcheck=20=
memcheck._check_requirements:83=20Less=20than=2016384MB=20of=20memory=20=
is=20available=0A2016-08-18=2012:58:43=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks.Plugin._v=
alidateZombies=0A2016-08-18=2012:58:43=20INFO=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
asynctasks._validateZombies:464=20Cleaning=20stale=20zombie=20tasks=20=
and=20commands=0A2016-08-18=2012:58:43=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
plugin.executeRaw:813=20execute:=20=
('/usr/share/ovirt-engine/setup/dbutils/taskcleaner.sh',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-u',=20'engine',=20'-s',=20'localhost',=20'-p',=20'5432',=20'-d',=20=
'engine',=20'-q',=20'-r',=20'-Z'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3D{'LANG':=20'en_US.UTF-8',=20'TERM':=20'xterm-256color',=20'SHELL':=20=
'/bin/bash',=20'MAIL':=20'/var/spool/mail/root',=20'SHLVL':=20'1',=20=
'PYTHONPATH':=20'/usr/share/ovirt-engine/setup/bin/..::',=20'HOSTNAME':=20=
'cultivar.grove.silverorange.com',=20'LS_COLORS':=20=
'rs=3D0:di=3D38;5;27:ln=3D38;5;51:mh=3D44;38;5;15:pi=3D40;38;5;11:so=3D38;=
5;13:do=3D38;5;5:bd=3D48;5;232;38;5;11:cd=3D48;5;232;38;5;3:or=3D48;5;232;=
38;5;9:mi=3D05;48;5;232;38;5;15:su=3D48;5;196;38;5;15:sg=3D48;5;11;38;5;16=
:ca=3D48;5;196;38;5;226:tw=3D48;5;10;38;5;16:ow=3D48;5;10;38;5;21:st=3D48;=
5;21;38;5;15:ex=3D38;5;34:*.tar=3D38;5;9:*.tgz=3D38;5;9:*.arc=3D38;5;9:*.a=
rj=3D38;5;9:*.taz=3D38;5;9:*.lha=3D38;5;9:*.lz4=3D38;5;9:*.lzh=3D38;5;9:*.=
lzma=3D38;5;9:*.tlz=3D38;5;9:*.txz=3D38;5;9:*.tzo=3D38;5;9:*.t7z=3D38;5;9:=
*.zip=3D38;5;9:*.z=3D38;5;9:*.Z=3D38;5;9:*.dz=3D38;5;9:*.gz=3D38;5;9:*.lrz=
=3D38;5;9:*.lz=3D38;5;9:*.lzo=3D38;5;9:*.xz=3D38;5;9:*.bz2=3D38;5;9:*.bz=3D=
38;5;9:*.tbz=3D38;5;9:*.tbz2=3D38;5;9:*.tz=3D38;5;9:*.deb=3D38;5;9:*.rpm=3D=
38;5;9:*.jar=3D38;5;9:*.war=3D38;5;9:*.ear=3D38;5;9:*.sar=3D38;5;9:*.rar=3D=
38;5;9:*.alz=3D38;5;9:*.ace=3D38;5;9:*.zoo=3D38;5;9:*.cpio=3D38;5;9:*.7z=3D=
38;5;9:*.rz=3D38;5;9:*.cab=3D38;5;9:*.jpg=3D38;5;13:*.jpeg=3D38;5;13:*.gif=
=3D38;5;13:*.bmp=3D38;5;13:*.pbm=3D38;5;13:*.pgm=3D38;5;13:*.ppm=3D38;5;13=
:*.tga=3D38;5;13:*.xbm=3D38;5;13:*.xpm=3D38;5;13:*.tif=3D38;5;13:*.tiff=3D=
38;5;13:*.png=3D38;5;13:*.svg=3D38;5;13:*.svgz=3D38;5;13:*.mng=3D38;5;13:*=
.pcx=3D38;5;13:*.mov=3D38;5;13:*.mpg=3D38;5;13:*.mpeg=3D38;5;13:*.m2v=3D38=
;5;13:*.mkv=3D38;5;13:*.webm=3D38;5;13:*.ogm=3D38;5;13:*.mp4=3D38;5;13:*.m=
4v=3D38;5;13:*.mp4v=3D38;5;13:*.vob=3D38;5;13:*.qt=3D38;5;13:*.nuv=3D38;5;=
13:*.wmv=3D38;5;13:*.asf=3D38;5;13:*.rm=3D38;5;13:*.rmvb=3D38;5;13:*.flc=3D=
38;5;13:*.avi=3D38;5;13:*.fli=3D38;5;13:*.flv=3D38;5;13:*.gl=3D38;5;13:*.d=
l=3D38;5;13:*.xcf=3D38;5;13:*.xwd=3D38;5;13:*.yuv=3D38;5;13:*.cgm=3D38;5;1=
3:*.emf=3D38;5;13:*.axv=3D38;5;13:*.anx=3D38;5;13:*.ogv=3D38;5;13:*.ogx=3D=
38;5;13:*.aac=3D38;5;45:*.au=3D38;5;45:*.flac=3D38;5;45:*.mid=3D38;5;45:*.=
midi=3D38;5;45:*.mka=3D38;5;45:*.mp3=3D38;5;45:*.mpc=3D38;5;45:*.ogg=3D38;=
5;45:*.ra=3D38;5;45:*.wav=3D38;5;45:*.axa=3D38;5;45:*.oga=3D38;5;45:*.spx=3D=
38;5;45:*.xspf=3D38;5;45:',=20'LESSOPEN':=20'||/usr/bin/lesspipe.sh=20=
%s',=20'HISTCONTROL':=20'ignoredups',=20'PWD':=20'/root',=20'LOGNAME':=20=
'root',=20'USER':=20'root',=20'OTOPI_LOGFILE':=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'HOME':=20'/root',=20'HISTSIZE':=20'1000',=20'XDG_SESSION_ID':=20=
'6',=20'OTOPI_EXECDIR':=20'/root',=20'DBFUNC_DB_PGPASSFILE':=20=
'/tmp/tmpGmniqO',=20'PATH':=20=
'/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin'}=0A=
*********=20QUERY=20**********=0Aselect=20exists=20(select=20*=20from=20=
information_schema.tables=20where=20table_schema=20=3D=20'public'=20and=20=
table_name=20=3D=20'command_entities');=0A**************************=0A=0A=
=20t=0A=0A*********=20QUERY=20**********=0A=
/*************************************************************************=
***********************=0A=20The=20following=20are=20helper=20SP=20for=20=
taskcleaner=20utility=20and=20are=20not=20exposed=20to=20the=20=
application=20DAOs=0A=0AIf=20you=20add=20a=20function=20here,=20drop=20=
it=20in=20taskcleaner_sp_drop.sql=0A=
**************************************************************************=
**********************/=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAsyncTasksZombies()=20RETURNS=20SETOF=20async_tasks=0A=20=20=20AS=20=
$procedure$=0ADECLARE=0A=20=20=20=20zombie_task_life=20varchar;=0A=20=20=20=
=20zombie_timestamptz=20timestamp=20with=20time=20zone;=0ABEGIN=0A=20=20=20=
zombie_task_life=20=3D=20option_value=20FROM=20vdc_options=20WHERE=20=
option_name=20=3D=20'AsyncTaskZombieTaskLifeInMinutes';=0A=20=20=20=
EXECUTE=20'SELECT=20now()=20-=20interval=20'''=20||=20zombie_task_life=20=
||=20'=20minute'''=20=20INTO=20zombie_timestamptz;=0A=0A=20=20=20RETURN=20=
QUERY=20SELECT=20*=0A=20=20=20FROM=20async_tasks=0A=20=20=20WHERE=20=
started_at=20<=20zombie_timestamptz=0A=20=20=20ORDER=20BY=20command_id;=0A=
=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteAsyncTaskZombiesByTaskId(v_task_id=20UUID)=20=
RETURNS=20VOID=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20IF=20=
EXISTS=20(SELECT=201=20FROM=20GetAsyncTasksZombies()=20WHERE=20task_id=20=
=3D=20v_task_id)=20THEN=0A=20=20=20=20=20=20=20=20PERFORM=20=
Deleteasync_tasks(v_task_id);=0A=20=20=20=20END=20IF;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteAsyncTaskZombiesByCommandId(v_command_id=20=
UUID)=20RETURNS=20VOID=0A=20=20=20AS=20$procedure$=0ADECLARE=0A=
deleted_rows=20int;=0Aroot_command_id_of_deleted_cmds=20UUID;=0ABEGIN=0A=20=
=20=20=20IF=20(fn_db_is_table_exists=20('command_entities'))=20THEN=0A=20=
=20=20=20=20=20=20=20DELETE=20FROM=20command_entities=20c=20WHERE=0A=20=20=
=20=20=20=20=20=20c.command_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=20command_id=20FROM=20GetAsyncTasksZombies()=20t=20WHERE=20=
t.command_id=20=3D=20v_command_id=0A=20=20=20=20=20=20=20=20);=0A=0A=20=20=
=20=20=20=20=20=20DELETE=20FROM=20command_entities=20c=20WHERE=0A=20=20=20=
=20=20=20=20=20c.command_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20root_command_id=20FROM=20GetAsyncTasksZombies()=20t=20WHERE=20=
t.root_command_id=20=3D=20v_command_id=0A=20=20=20=20=20=20=20=20);=0A=20=
=20=20=20END=20IF;=0A=0A=20=20=20=20DELETE=20FROM=20async_tasks=20WHERE=0A=
=20=20=20=20root_command_id=20IN=20(=0A=20=20=20=20=20=20=20=20SELECT=20=
root_command_id=20FROM=20GetAsyncTasksZombies()=20t=20WHERE=20=
t.root_command_id=20=3D=20v_command_id=0A=20=20=20=20);=0A=0A=20=20=20=20=
DELETE=20FROM=20async_tasks=20WHERE=0A=20=20=20=20root_command_id=20IN=20=
(=0A=20=20=20=20=20=20=20=20SELECT=20root_command_id=20FROM=20=
GetAsyncTasksZombies()=20t=20WHERE=20t.command_id=20=3D=20v_command_id=0A=
=20=20=20=20);=0A=0A=20=20=20=20PERFORM=20=
DeleteEntitySnapshotByCommandId(v_command_id);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteAsyncTaskByCommandId(v_command_id=20UUID)=20RETURNS=20VOID=0A=20=20=
=20AS=20$procedure$=0ADECLARE=0Adeleted_rows=20int;=0A=
root_command_id_of_deleted_cmds=20UUID;=0ABEGIN=0A=20=20=20=20=20=20=20=20=
DELETE=20FROM=20async_tasks=20WHERE=20command_id=20=3D=20v_command_id;=0A=
=20=20=20=20=20=20=20=20IF=20(fn_db_is_table_exists=20=
('command_entities'))=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20root_command_id=20=20into=20root_command_id_of_deleted_cmds=20=
FROM=20COMMAND_entities=20WHERE=20command_id=20=3D=20v_command_id;=0A=20=20=
=20=20=20=20=20=20=20=20=20=20DELETE=20FROM=20command_entities=20where=20=
command_id=20=3D=20v_command_id;=0A=20=20=20=20=20=20=20=20=20=20=20=20=
GET=20DIAGNOSTICS=20deleted_rows=20=3D=20ROW_COUNT;=0A=20=20=20=20=20=20=20=
=20=20=20=20=20IF=20deleted_rows=20>=200=20THEN=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20DELETE=20FROM=20command_entities=20C=20WHERE=20=
command_id=20=3D=20root_command_id_of_deleted_cmds=20AND=20NOT=20EXISTS=20=
(SELECT=20*=20from=20COMMAND_ENTITIES=20WHERE=20root_command_id=20=3D=20=
C.command_id);=0A=20=20=20=20=20=20=20=20=20=20=20=20END=20IF;=0A=20=20=20=
=20=20=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20PERFORM=20=
DeleteEntitySnapshotByCommandId(v_command_id);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteAsyncTasksZombies()=20RETURNS=20VOID=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20DELETE=20FROM=20async_tasks=20WHERE=20task_id=20in=20=
(SELECT=20task_id=20FROM=20GetAsyncTasksZombies());=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteJobStepsByTaskId(v_task_id=20UUID)=20RETURNS=20VOID=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20=20DELETE=20FROM=20step=20WHERE=20=
external_id=20=3D=20v_task_id;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteEntitySnapshotByZombieTaskId(v_task_id=20UUID)=20RETURNS=20VOID=0A=20=
=20=20AS=20$procedure$=0ADECLARE=0A=20=20=20=20v_command_id=20UUID;=0A=
BEGIN=0A=20=20=20=20v_command_id:=3Dcommand_id=20FROM=20=
GetAsyncTasksZombies()=20WHERE=20task_id=20=3D=20v_task_id;=0A=20=20=20=20=
DELETE=20FROM=20business_entity_snapshot=20WHERE=20command_id=20=3D=20=
v_command_id;=0A=20=20=20=20PERFORM=20=
DeleteCommandEntitiesByCommandId(v_command_id);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteEntitySnapshotByTaskId(v_task_id=20UUID)=20RETURNS=20VOID=0A=20=20=20=
AS=20$procedure$=0ADECLARE=0A=20=20=20=20v_command_id=20UUID;=0ABEGIN=0A=20=
=20=20=20v_command_id:=3Dcommand_id=20FROM=20async_tasks=20WHERE=20=
task_id=20=3D=20v_task_id;=0A=20=20=20=20DELETE=20FROM=20=
business_entity_snapshot=20WHERE=20command_id=20=3D=20v_command_id;=0A=20=
=20=20=20PERFORM=20DeleteCommandEntitiesByCommandId(v_command_id);=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteEntitySnapshotZombies()=20RETURNS=20VOID=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20DELETE=20FROM=20=
business_entity_snapshot=20WHERE=20command_id=20IN=20(SELECT=20=
command_id=20FROM=20GetAsyncTasksZombies());=0A=20=20=20=20PERFORM=20=
DeleteAllCommandEntitiesByCommandId(v_command_id);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteOrphanJobs()=20RETURNS=20VOID=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=
=20=20=20=20DELETE=20FROM=20job=20WHERE=20NOT=20EXISTS=20(SELECT=201=20=
from=20step=20where=20step.job_id=20=3D=20job.job_id);=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteJobStepsByZombieCommandId(v_command_id=20=
UUID)=20RETURNS=20VOID=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20=
DELETE=20FROM=20step=20WHERE=20step_id=20IN=20(SELECT=20step_id=20from=20=
GetAsyncTasksZombies()=20WHERE=20command_id=20=3D=20v_command_id);=0A=20=20=
=20=20PERFORM=20DeleteOrphanJobs();=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteJobStepsByCommandId(v_command_id=20UUID)=20RETURNS=20VOID=0A=20=20=20=
AS=20$procedure$=0ABEGIN=0A=20=20=20=20DELETE=20FROM=20step=20WHERE=20=
step_id=20IN=20(SELECT=20step_id=20from=20async_tasks=20WHERE=20=
command_id=20=3D=20v_command_id);=0A=20=20=20=20PERFORM=20=
DeleteOrphanJobs();=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteJobStepsZombies()=20=
RETURNS=20VOID=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20DELETE=20=
FROM=20step=20WHERE=20step_id=20IN=20(SELECT=20step_id=20FROM=20=
GetAsyncTasksZombies());=0A=20=20=20=20PERFORM=20DeleteOrphanJobs();=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteAllJobs()=20RETURNS=20VOID=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20=20DELETE=20FROM=20job;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteAllEntitySnapshot()=20RETURNS=20VOID=0A=20=20=20=
AS=20$procedure$=0ABEGIN=0A=20=20=20=20DELETE=20FROM=20=
business_entity_snapshot;=0A=20=20=20=20PERFORM=20=
DeleteAllCommandEntities();=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteEntitySnapshotByCommandId(v_command_id=20UUID)=20RETURNS=20VOID=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20DELETE=20FROM=20=
business_entity_snapshot=20where=20command_id=20=3D=20v_command_id;=0A=20=
=20=20=20PERFORM=20DeleteCommandEntitiesByCommandId(v_command_id);=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteAllCommandEntities()=20RETURNS=20VOID=0A=20=20=
=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20IF=20(fn_db_is_table_exists=20=
('command_entities'))=20THEN=0A=20=20=20=20=20=20=20=20DELETE=20FROM=20=
command_entities;=0A=20=20=20=20END=20IF;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteCommandEntitiesByCommandId(v_command_id=20UUID)=20RETURNS=20VOID=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20IF=20=
(fn_db_is_table_exists=20('command_entities'))=20THEN=0A=20=20=20=20=20=20=
=20=20DELETE=20FROM=20command_entities=20where=20command_id=20=3D=20=
v_command_id;=0A=20=20=20=20END=20IF;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteAllCommandEntitiesByCommandId(v_command_id=20UUID)=20RETURNS=20=
VOID=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20IF=20=
(fn_db_is_table_exists=20('command_entities'))=20THEN=0A=20=20=20=20=20=20=
=20=20DELETE=20FROM=20command_entities=20where=20command_id=20IN=20=
(SELECT=20command_id=20FROM=20GetAsyncTasksZombies());=0A=20=20=20=20END=20=
IF;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A=
/*************************************************************************=
***********************=0A=20The=20following=20are=20helper=20SP=20for=20=
taskcleaner=20utility=20and=20are=20not=20exposed=20to=20the=20=
application=20DAOs=0A/This=20script=20deals=20with=20command_entities=20=
related=20SP=0A=
**************************************************************************=
**********************/=0ACreate=20or=20replace=20FUNCTION=20=
GetAllCommandsWithRunningTasks()=20RETURNS=20SETOF=20COMMAND_ENTITIES=20=
STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20RETURN=20QUERY=20=
SELECT=20*=0A=20=20=20FROM=20COMMAND_ENTITIES=20C=0A=20=20=20WHERE=20=
EXISTS=20(SELECT=20*=20FROM=20ASYNC_TASKS=20A=20WHERE=20A.COMMAND_ID=20=3D=
=20C.COMMAND_ID);=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=20GetAllCommands()=0A=
RETURNS=20SETOF=20COMMAND_ENTITIES=20STABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=20FROM=20=
COMMAND_ENTITIES;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetAllCommandsWithZombieTasks()=0ARETURNS=20SETOF=20COMMAND_ENTITIES=20=
STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20RETURN=20QUERY=20=
SELECT=20*=0A=20=20=20FROM=20COMMAND_ENTITIES=20C=0A=20=20=20WHERE=20=
C.COMMAND_ID=20in=20(SELECT=20COMMAND_ID=20from=20=
GetAsyncTasksZombies());=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20DeleteAllCommands()=0A=
RETURNS=20integer=0A=20=20=20AS=20$procedure$=0ADECLARE=0Adeleted_rows=20=
int;=0ABEGIN=0A=20=20=20DELETE=20FROM=20COMMAND_ENTITIES;=0A=20=20=20GET=20=
DIAGNOSTICS=20deleted_rows=20=3D=20ROW_COUNT;=0A=20=20=20RETURN=20=
deleted_rows;=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
DeleteAllCommandsWithZombieTasks()=0ARETURNS=20integer=0A=20=20=20AS=20=
$procedure$=0ADECLARE=0Adeleted_rows=20int;=0ABEGIN=0A=20=20=20DELETE=20=
FROM=20COMMAND_ENTITIES=20C=0A=20=20=20WHERE=20C.COMMAND_ID=20in=20=
(SELECT=20COMMAND_ID=20from=20GetAsyncTasksZombies());=0A=20=20=20GET=20=
DIAGNOSTICS=20deleted_rows=20=3D=20ROW_COUNT;=0A=20=20=20RETURN=20=
deleted_rows;=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
DeleteAllCommandsWithRunningTasks()=0ARETURNS=20integer=0A=20=20=20AS=20=
$procedure$=0ADECLARE=0Adeleted_rows=20int;=0ABEGIN=0A=20=20=20DELETE=20=
FROM=20COMMAND_ENTITIES=20C=20WHERE=20C.COMMAND_ID=20in=20(SELECT=20*=20=
FROM=20ASYNC_TASKS=20A=20WHERE=20A.COMMAND_ID=20=3D=20C.COMMAND_ID);=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ASELECT=20=
DeleteAllCommandsWithZombieTasks();=0A**************************=0A=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=200=0A=0A*********=20QUERY=20**********=0A=
/*************************************************************************=
***********************=0ADrop=20stuff=20created=20by=20=
taskcleaner_sp.sql=0A=
**************************************************************************=
**********************/=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteAllCommands();=0A**************************=0A=0ADROP=20FUNCTION=0A=
*********=20QUERY=20**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteAllCommandsWithRunningTasks();=0A**************************=0A=0A=
DROP=20FUNCTION=0A*********=20QUERY=20**********=0ADROP=20FUNCTION=20IF=20=
EXISTS=20DeleteAllCommandsWithZombieTasks();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20DeleteAllEntitySnapshot();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20DeleteAllJobs();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteAsyncTaskByCommandId(v_command_id=20UUID);=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20DeleteAsyncTasksZombies();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteAsyncTaskZombiesByCommandId(v_command_id=20UUID);=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteAsyncTaskZombiesByTaskId(v_task_id=20UUID);=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteEntitySnapshotByTaskId(v_task_id=20UUID);=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteEntitySnapshotByZombieTaskId(v_task_id=20UUID);=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteEntitySnapshotZombies();=0A**************************=0A=0ADROP=20=
FUNCTION=0A*********=20QUERY=20**********=0ADROP=20FUNCTION=20IF=20=
EXISTS=20DeleteJobStepsByCommandId(v_command_id=20UUID);=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteJobStepsByTaskId(v_task_id=20UUID);=0A**************************=0A=
=0ADROP=20FUNCTION=0A*********=20QUERY=20**********=0ADROP=20FUNCTION=20=
IF=20EXISTS=20DeleteJobStepsByZombieCommandId(v_command_id=20UUID);=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20DeleteJobStepsZombies();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20GetAllCommands();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
GetAllCommandsWithRunningTasks();=0A**************************=0A=0ADROP=20=
FUNCTION=0A*********=20QUERY=20**********=0ADROP=20FUNCTION=20IF=20=
EXISTS=20GetAllCommandsWithZombieTasks();=0A**************************=0A=
=0ADROP=20FUNCTION=0A*********=20QUERY=20**********=0ADROP=20FUNCTION=20=
IF=20EXISTS=20GetAsyncTasksZombies();=0A**************************=0A=0A=
DROP=20FUNCTION=0A2016-08-18=2012:58:43=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
plugin.executeRaw:863=20execute-result:=20=
('/usr/share/ovirt-engine/setup/dbutils/taskcleaner.sh',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-u',=20'engine',=20'-s',=20'localhost',=20'-p',=20'5432',=20'-d',=20=
'engine',=20'-q',=20'-r',=20'-Z'),=20rc=3D0=0A2016-08-18=2012:58:43=20=
DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
plugin.execute:921=20execute-output:=20=
('/usr/share/ovirt-engine/setup/dbutils/taskcleaner.sh',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-u',=20'engine',=20'-s',=20'localhost',=20'-p',=20'5432',=20'-d',=20=
'engine',=20'-q',=20'-r',=20'-Z')=20stdout:=0A=20t=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
0=0A=0A=0A2016-08-18=2012:58:43=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
plugin.execute:926=20execute-output:=20=
('/usr/share/ovirt-engine/setup/dbutils/taskcleaner.sh',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-u',=20'engine',=20'-s',=20'localhost',=20'-p',=20'5432',=20'-d',=20=
'engine',=20'-q',=20'-r',=20'-Z')=20stderr:=0A=0A=0A2016-08-18=20=
12:58:43=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
plugin.executeRaw:813=20execute:=20=
('/usr/share/ovirt-engine/setup/dbutils/taskcleaner.sh',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-u',=20'engine',=20'-s',=20'localhost',=20'-p',=20'5432',=20'-d',=20=
'engine',=20'-q',=20'-R',=20'-z',=20'-A'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3D{'LANG':=20'en_US.UTF-8',=20'TERM':=20=
'xterm-256color',=20'SHELL':=20'/bin/bash',=20'MAIL':=20=
'/var/spool/mail/root',=20'SHLVL':=20'1',=20'PYTHONPATH':=20=
'/usr/share/ovirt-engine/setup/bin/..::',=20'HOSTNAME':=20=
'cultivar.grove.silverorange.com',=20'LS_COLORS':=20=
'rs=3D0:di=3D38;5;27:ln=3D38;5;51:mh=3D44;38;5;15:pi=3D40;38;5;11:so=3D38;=
5;13:do=3D38;5;5:bd=3D48;5;232;38;5;11:cd=3D48;5;232;38;5;3:or=3D48;5;232;=
38;5;9:mi=3D05;48;5;232;38;5;15:su=3D48;5;196;38;5;15:sg=3D48;5;11;38;5;16=
:ca=3D48;5;196;38;5;226:tw=3D48;5;10;38;5;16:ow=3D48;5;10;38;5;21:st=3D48;=
5;21;38;5;15:ex=3D38;5;34:*.tar=3D38;5;9:*.tgz=3D38;5;9:*.arc=3D38;5;9:*.a=
rj=3D38;5;9:*.taz=3D38;5;9:*.lha=3D38;5;9:*.lz4=3D38;5;9:*.lzh=3D38;5;9:*.=
lzma=3D38;5;9:*.tlz=3D38;5;9:*.txz=3D38;5;9:*.tzo=3D38;5;9:*.t7z=3D38;5;9:=
*.zip=3D38;5;9:*.z=3D38;5;9:*.Z=3D38;5;9:*.dz=3D38;5;9:*.gz=3D38;5;9:*.lrz=
=3D38;5;9:*.lz=3D38;5;9:*.lzo=3D38;5;9:*.xz=3D38;5;9:*.bz2=3D38;5;9:*.bz=3D=
38;5;9:*.tbz=3D38;5;9:*.tbz2=3D38;5;9:*.tz=3D38;5;9:*.deb=3D38;5;9:*.rpm=3D=
38;5;9:*.jar=3D38;5;9:*.war=3D38;5;9:*.ear=3D38;5;9:*.sar=3D38;5;9:*.rar=3D=
38;5;9:*.alz=3D38;5;9:*.ace=3D38;5;9:*.zoo=3D38;5;9:*.cpio=3D38;5;9:*.7z=3D=
38;5;9:*.rz=3D38;5;9:*.cab=3D38;5;9:*.jpg=3D38;5;13:*.jpeg=3D38;5;13:*.gif=
=3D38;5;13:*.bmp=3D38;5;13:*.pbm=3D38;5;13:*.pgm=3D38;5;13:*.ppm=3D38;5;13=
:*.tga=3D38;5;13:*.xbm=3D38;5;13:*.xpm=3D38;5;13:*.tif=3D38;5;13:*.tiff=3D=
38;5;13:*.png=3D38;5;13:*.svg=3D38;5;13:*.svgz=3D38;5;13:*.mng=3D38;5;13:*=
.pcx=3D38;5;13:*.mov=3D38;5;13:*.mpg=3D38;5;13:*.mpeg=3D38;5;13:*.m2v=3D38=
;5;13:*.mkv=3D38;5;13:*.webm=3D38;5;13:*.ogm=3D38;5;13:*.mp4=3D38;5;13:*.m=
4v=3D38;5;13:*.mp4v=3D38;5;13:*.vob=3D38;5;13:*.qt=3D38;5;13:*.nuv=3D38;5;=
13:*.wmv=3D38;5;13:*.asf=3D38;5;13:*.rm=3D38;5;13:*.rmvb=3D38;5;13:*.flc=3D=
38;5;13:*.avi=3D38;5;13:*.fli=3D38;5;13:*.flv=3D38;5;13:*.gl=3D38;5;13:*.d=
l=3D38;5;13:*.xcf=3D38;5;13:*.xwd=3D38;5;13:*.yuv=3D38;5;13:*.cgm=3D38;5;1=
3:*.emf=3D38;5;13:*.axv=3D38;5;13:*.anx=3D38;5;13:*.ogv=3D38;5;13:*.ogx=3D=
38;5;13:*.aac=3D38;5;45:*.au=3D38;5;45:*.flac=3D38;5;45:*.mid=3D38;5;45:*.=
midi=3D38;5;45:*.mka=3D38;5;45:*.mp3=3D38;5;45:*.mpc=3D38;5;45:*.ogg=3D38;=
5;45:*.ra=3D38;5;45:*.wav=3D38;5;45:*.axa=3D38;5;45:*.oga=3D38;5;45:*.spx=3D=
38;5;45:*.xspf=3D38;5;45:',=20'LESSOPEN':=20'||/usr/bin/lesspipe.sh=20=
%s',=20'HISTCONTROL':=20'ignoredups',=20'PWD':=20'/root',=20'LOGNAME':=20=
'root',=20'USER':=20'root',=20'OTOPI_LOGFILE':=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'HOME':=20'/root',=20'HISTSIZE':=20'1000',=20'XDG_SESSION_ID':=20=
'6',=20'OTOPI_EXECDIR':=20'/root',=20'DBFUNC_DB_PGPASSFILE':=20=
'/tmp/tmpGmniqO',=20'PATH':=20=
'/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin'}=0A=
*********=20QUERY=20**********=0Aselect=20exists=20(select=20*=20from=20=
information_schema.tables=20where=20table_schema=20=3D=20'public'=20and=20=
table_name=20=3D=20'command_entities');=0A**************************=0A=0A=
=20t=0A=0A*********=20QUERY=20**********=0A=
/*************************************************************************=
***********************=0A=20The=20following=20are=20helper=20SP=20for=20=
taskcleaner=20utility=20and=20are=20not=20exposed=20to=20the=20=
application=20DAOs=0A=0AIf=20you=20add=20a=20function=20here,=20drop=20=
it=20in=20taskcleaner_sp_drop.sql=0A=
**************************************************************************=
**********************/=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAsyncTasksZombies()=20RETURNS=20SETOF=20async_tasks=0A=20=20=20AS=20=
$procedure$=0ADECLARE=0A=20=20=20=20zombie_task_life=20varchar;=0A=20=20=20=
=20zombie_timestamptz=20timestamp=20with=20time=20zone;=0ABEGIN=0A=20=20=20=
zombie_task_life=20=3D=20option_value=20FROM=20vdc_options=20WHERE=20=
option_name=20=3D=20'AsyncTaskZombieTaskLifeInMinutes';=0A=20=20=20=
EXECUTE=20'SELECT=20now()=20-=20interval=20'''=20||=20zombie_task_life=20=
||=20'=20minute'''=20=20INTO=20zombie_timestamptz;=0A=0A=20=20=20RETURN=20=
QUERY=20SELECT=20*=0A=20=20=20FROM=20async_tasks=0A=20=20=20WHERE=20=
started_at=20<=20zombie_timestamptz=0A=20=20=20ORDER=20BY=20command_id;=0A=
=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteAsyncTaskZombiesByTaskId(v_task_id=20UUID)=20=
RETURNS=20VOID=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20IF=20=
EXISTS=20(SELECT=201=20FROM=20GetAsyncTasksZombies()=20WHERE=20task_id=20=
=3D=20v_task_id)=20THEN=0A=20=20=20=20=20=20=20=20PERFORM=20=
Deleteasync_tasks(v_task_id);=0A=20=20=20=20END=20IF;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteAsyncTaskZombiesByCommandId(v_command_id=20=
UUID)=20RETURNS=20VOID=0A=20=20=20AS=20$procedure$=0ADECLARE=0A=
deleted_rows=20int;=0Aroot_command_id_of_deleted_cmds=20UUID;=0ABEGIN=0A=20=
=20=20=20IF=20(fn_db_is_table_exists=20('command_entities'))=20THEN=0A=20=
=20=20=20=20=20=20=20DELETE=20FROM=20command_entities=20c=20WHERE=0A=20=20=
=20=20=20=20=20=20c.command_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=20command_id=20FROM=20GetAsyncTasksZombies()=20t=20WHERE=20=
t.command_id=20=3D=20v_command_id=0A=20=20=20=20=20=20=20=20);=0A=0A=20=20=
=20=20=20=20=20=20DELETE=20FROM=20command_entities=20c=20WHERE=0A=20=20=20=
=20=20=20=20=20c.command_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20root_command_id=20FROM=20GetAsyncTasksZombies()=20t=20WHERE=20=
t.root_command_id=20=3D=20v_command_id=0A=20=20=20=20=20=20=20=20);=0A=20=
=20=20=20END=20IF;=0A=0A=20=20=20=20DELETE=20FROM=20async_tasks=20WHERE=0A=
=20=20=20=20root_command_id=20IN=20(=0A=20=20=20=20=20=20=20=20SELECT=20=
root_command_id=20FROM=20GetAsyncTasksZombies()=20t=20WHERE=20=
t.root_command_id=20=3D=20v_command_id=0A=20=20=20=20);=0A=0A=20=20=20=20=
DELETE=20FROM=20async_tasks=20WHERE=0A=20=20=20=20root_command_id=20IN=20=
(=0A=20=20=20=20=20=20=20=20SELECT=20root_command_id=20FROM=20=
GetAsyncTasksZombies()=20t=20WHERE=20t.command_id=20=3D=20v_command_id=0A=
=20=20=20=20);=0A=0A=20=20=20=20PERFORM=20=
DeleteEntitySnapshotByCommandId(v_command_id);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteAsyncTaskByCommandId(v_command_id=20UUID)=20RETURNS=20VOID=0A=20=20=
=20AS=20$procedure$=0ADECLARE=0Adeleted_rows=20int;=0A=
root_command_id_of_deleted_cmds=20UUID;=0ABEGIN=0A=20=20=20=20=20=20=20=20=
DELETE=20FROM=20async_tasks=20WHERE=20command_id=20=3D=20v_command_id;=0A=
=20=20=20=20=20=20=20=20IF=20(fn_db_is_table_exists=20=
('command_entities'))=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20root_command_id=20=20into=20root_command_id_of_deleted_cmds=20=
FROM=20COMMAND_entities=20WHERE=20command_id=20=3D=20v_command_id;=0A=20=20=
=20=20=20=20=20=20=20=20=20=20DELETE=20FROM=20command_entities=20where=20=
command_id=20=3D=20v_command_id;=0A=20=20=20=20=20=20=20=20=20=20=20=20=
GET=20DIAGNOSTICS=20deleted_rows=20=3D=20ROW_COUNT;=0A=20=20=20=20=20=20=20=
=20=20=20=20=20IF=20deleted_rows=20>=200=20THEN=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20DELETE=20FROM=20command_entities=20C=20WHERE=20=
command_id=20=3D=20root_command_id_of_deleted_cmds=20AND=20NOT=20EXISTS=20=
(SELECT=20*=20from=20COMMAND_ENTITIES=20WHERE=20root_command_id=20=3D=20=
C.command_id);=0A=20=20=20=20=20=20=20=20=20=20=20=20END=20IF;=0A=20=20=20=
=20=20=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20PERFORM=20=
DeleteEntitySnapshotByCommandId(v_command_id);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteAsyncTasksZombies()=20RETURNS=20VOID=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20DELETE=20FROM=20async_tasks=20WHERE=20task_id=20in=20=
(SELECT=20task_id=20FROM=20GetAsyncTasksZombies());=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteJobStepsByTaskId(v_task_id=20UUID)=20RETURNS=20VOID=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20=20DELETE=20FROM=20step=20WHERE=20=
external_id=20=3D=20v_task_id;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteEntitySnapshotByZombieTaskId(v_task_id=20UUID)=20RETURNS=20VOID=0A=20=
=20=20AS=20$procedure$=0ADECLARE=0A=20=20=20=20v_command_id=20UUID;=0A=
BEGIN=0A=20=20=20=20v_command_id:=3Dcommand_id=20FROM=20=
GetAsyncTasksZombies()=20WHERE=20task_id=20=3D=20v_task_id;=0A=20=20=20=20=
DELETE=20FROM=20business_entity_snapshot=20WHERE=20command_id=20=3D=20=
v_command_id;=0A=20=20=20=20PERFORM=20=
DeleteCommandEntitiesByCommandId(v_command_id);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteEntitySnapshotByTaskId(v_task_id=20UUID)=20RETURNS=20VOID=0A=20=20=20=
AS=20$procedure$=0ADECLARE=0A=20=20=20=20v_command_id=20UUID;=0ABEGIN=0A=20=
=20=20=20v_command_id:=3Dcommand_id=20FROM=20async_tasks=20WHERE=20=
task_id=20=3D=20v_task_id;=0A=20=20=20=20DELETE=20FROM=20=
business_entity_snapshot=20WHERE=20command_id=20=3D=20v_command_id;=0A=20=
=20=20=20PERFORM=20DeleteCommandEntitiesByCommandId(v_command_id);=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteEntitySnapshotZombies()=20RETURNS=20VOID=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20DELETE=20FROM=20=
business_entity_snapshot=20WHERE=20command_id=20IN=20(SELECT=20=
command_id=20FROM=20GetAsyncTasksZombies());=0A=20=20=20=20PERFORM=20=
DeleteAllCommandEntitiesByCommandId(v_command_id);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteOrphanJobs()=20RETURNS=20VOID=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=
=20=20=20=20DELETE=20FROM=20job=20WHERE=20NOT=20EXISTS=20(SELECT=201=20=
from=20step=20where=20step.job_id=20=3D=20job.job_id);=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteJobStepsByZombieCommandId(v_command_id=20=
UUID)=20RETURNS=20VOID=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20=
DELETE=20FROM=20step=20WHERE=20step_id=20IN=20(SELECT=20step_id=20from=20=
GetAsyncTasksZombies()=20WHERE=20command_id=20=3D=20v_command_id);=0A=20=20=
=20=20PERFORM=20DeleteOrphanJobs();=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteJobStepsByCommandId(v_command_id=20UUID)=20RETURNS=20VOID=0A=20=20=20=
AS=20$procedure$=0ABEGIN=0A=20=20=20=20DELETE=20FROM=20step=20WHERE=20=
step_id=20IN=20(SELECT=20step_id=20from=20async_tasks=20WHERE=20=
command_id=20=3D=20v_command_id);=0A=20=20=20=20PERFORM=20=
DeleteOrphanJobs();=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteJobStepsZombies()=20=
RETURNS=20VOID=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20DELETE=20=
FROM=20step=20WHERE=20step_id=20IN=20(SELECT=20step_id=20FROM=20=
GetAsyncTasksZombies());=0A=20=20=20=20PERFORM=20DeleteOrphanJobs();=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteAllJobs()=20RETURNS=20VOID=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20=20DELETE=20FROM=20job;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteAllEntitySnapshot()=20RETURNS=20VOID=0A=20=20=20=
AS=20$procedure$=0ABEGIN=0A=20=20=20=20DELETE=20FROM=20=
business_entity_snapshot;=0A=20=20=20=20PERFORM=20=
DeleteAllCommandEntities();=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteEntitySnapshotByCommandId(v_command_id=20UUID)=20RETURNS=20VOID=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20DELETE=20FROM=20=
business_entity_snapshot=20where=20command_id=20=3D=20v_command_id;=0A=20=
=20=20=20PERFORM=20DeleteCommandEntitiesByCommandId(v_command_id);=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteAllCommandEntities()=20RETURNS=20VOID=0A=20=20=
=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20IF=20(fn_db_is_table_exists=20=
('command_entities'))=20THEN=0A=20=20=20=20=20=20=20=20DELETE=20FROM=20=
command_entities;=0A=20=20=20=20END=20IF;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteCommandEntitiesByCommandId(v_command_id=20UUID)=20RETURNS=20VOID=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20IF=20=
(fn_db_is_table_exists=20('command_entities'))=20THEN=0A=20=20=20=20=20=20=
=20=20DELETE=20FROM=20command_entities=20where=20command_id=20=3D=20=
v_command_id;=0A=20=20=20=20END=20IF;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteAllCommandEntitiesByCommandId(v_command_id=20UUID)=20RETURNS=20=
VOID=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20IF=20=
(fn_db_is_table_exists=20('command_entities'))=20THEN=0A=20=20=20=20=20=20=
=20=20DELETE=20FROM=20command_entities=20where=20command_id=20IN=20=
(SELECT=20command_id=20FROM=20GetAsyncTasksZombies());=0A=20=20=20=20END=20=
IF;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A=
/*************************************************************************=
***********************=0A=20The=20following=20are=20helper=20SP=20for=20=
taskcleaner=20utility=20and=20are=20not=20exposed=20to=20the=20=
application=20DAOs=0A/This=20script=20deals=20with=20command_entities=20=
related=20SP=0A=
**************************************************************************=
**********************/=0ACreate=20or=20replace=20FUNCTION=20=
GetAllCommandsWithRunningTasks()=20RETURNS=20SETOF=20COMMAND_ENTITIES=20=
STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20RETURN=20QUERY=20=
SELECT=20*=0A=20=20=20FROM=20COMMAND_ENTITIES=20C=0A=20=20=20WHERE=20=
EXISTS=20(SELECT=20*=20FROM=20ASYNC_TASKS=20A=20WHERE=20A.COMMAND_ID=20=3D=
=20C.COMMAND_ID);=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=20GetAllCommands()=0A=
RETURNS=20SETOF=20COMMAND_ENTITIES=20STABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=20FROM=20=
COMMAND_ENTITIES;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetAllCommandsWithZombieTasks()=0ARETURNS=20SETOF=20COMMAND_ENTITIES=20=
STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20RETURN=20QUERY=20=
SELECT=20*=0A=20=20=20FROM=20COMMAND_ENTITIES=20C=0A=20=20=20WHERE=20=
C.COMMAND_ID=20in=20(SELECT=20COMMAND_ID=20from=20=
GetAsyncTasksZombies());=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20DeleteAllCommands()=0A=
RETURNS=20integer=0A=20=20=20AS=20$procedure$=0ADECLARE=0Adeleted_rows=20=
int;=0ABEGIN=0A=20=20=20DELETE=20FROM=20COMMAND_ENTITIES;=0A=20=20=20GET=20=
DIAGNOSTICS=20deleted_rows=20=3D=20ROW_COUNT;=0A=20=20=20RETURN=20=
deleted_rows;=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
DeleteAllCommandsWithZombieTasks()=0ARETURNS=20integer=0A=20=20=20AS=20=
$procedure$=0ADECLARE=0Adeleted_rows=20int;=0ABEGIN=0A=20=20=20DELETE=20=
FROM=20COMMAND_ENTITIES=20C=0A=20=20=20WHERE=20C.COMMAND_ID=20in=20=
(SELECT=20COMMAND_ID=20from=20GetAsyncTasksZombies());=0A=20=20=20GET=20=
DIAGNOSTICS=20deleted_rows=20=3D=20ROW_COUNT;=0A=20=20=20RETURN=20=
deleted_rows;=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
DeleteAllCommandsWithRunningTasks()=0ARETURNS=20integer=0A=20=20=20AS=20=
$procedure$=0ADECLARE=0Adeleted_rows=20int;=0ABEGIN=0A=20=20=20DELETE=20=
FROM=20COMMAND_ENTITIES=20C=20WHERE=20C.COMMAND_ID=20in=20(SELECT=20*=20=
FROM=20ASYNC_TASKS=20A=20WHERE=20A.COMMAND_ID=20=3D=20C.COMMAND_ID);=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ASELECT=20=
DeleteAllJobs();=20SELECT=20DeleteAllEntitySnapshot();SELECT=20=
DeleteAsyncTasksZombies();=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0A=
/*************************************************************************=
***********************=0ADrop=20stuff=20created=20by=20=
taskcleaner_sp.sql=0A=
**************************************************************************=
**********************/=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteAllCommands();=0A**************************=0A=0ADROP=20FUNCTION=0A=
*********=20QUERY=20**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteAllCommandsWithRunningTasks();=0A**************************=0A=0A=
DROP=20FUNCTION=0A*********=20QUERY=20**********=0ADROP=20FUNCTION=20IF=20=
EXISTS=20DeleteAllCommandsWithZombieTasks();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20DeleteAllEntitySnapshot();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20DeleteAllJobs();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteAsyncTaskByCommandId(v_command_id=20UUID);=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20DeleteAsyncTasksZombies();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteAsyncTaskZombiesByCommandId(v_command_id=20UUID);=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteAsyncTaskZombiesByTaskId(v_task_id=20UUID);=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteEntitySnapshotByTaskId(v_task_id=20UUID);=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteEntitySnapshotByZombieTaskId(v_task_id=20UUID);=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteEntitySnapshotZombies();=0A**************************=0A=0ADROP=20=
FUNCTION=0A*********=20QUERY=20**********=0ADROP=20FUNCTION=20IF=20=
EXISTS=20DeleteJobStepsByCommandId(v_command_id=20UUID);=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
DeleteJobStepsByTaskId(v_task_id=20UUID);=0A**************************=0A=
=0ADROP=20FUNCTION=0A*********=20QUERY=20**********=0ADROP=20FUNCTION=20=
IF=20EXISTS=20DeleteJobStepsByZombieCommandId(v_command_id=20UUID);=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20DeleteJobStepsZombies();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20GetAllCommands();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
GetAllCommandsWithRunningTasks();=0A**************************=0A=0ADROP=20=
FUNCTION=0A*********=20QUERY=20**********=0ADROP=20FUNCTION=20IF=20=
EXISTS=20GetAllCommandsWithZombieTasks();=0A**************************=0A=
=0ADROP=20FUNCTION=0A*********=20QUERY=20**********=0ADROP=20FUNCTION=20=
IF=20EXISTS=20GetAsyncTasksZombies();=0A**************************=0A=0A=
DROP=20FUNCTION=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
plugin.executeRaw:863=20execute-result:=20=
('/usr/share/ovirt-engine/setup/dbutils/taskcleaner.sh',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-u',=20'engine',=20'-s',=20'localhost',=20'-p',=20'5432',=20'-d',=20=
'engine',=20'-q',=20'-R',=20'-z',=20'-A'),=20rc=3D0=0A2016-08-18=20=
12:58:44=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
plugin.execute:921=20execute-output:=20=
('/usr/share/ovirt-engine/setup/dbutils/taskcleaner.sh',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-u',=20'engine',=20'-s',=20'localhost',=20'-p',=20'5432',=20'-d',=20=
'engine',=20'-q',=20'-R',=20'-z',=20'-A')=20stdout:=0A=20t=0A=20=0A=0A=0A=
2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
plugin.execute:926=20execute-output:=20=
('/usr/share/ovirt-engine/setup/dbutils/taskcleaner.sh',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-u',=20'engine',=20'-s',=20'localhost',=20'-p',=20'5432',=20'-d',=20=
'engine',=20'-q',=20'-R',=20'-z',=20'-A')=20stderr:=0A=0A=0A2016-08-18=20=
12:58:44=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._rev=
iew_config=0A2016-08-18=2012:58:44=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.memcheck.Plugin._vali=
dateContinueLowMemory=0A2016-08-18=2012:58:44=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.dialog.preview.Plugin._customization=
=0A2016-08-18=2012:58:44=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=3D=3D=20CONFIGURATION=20=
PREVIEW=20=3D=3D--=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:44=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20Default=20=
SAN=20wipe=20after=20delete=20=20=20=20=20=20=20=20=20=20=20:=20False=0A=
2016-08-18=2012:58:44=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20Firewall=20manager=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20:=20firewalld=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20Update=20Firewall=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:=20=
True=0A2016-08-18=2012:58:44=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20Host=20FQDN=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20:=20=
cultivar.grove.silverorange.com=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20Engine=20database=20=
secured=20connection=20=20=20=20=20=20:=20False=0A2016-08-18=2012:58:44=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20Engine=20=
database=20host=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
:=20localhost=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20Engine=20database=20user=20=
name=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:=20engine=0A2016-08-18=20=
12:58:44=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20Engine=20database=20name=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20:=20engine=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20Engine=20database=20port=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:=205432=0A=
2016-08-18=2012:58:44=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20Engine=20database=20host=20name=20validation=20=20=20=20:=20=
False=0A2016-08-18=2012:58:44=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20DWH=20database=20secured=20connection=20=20=20=20=20=20=20=20=
=20:=20False=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20DWH=20database=20host=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:=20=
localhost=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20DWH=20database=20user=20=
name=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:=20=
ovirt_engine_history=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20DWH=20database=20name=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:=20=
ovirt_engine_history=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20DWH=20database=20port=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:=205432=0A=
2016-08-18=2012:58:44=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20DWH=20database=20host=20name=20validation=20=20=20=20=20=20=20=
:=20False=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20Engine=20installation=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:=20True=0A=
2016-08-18=2012:58:44=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20PKI=20organization=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20:=20grove.silverorange.com=0A2016-08-18=20=
12:58:44=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20DWH=20installation=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20:=20True=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20Backup=20DWH=20database=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:=20True=0A=
2016-08-18=2012:58:44=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20Engine=20Host=20FQDN=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20:=20cultivar.grove.silverorange.com=0A=
2016-08-18=2012:58:44=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20Configure=20Image=20I/O=20Proxy=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20:=20True=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20Configure=20VMConsole=20=
Proxy=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:=20True=0A2016-08-18=20=
12:58:44=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20Configure=20WebSocket=20Proxy=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20:=20True=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20human.queryString:145=20query=20=
OVESETUP_DIALOG_CONFIRM_SETTINGS=0A2016-08-18=2012:58:44=20DEBUG=20=
otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20DIALOG:SEND=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=0A2016-08-18=2012:58:44=20=
DEBUG=20otopi.plugins.otopi.dialog.human=20dialog.__logString:204=20=
DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20Please=20=
confirm=20installation=20settings=20(OK,=20Cancel)=20[OK]:=20=0A=
2016-08-18=2012:59:05=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:59:05=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DIALOG/confirmSettings=3Dbool:'True'=0A2016-08-18=2012:59:05=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:59:05=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._validatio=
n_late=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20select=20version,=20option_value=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20from=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20where=20option_name=20=3D=20%(name)s=0A=20=20=20=20=20=20=20=
=20=20=20=20=20',=20args:=20{'name':=20'AdminPassword'}=0A2016-08-18=20=
12:59:05=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:177=20Creating=20own=20connection=0A2016-08-18=20=
12:59:05=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:222=20Result:=20[]=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaakerbldap.Plugin._v=
alidation_late=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20select=20version,=20option_value=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20from=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20where=20option_name=20=3D=20%(name)s=0A=20=20=20=20=20=20=20=
=20=20=20=20=20',=20args:=20{'name':=20'DomainName'}=0A2016-08-18=20=
12:59:05=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:177=20Creating=20own=20connection=0A2016-08-18=20=
12:59:05=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:222=20Result:=20[{'version':=20'general',=20=
'option_value':=20''}]=0A2016-08-18=2012:59:05=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks.Plugin._v=
alidateAsyncTasks=0A2016-08-18=2012:59:05=20INFO=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
asynctasks._validateAsyncTasks:475=20Cleaning=20async=20tasks=20and=20=
compensations=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20select=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
async_tasks.action_type,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
async_tasks.task_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
async_tasks.started_at,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
storage_pool.name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20from=20=
async_tasks,=20storage_pool=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20where=20async_tasks.storage_pool_id=20=3D=20storage_pool.id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20',=20args:=20{}=0A2016-08-18=2012:59:05=20=
DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:177=20Creating=20own=20connection=0A2016-08-18=20=
12:59:05=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:222=20Result:=20[]=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20select=20relname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20from=20pg_class=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
where=20relname=20=3D=20'command_entities'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20',=20args:=20{}=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'relname':=20'command_entities'}]=0A2016-08-18=2012:59:05=20=
DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20select=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20command_entities.command_type,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20command_entities.command_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20command_entities.created_at,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20command_entities.status=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20from=20command_entities=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20where=20=
command_entities.callback_enabled=20=3D=20'true'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20and=20command_entities.callback_notified=20=
=3D=20'false'=0A=20=20=20=20=20=20=20=20=20=20=20=20',=20args:=20{}=0A=
2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[]=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20select=20command_type,=20entity_type=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20from=20business_entity_snapshot=0A=20=20=20=20=20=
=20=20=20=20=20=20=20',=20args:=20{}=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[]=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
asynctasks._setEngineMode:63=20Setting=20engine=20into=20MAINTENANCE=20=
mode=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20select=20count(*)=20as=20count=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20from=20vdc_options=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20where=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
option_name=3D%(name)s=20and=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20version=3D%(version)s=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20',=20args:=20{'version':=20'general',=20=
'name':=20'EngineMode'}=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'count':=201L}]=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20update=20vdc_options=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20set=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
option_value=3D%(value)s=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20where=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20option_name=3D%(name)s=20and=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20version=3D%(version)s=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20',=20args:=20{'version':=20'general',=20'name':=20=
'EngineMode',=20'value':=20'MAINTENANCE'}=0A2016-08-18=2012:59:05=20=
DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:177=20Creating=20own=20connection=0A2016-08-18=20=
12:59:05=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:222=20Result:=20[]=0A2016-08-18=2012:59:05=20INFO=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
asynctasks._validateAsyncTasks:513=20Unlocking=20existing=20entities=0A=
2016-08-18=2012:59:05=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
plugin.executeRaw:813=20execute:=20=
('/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh',=20'-t',=20=
'all',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-u',=20'engine',=20'-s',=20'localhost',=20'-p',=20'5432',=20'-d',=20=
'engine',=20'-i'),=20executable=3D'None',=20cwd=3D'None',=20env=3D{'LANG':=
=20'en_US.UTF-8',=20'TERM':=20'xterm-256color',=20'SHELL':=20=
'/bin/bash',=20'MAIL':=20'/var/spool/mail/root',=20'SHLVL':=20'1',=20=
'PYTHONPATH':=20'/usr/share/ovirt-engine/setup/bin/..::',=20'HOSTNAME':=20=
'cultivar.grove.silverorange.com',=20'LS_COLORS':=20=
'rs=3D0:di=3D38;5;27:ln=3D38;5;51:mh=3D44;38;5;15:pi=3D40;38;5;11:so=3D38;=
5;13:do=3D38;5;5:bd=3D48;5;232;38;5;11:cd=3D48;5;232;38;5;3:or=3D48;5;232;=
38;5;9:mi=3D05;48;5;232;38;5;15:su=3D48;5;196;38;5;15:sg=3D48;5;11;38;5;16=
:ca=3D48;5;196;38;5;226:tw=3D48;5;10;38;5;16:ow=3D48;5;10;38;5;21:st=3D48;=
5;21;38;5;15:ex=3D38;5;34:*.tar=3D38;5;9:*.tgz=3D38;5;9:*.arc=3D38;5;9:*.a=
rj=3D38;5;9:*.taz=3D38;5;9:*.lha=3D38;5;9:*.lz4=3D38;5;9:*.lzh=3D38;5;9:*.=
lzma=3D38;5;9:*.tlz=3D38;5;9:*.txz=3D38;5;9:*.tzo=3D38;5;9:*.t7z=3D38;5;9:=
*.zip=3D38;5;9:*.z=3D38;5;9:*.Z=3D38;5;9:*.dz=3D38;5;9:*.gz=3D38;5;9:*.lrz=
=3D38;5;9:*.lz=3D38;5;9:*.lzo=3D38;5;9:*.xz=3D38;5;9:*.bz2=3D38;5;9:*.bz=3D=
38;5;9:*.tbz=3D38;5;9:*.tbz2=3D38;5;9:*.tz=3D38;5;9:*.deb=3D38;5;9:*.rpm=3D=
38;5;9:*.jar=3D38;5;9:*.war=3D38;5;9:*.ear=3D38;5;9:*.sar=3D38;5;9:*.rar=3D=
38;5;9:*.alz=3D38;5;9:*.ace=3D38;5;9:*.zoo=3D38;5;9:*.cpio=3D38;5;9:*.7z=3D=
38;5;9:*.rz=3D38;5;9:*.cab=3D38;5;9:*.jpg=3D38;5;13:*.jpeg=3D38;5;13:*.gif=
=3D38;5;13:*.bmp=3D38;5;13:*.pbm=3D38;5;13:*.pgm=3D38;5;13:*.ppm=3D38;5;13=
:*.tga=3D38;5;13:*.xbm=3D38;5;13:*.xpm=3D38;5;13:*.tif=3D38;5;13:*.tiff=3D=
38;5;13:*.png=3D38;5;13:*.svg=3D38;5;13:*.svgz=3D38;5;13:*.mng=3D38;5;13:*=
.pcx=3D38;5;13:*.mov=3D38;5;13:*.mpg=3D38;5;13:*.mpeg=3D38;5;13:*.m2v=3D38=
;5;13:*.mkv=3D38;5;13:*.webm=3D38;5;13:*.ogm=3D38;5;13:*.mp4=3D38;5;13:*.m=
4v=3D38;5;13:*.mp4v=3D38;5;13:*.vob=3D38;5;13:*.qt=3D38;5;13:*.nuv=3D38;5;=
13:*.wmv=3D38;5;13:*.asf=3D38;5;13:*.rm=3D38;5;13:*.rmvb=3D38;5;13:*.flc=3D=
38;5;13:*.avi=3D38;5;13:*.fli=3D38;5;13:*.flv=3D38;5;13:*.gl=3D38;5;13:*.d=
l=3D38;5;13:*.xcf=3D38;5;13:*.xwd=3D38;5;13:*.yuv=3D38;5;13:*.cgm=3D38;5;1=
3:*.emf=3D38;5;13:*.axv=3D38;5;13:*.anx=3D38;5;13:*.ogv=3D38;5;13:*.ogx=3D=
38;5;13:*.aac=3D38;5;45:*.au=3D38;5;45:*.flac=3D38;5;45:*.mid=3D38;5;45:*.=
midi=3D38;5;45:*.mka=3D38;5;45:*.mp3=3D38;5;45:*.mpc=3D38;5;45:*.ogg=3D38;=
5;45:*.ra=3D38;5;45:*.wav=3D38;5;45:*.axa=3D38;5;45:*.oga=3D38;5;45:*.spx=3D=
38;5;45:*.xspf=3D38;5;45:',=20'LESSOPEN':=20'||/usr/bin/lesspipe.sh=20=
%s',=20'HISTCONTROL':=20'ignoredups',=20'PWD':=20'/root',=20'LOGNAME':=20=
'root',=20'USER':=20'root',=20'OTOPI_LOGFILE':=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'HOME':=20'/root',=20'HISTSIZE':=20'1000',=20'XDG_SESSION_ID':=20=
'6',=20'OTOPI_EXECDIR':=20'/root',=20'DBFUNC_DB_PGPASSFILE':=20=
'/tmp/tmpGmniqO',=20'PATH':=20=
'/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin'}=0A=
*********=20QUERY=20**********=0A=
/*************************************************************************=
***********************=0A=20The=20following=20are=20helper=20SP=20for=20=
unlock_entity.sh=20utility=20and=20are=20not=20exposed=20to=20the=20=
application=20DAOs=0A=0AIf=20you=20add=20a=20function=20here,=20drop=20=
it=20in=20unlock_entity_drop.sql=0A=
**************************************************************************=
**********************/=0A=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_unlock_all()=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0A=20=20=
=20=20DOWN=20integer;=0A=20=20=20=20OK=20integer;=0A=20=20=20=20LOCKED=20=
integer;=0A=20=20=20=20TEMPLATE_OK=20integer;=0A=20=20=20=20=
TEMPLATE_LOCKED=20integer;=0A=20=20=20=20IMAGE_LOCKED=20integer;=0A=20=20=
=20=20SNAPSHOT_OK=20varchar;=0A=20=20=20=20SNAPSHOT_LOCKED=20varchar;=0A=
BEGIN=0A=20=20=20=20DOWN:=3D0;=0A=20=20=20=20OK:=3D1;=0A=20=20=20=20=
LOCKED:=3D2;=0A=20=20=20=20TEMPLATE_OK:=3D0;=0A=20=20=20=20=
TEMPLATE_LOCKED:=3D1;=0A=20=20=20=20IMAGE_LOCKED:=3D15;=0A=20=20=20=20=
SNAPSHOT_OK:=3D'OK';=0A=20=20=20=20SNAPSHOT_LOCKED:=3D'LOCKED';=0A=20=20=20=
=20update=20vm_static=20set=20template_status=20=3D=20TEMPLATE_OK=20=
where=20template_status=20=3D=20TEMPLATE_LOCKED;=0A=20=20=20=20update=20=
vm_dynamic=20set=20status=20=3D=20DOWN=20where=20status=20=3D=20=
IMAGE_LOCKED;=0A=20=20=20=20update=20images=20set=20imagestatus=20=3D=20=
OK=20where=20imagestatus=20=3D=20LOCKED;=0A=20=20=20=20update=20=
snapshots=20set=20status=20=3D=20SNAPSHOT_OK=20where=20status=20ilike=20=
SNAPSHOT_LOCKED;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Aselect=20fn_db_unlock_all();=0A**************************=0A=
=0A=20=0A=0A*********=20QUERY=20**********=0A=
/*************************************************************************=
***********************=0ADrop=20the=20SPs=20created=20by=20=
unlock_entity.sql=0A=
**************************************************************************=
**********************/=0ADROP=20FUNCTION=20IF=20EXISTS=20=
fn_db_unlock_all();=0A**************************=0A=0ADROP=20FUNCTION=0A=
2016-08-18=2012:59:05=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
plugin.executeRaw:863=20execute-result:=20=
('/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh',=20'-t',=20=
'all',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-u',=20'engine',=20'-s',=20'localhost',=20'-p',=20'5432',=20'-d',=20=
'engine',=20'-i'),=20rc=3D0=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
plugin.execute:921=20execute-output:=20=
('/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh',=20'-t',=20=
'all',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-u',=20'engine',=20'-s',=20'localhost',=20'-p',=20'5432',=20'-d',=20=
'engine',=20'-i')=20stdout:=0Aselect=20fn_db_unlock_all();=0A=20=0A=0A=
unlock=20all=20=20completed=20successfully.=0A=0A2016-08-18=2012:59:05=20=
DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
plugin.execute:926=20execute-output:=20=
('/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh',=20'-t',=20=
'all',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-u',=20'engine',=20'-s',=20'localhost',=20'-p',=20'5432',=20'-d',=20=
'engine',=20'-i')=20stderr:=0A=0A=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.asynctasks=20=
asynctasks._setEngineMode:63=20Setting=20engine=20into=20ACTIVE=20mode=0A=
2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20select=20count(*)=20as=20count=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20from=20vdc_options=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20where=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
option_name=3D%(name)s=20and=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20version=3D%(version)s=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20',=20args:=20{'version':=20'general',=20=
'name':=20'EngineMode'}=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'count':=201L}]=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20update=20vdc_options=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20set=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
option_value=3D%(value)s=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20where=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20option_name=3D%(name)s=20and=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20version=3D%(version)s=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20',=20args:=20{'version':=20'general',=20'name':=20=
'EngineMode',=20'value':=20'ACTIVE'}=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[]=0A2016-08-18=2012:59:05=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dbvalidations.Plugin=
._validation=0A2016-08-18=2012:59:05=20INFO=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dbvalidations=20=
dbvalidations._validation:145=20Checking=20the=20Engine=20database=20=
consistency=0A2016-08-18=2012:59:05=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dbvalidations=20=
plugin.executeRaw:813=20execute:=20=
['/usr/share/ovirt-engine/setup/dbutils/validatedb.sh',=20=
'--user=3Dengine',=20'--host=3Dlocalhost',=20'--port=3D5432',=20=
'--database=3Dengine',=20=
'--log=3D/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g=
6ku.log'],=20executable=3D'None',=20cwd=3D'None',=20env=3D{'LANG':=20=
'en_US.UTF-8',=20'TERM':=20'xterm-256color',=20'SHELL':=20'/bin/bash',=20=
'MAIL':=20'/var/spool/mail/root',=20'SHLVL':=20'1',=20'PYTHONPATH':=20=
'/usr/share/ovirt-engine/setup/bin/..::',=20'HOSTNAME':=20=
'cultivar.grove.silverorange.com',=20'LS_COLORS':=20=
'rs=3D0:di=3D38;5;27:ln=3D38;5;51:mh=3D44;38;5;15:pi=3D40;38;5;11:so=3D38;=
5;13:do=3D38;5;5:bd=3D48;5;232;38;5;11:cd=3D48;5;232;38;5;3:or=3D48;5;232;=
38;5;9:mi=3D05;48;5;232;38;5;15:su=3D48;5;196;38;5;15:sg=3D48;5;11;38;5;16=
:ca=3D48;5;196;38;5;226:tw=3D48;5;10;38;5;16:ow=3D48;5;10;38;5;21:st=3D48;=
5;21;38;5;15:ex=3D38;5;34:*.tar=3D38;5;9:*.tgz=3D38;5;9:*.arc=3D38;5;9:*.a=
rj=3D38;5;9:*.taz=3D38;5;9:*.lha=3D38;5;9:*.lz4=3D38;5;9:*.lzh=3D38;5;9:*.=
lzma=3D38;5;9:*.tlz=3D38;5;9:*.txz=3D38;5;9:*.tzo=3D38;5;9:*.t7z=3D38;5;9:=
*.zip=3D38;5;9:*.z=3D38;5;9:*.Z=3D38;5;9:*.dz=3D38;5;9:*.gz=3D38;5;9:*.lrz=
=3D38;5;9:*.lz=3D38;5;9:*.lzo=3D38;5;9:*.xz=3D38;5;9:*.bz2=3D38;5;9:*.bz=3D=
38;5;9:*.tbz=3D38;5;9:*.tbz2=3D38;5;9:*.tz=3D38;5;9:*.deb=3D38;5;9:*.rpm=3D=
38;5;9:*.jar=3D38;5;9:*.war=3D38;5;9:*.ear=3D38;5;9:*.sar=3D38;5;9:*.rar=3D=
38;5;9:*.alz=3D38;5;9:*.ace=3D38;5;9:*.zoo=3D38;5;9:*.cpio=3D38;5;9:*.7z=3D=
38;5;9:*.rz=3D38;5;9:*.cab=3D38;5;9:*.jpg=3D38;5;13:*.jpeg=3D38;5;13:*.gif=
=3D38;5;13:*.bmp=3D38;5;13:*.pbm=3D38;5;13:*.pgm=3D38;5;13:*.ppm=3D38;5;13=
:*.tga=3D38;5;13:*.xbm=3D38;5;13:*.xpm=3D38;5;13:*.tif=3D38;5;13:*.tiff=3D=
38;5;13:*.png=3D38;5;13:*.svg=3D38;5;13:*.svgz=3D38;5;13:*.mng=3D38;5;13:*=
.pcx=3D38;5;13:*.mov=3D38;5;13:*.mpg=3D38;5;13:*.mpeg=3D38;5;13:*.m2v=3D38=
;5;13:*.mkv=3D38;5;13:*.webm=3D38;5;13:*.ogm=3D38;5;13:*.mp4=3D38;5;13:*.m=
4v=3D38;5;13:*.mp4v=3D38;5;13:*.vob=3D38;5;13:*.qt=3D38;5;13:*.nuv=3D38;5;=
13:*.wmv=3D38;5;13:*.asf=3D38;5;13:*.rm=3D38;5;13:*.rmvb=3D38;5;13:*.flc=3D=
38;5;13:*.avi=3D38;5;13:*.fli=3D38;5;13:*.flv=3D38;5;13:*.gl=3D38;5;13:*.d=
l=3D38;5;13:*.xcf=3D38;5;13:*.xwd=3D38;5;13:*.yuv=3D38;5;13:*.cgm=3D38;5;1=
3:*.emf=3D38;5;13:*.axv=3D38;5;13:*.anx=3D38;5;13:*.ogv=3D38;5;13:*.ogx=3D=
38;5;13:*.aac=3D38;5;45:*.au=3D38;5;45:*.flac=3D38;5;45:*.mid=3D38;5;45:*.=
midi=3D38;5;45:*.mka=3D38;5;45:*.mp3=3D38;5;45:*.mpc=3D38;5;45:*.ogg=3D38;=
5;45:*.ra=3D38;5;45:*.wav=3D38;5;45:*.axa=3D38;5;45:*.oga=3D38;5;45:*.spx=3D=
38;5;45:*.xspf=3D38;5;45:',=20'LESSOPEN':=20'||/usr/bin/lesspipe.sh=20=
%s',=20'HISTCONTROL':=20'ignoredups',=20'PWD':=20'/root',=20'LOGNAME':=20=
'root',=20'USER':=20'root',=20'OTOPI_LOGFILE':=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'HOME':=20'/root',=20'HISTSIZE':=20'1000',=20'XDG_SESSION_ID':=20=
'6',=20'OTOPI_EXECDIR':=20'/root',=20'DBFUNC_DB_PGPASSFILE':=20=
'/tmp/tmpGmniqO',=20'PATH':=20=
'/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin'}=0A=
*********=20QUERY=20**********=0ASET=20client_min_messages=3DERROR;=0A=
**************************=0A=0ASET=0A*********=20QUERY=20**********=0A=
DROP=20TYPE=20IF=20EXISTS=20fk_info_rs=20CASCADE;=0A=
**************************=0A=0ADROP=20TYPE=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
fn_db_validate_fks(boolean,boolean);=0A**************************=0A=0A=
DROP=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
fk_info_rs=20AS=0A=20=20=20=20(schema_name=20varchar,=20table_name=20=
varchar,=20table_col=20varchar,=20fk_table_name=20varchar,=20fk_col=20=
varchar,=20fk_violation=20varchar,=20fk_status=20integer);=0A=
**************************=0A=0ACREATE=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_validate_fks(v_fix_it=20boolean,=20v_verbose=20boolean)=0Areturns=20=
SETOF=20fk_info_rs=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20v_sql=20=
text;=0A=20=20=20=20v_msg=20text;=0A=20=20=20=20v_output=20text;=0A=20=20=
=20=20v_rowcount=20integer;=0A=20=20=20=20v_record=20fk_info_rs%ROWTYPE;=0A=
=20=20=20=20v_cur=20CURSOR=20FOR=0A=20=20=20=20SELECT=0A=20=20=20=20=20=20=
=20=20n.nspname=20as=20schema_name,=0A=20=20=20=20=20=20=20=20c.relname=20=
as=20table_name,=0A=20=20=20=20=20=20=20=20substring(substring=20=
((select=20pg_get_constraintdef(r.oid))=20from=20'[a-zA-Z0-9_,=20=
\-][(][a-zA-Z0-9_,=20\-]+[)]')=20from=202)=20as=20table_col,=0A=20=20=20=20=
=20=20=20=20c2.relname=20AS=20fk_table_name,=0A=20=20=20=20=20=20=20=20=
substring=20((select=20pg_get_constraintdef(r.oid))=20from=20'=20=
[(][a-zA-Z0-9_,=20\-]+[)]=20')=20as=20fk_col=0A=20=20=20=20FROM=20=
pg_class=20c,=20pg_class=20c2,=20pg_constraint=20r,=20=
pg_catalog.pg_namespace=20n=0A=20=20=20=20WHERE=20c.relname=20in=20=
(select=20table_name=20from=20information_schema.tables=0A=20=20=20=20=
where=20table_schema=20not=20in=20('pg_catalog','information_schema')=20=
and=20table_type=20=3D=20'BASE=20TABLE')=20AND=0A=20=20=20=20=20=20=20=20=
r.confrelid=20=3D=20c.oid=20AND=0A=20=20=20=20=20=20=20=20r.contype=20=3D=20=
'f'=20AND=0A=20=20=20=20=20=20=20=20c2.oid=20=3D=20r.conrelid=20AND=0A=20=
=20=20=20=20=20=20=20n.oid=20=3D=20c.relnamespace=20AND=0A=20=20=20=20=20=
=20=20=20pg_get_constraintdef(r.oid)=20not=20ilike=20'%ON=20DELETE=20SET=20=
%'=0A=20=20=20=20ORDER=20BY=20=20table_name;=0A=0ABEGIN=0A=20=20=20=20=
OPEN=20v_cur;=0A=20=20=20=20LOOP=0A=20=20=20=20=20=20=20=20FETCH=20v_cur=20=
INTO=20v_record;=0A=20=20=20=20=20=20=20=20EXIT=20WHEN=20NOT=20FOUND;=0A=20=
=20=20=20=20=20=20=20v_record.fk_violation=20:=3D=20'';=0A=20=20=20=20=20=
=20=20=20v_record.fk_status=20:=3D=200;=0A=20=20=20=20=20=20=20=20IF=20=
(v_fix_it)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
'delete=20from=20'=20||=20v_record.schema_name=20||=20'.'=20=20||=20=
v_record.fk_table_name=20||=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20'=20where=20'=20||=20v_record.fk_col=20||=20'IS=20=
NOT=20NULL=20and=20'=20=20||=20v_record.fk_col=20||=20'=20not=20in=20=
(select=20'=20||=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20trim(both=20'()'=20from=20v_record.table_col)=20||=20'=20=
from=20'=20||=20v_record.schema_name=20||=20'.'=20=20||=20=
v_record.table_name=20||=20');';=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_msg=20:=3D=20'Fixing=20violation/s=20found=20in=20'=20||=20=20=
v_record.fk_table_name=20;=0A=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=
=20=20=20=20=20=20=20v_sql=20:=3D=20'select=20'=20||=20=20=
v_record.fk_col=20||=20'=20from=20'=20||=20v_record.schema_name=20||=20=
'.'=20=20||=20v_record.fk_table_name=20||=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20'=20where=20'=20||=20v_record.fk_col=20=
||=20'IS=20NOT=20NULL=20and=20'=20||=20v_record.fk_col=20||=20'=20not=20=
in=20(select=20'=20||=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20trim(both=20'()'=20from=20v_record.table_col)=20||=20'=20=
from=20'=20||=20v_record.schema_name=20||=20'.'=20=20||=20=
v_record.table_name=20||=20');';=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_msg=20:=3D=20'Constraint=20violation=20found=20in=20=20'=20||=20=20=
v_record.fk_table_name=20||=20v_record.fk_col;=0A=20=20=20=20=20=20=20=20=
END=20IF;=0A=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=20=20=20=20=
=20=20GET=20DIAGNOSTICS=20v_rowcount=20=3D=20ROW_COUNT;=0A=20=20=20=20=20=
=20=20=20IF=20(v_rowcount=20>=200)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=
=20=20IF=20(v_verbose=20and=20not=20v_fix_it)=20THEN=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20v_record.fk_violation=20:=3D=20v_msg=20||=20=
E'\nPlease=20run=20the=20following=20SQL=20to=20get=20the=20'=20||=20=
v_rowcount=20||=20E'=20violated=20record/s:=20\n'=20||=20v_sql=20||=20=
E'\n';=0A=20=20=20=20=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20v_record.fk_violation=20:=3D=20v_msg;=0A=20=20=
=20=20=20=20=20=20=20=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20=20=20=20=
=20v_record.fk_status=20:=3D=201;=0A=20=20=20=20=20=20=20=20END=20IF;=0A=20=
=20=20=20=20=20=20=20RETURN=20NEXT=20v_record;=0A=0A=20=20=20=20END=20=
LOOP;=0A=20=20=20=20CLOSE=20v_cur;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0Acopy=20(=0A=09=09=09=09select=20fk_violation,=20=
fk_status=0A=09=09=09=09from=20fn_db_validate_fks(false,=200=20!=3D=200)=0A=
=09=09=09=09where=20fk_status=3D1=0A=09=09=09)=20to=20stdout=20with=20=
delimiter=20as=20'|';=0A**************************=0A=0A*********=20=
QUERY=20**********=0ADROP=20TYPE=20IF=20EXISTS=20fk_info_rs=20CASCADE;=0A=
**************************=0A=0ADROP=20TYPE=0A*********=20QUERY=20=
**********=0ADROP=20FUNCTION=20IF=20EXISTS=20=
fn_db_validate_fks(boolean,boolean);=0A**************************=0A=0A=
DROP=20FUNCTION=0A2016-08-18=2012:59:06=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dbvalidations=20=
plugin.executeRaw:863=20execute-result:=20=
['/usr/share/ovirt-engine/setup/dbutils/validatedb.sh',=20=
'--user=3Dengine',=20'--host=3Dlocalhost',=20'--port=3D5432',=20=
'--database=3Dengine',=20=
'--log=3D/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g=
6ku.log'],=20rc=3D0=0A2016-08-18=2012:59:06=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dbvalidations=20=
plugin.execute:921=20execute-output:=20=
['/usr/share/ovirt-engine/setup/dbutils/validatedb.sh',=20=
'--user=3Dengine',=20'--host=3Dlocalhost',=20'--port=3D5432',=20=
'--database=3Dengine',=20=
'--log=3D/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g=
6ku.log']=20stdout:=0A=0A=0A2016-08-18=2012:59:06=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dbvalidations=20=
plugin.execute:926=20execute-output:=20=
['/usr/share/ovirt-engine/setup/dbutils/validatedb.sh',=20=
'--user=3Dengine',=20'--host=3Dlocalhost',=20'--port=3D5432',=20=
'--database=3Dengine',=20=
'--log=3D/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g=
6ku.log']=20stderr:=0A=0A=0A2016-08-18=2012:59:06=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20validation=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaainternal.Plugin._v=
alidation=0A2016-08-18=2012:59:06=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:59:06=20=
INFO=20otopi.context=20context.runSequence:687=20Stage:=20Transaction=20=
setup=0A2016-08-18=2012:59:06=20DEBUG=20otopi.context=20=
context.runSequence:691=20STAGE=20transaction-prepare=0A2016-08-18=20=
12:59:06=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
transaction-prepare=20METHOD=20=
otopi.plugins.otopi.core.transaction.Plugin._main_prepare=0A2016-08-18=20=
12:59:06=20DEBUG=20otopi.transaction=20transaction._prepare:61=20=
preparing=20'Yum=20Transaction'=0ALoaded=20plugins:=20fastestmirror,=20=
versionlock=0A2016-08-18=2012:59:06=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'DWH=20Engine=20database=20=
Transaction'=0A2016-08-18=2012:59:06=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'Database=20Transaction'=0A=
2016-08-18=2012:59:06=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'Version=20Lock=20Transaction'=0A=
2016-08-18=2012:59:06=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'DWH=20database=20Transaction'=0A=
2016-08-18=2012:59:06=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20transaction-prepare=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.engine.Plugin._transac=
tionBegin=0A2016-08-18=2012:59:06=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.exists:73=20check=20if=20=
service=20ovirt-engine=20exists=0A2016-08-18=2012:59:06=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:59:06=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine.service'),=20rc=3D0=0A2016-08-18=2012:59:06=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine.service')=20stdout:=0ALoadState=3Dloaded=0A=0A2016-08-18=20=
12:59:06=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'LoadState',=20'ovirt-engine.service')=20stderr:=0A=0A=0A=
2016-08-18=2012:59:06=20INFO=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.engine=20=
engine._transactionBegin:105=20Stopping=20engine=20service=0A2016-08-18=20=
12:59:06=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
systemd.state:130=20stopping=20service=20ovirt-engine=0A2016-08-18=20=
12:59:06=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'stop',=20=
'ovirt-engine.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:59:16=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'stop',=20=
'ovirt-engine.service'),=20rc=3D0=0A2016-08-18=2012:59:16=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'stop',=20'ovirt-engine.service')=20=
stdout:=0A=0A=0A2016-08-18=2012:59:16=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'stop',=20'ovirt-engine.service')=20=
stderr:=0A=0A=0A2016-08-18=2012:59:16=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20transaction-prepare=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.fence_kdump_listener.P=
lugin._transactionBegin=0A2016-08-18=2012:59:16=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.exists:73=20check=20if=20=
service=20ovirt-fence-kdump-listener=20exists=0A2016-08-18=2012:59:16=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20=
execute:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-fence-kdump-listener.service'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2012:59:16=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-fence-kdump-listener.service'),=20rc=3D0=0A2016-08-18=2012:59:16=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-fence-kdump-listener.service')=20stdout:=0ALoadState=3Dloaded=0A=0A=
2016-08-18=2012:59:16=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'LoadState',=20'ovirt-fence-kdump-listener.service')=20stderr:=0A=
=0A=0A2016-08-18=2012:59:16=20INFO=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.core.fence_kdump_listener=20=
fence_kdump_listener._transactionBegin:63=20Stopping=20=
ovirt-fence-kdump-listener=20service=0A2016-08-18=2012:59:16=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.state:130=20stopping=20=
service=20ovirt-fence-kdump-listener=0A2016-08-18=2012:59:16=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'stop',=20'ovirt-fence-kdump-listener.service'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
12:59:16=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20'stop',=20=
'ovirt-fence-kdump-listener.service'),=20rc=3D0=0A2016-08-18=2012:59:16=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'stop',=20=
'ovirt-fence-kdump-listener.service')=20stdout:=0A=0A=0A2016-08-18=20=
12:59:16=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'stop',=20=
'ovirt-fence-kdump-listener.service')=20stderr:=0A=0A=0A2016-08-18=20=
12:59:16=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
transaction-prepare=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.core.service.Plugin._tr=
ansactionBegin=0A2016-08-18=2012:59:16=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.exists:73=20check=20if=20=
service=20ovirt-engine-dwhd=20exists=0A2016-08-18=2012:59:16=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine-dwhd.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:59:16=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine-dwhd.service'),=20rc=3D0=0A2016-08-18=2012:59:16=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine-dwhd.service')=20stdout:=0ALoadState=3Dloaded=0A=0A=
2016-08-18=2012:59:16=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'LoadState',=20'ovirt-engine-dwhd.service')=20stderr:=0A=0A=0A=
2016-08-18=2012:59:16=20INFO=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.core.service=20=
service._transactionBegin:62=20Stopping=20dwh=20service=0A2016-08-18=20=
12:59:16=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
systemd.state:130=20stopping=20service=20ovirt-engine-dwhd=0A2016-08-18=20=
12:59:16=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'stop',=20=
'ovirt-engine-dwhd.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'stop',=20=
'ovirt-engine-dwhd.service'),=20rc=3D0=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'stop',=20=
'ovirt-engine-dwhd.service')=20stdout:=0A=0A=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'stop',=20=
'ovirt-engine-dwhd.service')=20stderr:=0A=0A=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
transaction-prepare=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_imageio_proxy.core.Plugin._transac=
tionBegin=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.exists:73=20check=20if=20=
service=20ovirt-imageio-proxy=20exists=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-imageio-proxy.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-imageio-proxy.service'),=20rc=3D0=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-imageio-proxy.service')=20stdout:=0ALoadState=3Dloaded=0A=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'LoadState',=20'ovirt-imageio-proxy.service')=20stderr:=0A=0A=0A=
2016-08-18=2012:59:19=20INFO=20=
otopi.plugins.ovirt_engine_common.ovirt_imageio_proxy.core=20=
core._transactionBegin:71=20Stopping=20Image=20I/O=20Proxy=20service=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
systemd.state:130=20stopping=20service=20ovirt-imageio-proxy=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'stop',=20=
'ovirt-imageio-proxy.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'stop',=20=
'ovirt-imageio-proxy.service'),=20rc=3D0=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'stop',=20=
'ovirt-imageio-proxy.service')=20stdout:=0A=0A=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'stop',=20=
'ovirt-imageio-proxy.service')=20stderr:=0A=0A=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
transaction-prepare=20METHOD=20=
otopi.plugins.ovirt_engine_common.websocket_proxy.core.Plugin._transaction=
Begin=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.exists:73=20check=20if=20=
service=20ovirt-websocket-proxy=20exists=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-websocket-proxy.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-websocket-proxy.service'),=20rc=3D0=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-websocket-proxy.service')=20stdout:=0ALoadState=3Dloaded=0A=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'LoadState',=20'ovirt-websocket-proxy.service')=20stderr:=0A=0A=0A=
2016-08-18=2012:59:19=20INFO=20=
otopi.plugins.ovirt_engine_common.websocket_proxy.core=20=
core._transactionBegin:70=20Stopping=20websocket-proxy=20service=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
systemd.state:130=20stopping=20service=20ovirt-websocket-proxy=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'stop',=20=
'ovirt-websocket-proxy.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'stop',=20=
'ovirt-websocket-proxy.service'),=20rc=3D0=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'stop',=20=
'ovirt-websocket-proxy.service')=20stdout:=0A=0A=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'stop',=20=
'ovirt-websocket-proxy.service')=20stderr:=0A=0A=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
transaction-prepare=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.hostile_services.Plugin._tra=
nsaction_begin=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.exists:73=20check=20if=20=
service=20ovirt-engine-dwhd=20exists=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine-dwhd.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine-dwhd.service'),=20rc=3D0=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine-dwhd.service')=20stdout:=0ALoadState=3Dloaded=0A=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'LoadState',=20'ovirt-engine-dwhd.service')=20stderr:=0A=0A=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
systemd.status:90=20check=20service=20ovirt-engine-dwhd=20status=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'status',=20=
'ovirt-engine-dwhd.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'status',=20=
'ovirt-engine-dwhd.service'),=20rc=3D3=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'status',=20=
'ovirt-engine-dwhd.service')=20stdout:=0A=E2=97=8F=20=
ovirt-engine-dwhd.service=20-=20oVirt=20Engine=20Data=20Warehouse=0A=20=20=
=20Loaded:=20loaded=20=
(/usr/lib/systemd/system/ovirt-engine-dwhd.service;=20enabled;=20vendor=20=
preset:=20disabled)=0A=20=20=20Active:=20inactive=20(dead)=20since=20Thu=20=
2016-08-18=2012:59:19=20ADT;=20237ms=20ago=0A=20Main=20PID:=2010855=20=
(code=3Dexited,=20status=3D0/SUCCESS)=0A=0AAug=2018=2011:02:09=20=
cultivar.grove.silverorange.com=20systemd[1]:=20Starting=20oVirt=20=
Engine=20Data=20Warehouse...=0AAug=2018=2011:02:11=20=
cultivar.grove.silverorange.com=20systemd[1]:=20Started=20oVirt=20Engine=20=
Data=20Warehouse.=0AAug=2018=2012:59:16=20=
cultivar.grove.silverorange.com=20systemd[1]:=20Stopping=20oVirt=20=
Engine=20Data=20Warehouse...=0AAug=2018=2012:59:19=20=
cultivar.grove.silverorange.com=20systemd[1]:=20Stopped=20oVirt=20Engine=20=
Data=20Warehouse.=0A=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'status',=20=
'ovirt-engine-dwhd.service')=20stderr:=0A=0A=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20systemd.exists:73=20check=20=
if=20service=20ovirt-engine-notifier=20exists=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20=
execute:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine-notifier.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine-notifier.service'),=20rc=3D0=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'ovirt-engine-notifier.service')=20stdout:=0ALoadState=3Dloaded=0A=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'LoadState',=20'ovirt-engine-notifier.service')=20stderr:=0A=0A=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
systemd.status:90=20check=20service=20ovirt-engine-notifier=20status=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'status',=20=
'ovirt-engine-notifier.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'status',=20=
'ovirt-engine-notifier.service'),=20rc=3D3=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'status',=20=
'ovirt-engine-notifier.service')=20stdout:=0A=E2=97=8F=20=
ovirt-engine-notifier.service=20-=20oVirt=20Engine=20Notifier=0A=20=20=20=
Loaded:=20loaded=20=
(/usr/lib/systemd/system/ovirt-engine-notifier.service;=20disabled;=20=
vendor=20preset:=20disabled)=0A=20=20=20Active:=20inactive=20(dead)=0A=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'status',=20=
'ovirt-engine-notifier.service')=20stderr:=0A=0A=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
transaction-prepare=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.single_etl.Plugin._=
transactionBegin=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
select=20*=20from=20GetDwhHistoryTimekeepingByVarName(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20%(name)s=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20=20=20=20=20',=20args:=20{'name':=20=
'DwhCurrentlyRunning'}=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'var_value':=20'0',=20'var_datetime':=20None,=20'var_name':=20=
'DwhCurrentlyRunning'}]=0A2016-08-18=2012:59:19=20INFO=20otopi.context=20=
context.runSequence:687=20Stage:=20Misc=20configuration=0A2016-08-18=20=
12:59:19=20DEBUG=20otopi.context=20context.runSequence:691=20STAGE=20=
early_misc=0A2016-08-18=2012:59:19=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20early_misc=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._early_misc=0A2016-08-18=20=
12:59:19=20DEBUG=20otopi.transaction=20transaction._prepare:61=20=
preparing=20'Firewalld=20Transaction'=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.exists:73=20check=20if=20=
service=20iptables=20exists=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'iptables.service'),=20executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20'show',=20=
'-p',=20'LoadState',=20'iptables.service'),=20rc=3D0=0A2016-08-18=20=
12:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:921=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'LoadState',=20'iptables.service')=20stdout:=0A=
LoadState=3Dnot-found=0A=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'LoadState',=20=
'iptables.service')=20stderr:=0A=0A=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.state:130=20starting=20=
service=20firewalld=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'start',=20'firewalld.service'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
12:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20'start',=20=
'firewalld.service'),=20rc=3D0=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'start',=20'firewalld.service')=20=
stdout:=0A=0A=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'start',=20'firewalld.service')=20=
stderr:=0A=0A=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.startup:99=20set=20=
service=20firewalld=20startup=20to=20True=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20=
execute:=20('/bin/systemctl',=20'show',=20'-p',=20'Id',=20=
'firewalld.service'),=20executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A=
2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20'show',=20=
'-p',=20'Id',=20'firewalld.service'),=20rc=3D0=0A2016-08-18=2012:59:19=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'Id',=20=
'firewalld.service')=20stdout:=0AId=3Dfirewalld.service=0A=0A2016-08-18=20=
12:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'Id',=20'firewalld.service')=20stderr:=0A=0A=0A2016-08-18=20=
12:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'enable',=20=
u'firewalld.service'),=20executable=3D'None',=20cwd=3D'None',=20env=3DNone=
=0A2016-08-18=2012:59:19=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20'enable',=20=
u'firewalld.service'),=20rc=3D0=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'enable',=20u'firewalld.service')=20=
stdout:=0A=0A=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'enable',=20u'firewalld.service')=20=
stderr:=0A=0A=0A2016-08-18=2012:59:19=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.executeRaw:813=20execute:=20=
('/bin/firewall-cmd',=20'--list-all-zones'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2012:59:20=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.executeRaw:863=20=
execute-result:=20('/bin/firewall-cmd',=20'--list-all-zones'),=20rc=3D0=0A=
2016-08-18=2012:59:20=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.execute:921=20execute-output:=20('/bin/firewall-cmd',=20=
'--list-all-zones')=20stdout:=0Ablock=0A=20=20interfaces:=20=0A=20=20=
sources:=20=0A=20=20services:=20=0A=20=20ports:=20=0A=20=20masquerade:=20=
no=0A=20=20forward-ports:=20=0A=20=20icmp-blocks:=20=0A=20=20rich=20=
rules:=20=0A=09=0Admz=0A=20=20interfaces:=20=0A=20=20sources:=20=0A=20=20=
services:=20ssh=0A=20=20ports:=20=0A=20=20masquerade:=20no=0A=20=20=
forward-ports:=20=0A=20=20icmp-blocks:=20=0A=20=20rich=20rules:=20=0A=09=0A=
drop=0A=20=20interfaces:=20=0A=20=20sources:=20=0A=20=20services:=20=0A=20=
=20ports:=20=0A=20=20masquerade:=20no=0A=20=20forward-ports:=20=0A=20=20=
icmp-blocks:=20=0A=20=20rich=20rules:=20=0A=09=0Aexternal=0A=20=20=
interfaces:=20=0A=20=20sources:=20=0A=20=20services:=20ssh=0A=20=20=
ports:=20=0A=20=20masquerade:=20yes=0A=20=20forward-ports:=20=0A=20=20=
icmp-blocks:=20=0A=20=20rich=20rules:=20=0A=09=0Ahome=0A=20=20=
interfaces:=20=0A=20=20sources:=20=0A=20=20services:=20dhcpv6-client=20=
ipp-client=20mdns=20samba-client=20ssh=0A=20=20ports:=20=0A=20=20=
masquerade:=20no=0A=20=20forward-ports:=20=0A=20=20icmp-blocks:=20=0A=20=20=
rich=20rules:=20=0A=09=0Ainternal=0A=20=20interfaces:=20=0A=20=20=
sources:=20=0A=20=20services:=20dhcpv6-client=20ipp-client=20mdns=20=
samba-client=20ssh=0A=20=20ports:=20=0A=20=20masquerade:=20no=0A=20=20=
forward-ports:=20=0A=20=20icmp-blocks:=20=0A=20=20rich=20rules:=20=0A=09=0A=
public=20(default,=20active)=0A=20=20interfaces:=20eth0=0A=20=20sources:=20=
=0A=20=20services:=20dhcpv6-client=20ovirt-fence-kdump-listener=20=
ovirt-http=20ovirt-https=20ovirt-imageio-proxy=20ovirt-postgres=20=
ovirt-vmconsole-proxy=20ovirt-websocket-proxy=20ssh=0A=20=20ports:=20=0A=20=
=20masquerade:=20no=0A=20=20forward-ports:=20=0A=20=20icmp-blocks:=20=0A=20=
=20rich=20rules:=20=0A=09=0Atrusted=0A=20=20interfaces:=20=0A=20=20=
sources:=20=0A=20=20services:=20=0A=20=20ports:=20=0A=20=20masquerade:=20=
no=0A=20=20forward-ports:=20=0A=20=20icmp-blocks:=20=0A=20=20rich=20=
rules:=20=0A=09=0Awork=0A=20=20interfaces:=20=0A=20=20sources:=20=0A=20=20=
services:=20dhcpv6-client=20ipp-client=20ssh=0A=20=20ports:=20=0A=20=20=
masquerade:=20no=0A=20=20forward-ports:=20=0A=20=20icmp-blocks:=20=0A=20=20=
rich=20rules:=20=0A=09=0A=0A2016-08-18=2012:59:20=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.execute:926=20=
execute-output:=20('/bin/firewall-cmd',=20'--list-all-zones')=20stderr:=0A=
=0A=0A2016-08-18=2012:59:20=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20firewalld._early_misc:264=20=
zones_services=20=3D=20{u'work':=20[u'dhcpv6-client',=20u'ipp-client',=20=
u'ssh'],=20u'internal':=20[u'dhcpv6-client',=20u'ipp-client',=20u'mdns',=20=
u'samba-client',=20u'ssh'],=20u'external':=20[u'ssh'],=20u'home':=20=
[u'dhcpv6-client',=20u'ipp-client',=20u'mdns',=20u'samba-client',=20=
u'ssh'],=20u'dmz':=20[u'ssh'],=20u'public':=20[u'dhcpv6-client',=20=
u'ovirt-fence-kdump-listener',=20u'ovirt-http',=20u'ovirt-https',=20=
u'ovirt-imageio-proxy',=20u'ovirt-postgres',=20u'ovirt-vmconsole-proxy',=20=
u'ovirt-websocket-proxy',=20u'ssh']}=0A2016-08-18=2012:59:20=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20early_misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dbvalidations.Plugin=
._misc=0A2016-08-18=2012:59:20=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:59:20=20=
INFO=20otopi.context=20context.runSequence:687=20Stage:=20Package=20=
installation=0A2016-08-18=2012:59:20=20DEBUG=20otopi.context=20=
context.runSequence:691=20STAGE=20packages=0A2016-08-18=2012:59:20=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20packages=20=
METHOD=20otopi.plugins.otopi.network.iptables.Plugin._packages=0A=
2016-08-18=2012:59:20=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:59:20=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20packages=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages.P=
lugin.packages=0A2016-08-18=2012:59:20=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:59:20=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20packages=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.system.Plugin._pac=
kages=0A2016-08-18=2012:59:20=20DEBUG=20=
otopi.plugins.otopi.packagers.yumpackager=20yumpackager.verbose:76=20Yum=20=
queue=20package=20ovirt-vmconsole-proxy=20for=20install/update=0ALoading=20=
mirror=20speeds=20from=20cached=20hostfile=0A=20*=20base:=20=
less.cogeco.net=0A=20*=20epel:=20ca.mirror.babylon.network=0A=20*=20=
extras:=20mirror.its.dal.ca=0A=20*=20ovirt-4.0-epel:=20=
ca.mirror.babylon.network=0A=20*=20updates:=20centos.mirror.gtcomm.net=0A=
2016-08-18=2012:59:20=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20packages=20METHOD=20=
otopi.plugins.otopi.packagers.dnfpackager.Plugin._packages=0A2016-08-18=20=
12:59:20=20DEBUG=20otopi.context=20context._executeMethod:134=20=
condition=20False=0A2016-08-18=2012:59:20=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20packages=20METHOD=20=
otopi.plugins.otopi.packagers.yumpackager.Plugin._packages=0A2016-08-18=20=
12:59:20=20DEBUG=20otopi.plugins.otopi.packagers.yumpackager=20=
yumpackager.verbose:76=20Yum=20Building=20transaction=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.plugins.otopi.packagers.yumpackager=20=
yumpackager.verbose:76=20Yum=20Empty=20transaction=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.plugins.otopi.packagers.yumpackager=20=
yumpackager.verbose:76=20Yum=20Transaction=20Summary:=0A2016-08-18=20=
12:59:21=20INFO=20otopi.context=20context.runSequence:687=20Stage:=20=
Misc=20configuration=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.runSequence:691=20STAGE=20misc=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.config.jboss.Plugin._=
jboss=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.otopi.system.command.Plugin._misc=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.context=20context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20=
-=20BEGIN=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
COMMAND/ssh-keygen=3Dstr:'/bin/ssh-keygen'=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl.Plugin.=
_misc=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl=20=
plugin.executeRaw:813=20execute:=20('/sbin/sysctl',=20'-n',=20=
'kernel.shmmax'),=20executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A=
2016-08-18=2012:59:21=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl=20=
plugin.executeRaw:863=20execute-result:=20('/sbin/sysctl',=20'-n',=20=
'kernel.shmmax'),=20rc=3D0=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl=20=
plugin.execute:921=20execute-output:=20('/sbin/sysctl',=20'-n',=20=
'kernel.shmmax')=20stdout:=0A18446744073692774399=0A=0A2016-08-18=20=
12:59:21=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.system.sysctl=20=
plugin.execute:926=20execute-output:=20('/sbin/sysctl',=20'-n',=20=
'kernel.shmmax')=20stderr:=0A=0A=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._misc=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.transaction=20transaction._prepare:61=20=
preparing=20'File=20transaction=20for=20=
'/etc/firewalld/services/ovirt-postgres.xml''=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20file=20=
'/etc/firewalld/services/ovirt-postgres.xml'=20exists=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:189=20=
file=20'/etc/firewalld/services/ovirt-postgres.xml'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/firewalld/services/ovirt-https.xml''=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20file=20=
'/etc/firewalld/services/ovirt-https.xml'=20exists=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:189=20=
file=20'/etc/firewalld/services/ovirt-https.xml'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/firewalld/services/ovirt-fence-kdump-listener.xml''=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/firewalld/services/ovirt-fence-kdump-listener.xml'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/firewalld/services/ovirt-fence-kdump-listener.xml'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/firewalld/services/ovirt-imageio-proxy.xml''=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/firewalld/services/ovirt-imageio-proxy.xml'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/firewalld/services/ovirt-imageio-proxy.xml'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/firewalld/services/ovirt-websocket-proxy.xml''=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/firewalld/services/ovirt-websocket-proxy.xml'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/firewalld/services/ovirt-websocket-proxy.xml'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/firewalld/services/ovirt-http.xml''=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20file=20=
'/etc/firewalld/services/ovirt-http.xml'=20exists=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:189=20=
file=20'/etc/firewalld/services/ovirt-http.xml'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/firewalld/services/ovirt-vmconsole-proxy.xml''=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/firewalld/services/ovirt-vmconsole-proxy.xml'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/firewalld/services/ovirt-vmconsole-proxy.xml'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.otopi.network.iptables.Plugin._store_iptables=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.context=20context._executeMethod:134=20=
condition=20False=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.otopi.network.ssh.Plugin._append_key=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.context=20context._executeMethod:134=20=
condition=20False=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.otopi.system.clock.Plugin._set_clock=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.context=20context._executeMethod:134=20=
condition=20False=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.base.network.firewall_manager.Plugin._pre=
pare_examples=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-http.xml''=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine/firewalld/ovirt-http.xml'=20exists=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:189=20=
file=20'/etc/ovirt-engine/firewalld/ovirt-http.xml'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-https.xml''=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine/firewalld/ovirt-https.xml'=20exists=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:189=20=
file=20'/etc/ovirt-engine/firewalld/ovirt-https.xml'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-vmconsole-proxy.xml''=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/ovirt-engine/firewalld/ovirt-vmconsole-proxy.xml'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/firewalld/ovirt-vmconsole-proxy.xml'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-imageio-proxy.xml''=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/ovirt-engine/firewalld/ovirt-imageio-proxy.xml'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/firewalld/ovirt-imageio-proxy.xml'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-websocket-proxy.xml''=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/ovirt-engine/firewalld/ovirt-websocket-proxy.xml'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/firewalld/ovirt-websocket-proxy.xml'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-fence-kdump-listener.xml''=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine/firewalld/ovirt-fence-kdump-listener.xml'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/firewalld/ovirt-fence-kdump-listener.xml'=20already=20=
has=20content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-postgres.xml''=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/ovirt-engine/firewalld/ovirt-postgres.xml'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/firewalld/ovirt-postgres.xml'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-postgres.xml''=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/ovirt-engine/firewalld/ovirt-postgres.xml'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/firewalld/ovirt-postgres.xml'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/iptables.example''=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.filetransaction=20filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine/iptables.example'=20exists=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.filetransaction=20filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/iptables.example'=20already=20has=20content=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.engine.Plugin._misc=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/httpd/conf.d/z-ovirt-engine-proxy.conf''=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20file=20=
'/etc/httpd/conf.d/z-ovirt-engine-proxy.conf'=20exists=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:189=20=
file=20'/etc/httpd/conf.d/z-ovirt-engine-proxy.conf'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/needRestart=3Dbool:'True'=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.apache.root.Plugin._misc=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaainternal.Plugin._m=
isc=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.database.Plugin._misc=
=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-database.conf''=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/ovirt-engine/engine.conf.d/10-setup-database.conf'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-database.conf'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.dwh_database.Plugin._=
miscDWHConfig=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-dwh-database.conf''=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-dwh-database.conf'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-dwh-database.conf'=20already=20=
has=20content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.java.Plugin._misc=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.jboss.Plugin._misc=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-jboss.conf''=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/ovirt-engine/engine.conf.d/10-setup-jboss.conf'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-jboss.conf'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/notifier/notifier.conf.d/10-setup-jboss.conf''=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine/notifier/notifier.conf.d/10-setup-jboss.conf'=20=
exists=0A2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/notifier/notifier.conf.d/10-setup-jboss.conf'=20=
already=20has=20content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.protocols.Plugin._mis=
c=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-protocols.conf''=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/ovirt-engine/engine.conf.d/10-setup-protocols.conf'=20=
exists=0A2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-protocols.conf'=20already=20=
has=20content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.tools.Plugin._misc=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/isouploader.conf.d/10-engine-setup.conf''=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine/isouploader.conf.d/10-engine-setup.conf'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/isouploader.conf.d/10-engine-setup.conf'=20already=20=
has=20content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/imageuploader.conf.d/10-engine-setup.conf''=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine/imageuploader.conf.d/10-engine-setup.conf'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/imageuploader.conf.d/10-engine-setup.conf'=20already=20=
has=20content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/logcollector.conf.d/10-engine-setup.conf''=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine/logcollector.conf.d/10-engine-setup.conf'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/logcollector.conf.d/10-engine-setup.conf'=20already=20=
has=20content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.advertise_dwh.Plugin._g=
et_dwh_host=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
select=20*=20from=20GetDwhHistoryTimekeepingByVarName(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20%(name)s=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20=20=20=20=20',=20args:=20{'name':=20'dwhHostname'}=0A=
2016-08-18=2012:59:21=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'var_value':=20'cultivar.grove.silverorange.com',=20=
'var_datetime':=20None,=20'var_name':=20'dwhHostname'}]=0A2016-08-18=20=
12:59:21=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.core.advertise_dwh=20=
advertise_dwh._get_dwh_host:117=20DWH=20host=20is=20=
cultivar.grove.silverorange.com.=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._miscUpgrade=0A=
2016-08-18=2012:59:21=20INFO=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca=20=
ca._miscUpgrade:517=20Upgrading=20CA=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.transaction=20transaction._prepare:61=20preparing=20'File=20=
transaction=20for=20'/etc/pki/ovirt-engine/cacert.template''=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/pki/ovirt-engine/cacert.template'=20exists=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.filetransaction=20filetransaction.prepare:189=20file=20=
'/etc/pki/ovirt-engine/cacert.template'=20already=20has=20content=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/pki/ovirt-engine/cacert.conf''=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.filetransaction=20filetransaction.prepare:185=20file=20=
'/etc/pki/ovirt-engine/cacert.conf'=20exists=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.filetransaction=20filetransaction.prepare:189=20file=20=
'/etc/pki/ovirt-engine/cacert.conf'=20already=20has=20content=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/pki/ovirt-engine/cert.template''=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.filetransaction=20filetransaction.prepare:185=20file=20=
'/etc/pki/ovirt-engine/cert.template'=20exists=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.filetransaction=20filetransaction.prepare:189=20file=20=
'/etc/pki/ovirt-engine/cert.template'=20already=20has=20content=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/pki/ovirt-engine/cert.conf''=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.filetransaction=20filetransaction.prepare:185=20file=20=
'/etc/pki/ovirt-engine/cert.conf'=20exists=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.filetransaction=20filetransaction.prepare:189=20file=20=
'/etc/pki/ovirt-engine/cert.conf'=20already=20has=20content=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/pki/ovirt-engine/cert.conf''=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.transaction=20transaction.commit:147=20committing=20'File=20=
transaction=20for=20'/etc/pki/ovirt-engine/cert.template''=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/pki/ovirt-engine/cacert.conf''=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.transaction=20transaction.commit:147=20committing=20'File=20=
transaction=20for=20'/etc/pki/ovirt-engine/cacert.template''=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_FILE_GROUP/ca_pki=3Dlist:'[[]]'=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_LINES_GROUP/ca_pki=3Ddict:'{}'=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.provisioning.postgres.Plugin=
._misc=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._misc=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.answerfile_fixup.Plu=
gin._misc=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.upgrade.dwh.Plugin._misc_sto=
p_remote_dwh=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
select=20*=20from=20GetDwhHistoryTimekeepingByVarName(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20%(name)s=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20=20=20=20=20',=20args:=20{'name':=20'dwhHostname'}=0A=
2016-08-18=2012:59:21=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'var_value':=20'cultivar.grove.silverorange.com',=20=
'var_datetime':=20None,=20'var_name':=20'dwhHostname'}]=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'=0A=20=20=20=20=
=20=20=20=20=20=20=20=20select=20*=20from=20=
GetDwhHistoryTimekeepingByVarName(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20%(name)s=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
=20=20=20=20',=20args:=20{'name':=20'DwhCurrentlyRunning'}=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:177=20Creating=20own=20connection=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:222=20Result:=20[{'var_value':=20'0',=20'var_datetime':=20=
None,=20'var_name':=20'DwhCurrentlyRunning'}]=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.selinux.Plugin=
._misc=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/selinuxBooleans=3Dlist:'[{'state':=20'on',=20'boolean':=20=
'httpd_can_network_connect'}]'=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20=
END=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.ssl.Plugin._mi=
sc=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.config.Plugin._misc=
=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf''=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf'=20=
exists=0A2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf'=20=
already=20has=20content=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.transaction=20transaction._prepare:61=20preparing=20'File=20=
transaction=20for=20=
'/etc/ovirt-engine-dwh/examples/10-setup-dwh-database.conf''=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine-dwh/examples/10-setup-dwh-database.conf'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine-dwh/examples/10-setup-dwh-database.conf'=20already=20=
has=20content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_FILE_GROUP/ovirt_dwh_files=3Dlist:'[[]]'=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.scale.Plugin._misc=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-scale.conf''=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-scale.conf'=20=
exists=0A2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-scale.conf'=20=
already=20has=20content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_FILE_GROUP/ovirt_dwh_files=3Dlist:'[[],=20[]]'=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.provisioning.postgres.Pl=
ugin._misc=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._misc_c=
onfig=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-imageio-proxy/ovirt-imageio-proxy.conf''=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/ovirt-imageio-proxy/ovirt-imageio-proxy.conf'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-imageio-proxy/ovirt-imageio-proxy.conf'=20already=20has=20=
content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._mis=
cConfigVMConsoleHelper=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.transaction=20transaction._prepare:61=20preparing=20'File=20=
transaction=20for=20=
'/etc/ovirt-engine/ovirt-vmconsole-proxy-helper.conf.d/10-setup.conf''=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine/ovirt-vmconsole-proxy-helper.conf.d/10-setup.conf'=20=
exists=0A2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/ovirt-vmconsole-proxy-helper.conf.d/10-setup.conf'=20=
already=20has=20content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.config.Plugin._mis=
cConfigVMConsoleProxy=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.transaction=20transaction._prepare:61=20preparing=20'File=20=
transaction=20for=20=
'/etc/ovirt-vmconsole/ovirt-vmconsole-proxy/conf.d/20-ovirt-vmconsole-prox=
y-helper.conf''=0A2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/ovirt-vmconsole/ovirt-vmconsole-proxy/conf.d/20-ovirt-vmconsole-prox=
y-helper.conf'=20exists=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.filetransaction=20filetransaction.prepare:189=20file=20=
'/etc/ovirt-vmconsole/ovirt-vmconsole-proxy/conf.d/20-ovirt-vmconsole-prox=
y-helper.conf'=20already=20has=20content=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._misc_confi=
g=0A2016-08-18=2012:59:21=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/ovirt-websocket-proxy.conf.d/10-setup.conf''=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine/ovirt-websocket-proxy.conf.d/10-setup.conf'=20exists=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/ovirt-websocket-proxy.conf.d/10-setup.conf'=20already=20=
has=20content=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine.db.pgpass.Plugin._misc=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/pgPassFile=3Dstr:'/tmp/tmpZ8kHN0'=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.pgpass.Plugin._misc=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/pgPassFile=3Dstr:'/tmp/tmp8s8Ayx'=0A2016-08-18=20=
12:59:21=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin._misc=0A=
2016-08-18=2012:59:21=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2012:59:21=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema.Plugin._misc=0A=
2016-08-18=2012:59:21=20INFO=20=
otopi.ovirt_engine_setup.engine_common.database=20database.backup:606=20=
Backing=20up=20database=20localhost:engine=20to=20=
'/var/lib/ovirt-engine/backups/engine-20160818125921.8Qh_1c.dump'.=0A=
2016-08-18=2012:59:21=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema=20=
plugin.executePipeRaw:481=20executePipeRaw:=20[0]=20popen=20kw=3D{'stdin':=
=20None,=20'stdout':=20-1,=20'preexec_fn':=20<function=20_enableSignals=20=
at=200x29cf938>,=20'env':=20{'LANG':=20'en_US.UTF-8',=20'PGPASSFILE':=20=
'/tmp/tmpZ8kHN0',=20'TERM':=20'xterm-256color',=20'SHELL':=20=
'/bin/bash',=20'MAIL':=20'/var/spool/mail/root',=20'SHLVL':=20'1',=20=
'PYTHONPATH':=20'/usr/share/ovirt-engine/setup/bin/..::',=20'HOSTNAME':=20=
'cultivar.grove.silverorange.com',=20'LS_COLORS':=20=
'rs=3D0:di=3D38;5;27:ln=3D38;5;51:mh=3D44;38;5;15:pi=3D40;38;5;11:so=3D38;=
5;13:do=3D38;5;5:bd=3D48;5;232;38;5;11:cd=3D48;5;232;38;5;3:or=3D48;5;232;=
38;5;9:mi=3D05;48;5;232;38;5;15:su=3D48;5;196;38;5;15:sg=3D48;5;11;38;5;16=
:ca=3D48;5;196;38;5;226:tw=3D48;5;10;38;5;16:ow=3D48;5;10;38;5;21:st=3D48;=
5;21;38;5;15:ex=3D38;5;34:*.tar=3D38;5;9:*.tgz=3D38;5;9:*.arc=3D38;5;9:*.a=
rj=3D38;5;9:*.taz=3D38;5;9:*.lha=3D38;5;9:*.lz4=3D38;5;9:*.lzh=3D38;5;9:*.=
lzma=3D38;5;9:*.tlz=3D38;5;9:*.txz=3D38;5;9:*.tzo=3D38;5;9:*.t7z=3D38;5;9:=
*.zip=3D38;5;9:*.z=3D38;5;9:*.Z=3D38;5;9:*.dz=3D38;5;9:*.gz=3D38;5;9:*.lrz=
=3D38;5;9:*.lz=3D38;5;9:*.lzo=3D38;5;9:*.xz=3D38;5;9:*.bz2=3D38;5;9:*.bz=3D=
38;5;9:*.tbz=3D38;5;9:*.tbz2=3D38;5;9:*.tz=3D38;5;9:*.deb=3D38;5;9:*.rpm=3D=
38;5;9:*.jar=3D38;5;9:*.war=3D38;5;9:*.ear=3D38;5;9:*.sar=3D38;5;9:*.rar=3D=
38;5;9:*.alz=3D38;5;9:*.ace=3D38;5;9:*.zoo=3D38;5;9:*.cpio=3D38;5;9:*.7z=3D=
38;5;9:*.rz=3D38;5;9:*.cab=3D38;5;9:*.jpg=3D38;5;13:*.jpeg=3D38;5;13:*.gif=
=3D38;5;13:*.bmp=3D38;5;13:*.pbm=3D38;5;13:*.pgm=3D38;5;13:*.ppm=3D38;5;13=
:*.tga=3D38;5;13:*.xbm=3D38;5;13:*.xpm=3D38;5;13:*.tif=3D38;5;13:*.tiff=3D=
38;5;13:*.png=3D38;5;13:*.svg=3D38;5;13:*.svgz=3D38;5;13:*.mng=3D38;5;13:*=
.pcx=3D38;5;13:*.mov=3D38;5;13:*.mpg=3D38;5;13:*.mpeg=3D38;5;13:*.m2v=3D38=
;5;13:*.mkv=3D38;5;13:*.webm=3D38;5;13:*.ogm=3D38;5;13:*.mp4=3D38;5;13:*.m=
4v=3D38;5;13:*.mp4v=3D38;5;13:*.vob=3D38;5;13:*.qt=3D38;5;13:*.nuv=3D38;5;=
13:*.wmv=3D38;5;13:*.asf=3D38;5;13:*.rm=3D38;5;13:*.rmvb=3D38;5;13:*.flc=3D=
38;5;13:*.avi=3D38;5;13:*.fli=3D38;5;13:*.flv=3D38;5;13:*.gl=3D38;5;13:*.d=
l=3D38;5;13:*.xcf=3D38;5;13:*.xwd=3D38;5;13:*.yuv=3D38;5;13:*.cgm=3D38;5;1=
3:*.emf=3D38;5;13:*.axv=3D38;5;13:*.anx=3D38;5;13:*.ogv=3D38;5;13:*.ogx=3D=
38;5;13:*.aac=3D38;5;45:*.au=3D38;5;45:*.flac=3D38;5;45:*.mid=3D38;5;45:*.=
midi=3D38;5;45:*.mka=3D38;5;45:*.mp3=3D38;5;45:*.mpc=3D38;5;45:*.ogg=3D38;=
5;45:*.ra=3D38;5;45:*.wav=3D38;5;45:*.axa=3D38;5;45:*.oga=3D38;5;45:*.spx=3D=
38;5;45:*.xspf=3D38;5;45:',=20'PGPASSWORD':=20'',=20'LESSOPEN':=20=
'||/usr/bin/lesspipe.sh=20%s',=20'HISTCONTROL':=20'ignoredups',=20'PWD':=20=
'/root',=20'LOGNAME':=20'root',=20'USER':=20'root',=20'OTOPI_LOGFILE':=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'HOME':=20'/root',=20'HISTSIZE':=20'1000',=20'XDG_SESSION_ID':=20=
'6',=20'OTOPI_EXECDIR':=20'/root',=20'PATH':=20=
'/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin'},=
=20'close_fds':=20True,=20'args':=20['/bin/pg_dump',=20'-E',=20'UTF8',=20=
'--disable-dollar-quoting',=20'--disable-triggers',=20'-U',=20'engine',=20=
'-h',=20'localhost',=20'-p',=20'5432',=20'--format=3Dcustom',=20=
'--file=3D/var/lib/ovirt-engine/backups/engine-20160818125921.8Qh_1c.dump'=
,=20'engine'],=20'stderr':=20-1}=0A2016-08-18=2012:59:21=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema=20=
plugin.executePipeRaw:486=20executePipeRaw:=20[0]=20pid=20pid=3D18506=0A=
2016-08-18=2012:59:23=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema=20=
plugin.executePipeRaw:603=20executePipe-result:=20[0]=20['/bin/pg_dump',=20=
'-E',=20'UTF8',=20'--disable-dollar-quoting',=20'--disable-triggers',=20=
'-U',=20'engine',=20'-h',=20'localhost',=20'-p',=20'5432',=20=
'--format=3Dcustom',=20=
'--file=3D/var/lib/ovirt-engine/backups/engine-20160818125921.8Qh_1c.dump'=
,=20'engine'],=20rc=3D0=0A2016-08-18=2012:59:23=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.backup:654=20=
db=20backup=20res=20{'result':=20[{'stderr':=20'',=20'rc':=200}],=20=
'stdout':=20''}=0A2016-08-18=2012:59:23=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'Engine=20schema=20Transaction'=0A=
2016-08-18=2012:59:23=20INFO=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema=20=
schema._misc:263=20Creating/refreshing=20Engine=20database=20schema=0A=
2016-08-18=2012:59:23=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema=20=
plugin.executeRaw:813=20execute:=20=
['/usr/share/ovirt-engine/dbscripts/schema.sh',=20'-s',=20'localhost',=20=
'-p',=20'5432',=20'-u',=20'engine',=20'-d',=20'engine',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-c',=20'apply'],=20executable=3D'None',=20cwd=3D'None',=20=
env=3D{'LANG':=20'en_US.UTF-8',=20'TERM':=20'xterm-256color',=20'SHELL':=20=
'/bin/bash',=20'MAIL':=20'/var/spool/mail/root',=20'SHLVL':=20'1',=20=
'PYTHONPATH':=20'/usr/share/ovirt-engine/setup/bin/..::',=20'HOSTNAME':=20=
'cultivar.grove.silverorange.com',=20'LS_COLORS':=20=
'rs=3D0:di=3D38;5;27:ln=3D38;5;51:mh=3D44;38;5;15:pi=3D40;38;5;11:so=3D38;=
5;13:do=3D38;5;5:bd=3D48;5;232;38;5;11:cd=3D48;5;232;38;5;3:or=3D48;5;232;=
38;5;9:mi=3D05;48;5;232;38;5;15:su=3D48;5;196;38;5;15:sg=3D48;5;11;38;5;16=
:ca=3D48;5;196;38;5;226:tw=3D48;5;10;38;5;16:ow=3D48;5;10;38;5;21:st=3D48;=
5;21;38;5;15:ex=3D38;5;34:*.tar=3D38;5;9:*.tgz=3D38;5;9:*.arc=3D38;5;9:*.a=
rj=3D38;5;9:*.taz=3D38;5;9:*.lha=3D38;5;9:*.lz4=3D38;5;9:*.lzh=3D38;5;9:*.=
lzma=3D38;5;9:*.tlz=3D38;5;9:*.txz=3D38;5;9:*.tzo=3D38;5;9:*.t7z=3D38;5;9:=
*.zip=3D38;5;9:*.z=3D38;5;9:*.Z=3D38;5;9:*.dz=3D38;5;9:*.gz=3D38;5;9:*.lrz=
=3D38;5;9:*.lz=3D38;5;9:*.lzo=3D38;5;9:*.xz=3D38;5;9:*.bz2=3D38;5;9:*.bz=3D=
38;5;9:*.tbz=3D38;5;9:*.tbz2=3D38;5;9:*.tz=3D38;5;9:*.deb=3D38;5;9:*.rpm=3D=
38;5;9:*.jar=3D38;5;9:*.war=3D38;5;9:*.ear=3D38;5;9:*.sar=3D38;5;9:*.rar=3D=
38;5;9:*.alz=3D38;5;9:*.ace=3D38;5;9:*.zoo=3D38;5;9:*.cpio=3D38;5;9:*.7z=3D=
38;5;9:*.rz=3D38;5;9:*.cab=3D38;5;9:*.jpg=3D38;5;13:*.jpeg=3D38;5;13:*.gif=
=3D38;5;13:*.bmp=3D38;5;13:*.pbm=3D38;5;13:*.pgm=3D38;5;13:*.ppm=3D38;5;13=
:*.tga=3D38;5;13:*.xbm=3D38;5;13:*.xpm=3D38;5;13:*.tif=3D38;5;13:*.tiff=3D=
38;5;13:*.png=3D38;5;13:*.svg=3D38;5;13:*.svgz=3D38;5;13:*.mng=3D38;5;13:*=
.pcx=3D38;5;13:*.mov=3D38;5;13:*.mpg=3D38;5;13:*.mpeg=3D38;5;13:*.m2v=3D38=
;5;13:*.mkv=3D38;5;13:*.webm=3D38;5;13:*.ogm=3D38;5;13:*.mp4=3D38;5;13:*.m=
4v=3D38;5;13:*.mp4v=3D38;5;13:*.vob=3D38;5;13:*.qt=3D38;5;13:*.nuv=3D38;5;=
13:*.wmv=3D38;5;13:*.asf=3D38;5;13:*.rm=3D38;5;13:*.rmvb=3D38;5;13:*.flc=3D=
38;5;13:*.avi=3D38;5;13:*.fli=3D38;5;13:*.flv=3D38;5;13:*.gl=3D38;5;13:*.d=
l=3D38;5;13:*.xcf=3D38;5;13:*.xwd=3D38;5;13:*.yuv=3D38;5;13:*.cgm=3D38;5;1=
3:*.emf=3D38;5;13:*.axv=3D38;5;13:*.anx=3D38;5;13:*.ogv=3D38;5;13:*.ogx=3D=
38;5;13:*.aac=3D38;5;45:*.au=3D38;5;45:*.flac=3D38;5;45:*.mid=3D38;5;45:*.=
midi=3D38;5;45:*.mka=3D38;5;45:*.mp3=3D38;5;45:*.mpc=3D38;5;45:*.ogg=3D38;=
5;45:*.ra=3D38;5;45:*.wav=3D38;5;45:*.axa=3D38;5;45:*.oga=3D38;5;45:*.spx=3D=
38;5;45:*.xspf=3D38;5;45:',=20'LESSOPEN':=20'||/usr/bin/lesspipe.sh=20=
%s',=20'HISTCONTROL':=20'ignoredups',=20'PWD':=20'/root',=20'LOGNAME':=20=
'root',=20'USER':=20'root',=20'OTOPI_LOGFILE':=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'HOME':=20'/root',=20'HISTSIZE':=20'1000',=20'XDG_SESSION_ID':=20=
'6',=20'OTOPI_EXECDIR':=20'/root',=20'DBFUNC_DB_PGPASSFILE':=20=
'/tmp/tmpZ8kHN0',=20'PATH':=20=
'/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin'}=0A=
*********=20QUERY=20**********=0Aselect=201;=0A=
**************************=0A=0A=20=20=20=20=20=20=20=201=0A=0A*********=20=
QUERY=20**********=0Acopy=20(=0A=09=09select=20count(*)=20as=20count=0A=09=
=09from=20pg_catalog.pg_tables=0A=09=09where=0A=09=09=09tablename=20=3D=20=
'schema_version'=20and=0A=09=09=09schemaname=20=3D=20'public'=0A=09)=20=
to=20stdout=20with=20delimiter=20as=20'|';=0A**************************=0A=
=0A*********=20QUERY=20**********=0Aselect=203050000;=0A=
**************************=0A=0A=20=203050000=0A=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_add_column=20(=0A=20=
=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=20v_column=20VARCHAR(128),=0A=
=20=20=20=20v_column_def=20TEXT=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20=
ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20column_name=20ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20=
||=20v_table=20||=20'=20ADD=20COLUMN=20'=20||=20v_column=20||=20'=20'=20=
||=20v_column_def;=0A=0A=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=
=20=20END;=0AEND=0A=0AIF=20;END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_drop_column=20(=0A=20=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=20=
v_column=20VARCHAR(128)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20=
v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20column_name=20ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20=
v_table=20||=20'=20DROP=20COLUMN=20'=20||=20v_column;=0A=0A=20=20=20=20=20=
=20=20=20EXECUTE=20v_sql;=0A=20=20=20=20END;=0A=20=20=20=20ELSE=0A=20=20=20=
=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20Column=20%=20does=20=
not=20exist.',=0A=20=20=20=20=20=20=20=20=20=20=20=20v_table,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_column;=0A=20=20=20=20END=20IF;=0A=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_change_column_type=20(=0A=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20v_column=20VARCHAR(128),=0A=20=20=20=20=
v_type=20VARCHAR(128),=0A=20=20=20=20v_new_type=20VARCHAR(128)=0A=20=20=20=
=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0A=
BEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20information_schema.columns=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20table_schema=20=3D=
=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20table_name=20ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20column_name=20ilike=20v_column=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20udt_name=20=
ilike=20v_type=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20OR=20data_type=20ilike=20v_type=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20=
THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20ALTER=20COLUMN=20'=20||=20v_column=20=
||=20'=20TYPE=20'=20||=20v_new_type;=0A=0A=20=20=20=20=20=20=20=20=
EXECUTE=20v_sql;=0A=20=20=20=20END;=0A=0A=20=20=20=20---=20ignore=20=
operation=20if=20requested=20type=20is=20already=20there=0A=20=20=20=20=
ELSIF(NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20v_table=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20column_name=20=
ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20udt_name=20ilike=20v_new_type=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20data_type=20ilike=20=
v_new_type=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20))=20=
THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20RAISE=20=
EXCEPTION=20'Table=20%=20or=20Column=20%=20does=20not=20exist.',=20=
v_table,=20v_column;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_rename_column=20(=0A=20=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=
=20v_column=20VARCHAR(128),=0A=20=20=20=20v_new_name=20VARCHAR(128)=0A=20=
=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=
=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20v_table=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20column_name=20=
ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20=
RENAME=20COLUMN=20'=20||=20v_column=20||=20'=20TO=20'=20||=20v_new_name;=0A=
=0A=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=20=20END;=0A=20=20=20=
=20ELSE=0A=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20=
Column=20%=20does=20not=20exist.',=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_table,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_column;=0AEND=0A=0AIF=20=
;END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_rename_table=20(=0A=
=20=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=20v_new_name=20=
VARCHAR(128)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
DECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20v_table=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20RENAME=20TO=20=
'=20||=20v_new_name;=0A=0A=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=
=20=20END;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20RAISE=20=
EXCEPTION=20'Table=20%=20does=20not=20exist.',=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_table;=0AEND=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_add_config_value=20=
(=0A=20=20=20=20v_option_name=20VARCHAR(100),=0A=20=20=20=20=
v_option_value=20VARCHAR(4000),=0A=20=20=20=20v_version=20VARCHAR(40)=0A=20=
=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20=20=20=20=20INSERT=20INTO=20vdc_options=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20option_name,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20option_value,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20END;=0A=20=20=20=20END=20IF;=0A=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_delete_config_value_all_versions=20=
(v_option_name=20VARCHAR(100))=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20BEGIN=0A=
=20=20=20=20=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
option_name=20ilike=20v_option_name;=0A=20=20=20=20=20=20=20=20END;=0A=20=
=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_delete_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_version=20TEXT=0A=20=20=20=20)=0ARETURNS=20=
void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20version=20IN=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitter(v_version)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20version=20IN=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20fnSplitter(v_version)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=
=20=20END;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_delete_config_for_version=20(v_version=20TEXT)=0ARETURNS=20void=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20WHERE=20version=20IN=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitter(v_version)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_update_config_value=20(=0A=20=20=20=20=
v_option_name=20VARCHAR(100),=0A=20=20=20=20v_option_value=20=
VARCHAR(4000),=0A=20=20=20=20v_version=20VARCHAR(40)=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=
=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=
=20=20=20=20=20UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SET=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20=
=20=20=20=20END;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_update_default_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_default_option_value=20VARCHAR(4000),=0A=20=
=20=20=20v_option_value=20VARCHAR(4000),=0A=20=20=20=20v_version=20=
VARCHAR(40),=0A=20=20=20=20v_ignore_default_value_case=20boolean=0A=20=20=
=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20=
(v_ignore_default_value_case)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20option_value=20ilike=20v_default_option_value=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=20=20=
=20=20UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20option_value=20=3D=20v_default_option_value=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20END=20IF;=0A=0A=20=20=20=20END;=0A=20=
=20=20=20END=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_db_rename_config_key=20(=0A=20=20=20=20=20=20=20=20v_old_option_name=20=
VARCHAR(100),=0A=20=20=20=20=20=20=20=20v_new_option_name=20=
VARCHAR(100),=0A=20=20=20=20=20=20=20=20v_version=20VARCHAR(40)=0A=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=
=20=20=20DECLARE=20v_current_option_value=20VARCHAR(4000);=0A=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20v_old_option_name=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20version=20=3D=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20v_current_option_value:=3D=20=
option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_old_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
version=20=3D=20v_version;=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_name=20=3D=20v_new_option_name,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20option_value=20=3D=20v_current_option_value=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_old_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20=20=20=20=20END=20=
IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_db_create_constraint=20(=0A=20=20=20=20=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_constraint=20VARCHAR(128),=0A=20=
=20=20=20=20=20=20=20v_constraint_sql=20TEXT=0A=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20IF=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_constraint=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20conname=20ilike=20v_constraint=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20EXECUTE=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ADD=20CONSTRAINT=20'=20||=20=
v_constraint=20||=20'=20'=20||=20v_constraint_sql;=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20fn_db_drop_constraint=20(=0A=20=20=20=20=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_constraint=20VARCHAR(128)=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=
=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20pg_constraint=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20conname=20ilike=20v_constraint=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=
=20=20=20=20EXECUTE=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20DROP=20=
CONSTRAINT=20'=20||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=20=20=
=20=20=20END=20IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
replace=20FUNCTION=20CheckDBConnection=20()=0A=20=20=20=20RETURNS=20=
SETOF=20INT=20IMMUTABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=
=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
1;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax=20()=0A=20=20=20=20RETURNS=20SETOF=20=
TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=0A=20=20=
=20=20=20=20=20=20FROM=20pg_proc=0A=20=20=20=20=20=20=20=20INNER=20JOIN=20=
pg_namespace=20ns=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
(pg_proc.pronamespace=20=3D=20ns.oid)=0A=20=20=20=20=20=20=20=20WHERE=20=
ns.nspname=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
proname;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
generate_drop_all_views_syntax=20()=0A=20=20=20=20RETURNS=20SETOF=20TEXT=20=
STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20'DROP=20VIEW=20if=20=
exists=20'=20||=20table_name=20||=20'=20CASCADE;'=0A=20=20=20=20=20=20=20=
=20FROM=20information_schema.VIEWS=0A=20=20=20=20=20=20=20=20WHERE=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
table_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20generate_drop_all_tables_syntax=20()=0A=20=20=20=20RETURNS=20=
SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
'DROP=20TABLE=20if=20exists=20'=20||=20table_name=20||=20'=20CASCADE;'=0A=
=20=20=20=20=20=20=20=20FROM=20information_schema.tables=0A=20=20=20=20=20=
=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20table_type=20=3D=20'BASE=20TABLE'=0A=20=20=20=20=20=20=20=
=20ORDER=20BY=20table_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
replace=20FUNCTION=20generate_drop_all_seq_syntax=20()=0A=20=20=20=20=
RETURNS=20SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20'DROP=20SEQUENCE=20if=20exists=20'=20||=20sequence_name=20||=20=
'=20CASCADE;'=0A=20=20=20=20=20=20=20=20FROM=20=
information_schema.sequences=0A=20=20=20=20=20=20=20=20WHERE=20=
sequence_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
sequence_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20generate_drop_all_user_types_syntax=20()=0A=20=20=20=20=
RETURNS=20SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20=20=20=20=20=20FROM=20pg_namespace=20n,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20pg_class=20c,=0A=20=20=20=20=20=20=20=20=20=20=20=20pg_type=20t=0A=20=
=20=20=20=20=20=20=20WHERE=20n.oid=20=3D=20c.relnamespace=0A=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20t.typrelid=20=3D=20c.oid=0A=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20c.relkind=20=3D=20'c'::"char"=0A=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20n.nspname=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
ORDER=20BY=20c.relname::information_schema.sql_identifier;=0A=20=20=20=20=
END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_get_column_size=20(=0A=20=20=20=20=20=20=20=20v_table=20VARCHAR(64),=0A=
=20=20=20=20=20=20=20=20v_column=20VARCHAR(64)=0A=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20RETURNS=20INT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
DECLARE=20retvalue=20INT;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
retvalue=20:=3D=20character_maximum_length=0A=20=20=20=20=20=20=20=20=
FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20WHERE=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
table_name=20ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
column_name=20ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
udt_name=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
'char',=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'varchar'=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=
=20RETURN=20retvalue;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
REPLACE=20FUNCTION=20attach_user_to_role=20(=0A=20=20=20=20=20=20=20=20=
v_user_name=20VARCHAR(255),=0A=20=20=20=20=20=20=20=20v_domain=20=
VARCHAR(255),=0A=20=20=20=20=20=20=20=20v_namespace=20VARCHAR(255),=0A=20=
=20=20=20=20=20=20=20v_domain_entry_id=20TEXT,=0A=20=20=20=20=20=20=20=20=
v_role_name=20VARCHAR(255)=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$BODY$=0A=0A=20=20=20=20DECLARE=20selected_user_id=20=
uuid;=0A=0A=20=20=20=20input_role_id=20uuid;=0A=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20SELECT=20roles.id=0A=20=20=20=20=20=20=20=20INTO=20=
input_role_id=0A=20=20=20=20=20=20=20=20FROM=20roles=0A=20=20=20=20=20=20=
=20=20WHERE=20roles.name=20=3D=20v_role_name;=0A=0A=20=20=20=20=20=20=20=20=
--=20The=20external=20identifier=20is=20the=20user=20identifier=20=
converted=20to=20an=20array=20of=0A=20=20=20=20=20=20=20=20--=20bytes:=0A=
=20=20=20=20=20=20=20=20INSERT=20INTO=20users=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20user_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
external_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20namespace,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
domain,=0A=20=20=20=20=20=20=20=20=20=20=20=20username,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20last_admin_check_status=0A=20=20=20=20=20=20=20=20=20=
=20=20=20)=0A=20=20=20=20=20=20=20=20SELECT=20uuid_generate_v1(),=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_domain_entry_id,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_namespace,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_user_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_domain,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20v_user_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
true=0A=20=20=20=20=20=20=20=20WHERE=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20domain=20=3D=20v_domain=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20external_id=20=3D=20=
v_domain_entry_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=0A=20=20=20=20=20=20=20=20SELECT=20user_id=0A=20=20=20=20=20=20=20=20=
FROM=20users=0A=20=20=20=20=20=20=20=20WHERE=20domain=20=3D=20v_domain=0A=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20external_id=20=3D=20=
v_domain_entry_id=0A=20=20=20=20=20=20=20=20INTO=20selected_user_id;=0A=0A=
=20=20=20=20=20=20=20=20INSERT=20INTO=20permissions=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20=20=20=20=20role_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20ad_element_id,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20object_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
object_type_id=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=
=20=20SELECT=20uuid_generate_v1(),=0A=20=20=20=20=20=20=20=20=20=20=20=20=
input_role_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20selected_user_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20getGlobalIds('system'),=0A=20=20=20=20=
=20=20=20=20=20=20=20=201=0A=20=20=20=20=20=20=20=20WHERE=20NOT=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20role_id,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ad_element_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20object_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
object_type_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
permissions=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20input_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20AND=20ad_element_id=20=3D=20selected_user_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20object_id=20=3D=20=
getGlobalIds('system')=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20object_type_id=20=3D=201=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20);=0A=20=20=20=20END;$BODY$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20=
FUNCTION=20fn_db_add_action_group_to_role=20(=0A=20=20=20=20=20=20=20=20=
v_role_id=20UUID,=0A=20=20=20=20=20=20=20=20v_action_group_id=20INT=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20RETURNS=20VOID=20AS=20$PROCEDURE$=0A=
=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20INSERT=20INTO=20=
roles_groups=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20role_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20action_group_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20SELECT=20v_role_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_action_group_id=0A=20=20=20=20=20=20=20=20WHERE=20=
NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
roles_groups=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20v_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20action_group_id=20=3D=20v_action_group_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=20=
RETURN;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20FUNCTION=20=
fn_db_split_config_value=20(=0A=20=20=20=20=20=20=20=20v_option_name=20=
VARCHAR,=0A=20=20=20=20=20=20=20=20v_old_option_value=20VARCHAR,=0A=20=20=
=20=20=20=20=20=20v_new_option_value=20VARCHAR,=0A=20=20=20=20=20=20=20=20=
v_update_from_version=20VARCHAR=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$BODY$=0A=0A=20=20=20=20DECLARE=20v_old_value=20=
VARCHAR(4000);=0A=0A=20=20=20=20v_cur=20CURSOR=0A=20=20=20=20FOR=0A=0A=20=
=20=20=20SELECT=20DISTINCT=20version=0A=20=20=20=20FROM=20vdc_options=0A=20=
=20=20=20WHERE=20version=20<>=20'general'=0A=20=20=20=20ORDER=20BY=20=
version;=0A=0A=20=20=20=20v_version=20VARCHAR(40);=0A=0A=20=20=20=20=
v_index=20INT;=0A=0A=20=20=20=20v_count=20INT;=0A=0A=20=20=20=20=
v_total_count=20INT;=0A=0A=20=20=20=20v_version_count=20INT;=0A=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20v_total_count=20:=3D=20count(version)=0A=
=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=
WHERE=20option_name=20=3D=20v_option_name;=0A=0A=20=20=20=20=20=20=20=20=
v_old_value=20:=3D=20option_value=0A=20=20=20=20=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20=20=20=20=20WHERE=20option_name=20=3D=20=
v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
'general';=0A=0A=20=20=20=20=20=20=20=20v_version_count=20:=3D=20=
count(DISTINCT=20version)=0A=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=
=20=20=20=20=20=20=20=20WHERE=20version=20<>=20'general';=0A=0A=20=20=20=20=
=20=20=20=20IF=20(v_total_count=20<=3D=20v_version_count)=20THEN=0A=20=20=
=20=20=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=20=20=20=20IF=20=
(v_old_value=20IS=20NULL)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20v_old_value=20:=3D=20v_old_option_value;=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=20=20=20=20=20=20=20=20v_count=20:=3D=20count(DISTINCT=20=
version)=0A=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=
=20=20WHERE=20version=20<>=20'general';=0A=0A=20=20=20=20=20=20=20=20=
v_index=20:=3D=201;=0A=0A=20=20=20=20=20=20=20=20OPEN=20v_cur;=0A=0A=20=20=
=20=20=20=20=20=20LOOP=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20FETCH=20=
v_cur=0A=20=20=20=20=20=20=20=20=20=20=20=20INTO=20v_version;=0A=0A=20=20=
=20=20=20=20=20=20=20=20=20=20EXIT=20when=20NOT=20found;=0A=0A=20=20=20=20=
=20=20=20=20=20=20=20=20--=20We=20shouldn't=20update=20if=20already=20=
exists=0A=20=20=20=20=20=20=20=20=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20option_name=20=3D=20v_option_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20version=20=3D=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20--=20Might=20not=20work=20well=20for=20versions=20such=20as=20=
3.10,=20but=20we=20currently=20don't=20have=20any=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20IF=20(v_version=20>=3D=20=
v_update_from_version)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20INSERT=20INTO=20vdc_options=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20option_name,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_new_option_value,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_version=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20INSERT=20INTO=20vdc_options=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20option_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20version=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_old_value,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20END=20IF;=0A=
=0A=20=20=20=20=20=20=20=20=20=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_index=20:=3D=20v_index=20+=201;=0A=20=20=20=20=20=20=20=20=
END=20LOOP;=0A=0A=20=20=20=20CLOSE=20v_cur;=0A=0A=20=20=20=20DELETE=0A=20=
=20=20=20FROM=20vdc_options=0A=20=20=20=20WHERE=20option_name=20=3D=20=
v_option_name=0A=20=20=20=20=20=20=20=20AND=20version=20=3D=20'general';=0A=
=20=20=20=20END;=0AEND=20IF;=0A=0AEND;$BODY$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_grant_action_group_to_all_roles_filter=20(=0A=20=20=20=20=
v_action_group_id=20INT,=0A=20=20=20=20uuid=20[]=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$BODY$=0A=0ADECLARE=20v_role_id_to_filter=20alias=0A=
FOR=20$2;=0A=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20roles_groups=20(=0A=20=
=20=20=20=20=20=20=20role_id,=0A=20=20=20=20=20=20=20=20action_group_id=0A=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20SELECT=20DISTINCT=20role_id,=0A=20=
=20=20=20=20=20=20=20v_action_group_id=0A=20=20=20=20FROM=20roles_groups=20=
rg=0A=20=20=20=20WHERE=20NOT=20ARRAY=20[role_id]=20<@=20=
v_role_id_to_filter=0A=20=20=20=20=20=20=20=20AND=20NOT=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20roles_groups=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20rg.role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20action_group_id=20=3D=20v_action_group_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20);=0AEND;$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_mask_object=20=
(v_object=20regclass)=0ARETURNS=20setof=20record=20AS=20$BODY$=0A=0A=
DECLARE=20v_sql=20TEXT;=0A=0Av_table=20record;=0A=0Av_table_name=20TEXT;=0A=
=0Atemprec=20record;=0A=0ABEGIN=0A=20=20=20=20--=20get=20full=20=
table/view=20name=20from=20v_object=20(i.e=20<namespace>.<name>)=0A=20=20=
=20=20SELECT=20c.relname,=0A=20=20=20=20=20=20=20=20n.nspname=0A=20=20=20=
=20INTO=20v_table=0A=20=20=20=20FROM=20pg_class=20c=0A=20=20=20=20INNER=20=
JOIN=20pg_namespace=20n=0A=20=20=20=20=20=20=20=20ON=20c.relnamespace=20=
=3D=20n.oid=0A=20=20=20=20WHERE=20c.oid=20=3D=20v_object;=0A=0A=20=20=20=20=
--=20try=20to=20get=20filtered=20query=20syntax=20from=20previous=20=
execution=0A=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
object_column_white_list_sql=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
object_name=20=3D=20v_table.relname=0A=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=0A=20=20=20=20=20=20=20=20SELECT=20sql=0A=20=20=20=20=20=20=20=20=
INTO=20v_sql=0A=20=20=20=20=20=20=20=20FROM=20=
object_column_white_list_sql=0A=20=20=20=20=20=20=20=20WHERE=20=
object_name=20=3D=20v_table.relname;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=
=20=20=20v_table_name=20:=3D=20quote_ident(v_table.nspname)=20||=20'.'=20=
||=20quote_ident(v_table.relname);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20FOR=20temprec=20IN=0A=20=20=20=20SELECT=20a.attname,=0A=20=20=20=
=20=20=20=20=20t.typname=0A=20=20=20=20FROM=20pg_attribute=20a=0A=20=20=20=
=20INNER=20JOIN=20pg_type=20t=0A=20=20=20=20=20=20=20=20ON=20a.atttypid=20=
=3D=20t.oid=0A=20=20=20=20WHERE=20a.attrelid=20=3D=20v_object=0A=20=20=20=
=20=20=20=20=20AND=20a.attnum=20>=200=0A=20=20=20=20=20=20=20=20AND=20=
NOT=20a.attisdropped=0A=20=20=20=20ORDER=20BY=20a.attnum=20LOOP=20v_sql=20=
:=3D=20coalesce(v_sql=20||=20',=20',=20'SELECT=20');=0A=0A=20=20=20=20=20=
=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
1=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20object_column_white_list=0A=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20object_name=20=3D=20=
v_table.relname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
column_name=20=3D=20temprec.attname=0A=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=20v_sql=20:=3D=20v_sql=20||=20quote_ident(temprec.attname);=0A=20=
=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20=
:=3D=20v_sql=20||=20'NULL::'=20||=20quote_ident(temprec.typname)=20||=20=
'=20as=20'=20||=20quote_ident(temprec.attname);=0A=20=20=20=20=20=20=20=20=
END=20IF;=0A=0A=20=20=20=20END=20LOOP;=0A=0A=20=20=20=20v_sql=20:=3D=20=
v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=0A=20=20=20=20v_sql=20=
:=3D=20'SELECT=20x::'=20||=20v_table_name=20||=20'=20as=20rec=20FROM=20=
('=20||=20v_sql=20||=20')=20as=20x';=0A=0A=20=20=20=20--=20save=20=
generated=20query=20for=20further=20use=0A=20=20=20=20INSERT=20INTO=20=
object_column_white_list_sql=20(=0A=20=20=20=20=20=20=20=20object_name,=0A=
=20=20=20=20=20=20=20=20sql=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_table.relname,=0A=20=20=20=20=20=20=
=20=20v_sql=0A=20=20=20=20=20=20=20=20);=0A=20=20=20=20END=20IF;=0A=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20EXECUTE=20v_sql;=0AEND;$BODY$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_add_column_to_object_white_list=20(=0A=20=20=20=20v_object_name=20=
VARCHAR(128),=0A=20=20=20=20v_column_name=20VARCHAR(128)=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20object_column_white_list=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20object_name=20=3D=20v_object_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20column_name=20=3D=20=
v_column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=
=20=20=20=20--=20verify=20that=20there=20is=20such=20object=20in=20db=0A=20=
=20=20=20=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20=3D=20=
v_object_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20column_name=20=3D=20v_column_name=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20INSERT=20=
INTO=20object_column_white_list=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20object_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20v_object_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20v_column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=20=20=20=20=20=20=20=20END=20IF;=0A=0A=20=20=20=20END;=0A=20=20=20=20=
END=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20FUNCTION=20=
fn_db_is_table_exists=20(v_table=20VARCHAR(64))=0A=20=20=20=20RETURNS=20=
boolean=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20DECLARE=20retvalue=20=
boolean;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20retvalue=20:=3D=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.tables=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ILIKE=20v_table=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=20=
RETURN=20retvalue;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20fn_db_create_index=20(=0A=20=20=20=20=20=20=20=20v_index_name=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_table_name=20VARCHAR(128),=0A=20=
=20=20=20=20=20=20=20v_column_names=20TEXT,=0A=20=20=20=20=20=20=20=20=
v_where_predicate=20TEXT=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=20=20=20DECLARE=20v_sql=20=
TEXT;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
'DROP=20INDEX=20'=20||=20'=20IF=20EXISTS=20'=20||=20v_index_name=20||=20=
';=20CREATE=20INDEX=20'=20||=20v_index_name=20||=20'=20ON=20'=20||=20=
v_table_name=20||=20'('=20||=20v_column_names=20||=20')';=0A=0A=20=20=20=20=
=20=20=20=20IF=20v_where_predicate=20=3D=20''=20THEN=20v_sql=20:=3D=20=
v_sql=20||=20';';ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
v_sql=20||=20'=20WHERE=20'=20||=20v_where_predicate=20||=20';';=0A=20=20=20=
=20END=20IF;=0A=0A=20=20=20=20EXECUTE=20v_sql;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_unlock_disk=20(v_id=20UUID)=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
DECLARE=20OK=20INT;=0A=0ALOCKED=20INT;=0A=0ABEGIN=0A=20=20=20=20OK:=3D=20=
1;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20UPDATE=20images=0A=20=
=20=20=20SET=20imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=
=3D=20LOCKED=0A=20=20=20=20=20=20=20=20AND=20image_group_id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_snapshot=20=
(v_id=20UUID)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20OK=20=
VARCHAR;=0A=0ALOCKED=20VARCHAR;=0A=0ABEGIN=0A=20=20=20=20OK:=3D=20'OK';=0A=
=0A=20=20=20=20LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20UPDATE=20=
snapshots=0A=20=20=20=20SET=20status=20=3D=20OK=0A=20=20=20=20WHERE=20=
status=20=3D=20LOCKED=0A=20=20=20=20=20=20=20=20AND=20snapshot_id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_entity=20(=0A=
=20=20=20=20v_object_type=20VARCHAR(10),=0A=20=20=20=20v_name=20=
VARCHAR(255),=0A=20=20=20=20v_recursive=20boolean=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20DOWN=20INT;=0A=0AOK=20INT;=0A=
=0ALOCKED=20INT;=0A=0ATEMPLATE_OK=20INT;=0A=0ATEMPLATE_LOCKED=20INT;=0A=0A=
IMAGE_LOCKED=20INT;=0A=0ASNAPSHOT_OK=20VARCHAR;=0A=0ASNAPSHOT_LOCKED=20=
VARCHAR;=0A=0Av_id=20UUID;=0A=0ABEGIN=0A=20=20=20=20DOWN:=3D=200;=0A=0A=20=
=20=20=20OK:=3D=201;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20=
TEMPLATE_OK:=3D=200;=0A=0A=20=20=20=20TEMPLATE_LOCKED:=3D=201;=0A=0A=20=20=
=20=20IMAGE_LOCKED:=3D=2015;=0A=0A=20=20=20=20SNAPSHOT_OK:=3D=20'OK';=0A=0A=
=20=20=20=20SNAPSHOT_LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20v_id=20:=3D=20=
vm_guid=0A=20=20=20=20FROM=20vm_static=0A=20=20=20=20WHERE=20vm_name=20=3D=
=20v_name=0A=20=20=20=20=20=20=20=20AND=20entity_type=20ilike=20=
v_object_type;=0A=0A=20=20=20=20--=20set=20VM=20status=20to=20DOWN=0A=20=20=
=20=20IF=20(v_object_type=20=3D=20'vm')=20THEN=0A=20=20=20=20=20=20=20=20=
UPDATE=20vm_dynamic=0A=20=20=20=20=20=20=20=20SET=20status=20=3D=20DOWN=0A=
=20=20=20=20=20=20=20=20WHERE=20status=20=3D=20IMAGE_LOCKED=0A=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20vm_guid=20=3D=20v_id;=0A=20=20=20=20=20=20=20=
=20=20=20=20=20--=20set=20Template=20status=20to=20OK=0A=20=20=20=20ELSE=20=
IF=20(v_object_type=20=3D=20'template')=20THEN=0A=20=20=20=20=20=20=20=20=
UPDATE=20vm_static=0A=20=20=20=20=20=20=20=20SET=20template_status=20=3D=20=
TEMPLATE_OK=0A=20=20=20=20=20=20=20=20WHERE=20template_status=20=3D=20=
TEMPLATE_LOCKED=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20vm_guid=20=3D=20=
v_id;=0A=20=20=20=20END=20IF;=0A=0AEND=20IF;=0A=20--unlock=20images=20=
and=20snapshots=20=20if=20recursive=20flag=20is=20set=0AIF=20=
(v_recursive)=20THEN=0A=20=20=20=20UPDATE=20images=0A=20=20=20=20SET=20=
imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=3D=20LOCKED=0A=
=20=20=20=20=20=20=20=20AND=20image_group_id=20IN=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=20device_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vm_device=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vm_id=20=3D=
=20v_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
is_plugged=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=
UPDATE=20snapshots=0A=20=20=20=20SET=20status=20=3D=20SNAPSHOT_OK=0A=20=20=
=20=20WHERE=20status=20ilike=20SNAPSHOT_LOCKED=0A=20=20=20=20=20=20=20=20=
AND=20vm_id=20=3D=20v_id;=0AEND=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_all=20=
()=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20DOWN=20INT;=0A=0AOK=20=
INT;=0A=0ALOCKED=20INT;=0A=0ATEMPLATE_OK=20INT;=0A=0ATEMPLATE_LOCKED=20=
INT;=0A=0AIMAGE_LOCKED=20INT;=0A=0ASNAPSHOT_OK=20VARCHAR;=0A=0A=
SNAPSHOT_LOCKED=20VARCHAR;=0A=0ABEGIN=0A=20=20=20=20DOWN:=3D=200;=0A=0A=20=
=20=20=20OK:=3D=201;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20=
TEMPLATE_OK:=3D=200;=0A=0A=20=20=20=20TEMPLATE_LOCKED:=3D=201;=0A=0A=20=20=
=20=20IMAGE_LOCKED:=3D=2015;=0A=0A=20=20=20=20SNAPSHOT_OK:=3D=20'OK';=0A=0A=
=20=20=20=20SNAPSHOT_LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20UPDATE=20=
vm_static=0A=20=20=20=20SET=20template_status=20=3D=20TEMPLATE_OK=0A=20=20=
=20=20WHERE=20template_status=20=3D=20TEMPLATE_LOCKED;=0A=0A=20=20=20=20=
UPDATE=20vm_dynamic=0A=20=20=20=20SET=20status=20=3D=20DOWN=0A=20=20=20=20=
WHERE=20status=20=3D=20IMAGE_LOCKED;=0A=0A=20=20=20=20UPDATE=20images=0A=20=
=20=20=20SET=20imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=
=3D=20LOCKED;=0A=0A=20=20=20=20UPDATE=20snapshots=0A=20=20=20=20SET=20=
status=20=3D=20SNAPSHOT_OK=0A=20=20=20=20WHERE=20status=20ilike=20=
SNAPSHOT_LOCKED;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A/*=20Displays=20DC=20id=20,=20DC=20name,=20SPM=20Host=20id=20=
,=20SPM=20Host=20name=20and=20number=20of=20async=20tasks=20awaiting.=0A=0A=
1)=20create=20a=20record=20type=20with=20DC=20name,=20DC=20id,=20SPM=20=
host=20id,=20SPM=20host=20name,=20count=0A=0A2)=20get=20all=20distinct=20=
DC=20ids=20from=20async_tasks=20table=0A=0A3)=20Run=20a=20cursor=20for=20=
each=20result=20in=202)=0A=0A=20=20=20a)=20get=20DC=20name=0A=20=20=20b)=20=
get=20SPM=20Host=20id=20&=20name=20if=20available=0A=20=20=20c)=20get=20=
count=20of=20tasks=0A=0A=20=20=20return=20current=20record=0A=0A4)=20=
return=20set=20of=20generated=20records=0A*/=0ADROP=20TYPE=20IF=20EXISTS=20=
async_tasks_info_rs=20CASCADE;=0A**************************=0A=0ADROP=20=
TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
async_tasks_info_rs=20AS=20(=0A=20=20=20=20=20=20=20=20dc_id=20uuid,=0A=20=
=20=20=20=20=20=20=20dc_name=20VARCHAR,=0A=20=20=20=20=20=20=20=20=
spm_host_id=20uuid,=0A=20=20=20=20=20=20=20=20spm_host_name=20VARCHAR,=0A=
=20=20=20=20=20=20=20=20task_count=20INT=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_get_async_tasks=20=
()=0ARETURNS=20SETOF=20async_tasks_info_rs=20STABLE=20AS=20$PROCEDURE$=0A=
DECLARE=20v_record=20async_tasks_info_rs;=0A=0A--=20selects=20=
storage_pool_id=20uuid=20found=20in=20async_tasks=0Av_tasks_cursor=20=
CURSOR=0AFOR=0A=0ASELECT=20DISTINCT=20storage_pool_id=0AFROM=20=
async_tasks;=0A=0ABEGIN=0A=20=20=20=20OPEN=20v_tasks_cursor;=0A=0A=20=20=20=
=20FETCH=20v_tasks_cursor=0A=20=20=20=20INTO=20v_record.dc_id;=0A=0A=20=20=
=20=20WHILE=20FOUND=0A=20=20=20=20LOOP=0A=20=20=20=20=20=20=20=20--=20=
get=20dc_name=20and=20SPM=20Host=20id=0A=20=20=20=20=20=20=20=20=
v_record.dc_name=20:=3D=20name=20FROM=20storage_pool=20WHERE=20id=20=3D=20=
v_record.dc_id;=0A=20=20=20=20=20=20=20=20v_record.spm_host_id=20:=3D=20=
spm_vds_id=0A=20=20=20=20=20=20=20=20FROM=20storage_pool=0A=20=20=20=20=20=
=20=20=20WHERE=20id=20=3D=20v_record.dc_id;=0A=0A=20=20=20=20=20=20=20=20=
--=20get=20Host=20name=20if=20we=20have=20non=20NULL=20SPM=20Host=0A=20=20=
=20=20=20=20=20=20IF=20(v_record.spm_host_id=20IS=20NOT=20NULL)=20THEN=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_record.spm_host_name=20:=3D=20=
vds_name=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vds_static=0A=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20=
v_record.spm_host_id;=0A=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_record.spm_host_name:=3D=20'';=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=20=20=20=20=20=20=20=20--=20get=20tasks=20count=20for=20=
this=20DC=0A=20=20=20=20=20=20=20=20v_record.task_count=20:=3D=20=
count(*)=0A=20=20=20=20=20=20=20=20FROM=20async_tasks=0A=20=20=20=20=20=20=
=20=20WHERE=20position(cast(v_record.dc_id=20AS=20VARCHAR)=20IN=20=
action_parameters)=20>=200;=0A=0A=20=20=20=20=20=20=20=20--=20return=20=
the=20record=0A=20=20=20=20=20=20=20=20RETURN=20NEXT=20v_record;=0A=0A=20=
=20=20=20=20=20=20=20FETCH=20v_tasks_cursor=0A=20=20=20=20INTO=20=
v_record.dc_id;=0A=0A=20=20=20=20END=20LOOP;=0A=0ACLOSE=20=
v_tasks_cursor;=0A=0A--=20return=20full=20set=20of=20generated=20records=0A=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_remove_csv_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_value=20VARCHAR(4000),=0A=20=20=20=20=
v_version=20VARCHAR(40)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v=20VARCHAR=20[];=0A=0Ae=20VARCHAR;=0A=0A=
v_result=20VARCHAR;=0A=0Av_sep=20VARCHAR(1);=0A=0ABEGIN=0A=20=20=20=20=
v_result=20:=3D=20'';=0A=0A=20=20=20=20v_sep=20:=3D=20'';=0A=0A=20=20=20=20=
v=20:=3D=20string_to_array(option_value,=20',')=0A=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20WHERE=20option_name=20=3D=20v_option_name=0A=20=
=20=20=20=20=20=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20FOR=0A=
=0A=20=20=20=20e=20IN=0A=0A=20=20=20=20SELECT=20unnest(v)=20LOOP=0A=0A=20=
=20=20=20IF=20(e=20!=3D=20v_value)=20THEN=20v_result=20:=3D=20v_result=20=
||=20v_sep=20||=20e;=0A=20=20=20=20=20=20=20=20v_sep=20:=3D=20',';=0A=20=20=
=20=20END=20IF;=0A=0AEND=0ALOOP;=0A=0A=20=20=20=20UPDATE=20vdc_options=0A=
=20=20=20=20SET=20option_value=20=3D=20v_result=0A=20=20=20=20WHERE=20=
option_name=20=3D=20v_option_name=0A=20=20=20=20=20=20=20=20AND=20=
version=20=3D=20v_version;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_remove_uuid_from_csv=20(=0A=20=20=20=20v_csv_text=20TEXT,=0A=20=20=20=
=20v_uuid=20uuid=0A=20=20=20=20)=0ARETURNS=20TEXT=20STABLE=20AS=20=
$PROCEDURE$=0ADECLARE=20v=20uuid=20[];=0A=0Ae=20uuid;=0A=0Av_result=20=
TEXT;=0A=0Av_sep=20VARCHAR(1);=0A=0ABEGIN=0A=20=20=20=20v_result=20:=3D=20=
'';=0A=0A=20=20=20=20v_sep=20:=3D=20'';=0A=0A=20=20=20=20v=20:=3D=20=
string_to_array(v_csv_text,=20',');=0A=20=20=20=20FOR=0A=0A=20=20=20=20e=20=
IN=0A=0A=20=20=20=20SELECT=20unnest(v)=20LOOP=0A=0A=20=20=20=20IF=20(e=20=
!=3D=20v_uuid)=20THEN=20v_result=20:=3D=20v_result=20||=20v_sep=20||=20=
e;=0A=20=20=20=20=20=20=20=20v_sep=20:=3D=20',';=0A=20=20=20=20END=20IF;=0A=
=0A=20=20=20=20END=20LOOP;=0A=0A=20=20=20=20IF=20(v_result=20=3D=20'')=20=
THEN=20v_result=20:=3D=20NULL;=0A=20=20=20=20END=20IF;=0A=20=20=20=20=
RETURN=20v_result;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_add_config_value_for_versions_up_to=20(=0A=20=20=20=20=
v_option_name=20VARCHAR(100),=0A=20=20=20=20v_val=20VARCHAR(4000),=0A=20=20=
=20=20v_version=20VARCHAR(40)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20i=20INT;=0A=0Aarr=20VARCHAR=20[]=20:=3D=20array=20=
['3.6',=20'4.0'];=0A=0ABEGIN=0A=20=20=20=20FOR=20i=20IN=20=
array_lower(arr,=201)..array_upper(arr,=201)=20LOOP=20PERFORM=20=
fn_db_add_config_value(v_option_name,=20v_val,=20arr=20[i]);=0A=20=20=20=20=
=20=20=20=20EXIT=20WHEN=20arr=20[i]=20=3D=20v_version;=0A=20=20=20=20END=20=
LOOP;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Aselect=20*=20from=20generate_drop_all_views_syntax();=0A=
**************************=0A=0A=20DROP=20VIEW=20if=20exists=20=
active_migration_network_interfaces=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20affinity_groups_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
all_disks=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20all_disks_for_vms=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20all_disks_including_memory=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20all_disks_including_snapshots=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
all_disks_including_snapshots_and_memory=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20cluster_storage_domain=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20cluster_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
desktop_vms=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
disk_vm_element_extended=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
domains_with_unregistered_entities_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20dwh_add_tags_relations_history_view=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20dwh_cluster_configuration_history_view=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20dwh_datacenter_configuration_history_view=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
dwh_datacenter_storage_map_history_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20dwh_host_configuration_full_check_view=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20dwh_host_configuration_history_view=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20dwh_host_history_view=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20dwh_host_interface_configuration_history_view=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
dwh_host_interface_history_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20dwh_remove_tags_relations_history_view=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20dwh_storage_domain_configuration_history_view=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
dwh_storage_domain_history_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20dwh_tags_details_history_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20dwh_users_history_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20dwh_vm_configuration_history_view=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20dwh_vm_device_history_view=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20dwh_vm_disk_configuration_history_view=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20dwh_vm_disks_history_view=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20dwh_vm_history_view=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20dwh_vm_interface_configuration_history_view=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20dwh_vm_interface_history_view=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
engine_session_user_flat_groups=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20gluster_geo_rep_config_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20gluster_georep_sessions_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20gluster_server_hooks_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20gluster_server_services_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20gluster_volume_bricks_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20gluster_volume_snapshot_schedules_view=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20gluster_volume_snapshots_view=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20gluster_volumes_view=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20gluster_volume_task_steps=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20host_device_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
host_network_qos_of_migration_network_by_cluster=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20images_storage_domain_view=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20image_types_storage_domain=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20image_types_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20instance_types_storage_domain=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20instance_types_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
internal_permissions_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
labels_map_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20luns_view=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
memory_and_disk_images_storage_domain_view=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20network_cluster_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20network_vds_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
network_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
numa_node_assignment_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
numa_node_cpus_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
numa_node_with_cluster_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
permissions_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
qos_for_disk_profile_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
qos_for_vm_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
quota_cluster_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
quota_global_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
quota_limitations_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
quota_storage_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
quota_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20server_vms=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20storage_domain_file_repos=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20storage_domains=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20storage_domains_for_search=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20storage_domain_shared_status=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20storage_domains_image_sizes=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20storage_domains_with_hosts_view=20CASCADE;=0A=
=20DROP=20VIEW=20if=20exists=20storage_domains_without_storage_pools=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20storage_for_image_view=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
storage_pool_with_storage_domain=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20supported_cluster_features_view=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20tags_user_group_map_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20tags_user_map_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
tags_vds_map_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
tags_vm_map_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
tags_vm_pool_map_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
user_cluster_permissions_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
user_cluster_permissions_view_base=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20user_cpu_profile_permissions_view=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20user_db_users_permissions_view=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20user_disk_permissions_view=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20user_disk_permissions_view_base=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20user_disk_profile_permissions_view=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20user_disk_profile_permissions_view_base=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20user_network_permissions_view=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
user_network_permissions_view_base=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20user_object_permissions_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20user_permissions_permissions_view=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20user_profiles_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20users_and_groups_to_vm_pool_map_view=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20user_storage_domain_permissions_view=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20user_storage_domain_permissions_view_base=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
user_storage_pool_permissions_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20user_storage_pool_permissions_view_base=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20user_vds_permissions_view=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20user_vds_permissions_view_base=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20user_vm_permissions_view=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20user_vm_pool_permissions_view=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20user_vm_pool_permissions_view_base=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20user_vm_template_permissions_view=20CASCADE;=0A=
=20DROP=20VIEW=20if=20exists=20user_vm_template_permissions_view_base=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
user_vnic_profile_permissions_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20user_vnic_profile_permissions_view_base=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20vdc_users=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
vdc_users_with_tags=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20vds=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20vds_interface_view=20CASCADE;=0A=
=20DROP=20VIEW=20if=20exists=20vds_with_tags=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20vm_device_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
vm_host_device_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
vm_host_pinning_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
vm_images_storage_domains_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
vm_images_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
vm_interface_monitoring_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
vm_interface_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
vm_permissions_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
vm_permissions_view_base=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
vm_pool_map_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
vm_pools_full_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
vm_pools_view=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20vms=20CASCADE;=0A=
=20DROP=20VIEW=20if=20exists=20vms_for_disk_view=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20vms_with_plug_info=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20vms_with_tags=20CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
vm_templates_based_storage_domain=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20vm_templates_based_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20vm_templates_based_with_plug_info=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20vm_templates_storage_domain=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20vm_templates_view=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20vnic_profiles_view=20CASCADE;=0A=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
active_migration_network_interfaces=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20affinity_groups_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20all_disks=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20all_disks_for_vms=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20all_disks_including_memory=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
all_disks_including_snapshots=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
all_disks_including_snapshots_and_memory=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20cluster_storage_domain=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20cluster_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20desktop_vms=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20disk_vm_element_extended=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
domains_with_unregistered_entities_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
dwh_add_tags_relations_history_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
dwh_cluster_configuration_history_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
dwh_datacenter_configuration_history_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
dwh_datacenter_storage_map_history_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
dwh_host_configuration_full_check_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
dwh_host_configuration_history_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20dwh_host_history_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
dwh_host_interface_configuration_history_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20dwh_host_interface_history_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
dwh_remove_tags_relations_history_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
dwh_storage_domain_configuration_history_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20dwh_storage_domain_history_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
dwh_tags_details_history_view=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
dwh_users_history_view=20CASCADE;=0A**************************=0A=0ADROP=20=
VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
dwh_vm_configuration_history_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20dwh_vm_device_history_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
dwh_vm_disk_configuration_history_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20dwh_vm_disks_history_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20dwh_vm_history_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
dwh_vm_interface_configuration_history_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20dwh_vm_interface_history_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
engine_session_user_flat_groups=20CASCADE;=0A**************************=0A=
=0ADROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20=
exists=20gluster_geo_rep_config_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20gluster_georep_sessions_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
gluster_server_hooks_view=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
gluster_server_services_view=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
gluster_volume_bricks_view=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
gluster_volume_snapshot_schedules_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20gluster_volume_snapshots_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20gluster_volumes_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
gluster_volume_task_steps=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
host_device_view=20CASCADE;=0A**************************=0A=0ADROP=20=
VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
host_network_qos_of_migration_network_by_cluster=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20images_storage_domain_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
image_types_storage_domain=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
image_types_view=20CASCADE;=0A**************************=0A=0ADROP=20=
VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
instance_types_storage_domain=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
instance_types_view=20CASCADE;=0A**************************=0A=0ADROP=20=
VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
internal_permissions_view=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
labels_map_view=20CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A=
*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20luns_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
memory_and_disk_images_storage_domain_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20network_cluster_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20network_vds_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20network_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20numa_node_assignment_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20numa_node_cpus_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
numa_node_with_cluster_view=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
permissions_view=20CASCADE;=0A**************************=0A=0ADROP=20=
VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
qos_for_disk_profile_view=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
qos_for_vm_view=20CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A=
*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
quota_cluster_view=20CASCADE;=0A**************************=0A=0ADROP=20=
VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
quota_global_view=20CASCADE;=0A**************************=0A=0ADROP=20=
VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
quota_limitations_view=20CASCADE;=0A**************************=0A=0ADROP=20=
VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
quota_storage_view=20CASCADE;=0A**************************=0A=0ADROP=20=
VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
quota_view=20CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A=
*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20server_vms=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
storage_domain_file_repos=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
storage_domains=20CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A=
*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
storage_domains_for_search=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
storage_domain_shared_status=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
storage_domains_image_sizes=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
storage_domains_with_hosts_view=20CASCADE;=0A**************************=0A=
=0ADROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20=
exists=20storage_domains_without_storage_pools=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20storage_for_image_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
storage_pool_with_storage_domain=20CASCADE;=0A**************************=0A=
=0ADROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20=
exists=20supported_cluster_features_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20tags_user_group_map_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20tags_user_map_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20tags_vds_map_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20tags_vm_map_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20tags_vm_pool_map_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
user_cluster_permissions_view=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
user_cluster_permissions_view_base=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
user_cpu_profile_permissions_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20user_db_users_permissions_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
user_disk_permissions_view=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
user_disk_permissions_view_base=20CASCADE;=0A**************************=0A=
=0ADROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20=
exists=20user_disk_profile_permissions_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
user_disk_profile_permissions_view_base=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20user_network_permissions_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
user_network_permissions_view_base=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20user_object_permissions_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
user_permissions_permissions_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20user_profiles_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
users_and_groups_to_vm_pool_map_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
user_storage_domain_permissions_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
user_storage_domain_permissions_view_base=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
user_storage_pool_permissions_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
user_storage_pool_permissions_view_base=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20user_vds_permissions_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
user_vds_permissions_view_base=20CASCADE;=0A**************************=0A=
=0ADROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20=
exists=20user_vm_permissions_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20user_vm_pool_permissions_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
user_vm_pool_permissions_view_base=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
user_vm_template_permissions_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
user_vm_template_permissions_view_base=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
user_vnic_profile_permissions_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
user_vnic_profile_permissions_view_base=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20vdc_users=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20vdc_users_with_tags=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20vds=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20vds_interface_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20vds_with_tags=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20vm_device_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20vm_host_device_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20vm_host_pinning_view=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20vm_images_storage_domains_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20vm_images_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
vm_interface_monitoring_view=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
vm_interface_view=20CASCADE;=0A**************************=0A=0ADROP=20=
VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
vm_permissions_view=20CASCADE;=0A**************************=0A=0ADROP=20=
VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
vm_permissions_view_base=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
vm_pool_map_view=20CASCADE;=0A**************************=0A=0ADROP=20=
VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
vm_pools_full_view=20CASCADE;=0A**************************=0A=0ADROP=20=
VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
vm_pools_view=20CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A=
*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20vms=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20vms_for_disk_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20vms_with_plug_info=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20vms_with_tags=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
vm_templates_based_storage_domain=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20vm_templates_based_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
vm_templates_based_with_plug_info=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20vm_templates_storage_domain=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20vm_templates_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20vnic_profiles_view=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_add_column=20=
(=0A=20=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=20v_column=20=
VARCHAR(128),=0A=20=20=20=20v_column_def=20TEXT=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=
=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20information_schema.columns=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20table_schema=20=3D=
=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20table_name=20ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20column_name=20ilike=20v_column=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ADD=20COLUMN=20'=20||=20=
v_column=20||=20'=20'=20||=20v_column_def;=0A=0A=20=20=20=20=20=20=20=20=
EXECUTE=20v_sql;=0A=20=20=20=20END;=0AEND=0A=0AIF=20;END;$PROCEDURE$=0A=20=
=20=20=20LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20=
FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
FUNCTION=20fn_db_drop_column=20(=0A=20=20=20=20v_table=20VARCHAR(128),=0A=
=20=20=20=20v_column=20VARCHAR(128)=0A=20=20=20=20)=0ARETURNS=20void=20=
AS=20$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20=
ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20column_name=20ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20=
||=20v_table=20||=20'=20DROP=20COLUMN=20'=20||=20v_column;=0A=0A=20=20=20=
=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=20=20END;=0A=20=20=20=20ELSE=0A=20=
=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20Column=20%=20=
does=20not=20exist.',=0A=20=20=20=20=20=20=20=20=20=20=20=20v_table,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20v_column;=0A=20=20=20=20END=20IF;=0A=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_change_column_type=20(=0A=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20v_column=20VARCHAR(128),=0A=20=20=20=20=
v_type=20VARCHAR(128),=0A=20=20=20=20v_new_type=20VARCHAR(128)=0A=20=20=20=
=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0A=
BEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20information_schema.columns=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20table_schema=20=3D=
=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20table_name=20ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20column_name=20ilike=20v_column=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20udt_name=20=
ilike=20v_type=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20OR=20data_type=20ilike=20v_type=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20=
THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20ALTER=20COLUMN=20'=20||=20v_column=20=
||=20'=20TYPE=20'=20||=20v_new_type;=0A=0A=20=20=20=20=20=20=20=20=
EXECUTE=20v_sql;=0A=20=20=20=20END;=0A=0A=20=20=20=20---=20ignore=20=
operation=20if=20requested=20type=20is=20already=20there=0A=20=20=20=20=
ELSIF(NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20v_table=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20column_name=20=
ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20udt_name=20ilike=20v_new_type=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20data_type=20ilike=20=
v_new_type=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20))=20=
THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20RAISE=20=
EXCEPTION=20'Table=20%=20or=20Column=20%=20does=20not=20exist.',=20=
v_table,=20v_column;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_rename_column=20(=0A=20=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=
=20v_column=20VARCHAR(128),=0A=20=20=20=20v_new_name=20VARCHAR(128)=0A=20=
=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=
=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20v_table=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20column_name=20=
ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20=
RENAME=20COLUMN=20'=20||=20v_column=20||=20'=20TO=20'=20||=20v_new_name;=0A=
=0A=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=20=20END;=0A=20=20=20=
=20ELSE=0A=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20=
Column=20%=20does=20not=20exist.',=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_table,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_column;=0AEND=0A=0AIF=20=
;END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_rename_table=20(=0A=
=20=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=20v_new_name=20=
VARCHAR(128)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
DECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20v_table=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20RENAME=20TO=20=
'=20||=20v_new_name;=0A=0A=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=
=20=20END;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20RAISE=20=
EXCEPTION=20'Table=20%=20does=20not=20exist.',=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_table;=0AEND=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_add_config_value=20=
(=0A=20=20=20=20v_option_name=20VARCHAR(100),=0A=20=20=20=20=
v_option_value=20VARCHAR(4000),=0A=20=20=20=20v_version=20VARCHAR(40)=0A=20=
=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20=20=20=20=20INSERT=20INTO=20vdc_options=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20option_name,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20option_value,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20END;=0A=20=20=20=20END=20IF;=0A=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_delete_config_value_all_versions=20=
(v_option_name=20VARCHAR(100))=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20BEGIN=0A=
=20=20=20=20=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
option_name=20ilike=20v_option_name;=0A=20=20=20=20=20=20=20=20END;=0A=20=
=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_delete_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_version=20TEXT=0A=20=20=20=20)=0ARETURNS=20=
void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20version=20IN=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitter(v_version)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20version=20IN=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20fnSplitter(v_version)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=
=20=20END;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_delete_config_for_version=20(v_version=20TEXT)=0ARETURNS=20void=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20WHERE=20version=20IN=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitter(v_version)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_update_config_value=20(=0A=20=20=20=20=
v_option_name=20VARCHAR(100),=0A=20=20=20=20v_option_value=20=
VARCHAR(4000),=0A=20=20=20=20v_version=20VARCHAR(40)=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=
=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=
=20=20=20=20=20UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SET=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20=
=20=20=20=20END;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_update_default_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_default_option_value=20VARCHAR(4000),=0A=20=
=20=20=20v_option_value=20VARCHAR(4000),=0A=20=20=20=20v_version=20=
VARCHAR(40),=0A=20=20=20=20v_ignore_default_value_case=20boolean=0A=20=20=
=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20=
(v_ignore_default_value_case)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20option_value=20ilike=20v_default_option_value=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=20=20=
=20=20UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20option_value=20=3D=20v_default_option_value=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20END=20IF;=0A=0A=20=20=20=20END;=0A=20=
=20=20=20END=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_db_rename_config_key=20(=0A=20=20=20=20=20=20=20=20v_old_option_name=20=
VARCHAR(100),=0A=20=20=20=20=20=20=20=20v_new_option_name=20=
VARCHAR(100),=0A=20=20=20=20=20=20=20=20v_version=20VARCHAR(40)=0A=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=
=20=20=20DECLARE=20v_current_option_value=20VARCHAR(4000);=0A=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20v_old_option_name=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20version=20=3D=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20v_current_option_value:=3D=20=
option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_old_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
version=20=3D=20v_version;=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_name=20=3D=20v_new_option_name,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20option_value=20=3D=20v_current_option_value=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_old_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20=20=20=20=20END=20=
IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_db_create_constraint=20(=0A=20=20=20=20=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_constraint=20VARCHAR(128),=0A=20=
=20=20=20=20=20=20=20v_constraint_sql=20TEXT=0A=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20IF=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_constraint=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20conname=20ilike=20v_constraint=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20EXECUTE=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ADD=20CONSTRAINT=20'=20||=20=
v_constraint=20||=20'=20'=20||=20v_constraint_sql;=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20fn_db_drop_constraint=20(=0A=20=20=20=20=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_constraint=20VARCHAR(128)=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=
=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20pg_constraint=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20conname=20ilike=20v_constraint=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=
=20=20=20=20EXECUTE=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20DROP=20=
CONSTRAINT=20'=20||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=20=20=
=20=20=20END=20IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
replace=20FUNCTION=20CheckDBConnection=20()=0A=20=20=20=20RETURNS=20=
SETOF=20INT=20IMMUTABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=
=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
1;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax=20()=0A=20=20=20=20RETURNS=20SETOF=20=
TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=0A=20=20=
=20=20=20=20=20=20FROM=20pg_proc=0A=20=20=20=20=20=20=20=20INNER=20JOIN=20=
pg_namespace=20ns=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
(pg_proc.pronamespace=20=3D=20ns.oid)=0A=20=20=20=20=20=20=20=20WHERE=20=
ns.nspname=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
proname;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
generate_drop_all_views_syntax=20()=0A=20=20=20=20RETURNS=20SETOF=20TEXT=20=
STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20'DROP=20VIEW=20if=20=
exists=20'=20||=20table_name=20||=20'=20CASCADE;'=0A=20=20=20=20=20=20=20=
=20FROM=20information_schema.VIEWS=0A=20=20=20=20=20=20=20=20WHERE=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
table_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20generate_drop_all_tables_syntax=20()=0A=20=20=20=20RETURNS=20=
SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
'DROP=20TABLE=20if=20exists=20'=20||=20table_name=20||=20'=20CASCADE;'=0A=
=20=20=20=20=20=20=20=20FROM=20information_schema.tables=0A=20=20=20=20=20=
=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20table_type=20=3D=20'BASE=20TABLE'=0A=20=20=20=20=20=20=20=
=20ORDER=20BY=20table_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
replace=20FUNCTION=20generate_drop_all_seq_syntax=20()=0A=20=20=20=20=
RETURNS=20SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20'DROP=20SEQUENCE=20if=20exists=20'=20||=20sequence_name=20||=20=
'=20CASCADE;'=0A=20=20=20=20=20=20=20=20FROM=20=
information_schema.sequences=0A=20=20=20=20=20=20=20=20WHERE=20=
sequence_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
sequence_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20generate_drop_all_user_types_syntax=20()=0A=20=20=20=20=
RETURNS=20SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20=20=20=20=20=20FROM=20pg_namespace=20n,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20pg_class=20c,=0A=20=20=20=20=20=20=20=20=20=20=20=20pg_type=20t=0A=20=
=20=20=20=20=20=20=20WHERE=20n.oid=20=3D=20c.relnamespace=0A=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20t.typrelid=20=3D=20c.oid=0A=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20c.relkind=20=3D=20'c'::"char"=0A=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20n.nspname=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
ORDER=20BY=20c.relname::information_schema.sql_identifier;=0A=20=20=20=20=
END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_get_column_size=20(=0A=20=20=20=20=20=20=20=20v_table=20VARCHAR(64),=0A=
=20=20=20=20=20=20=20=20v_column=20VARCHAR(64)=0A=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20RETURNS=20INT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
DECLARE=20retvalue=20INT;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
retvalue=20:=3D=20character_maximum_length=0A=20=20=20=20=20=20=20=20=
FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20WHERE=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
table_name=20ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
column_name=20ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
udt_name=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
'char',=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'varchar'=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=
=20RETURN=20retvalue;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
REPLACE=20FUNCTION=20attach_user_to_role=20(=0A=20=20=20=20=20=20=20=20=
v_user_name=20VARCHAR(255),=0A=20=20=20=20=20=20=20=20v_domain=20=
VARCHAR(255),=0A=20=20=20=20=20=20=20=20v_namespace=20VARCHAR(255),=0A=20=
=20=20=20=20=20=20=20v_domain_entry_id=20TEXT,=0A=20=20=20=20=20=20=20=20=
v_role_name=20VARCHAR(255)=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$BODY$=0A=0A=20=20=20=20DECLARE=20selected_user_id=20=
uuid;=0A=0A=20=20=20=20input_role_id=20uuid;=0A=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20SELECT=20roles.id=0A=20=20=20=20=20=20=20=20INTO=20=
input_role_id=0A=20=20=20=20=20=20=20=20FROM=20roles=0A=20=20=20=20=20=20=
=20=20WHERE=20roles.name=20=3D=20v_role_name;=0A=0A=20=20=20=20=20=20=20=20=
--=20The=20external=20identifier=20is=20the=20user=20identifier=20=
converted=20to=20an=20array=20of=0A=20=20=20=20=20=20=20=20--=20bytes:=0A=
=20=20=20=20=20=20=20=20INSERT=20INTO=20users=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20user_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
external_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20namespace,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
domain,=0A=20=20=20=20=20=20=20=20=20=20=20=20username,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20last_admin_check_status=0A=20=20=20=20=20=20=20=20=20=
=20=20=20)=0A=20=20=20=20=20=20=20=20SELECT=20uuid_generate_v1(),=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_domain_entry_id,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_namespace,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_user_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_domain,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20v_user_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
true=0A=20=20=20=20=20=20=20=20WHERE=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20domain=20=3D=20v_domain=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20external_id=20=3D=20=
v_domain_entry_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=0A=20=20=20=20=20=20=20=20SELECT=20user_id=0A=20=20=20=20=20=20=20=20=
FROM=20users=0A=20=20=20=20=20=20=20=20WHERE=20domain=20=3D=20v_domain=0A=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20external_id=20=3D=20=
v_domain_entry_id=0A=20=20=20=20=20=20=20=20INTO=20selected_user_id;=0A=0A=
=20=20=20=20=20=20=20=20INSERT=20INTO=20permissions=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20=20=20=20=20role_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20ad_element_id,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20object_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
object_type_id=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=
=20=20SELECT=20uuid_generate_v1(),=0A=20=20=20=20=20=20=20=20=20=20=20=20=
input_role_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20selected_user_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20getGlobalIds('system'),=0A=20=20=20=20=
=20=20=20=20=20=20=20=201=0A=20=20=20=20=20=20=20=20WHERE=20NOT=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20role_id,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ad_element_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20object_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
object_type_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
permissions=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20input_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20AND=20ad_element_id=20=3D=20selected_user_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20object_id=20=3D=20=
getGlobalIds('system')=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20object_type_id=20=3D=201=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20);=0A=20=20=20=20END;$BODY$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20=
FUNCTION=20fn_db_add_action_group_to_role=20(=0A=20=20=20=20=20=20=20=20=
v_role_id=20UUID,=0A=20=20=20=20=20=20=20=20v_action_group_id=20INT=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20RETURNS=20VOID=20AS=20$PROCEDURE$=0A=
=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20INSERT=20INTO=20=
roles_groups=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20role_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20action_group_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20SELECT=20v_role_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_action_group_id=0A=20=20=20=20=20=20=20=20WHERE=20=
NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
roles_groups=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20v_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20action_group_id=20=3D=20v_action_group_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=20=
RETURN;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20FUNCTION=20=
fn_db_split_config_value=20(=0A=20=20=20=20=20=20=20=20v_option_name=20=
VARCHAR,=0A=20=20=20=20=20=20=20=20v_old_option_value=20VARCHAR,=0A=20=20=
=20=20=20=20=20=20v_new_option_value=20VARCHAR,=0A=20=20=20=20=20=20=20=20=
v_update_from_version=20VARCHAR=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$BODY$=0A=0A=20=20=20=20DECLARE=20v_old_value=20=
VARCHAR(4000);=0A=0A=20=20=20=20v_cur=20CURSOR=0A=20=20=20=20FOR=0A=0A=20=
=20=20=20SELECT=20DISTINCT=20version=0A=20=20=20=20FROM=20vdc_options=0A=20=
=20=20=20WHERE=20version=20<>=20'general'=0A=20=20=20=20ORDER=20BY=20=
version;=0A=0A=20=20=20=20v_version=20VARCHAR(40);=0A=0A=20=20=20=20=
v_index=20INT;=0A=0A=20=20=20=20v_count=20INT;=0A=0A=20=20=20=20=
v_total_count=20INT;=0A=0A=20=20=20=20v_version_count=20INT;=0A=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20v_total_count=20:=3D=20count(version)=0A=
=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=
WHERE=20option_name=20=3D=20v_option_name;=0A=0A=20=20=20=20=20=20=20=20=
v_old_value=20:=3D=20option_value=0A=20=20=20=20=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20=20=20=20=20WHERE=20option_name=20=3D=20=
v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
'general';=0A=0A=20=20=20=20=20=20=20=20v_version_count=20:=3D=20=
count(DISTINCT=20version)=0A=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=
=20=20=20=20=20=20=20=20WHERE=20version=20<>=20'general';=0A=0A=20=20=20=20=
=20=20=20=20IF=20(v_total_count=20<=3D=20v_version_count)=20THEN=0A=20=20=
=20=20=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=20=20=20=20IF=20=
(v_old_value=20IS=20NULL)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20v_old_value=20:=3D=20v_old_option_value;=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=20=20=20=20=20=20=20=20v_count=20:=3D=20count(DISTINCT=20=
version)=0A=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=
=20=20WHERE=20version=20<>=20'general';=0A=0A=20=20=20=20=20=20=20=20=
v_index=20:=3D=201;=0A=0A=20=20=20=20=20=20=20=20OPEN=20v_cur;=0A=0A=20=20=
=20=20=20=20=20=20LOOP=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20FETCH=20=
v_cur=0A=20=20=20=20=20=20=20=20=20=20=20=20INTO=20v_version;=0A=0A=20=20=
=20=20=20=20=20=20=20=20=20=20EXIT=20when=20NOT=20found;=0A=0A=20=20=20=20=
=20=20=20=20=20=20=20=20--=20We=20shouldn't=20update=20if=20already=20=
exists=0A=20=20=20=20=20=20=20=20=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20option_name=20=3D=20v_option_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20version=20=3D=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20--=20Might=20not=20work=20well=20for=20versions=20such=20as=20=
3.10,=20but=20we=20currently=20don't=20have=20any=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20IF=20(v_version=20>=3D=20=
v_update_from_version)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20INSERT=20INTO=20vdc_options=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20option_name,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_new_option_value,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_version=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20INSERT=20INTO=20vdc_options=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20option_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20version=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_old_value,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20END=20IF;=0A=
=0A=20=20=20=20=20=20=20=20=20=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_index=20:=3D=20v_index=20+=201;=0A=20=20=20=20=20=20=20=20=
END=20LOOP;=0A=0A=20=20=20=20CLOSE=20v_cur;=0A=0A=20=20=20=20DELETE=0A=20=
=20=20=20FROM=20vdc_options=0A=20=20=20=20WHERE=20option_name=20=3D=20=
v_option_name=0A=20=20=20=20=20=20=20=20AND=20version=20=3D=20'general';=0A=
=20=20=20=20END;=0AEND=20IF;=0A=0AEND;$BODY$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_grant_action_group_to_all_roles_filter=20(=0A=20=20=20=20=
v_action_group_id=20INT,=0A=20=20=20=20uuid=20[]=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$BODY$=0A=0ADECLARE=20v_role_id_to_filter=20alias=0A=
FOR=20$2;=0A=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20roles_groups=20(=0A=20=
=20=20=20=20=20=20=20role_id,=0A=20=20=20=20=20=20=20=20action_group_id=0A=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20SELECT=20DISTINCT=20role_id,=0A=20=
=20=20=20=20=20=20=20v_action_group_id=0A=20=20=20=20FROM=20roles_groups=20=
rg=0A=20=20=20=20WHERE=20NOT=20ARRAY=20[role_id]=20<@=20=
v_role_id_to_filter=0A=20=20=20=20=20=20=20=20AND=20NOT=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20roles_groups=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20rg.role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20action_group_id=20=3D=20v_action_group_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20);=0AEND;$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_mask_object=20=
(v_object=20regclass)=0ARETURNS=20setof=20record=20AS=20$BODY$=0A=0A=
DECLARE=20v_sql=20TEXT;=0A=0Av_table=20record;=0A=0Av_table_name=20TEXT;=0A=
=0Atemprec=20record;=0A=0ABEGIN=0A=20=20=20=20--=20get=20full=20=
table/view=20name=20from=20v_object=20(i.e=20<namespace>.<name>)=0A=20=20=
=20=20SELECT=20c.relname,=0A=20=20=20=20=20=20=20=20n.nspname=0A=20=20=20=
=20INTO=20v_table=0A=20=20=20=20FROM=20pg_class=20c=0A=20=20=20=20INNER=20=
JOIN=20pg_namespace=20n=0A=20=20=20=20=20=20=20=20ON=20c.relnamespace=20=
=3D=20n.oid=0A=20=20=20=20WHERE=20c.oid=20=3D=20v_object;=0A=0A=20=20=20=20=
--=20try=20to=20get=20filtered=20query=20syntax=20from=20previous=20=
execution=0A=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
object_column_white_list_sql=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
object_name=20=3D=20v_table.relname=0A=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=0A=20=20=20=20=20=20=20=20SELECT=20sql=0A=20=20=20=20=20=20=20=20=
INTO=20v_sql=0A=20=20=20=20=20=20=20=20FROM=20=
object_column_white_list_sql=0A=20=20=20=20=20=20=20=20WHERE=20=
object_name=20=3D=20v_table.relname;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=
=20=20=20v_table_name=20:=3D=20quote_ident(v_table.nspname)=20||=20'.'=20=
||=20quote_ident(v_table.relname);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20FOR=20temprec=20IN=0A=20=20=20=20SELECT=20a.attname,=0A=20=20=20=
=20=20=20=20=20t.typname=0A=20=20=20=20FROM=20pg_attribute=20a=0A=20=20=20=
=20INNER=20JOIN=20pg_type=20t=0A=20=20=20=20=20=20=20=20ON=20a.atttypid=20=
=3D=20t.oid=0A=20=20=20=20WHERE=20a.attrelid=20=3D=20v_object=0A=20=20=20=
=20=20=20=20=20AND=20a.attnum=20>=200=0A=20=20=20=20=20=20=20=20AND=20=
NOT=20a.attisdropped=0A=20=20=20=20ORDER=20BY=20a.attnum=20LOOP=20v_sql=20=
:=3D=20coalesce(v_sql=20||=20',=20',=20'SELECT=20');=0A=0A=20=20=20=20=20=
=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
1=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20object_column_white_list=0A=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20object_name=20=3D=20=
v_table.relname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
column_name=20=3D=20temprec.attname=0A=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=20v_sql=20:=3D=20v_sql=20||=20quote_ident(temprec.attname);=0A=20=
=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20=
:=3D=20v_sql=20||=20'NULL::'=20||=20quote_ident(temprec.typname)=20||=20=
'=20as=20'=20||=20quote_ident(temprec.attname);=0A=20=20=20=20=20=20=20=20=
END=20IF;=0A=0A=20=20=20=20END=20LOOP;=0A=0A=20=20=20=20v_sql=20:=3D=20=
v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=0A=20=20=20=20v_sql=20=
:=3D=20'SELECT=20x::'=20||=20v_table_name=20||=20'=20as=20rec=20FROM=20=
('=20||=20v_sql=20||=20')=20as=20x';=0A=0A=20=20=20=20--=20save=20=
generated=20query=20for=20further=20use=0A=20=20=20=20INSERT=20INTO=20=
object_column_white_list_sql=20(=0A=20=20=20=20=20=20=20=20object_name,=0A=
=20=20=20=20=20=20=20=20sql=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_table.relname,=0A=20=20=20=20=20=20=
=20=20v_sql=0A=20=20=20=20=20=20=20=20);=0A=20=20=20=20END=20IF;=0A=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20EXECUTE=20v_sql;=0AEND;$BODY$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_add_column_to_object_white_list=20(=0A=20=20=20=20v_object_name=20=
VARCHAR(128),=0A=20=20=20=20v_column_name=20VARCHAR(128)=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20object_column_white_list=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20object_name=20=3D=20v_object_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20column_name=20=3D=20=
v_column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=
=20=20=20=20--=20verify=20that=20there=20is=20such=20object=20in=20db=0A=20=
=20=20=20=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20=3D=20=
v_object_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20column_name=20=3D=20v_column_name=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20INSERT=20=
INTO=20object_column_white_list=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20object_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20v_object_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20v_column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=20=20=20=20=20=20=20=20END=20IF;=0A=0A=20=20=20=20END;=0A=20=20=20=20=
END=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20FUNCTION=20=
fn_db_is_table_exists=20(v_table=20VARCHAR(64))=0A=20=20=20=20RETURNS=20=
boolean=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20DECLARE=20retvalue=20=
boolean;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20retvalue=20:=3D=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.tables=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ILIKE=20v_table=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=20=
RETURN=20retvalue;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20fn_db_create_index=20(=0A=20=20=20=20=20=20=20=20v_index_name=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_table_name=20VARCHAR(128),=0A=20=
=20=20=20=20=20=20=20v_column_names=20TEXT,=0A=20=20=20=20=20=20=20=20=
v_where_predicate=20TEXT=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=20=20=20DECLARE=20v_sql=20=
TEXT;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
'DROP=20INDEX=20'=20||=20'=20IF=20EXISTS=20'=20||=20v_index_name=20||=20=
';=20CREATE=20INDEX=20'=20||=20v_index_name=20||=20'=20ON=20'=20||=20=
v_table_name=20||=20'('=20||=20v_column_names=20||=20')';=0A=0A=20=20=20=20=
=20=20=20=20IF=20v_where_predicate=20=3D=20''=20THEN=20v_sql=20:=3D=20=
v_sql=20||=20';';ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
v_sql=20||=20'=20WHERE=20'=20||=20v_where_predicate=20||=20';';=0A=20=20=20=
=20END=20IF;=0A=0A=20=20=20=20EXECUTE=20v_sql;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_unlock_disk=20(v_id=20UUID)=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
DECLARE=20OK=20INT;=0A=0ALOCKED=20INT;=0A=0ABEGIN=0A=20=20=20=20OK:=3D=20=
1;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20UPDATE=20images=0A=20=
=20=20=20SET=20imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=
=3D=20LOCKED=0A=20=20=20=20=20=20=20=20AND=20image_group_id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_snapshot=20=
(v_id=20UUID)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20OK=20=
VARCHAR;=0A=0ALOCKED=20VARCHAR;=0A=0ABEGIN=0A=20=20=20=20OK:=3D=20'OK';=0A=
=0A=20=20=20=20LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20UPDATE=20=
snapshots=0A=20=20=20=20SET=20status=20=3D=20OK=0A=20=20=20=20WHERE=20=
status=20=3D=20LOCKED=0A=20=20=20=20=20=20=20=20AND=20snapshot_id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_entity=20(=0A=
=20=20=20=20v_object_type=20VARCHAR(10),=0A=20=20=20=20v_name=20=
VARCHAR(255),=0A=20=20=20=20v_recursive=20boolean=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20DOWN=20INT;=0A=0AOK=20INT;=0A=
=0ALOCKED=20INT;=0A=0ATEMPLATE_OK=20INT;=0A=0ATEMPLATE_LOCKED=20INT;=0A=0A=
IMAGE_LOCKED=20INT;=0A=0ASNAPSHOT_OK=20VARCHAR;=0A=0ASNAPSHOT_LOCKED=20=
VARCHAR;=0A=0Av_id=20UUID;=0A=0ABEGIN=0A=20=20=20=20DOWN:=3D=200;=0A=0A=20=
=20=20=20OK:=3D=201;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20=
TEMPLATE_OK:=3D=200;=0A=0A=20=20=20=20TEMPLATE_LOCKED:=3D=201;=0A=0A=20=20=
=20=20IMAGE_LOCKED:=3D=2015;=0A=0A=20=20=20=20SNAPSHOT_OK:=3D=20'OK';=0A=0A=
=20=20=20=20SNAPSHOT_LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20v_id=20:=3D=20=
vm_guid=0A=20=20=20=20FROM=20vm_static=0A=20=20=20=20WHERE=20vm_name=20=3D=
=20v_name=0A=20=20=20=20=20=20=20=20AND=20entity_type=20ilike=20=
v_object_type;=0A=0A=20=20=20=20--=20set=20VM=20status=20to=20DOWN=0A=20=20=
=20=20IF=20(v_object_type=20=3D=20'vm')=20THEN=0A=20=20=20=20=20=20=20=20=
UPDATE=20vm_dynamic=0A=20=20=20=20=20=20=20=20SET=20status=20=3D=20DOWN=0A=
=20=20=20=20=20=20=20=20WHERE=20status=20=3D=20IMAGE_LOCKED=0A=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20vm_guid=20=3D=20v_id;=0A=20=20=20=20=20=20=20=
=20=20=20=20=20--=20set=20Template=20status=20to=20OK=0A=20=20=20=20ELSE=20=
IF=20(v_object_type=20=3D=20'template')=20THEN=0A=20=20=20=20=20=20=20=20=
UPDATE=20vm_static=0A=20=20=20=20=20=20=20=20SET=20template_status=20=3D=20=
TEMPLATE_OK=0A=20=20=20=20=20=20=20=20WHERE=20template_status=20=3D=20=
TEMPLATE_LOCKED=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20vm_guid=20=3D=20=
v_id;=0A=20=20=20=20END=20IF;=0A=0AEND=20IF;=0A=20--unlock=20images=20=
and=20snapshots=20=20if=20recursive=20flag=20is=20set=0AIF=20=
(v_recursive)=20THEN=0A=20=20=20=20UPDATE=20images=0A=20=20=20=20SET=20=
imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=3D=20LOCKED=0A=
=20=20=20=20=20=20=20=20AND=20image_group_id=20IN=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=20device_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vm_device=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vm_id=20=3D=
=20v_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
is_plugged=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=
UPDATE=20snapshots=0A=20=20=20=20SET=20status=20=3D=20SNAPSHOT_OK=0A=20=20=
=20=20WHERE=20status=20ilike=20SNAPSHOT_LOCKED=0A=20=20=20=20=20=20=20=20=
AND=20vm_id=20=3D=20v_id;=0AEND=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_all=20=
()=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20DOWN=20INT;=0A=0AOK=20=
INT;=0A=0ALOCKED=20INT;=0A=0ATEMPLATE_OK=20INT;=0A=0ATEMPLATE_LOCKED=20=
INT;=0A=0AIMAGE_LOCKED=20INT;=0A=0ASNAPSHOT_OK=20VARCHAR;=0A=0A=
SNAPSHOT_LOCKED=20VARCHAR;=0A=0ABEGIN=0A=20=20=20=20DOWN:=3D=200;=0A=0A=20=
=20=20=20OK:=3D=201;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20=
TEMPLATE_OK:=3D=200;=0A=0A=20=20=20=20TEMPLATE_LOCKED:=3D=201;=0A=0A=20=20=
=20=20IMAGE_LOCKED:=3D=2015;=0A=0A=20=20=20=20SNAPSHOT_OK:=3D=20'OK';=0A=0A=
=20=20=20=20SNAPSHOT_LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20UPDATE=20=
vm_static=0A=20=20=20=20SET=20template_status=20=3D=20TEMPLATE_OK=0A=20=20=
=20=20WHERE=20template_status=20=3D=20TEMPLATE_LOCKED;=0A=0A=20=20=20=20=
UPDATE=20vm_dynamic=0A=20=20=20=20SET=20status=20=3D=20DOWN=0A=20=20=20=20=
WHERE=20status=20=3D=20IMAGE_LOCKED;=0A=0A=20=20=20=20UPDATE=20images=0A=20=
=20=20=20SET=20imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=
=3D=20LOCKED;=0A=0A=20=20=20=20UPDATE=20snapshots=0A=20=20=20=20SET=20=
status=20=3D=20SNAPSHOT_OK=0A=20=20=20=20WHERE=20status=20ilike=20=
SNAPSHOT_LOCKED;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A/*=20Displays=20DC=20id=20,=20DC=20name,=20SPM=20Host=20id=20=
,=20SPM=20Host=20name=20and=20number=20of=20async=20tasks=20awaiting.=0A=0A=
1)=20create=20a=20record=20type=20with=20DC=20name,=20DC=20id,=20SPM=20=
host=20id,=20SPM=20host=20name,=20count=0A=0A2)=20get=20all=20distinct=20=
DC=20ids=20from=20async_tasks=20table=0A=0A3)=20Run=20a=20cursor=20for=20=
each=20result=20in=202)=0A=0A=20=20=20a)=20get=20DC=20name=0A=20=20=20b)=20=
get=20SPM=20Host=20id=20&=20name=20if=20available=0A=20=20=20c)=20get=20=
count=20of=20tasks=0A=0A=20=20=20return=20current=20record=0A=0A4)=20=
return=20set=20of=20generated=20records=0A*/=0ADROP=20TYPE=20IF=20EXISTS=20=
async_tasks_info_rs=20CASCADE;=0A**************************=0A=0ADROP=20=
TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
async_tasks_info_rs=20AS=20(=0A=20=20=20=20=20=20=20=20dc_id=20uuid,=0A=20=
=20=20=20=20=20=20=20dc_name=20VARCHAR,=0A=20=20=20=20=20=20=20=20=
spm_host_id=20uuid,=0A=20=20=20=20=20=20=20=20spm_host_name=20VARCHAR,=0A=
=20=20=20=20=20=20=20=20task_count=20INT=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_get_async_tasks=20=
()=0ARETURNS=20SETOF=20async_tasks_info_rs=20STABLE=20AS=20$PROCEDURE$=0A=
DECLARE=20v_record=20async_tasks_info_rs;=0A=0A--=20selects=20=
storage_pool_id=20uuid=20found=20in=20async_tasks=0Av_tasks_cursor=20=
CURSOR=0AFOR=0A=0ASELECT=20DISTINCT=20storage_pool_id=0AFROM=20=
async_tasks;=0A=0ABEGIN=0A=20=20=20=20OPEN=20v_tasks_cursor;=0A=0A=20=20=20=
=20FETCH=20v_tasks_cursor=0A=20=20=20=20INTO=20v_record.dc_id;=0A=0A=20=20=
=20=20WHILE=20FOUND=0A=20=20=20=20LOOP=0A=20=20=20=20=20=20=20=20--=20=
get=20dc_name=20and=20SPM=20Host=20id=0A=20=20=20=20=20=20=20=20=
v_record.dc_name=20:=3D=20name=20FROM=20storage_pool=20WHERE=20id=20=3D=20=
v_record.dc_id;=0A=20=20=20=20=20=20=20=20v_record.spm_host_id=20:=3D=20=
spm_vds_id=0A=20=20=20=20=20=20=20=20FROM=20storage_pool=0A=20=20=20=20=20=
=20=20=20WHERE=20id=20=3D=20v_record.dc_id;=0A=0A=20=20=20=20=20=20=20=20=
--=20get=20Host=20name=20if=20we=20have=20non=20NULL=20SPM=20Host=0A=20=20=
=20=20=20=20=20=20IF=20(v_record.spm_host_id=20IS=20NOT=20NULL)=20THEN=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_record.spm_host_name=20:=3D=20=
vds_name=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vds_static=0A=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20=
v_record.spm_host_id;=0A=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_record.spm_host_name:=3D=20'';=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=20=20=20=20=20=20=20=20--=20get=20tasks=20count=20for=20=
this=20DC=0A=20=20=20=20=20=20=20=20v_record.task_count=20:=3D=20=
count(*)=0A=20=20=20=20=20=20=20=20FROM=20async_tasks=0A=20=20=20=20=20=20=
=20=20WHERE=20position(cast(v_record.dc_id=20AS=20VARCHAR)=20IN=20=
action_parameters)=20>=200;=0A=0A=20=20=20=20=20=20=20=20--=20return=20=
the=20record=0A=20=20=20=20=20=20=20=20RETURN=20NEXT=20v_record;=0A=0A=20=
=20=20=20=20=20=20=20FETCH=20v_tasks_cursor=0A=20=20=20=20INTO=20=
v_record.dc_id;=0A=0A=20=20=20=20END=20LOOP;=0A=0ACLOSE=20=
v_tasks_cursor;=0A=0A--=20return=20full=20set=20of=20generated=20records=0A=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_remove_csv_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_value=20VARCHAR(4000),=0A=20=20=20=20=
v_version=20VARCHAR(40)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v=20VARCHAR=20[];=0A=0Ae=20VARCHAR;=0A=0A=
v_result=20VARCHAR;=0A=0Av_sep=20VARCHAR(1);=0A=0ABEGIN=0A=20=20=20=20=
v_result=20:=3D=20'';=0A=0A=20=20=20=20v_sep=20:=3D=20'';=0A=0A=20=20=20=20=
v=20:=3D=20string_to_array(option_value,=20',')=0A=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20WHERE=20option_name=20=3D=20v_option_name=0A=20=
=20=20=20=20=20=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20FOR=0A=
=0A=20=20=20=20e=20IN=0A=0A=20=20=20=20SELECT=20unnest(v)=20LOOP=0A=0A=20=
=20=20=20IF=20(e=20!=3D=20v_value)=20THEN=20v_result=20:=3D=20v_result=20=
||=20v_sep=20||=20e;=0A=20=20=20=20=20=20=20=20v_sep=20:=3D=20',';=0A=20=20=
=20=20END=20IF;=0A=0AEND=0ALOOP;=0A=0A=20=20=20=20UPDATE=20vdc_options=0A=
=20=20=20=20SET=20option_value=20=3D=20v_result=0A=20=20=20=20WHERE=20=
option_name=20=3D=20v_option_name=0A=20=20=20=20=20=20=20=20AND=20=
version=20=3D=20v_version;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_remove_uuid_from_csv=20(=0A=20=20=20=20v_csv_text=20TEXT,=0A=20=20=20=
=20v_uuid=20uuid=0A=20=20=20=20)=0ARETURNS=20TEXT=20STABLE=20AS=20=
$PROCEDURE$=0ADECLARE=20v=20uuid=20[];=0A=0Ae=20uuid;=0A=0Av_result=20=
TEXT;=0A=0Av_sep=20VARCHAR(1);=0A=0ABEGIN=0A=20=20=20=20v_result=20:=3D=20=
'';=0A=0A=20=20=20=20v_sep=20:=3D=20'';=0A=0A=20=20=20=20v=20:=3D=20=
string_to_array(v_csv_text,=20',');=0A=20=20=20=20FOR=0A=0A=20=20=20=20e=20=
IN=0A=0A=20=20=20=20SELECT=20unnest(v)=20LOOP=0A=0A=20=20=20=20IF=20(e=20=
!=3D=20v_uuid)=20THEN=20v_result=20:=3D=20v_result=20||=20v_sep=20||=20=
e;=0A=20=20=20=20=20=20=20=20v_sep=20:=3D=20',';=0A=20=20=20=20END=20IF;=0A=
=0A=20=20=20=20END=20LOOP;=0A=0A=20=20=20=20IF=20(v_result=20=3D=20'')=20=
THEN=20v_result=20:=3D=20NULL;=0A=20=20=20=20END=20IF;=0A=20=20=20=20=
RETURN=20v_result;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_add_config_value_for_versions_up_to=20(=0A=20=20=20=20=
v_option_name=20VARCHAR(100),=0A=20=20=20=20v_val=20VARCHAR(4000),=0A=20=20=
=20=20v_version=20VARCHAR(40)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20i=20INT;=0A=0Aarr=20VARCHAR=20[]=20:=3D=20array=20=
['3.6',=20'4.0'];=0A=0ABEGIN=0A=20=20=20=20FOR=20i=20IN=20=
array_lower(arr,=201)..array_upper(arr,=201)=20LOOP=20PERFORM=20=
fn_db_add_config_value(v_option_name,=20v_val,=20arr=20[i]);=0A=20=20=20=20=
=20=20=20=20EXIT=20WHEN=20arr=20[i]=20=3D=20v_version;=0A=20=20=20=20END=20=
LOOP;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Aselect=20*=20from=20generate_drop_all_functions_syntax();=0A=
**************************=0A=0A=20drop=20function=20if=20exists=20=
public.activateallmaterializedviews(boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.activatematerializedview(name,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.addconnectiontoiscsibond(uuid,=20character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.addglusterserverknownaddress(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.addnetworktoiscsibond(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.attach_user_to_role(character=20varying,=20=
character=20varying,=20character=20varying,=20text,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.boundvmpoolprestartedvms(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.calculateallclusterusage()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.calculateallstorageusage()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.calculateclusterusage(uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.calculatestorageusage(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.checkdbconnection()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.checkifjobhastasks(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.checkifsnapshotexistsbyvmidandsnapshotid(uuid,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.checkifsnapshotexistsbyvmidandstatus(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.checkifsnapshotexistsbyvmidandtype(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.checkvmhostdeviceavailability(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.cleandownvms()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.clear_network_from_nics(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.clear_osinfo()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.clearallauditlogevents(integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.clearalldeviceaddressesbyvmid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.clearmigratingtovds(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.clearvmdeviceaddress(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.createallmaterializedviewsiindexes()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.createcustommaterializedview(name,=20=
name,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.createcustommaterializedview(name,=20name,=20integer,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.createcustommaterializedviewas(name,=20integer,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.createcustommaterializedviewas(name,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.createlabel(uuid,=20character=20=
varying,=20boolean,=20uuid[],=20uuid[])=20cascade;=0A=20drop=20function=20=
if=20exists=20public.creatematerializedview(name,=20name,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.creatematerializedview(name,=20name,=20integer,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.creatematerializedview(name,=20name,=20integer,=20boolean,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.creatematerializedviewas(name,=20integer,=20boolean,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.creatematerializedviewas(name,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.creatematerializedviewas(name,=20=
integer,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.delete_entity_snapshot_by_command_id(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.delete_roles_groups(integer,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteaffinitygroup(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deleteallcommandentities()=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.deleteallcommandentitiesbycommandid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteallfromenginesessions()=20cascade;=0A=
=20drop=20function=20if=20exists=20public.deleteallfromvmicondefaults()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteallglusterhooks(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deleteallunusedvmicons()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteallvfsconfiglabels(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteallvfsconfignetworks(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteasync_tasks(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deleteasynctasksbyvdsmtaskid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteauditalertlogbyvdsidandtype(uuid,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteauditalertlogbyvolumeidandtype(uuid,=20integer)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.deleteauditlog(integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteauditlogalertsbyvdsid(uuid,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteauditlogolderthendate(timestamp=20=
with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deletebackuprelatedalerts()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletebasedisk(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletebookmark(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletebypoolvds_spm_id_map(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.deletecluster(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteclusterpolicy(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deleteclusterpolicyunitsbyclusterpolicyid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletecommandentitiesbycommandid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.deletecommandentitiesolderthandate(timestamp=20with=20time=20=
zone)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deletecommandentity(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletecompletedjobsolderthandate(timestamp=20with=20time=20=
zone,=20timestamp=20with=20time=20zone)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletecpuprofile(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletecustom_actions(integer)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.deletedisk_image_dynamic(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletedisklunmap(uuid,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletediskprofile(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletediskvmelement(uuid,=20uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteenginesession(integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteentitysnapshotbycommandid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteevent_notification_hist(timestamp=20without=20time=20zone)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteevent_subscriber(character=20varying,=20character=20=
varying,=20uuid,=20character=20varying)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteexternalvariable(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletefenceagent(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletefenceagentsbyvdsid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteglustergeorepsession(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglusterhook(uuid,=20character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deleteglusterhookbyid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteglusterhooksbyids(text)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.deleteglusterserver(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglusterserverbyglusterserveruuid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteglusterserverhook(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglusterserverhookbyid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteglusterserverhooksbyids(text)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deleteglusterserverservice(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglustervolumeaccessprotocol(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglustervolumebrick(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteglustervolumebricks(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglustervolumebyguid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteglustervolumebyname(uuid,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglustervolumeoption(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteglustervolumeoptions(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglustervolumesbyclusterid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteglustervolumesbyguids(character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglustervolumesnapshotbyguid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteglustervolumesnapshotbyname(uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglustervolumesnapshotsbyvolumeid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.deleteglustervolumesnapshotschedulebyvolumeid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.deleteglustervolumessnapshotbyids(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.deleteglustervolumetransporttype(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.deletegroup(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletehostdevice(uuid,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletehostnicvfsconfig(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.deleteimage(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteimage_storage_domain_map(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.deleteimage_storage_domain_map_by_image_id(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deleteimageuploads(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteiscsibond(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletejob(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletejobolderthandatewithstatus(timestamp=20with=20time=20=
zone,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deletelabel(uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deletelibvirtsecret(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletelun(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.deletelun_storage_server_connection_map(character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deletemacpool(uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deletemacpoolrangesbymacpoolid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletenetwork(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletenetwork_cluster(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletenetworkattachment(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletenumanode(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletenumanodecpubynumanodeid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletenumanodemapbyvdsnumanodeid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletenumanodemapbyvmnumanodeid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.deleteorphanjobs()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteovfgenerations(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletepermission(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletepermissionsbyentityid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletepolicyunit(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deleteprovider(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteqos(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletequotabyquotaguid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletequotalimitationbyquotaguid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleterepo_domain_file_list(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleterole(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleterunningjobsoftasklesscommands()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletesnapshot(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletestep(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletestorage_domain_dynamic(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletestorage_domain_static(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletestorage_pool(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletestorage_pool_iso_map(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.deletestorage_server_connections(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.deletestoragedevicebyid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletestoragedomainovfinfo(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletestorageserverconnectionextension(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.deletetags(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletetags_user_group_map(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletetags_user_map(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletetags_vds_map(uuid,=20uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletetags_vm_map(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletetags_vm_pool_map(uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteunpinnednumanodemapbyvmnumanodeid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deleteuser(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deleteuserprofile(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevdcoption(integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletevds(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletevds_interface(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletevds_interface_statistics(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevds_spm_id_map(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletevdscpustatisticsbyvdsid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletevdsdynamic(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletevdsstatic(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.deletevdsstatistics(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevfsconfiglabel(uuid,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletevfsconfignetwork(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.deletevm(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevm_interface_statistics(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletevm_pool_map(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletevm_pools(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.deletevmdevice(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevmdevicesbyvmidandtype(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevmdynamic(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletevmguestagentinterfacesbyvmid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletevmicon(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletevmicondefault(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevmiconifunused(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletevminit(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletevminterface(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletevmjobs(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletevmstatic(uuid,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletevmstatistics(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevmtemplates(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletevnicprofile(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.displayallauditlogevents(integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.dropallcustommaterializedviews()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.dropallmaterializedviews()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.dropmaterializedview(name)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.existsvmdevicebyvmidandtype(uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_authz_entry_info(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_add_action_group_to_role(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_add_column(character=20varying,=20character=20varying,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_add_column_to_object_white_list(character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_add_config_value(character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_add_config_value_for_versions_up_to(character=20=
varying,=20character=20varying,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.fn_db_change_column_type(character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.fn_db_create_constraint(character=20=
varying,=20character=20varying,=20text)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.fn_db_create_index(character=20varying,=20character=20=
varying,=20text,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_delete_config_for_version(text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.fn_db_delete_config_value(character=20=
varying,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_delete_config_value_all_versions(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_drop_column(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_drop_constraint(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_get_async_tasks()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_grant_action_group_to_all_roles_filter(integer,=20=
uuid[])=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_is_table_exists(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.fn_db_mask_object(regclass)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.fn_db_remove_csv_config_value(character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_remove_uuid_from_csv(text,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.fn_db_rename_column(character=20=
varying,=20character=20varying,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.fn_db_rename_config_key(character=20=
varying,=20character=20varying,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.fn_db_rename_table(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_split_config_value(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.fn_db_unlock_all()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_unlock_disk(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_unlock_entity(character=20varying,=20character=20=
varying,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_unlock_snapshot(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_update_config_value(character=20varying,=20=
character=20varying,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.fn_db_update_default_config_value(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_get_ad_element_name(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_get_column_size(character=20varying,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_get_comparable_ip_list(text)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.fn_get_dedicated_hosts_ids_by_vm_id(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_get_entity_name(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.fn_get_entity_parents(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_get_num_of_vcpus(vm_static)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.fn_image_deleted()=20cascade;=0A=20drop=20function=20=
if=20exists=20=
public.fn_perms_get_storage_pools_with_permitted_action_on_clusters(uuid,=20=
integer,=20boolean,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_user_permissions(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.fnsplitter(text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.fnsplitterinteger(text)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.fnsplitteruuid(text)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.fnsplitterwithseperator(text,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.force_delete_storage_domain(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.freehostdevicesusedbyvmid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.generate_drop_all_functions_syntax()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.generate_drop_all_seq_syntax()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.generate_drop_all_tables_syntax()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.generate_drop_all_user_types_syntax()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.generate_drop_all_views_syntax()=20=
cascade;=0A=20drop=20function=20if=20exists=20public.get_all_commands()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.get_entity_permissions(uuid,=20integer,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.get_entity_permissions_for_user_and_groups(uuid,=20text,=20=
integer,=20uuid,=20integer,=20boolean)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.get_entity_snapshot_by_command_id(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.get_entity_snapshot_by_id(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.get_oauth_client(character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.get_role_groups_by_role_id(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.get_roles_groups_by_action_group_id_and_by_role_id(integer,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.get_seconds_to_wait_before_pm_operation(character=20varying,=20=
character=20varying,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getaccessprotocolsbyglustervolumeguid(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getallbystatus(integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getalldatacentersbymacpoolid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromasync_tasks()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromauditlog(uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfrombasedisks()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfrombookmarks()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getallfromclusterpolicys()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromclusterpolicyunits()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromcommandentities()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromcpuprofiles()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getallfromcustom_actions()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromdisk_image_dynamic()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromdisklunmaps()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromdiskprofiles()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getallfromglusterservices()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromhostdevices()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromhostnicvfsconfigs()=20=
cascade;=0A=20drop=20function=20if=20exists=20public.getallfromimages()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromimageuploads()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromiscsibonds()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getallfromlibvirtsecrets()=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getallfromlun_storage_server_connection_map()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfrommacpools()=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getallfromnetwork(uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromnetwork_cluster()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromnetwork_clusterbyclusterid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getallfromnetwork_clusterbynetworkid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromnetworkattachments()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromnumanode()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromnumanodecpumap()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfrompolicyunits()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromproviders()=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getallfromprovidersbytypes(character=20varying[])=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromrole(integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromsnapshots()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromsnapshotsbyvmid(uuid,=20uuid,=20boolean,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromstorage_domain_dynamic()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromstorage_domain_static()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromstorage_pool(uuid,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromstorage_pool_iso_map()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromstorageserverconnectionextensions()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromtags()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromtags_user_group_map()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromtags_user_map()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromtags_vds_map()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getallfromtags_vm_map()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromtags_vm_pool_map()=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getallfromusers(uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromvdcoption()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromvds_spm_id_map()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromvdscpustatistics()=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getallfromvdsdynamic()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromvdsstatic()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromvdsstatistics()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromvm_pool_map()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromvm_pools()=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getallfromvmdynamic()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromvmicondefaults()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromvmicons()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromvmiconsfiltered(uuid,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromvminterfaces()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromvmstatic()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromvmstaticbystoragepoolid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromvmstatistics()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromvnicprofiles()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallgroups()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallhashesfromvmdynamic()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallimageuploadids()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getalljobidsbyentityid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.getalljobs()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getalllibvirtsecretsbyproviderid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallmacpoolrangesbymacpoolid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallmacsbymacpoolid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallmanagementnetworksbydatacenterid(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getallnetworkbyclusterid(uuid,=20=
uuid,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getallnetworkbystoragepoolid(uuid,=20uuid,=20boolean)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getallnetworkfilters()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallnetworklabelsbydatacenterid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallnetworksbynetworkproviderid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallnetworksbyqosid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallnonadminroles(integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getallovfentitiesforstoragedomainbyentitytype(uuid,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getallqosbyqostype(smallint)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallqosforstoragepool(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallqosforstoragepoolbyqostype(uuid,=20=
smallint)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getallsnapshotsbystoragedomainid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallsteps()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallstorage_server_connections()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallsupportednetworkfiltersbyversion(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallunfinishedvdskdumpstatus()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getallvfsconfigbyhostid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallvmjobs()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getanyadminrolebyuseridandgroupids(uuid,=20=
text,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getasync_tasksbytask_id(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getasynctaskentitiesbytaskid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getasynctasksbyentityid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getasynctasksbystoragepoolid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getasynctasksbyvdsmtaskid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getasynctasksidsbyentityid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getauditlogbyauditlogid(integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getauditlogbyoriginandcustomeventid(character=20varying,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getauditlogbyvmid(uuid,=20uuid,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getauditlogbyvmtemplateid(uuid,=20uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getauditlogbyvolumeidandtype(uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getauditloglaterthendate(timestamp=20with=20time=20zone)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getbasediskbybasediskid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getbasedisksbyalias(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getbookmarkbybookmark_id(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getbookmarkbybookmark_name(character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getbrickdetailsbyid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getclusterfeaturesbyversionandcategory(character=20varying,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getclusterpolicybyclusterpolicyid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getclusterpolicyunitsbyclusterpolicyid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getcommandassociatedentities(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getcommandentitiesbyparentcmdid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getcommandentitybycommandentityid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getcommandidsbyentityid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getconnectionsbyiscsibondid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getcpuprofilebycpuprofileid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getcpuprofilesbyclusterid(uuid,=20uuid,=20boolean,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getcpuprofilesbyqosid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getcustom_actionsbyaction_id(integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getcustom_actionsbynameandtab(character=20varying,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getcustom_actionsbytab_id(integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getdbgeneration(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getdcidbyexternalnetworkid(text)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.getdefaultmacpool()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getdisk_image_dynamicbyimage_id(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getdiskbydiskidandstoragedomainid(uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getdisklunmapbydisklunmapid(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getdisklunmapbylunid(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getdiskprofilebydiskprofileid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getdiskprofilesbyqosid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getdiskprofilesbystoragedomainid(uuid,=20uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getdisksvmguidbasicview(uuid,=20boolean,=20uuid,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getdwhhistorytimekeepingbyvarname(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getelementidsbyidandgroups(uuid,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getenginesession(integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getenginesessionbysessionid(text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getentitiesbydiskid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getevent_subscriberbysubscriber_id(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getexternalidsfromsteps(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getexternalvariablebyname(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getfenceagentbyid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getfenceagentsbyvdsid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getglobalids(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getglusterclusterservicesbyclusterid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getglusterclusterservicesbyclusteridandservicetype(uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getglustergeorepsessiondetails(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getglustergeorepsessiondetailsforbrick(uuid,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getglustergeorepsessionunsetconfig(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getglusterhook(uuid,=20character=20=
varying,=20character=20varying,=20character=20varying,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getglusterhookbyid(uuid,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getglusterhookcontentbyid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getglusterhooksbyclusterid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getglusteroptionbyid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getglusterserverbyglusterserveruuid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getglusterserverbyserverid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getglusterservicebyglusterserviceid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getglusterservicebytypeandname(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getglusterservicesbytype(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getglusterservicetypes()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getglustervolumedetailsbyid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getglustervolumesnapshotconfigbyclusterid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getglustervolumesnapshotconfigbyclusteridandname(uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getglustervolumesnapshotconfigbyvolumeid(uuid,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getglustervolumesnapshotconfigbyvolumeidandname(uuid,=20uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getgroupbyexternalid(character=20varying,=20text)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getgroupbyid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getgroupbyname(character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.gethostdevicebyhostidanddevicename(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.gethostdevicesbyhostid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.gethostdevicesbyhostidandiommugroup(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.gethostnetworksbycluster(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.gethostnicvfsconfigbyid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.gethostsandvmsforclusters(uuid[])=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getidsforovfdeletion(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getidsofhostswithstatus(integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getimage_storage_domain_mapbyimage_id(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getimage_storage_domain_mapbystorage_domain_id(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getimagebyimageid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getimageuploadsbycommandid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getimageuploadsbydiskid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getisclusterempty(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getiscsibondbyiscsibondid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getiscsibondsbynetworkid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getiscsibondsbystoragepoolid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getjobbyjobid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getjobsbycorrelationid(character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getjobsbyenginesessionseqidandstatus(bigint,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getjobsbyoffsetandpagesize(integer,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getjobsubjectentitybyjobid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getkdumpstatusforvds(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getlabelsbyvfsconfigid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getlastsuccessfulenginebackup(character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getlibvirtsecretbylibvirtsecretid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getlibvirtsecretsbypoolidonactivedomains(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getlun_storage_server_connection_mapbylun(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getlun_storage_server_connection_mapbylunbystorage_server_conn(char=
acter=20varying,=20character=20varying)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getmacpoolbymacpoolid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getmacsbydatacenterid(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getmanagementnetworkbycluster(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getnamesofhostsdedicatedtovm(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnamesofvmstaticdedicatedtovds(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getnetwork_clusterbycluster_idandbynetwork_id(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnetworkattachmentbynetworkattachmentid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getnetworkattachmentbynicidandnetworkid(uuid,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getnetworkattachmentsbyhostid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getnetworkattachmentsbynetworkid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnetworkattachmentsbynicid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getnetworkbyid(uuid,=20uuid,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnetworkbyname(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getnetworkbynameandcluster(character=20=
varying,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getnetworkbynameanddatacenter(character=20varying,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnetworkfilterbyid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getnetworkfilterbyname(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getnetworksbyiscsibondid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnetworksbyvfsconfigid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getnoncountablequtoavmstatuses()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getnumanodebynumanodeid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnumanodecpubynumanodeid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getnumberofimagesinstoragedomain(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getnumberofvmsincluster(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnumofsnapshotsbymemoryvolume(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getnvmtagsbyvmid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnvmtagsbyvmidanddefaulttag(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getoptionsbyglustervolumeguid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getorderedvmguidsforrunmultipleactions(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getovfdatabyentityidandstoragedomain(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getovfgeneration(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getpermissionbyroleid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getpolicyunitbypolicyunitid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getproviderbyname(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getproviderbyproviderid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.getqosbyqosid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.getquotacount()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getrepo_files_by_storage_domain(uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getrepo_files_in_all_storage_pools(integer,=20integer,=20integer,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getroleactiongroupsbyroleid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getrolebyname(character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getrolsbyid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getsessionuserandgroupsbyid(uuid,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getsnapshotbysnapshotid(uuid,=20uuid,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getsnapshotbyvmidandstatus(uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getsnapshotbyvmidandtype(uuid,=20character=20varying,=20uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getsnapshotbyvmidandtypeandstatus(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getsnapshotidsbyvmidandtype(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getsnapshotidsbyvmidandtypeandstatus(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getstepbystepid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getstepsbyexternaltaskid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getstepsbyjobid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getstepsbyparentstepid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_domain_dynamicbyid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getstorage_domain_staticbyid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_domain_staticbyname(character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getstorage_domain_staticbynamefiltered(character=20varying,=20=
uuid,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_domain_staticbystorage_pool_id(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getstorage_pool_iso_mapbystorage_idandbystorage_pool_id(uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_pool_iso_mapsbybystorage_pool_id(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_pool_iso_mapsbystorage_id(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getstorage_poolbyid(uuid,=20uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_poolbyname(character=20varying,=20boolean)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getstorage_poolsbyclusterid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getstorage_poolsbystoragedomainid(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getstorage_poolsbyvdsid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_server_connectionsbyconnection(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_server_connectionsbyid(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getstorage_server_connectionsbyiqn(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_server_connectionsbyiqnandconnection(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getstorage_server_connectionsbykey(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_server_connectionsbylunid(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_server_connectionsbystoragetype(integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getstorage_server_connectionsbyvolumegroupid(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorageconnectionsbystoragetypeandstatus(uuid,=20integer,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getstoragedevicebyid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getstoragedevicesbyvdsid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getstoragedomainidsbystoragepoolidandstatus(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstoragepoolsbyclusterservice(boolean,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getstorageserverconnectionextensionbyid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getstorageserverconnectionextensionsbyhostid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getstorageserverconnectionextensionsbyhostidandtarget(uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorageserverconnectionsbyids(text)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getstorageserverconnectionsfordomain(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getsupportedhostfeaturesbyhostid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getsystem_statistics(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.gettags_vm_pool_mapbytag_idandbyvm_pool_id(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.gettagsbyparent_id(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.gettagsbytag_id(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.gettagsbytag_name(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.gettaguserbytagidandbyuserid(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.gettagusergroupbygroupidandbytagid(uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.gettagvdsbytagidandbyvdsid(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.gettagvmbytagidandbyvmid(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.gettemplatecount()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.gettransporttypesbyglustervolumeguid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getuserandgroupsbyid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getuserbyexternalid(character=20=
varying,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getuserbyuserid(uuid,=20boolean)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getuserbyusernameanddomain(character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getusersbyvmguid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getvdcoptionbyid(integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvdcoptionbyname(character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getvds_spm_id_mapbystorage_pool_id(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getvds_spm_id_mapbystorage_pool_idandbyvds_spm_id(uuid,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getvds_spm_id_mapbyvds_id(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvdscpustatisticsbyvdsid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getvdsdynamicbyvdsid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvdsstaticbyclusterid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvdsstaticbyhostname(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvdsstaticbyip(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvdsstaticbyvdsid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getvdsstaticbyvdsname(character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getvdsstatisticsbyvdsid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvfsconfigbynicid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvm_interface_statisticsbyid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvm_pool_mapbyvm_pool_id(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvmandtemplatesidsbystoragedomainid(uuid,=20=
boolean,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmdevicesattachedtohost(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvmdynamicbyvmguid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvmguestagentinterfacesbyvmid(uuid,=20=
uuid,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmiconbyvmicondataurl(text)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvmiconbyvmiconid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvmicondefaultbyvmicondefaultid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmicondefaultbyvmicondefaultlargeiconid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getvmicondefaultbyvmicondefaultosid(integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvmidsforversionupdate(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvminitbyids(text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getvminitbyvmid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvminterfacebytemplateid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getvminterfacebyvminterfaceid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvminterfacesbynetworkid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvminterfacesbyvmid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getvmmapsinvmpoolbyvmpoolidandstatus(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmnumanodebyvdsnumanodeid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getvmnumanodebyvdsnumanodeidwithpinnedinfo(uuid,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmsandtemplatesidswithoutattachedimagedisks(uuid,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmsdynamicrunningonvds(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvmsidsforovfupdate(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvmstaticbycluster(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getvmstaticbygroupidandnetwork(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmstaticbyname(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvmstaticbyvmguid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getvmstaticwithfailbackbyvdsid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvmstaticwithouticon()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getvmstatisticsbyvmguid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmtemplateinterfacesbynetworkid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvmtemplatesidsforovfupdate(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvnicprofilebyvnicprofileid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvnicprofilesbynetworkid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.increasestoragepoolmasterversion(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.incrementdbgeneration(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.incrementdbgenerationforallinstoragepool(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.insert_entity_snapshot(uuid,=20=
uuid,=20character=20varying,=20character=20varying,=20character=20=
varying,=20text,=20character=20varying,=20integer,=20integer)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.insert_osinfo(integer,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insert_roles_groups(integer,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertaffinitygroupwithmembers(uuid,=20=
character=20varying,=20character=20varying,=20uuid,=20boolean,=20=
boolean,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertasync_tasks(integer,=20integer,=20integer,=20uuid,=20=
uuid,=20uuid,=20uuid,=20uuid,=20uuid,=20timestamp=20with=20time=20zone,=20=
uuid,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertasynctaskentities(uuid,=20uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertauditlog(integer,=20timestamp=20with=20time=20zone,=20=
integer,=20character=20varying,=20integer,=20text,=20uuid,=20character=20=
varying,=20uuid,=20character=20varying,=20uuid,=20character=20varying,=20=
uuid,=20character=20varying,=20uuid,=20character=20varying,=20uuid,=20=
character=20varying,=20uuid,=20character=20varying,=20uuid,=20character=20=
varying,=20character=20varying,=20uuid,=20uuid,=20character=20varying,=20=
text,=20boolean,=20uuid,=20text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertbasedisk(uuid,=20boolean,=20character=20varying,=20=
character=20varying,=20character=20varying,=20boolean,=20integer,=20=
smallint,=20timestamp=20with=20time=20zone,=20smallint,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertbookmark(uuid,=20character=20varying,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertcluster(uuid,=20character=20varying,=20text,=20character=20=
varying,=20character=20varying,=20uuid,=20integer,=20boolean,=20=
character=20varying,=20boolean,=20integer,=20boolean,=20boolean,=20=
boolean,=20character=20varying,=20boolean,=20boolean,=20boolean,=20=
boolean,=20boolean,=20uuid,=20text,=20boolean,=20integer,=20smallint,=20=
character=20varying,=20boolean,=20smallint,=20character=20varying,=20=
character=20varying,=20boolean,=20boolean,=20smallint,=20boolean,=20=
boolean,=20boolean,=20character=20varying,=20boolean,=20character=20=
varying,=20integer,=20uuid,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertclusterfeature(uuid,=20character=20=
varying,=20character=20varying,=20integer,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertclusterpolicy(uuid,=20character=20=
varying,=20character=20varying,=20boolean,=20boolean,=20text)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.insertclusterpolicyunit(uuid,=20=
uuid,=20integer,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertcommandassociatedentities(uuid,=20uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertcommandentity(uuid,=20bigint,=20uuid,=20integer,=20uuid,=20=
uuid,=20uuid,=20uuid,=20text,=20character=20varying,=20timestamp=20with=20=
time=20zone,=20character=20varying,=20boolean,=20boolean,=20text,=20=
character=20varying,=20text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertcpuprofile(uuid,=20character=20varying,=20uuid,=20=
uuid,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertcpuqos(uuid,=20smallint,=20character=20varying,=20text,=20=
uuid,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertcustom_actions(integer,=20character=20varying,=20character=20=
varying,=20integer,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertdedicatedhoststovm(uuid,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertdisk_image_dynamic(uuid,=20integer,=20integer,=20bigint,=20=
numeric,=20numeric,=20numeric)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertdisklunmap(uuid,=20character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.insertdiskprofile(uuid,=20=
character=20varying,=20uuid,=20uuid,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertdiskvmelement(uuid,=20uuid,=20=
boolean,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertenginesession(integer,=20text,=20uuid,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertevent_notification_hist(bigint,=20character=20=
varying,=20character,=20character,=20timestamp=20with=20time=20zone,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertevent_subscriber(character=20varying,=20character=20=
varying,=20character=20varying,=20uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertexternalauditlog(integer,=20timestamp=20with=20time=20zone,=20=
integer,=20character=20varying,=20integer,=20text,=20uuid,=20character=20=
varying,=20uuid,=20character=20varying,=20uuid,=20character=20varying,=20=
uuid,=20character=20varying,=20uuid,=20character=20varying,=20uuid,=20=
character=20varying,=20uuid,=20character=20varying,=20uuid,=20character=20=
varying,=20character=20varying,=20uuid,=20uuid,=20character=20varying,=20=
text,=20uuid,=20text,=20character=20varying,=20integer,=20integer,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertexternalvariable(character=20varying,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertfenceagent(uuid,=20uuid,=20integer,=20character=20varying,=20=
character=20varying,=20character=20varying,=20text,=20text,=20boolean,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglusterclusterservice(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustergeorepsession(uuid,=20uuid,=20character=20varying,=20=
character=20varying,=20uuid,=20character=20varying,=20uuid,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertglustergeorepsessionconfig(uuid,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertglustergeorepsessiondetail(uuid,=20uuid,=20=
character=20varying,=20uuid,=20character=20varying,=20character=20=
varying,=20character=20varying,=20bigint,=20bigint,=20bigint,=20bigint,=20=
timestamp=20without=20time=20zone,=20timestamp=20without=20time=20zone,=20=
timestamp=20without=20time=20zone,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertglusterhook(uuid,=20uuid,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
text,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglusterserver(uuid,=20uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglusterserverhook(uuid,=20uuid,=20character=20varying,=20=
character=20varying,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertglusterserverservice(uuid,=20uuid,=20=
uuid,=20integer,=20character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustervolume(uuid,=20uuid,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20integer,=20=
integer,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustervolumeaccessprotocol(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustervolumebrick(uuid,=20uuid,=20uuid,=20character=20=
varying,=20integer,=20character=20varying,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertglustervolumebrickdetails(uuid,=20=
bigint,=20bigint,=20bigint)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertglustervolumedetails(uuid,=20bigint,=20bigint,=20=
bigint)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustervolumeoption(uuid,=20uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustervolumesnapshot(uuid,=20character=20varying,=20uuid,=20=
character=20varying,=20character=20varying,=20timestamp=20with=20time=20=
zone)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustervolumesnapshotconfig(uuid,=20uuid,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertglustervolumesnapshotschedule(uuid,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20integer,=20timestamp=20with=20time=20=
zone,=20time=20without=20time=20zone,=20character=20varying,=20timestamp=20=
with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustervolumetransporttype(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.insertgroup(uuid,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
text,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.inserthostdevice(uuid,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20integer,=20character=20varying,=20=
character=20varying,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.inserthostnetworkqos(uuid,=20smallint,=20character=20=
varying,=20text,=20uuid,=20integer,=20integer,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.inserthostnicvfsconfig(uuid,=20=
uuid,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertimage(timestamp=20with=20time=20zone,=20uuid,=20uuid,=20=
bigint,=20uuid,=20integer,=20timestamp=20with=20time=20zone,=20uuid,=20=
integer,=20integer,=20uuid,=20boolean,=20smallint)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertimage_storage_domain_map(uuid,=20=
uuid,=20uuid,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertimageuploads(uuid,=20integer,=20integer,=20timestamp=20=
without=20time=20zone,=20character=20varying,=20uuid,=20uuid,=20uuid,=20=
character=20varying,=20character=20varying,=20bigint,=20bigint)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertiscsibond(uuid,=20character=20varying,=20character=20=
varying,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertjob(uuid,=20character=20varying,=20text,=20character=20=
varying,=20uuid,=20bigint,=20boolean,=20timestamp=20with=20time=20zone,=20=
timestamp=20with=20time=20zone,=20timestamp=20with=20time=20zone,=20=
character=20varying,=20boolean,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertjobsubjectentity(uuid,=20uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertlibvirtsecret(uuid,=20text,=20integer,=20text,=20uuid,=20=
timestamp=20with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertlun_storage_server_connection_map(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertluns(character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20character=20=
varying,=20character=20varying,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertmacpool(uuid,=20character=20=
varying,=20boolean,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertmacpoolrange(uuid,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertnetwork(character=20varying,=20character=20=
varying,=20text,=20uuid,=20character=20varying,=20character=20varying,=20=
character=20varying,=20integer,=20integer,=20boolean,=20uuid,=20integer,=20=
boolean,=20uuid,=20text,=20uuid,=20text)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.insertnetwork_cluster(uuid,=20uuid,=20integer,=20=
boolean,=20boolean,=20boolean,=20boolean,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.insertnetworkattachment(uuid,=20=
uuid,=20uuid,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20integer,=20character=20varying,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertnetworkqos(uuid,=20smallint,=20=
character=20varying,=20text,=20uuid,=20integer,=20integer,=20integer,=20=
integer,=20integer,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertnumanode(uuid,=20uuid,=20uuid,=20smallint,=20=
bigint,=20smallint,=20bigint,=20integer,=20numeric,=20numeric,=20=
numeric,=20integer,=20text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertnumanodecpu(uuid,=20uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.insertnumanodemap(uuid,=20uuid,=20=
uuid,=20smallint,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertorupdateasynctasks(integer,=20integer,=20integer,=20=
uuid,=20uuid,=20uuid,=20uuid,=20uuid,=20uuid,=20timestamp=20with=20time=20=
zone,=20uuid,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertorupdatecommandentity(uuid,=20bigint,=20uuid,=20integer,=20=
uuid,=20uuid,=20uuid,=20uuid,=20text,=20character=20varying,=20timestamp=20=
with=20time=20zone,=20character=20varying,=20boolean,=20boolean,=20text,=20=
character=20varying,=20text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertorupdateuser(character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20uuid,=20character=20varying,=20text,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertovfdataforentities(uuid,=20character=20varying,=20character=20=
varying,=20integer,=20character=20varying,=20uuid,=20text,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertpermission(uuid,=20uuid,=20uuid,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertpolicyunit(uuid,=20character=20varying,=20text,=20boolean,=20=
smallint,=20text,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertprovider(uuid,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20boolean,=20=
character=20varying,=20text,=20text,=20character=20varying,=20character=20=
varying,=20text,=20text,=20text,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertquota(uuid,=20uuid,=20character=20=
varying,=20character=20varying,=20integer,=20integer,=20integer,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertquotalimitation(uuid,=20uuid,=20uuid,=20uuid,=20integer,=20=
bigint,=20bigint)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertrepo_domain_file_meta_data(uuid,=20character=20varying,=20=
character=20varying,=20bigint,=20timestamp=20with=20time=20zone,=20=
bigint,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertrole(character=20varying,=20uuid,=20character=20varying,=20=
boolean,=20integer,=20boolean,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertsnapshot(uuid,=20uuid,=20character=20=
varying,=20character=20varying,=20character=20varying,=20timestamp=20=
with=20time=20zone,=20text,=20text,=20character=20varying,=20uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertstep(uuid,=20uuid,=20uuid,=20character=20varying,=20text,=20=
integer,=20character=20varying,=20timestamp=20with=20time=20zone,=20=
timestamp=20with=20time=20zone,=20character=20varying,=20uuid,=20=
character=20varying,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertstorage_domain_dynamic(integer,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertstorage_domain_static(uuid,=20character=20varying,=20=
character=20varying,=20character=20varying,=20text,=20integer,=20=
integer,=20character=20varying,=20bigint,=20boolean,=20integer,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertstorage_pool(character=20varying,=20text,=20uuid,=20=
character=20varying,=20integer,=20boolean,=20integer,=20uuid,=20=
character=20varying,=20integer,=20uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.insertstorage_pool_iso_map(uuid,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertstorage_server_connections(character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20text,=20integer,=20text,=20character=20varying,=20character=20=
varying,=20character=20varying,=20smallint,=20smallint)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.insertstoragedevice(uuid,=20text,=20=
character=20varying,=20character=20varying,=20uuid,=20text,=20character=20=
varying,=20text,=20character=20varying,=20text,=20bigint,=20boolean,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertstoragedomainovfinfo(uuid,=20integer,=20uuid,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertstorageqos(uuid,=20smallint,=20character=20varying,=20text,=20=
uuid,=20integer,=20integer,=20integer,=20integer,=20integer,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertstorageserverconnectionextension(uuid,=20uuid,=20character=20=
varying,=20text,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertsupportedclusterfeature(uuid,=20uuid,=20boolean)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.insertsupportedhostfeature(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.inserttags(character=20varying,=20uuid,=20character=20varying,=20=
uuid,=20boolean,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.inserttags_user_group_map(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.inserttags_user_map(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.inserttags_vds_map(uuid,=20uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.inserttags_vm_map(uuid,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.inserttags_vm_pool_map(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertunregistereddisk(uuid,=20uuid,=20=
character=20varying,=20character=20varying,=20uuid,=20timestamp=20with=20=
time=20zone,=20timestamp=20with=20time=20zone,=20integer,=20integer,=20=
bigint,=20bigint)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertunregistereddiskstovms(uuid,=20uuid,=20character=20varying,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertuser(character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20uuid,=20character=20varying,=20text,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertuserprofile(uuid,=20uuid,=20uuid,=20text,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvdcoption(character=20varying,=20character=20varying,=20=
character=20varying,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertvds_interface(character=20varying,=20character=20=
varying,=20integer,=20character=20varying,=20uuid,=20boolean,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20character=20=
varying,=20integer,=20integer,=20uuid,=20character=20varying,=20integer,=20=
integer,=20boolean,=20text,=20integer,=20character=20varying,=20integer,=20=
character=20varying,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertvds_interface_statistics(uuid,=20=
numeric,=20numeric,=20bigint,=20bigint,=20numeric,=20numeric,=20bigint,=20=
bigint,=20integer,=20double=20precision,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertvds_spm_id_map(uuid,=20uuid,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvdscpustatistics(uuid,=20uuid,=20integer,=20numeric,=20=
numeric,=20numeric,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertvdsdynamic(integer,=20integer,=20character=20=
varying,=20numeric,=20character=20varying,=20boolean,=20integer,=20=
integer,=20integer,=20uuid,=20integer,=20integer,=20integer,=20integer,=20=
integer,=20integer,=20integer,=20integer,=20character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
integer,=20character=20varying,=20integer,=20integer,=20integer,=20=
boolean,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20integer,=20=
text,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20text,=20text,=20boolean,=20smallint,=20integer,=20smallint,=20=
boolean,=20character=20varying,=20text,=20boolean,=20boolean,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvdsstatic(text,=20uuid,=20character=20varying,=20character=20=
varying,=20integer,=20smallint,=20uuid,=20character=20varying,=20=
boolean,=20integer,=20integer,=20boolean,=20character=20varying,=20=
boolean,=20integer,=20character=20varying,=20character=20varying,=20=
integer,=20character=20varying,=20boolean,=20uuid,=20uuid,=20text,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvdsstatistics(numeric,=20numeric,=20numeric,=20numeric,=20=
integer,=20integer,=20integer,=20uuid,=20bigint,=20bigint,=20bigint,=20=
bigint,=20bigint,=20integer,=20bigint,=20boolean,=20integer,=20bigint,=20=
integer,=20boolean,=20boolean,=20boolean,=20boolean,=20timestamp=20with=20=
time=20zone)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvfsconfiglabel(uuid,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertvfsconfignetwork(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvm_interface_statistics(uuid,=20numeric,=20numeric,=20=
bigint,=20bigint,=20numeric,=20numeric,=20bigint,=20bigint,=20integer,=20=
double=20precision,=20uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertvm_pool_map(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertvm_pools(character=20varying,=20=
text,=20uuid,=20character=20varying,=20integer,=20boolean,=20character=20=
varying,=20integer,=20uuid,=20smallint,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvmdevice(uuid,=20uuid,=20character=20varying,=20character=20=
varying,=20character=20varying,=20integer,=20text,=20boolean,=20boolean,=20=
boolean,=20character=20varying,=20text,=20uuid,=20character=20varying,=20=
boolean,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertvmdynamic(text,=20character=20varying,=20character=20=
varying,=20uuid,=20character=20varying,=20uuid,=20uuid,=20integer,=20=
uuid,=20character=20varying,=20character=20varying,=20character=20=
varying,=20timestamp=20with=20time=20zone,=20timestamp=20with=20time=20=
zone,=20integer,=20boolean,=20integer,=20boolean,=20integer,=20integer,=20=
uuid,=20character=20varying,=20integer,=20integer,=20integer,=20=
character=20varying,=20integer,=20numeric,=20character=20varying,=20=
boolean,=20character=20varying,=20character=20varying,=20character=20=
varying,=20integer,=20integer,=20integer,=20integer,=20character=20=
varying,=20integer,=20character=20varying,=20integer,=20bigint,=20=
bigint,=20bigint,=20integer,=20character=20varying,=20integer,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertvmguestagentinterface(uuid,=20=
character=20varying,=20character=20varying,=20text,=20text)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.insertvmicon(uuid,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvmicondefault(uuid,=20integer,=20uuid,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.insertvminit(uuid,=20text,=20=
text,=20text,=20boolean,=20character=20varying,=20text,=20text,=20text,=20=
text,=20character=20varying,=20text,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.insertvminterface(uuid,=20=
character=20varying,=20character=20varying,=20integer,=20uuid,=20uuid,=20=
uuid,=20integer,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertvmjobs(uuid,=20uuid,=20integer,=20integer,=20=
integer,=20integer,=20bigint,=20bigint,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertvmstatic(character=20varying,=20=
text,=20integer,=20integer,=20integer,=20uuid,=20uuid,=20character=20=
varying,=20uuid,=20timestamp=20with=20time=20zone,=20integer,=20boolean,=20=
boolean,=20boolean,=20integer,=20integer,=20integer,=20integer,=20=
character=20varying,=20boolean,=20boolean,=20boolean,=20boolean,=20=
character=20varying,=20text,=20boolean,=20integer,=20integer,=20integer,=20=
integer,=20integer,=20integer,=20character=20varying,=20integer,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
integer,=20character=20varying,=20character=20varying,=20integer,=20=
uuid,=20character=20varying,=20boolean,=20boolean,=20character=20=
varying,=20boolean,=20uuid,=20uuid,=20uuid,=20uuid,=20character=20=
varying,=20integer,=20integer,=20smallint,=20character=20varying,=20=
boolean,=20character=20varying,=20boolean,=20boolean,=20uuid,=20boolean,=20=
boolean,=20character=20varying,=20character=20varying,=20uuid,=20uuid,=20=
character=20varying,=20character=20varying,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertvmstatistics(numeric,=20numeric,=20=
numeric,=20integer,=20integer,=20integer,=20integer,=20text,=20text,=20=
text,=20text,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvmtemplate(integer,=20timestamp=20with=20time=20zone,=20=
character=20varying,=20text,=20integer,=20integer,=20character=20=
varying,=20integer,=20integer,=20integer,=20integer,=20uuid,=20uuid,=20=
integer,=20boolean,=20boolean,=20integer,=20integer,=20character=20=
varying,=20boolean,=20integer,=20integer,=20integer,=20integer,=20=
integer,=20integer,=20boolean,=20boolean,=20boolean,=20boolean,=20=
character=20varying,=20boolean,=20character=20varying,=20integer,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
uuid,=20integer,=20text,=20boolean,=20character=20varying,=20integer,=20=
boolean,=20uuid,=20character=20varying,=20integer,=20uuid,=20character=20=
varying,=20smallint,=20character=20varying,=20boolean,=20boolean,=20=
boolean,=20uuid,=20character=20varying,=20boolean,=20boolean,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20uuid,=20uuid,=20character=20varying,=20character=20=
varying,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvnicprofile(uuid,=20character=20varying,=20uuid,=20uuid,=20=
boolean,=20boolean,=20text,=20text,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.inst_add_glance_provider(uuid,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
uuid,=20boolean,=20character=20varying,=20text,=20text,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.inst_add_iso_storage_domain(uuid,=20character=20varying,=20uuid,=20=
character=20varying,=20integer,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.inst_update_default_storage_pool_type(boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.inst_update_service_type(uuid,=20=
boolean,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.isanyvmrunonvds(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.ismaterializedviewrefreshed(name)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.ismemballoonenabled(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.isquotainuse(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.isvmiconexist(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.loadovfdataforids(character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.loadstoragedomaininfobydiskid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.loadstoragedomaininfobydomainid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.loadstoragedomainsforovfids(text)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.logenginebackupevent(character=20varying,=20=
timestamp=20with=20time=20zone,=20integer,=20text,=20character=20=
varying,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.markhostdevicesusedbyvmid(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.nullifyqosforstoragedomain(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.refreshallmaterializedviews(boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.refreshmaterializedview(name)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.remove_entities_from_storage_domain(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.removeallvmtagsbyvmid(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.removeauditlogbybrickidlogtype(uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.removeconnectionfromiscsibond(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.removediskfromunregistered(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.removediskfromunregisteredrelatedtovm(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.removeentityfromunregistered(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.removefinishedkdumpstatusforvds(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.removememoryfromsnapshotbysnapshotid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.removememoryfromsnapshotbyvmidandtype(uuid,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.removenetworkattachmentbynetworkid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.removenetworkfromiscsibond(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.removesupportedhostfeature(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.removevmfromaffinitygroups(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.set_network_exclusively_as_display(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.set_network_exclusively_as_gluster(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.set_network_exclusively_as_management(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.set_network_exclusively_as_migration(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.setallauditlogalerts(integer,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.sethashbyvmguid(uuid,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.settounknown(uuid[],=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.setvmidonhostdevice(uuid,=20character=20varying,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.setvmpoolbeingdestroyed(uuid,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.sso_oauth_client_exists(character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.sso_oauth_register_client(character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20text,=20character=20varying,=20boolean,=20character=20=
varying,=20character=20varying,=20boolean,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.sso_oauth_unregister_client(character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.to_interval(integer)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.update_oauth_client(character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20text,=20character=20varying,=20boolean,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.update_oauth_client_callback_prefix(character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateaffinitygroupwithmembers(uuid,=20character=20varying,=20=
character=20varying,=20uuid,=20boolean,=20boolean,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateasync_tasks(integer,=20integer,=20integer,=20uuid,=20uuid,=20=
uuid,=20uuid,=20uuid,=20uuid,=20uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.updatebasedisk(uuid,=20boolean,=20character=20=
varying,=20character=20varying,=20character=20varying,=20boolean,=20=
integer,=20smallint,=20timestamp=20with=20time=20zone,=20smallint,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatebookmark(uuid,=20character=20varying,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatecluster(character=20varying,=20text,=20character=20varying,=20=
uuid,=20character=20varying,=20uuid,=20integer,=20boolean,=20character=20=
varying,=20boolean,=20integer,=20boolean,=20boolean,=20boolean,=20=
boolean,=20character=20varying,=20boolean,=20boolean,=20boolean,=20=
boolean,=20boolean,=20uuid,=20text,=20boolean,=20integer,=20smallint,=20=
character=20varying,=20boolean,=20smallint,=20character=20varying,=20=
character=20varying,=20boolean,=20boolean,=20smallint,=20boolean,=20=
boolean,=20boolean,=20character=20varying,=20boolean,=20character=20=
varying,=20integer,=20uuid,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateclusteremulatedmachine(uuid,=20=
character=20varying,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateclusterfeature(uuid,=20character=20varying,=20=
character=20varying,=20integer,=20text)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.updateclusterpolicy(uuid,=20character=20varying,=20=
character=20varying,=20boolean,=20boolean,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatecommandentity(uuid,=20bigint,=20=
uuid,=20integer,=20uuid,=20uuid,=20uuid,=20uuid,=20text,=20character=20=
varying,=20character=20varying,=20boolean,=20boolean,=20text,=20=
character=20varying,=20text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatecommandentityexecuted(uuid,=20boolean)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.updatecommandentitynotified(uuid,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatecommandentitystatus(uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateconfigbyclusteridandname(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateconfigbyvolumeididandname(uuid,=20uuid,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateconsoleuserwithoptimisticlocking(uuid,=20uuid,=20=
character=20varying,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatecpuflags(uuid,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatecpuprofile(uuid,=20character=20varying,=20uuid,=20uuid,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatecpuqos(uuid,=20smallint,=20character=20varying,=20text,=20=
uuid,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatecustom_actions(integer,=20character=20varying,=20character=20=
varying,=20integer,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatededicatedhoststovm(uuid,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatedisk_image_dynamic(uuid,=20integer,=20integer,=20bigint,=20=
numeric,=20numeric,=20numeric)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatedisk_image_dynamic_by_disk_id_and_vm_id(uuid,=20=
uuid,=20integer,=20integer,=20bigint,=20numeric,=20numeric,=20numeric)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatediskprofile(uuid,=20character=20varying,=20uuid,=20uuid,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatediskprofilebyimagegroupid(uuid,=20uuid,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.updatediskvmelement(uuid,=20=
uuid,=20boolean,=20character=20varying)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.updatedwhhistorytimekeeping(character=20varying,=20=
character=20varying,=20timestamp=20with=20time=20zone)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updateexternalvariable(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatefenceagent(uuid,=20uuid,=20integer,=20character=20=
varying,=20character=20varying,=20character=20varying,=20text,=20text,=20=
boolean,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterbricktaskbyserveridbrickdir(uuid,=20character=20=
varying,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterclusterservice(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustergeorepsession(uuid,=20character=20varying,=20uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustergeorepsessionconfig(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustergeorepsessiondetail(uuid,=20uuid,=20character=20=
varying,=20uuid,=20character=20varying,=20character=20varying,=20=
character=20varying,=20bigint,=20bigint,=20bigint,=20bigint,=20timestamp=20=
without=20time=20zone,=20timestamp=20without=20time=20zone,=20timestamp=20=
without=20time=20zone,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateglustergeorepsessionstatus(uuid,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterhook(uuid,=20character=20varying,=20character=20=
varying,=20character=20varying,=20text,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateglusterhookconflictstatus(uuid,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterhookcontent(uuid,=20character=20varying,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterhookcontenttype(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterhookstatus(uuid,=20character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.updateglusterserver(uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterserverhook(uuid,=20uuid,=20character=20varying,=20=
character=20varying,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateglusterserverhookchecksum(uuid,=20=
uuid,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateglusterserverhookstatus(uuid,=20uuid,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterserverknownaddresses(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterserverpeerstatus(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterserverservice(uuid,=20integer,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateglusterserverservicebyserveridandservicetype(uuid,=20=
uuid,=20integer,=20character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolume(uuid,=20uuid,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20integer,=20=
integer,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumeasynctask(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateglustervolumebrick(uuid,=20uuid,=20=
uuid,=20character=20varying,=20character=20varying,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.updateglustervolumebrickasynctask(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updateglustervolumebrickdetails(uuid,=20bigint,=20bigint,=20=
bigint)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumebricknetworkid(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updateglustervolumebrickorder(uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updateglustervolumebrickstatus(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumebrickunsyncedentries(uuid,=20integer,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumedetails(uuid,=20bigint,=20bigint,=20bigint)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumeoption(uuid,=20character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.updateglustervolumesnapshotschedulebyvolumeid(uuid,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20integer,=20timestamp=20with=20time=20=
zone,=20time=20without=20time=20zone,=20character=20varying,=20timestamp=20=
with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumesnapshotstatus(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumesnapshotstatusbyname(uuid,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateglustervolumestatus(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumestatusbyname(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updategroup(uuid,=20character=20varying,=20character=20varying,=20=
character=20varying,=20text,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateguestagentstatus(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatehostdevice(uuid,=20character=20varying,=20character=20=
varying,=20character=20varying,=20integer,=20character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20integer,=20character=20varying,=20character=20=
varying,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatehostexternalstatus(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatehostnetworkqos(uuid,=20smallint,=20=
character=20varying,=20text,=20uuid,=20integer,=20integer,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatehostnicvfsconfig(uuid,=20uuid,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updateimage(timestamp=20with=20=
time=20zone,=20uuid,=20uuid,=20bigint,=20uuid,=20integer,=20timestamp=20=
with=20time=20zone,=20uuid,=20integer,=20integer,=20uuid,=20boolean,=20=
smallint)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateimagesize(uuid,=20bigint,=20timestamp=20with=20time=20zone)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateimagestatus(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateimageuploads(uuid,=20integer,=20=
integer,=20timestamp=20without=20time=20zone,=20character=20varying,=20=
uuid,=20uuid,=20uuid,=20character=20varying,=20character=20varying,=20=
bigint,=20bigint)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateimagevmsnapshotid(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateiscsibond(uuid,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateisfreeflagbyid(uuid,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updateisinitialized(uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatejob(uuid,=20character=20varying,=20text,=20character=20=
varying,=20uuid,=20bigint,=20boolean,=20timestamp=20with=20time=20zone,=20=
timestamp=20with=20time=20zone,=20timestamp=20with=20time=20zone,=20=
character=20varying,=20boolean,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatejoblastupdatetime(uuid,=20=
timestamp=20with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatejobstepscompleted(uuid,=20character=20varying,=20=
timestamp=20with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatelabel(uuid,=20character=20varying,=20boolean,=20=
uuid[],=20uuid[])=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatelastadmincheckstatus(character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updatelibvirtsecret(uuid,=20text,=20=
integer,=20text,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatelun_storage_server_connection_map(character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateluns(character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20character=20=
varying,=20character=20varying,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatemacpool(uuid,=20character=20=
varying,=20boolean,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.updatematerializedviewminrefreshrate(name,=20integer)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.updatematerializedviewrefreshrate(name,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updatememory(character=20varying,=20=
uuid,=20uuid,=20uuid,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatenetwork(character=20varying,=20=
character=20varying,=20text,=20uuid,=20character=20varying,=20character=20=
varying,=20character=20varying,=20integer,=20integer,=20boolean,=20uuid,=20=
integer,=20boolean,=20uuid,=20text,=20uuid,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatenetwork_cluster(uuid,=20uuid,=20=
integer,=20boolean,=20boolean,=20boolean,=20boolean,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatenetwork_cluster_status(uuid,=20uuid,=20integer)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.updatenetworkattachment(uuid,=20=
uuid,=20uuid,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20integer,=20character=20varying,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatenetworkqos(uuid,=20smallint,=20=
character=20varying,=20text,=20uuid,=20integer,=20integer,=20integer,=20=
integer,=20integer,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatenumanode(uuid,=20smallint,=20bigint,=20smallint,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatenumanodestatistics(uuid,=20bigint,=20integer,=20numeric,=20=
numeric,=20numeric,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateoriginaltemplatename(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateovfgenerations(character=20varying,=20character=20varying,=20=
text,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateovfupdatedinfo(character=20varying,=20integer,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatepolicyunit(uuid,=20boolean,=20text,=20text)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updateprovider(uuid,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20boolean,=20character=20varying,=20text,=20text,=20character=20=
varying,=20character=20varying,=20text,=20text,=20text,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatequotaforimageandsnapshots(uuid,=20uuid,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.updatequotametadata(uuid,=20=
uuid,=20character=20varying,=20character=20varying,=20integer,=20=
integer,=20integer,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatereplicacount(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updaterole(character=20varying,=20uuid,=20=
character=20varying,=20boolean,=20integer,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updatesnapshot(uuid,=20uuid,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
timestamp=20with=20time=20zone,=20text,=20text,=20character=20varying,=20=
uuid,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatesnapshotcountdec(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatesnapshotcountinc(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatesnapshotid(uuid,=20uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.updatesnapshotstatus(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestartedexecutionentitiestounknown(timestamp=20with=20time=20=
zone)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestatusofimagesbyimagegroupid(uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updatestep(uuid,=20uuid,=20uuid,=20=
character=20varying,=20text,=20integer,=20character=20varying,=20=
timestamp=20with=20time=20zone,=20timestamp=20with=20time=20zone,=20=
character=20varying,=20uuid,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatestepexternalidandtype(uuid,=20=
uuid,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatestepstatusandendtime(uuid,=20character=20varying,=20=
timestamp=20with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatestorage_domain_dynamic(integer,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestorage_domain_static(uuid,=20character=20varying,=20=
character=20varying,=20character=20varying,=20text,=20integer,=20=
integer,=20integer,=20bigint,=20boolean,=20integer,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestorage_pool(character=20varying,=20text,=20uuid,=20=
character=20varying,=20integer,=20boolean,=20character=20varying,=20=
integer,=20uuid,=20character=20varying,=20integer,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updatestorage_pool_iso_map_status(uuid,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestorage_pool_partial(character=20varying,=20text,=20uuid,=20=
character=20varying,=20boolean,=20character=20varying,=20character=20=
varying,=20integer,=20uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatestorage_pool_status(uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updatestorage_server_connections(character=20varying,=20character=20=
varying,=20character=20varying,=20text,=20integer,=20character=20=
varying,=20character=20varying,=20text,=20character=20varying,=20=
character=20varying,=20character=20varying,=20smallint,=20smallint)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestoragedevice(uuid,=20text,=20character=20varying,=20=
character=20varying,=20text,=20character=20varying,=20text,=20character=20=
varying,=20text,=20bigint,=20boolean)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.updatestoragedomainexternalstatus(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestoragedomainovfinfo(uuid,=20integer,=20uuid,=20text,=20=
timestamp=20with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatestorageqos(uuid,=20smallint,=20character=20=
varying,=20text,=20uuid,=20integer,=20integer,=20integer,=20integer,=20=
integer,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestorageserverconnectionextension(uuid,=20uuid,=20character=20=
varying,=20text,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatesupportedclusterfeature(uuid,=20uuid,=20boolean)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.updatetags(character=20=
varying,=20uuid,=20character=20varying,=20uuid,=20boolean,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatetags_vm_pool_map(integer,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateuser(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20uuid,=20character=20=
varying,=20boolean,=20text,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateuserimpl(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20uuid,=20character=20=
varying,=20text,=20character=20varying)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.updateuserprofile(uuid,=20uuid,=20uuid,=20text,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevdcoption(character=20varying,=20character=20varying,=20=
integer,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatevds_interface(character=20varying,=20character=20=
varying,=20integer,=20character=20varying,=20uuid,=20boolean,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20character=20=
varying,=20integer,=20integer,=20uuid,=20character=20varying,=20integer,=20=
integer,=20boolean,=20text,=20character=20varying,=20character=20=
varying,=20integer,=20integer,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updatevds_interface_statistics(uuid,=20numeric,=20numeric,=20=
bigint,=20bigint,=20numeric,=20numeric,=20bigint,=20bigint,=20integer,=20=
double=20precision,=20uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatevdscpustatistics(uuid,=20integer,=20numeric,=20=
numeric,=20numeric,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatevdsdynamic(integer,=20integer,=20character=20=
varying,=20numeric,=20character=20varying,=20boolean,=20integer,=20=
integer,=20integer,=20uuid,=20integer,=20integer,=20integer,=20integer,=20=
integer,=20integer,=20integer,=20integer,=20character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
integer,=20character=20varying,=20integer,=20integer,=20integer,=20=
boolean,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20integer,=20=
text,=20integer,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20text,=20text,=20smallint,=20integer,=20smallint,=20=
boolean,=20character=20varying,=20text,=20text,=20boolean,=20boolean,=20=
text,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatevdsdynamicisupdateavailable(uuid,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevdsdynamicnetconfigdirty(uuid,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updatevdsdynamicpowermanagementpolicyflag(uuid,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevdsdynamicstatus(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatevdsdynamicstatusandreasons(uuid,=20=
integer,=20integer,=20text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatevdsstatic(character=20varying,=20text,=20character=20=
varying,=20integer,=20smallint,=20uuid,=20uuid,=20character=20varying,=20=
boolean,=20integer,=20integer,=20boolean,=20character=20varying,=20=
boolean,=20bigint,=20integer,=20character=20varying,=20character=20=
varying,=20integer,=20character=20varying,=20boolean,=20uuid,=20uuid,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevdsstaticlaststoredkernelcmdline(uuid,=20text)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.updatevdsstatistics(numeric,=20=
numeric,=20numeric,=20numeric,=20integer,=20integer,=20integer,=20uuid,=20=
bigint,=20bigint,=20bigint,=20bigint,=20bigint,=20integer,=20bigint,=20=
boolean,=20integer,=20bigint,=20integer,=20boolean,=20boolean,=20=
boolean,=20boolean,=20timestamp=20with=20time=20zone)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updatevm_interface_statistics(uuid,=20numeric,=20numeric,=20=
bigint,=20bigint,=20numeric,=20numeric,=20bigint,=20bigint,=20integer,=20=
double=20precision,=20uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatevm_pool_map(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatevm_pools(character=20varying,=20=
text,=20uuid,=20character=20varying,=20integer,=20boolean,=20character=20=
varying,=20integer,=20uuid,=20smallint,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmcpuprofileidforclusterid(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updatevmdevice(uuid,=20uuid,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
integer,=20text,=20boolean,=20boolean,=20boolean,=20character=20varying,=20=
text,=20uuid,=20character=20varying,=20boolean,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmdevicebootorder(uuid,=20uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updatevmdeviceforhotplugdisk(uuid,=20uuid,=20boolean)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.updatevmdeviceruntimeinfo(uuid,=20uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmdynamic(text,=20character=20varying,=20character=20=
varying,=20uuid,=20character=20varying,=20uuid,=20uuid,=20integer,=20=
uuid,=20character=20varying,=20character=20varying,=20character=20=
varying,=20timestamp=20with=20time=20zone,=20timestamp=20with=20time=20=
zone,=20integer,=20boolean,=20integer,=20boolean,=20integer,=20integer,=20=
uuid,=20character=20varying,=20integer,=20integer,=20integer,=20=
character=20varying,=20integer,=20numeric,=20character=20varying,=20=
boolean,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20integer,=20integer,=20integer,=20=
integer,=20character=20varying,=20integer,=20character=20varying,=20=
integer,=20bigint,=20bigint,=20bigint,=20integer,=20character=20varying,=20=
integer,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmdynamicstatus(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatevmicon(uuid,=20text)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updatevmicondefault(uuid,=20=
integer,=20uuid,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevminit(uuid,=20text,=20text,=20text,=20boolean,=20character=20=
varying,=20text,=20text,=20text,=20text,=20character=20varying,=20text,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevminterface(uuid,=20character=20varying,=20character=20=
varying,=20integer,=20uuid,=20uuid,=20uuid,=20integer,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.updatevmjobs(uuid,=20=
uuid,=20integer,=20integer,=20integer,=20integer,=20bigint,=20bigint,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmstatic(character=20varying,=20text,=20integer,=20integer,=20=
integer,=20uuid,=20uuid,=20character=20varying,=20uuid,=20timestamp=20=
with=20time=20zone,=20integer,=20boolean,=20boolean,=20boolean,=20=
integer,=20integer,=20integer,=20integer,=20character=20varying,=20=
boolean,=20boolean,=20boolean,=20boolean,=20character=20varying,=20text,=20=
boolean,=20integer,=20integer,=20integer,=20integer,=20integer,=20=
integer,=20character=20varying,=20integer,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20character=20=
varying,=20character=20varying,=20integer,=20uuid,=20character=20=
varying,=20boolean,=20boolean,=20character=20varying,=20boolean,=20uuid,=20=
uuid,=20uuid,=20uuid,=20character=20varying,=20integer,=20integer,=20=
smallint,=20character=20varying,=20boolean,=20character=20varying,=20=
boolean,=20boolean,=20uuid,=20boolean,=20boolean,=20character=20varying,=20=
character=20varying,=20uuid,=20uuid,=20uuid,=20character=20varying,=20=
character=20varying,=20uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatevmstatistics(numeric,=20numeric,=20numeric,=20=
integer,=20integer,=20integer,=20integer,=20text,=20text,=20text,=20=
text,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmtagsdefaultdisplaytype(uuid,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmtemplate(integer,=20timestamp=20with=20time=20zone,=20=
character=20varying,=20text,=20integer,=20integer,=20character=20=
varying,=20integer,=20integer,=20integer,=20integer,=20uuid,=20uuid,=20=
integer,=20boolean,=20boolean,=20integer,=20integer,=20character=20=
varying,=20boolean,=20integer,=20integer,=20integer,=20integer,=20=
integer,=20integer,=20boolean,=20boolean,=20boolean,=20boolean,=20=
character=20varying,=20boolean,=20character=20varying,=20integer,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
uuid,=20integer,=20text,=20boolean,=20character=20varying,=20integer,=20=
boolean,=20uuid,=20character=20varying,=20integer,=20character=20=
varying,=20smallint,=20character=20varying,=20boolean,=20boolean,=20=
boolean,=20uuid,=20character=20varying,=20boolean,=20boolean,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20uuid,=20uuid,=20character=20varying,=20character=20=
varying,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmtemplateshiftbasetemplate(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatevmtemplatestatus(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevnicprofile(uuid,=20character=20varying,=20uuid,=20uuid,=20=
boolean,=20boolean,=20text,=20text,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.upsertexternalvariable(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.upsertkdumpstatus(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.upsertkdumpstatusforip(character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.uuid_generate_v1()=20cascade;=0A=0A*********=20QUERY=20=
**********=0A=20drop=20function=20if=20exists=20=
public.activateallmaterializedviews(boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.activatematerializedview(name,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.addconnectiontoiscsibond(uuid,=20character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.addglusterserverknownaddress(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.addnetworktoiscsibond(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.attach_user_to_role(character=20varying,=20=
character=20varying,=20character=20varying,=20text,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.boundvmpoolprestartedvms(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.calculateallclusterusage()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.calculateallstorageusage()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.calculateclusterusage(uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.calculatestorageusage(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.checkdbconnection()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.checkifjobhastasks(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.checkifsnapshotexistsbyvmidandsnapshotid(uuid,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.checkifsnapshotexistsbyvmidandstatus(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.checkifsnapshotexistsbyvmidandtype(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.checkvmhostdeviceavailability(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.cleandownvms()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.clear_network_from_nics(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.clear_osinfo()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.clearallauditlogevents(integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.clearalldeviceaddressesbyvmid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.clearmigratingtovds(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.clearvmdeviceaddress(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.createallmaterializedviewsiindexes()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.createcustommaterializedview(name,=20=
name,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.createcustommaterializedview(name,=20name,=20integer,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.createcustommaterializedviewas(name,=20integer,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.createcustommaterializedviewas(name,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.createlabel(uuid,=20character=20=
varying,=20boolean,=20uuid[],=20uuid[])=20cascade;=0A=20drop=20function=20=
if=20exists=20public.creatematerializedview(name,=20name,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.creatematerializedview(name,=20name,=20integer,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.creatematerializedview(name,=20name,=20integer,=20boolean,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.creatematerializedviewas(name,=20integer,=20boolean,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.creatematerializedviewas(name,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.creatematerializedviewas(name,=20=
integer,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.delete_entity_snapshot_by_command_id(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.delete_roles_groups(integer,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteaffinitygroup(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deleteallcommandentities()=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.deleteallcommandentitiesbycommandid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteallfromenginesessions()=20cascade;=0A=
=20drop=20function=20if=20exists=20public.deleteallfromvmicondefaults()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteallglusterhooks(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deleteallunusedvmicons()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteallvfsconfiglabels(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteallvfsconfignetworks(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteasync_tasks(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deleteasynctasksbyvdsmtaskid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteauditalertlogbyvdsidandtype(uuid,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteauditalertlogbyvolumeidandtype(uuid,=20integer)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.deleteauditlog(integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteauditlogalertsbyvdsid(uuid,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteauditlogolderthendate(timestamp=20=
with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deletebackuprelatedalerts()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletebasedisk(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletebookmark(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletebypoolvds_spm_id_map(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.deletecluster(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteclusterpolicy(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deleteclusterpolicyunitsbyclusterpolicyid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletecommandentitiesbycommandid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.deletecommandentitiesolderthandate(timestamp=20with=20time=20=
zone)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deletecommandentity(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletecompletedjobsolderthandate(timestamp=20with=20time=20=
zone,=20timestamp=20with=20time=20zone)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletecpuprofile(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletecustom_actions(integer)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.deletedisk_image_dynamic(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletedisklunmap(uuid,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletediskprofile(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletediskvmelement(uuid,=20uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteenginesession(integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteentitysnapshotbycommandid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteevent_notification_hist(timestamp=20without=20time=20zone)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteevent_subscriber(character=20varying,=20character=20=
varying,=20uuid,=20character=20varying)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteexternalvariable(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletefenceagent(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletefenceagentsbyvdsid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteglustergeorepsession(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglusterhook(uuid,=20character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deleteglusterhookbyid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteglusterhooksbyids(text)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.deleteglusterserver(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglusterserverbyglusterserveruuid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteglusterserverhook(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglusterserverhookbyid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteglusterserverhooksbyids(text)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deleteglusterserverservice(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglustervolumeaccessprotocol(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglustervolumebrick(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteglustervolumebricks(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglustervolumebyguid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteglustervolumebyname(uuid,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglustervolumeoption(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteglustervolumeoptions(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglustervolumesbyclusterid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteglustervolumesbyguids(character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglustervolumesnapshotbyguid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleteglustervolumesnapshotbyname(uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteglustervolumesnapshotsbyvolumeid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.deleteglustervolumesnapshotschedulebyvolumeid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.deleteglustervolumessnapshotbyids(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.deleteglustervolumetransporttype(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.deletegroup(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletehostdevice(uuid,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletehostnicvfsconfig(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.deleteimage(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteimage_storage_domain_map(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.deleteimage_storage_domain_map_by_image_id(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deleteimageuploads(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteiscsibond(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletejob(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletejobolderthandatewithstatus(timestamp=20with=20time=20=
zone,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deletelabel(uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deletelibvirtsecret(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletelun(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.deletelun_storage_server_connection_map(character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deletemacpool(uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deletemacpoolrangesbymacpoolid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletenetwork(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletenetwork_cluster(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletenetworkattachment(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletenumanode(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletenumanodecpubynumanodeid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletenumanodemapbyvdsnumanodeid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletenumanodemapbyvmnumanodeid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.deleteorphanjobs()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteovfgenerations(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletepermission(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletepermissionsbyentityid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletepolicyunit(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deleteprovider(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deleteqos(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletequotabyquotaguid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletequotalimitationbyquotaguid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deleterepo_domain_file_list(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleterole(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deleterunningjobsoftasklesscommands()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletesnapshot(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletestep(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletestorage_domain_dynamic(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletestorage_domain_static(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletestorage_pool(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletestorage_pool_iso_map(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.deletestorage_server_connections(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.deletestoragedevicebyid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletestoragedomainovfinfo(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletestorageserverconnectionextension(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.deletetags(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletetags_user_group_map(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletetags_user_map(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletetags_vds_map(uuid,=20uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletetags_vm_map(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletetags_vm_pool_map(uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.deleteunpinnednumanodemapbyvmnumanodeid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deleteuser(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deleteuserprofile(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevdcoption(integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletevds(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletevds_interface(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletevds_interface_statistics(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevds_spm_id_map(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletevdscpustatisticsbyvdsid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletevdsdynamic(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletevdsstatic(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.deletevdsstatistics(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevfsconfiglabel(uuid,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletevfsconfignetwork(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.deletevm(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevm_interface_statistics(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.deletevm_pool_map(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletevm_pools(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.deletevmdevice(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevmdevicesbyvmidandtype(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevmdynamic(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletevmguestagentinterfacesbyvmid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletevmicon(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletevmicondefault(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevmiconifunused(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletevminit(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletevminterface(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletevmjobs(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.deletevmstatic(uuid,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.deletevmstatistics(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.deletevmtemplates(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.deletevnicprofile(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.displayallauditlogevents(integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.dropallcustommaterializedviews()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.dropallmaterializedviews()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.dropmaterializedview(name)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.existsvmdevicebyvmidandtype(uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_authz_entry_info(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_add_action_group_to_role(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_add_column(character=20varying,=20character=20varying,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_add_column_to_object_white_list(character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_add_config_value(character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_add_config_value_for_versions_up_to(character=20=
varying,=20character=20varying,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.fn_db_change_column_type(character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.fn_db_create_constraint(character=20=
varying,=20character=20varying,=20text)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.fn_db_create_index(character=20varying,=20character=20=
varying,=20text,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_delete_config_for_version(text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.fn_db_delete_config_value(character=20=
varying,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_delete_config_value_all_versions(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_drop_column(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_drop_constraint(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_get_async_tasks()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_grant_action_group_to_all_roles_filter(integer,=20=
uuid[])=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_is_table_exists(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.fn_db_mask_object(regclass)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.fn_db_remove_csv_config_value(character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_remove_uuid_from_csv(text,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.fn_db_rename_column(character=20=
varying,=20character=20varying,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.fn_db_rename_config_key(character=20=
varying,=20character=20varying,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.fn_db_rename_table(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_split_config_value(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.fn_db_unlock_all()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_unlock_disk(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_unlock_entity(character=20varying,=20character=20=
varying,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_unlock_snapshot(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_update_config_value(character=20varying,=20=
character=20varying,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.fn_db_update_default_config_value(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_get_ad_element_name(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_get_column_size(character=20varying,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_get_comparable_ip_list(text)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.fn_get_dedicated_hosts_ids_by_vm_id(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_get_entity_name(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.fn_get_entity_parents(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_get_num_of_vcpus(vm_static)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.fn_image_deleted()=20cascade;=0A=20drop=20function=20=
if=20exists=20=
public.fn_perms_get_storage_pools_with_permitted_action_on_clusters(uuid,=20=
integer,=20boolean,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_user_permissions(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.fnsplitter(text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.fnsplitterinteger(text)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.fnsplitteruuid(text)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.fnsplitterwithseperator(text,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.force_delete_storage_domain(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.freehostdevicesusedbyvmid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.generate_drop_all_functions_syntax()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.generate_drop_all_seq_syntax()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.generate_drop_all_tables_syntax()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.generate_drop_all_user_types_syntax()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.generate_drop_all_views_syntax()=20=
cascade;=0A=20drop=20function=20if=20exists=20public.get_all_commands()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.get_entity_permissions(uuid,=20integer,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.get_entity_permissions_for_user_and_groups(uuid,=20text,=20=
integer,=20uuid,=20integer,=20boolean)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.get_entity_snapshot_by_command_id(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.get_entity_snapshot_by_id(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.get_oauth_client(character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.get_role_groups_by_role_id(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.get_roles_groups_by_action_group_id_and_by_role_id(integer,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.get_seconds_to_wait_before_pm_operation(character=20varying,=20=
character=20varying,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getaccessprotocolsbyglustervolumeguid(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getallbystatus(integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getalldatacentersbymacpoolid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromasync_tasks()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromauditlog(uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfrombasedisks()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfrombookmarks()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getallfromclusterpolicys()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromclusterpolicyunits()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromcommandentities()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromcpuprofiles()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getallfromcustom_actions()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromdisk_image_dynamic()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromdisklunmaps()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromdiskprofiles()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getallfromglusterservices()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromhostdevices()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromhostnicvfsconfigs()=20=
cascade;=0A=20drop=20function=20if=20exists=20public.getallfromimages()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromimageuploads()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromiscsibonds()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getallfromlibvirtsecrets()=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getallfromlun_storage_server_connection_map()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfrommacpools()=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getallfromnetwork(uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromnetwork_cluster()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromnetwork_clusterbyclusterid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getallfromnetwork_clusterbynetworkid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromnetworkattachments()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromnumanode()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromnumanodecpumap()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfrompolicyunits()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromproviders()=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getallfromprovidersbytypes(character=20varying[])=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromrole(integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromsnapshots()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromsnapshotsbyvmid(uuid,=20uuid,=20boolean,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromstorage_domain_dynamic()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromstorage_domain_static()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromstorage_pool(uuid,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromstorage_pool_iso_map()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromstorageserverconnectionextensions()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromtags()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromtags_user_group_map()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromtags_user_map()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromtags_vds_map()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getallfromtags_vm_map()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromtags_vm_pool_map()=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getallfromusers(uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromvdcoption()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromvds_spm_id_map()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromvdscpustatistics()=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getallfromvdsdynamic()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromvdsstatic()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromvdsstatistics()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallfromvm_pool_map()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromvm_pools()=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getallfromvmdynamic()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromvmicondefaults()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromvmicons()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromvmiconsfiltered(uuid,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromvminterfaces()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromvmstatic()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallfromvmstaticbystoragepoolid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getallfromvmstatistics()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallfromvnicprofiles()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallgroups()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallhashesfromvmdynamic()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallimageuploadids()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getalljobidsbyentityid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.getalljobs()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getalllibvirtsecretsbyproviderid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallmacpoolrangesbymacpoolid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallmacsbymacpoolid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallmanagementnetworksbydatacenterid(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getallnetworkbyclusterid(uuid,=20=
uuid,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getallnetworkbystoragepoolid(uuid,=20uuid,=20boolean)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getallnetworkfilters()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallnetworklabelsbydatacenterid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallnetworksbynetworkproviderid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallnetworksbyqosid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallnonadminroles(integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getallovfentitiesforstoragedomainbyentitytype(uuid,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getallqosbyqostype(smallint)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getallqosforstoragepool(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallqosforstoragepoolbyqostype(uuid,=20=
smallint)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getallsnapshotsbystoragedomainid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallsteps()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallstorage_server_connections()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallsupportednetworkfiltersbyversion(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getallunfinishedvdskdumpstatus()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getallvfsconfigbyhostid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getallvmjobs()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getanyadminrolebyuseridandgroupids(uuid,=20=
text,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getasync_tasksbytask_id(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getasynctaskentitiesbytaskid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getasynctasksbyentityid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getasynctasksbystoragepoolid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getasynctasksbyvdsmtaskid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getasynctasksidsbyentityid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getauditlogbyauditlogid(integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getauditlogbyoriginandcustomeventid(character=20varying,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getauditlogbyvmid(uuid,=20uuid,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getauditlogbyvmtemplateid(uuid,=20uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getauditlogbyvolumeidandtype(uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getauditloglaterthendate(timestamp=20with=20time=20zone)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getbasediskbybasediskid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getbasedisksbyalias(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getbookmarkbybookmark_id(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getbookmarkbybookmark_name(character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getbrickdetailsbyid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getclusterfeaturesbyversionandcategory(character=20varying,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getclusterpolicybyclusterpolicyid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getclusterpolicyunitsbyclusterpolicyid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getcommandassociatedentities(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getcommandentitiesbyparentcmdid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getcommandentitybycommandentityid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getcommandidsbyentityid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getconnectionsbyiscsibondid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getcpuprofilebycpuprofileid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getcpuprofilesbyclusterid(uuid,=20uuid,=20boolean,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getcpuprofilesbyqosid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getcustom_actionsbyaction_id(integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getcustom_actionsbynameandtab(character=20varying,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getcustom_actionsbytab_id(integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getdbgeneration(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getdcidbyexternalnetworkid(text)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.getdefaultmacpool()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getdisk_image_dynamicbyimage_id(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getdiskbydiskidandstoragedomainid(uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getdisklunmapbydisklunmapid(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getdisklunmapbylunid(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getdiskprofilebydiskprofileid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getdiskprofilesbyqosid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getdiskprofilesbystoragedomainid(uuid,=20uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getdisksvmguidbasicview(uuid,=20boolean,=20uuid,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getdwhhistorytimekeepingbyvarname(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getelementidsbyidandgroups(uuid,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getenginesession(integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getenginesessionbysessionid(text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getentitiesbydiskid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getevent_subscriberbysubscriber_id(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getexternalidsfromsteps(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getexternalvariablebyname(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getfenceagentbyid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getfenceagentsbyvdsid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getglobalids(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getglusterclusterservicesbyclusterid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getglusterclusterservicesbyclusteridandservicetype(uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getglustergeorepsessiondetails(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getglustergeorepsessiondetailsforbrick(uuid,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getglustergeorepsessionunsetconfig(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getglusterhook(uuid,=20character=20=
varying,=20character=20varying,=20character=20varying,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getglusterhookbyid(uuid,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getglusterhookcontentbyid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getglusterhooksbyclusterid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getglusteroptionbyid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getglusterserverbyglusterserveruuid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getglusterserverbyserverid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getglusterservicebyglusterserviceid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getglusterservicebytypeandname(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getglusterservicesbytype(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getglusterservicetypes()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getglustervolumedetailsbyid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getglustervolumesnapshotconfigbyclusterid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getglustervolumesnapshotconfigbyclusteridandname(uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getglustervolumesnapshotconfigbyvolumeid(uuid,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getglustervolumesnapshotconfigbyvolumeidandname(uuid,=20uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getgroupbyexternalid(character=20varying,=20text)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getgroupbyid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getgroupbyname(character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.gethostdevicebyhostidanddevicename(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.gethostdevicesbyhostid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.gethostdevicesbyhostidandiommugroup(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.gethostnetworksbycluster(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.gethostnicvfsconfigbyid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.gethostsandvmsforclusters(uuid[])=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getidsforovfdeletion(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getidsofhostswithstatus(integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getimage_storage_domain_mapbyimage_id(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getimage_storage_domain_mapbystorage_domain_id(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getimagebyimageid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getimageuploadsbycommandid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getimageuploadsbydiskid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getisclusterempty(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getiscsibondbyiscsibondid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getiscsibondsbynetworkid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getiscsibondsbystoragepoolid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getjobbyjobid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getjobsbycorrelationid(character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getjobsbyenginesessionseqidandstatus(bigint,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getjobsbyoffsetandpagesize(integer,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getjobsubjectentitybyjobid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getkdumpstatusforvds(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getlabelsbyvfsconfigid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getlastsuccessfulenginebackup(character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getlibvirtsecretbylibvirtsecretid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getlibvirtsecretsbypoolidonactivedomains(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getlun_storage_server_connection_mapbylun(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getlun_storage_server_connection_mapbylunbystorage_server_conn(char=
acter=20varying,=20character=20varying)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getmacpoolbymacpoolid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getmacsbydatacenterid(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getmanagementnetworkbycluster(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getnamesofhostsdedicatedtovm(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnamesofvmstaticdedicatedtovds(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getnetwork_clusterbycluster_idandbynetwork_id(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnetworkattachmentbynetworkattachmentid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getnetworkattachmentbynicidandnetworkid(uuid,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getnetworkattachmentsbyhostid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getnetworkattachmentsbynetworkid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnetworkattachmentsbynicid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getnetworkbyid(uuid,=20uuid,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnetworkbyname(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getnetworkbynameandcluster(character=20=
varying,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getnetworkbynameanddatacenter(character=20varying,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnetworkfilterbyid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getnetworkfilterbyname(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getnetworksbyiscsibondid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnetworksbyvfsconfigid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getnoncountablequtoavmstatuses()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getnumanodebynumanodeid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnumanodecpubynumanodeid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getnumberofimagesinstoragedomain(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getnumberofvmsincluster(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnumofsnapshotsbymemoryvolume(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getnvmtagsbyvmid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getnvmtagsbyvmidanddefaulttag(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getoptionsbyglustervolumeguid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getorderedvmguidsforrunmultipleactions(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getovfdatabyentityidandstoragedomain(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getovfgeneration(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getpermissionbyroleid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getpolicyunitbypolicyunitid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getproviderbyname(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getproviderbyproviderid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.getqosbyqosid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.getquotacount()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getrepo_files_by_storage_domain(uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getrepo_files_in_all_storage_pools(integer,=20integer,=20integer,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getroleactiongroupsbyroleid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getrolebyname(character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getrolsbyid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getsessionuserandgroupsbyid(uuid,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getsnapshotbysnapshotid(uuid,=20uuid,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getsnapshotbyvmidandstatus(uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getsnapshotbyvmidandtype(uuid,=20character=20varying,=20uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getsnapshotbyvmidandtypeandstatus(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getsnapshotidsbyvmidandtype(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getsnapshotidsbyvmidandtypeandstatus(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getstepbystepid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getstepsbyexternaltaskid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getstepsbyjobid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getstepsbyparentstepid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_domain_dynamicbyid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getstorage_domain_staticbyid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_domain_staticbyname(character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getstorage_domain_staticbynamefiltered(character=20varying,=20=
uuid,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_domain_staticbystorage_pool_id(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getstorage_pool_iso_mapbystorage_idandbystorage_pool_id(uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_pool_iso_mapsbybystorage_pool_id(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_pool_iso_mapsbystorage_id(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getstorage_poolbyid(uuid,=20uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_poolbyname(character=20varying,=20boolean)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getstorage_poolsbyclusterid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getstorage_poolsbystoragedomainid(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.getstorage_poolsbyvdsid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_server_connectionsbyconnection(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_server_connectionsbyid(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.getstorage_server_connectionsbyiqn(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_server_connectionsbyiqnandconnection(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getstorage_server_connectionsbykey(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_server_connectionsbylunid(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorage_server_connectionsbystoragetype(integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getstorage_server_connectionsbyvolumegroupid(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorageconnectionsbystoragetypeandstatus(uuid,=20integer,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getstoragedevicebyid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getstoragedevicesbyvdsid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getstoragedomainidsbystoragepoolidandstatus(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getstoragepoolsbyclusterservice(boolean,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getstorageserverconnectionextensionbyid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getstorageserverconnectionextensionsbyhostid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getstorageserverconnectionextensionsbyhostidandtarget(uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getstorageserverconnectionsbyids(text)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getstorageserverconnectionsfordomain(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getsupportedhostfeaturesbyhostid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getsystem_statistics(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.gettags_vm_pool_mapbytag_idandbyvm_pool_id(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.gettagsbyparent_id(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.gettagsbytag_id(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.gettagsbytag_name(character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.gettaguserbytagidandbyuserid(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.gettagusergroupbygroupidandbytagid(uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.gettagvdsbytagidandbyvdsid(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.gettagvmbytagidandbyvmid(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.gettemplatecount()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.gettransporttypesbyglustervolumeguid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getuserandgroupsbyid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getuserbyexternalid(character=20=
varying,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getuserbyuserid(uuid,=20boolean)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getuserbyusernameanddomain(character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getusersbyvmguid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getvdcoptionbyid(integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvdcoptionbyname(character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getvds_spm_id_mapbystorage_pool_id(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getvds_spm_id_mapbystorage_pool_idandbyvds_spm_id(uuid,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getvds_spm_id_mapbyvds_id(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvdscpustatisticsbyvdsid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getvdsdynamicbyvdsid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvdsstaticbyclusterid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvdsstaticbyhostname(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvdsstaticbyip(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvdsstaticbyvdsid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getvdsstaticbyvdsname(character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getvdsstatisticsbyvdsid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvfsconfigbynicid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvm_interface_statisticsbyid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvm_pool_mapbyvm_pool_id(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvmandtemplatesidsbystoragedomainid(uuid,=20=
boolean,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmdevicesattachedtohost(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvmdynamicbyvmguid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvmguestagentinterfacesbyvmid(uuid,=20=
uuid,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmiconbyvmicondataurl(text)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvmiconbyvmiconid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvmicondefaultbyvmicondefaultid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmicondefaultbyvmicondefaultlargeiconid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getvmicondefaultbyvmicondefaultosid(integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvmidsforversionupdate(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvminitbyids(text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getvminitbyvmid(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvminterfacebytemplateid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getvminterfacebyvminterfaceid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvminterfacesbynetworkid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvminterfacesbyvmid(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.getvmmapsinvmpoolbyvmpoolidandstatus(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmnumanodebyvdsnumanodeid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.getvmnumanodebyvdsnumanodeidwithpinnedinfo(uuid,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmsandtemplatesidswithoutattachedimagedisks(uuid,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmsdynamicrunningonvds(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.getvmsidsforovfupdate(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvmstaticbycluster(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getvmstaticbygroupidandnetwork(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmstaticbyname(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvmstaticbyvmguid(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.getvmstaticwithfailbackbyvdsid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvmstaticwithouticon()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.getvmstatisticsbyvmguid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvmtemplateinterfacesbynetworkid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvmtemplatesidsforovfupdate(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.getvnicprofilebyvnicprofileid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.getvnicprofilesbynetworkid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.increasestoragepoolmasterversion(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.incrementdbgeneration(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.incrementdbgenerationforallinstoragepool(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.insert_entity_snapshot(uuid,=20=
uuid,=20character=20varying,=20character=20varying,=20character=20=
varying,=20text,=20character=20varying,=20integer,=20integer)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.insert_osinfo(integer,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insert_roles_groups(integer,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertaffinitygroupwithmembers(uuid,=20=
character=20varying,=20character=20varying,=20uuid,=20boolean,=20=
boolean,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertasync_tasks(integer,=20integer,=20integer,=20uuid,=20=
uuid,=20uuid,=20uuid,=20uuid,=20uuid,=20timestamp=20with=20time=20zone,=20=
uuid,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertasynctaskentities(uuid,=20uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertauditlog(integer,=20timestamp=20with=20time=20zone,=20=
integer,=20character=20varying,=20integer,=20text,=20uuid,=20character=20=
varying,=20uuid,=20character=20varying,=20uuid,=20character=20varying,=20=
uuid,=20character=20varying,=20uuid,=20character=20varying,=20uuid,=20=
character=20varying,=20uuid,=20character=20varying,=20uuid,=20character=20=
varying,=20character=20varying,=20uuid,=20uuid,=20character=20varying,=20=
text,=20boolean,=20uuid,=20text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertbasedisk(uuid,=20boolean,=20character=20varying,=20=
character=20varying,=20character=20varying,=20boolean,=20integer,=20=
smallint,=20timestamp=20with=20time=20zone,=20smallint,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertbookmark(uuid,=20character=20varying,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertcluster(uuid,=20character=20varying,=20text,=20character=20=
varying,=20character=20varying,=20uuid,=20integer,=20boolean,=20=
character=20varying,=20boolean,=20integer,=20boolean,=20boolean,=20=
boolean,=20character=20varying,=20boolean,=20boolean,=20boolean,=20=
boolean,=20boolean,=20uuid,=20text,=20boolean,=20integer,=20smallint,=20=
character=20varying,=20boolean,=20smallint,=20character=20varying,=20=
character=20varying,=20boolean,=20boolean,=20smallint,=20boolean,=20=
boolean,=20boolean,=20character=20varying,=20boolean,=20character=20=
varying,=20integer,=20uuid,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertclusterfeature(uuid,=20character=20=
varying,=20character=20varying,=20integer,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertclusterpolicy(uuid,=20character=20=
varying,=20character=20varying,=20boolean,=20boolean,=20text)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.insertclusterpolicyunit(uuid,=20=
uuid,=20integer,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertcommandassociatedentities(uuid,=20uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertcommandentity(uuid,=20bigint,=20uuid,=20integer,=20uuid,=20=
uuid,=20uuid,=20uuid,=20text,=20character=20varying,=20timestamp=20with=20=
time=20zone,=20character=20varying,=20boolean,=20boolean,=20text,=20=
character=20varying,=20text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertcpuprofile(uuid,=20character=20varying,=20uuid,=20=
uuid,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertcpuqos(uuid,=20smallint,=20character=20varying,=20text,=20=
uuid,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertcustom_actions(integer,=20character=20varying,=20character=20=
varying,=20integer,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertdedicatedhoststovm(uuid,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertdisk_image_dynamic(uuid,=20integer,=20integer,=20bigint,=20=
numeric,=20numeric,=20numeric)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertdisklunmap(uuid,=20character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.insertdiskprofile(uuid,=20=
character=20varying,=20uuid,=20uuid,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertdiskvmelement(uuid,=20uuid,=20=
boolean,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertenginesession(integer,=20text,=20uuid,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertevent_notification_hist(bigint,=20character=20=
varying,=20character,=20character,=20timestamp=20with=20time=20zone,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertevent_subscriber(character=20varying,=20character=20=
varying,=20character=20varying,=20uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertexternalauditlog(integer,=20timestamp=20with=20time=20zone,=20=
integer,=20character=20varying,=20integer,=20text,=20uuid,=20character=20=
varying,=20uuid,=20character=20varying,=20uuid,=20character=20varying,=20=
uuid,=20character=20varying,=20uuid,=20character=20varying,=20uuid,=20=
character=20varying,=20uuid,=20character=20varying,=20uuid,=20character=20=
varying,=20character=20varying,=20uuid,=20uuid,=20character=20varying,=20=
text,=20uuid,=20text,=20character=20varying,=20integer,=20integer,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertexternalvariable(character=20varying,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertfenceagent(uuid,=20uuid,=20integer,=20character=20varying,=20=
character=20varying,=20character=20varying,=20text,=20text,=20boolean,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglusterclusterservice(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustergeorepsession(uuid,=20uuid,=20character=20varying,=20=
character=20varying,=20uuid,=20character=20varying,=20uuid,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertglustergeorepsessionconfig(uuid,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertglustergeorepsessiondetail(uuid,=20uuid,=20=
character=20varying,=20uuid,=20character=20varying,=20character=20=
varying,=20character=20varying,=20bigint,=20bigint,=20bigint,=20bigint,=20=
timestamp=20without=20time=20zone,=20timestamp=20without=20time=20zone,=20=
timestamp=20without=20time=20zone,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertglusterhook(uuid,=20uuid,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
text,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglusterserver(uuid,=20uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglusterserverhook(uuid,=20uuid,=20character=20varying,=20=
character=20varying,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertglusterserverservice(uuid,=20uuid,=20=
uuid,=20integer,=20character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustervolume(uuid,=20uuid,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20integer,=20=
integer,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustervolumeaccessprotocol(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustervolumebrick(uuid,=20uuid,=20uuid,=20character=20=
varying,=20integer,=20character=20varying,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertglustervolumebrickdetails(uuid,=20=
bigint,=20bigint,=20bigint)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertglustervolumedetails(uuid,=20bigint,=20bigint,=20=
bigint)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustervolumeoption(uuid,=20uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustervolumesnapshot(uuid,=20character=20varying,=20uuid,=20=
character=20varying,=20character=20varying,=20timestamp=20with=20time=20=
zone)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustervolumesnapshotconfig(uuid,=20uuid,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertglustervolumesnapshotschedule(uuid,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20integer,=20timestamp=20with=20time=20=
zone,=20time=20without=20time=20zone,=20character=20varying,=20timestamp=20=
with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertglustervolumetransporttype(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.insertgroup(uuid,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
text,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.inserthostdevice(uuid,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20integer,=20character=20varying,=20=
character=20varying,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.inserthostnetworkqos(uuid,=20smallint,=20character=20=
varying,=20text,=20uuid,=20integer,=20integer,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.inserthostnicvfsconfig(uuid,=20=
uuid,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertimage(timestamp=20with=20time=20zone,=20uuid,=20uuid,=20=
bigint,=20uuid,=20integer,=20timestamp=20with=20time=20zone,=20uuid,=20=
integer,=20integer,=20uuid,=20boolean,=20smallint)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertimage_storage_domain_map(uuid,=20=
uuid,=20uuid,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertimageuploads(uuid,=20integer,=20integer,=20timestamp=20=
without=20time=20zone,=20character=20varying,=20uuid,=20uuid,=20uuid,=20=
character=20varying,=20character=20varying,=20bigint,=20bigint)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertiscsibond(uuid,=20character=20varying,=20character=20=
varying,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertjob(uuid,=20character=20varying,=20text,=20character=20=
varying,=20uuid,=20bigint,=20boolean,=20timestamp=20with=20time=20zone,=20=
timestamp=20with=20time=20zone,=20timestamp=20with=20time=20zone,=20=
character=20varying,=20boolean,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertjobsubjectentity(uuid,=20uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertlibvirtsecret(uuid,=20text,=20integer,=20text,=20uuid,=20=
timestamp=20with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertlun_storage_server_connection_map(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertluns(character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20character=20=
varying,=20character=20varying,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertmacpool(uuid,=20character=20=
varying,=20boolean,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertmacpoolrange(uuid,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertnetwork(character=20varying,=20character=20=
varying,=20text,=20uuid,=20character=20varying,=20character=20varying,=20=
character=20varying,=20integer,=20integer,=20boolean,=20uuid,=20integer,=20=
boolean,=20uuid,=20text,=20uuid,=20text)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.insertnetwork_cluster(uuid,=20uuid,=20integer,=20=
boolean,=20boolean,=20boolean,=20boolean,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.insertnetworkattachment(uuid,=20=
uuid,=20uuid,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20integer,=20character=20varying,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertnetworkqos(uuid,=20smallint,=20=
character=20varying,=20text,=20uuid,=20integer,=20integer,=20integer,=20=
integer,=20integer,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertnumanode(uuid,=20uuid,=20uuid,=20smallint,=20=
bigint,=20smallint,=20bigint,=20integer,=20numeric,=20numeric,=20=
numeric,=20integer,=20text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertnumanodecpu(uuid,=20uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.insertnumanodemap(uuid,=20uuid,=20=
uuid,=20smallint,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertorupdateasynctasks(integer,=20integer,=20integer,=20=
uuid,=20uuid,=20uuid,=20uuid,=20uuid,=20uuid,=20timestamp=20with=20time=20=
zone,=20uuid,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertorupdatecommandentity(uuid,=20bigint,=20uuid,=20integer,=20=
uuid,=20uuid,=20uuid,=20uuid,=20text,=20character=20varying,=20timestamp=20=
with=20time=20zone,=20character=20varying,=20boolean,=20boolean,=20text,=20=
character=20varying,=20text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertorupdateuser(character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20uuid,=20character=20varying,=20text,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertovfdataforentities(uuid,=20character=20varying,=20character=20=
varying,=20integer,=20character=20varying,=20uuid,=20text,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertpermission(uuid,=20uuid,=20uuid,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertpolicyunit(uuid,=20character=20varying,=20text,=20boolean,=20=
smallint,=20text,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertprovider(uuid,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20boolean,=20=
character=20varying,=20text,=20text,=20character=20varying,=20character=20=
varying,=20text,=20text,=20text,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertquota(uuid,=20uuid,=20character=20=
varying,=20character=20varying,=20integer,=20integer,=20integer,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertquotalimitation(uuid,=20uuid,=20uuid,=20uuid,=20integer,=20=
bigint,=20bigint)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertrepo_domain_file_meta_data(uuid,=20character=20varying,=20=
character=20varying,=20bigint,=20timestamp=20with=20time=20zone,=20=
bigint,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertrole(character=20varying,=20uuid,=20character=20varying,=20=
boolean,=20integer,=20boolean,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertsnapshot(uuid,=20uuid,=20character=20=
varying,=20character=20varying,=20character=20varying,=20timestamp=20=
with=20time=20zone,=20text,=20text,=20character=20varying,=20uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertstep(uuid,=20uuid,=20uuid,=20character=20varying,=20text,=20=
integer,=20character=20varying,=20timestamp=20with=20time=20zone,=20=
timestamp=20with=20time=20zone,=20character=20varying,=20uuid,=20=
character=20varying,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertstorage_domain_dynamic(integer,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertstorage_domain_static(uuid,=20character=20varying,=20=
character=20varying,=20character=20varying,=20text,=20integer,=20=
integer,=20character=20varying,=20bigint,=20boolean,=20integer,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertstorage_pool(character=20varying,=20text,=20uuid,=20=
character=20varying,=20integer,=20boolean,=20integer,=20uuid,=20=
character=20varying,=20integer,=20uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.insertstorage_pool_iso_map(uuid,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertstorage_server_connections(character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20text,=20integer,=20text,=20character=20varying,=20character=20=
varying,=20character=20varying,=20smallint,=20smallint)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.insertstoragedevice(uuid,=20text,=20=
character=20varying,=20character=20varying,=20uuid,=20text,=20character=20=
varying,=20text,=20character=20varying,=20text,=20bigint,=20boolean,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertstoragedomainovfinfo(uuid,=20integer,=20uuid,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertstorageqos(uuid,=20smallint,=20character=20varying,=20text,=20=
uuid,=20integer,=20integer,=20integer,=20integer,=20integer,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertstorageserverconnectionextension(uuid,=20uuid,=20character=20=
varying,=20text,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertsupportedclusterfeature(uuid,=20uuid,=20boolean)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.insertsupportedhostfeature(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.inserttags(character=20varying,=20uuid,=20character=20varying,=20=
uuid,=20boolean,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.inserttags_user_group_map(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.inserttags_user_map(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.inserttags_vds_map(uuid,=20uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.inserttags_vm_map(uuid,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.inserttags_vm_pool_map(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertunregistereddisk(uuid,=20uuid,=20=
character=20varying,=20character=20varying,=20uuid,=20timestamp=20with=20=
time=20zone,=20timestamp=20with=20time=20zone,=20integer,=20integer,=20=
bigint,=20bigint)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertunregistereddiskstovms(uuid,=20uuid,=20character=20varying,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertuser(character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20uuid,=20character=20varying,=20text,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertuserprofile(uuid,=20uuid,=20uuid,=20text,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvdcoption(character=20varying,=20character=20varying,=20=
character=20varying,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertvds_interface(character=20varying,=20character=20=
varying,=20integer,=20character=20varying,=20uuid,=20boolean,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20character=20=
varying,=20integer,=20integer,=20uuid,=20character=20varying,=20integer,=20=
integer,=20boolean,=20text,=20integer,=20character=20varying,=20integer,=20=
character=20varying,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertvds_interface_statistics(uuid,=20=
numeric,=20numeric,=20bigint,=20bigint,=20numeric,=20numeric,=20bigint,=20=
bigint,=20integer,=20double=20precision,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertvds_spm_id_map(uuid,=20uuid,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvdscpustatistics(uuid,=20uuid,=20integer,=20numeric,=20=
numeric,=20numeric,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertvdsdynamic(integer,=20integer,=20character=20=
varying,=20numeric,=20character=20varying,=20boolean,=20integer,=20=
integer,=20integer,=20uuid,=20integer,=20integer,=20integer,=20integer,=20=
integer,=20integer,=20integer,=20integer,=20character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
integer,=20character=20varying,=20integer,=20integer,=20integer,=20=
boolean,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20integer,=20=
text,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20text,=20text,=20boolean,=20smallint,=20integer,=20smallint,=20=
boolean,=20character=20varying,=20text,=20boolean,=20boolean,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvdsstatic(text,=20uuid,=20character=20varying,=20character=20=
varying,=20integer,=20smallint,=20uuid,=20character=20varying,=20=
boolean,=20integer,=20integer,=20boolean,=20character=20varying,=20=
boolean,=20integer,=20character=20varying,=20character=20varying,=20=
integer,=20character=20varying,=20boolean,=20uuid,=20uuid,=20text,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvdsstatistics(numeric,=20numeric,=20numeric,=20numeric,=20=
integer,=20integer,=20integer,=20uuid,=20bigint,=20bigint,=20bigint,=20=
bigint,=20bigint,=20integer,=20bigint,=20boolean,=20integer,=20bigint,=20=
integer,=20boolean,=20boolean,=20boolean,=20boolean,=20timestamp=20with=20=
time=20zone)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvfsconfiglabel(uuid,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertvfsconfignetwork(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvm_interface_statistics(uuid,=20numeric,=20numeric,=20=
bigint,=20bigint,=20numeric,=20numeric,=20bigint,=20bigint,=20integer,=20=
double=20precision,=20uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertvm_pool_map(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertvm_pools(character=20varying,=20=
text,=20uuid,=20character=20varying,=20integer,=20boolean,=20character=20=
varying,=20integer,=20uuid,=20smallint,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvmdevice(uuid,=20uuid,=20character=20varying,=20character=20=
varying,=20character=20varying,=20integer,=20text,=20boolean,=20boolean,=20=
boolean,=20character=20varying,=20text,=20uuid,=20character=20varying,=20=
boolean,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertvmdynamic(text,=20character=20varying,=20character=20=
varying,=20uuid,=20character=20varying,=20uuid,=20uuid,=20integer,=20=
uuid,=20character=20varying,=20character=20varying,=20character=20=
varying,=20timestamp=20with=20time=20zone,=20timestamp=20with=20time=20=
zone,=20integer,=20boolean,=20integer,=20boolean,=20integer,=20integer,=20=
uuid,=20character=20varying,=20integer,=20integer,=20integer,=20=
character=20varying,=20integer,=20numeric,=20character=20varying,=20=
boolean,=20character=20varying,=20character=20varying,=20character=20=
varying,=20integer,=20integer,=20integer,=20integer,=20character=20=
varying,=20integer,=20character=20varying,=20integer,=20bigint,=20=
bigint,=20bigint,=20integer,=20character=20varying,=20integer,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertvmguestagentinterface(uuid,=20=
character=20varying,=20character=20varying,=20text,=20text)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.insertvmicon(uuid,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvmicondefault(uuid,=20integer,=20uuid,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.insertvminit(uuid,=20text,=20=
text,=20text,=20boolean,=20character=20varying,=20text,=20text,=20text,=20=
text,=20character=20varying,=20text,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.insertvminterface(uuid,=20=
character=20varying,=20character=20varying,=20integer,=20uuid,=20uuid,=20=
uuid,=20integer,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.insertvmjobs(uuid,=20uuid,=20integer,=20integer,=20=
integer,=20integer,=20bigint,=20bigint,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertvmstatic(character=20varying,=20=
text,=20integer,=20integer,=20integer,=20uuid,=20uuid,=20character=20=
varying,=20uuid,=20timestamp=20with=20time=20zone,=20integer,=20boolean,=20=
boolean,=20boolean,=20integer,=20integer,=20integer,=20integer,=20=
character=20varying,=20boolean,=20boolean,=20boolean,=20boolean,=20=
character=20varying,=20text,=20boolean,=20integer,=20integer,=20integer,=20=
integer,=20integer,=20integer,=20character=20varying,=20integer,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
integer,=20character=20varying,=20character=20varying,=20integer,=20=
uuid,=20character=20varying,=20boolean,=20boolean,=20character=20=
varying,=20boolean,=20uuid,=20uuid,=20uuid,=20uuid,=20character=20=
varying,=20integer,=20integer,=20smallint,=20character=20varying,=20=
boolean,=20character=20varying,=20boolean,=20boolean,=20uuid,=20boolean,=20=
boolean,=20character=20varying,=20character=20varying,=20uuid,=20uuid,=20=
character=20varying,=20character=20varying,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.insertvmstatistics(numeric,=20numeric,=20=
numeric,=20integer,=20integer,=20integer,=20integer,=20text,=20text,=20=
text,=20text,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvmtemplate(integer,=20timestamp=20with=20time=20zone,=20=
character=20varying,=20text,=20integer,=20integer,=20character=20=
varying,=20integer,=20integer,=20integer,=20integer,=20uuid,=20uuid,=20=
integer,=20boolean,=20boolean,=20integer,=20integer,=20character=20=
varying,=20boolean,=20integer,=20integer,=20integer,=20integer,=20=
integer,=20integer,=20boolean,=20boolean,=20boolean,=20boolean,=20=
character=20varying,=20boolean,=20character=20varying,=20integer,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
uuid,=20integer,=20text,=20boolean,=20character=20varying,=20integer,=20=
boolean,=20uuid,=20character=20varying,=20integer,=20uuid,=20character=20=
varying,=20smallint,=20character=20varying,=20boolean,=20boolean,=20=
boolean,=20uuid,=20character=20varying,=20boolean,=20boolean,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20uuid,=20uuid,=20character=20varying,=20character=20=
varying,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.insertvnicprofile(uuid,=20character=20varying,=20uuid,=20uuid,=20=
boolean,=20boolean,=20text,=20text,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.inst_add_glance_provider(uuid,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
uuid,=20boolean,=20character=20varying,=20text,=20text,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.inst_add_iso_storage_domain(uuid,=20character=20varying,=20uuid,=20=
character=20varying,=20integer,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.inst_update_default_storage_pool_type(boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.inst_update_service_type(uuid,=20=
boolean,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.isanyvmrunonvds(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.ismaterializedviewrefreshed(name)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.ismemballoonenabled(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.isquotainuse(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.isvmiconexist(uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.loadovfdataforids(character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.loadstoragedomaininfobydiskid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.loadstoragedomaininfobydomainid(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.loadstoragedomainsforovfids(text)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.logenginebackupevent(character=20varying,=20=
timestamp=20with=20time=20zone,=20integer,=20text,=20character=20=
varying,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.markhostdevicesusedbyvmid(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.nullifyqosforstoragedomain(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.refreshallmaterializedviews(boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.refreshmaterializedview(name)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.remove_entities_from_storage_domain(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.removeallvmtagsbyvmid(uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.removeauditlogbybrickidlogtype(uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.removeconnectionfromiscsibond(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.removediskfromunregistered(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.removediskfromunregisteredrelatedtovm(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.removeentityfromunregistered(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.removefinishedkdumpstatusforvds(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.removememoryfromsnapshotbysnapshotid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.removememoryfromsnapshotbyvmidandtype(uuid,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.removenetworkattachmentbynetworkid(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.removenetworkfromiscsibond(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.removesupportedhostfeature(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.removevmfromaffinitygroups(uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.set_network_exclusively_as_display(uuid,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.set_network_exclusively_as_gluster(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.set_network_exclusively_as_management(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.set_network_exclusively_as_migration(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.setallauditlogalerts(integer,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.sethashbyvmguid(uuid,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.settounknown(uuid[],=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.setvmidonhostdevice(uuid,=20character=20varying,=20uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.setvmpoolbeingdestroyed(uuid,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.sso_oauth_client_exists(character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.sso_oauth_register_client(character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20text,=20character=20varying,=20boolean,=20character=20=
varying,=20character=20varying,=20boolean,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.sso_oauth_unregister_client(character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.to_interval(integer)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.update_oauth_client(character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20text,=20character=20varying,=20boolean,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.update_oauth_client_callback_prefix(character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateaffinitygroupwithmembers(uuid,=20character=20varying,=20=
character=20varying,=20uuid,=20boolean,=20boolean,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateasync_tasks(integer,=20integer,=20integer,=20uuid,=20uuid,=20=
uuid,=20uuid,=20uuid,=20uuid,=20uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.updatebasedisk(uuid,=20boolean,=20character=20=
varying,=20character=20varying,=20character=20varying,=20boolean,=20=
integer,=20smallint,=20timestamp=20with=20time=20zone,=20smallint,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatebookmark(uuid,=20character=20varying,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatecluster(character=20varying,=20text,=20character=20varying,=20=
uuid,=20character=20varying,=20uuid,=20integer,=20boolean,=20character=20=
varying,=20boolean,=20integer,=20boolean,=20boolean,=20boolean,=20=
boolean,=20character=20varying,=20boolean,=20boolean,=20boolean,=20=
boolean,=20boolean,=20uuid,=20text,=20boolean,=20integer,=20smallint,=20=
character=20varying,=20boolean,=20smallint,=20character=20varying,=20=
character=20varying,=20boolean,=20boolean,=20smallint,=20boolean,=20=
boolean,=20boolean,=20character=20varying,=20boolean,=20character=20=
varying,=20integer,=20uuid,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateclusteremulatedmachine(uuid,=20=
character=20varying,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateclusterfeature(uuid,=20character=20varying,=20=
character=20varying,=20integer,=20text)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.updateclusterpolicy(uuid,=20character=20varying,=20=
character=20varying,=20boolean,=20boolean,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatecommandentity(uuid,=20bigint,=20=
uuid,=20integer,=20uuid,=20uuid,=20uuid,=20uuid,=20text,=20character=20=
varying,=20character=20varying,=20boolean,=20boolean,=20text,=20=
character=20varying,=20text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatecommandentityexecuted(uuid,=20boolean)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.updatecommandentitynotified(uuid,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatecommandentitystatus(uuid,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateconfigbyclusteridandname(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateconfigbyvolumeididandname(uuid,=20uuid,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateconsoleuserwithoptimisticlocking(uuid,=20uuid,=20=
character=20varying,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatecpuflags(uuid,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatecpuprofile(uuid,=20character=20varying,=20uuid,=20uuid,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatecpuqos(uuid,=20smallint,=20character=20varying,=20text,=20=
uuid,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatecustom_actions(integer,=20character=20varying,=20character=20=
varying,=20integer,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatededicatedhoststovm(uuid,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatedisk_image_dynamic(uuid,=20integer,=20integer,=20bigint,=20=
numeric,=20numeric,=20numeric)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatedisk_image_dynamic_by_disk_id_and_vm_id(uuid,=20=
uuid,=20integer,=20integer,=20bigint,=20numeric,=20numeric,=20numeric)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatediskprofile(uuid,=20character=20varying,=20uuid,=20uuid,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatediskprofilebyimagegroupid(uuid,=20uuid,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.updatediskvmelement(uuid,=20=
uuid,=20boolean,=20character=20varying)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.updatedwhhistorytimekeeping(character=20varying,=20=
character=20varying,=20timestamp=20with=20time=20zone)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updateexternalvariable(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatefenceagent(uuid,=20uuid,=20integer,=20character=20=
varying,=20character=20varying,=20character=20varying,=20text,=20text,=20=
boolean,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterbricktaskbyserveridbrickdir(uuid,=20character=20=
varying,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterclusterservice(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustergeorepsession(uuid,=20character=20varying,=20uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustergeorepsessionconfig(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustergeorepsessiondetail(uuid,=20uuid,=20character=20=
varying,=20uuid,=20character=20varying,=20character=20varying,=20=
character=20varying,=20bigint,=20bigint,=20bigint,=20bigint,=20timestamp=20=
without=20time=20zone,=20timestamp=20without=20time=20zone,=20timestamp=20=
without=20time=20zone,=20boolean)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateglustergeorepsessionstatus(uuid,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterhook(uuid,=20character=20varying,=20character=20=
varying,=20character=20varying,=20text,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateglusterhookconflictstatus(uuid,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterhookcontent(uuid,=20character=20varying,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterhookcontenttype(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterhookstatus(uuid,=20character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.updateglusterserver(uuid,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterserverhook(uuid,=20uuid,=20character=20varying,=20=
character=20varying,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateglusterserverhookchecksum(uuid,=20=
uuid,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateglusterserverhookstatus(uuid,=20uuid,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterserverknownaddresses(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterserverpeerstatus(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglusterserverservice(uuid,=20integer,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateglusterserverservicebyserveridandservicetype(uuid,=20=
uuid,=20integer,=20character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolume(uuid,=20uuid,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20integer,=20=
integer,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumeasynctask(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateglustervolumebrick(uuid,=20uuid,=20=
uuid,=20character=20varying,=20character=20varying,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.updateglustervolumebrickasynctask(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updateglustervolumebrickdetails(uuid,=20bigint,=20bigint,=20=
bigint)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumebricknetworkid(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updateglustervolumebrickorder(uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updateglustervolumebrickstatus(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumebrickunsyncedentries(uuid,=20integer,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumedetails(uuid,=20bigint,=20bigint,=20bigint)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumeoption(uuid,=20character=20varying)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.updateglustervolumesnapshotschedulebyvolumeid(uuid,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20integer,=20timestamp=20with=20time=20=
zone,=20time=20without=20time=20zone,=20character=20varying,=20timestamp=20=
with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumesnapshotstatus(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumesnapshotstatusbyname(uuid,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateglustervolumestatus(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateglustervolumestatusbyname(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updategroup(uuid,=20character=20varying,=20character=20varying,=20=
character=20varying,=20text,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateguestagentstatus(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatehostdevice(uuid,=20character=20varying,=20character=20=
varying,=20character=20varying,=20integer,=20character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20integer,=20character=20varying,=20character=20=
varying,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatehostexternalstatus(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatehostnetworkqos(uuid,=20smallint,=20=
character=20varying,=20text,=20uuid,=20integer,=20integer,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatehostnicvfsconfig(uuid,=20uuid,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updateimage(timestamp=20with=20=
time=20zone,=20uuid,=20uuid,=20bigint,=20uuid,=20integer,=20timestamp=20=
with=20time=20zone,=20uuid,=20integer,=20integer,=20uuid,=20boolean,=20=
smallint)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateimagesize(uuid,=20bigint,=20timestamp=20with=20time=20zone)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateimagestatus(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateimageuploads(uuid,=20integer,=20=
integer,=20timestamp=20without=20time=20zone,=20character=20varying,=20=
uuid,=20uuid,=20uuid,=20character=20varying,=20character=20varying,=20=
bigint,=20bigint)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateimagevmsnapshotid(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateiscsibond(uuid,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateisfreeflagbyid(uuid,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updateisinitialized(uuid,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatejob(uuid,=20character=20varying,=20text,=20character=20=
varying,=20uuid,=20bigint,=20boolean,=20timestamp=20with=20time=20zone,=20=
timestamp=20with=20time=20zone,=20timestamp=20with=20time=20zone,=20=
character=20varying,=20boolean,=20boolean)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatejoblastupdatetime(uuid,=20=
timestamp=20with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatejobstepscompleted(uuid,=20character=20varying,=20=
timestamp=20with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatelabel(uuid,=20character=20varying,=20boolean,=20=
uuid[],=20uuid[])=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatelastadmincheckstatus(character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updatelibvirtsecret(uuid,=20text,=20=
integer,=20text,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatelun_storage_server_connection_map(character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updateluns(character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20character=20=
varying,=20character=20varying,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatemacpool(uuid,=20character=20=
varying,=20boolean,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.updatematerializedviewminrefreshrate(name,=20integer)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.updatematerializedviewrefreshrate(name,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updatememory(character=20varying,=20=
uuid,=20uuid,=20uuid,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatenetwork(character=20varying,=20=
character=20varying,=20text,=20uuid,=20character=20varying,=20character=20=
varying,=20character=20varying,=20integer,=20integer,=20boolean,=20uuid,=20=
integer,=20boolean,=20uuid,=20text,=20uuid,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatenetwork_cluster(uuid,=20uuid,=20=
integer,=20boolean,=20boolean,=20boolean,=20boolean,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatenetwork_cluster_status(uuid,=20uuid,=20integer)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.updatenetworkattachment(uuid,=20=
uuid,=20uuid,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20integer,=20character=20varying,=20text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatenetworkqos(uuid,=20smallint,=20=
character=20varying,=20text,=20uuid,=20integer,=20integer,=20integer,=20=
integer,=20integer,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatenumanode(uuid,=20smallint,=20bigint,=20smallint,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatenumanodestatistics(uuid,=20bigint,=20integer,=20numeric,=20=
numeric,=20numeric,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateoriginaltemplatename(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updateovfgenerations(character=20varying,=20character=20varying,=20=
text,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updateovfupdatedinfo(character=20varying,=20integer,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatepolicyunit(uuid,=20boolean,=20text,=20text)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updateprovider(uuid,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20boolean,=20character=20varying,=20text,=20text,=20character=20=
varying,=20character=20varying,=20text,=20text,=20text,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatequotaforimageandsnapshots(uuid,=20uuid,=20uuid)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.updatequotametadata(uuid,=20=
uuid,=20character=20varying,=20character=20varying,=20integer,=20=
integer,=20integer,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatereplicacount(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updaterole(character=20varying,=20uuid,=20=
character=20varying,=20boolean,=20integer,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updatesnapshot(uuid,=20uuid,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
timestamp=20with=20time=20zone,=20text,=20text,=20character=20varying,=20=
uuid,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatesnapshotcountdec(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatesnapshotcountinc(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatesnapshotid(uuid,=20uuid)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.updatesnapshotstatus(uuid,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestartedexecutionentitiestounknown(timestamp=20with=20time=20=
zone)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestatusofimagesbyimagegroupid(uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updatestep(uuid,=20uuid,=20uuid,=20=
character=20varying,=20text,=20integer,=20character=20varying,=20=
timestamp=20with=20time=20zone,=20timestamp=20with=20time=20zone,=20=
character=20varying,=20uuid,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatestepexternalidandtype(uuid,=20=
uuid,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatestepstatusandendtime(uuid,=20character=20varying,=20=
timestamp=20with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatestorage_domain_dynamic(integer,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestorage_domain_static(uuid,=20character=20varying,=20=
character=20varying,=20character=20varying,=20text,=20integer,=20=
integer,=20integer,=20bigint,=20boolean,=20integer,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestorage_pool(character=20varying,=20text,=20uuid,=20=
character=20varying,=20integer,=20boolean,=20character=20varying,=20=
integer,=20uuid,=20character=20varying,=20integer,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updatestorage_pool_iso_map_status(uuid,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestorage_pool_partial(character=20varying,=20text,=20uuid,=20=
character=20varying,=20boolean,=20character=20varying,=20character=20=
varying,=20integer,=20uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatestorage_pool_status(uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updatestorage_server_connections(character=20varying,=20character=20=
varying,=20character=20varying,=20text,=20integer,=20character=20=
varying,=20character=20varying,=20text,=20character=20varying,=20=
character=20varying,=20character=20varying,=20smallint,=20smallint)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestoragedevice(uuid,=20text,=20character=20varying,=20=
character=20varying,=20text,=20character=20varying,=20text,=20character=20=
varying,=20text,=20bigint,=20boolean)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.updatestoragedomainexternalstatus(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestoragedomainovfinfo(uuid,=20integer,=20uuid,=20text,=20=
timestamp=20with=20time=20zone)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatestorageqos(uuid,=20smallint,=20character=20=
varying,=20text,=20uuid,=20integer,=20integer,=20integer,=20integer,=20=
integer,=20integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatestorageserverconnectionextension(uuid,=20uuid,=20character=20=
varying,=20text,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatesupportedclusterfeature(uuid,=20uuid,=20boolean)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.updatetags(character=20=
varying,=20uuid,=20character=20varying,=20uuid,=20boolean,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatetags_vm_pool_map(integer,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateuser(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20uuid,=20character=20=
varying,=20boolean,=20text,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updateuserimpl(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20uuid,=20character=20=
varying,=20text,=20character=20varying)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.updateuserprofile(uuid,=20uuid,=20uuid,=20text,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevdcoption(character=20varying,=20character=20varying,=20=
integer,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatevds_interface(character=20varying,=20character=20=
varying,=20integer,=20character=20varying,=20uuid,=20boolean,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20character=20=
varying,=20integer,=20integer,=20uuid,=20character=20varying,=20integer,=20=
integer,=20boolean,=20text,=20character=20varying,=20character=20=
varying,=20integer,=20integer,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updatevds_interface_statistics(uuid,=20numeric,=20numeric,=20=
bigint,=20bigint,=20numeric,=20numeric,=20bigint,=20bigint,=20integer,=20=
double=20precision,=20uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatevdscpustatistics(uuid,=20integer,=20numeric,=20=
numeric,=20numeric,=20integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatevdsdynamic(integer,=20integer,=20character=20=
varying,=20numeric,=20character=20varying,=20boolean,=20integer,=20=
integer,=20integer,=20uuid,=20integer,=20integer,=20integer,=20integer,=20=
integer,=20integer,=20integer,=20integer,=20character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
integer,=20character=20varying,=20integer,=20integer,=20integer,=20=
boolean,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20integer,=20=
text,=20integer,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20text,=20text,=20smallint,=20integer,=20smallint,=20=
boolean,=20character=20varying,=20text,=20text,=20boolean,=20boolean,=20=
text,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatevdsdynamicisupdateavailable(uuid,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevdsdynamicnetconfigdirty(uuid,=20boolean)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updatevdsdynamicpowermanagementpolicyflag(uuid,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevdsdynamicstatus(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatevdsdynamicstatusandreasons(uuid,=20=
integer,=20integer,=20text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatevdsstatic(character=20varying,=20text,=20character=20=
varying,=20integer,=20smallint,=20uuid,=20uuid,=20character=20varying,=20=
boolean,=20integer,=20integer,=20boolean,=20character=20varying,=20=
boolean,=20bigint,=20integer,=20character=20varying,=20character=20=
varying,=20integer,=20character=20varying,=20boolean,=20uuid,=20uuid,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevdsstaticlaststoredkernelcmdline(uuid,=20text)=20cascade;=0A=
=20drop=20function=20if=20exists=20public.updatevdsstatistics(numeric,=20=
numeric,=20numeric,=20numeric,=20integer,=20integer,=20integer,=20uuid,=20=
bigint,=20bigint,=20bigint,=20bigint,=20bigint,=20integer,=20bigint,=20=
boolean,=20integer,=20bigint,=20integer,=20boolean,=20boolean,=20=
boolean,=20boolean,=20timestamp=20with=20time=20zone)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updatevm_interface_statistics(uuid,=20numeric,=20numeric,=20=
bigint,=20bigint,=20numeric,=20numeric,=20bigint,=20bigint,=20integer,=20=
double=20precision,=20uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatevm_pool_map(uuid,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatevm_pools(character=20varying,=20=
text,=20uuid,=20character=20varying,=20integer,=20boolean,=20character=20=
varying,=20integer,=20uuid,=20smallint,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmcpuprofileidforclusterid(uuid,=20uuid)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updatevmdevice(uuid,=20uuid,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
integer,=20text,=20boolean,=20boolean,=20boolean,=20character=20varying,=20=
text,=20uuid,=20character=20varying,=20boolean,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmdevicebootorder(uuid,=20uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.updatevmdeviceforhotplugdisk(uuid,=20uuid,=20boolean)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
public.updatevmdeviceruntimeinfo(uuid,=20uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmdynamic(text,=20character=20varying,=20character=20=
varying,=20uuid,=20character=20varying,=20uuid,=20uuid,=20integer,=20=
uuid,=20character=20varying,=20character=20varying,=20character=20=
varying,=20timestamp=20with=20time=20zone,=20timestamp=20with=20time=20=
zone,=20integer,=20boolean,=20integer,=20boolean,=20integer,=20integer,=20=
uuid,=20character=20varying,=20integer,=20integer,=20integer,=20=
character=20varying,=20integer,=20numeric,=20character=20varying,=20=
boolean,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20integer,=20integer,=20integer,=20=
integer,=20character=20varying,=20integer,=20character=20varying,=20=
integer,=20bigint,=20bigint,=20bigint,=20integer,=20character=20varying,=20=
integer,=20character=20varying,=20character=20varying,=20character=20=
varying,=20character=20varying,=20character=20varying,=20text)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmdynamicstatus(uuid,=20integer)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatevmicon(uuid,=20text)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.updatevmicondefault(uuid,=20=
integer,=20uuid,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevminit(uuid,=20text,=20text,=20text,=20boolean,=20character=20=
varying,=20text,=20text,=20text,=20text,=20character=20varying,=20text,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevminterface(uuid,=20character=20varying,=20character=20=
varying,=20integer,=20uuid,=20uuid,=20uuid,=20integer,=20boolean)=20=
cascade;=0A=20drop=20function=20if=20exists=20public.updatevmjobs(uuid,=20=
uuid,=20integer,=20integer,=20integer,=20integer,=20bigint,=20bigint,=20=
uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmstatic(character=20varying,=20text,=20integer,=20integer,=20=
integer,=20uuid,=20uuid,=20character=20varying,=20uuid,=20timestamp=20=
with=20time=20zone,=20integer,=20boolean,=20boolean,=20boolean,=20=
integer,=20integer,=20integer,=20integer,=20character=20varying,=20=
boolean,=20boolean,=20boolean,=20boolean,=20character=20varying,=20text,=20=
boolean,=20integer,=20integer,=20integer,=20integer,=20integer,=20=
integer,=20character=20varying,=20integer,=20character=20varying,=20=
character=20varying,=20character=20varying,=20integer,=20character=20=
varying,=20character=20varying,=20integer,=20uuid,=20character=20=
varying,=20boolean,=20boolean,=20character=20varying,=20boolean,=20uuid,=20=
uuid,=20uuid,=20uuid,=20character=20varying,=20integer,=20integer,=20=
smallint,=20character=20varying,=20boolean,=20character=20varying,=20=
boolean,=20boolean,=20uuid,=20boolean,=20boolean,=20character=20varying,=20=
character=20varying,=20uuid,=20uuid,=20uuid,=20character=20varying,=20=
character=20varying,=20uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.updatevmstatistics(numeric,=20numeric,=20numeric,=20=
integer,=20integer,=20integer,=20integer,=20text,=20text,=20text,=20=
text,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmtagsdefaultdisplaytype(uuid,=20uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmtemplate(integer,=20timestamp=20with=20time=20zone,=20=
character=20varying,=20text,=20integer,=20integer,=20character=20=
varying,=20integer,=20integer,=20integer,=20integer,=20uuid,=20uuid,=20=
integer,=20boolean,=20boolean,=20integer,=20integer,=20character=20=
varying,=20boolean,=20integer,=20integer,=20integer,=20integer,=20=
integer,=20integer,=20boolean,=20boolean,=20boolean,=20boolean,=20=
character=20varying,=20boolean,=20character=20varying,=20integer,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
uuid,=20integer,=20text,=20boolean,=20character=20varying,=20integer,=20=
boolean,=20uuid,=20character=20varying,=20integer,=20character=20=
varying,=20smallint,=20character=20varying,=20boolean,=20boolean,=20=
boolean,=20uuid,=20character=20varying,=20boolean,=20boolean,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
character=20varying,=20uuid,=20uuid,=20character=20varying,=20character=20=
varying,=20uuid)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevmtemplateshiftbasetemplate(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.updatevmtemplatestatus(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.updatevnicprofile(uuid,=20character=20varying,=20uuid,=20uuid,=20=
boolean,=20boolean,=20text,=20text,=20uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.upsertexternalvariable(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.upsertkdumpstatus(uuid,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.upsertkdumpstatusforip(character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.uuid_generate_v1()=20cascade;=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20TYPE=20IF=20EXISTS=20idTextType=20CASCADE;=0A=
**************************=0A=0ADROP=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20TYPE=20idtexttype=20AS=20(id=20TEXT);=0A=
**************************=0A=0ACREATE=20TYPE=0A*********=20QUERY=20=
**********=0ADROP=20TYPE=20IF=20EXISTS=20idUuidType=20CASCADE;=0A=
**************************=0A=0ADROP=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20TYPE=20iduuidtype=20AS=20(id=20uuid);=0A=
**************************=0A=0ACREATE=20TYPE=0A*********=20QUERY=20=
**********=0ADROP=20TYPE=20IF=20EXISTS=20booleanResultType=20CASCADE;=0A=
**************************=0A=0ADROP=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20TYPE=20booleanresulttype=20AS=20(result=20=
boolean);=0A**************************=0A=0ACREATE=20TYPE=0A*********=20=
QUERY=20**********=0ADROP=20TYPE=20IF=20EXISTS=20authzEntryInfoType=20=
CASCADE;=0A**************************=0A=0ADROP=20TYPE=0A*********=20=
QUERY=20**********=0ACREATE=20TYPE=20authzentryinfotype=20AS=20(=0A=20=20=
=20=20name=20TEXT,=0A=20=20=20=20namespace=20VARCHAR(2048),=0A=20=20=20=20=
authz=20VARCHAR(255)=0A);=0A**************************=0A=0ACREATE=20=
TYPE=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
getGlobalIds=20(v_name=20VARCHAR(4000))=0ARETURNS=20UUID=20IMMUTABLE=20=
STRICT=20AS=20$FUNCTION$=0A=0ADECLARE=20v_id=20UUID;=0A=0ABEGIN=0A=20=20=20=
=20IF=20(v_name=20=3D=20'system')=20THEN=0A=20=20=20=20=20=20=20=20v_id=20=
:=3D=20'AAA00000-0000-0000-0000-123456789AAA';=0A=20=20=20=20=
ELSIF(v_name=20=3D=20'everyone')=20THEN=0A=20=20=20=20=20=20=20=20v_id=20=
:=3D=20'EEE00000-0000-0000-0000-123456789EEE';=0A=0A=20=20=20=20--=20=
bottom=20is=20an=20object=20which=20all=20the=20objects=20in=20the=20=
system=20are=20its=20parents=0A=20=20=20=20--=20useful=20to=20denote=20=
we=20want=20all=20objects=20when=20checking=20for=20permissions=0A=20=20=20=
=20ELSIF(v_name=20=3D=20'bottom')=20THEN=0A=20=20=20=20=20=20=20=20v_id=20=
:=3D=20'BBB00000-0000-0000-0000-123456789BBB';=0A=20=20=20=20END=20IF;=0A=
=0A=20=20=20=20RETURN=20v_id;=0AEND;$FUNCTION$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
public.fnSplitterInteger(ids=20TEXT)=0ARETURNS=20SETOF=20INTEGER=20=
IMMUTABLE=20AS=0A$FUNCTION$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=20=20=
=20=20=20=20=20=20SELECT=20CAST(regexp_split_to_table(ids,=20',')=20AS=20=
INTEGER);=0AEND;=20$FUNCTION$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20PUBLIC.fnSplitter=20(ids=20=
TEXT)=0ARETURNS=20SETOF=20idTextType=20IMMUTABLE=0AAS=20$FUNCTION$=0A=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
regexp_split_to_table(ids,=20',')=20AS=20id;=0AEND;$FUNCTION$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fnSplitterUuid=20=
(ids=20TEXT)=0ARETURNS=20SETOF=20UUID=20IMMUTABLE=20AS=20$FUNCTION$=0A=0A=
BEGIN=0A=20=20=20=20IF=20ids=20!=3D=20''=20THEN=0A=20=20=20=20=20=20=20=20=
RETURN=20QUERY=0A=20=20=20=20=20=20=20=20SELECT=20=
CAST(regexp_split_to_table(ids,=20',')=20AS=20UUID);=0A=20=20=20=20END=20=
IF;=0A=0AEND;$FUNCTION$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
PUBLIC.fnSplitterWithSeperator=20(=0A=20=20=20=20ids=20TEXT,=0A=20=20=20=20=
separator=20VARCHAR(10)=0A=20=20=20=20)=0ARETURNS=20SETOF=20idTextType=20=
IMMUTABLE=0AAS=20$FUNCTION$=0A=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=
=20=20=20=20SELECT=20regexp_split_to_table(ids,=20separator)=20AS=20id;=0A=
END;$FUNCTION$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ADROP=20TYPE=20IF=20=
EXISTS=20user_permissions=20CASCADE;=0A**************************=0A=0A=
DROP=20TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
user_permissions=20AS=20(=0A=20=20=20=20permission_id=20uuid,=0A=20=20=20=
=20role_id=20uuid,=0A=20=20=20=20user_id=20uuid=0A);=0A=
**************************=0A=0ACREATE=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
PUBLIC.fn_user_permissions=20(v_userId=20IN=20uuid)=0ARETURNS=20SETOF=20=
user_permissions=20STABLE=20AS=20$FUNCTION$=0A=0ADECLARE=0A=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20permissions.id=20AS=20=
permission_id,=0A=20=20=20=20=20=20=20=20permissions.role_id,=0A=20=20=20=
=20=20=20=20=20permissions.ad_element_id=20AS=20user_id=0A=20=20=20=20=
FROM=20permissions=0A=20=20=20=20INNER=20JOIN=20users=0A=20=20=20=20=20=20=
=20=20ON=20permissions.ad_element_id=20=3D=20users.user_id=0A=20=20=20=20=
WHERE=20users.user_id=20=3D=20v_userId=0A=0A=20=20=20=20UNION=0A=0A=20=20=
=20=20SELECT=0A=20=20=20=20=20=20=20=20permissions.id=20AS=20=
permission_id,=0A=20=20=20=20=20=20=20=20permissions.role_id,=0A=20=20=20=
=20=20=20=20=20TEMP.user_id=20AS=20user_id=0A=20=20=20=20FROM=20=
permissions=0A=20=20=20=20INNER=20JOIN=20(=0A=20=20=20=20=20=20=20=20--=20=
get=20all=20groups=20of=20admin=20users=0A=20=20=20=20=20=20=20=20SELECT=0A=
=20=20=20=20=20=20=20=20=20=20=20=20ad_groups.id=20group_id,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20users.user_id=0A=20=20=20=20=20=20=20=20FROM=0A=20=
=20=20=20=20=20=20=20=20=20=20=20ad_groups,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20engine_sessions=0A=20=20=20=20=20=20=20=20WHERE=20ad_groups.id=20=
IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20fnsplitteruuid(engine_sessions.group_ids)=0A=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20users.user_id=20=3D=20v_userId=0A=20=20=20=20=20=20=20=20)=20TEMP=0A=
=20=20=20=20=20=20=20=20ON=20permissions.ad_element_id=20=3D=20=
TEMP.group_id;=0AEND;$FUNCTION$=0ALANGUAGE=20'plpgsql';=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
PUBLIC.fn_get_entity_parents=20(=0A=20=20=20=20v_entity_id=20IN=20uuid,=0A=
=20=20=20=20v_object_type=20IN=20int4=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
idUuidType=20STABLE=20AS=20$FUNCTION$=0A=0A/*Gets=20a=20list=20of=20all=20=
parent=20GUID=20to=20the=20system=20root=20(including)=0A=0AObject=20=
Types=20(compatible=20with=20VdcObjectType,=20XXX=20entries=20are=20=
unused=20currently)=0AUnknown=20XXX,=0ASystem=20XXX,=0A=20=20=20=20=20=20=
=20Bottom=20=3D=200,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
VM=20=3D=202,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20VDS=20=3D=20=
3,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20VmTemplate=20=3D=20=
4,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20VmPool=20=3D=205,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AdElements=20XXX,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20Tags=20XXX,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20Bookmarks=20XXX,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20Cluster=20=3D=209,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20MultiLevelAdministration=20XXX,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20Storage=20=3D=2011,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20EventNotification=20XXX,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20ImportExport=20XXX,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20StoragePool=20=3D=2014,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20User=20=3D=2015,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20Role=20=3D=2016,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20Quota=20=3D=2017,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20GlusterVolume=20=3D=2018,=0A=20=20=20=20=20=20=20=20Disk=20=3D=2019,=0A=
=20=20=20=20=20=20=20=20Network=20=3D=2020,=0A=20=20=20=20=20=20=20=20=
VNICProfile=20=3D=2027,=0A=20=20=20=20=20=20=20=20MacPool=20=3D=2028=0A=20=
=20=20=20=20=20=20=20DiskProfile=20=3D=2029=0A=20=20=20=20=20=20=20=20=
CpuProfile=20=3D=2030=0A*/=0ADECLARE=0A=20=20=20=20v_entity_type=20int4=20=
:=3D=20v_object_type;=0A=20=20=20=20system_root_id=20uuid;=0A=20=20=20=20=
v_cluster_id=20uuid;=0A=20=20=20=20ds_id=20uuid;=0A=20=20=20=20=
v_image_id=20uuid;=0A=20=20=20=20v_storage_id=20uuid;=0A=20=20=20=20=
v_vm_id=20uuid;=0A=20=20=20=20v_storage_pool_id=20uuid;=0A=20=20=20=20=
v_profile_network_id=20uuid;=0A=20=20=20=20v_disk_profile_storage_id=20=
uuid;=0A=20=20=20=20v_cpu_profile_cluster_id=20uuid;=0A=0ABEGIN=0A=20=20=20=
=20system_root_id=20:=3D=20(=0A=20=20=20=20=20=20=20=20SELECT=20=
getGlobalIds('system')=0A=20=20=20=20);--=20hardcoded=20also=20in=20MLA=20=
Handler=0A=20=20=20=20CASE=0A=20=20=20=20=20=20=20=20WHEN=20=
v_entity_type=20=3D=200=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20--=20=
Bottom=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20RETURN=20QUERY=20=
SELECT=20object_id=20FROM=20permissions;=0A=20=20=20=20=20=20=20=20WHEN=20=
v_entity_type=20=3D=202=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20--=20=
VM=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=20get=20cluster=20=
id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_cluster_id=20:=3D=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vm_static=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20vm_guid=20=3D=20v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20--=20get=20data=20center=20id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20ds_id=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=20storage_pool_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20cluster=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);RETURN=20QUERY=20SELECT=20system_root_id=20AS=20id=0A=0A=20=20=20=20=20=
=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=20ds_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v_cluster_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20v_entity_id=20=
AS=20id;=0A=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=3D=203=0A=20=20=
=20=20=20=20=20=20=20=20=20=20THEN=20--=20VDS=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20--=20get=20cluster=20id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20v_cluster_id=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20cluster_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vds_static=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20=
v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=20get=20data=20=
center=20id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ds_id=20:=3D=
=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20storage_pool_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20FROM=20cluster=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20);RETURN=20QUERY=20SELECT=20=
system_root_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=
=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20ds_id=20AS=20=
id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20SELECT=20v_cluster_id=20AS=20id=0A=0A=20=20=
=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20v_entity_id=20AS=20id;=0A=20=20=20=20=20=20=20=20=
WHEN=20v_entity_type=20=3D=204=0A=20=20=20=20=20=20=20=20=20=20=20=20=
THEN=20--=20Template=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
--=20get=20image=20id=20first=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20v_image_id=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20image_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20FROM=20images=20i=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20INNER=20JOIN=20vm_device=20vd=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
i.image_group_id=20=3D=20vd.device_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20WHERE=20vm_id=20=3D=20v_entity_id=20limit=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20--=20get=20the=20storage=20id=20=
from=20images=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_storage_id=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=20storage_domain_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20image_storage_domain_map=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20image_id=20=3D=20=
v_image_id=20limit=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=20=
finally=20get=20data=20center=20id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20ds_id=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=20storage_pool_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20FROM=20storage_pool_iso_map=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20storage_id=20=3D=20=
v_storage_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20RETURN=20QUERY=20=
SELECT=20system_root_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
ds_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20v_entity_id=20AS=20=
id;=0A=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=3D=205=0A=20=20=20=20=
=20=20=20=20=20=20=20=20THEN=20--=20VM=20Pool=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20--=20get=20cluster=20id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20v_cluster_id=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20cluster_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vm_pools=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vm_pool_id=20=3D=20=
v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=20get=20data=20=
center=20id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ds_id=20:=3D=
=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20storage_pool_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20FROM=20cluster=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20RETURN=20QUERY=20SELECT=20system_root_id=20AS=20id=0A=
=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=20ds_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=
=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20v_cluster_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v_entity_id=20AS=20id;=0A=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=
=3D=209=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20--=20Cluster=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=20get=20data=20center=20id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ds_id=20:=3D=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
storage_pool_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20cluster=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20cluster_id=20=3D=20v_entity_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20RETURN=20QUERY=20SELECT=20system_root_id=20AS=20id=0A=0A=20=20=
=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20ds_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=
=20=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v_entity_id=20AS=20id;=0A=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=
=3D=2011=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20--=20Storage=20=
Domain=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20RETURN=20QUERY=20=
SELECT=20system_root_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UNION=20ALL=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
storage_pool_id=20AS=20id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20storage_pool_iso_map=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20storage_id=20=3D=20v_entity_id=0A=0A=20=20=20=20=20=20=20=20=
=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20v_entity_id=20AS=20id;=0A=20=20=20=20=20=20=20=20WHEN=20=
v_entity_type=20=3D=2017=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20--=20=
Quota=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=20get=20data=20=
center=20id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ds_id=20:=3D=
=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20storage_pool_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20FROM=20quota=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20id=20=3D=20v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20RETURN=20QUERY=20SELECT=20system_root_id=20AS=20id=0A=0A=20=20=20=
=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=20ds_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=
=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v_entity_id=20AS=20id;=0A=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=
=3D=2018=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20--=20GlusterVolume=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=20get=20cluster=20id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_cluster_id=20:=3D=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v.cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20gluster_volumes=20v=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20id=20=3D=20v_entity_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20--=20get=20data=20center=20id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20ds_id=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=20storage_pool_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20cluster=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20RETURN=20QUERY=20=
SELECT=20system_root_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
ds_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20v_cluster_id=20AS=20=
id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20SELECT=20v_entity_id=20AS=20id;=0A=20=20=20=
=20=20=20=20=20WHEN=20v_entity_type=20=3D=2019=0A=20=20=20=20=20=20=20=20=
=20=20=20=20THEN=20--=20Disk=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20--=20get=20data=20center,=20storage=20domain=20and=20vm=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20INTO=20ds_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20v_storage_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20v_vm_id=20storage_pool_id,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20storage_id,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20vm_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20images_storage_domain_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20LEFT=20JOIN=20vm_device=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20ON=20vm_device.device_id=20=3D=20=
images_storage_domain_view.disk_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20image_group_id=20=3D=20v_entity_id;=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20--=20get=20cluster=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20v_cluster_id=20:=3D=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20cluster_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vm_static=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vm_guid=20=
=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20RETURN=20QUERY=20=
SELECT=20system_root_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
ds_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20v_storage_id=20AS=20=
id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20SELECT=20v_vm_id=20AS=20id=0A=0A=20=20=20=20=
=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=20v_cluster_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=
=20=20=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20v_entity_id=20AS=20id;=0A=20=20=20=20=20=20=20=20WHEN=20=
v_entity_type=20=3D=2020=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20--=20=
Network=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20INTO=20=
v_storage_pool_id=20network.storage_pool_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20network=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20network.id=20=3D=20v_entity_id;=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20RETURN=20QUERY=20SELECT=20system_root_id=20AS=20=
id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20SELECT=20v_storage_pool_id=20AS=20id=0A=0A=20=
=20=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=20v_entity_id=20AS=20id;=0A=20=20=20=20=20=20=20=
=20WHEN=20v_entity_type=20=3D=2027=0A=20=20=20=20=20=20=20=20=20=20=20=20=
THEN=20--=20VNICProfile=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20INTO=20v_profile_network_id=20vnic_profiles.network_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vnic_profiles=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vnic_profiles.id=20=3D=20=
v_entity_id;=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
INTO=20v_storage_pool_id=20network.storage_pool_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20network=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20network.id=20=3D=20v_profile_network_id;=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20RETURN=20QUERY=20SELECT=20=
system_root_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=
=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v_storage_pool_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v_profile_network_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v_entity_id=20AS=20id;=0A=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=
=3D=2029=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20--=20DiskProfile=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20INTO=20=
v_disk_profile_storage_id=20disk_profiles.storage_domain_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20disk_profiles=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20disk_profiles.id=20=3D=20=
v_entity_id;=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
INTO=20v_storage_pool_id=20storage_pool_iso_map.storage_pool_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20storage_pool_iso_map=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
storage_pool_iso_map.storage_id=20=3D=20v_disk_profile_storage_id;=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20RETURN=20QUERY=20SELECT=20=
system_root_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=
=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v_storage_pool_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v_disk_profile_storage_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=
=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v_entity_id=20AS=20id;=0A=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=
=3D=2030=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20--=20CpuProfile=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20INTO=20=
v_cpu_profile_cluster_id=20cpu_profiles.cluster_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20cpu_profiles=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20cpu_profiles.id=20=3D=20v_entity_id;=0A=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20INTO=20=
v_storage_pool_id=20cluster.storage_pool_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20cluster=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20cluster.cluster_id=20=3D=20v_cpu_profile_cluster_id;=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20RETURN=20QUERY=20SELECT=20=
system_root_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=
=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v_storage_pool_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v_cpu_profile_cluster_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=
=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v_entity_id=20AS=20id;=0A=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=
=3D=2023=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20--=20Gluster=20=
Hook=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=20get=20=
cluster=20id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_cluster_id=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=20cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20gluster_hooks=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20id=20=3D=20v_entity_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20--=20get=20data=20center=20id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20ds_id=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=20storage_pool_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20cluster=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20RETURN=20QUERY=20SELECT=20=
system_root_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=
=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20ds_id=20AS=20=
id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20SELECT=20v_cluster_id=20AS=20id=0A=0A=20=20=
=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20v_entity_id=20AS=20id;=0A=20=20=20=20=20=20=20=20=
WHEN=20v_entity_type=20=3D=2025=0A=20=20=20=20=20=20=20=20=20=20=20=20=
THEN=20--=20Gluster=20Service=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20--=20get=20cluster=20id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20v_cluster_id=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=20cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20vds_static=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20v_entity_id=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20--=20get=20data=20center=20id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20ds_id=20:=3D=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20storage_pool_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20cluster=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20cluster_id=20=
=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20RETURN=20QUERY=20SELECT=20=
system_root_id=20AS=20id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=
=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20ds_id=20AS=20=
id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20SELECT=20v_cluster_id=20AS=20id=0A=0A=20=20=
=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20v_entity_id=20AS=20id;=0A=20=20=20=20=20=20=20=20=
ELSE=20IF=0A=20=20=20=20=20=20=20=20=20=20=20=20v_entity_type=20IN=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=201,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=2014,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=2015,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=2016,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=2028=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20)=20THEN=20--=20Data=20Center,=20users,=20roles=20and=20=
mac=20pools=20are=20under=20system=0A=20=20=20=20=20=20=20=20=20=20=20=20=
RETURN=20QUERY=20SELECT=20system_root_id=20AS=20id=0A=0A=20=20=20=20=20=20=
=20=20UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
v_entity_id=20AS=20id;=0A=20=20=20=20=20=20=20=20END=20IF;=0A=0A=20=20=20=
=20END=20CASE=20;=0AEND;$FUNCTION$=0ALANGUAGE=20'plpgsql';=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
PUBLIC.fn_authz_entry_info(v_ad_element_id=20IN=20uuid)=0ARETURNS=20=
AuthzEntryInfoType=20STABLE=0AAS=20$FUNCTION$=0ADECLARE=0A=20=20=20=20=
result=20authzEntryInfoType;=0ABEGIN=0A=20=20=20=20IF=20(v_ad_element_id=20=
=3D=20getGlobalIds('everyone'))=20THEN=0A=20=20=20=20=20=20=20=20SELECT=20=
'Everyone',=0A=20=20=20=20=20=20=20=20=20=20=20=20'*',=0A=20=20=20=20=20=20=
=20=20=20=20=20=20''=0A=20=20=20=20=20=20=20=20INTO=20result;=0A=20=20=20=
=20ELSE=0A=20=20=20=20=20=20=20=20SELECT=20(COALESCE(name,=20'')=20||=20=
'=20'=20||=20COALESCE(surname,=20'')=20||=20'=20('=20||=20=
COALESCE(username,=20'')=20||=20'@'=20||=20COALESCE(domain,=20'')=20||=20=
')'),=0A=20=20=20=20=20=20=20=20=20=20=20=20namespace,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20domain=0A=20=20=20=20=20=20=20=20INTO=20result=0A=20=20=
=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=20=20=20=20WHERE=20user_id=20=
=3D=20v_ad_element_id;=0A=0A=20=20=20=20=20=20=20=20IF=20(result=20IS=20=
NULL)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20name,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20namespace,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20domain=0A=20=20=20=20=20=20=
=20=20=20=20=20=20INTO=20result=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20ad_groups=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20ID=20=3D=20=
v_ad_element_id;=0A=20=20=20=20=20=20=20=20END=20IF=20;=0A=20=20=20=20=
END=20IF;=0A=20=20=20=20RETURN=20result;=0AEND;$FUNCTION$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
PUBLIC.fn_get_ad_element_name(v_ad_element_id=20IN=20uuid)=0ARETURNS=20=
TEXT=20STABLE=0AAS=20$FUNCTION$=0ADECLARE=0A=20=20=20=20result=20TEXT;=0A=
BEGIN=0A=20=20=20=20IF=20(v_ad_element_id=20=3D=20=
getGlobalIds('everyone'))=20THEN=0A=20=20=20=20=20=20=20=20result=20:=3D=20=
'Everyone';=0A=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20SELECT=20=
(COALESCE(name,=20'')=20||=20'=20'=20||=20COALESCE(surname,=20'')=20||=20=
'=20('=20||=20COALESCE(username,=20'')=20||=20'@'=20||=20=
COALESCE(domain,=20'')=20||=20')')=0A=20=20=20=20=20=20=20=20INTO=20=
result=0A=20=20=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=20=20=20=20=
WHERE=20user_id=20=3D=20v_ad_element_id;=0A=0A=20=20=20=20=20=20=20=20IF=20=
(result=20IS=20NULL)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
name=0A=20=20=20=20=20=20=20=20=20=20=20=20INTO=20result=0A=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20ad_groups=0A=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20ID=20=3D=20v_ad_element_id;=0A=20=20=20=20=20=20=20=20END=20=
IF=20;=0A=20=20=20END=20IF;=0A=20=20=20RETURN=20result;=0AEND;$FUNCTION$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
PUBLIC.fn_get_entity_name(v_entity_id=20IN=20uuid,=0A=20=20=20=20=
v_object_type=20IN=20int4=0A=20=20=20=20)=0ARETURNS=20TEXT=20STABLE=0AAS=20=
$FUNCTION$=0A=20=20=20=20=20=20=20=20=20=20=20=20/*=20=20=20=20Gets=20=
object=20name=20by=20its=20id=20and=20type=0A=0A=20=20=20=20Object=20=
Types=20(compatible=20with=20VdcObjectType,=20XXX=20entries=20are=20=
unused=20currently)=0A=20=20=20=20=20=20=20=20Unknown=20XXX,=0A=20=20=20=20=
=20=20=20=20System=20XXX,=0A=20=20=20=20=20=20=20=20VM=20=3D=202,=0A=20=20=
=20=20=20=20=20=20VDS=20=3D=203,=0A=20=20=20=20=20=20=20=20VmTemplate=20=
=3D=204,=0A=20=20=20=20=20=20=20=20VmPool=20=3D=205,=0A=20=20=20=20=20=20=
=20=20AdElements=20XXX,=0A=20=20=20=20=20=20=20=20Tags=20XXX,=0A=20=20=20=
=20=20=20=20=20Bookmarks=20XXX,=0A=20=20=20=20=20=20=20=20Cluster=20=3D=20=
9,=0A=20=20=20=20=20=20=20=20MultiLevelAdministration=20XXX,=0A=20=20=20=20=
=20=20=20=20Storage=20=3D=2011,=0A=20=20=20=20=20=20=20=20=
EventNotification=20XXX,=0A=20=20=20=20=20=20=20=20ImportExport=20XXX,=0A=
=20=20=20=20=20=20=20=20StoragePool=20=3D=2014,=0A=20=20=20=20=20=20=20=20=
User=20=3D=2015,=0A=20=20=20=20=20=20=20=20Role=20=3D=2016,=0A=20=20=20=20=
=20=20=20=20Quota=20=3D=2017,=0A=20=20=20=20=20=20=20=20GlusterVolume=20=
=3D=2018,=0A=20=20=20=20=20=20=20=20Disk=20=3D=2019,=0A=20=20=20=20=20=20=
=20=20Network=20=3D=2020,=0A=20=20=20=20=20=20=20=20VNICProfile=20=3D=20=
27,=0A=20=20=20=20=20=20=20=20MacPool=20=3D=2028,=0A=20=20=20=20=20=20=20=
=20DiskProfile=20=3D=2029=0A=20=20=20=20=20=20=20=20CpuProfile=20=3D=20=
30=0A*/=0A=20=20=20=20DECLARE=20v_entity_type=20int4=20:=3D=20=
v_object_type;result=20TEXT;BEGIN=0A=20=20=20=20CASE=0A=20=20=20=20=20=20=
=20=20WHEN=20v_entity_type=20=3D=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=
THEN=20result=20:=3D=20'System';=0A=20=20=20=20=20=20=20=20WHEN=20=
v_entity_type=20=3D=202=0A=20=20=20=20=20=20=20=20OR=20v_entity_type=20=3D=
=204=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20result=20:=3D=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=20vm_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vm_static=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
vm_guid=20=3D=20v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20WHEN=20=
v_entity_type=20=3D=203=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20=
result=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20SELECT=20vds_name=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vds_static=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20v_entity_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=3D=205=0A=20=20=20=20=20=20=
=20=20=20=20=20=20THEN=20result=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
vm_pool_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20FROM=20vm_pools=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vm_pool_id=20=
=3D=20v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20WHEN=20=
v_entity_type=20=3D=207=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20=
result=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20SELECT=20tag_name=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20tags=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20tag_id=20=3D=20v_entity_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=
=20=20=20=20=20WHEN=20v_entity_type=20=3D=208=0A=20=20=20=20=20=20=20=20=20=
=20=20=20THEN=20result=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20bookmark_name=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20bookmarks=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20bookmark_id=20=3D=20=
v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=
=3D=209=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20result=20:=3D=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=20name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20cluster=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20WHEN=20=
v_entity_type=20=3D=2011=0A=20=20=20=20=20=20=20=20=20=20=20=20=20THEN=20=
result=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20storage_name=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20storage_domain_static=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20id=20=3D=20=
v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20WHEN=20=
v_entity_type=20=3D=2014=0A=20=20=20=20=20=20=20=20=20=20=20=20=20THEN=20=
result=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20name=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
storage_pool=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20WHERE=20id=20=3D=20v_entity_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=3D=2015=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20THEN=20result=20:=3D=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
username=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20=
v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20WHEN=20=
v_entity_type=20=3D=2016=0A=20=20=20=20=20=20=20=20=20=20=20=20=20THEN=20=
result=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20name=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
roles=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20WHERE=20id=20=3D=20v_entity_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=
=20=20=20=20=20=20WHEN=20v_entity_type=20=3D=2017=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20THEN=20result=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
quota_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20quota=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20id=20=3D=20=
v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20WHEN=20=
v_entity_type=20=3D=2018=0A=20=20=20=20=20=20=20=20=20=20=20=20=20THEN=20=
result=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20vol_name=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
gluster_volumes=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20id=20=3D=20v_entity_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=3D=2019=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20THEN=20result=20:=3D=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
disk_alias=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20base_disks=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
disk_id=20=3D=20v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20WHEN=20=
v_entity_type=20=3D=2020=0A=20=20=20=20=20=20=20=20=20=20=20=20=20THEN=20=
result=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20name=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
network=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20id=20=3D=20v_entity_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=
=20=20=20=20=20=20=20WHEN=20v_entity_type=20=3D=2023=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20THEN=20result=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
CONCAT=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20gluster_command,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20'-',=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20stage,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'-',=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20gluster_hooks=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20id=20=3D=20v_entity_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20);=0A=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=3D=2025=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20THEN=20result=20:=3D=20(=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20service_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20gluster_services=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20id=20=3D=20v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20=
WHEN=20v_entity_type=20=3D=2027=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
THEN=20result=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20name=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vnic_profiles=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20id=20=3D=20v_entity_id=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20);=0A=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=3D=2028=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20THEN=20result=20:=3D=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20FROM=20mac_pools=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
id=20=3D=20v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20WHEN=20=
v_entity_type=20=3D=2029=0A=20=20=20=20=20=20=20=20=20=20=20=20=20THEN=20=
result=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20name=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
disk_profiles=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20id=20=3D=20v_entity_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20WHEN=20v_entity_type=20=3D=2030=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20THEN=20result=20:=3D=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20cpu_profiles=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20id=20=3D=20=
v_entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=20=20ELSE=20result=20:=3D=20=
'Unknown=20type=20'=20||=20v_entity_type;=0A=20=20=20=20=20=20=20=20END=20=
CASE=20;=0A=20=20=20=20=20=20=20=20--=20This=20should=20be=20written=20=
to=20an=20error=20var=20or=20include=20object_id=20that=20is=20missing=0A=
=20=20=20=20=20=20=20=20--=20=20=20=20IF=20result=20IS=20NULL=20THEN=0A=20=
=20=20=20=20=20=20=20--=20=20=20=20=20=20=20=20result=20:=3D=20=
v_entity_id=20||=20''=20NOT=20FOUND'';=0A=20=20=20=20=20=20=20=20--=20=20=
=20=20END=20IF;=0A=20=20=20=20=20=20=20=20RETURN=20result;=0A=
END;$FUNCTION$=0ALANGUAGE=20'plpgsql';=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20getUserAndGroupsById(v_id=20UUID)=0ARETURNS=20SETOF=20=
idUuidType=20STABLE=0AAS=20$FUNCTION$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20ad_groups.ID=0A=20=20=20=20FROM=20=
ad_groups,=0A=20=20=20=20=20=20=20=20=20engine_sessions=0A=20=20=20=20=
WHERE=20engine_sessions.user_id=20=3D=20v_id=0A=20=20=20=20=20=20=20=20=
AND=20ad_groups.id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
*=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnsplitteruuid(engine_sessions.group_ids)=0A=20=20=20=20=20=20=20=20)=0A=0A=
=20=20=20=20UNION=0A=20=20=20=20SELECT=20v_id=0A=0A=20=20=20=20UNION=0A=20=
=20=20=20--=20user=20is=20also=20member=20of=20'Everyone'=0A=20=20=20=20=
SELECT=20'EEE00000-0000-0000-0000-123456789EEE';=0AEND;$FUNCTION$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
getElementIdsByIdAndGroups(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_group_ids=20TEXT=0A=20=20=20=20)=0ARETURNS=20SETOF=20idUuidType=20=
STABLE=0AAS=20$FUNCTION$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=20=20=20=
=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20FROM=20=
fnsplitteruuid(v_group_ids)=0A=0A=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=
=20=20=20=20=20=20SELECT=20v_id=0A=0A=20=20=20=20=20=20=20=20UNION=0A=0A=20=
=20=20=20=20=20=20=20--=20user=20is=20also=20member=20of=20'Everyone'=0A=20=
=20=20=20=20=20=20=20SELECT=20'EEE00000-0000-0000-0000-123456789EEE';=0A=
END;$FUNCTION$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ADROP=20TYPE=20IF=0A=
EXISTS=20cluster_usage_rs=20CASCADE;=0A**************************=0A=0A=
DROP=20TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
cluster_usage_rs=20AS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
virtual_cpu_usage=20INT,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
mem_size_mb_usage=20BIGINT=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
getNonCountableQutoaVmStatuses()=0ARETURNS=20SETOF=20INT=20IMMUTABLE=0A=
AS=20$BODY$=0ABEGIN=0ARETURN=20query=0A=20=20=20=20SELECT=200=0A=0A=20=20=
=20=20UNION=20ALL=0A=0A=20=20=20=20SELECT=2013=0A=0A=20=20=20=20UNION=20=
ALL=0A=0A=20=20=20=20SELECT=2014=0A=0A=20=20=20=20UNION=20ALL=0A=0A=20=20=
=20=20SELECT=2015;=0A=20=20=20=20--(Down(0),=20Suspended(13),=20=
ImageIllegal(14),=20ImageLocked(15))=0AEND;$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20CalculateClusterUsage(=0A=
=20=20=20=20v_quota_id=20UUID,=0A=20=20=20=20v_cluster_id=20UUID=0A=20=20=
=20=20)=0ARETURNS=20SETOF=20cluster_usage_rs=20STABLE=0AAS=20$FUNCTION$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
cast(COALESCE(sum(num_of_sockets=20*=20cpu_per_socket),=200)=20AS=20INT)=20=
AS=20virtual_cpu_usage,=0A=20=20=20=20=20=20=20=20=20=20=20=
COALESCE(sum(mem_size_mb),=200)=20AS=20mem_size_mb_usage=0A=20=20=20=20=
FROM=20vm_static,=0A=20=20=20=20=20=20=20=20=20vm_dynamic=0A=20=20=20=20=
WHERE=20quota_id=20=3D=20v_quota_id=0A=20=20=20=20=20=20=20=20AND=20=
vm_dynamic.vm_guid=20=3D=20vm_static.vm_guid=0A=20=20=20=20=20=20=20=20=
AND=20vm_dynamic.status=20NOT=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=20getNonCountableQutoaVmStatuses()=0A=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_cluster_id=20=3D=20vm_static.cluster_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20OR=20v_cluster_id=20IS=20NULL=0A=20=20=20=20=20=20=20=20);=0A=
END;$FUNCTION$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ADROP=20TYPE=20IF=20=
EXISTS=20all_cluster_usage_rs=20CASCADE;=0A**************************=0A=0A=
DROP=20TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
all_cluster_usage_rs=20AS=20(=0A=20=20=20=20quota_cluster_id=20uuid,=0A=20=
=20=20=20quota_id=20uuid,=0A=20=20=20=20cluster_id=20uuid,=0A=20=20=20=20=
cluster_name=20VARCHAR(40),=0A=20=20=20=20virtual_cpu=20INT,=0A=20=20=20=20=
virtual_cpu_usage=20INT,=0A=20=20=20=20mem_size_mb=20BIGINT,=0A=20=20=20=20=
mem_size_mb_usage=20BIGINT=0A=20=20=20=20);=0A**************************=0A=
=0ACREATE=20TYPE=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20calculateAllClusterUsage()=0ARETURNS=20SETOF=20=
all_cluster_usage_rs=20STABLE=0AAS=20$FUNCTION$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=0A=20=20=20=20=20=20=20=20=
quota_limitation.id=20AS=20quota_cluster_id,=0A=20=20=20=20=20=20=20=20=
quota_limitation.quota_id=20AS=20quota_id,=0A=20=20=20=20=20=20=20=20=
quota_limitation.cluster_id=20AS=20cluster_id,=0A=20=20=20=20=20=20=20=20=
cluster.name=20AS=20cluster_name,=0A=20=20=20=20=20=20=20=20=
quota_limitation.virtual_cpu,=0A=20=20=20=20=20=20=20=20=
cast(COALESCE(sum(num_of_sockets=20*=20cpu_per_socket=20*=20=
cast(vm_dynamic.status=20NOT=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
getNonCountableQutoaVmStatuses()=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=20AS=20INT)),=200)=20AS=20=
INT)=20AS=20virtual_cpu_usage,=0A=20=20=20=20=20=20=20=20=
quota_limitation.mem_size_mb,=0A=20=20=20=20=20=20=20=20=
COALESCE(sum(vm_static.mem_size_mb),=200)=20AS=20mem_size_mb_usage=0A=20=20=
=20=20FROM=20quota_limitation=0A=20=20=20=20LEFT=20JOIN=20vm_static=0A=20=
=20=20=20=20=20=20=20ON=20vm_static.quota_id=20=3D=20=
quota_limitation.quota_id=0A=20=20=20=20LEFT=20JOIN=20vm_dynamic=0A=20=20=
=20=20=20=20=20=20ON=20vm_dynamic.vm_guid=20=3D=20vm_static.vm_guid=0A=20=
=20=20=20LEFT=20JOIN=20cluster=0A=20=20=20=20=20=20=20=20ON=20=
cluster.cluster_id=20=3D=20vm_static.cluster_id=0A=20=20=20=20WHERE=20=
quota_limitation.virtual_cpu=20IS=20NOT=20NULL=0A=20=20=20=20=20=20=20=20=
AND=20quota_limitation.mem_size_mb=20IS=20NOT=20NULL=0A=20=20=20=20GROUP=20=
BY=20quota_limitation.quota_id,=0A=20=20=20=20=20=20=20=20=
quota_limitation.cluster_id,=0A=20=20=20=20=20=20=20=20cluster_name,=0A=20=
=20=20=20=20=20=20=20quota_limitation.virtual_cpu,=0A=20=20=20=20=20=20=20=
=20quota_limitation.mem_size_mb,=0A=20=20=20=20=20=20=20=20=
vm_static.quota_id,=0A=20=20=20=20=20=20=20=20cluster.cluster_id,=0A=20=20=
=20=20=20=20=20=20vm_static.cluster_id,=0A=20=20=20=20=20=20=20=20=
quota_limitation.id;=0AEND;$FUNCTION$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20TYPE=20IF=20EXISTS=20all_storage_usage_rs=20CASCADE;=0A=
**************************=0A=0ADROP=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20TYPE=20all_storage_usage_rs=20AS=20(=0A=20=20=20=20=
quota_storage_id=20uuid,=0A=20=20=20=20quota_id=20uuid,=0A=20=20=20=20=
storage_id=20uuid,=0A=20=20=20=20storage_name=20VARCHAR(250),=0A=20=20=20=
=20storage_size_gb=20BIGINT,=0A=20=20=20=20storage_size_gb_usage=20FLOAT=0A=
=20=20=20=20);=0A**************************=0A=0ACREATE=20TYPE=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
calculateAllStorageUsage()=0ARETURNS=20SETOF=20all_storage_usage_rs=20=
STABLE=0AAS=20$FUNCTION$=0ABEGIN=0A--=20Summarize=20size=20of=20all=20=
disks=20that=20are=20active.=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=0A=20=20=20=20=20=20=20=20quota_limitation.id=20AS=20=
quota_storage_id,=0A=20=20=20=20=20=20=20=20quota_limitation.quota_id=20=
AS=20quota_id,=0A=20=20=20=20=20=20=20=20quota_limitation.storage_id=20=
AS=20storage_id,=0A=20=20=20=20=20=20=20=20=
storage_domain_static.storage_name,=0A=20=20=20=20=20=20=20=20=
quota_limitation.storage_size_gb,=0A=20=20=20=20=20=20=20=20=
cast(COALESCE(sum(size=20*=20cast(active=20AS=20INT)=20+=20=
disk_image_dynamic.actual_size=20*=20cast((NOT=20active)=20AS=20INT))=20=
/=201073741824,=200)=20AS=20FLOAT)=20AS=20storage_usage=0A=20=20=20=20=20=
=20=20=20--=201073741824=20is=201024^3=20(for=20GB)=0A=20=20=20=20FROM=20=
quota_limitation=0A=20=20=20=20LEFT=20JOIN=20image_storage_domain_map=0A=20=
=20=20=20=20=20=20=20ON=20quota_limitation.quota_id=20=3D=20=
image_storage_domain_map.quota_id=0A=20=20=20=20LEFT=20JOIN=20images=0A=20=
=20=20=20=20=20=20=20ON=20images.image_guid=20=3D=20=
image_storage_domain_map.image_id=0A=20=20=20=20LEFT=20JOIN=20=
disk_image_dynamic=0A=20=20=20=20=20=20=20=20ON=20images.image_guid=20=3D=20=
disk_image_dynamic.image_id=0A=20=20=20=20LEFT=20JOIN=20=
storage_domain_static=0A=20=20=20=20=20=20=20=20ON=20=
image_storage_domain_map.storage_domain_id=20=3D=20=
storage_domain_static.id=0A=20=20=20=20WHERE=20=
quota_limitation.storage_size_gb=20IS=20NOT=20NULL=0A=20=20=20=20GROUP=20=
BY=0A=20=20=20=20=20=20=20=20quota_limitation.quota_id,=0A=20=20=20=20=20=
=20=20=20storage_id,=0A=20=20=20=20=20=20=20=20quota_limitation.id,=0A=20=
=20=20=20=20=20=20=20storage_domain_static.storage_name,=0A=20=20=20=20=20=
=20=20=20quota_limitation.storage_size_gb;=0AEND;$FUNCTION$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CalculateStorageUsage(v_quota_id=20UUID,=20v_storage_id=20UUID)=0A=
RETURNS=20double=20precision=20STABLE=0AAS=20$FUNCTION$=0ADECLARE=0A=20=20=
v_retVal=20double=20precision;=0ABEGIN=0A=20=20SELECT=20=
COALESCE(sum(CASE=20active=20WHEN=20TRUE=20THEN=20size=20ELSE=20=
actual_size=20END)=20/=20(1024=20*=201024=20*=201024),0)=0A=20=20INTO=20=
v_retVal=0A=20=20FROM=20images_storage_domain_view=0A=20=20WHERE=20=
quota_id=20=3D=20v_quota_id=0A=20=20=20=20AND=20(v_storage_id=20IS=20=
NULL=0A=20=20=20=20=20=20=20=20OR=20v_storage_id=20=3D=20storage_id);=0A=20=
=20RETURN=20v_retVal;=0AEND;=20$FUNCTION$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20create_uuid_sequence()=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20NOT=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20information_schema.sequences=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20WHERE=20sequence_schema=20=3D=20'public'=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
sequence_name=20=3D=20'uuid_sequence'=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20CREATE=20sequence=20uuid_sequence=20=
increment=20BY=201=20START=20WITH=201;=0A=20=20=20=20END=20IF=20;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ASELECT=20=
create_uuid_sequence();=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0ADROP=20FUNCTION=20=
create_uuid_sequence();=0A**************************=0A=0ADROP=20=
FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
FUNCTION=20uuid_generate_v1()=0ARETURNS=20uuid=20STABLE=0AAS=20=
$PROCEDURE$=0ADECLARE=0A=20=20=20=20v_val=20BIGINT;=0A=20=20=20=20=
v_4_part=20CHAR(4);=0A=20=20=20=20v_8_part=20CHAR(8);=0A=20=20=20=20=
v_12_part=20CHAR(12);=0A=20=20=20=20v_4_part_max=20INT;=0ABEGIN=0A=20=20=20=
=20--=20The=20only=20part=20we=20should=20use=20modulo=20is=20the=204=20=
digit=20part,=20all=20the=0A=20=20=20=20--=20rest=20are=20really=20big=20=
numbers=20(i.e=2016^8=20-=201=20and=2016^12=20-=201)=0A=20=20=20=20--=20=
The=20use=20of=20round(random()=20*=201000=20is=20for=20getting=20a=20=
different=20id=0A=20=20=20=20--=20for=20DC/Cluster=20in=20different=20=
installations=0A=20=20=20=20v_4_part_max=20=3D=2065535;--=20this=20is=20=
16^4=20-1=0A=0A=20=20=20=20v_val=20:=3D=20nextval('uuid_sequence');=0A=0A=
=20=20=20=20v_4_part=20:=3D=20lpad(to_hex(v_val=20%=20v_4_part_max),=20=
4,=20'0');=0A=0A=20=20=20=20v_8_part=20:=3D=20lpad(to_hex(v_val),=208,=20=
'0');=0A=0A=20=20=20=20v_12_part=20:=3D=20lpad(to_hex((v_val=20+=20=
(round(random()=20*=201000))::BIGINT)),=2012,=20'0');=0A=0A=20=20=20=20=
RETURN=20v_8_part=20||=20v_4_part=20||=20v_4_part=20||=20v_4_part=20||=20=
v_12_part;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_get_comparable_ip_list(TEXT)=0ARETURNS=20inet=20[]=20IMMUTABLE=20=
STRICT=0AAS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20CASE=0A=20=20=20=20=20=20=
=20=20WHEN=20($1=20IS=20NULL)=0A=20=20=20=20=20=20=20=20OR=20($1=20~=20=
E'^\\s*$')=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20RETURN=20NULL;=0A=
=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20=
RETURN=20regexp_split_to_array(trim(both=20FROM=20$1),=20E'\\s+')::inet=20=
[];=0A=20=20=20=20END=20CASE=20;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_get_dedicated_hosts_ids_by_vm_id(v_vm_id=20UUID)=0ARETURNS=20TEXT=20=
STABLE=0AAS=20$FUNCTION$=0ABEGIN=0A=20=20=20=20RETURN=20=
array_to_string(array_agg(vds_id),=20',')=0A=20=20=20=20FROM=20=
vm_host_pinning_map=0A=20=20=20=20WHERE=20vm_id=20=3D=20v_vm_id;=0A=
END;$FUNCTION$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_get_num_of_vcpus(vm_static)=0ARETURNS=20INT=20=
STABLE=0AAS=20$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20RETURN=20$1.=20=
num_of_sockets=20*=20$1.=20cpu_per_socket=20*=20$1.=20threads_per_cpu;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_add_column=20(=0A=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20v_column=20VARCHAR(128),=0A=20=20=20=20=
v_column_def=20TEXT=0A=20=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
DECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20=
v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20column_name=20ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20=
v_table=20||=20'=20ADD=20COLUMN=20'=20||=20v_column=20||=20'=20'=20||=20=
v_column_def;=0A=0A=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=20=20=
END;=0AEND=0A=0AIF=20;END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_drop_column=20(=0A=20=
=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=20v_column=20VARCHAR(128)=0A=
=20=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20v_sql=20=
TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
1=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20v_table=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20column_name=20=
ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20=
DROP=20COLUMN=20'=20||=20v_column;=0A=0A=20=20=20=20=20=20=20=20EXECUTE=20=
v_sql;=0A=20=20=20=20END;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=
RAISE=20EXCEPTION=20'Table=20%=20or=20Column=20%=20does=20not=20exist.',=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_table,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_column;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_change_column_type=20(=0A=20=20=20=20v_table=20VARCHAR(128),=0A=20=20=
=20=20v_column=20VARCHAR(128),=0A=20=20=20=20v_type=20VARCHAR(128),=0A=20=
=20=20=20v_new_type=20VARCHAR(128)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20=
v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20column_name=20ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20udt_name=20ilike=20v_type=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
data_type=20ilike=20v_type=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20=
v_table=20||=20'=20ALTER=20COLUMN=20'=20||=20v_column=20||=20'=20TYPE=20=
'=20||=20v_new_type;=0A=0A=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=
=20=20END;=0A=0A=20=20=20=20---=20ignore=20operation=20if=20requested=20=
type=20is=20already=20there=0A=20=20=20=20ELSIF(NOT=20EXISTS=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20FROM=20information_schema.columns=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20table_schema=20=3D=20=
'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20table_name=20ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20column_name=20ilike=20v_column=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20udt_name=20=
ilike=20v_new_type=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20OR=20data_type=20ilike=20v_new_type=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20))=20THEN=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20=
Column=20%=20does=20not=20exist.',=20v_table,=20v_column;=0A=20=20=20=20=
END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_rename_column=20(=0A=
=20=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=20v_column=20=
VARCHAR(128),=0A=20=20=20=20v_new_name=20VARCHAR(128)=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=
=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20information_schema.columns=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20table_schema=20=3D=20=
'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20table_name=20ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20column_name=20ilike=20v_column=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20RENAME=20COLUMN=20'=20||=20=
v_column=20||=20'=20TO=20'=20||=20v_new_name;=0A=0A=20=20=20=20=20=20=20=20=
EXECUTE=20v_sql;=0A=20=20=20=20END;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=20=
=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20Column=20%=20does=20not=20=
exist.',=0A=20=20=20=20=20=20=20=20=20=20=20=20v_table,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20v_column;=0AEND=0A=0AIF=20;END;$PROCEDURE$=0A=20=20=20=
=20LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20=
FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
FUNCTION=20fn_db_rename_table=20(=0A=20=20=20=20v_table=20VARCHAR(128),=0A=
=20=20=20=20v_new_name=20VARCHAR(128)=0A=20=20=20=20)=0ARETURNS=20void=20=
AS=20$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20=
ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20=
RENAME=20TO=20'=20||=20v_new_name;=0A=0A=20=20=20=20=20=20=20=20EXECUTE=20=
v_sql;=0A=20=20=20=20END;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=
RAISE=20EXCEPTION=20'Table=20%=20does=20not=20exist.',=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_table;=0AEND=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_add_config_value=20(=0A=20=20=20=20v_option_name=20VARCHAR(100),=0A=
=20=20=20=20v_option_value=20VARCHAR(4000),=0A=20=20=20=20v_version=20=
VARCHAR(40)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20version=20=3D=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=
=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=20=20=20=20INSERT=20INTO=20=
vdc_options=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
option_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20version=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20v_option_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=
=20=20=20=20=20END;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_delete_config_value_all_versions=20(v_option_name=20VARCHAR(100))=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=
=20=20=20=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=20=20=20=20DELETE=0A=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20option_name=20ilike=20v_option_name;=0A=20=20=20=
=20=20=20=20=20END;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_delete_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_version=20TEXT=0A=20=20=20=20)=0ARETURNS=20=
void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20version=20IN=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitter(v_version)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20version=20IN=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20fnSplitter(v_version)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=
=20=20END;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_delete_config_for_version=20(v_version=20TEXT)=0ARETURNS=20void=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20WHERE=20version=20IN=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitter(v_version)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_update_config_value=20(=0A=20=20=20=20=
v_option_name=20VARCHAR(100),=0A=20=20=20=20v_option_value=20=
VARCHAR(4000),=0A=20=20=20=20v_version=20VARCHAR(40)=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=
=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=
=20=20=20=20=20UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SET=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20=
=20=20=20=20END;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_update_default_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_default_option_value=20VARCHAR(4000),=0A=20=
=20=20=20v_option_value=20VARCHAR(4000),=0A=20=20=20=20v_version=20=
VARCHAR(40),=0A=20=20=20=20v_ignore_default_value_case=20boolean=0A=20=20=
=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20=
(v_ignore_default_value_case)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20option_value=20ilike=20v_default_option_value=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=20=20=
=20=20UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20option_value=20=3D=20v_default_option_value=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20END=20IF;=0A=0A=20=20=20=20END;=0A=20=
=20=20=20END=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_db_rename_config_key=20(=0A=20=20=20=20=20=20=20=20v_old_option_name=20=
VARCHAR(100),=0A=20=20=20=20=20=20=20=20v_new_option_name=20=
VARCHAR(100),=0A=20=20=20=20=20=20=20=20v_version=20VARCHAR(40)=0A=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=
=20=20=20DECLARE=20v_current_option_value=20VARCHAR(4000);=0A=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20v_old_option_name=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20version=20=3D=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20v_current_option_value:=3D=20=
option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_old_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
version=20=3D=20v_version;=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_name=20=3D=20v_new_option_name,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20option_value=20=3D=20v_current_option_value=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_old_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20=20=20=20=20END=20=
IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_db_create_constraint=20(=0A=20=20=20=20=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_constraint=20VARCHAR(128),=0A=20=
=20=20=20=20=20=20=20v_constraint_sql=20TEXT=0A=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20IF=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_constraint=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20conname=20ilike=20v_constraint=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20EXECUTE=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ADD=20CONSTRAINT=20'=20||=20=
v_constraint=20||=20'=20'=20||=20v_constraint_sql;=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20fn_db_drop_constraint=20(=0A=20=20=20=20=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_constraint=20VARCHAR(128)=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=
=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20pg_constraint=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20conname=20ilike=20v_constraint=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=
=20=20=20=20EXECUTE=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20DROP=20=
CONSTRAINT=20'=20||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=20=20=
=20=20=20END=20IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
replace=20FUNCTION=20CheckDBConnection=20()=0A=20=20=20=20RETURNS=20=
SETOF=20INT=20IMMUTABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=
=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
1;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax=20()=0A=20=20=20=20RETURNS=20SETOF=20=
TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=0A=20=20=
=20=20=20=20=20=20FROM=20pg_proc=0A=20=20=20=20=20=20=20=20INNER=20JOIN=20=
pg_namespace=20ns=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
(pg_proc.pronamespace=20=3D=20ns.oid)=0A=20=20=20=20=20=20=20=20WHERE=20=
ns.nspname=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
proname;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
generate_drop_all_views_syntax=20()=0A=20=20=20=20RETURNS=20SETOF=20TEXT=20=
STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20'DROP=20VIEW=20if=20=
exists=20'=20||=20table_name=20||=20'=20CASCADE;'=0A=20=20=20=20=20=20=20=
=20FROM=20information_schema.VIEWS=0A=20=20=20=20=20=20=20=20WHERE=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
table_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20generate_drop_all_tables_syntax=20()=0A=20=20=20=20RETURNS=20=
SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
'DROP=20TABLE=20if=20exists=20'=20||=20table_name=20||=20'=20CASCADE;'=0A=
=20=20=20=20=20=20=20=20FROM=20information_schema.tables=0A=20=20=20=20=20=
=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20table_type=20=3D=20'BASE=20TABLE'=0A=20=20=20=20=20=20=20=
=20ORDER=20BY=20table_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
replace=20FUNCTION=20generate_drop_all_seq_syntax=20()=0A=20=20=20=20=
RETURNS=20SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20'DROP=20SEQUENCE=20if=20exists=20'=20||=20sequence_name=20||=20=
'=20CASCADE;'=0A=20=20=20=20=20=20=20=20FROM=20=
information_schema.sequences=0A=20=20=20=20=20=20=20=20WHERE=20=
sequence_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
sequence_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20generate_drop_all_user_types_syntax=20()=0A=20=20=20=20=
RETURNS=20SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20=20=20=20=20=20FROM=20pg_namespace=20n,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20pg_class=20c,=0A=20=20=20=20=20=20=20=20=20=20=20=20pg_type=20t=0A=20=
=20=20=20=20=20=20=20WHERE=20n.oid=20=3D=20c.relnamespace=0A=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20t.typrelid=20=3D=20c.oid=0A=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20c.relkind=20=3D=20'c'::"char"=0A=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20n.nspname=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
ORDER=20BY=20c.relname::information_schema.sql_identifier;=0A=20=20=20=20=
END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_get_column_size=20(=0A=20=20=20=20=20=20=20=20v_table=20VARCHAR(64),=0A=
=20=20=20=20=20=20=20=20v_column=20VARCHAR(64)=0A=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20RETURNS=20INT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
DECLARE=20retvalue=20INT;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
retvalue=20:=3D=20character_maximum_length=0A=20=20=20=20=20=20=20=20=
FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20WHERE=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
table_name=20ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
column_name=20ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
udt_name=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
'char',=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'varchar'=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=
=20RETURN=20retvalue;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
REPLACE=20FUNCTION=20attach_user_to_role=20(=0A=20=20=20=20=20=20=20=20=
v_user_name=20VARCHAR(255),=0A=20=20=20=20=20=20=20=20v_domain=20=
VARCHAR(255),=0A=20=20=20=20=20=20=20=20v_namespace=20VARCHAR(255),=0A=20=
=20=20=20=20=20=20=20v_domain_entry_id=20TEXT,=0A=20=20=20=20=20=20=20=20=
v_role_name=20VARCHAR(255)=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$BODY$=0A=0A=20=20=20=20DECLARE=20selected_user_id=20=
uuid;=0A=0A=20=20=20=20input_role_id=20uuid;=0A=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20SELECT=20roles.id=0A=20=20=20=20=20=20=20=20INTO=20=
input_role_id=0A=20=20=20=20=20=20=20=20FROM=20roles=0A=20=20=20=20=20=20=
=20=20WHERE=20roles.name=20=3D=20v_role_name;=0A=0A=20=20=20=20=20=20=20=20=
--=20The=20external=20identifier=20is=20the=20user=20identifier=20=
converted=20to=20an=20array=20of=0A=20=20=20=20=20=20=20=20--=20bytes:=0A=
=20=20=20=20=20=20=20=20INSERT=20INTO=20users=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20user_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
external_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20namespace,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
domain,=0A=20=20=20=20=20=20=20=20=20=20=20=20username,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20last_admin_check_status=0A=20=20=20=20=20=20=20=20=20=
=20=20=20)=0A=20=20=20=20=20=20=20=20SELECT=20uuid_generate_v1(),=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_domain_entry_id,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_namespace,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_user_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_domain,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20v_user_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
true=0A=20=20=20=20=20=20=20=20WHERE=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20domain=20=3D=20v_domain=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20external_id=20=3D=20=
v_domain_entry_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=0A=20=20=20=20=20=20=20=20SELECT=20user_id=0A=20=20=20=20=20=20=20=20=
FROM=20users=0A=20=20=20=20=20=20=20=20WHERE=20domain=20=3D=20v_domain=0A=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20external_id=20=3D=20=
v_domain_entry_id=0A=20=20=20=20=20=20=20=20INTO=20selected_user_id;=0A=0A=
=20=20=20=20=20=20=20=20INSERT=20INTO=20permissions=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20=20=20=20=20role_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20ad_element_id,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20object_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
object_type_id=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=
=20=20SELECT=20uuid_generate_v1(),=0A=20=20=20=20=20=20=20=20=20=20=20=20=
input_role_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20selected_user_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20getGlobalIds('system'),=0A=20=20=20=20=
=20=20=20=20=20=20=20=201=0A=20=20=20=20=20=20=20=20WHERE=20NOT=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20role_id,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ad_element_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20object_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
object_type_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
permissions=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20input_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20AND=20ad_element_id=20=3D=20selected_user_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20object_id=20=3D=20=
getGlobalIds('system')=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20object_type_id=20=3D=201=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20);=0A=20=20=20=20END;$BODY$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20=
FUNCTION=20fn_db_add_action_group_to_role=20(=0A=20=20=20=20=20=20=20=20=
v_role_id=20UUID,=0A=20=20=20=20=20=20=20=20v_action_group_id=20INT=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20RETURNS=20VOID=20AS=20$PROCEDURE$=0A=
=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20INSERT=20INTO=20=
roles_groups=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20role_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20action_group_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20SELECT=20v_role_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_action_group_id=0A=20=20=20=20=20=20=20=20WHERE=20=
NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
roles_groups=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20v_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20action_group_id=20=3D=20v_action_group_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=20=
RETURN;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20FUNCTION=20=
fn_db_split_config_value=20(=0A=20=20=20=20=20=20=20=20v_option_name=20=
VARCHAR,=0A=20=20=20=20=20=20=20=20v_old_option_value=20VARCHAR,=0A=20=20=
=20=20=20=20=20=20v_new_option_value=20VARCHAR,=0A=20=20=20=20=20=20=20=20=
v_update_from_version=20VARCHAR=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$BODY$=0A=0A=20=20=20=20DECLARE=20v_old_value=20=
VARCHAR(4000);=0A=0A=20=20=20=20v_cur=20CURSOR=0A=20=20=20=20FOR=0A=0A=20=
=20=20=20SELECT=20DISTINCT=20version=0A=20=20=20=20FROM=20vdc_options=0A=20=
=20=20=20WHERE=20version=20<>=20'general'=0A=20=20=20=20ORDER=20BY=20=
version;=0A=0A=20=20=20=20v_version=20VARCHAR(40);=0A=0A=20=20=20=20=
v_index=20INT;=0A=0A=20=20=20=20v_count=20INT;=0A=0A=20=20=20=20=
v_total_count=20INT;=0A=0A=20=20=20=20v_version_count=20INT;=0A=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20v_total_count=20:=3D=20count(version)=0A=
=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=
WHERE=20option_name=20=3D=20v_option_name;=0A=0A=20=20=20=20=20=20=20=20=
v_old_value=20:=3D=20option_value=0A=20=20=20=20=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20=20=20=20=20WHERE=20option_name=20=3D=20=
v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
'general';=0A=0A=20=20=20=20=20=20=20=20v_version_count=20:=3D=20=
count(DISTINCT=20version)=0A=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=
=20=20=20=20=20=20=20=20WHERE=20version=20<>=20'general';=0A=0A=20=20=20=20=
=20=20=20=20IF=20(v_total_count=20<=3D=20v_version_count)=20THEN=0A=20=20=
=20=20=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=20=20=20=20IF=20=
(v_old_value=20IS=20NULL)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20v_old_value=20:=3D=20v_old_option_value;=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=20=20=20=20=20=20=20=20v_count=20:=3D=20count(DISTINCT=20=
version)=0A=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=
=20=20WHERE=20version=20<>=20'general';=0A=0A=20=20=20=20=20=20=20=20=
v_index=20:=3D=201;=0A=0A=20=20=20=20=20=20=20=20OPEN=20v_cur;=0A=0A=20=20=
=20=20=20=20=20=20LOOP=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20FETCH=20=
v_cur=0A=20=20=20=20=20=20=20=20=20=20=20=20INTO=20v_version;=0A=0A=20=20=
=20=20=20=20=20=20=20=20=20=20EXIT=20when=20NOT=20found;=0A=0A=20=20=20=20=
=20=20=20=20=20=20=20=20--=20We=20shouldn't=20update=20if=20already=20=
exists=0A=20=20=20=20=20=20=20=20=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20option_name=20=3D=20v_option_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20version=20=3D=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20--=20Might=20not=20work=20well=20for=20versions=20such=20as=20=
3.10,=20but=20we=20currently=20don't=20have=20any=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20IF=20(v_version=20>=3D=20=
v_update_from_version)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20INSERT=20INTO=20vdc_options=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20option_name,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_new_option_value,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_version=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20INSERT=20INTO=20vdc_options=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20option_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20version=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_old_value,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20END=20IF;=0A=
=0A=20=20=20=20=20=20=20=20=20=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_index=20:=3D=20v_index=20+=201;=0A=20=20=20=20=20=20=20=20=
END=20LOOP;=0A=0A=20=20=20=20CLOSE=20v_cur;=0A=0A=20=20=20=20DELETE=0A=20=
=20=20=20FROM=20vdc_options=0A=20=20=20=20WHERE=20option_name=20=3D=20=
v_option_name=0A=20=20=20=20=20=20=20=20AND=20version=20=3D=20'general';=0A=
=20=20=20=20END;=0AEND=20IF;=0A=0AEND;$BODY$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_grant_action_group_to_all_roles_filter=20(=0A=20=20=20=20=
v_action_group_id=20INT,=0A=20=20=20=20uuid=20[]=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$BODY$=0A=0ADECLARE=20v_role_id_to_filter=20alias=0A=
FOR=20$2;=0A=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20roles_groups=20(=0A=20=
=20=20=20=20=20=20=20role_id,=0A=20=20=20=20=20=20=20=20action_group_id=0A=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20SELECT=20DISTINCT=20role_id,=0A=20=
=20=20=20=20=20=20=20v_action_group_id=0A=20=20=20=20FROM=20roles_groups=20=
rg=0A=20=20=20=20WHERE=20NOT=20ARRAY=20[role_id]=20<@=20=
v_role_id_to_filter=0A=20=20=20=20=20=20=20=20AND=20NOT=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20roles_groups=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20rg.role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20action_group_id=20=3D=20v_action_group_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20);=0AEND;$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_mask_object=20=
(v_object=20regclass)=0ARETURNS=20setof=20record=20AS=20$BODY$=0A=0A=
DECLARE=20v_sql=20TEXT;=0A=0Av_table=20record;=0A=0Av_table_name=20TEXT;=0A=
=0Atemprec=20record;=0A=0ABEGIN=0A=20=20=20=20--=20get=20full=20=
table/view=20name=20from=20v_object=20(i.e=20<namespace>.<name>)=0A=20=20=
=20=20SELECT=20c.relname,=0A=20=20=20=20=20=20=20=20n.nspname=0A=20=20=20=
=20INTO=20v_table=0A=20=20=20=20FROM=20pg_class=20c=0A=20=20=20=20INNER=20=
JOIN=20pg_namespace=20n=0A=20=20=20=20=20=20=20=20ON=20c.relnamespace=20=
=3D=20n.oid=0A=20=20=20=20WHERE=20c.oid=20=3D=20v_object;=0A=0A=20=20=20=20=
--=20try=20to=20get=20filtered=20query=20syntax=20from=20previous=20=
execution=0A=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
object_column_white_list_sql=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
object_name=20=3D=20v_table.relname=0A=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=0A=20=20=20=20=20=20=20=20SELECT=20sql=0A=20=20=20=20=20=20=20=20=
INTO=20v_sql=0A=20=20=20=20=20=20=20=20FROM=20=
object_column_white_list_sql=0A=20=20=20=20=20=20=20=20WHERE=20=
object_name=20=3D=20v_table.relname;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=
=20=20=20v_table_name=20:=3D=20quote_ident(v_table.nspname)=20||=20'.'=20=
||=20quote_ident(v_table.relname);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20FOR=20temprec=20IN=0A=20=20=20=20SELECT=20a.attname,=0A=20=20=20=
=20=20=20=20=20t.typname=0A=20=20=20=20FROM=20pg_attribute=20a=0A=20=20=20=
=20INNER=20JOIN=20pg_type=20t=0A=20=20=20=20=20=20=20=20ON=20a.atttypid=20=
=3D=20t.oid=0A=20=20=20=20WHERE=20a.attrelid=20=3D=20v_object=0A=20=20=20=
=20=20=20=20=20AND=20a.attnum=20>=200=0A=20=20=20=20=20=20=20=20AND=20=
NOT=20a.attisdropped=0A=20=20=20=20ORDER=20BY=20a.attnum=20LOOP=20v_sql=20=
:=3D=20coalesce(v_sql=20||=20',=20',=20'SELECT=20');=0A=0A=20=20=20=20=20=
=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
1=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20object_column_white_list=0A=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20object_name=20=3D=20=
v_table.relname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
column_name=20=3D=20temprec.attname=0A=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=20v_sql=20:=3D=20v_sql=20||=20quote_ident(temprec.attname);=0A=20=
=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20=
:=3D=20v_sql=20||=20'NULL::'=20||=20quote_ident(temprec.typname)=20||=20=
'=20as=20'=20||=20quote_ident(temprec.attname);=0A=20=20=20=20=20=20=20=20=
END=20IF;=0A=0A=20=20=20=20END=20LOOP;=0A=0A=20=20=20=20v_sql=20:=3D=20=
v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=0A=20=20=20=20v_sql=20=
:=3D=20'SELECT=20x::'=20||=20v_table_name=20||=20'=20as=20rec=20FROM=20=
('=20||=20v_sql=20||=20')=20as=20x';=0A=0A=20=20=20=20--=20save=20=
generated=20query=20for=20further=20use=0A=20=20=20=20INSERT=20INTO=20=
object_column_white_list_sql=20(=0A=20=20=20=20=20=20=20=20object_name,=0A=
=20=20=20=20=20=20=20=20sql=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_table.relname,=0A=20=20=20=20=20=20=
=20=20v_sql=0A=20=20=20=20=20=20=20=20);=0A=20=20=20=20END=20IF;=0A=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20EXECUTE=20v_sql;=0AEND;$BODY$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_add_column_to_object_white_list=20(=0A=20=20=20=20v_object_name=20=
VARCHAR(128),=0A=20=20=20=20v_column_name=20VARCHAR(128)=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20object_column_white_list=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20object_name=20=3D=20v_object_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20column_name=20=3D=20=
v_column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=
=20=20=20=20--=20verify=20that=20there=20is=20such=20object=20in=20db=0A=20=
=20=20=20=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20=3D=20=
v_object_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20column_name=20=3D=20v_column_name=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20INSERT=20=
INTO=20object_column_white_list=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20object_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20v_object_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20v_column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=20=20=20=20=20=20=20=20END=20IF;=0A=0A=20=20=20=20END;=0A=20=20=20=20=
END=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20FUNCTION=20=
fn_db_is_table_exists=20(v_table=20VARCHAR(64))=0A=20=20=20=20RETURNS=20=
boolean=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20DECLARE=20retvalue=20=
boolean;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20retvalue=20:=3D=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.tables=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ILIKE=20v_table=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=20=
RETURN=20retvalue;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20fn_db_create_index=20(=0A=20=20=20=20=20=20=20=20v_index_name=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_table_name=20VARCHAR(128),=0A=20=
=20=20=20=20=20=20=20v_column_names=20TEXT,=0A=20=20=20=20=20=20=20=20=
v_where_predicate=20TEXT=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=20=20=20DECLARE=20v_sql=20=
TEXT;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
'DROP=20INDEX=20'=20||=20'=20IF=20EXISTS=20'=20||=20v_index_name=20||=20=
';=20CREATE=20INDEX=20'=20||=20v_index_name=20||=20'=20ON=20'=20||=20=
v_table_name=20||=20'('=20||=20v_column_names=20||=20')';=0A=0A=20=20=20=20=
=20=20=20=20IF=20v_where_predicate=20=3D=20''=20THEN=20v_sql=20:=3D=20=
v_sql=20||=20';';ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
v_sql=20||=20'=20WHERE=20'=20||=20v_where_predicate=20||=20';';=0A=20=20=20=
=20END=20IF;=0A=0A=20=20=20=20EXECUTE=20v_sql;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_unlock_disk=20(v_id=20UUID)=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
DECLARE=20OK=20INT;=0A=0ALOCKED=20INT;=0A=0ABEGIN=0A=20=20=20=20OK:=3D=20=
1;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20UPDATE=20images=0A=20=
=20=20=20SET=20imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=
=3D=20LOCKED=0A=20=20=20=20=20=20=20=20AND=20image_group_id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_snapshot=20=
(v_id=20UUID)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20OK=20=
VARCHAR;=0A=0ALOCKED=20VARCHAR;=0A=0ABEGIN=0A=20=20=20=20OK:=3D=20'OK';=0A=
=0A=20=20=20=20LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20UPDATE=20=
snapshots=0A=20=20=20=20SET=20status=20=3D=20OK=0A=20=20=20=20WHERE=20=
status=20=3D=20LOCKED=0A=20=20=20=20=20=20=20=20AND=20snapshot_id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_entity=20(=0A=
=20=20=20=20v_object_type=20VARCHAR(10),=0A=20=20=20=20v_name=20=
VARCHAR(255),=0A=20=20=20=20v_recursive=20boolean=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20DOWN=20INT;=0A=0AOK=20INT;=0A=
=0ALOCKED=20INT;=0A=0ATEMPLATE_OK=20INT;=0A=0ATEMPLATE_LOCKED=20INT;=0A=0A=
IMAGE_LOCKED=20INT;=0A=0ASNAPSHOT_OK=20VARCHAR;=0A=0ASNAPSHOT_LOCKED=20=
VARCHAR;=0A=0Av_id=20UUID;=0A=0ABEGIN=0A=20=20=20=20DOWN:=3D=200;=0A=0A=20=
=20=20=20OK:=3D=201;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20=
TEMPLATE_OK:=3D=200;=0A=0A=20=20=20=20TEMPLATE_LOCKED:=3D=201;=0A=0A=20=20=
=20=20IMAGE_LOCKED:=3D=2015;=0A=0A=20=20=20=20SNAPSHOT_OK:=3D=20'OK';=0A=0A=
=20=20=20=20SNAPSHOT_LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20v_id=20:=3D=20=
vm_guid=0A=20=20=20=20FROM=20vm_static=0A=20=20=20=20WHERE=20vm_name=20=3D=
=20v_name=0A=20=20=20=20=20=20=20=20AND=20entity_type=20ilike=20=
v_object_type;=0A=0A=20=20=20=20--=20set=20VM=20status=20to=20DOWN=0A=20=20=
=20=20IF=20(v_object_type=20=3D=20'vm')=20THEN=0A=20=20=20=20=20=20=20=20=
UPDATE=20vm_dynamic=0A=20=20=20=20=20=20=20=20SET=20status=20=3D=20DOWN=0A=
=20=20=20=20=20=20=20=20WHERE=20status=20=3D=20IMAGE_LOCKED=0A=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20vm_guid=20=3D=20v_id;=0A=20=20=20=20=20=20=20=
=20=20=20=20=20--=20set=20Template=20status=20to=20OK=0A=20=20=20=20ELSE=20=
IF=20(v_object_type=20=3D=20'template')=20THEN=0A=20=20=20=20=20=20=20=20=
UPDATE=20vm_static=0A=20=20=20=20=20=20=20=20SET=20template_status=20=3D=20=
TEMPLATE_OK=0A=20=20=20=20=20=20=20=20WHERE=20template_status=20=3D=20=
TEMPLATE_LOCKED=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20vm_guid=20=3D=20=
v_id;=0A=20=20=20=20END=20IF;=0A=0AEND=20IF;=0A=20--unlock=20images=20=
and=20snapshots=20=20if=20recursive=20flag=20is=20set=0AIF=20=
(v_recursive)=20THEN=0A=20=20=20=20UPDATE=20images=0A=20=20=20=20SET=20=
imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=3D=20LOCKED=0A=
=20=20=20=20=20=20=20=20AND=20image_group_id=20IN=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=20device_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vm_device=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vm_id=20=3D=
=20v_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
is_plugged=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=
UPDATE=20snapshots=0A=20=20=20=20SET=20status=20=3D=20SNAPSHOT_OK=0A=20=20=
=20=20WHERE=20status=20ilike=20SNAPSHOT_LOCKED=0A=20=20=20=20=20=20=20=20=
AND=20vm_id=20=3D=20v_id;=0AEND=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_all=20=
()=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20DOWN=20INT;=0A=0AOK=20=
INT;=0A=0ALOCKED=20INT;=0A=0ATEMPLATE_OK=20INT;=0A=0ATEMPLATE_LOCKED=20=
INT;=0A=0AIMAGE_LOCKED=20INT;=0A=0ASNAPSHOT_OK=20VARCHAR;=0A=0A=
SNAPSHOT_LOCKED=20VARCHAR;=0A=0ABEGIN=0A=20=20=20=20DOWN:=3D=200;=0A=0A=20=
=20=20=20OK:=3D=201;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20=
TEMPLATE_OK:=3D=200;=0A=0A=20=20=20=20TEMPLATE_LOCKED:=3D=201;=0A=0A=20=20=
=20=20IMAGE_LOCKED:=3D=2015;=0A=0A=20=20=20=20SNAPSHOT_OK:=3D=20'OK';=0A=0A=
=20=20=20=20SNAPSHOT_LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20UPDATE=20=
vm_static=0A=20=20=20=20SET=20template_status=20=3D=20TEMPLATE_OK=0A=20=20=
=20=20WHERE=20template_status=20=3D=20TEMPLATE_LOCKED;=0A=0A=20=20=20=20=
UPDATE=20vm_dynamic=0A=20=20=20=20SET=20status=20=3D=20DOWN=0A=20=20=20=20=
WHERE=20status=20=3D=20IMAGE_LOCKED;=0A=0A=20=20=20=20UPDATE=20images=0A=20=
=20=20=20SET=20imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=
=3D=20LOCKED;=0A=0A=20=20=20=20UPDATE=20snapshots=0A=20=20=20=20SET=20=
status=20=3D=20SNAPSHOT_OK=0A=20=20=20=20WHERE=20status=20ilike=20=
SNAPSHOT_LOCKED;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A/*=20Displays=20DC=20id=20,=20DC=20name,=20SPM=20Host=20id=20=
,=20SPM=20Host=20name=20and=20number=20of=20async=20tasks=20awaiting.=0A=0A=
1)=20create=20a=20record=20type=20with=20DC=20name,=20DC=20id,=20SPM=20=
host=20id,=20SPM=20host=20name,=20count=0A=0A2)=20get=20all=20distinct=20=
DC=20ids=20from=20async_tasks=20table=0A=0A3)=20Run=20a=20cursor=20for=20=
each=20result=20in=202)=0A=0A=20=20=20a)=20get=20DC=20name=0A=20=20=20b)=20=
get=20SPM=20Host=20id=20&=20name=20if=20available=0A=20=20=20c)=20get=20=
count=20of=20tasks=0A=0A=20=20=20return=20current=20record=0A=0A4)=20=
return=20set=20of=20generated=20records=0A*/=0ADROP=20TYPE=20IF=20EXISTS=20=
async_tasks_info_rs=20CASCADE;=0A**************************=0A=0ADROP=20=
TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
async_tasks_info_rs=20AS=20(=0A=20=20=20=20=20=20=20=20dc_id=20uuid,=0A=20=
=20=20=20=20=20=20=20dc_name=20VARCHAR,=0A=20=20=20=20=20=20=20=20=
spm_host_id=20uuid,=0A=20=20=20=20=20=20=20=20spm_host_name=20VARCHAR,=0A=
=20=20=20=20=20=20=20=20task_count=20INT=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_get_async_tasks=20=
()=0ARETURNS=20SETOF=20async_tasks_info_rs=20STABLE=20AS=20$PROCEDURE$=0A=
DECLARE=20v_record=20async_tasks_info_rs;=0A=0A--=20selects=20=
storage_pool_id=20uuid=20found=20in=20async_tasks=0Av_tasks_cursor=20=
CURSOR=0AFOR=0A=0ASELECT=20DISTINCT=20storage_pool_id=0AFROM=20=
async_tasks;=0A=0ABEGIN=0A=20=20=20=20OPEN=20v_tasks_cursor;=0A=0A=20=20=20=
=20FETCH=20v_tasks_cursor=0A=20=20=20=20INTO=20v_record.dc_id;=0A=0A=20=20=
=20=20WHILE=20FOUND=0A=20=20=20=20LOOP=0A=20=20=20=20=20=20=20=20--=20=
get=20dc_name=20and=20SPM=20Host=20id=0A=20=20=20=20=20=20=20=20=
v_record.dc_name=20:=3D=20name=20FROM=20storage_pool=20WHERE=20id=20=3D=20=
v_record.dc_id;=0A=20=20=20=20=20=20=20=20v_record.spm_host_id=20:=3D=20=
spm_vds_id=0A=20=20=20=20=20=20=20=20FROM=20storage_pool=0A=20=20=20=20=20=
=20=20=20WHERE=20id=20=3D=20v_record.dc_id;=0A=0A=20=20=20=20=20=20=20=20=
--=20get=20Host=20name=20if=20we=20have=20non=20NULL=20SPM=20Host=0A=20=20=
=20=20=20=20=20=20IF=20(v_record.spm_host_id=20IS=20NOT=20NULL)=20THEN=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_record.spm_host_name=20:=3D=20=
vds_name=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vds_static=0A=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20=
v_record.spm_host_id;=0A=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_record.spm_host_name:=3D=20'';=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=20=20=20=20=20=20=20=20--=20get=20tasks=20count=20for=20=
this=20DC=0A=20=20=20=20=20=20=20=20v_record.task_count=20:=3D=20=
count(*)=0A=20=20=20=20=20=20=20=20FROM=20async_tasks=0A=20=20=20=20=20=20=
=20=20WHERE=20position(cast(v_record.dc_id=20AS=20VARCHAR)=20IN=20=
action_parameters)=20>=200;=0A=0A=20=20=20=20=20=20=20=20--=20return=20=
the=20record=0A=20=20=20=20=20=20=20=20RETURN=20NEXT=20v_record;=0A=0A=20=
=20=20=20=20=20=20=20FETCH=20v_tasks_cursor=0A=20=20=20=20INTO=20=
v_record.dc_id;=0A=0A=20=20=20=20END=20LOOP;=0A=0ACLOSE=20=
v_tasks_cursor;=0A=0A--=20return=20full=20set=20of=20generated=20records=0A=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_remove_csv_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_value=20VARCHAR(4000),=0A=20=20=20=20=
v_version=20VARCHAR(40)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v=20VARCHAR=20[];=0A=0Ae=20VARCHAR;=0A=0A=
v_result=20VARCHAR;=0A=0Av_sep=20VARCHAR(1);=0A=0ABEGIN=0A=20=20=20=20=
v_result=20:=3D=20'';=0A=0A=20=20=20=20v_sep=20:=3D=20'';=0A=0A=20=20=20=20=
v=20:=3D=20string_to_array(option_value,=20',')=0A=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20WHERE=20option_name=20=3D=20v_option_name=0A=20=
=20=20=20=20=20=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20FOR=0A=
=0A=20=20=20=20e=20IN=0A=0A=20=20=20=20SELECT=20unnest(v)=20LOOP=0A=0A=20=
=20=20=20IF=20(e=20!=3D=20v_value)=20THEN=20v_result=20:=3D=20v_result=20=
||=20v_sep=20||=20e;=0A=20=20=20=20=20=20=20=20v_sep=20:=3D=20',';=0A=20=20=
=20=20END=20IF;=0A=0AEND=0ALOOP;=0A=0A=20=20=20=20UPDATE=20vdc_options=0A=
=20=20=20=20SET=20option_value=20=3D=20v_result=0A=20=20=20=20WHERE=20=
option_name=20=3D=20v_option_name=0A=20=20=20=20=20=20=20=20AND=20=
version=20=3D=20v_version;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_remove_uuid_from_csv=20(=0A=20=20=20=20v_csv_text=20TEXT,=0A=20=20=20=
=20v_uuid=20uuid=0A=20=20=20=20)=0ARETURNS=20TEXT=20STABLE=20AS=20=
$PROCEDURE$=0ADECLARE=20v=20uuid=20[];=0A=0Ae=20uuid;=0A=0Av_result=20=
TEXT;=0A=0Av_sep=20VARCHAR(1);=0A=0ABEGIN=0A=20=20=20=20v_result=20:=3D=20=
'';=0A=0A=20=20=20=20v_sep=20:=3D=20'';=0A=0A=20=20=20=20v=20:=3D=20=
string_to_array(v_csv_text,=20',');=0A=20=20=20=20FOR=0A=0A=20=20=20=20e=20=
IN=0A=0A=20=20=20=20SELECT=20unnest(v)=20LOOP=0A=0A=20=20=20=20IF=20(e=20=
!=3D=20v_uuid)=20THEN=20v_result=20:=3D=20v_result=20||=20v_sep=20||=20=
e;=0A=20=20=20=20=20=20=20=20v_sep=20:=3D=20',';=0A=20=20=20=20END=20IF;=0A=
=0A=20=20=20=20END=20LOOP;=0A=0A=20=20=20=20IF=20(v_result=20=3D=20'')=20=
THEN=20v_result=20:=3D=20NULL;=0A=20=20=20=20END=20IF;=0A=20=20=20=20=
RETURN=20v_result;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_add_config_value_for_versions_up_to=20(=0A=20=20=20=20=
v_option_name=20VARCHAR(100),=0A=20=20=20=20v_val=20VARCHAR(4000),=0A=20=20=
=20=20v_version=20VARCHAR(40)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20i=20INT;=0A=0Aarr=20VARCHAR=20[]=20:=3D=20array=20=
['3.6',=20'4.0'];=0A=0ABEGIN=0A=20=20=20=20FOR=20i=20IN=20=
array_lower(arr,=201)..array_upper(arr,=201)=20LOOP=20PERFORM=20=
fn_db_add_config_value(v_option_name,=20v_val,=20arr=20[i]);=0A=20=20=20=20=
=20=20=20=20EXIT=20WHEN=20arr=20[i]=20=3D=20v_version;=0A=20=20=20=20END=20=
LOOP;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ASELECT=20setval('vdc_options_seq',=20max(option_id))=20FROM=20=
vdc_options;=0A**************************=0A=0A=20=20=201006=0A=0A=
*********=20QUERY=20**********=0ASELECT=20setval('custom_actions_seq',=20=
max(action_id))=20FROM=20custom_actions;=0A**************************=0A=0A=
=20=20=20=20=20=20=20=0A=0A*********=20QUERY=20**********=0ASELECT=20=
setval('vdc_db_log_seq',=20max(error_id))=20FROM=20vdc_db_log;=0A=
**************************=0A=0A=20=20=20=20=20=20=20=0A=0A*********=20=
QUERY=20**********=0ASELECT=20setval('audit_log_seq',=20=
max(audit_log_id))=20FROM=20audit_log;=0A**************************=0A=0A=
=20=2012377=0A=0A*********=20QUERY=20**********=0ASELECT=20=
setval('schema_version_seq',=20max(id))=20FROM=20schema_version;=0A=
**************************=0A=0A=20=20=20=20437=0A=0A*********=20QUERY=20=
**********=0A=
/*************************************************************************=
***********=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20DATABASE=20=
APPLICATION=20CONFIGURATION=20FILE=0A=0AThis=20file=20is=20used=20to=20=
update=20the=20vdc_options=20configuration=20table.=0AThe=20following=20=
sections=20are=20available:=0A=20=20=20=20Add=20Section=0A=20=20=20=20=
Update=20section=20(w/o=20overriding=20current=20value)=0A=20=20=20=20=
Delete=20section=20-=20Deprecated,=20all=20config=20key=20removals=20=
should=20be=20done=20in=20an=20upgrade=20script!=0A=20=20=20=20Split=20=
config=20section=0A=20=20=20=20Simple=20upgrades=20not=20available=20=
using=20a=20fn_db*=20function=20call=0A=20=20=20=20Complex=20upgrades=20=
using=20temporary=20functions=0A=0AIn=20each=20section=20(except=20=
simple/function=20sections),=20entries=20are=20ordered=20by=20key,=0A=
please=20keep=20this=20when=20modifying=20this=20file.=0A=0APLEASE=20=
NOTE=20THAT=20THIS=20SCRIPT=20MUST=20REMAIN=20RE-ENTRANT!=0A=0A=
**************************************************************************=
**********/=0A=0A=0A=0Aselect=20=
fn_db_rename_config_key('AuditLogAgingThreashold',=20=
'AuditLogAgingThreshold',=20'general');=0A**************************=0A=0A=
=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_rename_config_key('ClientConsoleModeDefault',=20=
'ClientModeSpiceDefault',=20'general');=0A**************************=0A=0A=
=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_rename_config_key('PowerClientAutoApprovePatterns','AutoApprovePatte=
rns','general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_rename_config_key('PowerClientAutoRegistrationDefaultClusterID','Aut=
oRegistrationDefaultClusterID','general');=0A**************************=0A=
=0A=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_rename_config_key('PowerClientAutoInstallCertificateOnApprove','Auto=
InstallCertificateOnApprove','general');=0A**************************=0A=0A=
=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_rename_config_key('UseSecureConnectionWithServers',=20=
'EncryptHostCommunication',=20'general');=0A**************************=0A=
=0A=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_rename_config_key('SpiceReleaseCursorKeys',=20=
'ConsoleReleaseCursorKeys',=20'general');=0A**************************=0A=
=0A=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_rename_config_key('SpiceToggleFullScreenKeys',=20=
'ConsoleToggleFullScreenKeys',=20'general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_rename_config_key('SSHInactivityTimoutSeconds',=20=
'SSHInactivityTimeoutSeconds',=20'general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_rename_config_key('SSHInactivityHardTimoutSeconds',=20=
'SSHInactivityHardTimeoutSeconds',=20'general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_rename_config_key('StorageDomainFalureTimeoutInMinutes',=20=
'StorageDomainFailureTimeoutInMinutes',=20'general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_rename_config_key('VdsLoadBalancingeIntervalInMinutes',=20=
'VdsLoadBalancingIntervalInMinutes',=20'general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_rename_config_key('VdsRecoveryTimeoutInMintues',=20=
'VdsRecoveryTimeoutInMinutes',=20'general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_rename_config_key('UknownTaskPrePollingLapse',=20=
'UnknownTaskPrePollingLapse',=20'general');=0A**************************=0A=
=0A=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_rename_config_key('DefaultMtu',=20'DefaultMTU',=20'general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_rename_config_key('ManagementNetwork',=20=
'DefaultManagementNetwork',=20'general');=0A**************************=0A=
=0A=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_rename_config_key('FreeSpaceCriticalLowInGB','CriticalSpaceActionBlo=
cker',=20'general');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_rename_config_key('FreeSpaceLow',=20'WarningLowSpaceIndicator',=20=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('BootstrapMinimalVdsmVersion','4.9','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('CpuPinMigrationEnabled','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('AdminDomain','internal','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('AffinityRulesEnforcementManagerEnabled',=20=
'true',=20'general');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('AffinityRulesEnforcementManagerRegularInterval',=20=
'1',=20'general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('AgentAppName','ovirt-guest-agent-common,ovirt-gues=
t-agent','general');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('AllowClusterWithVirtGlusterEnabled','true','genera=
l');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('AllowDuplicateMacAddresses','false','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('ApplicationMode','255','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('AsyncCommandPollingLoopInSeconds','1','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('AsyncCommandPollingRateInSeconds','10','general');=
=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('AsyncTaskPollingRate','10','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('AsyncTaskStatusCacheRefreshRateInSeconds','30','ge=
neral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('AsyncTaskStatusCachingTimeInMinutes','1','general'=
);=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('AsyncTaskZombieTaskLifeInMinutes','300','general')=
;=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('AuditLogAgingThreshold','30','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('AuditLogCleanupTime','03:35:35','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('CoCoLifeInMinutes','3000','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('CoCoWaitForEventInMinutes','300','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('CommandCoordinatorThreadPoolSize','10','general');=
=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('CommandEntityAgingThreshold','30','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('CommandEntityCleanupTime','03:35:35','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('OnlyRequiredNetworksMandatoryForVdsSelection','fal=
se','general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('AutoApprovePatterns','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('AutoInstallCertificateOnApprove','true','general')=
;=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20fn_db_add_config_value('AutoRecoverySchedule','0=20=
0/5=20*=20*=20*=20?','general');=0A**************************=0A=0A=20=0A=
=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('AutoRegistrationDefaultClusterID','99408929-82CF-4=
DC7-A532-9D998063FA95','general');=0A**************************=0A=0A=20=0A=
=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('AutoRepoDomainRefreshTime','60','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('BlockMigrationOnSwapUsagePercentage','0','general'=
);=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('CipherSuite','DEFAULT','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('ConnectToServerTimeoutInSeconds','20','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('ClusterEmulatedMachines','pc-i4=
40fx-rhel7.2.0,pc-i440fx-2.1,pseries-rhel7.2.0','4.0');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('CpuOverCommitDurationMinutes','2','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('DataDir','/usr/share/engine','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('DBEngine','Postgres','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('DebugTimerLogging','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('DefaultMaxThreadPoolSize','500','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('DefaultMinThreadPoolSize','50','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('DefaultMaxThreadWaitQueueSize','100','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('DefaultWindowsTimeZone','GMT=20Standard=20=
Time','general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('DefaultGeneralTimeZone','Etc/GMT','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('DefaultWorkgroup','WORKGROUP','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('DisableFenceAtStartupInSec','300','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('PopulateDirectLUNDiskDescriptionWithLUNId','4','ge=
neral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('EnableHostTimeDrift','false','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('RemoteViewerSupportedVersions','rhev-win64:2.0-128=
;rhev-win32:2.0-128;rhel7:2.0-6;rhel6:2.0-14','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('RemoteViewerNewerVersionUrl','${console_client_res=
ources_url}','general');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('EnableSpiceRootCertificateValidation','true','gene=
ral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('EnableSwapCheck','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('EnableUSBAsDefault','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('EnableVdsLoadBalancing','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('BackupCheckPeriodInHours','6','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('BackupAlertPeriodInDays','1','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('EngineMode','Active','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('FailedJobCleanupTimeInMinutes','60','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('FenceAgentDefaultParams','drac7:privlvl=3DOPERATOR=
,lanplus,delay=3D10;ilo3:lanplus,power_wait=3D4;ilo4:lanplus,power_wait=3D=
4','general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('CustomFenceAgentDefaultParams','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('FenceAgentDefaultParamsForPPC','ilo3:lanplus=3D1,c=
ipher=3D1,privlvl=3Dadministrator,power_wait=3D4;ilo4:ilanplus=3D1,cipher=3D=
1,privlvl=3Dadministrator,power_wait=3D4;ipmilan:lanplus=3D1,cipher=3D1,pr=
ivlvl=3Dadministrator,power_wait=3D4','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('CustomFenceAgentDefaultParamsForPPC','','general')=
;=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('FenceAgentMapping','drac7=3Dipmilan,ilo2=3Dilo,ilo=
3=3Dipmilan,ilo4=3Dipmilan','general');=0A**************************=0A=0A=
=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('CustomFenceAgentMapping','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('CustomFencePowerWaitParam','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('FenceProxyDefaultPreferences','cluster,dc','genera=
l');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('FenceQuietTimeBetweenOperationsInSec','180','gener=
al');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('FenceStartStatusDelayBetweenRetriesInSec','60','ge=
neral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('FenceStartStatusRetries','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('FenceStopStatusDelayBetweenRetriesInSec','60','gen=
eral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('FenceStopStatusRetries','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('FencePowerWaitParam','apc=3Dpower_wait,apc_snmp=3D=
power_wait,bladecenter=3Dpower_wait,cisco_ucs=3Dpower_wait,drac5=3Dpower_w=
ait,drac7=3Dpower_wait,eps=3Ddelay,hpblade=3Dpower_wait,ilo=3Dpower_wait,i=
lo2=3Dpower_wait,ilo3=3Dpower_wait,ilo4=3Dpower_wait,ipmilan=3Dpower_wait,=
rsa=3Dpower_wait,rsb=3Dpower_wait,wti=3Dpower_wait','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('FindFenceProxyDelayBetweenRetriesInSec','30','gene=
ral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('FindFenceProxyRetries','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('CriticalSpaceActionBlocker','5','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('WarningLowSpaceIndicator','10','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('GlusterRefreshRateHooks',=20'7200',=20=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20fn_db_add_config_value('GlusterRefreshRateLight',=20=
'5',=20'general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('GlusterRefreshRateHeavy',=20'300',=20'general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('GlusterRefreshRateStorageDevices',=20=
'7200',=20'general');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('GlusterVolumeOptionGroupVirtValue','virt','general=
');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('GlusterVolumeOptionOwnerUserVirtValue','36','gener=
al');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('GlusterVolumeOptionOwnerGroupVirtValue','36','gene=
ral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20fn_db_add_config_value('GlusterRefreshRateTasks',=20=
'60',=20'general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('GlusterPeerStatusRetries',=20'2',=20'general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('GlusterTaskMinWaitForCleanupInMins',=20=
'10',=20'general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('GlusterRefreshRateHealInfo',=20'600',=20=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('GlusterUnSyncedEntriesHistoryLimit',=20'40',=20=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value_for_versions_up_to('GlusterSelfHealMonitoringSuppor=
ted',=20'false',=20'3.6');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('GlusterRefreshRateGeoRepDiscoveryInSecs',=20=
'3600',=20'general');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('GlusterRefreshRateGeoRepStatusInSecs',=20'300',=20=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('GlusterRefreshRateSnapshotDiscovery',=20'300',=20=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20fn_db_add_config_value('GlusterMetaVolumeName',=20=
'gluster_shared_storage',=20'general');=0A**************************=0A=0A=
=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('GlusterStorageDeviceListMountPointsToIgnore','/,/h=
ome,/boot,/run/gluster/snaps/.*','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('GlusterStorageDeviceListFileSystemTypesToIgnore','=
swap','general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('GlusterDefaultBrickMountPoint','/gluster-bricks','=
general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20fn_db_add_config_value('KeystoneAuthUrl',=20'',=20=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('GuestToolsSetupIsoPrefix','ovirt-guest-tools-','ge=
neral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('HighUtilizationForEvenlyDistribute','75','general'=
);=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('HighUtilizationForPowerSave','75','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('HostPreparingForMaintenanceIdleTime',=20=
'300',=20'general');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('HostTimeDriftInSec','300','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('HotPlugCpuSupported',=20=
'{"x86_64":"false","ppc64":"false"}',=20'3.6');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('HotPlugCpuSupported',=20=
'{"x86_64":"true","ppc64":"false"}',=20'4.0');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('HotUnplugCpuSupported',=20=
'{"x86_64":"false","ppc64":"false"}',=20'4.0');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('HotPlugMemorySupported',=20=
'{"x86_64":"true","ppc64":"false"}',=20'3.6');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('HotUnplugMemorySupported',=20=
'{"x86_64":"false","ppc64":"false"}',=20'4.0');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('MaxMemorySlots','16','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('HotPlugMemoryMultiplicationSizeMb','256','general'=
);=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('IsMigrationSupported','{"undefined":=20"true",=20=
"x86_64":=20"true",=20"ppc64"=20:=20"true"=20}','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('IsMemorySnapshotSupported','{"undefined":=20=
"true",=20"x86_64":=20"true",=20"ppc64"=20:=20"true"=20}','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('IsSuspendSupported','{"undefined":=20=
"true",=20"x86_64":=20"true",=20"ppc64"=20:=20"true"=20}','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('DisconnectPoolOnReconstruct','0,2','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('OsRepositoryConfDir','/osinfo.conf.d','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('IterationsWithBalloonProblem','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('DefaultSysprepLocale','en_US','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('DataCenterWithoutSpm',=20=
'false',=20'3.6');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value_for_versions_up_to('ClusterRequiredRngSourcesDefaul=
t',=20'RANDOM',=20'4.0');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('HostDevicePassthroughCapabilities',=20=
'pci,scsi,usb_device',=20'general');=0A**************************=0A=0A=20=
=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('PackageNamesForCheckUpdate','vdsm,vdsm-cli','gener=
al');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('UserPackageNamesForCheckUpdate','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('HostPackagesUpdateTimeInHours','24','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('OvirtNodePackageNamesForCheckUpdate','ovirt-node-n=
g-image-update','general');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('CertificationValidityCheckTimeInHours','24','gener=
al');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('MaxIoThreadsPerVm','127','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('DisplayUncaughtUIExceptions',=20'true',=20=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('SpiceProxyDefault','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('RemapCtrlAltDelDefault','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('MigrationPoliciesSupported',=20=
'false',=20'3.6');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('InstallVds','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('IoOpTimeoutSec','10','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('IPTablesConfig',=0A'#=20oVirt=20default=20=
firewall=20configuration.=20Automatically=20generated=20by=20vdsm=20=
bootstrap=20script.=0A*filter=0A:INPUT=20ACCEPT=20[0:0]=0A:FORWARD=20=
ACCEPT=20[0:0]=0A:OUTPUT=20ACCEPT=20[0:0]=0A-A=20INPUT=20-m=20state=20=
--state=20ESTABLISHED,RELATED=20-j=20ACCEPT=0A-A=20INPUT=20-p=20icmp=20=
-j=20ACCEPT=0A-A=20INPUT=20-i=20lo=20-j=20ACCEPT=0A#=20vdsm=0A-A=20INPUT=20=
-p=20tcp=20--dport=20@VDSM_PORT@=20-j=20ACCEPT=0A#=20=
ovirt-imageio-daemon=0A-A=20INPUT=20-p=20tcp=20--dport=2054322=20-j=20=
ACCEPT=0A#=20libvirt=20tls=0A-A=20INPUT=20-p=20tcp=20--dport=2016514=20=
-j=20ACCEPT=0A#=20SSH=0A-A=20INPUT=20-p=20tcp=20--dport=20@SSH_PORT@=20=
-j=20ACCEPT=0A#=20guest=20consoles=0A-A=20INPUT=20-p=20tcp=20-m=20=
multiport=20--dports=205900:6923=20-j=20ACCEPT=0A#=20migration=0A-A=20=
INPUT=20-p=20tcp=20-m=20multiport=20--dports=2049152:49216=20-j=20ACCEPT=0A=
#=20snmp=0A-A=20INPUT=20-p=20udp=20--dport=20161=20-j=20ACCEPT=0A#=20=
Reject=20any=20other=20input=20traffic=0A-A=20INPUT=20-j=20REJECT=20=
--reject-with=20icmp-host-prohibited=0A-A=20FORWARD=20-m=20physdev=20!=20=
--physdev-is-bridged=20-j=20REJECT=20--reject-with=20=
icmp-host-prohibited=0ACOMMIT=0A','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('IPTablesConfigForGluster',=0A'=0A#=20=
glusterd=0A-A=20INPUT=20-p=20tcp=20-m=20tcp=20--dport=2024007=20-j=20=
ACCEPT=0A=0A#=20gluster=20swift=0A-A=20INPUT=20-p=20tcp=20-m=20tcp=20=
--dport=208080=20=20-j=20ACCEPT=0A=0A#=20portmapper=0A-A=20INPUT=20-p=20=
udp=20-m=20udp=20--dport=20111=20=20=20-j=20ACCEPT=0A-A=20INPUT=20-p=20=
tcp=20-m=20tcp=20--dport=2038465=20-j=20ACCEPT=0A-A=20INPUT=20-p=20tcp=20=
-m=20tcp=20--dport=2038466=20-j=20ACCEPT=0A=0A#=20nfs=0A-A=20INPUT=20-p=20=
tcp=20-m=20tcp=20--dport=2038467=20-j=20ACCEPT=0A-A=20INPUT=20-p=20tcp=20=
-m=20tcp=20--dport=202049=20=20-j=20ACCEPT=0A-A=20INPUT=20-p=20tcp=20-m=20=
tcp=20--dport=2038469=20-j=20ACCEPT=0A=0A#=20nrpe=0A-A=20INPUT=20-p=20=
tcp=20--dport=205666=20-j=20ACCEPT=0A=0A#=20status=0A-A=20INPUT=20-p=20=
tcp=20-m=20tcp=20--dport=2039543=20-j=20ACCEPT=0A-A=20INPUT=20-p=20tcp=20=
-m=20tcp=20--dport=2055863=20-j=20ACCEPT=0A=0A#=20nlockmgr=0A-A=20INPUT=20=
-p=20tcp=20-m=20tcp=20--dport=2038468=20-j=20ACCEPT=0A-A=20INPUT=20-p=20=
udp=20-m=20udp=20--dport=20963=20=20=20-j=20ACCEPT=0A-A=20INPUT=20-p=20=
tcp=20-m=20tcp=20--dport=20965=20=20=20-j=20ACCEPT=0A=0A#=20ctdbd=0A-A=20=
INPUT=20-p=20tcp=20-m=20tcp=20--dport=204379=20=20-j=20ACCEPT=0A=0A#=20=
smbd=0A-A=20INPUT=20-p=20tcp=20-m=20tcp=20--dport=20139=20=20=20-j=20=
ACCEPT=0A-A=20INPUT=20-p=20tcp=20-m=20tcp=20--dport=20445=20=20=20-j=20=
ACCEPT=0A=0A#=20Ports=20for=20gluster=20volume=20bricks=20(default=20100=20=
ports)=0A#=20Needed=20for=20gluster=20<=203.4.0=20that=20may=20be=20=
still=20handled=20by=20the=20engine=0A-A=20INPUT=20-p=20tcp=20-m=20tcp=20=
--dport=2024009:24108=20-j=20ACCEPT=0A=0A#=20Ports=20for=20gluster=20=
volume=20bricks=20in=20Hyper=20Converged=20setup(default=20100=20ports)=0A=
-A=20INPUT=20-p=20tcp=20-m=20tcp=20--dport=2049217:49316=20-j=20ACCEPT=0A=
','general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('IPTablesConfigForVirt',=0A'=0A#=20libvirt=20tls=0A=
-A=20INPUT=20-p=20tcp=20--dport=2016514=20-j=20ACCEPT=0A=0A#=20serial=20=
consoles=0A-A=20INPUT=20-p=20tcp=20-m=20multiport=20--dports=202223=20-j=20=
ACCEPT=0A=0A#=20guest=20consoles=0A-A=20INPUT=20-p=20tcp=20-m=20=
multiport=20--dports=205900:6923=20-j=20ACCEPT=0A=0A#=20migration=0A-A=20=
INPUT=20-p=20tcp=20-m=20multiport=20--dports=2049152:49216=20-j=20ACCEPT=0A=
',=20'general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value_for_versions_up_to('Ipv6Supported',=20'false',=20=
'4.0');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('IPTablesConfigSiteCustom','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('IsMultilevelAdministrationOn','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('JobCleanupRateInMinutes','10','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('JobPageSize','100','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('LeaseRetries','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('LeaseTimeSec','60','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('LicenseCertificateFingerPrint','5f=2038=20=
41=2089=20b1=2033=2049=200c=2024=2013=206b=20b3=20e5=20ba=209e=20c7=20fd=20=
83=2080=203b','general');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('LockPolicy','ON','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('LockRenewalIntervalSec','5','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('LogPhysicalMemoryThresholdInMB','1024','general');=
=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('LogSwapMemoryThresholdInMB','1024','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('LowUtilizationForEvenlyDistribute','0','general');=
=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('LowUtilizationForPowerSave','20','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('MacPoolRanges','00:1A:4A:16:01:51-00:1A:4A:16:01:e=
6','general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('ManagedDevicesWhiteList','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('DefaultManagementNetwork','ovirtmgmt','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('MaxAuditLogMessageLength','10000','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('MaxBlockDiskSize','8192','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('MaxMacsCountInPool','100000','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('MaxNumberOfHostsInStoragePool','250','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('MaxNumOfCpuPerSocket',=20=
'16',=20'4.0');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value_for_versions_up_to('MaxNumOfThreadsPerCpu',=20=
'8',=20'4.0');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value_for_versions_up_to('MaxNumOfVmCpus',=20'240',=20=
'4.0');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value_for_versions_up_to('MaxNumOfVmSockets',=20'16',=20=
'4.0');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('MaxRerunVmOnVdsCount','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('MaxStorageVdsDelayCheckSec','5','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('MaxStorageVdsTimeoutCheckSec','30','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('MaxVdsMemOverCommit','200','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('MaxVdsMemOverCommitForServers','150','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('MaxVdsNameLength','255','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('MaxVmNameLengthNonWindows','64','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('MaxVmNameLengthWindows','15','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('MaxVmsInPool','1000','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('MinimalETLVersion','3.0.0','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('NicDHCPDelayGraceInMS','60','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('NumberOfFailedRunsOnVds','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('NumberOfUSBSlots','4','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('NumberVmRefreshesBeforeSave','5','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('EnableMACAntiSpoofingFilterRules','true',=20=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('MaxSchedulerWeight','1000','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('SpeedOptimizationSchedulingThreshold','10','genera=
l');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('SchedulerAllowOverBooking','false','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('SchedulerOverBookingThreshold','10','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('UploadFileMaxTimeInMinutes','5','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('RetrieveDataMaxTimeInMinutes','5','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('StorageDomainOvfStoreCount','2','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('OrganizationName','oVirt','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('OriginType','OVIRT','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('OvfVirtualSystemType','ENGINE','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('OvirtInitialSupportedIsoVersion','2.5.5:5.8','gene=
ral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('OvirtIsoPrefix','^ovirt-node-iso-([0-9].*)\.iso$:^=
rhevh-([0-9].*)\.iso$','general');=0A**************************=0A=0A=20=0A=
=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('OvirtNodeOS','^ovirt.*$:^rhev.*$','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('oVirtISOsRepositoryPath','/usr/share/ovirt-node-is=
o:/usr/share/rhev-hypervisor','general');=0A**************************=0A=
=0A=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('oVirtUpgradeScriptName','/usr/share/vdsm-reg/vdsm-=
upgrade','general');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('oVirtUploadPath','/data/updates/ovirt-node-image.i=
so','general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('OvfUpdateIntervalInMinutes','60','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('OvfItemsCountPerUpdate','100','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('PayloadSize','8192','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('PMHealthCheckEnabled','false','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('PMHealthCheckIntervalInSec','3600','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('PostgresI18NPrefix','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('PostgresLikeSyntax','ILIKE','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('PostgresPagingSyntax',E'=20OFFSET=20=
(%1$s=20-1)=20LIMIT=20%2$s','general');=0A**************************=0A=0A=
=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('PostgresPagingType','Offset','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('PostgresSearchTemplate',E'SELECT=20*=20=
FROM=20(%2$s)=20%1$s)=20as=20T1=20%3$s','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('PredefinedVMProperties',=20=
'sap_agent=3D^(true|false)$;sndbuf=3D^[0-9]+$;vhost=3D^(([a-zA-Z0-9_]*):(t=
rue|false))(,(([a-zA-Z0-9_]*):(true|false)))*$;viodiskcache=3D^(none|write=
back|writethrough)$',=20'4.0');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('ProductRPMVersion','3.0.0.0','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('QuotaGraceStorage','20','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('QuotaGraceCluster','20','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('QuotaThresholdStorage','80','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('QuotaThresholdCluster','80','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('RhevhLocalFSPath','/data/images/','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('SANWipeAfterDelete','false','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('SearchResultsLimit','100','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('SendSMPOnRunVm','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('ServerCPUList','3:Intel=20=
Conroe=20Family:vmx,nx,model_Conroe:Conroe:x86_64;=204:Intel=20Penryn=20=
Family:vmx,nx,model_Penryn:Penryn:x86_64;=205:Intel=20Nehalem=20=
Family:vmx,nx,model_Nehalem:Nehalem:x86_64;=206:Intel=20Westmere=20=
Family:aes,vmx,nx,model_Westmere:Westmere:x86_64;=207:Intel=20=
SandyBridge=20Family:vmx,nx,model_SandyBridge:SandyBridge:x86_64;=20=
8:Intel=20Haswell=20Family:vmx,nx,model_Haswell:Haswell:x86_64;=202:AMD=20=
Opteron=20G1:svm,nx,model_Opteron_G1:Opteron_G1:x86_64;=203:AMD=20=
Opteron=20G2:svm,nx,model_Opteron_G2:Opteron_G2:x86_64;=204:AMD=20=
Opteron=20G3:svm,nx,model_Opteron_G3:Opteron_G3:x86_64;=205:AMD=20=
Opteron=20G4:svm,nx,model_Opteron_G4:Opteron_G4:x86_64;=206:AMD=20=
Opteron=20G5:svm,nx,model_Opteron_G5:Opteron_G5:x86_64;=203:IBM=20=
POWER8:powernv,model_power8:power8:ppc64;','3.6');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value_for_versions_up_to('ServerCPUList',=20=
'3:Intel=20Conroe=20Family:vmx,nx,model_Conroe:Conroe:x86_64;=204:Intel=20=
Penryn=20Family:vmx,nx,model_Penryn:Penryn:x86_64;=205:Intel=20Nehalem=20=
Family:vmx,nx,model_Nehalem:Nehalem:x86_64;=206:Intel=20Westmere=20=
Family:aes,vmx,nx,model_Westmere:Westmere:x86_64;=207:Intel=20=
SandyBridge=20Family:vmx,nx,model_SandyBridge:SandyBridge:x86_64;=20=
8:Intel=20Haswell-noTSX=20=
Family:vmx,nx,model_Haswell-noTSX:Haswell-noTSX:x86_64;=209:Intel=20=
Haswell=20Family:vmx,nx,model_Haswell:Haswell:x86_64;=2010:Intel=20=
Broadwell-noTSX=20=
Family:vmx,nx,model_Broadwell-noTSX:Broadwell-noTSX:x86_64;=2011:Intel=20=
Broadwell=20Family:vmx,nx,model_Broadwell:Broadwell:x86_64;=202:AMD=20=
Opteron=20G1:svm,nx,model_Opteron_G1:Opteron_G1:x86_64;=203:AMD=20=
Opteron=20G2:svm,nx,model_Opteron_G2:Opteron_G2:x86_64;=204:AMD=20=
Opteron=20G3:svm,nx,model_Opteron_G3:Opteron_G3:x86_64;=205:AMD=20=
Opteron=20G4:svm,nx,model_Opteron_G4:Opteron_G4:x86_64;=206:AMD=20=
Opteron=20G5:svm,nx,model_Opteron_G5:Opteron_G5:x86_64;=203:IBM=20=
POWER8:powernv,model_POWER8:POWER8:ppc64;',=20'4.0');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('ServerRebootTimeout','300','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('SetupNetworksPollingTimeout','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('SignCertTimeoutInSeconds','30','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('SpiceDriverNameInGuest','RHEV-Spice','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('ConsoleReleaseCursorKeys','shift+f12','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('ConsoleToggleFullScreenKeys','shift+f11','general'=
);=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('SpiceUsbAutoShare','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('FullScreenWebadminDefault','false','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('FullScreenUserportalBasicDefault','true','general'=
);=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('FullScreenUserportalExtendedDefault','false','gene=
ral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('WANDisableEffects','animation','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('WANColorDepth','16','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('SpmCommandFailOverRetries','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('SPMFailOverAttempts','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('HsmCommandFailOverRetries','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('SpmVCpuConsumption','1','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('SSHInactivityTimeoutSeconds','300','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('SSHInactivityHardTimeoutSeconds','1800','general')=
;=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('SSLEnabled','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('StorageDomainFailureTimeoutInMinutes','5','general=
');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('StorageDomainNameSizeLimit','50','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('StoragePoolNameSizeLimit','40','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('StoragePoolNonOperationalResetTimeoutInMin','3','g=
eneral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('StoragePoolRefreshTimeInSeconds','10','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('HostStorageConnectionAndPoolRefreshTimeInSeconds',=
'30','general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('SucceededJobCleanupTimeInMinutes','10','general');=
=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('SupportedClusterLevels','3.0','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('SupportedVDSMVersions','4.9,4.10,4.11,4.12,4.13,4.=
14','general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('SysPrepDefaultPassword','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('SysPrepDefaultUser','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('ThrottlerMaxWaitForVdsUpdateInMillis','10000','gen=
eral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('TimeoutToResetVdsInSeconds','60','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('DelayResetForSpmInSeconds','20','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('DelayResetPerVmInSeconds','0.5','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('EncryptHostCommunication','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('VdsmSSLProtocol','TLSv1','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('ExternalCommunicationProtocol','TLSv1','general');=
=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('VdsRequestQueueName','jms.topic.vdsm_requests','ge=
neral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('VdsResponseQueueName','jms.topic.vdsm_responses','=
general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('IrsRequestQueueName','jms.topic.vdsm_irs_requests'=
,'general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('IrsResponseQueueName','jms.topic.vdsm_irs_response=
s','general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('EventQueueName','jms.queue.events','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('EventProcessingPoolSize','10','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('TimeToReduceFailedRunOnVdsInMinutes','30','general=
');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('UnknownTaskPrePollingLapse','60000','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('UserSessionHardLimit','600','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('UserDefinedVMProperties',=20=
'','4.0');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('UserSessionTimeOutInterval','30','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('UtilizationThresholdInPercent','80','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('ValidNumOfMonitors','1,2,4','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('VcpuConsumptionPercentage','10','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('VdcVersion','3.0.0.0','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('VDSAttemptsToResetCount','2','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('VdsCertificateValidityInYears','5','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('vdsConnectionTimeout','20','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('VdsMaxConnectionsPerHost','2','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('IrsMaxConnectionsPerHost','2','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('MaxTotalConnections','20','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('VdsFenceOptionMapping','apc:sec=
ure=3Dsecure,port=3Dipport,slot=3Dport;apc_snmp:port=3Dport,encrypt_option=
s=3Dencrypt_options;bladecenter:secure=3Dsecure,port=3Dipport,slot=3Dport;=
cisco_ucs:secure=3Dssl,slot=3Dport;drac5:secure=3Dsecure,slot=3Dport;drac7=
:;eps:slot=3Dport;hpblade:port=3Dport;ilo:secure=3Dssl,port=3Dipport;ipmil=
an:;ilo2:secure=3Dssl,port=3Dipport;ilo3:;ilo4:;rsa:secure=3Dsecure,port=3D=
ipport;rsb:;wti:secure=3Dsecure,port=3Dipport,slot=3Dport','4.0');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('CustomVdsFenceOptionMapping','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('VdsFenceOptions','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('VdsFenceOptionTypes','encrypt_options=3Dbool,secur=
e=3Dbool,port=3Dint,slot=3Dint','general');=0A**************************=0A=
=0A=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value_for_versions_up_to('VdsFenceType','apc,apc_snmp,bla=
decenter,cisco_ucs,drac5,drac7,eps,hpblade,ilo,ilo2,ilo3,ilo4,ipmilan,rsa,=
rsb,wti','4.0');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('CustomVdsFenceType','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('vdsHeartbeatInSeconds','30','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('VdsLoadBalancingIntervalInMinutes','1','general');=
=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('VdsLocalDisksCriticallyLowFreeSpace','100','genera=
l');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('VdsLocalDisksLowFreeSpace','500','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('VdsRecoveryTimeoutInMinutes','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('VdsRefreshRate','2','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('vdsRetries','0','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('ProtocolFallbackRetries','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('ProtocolFallbackTimeoutInMilliSeconds','5000','gen=
eral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('vdsTimeout','180','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('VM32BitMaxMemorySizeInMB','20480','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('VM64BitMaxMemorySizeInMB','4194=
304','4.0');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value_for_versions_up_to('VMPpc64BitMaxMemorySizeInMB','1=
048576','4.0');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('VmGracefulShutdownMessage','System=20=
Administrator=20has=20initiated=20shutdown=20of=20this=20Virtual=20=
Machine.=20Virtual=20Machine=20is=20shutting=20down.','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('VmGracefulShutdownTimeout','30','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('VmPoolMaxSubsequentFailures','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('VmPoolMonitorBatchSize','5','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('VmPoolMonitorIntervalInMinutes','5','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('VmPoolMonitorMaxAttempts','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('VmPriorityMaxValue','100','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('AutoStartVmsRunnerIntervalInSeconds','1','general'=
);=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('RetryToRunAutoStartVmIntervalInSeconds','30','gene=
ral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('MaxNumOfTriesToRunFailedAutoStartVm','10','general=
');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('VncKeyboardLayout','en-us','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('VncKeyboardLayoutValidValues','ar,da,de,de-ch,en-g=
b,en-us,es,et,fi,fo,fr,fr-be,fr-ca,fr-ch,hr,hu,is,it,ja,lt,lv,mk,nl,nl-be,=
no,pl,pt,pt-br,ru,sl,sv,th,tr','general');=0A**************************=0A=
=0A=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('WaitForVdsInitInSec','60','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('NetworkConnectivityCheckTimeoutInSeconds','120','g=
eneral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('AutoRecoveryAllowedTypes','{"storage=20=
domains":"true","hosts":"true"}','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('ClientModeSpiceDefault','Native','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('EnableDeprecatedClientModeSpicePlugin','false','ge=
neral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('ClientModeVncDefault','Native','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('ClientModeRdpDefault','Auto','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('UseFqdnForRdpIfAvailable','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('WebSocketProxy','Off','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('WebSocketProxyTicketValiditySeconds','120','genera=
l');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('LogMaxPhysicalMemoryUsedThresholdInPercentage',=20=
'95',=20'general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('LogMaxSwapMemoryUsedThresholdInPercentage',=20=
'95',=20'general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('LogMaxCpuUsedThresholdInPercentage',=20'95',=20=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('LogMaxNetworkUsedThresholdInPercentage',=20'95',=20=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('LogMinFreeSwapThresholdInMB',=20'256',=20=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('LogMaxSwapUsedThresholdInPercentage',=20'95',=20=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value_for_versions_up_to('CustomDeviceProperties',=20=
'{type=3Dinterface;prop=3D{SecurityGroups=3D^(?:(?:[0-9a-fA-F]{8}-(?:[0-9a=
-fA-F]{4}-){3}[0-9a-fA-F]{12},=20=
*)*[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}|)$}}',=20'4.0');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('PreDefinedNetworkCustomProperti=
es',=20$q$bridge_opts=3D^[^\s=3D]+=3D[^\s=3D]+(\s+[^\s=3D]+=3D[^\s=3D]+)*$=
$q$,=20'4.0');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value_for_versions_up_to('UserDefinedNetworkCustomPropert=
ies',=20'',=20'4.0');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value_for_versions_up_to('SshSoftFencingCommand',=20=
'/usr/bin/vdsm-tool=20service-restart=20vdsmd',=20'4.0');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('SecureConnectionWithOATServers','true','general');=
=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('PollUri','AttestationService/resources/PollHosts',=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('AttestationTruststore','TrustStore.jks','general')=
;=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('AttestationPort','8443','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('AttestationTruststorePass','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('AttestationServer','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('AttestationFirstStageSize','10','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('MaxAverageNetworkQoSValue','1024','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('MaxPeakNetworkQoSValue','2048','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('MaxBurstNetworkQoSValue','10240','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('MaxHostNetworkQosShares',=20'100',=20=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('QoSInboundAverageDefaultValue','10','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('QoSInboundPeakDefaultValue','10','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('QoSInboundBurstDefaultValue','100','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('QoSOutboundAverageDefaultValue','10','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('QoSOutboundPeakDefaultValue','10','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('QoSOutboundBurstDefaultValue','100','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('ExternalSchedulerServiceURL','http://localhost:187=
81/','general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('ExternalSchedulerConnectionTimeout','100','general=
');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('ExternalSchedulerEnabled','false','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('ExternalSchedulerResponseTimeout','120000','genera=
l');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20fn_db_add_config_value('DwhHeartBeatInterval',=20=
'30',=20'general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20fn_db_add_config_value('DisconnectDwh',=20=
'0',=20'general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('GlanceImageListSize','20','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('GlanceImageTotalListSize','500','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('OverUtilizationForHaReservation','200','general');=
=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('ScaleDownForHaReservation','1','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('VdsHaReservationIntervalInMinutes','5','general');=
=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('DefaultMaximumMigrationDowntime','0','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('DefaultSerialNumberPolicy','HOST_ID','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('DefaultCustomSerialNumber','Dummy=20=
serial=20number.','general');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('DefaultMTU',=20'1500',=20'general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('FenceKdumpDestinationAddress','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('FenceKdumpDestinationPort','7410','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('FenceKdumpMessageInterval','5','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('FenceKdumpListenerTimeout','90','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('KdumpStartedTimeout','30','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('AlertOnNumberOfLVs','300','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('CSRFProtection','false','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('CORSSupport','false','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('CORSAllowedOrigins','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('UsageHistoryLimit','40',=20'general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('HostStorageLeaseAliveCheckingInterval',=20=
'90',=20'general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('SupportNUMAMigration','false','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('UnsupportedLocalesFilter','','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('DefaultAutoConvergence','false','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('DefaultMigrationCompression','false','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('MigrationPolicies','[{"id":{"uuid":"80554327-0569-=
496b-bdeb-fcbbf52b827b"},"maxMigrations":2,"autoConvergence":true,"migrati=
onCompression":true,"enableGuestEvents":true,"name":"Safe=20but=20not=20=
may=20not=20converge","description":"A=20safe=20policy=20which=20in=20=
typical=20situations=20lets=20the=20VM=20converge.=20The=20user=20of=20=
the=20VM=20should=20not=20notice=20any=20significant=20slowdown=20of=20=
the=20VM.=20If=20the=20VM=20is=20not=20converging=20for=20a=20longer=20=
time,=20the=20migration=20will=20be=20=
aborted.","config":{"convergenceItems":[{"stallingLimit":1,"convergenceIte=
m":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"converge=
nceItem":{"action":"setDowntime","params":["200"]}},{"stallingLimit":3,"co=
nvergenceItem":{"action":"setDowntime","params":["300"]}},{"stallingLimit"=
:4,"convergenceItem":{"action":"setDowntime","params":["400"]}},{"stalling=
Limit":6,"convergenceItem":{"action":"setDowntime","params":["500"]}}],"in=
itialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"act=
ion":"abort","params":[]}]}},{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf5=
2b827c"},"maxMigrations":1,"autoConvergence":true,"migrationCompression":t=
rue,"enableGuestEvents":true,"name":"Should=20converge=20but=20guest=20=
may=20notice=20a=20pause","description":"A=20safe=20policy=20which=20=
makes=20also=20a=20highly=20loaded=20VM=20converge=20in=20most=20=
situations.=20On=20the=20other=20hand,=20the=20user=20may=20notice=20a=20=
slowdown.=20If=20the=20VM=20is=20still=20not=20converging,=20the=20=
migration=20is=20=
aborted.","config":{"convergenceItems":[{"stallingLimit":1,"convergenceIte=
m":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"converge=
nceItem":{"action":"setDowntime","params":["200"]}},{"stallingLimit":3,"co=
nvergenceItem":{"action":"setDowntime","params":["300"]}},{"stallingLimit"=
:4,"convergenceItem":{"action":"setDowntime","params":["400"]}},{"stalling=
Limit":6,"convergenceItem":{"action":"setDowntime","params":["500"]}}],"in=
itialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"act=
ion":"setDowntime","params":["5000"]},{"action":"abort","params":[]}]}}]',=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value_for_versions_up_to('SriovHotPlugSupported','false',=
'3.6');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('HostedEngineVmName','HostedEngine','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('AutoImportHostedEngine','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('AllowEditingHostedEngine','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('HostedEngineConfigDiskSizeInBytes','20480','genera=
l');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('ImageProxyAddress','localhost:54323','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('ImageProxySSLEnabled','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_config_value('ImageDaemonPort','54322','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('ImageTransferClientTicketValidityInSeconds','3600'=
,'general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('ImageTransferHostTicketValidityInSeconds','300','g=
eneral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('ImageTransferHostTicketRefreshAllowanceInSeconds',=
'60','general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_add_config_value('ImageTransferPausedLogIntervalInSeconds','1800','g=
eneral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('UploadImageUiInactivityTimeoutInSeconds','60','gen=
eral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('UploadImageChunkSizeKB','8192','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('UploadImageXhrTimeoutInSeconds','10','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value('UploadImageXhrRetryIntervalInSeconds','3','general=
');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value('UploadImageXhrMaxRetries','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_add_config_value_for_versions_up_to('AdPartnerMacSupported','false',=
'3.6');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_config_value_for_versions_up_to('OvsSupported','false','3.6');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_update_config_value('AutoRecoveryAllowedTypes','{"storage=20=
domains":"true","hosts":"true"}','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('BootstrapMinimalVdsmVersion','4.9','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_update_config_value('DBEngine','Postgres','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_update_config_value('DefaultTimeZone','(GMT)=20GMT=20=
Standard=20Time','general');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_update_config_value('FenceAgentDefaultParams','drac7:privlvl=3DOPERA=
TOR,lanplus=3D1,delay=3D10;ilo3:lanplus=3D1,power_wait=3D4;ilo4:lanplus=3D=
1,power_wait=3D4;ilo_ssh:secure=3D1','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('FenceAgentDefaultParamsForPPC','ilo3:lanplus=3D=
1,cipher=3D1,privlvl=3Dadministrator,power_wait=3D4,retry_on=3D2;ilo4:ilan=
plus=3D1,cipher=3D1,privlvl=3Dadministrator,power_wait=3D4,retry_on=3D2;ip=
milan:lanplus=3D1,cipher=3D1,privlvl=3Dadministrator,power_wait=3D4,retry_=
on=3D2;ilo_ssh:secure=3D1','general');=0A**************************=0A=0A=
=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_update_config_value('FenceAgentMapping','drac7=3Dipmilan,ilo2=3Dilo,=
ilo3=3Dipmilan,ilo4=3Dipmilan','general');=0A**************************=0A=
=0A=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_update_config_value('FenceStartStatusDelayBetweenRetriesInSec','10',=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_update_config_value('FenceStartStatusRetries','18','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('FenceStopStatusDelayBetweenRetriesInSec','10','=
general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_update_config_value('FenceStopStatusRetries','18','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('FencePowerWaitParam','apc=3Dpower_wait,apc_snmp=
=3Dpower_wait,bladecenter=3Dpower_wait,cisco_ucs=3Dpower_wait,drac5=3Dpowe=
r_wait,drac7=3Dpower_wait,eps=3Ddelay,hpblade=3Dpower_wait,ilo=3Dpower_wai=
t,ilo2=3Dpower_wait,ilo3=3Dpower_wait,ilo4=3Dpower_wait,ilo_ssh=3Dpower_wa=
it,ipmilan=3Dpower_wait,rsa=3Dpower_wait,rsb=3Dpower_wait,wti=3Dpower_wait=
','general');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_update_config_value('MigrationPolicies','[{"id":{"uuid":"80554327-05=
69-496b-bdeb-fcbbf52b827b"},"maxMigrations":2,"autoConvergence":true,"migr=
ationCompression":true,"enableGuestEvents":true,"name":"Minimal=20=
downtime","description":"A=20policy=20that=20lets=20the=20VM=20migrate=20=
in=20typical=20situations.=20The=20VM=20should=20not=20experience=20any=20=
significant=20downtime.=20If=20the=20VM=20migration=20is=20not=20=
converging=20for=20a=20long=20time,=20the=20migration=20will=20be=20=
aborted.=20The=20guest=20agent=20hook=20mechanism=20is=20=
enabled.","config":{"convergenceItems":[{"stallingLimit":1,"convergenceIte=
m":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"converge=
nceItem":{"action":"setDowntime","params":["200"]}},{"stallingLimit":3,"co=
nvergenceItem":{"action":"setDowntime","params":["300"]}},{"stallingLimit"=
:4,"convergenceItem":{"action":"setDowntime","params":["400"]}},{"stalling=
Limit":6,"convergenceItem":{"action":"setDowntime","params":["500"]}}],"in=
itialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"act=
ion":"abort","params":[]}]}},{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf5=
2b827c"},"maxMigrations":1,"autoConvergence":true,"migrationCompression":t=
rue,"enableGuestEvents":true,"name":"Suspend=20workload=20if=20=
needed","description":"A=20policy=20that=20lets=20the=20VM=20migrate=20=
in=20most=20situations,=20including=20VMs=20running=20heavy=20workloads.=20=
On=20the=20other=20hand,=20the=20VM=20may=20experience=20a=20more=20=
significant=20downtime.=20The=20migration=20may=20still=20be=20aborted=20=
for=20extreme=20workloads.=20The=20guest=20agent=20hook=20mechanism=20is=20=
enabled.","config":{"convergenceItems":[{"stallingLimit":1,"convergenceIte=
m":{"action":"setDowntime","params":["150"]}},{"stallingLimit":2,"converge=
nceItem":{"action":"setDowntime","params":["200"]}},{"stallingLimit":3,"co=
nvergenceItem":{"action":"setDowntime","params":["300"]}},{"stallingLimit"=
:4,"convergenceItem":{"action":"setDowntime","params":["400"]}},{"stalling=
Limit":6,"convergenceItem":{"action":"setDowntime","params":["500"]}}],"in=
itialItems":[{"action":"setDowntime","params":["100"]}],"lastItems":[{"act=
ion":"setDowntime","params":["5000"]},{"action":"abort","params":[]}]}}]',=
'general');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20fn_db_update_config_value('IPTablesConfig','=0A#=20=
oVirt=20default=20firewall=20configuration.=20Automatically=20generated=20=
by=20vdsm=20bootstrap=20script.=0A*filter=0A:INPUT=20ACCEPT=20[0:0]=0A=
:FORWARD=20ACCEPT=20[0:0]=0A:OUTPUT=20ACCEPT=20[0:0]=0A-A=20INPUT=20-m=20=
state=20--state=20ESTABLISHED,RELATED=20-j=20ACCEPT=0A-A=20INPUT=20-p=20=
icmp=20-j=20ACCEPT=0A-A=20INPUT=20-i=20lo=20-j=20ACCEPT=0A#=20vdsm=0A-A=20=
INPUT=20-p=20tcp=20--dport=20@VDSM_PORT@=20-j=20ACCEPT=0A#=20=
ovirt-imageio-daemon=0A-A=20INPUT=20-p=20tcp=20--dport=2054322=20-j=20=
ACCEPT=0A#=20rpc.statd=0A-A=20INPUT=20-p=20tcp=20--dport=20111=20-j=20=
ACCEPT=0A-A=20INPUT=20-p=20udp=20--dport=20111=20-j=20ACCEPT=0A#=20SSH=0A=
-A=20INPUT=20-p=20tcp=20--dport=20@SSH_PORT@=20-j=20ACCEPT=0A#=20snmp=0A=
-A=20INPUT=20-p=20udp=20--dport=20161=20-j=20ACCEPT=0A#=20Cockpit=0A-A=20=
INPUT=20-p=20tcp=20--dport=209090=20-j=20ACCEPT=0A=0A@CUSTOM_RULES@=0A=0A=
#=20Reject=20any=20other=20input=20traffic=0A-A=20INPUT=20-j=20REJECT=20=
--reject-with=20icmp-host-prohibited=0A-A=20FORWARD=20-m=20physdev=20!=20=
--physdev-is-bridged=20-j=20REJECT=20--reject-with=20=
icmp-host-prohibited=0ACOMMIT=0A','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_update_config_value('IPTablesConfigForGluster',=0A'=0A#=20=
glusterd=0A-A=20INPUT=20-p=20tcp=20-m=20tcp=20--dport=2024007=20-j=20=
ACCEPT=0A=0A#=20gluster=20swift=0A-A=20INPUT=20-p=20tcp=20-m=20tcp=20=
--dport=208080=20=20-j=20ACCEPT=0A=0A#=20portmapper=0A-A=20INPUT=20-p=20=
tcp=20-m=20tcp=20--dport=2038465=20-j=20ACCEPT=0A-A=20INPUT=20-p=20tcp=20=
-m=20tcp=20--dport=2038466=20-j=20ACCEPT=0A=0A#=20nfs=0A-A=20INPUT=20-p=20=
tcp=20-m=20tcp=20--dport=2038467=20-j=20ACCEPT=0A-A=20INPUT=20-p=20tcp=20=
-m=20tcp=20--dport=202049=20=20-j=20ACCEPT=0A-A=20INPUT=20-p=20tcp=20-m=20=
tcp=20--dport=2038469=20-j=20ACCEPT=0A=0A#=20nrpe=0A-A=20INPUT=20-p=20=
tcp=20--dport=205666=20-j=20ACCEPT=0A=0A#=20status=0A-A=20INPUT=20-p=20=
tcp=20-m=20tcp=20--dport=2039543=20-j=20ACCEPT=0A-A=20INPUT=20-p=20tcp=20=
-m=20tcp=20--dport=2055863=20-j=20ACCEPT=0A=0A#=20nlockmgr=0A-A=20INPUT=20=
-p=20tcp=20-m=20tcp=20--dport=2038468=20-j=20ACCEPT=0A-A=20INPUT=20-p=20=
udp=20-m=20udp=20--dport=20963=20=20=20-j=20ACCEPT=0A-A=20INPUT=20-p=20=
tcp=20-m=20tcp=20--dport=20965=20=20=20-j=20ACCEPT=0A=0A#=20ctdbd=0A-A=20=
INPUT=20-p=20tcp=20-m=20tcp=20--dport=204379=20=20-j=20ACCEPT=0A=0A#=20=
smbd=0A-A=20INPUT=20-p=20tcp=20-m=20tcp=20--dport=20139=20=20=20-j=20=
ACCEPT=0A-A=20INPUT=20-p=20tcp=20-m=20tcp=20--dport=20445=20=20=20-j=20=
ACCEPT=0A=0A#=20Ports=20for=20gluster=20volume=20bricks=20(default=20100=20=
ports)=0A#=20Needed=20for=20Gluster=20<=203.4.0=20compatibility=0A-A=20=
INPUT=20-p=20tcp=20-m=20tcp=20--dport=2024009:24108=20-j=20ACCEPT=0A=0A#=20=
Ports=20required=20for=20GlusterFS=20brick=20processes=20have=20changed=20=
in=0A#=20glusterfs=203.4.0=20from=2024009=20onwards=20to=2049152=20=
onwards.=0A-A=20INPUT=20-p=20tcp=20-m=20tcp=20--dport=2049152:49251=20-j=20=
ACCEPT=0A=0A#=20Ports=20for=20gluster=20volume=20bricks=20in=20Hyper=20=
Converged=20setup(default=20100=20ports)=0A-A=20INPUT=20-p=20tcp=20-m=20=
tcp=20--dport=2049217:49316=20-j=20ACCEPT=0A=0A','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_update_config_value('IPTablesConfigForVirt',=0A'=0A#=20=
libvirt=20tls=0A-A=20INPUT=20-p=20tcp=20--dport=2016514=20-j=20ACCEPT=0A=0A=
#=20serial=20consoles=0A-A=20INPUT=20-p=20tcp=20-m=20multiport=20=
--dports=202223=20-j=20ACCEPT=0A=0A#=20guest=20consoles=0A-A=20INPUT=20=
-p=20tcp=20-m=20multiport=20--dports=205900:6923=20-j=20ACCEPT=0A=0A#=20=
migration=0A-A=20INPUT=20-p=20tcp=20-m=20multiport=20--dports=20=
49152:49216=20-j=20ACCEPT=0A',=20'general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('IsMultilevelAdministrationOn','true','general')=
;=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_update_config_value('MinimalETLVersion','4.0.0','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('OvirtInitialSupportedIsoVersion','2.5.5:5.8','g=
eneral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_update_config_value('OvirtIsoPrefix','^ovirt-node-iso-([0-9].*)\.iso=
$:^rhevh-([0-9].*)\.iso$','general');=0A**************************=0A=0A=20=
=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_update_config_value('OvirtNodeOS','^ovirt.*$:^rhev.*$','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('oVirtISOsRepositoryPath','/usr/share/ovirt-node=
-iso:/usr/share/rhev-hypervisor','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('PackageNamesForCheckUpdate','ioprocess,mom,libv=
irt,lvm2,ovirt-imageio-common,ovirt-imageio-daemon,ovirt-vmconsole,ovirt-v=
mconsole-host,python-ioprocess,qemu-kvm,qemu-img,sanlock,vdsm,vdsm-cli','g=
eneral');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_update_config_value('PostgresPagingSyntax','OFFSET=20(%1$s=20-1)=20=
LIMIT=20%2$s','general');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_update_config_value('PostgresSearchTemplate','SELECT=20*=20FROM=20=
(%2$s)=20%1$s)=20as=20T1=20%3$s','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('RhevhLocalFSPath','/data/images/rhev','general'=
);=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_update_config_value('ClusterEmulatedMachines','pc-i440fx-rhel7.2.0,p=
c-i440fx-2.1,pseries-rhel7.2.0','3.6');=0A**************************=0A=0A=
=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_update_config_value('SpiceDriverNameInGuest','{"windows":=20=
"RHEV-Spice",=20"linux"=20:=20"xorg-x11-drv-qxl"=20}','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('SupportedClusterLevels','3.6,4.0','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('SupportedStorageFormats','0,2,3','3.6,4.0');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('SupportedVDSMVersions','4.17','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_update_config_value('VdcVersion','4.0.0.0','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('ProductRPMVersion','4.0.0.0','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('VdsFenceOptionMapping','apc:secure=3Dsecure,por=
t=3Dipport,slot=3Dport;apc_snmp:port=3Dport,encrypt_options=3Dencrypt_opti=
ons;bladecenter:secure=3Dsecure,port=3Dipport,slot=3Dport;cisco_ucs:secure=
=3Dssl,slot=3Dport;drac5:secure=3Dsecure,slot=3Dport;drac7:;eps:slot=3Dpor=
t;hpblade:port=3Dport;ilo:secure=3Dssl,port=3Dipport;ipmilan:;ilo2:secure=3D=
ssl,port=3Dipport;ilo3:;ilo4:;ilo_ssh:port=3Dport;rsa:secure=3Dsecure,port=
=3Dipport;rsb:;wti:secure=3Dsecure,port=3Dipport,slot=3Dport','3.6');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('VdsFenceOptionMapping','apc:secure=3Dsecure,por=
t=3Dipport,slot=3Dport;apc_snmp:port=3Dport,encrypt_options=3Dencrypt_opti=
ons;bladecenter:secure=3Dsecure,port=3Dipport,slot=3Dport;cisco_ucs:secure=
=3Dssl,slot=3Dport;drac5:secure=3Dsecure,slot=3Dport;drac7:;eps:slot=3Dpor=
t;hpblade:port=3Dport;ilo:secure=3Dssl,port=3Dipport;ipmilan:;ilo2:secure=3D=
ssl,port=3Dipport;ilo3:;ilo4:;ilo_ssh:port=3Dport;rsa:secure=3Dsecure,port=
=3Dipport;rsb:;wti:secure=3Dsecure,port=3Dipport,slot=3Dport','4.0');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('VdsFenceType','apc,apc_snmp,bladecenter,cisco_u=
cs,drac5,drac7,eps,hpblade,ilo,ilo2,ilo3,ilo4,ilo_ssh,ipmilan,rsa,rsb,wti'=
,'3.6');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_update_config_value('VdsFenceType','apc,apc_snmp,bladecenter,cisco_u=
cs,drac5,drac7,eps,hpblade,ilo,ilo2,ilo3,ilo4,ilo_ssh,ipmilan,rsa,rsb,wti'=
,'4.0');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_update_config_value('VdsRefreshRate','3','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_update_config_value('VmGracefulShutdownMessage','System=20=
Administrator=20has=20initiated=20shutdown=20of=20this=20Virtual=20=
Machine.=20Virtual=20Machine=20is=20shutting=20down.','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('DisconnectPoolOnReconstruct','0,2,3','general')=
;=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_update_config_value('AgentAppName','ovirt-guest-agent-common,ovirt-g=
uest-agent','general');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_update_config_value('VM64BitMaxMemorySizeInMB','4194304','3.6');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('VM64BitMaxMemorySizeInMB','4194304','4.0');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('AutoStartVmsRunnerIntervalInSeconds','1','gener=
al');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_update_config_value('AllowEditingHostedEngine','true','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_update_config_value('IsMigrationSupported','{"undefined":=20=
"true",=20"x86_64":=20"true",=20"ppc64"=20:=20"true"=20}','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_config_value('IsMemorySnapshotSupported','{"undefined":=20=
"true",=20"x86_64":=20"true",=20"ppc64"=20:=20"true"=20}','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_update_config_value('IsSuspendSupported','{"undefined":=20=
"true",=20"x86_64":=20"true",=20"ppc64"=20:=20"true"=20}','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_default_config_value('AsyncTaskZombieTaskLifeInMinutes','300'=
,'3000','general',false);=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_update_default_config_value('VdsLocalDisksCriticallyLowFreeSpace','1=
00','500','general',false);=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_update_default_config_value('VdsLocalDisksLowFreeSpace','1000',=20=
'100','general',false);=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_update_default_config_value('GuestToolsSetupIsoPrefix','RHEV-toolsSe=
tup_',=20'ovirt-guest-tools-','general',=20false);=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_update_default_config_value('vdsConnectionTimeout',=20=
'180',=20'2',=20'general',=20false);=0A**************************=0A=0A=20=
=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_update_default_config_value('vdsRetries',=20'3',=20'0',=20=
'general',=20false);=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_update_default_config_value('VdsmSSLProtocol','SSLv3','TLSv1','gener=
al',=20false);=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_update_default_config_value('ExternalCommunicationProtocol','SSLv3',=
'TLSv1','general',=20false);=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_update_default_config_value('ServerCPUList',=20'3:Intel=20Conroe=20=
Family:vmx,nx,model_Conroe:Conroe:x86_64;=204:Intel=20Penryn=20=
Family:vmx,nx,model_Penryn:Penryn:x86_64;=205:Intel=20Nehalem=20=
Family:vmx,nx,model_Nehalem:Nehalem:x86_64;=206:Intel=20Westmere=20=
Family:aes,vmx,nx,model_Westmere:Westmere:x86_64;=207:Intel=20=
SandyBridge=20Family:vmx,nx,model_SandyBridge:SandyBridge:x86_64;=20=
8:Intel=20Haswell-noTSX=20=
Family:vmx,nx,model_Haswell-noTSX:Haswell-noTSX:x86_64;=209:Intel=20=
Haswell=20Family:vmx,nx,model_Haswell:Haswell:x86_64;=2010:Intel=20=
Broadwell-noTSX=20=
Family:vmx,nx,model_Broadwell-noTSX:Broadwell-noTSX:x86_64;=2011:Intel=20=
Broadwell=20Family:vmx,nx,model_Broadwell:Broadwell:x86_64;=202:AMD=20=
Opteron=20G1:svm,nx,model_Opteron_G1:Opteron_G1:x86_64;=203:AMD=20=
Opteron=20G2:svm,nx,model_Opteron_G2:Opteron_G2:x86_64;=204:AMD=20=
Opteron=20G3:svm,nx,model_Opteron_G3:Opteron_G3:x86_64;=205:AMD=20=
Opteron=20G4:svm,nx,model_Opteron_G4:Opteron_G4:x86_64;=206:AMD=20=
Opteron=20G5:svm,nx,model_Opteron_G5:Opteron_G5:x86_64;=203:IBM=20POWER=20=
8:powernv,model_power8:power8:ppc64;=204:IBM=20POWER=20=
8E:powernv,model_power8e:power8e:ppc64;',=20'3:Intel=20Conroe=20=
Family:vmx,nx,model_Conroe:Conroe:x86_64;=204:Intel=20Penryn=20=
Family:vmx,nx,model_Penryn:Penryn:x86_64;=205:Intel=20Nehalem=20=
Family:vmx,nx,model_Nehalem:Nehalem:x86_64;=206:Intel=20Westmere=20=
Family:aes,vmx,nx,model_Westmere:Westmere:x86_64;=207:Intel=20=
SandyBridge=20Family:vmx,nx,model_SandyBridge:SandyBridge:x86_64;=20=
8:Intel=20Haswell-noTSX=20=
Family:vmx,nx,model_Haswell-noTSX:Haswell-noTSX:x86_64;=209:Intel=20=
Haswell=20Family:vmx,nx,model_Haswell:Haswell:x86_64;=2010:Intel=20=
Broadwell-noTSX=20=
Family:vmx,nx,model_Broadwell-noTSX:Broadwell-noTSX:x86_64;=2011:Intel=20=
Broadwell=20Family:vmx,nx,model_Broadwell:Broadwell:x86_64;=202:AMD=20=
Opteron=20G1:svm,nx,model_Opteron_G1:Opteron_G1:x86_64;=203:AMD=20=
Opteron=20G2:svm,nx,model_Opteron_G2:Opteron_G2:x86_64;=204:AMD=20=
Opteron=20G3:svm,nx,model_Opteron_G3:Opteron_G3:x86_64;=205:AMD=20=
Opteron=20G4:svm,nx,model_Opteron_G4:Opteron_G4:x86_64;=206:AMD=20=
Opteron=20G5:svm,nx,model_Opteron_G5:Opteron_G5:x86_64;=203:IBM=20=
POWER8:powernv,model_POWER8:POWER8:ppc64;',=20'3.6',=20FALSE);=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_default_config_value('GlusterStorageDeviceListMountPointsToIg=
nore','/,/home,/boot,/run/gluster/snaps/.*',=20=
'/,/home,/boot,/run/gluster/snaps/.*,/var/run/gluster/snaps/.*','general',=
=20false);=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_update_default_config_value('vdsHeartbeatInSeconds','10','30','gener=
al',false);=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_rename_config_key('MaxVmNameLengthNonWindows',=20=
'MaxVmNameLength',=20'general');=0A**************************=0A=0A=20=0A=
=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_rename_config_key('MaxVmNameLengthWindows',=20=
'MaxVmNameLengthSysprep',=20'general');=0A**************************=0A=0A=
=20=0A=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_update_default_config_value('ClientModeSpiceDefault','Plugin','Nativ=
e','general',false);=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_update_config_value('RemoteViewerSupportedVersions','rhev-win64:2.0-=
160;rhev-win32:2.0-160;rhel7:2.0-6;rhel6:99.0-1','general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20=
fn_db_update_default_config_value('vdsConnectionTimeout','2','20','general=
',false);=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_update_default_config_value('ProtocolFallbackRetries','3','25','gene=
ral',false);=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20=
fn_db_update_default_config_value('DwhHeartBeatInterval',=20'30',=20=
'15',=20'general',=20false);=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_config_value('UseHostNameIdentifier',=20'false',=20'general');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_split_config_value('GlusterTunedProfile',=20=
'rhs-high-throughput,rhs-virtualization',=20=
'rhgs-sequential-io,rhgs-random-io',=20'3.6');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
create=20or=20replace=20function=20__temp_set_pg_major_release()=0A=
RETURNS=20void=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20=
v_pg_major_release=20char(1);=0ABEGIN=0A=20=20=20=20--=20the=20folowing=20=
evaluates=20currently=20to=208=20on=20PG=208.x=20and=20to=209=20on=20PG=20=
9.x=0A=20=20=20=20v_pg_major_release:=3Dsubstring=20=
((string_to_array(version(),'=20'))[2],1,1);=0A=20=20=20=20perform=20=
fn_db_add_config_value('PgMajorRelease',v_pg_major_release,'general');=0A=
=20=20=20=20--=20ensure=20that=20if=20PG=20was=20upgraded=20we=20will=20=
get=20the=20right=20value=0A=20=20=20=20perform=20=
fn_db_update_config_value('PgMajorRelease',v_pg_major_release,'general');=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ASELECT=20=20=
__temp_set_pg_major_release();=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0ADROP=20FUNCTION=20=
__temp_set_pg_major_release();=0A**************************=0A=0ADROP=20=
FUNCTION=0A*********=20QUERY=20**********=0A=
/*************************************************************************=
*********************=0A=20=20=20Currently=20we=20have=20a=20bug=20that=20=
upgarde=2003010250=20was=20cherry-picked=20and=20installed=20after=20=
03010130=0A=20=20=20This=20caused=20all=20scripts=20between=2003010140=20=
and=2003010240=20not=20to=20run.=0A=20=20=20This=20scripts=20removes=20=
the=2003010250=20from=20schema_version=20and=20updates=2003010130=20to=20=
be=20the=20curent=20version=0A=20=20=20So,=20after=20that=20,=20all=20=
scripts=20from=2003010140=20and=20up=20will=20run=0A=20=20=20Since=20=
03010250=20was=20a=20configuration=20change=20that=20is=20already=20=
handled=20in=20the=20new=20config.sql,=20no=20other=20handling=20is=20=
needed.=0A=
**************************************************************************=
********************/=0Aupdate=20schema_version=20set=20current=20=3D=20=
true=20where=20version=20=3D=20'03010130'=0Aand=20exists(select=201=20=
from=20schema_version=20where=20version=20=3D=20'03010250'=20and=20=
current=20=3D=20true);=0A**************************=0A=0AUPDATE=200=0A=
*********=20QUERY=20**********=0Adelete=20from=20schema_version=0Awhere=20=
version=20=3D=20'03010250'=20and=20current=20=3D=20true;=0A=
**************************=0A=0ADELETE=200=0A*********=20QUERY=20=
**********=0Aselect=20=
fn_db_add_column('vds_dynamic','supported_engines','varchar(40)');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
CREATE=20FUNCTION=20__temp__0030_add_materialized_views_table()=0A=
RETURNS=20VOID=0AAS=20$procedure$=0ABEGIN=0A=20=20=20=20IF=20not=20=
exists=20(select=201=20from=20information_schema.tables=20where=20=
table_schema=20=3D=20'public'=20and=20table_name=20=
=3D'materialized_views')=20then=0A=20=20=20=20=20=20=20=20CREATE=20TABLE=20=
materialized_views=20(=0A=20=20=20=20=20=20=20=20=20=20mv_name=20NAME=20=
NOT=20NULL=20PRIMARY=20KEY,=0A=20=20=20=20=20=20=20=20=20=20v_name=20=
NAME=20NOT=20NULL,=0A=20=20=20=20=20=20=20=20=20=20refresh_rate_in_sec=20=
INTEGER,=0A=20=20=20=20=20=20=20=20=20=20last_refresh=20TIMESTAMP=20WITH=20=
TIME=20ZONE,=0A=20=20=20=20=20=20=20=20=20=20avg_cost_ms=20int=20not=20=
null=20default=200=0A=20=20=20=20=20=20=20=20);=0A=20=20=20=20END=20IF;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Aselect=20=
__temp__0030_add_materialized_views_table();=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
DROP=20FUNCTION=20__temp__0030_add_materialized_views_table();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0Aselect=20fn_db_add_column('materialized_views',=20=
'min_refresh_rate_in_sec',=20'int=20default=200');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_column('materialized_views',=20'custom',=20'boolean=20=
default=20false');=0A**************************=0A=0A=20=0A=0A*********=20=
QUERY=20**********=0Aselect=20fn_db_add_column('materialized_views',=20=
'active',=20'boolean=20default=20true');=0A**************************=0A=0A=
=20=0A=0A*********=20QUERY=20**********=0AALTER=20TABLE=20schema_version=20=
ALTER=20COLUMN=20installed_by=20TYPE=20varchar(63);=0A=
**************************=0A=0AALTER=20TABLE=0A*********=20QUERY=20=
**********=0A/*=0AThis=20file=20adds=20Snapshot=20Materialized=20Views=20=
support=20to=20Postgres.=0AA=20Snapshot=20Materialized=20View=20is=20=
actually=20a=20table=20built=20on=20top=20of=0Aa=20real=20view=20that=20=
enables=20to=20select=20data=20from=20the=20Snapshot=20Materialized=20=
View=0Aeasily=20and=20efficiently.=0ACandidates=20for=20Snapshot=20=
Materialized=20Views=20are=20views=20that=20are=20based=20on=0A=
slowly-changing=20data.=20The=20Snapshot=20Materialized=20Views=20is=20=
actually=0Afunctioning=20as=20a=20cache.=0AThe=20Snapshot=20Materialized=20=
View=20is=20refreshed=20per=20request.=0AThe=20Snapshot=20Materialized=20=
View=20definitions=20are=20stored=20in=20the=20materialized_views=20=
table.=0A=0AFlow:=0A1)=20Create=20the=20Materialized=20View=20by=20=
calling:=0A=20=20=20CreateMaterializedView=20-=20if=20you=20are=20=
creating=20a=20new=20view=0A=20=20=20CreateMaterializedViewAs=20-=20If=20=
you=20want=20to=20preserve=20the=20original=20view=20name=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
in=20this=20case=20the=20original=20view=20will=20be=20renamed=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20and=20the=20new=20Materialized=20View=20will=20have=20the=20=
original=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20view=20name.=0A=20=20=20The=20following=20=
should=20be=20called=20for=20Custom=20Materialized=20Views=0A=20=20=20=
CreateCustomMaterializedView=0A=20=20=20CreateCustomMaterializedViewAs=0A=
2)=20If=20your=20Snapshot=20Materialized=20View=20is=20my_mt=20you=20=
should=20create=20Stored=20Procedures:=0A=20=20=20=20MtDropmy_mtIndexes=20=
-=20Drops=20indexes=20on=20my_mt=0A=20=20=20=20MtCreatemy_mtIndexes=20-=20=
Creates=20needed=20indexes=20on=20my_mt=0A=20=20=20=20Those=20indexes=20=
should=20be=20defined=20in=20the=20"Snapshot=20Materialized=20Views=20=
Index=20Definitions=20Section"=0A=20=20=20=20in=20=
post_upgrade/0020_create_materialized_views.sql=20file.=0A=0A=20=20=20=
Those=20SP=20are=20called=20automatically=20when=20a=20Snapshot=20=
Materialized=20View=20is=20refreshed=0A=20=20=20to=20boost=20refresh=20=
performance.=0A=0A3)=20You=20can=20call=20IsMaterializedViewRefreshed=20=
to=20check=20if=20it=20is=20time=20to=20refresh=20the=20view=0A=20=20=20=
and=20if=20yes=20call=20RefreshMaterializedView=20manually.=0A=20=20=20=
or=0A=20=20=20You=20can=20define=20a=20cron=20job=20that=20calls=20=
RefreshAllMaterializedViews=20that=20loops=20over=0A=20=20=20all=20=20=
Snapshot=20Materialized=20Views=20and=20refreshes=20it=20automatically=0A=
=20=20=20RefreshAllMaterializedViews=20recieves=20a=20boolean=20v_force=20=
flag,=20please=20set=20this=20flag=20to=20false=0A=20=20=20when=20=
calling=20it=20from=20a=20cron=20job=20in=20order=20to=20update=20the=20=
materialized=20views=20only=20when=20needed.=0A=20=20=20(This=20SP=20is=20=
called=20with=20v_force=20=3D=20true=20after=20create/upgrade=20DB)=0A=0A=
There=20are=20also=20additional=20functions=20:=0A=20=20=20=
CreateAllMaterializedViewsiIndexes=20-=20Creates=20indexes=20for=20all=20=
Snapshot=20Materialized=20views=0A=20=20=20DropMaterializedView=20-=20=
Drops=20the=20Materialized=20View=0A=20=20=20DropAllMaterializedViews=20=
-=20Drop=20all=20Materialized=20Views=0A=20=20=20=
DropAllCustomMaterializedViews=20-=20Drop=20all=20custom=20Materialized=20=
Views=0A=20=20=20UpdateMaterializedViewRefreshRate=20-=20Updates=20the=20=
Materialized=20View=20refresh=20rate=0A=20=20=20=
UpdateMaterializedViewMinRefreshRate=20-=20Updates=20the=20Materialized=20=
View=20minimal=20refresh=20rate=0A=20=20=20ActivateMaterializedView=20-=20=
activates/decativates=20a=20=20Materialized=20View=0A=20=20=20=
ActivateAllMaterializedViews=20-=20activates/decativates=20all=20=
Materialized=20Views=0A=0AIn=20addition,=20you=20can=20create=20a=20file=20=
named=20create_materialized_views.sql=20under=20=
dbscripts/upgrade/post_upgrade/custom/=0AThis=20file=20may=20include=20=
other=20custom=20materialized=20views=20settings=20and=20is=20executed=20=
by=20the=20create/upgrade=20database=20scripts.=0A=0ANOTE=20:=20=
Materialized=20Views=20are=20automatically=20refreshed=20upon=20=
create/upgrade=0A*/=0A=0A=0A=0A=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
to_interval=20(sec=20INT)=0ARETURNS=20INTERVAL=20AS=20$$=0A=0ABEGIN=0A=20=
=20=20=20RETURN=20(sec=20||=20'=20seconds')::INTERVAL;=0AEND;$$=0A=
LANGUAGE=20'plpgsql'=20IMMUTABLE=20STRICT;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20CreateMaterializedView=20(=0A=20=20=20=20v_matview=20=
NAME,=0A=20=20=20=20v_view_NAME=20NAME,=0A=20=20=20=20=
v_refresh_rate_in_sec=20INT,=0A=20=20=20=20v_custom=20BOOLEAN,=0A=20=20=20=
=20v_min_refresh_rate_in_sec=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ADECLARE=20v_entry=20materialized_views=20%=20ROWTYPE;=0A=0A=
BEGIN=0A=20=20=20=20SELECT=20*=0A=20=20=20=20INTO=20v_entry=0A=20=20=20=20=
FROM=20materialized_views=0A=20=20=20=20WHERE=20mv_name=20=3D=20=
v_matview;=0A=0A=20=20=20=20IF=20FOUND=20THEN=20RAISE=20EXCEPTION=20=
'Materialized=20view=20%=20already=20exists.',=0A=20=20=20=20=20=20=20=20=
v_matview;=0A=20=20=20=20END=20IF;=0A=20=20=20=20IF=20current_user=20!=3D=20=
usename=20FROM=20pg_database,=0A=20=20=20=20=20=20=20=20pg_user=20WHERE=20=
datdba=20=3D=20usesysid=0A=20=20=20=20=20=20=20=20AND=20datname=20=3D=20=
current_database=20THEN=20RAISE=20EXCEPTION=20'Materialized=20view=20%=20=
should=20be=20created=20with=20user=20''engine''.',=0A=20=20=20=20=20=20=20=
=20v_matview;=0A=20=20=20=20END=20IF=20;=0A=20=20=20=20EXECUTE=20'REVOKE=20=
ALL=20ON=20'=20||=20v_view_name=20||=20'=20FROM=20PUBLIC';=0A=0A=20=20=20=
=20EXECUTE=20'GRANT=20SELECT=20ON=20'=20||=20v_view_name=20||=20'=20TO=20=
PUBLIC';=0A=0A=20=20=20=20EXECUTE=20'CREATE=20TABLE=20'=20||=20v_matview=20=
||=20'=20AS=20SELECT=20*=20FROM=20'=20||=20v_view_name;=0A=0A=20=20=20=20=
EXECUTE=20'REVOKE=20ALL=20ON=20'=20||=20v_matview=20||=20'=20FROM=20=
PUBLIC';=0A=0A=20=20=20=20EXECUTE=20'GRANT=20SELECT=20ON=20'=20||=20=
v_matview=20||=20'=20TO=20PUBLIC';=0A=0A=20=20=20=20INSERT=20INTO=20=
materialized_views=20(=0A=20=20=20=20=20=20=20=20mv_name,=0A=20=20=20=20=20=
=20=20=20v_name,=0A=20=20=20=20=20=20=20=20refresh_rate_in_sec,=0A=20=20=20=
=20=20=20=20=20last_refresh,=0A=20=20=20=20=20=20=20=20custom,=0A=20=20=20=
=20=20=20=20=20min_refresh_rate_in_sec=0A=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_matview,=0A=20=20=20=20=20=20=
=20=20v_view_name,=0A=20=20=20=20=20=20=20=20v_refresh_rate_in_sec,=0A=20=
=20=20=20=20=20=20=20CURRENT_TIMESTAMP,=0A=20=20=20=20=20=20=20=20=
v_custom,=0A=20=20=20=20=20=20=20=20v_min_refresh_rate_in_sec=0A=20=20=20=
=20=20=20=20=20);=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CreateMaterializedView=20(=0A=20=20=20=20v_matview=20NAME,=0A=20=20=20=20=
v_view_name=20NAME,=0A=20=20=20=20v_refresh_rate_in_sec=20INT,=0A=20=20=20=
=20v_min_refresh_rate_in_sec=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
CreateMaterializedView(v_matview,=20v_view_name,=20=
v_refresh_rate_in_sec,=20false,=20v_min_refresh_rate_in_sec);=0A=0A=20=20=
=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CreateCustomMaterializedView=20(=0A=20=20=20=20v_matview=20NAME,=0A=20=20=
=20=20v_view_name=20NAME,=0A=20=20=20=20v_refresh_rate_in_sec=20INT,=0A=20=
=20=20=20v_min_refresh_rate_in_sec=20INT=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
CreateMaterializedView(v_matview,=20v_view_name,=20=
v_refresh_rate_in_sec,=20true,=20v_min_refresh_rate_in_sec);=0A=0A=20=20=20=
=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20CreateMaterializedView=20=
(=0A=20=20=20=20v_matview=20NAME,=0A=20=20=20=20v_view_name=20NAME,=0A=20=
=20=20=20v_refresh_rate_in_sec=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
CreateMaterializedView(v_matview,=20v_view_name,=20=
v_refresh_rate_in_sec,=20false,=200);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CreateCustomMaterializedView=20(=0A=20=20=20=20v_matview=20NAME,=0A=20=20=
=20=20v_view_name=20NAME,=0A=20=20=20=20v_refresh_rate_in_sec=20INT=0A=20=
=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
PERFORM=20CreateMaterializedView(v_matview,=20v_view_name,=20=
v_refresh_rate_in_sec,=20true,=200);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CreateMaterializedViewAs=20(=0A=20=20=20=20v_view_name=20NAME,=0A=20=20=20=
=20v_refresh_rate_in_sec=20INT,=0A=20=20=20=20v_custom=20BOOLEAN,=0A=20=20=
=20=20v_min_refesh_rate_in_sec=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ADECLARE=20v_entry=20materialized_views=20%=20ROWTYPE;=0A=
=0Av_renamed_view=20NAME;=0A=0ABEGIN=0A=20=20=20=20IF=20FOUND=20THEN=0A=20=
=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Materialized=20view=20%=20=
already=20exists.',=20v_view_name;=0A=20=20=20=20END=20IF;=0A=20=20=20=20=
v_renamed_view=20:=3D=20v_view_name=20||=20'_mt_base';=0A=0A=20=20=20=20=
EXECUTE=20'ALTER=20VIEW=20'=20||=20v_view_name=20||=20'=20RENAME=20TO=20=
'=20||=20v_renamed_view;=0A=0A=20=20=20=20perform=20=
CreateMaterializedView(v_view_name,=20v_renamed_view,=20=
v_refresh_rate_in_sec,=20v_custom,=20v_min_refesh_rate_in_sec);=0A=0A=20=20=
=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20CreateMaterializedViewAs=20=
(=0A=20=20=20=20v_view_name=20NAME,=0A=20=20=20=20v_refresh_rate_in_sec=20=
INT,=0A=20=20=20=20v_min_refesh_rate_in_sec=20INT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
CreateMaterializedViewAs(v_view_name,=20v_refresh_rate_in_sec,=20false,=20=
v_min_refesh_rate_in_sec);=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CreateCustomMaterializedViewAs=20(=0A=20=20=20=20v_view_name=20NAME,=0A=20=
=20=20=20v_refresh_rate_in_sec=20INT,=0A=20=20=20=20=
v_min_refesh_rate_in_sec=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
CreateMaterializedViewAs(v_view_name,=20v_refresh_rate_in_sec,=20true,=20=
v_min_refesh_rate_in_sec);=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CreateMaterializedViewAs=20(=0A=20=20=20=20v_view_name=20NAME,=0A=20=20=20=
=20v_refresh_rate_in_sec=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
CreateMaterializedViewAs(v_view_name,=20v_refresh_rate_in_sec,=20false,=20=
0);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20CreateCustomMaterializedViewAs=20(=0A=20=20=20=20=
v_view_name=20NAME,=0A=20=20=20=20v_refresh_rate_in_sec=20INT=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
CreateMaterializedViewAs(v_view_name,=20v_refresh_rate_in_sec,=20true,=20=
0);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DropMaterializedView=20(v_matview=20NAME)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_entry=20materialized_views=20%=20=
ROWTYPE;=0A=0ABEGIN=0A=20=20=20=20SELECT=20*=0A=20=20=20=20INTO=20=
v_entry=0A=20=20=20=20FROM=20materialized_views=0A=20=20=20=20WHERE=20=
mv_name=20=3D=20v_matview;=0A=0A=20=20=20=20IF=20NOT=20FOUND=20THEN=0A=20=
=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Materialized=20view=20%=20does=20=
not=20exist.',=20v_matview;=0A=20=20=20=20END=20IF;=0A=20=20=20=20=
EXECUTE=20'DROP=20TABLE=20'=20||=20v_matview=20||=20'=20CASCADE';=0A=0A=20=
=20=20=20DELETE=0A=20=20=20=20FROM=20materialized_views=0A=20=20=20=20=
WHERE=20mv_name=20=3D=20v_matview;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DropAllMaterializedViews=20()=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v_cur=20CURSOR=0AFOR=0ASELECT=20*=0AFROM=20=
materialized_views;=0A=0Av_record=20materialized_views=20%=20ROWTYPE;=0A=0A=
BEGIN=0A=20=20=20=20OPEN=20v_cur;=0A=0A=20=20=20=20--=20loop=20on=20all=20=
entries=20in=20materialized_views=0A=20=20=20=20LOOP=0A=0A=20=20=20=20=
FETCH=20v_cur=0A=20=20=20=20INTO=20v_record;=0A=0A=20=20=20=20EXIT=20=
WHEN=20NOT=20FOUND;=0A=0A=20=20=20=20perform=20=
DropMaterializedView(v_record.mv_name);=0A=20=20=20=20END=20LOOP;=0A=0A=
CLOSE=20v_cur;END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DropAllCustomMaterializedViews=20()=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
DECLARE=20v_cur=20CURSOR=0AFOR=0ASELECT=20*=0AFROM=20materialized_views=0A=
WHERE=20custom;=0A=0Av_record=20materialized_views=20%=20ROWTYPE;=0A=0A=
BEGIN=0A=20=20=20=20OPEN=20v_cur;=0A=0A=20=20=20=20--=20loop=20on=20all=20=
entries=20in=20materialized_views=0A=20=20=20=20LOOP=0A=0A=20=20=20=20=
FETCH=20v_cur=0A=20=20=20=20INTO=20v_record;=0A=0A=20=20=20=20EXIT=20=
WHEN=20NOT=20FOUND;=0A=0A=20=20=20=20perform=20=
DropMaterializedView(v_record.mv_name);=0A=20=20=20=20END=20LOOP;=0A=0A=0A=
CLOSE=20v_cur;END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
IsMaterializedViewRefreshed=20(v_matview=20NAME)=0ARETURNS=20boolean=20=
STABLE=20AS=20$PROCEDURE$=0ADECLARE=20v_entry=20materialized_views=20%=20=
ROWTYPE;=0A=0Av_is_refreshed=20boolean;=0A=0ABEGIN=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20INTO=20v_entry=0A=20=20=20=20FROM=20materialized_views=0A=
=20=20=20=20WHERE=20mv_name=20=3D=20v_matview;=0A=0A=20=20=20=20IF=20NOT=20=
FOUND=20THEN=20RAISE=20EXCEPTION=20'Materialized=20view=20%=20does=20not=20=
exist.',=0A=20=20=20=20=20=20=20=20v_matview;=0A=20=20=20=20END=20IF;=0A=20=
=20=20=20--=20check=20if=20materialized=20View=20should=20refresh=0A=20=20=
=20=20v_is_refreshed=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
((CURRENT_TIMESTAMP=20-=20to_interval(refresh_rate_in_sec))=20<=3D=20=
last_refresh)=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
((CURRENT_TIMESTAMP=20-=20to_interval(min_refresh_rate_in_sec))=20<=3D=20=
last_refresh)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=
=20=20OR=20NOT=20active=0A=20=20=20=20FROM=20materialized_views=0A=20=20=20=
=20WHERE=20mv_name=20=3D=20v_matview;=0A=0A=20=20=20=20RETURN=20=
v_is_refreshed;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20RefreshMaterializedView=20=
(v_matview=20NAME)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20=
v_entry=20materialized_views=20%=20ROWTYPE;=0A=0Av_drop_index_sp=20NAME;=0A=
=0Av_create_index_sp=20NAME;=0A=0Av_start_time=20TIMESTAMP=0AWITH=20TIME=20=
ZONE;=0A=0Av_avg_cost_ms=20INT;=0A=0ABEGIN=0A=20=20=20=20SELECT=20*=0A=20=
=20=20=20INTO=20v_entry=0A=20=20=20=20FROM=20materialized_views=0A=20=20=20=
=20WHERE=20mv_name=20=3D=20v_matview;=0A=0A=20=20=20=20IF=20NOT=20FOUND=20=
THEN=0A=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Materialized=20view=20=
%=20does=20not=20exist.',=20v_matview;=0A=20=20=20=20END=20IF;=0A=20=20=20=
=20--=20get=20start=20time=0A=20=20=20=20v_start_time:=3D=20=
CURRENT_TIMESTAMP;=0A=0A=20=20=20=20--=20SP=20for=20Drop=20/=20create=20=
Index=20should=20follow=20naming=20convention=20=
Mt[Drop|Create]<v_matview>Indexes=0A=20=20=20=20v_drop_index_sp=20:=3D=20=
'MtDrop'=20||=20v_matview=20||=20'Indexes';=0A=0A=20=20=20=20=
v_create_index_sp=20:=3D=20'MtCreate'=20||=20v_matview=20||=20'Indexes';=0A=
=0A=20=20=20=20IF=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.routines=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
routine_name=20ilike=20v_drop_index_sp=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=20THEN=20v_drop_index_sp=20:=3D=20NULL;=0A=20=20=20=20END=20IF;=0A=20=
=20=20=20IF=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.routines=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
routine_name=20ilike=20v_create_index_sp=0A=20=20=20=20=20=20=20=20=20=20=
=20=20)=20THEN=20v_create_index_sp=20:=3D=20NULL;=0A=20=20=20=20END=20=
IF;=0A=20=20=20=20--=20Lock=20materialized_views=20table=20until=20=
refresh=20completes=20to=20prevent=20duplicate=20refreshes=20by=20other=20=
threads=0A=20=20=20=20LOCK=20TABLE=20materialized_views;=0A=0A=20=20=20=20=
--=20taking=20a=20lock=20on=20the=20snapshot=20materialized=20view=20=
until=20it=20refreshed=0A=20=20=20=20EXECUTE=20'LOCK=20TABLE=20'=20||=20=
v_matview;=0A=0A=20=20=20=20--=20drop=20indexes=20on=20the=20snapshot=20=
materialized=20view=20if=20exists=0A=20=20=20=20IF=20(v_drop_index_sp=20=
IS=20NOT=20NULL)=20THEN=0A=20=20=20=20=20=20=20=20EXECUTE=20'select=20'=20=
||=20v_drop_index_sp=20||=20'()';=0A=20=20=20=20END=20IF;=0A=0A=20=20=20=20=
--=20refresh=20the=20view=0A=20=20=20=20EXECUTE=20'TRUNCATE=20TABLE=20'=20=
||=20v_matview;=0A=0A=20=20=20=20EXECUTE=20'INSERT=20INTO=20'=20||=20=
v_matview=20||=20'=20SELECT=20*=20FROM=20'=20||=20v_entry.v_name;=0A=0A=20=
=20=20=20--=20restore=20=20indexes=20on=20the=20snapshot=20materialized=20=
view=20if=20exists=0A=20=20=20=20IF=20(v_create_index_sp=20IS=20NOT=20=
NULL)=20THEN=0A=20=20=20=20=20=20=20=20EXECUTE=20'select=20'=20||=20=
v_create_index_sp=20||=20'()';=0A=20=20=20=20END=20IF;=0A=0A=20=20=20=20=
--=20update=20last=20refresh=20time=20and=20average=20cost=20in=20[ms]=0A=
=20=20=20=20IF=20(v_entry.avg_cost_ms=20=3D=200)=20THEN=0A=20=20=20=20=20=
=20=20=20v_avg_cost_ms:=3D=20EXTRACT(EPOCH=20FROM=20current_timestamp=20=
-=20v_start_time)=20*=201000;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=
v_avg_cost_ms:=3D=20((EXTRACT(EPOCH=20FROM=20current_timestamp=20-=20=
v_start_time)=20*=201000)=20+=20v_entry.avg_cost_ms)=20/=202;=0A=20=20=20=
=20END=20IF;=0A=0A=20=20=20=20UPDATE=20materialized_views=0A=20=20=20=20=
SET=20last_refresh=20=3D=20CURRENT_TIMESTAMP,=0A=20=20=20=20=20=20=20=20=
avg_cost_ms=20=3D=20v_avg_cost_ms=0A=20=20=20=20WHERE=20mv_name=20=3D=20=
v_matview;=0A=0ARETURN;END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
RefreshAllMaterializedViews=20(v_force=20boolean)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v_cur=20CURSOR=0AFOR=0ASELECT=20*=0AFROM=20=
materialized_views;=0A=0Av_record=20materialized_views=20%=20ROWTYPE;=0A=0A=
BEGIN=0A=20=20=20=20OPEN=20v_cur;=0A=0A=20=20=20=20--=20loop=20on=20all=20=
entries=20in=20materialized_views=20and=20refresh=20only=20needed=20=
snapshots=0A=20=20=20=20LOOP=0A=0A=20=20=20=20FETCH=20v_cur=0A=20=20=20=20=
INTO=20v_record;=0A=0A=20=20=20=20EXIT=20WHEN=20NOT=20FOUND;=0A=0A=20=20=20=
=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20v_force=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20v_record.min_refresh_rate_in_sec=20=3D=200=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=
=20OR=20NOT=20IsMaterializedViewRefreshed(v_record.mv_name)=0A=20=20=20=20=
=20=20=20=20=20=20=20=20)=20THEN=20perform=20=
RefreshMaterializedView(v_record.mv_name);=0A=20=20=20=20END=20IF;=0A=20=20=
=20=20END=20LOOP;=0A=0A=20=20=20=20CLOSE=20v_cur;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CreateAllMaterializedViewsiIndexes=20()=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v_cur=20CURSOR=0AFOR=0ASELECT=20*=0AFROM=20=
materialized_views;=0A=0Av_record=20materialized_views=20%=20ROWTYPE;=0A=0A=
v_create_index_sp=20NAME;=0A=0ABEGIN=0A=20=20=20=20OPEN=20v_cur;=0A=0A=20=
=20=20=20--=20loop=20on=20all=20entries=20in=20materialized_views=20and=20=
create=20indexes(if=20defined)=0A=20=20=20=20LOOP=0A=0A=20=20=20=20FETCH=20=
v_cur=0A=20=20=20=20INTO=20v_record;=0A=0A=20=20=20=20EXIT=20WHEN=20NOT=20=
FOUND;=0A=0A=20=20=20=20v_create_index_sp=20:=3D=20'MtCreate'=20||=20=
v_record.mv_name=20||=20'Indexes';=0A=0A=20=20=20=20--=20Check=20if=20SP=20=
that=20creates=20the=20indexes=20exists=0A=20=20=20=20IF=20NOT=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20information_schema.routines=0A=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20routine_name=20ilike=20v_create_index_sp=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=20THEN=20v_create_index_sp=20:=3D=20NULL;=0A=
=20=20=20=20END=20IF;=0A=20=20=20=20IF=20(v_create_index_sp=20IS=20NOT=20=
NULL)=20THEN=0A=20=20=20=20=20=20=20=20EXECUTE=20'select=20'=20||=20=
v_create_index_sp=20||=20'()';=0A=20=20=20=20END=20IF;=0A=0A=20=20=20=20=
END=20LOOP;=0A=0ACLOSE=20v_cur;END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateMaterializedViewRefreshRate=20(=0A=20=20=20=20v_matview=20NAME,=0A=20=
=20=20=20v_refresh_rate=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ADECLARE=20v_entry=20materialized_views=20%=20ROWTYPE;=0A=0A=
BEGIN=0A=20=20=20=20SELECT=20*=0A=20=20=20=20INTO=20v_entry=0A=20=20=20=20=
FROM=20materialized_views=0A=20=20=20=20WHERE=20mv_name=20=3D=20=
v_matview;=0A=0A=20=20=20=20IF=20NOT=20FOUND=20THEN=20RAISE=20EXCEPTION=20=
'Materialized=20view=20%=20does=20not=20exist.',=0A=20=20=20=20=20=20=20=20=
v_matview;=0A=20=20=20=20END=20IF;=0A=20=20=20=20UPDATE=20=
materialized_views=0A=20=20=20=20SET=20refresh_rate_in_sec=20=3D=20=
v_refresh_rate=0A=20=20=20=20WHERE=20mv_name=20=3D=20v_matview;=0A=0A=20=20=
=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateMaterializedViewMinRefreshRate=20(=0A=20=20=20=20v_matview=20NAME,=0A=
=20=20=20=20v_min_refresh_rate=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ADECLARE=20v_entry=20materialized_views=20%=20ROWTYPE;=0A=
=0ABEGIN=0A=20=20=20=20SELECT=20*=0A=20=20=20=20INTO=20v_entry=0A=20=20=20=
=20FROM=20materialized_views=0A=20=20=20=20WHERE=20mv_name=20=3D=20=
v_matview;=0A=0A=20=20=20=20IF=20NOT=20FOUND=20THEN=20RAISE=20EXCEPTION=20=
'Materialized=20view=20%=20does=20not=20exist.',=0A=20=20=20=20=20=20=20=20=
v_matview;=0A=20=20=20=20END=20IF;=0A=20=20=20=20UPDATE=20=
materialized_views=0A=20=20=20=20SET=20min_refresh_rate_in_sec=20=3D=20=
v_min_refresh_rate=0A=20=20=20=20WHERE=20mv_name=20=3D=20v_matview;=0A=0A=
=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20ActivateMaterializedView=20=
(=0A=20=20=20=20v_matview=20NAME,=0A=20=20=20=20v_active=20BOOLEAN=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_entry=20=
materialized_views=20%=20ROWTYPE;=0A=0ABEGIN=0A=20=20=20=20SELECT=20*=0A=20=
=20=20=20INTO=20v_entry=0A=20=20=20=20FROM=20materialized_views=0A=20=20=20=
=20WHERE=20mv_name=20=3D=20v_matview;=0A=0A=20=20=20=20IF=20NOT=20FOUND=20=
THEN=20RAISE=20EXCEPTION=20'Materialized=20view=20%=20does=20not=20=
exist.',=0A=20=20=20=20=20=20=20=20v_matview;=0A=20=20=20=20END=20IF;=0A=20=
=20=20=20UPDATE=20materialized_views=0A=20=20=20=20SET=20active=20=3D=20=
v_active=0A=20=20=20=20WHERE=20mv_name=20=3D=20v_matview;=0A=0A=20=20=20=20=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
ActivateAllMaterializedViews=20(v_active=20BOOLEAN)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ADECLARE=20v_entry=20materialized_views=20%=20ROWTYPE;=0A=
=0ABEGIN=0A=20=20=20=20UPDATE=20materialized_views=0A=20=20=20=20SET=20=
active=20=3D=20v_active;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0Aselect=20DropAllMaterializedViews();=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
copy=20(=0A=09=09select=20version=0A=09=09from=20schema_version=0A=09=09=
where=20current=20=3D=20true=0A=09=09order=20by=20id=0A=09=09LIMIT=201=0A=
=09)=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(=0A=09=09=09select=20max(id)=0A=09=09=09from=20schema_version=0A=09=09=09=
where=20state=20in=20('INSTALLED','SKIPPED')=0A=09=09)=20to=20stdout=20=
with=20delimiter=20as=20'|';=0A**************************=0A=0A*********=20=
QUERY=20**********=0A=0A=09=09update=20schema_version=0A=09=09set=20=
current=3D(id=3D437);=0A=09=0A**************************=0A=0AUPDATE=20=
437=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
domains_with_unregistered_entities_view=20AS=0ASELECT=20=
storage_domain_id=0AFROM=20unregistered_ovf_of_entities=0AUNION=0ASELECT=20=
storage_domain_id=0AFROM=20unregistered_disks;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20storage_domain_shared_status=20=
AS=0ASELECT=20storage_id,=0A=20=20=20=20CASE=20WHEN=20COUNT(CASE=20=
status=20WHEN=203=20THEN=201=20END)=20>=200=0A=20=20=20=20=20=20=20=20=
THEN=20CASE=20WHEN=20COUNT(DISTINCT=20status)=20>=201=20THEN=203=20ELSE=20=
1=20END=0A=20=20=20=20=20=20=20=20ELSE=202=0A=20=20=20=20END=20AS=20=
status=0AFROM=20storage_pool_iso_map=0AGROUP=20BY=20storage_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20vms_for_disk_view=20AS=0A=
SELECT=20array_agg(vm_name)=20AS=20array_vm_names,=0A=20=20=20=20=
device_id,=0A=20=20=20=20entity_type,=0A=20=20=20=20=
array_agg(template_version_name)=20AS=20array_template_version_name=0A=
FROM=20vm_static=0AINNER=20JOIN=20vm_device=0A=20=20=20=20ON=20=
vm_static.vm_guid=20=3D=20vm_device.vm_id=0AWHERE=20device=20=3D=20=
'disk'=0AGROUP=20BY=20device_id,=0A=20=20=20=20entity_type;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
memory_and_disk_images_storage_domain_view=20AS=0ASELECT=20=
images.image_guid=20AS=20image_guid,=0A=20=20=20=20=
storage_domain_static.storage_name=20AS=20storage_name,=0A=20=20=20=20=
storage_pool_iso_map.storage_pool_id=20AS=20storage_pool_id,=0A=20=20=20=20=
storage_domain_static.storage_type=20AS=20storage_type,=0A=20=20=20=20=
images.creation_date=20AS=20creation_date,=0A=20=20=20=20images.size=20=
AS=20size,=0A=20=20=20=20images.it_guid=20AS=20it_guid,=0A=20=20=20=20=
snapshots.description=20AS=20description,=0A=20=20=20=20images.ParentId=20=
AS=20ParentId,=0A=20=20=20=20images.lastModified=20AS=20lastModified,=0A=20=
=20=20=20snapshots.app_list=20AS=20app_list,=0A=20=20=20=20=
image_storage_domain_map.storage_domain_id=20AS=20storage_id,=0A=20=20=20=
=20images.vm_snapshot_id=20AS=20vm_snapshot_id,=0A=20=20=20=20=
images.volume_type=20AS=20volume_type,=0A=20=20=20=20=
images.volume_format=20AS=20volume_format,=0A=20=20=20=20=
images.imageStatus=20AS=20imageStatus,=0A=20=20=20=20=
images.image_group_id=20AS=20image_group_id,=0A=20=20=20=20=
images.active,=0A=20=20=20=20images.volume_classification,=0A=20=20=20=20=
vms_for_disk_view.entity_type=20AS=20entity_type,=0A=20=20=20=20=
array_to_string(vms_for_disk_view.array_vm_names,=20',')=20AS=20=
vm_names,=0A=20=20=20=20=
COALESCE(array_upper(vms_for_disk_view.array_vm_names,=201),=200)=20AS=20=
number_of_vms,=0A=20=20=20=20=
array_to_string(vms_for_disk_view.array_template_version_name,=20',')=20=
AS=20template_version_names,=0A=20=20=20=20base_disks.disk_id,=0A=20=20=20=
=20base_disks.disk_alias=20AS=20disk_alias,=0A=20=20=20=20=
base_disks.disk_description=20AS=20disk_description,=0A=20=20=20=20=
base_disks.shareable=20AS=20shareable,=0A=20=20=20=20=
base_disks.wipe_after_delete=20AS=20wipe_after_delete,=0A=20=20=20=20=
base_disks.propagate_errors,=0A=20=20=20=20base_disks.sgio=20AS=20sgio,=0A=
=20=20=20=20image_storage_domain_map.quota_id=20AS=20quota_id,=0A=20=20=20=
=20quota.quota_name=20AS=20quota_name,=0A=20=20=20=20=
storage_pool.quota_enforcement_type,=0A=20=20=20=20=
image_storage_domain_map.disk_profile_id=20AS=20disk_profile_id,=0A=20=20=
=20=20disk_profiles.name=20AS=20disk_profile_name,=0A=20=20=20=20=
disk_image_dynamic.actual_size=20AS=20actual_size,=0A=20=20=20=20=
disk_image_dynamic.read_rate=20AS=20read_rate,=0A=20=20=20=20=
disk_image_dynamic.write_rate=20AS=20write_rate,=0A=20=20=20=20=
disk_image_dynamic.read_latency_seconds=20AS=20read_latency_seconds,=0A=20=
=20=20=20disk_image_dynamic.write_latency_seconds=20AS=20=
write_latency_seconds,=0A=20=20=20=20=
disk_image_dynamic.flush_latency_seconds=20AS=20flush_latency_seconds,=0A=
=20=20=20=20base_disks.alignment=20AS=20alignment,=0A=20=20=20=20=
base_disks.disk_storage_type=20AS=20disk_storage_type,=0A=20=20=20=20=
base_disks.cinder_volume_type=20AS=20cinder_volume_type,=0A=20=20=20=20=
base_disks.last_alignment_scan=20AS=20last_alignment_scan,=0A=20=20=20=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=
FROM=20storage_domains_ovf_info=0A=20=20=20=20=20=20=20=20WHERE=20=
images.image_group_id=20=3D=20storage_domains_ovf_info.ovf_disk_id=0A=20=20=
=20=20=20=20=20=20)=20AS=20ovf_store,=0A=20=20=20=20EXISTS=20(=0A=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20FROM=20snapshots=0A=20=
=20=20=20=20=20=20=20WHERE=20images.image_group_id=20IN=20(=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20snapshots.memory_metadata_disk_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
snapshots.memory_dump_disk_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20)=20AS=20memory_image,=0A=20=20=20=20=
image_transfers.phase=20AS=20image_transfer_phase,=0A=20=20=20=20=
image_transfers.bytes_sent=20AS=20image_transfer_bytes_sent,=0A=20=20=20=20=
image_transfers.bytes_total=20AS=20image_transfer_bytes_total=0AFROM=20=
images=0ALEFT=20JOIN=20disk_image_dynamic=0A=20=20=20=20ON=20=
images.image_guid=20=3D=20disk_image_dynamic.image_id=0ALEFT=20JOIN=20=
base_disks=0A=20=20=20=20ON=20images.image_group_id=20=3D=20=
base_disks.disk_id=0ALEFT=20JOIN=20vms_for_disk_view=0A=20=20=20=20ON=20=
vms_for_disk_view.device_id=20=3D=20images.image_group_id=0ALEFT=20JOIN=20=
image_storage_domain_map=0A=20=20=20=20ON=20=
image_storage_domain_map.image_id=20=3D=20images.image_guid=0ALEFT=20=
JOIN=20storage_domain_static=0A=20=20=20=20ON=20=
image_storage_domain_map.storage_domain_id=20=3D=20=
storage_domain_static.id=0ALEFT=20JOIN=20snapshots=0A=20=20=20=20ON=20=
images.vm_snapshot_id=20=3D=20snapshots.snapshot_id=0ALEFT=20JOIN=20=
quota=0A=20=20=20=20ON=20image_storage_domain_map.quota_id=20=3D=20=
quota.id=0ALEFT=20JOIN=20disk_profiles=0A=20=20=20=20ON=20=
image_storage_domain_map.disk_profile_id=20=3D=20disk_profiles.id=0ALEFT=20=
JOIN=20storage_pool_iso_map=0A=20=20=20=20ON=20=
storage_pool_iso_map.storage_id=20=3D=20storage_domain_static.id=0ALEFT=20=
JOIN=20storage_pool=0A=20=20=20=20ON=20storage_pool.id=20=3D=20=
storage_pool_iso_map.storage_pool_id=0ALEFT=20JOIN=20image_transfers=0A=20=
=20=20=20ON=20images.image_group_id=20=3D=20image_transfers.disk_id=0A=
WHERE=20images.image_guid=20!=3D=20=
'00000000-0000-0000-0000-000000000000';=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20images_storage_domain_view=20AS=20=0ASELECT=20*=0AFROM=20=
memory_and_disk_images_storage_domain_view=0AWHERE=20memory_image=20=3D=20=
FALSE;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
storage_domain_file_repos=20AS=0ASELECT=20storage_domain_static.id=20AS=20=
storage_domain_id,=0A=20=20=20=20=
storage_domain_static.storage_domain_type=20AS=20storage_domain_type,=0A=20=
=20=20=20storage_pool_iso_map.storage_pool_id=20AS=20storage_pool_id,=0A=20=
=20=20=20storage_pool_iso_map.status=20AS=20storage_domain_status,=0A=20=20=
=20=20repo_file_meta_data.repo_image_id=20AS=20repo_image_id,=0A=20=20=20=
=20repo_file_meta_data.size=20AS=20size,=0A=20=20=20=20=
repo_file_meta_data.date_created=20AS=20date_created,=0A=20=20=20=20=
repo_file_meta_data.last_refreshed=20AS=20last_refreshed,=0A=20=20=20=20=
repo_file_meta_data.file_type=20AS=20file_type,=0A=20=20=20=20=
vds_dynamic.status=20AS=20vds_status,=0A=20=20=20=20storage_pool.status=20=
AS=20storage_pool_status=0AFROM=20storage_domain_static=0AINNER=20JOIN=20=
storage_pool_iso_map=0A=20=20=20=20ON=20storage_domain_static.id=20=3D=20=
storage_pool_iso_map.storage_id=0AINNER=20JOIN=20storage_pool=0A=20=20=20=
=20ON=20storage_pool.id=20=3D=20storage_pool_iso_map.storage_pool_id=0A=
INNER=20JOIN=20vds_dynamic=0A=20=20=20=20ON=20vds_dynamic.vds_id=20=3D=20=
storage_pool.spm_vds_id=0ALEFT=20JOIN=20repo_file_meta_data=0A=20=20=20=20=
ON=20storage_pool_iso_map.storage_id=20=3D=20=
repo_file_meta_data.repo_domain_id;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20storage_for_image_view=20AS=0ASELECT=20images.image_guid=20AS=20=
image_id,=0A=20=20=20=20=
array_to_string(array_agg(storage_domain_static.id),=20',')=20=
storage_id,=0A=20=20=20=20=
array_to_string(array_agg(storage_domain_static.storage_type),=20',')=20=
storage_type,=0A=20=20=20=20=
array_to_string(array_agg(storage_domain_static.storage_name),=20',')=20=
AS=20storage_name,=0A=20=20=20=20=
array_to_string(array_agg(COALESCE(CAST(quota.id=20AS=20VARCHAR),=20=
'')),=20',')=20AS=20quota_id,=0A=20=20=20=20=
array_to_string(array_agg(COALESCE(quota.quota_name,=20'')),=20',')=20AS=20=
quota_name,=0A=20=20=20=20=
array_to_string(array_agg(COALESCE(CAST(disk_profiles.id=20AS=20=
VARCHAR),=20'')),=20',')=20AS=20disk_profile_id,=0A=20=20=20=20=
array_to_string(array_agg(COALESCE(disk_profiles.name,=20'')),=20',')=20=
AS=20disk_profile_name=0AFROM=20images=0ALEFT=20JOIN=20=
image_storage_domain_map=0A=20=20=20=20ON=20=
image_storage_domain_map.image_id=20=3D=20images.image_guid=0ALEFT=20=
JOIN=20storage_domain_static=0A=20=20=20=20ON=20=
image_storage_domain_map.storage_domain_id=20=3D=20=
storage_domain_static.id=0ALEFT=20JOIN=20quota=0A=20=20=20=20ON=20=
image_storage_domain_map.quota_id=20=3D=20quota.id=0ALEFT=20JOIN=20=
disk_profiles=0A=20=20=20=20ON=20=
image_storage_domain_map.disk_profile_id=20=3D=20disk_profiles.id=0A=
GROUP=20BY=20images.image_guid;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
vm_images_view=20AS=0ASELECT=20storage_for_image_view.storage_id=20AS=20=
storage_id,=0A=20=20=20=20storage_for_image_view.storage_name=20AS=20=
storage_name,=0A=20=20=20=20storage_for_image_view.storage_type,=0A=20=20=
=20=20images_storage_domain_view.storage_pool_id=20AS=20storage_pool_id,=0A=
=20=20=20=20images_storage_domain_view.image_guid=20AS=20image_guid,=0A=20=
=20=20=20images_storage_domain_view.creation_date=20AS=20creation_date,=0A=
=20=20=20=20disk_image_dynamic.actual_size=20AS=20actual_size,=0A=20=20=20=
=20disk_image_dynamic.read_rate=20AS=20read_rate,=0A=20=20=20=20=
disk_image_dynamic.read_latency_seconds=20AS=20read_latency_seconds,=0A=20=
=20=20=20disk_image_dynamic.write_latency_seconds=20AS=20=
write_latency_seconds,=0A=20=20=20=20=
disk_image_dynamic.flush_latency_seconds=20AS=20flush_latency_seconds,=0A=
=20=20=20=20disk_image_dynamic.write_rate=20AS=20write_rate,=0A=20=20=20=20=
images_storage_domain_view.size=20AS=20size,=0A=20=20=20=20=
images_storage_domain_view.it_guid=20AS=20it_guid,=0A=20=20=20=20=
images_storage_domain_view.description=20AS=20description,=0A=20=20=20=20=
images_storage_domain_view.ParentId=20AS=20ParentId,=0A=20=20=20=20=
images_storage_domain_view.imageStatus=20AS=20imageStatus,=0A=20=20=20=20=
images_storage_domain_view.lastModified=20AS=20lastModified,=0A=20=20=20=20=
images_storage_domain_view.app_list=20AS=20app_list,=0A=20=20=20=20=
images_storage_domain_view.vm_snapshot_id=20AS=20vm_snapshot_id,=0A=20=20=
=20=20images_storage_domain_view.volume_type=20AS=20volume_type,=0A=20=20=
=20=20images_storage_domain_view.image_group_id=20AS=20image_group_id,=0A=
=20=20=20=20images_storage_domain_view.active=20AS=20active,=0A=20=20=20=20=
images_storage_domain_view.volume_classification=20AS=20=
volume_classification,=0A=20=20=20=20=
images_storage_domain_view.volume_format=20AS=20volume_format,=0A=20=20=20=
=20images_storage_domain_view.wipe_after_delete=20AS=20=
wipe_after_delete,=0A=20=20=20=20=
images_storage_domain_view.propagate_errors=20AS=20propagate_errors,=0A=20=
=20=20=20images_storage_domain_view.sgio=20AS=20sgio,=0A=20=20=20=20=
images_storage_domain_view.entity_type=20AS=20entity_type,=0A=20=20=20=20=
images_storage_domain_view.number_of_vms=20AS=20number_of_vms,=0A=20=20=20=
=20images_storage_domain_view.vm_names=20AS=20vm_names,=0A=20=20=20=20=
images_storage_domain_view.template_version_names=20AS=20=
template_version_names,=0A=20=20=20=20storage_for_image_view.quota_id=20=
AS=20quota_id,=0A=20=20=20=20storage_for_image_view.quota_name=20AS=20=
quota_name,=0A=20=20=20=20=
images_storage_domain_view.quota_enforcement_type,=0A=20=20=20=20=
storage_for_image_view.disk_profile_id=20AS=20disk_profile_id,=0A=20=20=20=
=20storage_for_image_view.disk_profile_name=20AS=20disk_profile_name,=0A=20=
=20=20=20images_storage_domain_view.disk_id,=0A=20=20=20=20=
images_storage_domain_view.disk_alias=20AS=20disk_alias,=0A=20=20=20=20=
images_storage_domain_view.disk_description=20AS=20disk_description,=0A=20=
=20=20=20images_storage_domain_view.shareable=20AS=20shareable,=0A=20=20=20=
=20images_storage_domain_view.alignment=20AS=20alignment,=0A=20=20=20=20=
images_storage_domain_view.last_alignment_scan=20AS=20=
last_alignment_scan,=0A=20=20=20=20images_storage_domain_view.ovf_store=20=
AS=20ovf_store,=0A=20=20=20=20=
images_storage_domain_view.image_transfer_phase=20AS=20=
image_transfer_phase,=0A=20=20=20=20=
images_storage_domain_view.image_transfer_bytes_sent=20AS=20=
image_transfer_bytes_sent,=0A=20=20=20=20=
images_storage_domain_view.image_transfer_bytes_total=20AS=20=
image_transfer_bytes_total,=0A=20=20=20=20=
images_storage_domain_view.disk_storage_type=20AS=20disk_storage_type,=0A=
=20=20=20=20images_storage_domain_view.cinder_volume_type=20AS=20=
cinder_volume_type=0AFROM=20images_storage_domain_view=0AINNER=20JOIN=20=
disk_image_dynamic=0A=20=20=20=20ON=20=
images_storage_domain_view.image_guid=20=3D=20=
disk_image_dynamic.image_id=0AINNER=20JOIN=20storage_for_image_view=0A=20=
=20=20=20ON=20images_storage_domain_view.image_guid=20=3D=20=
storage_for_image_view.image_id=0AWHERE=20=
images_storage_domain_view.active=20=3D=20TRUE;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
all_disks_including_snapshots=20AS=0ASELECT=20storage_impl.*,=0A=20=20=20=
=20bd.disk_id,=0A=20=20=20=20=0A=20=20=20=20bd.wipe_after_delete,=0A=20=20=
=20=20bd.propagate_errors,=0A=20=20=20=20bd.disk_alias,=0A=20=20=20=20=
bd.disk_description,=0A=20=20=20=20bd.shareable,=0A=20=20=20=20bd.sgio,=0A=
=20=20=20=20bd.alignment,=0A=20=20=20=20bd.last_alignment_scan,=0A=20=20=20=
=20bd.disk_storage_type,=0A=20=20=20=20bd.cinder_volume_type=0AFROM=20(=0A=
=20=20=20=20SELECT=20storage_for_image_view.storage_id=20AS=20=
storage_id,=0A=20=20=20=20=20=20=20=20=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.storage_name=20AS=20storage_name,=0A=20=20=20=20=20=
=20=20=20storage_for_image_view.storage_type=20AS=20storage_type,=0A=20=20=
=20=20=20=20=20=20storage_pool_id,=0A=20=20=20=20=20=20=20=20image_guid,=0A=
=20=20=20=20=20=20=20=20=0A=20=20=20=20=20=20=20=20creation_date,=0A=20=20=
=20=20=20=20=20=20actual_size,=0A=20=20=20=20=20=20=20=20read_rate,=0A=20=
=20=20=20=20=20=20=20write_rate,=0A=20=20=20=20=20=20=20=20=
read_latency_seconds,=0A=20=20=20=20=20=20=20=20write_latency_seconds,=0A=
=20=20=20=20=20=20=20=20flush_latency_seconds,=0A=20=20=20=20=20=20=20=20=
size,=0A=20=20=20=20=20=20=20=20it_guid,=0A=20=20=20=20=20=20=20=20=
imageStatus,=0A=20=20=20=20=20=20=20=20lastModified,=0A=20=20=20=20=20=20=
=20=20volume_type,=0A=20=20=20=20=20=20=20=20volume_format,=0A=20=20=20=20=
=20=20=20=20image_group_id,=0A=20=20=20=20=20=20=20=20description,=0A=20=20=
=20=20=20=20=20=20=0A=20=20=20=20=20=20=20=20ParentId,=0A=20=20=20=20=20=20=
=20=20app_list,=0A=20=20=20=20=20=20=20=20vm_snapshot_id,=0A=20=20=20=20=20=
=20=20=20active,=0A=20=20=20=20=20=20=20=20volume_classification,=0A=20=20=
=20=20=20=20=20=20entity_type,=0A=20=20=20=20=20=20=20=20number_of_vms,=0A=
=20=20=20=20=20=20=20=20vm_names,=0A=20=20=20=20=20=20=20=20=
template_version_names,=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.quota_id=20AS=20quota_id,=0A=20=20=20=20=20=20=20=20=
=0A=20=20=20=20=20=20=20=20storage_for_image_view.quota_name=20AS=20=
quota_name,=0A=20=20=20=20=20=20=20=20quota_enforcement_type,=0A=20=20=20=
=20=20=20=20=20ovf_store,=0A=20=20=20=20=20=20=20=20=
image_transfer_phase,=0A=20=20=20=20=20=20=20=20=
image_transfer_bytes_sent,=0A=20=20=20=20=20=20=20=20=
image_transfer_bytes_total,=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.disk_profile_id=20AS=20disk_profile_id,=0A=20=20=20=
=20=20=20=20=20=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.disk_profile_name=20AS=20disk_profile_name,=0A=20=20=
=20=20=20=20=20=20NULL=20AS=20lun_id,=0A=20=20=20=20=20=20=20=20=0A=20=20=
=20=20=20=20=20=20NULL=20AS=20physical_volume_id,=0A=20=20=20=20=20=20=20=
=20NULL=20AS=20volume_group_id,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
serial,=0A=20=20=20=20=20=20=20=20NULL=20AS=20lun_mapping,=0A=20=20=20=20=
=20=20=20=20NULL=20AS=20vendor_id,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
product_id,=0A=20=20=20=20=20=20=20=20NULL=20AS=20device_size=0A=20=20=20=
=20FROM=20images_storage_domain_view=0A=20=20=20=20INNER=20JOIN=20=
storage_for_image_view=0A=20=20=20=20=20=20=20=20ON=20=
images_storage_domain_view.image_guid=20=3D=20=
storage_for_image_view.image_id=0A=20=20=20=20GROUP=20BY=20=
storage_for_image_view.storage_id,=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.storage_name,=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.storage_type,=0A=20=20=20=20=20=20=20=20=
storage_pool_id,=0A=20=20=20=20=20=20=20=20image_guid,=0A=20=20=20=20=20=20=
=20=20=0A=20=20=20=20=20=20=20=20creation_date,=0A=20=20=20=20=20=20=20=20=
actual_size,=0A=20=20=20=20=20=20=20=20read_rate,=0A=20=20=20=20=20=20=20=
=20write_rate,=0A=20=20=20=20=20=20=20=20read_latency_seconds,=0A=20=20=20=
=20=20=20=20=20write_latency_seconds,=0A=20=20=20=20=20=20=20=20=
flush_latency_seconds,=0A=20=20=20=20=20=20=20=20size,=0A=20=20=20=20=20=20=
=20=20it_guid,=0A=20=20=20=20=20=20=20=20imageStatus,=0A=20=20=20=20=20=20=
=20=20lastModified,=0A=20=20=20=20=20=20=20=20volume_type,=0A=20=20=20=20=
=20=20=20=20volume_format,=0A=20=20=20=20=20=20=20=20image_group_id,=0A=20=
=20=20=20=20=20=20=20description,=0A=20=20=20=20=20=20=20=20=0A=20=20=20=20=
=20=20=20=20ParentId,=0A=20=20=20=20=20=20=20=20app_list,=0A=20=20=20=20=20=
=20=20=20vm_snapshot_id,=0A=20=20=20=20=20=20=20=20active,=0A=20=20=20=20=
=20=20=20=20volume_classification,=0A=20=20=20=20=20=20=20=20=
entity_type,=0A=20=20=20=20=20=20=20=20number_of_vms,=0A=20=20=20=20=20=20=
=20=20vm_names,=0A=20=20=20=20=20=20=20=20template_version_names,=0A=20=20=
=20=20=20=20=20=20storage_for_image_view.quota_id,=0A=20=20=20=20=20=20=20=
=20storage_for_image_view.quota_name,=0A=20=20=20=20=20=20=20=20=
quota_enforcement_type,=0A=20=20=20=20=20=20=20=20ovf_store,=0A=20=20=20=20=
=20=20=20=20image_transfer_phase,=0A=20=20=20=20=20=20=20=20=
image_transfer_bytes_sent,=0A=20=20=20=20=20=20=20=20=
image_transfer_bytes_total,=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.disk_profile_id,=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.disk_profile_name=0A=20=20=20=20UNION=20ALL=0A=20=20=
=20=20SELECT=20NULL=20AS=20storage_id,=0A=20=20=20=20=20=20=20=20=0A=20=20=
=20=20=20=20=20=20NULL=20AS=20storage_name,=0A=20=20=20=20=20=20=20=20=
NULL=20AS=20storage_type,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
storage_pool_id,=0A=20=20=20=20=20=20=20=20NULL=20AS=20image_guid,=0A=20=20=
=20=20=20=20=20=20=0A=20=20=20=20=20=20=20=20NULL=20AS=20creation_date,=0A=
=20=20=20=20=20=20=20=20NULL=20AS=20actual_size,=0A=20=20=20=20=20=20=20=20=
NULL=20AS=20read_rate,=0A=20=20=20=20=20=20=20=20NULL=20AS=20write_rate,=0A=
=20=20=20=20=20=20=20=20NULL=20AS=20read_latency_seconds,=0A=20=20=20=20=20=
=20=20=20NULL=20AS=20write_latency_seconds,=0A=20=20=20=20=20=20=20=20=
NULL=20AS=20flush_latency_seconds,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
size,=0A=20=20=20=20=20=20=20=20NULL=20AS=20it_guid,=0A=20=20=20=20=20=20=
=20=20NULL=20AS=20imageStatus,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
lastModified,=0A=20=20=20=20=20=20=20=20NULL=20AS=20volume_type,=0A=20=20=
=20=20=20=20=20=20NULL=20AS=20volume_format,=0A=20=20=20=20=20=20=20=20=
dlm.disk_id=20AS=20image_group_id,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
description,=0A=20=20=20=20=20=20=20=20=0A=20=20=20=20=20=20=20=20NULL=20=
AS=20ParentId,=0A=20=20=20=20=20=20=20=20NULL=20AS=20app_list,=0A=20=20=20=
=20=20=20=20=20NULL=20AS=20vm_snapshot_id,=0A=20=20=20=20=20=20=20=20=
NULL=20AS=20active,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
volume_classification,=0A=20=20=20=20=20=20=20=20=
vms_for_disk_view.entity_type,=0A=20=20=20=20=20=20=20=20=
COALESCE(array_upper(vms_for_disk_view.array_vm_names,=201),=200)=20AS=20=
number_of_vms,=0A=20=20=20=20=20=20=20=20=
array_to_string(vms_for_disk_view.array_vm_names,=20',')=20AS=20=
vm_names,=0A=20=20=20=20=20=20=20=20=
array_to_string(vms_for_disk_view.array_template_version_name,=20',')=20=
AS=20template_version_names,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
quota_id,=0A=20=20=20=20=20=20=20=20=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
quota_name,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
quota_enforcement_type,=0A=20=20=20=20=20=20=20=20FALSE=20AS=20=
ovf_store,=0A=20=20=20=20=20=20=20=20NULL=20AS=20image_transfer_phase,=0A=
=20=20=20=20=20=20=20=20NULL=20AS=20image_transfer_bytes_sent,=0A=20=20=20=
=20=20=20=20=20NULL=20AS=20image_transfer_bytes_total,=0A=20=20=20=20=20=20=
=20=20NULL=20AS=20disk_profile_id,=0A=20=20=20=20=20=20=20=20=0A=20=20=20=
=20=20=20=20=20NULL=20AS=20disk_profile_name,=0A=20=20=20=20=20=20=20=20=
l.lun_id,=0A=20=20=20=20=20=20=20=20=0A=20=20=20=20=20=20=20=20=
l.physical_volume_id,=0A=20=20=20=20=20=20=20=20l.volume_group_id,=0A=20=20=
=20=20=20=20=20=20l.serial,=0A=20=20=20=20=20=20=20=20l.lun_mapping,=0A=20=
=20=20=20=20=20=20=20l.vendor_id,=0A=20=20=20=20=20=20=20=20=
l.product_id,=0A=20=20=20=20=20=20=20=20l.device_size=0A=20=20=20=20FROM=20=
disk_lun_map=20dlm=0A=20=20=20=20INNER=20JOIN=20luns=20l=0A=20=20=20=20=20=
=20=20=20ON=20l.lun_id=20=3D=20dlm.lun_id=0A=20=20=20=20LEFT=20JOIN=20=
vms_for_disk_view=0A=20=20=20=20=20=20=20=20ON=20=
vms_for_disk_view.device_id=20=3D=20dlm.disk_id=0A=20=20=20=20)=20AS=20=
storage_impl=0AINNER=20JOIN=20base_disks=20bd=0A=20=20=20=20ON=20=
bd.disk_id=20=3D=20storage_impl.image_group_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
all_disks_including_snapshots_and_memory=20AS=0ASELECT=20storage_impl.*,=0A=
=20=20=20=20bd.disk_id,=0A=20=20=20=20=0A=20=20=20=20=
bd.wipe_after_delete,=0A=20=20=20=20bd.propagate_errors,=0A=20=20=20=20=
bd.disk_alias,=0A=20=20=20=20bd.disk_description,=0A=20=20=20=20=
bd.shareable,=0A=20=20=20=20bd.sgio,=0A=20=20=20=20bd.alignment,=0A=20=20=
=20=20bd.last_alignment_scan,=0A=20=20=20=20bd.disk_storage_type,=0A=20=20=
=20=20bd.cinder_volume_type=0AFROM=20(=0A=20=20=20=20SELECT=20=
storage_for_image_view.storage_id=20AS=20storage_id,=0A=20=20=20=20=20=20=
=20=20=0A=20=20=20=20=20=20=20=20storage_for_image_view.storage_name=20=
AS=20storage_name,=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.storage_type=20AS=20storage_type,=0A=20=20=20=20=20=
=20=20=20storage_pool_id,=0A=20=20=20=20=20=20=20=20image_guid,=0A=20=20=20=
=20=20=20=20=20=0A=20=20=20=20=20=20=20=20creation_date,=0A=20=20=20=20=20=
=20=20=20actual_size,=0A=20=20=20=20=20=20=20=20read_rate,=0A=20=20=20=20=
=20=20=20=20write_rate,=0A=20=20=20=20=20=20=20=20read_latency_seconds,=0A=
=20=20=20=20=20=20=20=20write_latency_seconds,=0A=20=20=20=20=20=20=20=20=
flush_latency_seconds,=0A=20=20=20=20=20=20=20=20size,=0A=20=20=20=20=20=20=
=20=20it_guid,=0A=20=20=20=20=20=20=20=20imageStatus,=0A=20=20=20=20=20=20=
=20=20lastModified,=0A=20=20=20=20=20=20=20=20volume_type,=0A=20=20=20=20=
=20=20=20=20volume_format,=0A=20=20=20=20=20=20=20=20image_group_id,=0A=20=
=20=20=20=20=20=20=20description,=0A=20=20=20=20=20=20=20=20=0A=20=20=20=20=
=20=20=20=20ParentId,=0A=20=20=20=20=20=20=20=20app_list,=0A=20=20=20=20=20=
=20=20=20vm_snapshot_id,=0A=20=20=20=20=20=20=20=20active,=0A=20=20=20=20=
=20=20=20=20volume_classification,=0A=20=20=20=20=20=20=20=20=
entity_type,=0A=20=20=20=20=20=20=20=20number_of_vms,=0A=20=20=20=20=20=20=
=20=20vm_names,=0A=20=20=20=20=20=20=20=20template_version_names,=0A=20=20=
=20=20=20=20=20=20storage_for_image_view.quota_id=20AS=20quota_id,=0A=20=20=
=20=20=20=20=20=20=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.quota_name=20AS=20quota_name,=0A=20=20=20=20=20=20=
=20=20quota_enforcement_type,=0A=20=20=20=20=20=20=20=20ovf_store,=0A=20=20=
=20=20=20=20=20=20image_transfer_phase,=0A=20=20=20=20=20=20=20=20=
image_transfer_bytes_sent,=0A=20=20=20=20=20=20=20=20=
image_transfer_bytes_total,=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.disk_profile_id=20AS=20disk_profile_id,=0A=20=20=20=
=20=20=20=20=20=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.disk_profile_name=20AS=20disk_profile_name,=0A=20=20=
=20=20=20=20=20=20memory_image,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
lun_id,=0A=20=20=20=20=20=20=20=20=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
physical_volume_id,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
volume_group_id,=0A=20=20=20=20=20=20=20=20NULL=20AS=20serial,=0A=20=20=20=
=20=20=20=20=20NULL=20AS=20lun_mapping,=0A=20=20=20=20=20=20=20=20NULL=20=
AS=20vendor_id,=0A=20=20=20=20=20=20=20=20NULL=20AS=20product_id,=0A=20=20=
=20=20=20=20=20=20NULL=20AS=20device_size=0A=20=20=20=20FROM=20=
memory_and_disk_images_storage_domain_view=0A=20=20=20=20INNER=20JOIN=20=
storage_for_image_view=0A=20=20=20=20=20=20=20=20ON=20=
memory_and_disk_images_storage_domain_view.image_guid=20=3D=20=
storage_for_image_view.image_id=0A=20=20=20=20GROUP=20BY=20=
storage_for_image_view.storage_id,=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.storage_name,=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.storage_type,=0A=20=20=20=20=20=20=20=20=
storage_pool_id,=0A=20=20=20=20=20=20=20=20image_guid,=0A=20=20=20=20=20=20=
=20=20=0A=20=20=20=20=20=20=20=20creation_date,=0A=20=20=20=20=20=20=20=20=
actual_size,=0A=20=20=20=20=20=20=20=20read_rate,=0A=20=20=20=20=20=20=20=
=20write_rate,=0A=20=20=20=20=20=20=20=20read_latency_seconds,=0A=20=20=20=
=20=20=20=20=20write_latency_seconds,=0A=20=20=20=20=20=20=20=20=
flush_latency_seconds,=0A=20=20=20=20=20=20=20=20size,=0A=20=20=20=20=20=20=
=20=20it_guid,=0A=20=20=20=20=20=20=20=20imageStatus,=0A=20=20=20=20=20=20=
=20=20lastModified,=0A=20=20=20=20=20=20=20=20volume_type,=0A=20=20=20=20=
=20=20=20=20volume_format,=0A=20=20=20=20=20=20=20=20image_group_id,=0A=20=
=20=20=20=20=20=20=20description,=0A=20=20=20=20=20=20=20=20=0A=20=20=20=20=
=20=20=20=20ParentId,=0A=20=20=20=20=20=20=20=20app_list,=0A=20=20=20=20=20=
=20=20=20vm_snapshot_id,=0A=20=20=20=20=20=20=20=20active,=0A=20=20=20=20=
=20=20=20=20volume_classification,=0A=20=20=20=20=20=20=20=20=
entity_type,=0A=20=20=20=20=20=20=20=20number_of_vms,=0A=20=20=20=20=20=20=
=20=20vm_names,=0A=20=20=20=20=20=20=20=20template_version_names,=0A=20=20=
=20=20=20=20=20=20storage_for_image_view.quota_id,=0A=20=20=20=20=20=20=20=
=20storage_for_image_view.quota_name,=0A=20=20=20=20=20=20=20=20=
quota_enforcement_type,=0A=20=20=20=20=20=20=20=20ovf_store,=0A=20=20=20=20=
=20=20=20=20image_transfer_phase,=0A=20=20=20=20=20=20=20=20=
image_transfer_bytes_sent,=0A=20=20=20=20=20=20=20=20=
image_transfer_bytes_total,=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.disk_profile_id,=0A=20=20=20=20=20=20=20=20=
storage_for_image_view.disk_profile_name,=0A=20=20=20=20=20=20=20=20=
memory_image=0A=20=20=20=20UNION=20ALL=0A=20=20=20=20SELECT=20NULL=20AS=20=
storage_id,=0A=20=20=20=20=20=20=20=20=0A=20=20=20=20=20=20=20=20NULL=20=
AS=20storage_name,=0A=20=20=20=20=20=20=20=20NULL=20AS=20storage_type,=0A=
=20=20=20=20=20=20=20=20NULL=20AS=20storage_pool_id,=0A=20=20=20=20=20=20=
=20=20NULL=20AS=20image_guid,=0A=20=20=20=20=20=20=20=20=0A=20=20=20=20=20=
=20=20=20NULL=20AS=20creation_date,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
actual_size,=0A=20=20=20=20=20=20=20=20NULL=20AS=20read_rate,=0A=20=20=20=
=20=20=20=20=20NULL=20AS=20write_rate,=0A=20=20=20=20=20=20=20=20NULL=20=
AS=20read_latency_seconds,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
write_latency_seconds,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
flush_latency_seconds,=0A=20=20=20=20=20=20=20=20NULL=20AS=20size,=0A=20=20=
=20=20=20=20=20=20NULL=20AS=20it_guid,=0A=20=20=20=20=20=20=20=20NULL=20=
AS=20imageStatus,=0A=20=20=20=20=20=20=20=20NULL=20AS=20lastModified,=0A=20=
=20=20=20=20=20=20=20NULL=20AS=20volume_type,=0A=20=20=20=20=20=20=20=20=
NULL=20AS=20volume_format,=0A=20=20=20=20=20=20=20=20dlm.disk_id=20AS=20=
image_group_id,=0A=20=20=20=20=20=20=20=20NULL=20AS=20description,=0A=20=20=
=20=20=20=20=20=20=0A=20=20=20=20=20=20=20=20NULL=20AS=20ParentId,=0A=20=20=
=20=20=20=20=20=20NULL=20AS=20app_list,=0A=20=20=20=20=20=20=20=20NULL=20=
AS=20vm_snapshot_id,=0A=20=20=20=20=20=20=20=20NULL=20AS=20active,=0A=20=20=
=20=20=20=20=20=20NULL=20AS=20volume_classification,=0A=20=20=20=20=20=20=
=20=20vms_for_disk_view.entity_type,=0A=20=20=20=20=20=20=20=20=
COALESCE(array_upper(vms_for_disk_view.array_vm_names,=201),=200)=20AS=20=
number_of_vms,=0A=20=20=20=20=20=20=20=20=
array_to_string(vms_for_disk_view.array_vm_names,=20',')=20AS=20=
vm_names,=0A=20=20=20=20=20=20=20=20=
array_to_string(vms_for_disk_view.array_template_version_name,=20',')=20=
AS=20template_version_names,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
quota_id,=0A=20=20=20=20=20=20=20=20=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
quota_name,=0A=20=20=20=20=20=20=20=20NULL=20AS=20=
quota_enforcement_type,=0A=20=20=20=20=20=20=20=20FALSE=20AS=20=
ovf_store,=0A=20=20=20=20=20=20=20=20NULL=20AS=20image_transfer_phase,=0A=
=20=20=20=20=20=20=20=20NULL=20AS=20image_transfer_bytes_sent,=0A=20=20=20=
=20=20=20=20=20NULL=20AS=20image_transfer_bytes_total,=0A=20=20=20=20=20=20=
=20=20NULL=20AS=20disk_profile_id,=0A=20=20=20=20=20=20=20=20=0A=20=20=20=
=20=20=20=20=20NULL=20AS=20disk_profile_name,=0A=20=20=20=20=20=20=20=20=
FALSE=20AS=20memory_image,=0A=20=20=20=20=20=20=20=20l.lun_id,=0A=20=20=20=
=20=20=20=20=20=0A=20=20=20=20=20=20=20=20l.physical_volume_id,=0A=20=20=20=
=20=20=20=20=20l.volume_group_id,=0A=20=20=20=20=20=20=20=20l.serial,=0A=20=
=20=20=20=20=20=20=20l.lun_mapping,=0A=20=20=20=20=20=20=20=20=
l.vendor_id,=0A=20=20=20=20=20=20=20=20l.product_id,=0A=20=20=20=20=20=20=
=20=20l.device_size=0A=20=20=20=20FROM=20disk_lun_map=20dlm=0A=20=20=20=20=
INNER=20JOIN=20luns=20l=0A=20=20=20=20=20=20=20=20ON=20l.lun_id=20=3D=20=
dlm.lun_id=0A=20=20=20=20LEFT=20JOIN=20vms_for_disk_view=0A=20=20=20=20=20=
=20=20=20ON=20vms_for_disk_view.device_id=20=3D=20dlm.disk_id=0A=20=20=20=
=20)=20AS=20storage_impl=0AINNER=20JOIN=20base_disks=20bd=0A=20=20=20=20=
ON=20bd.disk_id=20=3D=20storage_impl.image_group_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20all_disks=20AS=0ASELECT=20*=0A=
FROM=20all_disks_including_snapshots=0AWHERE=20active=20IS=20NULL=0A=20=20=
=20=20OR=20active=20=3D=20TRUE;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
all_disks_including_memory=20AS=0ASELECT=20*=0AFROM=20=
all_disks_including_snapshots_and_memory=0AWHERE=20active=20IS=20NULL=0A=20=
=20=20=20OR=20active=20=3D=20TRUE=0A=20=20=20=20OR=20memory_image=20=3D=20=
TRUE;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20all_disks_for_vms=20=
AS=0ASELECT=20all_disks_including_snapshots.*,=0A=20=20=20=20=
vm_device.is_plugged,=0A=20=20=20=20vm_device.is_readonly,=0A=20=20=20=20=
vm_device.logical_name,=0A=20=20=20=20vm_device.vm_id,=0A=20=20=20=20=
vm_device.is_using_scsi_reservation=0AFROM=20=
all_disks_including_snapshots=0AINNER=20JOIN=20vm_device=0A=20=20=20=20=
ON=20vm_device.device_id=20=3D=20=
all_disks_including_snapshots.image_group_id=0AWHERE=20(=0A=20=20=20=20=20=
=20=20=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20vm_device.snapshot_id=20=
IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
all_disks_including_snapshots.active=20IS=20NOT=20FALSE=0A=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20OR=20=
vm_device.snapshot_id=20=3D=20=
all_disks_including_snapshots.vm_snapshot_id=0A=20=20=20=20=20=20=20=20=
);=0A**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20storage_domains_image_sizes=20=
AS=0ASELECT=20storage_domain_id,=0A=20=20=20=20CAST(CAST(COALESCE(SUM(=0A=
=20=20=20=20=20=20=20=20CASE=20WHEN=20active=20=3D=20TRUE=0A=20=20=20=20=20=
=20=20=20=20=20=20=20AND(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20entity_type=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20OR=20entity_type=20<>=20'TEMPLATE'=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20size=0A=20=20=
=20=20=20=20=20=20ELSE=20actual_size=0A=20=20=20=20=20=20=20=20END),=20=
0)=20*=200.000000000931322574615478515625=20AS=20BIGINT)=20AS=20INT)=0A=20=
=20=20=20AS=20commited_disk_size,=0A=20=20=20=20=
CAST(CAST(COALESCE(SUM(actual_size),=200)=0A=20=20=20=20*=20=
0.000000000931322574615478515625=20AS=20BIGINT)=20AS=20INT)=0A=20=20=20=20=
AS=20actual_images_size=0AFROM=20images=20i=0AINNER=20JOIN=20=
image_storage_domain_map=20isdm=0A=20=20=20=20ON=20i.image_guid=20=3D=20=
isdm.image_id=0ALEFT=20JOIN=20disk_image_dynamic=20din=0A=20=20=20=20ON=20=
i.image_guid=20=3D=20din.image_id=0ALEFT=20JOIN=20vms_for_disk_view=20=
vfdv=0A=20=20=20=20ON=20i.image_group_id=20=3D=20vfdv.device_id=0AGROUP=20=
BY=20storage_domain_id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
storage_domains=20AS=0ASELECT=20storage_domain_static.id=20AS=20id,=0A=20=
=20=20=20storage_domain_static.storage=20AS=20storage,=0A=20=20=20=20=
storage_domain_static.storage_name=20AS=20storage_name,=0A=20=20=20=20=
storage_domain_static.storage_description=20AS=20storage_description,=0A=20=
=20=20=20storage_domain_static.storage_comment=20AS=20storage_comment,=0A=
=20=20=20=20storage_pool_iso_map.storage_pool_id=20AS=20storage_pool_id,=0A=
=20=20=20=20storage_domain_dynamic.available_disk_size=20AS=20=
available_disk_size,=0A=20=20=20=20storage_domain_dynamic.used_disk_size=20=
AS=20used_disk_size,=0A=20=20=20=20=
storage_domains_image_sizes.commited_disk_size,=0A=20=20=20=20=
storage_domains_image_sizes.actual_images_size,=0A=20=20=20=20=
storage_pool_iso_map.status=20AS=20status,=0A=20=20=20=20=
storage_pool.name=20AS=20storage_pool_name,=0A=20=20=20=20=
storage_domain_static.storage_type=20AS=20storage_type,=0A=20=20=20=20=
storage_domain_static.storage_domain_type=20AS=20storage_domain_type,=0A=20=
=20=20=20storage_domain_static.storage_domain_format_type=20AS=20=
storage_domain_format_type,=0A=20=20=20=20=
storage_domain_static.last_time_used_as_master=20AS=20=
last_time_used_as_master,=0A=20=20=20=20=
storage_domain_static.wipe_after_delete=20AS=20wipe_after_delete,=0A=20=20=
=20=20COALESCE(storage_domain_shared_status.status,=200)=20AS=20=
storage_domain_shared_status,=0A=20=20=20=20=
storage_domain_static.recoverable=20AS=20recoverable,=0A=20=20=20=20=
domains_with_unregistered_entities_view.storage_domain_id=20IS=20NOT=20=
NULL=20AS=20contains_unregistered_entities,=0A=20=20=20=20=
storage_domain_static.warning_low_space_indicator=20AS=20=
warning_low_space_indicator,=0A=20=20=20=20=
storage_domain_static.critical_space_action_blocker=20AS=20=
critical_space_action_blocker,=0A=20=20=20=20=
storage_domain_dynamic.external_status=20AS=20external_status=0AFROM=20=
storage_domain_static=0AINNER=20JOIN=20storage_domain_dynamic=0A=20=20=20=
=20ON=20storage_domain_static.id=20=3D=20storage_domain_dynamic.id=0A=
LEFT=20JOIN=20storage_pool_iso_map=0A=20=20=20=20ON=20=
storage_domain_static.id=20=3D=20storage_pool_iso_map.storage_id=0ALEFT=20=
JOIN=20storage_pool=0A=20=20=20=20ON=20=
storage_pool_iso_map.storage_pool_id=20=3D=20storage_pool.id=0ALEFT=20=
JOIN=20domains_with_unregistered_entities_view=0A=20=20=20=20ON=20=
domains_with_unregistered_entities_view.storage_domain_id=20=3D=20=
storage_domain_static.id=0ALEFT=20JOIN=20storage_domains_image_sizes=0A=20=
=20=20=20ON=20storage_domains_image_sizes.storage_domain_id=20=3D=20=
storage_domain_static.id=0ALEFT=20JOIN=20storage_domain_shared_status=0A=20=
=20=20=20ON=20storage_domain_shared_status.storage_id=20=3D=20=
storage_domain_static.id;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
storage_domains_without_storage_pools=20AS=0ASELECT=20DISTINCT=20=
storage_domain_static.id=20AS=20id,=0A=20=20=20=20=
storage_domain_static.storage=20AS=20storage,=0A=20=20=20=20=
storage_domain_static.storage_name=20AS=20storage_name,=0A=20=20=20=20=
storage_domain_static.storage_description=20AS=20storage_description,=0A=20=
=20=20=20storage_domain_static.storage_comment=20AS=20storage_comment,=0A=
=20=20=20=20storage_domain_static.storage_type=20AS=20storage_type,=0A=20=
=20=20=20storage_domain_static.storage_domain_type=20AS=20=
storage_domain_type,=0A=20=20=20=20=
storage_domain_static.storage_domain_format_type=20AS=20=
storage_domain_format_type,=0A=20=20=20=20=
storage_domain_static.last_time_used_as_master=20AS=20=
last_time_used_as_master,=0A=20=20=20=20=
storage_domain_static.wipe_after_delete=20AS=20wipe_after_delete,=0A=20=20=
=20=20NULL=20AS=20storage_pool_id,=0A=20=20=20=20NULL=20AS=20=
storage_pool_name,=0A=20=20=20=20=
storage_domain_dynamic.available_disk_size=20AS=20available_disk_size,=0A=
=20=20=20=20storage_domain_dynamic.used_disk_size=20AS=20used_disk_size,=0A=
=20=20=20=20storage_domains_image_sizes.commited_disk_size,=0A=20=20=20=20=
storage_domains_image_sizes.actual_images_size,=0A=20=20=20=20NULL=20AS=20=
status,=0A=20=20=20=20COALESCE(storage_domain_shared_status.status,=200)=20=
AS=20storage_domain_shared_status,=0A=20=20=20=20=
storage_domain_static.recoverable=20AS=20recoverable,=0A=20=20=20=20=
domains_with_unregistered_entities_view.storage_domain_id=20IS=20NOT=20=
NULL=20AS=20contains_unregistered_entities,=0A=20=20=20=20=
storage_domain_static.warning_low_space_indicator=20AS=20=
warning_low_space_indicator,=0A=20=20=20=20=
storage_domain_static.critical_space_action_blocker=20AS=20=
critical_space_action_blocker,=0A=20=20=20=20=
storage_domain_dynamic.external_status=20AS=20external_status=0AFROM=20=
storage_domain_static=0AINNER=20JOIN=20storage_domain_dynamic=0A=20=20=20=
=20ON=20storage_domain_static.id=20=3D=20storage_domain_dynamic.id=0A=
LEFT=20JOIN=20storage_pool_iso_map=0A=20=20=20=20ON=20=
storage_domain_static.id=20=3D=20storage_pool_iso_map.storage_id=0ALEFT=20=
JOIN=20storage_domain_shared_status=0A=20=20=20=20ON=20=
storage_domain_shared_status.storage_id=20=3D=20storage_domain_static.id=0A=
LEFT=20JOIN=20domains_with_unregistered_entities_view=0A=20=20=20=20ON=20=
domains_with_unregistered_entities_view.storage_domain_id=20=3D=20=
storage_domain_static.id=0ALEFT=20JOIN=20storage_domains_image_sizes=0A=20=
=20=20=20ON=20storage_domains_image_sizes.storage_domain_id=20=3D=20=
storage_domain_static.id;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
storage_domains_for_search=20AS=0ASELECT=20storage_domain_static.id=20AS=20=
id,=0A=20=20=20=20storage_domain_static.storage=20AS=20storage,=0A=20=20=20=
=20storage_domain_static.storage_name=20AS=20storage_name,=0A=20=20=20=20=
storage_domain_static.storage_description=20AS=20storage_description,=0A=20=
=20=20=20storage_domain_static.storage_comment=20AS=20storage_comment,=0A=
=20=20=20=20storage_domain_static.storage_type=20AS=20storage_type,=0A=20=
=20=20=20storage_domain_static.storage_domain_type=20AS=20=
storage_domain_type,=0A=20=20=20=20=
storage_domain_static.storage_domain_format_type=20AS=20=
storage_domain_format_type,=0A=20=20=20=20=
storage_domain_static.last_time_used_as_master=20AS=20=
last_time_used_as_master,=0A=20=20=20=20=
storage_domain_static.wipe_after_delete=20AS=20wipe_after_delete,=0A=20=20=
=20=20CASE=0A=20=20=20=20=20=20=20=20WHEN=20status_table.is_multi_domain=0A=
=20=20=20=20=20=20=20=20=20=20=20=20THEN=20NULL=0A=20=20=20=20=20=20=20=20=
WHEN=20status_table.status=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=
=20THEN=202=20=0A=20=20=20=20=20=20=20=20ELSE=20status_table.status=0A=20=
=20=20=20=20=20=20=20END=20AS=20status,=0A=20=20=20=20=
status_table.storage_pool_ids=20[=201=20]=20AS=20storage_pool_id,=0A=20=20=
=20=20status_table.pool_names=20AS=20storage_pool_name,=0A=20=20=20=20=
storage_domain_dynamic.available_disk_size=20AS=20available_disk_size,=0A=
=20=20=20=20storage_domain_dynamic.used_disk_size=20AS=20used_disk_size,=0A=
=20=20=20=20storage_domains_image_sizes.commited_disk_size,=0A=20=20=20=20=
storage_domains_image_sizes.actual_images_size,=0A=20=20=20=20=
COALESCE(storage_domain_shared_status.status,=200)=20AS=20=
storage_domain_shared_status,=0A=20=20=20=20=
storage_domain_static.recoverable=20AS=20recoverable,=0A=20=20=20=20=
domains_with_unregistered_entities_view.storage_domain_id=20IS=20NOT=20=
NULL=20AS=20contains_unregistered_entities,=0A=20=20=20=20=
storage_domain_static.warning_low_space_indicator=20AS=20=
warning_low_space_indicator,=0A=20=20=20=20=
storage_domain_static.critical_space_action_blocker=20AS=20=
critical_space_action_blocker,=0A=20=20=20=20=
storage_domain_dynamic.external_status=20AS=20external_status=0AFROM=20=
storage_domain_static=0AINNER=20JOIN=20storage_domain_dynamic=0A=20=20=20=
=20ON=20storage_domain_static.id=20=3D=20storage_domain_dynamic.id=0A=
LEFT=20JOIN=20(=0A=20=20=20=20SELECT=20storage_id,=0A=20=20=20=20=20=20=20=
=20COUNT(storage_id)=20>=201=20AS=20is_multi_domain,=0A=20=20=20=20=20=20=
=20=20MAX(storage_pool_iso_map.status)=20AS=20status,=0A=20=20=20=20=20=20=
=20=20array_to_string(array_agg(storage_pool.name),=20',')=20AS=20=
pool_names,=0A=20=20=20=20=20=20=20=20CASE=0A=20=20=20=20=20=20=20=20=20=20=
=20=20WHEN=20COUNT(DISTINCT=20storage_pool.id)=20=3D=201=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20THEN=20array_agg(storage_pool.id)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20ELSE=20NULL=0A=20=20=20=20=20=20=20=20=20=20=
=20=20END=20AS=20storage_pool_ids=0A=20=20=20=20FROM=20=
storage_pool_iso_map=0A=20=20=20=20INNER=20JOIN=20storage_pool=0A=20=20=20=
=20=20=20=20=20ON=20storage_pool_iso_map.storage_pool_id=20=3D=20=
storage_pool.id=0A=20=20=20=20GROUP=20BY=20storage_id=0A=20=20=20=20)=20=
AS=20status_table=0A=20=20=20=20ON=20storage_domain_static.id=20=3D=20=
status_table.storage_id=0ALEFT=20JOIN=20storage_domain_shared_status=0A=20=
=20=20=20ON=20storage_domain_shared_status.storage_id=20=3D=20=
storage_domain_static.id=0ALEFT=20JOIN=20=
domains_with_unregistered_entities_view=0A=20=20=20=20ON=20=
domains_with_unregistered_entities_view.storage_domain_id=20=3D=20=
storage_domain_static.id=0ALEFT=20JOIN=20storage_domains_image_sizes=0A=20=
=20=20=20ON=20storage_domains_image_sizes.storage_domain_id=20=3D=20=
storage_domain_static.id;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
luns_view=20AS=0ASELECT=20luns.*,=0A=20=20=20=20storage_domain_static.id=20=
AS=20storage_id,=0A=20=20=20=20storage_domain_static.storage_name=20AS=20=
storage_name,=0A=20=20=20=20disk_lun_map.disk_id=20AS=20disk_id,=0A=20=20=
=20=20all_disks.disk_alias=20AS=20disk_alias=0AFROM=20luns=0ALEFT=20JOIN=20=
storage_domain_static=0A=20=20=20=20ON=20luns.volume_group_id=20=3D=20=
storage_domain_static.storage=0ALEFT=20JOIN=20disk_lun_map=0A=20=20=20=20=
ON=20luns.lun_id=20=3D=20disk_lun_map.lun_id=0ALEFT=20JOIN=20all_disks=0A=
=20=20=20=20ON=20disk_lun_map.disk_id=20=3D=20all_disks.disk_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20vm_templates_based_view=20AS=0A=
SELECT=20vm_templates.vm_guid=20AS=20vmt_guid,=0A=20=20=20=20=
vm_templates.vm_name=20AS=20name,=0A=20=20=20=20vm_templates.mem_size_mb=20=
AS=20mem_size_mb,=0A=20=20=20=20vm_templates.num_of_io_threads=20AS=20=
num_of_io_threads,=0A=20=20=20=20vm_templates.os=20AS=20os,=0A=20=20=20=20=
vm_templates.creation_date=20AS=20creation_date,=0A=20=20=20=20=
vm_templates.child_count=20AS=20child_count,=0A=20=20=20=20=
vm_templates.num_of_sockets=20AS=20num_of_sockets,=0A=20=20=20=20=
vm_templates.cpu_per_socket=20AS=20cpu_per_socket,=0A=20=20=20=20=
vm_templates.threads_per_cpu=20AS=20threads_per_cpu,=0A=20=20=20=20=
vm_templates.fn_get_num_of_vcpus=20AS=20num_of_cpus,=20=0A=20=20=20=20=
vm_templates.description=20AS=20description,=0A=20=20=20=20=
vm_templates.free_text_comment=20AS=20free_text_comment,=0A=20=20=20=20=
vm_templates.cluster_id=20AS=20cluster_id,=0A=20=20=20=20=
vm_templates.num_of_monitors=20AS=20num_of_monitors,=0A=20=20=20=20=
vm_templates.single_qxl_pci=20AS=20single_qxl_pci,=0A=20=20=20=20=
vm_templates.allow_console_reconnect=20AS=20allow_console_reconnect,=0A=20=
=20=20=20vm_templates.template_status=20AS=20status,=0A=20=20=20=20=
vm_templates.usb_policy=20AS=20usb_policy,=0A=20=20=20=20=
vm_templates.time_zone=20AS=20time_zone,=0A=20=20=20=20=
vm_templates.fail_back=20AS=20fail_back,=0A=20=20=20=20cluster.name=20AS=20=
cluster_name,=0A=20=20=20=20cluster.compatibility_version=20AS=20=
cluster_compatibility_version,=0A=20=20=20=20cluster.trusted_service=20=
AS=20trusted_service,=0A=20=20=20=20vm_templates.vm_type=20AS=20vm_type,=0A=
=20=20=20=20vm_templates.nice_level=20AS=20nice_level,=0A=20=20=20=20=
vm_templates.cpu_shares=20AS=20cpu_shares,=0A=20=20=20=20storage_pool.id=20=
AS=20storage_pool_id,=0A=20=20=20=20storage_pool.name=20AS=20=
storage_pool_name,=0A=20=20=20=20storage_pool.quota_enforcement_type=20=
AS=20quota_enforcement_type,=0A=20=20=20=20=
vm_templates.default_boot_sequence=20AS=20default_boot_sequence,=0A=20=20=
=20=20vm_templates.default_display_type=20AS=20default_display_type,=0A=20=
=20=20=20vm_templates.priority=20AS=20priority,=0A=20=20=20=20=
vm_templates.auto_startup=20AS=20auto_startup,=0A=20=20=20=20=
vm_templates.is_stateless=20AS=20is_stateless,=0A=20=20=20=20=
vm_templates.is_smartcard_enabled=20AS=20is_smartcard_enabled,=0A=20=20=20=
=20vm_templates.is_delete_protected=20AS=20is_delete_protected,=0A=20=20=20=
=20vm_templates.sso_method=20AS=20sso_method,=0A=20=20=20=20=
vm_templates.iso_path=20AS=20iso_path,=0A=20=20=20=20vm_templates.origin=20=
AS=20origin,=0A=20=20=20=20vm_templates.initrd_url=20AS=20initrd_url,=0A=20=
=20=20=20vm_templates.kernel_url=20AS=20kernel_url,=0A=20=20=20=20=
vm_templates.kernel_params=20AS=20kernel_params,=0A=20=20=20=20=
vm_templates.quota_id=20AS=20quota_id,=0A=20=20=20=20quota.quota_name=20=
AS=20quota_name,=0A=20=20=20=20vm_templates.db_generation=20AS=20=
db_generation,=0A=20=20=20=20vm_templates.migration_support,=0A=20=20=20=20=
fn_get_dedicated_hosts_ids_by_vm_id(vm_templates.vm_guid)=20AS=20=
dedicated_vm_for_vds,=0A=20=20=20=20vm_templates.is_disabled,=0A=20=20=20=
=20vm_templates.tunnel_migration,=0A=20=20=20=20=
vm_templates.vnc_keyboard_layout=20AS=20vnc_keyboard_layout,=0A=20=20=20=20=
vm_templates.min_allocated_mem=20AS=20min_allocated_mem,=0A=20=20=20=20=
vm_templates.is_run_and_pause=20AS=20is_run_and_pause,=0A=20=20=20=20=
vm_templates.created_by_user_id=20AS=20created_by_user_id,=0A=20=20=20=20=
vm_templates.entity_type,=0A=20=20=20=20vm_templates.migration_downtime=20=
AS=20migration_downtime,=0A=20=20=20=20cluster.architecture=20AS=20=
architecture,=0A=20=20=20=20vm_templates.template_version_number=20AS=20=
template_version_number,=0A=20=20=20=20vm_templates.vmt_guid=20AS=20=
base_template_id,=0A=20=20=20=20vm_templates.template_version_name=20AS=20=
template_version_name,=0A=20=20=20=20vm_templates.serial_number_policy=20=
AS=20serial_number_policy,=0A=20=20=20=20=
vm_templates.custom_serial_number=20AS=20custom_serial_number,=0A=20=20=20=
=20vm_templates.is_boot_menu_enabled=20AS=20is_boot_menu_enabled,=0A=20=20=
=20=20vm_templates.is_spice_file_transfer_enabled=20AS=20=
is_spice_file_transfer_enabled,=0A=20=20=20=20=
vm_templates.is_spice_copy_paste_enabled=20AS=20=
is_spice_copy_paste_enabled,=0A=20=20=20=20vm_templates.cpu_profile_id=20=
AS=20cpu_profile_id,=0A=20=20=20=20vm_templates.numatune_mode=20AS=20=
numatune_mode,=0A=20=20=20=20vm_templates.is_auto_converge=20AS=20=
is_auto_converge,=0A=20=20=20=20vm_templates.is_migrate_compressed=20AS=20=
is_migrate_compressed,=0A=20=20=20=20vm_templates.predefined_properties=20=
AS=20predefined_properties,=0A=20=20=20=20=
vm_templates.userdefined_properties=20AS=20userdefined_properties,=0A=20=20=
=20=20vm_templates.custom_emulated_machine=20AS=20=
custom_emulated_machine,=0A=20=20=20=20vm_templates.custom_cpu_name=20AS=20=
custom_cpu_name,=0A=20=20=20=20vm_templates.small_icon_id=20AS=20=
small_icon_id,=0A=20=20=20=20vm_templates.large_icon_id=20AS=20=
large_icon_id,=0A=20=20=20=20vm_templates.migration_policy_id=20as=20=
migration_policy_id,=0A=20=20=20=20=
vm_templates.console_disconnect_action=20AS=20console_disconnect_action,=0A=
=20=20=20=20vm_templates.custom_compatibility_version=20as=20=
custom_compatibility_version=0AFROM=20vm_static=20AS=20vm_templates=0A=
LEFT=20JOIN=20cluster=0A=20=20=20=20ON=20vm_templates.cluster_id=20=3D=20=
cluster.cluster_id=0ALEFT=20JOIN=20storage_pool=0A=20=20=20=20ON=20=
storage_pool.id=20=3D=20cluster.storage_pool_id=0ALEFT=20JOIN=20quota=0A=20=
=20=20=20ON=20vm_templates.quota_id=20=3D=20quota.id=0AWHERE=20=
entity_type=20=3D=20'TEMPLATE'=0A=20=20=20=20OR=20entity_type=20=3D=20=
'INSTANCE_TYPE'=0A=20=20=20=20OR=20entity_type=20=3D=20'IMAGE_TYPE';=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
vm_templates_based_with_plug_info=20AS=0ASELECT=20=
vm_templates_based_view.*,=0A=20=20=20=20image_guid,=0A=20=20=20=20=
image_group_id,=0A=20=20=20=20is_plugged=0AFROM=20=
vm_templates_based_view=0AINNER=20JOIN=20vm_device=20vd=0A=20=20=20=20ON=20=
vd.vm_id=20=3D=20vm_templates_based_view.vmt_guid=0AINNER=20JOIN=20=
images=0A=20=20=20=20ON=20images.image_group_id=20=3D=20vd.device_id=0A=20=
=20=20=20=20=20=20=20AND=20images.active=20=3D=20TRUE;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
vm_templates_based_storage_domain=20AS=0ASELECT=20vm_templates.vm_guid=20=
AS=20vmt_guid,=0A=20=20=20=20vm_templates.vm_name=20AS=20name,=0A=20=20=20=
=20vm_templates.mem_size_mb,=0A=20=20=20=20=
vm_templates.num_of_io_threads,=0A=20=20=20=20vm_templates.os,=0A=20=20=20=
=20vm_templates.creation_date,=0A=20=20=20=20vm_templates.child_count,=0A=
=20=20=20=20vm_templates.num_of_sockets,=0A=20=20=20=20=
vm_templates.cpu_per_socket,=0A=20=20=20=20vm_templates.threads_per_cpu,=0A=
=20=20=20=20vm_templates.fn_get_num_of_vcpus=20AS=20num_of_cpus,=20=0A=20=
=20=20=20vm_templates.description,=0A=20=20=20=20=
vm_templates.free_text_comment,=0A=20=20=20=20vm_templates.cluster_id,=0A=
=20=20=20=20vm_templates.num_of_monitors,=0A=20=20=20=20=
vm_templates.single_qxl_pci,=0A=20=20=20=20=
vm_templates.allow_console_reconnect,=0A=20=20=20=20=
vm_templates.template_status=20AS=20status,=0A=20=20=20=20=
vm_templates.usb_policy,=0A=20=20=20=20vm_templates.time_zone,=0A=20=20=20=
=20vm_templates.fail_back,=0A=20=20=20=20cluster.name=20AS=20=
cluster_name,=0A=20=20=20=20vm_templates.vm_type,=0A=20=20=20=20=
vm_templates.nice_level,=0A=20=20=20=20vm_templates.cpu_shares,=0A=20=20=20=
=20storage_pool.id=20AS=20storage_pool_id,=0A=20=20=20=20=
storage_pool.name=20AS=20storage_pool_name,=0A=20=20=20=20=
vm_templates.default_boot_sequence,=0A=20=20=20=20=
vm_templates.default_display_type,=0A=20=20=20=20vm_templates.priority,=0A=
=20=20=20=20vm_templates.auto_startup,=0A=20=20=20=20=
vm_templates.is_stateless,=0A=20=20=20=20vm_templates.iso_path,=0A=20=20=20=
=20vm_templates.origin,=0A=20=20=20=20vm_templates.initrd_url,=0A=20=20=20=
=20vm_templates.kernel_url,=0A=20=20=20=20vm_templates.kernel_params,=0A=20=
=20=20=20image_storage_domain_map.storage_domain_id=20AS=20storage_id,=0A=
=20=20=20=20quota.quota_name=20AS=20quota_name,=0A=20=20=20=20=
vm_templates.is_disabled,=0A=20=20=20=20vm_templates.min_allocated_mem,=0A=
=20=20=20=20vm_templates.is_run_and_pause,=0A=20=20=20=20=
vm_templates.created_by_user_id,=0A=20=20=20=20=
vm_templates.migration_downtime,=0A=20=20=20=20vm_templates.entity_type,=0A=
=20=20=20=20cluster.architecture,=0A=20=20=20=20=
vm_templates.template_version_number=20AS=20template_version_number,=0A=20=
=20=20=20vm_templates.vmt_guid=20AS=20base_template_id,=0A=20=20=20=20=
vm_templates.template_version_name=20AS=20template_version_name,=0A=20=20=
=20=20vm_templates.serial_number_policy=20AS=20serial_number_policy,=0A=20=
=20=20=20vm_templates.custom_serial_number=20AS=20custom_serial_number,=0A=
=20=20=20=20vm_templates.is_boot_menu_enabled=20AS=20=
is_boot_menu_enabled,=0A=20=20=20=20=
vm_templates.is_spice_file_transfer_enabled=20AS=20=
is_spice_file_transfer_enabled,=0A=20=20=20=20=
vm_templates.is_spice_copy_paste_enabled=20AS=20=
is_spice_copy_paste_enabled,=0A=20=20=20=20vm_templates.cpu_profile_id=20=
AS=20cpu_profile_id,=0A=20=20=20=20vm_templates.numatune_mode=20AS=20=
numatune_mode,=0A=20=20=20=20vm_templates.is_auto_converge=20AS=20=
is_auto_converge,=0A=20=20=20=20vm_templates.is_migrate_compressed=20AS=20=
is_migrate_compressed,=0A=20=20=20=20vm_templates.predefined_properties=20=
AS=20predefined_properties,=0A=20=20=20=20=
vm_templates.userdefined_properties=20AS=20userdefined_properties=0AFROM=20=
vm_static=20AS=20vm_templates=0ALEFT=20JOIN=20cluster=0A=20=20=20=20ON=20=
vm_templates.cluster_id=20=3D=20cluster.cluster_id=0ALEFT=20JOIN=20=
storage_pool=0A=20=20=20=20ON=20storage_pool.id=20=3D=20=
cluster.storage_pool_id=0AINNER=20JOIN=20vm_device=0A=20=20=20=20ON=20=
vm_device.vm_id=20=3D=20vm_templates.vm_guid=0ALEFT=20JOIN=20images=0A=20=
=20=20=20ON=20images.image_group_id=20=3D=20vm_device.device_id=0ALEFT=20=
JOIN=20image_storage_domain_map=0A=20=20=20=20ON=20=
image_storage_domain_map.image_id=20=3D=20images.image_guid=0ALEFT=20=
JOIN=20quota=20quota=0A=20=20=20=20ON=20quota.id=20=3D=20=
vm_templates.quota_id=0AWHERE=20entity_type=20=3D=20'TEMPLATE'=0A=20=20=20=
=20OR=20entity_type=20=3D=20'INSTANCE_TYPE'=0A=20=20=20=20OR=20=
entity_type=20=3D=20'IMAGE_TYPE'=0AUNION=0ASELECT=20=
vm_templates_1.vm_guid=20AS=20vmt_guid,=0A=20=20=20=20=
vm_templates_1.vm_name=20AS=20name,=0A=20=20=20=20=
vm_templates_1.mem_size_mb,=0A=20=20=20=20=
vm_templates_1.num_of_io_threads,=0A=20=20=20=20vm_templates_1.os,=0A=20=20=
=20=20vm_templates_1.creation_date,=0A=20=20=20=20=
vm_templates_1.child_count,=0A=20=20=20=20vm_templates_1.num_of_sockets,=0A=
=20=20=20=20vm_templates_1.cpu_per_socket,=0A=20=20=20=20=
vm_templates_1.threads_per_cpu,=0A=20=20=20=20=
vm_templates_1.fn_get_num_of_vcpus=20AS=20num_of_cpus,=20=0A=20=20=20=20=
vm_templates_1.description,=0A=20=20=20=20=
vm_templates_1.free_text_comment,=0A=20=20=20=20=
vm_templates_1.cluster_id,=0A=20=20=20=20vm_templates_1.num_of_monitors,=0A=
=20=20=20=20vm_templates_1.single_qxl_pci,=0A=20=20=20=20=
vm_templates_1.allow_console_reconnect,=0A=20=20=20=20=
vm_templates_1.template_status=20AS=20status,=0A=20=20=20=20=
vm_templates_1.usb_policy,=0A=20=20=20=20vm_templates_1.time_zone,=0A=20=20=
=20=20vm_templates_1.fail_back,=0A=20=20=20=20cluster_1.name=20AS=20=
cluster_name,=0A=20=20=20=20vm_templates_1.vm_type,=0A=20=20=20=20=
vm_templates_1.nice_level,=0A=20=20=20=20vm_templates_1.cpu_shares,=0A=20=
=20=20=20storage_pool_1.id=20AS=20storage_pool_id,=0A=20=20=20=20=
storage_pool_1.name=20AS=20storage_pool_name,=0A=20=20=20=20=
vm_templates_1.default_boot_sequence,=0A=20=20=20=20=
vm_templates_1.default_display_type,=0A=20=20=20=20=
vm_templates_1.priority,=0A=20=20=20=20vm_templates_1.auto_startup,=0A=20=
=20=20=20vm_templates_1.is_stateless,=0A=20=20=20=20=
vm_templates_1.iso_path,=0A=20=20=20=20vm_templates_1.origin,=0A=20=20=20=
=20vm_templates_1.initrd_url,=0A=20=20=20=20vm_templates_1.kernel_url,=0A=
=20=20=20=20vm_templates_1.kernel_params,=0A=20=20=20=20=
image_storage_domain_map.storage_domain_id=20AS=20storage_id,=0A=20=20=20=
=20quota.quota_name=20AS=20quota_name,=0A=20=20=20=20=
vm_templates_1.is_disabled,=0A=20=20=20=20=
vm_templates_1.min_allocated_mem,=0A=20=20=20=20=
vm_templates_1.is_run_and_pause,=0A=20=20=20=20=
vm_templates_1.created_by_user_id,=0A=20=20=20=20=
vm_templates_1.migration_downtime,=0A=20=20=20=20=
vm_templates_1.entity_type,=0A=20=20=20=20cluster_1.architecture,=0A=20=20=
=20=20vm_templates_1.template_version_number=20AS=20=
template_version_number,=0A=20=20=20=20vm_templates_1.vmt_guid=20AS=20=
base_template_id,=0A=20=20=20=20vm_templates_1.template_version_name=20=
AS=20template_version_name,=0A=20=20=20=20=
vm_templates_1.serial_number_policy=20AS=20serial_number_policy,=0A=20=20=
=20=20vm_templates_1.custom_serial_number=20AS=20custom_serial_number,=0A=
=20=20=20=20vm_templates_1.is_boot_menu_enabled=20AS=20=
is_boot_menu_enabled,=0A=20=20=20=20=
vm_templates_1.is_spice_file_transfer_enabled=20AS=20=
is_spice_file_transfer_enabled,=0A=20=20=20=20=
vm_templates_1.is_spice_copy_paste_enabled=20AS=20=
is_spice_copy_paste_enabled,=0A=20=20=20=20vm_templates_1.cpu_profile_id=20=
AS=20cpu_profile_id,=0A=20=20=20=20vm_templates_1.numatune_mode=20AS=20=
numatune_mode,=0A=20=20=20=20vm_templates_1.is_auto_converge=20AS=20=
is_auto_converge,=0A=20=20=20=20vm_templates_1.is_migrate_compressed=20=
AS=20is_migrate_compressed,=0A=20=20=20=20=
vm_templates_1.predefined_properties=20AS=20predefined_properties,=0A=20=20=
=20=20vm_templates_1.userdefined_properties=20AS=20=
userdefined_properties=0AFROM=20vm_static=20AS=20vm_templates_1=0ALEFT=20=
JOIN=20cluster=20AS=20cluster_1=0A=20=20=20=20ON=20=
vm_templates_1.cluster_id=20=3D=20cluster_1.cluster_id=0ALEFT=20JOIN=20=
storage_pool=20AS=20storage_pool_1=0A=20=20=20=20ON=20storage_pool_1.id=20=
=3D=20cluster_1.storage_pool_id=0AINNER=20JOIN=20vm_device=20AS=20=
vm_device_1=0A=20=20=20=20ON=20vm_device_1.vm_id=20=3D=20=
vm_templates_1.vm_guid=0AINNER=20JOIN=20images=20AS=20images_1=0A=20=20=20=
=20ON=20images_1.image_group_id=20=3D=20vm_device_1.device_id=0AINNER=20=
JOIN=20image_storage_domain_map=0A=20=20=20=20ON=20=
image_storage_domain_map.image_id=20=3D=20images_1.image_guid=0ALEFT=20=
JOIN=20quota=20quota=0A=20=20=20=20ON=20quota.id=20=3D=20=
vm_templates_1.quota_id=0AWHERE=20entity_type=20=3D=20'TEMPLATE'=0A=20=20=
=20=20OR=20entity_type=20=3D=20'INSTANCE_TYPE'=0A=20=20=20=20OR=20=
entity_type=20=3D=20'IMAGE_TYPE';=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20vm_templates_view=20AS=0ASELECT=20*=0AFROM=20=
vm_templates_based_view=0AWHERE=20entity_type=20=3D=20'TEMPLATE';=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20vm_templates_storage_domain=20=
AS=0ASELECT=20*=0AFROM=20vm_templates_based_storage_domain=0AWHERE=20=
entity_type=20=3D=20'TEMPLATE';=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
instance_types_view=20AS=0ASELECT=20*=0AFROM=20vm_templates_based_view=0A=
WHERE=20entity_type=20=3D=20'INSTANCE_TYPE';=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
instance_types_storage_domain=20AS=0ASELECT=20*=0AFROM=20=
vm_templates_based_storage_domain=0AWHERE=20entity_type=20=3D=20=
'INSTANCE_TYPE';=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
image_types_view=20AS=0ASELECT=20*=0AFROM=20vm_templates_based_view=0A=
WHERE=20entity_type=20=3D=20'IMAGE_TYPE';=0A**************************=0A=
=0ACREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20VIEW=20image_types_storage_domain=20AS=0ASELECT=20*=0AFROM=20=
vm_templates_based_storage_domain=0AWHERE=20entity_type=20=3D=20=
'IMAGE_TYPE';=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
vm_pool_map_view=20AS=0ASELECT=20vm_pool_map.vm_guid=20AS=20vm_guid,=0A=20=
=20=20=20vm_pool_map.vm_pool_id=20AS=20vm_pool_id,=0A=20=20=20=20=
vm_pools.vm_pool_name=20AS=20vm_pool_name,=0A=20=20=20=20=
vm_pools.spice_proxy=20AS=20vm_pool_spice_proxy=0AFROM=20vm_pool_map=0A=
INNER=20JOIN=20vm_pools=0A=20=20=20=20ON=20vm_pool_map.vm_pool_id=20=3D=20=
vm_pools.vm_pool_id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
tags_vm_pool_map_view=20AS=0ASELECT=20tags.tag_id=20AS=20tag_id,=0A=20=20=
=20=20tags.tag_name=20AS=20tag_name,=0A=20=20=20=20tags.parent_id=20AS=20=
parent_id,=0A=20=20=20=20tags.readonly=20AS=20readonly,=0A=20=20=20=20=
tags.type=20AS=20type,=0A=20=20=20=20tags_vm_pool_map.vm_pool_id=20AS=20=
vm_pool_id=0AFROM=20tags=0AINNER=20JOIN=20tags_vm_pool_map=0A=20=20=20=20=
ON=20tags.tag_id=20=3D=20tags_vm_pool_map.tag_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20tags_vm_map_view=20AS=0A=
SELECT=20tags.tag_id=20AS=20tag_id,=0A=20=20=20=20tags.tag_name=20AS=20=
tag_name,=0A=20=20=20=20tags.parent_id=20AS=20parent_id,=0A=20=20=20=20=
tags.readonly=20AS=20readonly,=0A=20=20=20=20tags.type=20AS=20type,=0A=20=
=20=20=20tags_vm_map.vm_id=20AS=20vm_id=0AFROM=20tags=0AINNER=20JOIN=20=
tags_vm_map=0A=20=20=20=20ON=20tags.tag_id=20=3D=20tags_vm_map.tag_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20tags_vds_map_view=20AS=0A=
SELECT=20tags.tag_id=20AS=20tag_id,=0A=20=20=20=20tags.tag_name=20AS=20=
tag_name,=0A=20=20=20=20tags.parent_id=20AS=20parent_id,=0A=20=20=20=20=
tags.readonly=20AS=20readonly,=0A=20=20=20=20tags.type=20AS=20type,=0A=20=
=20=20=20tags_vds_map.vds_id=20AS=20vds_id=0AFROM=20tags=0AINNER=20JOIN=20=
tags_vds_map=0A=20=20=20=20ON=20tags.tag_id=20=3D=20tags_vds_map.tag_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20tags_user_map_view=20AS=0A=
SELECT=20tags.tag_id=20AS=20tag_id,=0A=20=20=20=20tags.tag_name=20AS=20=
tag_name,=0A=20=20=20=20tags.parent_id=20AS=20parent_id,=0A=20=20=20=20=
tags.readonly=20AS=20readonly,=0A=20=20=20=20tags.type=20AS=20type,=0A=20=
=20=20=20tags_user_map.user_id=20AS=20user_id=0AFROM=20tags=0AINNER=20=
JOIN=20tags_user_map=0A=20=20=20=20ON=20tags.tag_id=20=3D=20=
tags_user_map.tag_id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
tags_user_group_map_view=20AS=0ASELECT=20tags.tag_id=20AS=20tag_id,=0A=20=
=20=20=20tags.tag_name=20AS=20tag_name,=0A=20=20=20=20tags.parent_id=20=
AS=20parent_id,=0A=20=20=20=20tags.readonly=20AS=20readonly,=0A=20=20=20=20=
tags.type=20AS=20type,=0A=20=20=20=20tags_user_group_map.group_id=20AS=20=
group_id=0AFROM=20tags_user_group_map=0AINNER=20JOIN=20tags=0A=20=20=20=20=
ON=20tags_user_group_map.tag_id=20=3D=20tags.tag_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20vms=20AS=0ASELECT=20=
vm_static.vm_name=20AS=20vm_name,=0A=20=20=20=20vm_static.mem_size_mb=20=
AS=20mem_size_mb,=0A=20=20=20=20vm_static.num_of_io_threads=20AS=20=
num_of_io_threads,=0A=20=20=20=20vm_static.nice_level=20AS=20nice_level,=0A=
=20=20=20=20vm_static.cpu_shares=20AS=20cpu_shares,=0A=20=20=20=20=
vm_static.vmt_guid=20AS=20vmt_guid,=0A=20=20=20=20vm_static.os=20AS=20=
os,=0A=20=20=20=20vm_static.description=20AS=20description,=0A=20=20=20=20=
vm_static.free_text_comment=20AS=20free_text_comment,=0A=20=20=20=20=
vm_static.cluster_id=20AS=20cluster_id,=0A=20=20=20=20=
vm_static.creation_date=20AS=20creation_date,=0A=20=20=20=20=
vm_static.auto_startup=20AS=20auto_startup,=0A=20=20=20=20=
vm_static.is_stateless=20AS=20is_stateless,=0A=20=20=20=20=
vm_static.is_smartcard_enabled=20AS=20is_smartcard_enabled,=0A=20=20=20=20=
vm_static.is_delete_protected=20AS=20is_delete_protected,=0A=20=20=20=20=
vm_static.sso_method=20AS=20sso_method,=0A=20=20=20=20=
fn_get_dedicated_hosts_ids_by_vm_id(vm_static.vm_guid)=20AS=20=
dedicated_vm_for_vds,=0A=20=20=20=20vm_static.fail_back=20AS=20=
fail_back,=0A=20=20=20=20vm_static.default_boot_sequence=20AS=20=
default_boot_sequence,=0A=20=20=20=20vm_static.vm_type=20AS=20vm_type,=0A=
=20=20=20=20vm_pool_map_view.vm_pool_spice_proxy=20AS=20=
vm_pool_spice_proxy,=0A=20=20=20=20cluster.name=20AS=20cluster_name,=0A=20=
=20=20=20cluster.transparent_hugepages=20AS=20transparent_hugepages,=0A=20=
=20=20=20cluster.trusted_service=20AS=20trusted_service,=0A=20=20=20=20=
storage_pool.id=20AS=20storage_pool_id,=0A=20=20=20=20storage_pool.name=20=
AS=20storage_pool_name,=0A=20=20=20=20cluster.description=20AS=20=
cluster_description,=0A=20=20=20=20cluster.spice_proxy=20AS=20=
cluster_spice_proxy,=0A=20=20=20=20vm_templates.vm_name=20AS=20vmt_name,=0A=
=20=20=20=20vm_templates.mem_size_mb=20AS=20vmt_mem_size_mb,=0A=20=20=20=20=
vm_templates.os=20AS=20vmt_os,=0A=20=20=20=20vm_templates.creation_date=20=
AS=20vmt_creation_date,=0A=20=20=20=20vm_templates.child_count=20AS=20=
vmt_child_count,=0A=20=20=20=20vm_templates.num_of_sockets=20AS=20=
vmt_num_of_sockets,=0A=20=20=20=20vm_templates.cpu_per_socket=20AS=20=
vmt_cpu_per_socket,=0A=20=20=20=20vm_templates.threads_per_cpu=20AS=20=
vmt_threads_per_cpu,=0A=20=20=20=20vm_templates.fn_get_num_of_vcpus=20AS=20=
vmt_num_of_cpus,=20=0A=20=20=20=20vm_templates.description=20AS=20=
vmt_description,=0A=20=20=20=20vm_dynamic.status=20AS=20status,=0A=20=20=20=
=20vm_dynamic.vm_ip=20AS=20vm_ip,=0A=20=20=20=20=
fn_get_comparable_ip_list(vm_ip)=20AS=20vm_ip_inet_array,=0A=20=20=20=20=
vm_dynamic.vm_host=20AS=20vm_host,=0A=20=20=20=20vm_dynamic.vm_pid=20AS=20=
vm_pid,=0A=20=20=20=20vm_dynamic.last_start_time=20AS=20last_start_time,=0A=
=20=20=20=20vm_dynamic.guest_cur_user_name=20AS=20guest_cur_user_name,=0A=
=20=20=20=20vm_dynamic.console_cur_user_name=20AS=20=
console_cur_user_name,=0A=20=20=20=20vm_dynamic.guest_os=20AS=20=
guest_os,=0A=20=20=20=20vm_dynamic.console_user_id=20AS=20=
console_user_id,=0A=20=20=20=20vm_dynamic.guest_agent_nics_hash=20AS=20=
guest_agent_nics_hash,=0A=20=20=20=20vm_dynamic.run_on_vds=20AS=20=
run_on_vds,=0A=20=20=20=20vm_dynamic.migrating_to_vds=20AS=20=
migrating_to_vds,=0A=20=20=20=20vm_dynamic.app_list=20AS=20app_list,=0A=20=
=20=20=20vm_pool_map_view.vm_pool_name=20AS=20vm_pool_name,=0A=20=20=20=20=
vm_pool_map_view.vm_pool_id=20AS=20vm_pool_id,=0A=20=20=20=20=
vm_static.vm_guid=20AS=20vm_guid,=0A=20=20=20=20=
vm_static.num_of_monitors=20AS=20num_of_monitors,=0A=20=20=20=20=
vm_static.single_qxl_pci=20AS=20single_qxl_pci,=0A=20=20=20=20=
vm_static.allow_console_reconnect=20AS=20allow_console_reconnect,=0A=20=20=
=20=20vm_static.is_initialized=20AS=20is_initialized,=0A=20=20=20=20=
vm_static.num_of_sockets=20AS=20num_of_sockets,=0A=20=20=20=20=
vm_static.cpu_per_socket=20AS=20cpu_per_socket,=0A=20=20=20=20=
vm_static.threads_per_cpu=20AS=20threads_per_cpu,=0A=20=20=20=20=
vm_static.usb_policy=20AS=20usb_policy,=0A=20=20=20=20=
vm_dynamic.acpi_enable=20AS=20acpi_enable,=0A=20=20=20=20=
vm_dynamic.session=20AS=20SESSION,=0A=20=20=20=20=
vm_static.fn_get_num_of_vcpus=20AS=20num_of_cpus,=20=0A=20=20=20=20=
vm_static.quota_id=20AS=20quota_id,=0A=20=20=20=20quota.quota_name=20AS=20=
quota_name,=0A=20=20=20=20storage_pool.quota_enforcement_type=20AS=20=
quota_enforcement_type,=0A=20=20=20=20vm_dynamic.kvm_enable=20AS=20=
kvm_enable,=0A=20=20=20=20vm_dynamic.boot_sequence=20AS=20boot_sequence,=0A=
=20=20=20=20vm_dynamic.utc_diff=20AS=20utc_diff,=0A=20=20=20=20=
vm_dynamic.last_vds_run_on=20AS=20last_vds_run_on,=0A=20=20=20=20=
vm_dynamic.client_ip=20AS=20client_ip,=0A=20=20=20=20=
vm_dynamic.guest_requested_memory=20AS=20guest_requested_memory,=0A=20=20=
=20=20vm_static.time_zone=20AS=20time_zone,=0A=20=20=20=20=
vm_statistics.cpu_user=20AS=20cpu_user,=0A=20=20=20=20=
vm_statistics.cpu_sys=20AS=20cpu_sys,=0A=20=20=20=20=
vm_statistics.memory_usage_history=20AS=20memory_usage_history,=0A=20=20=20=
=20vm_statistics.cpu_usage_history=20AS=20cpu_usage_history,=0A=20=20=20=20=
vm_statistics.network_usage_history=20AS=20network_usage_history,=0A=20=20=
=20=20vm_statistics.elapsed_time=20AS=20elapsed_time,=0A=20=20=20=20=
vm_statistics.usage_network_percent=20AS=20usage_network_percent,=0A=20=20=
=20=20vm_statistics.disks_usage=20AS=20disks_usage,=0A=20=20=20=20=
vm_statistics.usage_mem_percent=20AS=20usage_mem_percent,=0A=20=20=20=20=
vm_statistics.migration_progress_percent=20AS=20=
migration_progress_percent,=0A=20=20=20=20=
vm_statistics.usage_cpu_percent=20AS=20usage_cpu_percent,=0A=20=20=20=20=
vds_static.vds_name=20AS=20run_on_vds_name,=0A=20=20=20=20=
cluster.cpu_name=20AS=20cluster_cpu_name,=0A=20=20=20=20=
vm_static.default_display_type=20AS=20default_display_type,=0A=20=20=20=20=
vm_static.priority=20AS=20priority,=0A=20=20=20=20vm_static.iso_path=20=
AS=20iso_path,=0A=20=20=20=20vm_static.origin=20AS=20origin,=0A=20=20=20=20=
cluster.compatibility_version=20AS=20cluster_compatibility_version,=0A=20=
=20=20=20vm_static.initrd_url=20AS=20initrd_url,=0A=20=20=20=20=
vm_static.kernel_url=20AS=20kernel_url,=0A=20=20=20=20=
vm_static.kernel_params=20AS=20kernel_params,=0A=20=20=20=20=
vm_dynamic.pause_status=20AS=20pause_status,=0A=20=20=20=20=
vm_dynamic.exit_message=20AS=20exit_message,=0A=20=20=20=20=
vm_dynamic.exit_status=20AS=20exit_status,=0A=20=20=20=20=
vm_static.migration_support=20AS=20migration_support,=0A=20=20=20=20=
vm_static.predefined_properties=20AS=20predefined_properties,=0A=20=20=20=
=20vm_static.userdefined_properties=20AS=20userdefined_properties,=0A=20=20=
=20=20vm_static.min_allocated_mem=20AS=20min_allocated_mem,=0A=20=20=20=20=
vm_dynamic.HASH=20AS=20HASH,=0A=20=20=20=20vm_static.cpu_pinning=20AS=20=
cpu_pinning,=0A=20=20=20=20vm_static.db_generation=20AS=20db_generation,=0A=
=20=20=20=20vm_static.host_cpu_flags=20AS=20host_cpu_flags,=0A=20=20=20=20=
vm_static.tunnel_migration=20AS=20tunnel_migration,=0A=20=20=20=20=
vm_static.vnc_keyboard_layout=20AS=20vnc_keyboard_layout,=0A=20=20=20=20=
vm_static.is_run_and_pause=20AS=20is_run_and_pause,=0A=20=20=20=20=
vm_static.created_by_user_id=20AS=20created_by_user_id,=0A=20=20=20=20=
vm_dynamic.last_watchdog_event=20AS=20last_watchdog_event,=0A=20=20=20=20=
vm_dynamic.last_watchdog_action=20AS=20last_watchdog_action,=0A=20=20=20=20=
vm_dynamic.is_run_once=20AS=20is_run_once,=0A=20=20=20=20=
vm_dynamic.vm_fqdn=20AS=20vm_fqdn,=0A=20=20=20=20vm_dynamic.cpu_name=20=
AS=20cpu_name,=0A=20=20=20=20vm_dynamic.emulated_machine=20AS=20=
emulated_machine,=0A=20=20=20=20vm_dynamic.current_cd=20AS=20current_cd,=0A=
=20=20=20=20vm_dynamic.reason=20AS=20reason,=0A=20=20=20=20=
vm_dynamic.exit_reason=20AS=20exit_reason,=0A=20=20=20=20=
vm_static.instance_type_id=20AS=20instance_type_id,=0A=20=20=20=20=
vm_static.image_type_id=20AS=20image_type_id,=0A=20=20=20=20=
cluster.architecture=20AS=20architecture,=0A=20=20=20=20=
vm_static.original_template_id=20AS=20original_template_id,=0A=20=20=20=20=
vm_static.original_template_name=20AS=20original_template_name,=0A=20=20=20=
=20vm_dynamic.last_stop_time=20AS=20last_stop_time,=0A=20=20=20=20=
vm_static.migration_downtime=20AS=20migration_downtime,=0A=20=20=20=20=
vm_static.template_version_number=20AS=20template_version_number,=0A=20=20=
=20=20vm_static.serial_number_policy=20AS=20serial_number_policy,=0A=20=20=
=20=20vm_static.custom_serial_number=20AS=20custom_serial_number,=0A=20=20=
=20=20vm_static.is_boot_menu_enabled=20AS=20is_boot_menu_enabled,=0A=20=20=
=20=20vm_dynamic.guest_cpu_count=20AS=20guest_cpu_count,=0A=20=20=20=20=
vm_snapshots.next_run_config_exists=20AS=20next_run_config_exists,=0A=20=20=
=20=20vm_snapshots.is_previewing_snapshot=20AS=20is_previewing_snapshot,=0A=
=20=20=20=20vm_static.numatune_mode=20AS=20numatune_mode,=0A=20=20=20=20=
vm_static.is_spice_file_transfer_enabled=20AS=20=
is_spice_file_transfer_enabled,=0A=20=20=20=20=
vm_static.is_spice_copy_paste_enabled=20AS=20=
is_spice_copy_paste_enabled,=0A=20=20=20=20vm_static.cpu_profile_id=20AS=20=
cpu_profile_id,=0A=20=20=20=20vm_static.is_auto_converge=20AS=20=
is_auto_converge,=0A=20=20=20=20vm_static.is_migrate_compressed=20AS=20=
is_migrate_compressed,=0A=20=20=20=20vm_static.custom_emulated_machine=20=
AS=20custom_emulated_machine,=0A=20=20=20=20vm_static.custom_cpu_name=20=
AS=20custom_cpu_name,=0A=20=20=20=20vm_dynamic.spice_port=20AS=20=
spice_port,=0A=20=20=20=20vm_dynamic.spice_tls_port=20AS=20=
spice_tls_port,=0A=20=20=20=20vm_dynamic.spice_ip=20AS=20spice_ip,=0A=20=20=
=20=20vm_dynamic.vnc_port=20AS=20vnc_port,=0A=20=20=20=20=
vm_dynamic.vnc_ip=20AS=20vnc_ip,=0A=20=20=20=20=
vm_dynamic.guest_agent_status=20AS=20guest_agent_status,=0A=20=20=20=20=
vm_dynamic.guest_mem_buffered=20AS=20guest_mem_buffered,=0A=20=20=20=20=
vm_dynamic.guest_mem_cached=20AS=20guest_mem_cached,=0A=20=20=20=20=
vm_dynamic.guest_mem_free=20AS=20guest_mem_free,=0A=20=20=20=20=
vm_static.small_icon_id=20AS=20small_icon_id,=0A=20=20=20=20=
vm_static.large_icon_id=20AS=20large_icon_id,=0A=20=20=20=20=
vm_static.migration_policy_id=20as=20migration_policy_id,=0A=20=20=20=20=
vm_static.provider_id=20AS=20provider_id,=0A=20=20=20=20=
vm_static.console_disconnect_action=20AS=20console_disconnect_action,=0A=20=
=20=20=20vm_dynamic.guest_timezone_offset=20AS=20guest_timezone_offset,=0A=
=20=20=20=20vm_dynamic.guest_timezone_name=20AS=20guest_timezone_name,=0A=
=20=20=20=20vm_dynamic.guestos_arch=20AS=20guestos_arch,=0A=20=20=20=20=
vm_dynamic.guestos_codename=20AS=20guestos_codename,=0A=20=20=20=20=
vm_dynamic.guestos_distribution=20AS=20guestos_distribution,=0A=20=20=20=20=
vm_dynamic.guestos_kernel_version=20AS=20guestos_kernel_version,=0A=20=20=
=20=20vm_dynamic.guestos_type=20AS=20guestos_type,=0A=20=20=20=20=
vm_dynamic.guestos_version=20AS=20guestos_version,=0A=20=20=20=20=
vm_static.custom_compatibility_version=20as=20=
custom_compatibility_version,=0A=20=20=20=20vm_dynamic.guest_containers=20=
AS=20guest_containers=0AFROM=20vm_static=0AINNER=20JOIN=20vm_dynamic=0A=20=
=20=20=20ON=20vm_static.vm_guid=20=3D=20vm_dynamic.vm_guid=0AINNER=20=
JOIN=20vm_static=20AS=20vm_templates=0A=20=20=20=20ON=20=
vm_static.vmt_guid=20=3D=20vm_templates.vm_guid=0AINNER=20JOIN=20=
vm_statistics=0A=20=20=20=20ON=20vm_static.vm_guid=20=3D=20=
vm_statistics.vm_guid=0AINNER=20JOIN=20cluster=0A=20=20=20=20ON=20=
vm_static.cluster_id=20=3D=20cluster.cluster_id=0ALEFT=20JOIN=20=
storage_pool=0A=20=20=20=20ON=20vm_static.cluster_id=20=3D=20=
cluster.cluster_id=0A=20=20=20=20=20=20=20=20AND=20=
cluster.storage_pool_id=20=3D=20storage_pool.id=0ALEFT=20JOIN=20quota=0A=20=
=20=20=20ON=20vm_static.quota_id=20=3D=20quota.id=0ALEFT=20JOIN=20=
vds_static=0A=20=20=20=20ON=20vm_dynamic.run_on_vds=20=3D=20=
vds_static.vds_id=0ALEFT=20JOIN=20vm_pool_map_view=0A=20=20=20=20ON=20=
vm_static.vm_guid=20=3D=20vm_pool_map_view.vm_guid=0ALEFT=20JOIN=20(=0A=20=
=20=20=20SELECT=20vm_id,=0A=20=20=20=20=20=20=20=20COUNT(CASE=20=
snapshot_type=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHEN=20=
'NEXT_RUN'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
THEN=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20END)=20>=200=20=
AS=20next_run_config_exists,=0A=20=20=20=20=20=20=20=20COUNT(CASE=20=
snapshot_type=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHEN=20=
'PREVIEW'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
THEN=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20END)=20>=200=20=
AS=20is_previewing_snapshot=0A=20=20=20=20FROM=20snapshots=0A=20=20=20=20=
GROUP=20BY=20vm_id=0A=20=20=20=20)=20vm_snapshots=0A=20=20=20=20ON=20=
vm_static.vm_guid=20=3D=20vm_snapshots.vm_id=0AWHERE=20=
vm_static.entity_type=20=3D=20'VM';=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20vms_with_tags=20AS=0ASELECT=20vms.vm_name,=0A=20=20=20=20=
vms.mem_size_mb,=0A=20=20=20=20vms.num_of_io_threads,=0A=20=20=20=20=
vms.nice_level,=0A=20=20=20=20vms.cpu_shares,=0A=20=20=20=20=
vms.vmt_guid,=0A=20=20=20=20vms.os,=0A=20=20=20=20vms.description,=0A=20=20=
=20=20vms.free_text_comment,=0A=20=20=20=20vms.cluster_id,=0A=20=20=20=20=
vms.creation_date,=0A=20=20=20=20vms.auto_startup,=0A=20=20=20=20=
vms.is_stateless,=0A=20=20=20=20vms.is_smartcard_enabled,=0A=20=20=20=20=
vms.is_delete_protected,=0A=20=20=20=20vms.sso_method,=0A=20=20=20=20=
fn_get_dedicated_hosts_ids_by_vm_id(vms.vm_guid)=20AS=20=
dedicated_vm_for_vds,=0A=20=20=20=20vms.fail_back,=0A=20=20=20=20=
vms.default_boot_sequence,=0A=20=20=20=20vms.vm_type,=0A=20=20=20=20=
vms.cluster_name,=0A=20=20=20=20vms.storage_pool_id,=0A=20=20=20=20=
vms.storage_pool_name,=0A=20=20=20=20vms.cluster_description,=0A=20=20=20=
=20vms.vmt_name,=0A=20=20=20=20vms.vmt_mem_size_mb,=0A=20=20=20=20=
vms.vmt_os,=0A=20=20=20=20vms.vmt_creation_date,=0A=20=20=20=20=
vms.vmt_child_count,=0A=20=20=20=20vms.vmt_num_of_sockets,=0A=20=20=20=20=
vms.vmt_cpu_per_socket,=0A=20=20=20=20vms.vmt_description,=0A=20=20=20=20=
vms.status,=0A=20=20=20=20vms.vm_ip,=0A=20=20=20=20vms.vm_ip_inet_array,=0A=
=20=20=20=20vms.vm_host,=0A=20=20=20=20vms.num_of_cpus=20AS=20=
vmt_num_of_cpus,=0A=20=20=20=20vms.vm_pid,=0A=20=20=20=20=
vms.last_start_time,=0A=20=20=20=20vms.last_stop_time,=0A=20=20=20=20=
vms.guest_cur_user_name,=0A=20=20=20=20vms.console_cur_user_name,=0A=20=20=
=20=20vms.console_user_id,=0A=20=20=20=20vms.guest_os,=0A=20=20=20=20=
vms.run_on_vds,=0A=20=20=20=20vms.migrating_to_vds,=0A=20=20=20=20=
vms.app_list,=0A=20=20=20=20vms.vm_pool_name,=0A=20=20=20=20=
vms.vm_pool_id,=0A=20=20=20=20vms.vm_guid,=0A=20=20=20=20=
vms.num_of_monitors,=0A=20=20=20=20vms.single_qxl_pci,=0A=20=20=20=20=
vms.allow_console_reconnect,=0A=20=20=20=20vms.is_initialized,=0A=20=20=20=
=20vms.num_of_sockets,=0A=20=20=20=20vms.cpu_per_socket,=0A=20=20=20=20=
vms.threads_per_cpu,=0A=20=20=20=20vms.usb_policy,=0A=20=20=20=20=
vms.acpi_enable,=0A=20=20=20=20vms.session,=0A=20=20=20=20=
vms.num_of_cpus=20AS=20num_of_cpus,=0A=20=20=20=20vms.kvm_enable,=0A=20=20=
=20=20vms.boot_sequence,=0A=20=20=20=20vms.utc_diff,=0A=20=20=20=20=
vms.last_vds_run_on,=0A=20=20=20=20vms.client_ip,=0A=20=20=20=20=
vms.guest_requested_memory,=0A=20=20=20=20vms.time_zone,=0A=20=20=20=20=
vms.cpu_user,=0A=20=20=20=20vms.cpu_sys,=0A=20=20=20=20vms.elapsed_time,=0A=
=20=20=20=20vms.usage_network_percent,=0A=20=20=20=20vms.disks_usage,=0A=20=
=20=20=20vms.usage_mem_percent,=0A=20=20=20=20=
vms.migration_progress_percent,=0A=20=20=20=20vms.usage_cpu_percent,=0A=20=
=20=20=20vms.run_on_vds_name,=0A=20=20=20=20vms.cluster_cpu_name,=0A=20=20=
=20=20tags_vm_map_view.tag_name,=0A=20=20=20=20tags_vm_map_view.tag_id,=0A=
=20=20=20=20vms.default_display_type,=0A=20=20=20=20vms.priority,=0A=20=20=
=20=20vms.cluster_compatibility_version,=0A=20=20=20=20vms.initrd_url,=0A=
=20=20=20=20vms.kernel_url,=0A=20=20=20=20vms.kernel_params,=0A=20=20=20=20=
vms.pause_status,=0A=20=20=20=20vms.exit_status,=0A=20=20=20=20=
vms.exit_message,=0A=20=20=20=20vms.min_allocated_mem,=0A=20=20=20=20=
storage_domain_static.id=20AS=20storage_id,=0A=20=20=20=20vms.quota_id=20=
AS=20quota_id,=0A=20=20=20=20vms.quota_name=20AS=20quota_name,=0A=20=20=20=
=20vms.tunnel_migration=20AS=20tunnel_migration,=0A=20=20=20=20=
vms.vnc_keyboard_layout=20AS=20vnc_keyboard_layout,=0A=20=20=20=20=
vms.is_run_and_pause=20AS=20is_run_and_pause,=0A=20=20=20=20=
vms.created_by_user_id=20AS=20created_by_user_id,=0A=20=20=20=20=
vms.vm_fqdn,=0A=20=20=20=20vms.cpu_name=20AS=20cpu_name,=0A=20=20=20=20=
vms.emulated_machine=20AS=20emulated_machine,=0A=20=20=20=20=
vms.custom_emulated_machine=20AS=20custom_emulated_machine,=0A=20=20=20=20=
vms.custom_cpu_name=20AS=20custom_cpu_name,=0A=20=20=20=20=
vms.vm_pool_spice_proxy=20AS=20vm_pool_spice_proxy,=0A=20=20=20=20=
vms.cluster_spice_proxy=20AS=20cluster_spice_proxy,=0A=20=20=20=20=
vms.instance_type_id=20AS=20instance_type_id,=0A=20=20=20=20=
vms.image_type_id=20AS=20image_type_id,=0A=20=20=20=20vms.architecture=20=
AS=20architecture,=0A=20=20=20=20vms.original_template_id=20AS=20=
original_template_id,=0A=20=20=20=20vms.original_template_name=20AS=20=
original_template_name,=0A=20=20=20=20vms.migration_downtime=20AS=20=
migration_downtime,=0A=20=20=20=20vms.template_version_number=20AS=20=
template_version_number,=0A=20=20=20=20vms.current_cd=20AS=20current_cd,=0A=
=20=20=20=20vms.reason=20AS=20reason,=0A=20=20=20=20=
vms.serial_number_policy=20AS=20serial_number_policy,=0A=20=20=20=20=
vms.custom_serial_number=20AS=20custom_serial_number,=0A=20=20=20=20=
vms.exit_reason=20AS=20exit_reason,=0A=20=20=20=20=
vms.is_boot_menu_enabled=20AS=20is_boot_menu_enabled,=0A=20=20=20=20=
vms.guest_cpu_count=20AS=20guest_cpu_count,=0A=20=20=20=20=
vms.next_run_config_exists,=0A=20=20=20=20vms.is_previewing_snapshot,=0A=20=
=20=20=20vms.numatune_mode,=0A=20=20=20=20=
vms.is_spice_file_transfer_enabled,=0A=20=20=20=20=
vms.is_spice_copy_paste_enabled,=0A=20=20=20=20vms.cpu_profile_id,=0A=20=20=
=20=20vms.is_auto_converge,=0A=20=20=20=20vms.is_migrate_compressed,=0A=20=
=20=20=20vms.spice_port,=0A=20=20=20=20vms.spice_tls_port,=0A=20=20=20=20=
vms.spice_ip,=0A=20=20=20=20vms.vnc_port,=0A=20=20=20=20vms.vnc_ip,=0A=20=
=20=20=20vms.guest_agent_status,=0A=20=20=20=20vms.guest_mem_buffered=20=
AS=20guest_mem_buffered,=0A=20=20=20=20vms.guest_mem_cached=20AS=20=
guest_mem_cached,=0A=20=20=20=20vms.guest_mem_free=20AS=20=
guest_mem_free,=0A=20=20=20=20vms.small_icon_id=20AS=20small_icon_id,=0A=20=
=20=20=20vms.large_icon_id=20AS=20large_icon_id,=0A=20=20=20=20=
vms.migration_policy_id=20as=20migration_policy_id,=0A=20=20=20=20=
vms.console_disconnect_action,=0A=20=20=20=20vms.guest_timezone_offset=20=
AS=20guest_timezone_offset,=0A=20=20=20=20vms.guest_timezone_name=20AS=20=
guest_timezone_name,=0A=20=20=20=20vms.guestos_arch=20AS=20guestos_arch,=0A=
=20=20=20=20vms.guestos_codename=20AS=20guestos_codename,=0A=20=20=20=20=
vms.guestos_distribution=20AS=20guestos_distribution,=0A=20=20=20=20=
vms.guestos_kernel_version=20AS=20guestos_kernel_version,=0A=20=20=20=20=
vms.guestos_type=20AS=20guestos_type,=0A=20=20=20=20vms.guestos_version=20=
AS=20guestos_version,=0A=20=20=20=20vms.custom_compatibility_version=20=
as=20custom_compatibility_version,=0A=20=20=20=20vms.guest_containers=20=
as=20guest_containers=0AFROM=20vms=0ALEFT=20JOIN=20tags_vm_map_view=0A=20=
=20=20=20ON=20vms.vm_guid=20=3D=20tags_vm_map_view.vm_id=0ALEFT=20JOIN=20=
vm_device=0A=20=20=20=20ON=20vm_device.vm_id=20=3D=20vms.vm_guid=0ALEFT=20=
JOIN=20images=0A=20=20=20=20ON=20images.image_group_id=20=3D=20=
vm_device.device_id=0ALEFT=20JOIN=20image_storage_domain_map=0A=20=20=20=20=
ON=20image_storage_domain_map.image_id=20=3D=20images.image_guid=0ALEFT=20=
JOIN=20storage_domain_static=0A=20=20=20=20ON=20storage_domain_static.id=20=
=3D=20image_storage_domain_map.storage_domain_id=0AWHERE=20images.active=20=
IS=20NULL=0A=20=20=20=20OR=20images.active=20=3D=20TRUE;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20server_vms=20AS=0ASELECT=20*=0A=
FROM=20vms=0AWHERE=20vm_type=20=3D=20'1';=0A**************************=0A=
=0ACREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20VIEW=20vms_with_plug_info=20AS=0ASELECT=20*=0AFROM=20vms=0A=
INNER=20JOIN=20vm_device=20vd=0A=20=20=20=20ON=20vd.vm_id=20=3D=20=
vms.vm_guid;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20desktop_vms=20AS=0A=
SELECT=20*=0AFROM=20vms=0AWHERE=20vm_type=20=3D=20'0';=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20vds=20AS=0ASELECT=20=
cluster.cluster_id=20AS=20cluster_id,=0A=20=20=20=20cluster.name=20AS=20=
cluster_name,=0A=20=20=20=20cluster.description=20AS=20=
cluster_description,=0A=20=20=20=20cluster.architecture=20AS=20=
architecture,=0A=20=20=20=20cluster.enable_balloon=20AS=20=
enable_balloon,=0A=20=20=20=20vds_static.vds_id=20AS=20vds_id,=0A=20=20=20=
=20vds_static.vds_name=20AS=20vds_name,=0A=20=20=20=20=
vds_static.vds_unique_id=20AS=20vds_unique_id,=0A=20=20=20=20=
vds_static.host_name=20AS=20host_name,=0A=20=20=20=20=
vds_static.free_text_comment=20AS=20free_text_comment,=0A=20=20=20=20=
vds_static.port=20AS=20port,=0A=20=20=20=20vds_static.vds_strength=20AS=20=
vds_strength,=0A=20=20=20=20vds_static.server_SSL_enabled=20AS=20=
server_SSL_enabled,=0A=20=20=20=20vds_static.vds_type=20AS=20vds_type,=0A=
=20=20=20=20vds_static.pm_enabled=20AS=20pm_enabled,=0A=20=20=20=20=
vds_static.pm_proxy_preferences=20AS=20pm_proxy_preferences,=0A=20=20=20=20=
vds_static.pm_detect_kdump=20AS=20pm_detect_kdump,=0A=20=20=20=20=
vds_static.vds_spm_priority=20AS=20vds_spm_priority,=0A=20=20=20=20=
vds_dynamic.hooks=20AS=20hooks,=0A=20=20=20=20vds_dynamic.status=20AS=20=
status,=0A=20=20=20=20vds_dynamic.external_status=20AS=20=
external_status,=0A=20=20=20=20vds_dynamic.cpu_cores=20AS=20cpu_cores,=0A=
=20=20=20=20vds_dynamic.cpu_threads=20AS=20cpu_threads,=0A=20=20=20=20=
vds_dynamic.cpu_model=20AS=20cpu_model,=0A=20=20=20=20=
vds_dynamic.cpu_speed_mh=20AS=20cpu_speed_mh,=0A=20=20=20=20=
vds_dynamic.if_total_speed=20AS=20if_total_speed,=0A=20=20=20=20=
vds_dynamic.kvm_enabled=20AS=20kvm_enabled,=0A=20=20=20=20=
vds_dynamic.physical_mem_mb=20AS=20physical_mem_mb,=0A=20=20=20=20=
vds_dynamic.pending_vcpus_count=20AS=20pending_vcpus_count,=0A=20=20=20=20=
vds_dynamic.pending_vmem_size=20AS=20pending_vmem_size,=0A=20=20=20=20=
vds_dynamic.mem_commited=20AS=20mem_commited,=0A=20=20=20=20=
vds_dynamic.vm_active=20AS=20vm_active,=0A=20=20=20=20=
vds_dynamic.vm_count=20AS=20vm_count,=0A=20=20=20=20=
vds_dynamic.vm_migrating=20AS=20vm_migrating,=0A=20=20=20=20=
vds_dynamic.incoming_migrations=20AS=20incoming_migrations,=0A=20=20=20=20=
vds_dynamic.outgoing_migrations=20AS=20outgoing_migrations,=0A=20=20=20=20=
vds_dynamic.kernel_args=20AS=20kernel_args,=0A=20=20=20=20=
vds_dynamic.pretty_name=20AS=20pretty_name,=0A=20=20=20=20=
vds_dynamic.vms_cores_count=20AS=20vms_cores_count,=0A=20=20=20=20=
vds_statistics.cpu_over_commit_time_stamp=20AS=20=
cpu_over_commit_time_stamp,=0A=20=20=20=20=
cluster.max_vds_memory_over_commit=20AS=20max_vds_memory_over_commit,=0A=20=
=20=20=20vds_dynamic.net_config_dirty=20AS=20net_config_dirty,=0A=20=20=20=
=20cluster.count_threads_as_cores=20AS=20count_threads_as_cores,=0A=20=20=
=20=20storage_pool.id=20AS=20storage_pool_id,=0A=20=20=20=20=
storage_pool.name=20AS=20storage_pool_name,=0A=20=20=20=20=
vds_dynamic.reserved_mem=20AS=20reserved_mem,=0A=20=20=20=20=
vds_dynamic.guest_overhead=20AS=20guest_overhead,=0A=20=20=20=20=
vds_dynamic.rpm_version=20AS=20rpm_version,=0A=20=20=20=20=
vds_dynamic.software_version=20AS=20software_version,=0A=20=20=20=20=
vds_dynamic.version_name=20AS=20version_name,=0A=20=20=20=20=
vds_dynamic.build_name=20AS=20build_name,=0A=20=20=20=20=
vds_dynamic.previous_status=20AS=20previous_status,=0A=20=20=20=20=
vds_statistics.cpu_idle=20AS=20cpu_idle,=0A=20=20=20=20=
vds_statistics.cpu_load=20AS=20cpu_load,=0A=20=20=20=20=
vds_statistics.cpu_sys=20AS=20cpu_sys,=0A=20=20=20=20=
vds_statistics.cpu_user=20AS=20cpu_user,=0A=20=20=20=20=
vds_statistics.usage_mem_percent=20AS=20usage_mem_percent,=0A=20=20=20=20=
vds_statistics.usage_cpu_percent=20AS=20usage_cpu_percent,=0A=20=20=20=20=
vds_statistics.usage_network_percent=20AS=20usage_network_percent,=0A=20=20=
=20=20vds_statistics.mem_available=20AS=20mem_available,=0A=20=20=20=20=
vds_statistics.mem_free=20AS=20mem_free,=0A=20=20=20=20=
vds_statistics.mem_shared=20AS=20mem_shared,=0A=20=20=20=20=
vds_statistics.swap_free=20AS=20swap_free,=0A=20=20=20=20=
vds_statistics.swap_total=20AS=20swap_total,=0A=20=20=20=20=
vds_statistics.ksm_cpu_percent=20AS=20ksm_cpu_percent,=0A=20=20=20=20=
vds_statistics.ksm_pages=20AS=20ksm_pages,=0A=20=20=20=20=
vds_statistics.ksm_state=20AS=20ksm_state,=0A=20=20=20=20=
vds_dynamic.cpu_flags=20AS=20cpu_flags,=0A=20=20=20=20cluster.cpu_name=20=
AS=20cluster_cpu_name,=0A=20=20=20=20vds_dynamic.cpu_sockets=20AS=20=
cpu_sockets,=0A=20=20=20=20vds_spm_id_map.vds_spm_id=20AS=20vds_spm_id,=0A=
=20=20=20=20vds_static.otp_validity=20AS=20otp_validity,=0A=20=20=20=20=
vds_static.openstack_network_provider_id=20AS=20=
openstack_network_provider_id,=0A=20=20=20=20CASE=0A=20=20=20=20=20=20=20=
=20WHEN=20storage_pool.spm_vds_id=20=3D=20vds_static.vds_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20THEN=20CASE=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHEN=20storage_pool.status=20=3D=205=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20THEN=201=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ELSE=202=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20END=0A=20=20=20=20=20=
=20=20=20ELSE=200=0A=20=20=20=20=20=20=20=20END=20AS=20spm_status,=0A=20=20=
=20=20vds_dynamic.supported_cluster_levels=20AS=20=
supported_cluster_levels,=0A=20=20=20=20vds_dynamic.supported_engines=20=
AS=20supported_engines,=0A=20=20=20=20cluster.compatibility_version=20AS=20=
cluster_compatibility_version,=0A=20=20=20=20cluster.virt_service=20AS=20=
cluster_virt_service,=0A=20=20=20=20cluster.gluster_service=20AS=20=
cluster_gluster_service,=0A=20=20=20=20vds_dynamic.host_os=20AS=20=
host_os,=0A=20=20=20=20vds_dynamic.kvm_version=20AS=20kvm_version,=0A=20=20=
=20=20vds_dynamic.libvirt_version=20AS=20libvirt_version,=0A=20=20=20=20=
vds_dynamic.spice_version=20AS=20spice_version,=0A=20=20=20=20=
vds_dynamic.gluster_version=20AS=20gluster_version,=0A=20=20=20=20=
vds_dynamic.librbd1_version=20AS=20librbd1_version,=0A=20=20=20=20=
vds_dynamic.glusterfs_cli_version=20AS=20glusterfs_cli_version,=0A=20=20=20=
=20vds_dynamic.kernel_version=20AS=20kernel_version,=0A=20=20=20=20=
vds_dynamic.iscsi_initiator_name=20AS=20iscsi_initiator_name,=0A=20=20=20=
=20vds_dynamic.transparent_hugepages_state=20AS=20=
transparent_hugepages_state,=0A=20=20=20=20=
vds_statistics.anonymous_hugepages=20AS=20anonymous_hugepages,=0A=20=20=20=
=20vds_dynamic.non_operational_reason=20AS=20non_operational_reason,=0A=20=
=20=20=20vds_static.recoverable=20AS=20recoverable,=0A=20=20=20=20=
vds_static.sshKeyFingerprint=20AS=20sshKeyFingerprint,=0A=20=20=20=20=
vds_static.host_provider_id=20AS=20host_provider_id,=0A=20=20=20=20=
vds_dynamic.hw_manufacturer=20AS=20hw_manufacturer,=0A=20=20=20=20=
vds_dynamic.hw_product_name=20AS=20hw_product_name,=0A=20=20=20=20=
vds_dynamic.hw_version=20AS=20hw_version,=0A=20=20=20=20=
vds_dynamic.hw_serial_number=20AS=20hw_serial_number,=0A=20=20=20=20=
vds_dynamic.hw_uuid=20AS=20hw_uuid,=0A=20=20=20=20vds_dynamic.hw_family=20=
AS=20hw_family,=0A=20=20=20=20vds_static.console_address=20AS=20=
console_address,=0A=20=20=20=20vds_dynamic.hbas=20AS=20hbas,=0A=20=20=20=20=
vds_dynamic.supported_emulated_machines=20AS=20=
supported_emulated_machines,=0A=20=20=20=20=
vds_dynamic.supported_rng_sources=20AS=20supported_rng_sources,=0A=20=20=20=
=20vds_static.ssh_port=20AS=20ssh_port,=0A=20=20=20=20=
vds_static.ssh_username=20AS=20ssh_username,=0A=20=20=20=20=
vds_statistics.ha_score=20AS=20ha_score,=0A=20=20=20=20=
vds_statistics.ha_configured=20AS=20ha_configured,=0A=20=20=20=20=
vds_statistics.ha_active=20AS=20ha_active,=0A=20=20=20=20=
vds_statistics.ha_global_maintenance=20AS=20ha_global_maintenance,=0A=20=20=
=20=20vds_statistics.ha_local_maintenance=20AS=20ha_local_maintenance,=0A=
=20=20=20=20vds_static.disable_auto_pm=20AS=20disable_auto_pm,=0A=20=20=20=
=20vds_dynamic.controlled_by_pm_policy=20AS=20controlled_by_pm_policy,=0A=
=20=20=20=20vds_statistics.boot_time=20AS=20boot_time,=0A=20=20=20=20=
vds_dynamic.kdump_status=20AS=20kdump_status,=0A=20=20=20=20=
vds_dynamic.selinux_enforce_mode=20AS=20selinux_enforce_mode,=0A=20=20=20=
=20vds_dynamic.auto_numa_balancing=20AS=20auto_numa_balancing,=0A=20=20=20=
=20vds_dynamic.is_numa_supported=20AS=20is_numa_supported,=0A=20=20=20=20=
vds_static.protocol=20AS=20protocol,=0A=20=20=20=20=
vds_dynamic.online_cpus=20AS=20online_cpus,=0A=20=20=20=20=
fence_agents.id=20AS=20agent_id,=0A=20=20=20=20fence_agents.agent_order=20=
AS=20agent_order,=0A=20=20=20=20fence_agents.ip=20AS=20agent_ip,=0A=20=20=
=20=20fence_agents.type=20AS=20agent_type,=0A=20=20=20=20=
fence_agents.agent_user=20AS=20agent_user,=0A=20=20=20=20=
fence_agents.agent_password=20AS=20agent_password,=0A=20=20=20=20=
fence_agents.port=20AS=20agent_port,=0A=20=20=20=20fence_agents.options=20=
AS=20agent_options,=0A=20=20=20=20vds_dynamic.maintenance_reason=20AS=20=
maintenance_reason,=0A=20=20=20=20fence_agents.encrypt_options=20AS=20=
agent_encrypt_options,=0A=20=20=20=20vds_dynamic.is_update_available=20=
AS=20is_update_available,=0A=20=20=20=20vds_dynamic.is_hostdev_enabled=20=
AS=20is_hostdev_enabled,=0A=20=20=20=20=0A=20=20=20=20=
vds_dynamic.vm_count=20>=200=0A=20=20=20=20=20=20=20=20AND=20=
vds_statistics.ha_score=20IS=20NOT=20NULL=0A=20=20=20=20=20=20=20=20AND=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=
=20=20=20=20=20=20=20=20FROM=20vm_dynamic=0A=20=20=20=20=20=20=20=20=20=20=
=20=20LEFT=20JOIN=20vm_static=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20ON=20vm_dynamic.vm_guid=20=3D=20vm_static.vm_guid=0A=20=20=20=20=20=
=20=20=20=20=20=20=20WHERE=20vds_static.vds_id=20=3D=20=
vm_dynamic.run_on_vds=0A=20=20=20=20=20=20=20=20=20=20=20=20=0A=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20vm_static.origin=20IN=20(5,6))=20AS=20=
is_hosted_engine_host,=0A=20=20=20=20vds_static.kernel_cmdline=20AS=20=
kernel_cmdline,=0A=20=20=20=20vds_static.last_stored_kernel_cmdline=20AS=20=
last_stored_kernel_cmdline,=0A=20=20=20=20gluster_server.peer_status=20=
AS=20gluster_peer_status=0AFROM=20cluster=0AINNER=20JOIN=20vds_static=0A=20=
=20=20=20ON=20cluster.cluster_id=20=3D=20vds_static.cluster_id=0AINNER=20=
JOIN=20vds_dynamic=0A=20=20=20=20ON=20vds_static.vds_id=20=3D=20=
vds_dynamic.vds_id=0AINNER=20JOIN=20vds_statistics=0A=20=20=20=20ON=20=
vds_static.vds_id=20=3D=20vds_statistics.vds_id=0ALEFT=20JOIN=20=
storage_pool=0A=20=20=20=20ON=20cluster.storage_pool_id=20=3D=20=
storage_pool.id=0ALEFT=20JOIN=20fence_agents=0A=20=20=20=20ON=20=
vds_static.vds_id=20=3D=20fence_agents.vds_id=0ALEFT=20JOIN=20=
vds_spm_id_map=0A=20=20=20=20ON=20vds_static.vds_id=20=3D=20=
vds_spm_id_map.vds_id=0ALEFT=20JOIN=20gluster_server=0A=20=20=20=20ON=20=
vds_static.vds_id=20=3D=20gluster_server.server_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20vds_with_tags=20AS=0ASELECT=20=
cluster.cluster_id,=0A=20=20=20=20cluster.name=20AS=20cluster_name,=0A=20=
=20=20=20cluster.description=20AS=20cluster_description,=0A=20=20=20=20=
cluster.architecture=20AS=20architecture,=0A=20=20=20=20=
vds_static.vds_id,=0A=20=20=20=20vds_static.vds_name,=0A=20=20=20=20=
vds_static.vds_unique_id,=0A=20=20=20=20vds_static.host_name,=0A=20=20=20=
=20vds_static.free_text_comment,=0A=20=20=20=20vds_static.port,=0A=20=20=20=
=20vds_static.vds_strength,=0A=20=20=20=20vds_static.server_SSL_enabled,=0A=
=20=20=20=20vds_static.vds_type,=0A=20=20=20=20=
vds_dynamic.hw_product_name,=0A=20=20=20=20vds_dynamic.hw_version,=0A=20=20=
=20=20vds_dynamic.hw_serial_number,=0A=20=20=20=20vds_dynamic.hw_uuid,=0A=
=20=20=20=20vds_dynamic.hw_family,=0A=20=20=20=20vds_static.pm_enabled,=0A=
=20=20=20=20vds_static.pm_proxy_preferences=20AS=20pm_proxy_preferences,=0A=
=20=20=20=20vds_static.pm_detect_kdump=20AS=20pm_detect_kdump,=0A=20=20=20=
=20vds_dynamic.hooks,=0A=20=20=20=20vds_dynamic.status,=0A=20=20=20=20=
vds_dynamic.external_status,=0A=20=20=20=20vds_dynamic.cpu_cores,=0A=20=20=
=20=20vds_dynamic.cpu_threads,=0A=20=20=20=20vds_dynamic.kernel_args,=0A=20=
=20=20=20vds_dynamic.pretty_name,=0A=20=20=20=20vds_dynamic.cpu_model,=0A=
=20=20=20=20vds_dynamic.cpu_speed_mh,=0A=20=20=20=20=
vds_dynamic.if_total_speed,=0A=20=20=20=20vds_dynamic.kvm_enabled,=0A=20=20=
=20=20vds_dynamic.physical_mem_mb,=0A=20=20=20=20=
vds_dynamic.pending_vcpus_count,=0A=20=20=20=20=
vds_dynamic.pending_vmem_size,=0A=20=20=20=20vds_dynamic.mem_commited,=0A=
=20=20=20=20vds_dynamic.vm_active,=0A=20=20=20=20vds_dynamic.vm_count,=0A=
=20=20=20=20vds_dynamic.vm_migrating,=0A=20=20=20=20=
vds_dynamic.incoming_migrations,=0A=20=20=20=20=
vds_dynamic.outgoing_migrations,=0A=20=20=20=20=
vds_dynamic.vms_cores_count,=0A=20=20=20=20=
vds_statistics.cpu_over_commit_time_stamp,=0A=20=20=20=20=
vds_dynamic.net_config_dirty,=0A=20=20=20=20=
cluster.max_vds_memory_over_commit,=0A=20=20=20=20=
cluster.count_threads_as_cores,=0A=20=20=20=20storage_pool.id=20AS=20=
storage_pool_id,=0A=20=20=20=20storage_pool.name=20AS=20=
storage_pool_name,=0A=20=20=20=20tags_vds_map_view.tag_name,=0A=20=20=20=20=
tags_vds_map_view.tag_id,=0A=20=20=20=20vds_dynamic.reserved_mem,=0A=20=20=
=20=20vds_dynamic.guest_overhead,=0A=20=20=20=20vds_dynamic.rpm_version,=0A=
=20=20=20=20vds_dynamic.software_version,=0A=20=20=20=20=
vds_dynamic.version_name,=0A=20=20=20=20vds_dynamic.build_name,=0A=20=20=20=
=20vds_dynamic.previous_status,=0A=20=20=20=20vds_statistics.cpu_idle,=0A=
=20=20=20=20vds_statistics.cpu_load,=0A=20=20=20=20=
vds_statistics.cpu_sys,=0A=20=20=20=20vds_statistics.cpu_user,=0A=20=20=20=
=20vds_statistics.usage_mem_percent,=0A=20=20=20=20=
vds_statistics.usage_cpu_percent,=0A=20=20=20=20=
vds_statistics.usage_network_percent,=0A=20=20=20=20=
vds_statistics.mem_available,=0A=20=20=20=20vds_statistics.mem_free,=0A=20=
=20=20=20vds_statistics.mem_shared,=0A=20=20=20=20=
vds_statistics.swap_free,=0A=20=20=20=20vds_statistics.swap_total,=0A=20=20=
=20=20vds_statistics.ksm_cpu_percent,=0A=20=20=20=20=
vds_statistics.ksm_pages,=0A=20=20=20=20vds_statistics.ksm_state,=0A=20=20=
=20=20vds_dynamic.cpu_flags,=0A=20=20=20=20cluster.cpu_name=20AS=20=
cluster_cpu_name,=0A=20=20=20=20vds_dynamic.cpu_sockets,=0A=20=20=20=20=
vds_spm_id_map.vds_spm_id,=0A=20=20=20=20vds_static.otp_validity=20AS=20=
otp_validity,=0A=20=20=20=20vds_static.console_address=20AS=20=
console_address,=0A=20=20=20=20CASE=0A=20=20=20=20=20=20=20=20WHEN=20=
storage_pool.spm_vds_id=20=3D=20vds_static.vds_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20THEN=20CASE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHEN=20storage_pool.status=20=3D=205=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20THEN=201=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ELSE=202=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20END=0A=20=20=20=20=20=20=20=20=
ELSE=200=0A=20=20=20=20=20=20=20=20END=20AS=20spm_status,=0A=20=20=20=20=
vds_dynamic.supported_cluster_levels,=0A=20=20=20=20=
vds_dynamic.supported_engines,=0A=20=20=20=20=
cluster.compatibility_version=20AS=20cluster_compatibility_version,=0A=20=
=20=20=20vds_dynamic.host_os,=0A=20=20=20=20vds_dynamic.kvm_version,=0A=20=
=20=20=20vds_dynamic.libvirt_version,=0A=20=20=20=20=
vds_dynamic.spice_version,=0A=20=20=20=20vds_dynamic.gluster_version,=0A=20=
=20=20=20vds_dynamic.librbd1_version,=0A=20=20=20=20=
vds_dynamic.glusterfs_cli_version,=0A=20=20=20=20=
vds_dynamic.kernel_version,=0A=20=20=20=20=
vds_dynamic.iscsi_initiator_name,=0A=20=20=20=20=
vds_dynamic.transparent_hugepages_state,=0A=20=20=20=20=
vds_statistics.anonymous_hugepages,=0A=20=20=20=20=
vds_dynamic.non_operational_reason,=0A=20=20=20=20=
storage_pool_iso_map.storage_id,=0A=20=20=20=20vds_static.ssh_port,=0A=20=
=20=20=20vds_static.ssh_username,=0A=20=20=20=20vds_statistics.ha_score,=0A=
=20=20=20=20vds_statistics.ha_configured,=0A=20=20=20=20=
vds_statistics.ha_active,=0A=20=20=20=20=
vds_statistics.ha_global_maintenance,=0A=20=20=20=20=
vds_statistics.ha_local_maintenance,=0A=20=20=20=20=
vds_static.disable_auto_pm=20AS=20disable_auto_pm,=0A=20=20=20=20=
vds_dynamic.controlled_by_pm_policy=20AS=20controlled_by_pm_policy,=0A=20=
=20=20=20vds_statistics.boot_time,=0A=20=20=20=20=
vds_dynamic.kdump_status=20AS=20kdump_status,=0A=20=20=20=20=
vds_dynamic.selinux_enforce_mode=20AS=20selinux_enforce_mode,=0A=20=20=20=
=20vds_dynamic.auto_numa_balancing=20AS=20auto_numa_balancing,=0A=20=20=20=
=20vds_dynamic.is_numa_supported=20AS=20is_numa_supported,=0A=20=20=20=20=
vds_dynamic.supported_rng_sources=20AS=20supported_rng_sources,=0A=20=20=20=
=20vds_static.protocol=20AS=20protocol,=0A=20=20=20=20=
vds_dynamic.online_cpus=20AS=20online_cpus,=0A=20=20=20=20=
fence_agents.id=20AS=20agent_id,=0A=20=20=20=20fence_agents.agent_order=20=
AS=20agent_order,=0A=20=20=20=20fence_agents.ip=20AS=20agent_ip,=0A=20=20=
=20=20fence_agents.type=20AS=20agent_type,=0A=20=20=20=20=
fence_agents.agent_user=20AS=20agent_user,=0A=20=20=20=20=
fence_agents.agent_password=20AS=20agent_password,=0A=20=20=20=20=
fence_agents.port=20AS=20agent_port,=0A=20=20=20=20fence_agents.options=20=
AS=20agent_options,=0A=20=20=20=20vds_dynamic.maintenance_reason=20AS=20=
maintenance_reason,=0A=20=20=20=20vds_dynamic.is_update_available=20AS=20=
is_update_available,=0A=20=20=20=20vds_dynamic.is_hostdev_enabled=20AS=20=
is_hostdev_enabled=0AFROM=20cluster=0AINNER=20JOIN=20vds_static=0A=20=20=20=
=20ON=20cluster.cluster_id=20=3D=20vds_static.cluster_id=0AINNER=20JOIN=20=
vds_dynamic=0A=20=20=20=20ON=20vds_static.vds_id=20=3D=20=
vds_dynamic.vds_id=0AINNER=20JOIN=20vds_statistics=0A=20=20=20=20ON=20=
vds_static.vds_id=20=3D=20vds_statistics.vds_id=0ALEFT=20JOIN=20=
storage_pool=0A=20=20=20=20ON=20cluster.storage_pool_id=20=3D=20=
storage_pool.id=0ALEFT=20JOIN=20tags_vds_map_view=0A=20=20=20=20ON=20=
vds_static.vds_id=20=3D=20tags_vds_map_view.vds_id=0ALEFT=20JOIN=20=
fence_agents=0A=20=20=20=20ON=20vds_static.vds_id=20=3D=20=
fence_agents.vds_id=0ALEFT=20JOIN=20vds_spm_id_map=0A=20=20=20=20ON=20=
vds_static.vds_id=20=3D=20vds_spm_id_map.vds_id=0ALEFT=20JOIN=20=
storage_pool_iso_map=0A=20=20=20=20ON=20=
storage_pool_iso_map.storage_pool_id=20=3D=20storage_pool.id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
users_and_groups_to_vm_pool_map_view=20AS=0ASELECT=20p.vm_pool_id=20AS=20=
vm_pool_id,=0A=20=20=20=20p.vm_pool_name=20AS=20vm_pool_name,=0A=20=20=20=
=20per.ad_element_id=20AS=20user_id=0AFROM=20vm_pools=20AS=20p=0AINNER=20=
JOIN=20permissions=20AS=20per=0A=20=20=20=20ON=20per.object_id=20=3D=20=
p.vm_pool_id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
vdc_users=20AS=0ASELECT=20'user'=20AS=20user_group,=0A=20=20=20=20=
users_1.name=20AS=20name,=0A=20=20=20=20users_1.user_id=20AS=20user_id,=0A=
=20=20=20=20users_1.surname=20AS=20surname,=0A=20=20=20=20users_1.domain=20=
AS=20DOMAIN,=0A=20=20=20=20users_1.username=20AS=20username,=0A=20=20=20=20=
users_1.department=20AS=20department,=0A=20=20=20=20users_1.email=20AS=20=
email,=0A=20=20=20=20users_1.note=20AS=20note,=0A=20=20=20=200=20AS=20=
vm_admin,=0A=20=20=20=20users_1.last_admin_check_status=20AS=20=
last_admin_check_status,=0A=20=20=20=20users_1.external_id=20AS=20=
external_id,=0A=20=20=20=20users_1.namespace=20AS=20namespace=0AFROM=20=
users=20AS=20users_1=0AUNION=0ASELECT=20'group'=20AS=20user_group,=0A=20=20=
=20=20ad_groups.name=20AS=20name,=0A=20=20=20=20ad_groups.id=20AS=20id,=0A=
=20=20=20=20''=20AS=20surname,=0A=20=20=20=20ad_groups.domain=20AS=20=
DOMAIN,=0A=20=20=20=20''=20AS=20username,=0A=20=20=20=20''=20AS=20=
department,=0A=20=20=20=20''=20AS=20email,=0A=20=20=20=20''=20AS=20note,=0A=
=20=20=20=201=20AS=20vm_admin,=0A=20=20=20=20NULL=20AS=20=
last_admin_check_status,=0A=20=20=20=20ad_groups.external_id=20AS=20=
external_id,=0A=20=20=20=20ad_groups.namespace=20AS=20namespace=0AFROM=20=
ad_groups;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20vdc_users_with_tags=20=
AS=0ASELECT=20users_1.user_group=20AS=20user_group,=0A=20=20=20=20=
users_1.name=20AS=20name,=0A=20=20=20=20permissions.object_id=20AS=20=
vm_guid,=0A=20=20=20=20users_1.user_id=20AS=20user_id,=0A=20=20=20=20=
users_1.surname=20AS=20surname,=0A=20=20=20=20users_1.domain=20AS=20=
DOMAIN,=0A=20=20=20=20users_1.username=20AS=20username,=0A=20=20=20=20=
users_1.department=20AS=20department,=0A=20=20=20=20roles1.name=20AS=20=
mla_role,=0A=20=20=20=20users_1.email=20AS=20email,=0A=20=20=20=20=
users_1.note=20AS=20note,=0A=20=20=20=20users_1.vm_admin=20AS=20=
vm_admin,=0A=20=20=20=20tags_user_map_view_1.tag_name=20AS=20tag_name,=0A=
=20=20=20=20tags_user_map_view_1.tag_id=20AS=20tag_id,=0A=20=20=20=20=
users_1.last_admin_check_status=20AS=20last_admin_check_status,=0A=20=20=20=
=20pools.vm_pool_name=20AS=20vm_pool_name=0AFROM=20vdc_users=20AS=20=
users_1=0ALEFT=20JOIN=20users_and_groups_to_vm_pool_map_view=20AS=20=
pools=0A=20=20=20=20ON=20users_1.user_id=20=3D=20pools.user_id=0ALEFT=20=
JOIN=20permissions=0A=20=20=20=20ON=20users_1.user_id=20=3D=20=
permissions.ad_element_id=0ALEFT=20JOIN=20tags=0A=20=20=20=20ON=20=
tags.type=20=3D=201=0ALEFT=20JOIN=20tags_user_map_view=20AS=20=
tags_user_map_view_1=0A=20=20=20=20ON=20users_1.user_id=20=3D=20=
tags_user_map_view_1.user_id=0ALEFT=20JOIN=20roles=20AS=20roles1=0A=20=20=
=20=20ON=20roles1.id=20=3D=20permissions.role_id=0AWHERE=20=
(users_1.user_group=20=3D=20'user')=0AUNION=0ASELECT=20=
users_2.user_group=20AS=20user_group,=0A=20=20=20=20users_2.name=20AS=20=
name,=0A=20=20=20=20permissions_1.object_id=20AS=20vm_guid,=0A=20=20=20=20=
users_2.user_id=20AS=20user_id,=0A=20=20=20=20users_2.surname=20AS=20=
surname,=0A=20=20=20=20users_2.domain=20AS=20DOMAIN,=0A=20=20=20=20=
users_2.username=20AS=20username,=0A=20=20=20=20users_2.department=20AS=20=
department,=0A=20=20=20=20roles2.name=20AS=20mla_role,=0A=20=20=20=20=
users_2.email=20AS=20email,=0A=20=20=20=20users_2.note=20AS=20note,=0A=20=
=20=20=20users_2.vm_admin=20AS=20vm_admin,=0A=20=20=20=20=
tags_user_group_map_view.tag_name=20AS=20tag_name,=0A=20=20=20=20=
tags_user_group_map_view.tag_id=20AS=20tag_id,=0A=20=20=20=20=
users_2.last_admin_check_status=20AS=20last_admin_check_status,=0A=20=20=20=
=20pools1.vm_pool_name=20AS=20vm_pool_name=0AFROM=20vdc_users=20AS=20=
users_2=0ALEFT=20JOIN=20users_and_groups_to_vm_pool_map_view=20AS=20=
pools1=0A=20=20=20=20ON=20users_2.user_id=20=3D=20pools1.user_id=0ALEFT=20=
JOIN=20permissions=20AS=20permissions_1=0A=20=20=20=20ON=20=
users_2.user_id=20=3D=20permissions_1.ad_element_id=0ALEFT=20JOIN=20tags=20=
AS=20tags_1=0A=20=20=20=20ON=20tags_1.type=20=3D=201=0ALEFT=20JOIN=20=
tags_user_group_map_view=0A=20=20=20=20ON=20users_2.user_id=20=3D=20=
tags_user_group_map_view.group_id=0ALEFT=20JOIN=20roles=20AS=20roles2=0A=20=
=20=20=20ON=20roles2.id=20=3D=20permissions_1.role_id=0AWHERE=20=
(users_2.user_group=20=3D=20'group');=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20vm_pools_view=20AS=0ASELECT=20vm_pools.vm_pool_id,=0A=20=20=20=20=
vm_pools.vm_pool_name,=0A=20=20=20=20vm_pools.vm_pool_description,=0A=20=20=
=20=20vm_pools.vm_pool_comment,=0A=20=20=20=20vm_pools.vm_pool_type,=0A=20=
=20=20=20vm_pools.stateful,=0A=20=20=20=20vm_pools.parameters,=0A=20=20=20=
=20vm_pools.prestarted_vms,=0A=20=20=20=20vm_pools.cluster_id,=0A=20=20=20=
=20cluster.name=20AS=20cluster_name,=0A=20=20=20=20cluster.architecture=20=
AS=20architecture,=0A=20=20=20=20storage_pool.name=20AS=20=
storage_pool_name,=0A=20=20=20=20storage_pool.id=20AS=20storage_pool_id,=0A=
=20=20=20=20vm_pools.max_assigned_vms_per_user=20AS=20=
max_assigned_vms_per_user,=0A=20=20=20=20vm_pools.spice_proxy=20AS=20=
spice_proxy,=0A=20=20=20=20vm_pools.is_being_destroyed=20AS=20=
is_being_destroyed=0AFROM=20vm_pools=0AINNER=20JOIN=20cluster=0A=20=20=20=
=20ON=20vm_pools.cluster_id=20=3D=20cluster.cluster_id=0ALEFT=20JOIN=20=
storage_pool=0A=20=20=20=20ON=20storage_pool.id=20=3D=20=
cluster.storage_pool_id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
vm_pools_full_view=20AS=0ASELECT=20vmp.vm_pool_id,=0A=20=20=20=20=
vmp.vm_pool_name,=0A=20=20=20=20vmp.vm_pool_description,=0A=20=20=20=20=
vmp.vm_pool_comment,=0A=20=20=20=20vmp.vm_pool_type,=0A=20=20=20=20=
vmp.stateful,=0A=20=20=20=20vmp.parameters,=0A=20=20=20=20=
vmp.prestarted_vms,=0A=20=20=20=20vmp.cluster_id,=0A=20=20=20=20=
vmp.cluster_name,=0A=20=20=20=20vmp.architecture,=0A=20=20=20=20=
vmp.max_assigned_vms_per_user,=0A=20=20=20=20vmp.spice_proxy=20AS=20=
spice_proxy,=0A=20=20=20=20(=0A=20=20=20=20=20=20=20=20SELECT=20=
COUNT(vm_pool_map.vm_pool_id)=20AS=20expr1=0A=20=20=20=20=20=20=20=20=
FROM=20vm_pools_view=20v1=0A=20=20=20=20=20=20=20=20LEFT=20JOIN=20=
vm_pool_map=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20v1.vm_pool_id=20=3D=
=20vm_pool_map.vm_pool_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20v1.vm_pool_id=20=3D=20vmp.vm_pool_id=0A=20=20=20=20=20=20=20=20=
)=20AS=20assigned_vm_count,=0A=20=20=20=20(=0A=20=20=20=20=20=20=20=20=
SELECT=20COUNT(v2.vm_pool_id)=20AS=20expr1=0A=20=20=20=20=20=20=20=20=
FROM=20vm_pools=20v2=0A=20=20=20=20=20=20=20=20LEFT=20JOIN=20vm_pool_map=20=
vm_pool_map_1=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20v2.vm_pool_id=20=
=3D=20vm_pool_map_1.vm_pool_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20AND=20v2.vm_pool_id=20=3D=20vmp.vm_pool_id=0A=20=20=20=20=20=20=20=20=
LEFT=20JOIN=20vm_dynamic=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
vm_pool_map_1.vm_guid=20=3D=20vm_dynamic.vm_guid=0A=20=20=20=20=20=20=20=20=
WHERE=20vm_dynamic.status=20<>=20ALL=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20ARRAY=20[=200,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=2015=20]=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20GROUP=20BY=20v2.vm_pool_id=0A=20=20=20=20=20=20=20=20=
)=20AS=20vm_running_count,=0A=20=20=20=20vmp.storage_pool_name,=0A=20=20=20=
=20vmp.storage_pool_id,=0A=20=20=20=20vmp.is_being_destroyed=0AFROM=20=
vm_pools_view=20vmp;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
permissions_view=20AS=0ASELECT=20permissions.id=20AS=20id,=0A=20=20=20=20=
permissions.role_id=20AS=20role_id,=0A=20=20=20=20=
permissions.ad_element_id=20AS=20ad_element_id,=0A=20=20=20=20=
permissions.object_id=20AS=20object_id,=0A=20=20=20=20=
permissions.object_type_id=20AS=20object_type_id,=0A=20=20=20=20=
roles.name=20AS=20role_name,=0A=20=20=20=20roles.role_type=20AS=20=
role_type,=0A=20=20=20=20roles.allows_viewing_children=20AS=20=
allows_viewing_children,=0A=20=20=20=20roles.app_mode=20AS=20app_mode,=0A=
=20=20=20=20fn_get_entity_name(permissions.object_id,=20=
permissions.object_type_id)=20AS=20object_name,=0A=20=20=20=20=
(fn_authz_entry_info(permissions.ad_element_id)).name=20AS=20owner_name,=0A=
=20=20=20=20(fn_authz_entry_info(permissions.ad_element_id)).namespace=20=
AS=20namespace,=0A=20=20=20=20=
(fn_authz_entry_info(permissions.ad_element_id)).authz=20AS=20authz,=0A=20=
=20=20=20permissions.creation_date=20AS=20creation_date=0AFROM=20=
permissions=0AINNER=20JOIN=20roles=0A=20=20=20=20ON=20=
permissions.role_id=20=3D=20roles.id;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20internal_permissions_view=20AS=0ASELECT=20permissions.id=20AS=20=
id,=0A=20=20=20=20permissions.role_id=20AS=20role_id,=0A=20=20=20=20=
permissions.ad_element_id=20AS=20ad_element_id,=0A=20=20=20=20=
permissions.object_id=20AS=20object_id,=0A=20=20=20=20=
permissions.object_type_id=20AS=20object_type_id,=0A=20=20=20=20=
roles.name=20AS=20role_name,=0A=20=20=20=20roles.role_type=20AS=20=
role_type,=0A=20=20=20=20roles.allows_viewing_children=20AS=20=
allows_viewing_children=0AFROM=20permissions=0AINNER=20JOIN=20roles=0A=20=
=20=20=20ON=20permissions.role_id=20=3D=20roles.id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0A/*************************************************=0A=20=20=20=
=20=20=20=20=20vds/vm/=20interface=20view=0A=
*************************************************/=0ACREATE=20OR=20=
REPLACE=20VIEW=20vds_interface_view=20AS=0ASELECT=20=
vds_interface_statistics.rx_rate,=0A=20=20=20=20=
vds_interface_statistics.tx_rate,=0A=20=20=20=20=
vds_interface_statistics.rx_drop,=0A=20=20=20=20=
vds_interface_statistics.tx_drop,=0A=20=20=20=20=
vds_interface_statistics.rx_total,=0A=20=20=20=20=
vds_interface_statistics.tx_total,=0A=20=20=20=20=
vds_interface_statistics.rx_offset,=0A=20=20=20=20=
vds_interface_statistics.tx_offset,=0A=20=20=20=20=
vds_interface_statistics.iface_status,=0A=20=20=20=20=
vds_interface_statistics.sample_time,=0A=20=20=20=20vds_interface.type,=0A=
=20=20=20=20vds_interface.gateway,=0A=20=20=20=20=
vds_interface.ipv6_gateway,=0A=20=20=20=20vds_interface.subnet,=0A=20=20=20=
=20vds_interface.ipv6_prefix,=0A=20=20=20=20vds_interface.addr,=0A=20=20=20=
=20vds_interface.ipv6_address,=0A=20=20=20=20vds_interface.speed,=0A=20=20=
=20=20vds_interface.base_interface,=0A=20=20=20=20vds_interface.vlan_id,=0A=
=20=20=20=20vds_interface.bond_type,=0A=20=20=20=20=
vds_interface.bond_name,=0A=20=20=20=20vds_interface.is_bond,=0A=20=20=20=
=20vds_interface.bond_opts,=0A=20=20=20=20vds_interface.mac_addr,=0A=20=20=
=20=20vds_interface.network_name,=0A=20=20=20=20vds_interface.name,=0A=20=
=20=20=20vds_static.vds_id,=0A=20=20=20=20vds_static.vds_name,=0A=20=20=20=
=20vds_interface.id,=0A=20=20=20=20vds_interface.boot_protocol,=0A=20=20=20=
=20vds_interface.ipv6_boot_protocol,=0A=20=20=20=20vds_interface.mtu=20=
AS=20mtu,=0A=20=20=20=20vds_interface.bridged,=0A=20=20=20=20=
vds_interface.reported_switch_type,=0A=20=20=20=201=20AS=20is_vds,=0A=20=20=
=20=20vds_interface.qos_overridden=20AS=20qos_overridden,=0A=20=20=20=20=
vds_interface.labels=20AS=20labels,=0A=20=20=20=20vds_static.cluster_id=20=
AS=20cluster_id,=0A=20=20=20=20vds_interface.ad_partner_mac=0AFROM=20=
vds_interface_statistics=0AINNER=20JOIN=20vds_interface=0A=20=20=20=20ON=20=
vds_interface_statistics.id=20=3D=20vds_interface.id=0AINNER=20JOIN=20=
vds_static=0A=20=20=20=20ON=20vds_interface.vds_id=20=3D=20=
vds_static.vds_id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
vm_interface_view=20AS=0ASELECT=20vm_interface_statistics.rx_rate,=0A=20=20=
=20=20vm_interface_statistics.tx_rate,=0A=20=20=20=20=
vm_interface_statistics.rx_drop,=0A=20=20=20=20=
vm_interface_statistics.tx_drop,=0A=20=20=20=20=
vm_interface_statistics.rx_total,=0A=20=20=20=20=
vm_interface_statistics.tx_total,=0A=20=20=20=20=
vm_interface_statistics.rx_offset,=0A=20=20=20=20=
vm_interface_statistics.tx_offset,=0A=20=20=20=20=
vm_interface_statistics.iface_status,=0A=20=20=20=20=
vm_interface_statistics.sample_time,=0A=20=20=20=20vm_interface.type,=0A=20=
=20=20=20vm_interface.speed,=0A=20=20=20=20vm_interface.mac_addr,=0A=20=20=
=20=20network.name=20AS=20network_name,=0A=20=20=20=20vm_interface.name,=0A=
=20=20=20=20vm_interface.vnic_profile_id,=0A=20=20=20=20=
vm_static.vm_guid,=0A=20=20=20=20vm_interface.vmt_guid,=0A=20=20=20=20=
vm_static.vm_name,=0A=20=20=20=20vm_interface.id,=0A=20=20=20=200=20AS=20=
boot_protocol,=0A=20=20=20=200=20AS=20is_vds,=0A=20=20=20=20=
vm_device.is_plugged,=0A=20=20=20=20vm_device.custom_properties,=0A=20=20=
=20=20vnic_profiles.port_mirroring=20AS=20port_mirroring,=0A=20=20=20=20=
vm_interface.linked,=0A=20=20=20=20vm_static.cluster_id=20AS=20=
cluster_id,=0A=20=20=20=20vm_static.entity_type=20AS=20vm_entity_type,=0A=
=20=20=20=20vnic_profiles.name=20AS=20vnic_profile_name,=0A=20=20=20=20=
qos.name=20AS=20qos_name=0AFROM=20vm_interface_statistics=0AINNER=20JOIN=20=
vm_interface=0A=20=20=20=20ON=20vm_interface_statistics.id=20=3D=20=
vm_interface.id=0AINNER=20JOIN=20vm_static=0A=20=20=20=20ON=20=
vm_interface.vm_guid=20=3D=20vm_static.vm_guid=0AINNER=20JOIN=20=
vm_device=0A=20=20=20=20ON=20vm_interface.vm_guid=20=3D=20=
vm_device.vm_id=0A=20=20=20=20=20=20=20=20AND=20vm_interface.id=20=3D=20=
vm_device.device_id=0ALEFT=20JOIN=20(=0A=20=20=20=20(=0A=20=20=20=20=20=20=
=20=20vnic_profiles=20INNER=20JOIN=20network=0A=20=20=20=20=20=20=20=20=20=
=20=20=20ON=20network.id=20=3D=20vnic_profiles.network_id=0A=20=20=20=20=20=
=20=20=20)=20LEFT=20JOIN=20qos=0A=20=20=20=20=20=20=20=20ON=20=
vnic_profiles.network_qos_id=20=3D=20qos.id=0A=20=20=20=20)=0A=20=20=20=20=
ON=20vnic_profiles.id=20=3D=20vm_interface.vnic_profile_id=0AUNION=0A=
SELECT=20vm_interface_statistics.rx_rate,=0A=20=20=20=20=
vm_interface_statistics.tx_rate,=0A=20=20=20=20=
vm_interface_statistics.rx_drop,=0A=20=20=20=20=
vm_interface_statistics.tx_drop,=0A=20=20=20=20=
vm_interface_statistics.rx_total,=0A=20=20=20=20=
vm_interface_statistics.tx_total,=0A=20=20=20=20=
vm_interface_statistics.rx_offset,=0A=20=20=20=20=
vm_interface_statistics.tx_offset,=0A=20=20=20=20=
vm_interface_statistics.iface_status,=0A=20=20=20=20=
vm_interface_statistics.sample_time,=0A=20=20=20=20vm_interface.type,=0A=20=
=20=20=20vm_interface.speed,=0A=20=20=20=20vm_interface.mac_addr,=0A=20=20=
=20=20network.name=20AS=20network_name,=0A=20=20=20=20vm_interface.name,=0A=
=20=20=20=20vm_interface.vnic_profile_id,=0A=20=20=20=20NULL::uuid=20AS=20=
vm_guid,=0A=20=20=20=20vm_interface.vmt_guid,=0A=20=20=20=20=
vm_templates.vm_name=20AS=20vm_name,=0A=20=20=20=20vm_interface.id,=0A=20=
=20=20=200=20AS=20boot_protocol,=0A=20=20=20=200=20AS=20is_vds,=0A=20=20=20=
=20vm_device.is_plugged=20AS=20is_plugged,=0A=20=20=20=20=
vm_device.custom_properties=20AS=20custom_properties,=0A=20=20=20=20=
vnic_profiles.port_mirroring=20AS=20port_mirroring,=0A=20=20=20=20=
vm_interface.linked,=0A=20=20=20=20vm_templates.cluster_id=20AS=20=
cluster_id,=0A=20=20=20=20vm_templates.entity_type=20AS=20=
vm_entity_type,=0A=20=20=20=20vnic_profiles.name=20AS=20=
vnic_profile_name,=0A=20=20=20=20qos.name=20AS=20qos_name=0AFROM=20=
vm_interface_statistics=0ARIGHT=20JOIN=20vm_interface=0A=20=20=20=20ON=20=
vm_interface_statistics.id=20=3D=20vm_interface.id=0AINNER=20JOIN=20=
vm_static=20AS=20vm_templates=0A=20=20=20=20ON=20vm_interface.vmt_guid=20=
=3D=20vm_templates.vm_guid=0AINNER=20JOIN=20vm_device=0A=20=20=20=20ON=20=
vm_interface.vmt_guid=20=3D=20vm_device.vm_id=0A=20=20=20=20=20=20=20=20=
AND=20vm_interface.id=20=3D=20vm_device.device_id=0ALEFT=20JOIN=20(=0A=20=
=20=20=20(=0A=20=20=20=20=20=20=20=20vnic_profiles=20INNER=20JOIN=20=
network=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20network.id=20=3D=20=
vnic_profiles.network_id=0A=20=20=20=20=20=20=20=20)=20LEFT=20JOIN=20qos=0A=
=20=20=20=20=20=20=20=20ON=20vnic_profiles.network_qos_id=20=3D=20qos.id=0A=
=20=20=20=20)=0A=20=20=20=20ON=20vnic_profiles.id=20=3D=20=
vm_interface.vnic_profile_id;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
vm_interface_monitoring_view=20AS=0ASELECT=20=
vm_interface_statistics.rx_rate,=0A=20=20=20=20=
vm_interface_statistics.tx_rate,=0A=20=20=20=20=
vm_interface_statistics.rx_drop,=0A=20=20=20=20=
vm_interface_statistics.tx_drop,=0A=20=20=20=20=
vm_interface_statistics.rx_total,=0A=20=20=20=20=
vm_interface_statistics.tx_total,=0A=20=20=20=20=
vm_interface_statistics.rx_offset,=0A=20=20=20=20=
vm_interface_statistics.tx_offset,=0A=20=20=20=20=
vm_interface_statistics.iface_status,=0A=20=20=20=20=
vm_interface_statistics.sample_time,=0A=20=20=20=20=
vm_interface.mac_addr,=0A=20=20=20=20vm_interface.vm_guid,=0A=20=20=20=20=
vm_interface.id=0AFROM=20vm_interface_statistics=0AINNER=20JOIN=20=
vm_interface=0A=20=20=20=20ON=20vm_interface_statistics.id=20=3D=20=
vm_interface.id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
storage_pool_with_storage_domain=20AS=0ASELECT=20storage_pool.id=20AS=20=
id,=0A=20=20=20=20storage_pool.name=20AS=20name,=0A=20=20=20=20=
storage_pool.description=20AS=20description,=0A=20=20=20=20=
storage_pool.free_text_comment=20AS=20free_text_comment,=0A=20=20=20=20=
storage_pool.status=20AS=20status,=0A=20=20=20=20storage_pool.is_local=20=
AS=20is_local,=0A=20=20=20=20storage_pool.master_domain_version=20AS=20=
master_domain_version,=0A=20=20=20=20storage_pool.spm_vds_id=20AS=20=
spm_vds_id,=0A=20=20=20=20storage_pool.compatibility_version=20AS=20=
compatibility_version,=0A=20=20=20=20storage_pool._create_date=20AS=20=
_create_date,=0A=20=20=20=20storage_pool._update_date=20AS=20=
_update_date,=0A=20=20=20=20storage_pool_iso_map.storage_id=20AS=20=
storage_id,=0A=20=20=20=20storage_pool_iso_map.storage_pool_id=20AS=20=
storage_pool_id,=0A=20=20=20=20storage_domain_static.storage_type=20AS=20=
storage_type,=0A=20=20=20=20storage_domain_static.storage_domain_type=20=
AS=20storage_domain_type,=0A=20=20=20=20=
storage_domain_static.storage_domain_format_type=20AS=20=
storage_domain_format_type,=0A=20=20=20=20=
storage_domain_static.storage_name=20AS=20storage_name,=0A=20=20=20=20=
storage_domain_static.storage=20AS=20storage,=0A=20=20=20=20=
storage_domain_static.last_time_used_as_master=20AS=20=
last_time_used_as_master=0AFROM=20storage_pool=0ALEFT=20JOIN=20=
storage_pool_iso_map=0A=20=20=20=20ON=20storage_pool.id=20=3D=20=
storage_pool_iso_map.storage_pool_id=0ALEFT=20JOIN=20=
storage_domain_static=0A=20=20=20=20ON=20storage_pool_iso_map.storage_id=20=
=3D=20storage_domain_static.id;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
cluster_storage_domain=20AS=0ASELECT=20cluster.cluster_id,=0A=20=20=20=20=
cluster.name,=0A=20=20=20=20cluster.description,=0A=20=20=20=20=
cluster.free_text_comment,=0A=20=20=20=20cluster.cpu_name,=0A=20=20=20=20=
cluster._create_date,=0A=20=20=20=20cluster._update_date,=0A=20=20=20=20=
cluster.storage_pool_id,=0A=20=20=20=20=
cluster.max_vds_memory_over_commit,=0A=20=20=20=20=
cluster.count_threads_as_cores,=0A=20=20=20=20=
cluster.compatibility_version,=0A=20=20=20=20=
cluster.transparent_hugepages,=0A=20=20=20=20cluster.migrate_on_error,=0A=
=20=20=20=20cluster.architecture,=0A=20=20=20=20=
storage_pool_iso_map.storage_id,=0A=20=20=20=20storage_pool.name=20AS=20=
storage_pool_name=0AFROM=20cluster=0ALEFT=20JOIN=20storage_pool_iso_map=0A=
=20=20=20=20ON=20cluster.storage_pool_id=20=3D=20=
storage_pool_iso_map.storage_pool_id=0ALEFT=20JOIN=20storage_pool=0A=20=20=
=20=20ON=20cluster.storage_pool_id=20=3D=20storage_pool.id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20cluster_view=20AS=0ASELECT=20=
cluster.*,=0A=20=20=20=20storage_pool.name=20AS=20storage_pool_name,=0A=20=
=20=20=20cluster_policies.name=20AS=20cluster_policy_name=0AFROM=20=
cluster=0ALEFT=20JOIN=20storage_pool=0A=20=20=20=20ON=20=
cluster.storage_pool_id=20=3D=20storage_pool.id=0ALEFT=20JOIN=20=
cluster_policies=0A=20=20=20=20ON=20cluster.cluster_policy_id=20=3D=20=
cluster_policies.id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
storage_domains_with_hosts_view=20AS=0ASELECT=20=
storage_domain_static.id,=0A=20=20=20=20storage_domain_static.storage,=0A=
=20=20=20=20storage_domain_static.storage_name,=0A=20=20=20=20=
storage_domain_static.storage_description=20AS=20storage_description,=0A=20=
=20=20=20storage_domain_static.storage_comment=20AS=20storage_comment,=0A=
=20=20=20=20storage_domain_dynamic.available_disk_size,=0A=20=20=20=20=
storage_domain_dynamic.used_disk_size,=0A=20=20=20=20=
storage_domains_image_sizes.commited_disk_size,=0A=20=20=20=20=
storage_domains_image_sizes.actual_images_size,=0A=20=20=20=20=
storage_pool.name=20AS=20storage_pool_name,=0A=20=20=20=20=
storage_domain_static.storage_type,=0A=20=20=20=20=
storage_domain_static.storage_domain_type,=0A=20=20=20=20=
storage_domain_static.storage_domain_format_type,=0A=20=20=20=20=
storage_domain_static.last_time_used_as_master=20AS=20=
last_time_used_as_master,=0A=20=20=20=20=
storage_domain_static.wipe_after_delete=20AS=20wipe_after_delete,=0A=20=20=
=20=20COALESCE(storage_domain_shared_status.status,=200)=20AS=20=
storage_domain_shared_status,=0A=20=20=20=20cluster.cluster_id,=0A=20=20=20=
=20vds_static.vds_id,=0A=20=20=20=20=
storage_pool_iso_map.storage_pool_id,=0A=20=20=20=20=
vds_static.recoverable=0AFROM=20storage_domain_static=0AINNER=20JOIN=20=
storage_domain_dynamic=0A=20=20=20=20ON=20storage_domain_static.id=20=3D=20=
storage_domain_dynamic.id=0ALEFT=20JOIN=20storage_pool_iso_map=0A=20=20=20=
=20ON=20storage_domain_static.id=20=3D=20storage_pool_iso_map.storage_id=0A=
LEFT=20JOIN=20storage_domain_shared_status=0A=20=20=20=20ON=20=
storage_domain_shared_status.storage_id=20=3D=20storage_domain_static.id=0A=
LEFT=20JOIN=20storage_domains_image_sizes=0A=20=20=20=20ON=20=
storage_domains_image_sizes.storage_domain_id=20=3D=20=
storage_domain_static.id=0ALEFT=20JOIN=20storage_pool=0A=20=20=20=20ON=20=
storage_pool_iso_map.storage_pool_id=20=3D=20storage_pool.id=0ALEFT=20=
JOIN=20cluster=0A=20=20=20=20ON=20storage_pool_iso_map.storage_pool_id=20=
=3D=20cluster.storage_pool_id=0ALEFT=20JOIN=20vds_static=0A=20=20=20=20=
ON=20cluster.cluster_id=20=3D=20vds_static.cluster_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
vm_images_storage_domains_view=20AS=0ASELECT=20=
vm_images_view.storage_id,=0A=20=20=20=20vm_images_view.storage_pool_id,=0A=
=20=20=20=20vm_images_view.image_guid,=0A=20=20=20=20=
vm_images_view.creation_date,=0A=20=20=20=20vm_images_view.actual_size,=0A=
=20=20=20=20vm_images_view.read_rate,=0A=20=20=20=20=
vm_images_view.write_rate,=0A=20=20=20=20vm_images_view.size,=0A=20=20=20=
=20vm_images_view.it_guid,=0A=20=20=20=20vm_images_view.description,=0A=20=
=20=20=20vm_images_view.parentid,=0A=20=20=20=20=
vm_images_view.imagestatus,=0A=20=20=20=20vm_images_view.lastmodified,=0A=
=20=20=20=20vm_images_view.app_list,=0A=20=20=20=20=
vm_images_view.vm_snapshot_id,=0A=20=20=20=20vm_images_view.volume_type,=0A=
=20=20=20=20vm_images_view.image_group_id,=0A=20=20=20=20=
vm_images_view.active,=0A=20=20=20=20vm_images_view.volume_format,=0A=20=20=
=20=20vm_images_view.wipe_after_delete,=0A=20=20=20=20=
vm_images_view.propagate_errors,=0A=20=20=20=20=
vm_images_view.entity_type,=0A=20=20=20=20vm_images_view.number_of_vms,=0A=
=20=20=20=20vm_images_view.vm_names,=0A=20=20=20=20=
vm_images_view.template_version_names,=0A=20=20=20=20=
vm_images_view.quota_id,=0A=20=20=20=20vm_images_view.quota_name,=0A=20=20=
=20=20vm_images_view.disk_profile_id,=0A=20=20=20=20=
vm_images_view.disk_profile_name,=0A=20=20=20=20=
vm_images_view.disk_alias,=0A=20=20=20=20=
vm_images_view.disk_description,=0A=20=20=20=20vm_images_view.sgio,=0A=20=
=20=20=20storage_domains_with_hosts_view.id,=0A=20=20=20=20=
storage_domains_with_hosts_view.storage,=0A=20=20=20=20=
storage_domains_with_hosts_view.storage_name,=0A=20=20=20=20=
storage_domains_with_hosts_view.available_disk_size,=0A=20=20=20=20=
storage_domains_with_hosts_view.used_disk_size,=0A=20=20=20=20=
storage_domains_with_hosts_view.commited_disk_size,=0A=20=20=20=20=
storage_domains_with_hosts_view.actual_images_size,=0A=20=20=20=20=
storage_domains_with_hosts_view.storage_type,=0A=20=20=20=20=
storage_domains_with_hosts_view.storage_domain_type,=0A=20=20=20=20=
storage_domains_with_hosts_view.storage_domain_format_type,=0A=20=20=20=20=
storage_domains_with_hosts_view.storage_domain_shared_status,=0A=20=20=20=
=20storage_domains_with_hosts_view.cluster_id,=0A=20=20=20=20=
storage_domains_with_hosts_view.vds_id,=0A=20=20=20=20=
storage_domains_with_hosts_view.recoverable,=0A=20=20=20=20=
storage_domains_with_hosts_view.storage_pool_name,=0A=20=20=20=20=
storage_domains_with_hosts_view.storage_name=20AS=20name=0AFROM=20=
vm_images_view=0AINNER=20JOIN=20images_storage_domain_view=0A=20=20=20=20=
ON=20vm_images_view.image_guid=20=3D=20=
images_storage_domain_view.image_guid=0AINNER=20JOIN=20=
storage_domains_with_hosts_view=0A=20=20=20=20ON=20=
storage_domains_with_hosts_view.id=20=3D=20=
images_storage_domain_view.storage_id;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20quota_view=20AS=0ASELECT=20q.id=20AS=20quota_id,=0A=20=20=20=20=
q.storage_pool_id=20AS=20storage_pool_id,=0A=20=20=20=20=
storage_pool.name=20AS=20storage_pool_name,=0A=20=20=20=20q.quota_name=20=
AS=20quota_name,=0A=20=20=20=20q.description=20AS=20description,=0A=20=20=
=20=20q.threshold_cluster_percentage=20AS=20=
threshold_cluster_percentage,=0A=20=20=20=20=
q.threshold_storage_percentage=20AS=20threshold_storage_percentage,=0A=20=
=20=20=20q.grace_cluster_percentage=20AS=20grace_cluster_percentage,=0A=20=
=20=20=20q.grace_storage_percentage=20AS=20grace_storage_percentage,=0A=20=
=20=20=20storage_pool.quota_enforcement_type=20AS=20=
quota_enforcement_type=0AFROM=20storage_pool,=0A=20=20=20=20quota=20q=0A=
WHERE=20storage_pool.id=20=3D=20q.storage_pool_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20quota_global_view=20AS=0A=
SELECT=20q_limit.quota_id=20AS=20quota_id,=0A=20=20=20=20=
q.storage_pool_id=20AS=20storage_pool_id,=0A=20=20=20=20=
storage_pool.name=20AS=20storage_pool_name,=0A=20=20=20=20q.quota_name=20=
AS=20quota_name,=0A=20=20=20=20q.description=20AS=20description,=0A=20=20=
=20=20q.threshold_cluster_percentage=20AS=20=
threshold_cluster_percentage,=0A=20=20=20=20=
q.threshold_storage_percentage=20AS=20threshold_storage_percentage,=0A=20=
=20=20=20q.grace_cluster_percentage=20AS=20grace_cluster_percentage,=0A=20=
=20=20=20q.grace_storage_percentage=20AS=20grace_storage_percentage,=0A=20=
=20=20=20virtual_cpu,=0A=20=20=20=20(CalculateClusterUsage(quota_id,=20=
NULL)).virtual_cpu_usage,=0A=20=20=20=20mem_size_mb,=0A=20=20=20=20=
(CalculateClusterUsage(quota_id,=20NULL)).mem_size_mb_usage,=0A=20=20=20=20=
storage_size_gb,=0A=20=20=20=20CalculateStorageUsage(quota_id,=20NULL)=20=
AS=20storage_size_gb_usage,=0A=20=20=20=20=
storage_pool.quota_enforcement_type=20AS=20quota_enforcement_type=0AFROM=20=
storage_pool,=0A=20=20=20=20quota=20q=0ALEFT=20JOIN=20quota_limitation=20=
q_limit=0A=20=20=20=20ON=20q_limit.quota_id=20=3D=20q.id=0AWHERE=20=
storage_pool.id=20=3D=20q.storage_pool_id=0A=20=20=20=20AND=20=
q_limit.cluster_id=20IS=20NULL=0A=20=20=20=20AND=20q_limit.storage_id=20=
IS=20NULL;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
quota_limitations_view=20AS=0ASELECT=20q_limit.quota_id=20AS=20quota_id,=0A=
=20=20=20=20q.storage_pool_id=20AS=20storage_pool_id,=0A=20=20=20=20=
storage_pool.name=20AS=20storage_pool_name,=0A=20=20=20=20q.quota_name=20=
AS=20quota_name,=0A=20=20=20=20q.description=20AS=20description,=0A=20=20=
=20=20q.threshold_cluster_percentage=20AS=20=
threshold_cluster_percentage,=0A=20=20=20=20=
q.threshold_storage_percentage=20AS=20threshold_storage_percentage,=0A=20=
=20=20=20q.grace_cluster_percentage=20AS=20grace_cluster_percentage,=0A=20=
=20=20=20q.grace_storage_percentage=20AS=20grace_storage_percentage,=0A=20=
=20=20=20virtual_cpu,=0A=20=20=20=20mem_size_mb,=0A=20=20=20=20=
storage_size_gb,=0A=20=20=20=20storage_pool.quota_enforcement_type=20AS=20=
quota_enforcement_type,=0A=20=20=20=20cluster_id,=0A=20=20=20=20=
storage_id,=0A=20=20=20=20(COALESCE(cluster_id,=20storage_id)=20IS=20=
NULL)=20AS=20is_global,=0A=20=20=20=20(COALESCE(virtual_cpu,=20=
mem_size_mb,=20storage_size_gb)=20IS=20NULL)=20AS=20is_empty=0AFROM=20=
quota=20q=0AINNER=20JOIN=20storage_pool=0A=20=20=20=20ON=20=
storage_pool.id=20=3D=20q.storage_pool_id=0ALEFT=20JOIN=20=
quota_limitation=20q_limit=0A=20=20=20=20ON=20q_limit.quota_id=20=3D=20=
q.id;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20quota_storage_view=20=
AS=0ASELECT=20q_limit.id=20AS=20quota_storage_id,=0A=20=20=20=20=
q_limit.quota_id=20AS=20quota_id,=0A=20=20=20=20storage_id,=0A=20=20=20=20=
storage_domain_static.storage_name=20AS=20storage_name,=0A=20=20=20=20=
storage_size_gb,=0A=20=20=20=20CalculateStorageUsage(quota_id,=20=
storage_id)=20AS=20storage_size_gb_usage=0AFROM=20quota_limitation=20=
q_limit,=0A=20=20=20=20quota=20q,=0A=20=20=20=20storage_domain_static=0A=
WHERE=20q_limit.quota_id=20=3D=20q.id=0A=20=20=20=20AND=20=
q_limit.cluster_id=20IS=20NULL=0A=20=20=20=20AND=20q_limit.storage_id=20=
IS=20NOT=20NULL=0A=20=20=20=20AND=20storage_domain_static.id=20=3D=20=
q_limit.storage_id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
quota_cluster_view=20AS=0ASELECT=20q_limit.id=20AS=20quota_cluster_id,=0A=
=20=20=20=20q_limit.quota_id=20AS=20quota_id,=0A=20=20=20=20=
q_limit.cluster_id,=0A=20=20=20=20cluster.name=20AS=20cluster_name,=0A=20=
=20=20=20virtual_cpu,=0A=20=20=20=20(CalculateClusterUsage(quota_id,=20=
q_limit.cluster_id)).virtual_cpu_usage=20AS=20virtual_cpu_usage,=0A=20=20=
=20=20mem_size_mb,=0A=20=20=20=20(CalculateClusterUsage(quota_id,=20=
q_limit.cluster_id)).mem_size_mb_usage=20AS=20mem_size_mb_usage=0AFROM=20=
quota_limitation=20q_limit,=0A=20=20=20=20quota=20q,=0A=20=20=20=20=
cluster=0AWHERE=20q_limit.quota_id=20=3D=20q.id=0A=20=20=20=20AND=20=
q_limit.cluster_id=20IS=20NOT=20NULL=0A=20=20=20=20AND=20=
q_limit.storage_id=20IS=20NULL=0A=20=20=20=20AND=20cluster.cluster_id=20=
=3D=20q_limit.cluster_id;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
network_cluster_view=20AS=0ASELECT=20network_cluster.cluster_id=20AS=20=
cluster_id,=0A=20=20=20=20network_cluster.network_id=20AS=20network_id,=0A=
=20=20=20=20network.name=20AS=20network_name,=0A=20=20=20=20=
network_cluster.status=20AS=20status,=0A=20=20=20=20=
network_cluster.required=20AS=20required,=0A=20=20=20=20=
network_cluster.is_display=20AS=20is_display,=0A=20=20=20=20=
network_cluster.migration=20AS=20migration,=0A=20=20=20=20cluster.name=20=
AS=20cluster_name=0AFROM=20network_cluster=0AINNER=20JOIN=20network=0A=20=
=20=20=20ON=20network_cluster.network_id=20=3D=20network.id=0AINNER=20=
JOIN=20cluster=0A=20=20=20=20ON=20network_cluster.cluster_id=20=3D=20=
cluster.cluster_id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
network_vds_view=20AS=0ASELECT=20network.id=20AS=20network_id,=0A=20=20=20=
=20network.name=20AS=20network_name,=0A=20=20=20=20vds_static.vds_name=20=
AS=20vds_name=0AFROM=20vds_interface=0AINNER=20JOIN=20vds_static=0A=20=20=
=20=20ON=20vds_interface.vds_id=20=3D=20vds_static.vds_id=0AINNER=20JOIN=20=
network=0A=20=20=20=20ON=20vds_interface.network_name=20=3D=20=
network.name=0AINNER=20JOIN=20network_cluster=0A=20=20=20=20ON=20=
network_cluster.network_id=20=3D=20network.id=0AWHERE=20=
network_cluster.cluster_id=20=3D=20vds_static.cluster_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20network_view=20AS=0ASELECT=20=
network.id=20AS=20id,=0A=20=20=20=20network.name=20AS=20name,=0A=20=20=20=
=20network.description=20AS=20description,=0A=20=20=20=20=
network.free_text_comment=20AS=20free_text_comment,=0A=20=20=20=20=
network.type=20AS=20type,=0A=20=20=20=20network.addr=20AS=20addr,=0A=20=20=
=20=20network.subnet=20AS=20subnet,=0A=20=20=20=20network.gateway=20AS=20=
gateway,=0A=20=20=20=20network.vlan_id=20AS=20vlan_id,=0A=20=20=20=20=
network.stp=20AS=20stp,=0A=20=20=20=20network.mtu=20AS=20mtu,=0A=20=20=20=
=20network.vm_network=20AS=20vm_network,=0A=20=20=20=20=
network.storage_pool_id=20AS=20storage_pool_id,=0A=20=20=20=20=
network.provider_network_provider_id=20AS=20=
provider_network_provider_id,=0A=20=20=20=20=
network.provider_network_external_id=20AS=20=
provider_network_external_id,=0A=20=20=20=20network.qos_id=20AS=20=
qos_id,=0A=20=20=20=20network.label=20AS=20label,=0A=20=20=20=20=
storage_pool.name=20AS=20storage_pool_name,=0A=20=20=20=20=
storage_pool.compatibility_version=20AS=20compatibility_version,=0A=20=20=
=20=20providers.name=20AS=20provider_name,=0A=20=20=20=20qos.name=20AS=20=
qos_name=0AFROM=20network=0AINNER=20JOIN=20storage_pool=0A=20=20=20=20ON=20=
network.storage_pool_id=20=3D=20storage_pool.id=0ALEFT=20JOIN=20=
providers=0A=20=20=20=20ON=20network.provider_network_provider_id=20=3D=20=
providers.id=0ALEFT=20JOIN=20qos=0A=20=20=20=20ON=20qos.id=20=3D=20=
network.qos_id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
vnic_profiles_view=20AS=0ASELECT=20vnic_profiles.id=20AS=20id,=0A=20=20=20=
=20vnic_profiles.name=20AS=20name,=0A=20=20=20=20=
vnic_profiles.network_id=20AS=20network_id,=0A=20=20=20=20=
vnic_profiles.network_qos_id=20AS=20network_qos_id,=0A=20=20=20=20=
vnic_profiles.port_mirroring=20AS=20port_mirroring,=0A=20=20=20=20=
vnic_profiles.passthrough=20AS=20passthrough,=0A=20=20=20=20=
vnic_profiles.custom_properties=20AS=20custom_properties,=0A=20=20=20=20=
vnic_profiles.description=20AS=20description,=0A=20=20=20=20=
vnic_profiles.network_filter_id=20AS=20network_filter_id,=0A=20=20=20=20=
network_filter.filter_name=20AS=20network_filter_name,=0A=20=20=20=20=
network.name=20AS=20network_name,=0A=20=20=20=20qos.name=20AS=20=
network_qos_name,=0A=20=20=20=20storage_pool.name=20AS=20=
data_center_name,=0A=20=20=20=20storage_pool.compatibility_version=20AS=20=
compatibility_version,=0A=20=20=20=20storage_pool.id=20AS=20=
data_center_id=0AFROM=20vnic_profiles=0AINNER=20JOIN=20network=0A=20=20=20=
=20ON=20vnic_profiles.network_id=20=3D=20network.id=0ALEFT=20JOIN=20qos=0A=
=20=20=20=20ON=20vnic_profiles.network_qos_id=20=3D=20qos.id=0AINNER=20=
JOIN=20storage_pool=0A=20=20=20=20ON=20network.storage_pool_id=20=3D=20=
storage_pool.id=0ALEFT=20JOIN=20network_filter=0A=20=20=20=20ON=20=
vnic_profiles.network_filter_id=20=3D=20network_filter.filter_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
engine_session_user_flat_groups=20AS=0ASELECT=20id=20AS=20=
engine_session_seq_id,=0A=20=20=20=20user_id=20AS=20user_id,=0A=20=20=20=20=
fnSplitterUuid(engine_sessions.group_ids)=20AS=20granted_id=0AFROM=20=
engine_sessions=0AUNION=20ALL=20=0ASELECT=20id,=0A=20=20=20=20user_id,=0A=
=20=20=20=20user_id=0AFROM=20engine_sessions=0AUNION=20ALL=20=0ASELECT=20=
id,=0A=20=20=20=20user_id,=0A=20=20=20=20=
'EEE00000-0000-0000-0000-123456789EEE'=0AFROM=20engine_sessions;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
user_cluster_permissions_view_base=20(=0A=20=20=20=20entity_id,=0A=20=20=20=
=20granted_id=0A=20=20=20=20)=20AS=0ASELECT=20object_id,=0A=20=20=20=20=
ad_element_id=0AFROM=20internal_permissions_view=0AWHERE=20=
object_type_id=20=3D=209=0A=20=20=20=20AND=20role_type=20=3D=202=20=0A=
UNION=20ALL=0ASELECT=20DISTINCT=20cluster_id,=0A=20=20=20=20=
ad_element_id=0AFROM=20vm_static=0AINNER=20JOIN=20=
internal_permissions_view=0A=20=20=20=20ON=20object_id=20=3D=20vm_guid=0A=
=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
object_type_id=20=3D=202=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
object_type_id=20=3D=204=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20AND=20role_type=20=3D=202=0A=20=20=20=20=20=20=20=20=
AND=20cluster_id=20IS=20NOT=20NULL=20=0AUNION=20ALL=0ASELECT=20=
cluster_id,=0A=20=20=20=20ad_element_id=0AFROM=20cluster=0AINNER=20JOIN=20=
internal_permissions_view=0A=20=20=20=20ON=20object_id=20=3D=20=
cluster.storage_pool_id=0A=20=20=20=20=20=20=20=20AND=20object_type_id=20=
=3D=2014=0A=20=20=20=20=20=20=20=20AND=20role_type=20=3D=202=20=0AUNION=20=
ALL=0ASELECT=20cluster_id,=0A=20=20=20=20ad_element_id=0AFROM=20=
internal_permissions_view=0ACROSS=20JOIN=20cluster=0AWHERE=20=
object_type_id=20=3D=201=0A=20=20=20=20AND=20role_type=20=3D=202;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
user_cluster_permissions_view=20(=0A=20=20=20=20entity_id,=0A=20=20=20=20=
user_id=0A=20=20=20=20)=20AS=0ASELECT=20DISTINCT=20entity_id,=0A=20=20=20=
=20user_id=0AFROM=20user_cluster_permissions_view_base=20NATURAL=0A=20=
JOIN=20engine_session_user_flat_groups;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20user_storage_pool_permissions_view_base=20(=0A=20=20=20=20=
entity_id,=0A=20=20=20=20granted_id=0A=20=20=20=20)=20AS=0ASELECT=20=
object_id,=0A=20=20=20=20ad_element_id=0AFROM=20=
internal_permissions_view=0AWHERE=20object_type_id=20=3D=2014=0A=20=20=20=
=20AND=20role_type=20=3D=202=20=0AUNION=20ALL=0ASELECT=20=
storage_pool_id,=0A=20=20=20=20ad_element_id=0AFROM=20cluster=0AINNER=20=
JOIN=20internal_permissions_view=0A=20=20=20=20ON=20object_id=20=3D=20=
cluster.cluster_id=0A=20=20=20=20=20=20=20=20AND=20object_type_id=20=3D=20=
9=0A=20=20=20=20=20=20=20=20AND=20role_type=20=3D=202=20=0AUNION=20ALL=0A=
SELECT=20storage_pool_id,=0A=20=20=20=20ad_element_id=0AFROM=20cluster=0A=
INNER=20JOIN=20vm_pools=0A=20=20=20=20ON=20cluster.cluster_id=20=3D=20=
vm_pools.cluster_id=0AINNER=20JOIN=20internal_permissions_view=0A=20=20=20=
=20ON=20object_id=20=3D=20vm_pools.vm_pool_id=0A=20=20=20=20=20=20=20=20=
AND=20object_type_id=20=3D=205=0A=20=20=20=20=20=20=20=20AND=20role_type=20=
=3D=202=20=0AUNION=20ALL=0ASELECT=20storage_pool_id,=0A=20=20=20=20=
ad_element_id=0AFROM=20vm_static=0AINNER=20JOIN=20cluster=0A=20=20=20=20=
ON=20cluster.cluster_id=20=3D=20vm_static.cluster_id=0AINNER=20JOIN=20=
internal_permissions_view=0A=20=20=20=20ON=20object_id=20=3D=20vm_guid=0A=
=20=20=20=20=20=20=20=20AND=20object_type_id=20=3D=202=0A=20=20=20=20=20=20=
=20=20AND=20role_type=20=3D=202=20=0AUNION=20ALL=0ASELECT=20=
storage_pool.id,=0A=20=20=20=20ad_element_id=0AFROM=20=
internal_permissions_view=0ACROSS=20JOIN=20storage_pool=0AWHERE=20=
object_type_id=20=3D=201=0A=20=20=20=20AND=20role_type=20=3D=202;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
user_storage_pool_permissions_view=20(=0A=20=20=20=20entity_id,=0A=20=20=20=
=20user_id=0A=20=20=20=20)=20AS=0ASELECT=20DISTINCT=20entity_id,=0A=20=20=
=20=20user_id=0AFROM=20user_storage_pool_permissions_view_base=20NATURAL=0A=
=20JOIN=20engine_session_user_flat_groups;=0A**************************=0A=
=0ACREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20VIEW=20user_storage_domain_permissions_view_base=20(=0A=20=20=20=
=20entity_id,=0A=20=20=20=20granted_id=0A=20=20=20=20)=20AS=0ASELECT=20=
object_id,=0A=20=20=20=20ad_element_id=0AFROM=20=
internal_permissions_view=0AWHERE=20object_type_id=20=3D=2011=0A=20=20=20=
=20AND=20role_type=20=3D=202=20=0AUNION=20ALL=0ASELECT=20=
storage_domains.id,=0A=20=20=20=20ad_element_id=0AFROM=20storage_domains=0A=
INNER=20JOIN=20cluster=0A=20=20=20=20ON=20cluster.storage_pool_id=20=3D=20=
storage_domains.storage_pool_id=0AINNER=20JOIN=20vm_static=0A=20=20=20=20=
ON=20cluster.cluster_id=20=3D=20vm_static.cluster_id=0AINNER=20JOIN=20=
internal_permissions_view=0A=20=20=20=20ON=20object_id=20=3D=20=
vm_static.vm_guid=0A=20=20=20=20=20=20=20=20AND=20object_type_id=20=3D=20=
2=0A=20=20=20=20=20=20=20=20AND=20role_type=20=3D=202=20=0AUNION=20ALL=0A=
SELECT=20storage_id,=0A=20=20=20=20ad_element_id=0AFROM=20=
vm_templates_based_storage_domain=0AINNER=20JOIN=20=
internal_permissions_view=0A=20=20=20=20ON=20vmt_guid=20=3D=20=
internal_permissions_view.object_id=0A=20=20=20=20=20=20=20=20AND=20=
object_type_id=20=3D=204=0A=20=20=20=20=20=20=20=20AND=20role_type=20=3D=20=
2=20=0AUNION=20ALL=0ASELECT=20storage_id,=0A=20=20=20=20ad_element_id=0A=
FROM=20vm_static=0AINNER=20JOIN=20vm_templates_based_storage_domain=0A=20=
=20=20=20ON=20vm_static.vmt_guid=20=3D=20=
vm_templates_based_storage_domain.vmt_guid=0AINNER=20JOIN=20=
internal_permissions_view=0A=20=20=20=20ON=20vm_static.vm_guid=20=3D=20=
object_id=0A=20=20=20=20=20=20=20=20AND=20objecT_type_id=20=3D=202=0A=20=20=
=20=20=20=20=20=20AND=20role_type=20=3D=202=20=0AUNION=20ALL=0ASELECT=20=
storage_domains.id,=0A=20=20=20=20ad_element_id=0AFROM=20storage_domains=0A=
INNER=20JOIN=20internal_permissions_view=0A=20=20=20=20ON=20object_id=20=
=3D=20storage_domains.storage_pool_id=0A=20=20=20=20=20=20=20=20AND=20=
object_type_id=20=3D=2014=0A=20=20=20=20=20=20=20=20AND=20role_type=20=3D=20=
2=20=0AUNION=20ALL=0ASELECT=20storage_domains.id,=0A=20=20=20=20=
ad_element_id=0AFROM=20internal_permissions_view=0ACROSS=20JOIN=20=
storage_domains=0AWHERE=20object_type_id=20=3D=201=0A=20=20=20=20AND=20=
role_type=20=3D=202;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
user_storage_domain_permissions_view=20(=0A=20=20=20=20entity_id,=0A=20=20=
=20=20user_id=0A=20=20=20=20)=20AS=0ASELECT=20DISTINCT=20entity_id,=0A=20=
=20=20=20user_id=0AFROM=20user_storage_domain_permissions_view_base=20=
NATURAL=0A=20JOIN=20engine_session_user_flat_groups;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
user_vds_permissions_view_base=20(=0A=20=20=20=20entity_id,=0A=20=20=20=20=
granted_id=0A=20=20=20=20)=20AS=0ASELECT=20object_id,=0A=20=20=20=20=
ad_element_id=0AFROM=20internal_permissions_view=0AWHERE=20=
object_type_id=20=3D=203=0A=20=20=20=20AND=20role_type=20=3D=202=20=0A=
UNION=20ALL=0ASELECT=20vds_id,=0A=20=20=20=20ad_element_id=0AFROM=20vds=0A=
INNER=20JOIN=20internal_permissions_view=0A=20=20=20=20ON=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20object_id=20=3D=20cluster_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20object_type_id=20=3D=209=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20OR=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20object_id=20=3D=20storage_pool_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20object_type_id=20=3D=2014=0A=20=20=20=20=20=20=20=20=20=
=20=20=20)=0A=20=20=20=20=20=20=20=20AND=20role_type=20=3D=202=20=0A=
UNION=20ALL=0ASELECT=20vds_id,=0A=20=20=20=20ad_element_id=0AFROM=20=
internal_permissions_view=0ACROSS=20JOIN=20vds=0AWHERE=20object_type_id=20=
=3D=201=0A=20=20=20=20AND=20role_type=20=3D=202;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20user_vds_permissions_view=20=
(=0A=20=20=20=20entity_id,=0A=20=20=20=20user_id=0A=20=20=20=20)=20AS=0A=
SELECT=20DISTINCT=20entity_id,=0A=20=20=20=20user_id=0AFROM=20=
user_vds_permissions_view_base=20NATURAL=0A=20JOIN=20=
engine_session_user_flat_groups;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20user_vm_pool_permissions_view_base=20(=0A=20=20=20=20entity_id,=0A=
=20=20=20=20granted_id=0A=20=20=20=20)=20AS=0ASELECT=20object_id,=0A=20=20=
=20=20ad_element_id=0AFROM=20internal_permissions_view=0AWHERE=20=
object_type_id=20=3D=205=0A=20=20=20=20AND=20role_type=20=3D=202=20=0A=
UNION=20ALL=0ASELECT=20vm_pool_id,=0A=20=20=20=20ad_element_id=0AFROM=20=
vm_pool_map=0AINNER=20JOIN=20internal_permissions_view=0A=20=20=20=20ON=20=
object_id=20=3D=20vm_guid=0A=20=20=20=20=20=20=20=20AND=20object_type_id=20=
=3D=202=0A=20=20=20=20=20=20=20=20AND=20role_type=20=3D=202=20=0AUNION=20=
ALL=0ASELECT=20vm_pool_id,=0A=20=20=20=20ad_element_id=0AFROM=20vm_pools=0A=
INNER=20JOIN=20internal_permissions_view=0A=20=20=20=20ON=20object_id=20=
=3D=20cluster_id=0A=20=20=20=20=20=20=20=20AND=20object_type_id=20=3D=20=
9=0A=20=20=20=20=20=20=20=20AND=20allows_viewing_children=0A=20=20=20=20=20=
=20=20=20AND=20role_type=20=3D=202=20=0AUNION=20ALL=0ASELECT=20=
vm_pool_id,=0A=20=20=20=20ad_element_id=0AFROM=20vm_pools=0AINNER=20JOIN=20=
cluster=0A=20=20=20=20ON=20vm_pools.cluster_id=20=3D=20=
cluster.cluster_id=0AINNER=20JOIN=20internal_permissions_view=0A=20=20=20=
=20ON=20object_id=20=3D=20storage_pool_id=0A=20=20=20=20=20=20=20=20AND=20=
object_type_id=20=3D=2014=0A=20=20=20=20=20=20=20=20AND=20=
allows_viewing_children=0A=20=20=20=20=20=20=20=20AND=20role_type=20=3D=20=
2=20=0AUNION=20ALL=0ASELECT=20vm_pool_id,=0A=20=20=20=20ad_element_id=0A=
FROM=20internal_permissions_view=0ACROSS=20JOIN=20vm_pools=0AWHERE=20=
object_type_id=20=3D=201=0A=20=20=20=20AND=20allows_viewing_children=0A=20=
=20=20=20AND=20role_type=20=3D=202;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20user_vm_pool_permissions_view=20(=0A=20=20=20=20entity_id,=0A=20=20=
=20=20user_id=0A=20=20=20=20)=20AS=0ASELECT=20DISTINCT=20entity_id,=0A=20=
=20=20=20user_id=0AFROM=20user_vm_pool_permissions_view_base=20NATURAL=0A=
=20JOIN=20engine_session_user_flat_groups;=0A**************************=0A=
=0ACREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20VIEW=20user_vm_template_permissions_view_base=20(=0A=20=20=20=20=
entity_id,=0A=20=20=20=20granted_id=0A=20=20=20=20)=20AS=0ASELECT=20=
object_id,=0A=20=20=20=20ad_element_id=0AFROM=20=
internal_permissions_view=0AWHERE=20object_type_id=20=3D=204=0A=20=20=20=20=
AND=20role_type=20=3D=202=20=0AUNION=20ALL=0ASELECT=20vmt_guid,=0A=20=20=20=
=20ad_element_id=0AFROM=20vm_static=0AINNER=20JOIN=20=
internal_permissions_view=0A=20=20=20=20ON=20object_id=20=3D=20=
vm_static.vm_guid=0A=20=20=20=20=20=20=20=20AND=20object_type_id=20=3D=20=
2=0A=20=20=20=20=20=20=20=20AND=20role_type=20=3D=202=20=0AUNION=20ALL=0A=
SELECT=20vm_guid,=0A=20=20=20=20ad_element_id=0AFROM=20vm_static=0AINNER=20=
JOIN=20cluster=0A=20=20=20=20ON=20cluster.cluster_id=20=3D=20=
vm_static.cluster_id=0AINNER=20JOIN=20internal_permissions_view=0A=20=20=20=
=20ON=20object_id=20=3D=20storage_pool_id=0A=20=20=20=20=20=20=20=20AND=20=
object_type_id=20=3D=2014=0A=20=20=20=20=20=20=20=20AND=20=
allows_viewing_children=0A=20=20=20=20=20=20=20=20AND=20role_type=20=3D=20=
2=0A=20=20=20=20=20=20=20=20AND=20vm_static.entity_type::TEXT=20=3D=20=
'TEMPLATE'::TEXT=20=0AUNION=20ALL=0ASELECT=20vm_guid,=0A=20=20=20=20=
ad_element_id=0AFROM=20internal_permissions_view=0ACROSS=20JOIN=20=
vm_static=0AWHERE=20object_type_id=20=3D=201=0A=20=20=20=20AND=20=
allows_viewing_children=0A=20=20=20=20AND=20role_type=20=3D=202=0A=20=20=20=
=20AND=20(=0A=20=20=20=20=20=20=20=20vm_static.entity_type::TEXT=20=3D=20=
'TEMPLATE'::TEXT=0A=20=20=20=20=20=20=20=20OR=20=
vm_static.entity_type::TEXT=20=3D=20'INSTANCE_TYPE'::TEXT=0A=20=20=20=20=20=
=20=20=20OR=20vm_static.entity_type::TEXT=20=3D=20'IMAGE_TYPE'::TEXT=0A=20=
=20=20=20=20=20=20=20);=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
user_vm_template_permissions_view=20(=0A=20=20=20=20entity_id,=0A=20=20=20=
=20user_id=0A=20=20=20=20)=20AS=0ASELECT=20DISTINCT=20entity_id,=0A=20=20=
=20=20user_id=0AFROM=20user_vm_template_permissions_view_base=20NATURAL=0A=
=20JOIN=20engine_session_user_flat_groups;=0A**************************=0A=
=0ACREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20VIEW=20vm_permissions_view_base=20(=0A=20=20=20=20entity_id,=0A=
=20=20=20=20granted_id,=0A=20=20=20=20role_type=0A=20=20=20=20)=20AS=0A=
SELECT=20object_id,=0A=20=20=20=20ad_element_id,=0A=20=20=20=20role_type=0A=
FROM=20internal_permissions_view=0AWHERE=20object_type_id=20=3D=202=0A=
UNION=20ALL=0ASELECT=20vm_guid,=0A=20=20=20=20ad_element_id,=0A=20=20=20=20=
role_type=0AFROM=20vm_static=0AINNER=20JOIN=20internal_permissions_view=0A=
=20=20=20=20ON=20object_id=20=3D=20cluster_id=0A=20=20=20=20=20=20=20=20=
AND=20object_type_id=20=3D=209=0A=20=20=20=20=20=20=20=20AND=20=
allows_viewing_children=0AUNION=20ALL=0ASELECT=20vm_guid,=0A=20=20=20=20=
ad_element_id,=0A=20=20=20=20role_type=0AFROM=20vm_static=0AINNER=20JOIN=20=
cluster=0A=20=20=20=20ON=20cluster.cluster_id=20=3D=20=
vm_static.cluster_id=0AINNER=20JOIN=20internal_permissions_view=0A=20=20=20=
=20ON=20object_id=20=3D=20storage_pool_id=0A=20=20=20=20=20=20=20=20AND=20=
object_type_id=20=3D=2014=0A=20=20=20=20=20=20=20=20AND=20=
allows_viewing_children=0AUNION=20ALL=0ASELECT=20vm_guid,=0A=20=20=20=20=
ad_element_id,=0A=20=20=20=20role_type=0AFROM=20=
internal_permissions_view=0ACROSS=20JOIN=20vm_static=0AWHERE=20=
object_type_id=20=3D=201=0A=20=20=20=20AND=20allows_viewing_children;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20user_vm_permissions_view=20(=0A=
=20=20=20=20entity_id,=0A=20=20=20=20user_id=0A=20=20=20=20)=20AS=0A=
SELECT=20DISTINCT=20entity_id,=0A=20=20=20=20user_id=0AFROM=20=
vm_permissions_view_base=20NATURAL=0A=20JOIN=20=
engine_session_user_flat_groups=0A=20WHERE=20=
vm_permissions_view_base.role_type=20=3D=202;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20vm_permissions_view=20(=0A=20=
=20=20=20entity_id,=0A=20=20=20=20user_id=0A=20=20=20=20)=20AS=0ASELECT=20=
DISTINCT=20entity_id,=0A=20=20=20=20user_id=0AFROM=20=
vm_permissions_view_base=20NATURAL=0A=20JOIN=20=
engine_session_user_flat_groups;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20user_disk_permissions_view_base=20(=0A=20=20=20=20entity_id,=0A=20=
=20=20=20granted_id=0A=20=20=20=20)=20AS=0ASELECT=20object_id,=0A=20=20=20=
=20ad_element_id=0AFROM=20internal_permissions_view=0AWHERE=20=
object_type_id=20=3D=2019=0A=20=20=20=20AND=20role_type=20=3D=202=20=0A=
UNION=20ALL=0ASELECT=20device_id,=0A=20=20=20=20=
user_vm_permissions_view.user_id=20AS=20ad_element_id=0AFROM=20vm_device=0A=
INNER=20JOIN=20user_vm_permissions_view=0A=20=20=20=20ON=20=
user_vm_permissions_view.entity_id=20=3D=20vm_device.vm_id=0AWHERE=20=
vm_device.type=20=3D=20'disk'=0A=20=20=20=20AND=20vm_device.device=20=3D=20=
'disk'=20=0AUNION=20ALL=0ASELECT=20device_id,=0A=20=20=20=20=
user_vm_template_permissions_view.user_id=20AS=20ad_element_id=0AFROM=20=
vm_device=0AINNER=20JOIN=20user_vm_template_permissions_view=0A=20=20=20=20=
ON=20user_vm_template_permissions_view.entity_id=20=3D=20vm_device.vm_id=0A=
WHERE=20type=20=3D=20'disk'=0A=20=20=20=20AND=20device=20=3D=20'disk'=20=0A=
UNION=20ALL=0ASELECT=20images.image_group_id,=0A=20=20=20=20=
ad_element_id=0AFROM=20image_storage_domain_map=0AINNER=20JOIN=20images=0A=
=20=20=20=20ON=20images.image_guid=20=3D=20=
image_storage_domain_map.image_id=0AINNER=20JOIN=20=
internal_permissions_view=0A=20=20=20=20ON=20object_id=20=3D=20=
storage_domain_id=0A=20=20=20=20=20=20=20=20AND=20object_type_id=20=3D=20=
11=0A=20=20=20=20=20=20=20=20AND=20allows_viewing_children=0A=20=20=20=20=
=20=20=20=20AND=20role_type=20=3D=202=20=0AUNION=20ALL=0ASELECT=20=
images.image_group_id,=0A=20=20=20=20ad_element_id=0AFROM=20=
image_storage_domain_map=0AINNER=20JOIN=20storage_pool_iso_map=0A=20=20=20=
=20ON=20image_storage_domain_map.storage_domain_id=20=3D=20=
storage_pool_iso_map.storage_id=0AINNER=20JOIN=20images=0A=20=20=20=20ON=20=
images.image_guid=20=3D=20image_storage_domain_map.image_id=0AINNER=20=
JOIN=20internal_permissions_view=0A=20=20=20=20ON=20object_id=20=3D=20=
storage_pool_id=0A=20=20=20=20=20=20=20=20AND=20object_type_id=20=3D=20=
14=0A=20=20=20=20=20=20=20=20AND=20allows_viewing_children=0A=20=20=20=20=
=20=20=20=20AND=20role_type=20=3D=202=20=0AUNION=20ALL=0ASELECT=20=
device_id,=0A=20=20=20=20ad_element_id=0AFROM=20=
internal_permissions_view=0ACROSS=20JOIN=20vm_device=0AWHERE=20=
object_type_id=20=3D=201=0A=20=20=20=20AND=20allows_viewing_children=0A=20=
=20=20=20AND=20role_type=20=3D=202;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20user_disk_permissions_view=20(=0A=20=20=20=20entity_id,=0A=20=20=20=
=20user_id=0A=20=20=20=20)=20AS=0ASELECT=20DISTINCT=20entity_id,=0A=20=20=
=20=20user_id=0AFROM=20user_disk_permissions_view_base=20NATURAL=0A=20=
JOIN=20engine_session_user_flat_groups;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20user_permissions_permissions_view=20(=0A=20=20=20=20entity_id,=0A=20=
=20=20=20user_id=0A=20=20=20=20)=20AS=0ASELECT=20DISTINCT=20id,=0A=20=20=20=
=20user_id=0AFROM=20internal_permissions_view=0AINNER=20JOIN=20=
engine_session_user_flat_groups=0A=20=20=20=20ON=20granted_id=20=3D=20=
ad_element_id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
user_object_permissions_view=20AS=0ASELECT=20DISTINCT=20=
permissions.object_id=20AS=20entity_id,=0A=20=20=20=20=
engine_session_user_flat_groups.user_id=0AFROM=20permissions=0AINNER=20=
JOIN=20roles=0A=20=20=20=20ON=20permissions.role_id=20=3D=20roles.id=0A=
INNER=20JOIN=20engine_session_user_flat_groups=0A=20=20=20=20ON=20=
engine_session_user_flat_groups.granted_id=20=3D=20=
permissions.ad_element_id=0AWHERE=20permissions.ad_element_id=20!=3D=20=
getGlobalIds('everyone');=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
user_db_users_permissions_view=20AS=0ASELECT=20DISTINCT=20=
permissions.ad_element_id,=0A=20=20=20=20roles_groups.role_id,=0A=20=20=20=
=20roles_groups.action_group_id=0AFROM=20permissions=0AINNER=20JOIN=20=
roles_groups=0A=20=20=20=20ON=20permissions.role_id=20=3D=20=
roles_groups.role_id=0AWHERE=20roles_groups.action_group_id=20=3D=20502;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20vm_device_view=20AS=0ASELECT=20=
device_id,=0A=20=20=20=20vm_id,=0A=20=20=20=20type,=0A=20=20=20=20=
device,=0A=20=20=20=20address,=0A=20=20=20=20boot_order,=0A=20=20=20=20=
spec_params,=0A=20=20=20=20is_managed,=0A=20=20=20=20is_plugged,=0A=20=20=
=20=20is_readonly,=0A=20=20=20=20alias,=0A=20=20=20=20custom_properties,=0A=
=20=20=20=20snapshot_id,=0A=20=20=20=20logical_name,=0A=20=20=20=20=
is_using_scsi_reservation,=0A=20=20=20=20host_device=0AFROM=20vm_device;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
user_vnic_profile_permissions_view_base=20(=0A=20=20=20=20entity_id,=0A=20=
=20=20=20granted_id=0A=20=20=20=20)=20AS=0ASELECT=20object_id,=0A=20=20=20=
=20ad_element_id=0AFROM=20internal_permissions_view=0AWHERE=20=
object_type_id=20=3D=2027=0A=20=20=20=20AND=20role_type=20=3D=202=20=0A=
UNION=20ALL=0ASELECT=20vnic_profiles.id,=0A=20=20=20=20ad_element_id=0A=
FROM=20vnic_profiles=0AINNER=20JOIN=20internal_permissions_view=0A=20=20=20=
=20ON=20object_id=20=3D=20network_id=0AWHERE=20object_type_id=20=3D=2020=0A=
=20=20=20=20AND=20allows_viewing_children=0A=20=20=20=20AND=20role_type=20=
=3D=202=20=0AUNION=20ALL=0ASELECT=20vnic_profiles.id,=0A=20=20=20=20=
ad_element_id=0AFROM=20vnic_profiles=0AINNER=20JOIN=20network=0A=20=20=20=
=20ON=20network.id=20=3D=20network_id=0AINNER=20JOIN=20=
internal_permissions_view=0A=20=20=20=20ON=20object_id=20=3D=20=
network.storage_pool_id=0AWHERE=20object_type_id=20=3D=2014=0A=20=20=20=20=
AND=20role_type=20=3D=202=0A=20=20=20=20AND=20allows_viewing_children=20=0A=
UNION=20ALL=0ASELECT=20vnic_profiles.id,=0A=20=20=20=20ad_element_id=0A=
FROM=20vnic_profiles=0AINNER=20JOIN=20network_cluster=0A=20=20=20=20ON=20=
network_cluster.network_id=20=3D=20vnic_profiles.network_id=0AINNER=20=
JOIN=20internal_permissions_view=0A=20=20=20=20ON=20object_id=20=3D=20=
network_cluster.cluster_id=0AWHERE=20object_type_id=20=3D=209=0A=20=20=20=
=20AND=20role_type=20=3D=202=0A=20=20=20=20AND=20allows_viewing_children=20=
=0AUNION=20ALL=0ASELECT=20DISTINCT=20vnic_profile_id,=0A=20=20=20=20=
ad_element_id=0AFROM=20vm_interface=0AINNER=20JOIN=20=
internal_permissions_view=0A=20=20=20=20ON=20object_id=20=3D=20vm_guid=0A=
WHERE=20object_type_id=20=3D=202=0A=20=20=20=20AND=20role_type=20=3D=202=20=
=0AUNION=20ALL=0ASELECT=20DISTINCT=20vnic_profile_id,=0A=20=20=20=20=
ad_element_id=0AFROM=20vm_interface=0AINNER=20JOIN=20=
internal_permissions_view=0A=20=20=20=20ON=20object_id=20=3D=20vmt_guid=0A=
WHERE=20object_type_id=20=3D=204=0A=20=20=20=20AND=20role_type=20=3D=202=20=
=0AUNION=20ALL=0ASELECT=20vnic_profiles.id,=0A=20=20=20=20ad_element_id=0A=
FROM=20internal_permissions_view=0ACROSS=20JOIN=20vnic_profiles=0AWHERE=20=
object_type_id=20=3D=201=0A=20=20=20=20AND=20allows_viewing_children=0A=20=
=20=20=20AND=20role_type=20=3D=202;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20user_vnic_profile_permissions_view=20(=0A=20=20=20=20entity_id,=0A=
=20=20=20=20user_id=0A=20=20=20=20)=20AS=0ASELECT=20DISTINCT=20=
entity_id,=0A=20=20=20=20user_id=0AFROM=20=
user_vnic_profile_permissions_view_base=20NATURAL=0A=20JOIN=20=
engine_session_user_flat_groups;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20user_network_permissions_view_base=20(=0A=20=20=20=20entity_id,=0A=
=20=20=20=20granted_id=0A=20=20=20=20)=20AS=20=0ASELECT=20network.id,=0A=20=
=20=20=20user_id=0AFROM=20network=0AINNER=20JOIN=20vnic_profiles=0A=20=20=
=20=20ON=20network_id=20=3D=20network.id=0AINNER=20JOIN=20=
user_vnic_profile_permissions_view=0A=20=20=20=20ON=20entity_id=20=3D=20=
vnic_profiles.id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
user_network_permissions_view=20(=0A=20=20=20=20entity_id,=0A=20=20=20=20=
user_id=0A=20=20=20=20)=20AS=0ASELECT=20DISTINCT=20entity_id,=0A=20=20=20=
=20user_id=0AFROM=20user_network_permissions_view_base=20NATURAL=0A=20=
JOIN=20engine_session_user_flat_groups;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20user_disk_profile_permissions_view_base=20(=0A=20=20=20=20=
entity_id,=0A=20=20=20=20granted_id=0A=20=20=20=20)=20AS=0ASELECT=20=
object_id,=0A=20=20=20=20ad_element_id=0AFROM=20=
internal_permissions_view=0AWHERE=20object_type_id=20=3D=2029=0A=20=20=20=
=20AND=20role_type=20=3D=202;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
user_disk_profile_permissions_view=20(=0A=20=20=20=20entity_id,=0A=20=20=20=
=20user_id=0A=20=20=20=20)=20AS=0ASELECT=20DISTINCT=20entity_id,=0A=20=20=
=20=20user_id=0AFROM=20user_disk_profile_permissions_view_base=20NATURAL=0A=
=20JOIN=20engine_session_user_flat_groups;=0A**************************=0A=
=0ACREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20VIEW=20user_cpu_profile_permissions_view=20(=0A=20=20=20=20=
entity_id,=0A=20=20=20=20user_id,=0A=20=20=20=20role_id=0A=20=20=20=20)=20=
AS=0ASELECT=20object_id,=0A=20=20=20=20ad_element_id,=0A=20=20=20=20=
role_id=0AFROM=20internal_permissions_view=0AWHERE=20object_type_id=20=3D=20=
30=20=0AUNION=20ALL=0ASELECT=20cpu_profiles.id,=0A=20=20=20=20=
internal_permissions_view.ad_element_id,=0A=20=20=20=20=
internal_permissions_view.role_id=0AFROM=20cpu_profiles=0AINNER=20JOIN=20=
internal_permissions_view=0AON=20object_id=3Dcluster_id=0A=20=20=20=20=
AND=20object_type_id=20=3D=209=20=0AUNION=20ALL=0ASELECT=20=
cpu_profiles.id,=0A=20=20=20=20internal_permissions_view.ad_element_id,=0A=
=20=20=20=20internal_permissions_view.role_id=0AFROM=20cpu_profiles=0A=
INNER=20JOIN=20cluster=0AON=20cluster.cluster_id=3Dcpu_profiles.cluster_id=
=0AINNER=20JOIN=20internal_permissions_view=0AON=20=
object_id=3Dcluster.storage_pool_id=0A=20=20=20=20AND=20object_type_id=20=
=3D=2014=20=20=0AUNION=20ALL=0ASELECT=20cpu_profiles.id,=0A=20=20=20=20=
internal_permissions_view.ad_element_id,=0A=20=20=20=20=
internal_permissions_view.role_id=0AFROM=20cpu_profiles=0ACROSS=20JOIN=20=
internal_permissions_view=0AWHERE=20object_type_id=20=3D=201;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20gluster_volumes_view=20AS=0A=
SELECT=20gluster_volumes.*,=0A=20=20=20=20cluster.name=20AS=20=
cluster_name,=0A=20=20=20=20CASE=0A=20=20=20=20=20=20=20=20WHEN=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20session_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
gluster_georep_session=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20master_volume_id=20=3D=20gluster_volumes.id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20=
true=0A=20=20=20=20=20=20=20=20ELSE=20false=0A=20=20=20=20=20=20=20=20=
END=20AS=20is_master,=0A=20=20=20=20(=0A=20=20=20=20=20=20=20=20SELECT=20=
vol.vol_name=20||=20'|'=20||=20cluster.name=0A=20=20=20=20=20=20=20=20=
FROM=20gluster_georep_session=0A=20=20=20=20=20=20=20=20INNER=20JOIN=20=
gluster_volumes=20vol=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
master_volume_id=20=3D=20vol.id=0A=20=20=20=20=20=20=20=20INNER=20JOIN=20=
cluster=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20cluster.cluster_id=20=
=3D=20vol.cluster_id=0A=20=20=20=20=20=20=20=20WHERE=20slave_volume_id=20=
=3D=20gluster_volumes.id=0A=20=20=20=20=20=20=20=20)=20AS=20=
master_vol_cluster=0AFROM=20gluster_volumes=0AINNER=20JOIN=20cluster=0A=20=
=20=20=20ON=20gluster_volumes.cluster_id=20=3D=20cluster.cluster_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
gluster_volume_snapshots_view=20AS=0ASELECT=20=
gluster_volume_snapshots.*,=0A=20=20=20=20gluster_volumes.cluster_id=20=
AS=20cluster_id,=0A=20=20=20=20gluster_volumes.vol_name=20AS=20=
volume_name=0AFROM=20gluster_volume_snapshots=0AINNER=20JOIN=20=
gluster_volumes=0A=20=20=20=20ON=20gluster_volume_snapshots.volume_id=20=
=3D=20gluster_volumes.id;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
gluster_volume_snapshot_schedules_view=20AS=0ASELECT=20=
gluster_volume_snapshot_schedules.*,=0A=20=20=20=20=
gluster_volumes.cluster_id=20AS=20cluster_id=0AFROM=20=
gluster_volume_snapshot_schedules=0AINNER=20JOIN=20gluster_volumes=0A=20=20=
=20=20ON=20gluster_volume_snapshot_schedules.volume_id=20=3D=20=
gluster_volumes.id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
gluster_volume_bricks_view=20AS=0ASELECT=20gluster_volume_bricks.*,=0A=20=
=20=20=20vds_static.host_name=20AS=20vds_name,=0A=20=20=20=20=
gluster_volumes.vol_name=20AS=20volume_name,=0A=20=20=20=20=
vds_interface.addr=20AS=20interface_address,=0A=20=20=20=20=
gluster_volumes.cluster_id=20AS=20cluster_id=0AFROM=20=
gluster_volume_bricks=0AINNER=20JOIN=20vds_static=0A=20=20=20=20ON=20=
vds_static.vds_id=20=3D=20gluster_volume_bricks.server_id=0AINNER=20JOIN=20=
gluster_volumes=0A=20=20=20=20ON=20gluster_volumes.id=20=3D=20=
gluster_volume_bricks.volume_id=0ALEFT=20JOIN=20network=0A=20=20=20=20ON=20=
network.id=20=3D=20gluster_volume_bricks.network_id=0ALEFT=20JOIN=20=
vds_interface=0A=20=20=20=20ON=20vds_interface.vds_id=20=3D=20=
gluster_volume_bricks.server_id=0A=20=20=20=20=20=20=20=20AND=20=
vds_interface.network_name=20=3D=20network.name;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20gluster_volume_task_steps=20=
AS=0ASELECT=20step.*,=0A=20=20=20=20gluster_volumes.id=20AS=20volume_id,=0A=
=20=20=20=20job.job_id=20AS=20job_job_id,=0A=20=20=20=20job.action_type,=0A=
=20=20=20=20job.description=20AS=20job_description,=0A=20=20=20=20=
job.status=20AS=20job_status,=0A=20=20=20=20job.start_time=20AS=20=
job_start_time,=0A=20=20=20=20job.end_time=20AS=20job_end_time=0AFROM=20=
gluster_volumes=0AINNER=20JOIN=20job_subject_entity=20js=0A=20=20=20=20=
ON=20js.entity_id=20=3D=20gluster_volumes.id=0AINNER=20JOIN=20job=0A=20=20=
=20=20ON=20job.job_id=20=3D=20js.job_id=0A=20=20=20=20=20=20=20=20AND=20=
job.action_type=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
'StartRebalanceGlusterVolume',=0A=20=20=20=20=20=20=20=20=20=20=20=20=
'StartRemoveGlusterVolumeBricks'=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=
LEFT=20JOIN=20step=0A=20=20=20=20ON=20step.external_id=20=3D=20=
gluster_volumes.task_id=0A=20=20=20=20=20=20=20=20AND=20=
step.external_system_type=20=3D=20'GLUSTER'=0A=20=20=20=20=20=20=20=20=
AND=20step.job_id=20=3D=20js.job_id;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20gluster_server_services_view=20AS=0ASELECT=20=
gluster_server_services.*,=0A=20=20=20=20gluster_services.service_name,=0A=
=20=20=20=20gluster_services.service_type,=0A=20=20=20=20=
vds_static.vds_name=0AFROM=20gluster_server_services=0AINNER=20JOIN=20=
gluster_services=0A=20=20=20=20ON=20gluster_server_services.service_id=20=
=3D=20gluster_services.id=0AINNER=20JOIN=20vds_static=0A=20=20=20=20ON=20=
gluster_server_services.server_id=20=3D=20vds_static.vds_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20gluster_server_hooks_view=20=
AS=0ASELECT=20gluster_server_hooks.*,=0A=20=20=20=20vds_static.vds_name=20=
AS=20server_name=0AFROM=20gluster_server_hooks=0AINNER=20JOIN=20=
vds_static=0A=20=20=20=20ON=20gluster_server_hooks.server_id=20=3D=20=
vds_static.vds_id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
gluster_georep_sessions_view=20AS=0ASELECT=20session_id,=0A=20=20=20=20=
master_volume_id,=0A=20=20=20=20session_key,=0A=20=20=20=20=
slave_host_uuid,=0A=20=20=20=20slave_host_name,=0A=20=20=20=20=
slave_volume_id,=0A=20=20=20=20slave_volume_name,=0A=20=20=20=20=
georep.status,=0A=20=20=20=20georep._create_date,=0A=20=20=20=20=
georep._update_date,=0A=20=20=20=20gluster_volumes.vol_name=20AS=20=
master_volume_name,=0A=20=20=20=20gluster_volumes.cluster_id=20AS=20=
cluster_id,=0A=20=20=20=20georep.user_name=0AFROM=20=
gluster_georep_session=20georep=0AINNER=20JOIN=20gluster_volumes=0A=20=20=
=20=20ON=20gluster_volumes.id=20=3D=20georep.master_volume_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20gluster_geo_rep_config_view=20=
AS=0ASELECT=20session_id,=0A=20=20=20=20georepConfig.config_key,=0A=20=20=
=20=20config_value,=0A=20=20=20=20config_description,=0A=20=20=20=20=
config_possible_values,=0A=20=20=20=20_update_date=0AFROM=20=
gluster_georep_config=20georepConfig=0ALEFT=20JOIN=20=
gluster_config_master=0A=20=20=20=20ON=20=
gluster_config_master.config_key=20=3D=20georepConfig.config_key=0A=20=20=
=20=20=20=20=20=20AND=20gluster_config_master.config_feature=20=3D=20=
'geo_replication';=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
supported_cluster_features_view=20AS=0ASELECT=20cluster_features.*,=0A=20=
=20=20=20supported_cluster_features.cluster_id,=0A=20=20=20=20=
supported_cluster_features.is_enabled=0AFROM=20cluster_features=0AINNER=20=
JOIN=20supported_cluster_features=0A=20=20=20=20ON=20=
supported_cluster_features.feature_id=20=3D=20=
cluster_features.feature_id;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
affinity_groups_view=20AS=0ASELECT=20affinity_groups.*,=0A=20=20=20=20=
array_to_string(array_agg(affinity_group_members.vm_id),=20',')=20AS=20=
vm_ids,=0A=20=20=20=20array_to_string(array_agg(vm_static.vm_name),=20=
',')=20AS=20vm_names=0AFROM=20affinity_groups=0ALEFT=20JOIN=20=
affinity_group_members=0A=20=20=20=20ON=20=
affinity_group_members.affinity_group_id=20=3D=20affinity_groups.id=0A=
LEFT=20JOIN=20vm_static=0A=20=20=20=20ON=20vm_static.vm_guid=20=3D=20=
affinity_group_members.vm_id=20=0AGROUP=20BY=20affinity_groups.id,=0A=20=20=
=20=20affinity_groups.name,=0A=20=20=20=20affinity_groups.description,=0A=
=20=20=20=20affinity_groups.cluster_id,=0A=20=20=20=20=
affinity_groups.positive,=0A=20=20=20=20affinity_groups.enforcing,=0A=20=20=
=20=20affinity_groups._create_date,=0A=20=20=20=20=
affinity_groups._update_date;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
numa_node_cpus_view=20AS=0ASELECT=20*=0AFROM=20numa_node=0AINNER=20JOIN=0A=
=20=20=20=20(SELECT=20numa_node_id=20AS=20numa_node_id2,=0A=20=20=20=20=20=
=20=20=20ARRAY_AGG(cpu_core_id)=20AS=20cpu_core_ids=0A=20=20=20=20FROM=20=
numa_node_cpu_map=0A=20=20=20=20GROUP=20BY=20numa_node_id=0A=20=20=20=20=
)=20numa_node_to_cpu_core_ids=0A=20=20=20=20ON=20numa_node.numa_node_id=20=
=3D=20numa_node_to_cpu_core_ids.numa_node_id2;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20numa_node_assignment_view=20=
AS=0ASELECT=20vm_vds_numa_node_map.vm_numa_node_id=20AS=20=
assigned_vm_numa_node_id,=0A=20=20=20=20vm_vds_numa_node_map.is_pinned=20=
AS=20is_pinned,=0A=20=20=20=20vm_vds_numa_node_map.vds_numa_node_index=20=
AS=20last_run_in_vds_numa_node_index,=0A=20=20=20=20vm_numa_node.vm_id=20=
AS=20vm_numa_node_vm_id,=0A=20=20=20=20vm_numa_node.numa_node_index=20AS=20=
vm_numa_node_index,=0A=20=20=20=20vm_numa_node.mem_total=20AS=20=
vm_numa_node_mem_total,=0A=20=20=20=20vm_numa_node.cpu_count=20AS=20=
vm_numa_node_cpu_count,=0A=20=20=20=20vm_numa_node.mem_free=20AS=20=
vm_numa_node_mem_free,=0A=20=20=20=20vm_numa_node.usage_mem_percent=20AS=20=
vm_numa_node_usage_mem_percent,=0A=20=20=20=20vm_numa_node.cpu_sys=20AS=20=
vm_numa_node_cpu_sys,=0A=20=20=20=20vm_numa_node.cpu_user=20AS=20=
vm_numa_node_cpu_user,=0A=20=20=20=20vm_numa_node.cpu_idle=20AS=20=
vm_numa_node_cpu_idle,=0A=20=20=20=20vm_numa_node.usage_cpu_percent=20AS=20=
vm_numa_node_usage_cpu_percent,=0A=20=20=20=20vm_numa_node.distance=20AS=20=
vm_numa_node_distance,=0A=20=20=20=20run_in_vds_numa_node.numa_node_id=20=
AS=20run_in_vds_numa_node_id,=0A=20=20=20=20run_in_vds_numa_node.vds_id=20=
AS=20run_in_vds_id,=0A=20=20=20=20run_in_vds_numa_node.numa_node_index=20=
AS=20run_in_vds_numa_node_index,=0A=20=20=20=20=
run_in_vds_numa_node.mem_total=20AS=20run_in_vds_numa_node_mem_total,=0A=20=
=20=20=20run_in_vds_numa_node.cpu_count=20AS=20=
run_in_vds_numa_node_cpu_count,=0A=20=20=20=20=
run_in_vds_numa_node.mem_free=20AS=20run_in_vds_numa_node_mem_free,=0A=20=
=20=20=20run_in_vds_numa_node.usage_mem_percent=20AS=20=
run_in_vds_numa_node_usage_mem_percent,=0A=20=20=20=20=
run_in_vds_numa_node.cpu_sys=20AS=20run_in_vds_numa_node_cpu_sys,=0A=20=20=
=20=20run_in_vds_numa_node.cpu_user=20AS=20=
run_in_vds_numa_node_cpu_user,=0A=20=20=20=20=
run_in_vds_numa_node.cpu_idle=20AS=20run_in_vds_numa_node_cpu_idle,=0A=20=
=20=20=20run_in_vds_numa_node.usage_cpu_percent=20AS=20=
run_in_vds_numa_node_usage_cpu_percent,=0A=20=20=20=20=
run_in_vds_numa_node.distance=20AS=20run_in_vds_numa_node_distance=0A=
FROM=20vm_vds_numa_node_map=0ALEFT=20JOIN=20numa_node=20AS=20=
vm_numa_node=0A=20=20=20=20ON=20vm_vds_numa_node_map.vm_numa_node_id=20=3D=
=20vm_numa_node.numa_node_id=0ALEFT=20JOIN=20numa_node=20AS=20=
run_in_vds_numa_node=0A=20=20=20=20ON=20=
vm_vds_numa_node_map.vds_numa_node_id=20=3D=20=
run_in_vds_numa_node.numa_node_id;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20numa_node_with_cluster_view=20AS=0ASELECT=20=
vm_numa_node.numa_node_id=20AS=20vm_numa_node_id,=0A=20=20=20=20=
vm_numa_node.vm_id=20AS=20vm_numa_node_vm_id,=0A=20=20=20=20=
vm_numa_node.numa_node_index=20AS=20vm_numa_node_index,=0A=20=20=20=20=
vm_numa_node.mem_total=20AS=20vm_numa_node_mem_total,=0A=20=20=20=20=
vm_numa_node.cpu_count=20AS=20vm_numa_node_cpu_count,=0A=20=20=20=20=
vm_numa_node.mem_free=20AS=20vm_numa_node_mem_free,=0A=20=20=20=20=
vm_numa_node.usage_mem_percent=20AS=20vm_numa_node_usage_mem_percent,=0A=20=
=20=20=20vm_numa_node.cpu_sys=20AS=20vm_numa_node_cpu_sys,=0A=20=20=20=20=
vm_numa_node.cpu_user=20AS=20vm_numa_node_cpu_user,=0A=20=20=20=20=
vm_numa_node.cpu_idle=20AS=20vm_numa_node_cpu_idle,=0A=20=20=20=20=
vm_numa_node.usage_cpu_percent=20AS=20vm_numa_node_usage_cpu_percent,=0A=20=
=20=20=20vm_numa_node.distance=20AS=20vm_numa_node_distance,=0A=20=20=20=20=
vm_static.cluster_id=0AFROM=20numa_node=20AS=20vm_numa_node=0ALEFT=20=
JOIN=20vm_static=0A=20=20=20=20ON=20vm_numa_node.vm_id=20=3D=20=
vm_static.vm_guid;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
vm_host_pinning_view=20AS=0ASELECT=20host.vds_name,=0A=20=20=20=20=
vm.vm_name,=0A=20=20=20=20vm_vds.*=0AFROM=20vm_host_pinning_map=20AS=20=
vm_vds=0AINNER=20JOIN=20vm_static=20AS=20vm=0A=20=20=20=20ON=20=
vm_vds.vm_id=20=3D=20vm.vm_guid=0AINNER=20JOIN=20vds_static=20AS=20host=0A=
=20=20=20=20ON=20vm_vds.vds_id=20=3D=20host.vds_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20host_device_view=20AS=0A=
SELECT=20host_device.*,=0A=20=20=20=20NULL::UUID=20AS=20=
configured_vm_id,=0A=20=20=20=20NULL::VARCHAR=20AS=20spec_params,=0A=20=20=
=20=20(=0A=20=20=20=20=20=20=20=20SELECT=20=
array_to_string(array_agg(vm_host_pinning_view.vm_name),=20',')=0A=20=20=20=
=20=20=20=20=20FROM=20vm_device=0A=20=20=20=20=20=20=20=20INNER=20JOIN=20=
vm_host_pinning_view=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
vm_device.vm_id=20=3D=20vm_host_pinning_view.vm_id=0A=20=20=20=20=20=20=20=
=20WHERE=20vm_device.device=20=3D=20host_device.device_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20vm_host_pinning_view.vds_id=20=3D=20=
host_device.host_id=0A=20=20=20=20=20=20=20=20)=20AS=20=
attached_vm_names,=0A=20=20=20=20(=0A=20=20=20=20=20=20=20=20SELECT=20=
vm_name=0A=20=20=20=20=20=20=20=20FROM=20vm_static=0A=20=20=20=20=20=20=20=
=20WHERE=20vm_static.vm_guid=20=3D=20host_device.vm_id=0A=20=20=20=20=20=20=
=20=20)=20AS=20running_vm_name=0AFROM=20host_device;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
host_network_qos_of_migration_network_by_cluster=20AS=0ASELECT=20=
network_cluster.cluster_id,=20qos.*=0AFROM=20qos,=20network_cluster,=20=
network=0AWHERE=20network_cluster.network_id=20=3D=20network.id=0A=20=20=20=
=20=20=20AND=20network_cluster.migration=0A=20=20=20=20=20=20AND=20=
network.qos_id=20=3D=20qos.id;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
active_migration_network_interfaces=20AS=0ASELECT=20vds_interface_view.*=0A=
FROM=20vds_interface_view,=0A=20=20=20=20vds_dynamic,=0A=20=20=20=20=
network_attachments,=0A=20=20=20=20network,=0A=20=20=20=20=
network_cluster=0AWHERE=20vds_interface_view.id=20=3D=20=
network_attachments.nic_id=0A=20=20=20=20=20=20AND=20=
network_attachments.network_id=20=3D=20network.id=0A=20=20=20=20=20=20=
AND=20network.id=20=3D=20network_cluster.network_id=0A=20=20=20=20=20=20=
AND=20network_cluster.migration=0A=20=20=20=20=20=20AND=20=
network_cluster.cluster_id=20=3D=20vds_interface_view.cluster_id=0A=20=20=
=20=20=20=20AND=20vds_dynamic.vds_id=20=3D=20vds_interface_view.vds_id=0A=
=20=20=20=20=20=20AND=20vds_dynamic.status=20IN=20(3,=209)=20=20=20=20=20=
=20=20=20=20=0A=20=20=20=20=20=20AND=20vds_interface_view.iface_status=20=
=3D=201;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20vm_host_device_view=20=
AS=0ASELECT=20host_device.*,=0A=20=20=20=20vm_device.vm_id=20AS=20=
configured_vm_id,=0A=20=20=20=20vm_device.spec_params=20AS=20=
spec_params,=0A=20=20=20=20=
array_to_string(array_agg(vm_host_pinning_view.vm_name)=20OVER=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20PARTITION=20BY=20host_id,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20device_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=
),=20',')=20AS=20attached_vm_names,=0A=20=20=20=20(=0A=20=20=20=20=20=20=20=
=20SELECT=20vm_name=0A=20=20=20=20=20=20=20=20FROM=20vm_static=0A=20=20=20=
=20=20=20=20=20WHERE=20vm_static.vm_guid=20=3D=20host_device.vm_id=0A=20=20=
=20=20=20=20=20=20)=20AS=20running_vm_name=0AFROM=20vm_device=0AINNER=20=
JOIN=20vm_host_pinning_view=0A=20=20=20=20ON=20vm_device.vm_id=20=3D=20=
vm_host_pinning_view.vm_id=0AINNER=20JOIN=20host_device=0A=20=20=20=20ON=20=
host_device.device_name=20=3D=20vm_device.device=0A=20=20=20=20=20=20=20=20=
AND=20vm_host_pinning_view.vds_id=20=3D=20host_device.host_id=0AWHERE=20=
vm_device.type=20=3D=20'hostdev';=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20user_profiles_view=20AS=0ASELECT=20user_profiles.*,=0A=20=20=20=20=
users.username=20||=20'@'=20||=20users.domain=20AS=20login_name=0AFROM=20=
user_profiles=0AINNER=20JOIN=20users=0A=20=20=20=20ON=20=
user_profiles.user_id=20=3D=20users.user_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20qos_for_vm_view=20AS=0A=
SELECT=20qos.*,=0A=20=20=20=20vm_static.vm_guid=20AS=20vm_id=0AFROM=20=
qos=0A=20=20=20=20INNER=20JOIN=20cpu_profiles=0A=20=20=20=20=20=20=20=20=
ON=20qos.id=20=3D=20cpu_profiles.qos_id=0A=20=20=20=20INNER=20JOIN=20=
vm_static=0A=20=20=20=20=20=20=20=20ON=20vm_static.cpu_profile_id=20=3D=20=
cpu_profiles.id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
qos_for_disk_profile_view=20AS=0ASELECT=20qos.*,=0A=20=20=20=20=
disk_profiles.id=20AS=20disk_profile_id=0AFROM=20qos=0A=20=20=20=20INNER=20=
JOIN=20disk_profiles=0A=20=20=20=20=20=20=20=20ON=20qos.id=20=3D=20=
disk_profiles.qos_id;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
labels_map_view=20AS=0A=0A=0A=0ASELECT=20labels.label_id,=0A=20=20=20=20=
labels.label_name,=0A=20=20=20=20labels.read_only,=0A=20=20=20=20=
array_agg(labels_map.vm_id::text)=20as=20vm_ids,=0A=20=20=20=20=
array_agg(labels_map.vds_id::text)=20as=20vds_ids=0AFROM=20labels=0ALEFT=20=
JOIN=20labels_map=0A=20=20=20=20ON=20labels_map.label_id=20=3D=20=
labels.label_id=0AGROUP=20BY=20labels.label_id,=20labels.label_name,=20=
labels.read_only;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
disk_vm_element_extended=20AS=0A=20=20=20=20SELECT=20dve.*,=20=
vd.is_plugged=0A=20=20=20=20FROM=20disk_vm_element=20dve=0A=20=20=20=20=
JOIN=20vm_device=20vd=0A=20=20=20=20=20=20=20=20ON=20dve.disk_id=20=3D=20=
vd.device_id=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20dve.vm_id=20=3D=20=
vd.vm_id;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_datacenter_configuration_history_view=20AS=0ASELECT=20id=20AS=20=
datacenter_id,=0A=20=20=20=20name=20AS=20datacenter_name,=0A=20=20=20=20=
description=20AS=20datacenter_description,=0A=20=20=20=20is_local=20AS=20=
is_local_storage,=0A=20=20=20=20_create_date=20AS=20create_date,=0A=20=20=
=20=20_update_date=20AS=20update_date=0AFROM=20storage_pool=0AWHERE=20(=0A=
=20=20=20=20=20=20=20=20_create_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=20var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20dwh_history_timekeeping=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20OR=20(=0A=20=20=20=20=20=20=
=20=20_update_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
dwh_history_timekeeping=20AS=20history_timekeeping_1=0A=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_storage_domain_configuration_history_view=20AS=0ASELECT=20id=20AS=20=
storage_domain_id,=0A=20=20=20=20storage_name=20AS=20=
storage_domain_name,=0A=20=20=20=20CAST(storage_domain_type=20AS=20=
SMALLINT)=20AS=20storage_domain_type,=0A=20=20=20=20CAST(storage_type=20=
AS=20SMALLINT)=20AS=20storage_type,=0A=20=20=20=20_create_date=20AS=20=
create_date,=0A=20=20=20=20_update_date=20AS=20update_date=0AFROM=20=
storage_domain_static=0AWHERE=20(=0A=20=20=20=20=20=20=20=20_create_date=20=
>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20var_datetime=0A=20=20=
=20=20=20=20=20=20=20=20=20=20FROM=20dwh_history_timekeeping=0A=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
OR=20(=0A=20=20=20=20=20=20=20=20_update_date=20>=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=20var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20dwh_history_timekeeping=20AS=20history_timekeeping_1=0A=20=20=20=
=20=20=20=20=20=20=20=20=20WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=
=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_datacenter_storage_map_history_view=20AS=0ASELECT=20DISTINCT=20=
storage_pool_id=20AS=20datacenter_id,=0A=20=20=20=20storage_id=20AS=20=
storage_domain_id=0AFROM=20storage_pool_iso_map;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_storage_domain_history_view=20AS=0ASELECT=20=
storage_domain_dynamic.id=20AS=20storage_domain_id,=0A=20=20=20=20=
COALESCE(storage_domain_shared_status.status,=200)=20AS=20=
storage_domain_status,=0A=20=20=20=20=
storage_domain_dynamic.available_disk_size=20AS=20=
available_disk_size_gb,=0A=20=20=20=20=
storage_domain_dynamic.used_disk_size=20AS=20used_disk_size_gb=0AFROM=20=
storage_domain_dynamic=0AINNER=20JOIN=20storage_domain_static=0A=20=20=20=
=20ON=20(storage_domain_dynamic.id=20=3D=20storage_domain_static.id)=0A=
LEFT=20JOIN=20storage_domain_shared_status=0A=20=20=20=20ON=20=
storage_domain_shared_status.storage_id=20=3D=20=
storage_domain_static.id;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_cluster_configuration_history_view=20AS=0ASELECT=20cluster_id=20AS=20=
cluster_id,=0A=20=20=20=20name=20AS=20cluster_name,=0A=20=20=20=20=
description=20AS=20cluster_description,=0A=20=20=20=20storage_pool_id=20=
AS=20datacenter_id,=0A=20=20=20=20cpu_name,=0A=20=20=20=20=
compatibility_version,=0A=20=20=20=20_create_date=20AS=20create_date,=0A=20=
=20=20=20_update_date=20AS=20update_date=0AFROM=20cluster=0AWHERE=20(=0A=20=
=20=20=20=20=20=20=20_create_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=20var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
dwh_history_timekeeping=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
(var_name=20=3D=20'lastSync')=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20OR=20(=0A=20=20=20=20=20=20=20=20=
_update_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
dwh_history_timekeeping=20AS=20history_timekeeping_1=0A=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_host_configuration_history_view=20AS=0ASELECT=20a.vds_id=20AS=20=
host_id,=0A=20=20=20=20a.vds_unique_id=20AS=20host_unique_id,=0A=20=20=20=
=20a.vds_name=20AS=20host_name,=0A=20=20=20=20a.cluster_id=20AS=20=
cluster_id,=0A=20=20=20=20CAST(a.vds_type=20AS=20SMALLINT)=20AS=20=
host_type,=0A=20=20=20=20a.host_name=20AS=20fqdn_or_ip,=0A=20=20=20=20=
b.physical_mem_mb=20AS=20memory_size_mb,=0A=20=20=20=20CAST(c.swap_total=20=
AS=20INT)=20AS=20swap_size_mb,=0A=20=20=20=20b.cpu_model,=0A=20=20=20=20=
CAST(b.cpu_cores=20AS=20SMALLINT)=20AS=20number_of_cores,=0A=20=20=20=20=
CAST(b.cpu_sockets=20AS=20SMALLINT)=20AS=20number_of_sockets,=0A=20=20=20=
=20b.cpu_speed_mh,=0A=20=20=20=20b.host_os,=0A=20=20=20=20=
b.kernel_version,=0A=20=20=20=20b.kvm_version,=0A=20=20=20=20=
b.libvirt_version,=0A=20=20=20=20b.software_version=20AS=20vdsm_version,=0A=
=20=20=20=20a.port=20AS=20vdsm_port,=0A=20=20=20=20CAST(b.cpu_threads=20=
AS=20SMALLINT)=20AS=20threads_per_core,=0A=20=20=20=20b.hw_manufacturer=20=
AS=20hardware_manufacturer,=0A=20=20=20=20b.hw_product_name=20AS=20=
hardware_product_name,=0A=20=20=20=20b.hw_version=20AS=20=
hardware_version,=0A=20=20=20=20b.hw_serial_number=20AS=20=
hardware_serial_number,=0A=20=20=20=20a._create_date=20AS=20create_date,=0A=
=20=20=20=20a._update_date=20AS=20update_date=0AFROM=20vds_static=20AS=20=
a=0AINNER=20JOIN=20vds_dynamic=20AS=20b=0A=20=20=20=20ON=20a.vds_id=20=3D=20=
b.vds_id=0AINNER=20JOIN=20vds_statistics=20AS=20c=0A=20=20=20=20ON=20=
c.vds_id=20=3D=20a.vds_id=0AWHERE=20(=0A=20=20=20=20=20=20=20=20=
a._create_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
dwh_history_timekeeping=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
(var_name=20=3D=20'lastSync')=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20OR=20(=0A=20=20=20=20=20=20=20=20=
a._update_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
dwh_history_timekeeping=20AS=20history_timekeeping_1=0A=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_host_configuration_full_check_view=20AS=0ASELECT=20a.vds_id=20AS=20=
host_id,=0A=20=20=20=20a.vds_unique_id=20AS=20host_unique_id,=0A=20=20=20=
=20a.vds_name=20AS=20host_name,=0A=20=20=20=20a.cluster_id=20AS=20=
cluster_id,=0A=20=20=20=20CAST(a.vds_type=20AS=20SMALLINT)=20AS=20=
host_type,=0A=20=20=20=20a.host_name=20AS=20fqdn_or_ip,=0A=20=20=20=20=
b.physical_mem_mb=20AS=20memory_size_mb,=0A=20=20=20=20CAST(c.swap_total=20=
AS=20INT)=20AS=20swap_size_mb,=0A=20=20=20=20b.cpu_model,=0A=20=20=20=20=
CAST(b.cpu_cores=20AS=20SMALLINT)=20AS=20number_of_cores,=0A=20=20=20=20=
CAST(b.cpu_sockets=20AS=20SMALLINT)=20AS=20number_of_sockets,=0A=20=20=20=
=20b.cpu_speed_mh,=0A=20=20=20=20b.host_os,=0A=20=20=20=20=
b.kernel_version,=0A=20=20=20=20b.kvm_version,=0A=20=20=20=20=
b.libvirt_version,=0A=20=20=20=20CASE=20SUBSTR(b.software_version,=201,=20=
3)=0A=20=20=20=20=20=20=20=20WHEN=20'4.4'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20THEN=20'2.1'=20||=20SUBSTR(b.software_version,=204,=20=
LENGTH(b.software_version))=0A=20=20=20=20=20=20=20=20WHEN=20'4.5'=0A=20=20=
=20=20=20=20=20=20=20=20=20=20THEN=20'2.2'=20||=20=
SUBSTR(b.software_version,=204,=20LENGTH(b.software_version))=0A=20=20=20=
=20=20=20=20=20WHEN=20'4.9'=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20=
'2.3'=20||=20SUBSTR(b.software_version,=204,=20=
LENGTH(b.software_version))=0A=20=20=20=20=20=20=20=20ELSE=20=
b.software_version=0A=20=20=20=20=20=20=20=20END=20AS=20vdsm_version,=0A=20=
=20=20=20a.port=20AS=20vdsm_port,=0A=20=20=20=20CAST(b.cpu_threads=20AS=20=
SMALLINT)=20AS=20threads_per_core,=0A=20=20=20=20b.hw_manufacturer=20AS=20=
hardware_manufacturer,=0A=20=20=20=20b.hw_product_name=20AS=20=
hardware_product_name,=0A=20=20=20=20b.hw_version=20AS=20=
hardware_version,=0A=20=20=20=20b.hw_serial_number=20AS=20=
hardware_serial_number,=0A=20=20=20=20a._create_date=20AS=20create_date,=0A=
=20=20=20=20a._update_date=20AS=20update_date=0AFROM=20vds_static=20AS=20=
a=0AINNER=20JOIN=20vds_dynamic=20AS=20b=0A=20=20=20=20ON=20a.vds_id=20=3D=20=
b.vds_id=0AINNER=20JOIN=20vds_statistics=20AS=20c=0A=20=20=20=20ON=20=
c.vds_id=20=3D=20a.vds_id;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_host_history_view=20AS=0ASELECT=20b.vds_id=20AS=20host_id,=0A=20=20=20=
=20CAST(b.status=20AS=20SMALLINT)=20AS=20host_status,=0A=20=20=20=20=
CAST(c.usage_mem_percent=20AS=20SMALLINT)=20AS=20memory_usage_percent,=0A=
=20=20=20=20CAST(c.usage_cpu_percent=20AS=20SMALLINT)=20AS=20=
cpu_usage_percent,=0A=20=20=20=20CAST(c.ksm_cpu_percent=20AS=20SMALLINT)=20=
AS=20ksm_cpu_percent,=0A=20=20=20=20CAST(c.cpu_load=20AS=20INT)=20AS=20=
cpu_load,=0A=20=20=20=20CAST(c.cpu_sys=20AS=20SMALLINT)=20AS=20=
system_cpu_usage_percent,=0A=20=20=20=20CAST(c.cpu_user=20AS=20SMALLINT)=20=
AS=20user_cpu_usage_percent,=0A=20=20=20=20CAST((c.swap_total=20-=20=
c.swap_free)=20AS=20INT)=20AS=20swap_used_mb,=0A=20=20=20=20=
CAST(b.vm_active=20AS=20SMALLINT)=20AS=20vm_active,=0A=20=20=20=20=
CAST(b.vm_count=20AS=20SMALLINT)=20AS=20total_vms,=0A=20=20=20=20=
b.vms_cores_count=20AS=20total_vms_vcpus,=0A=20=20=20=20c.mem_shared=20=
AS=20ksm_shared_memory_mb=0AFROM=20vds_dynamic=20b,=0A=20=20=20=20=
vds_statistics=20c=0AWHERE=20b.vds_id=20=3D=20c.vds_id;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_host_interface_configuration_history_view=20AS=0ASELECT=20a.id=20AS=20=
host_interface_id,=0A=20=20=20=20a.name=20AS=20host_interface_name,=0A=20=
=20=20=20a.vds_id=20AS=20host_id,=0A=20=20=20=20CAST(a.type=20AS=20=
SMALLINT)=20AS=20host_interface_type,=0A=20=20=20=20a.speed=20AS=20=
host_interface_speed_bps,=0A=20=20=20=20a.mac_addr=20AS=20mac_address,=0A=
=20=20=20=20a.network_name=20AS=20logical_network_name,=0A=20=20=20=20=
a.addr=20AS=20ip_address,=0A=20=20=20=20a.gateway,=0A=20=20=20=20=
a.is_bond=20AS=20bond,=0A=20=20=20=20a.bond_name,=0A=20=20=20=20=
a.vlan_id,=0A=20=20=20=20a._create_date=20AS=20create_date,=0A=20=20=20=20=
a._update_date=20AS=20update_date=0AFROM=20vds_interface=20AS=20a=0A=
WHERE=20(=0A=20=20=20=20=20=20=20=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20a._create_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=20var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20dwh_history_timekeeping=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
a._update_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20dwh_history_timekeeping=20AS=20history_timekeeping_1=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20(var_name=20=3D=20=
'lastSync')=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
AND=20(=0A=20=20=20=20=20=20=20=20a.is_bond=20IS=20NULL=0A=20=20=20=20=20=
=20=20=20OR=20a.is_bond=20=3D=20FALSE=0A=20=20=20=20=20=20=20=20OR=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20a.is_bond=20=3D=20TRUE=0A=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20a.name=20IN=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=20b.bond_name=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20FROM=20vds_interface=20AS=20b=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20b.is_bond=20IS=20NULL=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20b.vds_id=20=3D=20=
a.vds_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_host_interface_history_view=20AS=0ASELECT=20=
vds_interface_statistics.id=20AS=20host_interface_id,=0A=20=20=20=20=
CAST(vds_interface_statistics.rx_rate=20AS=20SMALLINT)=20AS=20=
receive_rate_percent,=0A=20=20=20=20=
CAST(vds_interface_statistics.tx_rate=20AS=20SMALLINT)=20AS=20=
transmit_rate_percent,=0A=20=20=20=20vds_interface_statistics.rx_total=20=
AS=20received_total_byte,=0A=20=20=20=20=
vds_interface_statistics.tx_total=20AS=20transmitted_total_byte=0AFROM=20=
vds_interface_statistics;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_vm_configuration_history_view=20AS=0ASELECT=20a.vm_guid=20AS=20=
vm_id,=0A=20=20=20=20a.vm_name,=0A=20=20=20=20a.description=20AS=20=
vm_description,=0A=20=20=20=20CAST(a.vm_type=20AS=20SMALLINT)=20AS=20=
vm_type,=0A=20=20=20=20a.cluster_id=20AS=20cluster_id,=0A=20=20=20=20=
a.vmt_guid=20AS=20template_id,=0A=20=20=20=20b.vm_name=20AS=20=
template_name,=0A=20=20=20=20CAST(a.cpu_per_socket=20AS=20SMALLINT)=20AS=20=
cpu_per_socket,=0A=20=20=20=20CAST(a.num_of_sockets=20AS=20SMALLINT)=20=
AS=20number_of_sockets,=0A=20=20=20=20a.mem_size_mb=20AS=20=
memory_size_mb,=0A=20=20=20=20CAST(a.os=20AS=20SMALLINT)=20AS=20=
operating_system,=0A=20=20=20=20f.vds_id=20AS=20default_host,=0A=20=20=20=
=20a.auto_startup=20AS=20high_availability,=0A=20=20=20=20=
a.is_initialized=20AS=20initialized,=0A=20=20=20=20a.is_stateless=20AS=20=
stateless,=0A=20=20=20=20a.fail_back,=0A=20=20=20=20CAST(a.usb_policy=20=
AS=20SMALLINT)=20AS=20usb_policy,=0A=20=20=20=20a.time_zone,=0A=20=20=20=20=
c.vm_pool_id,=0A=20=20=20=20d.vm_pool_name,=0A=20=20=20=20e.user_id=20AS=20=
created_by_user_id,=0A=20=20=20=20a._create_date=20AS=20create_date,=0A=20=
=20=20=20a._update_date=20AS=20update_date=0AFROM=20vm_static=20AS=20a=0A=
INNER=20JOIN=20vm_static=20AS=20b=0A=20=20=20=20ON=20a.vmt_guid=20=3D=20=
b.vm_guid=0ALEFT=20JOIN=20vm_pool_map=20AS=20c=0A=20=20=20=20ON=20=
a.vm_guid=20=3D=20c.vm_guid=0ALEFT=20JOIN=20vm_pools=20AS=20d=0A=20=20=20=
=20ON=20c.vm_pool_id=20=3D=20d.vm_pool_id=0ALEFT=20JOIN=20users=20AS=20e=0A=
=20=20=20=20ON=20a.created_by_user_id=20=3D=20e.user_id=0ALEFT=20JOIN=20=
(=0A=20=20=20=20SELECT=20DISTINCT=0A=20=20=20=20=20=20=20=20ON=20(vm_id)=20=
vm_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20vds_id=0A=20=20=20=20FROM=20=
vm_host_pinning_map=0A=20=20=20=20ORDER=20BY=20vm_id=0A=20=20=20=20)=20f=0A=
=20=20=20=20ON=20f.vm_id=20=3D=20a.vm_guid,=0A=20=20=20=20=20=20=20=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20var_datetime=0A=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20dwh_history_timekeeping=0A=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20var_name=20=3D=20'lastSync'=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=20AS=20lastSync=0AWHERE=20(=0A=20=20=20=20=20=20=20=20=
a.entity_type=20=3D=20'VM'=0A=20=20=20=20=20=20=20=20AND=20b.entity_type=20=
=3D=20'TEMPLATE'=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20AND=20=
greatest(a._create_date,=20a._update_date,=20b._update_date)=20>=20=
lastSync.var_datetime;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_vm_history_view=20AS=0ASELECT=20c.vm_guid=20AS=20vm_id,=0A=20=20=20=20=
CAST(b.status=20AS=20SMALLINT)=20AS=20vm_status,=0A=20=20=20=20=
CAST(c.usage_cpu_percent=20AS=20SMALLINT)=20AS=20cpu_usage_percent,=0A=20=
=20=20=20CAST(c.usage_mem_percent=20AS=20SMALLINT)=20AS=20=
memory_usage_percent,=0A=20=20=20=20CAST((c.cpu_sys=20/=20=
(vm_static.cpu_per_socket=20*=20vm_static.num_of_sockets))=20AS=20=
SMALLINT)=20AS=20system_cpu_usage_percent,=0A=20=20=20=20=
CAST((c.cpu_user=20/=20(vm_static.cpu_per_socket=20*=20=
vm_static.num_of_sockets))=20AS=20SMALLINT)=20AS=20=
user_cpu_usage_percent,=0A=20=20=20=20c.disks_usage,=0A=20=20=20=20=
b.vm_ip,=0A=20=20=20=20b.vm_fqdn,=0A=20=20=20=20b.client_ip=20AS=20=
vm_client_ip,=0A=20=20=20=20b.console_user_id=20AS=20current_user_id,=0A=20=
=20=20=20CASE=0A=20=20=20=20=20=20=20=20WHEN=20b.guest_cur_user_name=20=
IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20THEN=20FALSE=0A=20=20=20=20=
=20=20=20=20ELSE=20TRUE=0A=20=20=20=20=20=20=20=20END=20AS=20=
user_logged_in_to_guest,=0A=20=20=20=20b.run_on_vds=20AS=20=
currently_running_on_host,=0A=20=20=20=20b.guest_mem_buffered=20AS=20=
memory_buffered_kb,=0A=20=20=20=20b.guest_mem_cached=20AS=20=
memory_cached_kb=0AFROM=20vm_dynamic=20b=0ALEFT=20JOIN=20vm_statistics=20=
c=0A=20=20=20=20ON=20c.vm_guid=20=3D=20b.vm_guid=0AINNER=20JOIN=20=
vm_static=0A=20=20=20=20ON=20c.vm_guid=20=3D=20vm_static.vm_guid;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_vm_interface_configuration_history_view=20AS=0ASELECT=20=
vm_interface.id=20AS=20vm_interface_id,=0A=20=20=20=20vm_interface.name=20=
AS=20vm_interface_name,=0A=20=20=20=20vm_interface.vm_guid=20AS=20vm_id,=0A=
=20=20=20=20CAST(vm_interface.type=20AS=20SMALLINT)=20AS=20=
vm_interface_type,=0A=20=20=20=20vm_interface.speed=20AS=20=
vm_interface_speed_bps,=0A=20=20=20=20vm_interface.mac_addr=20AS=20=
mac_address,=0A=20=20=20=20network.name=20AS=20logical_network_name,=0A=20=
=20=20=20vm_interface._create_date=20AS=20create_date,=0A=20=20=20=20=
vm_interface._update_date=20AS=20update_date=0AFROM=20vm_interface=0A=
LEFT=20JOIN=20(=0A=20=20=20=20vnic_profiles=20INNER=20JOIN=20network=0A=20=
=20=20=20=20=20=20=20ON=20network.id=20=3D=20vnic_profiles.network_id=0A=20=
=20=20=20)=0A=20=20=20=20ON=20vnic_profiles.id=20=3D=20=
vm_interface.vnic_profile_id=0AWHERE=20vmt_guid=20IS=20NULL=0A=20=20=20=20=
AND=20(=0A=20=20=20=20=20=20=20=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vm_interface._create_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=20var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20dwh_history_timekeeping=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vm_interface._update_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=20var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20dwh_history_timekeeping=20AS=20history_timekeeping_1=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20(var_name=20=3D=20=
'lastSync')=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_vm_interface_history_view=20AS=0ASELECT=20vm_interface_statistics.id=20=
AS=20vm_interface_id,=0A=20=20=20=20CAST(vm_interface_statistics.rx_rate=20=
AS=20SMALLINT)=20AS=20receive_rate_percent,=0A=20=20=20=20=
CAST(vm_interface_statistics.tx_rate=20AS=20SMALLINT)=20AS=20=
transmit_rate_percent,=0A=20=20=20=20vm_interface_statistics.rx_total=20=
AS=20received_total_byte,=0A=20=20=20=20vm_interface_statistics.tx_total=20=
AS=20transmitted_total_byte=0AFROM=20vm_interface_statistics;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_vm_disk_configuration_history_view=20AS=0ASELECT=20d.disk_id=20AS=20=
vm_disk_id,=0A=20=20=20=20d.disk_alias=20AS=20vm_disk_name,=0A=20=20=20=20=
d.disk_description=20AS=20vm_disk_description,=0A=20=20=20=20=
i.image_guid=20AS=20image_id,=0A=20=20=20=20=
image_storage_domain_map.storage_domain_id=20AS=20storage_domain_id,=0A=20=
=20=20=20CAST(i.size=20/=201048576=20AS=20INT)=20AS=20vm_disk_size_mb,=0A=
=20=20=20=20CAST(i.volume_type=20AS=20SMALLINT)=20AS=20vm_disk_type,=0A=20=
=20=20=20CAST(i.volume_format=20AS=20SMALLINT)=20AS=20vm_disk_format,=0A=20=
=20=20=20=20d.shareable=20AS=20is_shared,=0A=20=20=20=20i._create_date=20=
AS=20create_date,=0A=20=20=20=20i._update_date=20AS=20update_date=0AFROM=20=
images=20AS=20i=0AINNER=20JOIN=20base_disks=20AS=20d=0A=20=20=20=20ON=20=
i.image_group_id=20=3D=20d.disk_id=0AINNER=20JOIN=20=
image_storage_domain_map=0A=20=20=20=20ON=20=
image_storage_domain_map.image_id=20=3D=20i.image_guid=0ALEFT=20JOIN=20=
vm_device=0A=20=20=20=20ON=20vm_device.device_id=20=3D=20=
i.image_group_id=0ALEFT=20JOIN=20vm_static=0A=20=20=20=20ON=20=
vm_static.vm_guid=20=3D=20vm_device.vm_id=0AWHERE=20i.active=20=3D=20=
TRUE=0A=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=
vm_static.entity_type=20=3D=20'VM'=0A=20=20=20=20=20=20=20=20OR=20=
vm_static.entity_type=20IS=20NULL=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20AND=20(=0A=20=20=20=20=20=20=20=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20i._create_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=20var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20dwh_history_timekeeping=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
i._update_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20dwh_history_timekeeping=20AS=20history_timekeeping_1=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20(var_name=20=3D=20=
'lastSync')=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20dwh_vm_device_history_view=20=
AS=0ASELECT=20device_id,=0A=20=20=20=20vm_id,=0A=20=20=20=20type,=0A=20=20=
=20=20address,=0A=20=20=20=20is_managed,=0A=20=20=20=20is_plugged,=0A=20=20=
=20=20is_readonly,=0A=20=20=20=20_create_date=20AS=20create_date,=0A=20=20=
=20=20_update_date=20AS=20update_date=0AFROM=20vm_device=0AWHERE=20(=0A=20=
=20=20=20=20=20=20=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20type=20=3D=20=
'disk'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20device=20=3D=20'disk'=0A=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20OR=20=
(type=20=3D=20'interface')=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20AND=20=
(=0A=20=20=20=20=20=20=20=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
_create_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20dwh_history_timekeeping=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20_update_date=20=
>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
dwh_history_timekeeping=20AS=20history_timekeeping_1=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20(var_name=20=3D=20'lastSync')=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20);=0A**************************=0A=
=0ACREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20VIEW=20dwh_vm_disks_history_view=20AS=0ASELECT=20d.disk_id=20=
AS=20vm_disk_id,=0A=20=20=20=20images.image_guid=20AS=20image_id,=0A=20=20=
=20=20cast(images.imageStatus=20AS=20SMALLINT)=20AS=20vm_disk_status,=0A=20=
=20=20=20vm_disk_actual_size.vm_disk_actual_size_mb=20AS=20=
vm_disk_actual_size_mb,=0A=20=20=20=20disk_image_dynamic.read_rate=20AS=20=
read_rate_bytes_per_second,=0A=20=20=20=20=
disk_image_dynamic.read_latency_seconds=20AS=20read_latency_seconds,=0A=20=
=20=20=20disk_image_dynamic.write_rate=20AS=20=
write_rate_bytes_per_second,=0A=20=20=20=20=
disk_image_dynamic.write_latency_seconds=20AS=20write_latency_seconds,=0A=
=20=20=20=20disk_image_dynamic.flush_latency_seconds=20AS=20=
flush_latency_seconds=0AFROM=20images=0AINNER=20JOIN=20=
disk_image_dynamic=0A=20=20=20=20ON=20images.image_guid=20=3D=20=
disk_image_dynamic.image_id=0AINNER=20JOIN=20base_disks=20AS=20d=0A=20=20=
=20=20ON=20images.image_group_id=20=3D=20d.disk_id=0ALEFT=20JOIN=20=
vm_device=0A=20=20=20=20ON=20vm_device.device_id=20=3D=20=
images.image_group_id=0ALEFT=20JOIN=20vm_static=0A=20=20=20=20ON=20=
vm_static.vm_guid=20=3D=20vm_device.vm_id=0ALEFT=20JOIN=20(=0A=20=20=20=20=
SELECT=20e.disk_id=20AS=20vm_disk_id,=0A=20=20=20=20=20=20=20=20=
cast(SUM(disk_image_dynamic.actual_size=20/=201048576)=20AS=20INT)=20AS=20=
vm_disk_actual_size_mb=0A=20=20=20=20FROM=20images=20images_b=0A=20=20=20=
=20INNER=20JOIN=20disk_image_dynamic=0A=20=20=20=20=20=20=20=20ON=20=
images_b.image_guid=20=3D=20disk_image_dynamic.image_id=0A=20=20=20=20=
INNER=20JOIN=20base_disks=20e=0A=20=20=20=20=20=20=20=20ON=20=
images_b.image_group_id=20=3D=20e.disk_id=0A=20=20=20=20LEFT=20JOIN=20=
vm_device=0A=20=20=20=20=20=20=20=20ON=20vm_device.device_id=20=3D=20=
images_b.image_group_id=0A=20=20=20=20LEFT=20JOIN=20vm_static=0A=20=20=20=
=20=20=20=20=20ON=20vm_static.vm_guid=20=3D=20vm_device.vm_id=0A=20=20=20=
=20WHERE=20vm_static.entity_type=20=3D=20'VM'=0A=20=20=20=20=20=20=20=20=
OR=20vm_static.entity_type=20IS=20NULL=0A=20=20=20=20GROUP=20BY=20=
vm_disk_id=0A=20=20=20=20)=20AS=20vm_disk_actual_size=0A=20=20=20=20ON=20=
d.disk_id=20=3D=20vm_disk_actual_size.vm_disk_id=0AWHERE=20images.active=20=
=3D=20TRUE=0A=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=
vm_static.entity_type=20=3D=20'VM'=0A=20=20=20=20=20=20=20=20OR=20=
vm_static.entity_type=20IS=20NULL=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_remove_tags_relations_history_view=20AS=0ASELECT=20tag_id=20AS=20=
entity_id,=0A=20=20=20=20parent_id=20AS=20parent_id=0AFROM=20tags=0A=
UNION=20ALL=0ASELECT=20vds_id=20AS=20vds_id,=0A=20=20=20=20tag_id=20AS=20=
tag_id=0AFROM=20tags_vds_map=0AUNION=20ALL=0ASELECT=20vm_pool_id=20AS=20=
vm_pool_id,=0A=20=20=20=20tag_id=20AS=20tag_id=0AFROM=20tags_vm_pool_map=0A=
UNION=20ALL=0ASELECT=20vm_id=20AS=20vm_id,=0A=20=20=20=20tag_id=20AS=20=
tag_id=0AFROM=20tags_vm_map=0AUNION=20ALL=0ASELECT=20user_id=20AS=20=
user_id,=0A=20=20=20=20tag_id=20AS=20tag_id=0AFROM=20tags_user_map=0A=
UNION=20ALL=0ASELECT=20group_id=20AS=20group_id,=0A=20=20=20=20tag_id=20=
AS=20tag_id=0AFROM=20tags_user_group_map;=0A**************************=0A=
=0ACREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20VIEW=20dwh_add_tags_relations_history_view=20AS=0ASELECT=20=
tag_id=20AS=20entity_id,=0A=20=20=20=20parent_id=20AS=20parent_id,=0A=20=20=
=20=20CAST(18=20AS=20SMALLINT)=20AS=20entity_type,=0A=20=20=20=20=
_create_date=20AS=20attach_date,=0A=20=20=20=20_update_date=20AS=20=
move_date=0AFROM=20tags=0AWHERE=20(=0A=20=20=20=20=20=20=20=20=
_create_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
var_datetime=20AS=20var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20dwh_history_timekeeping=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20OR=20(=0A=20=20=20=20=20=20=
=20=20_update_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
var_datetime=20AS=20var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20dwh_history_timekeeping=20AS=20history_timekeeping_1=0A=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20)=0AUNION=20ALL=0A=
SELECT=20vds_id=20AS=20vds_id,=0A=20=20=20=20tag_id=20AS=20tag_id,=0A=20=20=
=20=20CAST(3=20AS=20SMALLINT),=0A=20=20=20=20_create_date,=0A=20=20=20=20=
NULL=0AFROM=20tags_vds_map=0AWHERE=20_create_date=20>=20(=0A=20=20=20=20=20=
=20=20=20SELECT=20var_datetime=20AS=20var_datetime=0A=20=20=20=20=20=20=20=
=20FROM=20dwh_history_timekeeping=0A=20=20=20=20=20=20=20=20WHERE=20=
(var_name=20=3D=20'lastSync')=0A=20=20=20=20=20=20=20=20)=0AUNION=20ALL=0A=
SELECT=20vm_pool_id=20AS=20vm_pool_id,=0A=20=20=20=20tag_id=20AS=20=
tag_id,=0A=20=20=20=20CAST(5=20AS=20SMALLINT),=0A=20=20=20=20=
_create_date,=0A=20=20=20=20NULL=0AFROM=20tags_vm_pool_map=0AWHERE=20=
_create_date=20>=20(=0A=20=20=20=20=20=20=20=20SELECT=20var_datetime=20=
AS=20var_datetime=0A=20=20=20=20=20=20=20=20FROM=20=
dwh_history_timekeeping=0A=20=20=20=20=20=20=20=20WHERE=20(var_name=20=3D=20=
'lastSync')=0A=20=20=20=20=20=20=20=20)=0AUNION=20ALL=0ASELECT=20vm_id=20=
AS=20vm_id,=0A=20=20=20=20tag_id=20AS=20tag_id,=0A=20=20=20=20CAST(2=20=
AS=20SMALLINT),=0A=20=20=20=20_create_date,=0A=20=20=20=20NULL=0AFROM=20=
tags_vm_map=0AWHERE=20_create_date=20>=20(=0A=20=20=20=20=20=20=20=20=
SELECT=20var_datetime=20AS=20var_datetime=0A=20=20=20=20=20=20=20=20FROM=20=
dwh_history_timekeeping=0A=20=20=20=20=20=20=20=20WHERE=20(var_name=20=3D=20=
'lastSync')=0A=20=20=20=20=20=20=20=20)=0AUNION=20ALL=0ASELECT=20user_id=20=
AS=20user_id,=0A=20=20=20=20tag_id=20AS=20tag_id,=0A=20=20=20=20CAST(15=20=
AS=20SMALLINT),=0A=20=20=20=20_create_date,=0A=20=20=20=20NULL=0AFROM=20=
tags_user_map=0AWHERE=20_create_date=20>=20(=0A=20=20=20=20=20=20=20=20=
SELECT=20var_datetime=20AS=20var_datetime=0A=20=20=20=20=20=20=20=20FROM=20=
dwh_history_timekeeping=0A=20=20=20=20=20=20=20=20WHERE=20(var_name=20=3D=20=
'lastSync')=0A=20=20=20=20=20=20=20=20)=0AUNION=20ALL=0ASELECT=20=
group_id=20AS=20group_id,=0A=20=20=20=20tag_id=20AS=20tag_id,=0A=20=20=20=
=20CAST(17=20AS=20SMALLINT),=0A=20=20=20=20_create_date,=0A=20=20=20=20=
NULL=0AFROM=20tags_user_group_map=0AWHERE=20_create_date=20>=20(=0A=20=20=
=20=20=20=20=20=20SELECT=20var_datetime=20AS=20var_datetime=0A=20=20=20=20=
=20=20=20=20FROM=20dwh_history_timekeeping=0A=20=20=20=20=20=20=20=20=
WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
dwh_tags_details_history_view=20AS=0ASELECT=20tag_id=20AS=20tag_id,=0A=20=
=20=20=20tag_name=20AS=20tag_name,=0A=20=20=20=20description=20AS=20=
tag_description,=0A=20=20=20=20_create_date=20AS=20create_date,=0A=20=20=20=
=20_update_date=20AS=20update_date=0AFROM=20tags=0AWHERE=20(=0A=20=20=20=20=
=20=20=20=20_create_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20var_datetime=20AS=20var_datetime=0A=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20dwh_history_timekeeping=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20OR=20(=0A=20=20=20=20=20=20=
=20=20_update_date=20>=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
var_datetime=20AS=20var_datetime=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20dwh_history_timekeeping=20AS=20history_timekeeping_1=0A=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20(var_name=20=3D=20'lastSync')=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20dwh_users_history_view=20AS=0A=
SELECT=20user_id,=0A=20=20=20=20name=20AS=20first_name,=0A=20=20=20=20=
surname=20AS=20last_name,=0A=20=20=20=20DOMAIN,=0A=20=20=20=20username,=0A=
=20=20=20=20department,=0A=20=20=20=20''=20AS=20user_role_title,=0A=20=20=
=20=20email,=0A=20=20=20=20external_id,=0A=20=20=20=20TRUE=20AS=20=
active,=0A=20=20=20=20_create_date=20AS=20create_date,=0A=20=20=20=20=
_update_date=20AS=20update_date=0AFROM=20users;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertGroup=20(=0A=20=20=20=
=20v_id=20UUID,=0A=20=20=20=20v_name=20VARCHAR(255),=0A=20=20=20=20=
v_domain=20VARCHAR(100),=0A=20=20=20=20v_distinguishedname=20=
VARCHAR(4000),=0A=20=20=20=20v_external_id=20TEXT,=0A=20=20=20=20=
v_namespace=20VARCHAR(2048)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20ad_groups=20(=0A=20=20=20=
=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=
=20domain,=0A=20=20=20=20=20=20=20=20distinguishedname,=0A=20=20=20=20=20=
=20=20=20external_id,=0A=20=20=20=20=20=20=20=20namespace=0A=20=20=20=20=20=
=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=
=20=20=20=20=20=20=20v_name,=0A=20=20=20=20=20=20=20=20v_domain,=0A=20=20=
=20=20=20=20=20=20v_distinguishedname,=0A=20=20=20=20=20=20=20=20=
v_external_id,=0A=20=20=20=20=20=20=20=20v_namespace=0A=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateGroup=20(=0A=20=20=20=
=20v_id=20UUID,=0A=20=20=20=20v_name=20VARCHAR(255),=0A=20=20=20=20=
v_domain=20VARCHAR(100),=0A=20=20=20=20v_distinguishedname=20=
VARCHAR(4000),=0A=20=20=20=20v_external_id=20TEXT,=0A=20=20=20=20=
v_namespace=20VARCHAR(2048)=0A=20=20=20=20)=0ARETURNS=20VOID=0A=20=20=20=20=
=0A=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20ad_groups=0A=
=20=20=20=20SET=20name=20=3D=20v_name,=0A=20=20=20=20=20=20=20=20domain=20=
=3D=20v_domain,=0A=20=20=20=20=20=20=20=20distinguishedname=20=3D=20=
v_distinguishedname,=0A=20=20=20=20=20=20=20=20external_id=20=3D=20=
v_external_id,=0A=20=20=20=20=20=20=20=20namespace=20=3D=20v_namespace=0A=
=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteGroup=20=
(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20tags_user_group_map=0A=20=20=20=20WHERE=20=
group_id=20=3D=20v_id;=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
ad_groups=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllGroups=20()=0ARETURNS=20SETOF=20ad_groups=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20ad_groups;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetGroupById=20=
(v_id=20UUID)=0ARETURNS=20SETOF=20ad_groups=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20ad_groups=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetGroupByExternalId=20(=0A=20=20=20=20v_domain=20=
VARCHAR(100),=0A=20=20=20=20v_external_id=20TEXT=0A=20=20=20=20)=0A=
RETURNS=20SETOF=20ad_groups=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
ad_groups=0A=20=20=20=20WHERE=20domain=20=3D=20v_domain=0A=20=20=20=20=20=
=20=20=20AND=20external_id=20=3D=20v_external_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGroupByName=20(v_name=20VARCHAR(256))=0ARETURNS=20SETOF=20ad_groups=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20ad_groups=0A=20=20=20=20WHERE=20=
name=20=3D=20v_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
getAllAffinityGroupsByVmId=20(v_vm_id=20UUID)=0ARETURNS=20SETOF=20=
affinity_groups_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20affinity_groups_view.*=0A=20=20=20=
=20FROM=20affinity_groups_view=0A=20=20=20=20INNER=20JOIN=20=
affinity_group_members=0A=20=20=20=20=20=20=20=20ON=20v_vm_id=20=3D=20=
affinity_group_members.vm_id=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
affinity_group_members.affinity_group_id=20=3D=20=
affinity_groups_view.id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
getAllAffinityGroupsByClusterId=20(v_cluster_id=20UUID)=0ARETURNS=20=
SETOF=20affinity_groups_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
affinity_groups_view=0A=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAffinityGroupByAffinityGroupId=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
affinity_groups_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
affinity_groups_view=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAffinityGroupByName=20(v_name=20VARCHAR(255))=0A=
RETURNS=20SETOF=20affinity_groups_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20affinity_groups_view=0A=20=20=20=20WHERE=20name=20=3D=20=
v_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertAffinityGroupWithMembers=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=
=20v_name=20VARCHAR(255),=0A=20=20=20=20v_description=20VARCHAR(4000),=0A=
=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_positive=20BOOLEAN,=0A=20=
=20=20=20v_enforcing=20BOOLEAN,=0A=20=20=20=20v_vm_ids=20VARCHAR(4000)=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20iter_id=20=
UUID;=0A=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20affinity_groups=20(=0A=20=20=
=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=
=20=20description,=0A=20=20=20=20=20=20=20=20cluster_id,=0A=20=20=20=20=20=
=20=20=20positive,=0A=20=20=20=20=20=20=20=20enforcing=0A=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=
=20=20=20=20=20=20v_name,=0A=20=20=20=20=20=20=20=20v_description,=0A=20=20=
=20=20=20=20=20=20v_cluster_id,=0A=20=20=20=20=20=20=20=20v_positive,=0A=20=
=20=20=20=20=20=20=20v_enforcing=0A=20=20=20=20=20=20=20=20);=0A=20=20=20=
=20FOR=0A=20=20=20=20=20=20=20=20iter_id=20IN=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnsplitteruuid(v_vm_ids)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20LOOP=0A=20=20=20=20=20=20=20=20INSERT=20INTO=20=
affinity_group_members=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
affinity_group_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20vm_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
iter_id=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20END=20=
LOOP;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteAffinityGroup=20=
(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20affinity_groups=0A=20=20=20=20WHERE=20id=20=3D=
=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateAffinityGroupWithMembers=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=
=20v_name=20VARCHAR(255),=0A=20=20=20=20v_description=20VARCHAR(4000),=0A=
=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_positive=20BOOLEAN,=0A=20=
=20=20=20v_enforcing=20BOOLEAN,=0A=20=20=20=20v_vm_ids=20VARCHAR(4000)=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
PERFORM=20DeleteAffinityGroup(v_id);=0A=0A=20=20=20=20PERFORM=20=
InsertAffinityGroupWithMembers(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=
=20=20=20=20=20v_name,=0A=20=20=20=20=20=20=20=20v_description,=0A=20=20=20=
=20=20=20=20=20v_cluster_id,=0A=20=20=20=20=20=20=20=20v_positive,=0A=20=20=
=20=20=20=20=20=20v_enforcing,=0A=20=20=20=20=20=20=20=20v_vm_ids);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20RemoveVmFromAffinityGroups=20(v_vm_id=20UUID)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20affinity_group_members=0A=20=20=20=20WHERE=20vm_id=20=3D=20=
v_vm_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
getPositiveEnforcingAffinityGroupsByRunningVmsOnVdsId=20(v_vds_id=20=
UUID)=0ARETURNS=20SETOF=20affinity_groups_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
DISTINCT=20affinity_groups_view.*=0A=20=20=20=20FROM=20=
affinity_groups_view=0A=20=20=20=20INNER=20JOIN=20affinity_group_members=0A=
=20=20=20=20=20=20=20=20ON=20id=20=3D=20=
affinity_group_members.affinity_group_id=0A=20=20=20=20INNER=20JOIN=20=
vm_dynamic=0A=20=20=20=20=20=20=20=20ON=20affinity_group_members.vm_id=20=
=3D=20vm_dynamic.vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
vm_dynamic.run_on_vds=20=3D=20v_vds_id=0A=20=20=20=20WHERE=20positive=0A=20=
=20=20=20=20=20=20=20AND=20enforcing;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromDisks=20=
(=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20BOOLEAN=0A=
=20=20=20=20)=0ARETURNS=20SETOF=20all_disks=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20all_disks=0A=20=20=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_disk_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20disk_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetDiskByDiskId=20(=0A=20=20=20=20v_disk_id=20UUID,=0A=
=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20boolean=0A=20=
=20=20=20)=0ARETURNS=20SETOF=20all_disks_including_memory=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20all_disks_including_memory=0A=20=20=20=20WHERE=20=
image_group_id=20=3D=20v_disk_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=
=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_disk_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20v_disk_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetDisksVmGuid=20(=0A=20=20=20=20v_vm_guid=20UUID,=0A=
=20=20=20=20v_only_plugged=20BOOLEAN,=0A=20=20=20=20v_user_id=20UUID,=0A=20=
=20=20=20v_is_filtered=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
all_disks_for_vms=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
all_disks_for_vms=0A=20=20=20=20WHERE=20vm_id=20=3D=20v_vm_guid=0A=20=20=20=
=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20=
v_only_plugged=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20is_plugged=0A=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=
=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20user_disk_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20disk_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetDisksVmGuids=20(=0A=20=
=20v_vm_guids=20UUID[]=0A)=0A=20=20RETURNS=20SETOF=20all_disks_for_vms=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20RETURN=20QUERY=0A=20=20SELECT=20=
*=0A=20=20FROM=20all_disks_for_vms=0A=20=20WHERE=20vm_id=20=3D=20=
ANY(v_vm_guids);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20TYPE=20IF=20EXISTS=20disks_basic_rs=20CASCADE;=0A=
**************************=0A=0ADROP=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20TYPE=20disks_basic_rs=20AS=20(=0A=20=20=20=20=20=20=
=20=20disk_id=20UUID,=0A=20=20=20=20=20=20=20=20disk_alias=20=
VARCHAR(255),=0A=20=20=20=20=20=20=20=20size=20BIGINT=0A=20=20=20=20=20=20=
=20=20);=0A**************************=0A=0ACREATE=20TYPE=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetDisksVmGuidBasicView=20(=0A=20=20=20=20v_vm_guid=20UUID,=0A=20=20=20=20=
v_only_plugged=20BOOLEAN,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20=
v_is_filtered=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
disks_basic_rs=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20disk_id,=0A=20=20=20=20=20=20=20=20=
disk_alias,=0A=20=20=20=20=20=20=20=20size=0A=20=20=20=20FROM=20images=0A=
=20=20=20=20LEFT=20JOIN=20base_disks=0A=20=20=20=20=20=20=20=20ON=20=
images.image_group_id=20=3D=20base_disks.disk_id=0A=20=20=20=20LEFT=20=
JOIN=20vm_device=0A=20=20=20=20=20=20=20=20ON=20vm_device.device_id=20=3D=20=
image_group_id=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20NOT=20v_only_plugged=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20OR=20is_plugged=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20WHERE=20vm_device.vm_id=20=3D=20=
v_vm_guid=0A=20=20=20=20=20=20=20=20AND=20images.active=20=3D=20true=0A=20=
=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20=
v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20user_disk_permissions_view=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20=
v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20entity_id=20=3D=20disk_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmBootActiveDisk=20(v_vm_guid=20UUID)=0ARETURNS=20SETOF=20all_disks=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20all_disks.*=0A=20=20=20=20FROM=20all_disks=0A=20=20=20=20=
INNER=20JOIN=20vm_device=0A=20=20=20=20=20=20=20=20ON=20=
vm_device.device_id=20=3D=20all_disks.image_group_id=0A=20=20=20=20INNER=20=
JOIN=20disk_vm_element=0A=20=20=20=20=20=20=20=20ON=20=
disk_vm_element.disk_id=20=3D=20all_disks.image_group_id=0A=20=20=20=20=
WHERE=20vm_device.vm_id=20=3D=20v_vm_guid=0A=20=20=20=20=20=20=20=20AND=20=
disk_vm_element.is_boot=20=3D=20TRUE=0A=20=20=20=20=20=20=20=20AND=20=
vm_device.snapshot_id=20IS=20NULL;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllAttachableDisksByPoolId=20(=0A=20=20=20=20v_storage_pool_id=20=
UUID,=0A=20=20=20=20v_vm_id=20uuid,=0A=20=20=20=20v_user_id=20UUID,=0A=20=
=20=20=20v_is_filtered=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
all_disks=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20DISTINCT=20all_disks.*=0A=20=20=20=20=
FROM=20all_disks=0A=20=20=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20v_storage_pool_id=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20=
OR=20all_disks.storage_pool_id=20=3D=20v_storage_pool_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20all_disks.number_of_vms=20=3D=200=0A=20=20=20=20=20=20=
=20=20=20=20=20=20OR=20all_disks.shareable=0A=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20--=20ImageStatus.ILLEGAL=3D4=20/=20=
imagestatus=20IS=20NULL=20->=20LunDiski=20/=20ImageStatus.Locked=3D2=0A=20=
=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
all_disks.imagestatus=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20=
OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
all_disks.imagestatus=20!=3D=204=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20AND=20all_disks.imagestatus=20!=3D=202=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20v_vm_id=20=
IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20v_vm_id=20NOT=20IN=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20vm_id=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vm_device=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vm_device.device_id=20=3D=20=
all_disks.image_group_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20AND=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=
=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20user_disk_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20disk_id=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromDisksByDiskStorageType=20(=0A=20=20=20=20v_disk_storage_type=20=
SMALLINT,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20=
BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20all_disks=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20all_disks=0A=20=20=20=20WHERE=20disk_storage_type=20=
=3D=20v_disk_storage_type=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=
=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=
=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_disk_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20disk_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Insertasync_tasks=20(=0A=20=20=20=20v_action_type=20=
INT,=0A=20=20=20=20v_result=20INT,=0A=20=20=20=20v_status=20INT,=0A=20=20=
=20=20v_user_id=20UUID,=0A=20=20=20=20v_vdsm_task_id=20UUID,=0A=20=20=20=20=
v_task_id=20UUID,=0A=20=20=20=20v_step_id=20UUID,=0A=20=20=20=20=
v_command_id=20UUID,=0A=20=20=20=20v_root_command_id=20UUID,=0A=20=20=20=20=
v_started_at=20TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20=
v_storage_pool_id=20UUID,=0A=20=20=20=20v_async_task_type=20INT=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20async_tasks=20(=0A=20=20=20=20=20=20=20=20action_type,=0A=20=20=20=
=20=20=20=20=20result,=0A=20=20=20=20=20=20=20=20status,=0A=20=20=20=20=20=
=20=20=20user_id,=0A=20=20=20=20=20=20=20=20vdsm_task_id,=0A=20=20=20=20=20=
=20=20=20task_id,=0A=20=20=20=20=20=20=20=20step_id,=0A=20=20=20=20=20=20=
=20=20command_id,=0A=20=20=20=20=20=20=20=20root_command_id,=0A=20=20=20=20=
=20=20=20=20started_at,=0A=20=20=20=20=20=20=20=20storage_pool_id,=0A=20=20=
=20=20=20=20=20=20task_type=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_action_type,=0A=20=20=20=20=20=20=20=
=20v_result,=0A=20=20=20=20=20=20=20=20v_status,=0A=20=20=20=20=20=20=20=20=
v_user_id,=0A=20=20=20=20=20=20=20=20v_vdsm_task_id,=0A=20=20=20=20=20=20=
=20=20v_task_id,=0A=20=20=20=20=20=20=20=20v_step_id,=0A=20=20=20=20=20=20=
=20=20v_command_id,=0A=20=20=20=20=20=20=20=20v_root_command_id,=0A=20=20=
=20=20=20=20=20=20v_started_at,=0A=20=20=20=20=20=20=20=20=
v_storage_pool_id,=0A=20=20=20=20=20=20=20=20v_async_task_type=0A=20=20=20=
=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Updateasync_tasks=20(=0A=20=
=20=20=20v_action_type=20INT,=0A=20=20=20=20v_result=20INT,=0A=20=20=20=20=
v_status=20INT,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20=
v_vdsm_task_id=20UUID,=0A=20=20=20=20v_task_id=20UUID,=0A=20=20=20=20=
v_step_id=20UUID,=0A=20=20=20=20v_command_id=20UUID,=0A=20=20=20=20=
v_root_command_id=20UUID,=0A=20=20=20=20v_storage_pool_id=20UUID=0A=20=20=
=20=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20UPDATE=20async_tasks=0A=20=20=20=20SET=20action_type=20=
=3D=20v_action_type,=0A=20=20=20=20=20=20=20=20result=20=3D=20v_result,=0A=
=20=20=20=20=20=20=20=20status=20=3D=20v_status,=0A=20=20=20=20=20=20=20=20=
step_id=20=3D=20v_step_id,=0A=20=20=20=20=20=20=20=20command_id=20=3D=20=
v_command_id,=0A=20=20=20=20=20=20=20=20root_command_id=20=3D=20=
v_root_command_id,=0A=20=20=20=20=20=20=20=20vdsm_task_id=20=3D=20=
v_vdsm_task_id,=0A=20=20=20=20=20=20=20=20storage_pool_id=20=3D=20=
v_storage_pool_id=0A=20=20=20=20WHERE=20task_id=20=3D=20v_task_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertOrUpdateAsyncTasks=20(=0A=20=20=20=20=
v_action_type=20INT,=0A=20=20=20=20v_result=20INT,=0A=20=20=20=20=
v_status=20INT,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20=
v_vdsm_task_id=20UUID,=0A=20=20=20=20v_task_id=20UUID,=0A=20=20=20=20=
v_step_id=20UUID,=0A=20=20=20=20v_command_id=20UUID,=0A=20=20=20=20=
v_root_command_id=20UUID,=0A=20=20=20=20v_started_at=20TIMESTAMP=20WITH=20=
TIME=20ZONE,=0A=20=20=20=20v_storage_pool_id=20UUID,=0A=20=20=20=20=
v_async_task_type=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20async_tasks=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
async_tasks.task_id=20=3D=20v_task_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
PERFORM=20Insertasync_tasks(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_action_type,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20v_result,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20v_status,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20v_user_id,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_vdsm_task_id,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_task_id,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_step_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_command_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20v_root_command_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20v_started_at,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20v_storage_pool_id,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_async_task_type);=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20PERFORM=20Updateasync_tasks(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20v_action_type,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_result,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_status,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_user_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_vdsm_task_id,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_task_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_step_id,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_command_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_root_command_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20v_storage_pool_id);=0AEND=0A=0AIF=20;END;$PROCEDURE$=0A=20=20=20=
=20LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20=
FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
FUNCTION=20InsertAsyncTaskEntities=20(=0A=20=20=20=20v_task_id=20UUID,=0A=
=20=20=20=20v_entity_id=20UUID,=0A=20=20=20=20v_entity_type=20=
VARCHAR(128)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20IF=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
async_tasks_entities=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
async_task_id=20=3D=20v_task_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20AND=20entity_id=20=3D=20v_entity_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20INSERT=20INTO=20=
async_tasks_entities=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
async_task_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20entity_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20entity_type=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20v_task_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_entity_id,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20v_entity_type=0A=20=20=20=20=20=20=20=20=
=20=20=20=20);=0AEND=0A=0AIF=20;END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAsyncTasksIdsByEntityId=20(v_entity_id=20UUID)=0ARETURNS=20SETOF=20=
idUuidType=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20async_task_id=0A=20=20=20=20FROM=20=
async_tasks_entities=0A=20=20=20=20WHERE=20entity_id=20=3D=20=
v_entity_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAsyncTaskEntitiesByTaskId=20(v_task_id=20UUID)=0ARETURNS=20SETOF=20=
async_tasks_entities=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
async_tasks_entities=0A=20=20=20=20WHERE=20async_task_id=20=3D=20=
v_task_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Deleteasync_tasks=20=
(v_task_id=20UUID)=0ARETURNS=20INT=20AS=20$PROCEDURE$=0ADECLARE=20=
deleted_rows=20INT;=0A=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
async_tasks=0A=20=20=20=20WHERE=20task_id=20=3D=20v_task_id;=0A=0A=20=20=20=
=20GET=20DIAGNOSTICS=20deleted_rows=20=3D=20ROW_COUNT;=0A=0A=20=20=20=20=
RETURN=20deleted_rows;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteAsyncTasksByVdsmTaskId=20(v_vdsm_task_id=20UUID)=0ARETURNS=20INT=20=
AS=20$PROCEDURE$=0ADECLARE=20deleted_rows=20INT;=0A=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20async_tasks=0A=20=20=20=20WHERE=20=
vdsm_task_id=20=3D=20v_vdsm_task_id;=0A=0A=20=20=20=20GET=20DIAGNOSTICS=20=
deleted_rows=20=3D=20ROW_COUNT;=0A=0A=20=20=20=20RETURN=20deleted_rows;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAsyncTasksByStoragePoolId=20(v_storage_pool_id=20=
UUID)=0ARETURNS=20SETOF=20idUuidType=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20async_tasks.task_id=0A=
=20=20=20=20FROM=20async_tasks=0A=20=20=20=20WHERE=20storage_pool_id=20=3D=
=20v_storage_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromasync_tasks=20=
()=0ARETURNS=20SETOF=20async_tasks=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20async_tasks;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Getasync_tasksBytask_id=20=
(v_task_id=20UUID)=0ARETURNS=20SETOF=20async_tasks=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20async_tasks=0A=20=20=20=20WHERE=20task_id=20=3D=20=
v_task_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAsyncTasksByEntityId=20=
(v_entity_id=20UUID)=0ARETURNS=20SETOF=20async_tasks=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
async_tasks.*=0A=20=20=20=20FROM=20async_tasks=0A=20=20=20=20INNER=20=
JOIN=20async_tasks_entities=0A=20=20=20=20=20=20=20=20ON=20async_task_id=20=
=3D=20task_id=0A=20=20=20=20WHERE=20entity_id=20=3D=20v_entity_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAsyncTasksByVdsmTaskId=20(v_vdsm_task_id=20UUID)=0A=
RETURNS=20SETOF=20async_tasks=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
async_tasks=0A=20=20=20=20WHERE=20vdsm_task_id=20=3D=20v_vdsm_task_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertAuditLog=20(=0A=20=20=20=20INOUT=20=
v_audit_log_id=20INT,=0A=20=20=20=20v_log_time=20TIMESTAMP=20WITH=20TIME=20=
ZONE,=0A=20=20=20=20v_log_type=20INT,=0A=20=20=20=20v_log_type_name=20=
VARCHAR(100),=0A=20=20=20=20v_severity=20INT,=0A=20=20=20=20v_message=20=
TEXT,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_user_name=20=
VARCHAR(255),=0A=20=20=20=20v_vds_id=20UUID,=0A=20=20=20=20v_vds_name=20=
VARCHAR(255),=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20v_vm_name=20=
VARCHAR(255),=0A=20=20=20=20v_vm_template_id=20UUID,=0A=20=20=20=20=
v_vm_template_name=20VARCHAR(40),=0A=20=20=20=20v_storage_pool_id=20=
UUID,=0A=20=20=20=20v_storage_pool_name=20VARCHAR(40),=0A=20=20=20=20=
v_storage_domain_id=20UUID,=0A=20=20=20=20v_storage_domain_name=20=
VARCHAR(250),=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20=
v_cluster_name=20VARCHAR(255),=0A=20=20=20=20v_quota_id=20UUID,=0A=20=20=20=
=20v_quota_name=20VARCHAR(60),=0A=20=20=20=20v_correlation_id=20=
VARCHAR(50),=0A=20=20=20=20v_job_id=20UUID,=0A=20=20=20=20=
v_gluster_volume_id=20UUID,=0A=20=20=20=20v_gluster_volume_name=20=
VARCHAR(1000),=0A=20=20=20=20v_call_stack=20TEXT,=0A=20=20=20=20=
v_repeatable=20BOOLEAN,=0A=20=20=20=20v_brick_id=20UUID,=0A=20=20=20=20=
v_brick_path=20TEXT=0A=20=20=20=20)=20AS=20$PROCEDURE$=0ADECLARE=20=
v_min_alret_severity=20INT;=0A=0ABEGIN=0A=20=20=20=20=
v_min_alret_severity=20:=3D=2010;=0A=0A=20=20=20=20--=20insert=20regular=20=
log=20messages=20(non=20alerts)=0A=20=20=20=20IF=20(v_severity=20<=20=
v_min_alret_severity)=20THEN=0A=20=20=20=20=20=20=20=20INSERT=20INTO=20=
audit_log=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20LOG_TIME,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20log_type,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
log_type_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20severity,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20message,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
user_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20user_name,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20vds_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vds_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20vm_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20vm_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vm_template_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20vm_template_name,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20storage_pool_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20storage_pool_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
storage_domain_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
storage_domain_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20cluster_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20cluster_name,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20correlation_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
job_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20quota_id,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20quota_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
gluster_volume_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
gluster_volume_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20call_stack,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20brick_id,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20brick_path=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20v_log_time,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_log_type,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_log_type_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_severity,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_message,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20v_user_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_user_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_vds_id,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20v_vds_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_vm_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_vm_name,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20v_vm_template_id,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20v_vm_template_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_storage_pool_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_storage_pool_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_storage_domain_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_storage_domain_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_cluster_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_cluster_name,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20v_correlation_id,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20v_job_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_quota_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_quota_name,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_gluster_volume_id,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_gluster_volume_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_call_stack,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_brick_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_brick_path=0A=20=20=20=20=20=20=20=20=20=20=20=
=20);=0A=0A=20=20=20=20=20=20=20=20v_audit_log_id=20:=3D=20=
CURRVAL('audit_log_seq');=0A=0A=20=20=20=20=20=20=20=20ELSE=20IF=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20v_repeatable=0A=20=20=20=20=20=20=20=20=20=
=20=20=20OR=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=20audit_log_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20audit_log=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20vds_name=20=3D=20v_vds_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20log_type=20=3D=20v_log_type=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20NOT=20deleted=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=
=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20INSERT=20INTO=20audit_log=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20LOG_TIME,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20log_type,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
log_type_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20severity,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20message,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
user_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20user_name,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20vds_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vds_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20vm_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20vm_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vm_template_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20vm_template_name,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20storage_pool_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20storage_pool_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
storage_domain_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
storage_domain_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20cluster_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20cluster_name,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20correlation_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
job_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20quota_id,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20quota_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
gluster_volume_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
gluster_volume_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20call_stack,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20brick_id,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20brick_path=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20v_log_time,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_log_type,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_log_type_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_severity,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_message,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20v_user_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_user_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_vds_id,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20v_vds_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_vm_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_vm_name,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20v_vm_template_id,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20v_vm_template_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_storage_pool_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_storage_pool_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_storage_domain_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_storage_domain_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_cluster_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_cluster_name,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20v_correlation_id,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20v_job_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_quota_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_quota_name,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_gluster_volume_id,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_gluster_volume_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_call_stack,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_brick_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_brick_path=0A=20=20=20=20=20=20=20=20=20=20=20=
=20);=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20v_audit_log_id=20:=3D=20=
CURRVAL('audit_log_seq');=0A=20=20=20=20=20=20=20=20=20ELSE=0A=0A=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=20audit_log_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20INTO=20v_audit_log_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20audit_log=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vds_name=20=
=3D=20v_vds_name=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20log_type=20=
=3D=20v_log_type;=0A=20=20=20=20=20=20=20=20END=20IF;=0A=20=20=20=20END=20=
IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertExternalAuditLog=20(=0A=20=20=20=20INOUT=20=
v_audit_log_id=20INT,=0A=20=20=20=20v_log_time=20TIMESTAMP=20WITH=20TIME=20=
ZONE,=0A=20=20=20=20v_log_type=20INT,=0A=20=20=20=20v_log_type_name=20=
VARCHAR(100),=0A=20=20=20=20v_severity=20INT,=0A=20=20=20=20v_message=20=
TEXT,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_user_name=20=
VARCHAR(255),=0A=20=20=20=20v_vds_id=20UUID,=0A=20=20=20=20v_vds_name=20=
VARCHAR(255),=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20v_vm_name=20=
VARCHAR(255),=0A=20=20=20=20v_vm_template_id=20UUID,=0A=20=20=20=20=
v_vm_template_name=20VARCHAR(40),=0A=20=20=20=20v_storage_pool_id=20=
UUID,=0A=20=20=20=20v_storage_pool_name=20VARCHAR(40),=0A=20=20=20=20=
v_storage_domain_id=20UUID,=0A=20=20=20=20v_storage_domain_name=20=
VARCHAR(250),=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20=
v_cluster_name=20VARCHAR(255),=0A=20=20=20=20v_quota_id=20UUID,=0A=20=20=20=
=20v_quota_name=20VARCHAR(60),=0A=20=20=20=20v_correlation_id=20=
VARCHAR(50),=0A=20=20=20=20v_job_id=20UUID,=0A=20=20=20=20=
v_gluster_volume_id=20UUID,=0A=20=20=20=20v_gluster_volume_name=20=
VARCHAR(1000),=0A=20=20=20=20v_call_stack=20TEXT,=0A=20=20=20=20=
v_brick_id=20UUID,=0A=20=20=20=20v_brick_path=20TEXT,=0A=20=20=20=20=
v_origin=20VARCHAR(25),=0A=20=20=20=20v_custom_event_id=20INT,=0A=20=20=20=
=20v_event_flood_in_sec=20INT,=0A=20=20=20=20v_custom_data=20TEXT=0A=20=20=
=20=20)=20AS=20$PROCEDURE$=0ADECLARE=20v_max_message_length=20INT;=0A=0A=
v_truncated_message=20TEXT;=0A=0ABEGIN=0A=20=20=20=20--=20truncate=20=
message=20if=20exceeds=20configured=20max=20length.=20truncated=20=
messages=20will=20be=20ended=0A=20=20=20=20--=20with=20"..."=20to=20=
indicate=20that=20message=20is=20incomplete=20due=20to=20size=20limits.=0A=
=20=20=20=20v_truncated_message=20:=3D=20v_message;=0A=0A=20=20=20=20=
v_max_message_length=20:=3D=20cast(option_value=20AS=20INT)=0A=20=20=20=20=
FROM=20vdc_options=0A=20=20=20=20WHERE=20option_name=20=3D=20=
'MaxAuditLogMessageLength'=0A=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
'general';=0A=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_max_message_length=20IS=20NOT=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20length(v_message)=20>=20v_max_message_length=0A=20=20=20=20=20=20=
=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20v_truncated_message=20:=3D=20substr(v_message,=201,=20=
v_max_message_length=20-=203)=20||=20'...';=0A=20=20=20=20END=20IF;=0A=20=
=20=20=20INSERT=20INTO=20audit_log=20(=0A=20=20=20=20=20=20=20=20=
log_time,=0A=20=20=20=20=20=20=20=20log_type,=0A=20=20=20=20=20=20=20=20=
log_type_name,=0A=20=20=20=20=20=20=20=20severity,=0A=20=20=20=20=20=20=20=
=20message,=0A=20=20=20=20=20=20=20=20user_id,=0A=20=20=20=20=20=20=20=20=
user_name,=0A=20=20=20=20=20=20=20=20vds_id,=0A=20=20=20=20=20=20=20=20=
vds_name,=0A=20=20=20=20=20=20=20=20vm_id,=0A=20=20=20=20=20=20=20=20=
vm_name,=0A=20=20=20=20=20=20=20=20vm_template_id,=0A=20=20=20=20=20=20=20=
=20vm_template_name,=0A=20=20=20=20=20=20=20=20storage_pool_id,=0A=20=20=20=
=20=20=20=20=20storage_pool_name,=0A=20=20=20=20=20=20=20=20=
storage_domain_id,=0A=20=20=20=20=20=20=20=20storage_domain_name,=0A=20=20=
=20=20=20=20=20=20cluster_id,=0A=20=20=20=20=20=20=20=20cluster_name,=0A=20=
=20=20=20=20=20=20=20correlation_id,=0A=20=20=20=20=20=20=20=20job_id,=0A=
=20=20=20=20=20=20=20=20quota_id,=0A=20=20=20=20=20=20=20=20quota_name,=0A=
=20=20=20=20=20=20=20=20gluster_volume_id,=0A=20=20=20=20=20=20=20=20=
gluster_volume_name,=0A=20=20=20=20=20=20=20=20call_stack,=0A=20=20=20=20=
=20=20=20=20origin,=0A=20=20=20=20=20=20=20=20custom_event_id,=0A=20=20=20=
=20=20=20=20=20event_flood_in_sec,=0A=20=20=20=20=20=20=20=20=
custom_data,=0A=20=20=20=20=20=20=20=20brick_id,=0A=20=20=20=20=20=20=20=20=
brick_path=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=
=20=20=20=20=20v_log_time,=0A=20=20=20=20=20=20=20=20v_log_type,=0A=20=20=
=20=20=20=20=20=20v_log_type_name,=0A=20=20=20=20=20=20=20=20v_severity,=0A=
=20=20=20=20=20=20=20=20v_truncated_message,=0A=20=20=20=20=20=20=20=20=
v_user_id,=0A=20=20=20=20=20=20=20=20v_user_name,=0A=20=20=20=20=20=20=20=
=20v_vds_id,=0A=20=20=20=20=20=20=20=20v_vds_name,=0A=20=20=20=20=20=20=20=
=20v_vm_id,=0A=20=20=20=20=20=20=20=20v_vm_name,=0A=20=20=20=20=20=20=20=20=
v_vm_template_id,=0A=20=20=20=20=20=20=20=20v_vm_template_name,=0A=20=20=20=
=20=20=20=20=20v_storage_pool_id,=0A=20=20=20=20=20=20=20=20=
v_storage_pool_name,=0A=20=20=20=20=20=20=20=20v_storage_domain_id,=0A=20=
=20=20=20=20=20=20=20v_storage_domain_name,=0A=20=20=20=20=20=20=20=20=
v_cluster_id,=0A=20=20=20=20=20=20=20=20v_cluster_name,=0A=20=20=20=20=20=
=20=20=20v_correlation_id,=0A=20=20=20=20=20=20=20=20v_job_id,=0A=20=20=20=
=20=20=20=20=20v_quota_id,=0A=20=20=20=20=20=20=20=20v_quota_name,=0A=20=20=
=20=20=20=20=20=20v_gluster_volume_id,=0A=20=20=20=20=20=20=20=20=
v_gluster_volume_name,=0A=20=20=20=20=20=20=20=20v_call_stack,=0A=20=20=20=
=20=20=20=20=20v_origin,=0A=20=20=20=20=20=20=20=20v_custom_event_id,=0A=20=
=20=20=20=20=20=20=20v_event_flood_in_sec,=0A=20=20=20=20=20=20=20=20=
v_custom_data,=0A=20=20=20=20=20=20=20=20v_brick_id,=0A=20=20=20=20=20=20=
=20=20v_brick_path=0A=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=
v_audit_log_id=20:=3D=20CURRVAL('audit_log_seq');=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteAuditLog=20(v_audit_log_id=20INT)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20audit_log=0A=20=20=20=20SET=20=
deleted=20=3D=20true=0A=20=20=20=20WHERE=20audit_log_id=20=3D=20=
v_audit_log_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20ClearAllAuditLogEvents=20=
(v_severity=20INT)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20UPDATE=20audit_log=0A=20=20=20=20SET=20deleted=20=3D=20true=0A=20=20=20=
=20WHERE=20severity=20!=3D=20v_severity;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DisplayAllAuditLogEvents=20(v_severity=20INT)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20audit_log=0A=20=20=20=20SET=20=
deleted=20=3D=20false=0A=20=20=20=20WHERE=20severity=20!=3D=20=
v_severity;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20SetAllAuditLogAlerts=20(=0A=
=20=20=20=20v_severity=20INT,=0A=20=20=20=20v_value=20BOOLEAN=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
audit_log=0A=20=20=20=20SET=20deleted=20=3D=20v_value=0A=20=20=20=20=
WHERE=20severity=20=3D=20v_severity;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromAuditLog=20(=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20=
v_is_filtered=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20audit_log=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20audit_log=20a=0A=20=20=20=20WHERE=20=
NOT=20deleted=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vm_permissions_view=20pv,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20user_object_permissions_view=20dpv=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20pv.user_id=20=3D=20v_user_id=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20pv.entity_id=20=
=3D=20a.vm_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20pv.entity_id=20=3D=20dpv.entity_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vm_template_permissions_view=20pv,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20user_object_permissions_view=20dpv=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20pv.user_id=20=3D=20=
v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20pv.entity_id=20=3D=20a.vm_template_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20pv.entity_id=20=3D=20=
dpv.entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20user_vds_permissions_view=20pv,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20user_object_permissions_view=20dpv=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20pv.user_id=20=3D=20=
v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20pv.entity_id=20=3D=20a.vds_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20pv.entity_id=20=3D=20dpv.entity_id=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=
=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_storage_pool_permissions_view=20pv,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20user_object_permissions_view=20dpv=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20pv.user_id=20=3D=20=
v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20pv.entity_id=20=3D=20a.storage_pool_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20pv.entity_id=20=3D=20=
dpv.entity_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20user_storage_domain_permissions_view=20pv,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
user_object_permissions_view=20dpv=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20pv.user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20pv.entity_id=20=3D=20=
a.storage_domain_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20AND=20pv.entity_id=20=3D=20dpv.entity_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_cluster_permissions_view=20pv,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20user_object_permissions_view=20dpv=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20pv.user_id=20=3D=20v_user_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
pv.entity_id=20=3D=20a.cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20pv.entity_id=20=3D=20dpv.entity_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20ORDER=20BY=20audit_log_id=20DESC;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAuditLogByAuditLogId=20(v_audit_log_id=20INT)=0A=
RETURNS=20SETOF=20audit_log=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
audit_log=0A=20=20=20=20WHERE=20audit_log_id=20=3D=20v_audit_log_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAuditLogByVMId=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=
=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20BOOLEAN=0A=20=
=20=20=20)=0ARETURNS=20SETOF=20audit_log=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20audit_log=0A=20=20=20=20WHERE=20NOT=20deleted=0A=20=20=20=20=20=
=20=20=20AND=20vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=
=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20user_vm_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20vm_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=
=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAuditLogByVMTemplateId=20(=0A=20=20=20=20v_vm_template_id=20UUID,=0A=20=
=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20BOOLEAN=0A=20=20=
=20=20)=0ARETURNS=20SETOF=20audit_log=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20audit_log=0A=20=20=20=20WHERE=20NOT=20deleted=0A=20=20=20=20=20=
=20=20=20AND=20vm_template_id=20=3D=20v_vm_template_id=0A=20=20=20=20=20=20=
=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=
=20=20=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20user_vm_template_permissions_view=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=
=3D=20vm_template_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
RemoveAuditLogByBrickIdLogType=20(=0A=20=20=20=20v_brick_id=20UUID,=0A=20=
=20=20=20v_audit_log_type=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20audit_log=0A=20=20=20=20SET=20=
deleted=20=3D=20true=0A=20=20=20=20WHERE=20brick_id=20=3D=20v_brick_id=0A=
=20=20=20=20=20=20=20=20AND=20log_type=20=3D=20v_audit_log_type;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAuditLogLaterThenDate=20(v_date=20TIMESTAMP=20=
WITH=20TIME=20ZONE)=0ARETURNS=20SETOF=20audit_log=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20audit_log=0A=20=20=20=20WHERE=20NOT=20deleted=0A=20=
=20=20=20=20=20=20=20AND=20LOG_TIME=20>=3D=20v_date;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteAuditLogOlderThenDate=20(v_date=20TIMESTAMP=20WITH=20TIME=20ZONE)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_id=20INT;=0A=0A=
SWV_RowCount=20INT;=0A=0ABEGIN=0A=20=20=20=20--=20get=20first=20the=20id=20=
from=20which=20to=20remove=20in=20order=20to=20use=20index=0A=20=20=20=20=
SELECT=20audit_log_id=0A=20=20=20=20INTO=20v_id=0A=20=20=20=20FROM=20=
audit_log=0A=20=20=20=20WHERE=20LOG_TIME=20<=20v_date=0A=20=20=20=20=
ORDER=20BY=20audit_log_id=20DESC=20LIMIT=201;=0A=0A=20=20=20=20--=20=
check=20if=20there=20are=20candidates=20to=20remove=0A=20=20=20=20GET=20=
DIAGNOSTICS=20SWV_RowCount=20=3D=20ROW_COUNT;=0A=0A=20=20=20=20IF=20=
(SWV_RowCount=20>=200)=20THEN=0A=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=
=20=20=20=20=20FROM=20audit_log=0A=20=20=20=20=20=20=20=20WHERE=20=
audit_log_id=20<=3D=20v_id;=0A=20=20=20=20END=20IF;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteAuditAlertLogByVdsIDAndType=20(=0A=20=20=20=20v_vds_id=20UUID,=0A=20=
=20=20=20v_log_type=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20audit_log=0A=20=20=20=20SET=20=
deleted=20=3D=20true=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id=0A=20=20=
=20=20=20=20=20=20AND=20log_type=20=3D=20v_log_type;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteBackupRelatedAlerts=20()=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20UPDATE=20audit_log=0A=20=20=20=20SET=20deleted=20=3D=20=
true=0A=20=20=20=20WHERE=20origin=20=3D=20'oVirt'=0A=20=20=20=20=20=20=20=
=20AND=20log_type=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=209022,=0A=
=20=20=20=20=20=20=20=20=20=20=20=209023,=0A=20=20=20=20=20=20=20=20=20=20=
=20=209026=0A=20=20=20=20=20=20=20=20=20=20=20=20);--=20=
(ENGINE_NO_FULL_BACKUP,=20ENGINE_NO_WARM_BACKUP,=20ENGINE_BACKUP_FAILED)=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteAuditAlertLogByVolumeIDAndType=20(=0A=20=20=20=
=20v_gluster_volume_id=20UUID,=0A=20=20=20=20v_log_type=20INT=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
audit_log=0A=20=20=20=20SET=20deleted=20=3D=20true=0A=20=20=20=20WHERE=20=
gluster_volume_id=20=3D=20v_gluster_volume_id=0A=20=20=20=20=20=20=20=20=
AND=20log_type=20=3D=20v_log_type;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteAuditLogAlertsByVdsID=20(=0A=20=20=20=20v_vds_id=20UUID,=0A=20=20=20=
=20v_delete_config_alerts=20BOOLEAN=20=3D=20true=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_min_alret_severity=20=
INT;=0A=0Av_no_config_alret_type=20INT;=0A=0Av_no_max_alret_type=20INT;=0A=
=0ABEGIN=0A=20=20=20=20v_min_alret_severity=20:=3D=2010;=0A=0A=20=20=20=20=
v_no_config_alret_type=20:=3D=209000;=0A=0A=20=20=20=20=
v_no_max_alret_type=20:=3D=209005;=0A=0A=20=20=20=20IF=20=
(v_delete_config_alerts=20=3D=20true)=20THEN=0A=20=20=20=20=20=20=20=20=
UPDATE=20audit_log=0A=20=20=20=20=20=20=20=20SET=20deleted=20=3D=20true=0A=
=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20severity=20>=3D=20v_min_alret_severity=0A=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20log_type=20BETWEEN=20=
v_no_config_alret_type=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20v_no_max_alret_type;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=
UPDATE=20audit_log=0A=20=20=20=20=20=20=20=20SET=20deleted=20=3D=20true=0A=
=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20severity=20>=3D=20v_min_alret_severity=0A=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20log_type=20BETWEEN=20=
v_no_config_alret_type=20+=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20AND=20v_no_max_alret_type;=0AEND=0A=0AIF=20;END;$PROCEDURE$=0A=20=20=
=20=20LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20=
FUNCTION=0A*********=20QUERY=20**********=0A/*=0AUsed=20to=20find=20out=20=
how=20many=20seconds=20to=20wait=20after=20Start/Stop/Restart=20PM=20=
operations=0Av_vds_name=20=20=20=20=20-=20The=20host=20name=0Av_event=20=20=
=20=20=20=20=20=20-=20The=20event=20[USER_VDS_STOP=20|=20USER_VDS_START=20=
|=20USER_VDS_RESTART]=0Av_wait_for_sec=20-=20Configurable=20time=20in=20=
seconds=20to=20wait=20from=20last=20operation.=0AReturns=20:=20The=20=
number=20of=20seconds=20we=20have=20to=20wait=20(negative=20value=20=
means=20we=20can=20do=20the=20operation=20immediately)=0A*/=0ACREATE=20=
OR=20REPLACE=20FUNCTION=20get_seconds_to_wait_before_pm_operation=20(=0A=20=
=20=20=20v_vds_name=20VARCHAR(255),=0A=20=20=20=20v_event=20=
VARCHAR(100),=0A=20=20=20=20v_wait_for_sec=20INT=0A=20=20=20=20)=0A=
RETURNS=20INT=20STABLE=20AS=20$PROCEDURE$=0ADECLARE=20v_last_event_dt=20=
TIMESTAMP=0AWITH=20TIME=20zone;=0ADECLARE=20v_now_dt=20TIMESTAMP=0AWITH=20=
TIME=20zone;=0A=0ABEGIN=0A=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
audit_log=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vds_name=20=3D=20=
v_vds_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
log_type_name=20=3D=20v_event=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20=
THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20v_last_event_dt=20:=3D=20=
log_time=0A=20=20=20=20=20=20=20=20FROM=20audit_log=0A=20=20=20=20=20=20=20=
=20WHERE=20vds_name=20=3D=20v_vds_name=0A=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20log_type_name=20=3D=20v_event=0A=20=20=20=20=20=20=20=20ORDER=20=
BY=20audit_log_id=20DESC=20limit=201;=0A=0A=20=20=20=20=20=20=20=20=
v_now_dt=20:=3D=20CURRENT_TIMESTAMP;=0A=0A=20=20=20=20=20=20=20=20RETURN=20=
cast((extract(epoch=20FROM=20v_last_event_dt)=20+=20v_wait_for_sec)=20-=20=
extract(epoch=20FROM=20v_now_dt)=20AS=20INT);=0A=20=20=20=20END;=0A=20=20=
=20=20ELSE=0A=20=20=20=20=20=20=20=20RETURN=200;=0AEND=0A=0AIF=20=
;END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAuditLogByOriginAndCustomEventId=20(=0A=20=20=20=20v_origin=20=
VARCHAR(255),=0A=20=20=20=20v_custom_event_id=20INT=0A=20=20=20=20)=0A=
RETURNS=20SETOF=20audit_log=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
audit_log=0A=20=20=20=20WHERE=20origin=20=3D=20v_origin=0A=20=20=20=20=20=
=20=20=20AND=20custom_event_id=20=3D=20v_custom_event_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAuditLogByVolumeIdAndType=20(=0A=20=20=20=20=
v_gluster_volume_id=20UUID,=0A=20=20=20=20v_log_type=20INT=0A=20=20=20=20=
)=0ARETURNS=20SETOF=20audit_log=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
audit_log=0A=20=20=20=20WHERE=20gluster_volume_id=20=3D=20=
v_gluster_volume_id=0A=20=20=20=20=20=20=20=20AND=20log_type=20=3D=20=
v_log_type;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertBaseDisk=20(=0A=20=20=
=20=20v_disk_id=20UUID,=0A=20=20=20=20v_wipe_after_delete=20BOOLEAN,=0A=20=
=20=20=20v_propagate_errors=20VARCHAR(32),=0A=20=20=20=20v_disk_alias=20=
VARCHAR(50),=0A=20=20=20=20v_disk_description=20VARCHAR(500),=0A=20=20=20=
=20v_shareable=20BOOLEAN,=0A=20=20=20=20v_sgio=20INT,=0A=20=20=20=20=
v_alignment=20SMALLINT,=0A=20=20=20=20v_last_alignment_scan=20TIMESTAMP=20=
WITH=20TIME=20ZONE,=0A=20=20=20=20v_disk_storage_type=20SMALLINT,=0A=20=20=
=20=20v_cinder_volume_type=20VARCHAR(255)=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20base_disks=20=
(=0A=20=20=20=20=20=20=20=20disk_id,=0A=20=20=20=20=20=20=20=20=
wipe_after_delete,=0A=20=20=20=20=20=20=20=20propagate_errors,=0A=20=20=20=
=20=20=20=20=20disk_alias,=0A=20=20=20=20=20=20=20=20disk_description,=0A=
=20=20=20=20=20=20=20=20shareable,=0A=20=20=20=20=20=20=20=20sgio,=0A=20=20=
=20=20=20=20=20=20alignment,=0A=20=20=20=20=20=20=20=20=
last_alignment_scan,=0A=20=20=20=20=20=20=20=20disk_storage_type,=0A=20=20=
=20=20=20=20=20=20cinder_volume_type=0A=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_disk_id,=0A=20=20=20=20=20=20=
=20=20v_wipe_after_delete,=0A=20=20=20=20=20=20=20=20v_propagate_errors,=0A=
=20=20=20=20=20=20=20=20v_disk_alias,=0A=20=20=20=20=20=20=20=20=
v_disk_description,=0A=20=20=20=20=20=20=20=20v_shareable,=0A=20=20=20=20=
=20=20=20=20v_sgio,=0A=20=20=20=20=20=20=20=20v_alignment,=0A=20=20=20=20=
=20=20=20=20v_last_alignment_scan,=0A=20=20=20=20=20=20=20=20=
v_disk_storage_type,=0A=20=20=20=20=20=20=20=20v_cinder_volume_type=0A=20=
=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateBaseDisk=20(=0A=20=20=
=20=20v_disk_id=20UUID,=0A=20=20=20=20v_wipe_after_delete=20BOOLEAN,=0A=20=
=20=20=20v_propagate_errors=20VARCHAR(32),=0A=20=20=20=20v_disk_alias=20=
VARCHAR(50),=0A=20=20=20=20v_disk_description=20VARCHAR(500),=0A=20=20=20=
=20v_shareable=20BOOLEAN,=0A=20=20=20=20v_sgio=20INT,=0A=20=20=20=20=
v_alignment=20SMALLINT,=0A=20=20=20=20v_last_alignment_scan=20TIMESTAMP=20=
WITH=20TIME=20ZONE,=0A=20=20=20=20v_disk_storage_type=20SMALLINT,=0A=20=20=
=20=20v_cinder_volume_type=20VARCHAR(255)=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20base_disks=0A=20=20=
=20=20SET=20wipe_after_delete=20=3D=20v_wipe_after_delete,=0A=20=20=20=20=
=20=20=20=20propagate_errors=20=3D=20v_propagate_errors,=0A=20=20=20=20=20=
=20=20=20disk_alias=20=3D=20v_disk_alias,=0A=20=20=20=20=20=20=20=20=
disk_description=20=3D=20v_disk_description,=0A=20=20=20=20=20=20=20=20=
shareable=20=3D=20v_shareable,=0A=20=20=20=20=20=20=20=20sgio=20=3D=20=
v_sgio,=0A=20=20=20=20=20=20=20=20alignment=20=3D=20v_alignment,=0A=20=20=
=20=20=20=20=20=20last_alignment_scan=20=3D=20v_last_alignment_scan,=0A=20=
=20=20=20=20=20=20=20disk_storage_type=20=3D=20v_disk_storage_type,=0A=20=
=20=20=20=20=20=20=20cinder_volume_type=20=3D=20v_cinder_volume_type=0A=20=
=20=20=20WHERE=20disk_id=20=3D=20v_disk_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteBaseDisk=20=
(v_disk_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_val=20=
UUID;=0A=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20base_disks=0A=20=
=20=20=20WHERE=20disk_id=20=3D=20v_disk_id;=0A=0A=20=20=20=20--=20Delete=20=
the=20disk's=20permissions=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
permissions=0A=20=20=20=20WHERE=20object_id=20=3D=20v_disk_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromBaseDisks=20()=0ARETURNS=20SETOF=20=
base_disks=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20base_disks;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetBaseDiskByBaseDiskId=20(v_disk_id=20UUID)=0A=
RETURNS=20SETOF=20base_disks=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
base_disks=0A=20=20=20=20WHERE=20disk_id=20=3D=20v_disk_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetBaseDisksByAlias(v_disk_alias=20varchar(255))=0A=
RETURNS=20SETOF=20base_disks=20STABLE=0AAS=20$procedure$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=20=20=
base_disks=0A=20=20=20=20WHERE=20=20disk_alias=20=3D=20v_disk_alias;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertBookmark=20(=0A=20=20=20=20v_bookmark_id=20=
UUID,=0A=20=20=20=20v_bookmark_name=20VARCHAR(40),=0A=20=20=20=20=
v_bookmark_value=20VARCHAR(300)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20bookmarks=20(=0A=20=20=20=
=20=20=20=20=20bookmark_Id,=0A=20=20=20=20=20=20=20=20bookmark_name,=0A=20=
=20=20=20=20=20=20=20bookmark_value=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_bookmark_id,=0A=20=20=20=20=20=20=
=20=20v_bookmark_name,=0A=20=20=20=20=20=20=20=20v_bookmark_value=0A=20=20=
=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateBookmark=20(=0A=20=20=
=20=20v_bookmark_id=20UUID,=0A=20=20=20=20v_bookmark_name=20VARCHAR(40),=0A=
=20=20=20=20v_bookmark_value=20VARCHAR(300)=0A=20=20=20=20)=0ARETURNS=20=
VOID=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
UPDATE=20bookmarks=0A=20=20=20=20SET=20bookmark_name=20=3D=20=
v_bookmark_name,=0A=20=20=20=20=20=20=20=20bookmark_value=20=3D=20=
v_bookmark_value=0A=20=20=20=20WHERE=20bookmark_Id=20=3D=20=
v_bookmark_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteBookmark=20=
(v_bookmark_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20DELETE=0A=20=20=20=20FROM=20bookmarks=0A=20=20=20=20WHERE=20=
bookmark_Id=20=3D=20v_bookmark_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromBookmarks=20()=0ARETURNS=20SETOF=20bookmarks=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20bookmarks;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetBookmarkBybookmark_name=20(v_bookmark_name=20VARCHAR(40))=0ARETURNS=20=
SETOF=20bookmarks=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
bookmarks=0A=20=20=20=20WHERE=20bookmark_name=20=3D=20v_bookmark_name;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetBookmarkBybookmark_id=20(v_bookmark_id=20UUID)=0A=
RETURNS=20SETOF=20bookmarks=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
bookmarks=0A=20=20=20=20WHERE=20bookmark_Id=20=3D=20v_bookmark_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20insert_entity_snapshot=20(=0A=20=20=20=20v_id=20=
uuid,=0A=20=20=20=20v_command_id=20uuid,=0A=20=20=20=20v_command_type=20=
VARCHAR,=0A=20=20=20=20v_entity_id=20VARCHAR,=0A=20=20=20=20=
v_entity_type=20VARCHAR,=0A=20=20=20=20v_entity_snapshot=20TEXT,=0A=20=20=
=20=20v_snapshot_class=20VARCHAR,=0A=20=20=20=20v_snapshot_type=20INT,=0A=
=20=20=20=20v_insertion_order=20INT=0A=20=20=20=20)=0ARETURNS=20void=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
INSERT=20INTO=20business_entity_snapshot=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20id,=0A=20=20=20=20=20=20=20=20=20=20=20=20command_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20command_type,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20entity_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20entity_type,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20entity_snapshot,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20snapshot_class,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
snapshot_type,=0A=20=20=20=20=20=20=20=20=20=20=20=20insertion_order=0A=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20VALUES=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20v_command_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_command_type,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_entity_id,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_entity_type,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_entity_snapshot,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_snapshot_class,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_snapshot_type,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_insertion_order=0A=20=20=20=20=20=20=
=20=20=20=20=20=20);=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20get_entity_snapshot_by_id=20(v_id=20uuid)=0ARETURNS=20=
SETOF=20business_entity_snapshot=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
business_entity_snapshot.*=0A=20=20=20=20FROM=20business_entity_snapshot=0A=
=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
get_entity_snapshot_by_command_id=20(v_command_id=20uuid)=0ARETURNS=20=
SETOF=20business_entity_snapshot=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
business_entity_snapshot.*=0A=20=20=20=20FROM=20business_entity_snapshot=0A=
=20=20=20=20WHERE=20command_id=20=3D=20v_command_id=0A=20=20=20=20ORDER=20=
BY=20insertion_order=20DESC;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20TYPE=20IF=20EXISTS=20get_all_commands_rs=20CASCADE;=0A=
**************************=0A=0ADROP=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20TYPE=20get_all_commands_rs=20AS=20(=0A=20=20=20=20=20=
=20=20=20command_id=20UUID,=0A=20=20=20=20=20=20=20=20command_type=20=
VARCHAR(256)=0A=20=20=20=20=20=20=20=20);=0A**************************=0A=
=0ACREATE=20TYPE=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20get_all_commands=20()=0ARETURNS=20SETOF=20=
get_all_commands_rs=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20DISTINCT=20=
business_entity_snapshot.command_id,=0A=20=20=20=20=20=20=20=20=
business_entity_snapshot.command_type=0A=20=20=20=20FROM=20=
business_entity_snapshot;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
delete_entity_snapshot_by_command_id=20(v_command_id=20uuid)=0ARETURNS=20=
void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=
=20DELETE=0A=20=20=20=20=20=20=20=20FROM=20business_entity_snapshot=0A=20=
=20=20=20=20=20=20=20WHERE=20command_id=20=3D=20v_command_id;=0A=20=20=20=
=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A/*=20=
----------------------------------------------------------------=0A=20=
Stored=20procedures=20for=20database=20operations=20on=20Cluster=20=
Features=0A=20related=20tables:=20cluster_features,=20=
supported_cluster_features,=20supported_host_features=0A=
----------------------------------------------------------------*/=0A=
CREATE=20OR=20REPLACE=20FUNCTION=20InsertClusterFeature=20(=0A=20=20=20=20=
v_feature_id=20UUID,=0A=20=20=20=20v_feature_name=20VARCHAR(256),=0A=20=20=
=20=20v_version=20VARCHAR(40),=0A=20=20=20=20v_category=20INT,=0A=20=20=20=
=20v_description=20TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20cluster_features=20(=0A=
=20=20=20=20=20=20=20=20feature_id,=0A=20=20=20=20=20=20=20=20=
feature_name,=0A=20=20=20=20=20=20=20=20version,=0A=20=20=20=20=20=20=20=20=
category,=0A=20=20=20=20=20=20=20=20description=0A=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_feature_id,=0A=20=20=
=20=20=20=20=20=20v_feature_name,=0A=20=20=20=20=20=20=20=20v_version,=0A=
=20=20=20=20=20=20=20=20v_category,=0A=20=20=20=20=20=20=20=20=
v_description=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateClusterFeature=20(=0A=20=20=20=20v_feature_id=20UUID,=0A=20=20=20=20=
v_feature_name=20VARCHAR(256),=0A=20=20=20=20v_version=20VARCHAR(40),=0A=20=
=20=20=20v_category=20INT,=0A=20=20=20=20v_description=20TEXT=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
cluster_features=0A=20=20=20=20SET=20feature_name=20=3D=20=
v_feature_name,=0A=20=20=20=20=20=20=20=20version=20=3D=20v_version,=0A=20=
=20=20=20=20=20=20=20description=20=3D=20v_description,=0A=20=20=20=20=20=
=20=20=20category=20=3D=20v_category=0A=20=20=20=20WHERE=20feature_id=20=
=3D=20v_feature_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetClusterFeaturesByVersionAndCategory=20(=0A=20=20=20=20v_version=20=
VARCHAR(256),=0A=20=20=20=20v_category=20INT=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20cluster_features=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
cluster_features=0A=20=20=20=20WHERE=20cluster_features.version=20=3D=20=
v_version=0A=20=20=20=20=20=20=20=20AND=20(cluster_features.category=20&=20=
v_category)=20>=200;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertSupportedClusterFeature=20(=0A=20=20=20=20v_feature_id=20UUID,=0A=20=
=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_is_enabled=20BOOLEAN=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20supported_cluster_features=20(=0A=20=20=20=20=20=20=20=20=
cluster_id,=0A=20=20=20=20=20=20=20=20feature_id,=0A=20=20=20=20=20=20=20=
=20is_enabled=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=
=20=20=20=20=20=20v_cluster_id,=0A=20=20=20=20=20=20=20=20v_feature_id,=0A=
=20=20=20=20=20=20=20=20v_is_enabled=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateSupportedClusterFeature=20(=0A=20=20=20=20=
v_feature_id=20UUID,=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20=
v_is_enabled=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20supported_cluster_features=0A=20=
=20=20=20SET=20is_enabled=20=3D=20v_is_enabled=0A=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20=
feature_id=20=3D=20v_feature_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetSupportedClusterFeaturesByClusterId=20(v_cluster_id=20UUID)=0ARETURNS=20=
SETOF=20supported_cluster_features_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20supported_cluster_features_view=0A=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertSupportedHostFeature=20(=0A=20=20=20=20v_host_id=20UUID,=0A=20=20=20=
=20v_feature_name=20VARCHAR(256)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
supported_host_features=20(=0A=20=20=20=20=20=20=20=20host_id,=0A=20=20=20=
=20=20=20=20=20feature_name=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_host_id,=0A=20=20=20=20=20=20=20=20=
v_feature_name=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetSupportedHostFeaturesByHostId=20(v_host_id=20UUID)=0ARETURNS=20SETOF=20=
supported_host_features=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
supported_host_features=0A=20=20=20=20WHERE=20host_id=20=3D=20v_host_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20RemoveSupportedHostFeature=20(=0A=20=20=20=20=
v_host_id=20UUID,=0A=20=20=20=20v_feature_name=20VARCHAR(256)=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=
=20=20=20FROM=20supported_host_features=0A=20=20=20=20WHERE=20host_id=20=
=3D=20v_host_id=0A=20=20=20=20=20=20=20=20AND=20feature_name=20=3D=20=
v_feature_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromClusterPolicys=20=
()=0ARETURNS=20SETOF=20cluster_policies=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20cluster_policies;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetClusterPolicyByClusterPolicyId=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
cluster_policies=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
cluster_policies=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertClusterPolicy=20(=0A=20=20=20=20v_id=20UUID,=0A=
=20=20=20=20v_name=20VARCHAR(128),=0A=20=20=20=20v_description=20=
VARCHAR(4000),=0A=20=20=20=20v_is_locked=20BOOLEAN,=0A=20=20=20=20=
v_is_default=20BOOLEAN,=0A=20=20=20=20v_custom_properties=20TEXT=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20cluster_policies=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=
=20=20=20name,=0A=20=20=20=20=20=20=20=20description,=0A=20=20=20=20=20=20=
=20=20is_locked,=0A=20=20=20=20=20=20=20=20is_default,=0A=20=20=20=20=20=20=
=20=20custom_properties=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20=
(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20v_name,=0A=20=
=20=20=20=20=20=20=20v_description,=0A=20=20=20=20=20=20=20=20=
v_is_locked,=0A=20=20=20=20=20=20=20=20v_is_default,=0A=20=20=20=20=20=20=
=20=20v_custom_properties=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateClusterPolicy=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_name=20=
VARCHAR(128),=0A=20=20=20=20v_description=20VARCHAR(4000),=0A=20=20=20=20=
v_is_locked=20BOOLEAN,=0A=20=20=20=20v_is_default=20BOOLEAN,=0A=20=20=20=20=
v_custom_properties=20TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20cluster_policies=0A=20=20=20=20=
SET=20name=20=3D=20v_name,=0A=20=20=20=20=20=20=20=20description=20=3D=20=
v_description,=0A=20=20=20=20=20=20=20=20is_locked=20=3D=20v_is_locked,=0A=
=20=20=20=20=20=20=20=20is_default=20=3D=20v_is_default,=0A=20=20=20=20=20=
=20=20=20custom_properties=20=3D=20v_custom_properties=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteClusterPolicy=20=
(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20cluster_policies=0A=20=20=20=20WHERE=20id=20=
=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromClusterPolicyUnits=20()=0ARETURNS=20SETOF=20=
cluster_policy_units=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
cluster_policy_units;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetClusterPolicyUnitsByClusterPolicyId=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
cluster_policy_units=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
cluster_policy_units=0A=20=20=20=20WHERE=20cluster_policy_id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteClusterPolicyUnitsByClusterPolicyId=20(v_id=20UUID)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
cluster_policy_units=0A=20=20=20=20WHERE=20cluster_policy_id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertClusterPolicyUnit=20=
(=0A=20=20=20=20v_cluster_policy_id=20UUID,=0A=20=20=20=20=
v_policy_unit_id=20UUID,=0A=20=20=20=20v_filter_sequence=20INT,=0A=20=20=20=
=20v_factor=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20cluster_policy_units=20(=0A=20=20=20=20=
=20=20=20=20cluster_policy_id,=0A=20=20=20=20=20=20=20=20policy_unit_id,=0A=
=20=20=20=20=20=20=20=20filter_sequence,=0A=20=20=20=20=20=20=20=20=
factor=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=
=20=20=20=20v_cluster_policy_id,=0A=20=20=20=20=20=20=20=20=
v_policy_unit_id,=0A=20=20=20=20=20=20=20=20v_filter_sequence,=0A=20=20=20=
=20=20=20=20=20v_factor=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertCluster=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20=
v_description=20VARCHAR(4000),=0A=20=20=20=20v_free_text_comment=20TEXT,=0A=
=20=20=20=20v_name=20VARCHAR(40),=0A=20=20=20=20v_cpu_name=20=
VARCHAR(255),=0A=20=20=20=20v_storage_pool_id=20UUID,=0A=20=20=20=20=
v_max_vds_memory_over_commit=20INT,=0A=20=20=20=20=
v_count_threads_as_cores=20BOOLEAN,=0A=20=20=20=20=
v_compatibility_version=20VARCHAR(40),=0A=20=20=20=20=
v_transparent_hugepages=20BOOLEAN,=0A=20=20=20=20v_migrate_on_error=20=
INT,=0A=20=20=20=20v_virt_service=20BOOLEAN,=0A=20=20=20=20=
v_gluster_service=20BOOLEAN,=0A=20=20=20=20v_tunnel_migration=20BOOLEAN,=0A=
=20=20=20=20v_emulated_machine=20VARCHAR(40),=0A=20=20=20=20=
v_detect_emulated_machine=20BOOLEAN,=0A=20=20=20=20v_trusted_service=20=
BOOLEAN,=0A=20=20=20=20v_ha_reservation=20BOOLEAN,=0A=20=20=20=20=
v_optional_reason=20BOOLEAN,=0A=20=20=20=20v_maintenance_reason_required=20=
BOOLEAN,=0A=20=20=20=20v_cluster_policy_id=20UUID,=0A=20=20=20=20=
v_cluster_policy_custom_properties=20TEXT,=0A=20=20=20=20=
v_enable_balloon=20BOOLEAN,=0A=20=20=20=20v_architecture=20INT,=0A=20=20=20=
=20v_optimization_type=20SMALLINT,=0A=20=20=20=20v_spice_proxy=20=
VARCHAR(255),=0A=20=20=20=20v_enable_ksm=20BOOLEAN,=0A=20=20=20=20=
v_serial_number_policy=20SMALLINT,=0A=20=20=20=20v_custom_serial_number=20=
VARCHAR(255),=0A=20=20=20=20v_required_rng_sources=20VARCHAR(255),=0A=20=20=
=20=20v_skip_fencing_if_sd_active=20BOOLEAN,=0A=20=20=20=20=
v_skip_fencing_if_connectivity_broken=20BOOLEAN,=0A=20=20=20=20=
v_hosts_with_broken_connectivity_threshold=20SMALLINT,=0A=20=20=20=20=
v_fencing_enabled=20BOOLEAN,=0A=20=20=20=20v_is_auto_converge=20BOOLEAN,=0A=
=20=20=20=20v_is_migrate_compressed=20BOOLEAN,=0A=20=20=20=20=
v_gluster_tuned_profile=20VARCHAR(50),=0A=20=20=20=20=
v_ksm_merge_across_nodes=20BOOLEAN,=0A=20=20=20=20=
v_migration_bandwidth_limit_type=20VARCHAR(16),=0A=20=20=20=20=
v_custom_migration_bandwidth_limit=20INT,=0A=20=20=20=20=
v_migration_policy_id=20UUID,=0A=20=20=20=20v_switch_type=20VARCHAR(6)=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
INSERT=20INTO=20cluster=20(=0A=20=20=20=20=20=20=20=20cluster_id,=0A=20=20=
=20=20=20=20=20=20description,=0A=20=20=20=20=20=20=20=20name,=0A=20=20=20=
=20=20=20=20=20free_text_comment,=0A=20=20=20=20=20=20=20=20cpu_name,=0A=20=
=20=20=20=20=20=20=20storage_pool_id,=0A=20=20=20=20=20=20=20=20=
max_vds_memory_over_commit,=0A=20=20=20=20=20=20=20=20=
count_threads_as_cores,=0A=20=20=20=20=20=20=20=20compatibility_version,=0A=
=20=20=20=20=20=20=20=20transparent_hugepages,=0A=20=20=20=20=20=20=20=20=
migrate_on_error,=0A=20=20=20=20=20=20=20=20virt_service,=0A=20=20=20=20=20=
=20=20=20gluster_service,=0A=20=20=20=20=20=20=20=20tunnel_migration,=0A=20=
=20=20=20=20=20=20=20emulated_machine,=0A=20=20=20=20=20=20=20=20=
detect_emulated_machine,=0A=20=20=20=20=20=20=20=20trusted_service,=0A=20=
=20=20=20=20=20=20=20ha_reservation,=0A=20=20=20=20=20=20=20=20=
optional_reason,=0A=20=20=20=20=20=20=20=20maintenance_reason_required,=0A=
=20=20=20=20=20=20=20=20cluster_policy_id,=0A=20=20=20=20=20=20=20=20=
cluster_policy_custom_properties,=0A=20=20=20=20=20=20=20=20=
enable_balloon,=0A=20=20=20=20=20=20=20=20architecture,=0A=20=20=20=20=20=
=20=20=20optimization_type,=0A=20=20=20=20=20=20=20=20spice_proxy,=0A=20=20=
=20=20=20=20=20=20enable_ksm,=0A=20=20=20=20=20=20=20=20=
serial_number_policy,=0A=20=20=20=20=20=20=20=20custom_serial_number,=0A=20=
=20=20=20=20=20=20=20required_rng_sources,=0A=20=20=20=20=20=20=20=20=
skip_fencing_if_sd_active,=0A=20=20=20=20=20=20=20=20=
skip_fencing_if_connectivity_broken,=0A=20=20=20=20=20=20=20=20=
hosts_with_broken_connectivity_threshold,=0A=20=20=20=20=20=20=20=20=
fencing_enabled,=0A=20=20=20=20=20=20=20=20is_auto_converge,=0A=20=20=20=20=
=20=20=20=20is_migrate_compressed,=0A=20=20=20=20=20=20=20=20=
gluster_tuned_profile,=0A=20=20=20=20=20=20=20=20ksm_merge_across_nodes,=0A=
=20=20=20=20=20=20=20=20migration_bandwidth_limit_type,=0A=20=20=20=20=20=
=20=20=20custom_migration_bandwidth_limit,=0A=20=20=20=20=20=20=20=20=
migration_policy_id,=0A=20=20=20=20=20=20=20=20switch_type=0A=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_cluster_id,=0A=20=20=20=20=20=20=20=20v_description,=0A=20=20=20=20=20=20=
=20=20v_name,=0A=20=20=20=20=20=20=20=20v_free_text_comment,=0A=20=20=20=20=
=20=20=20=20v_cpu_name,=0A=20=20=20=20=20=20=20=20v_storage_pool_id,=0A=20=
=20=20=20=20=20=20=20v_max_vds_memory_over_commit,=0A=20=20=20=20=20=20=20=
=20v_count_threads_as_cores,=0A=20=20=20=20=20=20=20=20=
v_compatibility_version,=0A=20=20=20=20=20=20=20=20=
v_transparent_hugepages,=0A=20=20=20=20=20=20=20=20v_migrate_on_error,=0A=
=20=20=20=20=20=20=20=20v_virt_service,=0A=20=20=20=20=20=20=20=20=
v_gluster_service,=0A=20=20=20=20=20=20=20=20v_tunnel_migration,=0A=20=20=
=20=20=20=20=20=20v_emulated_machine,=0A=20=20=20=20=20=20=20=20=
v_detect_emulated_machine,=0A=20=20=20=20=20=20=20=20v_trusted_service,=0A=
=20=20=20=20=20=20=20=20v_ha_reservation,=0A=20=20=20=20=20=20=20=20=
v_optional_reason,=0A=20=20=20=20=20=20=20=20=
v_maintenance_reason_required,=0A=20=20=20=20=20=20=20=20=
v_cluster_policy_id,=0A=20=20=20=20=20=20=20=20=
v_cluster_policy_custom_properties,=0A=20=20=20=20=20=20=20=20=
v_enable_balloon,=0A=20=20=20=20=20=20=20=20v_architecture,=0A=20=20=20=20=
=20=20=20=20v_optimization_type,=0A=20=20=20=20=20=20=20=20=
v_spice_proxy,=0A=20=20=20=20=20=20=20=20v_enable_ksm,=0A=20=20=20=20=20=20=
=20=20v_serial_number_policy,=0A=20=20=20=20=20=20=20=20=
v_custom_serial_number,=0A=20=20=20=20=20=20=20=20=
v_required_rng_sources,=0A=20=20=20=20=20=20=20=20=
v_skip_fencing_if_sd_active,=0A=20=20=20=20=20=20=20=20=
v_skip_fencing_if_connectivity_broken,=0A=20=20=20=20=20=20=20=20=
v_hosts_with_broken_connectivity_threshold,=0A=20=20=20=20=20=20=20=20=
v_fencing_enabled,=0A=20=20=20=20=20=20=20=20v_is_auto_converge,=0A=20=20=
=20=20=20=20=20=20v_is_migrate_compressed,=0A=20=20=20=20=20=20=20=20=
v_gluster_tuned_profile,=0A=20=20=20=20=20=20=20=20=
v_ksm_merge_across_nodes,=0A=20=20=20=20=20=20=20=20=
v_migration_bandwidth_limit_type,=0A=20=20=20=20=20=20=20=20=
v_custom_migration_bandwidth_limit,=0A=20=20=20=20=20=20=20=20=
v_migration_policy_id,=0A=20=20=20=20=20=20=20=20v_switch_type=0A=20=20=20=
=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateCluster=20(=0A=20=20=
=20=20v_description=20VARCHAR(4000),=0A=20=20=20=20v_free_text_comment=20=
TEXT,=0A=20=20=20=20v_name=20VARCHAR(40),=0A=20=20=20=20v_cluster_id=20=
UUID,=0A=20=20=20=20v_cpu_name=20VARCHAR(255),=0A=20=20=20=20=
v_storage_pool_id=20UUID,=0A=20=20=20=20v_max_vds_memory_over_commit=20=
INT,=0A=20=20=20=20v_count_threads_as_cores=20BOOLEAN,=0A=20=20=20=20=
v_compatibility_version=20VARCHAR(40),=0A=20=20=20=20=
v_transparent_hugepages=20BOOLEAN,=0A=20=20=20=20v_migrate_on_error=20=
INT,=0A=20=20=20=20v_virt_service=20BOOLEAN,=0A=20=20=20=20=
v_gluster_service=20BOOLEAN,=0A=20=20=20=20=
v_gluster_cli_based_snapshot_scheduled=20BOOLEAN,=0A=20=20=20=20=
v_tunnel_migration=20BOOLEAN,=0A=20=20=20=20v_emulated_machine=20=
VARCHAR(40),=0A=20=20=20=20v_detect_emulated_machine=20BOOLEAN,=0A=20=20=20=
=20v_trusted_service=20BOOLEAN,=0A=20=20=20=20v_ha_reservation=20=
BOOLEAN,=0A=20=20=20=20v_optional_reason=20BOOLEAN,=0A=20=20=20=20=
v_maintenance_reason_required=20BOOLEAN,=0A=20=20=20=20=
v_cluster_policy_id=20UUID,=0A=20=20=20=20=
v_cluster_policy_custom_properties=20TEXT,=0A=20=20=20=20=
v_enable_balloon=20BOOLEAN,=0A=20=20=20=20v_architecture=20INT,=0A=20=20=20=
=20v_optimization_type=20SMALLINT,=0A=20=20=20=20v_spice_proxy=20=
VARCHAR(255),=0A=20=20=20=20v_enable_ksm=20BOOLEAN,=0A=20=20=20=20=
v_serial_number_policy=20SMALLINT,=0A=20=20=20=20v_custom_serial_number=20=
VARCHAR(255),=0A=20=20=20=20v_required_rng_sources=20VARCHAR(255),=0A=20=20=
=20=20v_skip_fencing_if_sd_active=20BOOLEAN,=0A=20=20=20=20=
v_skip_fencing_if_connectivity_broken=20BOOLEAN,=0A=20=20=20=20=
v_hosts_with_broken_connectivity_threshold=20SMALLINT,=0A=20=20=20=20=
v_fencing_enabled=20BOOLEAN,=0A=20=20=20=20v_is_auto_converge=20BOOLEAN,=0A=
=20=20=20=20v_is_migrate_compressed=20BOOLEAN,=0A=20=20=20=20=
v_gluster_tuned_profile=20VARCHAR(50),=0A=20=20=20=20=
v_ksm_merge_across_nodes=20BOOLEAN,=0A=20=20=20=20=
v_migration_bandwidth_limit_type=20VARCHAR(16),=0A=20=20=20=20=
v_custom_migration_bandwidth_limit=20INT,=0A=20=20=20=20=
v_migration_policy_id=20UUID,=0A=20=20=20=20v_switch_type=20VARCHAR(6)=0A=
=20=20=20=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20cluster=0A=20=20=20=20SET=20=
description=20=3D=20v_description,=0A=20=20=20=20=20=20=20=20=
free_text_comment=20=3D=20v_free_text_comment,=0A=20=20=20=20=20=20=20=20=
name=20=3D=20v_name,=0A=20=20=20=20=20=20=20=20cpu_name=20=3D=20=
v_cpu_name,=0A=20=20=20=20=20=20=20=20storage_pool_id=20=3D=20=
v_storage_pool_id,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP,=0A=20=20=20=20=20=20=20=20max_vds_memory_over_commit=20=3D=
=20v_max_vds_memory_over_commit,=0A=20=20=20=20=20=20=20=20=
count_threads_as_cores=20=3D=20v_count_threads_as_cores,=0A=20=20=20=20=20=
=20=20=20compatibility_version=20=3D=20v_compatibility_version,=0A=20=20=20=
=20=20=20=20=20transparent_hugepages=20=3D=20v_transparent_hugepages,=0A=20=
=20=20=20=20=20=20=20migrate_on_error=20=3D=20v_migrate_on_error,=0A=20=20=
=20=20=20=20=20=20virt_service=20=3D=20v_virt_service,=0A=20=20=20=20=20=20=
=20=20gluster_service=20=3D=20v_gluster_service,=0A=20=20=20=20=20=20=20=20=
tunnel_migration=20=3D=20v_tunnel_migration,=0A=20=20=20=20=20=20=20=20=
gluster_cli_based_snapshot_scheduled=20=3D=20=
v_gluster_cli_based_snapshot_scheduled,=0A=20=20=20=20=20=20=20=20=
emulated_machine=20=3D=20v_emulated_machine,=0A=20=20=20=20=20=20=20=20=
detect_emulated_machine=20=3D=20v_detect_emulated_machine,=0A=20=20=20=20=
=20=20=20=20trusted_service=20=3D=20v_trusted_service,=0A=20=20=20=20=20=20=
=20=20ha_reservation=20=3D=20v_ha_reservation,=0A=20=20=20=20=20=20=20=20=
optional_reason=20=3D=20v_optional_reason,=0A=20=20=20=20=20=20=20=20=
maintenance_reason_required=20=3D=20v_maintenance_reason_required,=0A=20=20=
=20=20=20=20=20=20cluster_policy_id=20=3D=20v_cluster_policy_id,=0A=20=20=
=20=20=20=20=20=20cluster_policy_custom_properties=20=3D=20=
v_cluster_policy_custom_properties,=0A=20=20=20=20=20=20=20=20=
enable_balloon=20=3D=20v_enable_balloon,=0A=20=20=20=20=20=20=20=20=
architecture=20=3D=20v_architecture,=0A=20=20=20=20=20=20=20=20=
optimization_type=20=3D=20v_optimization_type,=0A=20=20=20=20=20=20=20=20=
spice_proxy=20=3D=20v_spice_proxy,=0A=20=20=20=20=20=20=20=20enable_ksm=20=
=3D=20v_enable_ksm,=0A=20=20=20=20=20=20=20=20serial_number_policy=20=3D=20=
v_serial_number_policy,=0A=20=20=20=20=20=20=20=20custom_serial_number=20=
=3D=20v_custom_serial_number,=0A=20=20=20=20=20=20=20=20=
required_rng_sources=20=3D=20v_required_rng_sources,=0A=20=20=20=20=20=20=
=20=20skip_fencing_if_sd_active=20=3D=20v_skip_fencing_if_sd_active,=0A=20=
=20=20=20=20=20=20=20skip_fencing_if_connectivity_broken=20=3D=20=
v_skip_fencing_if_connectivity_broken,=0A=20=20=20=20=20=20=20=20=
hosts_with_broken_connectivity_threshold=20=3D=20=
v_hosts_with_broken_connectivity_threshold,=0A=20=20=20=20=20=20=20=20=
fencing_enabled=20=3D=20v_fencing_enabled,=0A=20=20=20=20=20=20=20=20=
is_auto_converge=20=3D=20v_is_auto_converge,=0A=20=20=20=20=20=20=20=20=
is_migrate_compressed=20=3D=20v_is_migrate_compressed,=0A=20=20=20=20=20=20=
=20=20gluster_tuned_profile=20=3D=20v_gluster_tuned_profile,=0A=20=20=20=20=
=20=20=20=20ksm_merge_across_nodes=20=3D=20v_ksm_merge_across_nodes,=0A=20=
=20=20=20=20=20=20=20migration_bandwidth_limit_type=20=3D=20=
v_migration_bandwidth_limit_type,=0A=20=20=20=20=20=20=20=20=
custom_migration_bandwidth_limit=20=3D=20=
v_custom_migration_bandwidth_limit,=0A=20=20=20=20=20=20=20=20=
migration_policy_id=20=3D=20v_migration_policy_id,=0A=20=20=20=20=20=20=20=
=20switch_type=20=3D=20v_switch_type=0A=20=20=20=20WHERE=20cluster_id=20=
=3D=20v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteCluster=20=
(v_cluster_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20=
v_val=20UUID;=0A=0ABEGIN=0A=20=20=20=20--=20Get=20(and=20keep)=20a=20=
shared=20lock=20with=20"right=20to=20upgrade=20to=20exclusive"=0A=20=20=20=
=20--=20in=20order=20to=20force=20locking=20parent=20before=20children=0A=
=20=20=20=20SELECT=20cluster_id=0A=20=20=20=20INTO=20v_val=0A=20=20=20=20=
FROM=20cluster=0A=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=
=20=20=20FOR=20UPDATE;=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
cluster=0A=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id;=0A=0A=20=20=
=20=20--=20delete=20VDS=20group=20permissions=20--=0A=20=20=20=20DELETE=0A=
=20=20=20=20FROM=20permissions=0A=20=20=20=20WHERE=20object_id=20=3D=20=
v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromCluster=20(=0A=20=
=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20BOOLEAN=0A=20=20=
=20=20)=0ARETURNS=20SETOF=20cluster_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
cluster_view.*=0A=20=20=20=20FROM=20cluster_view=0A=20=20=20=20WHERE=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=
=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20user_cluster_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20cluster_id=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=
=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetClusterByClusterId=20=
(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_user_id=20UUID,=0A=20=
=20=20=20v_is_filtered=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
cluster_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20cluster_view.*=0A=20=20=20=20FROM=20=
cluster_view=0A=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=20=
=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20=
v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20user_cluster_permissions_view=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20=
v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20entity_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetClusterByClusterName=20(=0A=20=20=20=20v_cluster_name=20VARCHAR(40),=0A=
=20=20=20=20v_is_case_sensitive=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20cluster_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20cluster_view.*=0A=20=20=20=20=
FROM=20cluster_view=0A=20=20=20=20WHERE=20name=20=3D=20v_cluster_name=0A=20=
=20=20=20=20=20=20=20OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20=
v_is_case_sensitive=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20name=20=
ilike=20v_cluster_name=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetClusterForUserByClusterName=20(=0A=20=20=20=20=
v_cluster_name=20VARCHAR(40),=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=
=20v_is_filtered=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
cluster_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20cluster_view.*=0A=20=20=20=20FROM=20=
cluster_view=0A=20=20=20=20WHERE=20name=20=3D=20v_cluster_name=0A=20=20=20=
=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20=
v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20user_cluster_permissions_view=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20=
v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20entity_id=20=3D=20cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetClustersByStoragePoolId=20(=0A=20=20=20=20v_storage_pool_id=20UUID,=0A=
=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20BOOLEAN=0A=20=
=20=20=20)=0ARETURNS=20SETOF=20cluster_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
cluster_view.*=0A=20=20=20=20FROM=20cluster_view=0A=20=20=20=20WHERE=20=
storage_pool_id=20=3D=20v_storage_pool_id=0A=20=20=20=20=20=20=20=20AND=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=
=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20user_cluster_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20cluster_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetClusterWithRunningVms=20=
(v_cluster_id=20UUID)=0ARETURNS=20SETOF=20cluster_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
cluster_view.*=0A=20=20=20=20FROM=20cluster_view=0A=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20=
cluster_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vms=0A=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20vms.status=20NOT=20IN=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=200,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=2013,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=2014=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetClustersWithoutMigratingVms=20()=0ARETURNS=20=
SETOF=20cluster_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20cluster_view.*=0A=20=20=20=20=
FROM=20cluster_view=0A=20=20=20=20WHERE=20cluster_id=20NOT=20IN=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20s.cluster_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20FROM=20vm_static=20s=0A=20=20=20=20=20=20=20=20=20=20=20=
=20INNER=20JOIN=20vm_dynamic=20d=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20ON=20s.vm_guid=20=3D=20d.vm_guid=0A=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20d.status=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=205,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=206=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetIsClusterEmpty=20(v_cluster_id=20UUID)=0ARETURNS=20BOOLEAN=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20NOT=20EXISTS=20(=0A=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vm_static=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20AND=20vm_guid=20!=3D=20'00000000-0000-0000-0000-000000000000'=0A=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20AND=20=
NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=
=20=20=20=20=20=20=20=20=20=20FROM=20vds_static=0A=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_perms_get_clusters_with_permitted_action=20(=0A=20=20=20=20v_user_id=20=
UUID,=0A=20=20=20=20v_action_group_id=20INT=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20cluster_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20cluster_view.*=0A=20=20=20=20=
FROM=20cluster_view=0A=20=20=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
get_entity_permissions(v_user_id,=20v_action_group_id,=20=
cluster_view.cluster_id,=209)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20=
IS=20NOT=20NULL;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetClustersHavingHosts=20=
()=0ARETURNS=20SETOF=20cluster_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20cluster_view.*=0A=20=
=20=20=20FROM=20cluster_view=0A=20=20=20=20WHERE=20EXISTS=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20vds_static=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
cluster_id=20=3D=20cluster_view.cluster_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateClusterEmulatedMachine=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=
=20=20=20v_emulated_machine=20VARCHAR(40),=0A=20=20=20=20=
v_detect_emulated_machine=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20cluster=0A=20=20=20=20=
SET=20emulated_machine=20=3D=20v_emulated_machine,=0A=20=20=20=20=20=20=20=
=20detect_emulated_machine=20=3D=20v_detect_emulated_machine=0A=20=20=20=20=
WHERE=20cluster_id=20=3D=20v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetTrustedClusters=20()=0ARETURNS=20SETOF=20cluster_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
cluster_view.*=0A=20=20=20=20FROM=20cluster_view=0A=20=20=20=20WHERE=20=
trusted_service;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetClustersByClusterPolicyId=20(v_cluster_policy_id=20UUID)=0ARETURNS=20=
SETOF=20cluster_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20cluster_view.*=0A=20=20=20=20=
FROM=20cluster_view=0A=20=20=20=20WHERE=20cluster_policy_id=20=3D=20=
v_cluster_policy_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetNumberOfVmsInCluster=20=
(v_cluster_id=20UUID)=0ARETURNS=20SETOF=20BIGINT=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
COUNT(vms.*)=0A=20=20=20=20FROM=20vm_static=20vms=0A=20=20=20=20WHERE=20=
vms.cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20=
vms.entity_type=20=3D=20'VM';=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20TYPE=20IF=20EXISTS=20host_vm_cluster_rs=20CASCADE;=0A=
**************************=0A=0ADROP=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20TYPE=20host_vm_cluster_rs=20AS=20(=0A=20=20=20=20=20=
=20=20=20cluster_id=20UUID,=0A=20=20=20=20=20=20=20=20hosts=20BIGINT,=0A=20=
=20=20=20=20=20=20=20vms=20BIGINT=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetHostsAndVmsForClusters=20(v_cluster_ids=20UUID=20[])=0ARETURNS=20=
SETOF=20host_vm_cluster_rs=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20groups.cluster_id,=0A=20=20=20=
=20=20=20=20=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
COUNT(DISTINCT=20vds.vds_id)=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vds_static=20vds=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
vds.cluster_id=20=3D=20groups.cluster_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20)=20AS=20host_count,=0A=20=20=20=20=20=20=20=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=20COUNT(DISTINCT=20vms.vm_guid)=0A=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20vm_static=20vms=0A=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20vms.cluster_id=20=3D=20groups.cluster_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20vms.entity_type::TEXT=20=3D=20=
'VM'::TEXT=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20AS=20vm_count=0A=20=20=
=20=20FROM=20cluster=20groups=0A=20=20=20=20WHERE=20groups.cluster_id=20=
=3D=20ANY=20(v_cluster_ids)=0A=20=20=20=20GROUP=20BY=20=
groups.cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetClustersByServiceAndCompatibilityVersion=20(=0A=20=20=20=20=
v_gluster_service=20BOOLEAN,=0A=20=20=20=20v_virt_service=20BOOLEAN,=0A=20=
=20=20=20v_compatibility_version=20VARCHAR(40)=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20cluster_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20cluster_view.*=0A=20=20=20=20=
FROM=20cluster_view=0A=20=20=20=20WHERE=20virt_service=20=3D=20=
v_virt_service=0A=20=20=20=20=20=20=20=20AND=20gluster_service=20=3D=20=
v_gluster_service=0A=20=20=20=20=20=20=20=20AND=20compatibility_version=20=
=3D=20v_compatibility_version;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertCommandEntity=20(=0A=
=20=20=20=20v_user_id=20uuid,=0A=20=20=20=20v_engine_session_seq_id=20=
BIGINT,=0A=20=20=20=20v_command_id=20uuid,=0A=20=20=20=20v_command_type=20=
INT,=0A=20=20=20=20v_parent_command_id=20uuid,=0A=20=20=20=20=
v_root_command_id=20uuid,=0A=20=20=20=20v_job_id=20uuid,=0A=20=20=20=20=
v_step_id=20uuid,=0A=20=20=20=20v_command_parameters=20TEXT,=0A=20=20=20=20=
v_command_params_class=20VARCHAR(256),=0A=20=20=20=20v_created_at=20=
TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20v_status=20VARCHAR(20),=0A=20=
=20=20=20v_executed=20boolean,=0A=20=20=20=20v_callback_enabled=20=
boolean,=0A=20=20=20=20v_return_value=20TEXT,=0A=20=20=20=20=
v_return_value_class=20VARCHAR(256),=0A=20=20=20=20v_data=20TEXT=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20=
INSERT=20INTO=20command_entities=20(=0A=20=20=20=20=20=20=20=20user_id,=0A=
=20=20=20=20=20=20=20=20engine_session_seq_id,=0A=20=20=20=20=20=20=20=20=
command_id,=0A=20=20=20=20=20=20=20=20command_type,=0A=20=20=20=20=20=20=20=
=20parent_command_id,=0A=20=20=20=20=20=20=20=20root_command_id,=0A=20=20=
=20=20=20=20=20=20job_id,=0A=20=20=20=20=20=20=20=20step_id,=0A=20=20=20=20=
=20=20=20=20command_parameters,=0A=20=20=20=20=20=20=20=20=
command_params_class,=0A=20=20=20=20=20=20=20=20created_at,=0A=20=20=20=20=
=20=20=20=20status,=0A=20=20=20=20=20=20=20=20executed,=0A=20=20=20=20=20=
=20=20=20callback_enabled,=0A=20=20=20=20=20=20=20=20return_value,=0A=20=20=
=20=20=20=20=20=20return_value_class,=0A=20=20=20=20=20=20=20=20data=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_user_id,=0A=20=20=20=20=20=20=20=20v_engine_session_seq_id,=0A=20=20=20=
=20=20=20=20=20v_command_id,=0A=20=20=20=20=20=20=20=20v_command_type,=0A=
=20=20=20=20=20=20=20=20v_parent_command_id,=0A=20=20=20=20=20=20=20=20=
v_root_command_id,=0A=20=20=20=20=20=20=20=20v_job_id,=0A=20=20=20=20=20=20=
=20=20v_step_id,=0A=20=20=20=20=20=20=20=20v_command_parameters,=0A=20=20=
=20=20=20=20=20=20v_command_params_class,=0A=20=20=20=20=20=20=20=20=
NOW(),=0A=20=20=20=20=20=20=20=20v_status,=0A=20=20=20=20=20=20=20=20=
v_executed,=0A=20=20=20=20=20=20=20=20v_callback_enabled,=0A=20=20=20=20=20=
=20=20=20v_return_value,=0A=20=20=20=20=20=20=20=20v_return_value_class,=0A=
=20=20=20=20=20=20=20=20v_data=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateCommandEntity=20(=0A=20=20=20=20v_user_id=20=
uuid,=0A=20=20=20=20v_engine_session_seq_id=20BIGINT,=0A=20=20=20=20=
v_command_id=20uuid,=0A=20=20=20=20v_command_type=20INT,=0A=20=20=20=20=
v_parent_command_id=20uuid,=0A=20=20=20=20v_root_command_id=20uuid,=0A=20=
=20=20=20v_job_id=20uuid,=0A=20=20=20=20v_step_id=20uuid,=0A=20=20=20=20=
v_command_parameters=20TEXT,=0A=20=20=20=20v_command_params_class=20=
VARCHAR(256),=0A=20=20=20=20v_status=20VARCHAR(20),=0A=20=20=20=20=
v_executed=20boolean,=0A=20=20=20=20v_callback_enabled=20boolean,=0A=20=20=
=20=20v_return_value=20TEXT,=0A=20=20=20=20v_return_value_class=20=
VARCHAR(256),=0A=20=20=20=20v_data=20TEXT=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20UPDATE=20=
command_entities=0A=20=20=20=20SET=20command_type=20=3D=20=
v_command_type,=0A=20=20=20=20=20=20=20=20user_id=20=3D=20v_user_id,=0A=20=
=20=20=20=20=20=20=20engine_session_seq_id=20=3D=20=
v_engine_session_seq_id,=0A=20=20=20=20=20=20=20=20parent_command_id=20=3D=
=20v_parent_command_id,=0A=20=20=20=20=20=20=20=20root_command_id=20=3D=20=
v_root_command_id,=0A=20=20=20=20=20=20=20=20job_id=20=3D=20v_job_id,=0A=20=
=20=20=20=20=20=20=20step_id=20=3D=20v_step_id,=0A=20=20=20=20=20=20=20=20=
command_parameters=20=3D=20v_command_parameters,=0A=20=20=20=20=20=20=20=20=
command_params_class=20=3D=20v_command_params_class,=0A=20=20=20=20=20=20=
=20=20status=20=3D=20v_status,=0A=20=20=20=20=20=20=20=20executed=20=3D=20=
v_executed,=0A=20=20=20=20=20=20=20=20callback_enabled=20=3D=20=
v_callback_enabled,=0A=20=20=20=20=20=20=20=20return_value=20=3D=20=
v_return_value,=0A=20=20=20=20=20=20=20=20return_value_class=20=3D=20=
v_return_value_class,=0A=20=20=20=20=20=20=20=20data=20=3D=20v_data=0A=20=
=20=20=20WHERE=20command_id=20=3D=20v_command_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateCommandEntityStatus=20(=0A=20=20=20=20v_command_id=20uuid,=0A=20=20=
=20=20v_status=20VARCHAR(20)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20UPDATE=20command_entities=0A=20=20=20=
=20SET=20status=20=3D=20v_status=0A=20=20=20=20WHERE=20command_id=20=3D=20=
v_command_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateCommandEntityExecuted=20(=0A=20=20=20=20v_command_id=20uuid,=0A=20=20=
=20=20v_executed=20boolean=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20UPDATE=20command_entities=0A=20=20=20=
=20SET=20executed=20=3D=20v_executed=0A=20=20=20=20WHERE=20command_id=20=
=3D=20v_command_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateCommandEntityNotified=20(=0A=20=20=20=20v_command_id=20uuid,=0A=20=20=
=20=20v_callback_notified=20boolean=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20UPDATE=20command_entities=0A=20=
=20=20=20SET=20callback_notified=20=3D=20v_callback_notified=0A=20=20=20=20=
WHERE=20command_id=20=3D=20v_command_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertOrUpdateCommandEntity=20(=0A=20=20=20=20v_user_id=20uuid,=0A=20=20=20=
=20v_engine_session_seq_id=20BIGINT,=0A=20=20=20=20v_command_id=20uuid,=0A=
=20=20=20=20v_command_type=20INT,=0A=20=20=20=20v_parent_command_id=20=
uuid,=0A=20=20=20=20v_root_command_id=20uuid,=0A=20=20=20=20v_job_id=20=
uuid,=0A=20=20=20=20v_step_id=20uuid,=0A=20=20=20=20v_command_parameters=20=
TEXT,=0A=20=20=20=20v_command_params_class=20VARCHAR(256),=0A=20=20=20=20=
v_created_at=20TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20v_status=20=
VARCHAR(20),=0A=20=20=20=20v_executed=20boolean,=0A=20=20=20=20=
v_callback_enabled=20boolean,=0A=20=20=20=20v_return_value=20TEXT,=0A=20=20=
=20=20v_return_value_class=20VARCHAR(256),=0A=20=20=20=20v_data=20TEXT=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20=
IF=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20command_entities=0A=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20command_id=20=3D=20v_command_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20PERFORM=20InsertCommandEntity(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_user_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_engine_session_seq_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_command_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20v_command_type,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20v_parent_command_id,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20v_root_command_id,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_job_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_step_id,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_command_parameters,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20v_command_params_class,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20v_created_at,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_status,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_executed,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_callback_enabled,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_return_value,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20v_return_value_class,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_data);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20PERFORM=20=
UpdateCommandEntity(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20v_user_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20v_engine_session_seq_id,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20v_command_id,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20v_command_type,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_parent_command_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_root_command_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_job_id,=20=
v_step_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20v_command_parameters,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20v_command_params_class,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20v_status,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20v_executed,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20v_callback_enabled,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_return_value,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_return_value_class,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_data);=0A=
=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetCommandEntityByCommandEntityId=20(v_command_id=20uuid)=0ARETURNS=20=
SETOF=20command_entities=20AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20command_entities.*=0A=20=20=20=20=
FROM=20command_entities=0A=20=20=20=20WHERE=20command_id=20=3D=20=
v_command_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromCommandEntities=20()=0ARETURNS=20SETOF=20command_entities=20AS=20=
$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20*=0A=20=20=20=20FROM=20command_entities;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetCommandEntitiesByParentCmdId=20(v_root_command_id=20uuid)=0ARETURNS=20=
SETOF=20command_entities=20STABLE=20AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20command_entities.*=0A=20=20=20=
=20FROM=20command_entities=0A=20=20=20=20WHERE=20root_command_id=20=3D=20=
v_root_command_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteCommandEntity=20=
(v_command_id=20uuid)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=
=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=20=
FROM=20command_entities=0A=20=20=20=20=20=20=20=20WHERE=20command_id=20=3D=
=20v_command_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteCommandEntitiesOlderThanDate=20(v_date=20=
TIMESTAMP=20WITH=20TIME=20ZONE)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=0A=
DECLARE=20v_id=20INT;=0A=0ASWV_RowCount=20INT;=0A=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20command_entities=0A=20=20=20=20WHERE=20=
CREATED_AT=20<=20v_date=0A=20=20=20=20=20=20=20=20AND=20command_id=20NOT=20=
IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20command_id=0A=20=20=
=20=20=20=20=20=20=20=20=20=20FROM=20async_tasks=0A=20=20=20=20=20=20=20=20=
=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertCommandAssociatedEntities=20(=0A=20=20=20=20v_command_id=20UUID,=0A=
=20=20=20=20v_entity_id=20UUID,=0A=20=20=20=20v_entity_type=20=
VARCHAR(128)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20command_assoc_entities=20(=0A=20=20=20=
=20=20=20=20=20command_id,=0A=20=20=20=20=20=20=20=20entity_id,=0A=20=20=20=
=20=20=20=20=20entity_type=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_command_id,=0A=20=20=20=20=20=20=20=
=20v_entity_id,=0A=20=20=20=20=20=20=20=20v_entity_type=0A=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetCommandIdsByEntityId=20=
(v_entity_id=20UUID)=0ARETURNS=20SETOF=20idUuidType=20STABLE=20AS=20=
$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20command_id=0A=20=20=20=20FROM=20command_assoc_entities=0A=20=20=20=
=20WHERE=20entity_id=20=3D=20v_entity_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetCommandAssociatedEntities=20(v_command_id=20UUID)=0ARETURNS=20SETOF=20=
command_assoc_entities=20STABLE=20AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
command_assoc_entities=0A=20=20=20=20WHERE=20command_id=20=3D=20=
v_command_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_add_column=20(=0A=20=
=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=20v_column=20VARCHAR(128),=0A=
=20=20=20=20v_column_def=20TEXT=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20=
ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20column_name=20ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20=
||=20v_table=20||=20'=20ADD=20COLUMN=20'=20||=20v_column=20||=20'=20'=20=
||=20v_column_def;=0A=0A=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=
=20=20END;=0AEND=0A=0AIF=20;END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_drop_column=20(=0A=20=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=20=
v_column=20VARCHAR(128)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20=
v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20column_name=20ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20=
v_table=20||=20'=20DROP=20COLUMN=20'=20||=20v_column;=0A=0A=20=20=20=20=20=
=20=20=20EXECUTE=20v_sql;=0A=20=20=20=20END;=0A=20=20=20=20ELSE=0A=20=20=20=
=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20Column=20%=20does=20=
not=20exist.',=0A=20=20=20=20=20=20=20=20=20=20=20=20v_table,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_column;=0A=20=20=20=20END=20IF;=0A=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_change_column_type=20(=0A=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20v_column=20VARCHAR(128),=0A=20=20=20=20=
v_type=20VARCHAR(128),=0A=20=20=20=20v_new_type=20VARCHAR(128)=0A=20=20=20=
=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0A=
BEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20information_schema.columns=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20table_schema=20=3D=
=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20table_name=20ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20column_name=20ilike=20v_column=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20udt_name=20=
ilike=20v_type=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20OR=20data_type=20ilike=20v_type=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20=
THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20ALTER=20COLUMN=20'=20||=20v_column=20=
||=20'=20TYPE=20'=20||=20v_new_type;=0A=0A=20=20=20=20=20=20=20=20=
EXECUTE=20v_sql;=0A=20=20=20=20END;=0A=0A=20=20=20=20---=20ignore=20=
operation=20if=20requested=20type=20is=20already=20there=0A=20=20=20=20=
ELSIF(NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20v_table=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20column_name=20=
ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20udt_name=20ilike=20v_new_type=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20data_type=20ilike=20=
v_new_type=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20))=20=
THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20RAISE=20=
EXCEPTION=20'Table=20%=20or=20Column=20%=20does=20not=20exist.',=20=
v_table,=20v_column;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_rename_column=20(=0A=20=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=
=20v_column=20VARCHAR(128),=0A=20=20=20=20v_new_name=20VARCHAR(128)=0A=20=
=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=
=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20v_table=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20column_name=20=
ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20=
RENAME=20COLUMN=20'=20||=20v_column=20||=20'=20TO=20'=20||=20v_new_name;=0A=
=0A=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=20=20END;=0A=20=20=20=
=20ELSE=0A=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20=
Column=20%=20does=20not=20exist.',=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_table,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_column;=0AEND=0A=0AIF=20=
;END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_rename_table=20(=0A=
=20=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=20v_new_name=20=
VARCHAR(128)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
DECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20v_table=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20RENAME=20TO=20=
'=20||=20v_new_name;=0A=0A=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=
=20=20END;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20RAISE=20=
EXCEPTION=20'Table=20%=20does=20not=20exist.',=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_table;=0AEND=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_add_config_value=20=
(=0A=20=20=20=20v_option_name=20VARCHAR(100),=0A=20=20=20=20=
v_option_value=20VARCHAR(4000),=0A=20=20=20=20v_version=20VARCHAR(40)=0A=20=
=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20=20=20=20=20INSERT=20INTO=20vdc_options=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20option_name,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20option_value,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20END;=0A=20=20=20=20END=20IF;=0A=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_delete_config_value_all_versions=20=
(v_option_name=20VARCHAR(100))=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20BEGIN=0A=
=20=20=20=20=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
option_name=20ilike=20v_option_name;=0A=20=20=20=20=20=20=20=20END;=0A=20=
=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_delete_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_version=20TEXT=0A=20=20=20=20)=0ARETURNS=20=
void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20version=20IN=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitter(v_version)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20version=20IN=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20fnSplitter(v_version)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=
=20=20END;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_delete_config_for_version=20(v_version=20TEXT)=0ARETURNS=20void=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20WHERE=20version=20IN=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitter(v_version)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_update_config_value=20(=0A=20=20=20=20=
v_option_name=20VARCHAR(100),=0A=20=20=20=20v_option_value=20=
VARCHAR(4000),=0A=20=20=20=20v_version=20VARCHAR(40)=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=
=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=
=20=20=20=20=20UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SET=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20=
=20=20=20=20END;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_update_default_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_default_option_value=20VARCHAR(4000),=0A=20=
=20=20=20v_option_value=20VARCHAR(4000),=0A=20=20=20=20v_version=20=
VARCHAR(40),=0A=20=20=20=20v_ignore_default_value_case=20boolean=0A=20=20=
=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20=
(v_ignore_default_value_case)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20option_value=20ilike=20v_default_option_value=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=20=20=
=20=20UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20option_value=20=3D=20v_default_option_value=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20END=20IF;=0A=0A=20=20=20=20END;=0A=20=
=20=20=20END=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_db_rename_config_key=20(=0A=20=20=20=20=20=20=20=20v_old_option_name=20=
VARCHAR(100),=0A=20=20=20=20=20=20=20=20v_new_option_name=20=
VARCHAR(100),=0A=20=20=20=20=20=20=20=20v_version=20VARCHAR(40)=0A=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=
=20=20=20DECLARE=20v_current_option_value=20VARCHAR(4000);=0A=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20v_old_option_name=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20version=20=3D=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20v_current_option_value:=3D=20=
option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_old_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
version=20=3D=20v_version;=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_name=20=3D=20v_new_option_name,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20option_value=20=3D=20v_current_option_value=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_old_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20=20=20=20=20END=20=
IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_db_create_constraint=20(=0A=20=20=20=20=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_constraint=20VARCHAR(128),=0A=20=
=20=20=20=20=20=20=20v_constraint_sql=20TEXT=0A=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20IF=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_constraint=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20conname=20ilike=20v_constraint=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20EXECUTE=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ADD=20CONSTRAINT=20'=20||=20=
v_constraint=20||=20'=20'=20||=20v_constraint_sql;=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20fn_db_drop_constraint=20(=0A=20=20=20=20=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_constraint=20VARCHAR(128)=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=
=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20pg_constraint=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20conname=20ilike=20v_constraint=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=
=20=20=20=20EXECUTE=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20DROP=20=
CONSTRAINT=20'=20||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=20=20=
=20=20=20END=20IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
replace=20FUNCTION=20CheckDBConnection=20()=0A=20=20=20=20RETURNS=20=
SETOF=20INT=20IMMUTABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=
=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
1;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax=20()=0A=20=20=20=20RETURNS=20SETOF=20=
TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=0A=20=20=
=20=20=20=20=20=20FROM=20pg_proc=0A=20=20=20=20=20=20=20=20INNER=20JOIN=20=
pg_namespace=20ns=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
(pg_proc.pronamespace=20=3D=20ns.oid)=0A=20=20=20=20=20=20=20=20WHERE=20=
ns.nspname=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
proname;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
generate_drop_all_views_syntax=20()=0A=20=20=20=20RETURNS=20SETOF=20TEXT=20=
STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20'DROP=20VIEW=20if=20=
exists=20'=20||=20table_name=20||=20'=20CASCADE;'=0A=20=20=20=20=20=20=20=
=20FROM=20information_schema.VIEWS=0A=20=20=20=20=20=20=20=20WHERE=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
table_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20generate_drop_all_tables_syntax=20()=0A=20=20=20=20RETURNS=20=
SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
'DROP=20TABLE=20if=20exists=20'=20||=20table_name=20||=20'=20CASCADE;'=0A=
=20=20=20=20=20=20=20=20FROM=20information_schema.tables=0A=20=20=20=20=20=
=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20table_type=20=3D=20'BASE=20TABLE'=0A=20=20=20=20=20=20=20=
=20ORDER=20BY=20table_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
replace=20FUNCTION=20generate_drop_all_seq_syntax=20()=0A=20=20=20=20=
RETURNS=20SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20'DROP=20SEQUENCE=20if=20exists=20'=20||=20sequence_name=20||=20=
'=20CASCADE;'=0A=20=20=20=20=20=20=20=20FROM=20=
information_schema.sequences=0A=20=20=20=20=20=20=20=20WHERE=20=
sequence_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
sequence_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20generate_drop_all_user_types_syntax=20()=0A=20=20=20=20=
RETURNS=20SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20=20=20=20=20=20FROM=20pg_namespace=20n,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20pg_class=20c,=0A=20=20=20=20=20=20=20=20=20=20=20=20pg_type=20t=0A=20=
=20=20=20=20=20=20=20WHERE=20n.oid=20=3D=20c.relnamespace=0A=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20t.typrelid=20=3D=20c.oid=0A=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20c.relkind=20=3D=20'c'::"char"=0A=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20n.nspname=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
ORDER=20BY=20c.relname::information_schema.sql_identifier;=0A=20=20=20=20=
END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_get_column_size=20(=0A=20=20=20=20=20=20=20=20v_table=20VARCHAR(64),=0A=
=20=20=20=20=20=20=20=20v_column=20VARCHAR(64)=0A=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20RETURNS=20INT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
DECLARE=20retvalue=20INT;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
retvalue=20:=3D=20character_maximum_length=0A=20=20=20=20=20=20=20=20=
FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20WHERE=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
table_name=20ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
column_name=20ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
udt_name=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
'char',=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'varchar'=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=
=20RETURN=20retvalue;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
REPLACE=20FUNCTION=20attach_user_to_role=20(=0A=20=20=20=20=20=20=20=20=
v_user_name=20VARCHAR(255),=0A=20=20=20=20=20=20=20=20v_domain=20=
VARCHAR(255),=0A=20=20=20=20=20=20=20=20v_namespace=20VARCHAR(255),=0A=20=
=20=20=20=20=20=20=20v_domain_entry_id=20TEXT,=0A=20=20=20=20=20=20=20=20=
v_role_name=20VARCHAR(255)=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$BODY$=0A=0A=20=20=20=20DECLARE=20selected_user_id=20=
uuid;=0A=0A=20=20=20=20input_role_id=20uuid;=0A=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20SELECT=20roles.id=0A=20=20=20=20=20=20=20=20INTO=20=
input_role_id=0A=20=20=20=20=20=20=20=20FROM=20roles=0A=20=20=20=20=20=20=
=20=20WHERE=20roles.name=20=3D=20v_role_name;=0A=0A=20=20=20=20=20=20=20=20=
--=20The=20external=20identifier=20is=20the=20user=20identifier=20=
converted=20to=20an=20array=20of=0A=20=20=20=20=20=20=20=20--=20bytes:=0A=
=20=20=20=20=20=20=20=20INSERT=20INTO=20users=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20user_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
external_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20namespace,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
domain,=0A=20=20=20=20=20=20=20=20=20=20=20=20username,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20last_admin_check_status=0A=20=20=20=20=20=20=20=20=20=
=20=20=20)=0A=20=20=20=20=20=20=20=20SELECT=20uuid_generate_v1(),=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_domain_entry_id,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_namespace,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_user_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_domain,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20v_user_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
true=0A=20=20=20=20=20=20=20=20WHERE=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20domain=20=3D=20v_domain=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20external_id=20=3D=20=
v_domain_entry_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=0A=20=20=20=20=20=20=20=20SELECT=20user_id=0A=20=20=20=20=20=20=20=20=
FROM=20users=0A=20=20=20=20=20=20=20=20WHERE=20domain=20=3D=20v_domain=0A=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20external_id=20=3D=20=
v_domain_entry_id=0A=20=20=20=20=20=20=20=20INTO=20selected_user_id;=0A=0A=
=20=20=20=20=20=20=20=20INSERT=20INTO=20permissions=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20=20=20=20=20role_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20ad_element_id,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20object_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
object_type_id=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=
=20=20SELECT=20uuid_generate_v1(),=0A=20=20=20=20=20=20=20=20=20=20=20=20=
input_role_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20selected_user_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20getGlobalIds('system'),=0A=20=20=20=20=
=20=20=20=20=20=20=20=201=0A=20=20=20=20=20=20=20=20WHERE=20NOT=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20role_id,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ad_element_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20object_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
object_type_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
permissions=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20input_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20AND=20ad_element_id=20=3D=20selected_user_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20object_id=20=3D=20=
getGlobalIds('system')=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20object_type_id=20=3D=201=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20);=0A=20=20=20=20END;$BODY$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20=
FUNCTION=20fn_db_add_action_group_to_role=20(=0A=20=20=20=20=20=20=20=20=
v_role_id=20UUID,=0A=20=20=20=20=20=20=20=20v_action_group_id=20INT=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20RETURNS=20VOID=20AS=20$PROCEDURE$=0A=
=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20INSERT=20INTO=20=
roles_groups=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20role_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20action_group_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20SELECT=20v_role_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_action_group_id=0A=20=20=20=20=20=20=20=20WHERE=20=
NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
roles_groups=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20v_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20action_group_id=20=3D=20v_action_group_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=20=
RETURN;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20FUNCTION=20=
fn_db_split_config_value=20(=0A=20=20=20=20=20=20=20=20v_option_name=20=
VARCHAR,=0A=20=20=20=20=20=20=20=20v_old_option_value=20VARCHAR,=0A=20=20=
=20=20=20=20=20=20v_new_option_value=20VARCHAR,=0A=20=20=20=20=20=20=20=20=
v_update_from_version=20VARCHAR=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$BODY$=0A=0A=20=20=20=20DECLARE=20v_old_value=20=
VARCHAR(4000);=0A=0A=20=20=20=20v_cur=20CURSOR=0A=20=20=20=20FOR=0A=0A=20=
=20=20=20SELECT=20DISTINCT=20version=0A=20=20=20=20FROM=20vdc_options=0A=20=
=20=20=20WHERE=20version=20<>=20'general'=0A=20=20=20=20ORDER=20BY=20=
version;=0A=0A=20=20=20=20v_version=20VARCHAR(40);=0A=0A=20=20=20=20=
v_index=20INT;=0A=0A=20=20=20=20v_count=20INT;=0A=0A=20=20=20=20=
v_total_count=20INT;=0A=0A=20=20=20=20v_version_count=20INT;=0A=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20v_total_count=20:=3D=20count(version)=0A=
=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=
WHERE=20option_name=20=3D=20v_option_name;=0A=0A=20=20=20=20=20=20=20=20=
v_old_value=20:=3D=20option_value=0A=20=20=20=20=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20=20=20=20=20WHERE=20option_name=20=3D=20=
v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
'general';=0A=0A=20=20=20=20=20=20=20=20v_version_count=20:=3D=20=
count(DISTINCT=20version)=0A=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=
=20=20=20=20=20=20=20=20WHERE=20version=20<>=20'general';=0A=0A=20=20=20=20=
=20=20=20=20IF=20(v_total_count=20<=3D=20v_version_count)=20THEN=0A=20=20=
=20=20=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=20=20=20=20IF=20=
(v_old_value=20IS=20NULL)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20v_old_value=20:=3D=20v_old_option_value;=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=20=20=20=20=20=20=20=20v_count=20:=3D=20count(DISTINCT=20=
version)=0A=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=
=20=20WHERE=20version=20<>=20'general';=0A=0A=20=20=20=20=20=20=20=20=
v_index=20:=3D=201;=0A=0A=20=20=20=20=20=20=20=20OPEN=20v_cur;=0A=0A=20=20=
=20=20=20=20=20=20LOOP=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20FETCH=20=
v_cur=0A=20=20=20=20=20=20=20=20=20=20=20=20INTO=20v_version;=0A=0A=20=20=
=20=20=20=20=20=20=20=20=20=20EXIT=20when=20NOT=20found;=0A=0A=20=20=20=20=
=20=20=20=20=20=20=20=20--=20We=20shouldn't=20update=20if=20already=20=
exists=0A=20=20=20=20=20=20=20=20=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20option_name=20=3D=20v_option_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20version=20=3D=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20--=20Might=20not=20work=20well=20for=20versions=20such=20as=20=
3.10,=20but=20we=20currently=20don't=20have=20any=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20IF=20(v_version=20>=3D=20=
v_update_from_version)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20INSERT=20INTO=20vdc_options=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20option_name,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_new_option_value,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_version=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20INSERT=20INTO=20vdc_options=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20option_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20version=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_old_value,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20END=20IF;=0A=
=0A=20=20=20=20=20=20=20=20=20=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_index=20:=3D=20v_index=20+=201;=0A=20=20=20=20=20=20=20=20=
END=20LOOP;=0A=0A=20=20=20=20CLOSE=20v_cur;=0A=0A=20=20=20=20DELETE=0A=20=
=20=20=20FROM=20vdc_options=0A=20=20=20=20WHERE=20option_name=20=3D=20=
v_option_name=0A=20=20=20=20=20=20=20=20AND=20version=20=3D=20'general';=0A=
=20=20=20=20END;=0AEND=20IF;=0A=0AEND;$BODY$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_grant_action_group_to_all_roles_filter=20(=0A=20=20=20=20=
v_action_group_id=20INT,=0A=20=20=20=20uuid=20[]=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$BODY$=0A=0ADECLARE=20v_role_id_to_filter=20alias=0A=
FOR=20$2;=0A=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20roles_groups=20(=0A=20=
=20=20=20=20=20=20=20role_id,=0A=20=20=20=20=20=20=20=20action_group_id=0A=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20SELECT=20DISTINCT=20role_id,=0A=20=
=20=20=20=20=20=20=20v_action_group_id=0A=20=20=20=20FROM=20roles_groups=20=
rg=0A=20=20=20=20WHERE=20NOT=20ARRAY=20[role_id]=20<@=20=
v_role_id_to_filter=0A=20=20=20=20=20=20=20=20AND=20NOT=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20roles_groups=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20rg.role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20action_group_id=20=3D=20v_action_group_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20);=0AEND;$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_mask_object=20=
(v_object=20regclass)=0ARETURNS=20setof=20record=20AS=20$BODY$=0A=0A=
DECLARE=20v_sql=20TEXT;=0A=0Av_table=20record;=0A=0Av_table_name=20TEXT;=0A=
=0Atemprec=20record;=0A=0ABEGIN=0A=20=20=20=20--=20get=20full=20=
table/view=20name=20from=20v_object=20(i.e=20<namespace>.<name>)=0A=20=20=
=20=20SELECT=20c.relname,=0A=20=20=20=20=20=20=20=20n.nspname=0A=20=20=20=
=20INTO=20v_table=0A=20=20=20=20FROM=20pg_class=20c=0A=20=20=20=20INNER=20=
JOIN=20pg_namespace=20n=0A=20=20=20=20=20=20=20=20ON=20c.relnamespace=20=
=3D=20n.oid=0A=20=20=20=20WHERE=20c.oid=20=3D=20v_object;=0A=0A=20=20=20=20=
--=20try=20to=20get=20filtered=20query=20syntax=20from=20previous=20=
execution=0A=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
object_column_white_list_sql=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
object_name=20=3D=20v_table.relname=0A=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=0A=20=20=20=20=20=20=20=20SELECT=20sql=0A=20=20=20=20=20=20=20=20=
INTO=20v_sql=0A=20=20=20=20=20=20=20=20FROM=20=
object_column_white_list_sql=0A=20=20=20=20=20=20=20=20WHERE=20=
object_name=20=3D=20v_table.relname;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=
=20=20=20v_table_name=20:=3D=20quote_ident(v_table.nspname)=20||=20'.'=20=
||=20quote_ident(v_table.relname);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20FOR=20temprec=20IN=0A=20=20=20=20SELECT=20a.attname,=0A=20=20=20=
=20=20=20=20=20t.typname=0A=20=20=20=20FROM=20pg_attribute=20a=0A=20=20=20=
=20INNER=20JOIN=20pg_type=20t=0A=20=20=20=20=20=20=20=20ON=20a.atttypid=20=
=3D=20t.oid=0A=20=20=20=20WHERE=20a.attrelid=20=3D=20v_object=0A=20=20=20=
=20=20=20=20=20AND=20a.attnum=20>=200=0A=20=20=20=20=20=20=20=20AND=20=
NOT=20a.attisdropped=0A=20=20=20=20ORDER=20BY=20a.attnum=20LOOP=20v_sql=20=
:=3D=20coalesce(v_sql=20||=20',=20',=20'SELECT=20');=0A=0A=20=20=20=20=20=
=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
1=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20object_column_white_list=0A=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20object_name=20=3D=20=
v_table.relname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
column_name=20=3D=20temprec.attname=0A=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=20v_sql=20:=3D=20v_sql=20||=20quote_ident(temprec.attname);=0A=20=
=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20=
:=3D=20v_sql=20||=20'NULL::'=20||=20quote_ident(temprec.typname)=20||=20=
'=20as=20'=20||=20quote_ident(temprec.attname);=0A=20=20=20=20=20=20=20=20=
END=20IF;=0A=0A=20=20=20=20END=20LOOP;=0A=0A=20=20=20=20v_sql=20:=3D=20=
v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=0A=20=20=20=20v_sql=20=
:=3D=20'SELECT=20x::'=20||=20v_table_name=20||=20'=20as=20rec=20FROM=20=
('=20||=20v_sql=20||=20')=20as=20x';=0A=0A=20=20=20=20--=20save=20=
generated=20query=20for=20further=20use=0A=20=20=20=20INSERT=20INTO=20=
object_column_white_list_sql=20(=0A=20=20=20=20=20=20=20=20object_name,=0A=
=20=20=20=20=20=20=20=20sql=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_table.relname,=0A=20=20=20=20=20=20=
=20=20v_sql=0A=20=20=20=20=20=20=20=20);=0A=20=20=20=20END=20IF;=0A=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20EXECUTE=20v_sql;=0AEND;$BODY$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_add_column_to_object_white_list=20(=0A=20=20=20=20v_object_name=20=
VARCHAR(128),=0A=20=20=20=20v_column_name=20VARCHAR(128)=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20object_column_white_list=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20object_name=20=3D=20v_object_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20column_name=20=3D=20=
v_column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=
=20=20=20=20--=20verify=20that=20there=20is=20such=20object=20in=20db=0A=20=
=20=20=20=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20=3D=20=
v_object_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20column_name=20=3D=20v_column_name=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20INSERT=20=
INTO=20object_column_white_list=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20object_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20v_object_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20v_column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=20=20=20=20=20=20=20=20END=20IF;=0A=0A=20=20=20=20END;=0A=20=20=20=20=
END=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20FUNCTION=20=
fn_db_is_table_exists=20(v_table=20VARCHAR(64))=0A=20=20=20=20RETURNS=20=
boolean=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20DECLARE=20retvalue=20=
boolean;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20retvalue=20:=3D=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.tables=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ILIKE=20v_table=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=20=
RETURN=20retvalue;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20fn_db_create_index=20(=0A=20=20=20=20=20=20=20=20v_index_name=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_table_name=20VARCHAR(128),=0A=20=
=20=20=20=20=20=20=20v_column_names=20TEXT,=0A=20=20=20=20=20=20=20=20=
v_where_predicate=20TEXT=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=20=20=20DECLARE=20v_sql=20=
TEXT;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
'DROP=20INDEX=20'=20||=20'=20IF=20EXISTS=20'=20||=20v_index_name=20||=20=
';=20CREATE=20INDEX=20'=20||=20v_index_name=20||=20'=20ON=20'=20||=20=
v_table_name=20||=20'('=20||=20v_column_names=20||=20')';=0A=0A=20=20=20=20=
=20=20=20=20IF=20v_where_predicate=20=3D=20''=20THEN=20v_sql=20:=3D=20=
v_sql=20||=20';';ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
v_sql=20||=20'=20WHERE=20'=20||=20v_where_predicate=20||=20';';=0A=20=20=20=
=20END=20IF;=0A=0A=20=20=20=20EXECUTE=20v_sql;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_unlock_disk=20(v_id=20UUID)=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
DECLARE=20OK=20INT;=0A=0ALOCKED=20INT;=0A=0ABEGIN=0A=20=20=20=20OK:=3D=20=
1;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20UPDATE=20images=0A=20=
=20=20=20SET=20imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=
=3D=20LOCKED=0A=20=20=20=20=20=20=20=20AND=20image_group_id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_snapshot=20=
(v_id=20UUID)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20OK=20=
VARCHAR;=0A=0ALOCKED=20VARCHAR;=0A=0ABEGIN=0A=20=20=20=20OK:=3D=20'OK';=0A=
=0A=20=20=20=20LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20UPDATE=20=
snapshots=0A=20=20=20=20SET=20status=20=3D=20OK=0A=20=20=20=20WHERE=20=
status=20=3D=20LOCKED=0A=20=20=20=20=20=20=20=20AND=20snapshot_id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_entity=20(=0A=
=20=20=20=20v_object_type=20VARCHAR(10),=0A=20=20=20=20v_name=20=
VARCHAR(255),=0A=20=20=20=20v_recursive=20boolean=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20DOWN=20INT;=0A=0AOK=20INT;=0A=
=0ALOCKED=20INT;=0A=0ATEMPLATE_OK=20INT;=0A=0ATEMPLATE_LOCKED=20INT;=0A=0A=
IMAGE_LOCKED=20INT;=0A=0ASNAPSHOT_OK=20VARCHAR;=0A=0ASNAPSHOT_LOCKED=20=
VARCHAR;=0A=0Av_id=20UUID;=0A=0ABEGIN=0A=20=20=20=20DOWN:=3D=200;=0A=0A=20=
=20=20=20OK:=3D=201;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20=
TEMPLATE_OK:=3D=200;=0A=0A=20=20=20=20TEMPLATE_LOCKED:=3D=201;=0A=0A=20=20=
=20=20IMAGE_LOCKED:=3D=2015;=0A=0A=20=20=20=20SNAPSHOT_OK:=3D=20'OK';=0A=0A=
=20=20=20=20SNAPSHOT_LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20v_id=20:=3D=20=
vm_guid=0A=20=20=20=20FROM=20vm_static=0A=20=20=20=20WHERE=20vm_name=20=3D=
=20v_name=0A=20=20=20=20=20=20=20=20AND=20entity_type=20ilike=20=
v_object_type;=0A=0A=20=20=20=20--=20set=20VM=20status=20to=20DOWN=0A=20=20=
=20=20IF=20(v_object_type=20=3D=20'vm')=20THEN=0A=20=20=20=20=20=20=20=20=
UPDATE=20vm_dynamic=0A=20=20=20=20=20=20=20=20SET=20status=20=3D=20DOWN=0A=
=20=20=20=20=20=20=20=20WHERE=20status=20=3D=20IMAGE_LOCKED=0A=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20vm_guid=20=3D=20v_id;=0A=20=20=20=20=20=20=20=
=20=20=20=20=20--=20set=20Template=20status=20to=20OK=0A=20=20=20=20ELSE=20=
IF=20(v_object_type=20=3D=20'template')=20THEN=0A=20=20=20=20=20=20=20=20=
UPDATE=20vm_static=0A=20=20=20=20=20=20=20=20SET=20template_status=20=3D=20=
TEMPLATE_OK=0A=20=20=20=20=20=20=20=20WHERE=20template_status=20=3D=20=
TEMPLATE_LOCKED=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20vm_guid=20=3D=20=
v_id;=0A=20=20=20=20END=20IF;=0A=0AEND=20IF;=0A=20--unlock=20images=20=
and=20snapshots=20=20if=20recursive=20flag=20is=20set=0AIF=20=
(v_recursive)=20THEN=0A=20=20=20=20UPDATE=20images=0A=20=20=20=20SET=20=
imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=3D=20LOCKED=0A=
=20=20=20=20=20=20=20=20AND=20image_group_id=20IN=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=20device_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vm_device=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vm_id=20=3D=
=20v_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
is_plugged=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=
UPDATE=20snapshots=0A=20=20=20=20SET=20status=20=3D=20SNAPSHOT_OK=0A=20=20=
=20=20WHERE=20status=20ilike=20SNAPSHOT_LOCKED=0A=20=20=20=20=20=20=20=20=
AND=20vm_id=20=3D=20v_id;=0AEND=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_all=20=
()=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20DOWN=20INT;=0A=0AOK=20=
INT;=0A=0ALOCKED=20INT;=0A=0ATEMPLATE_OK=20INT;=0A=0ATEMPLATE_LOCKED=20=
INT;=0A=0AIMAGE_LOCKED=20INT;=0A=0ASNAPSHOT_OK=20VARCHAR;=0A=0A=
SNAPSHOT_LOCKED=20VARCHAR;=0A=0ABEGIN=0A=20=20=20=20DOWN:=3D=200;=0A=0A=20=
=20=20=20OK:=3D=201;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20=
TEMPLATE_OK:=3D=200;=0A=0A=20=20=20=20TEMPLATE_LOCKED:=3D=201;=0A=0A=20=20=
=20=20IMAGE_LOCKED:=3D=2015;=0A=0A=20=20=20=20SNAPSHOT_OK:=3D=20'OK';=0A=0A=
=20=20=20=20SNAPSHOT_LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20UPDATE=20=
vm_static=0A=20=20=20=20SET=20template_status=20=3D=20TEMPLATE_OK=0A=20=20=
=20=20WHERE=20template_status=20=3D=20TEMPLATE_LOCKED;=0A=0A=20=20=20=20=
UPDATE=20vm_dynamic=0A=20=20=20=20SET=20status=20=3D=20DOWN=0A=20=20=20=20=
WHERE=20status=20=3D=20IMAGE_LOCKED;=0A=0A=20=20=20=20UPDATE=20images=0A=20=
=20=20=20SET=20imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=
=3D=20LOCKED;=0A=0A=20=20=20=20UPDATE=20snapshots=0A=20=20=20=20SET=20=
status=20=3D=20SNAPSHOT_OK=0A=20=20=20=20WHERE=20status=20ilike=20=
SNAPSHOT_LOCKED;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A/*=20Displays=20DC=20id=20,=20DC=20name,=20SPM=20Host=20id=20=
,=20SPM=20Host=20name=20and=20number=20of=20async=20tasks=20awaiting.=0A=0A=
1)=20create=20a=20record=20type=20with=20DC=20name,=20DC=20id,=20SPM=20=
host=20id,=20SPM=20host=20name,=20count=0A=0A2)=20get=20all=20distinct=20=
DC=20ids=20from=20async_tasks=20table=0A=0A3)=20Run=20a=20cursor=20for=20=
each=20result=20in=202)=0A=0A=20=20=20a)=20get=20DC=20name=0A=20=20=20b)=20=
get=20SPM=20Host=20id=20&=20name=20if=20available=0A=20=20=20c)=20get=20=
count=20of=20tasks=0A=0A=20=20=20return=20current=20record=0A=0A4)=20=
return=20set=20of=20generated=20records=0A*/=0ADROP=20TYPE=20IF=20EXISTS=20=
async_tasks_info_rs=20CASCADE;=0A**************************=0A=0ADROP=20=
TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
async_tasks_info_rs=20AS=20(=0A=20=20=20=20=20=20=20=20dc_id=20uuid,=0A=20=
=20=20=20=20=20=20=20dc_name=20VARCHAR,=0A=20=20=20=20=20=20=20=20=
spm_host_id=20uuid,=0A=20=20=20=20=20=20=20=20spm_host_name=20VARCHAR,=0A=
=20=20=20=20=20=20=20=20task_count=20INT=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_get_async_tasks=20=
()=0ARETURNS=20SETOF=20async_tasks_info_rs=20STABLE=20AS=20$PROCEDURE$=0A=
DECLARE=20v_record=20async_tasks_info_rs;=0A=0A--=20selects=20=
storage_pool_id=20uuid=20found=20in=20async_tasks=0Av_tasks_cursor=20=
CURSOR=0AFOR=0A=0ASELECT=20DISTINCT=20storage_pool_id=0AFROM=20=
async_tasks;=0A=0ABEGIN=0A=20=20=20=20OPEN=20v_tasks_cursor;=0A=0A=20=20=20=
=20FETCH=20v_tasks_cursor=0A=20=20=20=20INTO=20v_record.dc_id;=0A=0A=20=20=
=20=20WHILE=20FOUND=0A=20=20=20=20LOOP=0A=20=20=20=20=20=20=20=20--=20=
get=20dc_name=20and=20SPM=20Host=20id=0A=20=20=20=20=20=20=20=20=
v_record.dc_name=20:=3D=20name=20FROM=20storage_pool=20WHERE=20id=20=3D=20=
v_record.dc_id;=0A=20=20=20=20=20=20=20=20v_record.spm_host_id=20:=3D=20=
spm_vds_id=0A=20=20=20=20=20=20=20=20FROM=20storage_pool=0A=20=20=20=20=20=
=20=20=20WHERE=20id=20=3D=20v_record.dc_id;=0A=0A=20=20=20=20=20=20=20=20=
--=20get=20Host=20name=20if=20we=20have=20non=20NULL=20SPM=20Host=0A=20=20=
=20=20=20=20=20=20IF=20(v_record.spm_host_id=20IS=20NOT=20NULL)=20THEN=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_record.spm_host_name=20:=3D=20=
vds_name=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vds_static=0A=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20=
v_record.spm_host_id;=0A=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_record.spm_host_name:=3D=20'';=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=20=20=20=20=20=20=20=20--=20get=20tasks=20count=20for=20=
this=20DC=0A=20=20=20=20=20=20=20=20v_record.task_count=20:=3D=20=
count(*)=0A=20=20=20=20=20=20=20=20FROM=20async_tasks=0A=20=20=20=20=20=20=
=20=20WHERE=20position(cast(v_record.dc_id=20AS=20VARCHAR)=20IN=20=
action_parameters)=20>=200;=0A=0A=20=20=20=20=20=20=20=20--=20return=20=
the=20record=0A=20=20=20=20=20=20=20=20RETURN=20NEXT=20v_record;=0A=0A=20=
=20=20=20=20=20=20=20FETCH=20v_tasks_cursor=0A=20=20=20=20INTO=20=
v_record.dc_id;=0A=0A=20=20=20=20END=20LOOP;=0A=0ACLOSE=20=
v_tasks_cursor;=0A=0A--=20return=20full=20set=20of=20generated=20records=0A=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_remove_csv_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_value=20VARCHAR(4000),=0A=20=20=20=20=
v_version=20VARCHAR(40)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v=20VARCHAR=20[];=0A=0Ae=20VARCHAR;=0A=0A=
v_result=20VARCHAR;=0A=0Av_sep=20VARCHAR(1);=0A=0ABEGIN=0A=20=20=20=20=
v_result=20:=3D=20'';=0A=0A=20=20=20=20v_sep=20:=3D=20'';=0A=0A=20=20=20=20=
v=20:=3D=20string_to_array(option_value,=20',')=0A=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20WHERE=20option_name=20=3D=20v_option_name=0A=20=
=20=20=20=20=20=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20FOR=0A=
=0A=20=20=20=20e=20IN=0A=0A=20=20=20=20SELECT=20unnest(v)=20LOOP=0A=0A=20=
=20=20=20IF=20(e=20!=3D=20v_value)=20THEN=20v_result=20:=3D=20v_result=20=
||=20v_sep=20||=20e;=0A=20=20=20=20=20=20=20=20v_sep=20:=3D=20',';=0A=20=20=
=20=20END=20IF;=0A=0AEND=0ALOOP;=0A=0A=20=20=20=20UPDATE=20vdc_options=0A=
=20=20=20=20SET=20option_value=20=3D=20v_result=0A=20=20=20=20WHERE=20=
option_name=20=3D=20v_option_name=0A=20=20=20=20=20=20=20=20AND=20=
version=20=3D=20v_version;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_remove_uuid_from_csv=20(=0A=20=20=20=20v_csv_text=20TEXT,=0A=20=20=20=
=20v_uuid=20uuid=0A=20=20=20=20)=0ARETURNS=20TEXT=20STABLE=20AS=20=
$PROCEDURE$=0ADECLARE=20v=20uuid=20[];=0A=0Ae=20uuid;=0A=0Av_result=20=
TEXT;=0A=0Av_sep=20VARCHAR(1);=0A=0ABEGIN=0A=20=20=20=20v_result=20:=3D=20=
'';=0A=0A=20=20=20=20v_sep=20:=3D=20'';=0A=0A=20=20=20=20v=20:=3D=20=
string_to_array(v_csv_text,=20',');=0A=20=20=20=20FOR=0A=0A=20=20=20=20e=20=
IN=0A=0A=20=20=20=20SELECT=20unnest(v)=20LOOP=0A=0A=20=20=20=20IF=20(e=20=
!=3D=20v_uuid)=20THEN=20v_result=20:=3D=20v_result=20||=20v_sep=20||=20=
e;=0A=20=20=20=20=20=20=20=20v_sep=20:=3D=20',';=0A=20=20=20=20END=20IF;=0A=
=0A=20=20=20=20END=20LOOP;=0A=0A=20=20=20=20IF=20(v_result=20=3D=20'')=20=
THEN=20v_result=20:=3D=20NULL;=0A=20=20=20=20END=20IF;=0A=20=20=20=20=
RETURN=20v_result;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_add_config_value_for_versions_up_to=20(=0A=20=20=20=20=
v_option_name=20VARCHAR(100),=0A=20=20=20=20v_val=20VARCHAR(4000),=0A=20=20=
=20=20v_version=20VARCHAR(40)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20i=20INT;=0A=0Aarr=20VARCHAR=20[]=20:=3D=20array=20=
['3.6',=20'4.0'];=0A=0ABEGIN=0A=20=20=20=20FOR=20i=20IN=20=
array_lower(arr,=201)..array_upper(arr,=201)=20LOOP=20PERFORM=20=
fn_db_add_config_value(v_option_name,=20v_val,=20arr=20[i]);=0A=20=20=20=20=
=20=20=20=20EXIT=20WHEN=20arr=20[i]=20=3D=20v_version;=0A=20=20=20=20END=20=
LOOP;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetCpuProfileByCpuProfileId=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
cpu_profiles=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20cpu_profiles=0A=20=
=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertCpuProfile=20=
(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_name=20VARCHAR(50),=0A=20=20=
=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_qos_id=20UUID,=0A=20=20=20=20=
v_description=20TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20cpu_profiles=20(=0A=20=20=20=20=20=20=
=20=20id,=0A=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20=
cluster_id,=0A=20=20=20=20=20=20=20=20qos_id,=0A=20=20=20=20=20=20=20=20=
description=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=
=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20v_name,=0A=20=20=20=20=20=
=20=20=20v_cluster_id,=0A=20=20=20=20=20=20=20=20v_qos_id,=0A=20=20=20=20=
=20=20=20=20v_description=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateCpuProfile=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_name=20=
VARCHAR(50),=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_qos_id=20=
UUID,=0A=20=20=20=20v_description=20TEXT=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20cpu_profiles=0A=20=
=20=20=20SET=20id=20=3D=20v_id,=0A=20=20=20=20=20=20=20=20name=20=3D=20=
v_name,=0A=20=20=20=20=20=20=20=20cluster_id=20=3D=20v_cluster_id,=0A=20=20=
=20=20=20=20=20=20qos_id=20=3D=20v_qos_id,=0A=20=20=20=20=20=20=20=20=
description=20=3D=20v_description,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteCpuProfile=20(v_id=20=
UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_val=20UUID;=0A=0A=
BEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20cpu_profiles=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0A=0A=20=20=20=20--=20Delete=20the=20cpu=20=
profiles=20permissions=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
permissions=0A=20=20=20=20WHERE=20object_id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromCpuProfiles=20()=0ARETURNS=20SETOF=20=
cpu_profiles=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20cpu_profiles;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetCpuProfilesByClusterId=20(=0A=20=20=20=20=
v_cluster_id=20UUID,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20=
v_is_filtered=20boolean,=0A=20=20=20=20v_action_group_id=20INTEGER=0A=20=20=
=20=20)=0ARETURNS=20SETOF=20cpu_profiles=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20cpu_profiles=0A=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20user_cpu_profile_permissions_view=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20NATURAL=20JOIN=20=
roles_groups=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
user_id=20IN=20(v_user_id,=20getGlobalIds('everyone'))=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20=
cpu_profiles.id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20action_group_id=20=3D=20v_action_group_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20ORDER=20BY=20_create_date;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetCpuProfilesByQosId=20(v_qos_id=20UUID)=0ARETURNS=20=
SETOF=20cpu_profiles=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
cpu_profiles=0A=20=20=20=20WHERE=20qos_id=20=3D=20v_qos_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Insertcustom_actions=20(=0A=20=20=20=20INOUT=20=
v_action_id=20INT,=0A=20=20=20=20v_action_name=20VARCHAR(50),=0A=20=20=20=
=20v_path=20VARCHAR(300),=0A=20=20=20=20v_tab=20INT,=0A=20=20=20=20=
v_description=20VARCHAR(4000)=0A=20=20=20=20)=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20INSERT=20INTO=20custom_actions=20(=0A=20=20=20=20=20=20=20=20=
action_name,=0A=20=20=20=20=20=20=20=20path,=0A=20=20=20=20=20=20=20=20=
tab,=0A=20=20=20=20=20=20=20=20description=0A=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_action_name,=0A=20=20=20=
=20=20=20=20=20v_path,=0A=20=20=20=20=20=20=20=20v_tab,=0A=20=20=20=20=20=
=20=20=20v_description=0A=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=
v_action_id=20:=3D=20CURRVAL('custom_actions_seq');=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Updatecustom_actions=20(=0A=20=20=20=20v_action_id=20INT,=0A=20=20=20=20=
v_action_name=20VARCHAR(50),=0A=20=20=20=20v_path=20VARCHAR(300),=0A=20=20=
=20=20v_tab=20INT,=0A=20=20=20=20v_description=20VARCHAR(4000)=0A=20=20=20=
=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20UPDATE=20custom_actions=0A=20=20=20=20SET=20=
action_name=20=3D=20v_action_name,=0A=20=20=20=20=20=20=20=20path=20=3D=20=
v_path,=0A=20=20=20=20=20=20=20=20tab=20=3D=20v_tab,=0A=20=20=20=20=20=20=
=20=20description=20=3D=20v_description=0A=20=20=20=20WHERE=20action_id=20=
=3D=20v_action_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Deletecustom_actions=20=
(v_action_id=20INT)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20DELETE=0A=20=20=20=20FROM=20custom_actions=0A=20=20=20=20WHERE=20=
action_id=20=3D=20v_action_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromcustom_actions=20=
()=0ARETURNS=20SETOF=20custom_actions=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20custom_actions;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getcustom_actionsByaction_id=20(v_action_id=20INT)=0ARETURNS=20SETOF=20=
custom_actions=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20custom_actions=0A=20=
=20=20=20WHERE=20action_id=20=3D=20v_action_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getcustom_actionsByTab_id=20(v_tab=20INT)=0ARETURNS=20SETOF=20=
custom_actions=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20custom_actions=0A=20=
=20=20=20WHERE=20tab=20=3D=20v_tab;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getcustom_actionsByNameAndTab=20(=0A=20=20=20=20v_action_name=20=
VARCHAR(50),=0A=20=20=20=20v_tab=20INT=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
custom_actions=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20custom_actions=0A=20=
=20=20=20WHERE=20tab=20=3D=20v_tab=0A=20=20=20=20=20=20=20=20AND=20=
action_name=20=3D=20v_action_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Insertdisk_image_dynamic=20(=0A=20=20=20=20v_image_id=20UUID,=0A=20=20=20=
=20v_read_rate=20INT,=0A=20=20=20=20v_write_rate=20INT,=0A=20=20=20=20=
v_actual_size=20BIGINT,=0A=20=20=20=20v_read_latency_seconds=20=
NUMERIC(18,=209),=0A=20=20=20=20v_write_latency_seconds=20NUMERIC(18,=20=
9),=0A=20=20=20=20v_flush_latency_seconds=20NUMERIC(18,=209)=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20disk_image_dynamic=20(=0A=20=20=20=20=20=20=20=20image_id,=0A=20=20=
=20=20=20=20=20=20read_rate,=0A=20=20=20=20=20=20=20=20write_rate,=0A=20=20=
=20=20=20=20=20=20actual_size,=0A=20=20=20=20=20=20=20=20=
read_latency_seconds,=0A=20=20=20=20=20=20=20=20write_latency_seconds,=0A=
=20=20=20=20=20=20=20=20flush_latency_seconds=0A=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_image_id,=0A=20=20=
=20=20=20=20=20=20v_read_rate,=0A=20=20=20=20=20=20=20=20v_write_rate,=0A=
=20=20=20=20=20=20=20=20v_actual_size,=0A=20=20=20=20=20=20=20=20=
v_read_latency_seconds,=0A=20=20=20=20=20=20=20=20=
v_write_latency_seconds,=0A=20=20=20=20=20=20=20=20=
v_flush_latency_seconds=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Updatedisk_image_dynamic=20(=0A=20=20=20=20v_image_id=20UUID,=0A=20=20=20=
=20v_read_rate=20INT,=0A=20=20=20=20v_write_rate=20INT,=0A=20=20=20=20=
v_actual_size=20BIGINT,=0A=20=20=20=20v_read_latency_seconds=20=
NUMERIC(18,=209),=0A=20=20=20=20v_write_latency_seconds=20NUMERIC(18,=20=
9),=0A=20=20=20=20v_flush_latency_seconds=20NUMERIC(18,=209)=0A=20=20=20=20=
)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20UPDATE=20disk_image_dynamic=0A=20=20=20=20SET=20read_rate=20=
=3D=20v_read_rate,=0A=20=20=20=20=20=20=20=20write_rate=20=3D=20=
v_write_rate,=0A=20=20=20=20=20=20=20=20actual_size=20=3D=20=
v_actual_size,=0A=20=20=20=20=20=20=20=20read_latency_seconds=20=3D=20=
v_read_latency_seconds,=0A=20=20=20=20=20=20=20=20write_latency_seconds=20=
=3D=20v_write_latency_seconds,=0A=20=20=20=20=20=20=20=20=
flush_latency_seconds=20=3D=20v_flush_latency_seconds,=0A=20=20=20=20=20=20=
=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20image_id=20=
=3D=20v_image_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Updatedisk_image_dynamic_by_disk_id_and_vm_id=20(=0A=20=20=20=20=
v_image_group_id=20UUID,=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20=
v_read_rate=20INT,=0A=20=20=20=20v_write_rate=20INT,=0A=20=20=20=20=
v_actual_size=20BIGINT,=0A=20=20=20=20v_read_latency_seconds=20=
NUMERIC(18,=209),=0A=20=20=20=20v_write_latency_seconds=20NUMERIC(18,=20=
9),=0A=20=20=20=20v_flush_latency_seconds=20NUMERIC(18,=209)=0A=20=20=20=20=
)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20UPDATE=20disk_image_dynamic=0A=20=20=20=20SET=20read_rate=20=
=3D=20v_read_rate,=0A=20=20=20=20=20=20=20=20write_rate=20=3D=20=
v_write_rate,=0A=20=20=20=20=20=20=20=20actual_size=20=3D=20=
v_actual_size,=0A=20=20=20=20=20=20=20=20read_latency_seconds=20=3D=20=
v_read_latency_seconds,=0A=20=20=20=20=20=20=20=20write_latency_seconds=20=
=3D=20v_write_latency_seconds,=0A=20=20=20=20=20=20=20=20=
flush_latency_seconds=20=3D=20v_flush_latency_seconds,=0A=20=20=20=20=20=20=
=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20image_id=20=
IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20DISTINCT=20=
image_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20images=0A=20=20=20=
=20=20=20=20=20=20=20=20=20WHERE=20image_group_id=20=3D=20=
v_image_group_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
active=20=3D=20true=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
=20=20=20=20AND=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vm_device=20vmd=0A=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vmd.vm_id=20=3D=20v_vm_id=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20vmd.device_id=20=3D=20=
v_image_group_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
vmd.snapshot_id=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Deletedisk_image_dynamic=20(v_image_id=20UUID)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20disk_image_dynamic=0A=20=20=20=20WHERE=20image_id=20=3D=20=
v_image_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromdisk_image_dynamic=20()=0ARETURNS=20SETOF=20disk_image_dynamic=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20disk_image_dynamic;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Getdisk_image_dynamicByimage_id=20(v_image_id=20=
UUID)=0ARETURNS=20SETOF=20disk_image_dynamic=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20disk_image_dynamic=0A=20=20=20=20WHERE=20image_id=20=3D=20=
v_image_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20TRIGGER=0AIF=20EXISTS=20=
delete_disk_image_dynamic_for_image=0A=20=20=20=20ON=20images;=0A=
**************************=0A=0ADROP=20TRIGGER=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20FUNCTION=20=
fn_image_deleted=20()=0A=20=20=20=20RETURNS=20TRIGGER=20AS=20$$=0A=0A=
BEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20disk_image_dynamic=20dim=0A=
=20=20=20=20WHERE=20DIM.image_id=20=3D=20OLD.image_guid;=0A=0A=20=20=20=20=
RETURN=20OLD;=0AEND;$$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20TRIGGER=20delete_disk_image_dynamic_for_image=20=
BEFORE=0ADELETE=0A=20=20=20=20ON=20IMAGES=0AFOR=20EACH=20ROW=0AEXECUTE=20=
PROCEDURE=20fn_image_deleted();=0A**************************=0A=0ACREATE=20=
TRIGGER=0A*********=20QUERY=20**********=0ACreate=20or=20replace=20=
FUNCTION=20GetImageByImageGuid(v_image_guid=20UUID)=0ARETURNS=20SETOF=20=
vm_images_view=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20=
=20RETURN=20QUERY=20SELECT=20*=0A=20=20=20=20=20FROM=20vm_images_view=0A=20=
=20=20=20=20WHERE=20image_guid=20=3D=20v_image_guid;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetAncestralImageByImageGuid(v_image_guid=20UUID,=20=
v_user_id=20UUID,=20v_is_filtered=20BOOLEAN)=0ARETURNS=20SETOF=20=
images_storage_domain_view=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=
=20=20=20=20=20RETURN=20QUERY=20WITH=20RECURSIVE=20=
ancestor_image(image_guid,=20parentid)=20AS=20(=0A=20=20=20=20=20=20=20=20=
=20SELECT=20image_guid,=20parentid=0A=20=20=20=20=20=20=20=20=20FROM=20=
images=0A=20=20=20=20=20=20=20=20=20WHERE=20image_guid=20=3D=20=
v_image_guid=0A=20=20=20=20=20=20=20=20=20UNION=20ALL=0A=20=20=20=20=20=20=
=20=20=20SELECT=20i.image_guid,=20i.parentid=0A=20=20=20=20=20=20=20=20=20=
FROM=20images=20i,=20ancestor_image=20ai=0A=20=20=20=20=20=20=20=20=20=
WHERE=20i.image_guid=20=3D=20ai.parentid=0A=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20SELECT=20i.*=0A=20=20=20=20=20=20FROM=20ancestor_image=20ai,=20=
images_storage_domain_view=20i=0A=20=20=20=20=20=20WHERE=20ai.parentid=20=
=3D=20'00000000-0000-0000-0000-000000000000'=20AND=0A=20=20=20=20=20=20=20=
=20=20=20=20=20ai.image_guid=20=3D=20i.image_guid=20AND=0A=20=20=20=20=20=
=20=20=20=20=20=20=20(NOT=20v_is_filtered=20OR=20EXISTS=20(SELECT=20=20=20=
=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=20=20=
=20=20=20user_disk_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20=20=20=20=20user_disk_permissions_view.user_id=20=
=3D=20v_user_id=20AND=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20user_disk_permissions_view.entity_id=20=3D=20=
i.image_group_id));=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetSnapshotByGuid(v_image_guid=20UUID)=0ARETURNS=20SETOF=20=
memory_and_disk_images_storage_domain_view=20STABLE=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=
=20=20=20FROM=20memory_and_disk_images_storage_domain_view=20=
memory_and_disk_images_storage_domain_view=0A=20=20=20=20=20WHERE=20=
image_guid=20=3D=20v_image_guid;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetSnapshotsByStorageDomainId(v_storage_domain_id=20UUID)=0ARETURNS=20=
SETOF=20images_storage_domain_view=20STABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=20=20=20FROM=20=
images_storage_domain_view=20images_storage_domain_view=0A=20=20=20=20=20=
WHERE=20storage_id=20=3D=20v_storage_domain_id;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetSnapshotByParentGuid(v_parent_guid=20UUID)=0ARETURNS=20SETOF=20=
images_storage_domain_view=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=
=20=20=20=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=20=20=20FROM=20=
images_storage_domain_view=20images_storage_domain_view=0A=20=20=20=20=20=
WHERE=20ParentId=20=3D=20v_parent_guid;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetSnapshotByLeafGuid(v_image_guid=20UUID)=0ARETURNS=20SETOF=20=
images_storage_domain_view=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=
=20=20=20=20=20RETURN=20QUERY=20WITH=20RECURSIVE=20image_list=20AS=20(=0A=
=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=
FROM=20=20=20images_storage_domain_view=0A=20=20=20=20=20=20=20=20=20=20=
WHERE=20=20image_guid=20=3D=20v_image_guid=0A=20=20=20=20=20=20=20=20=20=20=
UNION=20ALL=0A=20=20=20=20=20=20=20=20=20=20SELECT=20=
images_storage_domain_view.*=0A=20=20=20=20=20=20=20=20=20=20FROM=20=20=20=
images_storage_domain_view=0A=20=20=20=20=20=20=20=20=20=20JOIN=20=20=20=
image_list=20ON=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
image_list.parentid=20=3D=20images_storage_domain_view.image_guid=20AND=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
image_list.image_group_id=20=3D=20=
images_storage_domain_view.image_group_id=0A=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20SELECT=20*=0A=20=20=20=20=20=20FROM=20image_list;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetVmImageByImageGuid(v_image_guid=20UUID)=0A=
RETURNS=20SETOF=20vm_images_view=20STABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=20=20=20FROM=20=
vm_images_view=0A=20=20=20=20=20WHERE=20image_guid=20=3D=20v_image_guid;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetSnapshotsByVmSnapshotId(v_vm_snapshot_id=20UUID)=0A=
RETURNS=20SETOF=20images_storage_domain_view=20STABLE=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=
=20=20=20FROM=20images_storage_domain_view=20images_storage_domain_view=0A=
=20=20=20=20=20WHERE=20vm_snapshot_id=20=3D=20v_vm_snapshot_id;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetAttachedDiskSnapshotsToVm(v_vm_guid=20UUID,=20=
v_is_plugged=20BOOLEAN)=0ARETURNS=20SETOF=20images_storage_domain_view=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20=20RETURN=20QUERY=20=
SELECT=20images_storage_domain_view.*=0A=20=20=20=20=20FROM=20=
images_storage_domain_view=0A=20=20=20=20=20JOIN=20vm_device=20ON=20=
vm_device.device_id=20=3D=20images_storage_domain_view.disk_id=0A=20=20=20=
=20=20WHERE=20vm_device.vm_id=20=3D=20v_vm_guid=20AND=20(v_is_plugged=20=
IS=20NULL=20OR=20vm_device.is_plugged=20=3D=20v_is_plugged)=0A=20=20=20=20=
=20=20=20=20=20=20AND=20vm_device.snapshot_id=20IS=20NOT=20NULL=0A=20=20=20=
=20=20=20=20=20=20=20AND=20vm_device.snapshot_id=20=3D=20=
images_storage_domain_view.vm_snapshot_id;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetSnapshotsByImageGroupId(v_image_group_id=20UUID)=0ARETURNS=20SETOF=20=
images_storage_domain_view=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=
=20=20=20=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=20=20=20FROM=20=
images_storage_domain_view=20images_storage_domain_view=0A=20=20=20=20=20=
WHERE=20image_group_id=20=3D=20v_image_group_id;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetDiskSnapshotForVmSnapshot(v_image_group_id=20UUID,=20v_vm_snapshot_id=20=
UUID)=0ARETURNS=20SETOF=20images_storage_domain_view=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=
=20=20=20FROM=20images_storage_domain_view=0A=20=20=20=20=20WHERE=20=
image_group_id=20=3D=20v_image_group_id=0A=20=20=20=20=20=20=20=20=20AND=20=
vm_snapshot_id=20=3D=20v_vm_snapshot_id;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetAllForStorageDomain(v_storage_domain_id=20UUID)=0ARETURNS=20SETOF=20=
images_storage_domain_view=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=
=20=20=20=20=20RETURN=20QUERY=20SELECT=20images_storage_domain_view.*=0A=20=
=20=20=20=20FROM=20=20images_storage_domain_view=0A=20=20=20=20=20WHERE=20=
active=20AND=20images_storage_domain_view.storage_id=20=3D=20=
v_storage_domain_id;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetImagesWhichHaveNoDisk(v_vm_id=20UUID)=0ARETURNS=20SETOF=20=
images_storage_domain_view=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=
=20=20=20=20=20RETURN=20QUERY=20SELECT=20i.*=0A=20=20=20=20=20FROM=20=20=20=
images_storage_domain_view=20i=0A=20=20=20=20=20JOIN=20=20=20snapshots=20=
s=20ON=20(i.vm_snapshot_id=20=3D=20s.snapshot_id)=0A=20=20=20=20=20WHERE=20=
=20s.vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20AND=20NOT=20EXISTS=20(=0A=20=20=
=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20FROM=20=20=20=
base_disks=20d=0A=20=20=20=20=20=20=20=20=20WHERE=20=20d.disk_id=20=3D=20=
i.image_group_id);=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllForDiskProfiles(v_disk_profile_ids=20UUID[])=0ARETURNS=20SETOF=20=
images_storage_domain_view=20STABLE=0AAS=20$procedure$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=20SELECT=20images_storage_domain_view.*=0A=20=20=20=20=20=
=20=20=20FROM=20images_storage_domain_view=0A=20=20=20=20=20=20=20=20=
WHERE=20images_storage_domain_view.disk_profile_id=20=3D=20=
ANY(v_disk_profile_ids);=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertDiskLunMap=20(=0A=20=
=20=20=20v_disk_id=20UUID,=0A=20=20=20=20v_lun_id=20VARCHAR(50)=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20disk_lun_map=20(=0A=20=20=20=20=20=20=20=20disk_id,=0A=20=20=20=20=
=20=20=20=20lun_id=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=
=20=20=20=20=20=20=20=20v_disk_id,=0A=20=20=20=20=20=20=20=20v_lun_id=0A=20=
=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteDiskLunMap=20(=0A=20=
=20=20=20v_disk_id=20UUID,=0A=20=20=20=20v_lun_id=20VARCHAR(50)=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=
=20=20=20FROM=20disk_lun_map=0A=20=20=20=20WHERE=20disk_id=20=3D=20=
v_disk_id=0A=20=20=20=20=20=20=20=20AND=20lun_id=20=3D=20v_lun_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromDiskLunMaps=20()=0ARETURNS=20SETOF=20=
disk_lun_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20disk_lun_map;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetDiskLunMapByDiskLunMapId=20(=0A=20=20=20=20=
v_disk_id=20UUID,=0A=20=20=20=20v_lun_id=20VARCHAR(50)=0A=20=20=20=20)=0A=
RETURNS=20SETOF=20disk_lun_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
disk_lun_map=0A=20=20=20=20WHERE=20disk_id=20=3D=20v_disk_id=0A=20=20=20=20=
=20=20=20=20AND=20lun_id=20=3D=20v_lun_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetDiskLunMapByLunId=20(v_lun_id=20VARCHAR(50))=0ARETURNS=20SETOF=20=
disk_lun_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20disk_lun_map=0A=20=
=20=20=20WHERE=20lun_id=20=3D=20v_lun_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetDiskProfileByDiskProfileId=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
disk_profiles=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20disk_profiles=0A=20=
=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertDiskProfile=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_name=20=
VARCHAR(50),=0A=20=20=20=20v_storage_domain_id=20UUID,=0A=20=20=20=20=
v_qos_id=20UUID,=0A=20=20=20=20v_description=20TEXT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
disk_profiles=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20=
name,=0A=20=20=20=20=20=20=20=20storage_domain_id,=0A=20=20=20=20=20=20=20=
=20qos_id,=0A=20=20=20=20=20=20=20=20description=0A=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=
=20=20=20=20v_name,=0A=20=20=20=20=20=20=20=20v_storage_domain_id,=0A=20=20=
=20=20=20=20=20=20v_qos_id,=0A=20=20=20=20=20=20=20=20v_description=0A=20=
=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateDiskProfile=20(=0A=20=
=20=20=20v_id=20UUID,=0A=20=20=20=20v_name=20VARCHAR(50),=0A=20=20=20=20=
v_storage_domain_id=20UUID,=0A=20=20=20=20v_qos_id=20UUID,=0A=20=20=20=20=
v_description=20TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20UPDATE=20disk_profiles=0A=20=20=20=20SET=20id=20=3D=20=
v_id,=0A=20=20=20=20=20=20=20=20name=20=3D=20v_name,=0A=20=20=20=20=20=20=
=20=20storage_domain_id=20=3D=20v_storage_domain_id,=0A=20=20=20=20=20=20=
=20=20qos_id=20=3D=20v_qos_id,=0A=20=20=20=20=20=20=20=20description=20=3D=
=20v_description,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteDiskProfile=20(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
DECLARE=20v_val=20UUID;=0A=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20=
FROM=20disk_profiles=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=0A=20=20=20=
=20--=20Delete=20the=20disk=20profiles=20permissions=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20permissions=0A=20=20=20=20WHERE=20object_id=20=
=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromDiskProfiles=20=
()=0ARETURNS=20SETOF=20disk_profiles=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20disk_profiles;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetDiskProfilesByStorageDomainId=20(=0A=20=20=20=20v_storage_domain_id=20=
UUID,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20=
boolean=0A=20=20=20=20)=0ARETURNS=20SETOF=20disk_profiles=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20disk_profiles=0A=20=20=20=20WHERE=20=
storage_domain_id=20=3D=20v_storage_domain_id=0A=20=20=20=20=20=20=20=20=
AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=
=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20user_disk_profile_permissions_view=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20=
disk_profiles.id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
nullifyQosForStorageDomain=20(v_storage_domain_id=20UUID)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20disk_profiles=0A=20=
=20=20=20SET=20qos_id=20=3D=20NULL=0A=20=20=20=20WHERE=20=
storage_domain_id=20=3D=20v_storage_domain_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetDiskProfilesByQosId=20(v_qos_id=20UUID)=0ARETURNS=20SETOF=20=
disk_profiles=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20disk_profiles=0A=20=
=20=20=20WHERE=20qos_id=20=3D=20v_qos_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
InsertDiskVmElement(=0A=20=20=20=20v_disk_id=20UUID,=0A=20=20=20=20=
v_vm_id=20UUID,=0A=20=20=20=20v_is_boot=20boolean,=0A=20=20=20=20=
v_disk_interface=20VARCHAR(32))=0ARETURNS=20VOID=0AAS=20$procedure$=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20disk_vm_element=20(=0A=20=20=20=20=20=
=20=20=20disk_id,=0A=20=20=20=20=20=20=20=20vm_id,=0A=20=20=20=20=20=20=20=
=20is_boot,=0A=20=20=20=20=20=20=20=20disk_interface)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_disk_id,=0A=20=20=20=20=20=20=20=20=
v_vm_id,=0A=20=20=20=20=20=20=20=20v_is_boot,=0A=20=20=20=20=20=20=20=20=
v_disk_interface);=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateDiskVmElement(=0A=20=
=20=20=20v_disk_id=20UUID,=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20=
v_is_boot=20boolean,=0A=20=20=20=20v_disk_interface=20VARCHAR(32))=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
disk_vm_element=0A=20=20=20=20SET=20disk_id=20=3D=20v_disk_id,=0A=20=20=20=
=20=20=20=20=20vm_id=20=3D=20v_vm_id,=0A=20=20=20=20=20=20=20=20is_boot=20=
=3D=20v_is_boot,=0A=20=20=20=20=20=20=20=20disk_interface=20=3D=20=
v_disk_interface=0A=20=20=20=20WHERE=20disk_id=20=3D=20v_disk_id=0A=20=20=
=20=20=20=20=20=20AND=20vm_id=20=3D=20v_vm_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteDiskVmElement(=0A=20=20=20=20v_disk_id=20UUID,=0A=20=20=20=20=
v_vm_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20disk_vm_element=0A=20=20=20=20WHERE=20=
disk_id=20=3D=20v_disk_id=0A=20=20=20=20=20=20=20=20AND=20vm_id=20=3D=20=
v_vm_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromDiskVmElement()=0ARETURNS=20SETOF=20disk_vm_element_extended=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=20=20=20=
=20SELECT=20*=0A=20=20=20=20FROM=20disk_vm_element_extended;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetDiskVmElementByDiskVmElementId(=0A=20=20=20=20=
v_disk_id=20UUID,=0A=20=20=20=20v_vm_id=20UUID)=0ARETURNS=20SETOF=20=
disk_vm_element_extended=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
disk_vm_element_extended=0A=20=20=20=20WHERE=20disk_id=20=3D=20v_disk_id=0A=
=20=20=20=20=20=20=20=20AND=20vm_id=20=3D=20v_vm_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetDiskVmElementsForVm(=0A=20=20=20=20v_vm_id=20UUID)=0ARETURNS=20SETOF=20=
disk_vm_element_extended=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
disk_vm_element_extended=0A=20=20=20=20WHERE=20vm_id=20=3D=20v_vm_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetDiskVmElementsPluggedToVm(=0A=20=20=20=20v_vm_id=20=
UUID)=0ARETURNS=20SETOF=20disk_vm_element_extended=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20disk_vm_element_extended=0A=20=20=20=20WHERE=20=
vm_id=20=3D=20v_vm_id=20AND=20is_plugged=20=3D=20true;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateDwhHistoryTimekeeping=20(=0A=20=20=20=20v_var_name=20VARCHAR(50),=0A=
=20=20=20=20v_var_value=20VARCHAR(255),=0A=20=20=20=20v_var_datetime=20=
TIMESTAMP=20WITH=20TIME=20ZONE=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20dwh_history_timekeeping=0A=20=20=
=20=20SET=20var_value=20=3D=20v_var_value,=0A=20=20=20=20=20=20=20=20=
var_datetime=20=3D=20v_var_datetime=0A=20=20=20=20WHERE=20var_name=20=3D=20=
v_var_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetDwhHistoryTimekeepingByVarName=20(v_var_name=20VARCHAR(50))=0ARETURNS=20=
SETOF=20dwh_history_timekeeping=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
dwh_history_timekeeping=0A=20=20=20=20WHERE=20var_name=20=3D=20=
v_var_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20clear_osinfo=20()=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20TRUNCATE=20=
dwh_osinfo;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20insert_osinfo=20(=0A=20=20=
=20=20v_os_id=20INT,=0A=20=20=20=20v_os_name=20VARCHAR(255)=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20dwh_osinfo=20(=0A=20=20=20=20=20=20=20=20os_id,=0A=20=20=20=20=20=20=
=20=20os_name=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=
=20=20=20=20=20=20v_os_id,=0A=20=20=20=20=20=20=20=20v_os_name=0A=20=20=20=
=20=20=20=20=20);=0A=0A=20=20=20=20UPDATE=20dwh_history_timekeeping=0A=20=
=20=20=20SET=20var_datetime=20=3D=20now()=0A=20=20=20=20WHERE=20var_name=20=
=3D=20'lastOsinfoUpdate';=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20LogEngineBackupEvent=20(=0A=
=20=20=20=20v_scope=20VARCHAR(64),=0A=20=20=20=20v_done_at=20TIMESTAMP=20=
WITH=20TIME=20ZONE,=0A=20=20=20=20v_status=20INT,=0A=20=20=20=20=
v_output_message=20TEXT,=0A=20=20=20=20v_fqdn=20VARCHAR(255),=0A=20=20=20=
=20v_log_path=20TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20IF=20v_status=20=3D=20-=201=20THEN=0A=20=20=20=20=20=20=
=20=20INSERT=20INTO=20engine_backup_log=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20scope,=0A=20=20=20=20=20=20=20=20=20=20=20=20done_at,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20is_passed,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20output_message,=0A=20=20=20=20=20=20=20=20=20=20=20=20fqdn,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20log_path=0A=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20v_scope,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_done_at,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20false,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_output_message,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_fqdn,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_log_path=0A=20=20=20=20=20=20=20=20=20=20=20=
=20);=0A=0A=20=20=20=20INSERT=20INTO=20audit_log=20(=0A=20=20=20=20=20=20=
=20=20log_time,=0A=20=20=20=20=20=20=20=20log_type_name,=0A=20=20=20=20=20=
=20=20=20log_type,=0A=20=20=20=20=20=20=20=20severity,=0A=20=20=20=20=20=20=
=20=20message=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=
=20=20=20=20=20=20v_done_at,=0A=20=20=20=20=20=20=20=20=
'ENGINE_BACKUP_FAILED',=0A=20=20=20=20=20=20=20=209026,=0A=20=20=20=20=20=
=20=20=202,=0A=20=20=20=20=20=20=20=20v_output_message=0A=20=20=20=20=20=20=
=20=20);=0A=0A=20=20=20=20ELSIF=20v_status=20=3D=200=20THEN=0A=0A=20=20=20=
=20INSERT=20INTO=20audit_log=20(=0A=20=20=20=20=20=20=20=20log_time,=0A=20=
=20=20=20=20=20=20=20log_type_name,=0A=20=20=20=20=20=20=20=20log_type,=0A=
=20=20=20=20=20=20=20=20severity,=0A=20=20=20=20=20=20=20=20message=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_done_at,=0A=20=20=20=20=20=20=20=20'ENGINE_BACKUP_STARTED',=0A=20=20=20=
=20=20=20=20=209024,=0A=20=20=20=20=20=20=20=200,=0A=20=20=20=20=20=20=20=
=20v_output_message=0A=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20ELSIF=20=
v_status=20=3D=201=20THEN=0A=0A=20=20=20=20INSERT=20INTO=20=
engine_backup_log=20(=0A=20=20=20=20=20=20=20=20scope,=0A=20=20=20=20=20=20=
=20=20done_at,=0A=20=20=20=20=20=20=20=20is_passed,=0A=20=20=20=20=20=20=20=
=20output_message,=0A=20=20=20=20=20=20=20=20fqdn,=0A=20=20=20=20=20=20=20=
=20log_path=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=
=20=20=20=20=20=20v_scope,=0A=20=20=20=20=20=20=20=20v_done_at,=0A=20=20=20=
=20=20=20=20=20true,=0A=20=20=20=20=20=20=20=20v_output_message,=0A=20=20=
=20=20=20=20=20=20v_fqdn,=0A=20=20=20=20=20=20=20=20v_log_path=0A=20=20=20=
=20=20=20=20=20);=0A=0A=20=20=20=20--=20Clean=20alerts=0A=20=20=20=20=
PERFORM=20DeleteBackupRelatedAlerts();=0A=0A=20=20=20=20INSERT=20INTO=20=
audit_log=20(=0A=20=20=20=20=20=20=20=20log_time,=0A=20=20=20=20=20=20=20=
=20log_type_name,=0A=20=20=20=20=20=20=20=20log_type,=0A=20=20=20=20=20=20=
=20=20severity,=0A=20=20=20=20=20=20=20=20message=0A=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_done_at,=0A=20=20=
=20=20=20=20=20=20'ENGINE_BACKUP_COMPLETED',=0A=20=20=20=20=20=20=20=20=
9025,=0A=20=20=20=20=20=20=20=200,=0A=20=20=20=20=20=20=20=20=
v_output_message=0A=20=20=20=20=20=20=20=20);=0A=20=20=20=20END=20IF;=0A=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetLastSuccessfulEngineBackup=20(v_scope=20=
VARCHAR(64))=0ARETURNS=20SETOF=20engine_backup_log=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20engine_backup_log=0A=20=20=20=20WHERE=20scope=20=3D=
=20v_scope=0A=20=20=20=20=20=20=20=20AND=20is_passed=0A=20=20=20=20ORDER=20=
BY=20scope,=0A=20=20=20=20=20=20=20=20done_at=20DESC=20LIMIT=201;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertEngineSession=20(=0A=20=20=20=20INOUT=20v_id=20=
INT,=0A=20=20=20=20v_engine_session_id=20TEXT,=0A=20=20=20=20v_user_id=20=
UUID,=0A=20=20=20=20v_user_name=20VARCHAR(255),=0A=20=20=20=20=
v_authz_name=20VARCHAR(255),=0A=20=20=20=20v_source_ip=20VARCHAR(50),=0A=20=
=20=20=20v_group_ids=20VARCHAR(2048),=0A=20=20=20=20v_role_ids=20=
VARCHAR(2048)=0A=20=20=20=20)=0ARETURNS=20INT=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20INSERT=20INTO=20engine_sessions=20(=0A=20=20=20=20=20=20=20=20=
engine_session_id,=0A=20=20=20=20=20=20=20=20user_id,=0A=20=20=20=20=20=20=
=20=20user_name,=0A=20=20=20=20=20=20=20=20authz_name,=0A=20=20=20=20=20=20=
=20=20source_ip,=0A=20=20=20=20=20=20=20=20group_ids,=0A=20=20=20=20=20=20=
=20=20role_ids=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=
=20=20=20=20=20=20=20v_engine_session_id,=0A=20=20=20=20=20=20=20=20=
v_user_id,=0A=20=20=20=20=20=20=20=20v_user_name,=0A=20=20=20=20=20=20=20=
=20v_authz_name,=0A=20=20=20=20=20=20=20=20v_source_ip,=0A=20=20=20=20=20=
=20=20=20v_group_ids,=0A=20=20=20=20=20=20=20=20v_role_ids=0A=20=20=20=20=
=20=20=20=20);=0A=0A=20=20=20=20v_id=20:=3D=20=
CURRVAL('engine_session_seq');=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetEngineSession=20(v_id=20=
INT)=0ARETURNS=20SETOF=20engine_sessions=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20engine_sessions=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetEngineSessionBySessionId=20(v_engine_session_id=20=
TEXT)=0ARETURNS=20SETOF=20engine_sessions=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20engine_sessions=0A=20=20=20=20WHERE=20engine_session_id=20=3D=20=
v_engine_session_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteEngineSession=20=
(v_id=20INT)=0ARETURNS=20INT=20AS=20$PROCEDURE$=0ADECLARE=20deleted_rows=20=
INT;=0A=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
engine_sessions=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=0A=20=20=20=20=
GET=20DIAGNOSTICS=20deleted_rows=20=3D=20ROW_COUNT;=0A=0A=20=20=20=20=
RETURN=20deleted_rows;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteAllFromEngineSessions=20()=0ARETURNS=20INT=20AS=20$PROCEDURE$=0A=
DECLARE=20deleted_rows=20INT;=0A=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20engine_sessions;=0A=0A=20=20=20=20GET=20DIAGNOSTICS=20=
deleted_rows=20=3D=20ROW_COUNT;=0A=0A=20=20=20=20RETURN=20deleted_rows;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20insertevent_notification_hist=20(=0A=20=20=20=20=
v_audit_log_id=20BIGINT,=0A=20=20=20=20v_event_name=20VARCHAR(100),=0A=20=
=20=20=20v_method_type=20CHAR(10),=0A=20=20=20=20v_reason=20CHAR(255),=0A=
=20=20=20=20v_sent_at=20TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20=
v_status=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20event_notification_hist=20(=0A=20=20=20=
=20=20=20=20=20audit_log_id,=0A=20=20=20=20=20=20=20=20event_name,=0A=20=20=
=20=20=20=20=20=20method_type,=0A=20=20=20=20=20=20=20=20reason,=0A=20=20=
=20=20=20=20=20=20sent_at,=0A=20=20=20=20=20=20=20=20status=0A=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_audit_log_id,=0A=20=20=20=20=20=20=20=20v_event_name,=0A=20=20=20=20=20=
=20=20=20v_method_type,=0A=20=20=20=20=20=20=20=20v_reason,=0A=20=20=20=20=
=20=20=20=20v_sent_at,=0A=20=20=20=20=20=20=20=20v_status=0A=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Insertevent_subscriber=20=
(=0A=20=20=20=20v_event_up_name=20VARCHAR(100),=0A=20=20=20=20=
v_notification_method=20VARCHAR(32),=0A=20=20=20=20v_method_address=20=
VARCHAR(255),=0A=20=20=20=20v_subscriber_id=20UUID,=0A=20=20=20=20=
v_tag_name=20VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20event_subscriber=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
subscriber_id=20=3D=20v_subscriber_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20event_up_name=20=3D=20v_event_up_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20notification_method=20=3D=20=
v_notification_method=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20tag_name=20=3D=20v_tag_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=0A=20=20=20=20=20=20=20=20INSERT=20INTO=20event_subscriber=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20event_up_name,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20notification_method,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
method_address,=0A=20=20=20=20=20=20=20=20=20=20=20=20subscriber_id,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20tag_name=0A=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_event_up_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_notification_method,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_method_address,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_subscriber_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_tag_name=0A=20=20=20=20=20=20=20=20=
=20=20=20=20);=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getevent_subscriberBysubscriber_id=20(v_subscriber_id=20UUID)=0ARETURNS=20=
SETOF=20event_subscriber=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
event_subscriber=0A=20=20=20=20WHERE=20subscriber_id=20=3D=20=
v_subscriber_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Deleteevent_subscriber=20=
(=0A=20=20=20=20v_event_up_name=20VARCHAR(100),=0A=20=20=20=20=
v_notification_method=20VARCHAR(32),=0A=20=20=20=20v_subscriber_id=20=
UUID,=0A=20=20=20=20v_tag_name=20VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(v_tag_name=20IS=20=
NULL)=20THEN=0A=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=20=
FROM=20event_subscriber=0A=20=20=20=20=20=20=20=20WHERE=20event_up_name=20=
=3D=20v_event_up_name=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
notification_method=20=3D=20v_notification_method=0A=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20subscriber_id=20=3D=20v_subscriber_id;=0A=20=20=20=20=
ELSE=0A=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=20FROM=20=
event_subscriber=0A=20=20=20=20=20=20=20=20WHERE=20event_up_name=20=3D=20=
v_event_up_name=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
notification_method=20=3D=20v_notification_method=0A=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20subscriber_id=20=3D=20v_subscriber_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20tag_name=20=3D=20v_tag_name;=0A=20=20=20=20=
END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Deleteevent_notification_hist=20(v_sent_at=20TIMESTAMP)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
event_notification_hist=0A=20=20=20=20WHERE=20sent_at=20<=20v_sent_at;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertExternalVariable=20(=0A=20=20=20=20v_var_name=20=
VARCHAR(100),=0A=20=20=20=20v_var_value=20VARCHAR(4000)=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
external_variable=20(=0A=20=20=20=20=20=20=20=20var_name,=0A=20=20=20=20=20=
=20=20=20var_value=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=
=20=20=20=20=20=20=20=20v_var_name,=0A=20=20=20=20=20=20=20=20=
v_var_value=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateExternalVariable=20(=0A=20=20=20=20v_var_name=20VARCHAR(100),=0A=20=
=20=20=20v_var_value=20VARCHAR(4000)=0A=20=20=20=20)=0ARETURNS=20BOOLEAN=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20external_variable=0A=20=20=
=20=20SET=20var_value=20=3D=20v_var_value,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20var_name=20=3D=20=
v_var_name;=0A=0A=20=20=20=20RETURN=20found;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpsertExternalVariable=20(=0A=20=20=20=20v_var_name=20VARCHAR(100),=0A=20=
=20=20=20v_var_value=20VARCHAR(4000)=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ADECLARE=20record_found=20BOOLEAN;=0A=0ABEGIN=0A=20=20=20=
=20SELECT=20UpdateExternalVariable(v_var_name,=20v_var_value)=0A=20=20=20=
=20INTO=20record_found;=0A=0A=20=20=20=20IF=20NOT=20record_found=20THEN=0A=
=20=20=20=20=20=20=20=20PERFORM=20InsertExternalVariable(v_var_name,=20=
v_var_value);=0A=20=20=20=20END=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteExternalVariable=20(v_var_name=20VARCHAR(100))=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
external_variable=0A=20=20=20=20WHERE=20var_name=20=3D=20v_var_name;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetExternalVariableByName=20(v_var_name=20=
VARCHAR(100))=0ARETURNS=20SETOF=20external_variable=20STABLE=0AAS=20=
$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20external_variable.*=0A=20=20=20=20FROM=20external_variable=0A=20=
=20=20=20WHERE=20var_name=20=3D=20v_var_name;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetFenceAgentsByVdsId=20(v_vds_guid=20UUID)=0ARETURNS=20SETOF=20=
fence_agents=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20fence_agents.*=0A=20=20=20=20FROM=20=
fence_agents=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_guid;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetFenceAgentById=20(v_guid=20UUID)=0ARETURNS=20=
SETOF=20fence_agents=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20fence_agents.*=0A=20=20=20=20=
FROM=20fence_agents=0A=20=20=20=20WHERE=20id=20=3D=20v_guid;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteFenceAgent=20(v_guid=20UUID)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
fence_agents=0A=20=20=20=20WHERE=20id=20=3D=20v_guid;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteFenceAgentsByVdsId=20(v_vds_guid=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
fence_agents=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_guid;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateFenceAgent=20(=0A=20=20=20=20v_guid=20UUID,=0A=
=20=20=20=20v_vds_id=20UUID,=0A=20=20=20=20v_agent_order=20INT,=0A=20=20=20=
=20v_ip=20VARCHAR(255),=0A=20=20=20=20v_type=20VARCHAR(255),=0A=20=20=20=20=
v_agent_user=20VARCHAR(255),=0A=20=20=20=20v_agent_password=20TEXT,=0A=20=
=20=20=20v_options=20TEXT,=0A=20=20=20=20v_encrypt_options=20BOOLEAN,=0A=20=
=20=20=20v_port=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20fence_agents=0A=20=20=20=20=
SET=20vds_id=20=3D=20v_vds_id,=0A=20=20=20=20=20=20=20=20agent_order=20=3D=
=20v_agent_order,=0A=20=20=20=20=20=20=20=20ip=20=3D=20v_ip,=0A=20=20=20=20=
=20=20=20=20type=20=3D=20v_type,=0A=20=20=20=20=20=20=20=20agent_user=20=
=3D=20v_agent_user,=0A=20=20=20=20=20=20=20=20agent_password=20=3D=20=
v_agent_password,=0A=20=20=20=20=20=20=20=20port=20=3D=20v_port,=0A=20=20=
=20=20=20=20=20=20options=20=3D=20v_options,=0A=20=20=20=20=20=20=20=20=
encrypt_options=20=3D=20v_encrypt_options=0A=20=20=20=20WHERE=20id=20=3D=20=
v_guid;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertFenceAgent=20(=0A=20=
=20=20=20v_id=20UUID,=0A=20=20=20=20v_vds_id=20UUID,=0A=20=20=20=20=
v_agent_order=20INT,=0A=20=20=20=20v_ip=20VARCHAR(255),=0A=20=20=20=20=
v_type=20VARCHAR(255),=0A=20=20=20=20v_agent_user=20VARCHAR(255),=0A=20=20=
=20=20v_agent_password=20TEXT,=0A=20=20=20=20v_options=20TEXT,=0A=20=20=20=
=20v_encrypt_options=20BOOLEAN,=0A=20=20=20=20v_port=20INT=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20fence_agents=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=
=20=20vds_id,=0A=20=20=20=20=20=20=20=20agent_order,=0A=20=20=20=20=20=20=
=20=20ip,=0A=20=20=20=20=20=20=20=20type,=0A=20=20=20=20=20=20=20=20=
agent_user,=0A=20=20=20=20=20=20=20=20agent_password,=0A=20=20=20=20=20=20=
=20=20options,=0A=20=20=20=20=20=20=20=20encrypt_options,=0A=20=20=20=20=20=
=20=20=20port=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=
=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20v_vds_id,=0A=20=20=20=20=
=20=20=20=20v_agent_order,=0A=20=20=20=20=20=20=20=20v_ip,=0A=20=20=20=20=
=20=20=20=20v_type,=0A=20=20=20=20=20=20=20=20v_agent_user,=0A=20=20=20=20=
=20=20=20=20v_agent_password,=0A=20=20=20=20=20=20=20=20v_options,=0A=20=20=
=20=20=20=20=20=20v_encrypt_options,=0A=20=20=20=20=20=20=20=20v_port=0A=20=
=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A/*=20=
----------------------------------------------------------------=0A=20=
Stored=20procedures=20for=20database=20operations=20on=20Gluster=20=
Geo-replication=0A=20related=20tables:=0A=20=20=20=20=20=20-=20=
gluster_georep_session=0A=20=20=20=20=20=20-=20gluster_georep_config=0A=20=
=20=20=20=20=20-=20gluster_georep_session_details=0A=
----------------------------------------------------------------*/=0A=
CREATE=20OR=20REPLACE=20FUNCTION=20InsertGlusterGeoRepSession=20(=0A=20=20=
=20=20v_session_id=20UUID,=0A=20=20=20=20v_master_volume_id=20UUID,=0A=20=
=20=20=20v_session_key=20VARCHAR(150),=0A=20=20=20=20v_slave_host_name=20=
VARCHAR(50),=0A=20=20=20=20v_slave_host_uuid=20UUID,=0A=20=20=20=20=
v_slave_volume_name=20VARCHAR(50),=0A=20=20=20=20v_slave_volume_id=20=
UUID,=0A=20=20=20=20v_status=20VARCHAR(50),=0A=20=20=20=20v_user_name=20=
VARCHAR(255)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20INSERT=20INTO=20gluster_georep_session=20(=0A=20=20=20=20=20=20=
=20=20session_id,=0A=20=20=20=20=20=20=20=20master_volume_id,=0A=20=20=20=
=20=20=20=20=20session_key,=0A=20=20=20=20=20=20=20=20slave_host_name,=0A=
=20=20=20=20=20=20=20=20slave_host_uuid,=0A=20=20=20=20=20=20=20=20=
slave_volume_name,=0A=20=20=20=20=20=20=20=20slave_volume_id,=0A=20=20=20=
=20=20=20=20=20status,=0A=20=20=20=20=20=20=20=20user_name=0A=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_session_id,=0A=20=20=20=20=20=20=20=20v_master_volume_id,=0A=20=20=20=20=
=20=20=20=20v_session_key,=0A=20=20=20=20=20=20=20=20v_slave_host_name,=0A=
=20=20=20=20=20=20=20=20v_slave_host_uuid,=0A=20=20=20=20=20=20=20=20=
v_slave_volume_name,=0A=20=20=20=20=20=20=20=20v_slave_volume_id,=0A=20=20=
=20=20=20=20=20=20v_status,=0A=20=20=20=20=20=20=20=20v_user_name=0A=20=20=
=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertGlusterGeoRepSessionConfig=20(=0A=20=20=20=20v_session_id=20UUID,=0A=
=20=20=20=20v_config_key=20VARCHAR(50),=0A=20=20=20=20v_config_value=20=
VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20INSERT=20INTO=20gluster_georep_config=20(=0A=20=20=20=20=20=20=
=20=20session_id,=0A=20=20=20=20=20=20=20=20config_key,=0A=20=20=20=20=20=
=20=20=20config_value=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20=
(=0A=20=20=20=20=20=20=20=20v_session_id,=0A=20=20=20=20=20=20=20=20=
v_config_key,=0A=20=20=20=20=20=20=20=20v_config_value=0A=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertGlusterGeoRepSessionDetail=20(=0A=20=20=20=20v_session_id=20UUID,=0A=
=20=20=20=20v_master_brick_id=20UUID,=0A=20=20=20=20v_slave_host_name=20=
VARCHAR(50),=0A=20=20=20=20v_slave_host_uuid=20UUID,=0A=20=20=20=20=
v_status=20VARCHAR(20),=0A=20=20=20=20v_checkpoint_status=20VARCHAR(20),=0A=
=20=20=20=20v_crawl_status=20VARCHAR(20),=0A=20=20=20=20v_data_pending=20=
BIGINT,=0A=20=20=20=20v_entry_pending=20BIGINT,=0A=20=20=20=20=
v_meta_pending=20BIGINT,=0A=20=20=20=20v_failures=20BIGINT,=0A=20=20=20=20=
v_last_synced_at=20TIMESTAMP,=0A=20=20=20=20v_checkpoint_time=20=
TIMESTAMP,=0A=20=20=20=20v_checkpoint_completed_time=20TIMESTAMP,=0A=20=20=
=20=20v_is_checkpoint_completed=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
gluster_georep_session_details=20(=0A=20=20=20=20=20=20=20=20session_id,=0A=
=20=20=20=20=20=20=20=20master_brick_id,=0A=20=20=20=20=20=20=20=20=
slave_host_name,=0A=20=20=20=20=20=20=20=20slave_host_uuid,=0A=20=20=20=20=
=20=20=20=20status,=0A=20=20=20=20=20=20=20=20checkpoint_status,=0A=20=20=
=20=20=20=20=20=20crawl_status,=0A=20=20=20=20=20=20=20=20data_pending,=0A=
=20=20=20=20=20=20=20=20entry_pending,=0A=20=20=20=20=20=20=20=20=
meta_pending,=0A=20=20=20=20=20=20=20=20failures,=0A=20=20=20=20=20=20=20=
=20last_synced_at,=0A=20=20=20=20=20=20=20=20checkpoint_time,=0A=20=20=20=
=20=20=20=20=20checkpoint_completed_time,=0A=20=20=20=20=20=20=20=20=
is_checkpoint_completed=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20=
(=0A=20=20=20=20=20=20=20=20v_session_id,=0A=20=20=20=20=20=20=20=20=
v_master_brick_id,=0A=20=20=20=20=20=20=20=20v_slave_host_name,=0A=20=20=20=
=20=20=20=20=20v_slave_host_uuid,=0A=20=20=20=20=20=20=20=20v_status,=0A=20=
=20=20=20=20=20=20=20v_checkpoint_status,=0A=20=20=20=20=20=20=20=20=
v_crawl_status,=0A=20=20=20=20=20=20=20=20v_data_pending,=0A=20=20=20=20=20=
=20=20=20v_entry_pending,=0A=20=20=20=20=20=20=20=20v_meta_pending,=0A=20=
=20=20=20=20=20=20=20v_failures,=0A=20=20=20=20=20=20=20=20=
v_last_synced_at,=0A=20=20=20=20=20=20=20=20v_checkpoint_time,=0A=20=20=20=
=20=20=20=20=20v_checkpoint_completed_time,=0A=20=20=20=20=20=20=20=20=
v_is_checkpoint_completed=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterGeoRepSessionDetail=20(=0A=20=20=20=20v_session_id=20UUID,=0A=
=20=20=20=20v_master_brick_id=20UUID,=0A=20=20=20=20v_slave_host_name=20=
VARCHAR(50),=0A=20=20=20=20v_slave_host_uuid=20UUID,=0A=20=20=20=20=
v_status=20VARCHAR(20),=0A=20=20=20=20v_checkpoint_status=20VARCHAR(20),=0A=
=20=20=20=20v_crawl_status=20VARCHAR(20),=0A=20=20=20=20v_data_pending=20=
BIGINT,=0A=20=20=20=20v_entry_pending=20BIGINT,=0A=20=20=20=20=
v_meta_pending=20BIGINT,=0A=20=20=20=20v_failures=20BIGINT,=0A=20=20=20=20=
v_last_synced_at=20TIMESTAMP,=0A=20=20=20=20v_checkpoint_time=20=
TIMESTAMP,=0A=20=20=20=20v_checkpoint_completed_time=20TIMESTAMP,=0A=20=20=
=20=20v_is_checkpoint_completed=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
gluster_georep_session_details=0A=20=20=20=20SET=20slave_host_name=20=3D=20=
v_slave_host_name,=0A=20=20=20=20=20=20=20=20slave_host_uuid=20=3D=20=
v_slave_host_uuid,=0A=20=20=20=20=20=20=20=20status=20=3D=20v_status,=0A=20=
=20=20=20=20=20=20=20checkpoint_status=20=3D=20v_checkpoint_status,=0A=20=
=20=20=20=20=20=20=20crawl_status=20=3D=20v_crawl_status,=0A=20=20=20=20=20=
=20=20=20data_pending=20=3D=20v_data_pending,=0A=20=20=20=20=20=20=20=20=
entry_pending=20=3D=20v_entry_pending,=0A=20=20=20=20=20=20=20=20=
meta_pending=20=3D=20v_meta_pending,=0A=20=20=20=20=20=20=20=20failures=20=
=3D=20v_failures,=0A=20=20=20=20=20=20=20=20last_synced_at=20=3D=20=
v_last_synced_at,=0A=20=20=20=20=20=20=20=20checkpoint_time=20=3D=20=
v_checkpoint_time,=0A=20=20=20=20=20=20=20=20checkpoint_completed_time=20=
=3D=20v_checkpoint_completed_time,=0A=20=20=20=20=20=20=20=20=
is_checkpoint_completed=20=3D=20v_is_checkpoint_completed,=0A=20=20=20=20=
=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20=
session_id=20=3D=20v_session_id=0A=20=20=20=20=20=20=20=20AND=20=
master_brick_id=20=3D=20v_master_brick_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterGeoRepSessionConfig=20(=0A=20=20=20=20v_session_id=20UUID,=0A=
=20=20=20=20v_config_key=20VARCHAR(50),=0A=20=20=20=20v_config_value=20=
VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20UPDATE=20gluster_georep_config=0A=20=20=20=20SET=20=
config_value=20=3D=20v_config_value,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20session_id=20=3D=
=20v_session_id=0A=20=20=20=20=20=20=20=20AND=20config_key=20=3D=20=
v_config_key;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterGeoRepSessionById=20(v_session_id=20UUID)=0ARETURNS=20SETOF=20=
gluster_georep_sessions_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_georep_sessions_view=0A=20=20=20=20WHERE=20session_id=20=3D=20=
v_session_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterGeoRepSessionsByVolumeId=20(v_master_volume_id=20UUID)=0A=
RETURNS=20SETOF=20gluster_georep_sessions_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20gluster_georep_sessions_view=0A=20=20=20=20WHERE=20=
master_volume_id=20=3D=20v_master_volume_id=0A=20=20=20=20ORDER=20BY=20=
slave_volume_name=20ASC;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterGeoRepSessionsByClusterId=20(v_cluster_id=20UUID)=0ARETURNS=20=
SETOF=20gluster_georep_sessions_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20gluster_georep_sessions_view=0A=20=20=20=20WHERE=20cluster_id=20=3D=
=20v_cluster_id=0A=20=20=20=20ORDER=20BY=20slave_volume_name=20ASC;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetGlusterGeoRepSessionByKey=20(v_session_key=20=
VARCHAR(150))=0ARETURNS=20SETOF=20gluster_georep_sessions_view=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20*=0A=20=20=20=20FROM=20gluster_georep_sessions_view=0A=20=20=20=20=
WHERE=20session_key=20=3D=20v_session_key;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterGeoRepSessionBySlaveHostAndVolume=20(=0A=20=20=20=20=
v_master_volume_id=20UUID,=0A=20=20=20=20v_slave_host_uuid=20UUID,=0A=20=20=
=20=20v_slave_volume_name=20VARCHAR(150)=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20gluster_georep_sessions_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20gluster_georep_sessions_view=0A=20=20=20=20WHERE=20=
master_volume_id=20=3D=20v_master_volume_id=0A=20=20=20=20=20=20=20=20=
AND=20slave_host_uuid=20=3D=20v_slave_host_uuid=0A=20=20=20=20=20=20=20=20=
AND=20slave_volume_name=20=3D=20v_slave_volume_name;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterGeoRepSessionStatus=20(=0A=20=20=20=20v_session_id=20UUID,=0A=
=20=20=20=20v_status=20VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_georep_session=0A=20=20=
=20=20SET=20status=20=3D=20v_status,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20session_id=20=3D=
=20v_session_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterGeoRepSession=20(=0A=20=20=20=20v_session_id=20UUID,=0A=20=20=
=20=20v_status=20VARCHAR(50),=0A=20=20=20=20v_slave_host_uuid=20UUID,=0A=20=
=20=20=20v_slave_volume_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_georep_session=0A=20=20=
=20=20SET=20status=20=3D=20v_status,=0A=20=20=20=20=20=20=20=20=
slave_host_uuid=20=3D=20v_slave_host_uuid,=0A=20=20=20=20=20=20=20=20=
slave_volume_id=20=3D=20v_slave_volume_id,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20session_id=20=3D=
=20v_session_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterGeoRepSessionDetails=20(v_session_id=20UUID)=0ARETURNS=20SETOF=20=
gluster_georep_session_details=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_georep_session_details=0A=20=20=20=20WHERE=20session_id=20=3D=20=
v_session_id=0A=20=20=20=20ORDER=20BY=20slave_host_name=20ASC;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetGlusterGeoRepSessionDetailsForBrick=20(=0A=20=20=20=
=20v_session_id=20UUID,=0A=20=20=20=20v_master_brick_id=20UUID=0A=20=20=20=
=20)=0ARETURNS=20SETOF=20gluster_georep_session_details=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20gluster_georep_session_details=0A=20=20=20=20=
WHERE=20session_id=20=3D=20v_session_id=0A=20=20=20=20=20=20=20=20AND=20=
master_brick_id=20=3D=20v_master_brick_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterGeoRepSessionConfig=20(v_session_id=20UUID)=0ARETURNS=20SETOF=20=
gluster_geo_rep_config_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_geo_rep_config_view=0A=20=20=20=20WHERE=20session_id=20=3D=20=
v_session_id=0A=20=20=20=20ORDER=20BY=20config_key=20ASC;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetGlusterGeoRepSessionUnSetConfig=20(v_session_id=20=
UUID)=0ARETURNS=20SETOF=20gluster_config_master=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20gluster_config_master=0A=20=20=20=20WHERE=20=
gluster_config_master.config_feature=20=3D=20'geo_replication'=0A=20=20=20=
=20=20=20=20=20AND=20gluster_config_master.config_key=20NOT=20IN=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20config_key=0A=20=20=20=20=20=20=
=20=20=20=20=20=20FROM=20gluster_georep_config=0A=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20gluster_georep_config.session_id=20=3D=20=
v_session_id=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterGeoRepSessionConfigByKey=20(=0A=20=20=20=20v_session_id=20=
UUID,=0A=20=20=20=20v_config_key=20VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20gluster_geo_rep_config_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20gluster_geo_rep_config_view=0A=20=20=20=20WHERE=20session_id=20=3D=20=
v_session_id=0A=20=20=20=20=20=20=20=20AND=20config_key=20=3D=20=
v_config_key;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllGlusterGeoRepSessions=20()=0ARETURNS=20SETOF=20=
gluster_georep_sessions_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_georep_sessions_view;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterGeoRepSession=20(v_session_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_georep_session=0A=20=20=20=20WHERE=20session_id=20=3D=20=
v_session_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGeoRepSessionBySlaveVolume=20(v_slave_volume_id=20UUID)=0ARETURNS=20=
SETOF=20gluster_georep_sessions_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20gluster_georep_sessions_view=0A=20=20=20=20WHERE=20=
slave_volume_id=20=3D=20v_slave_volume_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0A/*=20=
----------------------------------------------------------------=0A=20=
Stored=20procedures=20for=20database=20operations=20on=20Gluster=20Hooks=0A=
=20related=20tables:=0A=20=20=20=20=20=20-=20gluster_hooks=0A=20=20=20=20=
=20=20-=20gluster_server_hooks=0A=
----------------------------------------------------------------*/=0A=
CREATE=20OR=20REPLACE=20FUNCTION=20InsertGlusterHook=20(=0A=20=20=20=20=
v_id=20UUID,=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20=
v_gluster_command=20VARCHAR(128),=0A=20=20=20=20v_stage=20VARCHAR(50),=0A=
=20=20=20=20v_name=20VARCHAR(256),=0A=20=20=20=20v_hook_status=20=
VARCHAR(50),=0A=20=20=20=20v_content_type=20VARCHAR(50),=0A=20=20=20=20=
v_checksum=20VARCHAR(256),=0A=20=20=20=20v_content=20TEXT,=0A=20=20=20=20=
v_conflict_status=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20gluster_hooks=20(=0A=20=
=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20cluster_id,=0A=20=20=20=
=20=20=20=20=20gluster_command,=0A=20=20=20=20=20=20=20=20stage,=0A=20=20=
=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20hook_status,=0A=20=20=20=
=20=20=20=20=20content_type,=0A=20=20=20=20=20=20=20=20checksum,=0A=20=20=
=20=20=20=20=20=20content,=0A=20=20=20=20=20=20=20=20conflict_status=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_id,=0A=20=20=20=20=20=20=20=20v_cluster_id,=0A=20=20=20=20=20=20=20=20=
v_gluster_command,=0A=20=20=20=20=20=20=20=20v_stage,=0A=20=20=20=20=20=20=
=20=20v_name,=0A=20=20=20=20=20=20=20=20v_hook_status,=0A=20=20=20=20=20=20=
=20=20v_content_type,=0A=20=20=20=20=20=20=20=20v_checksum,=0A=20=20=20=20=
=20=20=20=20v_content,=0A=20=20=20=20=20=20=20=20v_conflict_status=0A=20=20=
=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetGlusterHookById=20(=0A=
=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_includeContent=20BOOLEAN=20=3D=20=
false=0A=20=20=20=20)=0ARETURNS=20SETOF=20gluster_hooks=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
id,=0A=20=20=20=20=20=20=20=20cluster_id,=0A=20=20=20=20=20=20=20=20=
gluster_command,=0A=20=20=20=20=20=20=20=20stage,=0A=20=20=20=20=20=20=20=
=20name,=0A=20=20=20=20=20=20=20=20hook_status,=0A=20=20=20=20=20=20=20=20=
content_type,=0A=20=20=20=20=20=20=20=20checksum,=0A=20=20=20=20=20=20=20=
=20CASE=20v_includeContent=0A=20=20=20=20=20=20=20=20=20=20=20=20WHEN=20=
true=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20THEN=20content=0A=20=
=20=20=20=20=20=20=20=20=20=20=20ELSE=20NULL::TEXT=0A=20=20=20=20=20=20=20=
=20=20=20=20=20END=20AS=20content,=0A=20=20=20=20=20=20=20=20=
conflict_status,=0A=20=20=20=20=20=20=20=20_create_date,=0A=20=20=20=20=20=
=20=20=20_update_date=0A=20=20=20=20FROM=20gluster_hooks=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterHookContentById=20(v_id=20UUID)=0ARETURNS=20SETOF=20TEXT=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20content=0A=20=20=20=20FROM=20gluster_hooks=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterHooksByClusterId=20(v_cluster_id=20UUID)=0ARETURNS=20SETOF=20=
gluster_hooks=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20id,=0A=20=20=20=20=20=20=20=20=
cluster_id,=0A=20=20=20=20=20=20=20=20gluster_command,=0A=20=20=20=20=20=20=
=20=20stage,=0A=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20=
hook_status,=0A=20=20=20=20=20=20=20=20content_type,=0A=20=20=20=20=20=20=
=20=20checksum,=0A=20=20=20=20=20=20=20=20NULL::TEXT=20AS=20content,=0A=20=
=20=20=20=20=20=20=20conflict_status,=0A=20=20=20=20=20=20=20=20=
_create_date,=0A=20=20=20=20=20=20=20=20_update_date=0A=20=20=20=20FROM=20=
gluster_hooks=0A=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=
=20=20=20ORDER=20BY=20gluster_command=20ASC,=0A=20=20=20=20=20=20=20=20=
stage=20ASC;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterServerHooksById=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
gluster_server_hooks_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_server_hooks_view=0A=20=20=20=20WHERE=20hook_id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetGlusterHook=20(=0A=20=20=20=20v_cluster_id=20=
UUID,=0A=20=20=20=20v_gluster_command=20VARCHAR(1000),=0A=20=20=20=20=
v_stage=20VARCHAR(100),=0A=20=20=20=20v_name=20VARCHAR(1000),=0A=20=20=20=
=20v_includeContent=20BOOLEAN=20=3D=20false=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20gluster_hooks=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20id,=0A=20=20=20=20=20=20=20=20=
cluster_id,=0A=20=20=20=20=20=20=20=20gluster_command,=0A=20=20=20=20=20=20=
=20=20stage,=0A=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20=
hook_status,=0A=20=20=20=20=20=20=20=20content_type,=0A=20=20=20=20=20=20=
=20=20checksum,=0A=20=20=20=20=20=20=20=20CASE=20v_includeContent=0A=20=20=
=20=20=20=20=20=20=20=20=20=20WHEN=20true=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20THEN=20content=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ELSE=20NULL::TEXT=0A=20=20=20=20=20=20=20=20=20=20=20=20END=20AS=20=
content,=0A=20=20=20=20=20=20=20=20conflict_status,=0A=20=20=20=20=20=20=20=
=20_create_date,=0A=20=20=20=20=20=20=20=20_update_date=0A=20=20=20=20=
FROM=20gluster_hooks=0A=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20gluster_command=20=3D=20=
v_gluster_command=0A=20=20=20=20=20=20=20=20AND=20stage=20=3D=20v_stage=0A=
=20=20=20=20=20=20=20=20AND=20name=20=3D=20v_name;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterHookById=20(v_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_hooks=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterHook=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20=
v_gluster_command=20VARCHAR(1000),=0A=20=20=20=20v_stage=20VARCHAR(100),=0A=
=20=20=20=20v_name=20VARCHAR(1000)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_hooks=0A=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=
=20=20=20=20=20=20=20AND=20gluster_command=20=3D=20v_gluster_command=0A=20=
=20=20=20=20=20=20=20AND=20stage=20=3D=20v_stage=0A=20=20=20=20=20=20=20=20=
AND=20name=20=3D=20v_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteAllGlusterHooks=20=
(v_cluster_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20DELETE=0A=20=20=20=20FROM=20gluster_hooks=0A=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteGlusterHooksByIds=20=
(v_ids=20TEXT)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20gluster_hooks=0A=20=20=20=20WHERE=20id=20IN=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20fnSplitterUuid(v_ids)=0A=20=20=20=20=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterHookConflictStatus=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=
=20v_conflict_status=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_hooks=0A=20=20=20=20=
SET=20conflict_status=20=3D=20v_conflict_status,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterHookContentType=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_content_type=20VARCHAR(100)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_hooks=0A=20=20=20=20=
SET=20content_type=20=3D=20v_content_type,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateGlusterHookContent=20=
(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_checksum=20VARCHAR(256),=0A=20=
=20=20=20v_content=20TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_hooks=0A=20=20=20=20=
SET=20checksum=20=3D=20v_checksum,=0A=20=20=20=20=20=20=20=20content=20=3D=
=20v_content,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterHook=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_hook_status=20VARCHAR(50),=0A=20=20=20=20v_content_type=20VARCHAR(50),=0A=
=20=20=20=20v_checksum=20VARCHAR(256),=0A=20=20=20=20v_content=20TEXT,=0A=
=20=20=20=20v_conflict_status=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_hooks=0A=20=20=20=
=20SET=20hook_status=20=3D=20v_hook_status,=0A=20=20=20=20=20=20=20=20=
content_type=20=3D=20v_content_type,=0A=20=20=20=20=20=20=20=20checksum=20=
=3D=20v_checksum,=0A=20=20=20=20=20=20=20=20content=20=3D=20v_content,=0A=
=20=20=20=20=20=20=20=20conflict_status=20=3D=20v_conflict_status,=0A=20=20=
=20=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateGlusterHookStatus=20=
(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_hook_status=20VARCHAR(50)=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
UPDATE=20gluster_hooks=0A=20=20=20=20SET=20hook_status=20=3D=20=
v_hook_status,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertGlusterServerHook=20(=0A=20=20=20=20v_hook_id=20UUID,=0A=20=20=20=20=
v_server_id=20UUID,=0A=20=20=20=20v_hook_status=20VARCHAR(50),=0A=20=20=20=
=20v_content_type=20VARCHAR(50),=0A=20=20=20=20v_checksum=20VARCHAR(256)=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
INSERT=20INTO=20gluster_server_hooks=20(=0A=20=20=20=20=20=20=20=20=
hook_id,=0A=20=20=20=20=20=20=20=20server_id,=0A=20=20=20=20=20=20=20=20=
hook_status,=0A=20=20=20=20=20=20=20=20content_type,=0A=20=20=20=20=20=20=
=20=20checksum=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=
=20=20=20=20=20=20=20v_hook_id,=0A=20=20=20=20=20=20=20=20v_server_id,=0A=
=20=20=20=20=20=20=20=20v_hook_status,=0A=20=20=20=20=20=20=20=20=
v_content_type,=0A=20=20=20=20=20=20=20=20v_checksum=0A=20=20=20=20=20=20=
=20=20);=0A=0A=20=20=20=20UPDATE=20gluster_hooks=0A=20=20=20=20SET=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20=
v_hook_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetGlusterServerHook=20(=0A=
=20=20=20=20v_hook_id=20UUID,=0A=20=20=20=20v_server_id=20UUID=0A=20=20=20=
=20)=0ARETURNS=20SETOF=20gluster_server_hooks_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20gluster_server_hooks_view=0A=20=20=20=20WHERE=20=
hook_id=20=3D=20v_hook_id=0A=20=20=20=20=20=20=20=20AND=20server_id=20=3D=20=
v_server_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateGlusterServerHook=20=
(=0A=20=20=20=20v_hook_id=20UUID,=0A=20=20=20=20v_server_id=20UUID,=0A=20=
=20=20=20v_hook_status=20VARCHAR(50),=0A=20=20=20=20v_content_type=20=
VARCHAR(50),=0A=20=20=20=20v_checksum=20VARCHAR(256)=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
gluster_server_hooks=0A=20=20=20=20SET=20hook_status=20=3D=20=
v_hook_status,=0A=20=20=20=20=20=20=20=20content_type=20=3D=20=
v_content_type,=0A=20=20=20=20=20=20=20=20checksum=20=3D=20v_checksum,=0A=
=20=20=20=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20=
WHERE=20hook_id=20=3D=20v_hook_id=0A=20=20=20=20=20=20=20=20AND=20=
server_id=20=3D=20v_server_id;=0A=0A=20=20=20=20UPDATE=20gluster_hooks=0A=
=20=20=20=20SET=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20=
WHERE=20id=20=3D=20v_hook_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterServerHookStatus=20(=0A=20=20=20=20v_hook_id=20UUID,=0A=20=20=
=20=20v_server_id=20UUID,=0A=20=20=20=20v_hook_status=20VARCHAR(100)=0A=20=
=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
UPDATE=20gluster_server_hooks=0A=20=20=20=20SET=20hook_status=20=3D=20=
v_hook_status,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20hook_id=20=3D=20v_hook_id=0A=20=20=20=
=20=20=20=20=20AND=20server_id=20=3D=20v_server_id;=0A=0A=20=20=20=20=
UPDATE=20gluster_hooks=0A=20=20=20=20SET=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20v_hook_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateGlusterServerHookChecksum=20(=0A=20=20=20=20=
v_hook_id=20UUID,=0A=20=20=20=20v_server_id=20UUID,=0A=20=20=20=20=
v_checksum=20VARCHAR(100)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_server_hooks=0A=20=20=20=
=20SET=20checksum=20=3D=20v_checksum,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20hook_id=20=3D=20=
v_hook_id=0A=20=20=20=20=20=20=20=20AND=20server_id=20=3D=20v_server_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteGlusterServerHookById=20(v_hook_id=20UUID)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20gluster_server_hooks=0A=20=20=20=20WHERE=20hook_id=20=3D=20=
v_hook_id;=0A=0A=20=20=20=20UPDATE=20gluster_hooks=0A=20=20=20=20SET=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20=
v_hook_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterServerHooksByIds=20(v_ids=20TEXT)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_server_hooks=0A=20=20=20=20WHERE=20hook_id=20IN=20(=0A=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20fnSplitterUuid(v_ids)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=
=20=20=20=20UPDATE=20gluster_hooks=0A=20=20=20=20SET=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20IN=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitterUuid(v_ids)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteGlusterServerHook=20(=0A=20=20=20=20v_hook_id=20=
UUID,=0A=20=20=20=20v_server_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_server_hooks=0A=20=20=20=20WHERE=20hook_id=20=3D=20v_hook_id=0A=20=
=20=20=20=20=20=20=20AND=20server_id=20=3D=20v_server_id;=0A=0A=20=20=20=20=
UPDATE=20gluster_hooks=0A=20=20=20=20SET=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20v_hook_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0A=
/*--------------------------------------------------------------=0A=
Stored=20procedures=20for=20database=20operations=20on=20gluster_server=20=
table=0A--------------------------------------------------------------*/=0A=
CREATE=20OR=20REPLACE=20FUNCTION=20InsertGlusterServer=20(=0A=20=20=20=20=
v_server_id=20UUID,=0A=20=20=20=20v_gluster_server_uuid=20UUID,=0A=20=20=20=
=20v_peer_status=20VARCHAR(20)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20gluster_server=20(=0A=20=
=20=20=20=20=20=20=20server_id,=0A=20=20=20=20=20=20=20=20=
gluster_server_uuid,=0A=20=20=20=20=20=20=20=20peer_status=0A=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_server_id,=0A=20=20=20=20=20=20=20=20v_gluster_server_uuid,=0A=20=20=20=
=20=20=20=20=20v_peer_status=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetGlusterServerByServerId=20(v_server_id=20UUID)=0A=
RETURNS=20SETOF=20gluster_server=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_server=0A=20=20=20=20WHERE=20server_id=20=3D=20v_server_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetGlusterServerByGlusterServerUUID=20=
(v_gluster_server_uuid=20UUID)=0ARETURNS=20SETOF=20gluster_server=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20gluster_server=0A=20=20=20=20WHERE=20=
gluster_server_uuid=20=3D=20v_gluster_server_uuid;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterServer=20(v_server_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_server=0A=20=20=20=20WHERE=20server_id=20=3D=20v_server_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteGlusterServerByGlusterServerUUID=20=
(v_gluster_server_uuid=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20gluster_server=0A=20=20=20=
=20WHERE=20gluster_server_uuid=20=3D=20v_gluster_server_uuid;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateGlusterServer=20(=0A=20=20=20=20v_server_id=20=
UUID,=0A=20=20=20=20v_gluster_server_uuid=20UUID=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
gluster_server=0A=20=20=20=20SET=20gluster_server_uuid=20=3D=20=
v_gluster_server_uuid=0A=20=20=20=20WHERE=20server_id=20=3D=20=
v_server_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterServerKnownAddresses=20(=0A=20=20=20=20v_server_id=20UUID,=0A=
=20=20=20=20v_known_addresses=20VARCHAR(250)=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_server=0A=20=
=20=20=20SET=20known_addresses=20=3D=20v_known_addresses=0A=20=20=20=20=
WHERE=20server_id=20=3D=20v_server_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterServerPeerStatus=20(=0A=20=20=20=20v_server_id=20UUID,=0A=20=
=20=20=20v_peer_status=20VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_server=0A=20=20=20=
=20SET=20peer_status=20=3D=20v_peer_status=0A=20=20=20=20WHERE=20=
server_id=20=3D=20v_server_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
AddGlusterServerKnownAddress=20(=0A=20=20=20=20v_server_id=20UUID,=0A=20=20=
=20=20v_known_address=20VARCHAR(250)=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_server=0A=20=20=20=
=20SET=20known_addresses=20=3D=20coalesce(known_addresses=20||=20',',=20=
'')=20||=20v_known_address=0A=20=20=20=20WHERE=20server_id=20=3D=20=
v_server_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A/*=20=
----------------------------------------------------------------=0A=20=
Stored=20procedures=20for=20database=20operations=20on=20Services=0A=20=
related=20tables:=0A=20=20=20=20=20=20-=20gluster_service_types=0A=20=20=20=
=20=20=20-=20gluster_services=0A=20=20=20=20=20=20-=20=
gluster_cluster_services=0A=20=20=20=20=20=20-=20gluster_server_services=0A=
----------------------------------------------------------------*/=0A=0A=
CREATE=20OR=20REPLACE=20FUNCTION=20GetGlusterServiceTypes=20()=0ARETURNS=20=
SETOF=20gluster_service_types=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_service_types;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetGlusterServicesByType=20=
(v_service_type=20VARCHAR(100))=0ARETURNS=20SETOF=20gluster_services=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20gluster_services=0A=20=20=20=20=
WHERE=20service_type=20=3D=20v_service_type;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterClusterServicesByClusterId=20(v_cluster_id=20UUID)=0ARETURNS=20=
SETOF=20gluster_cluster_services=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_cluster_services=0A=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterClusterServicesByClusterIdAndServiceType=20(=0A=20=20=20=20=
v_cluster_id=20UUID,=0A=20=20=20=20v_service_type=20VARCHAR(100)=0A=20=20=
=20=20)=0ARETURNS=20SETOF=20gluster_cluster_services=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20gluster_cluster_services=0A=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20=
service_type=20=3D=20v_service_type;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterServerServicesByServerId=20(v_server_id=20UUID)=0ARETURNS=20=
SETOF=20gluster_server_services_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20gluster_server_services_view=0A=20=20=20=20WHERE=20server_id=20=3D=20=
v_server_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterServerServicesByClusterId=20(v_cluster_id=20UUID)=0ARETURNS=20=
SETOF=20gluster_server_services_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20s.*=0A=20=20=20=20=
FROM=20gluster_server_services_view=20s,=0A=20=20=20=20=20=20=20=20=
vds_static=20v=0A=20=20=20=20WHERE=20s.server_id=20=3D=20v.vds_id=0A=20=20=
=20=20=20=20=20=20AND=20v.cluster_id=20=3D=20v_cluster_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetGlusterServerServicesByClusterIdAndServiceType=20=
(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_service_type=20=
VARCHAR(100)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
gluster_server_services_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20s.*=0A=20=20=20=20FROM=20=
gluster_server_services_view=20s,=0A=20=20=20=20=20=20=20=20vds_static=20=
v=0A=20=20=20=20WHERE=20s.server_id=20=3D=20v.vds_id=0A=20=20=20=20=20=20=
=20=20AND=20v.cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20=
AND=20s.service_type=20=3D=20v_service_type;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterServerServicesByServerIdAndServiceType=20(=0A=20=20=20=20=
v_server_id=20UUID,=0A=20=20=20=20v_service_type=20VARCHAR(100)=0A=20=20=20=
=20)=0ARETURNS=20SETOF=20gluster_server_services_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20gluster_server_services_view=0A=20=20=20=20WHERE=20=
server_id=20=3D=20v_server_id=0A=20=20=20=20=20=20=20=20AND=20=
service_type=20=3D=20v_service_type;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterServiceByGlusterServiceId=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
gluster_services=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_services=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetGlusterServerServiceByGlusterServerServiceId=20=
(v_id=20UUID)=0ARETURNS=20SETOF=20gluster_server_services_view=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20*=0A=20=20=20=20FROM=20gluster_server_services_view=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromGlusterServerServices=20()=0ARETURNS=20SETOF=20=
gluster_server_services_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_server_services_view;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterServiceByTypeAndName=20(=0A=20=20=20=20v_service_type=20=
VARCHAR(100),=0A=20=20=20=20v_service_name=20VARCHAR(100)=0A=20=20=20=20=
)=0ARETURNS=20SETOF=20gluster_services=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20gluster_services=0A=20=20=20=20WHERE=20service_type=20=3D=20=
v_service_type=0A=20=20=20=20=20=20=20=20AND=20service_name=20=3D=20=
v_service_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromGlusterServices=20()=0ARETURNS=20SETOF=20gluster_services=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20gluster_services;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertGlusterClusterService=20(=0A=20=20=20=20=
v_cluster_id=20UUID,=0A=20=20=20=20v_service_type=20VARCHAR(100),=0A=20=20=
=20=20v_status=20VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
gluster_cluster_services=20(=0A=20=20=20=20=20=20=20=20cluster_id,=0A=20=20=
=20=20=20=20=20=20service_type,=0A=20=20=20=20=20=20=20=20status=0A=20=20=
=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_cluster_id,=0A=20=20=20=20=20=20=20=20v_service_type,=0A=20=20=20=20=20=
=20=20=20v_status=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertGlusterServerService=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_server_id=20UUID,=0A=20=20=20=20v_service_id=20UUID,=0A=20=20=20=20=
v_pid=20INT,=0A=20=20=20=20v_status=20VARCHAR(32),=0A=20=20=20=20=
v_message=20VARCHAR(1000)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
gluster_server_services=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=
=20=20=20server_id,=0A=20=20=20=20=20=20=20=20service_id,=0A=20=20=20=20=20=
=20=20=20pid,=0A=20=20=20=20=20=20=20=20status,=0A=20=20=20=20=20=20=20=20=
message=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=
=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20v_server_id,=0A=20=20=20=20=20=
=20=20=20v_service_id,=0A=20=20=20=20=20=20=20=20v_pid,=0A=20=20=20=20=20=
=20=20=20v_status,=0A=20=20=20=20=20=20=20=20v_message=0A=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterClusterService=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=
=20=20v_service_type=20VARCHAR(100),=0A=20=20=20=20v_status=20=
VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20UPDATE=20gluster_cluster_services=0A=20=20=20=20SET=20status=20=
=3D=20v_status,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=
=20=20=20=20=20=20=20AND=20service_type=20=3D=20v_service_type;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateGlusterServerService=20(=0A=20=20=20=20v_id=20=
UUID,=0A=20=20=20=20v_pid=20INT,=0A=20=20=20=20v_status=20VARCHAR(32),=0A=
=20=20=20=20v_message=20VARCHAR(1000)=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_server_services=0A=
=20=20=20=20SET=20pid=20=3D=20v_pid,=0A=20=20=20=20=20=20=20=20status=20=
=3D=20v_status,=0A=20=20=20=20=20=20=20=20message=20=3D=20v_message,=0A=20=
=20=20=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterServerServiceByServerIdAndServiceType=20(=0A=20=20=20=20=
v_server_id=20UUID,=0A=20=20=20=20v_service_id=20UUID,=0A=20=20=20=20=
v_pid=20INT,=0A=20=20=20=20v_status=20VARCHAR(32),=0A=20=20=20=20=
v_message=20VARCHAR(1000)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_server_services=0A=20=20=
=20=20SET=20pid=20=3D=20v_pid,=0A=20=20=20=20=20=20=20=20status=20=3D=20=
v_status,=0A=20=20=20=20=20=20=20=20message=20=3D=20v_message,=0A=20=20=20=
=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20=
server_id=20=3D=20v_server_id=0A=20=20=20=20=20=20=20=20AND=20service_id=20=
=3D=20v_service_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterServerService=20(v_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_server_services=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0A/*=20=
----------------------------------------------------------------=0A=20=
Stored=20procedures=20for=20database=20operations=20on=20Gluster=20=
Volume=20Snapshot=0A=20related=20tables:=0A=20=20=20=20=20=20-=20=
gluster_volume_snapshot_schedules=0A=
----------------------------------------------------------------*/=0A=
CREATE=20OR=20REPLACE=20FUNCTION=20InsertGlusterVolumeSnapshotSchedule=20=
(=0A=20=20=20=20v_volume_id=20UUID,=0A=20=20=20=20v_job_id=20=
VARCHAR(256),=0A=20=20=20=20v_snapshot_name_prefix=20VARCHAR(128),=0A=20=20=
=20=20v_snapshot_description=20VARCHAR(1024),=0A=20=20=20=20v_recurrence=20=
VARCHAR(128),=0A=20=20=20=20v_time_zone=20VARCHAR(128),=0A=20=20=20=20=
v_interval=20INT,=0A=20=20=20=20v_start_date=20TIMESTAMP=20WITH=20TIME=20=
ZONE,=0A=20=20=20=20v_execution_time=20TIME,=0A=20=20=20=20v_days=20=
VARCHAR(256),=0A=20=20=20=20v_end_by=20TIMESTAMP=20WITH=20TIME=20ZONE=0A=20=
=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
INSERT=20INTO=20gluster_volume_snapshot_schedules=20(=0A=20=20=20=20=20=20=
=20=20volume_id,=0A=20=20=20=20=20=20=20=20job_id,=0A=20=20=20=20=20=20=20=
=20snapshot_name_prefix,=0A=20=20=20=20=20=20=20=20snapshot_description,=0A=
=20=20=20=20=20=20=20=20recurrence,=0A=20=20=20=20=20=20=20=20time_zone,=0A=
=20=20=20=20=20=20=20=20interval,=0A=20=20=20=20=20=20=20=20start_date,=0A=
=20=20=20=20=20=20=20=20execution_time,=0A=20=20=20=20=20=20=20=20days,=0A=
=20=20=20=20=20=20=20=20end_by=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_volume_id,=0A=20=20=20=20=20=20=20=
=20v_job_id,=0A=20=20=20=20=20=20=20=20v_snapshot_name_prefix,=0A=20=20=20=
=20=20=20=20=20v_snapshot_description,=0A=20=20=20=20=20=20=20=20=
v_recurrence,=0A=20=20=20=20=20=20=20=20v_time_zone,=0A=20=20=20=20=20=20=
=20=20v_interval,=0A=20=20=20=20=20=20=20=20v_start_date,=0A=20=20=20=20=20=
=20=20=20v_execution_time,=0A=20=20=20=20=20=20=20=20v_days,=0A=20=20=20=20=
=20=20=20=20v_end_by=0A=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=
UPDATE=20gluster_volumes=0A=20=20=20=20SET=20snapshot_scheduled=20=3D=20=
true=0A=20=20=20=20WHERE=20id=20=3D=20v_volume_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterVolumeSnapshotScheduleByVolumeId=20(v_volume_id=20UUID)=0A=
RETURNS=20SETOF=20gluster_volume_snapshot_schedules_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20gluster_volume_snapshot_schedules_view=0A=20=20=20=
=20WHERE=20volume_id=20=3D=20v_volume_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterVolumeSnapshotScheduleByVolumeId=20(v_volume_id=20UUID)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20gluster_volume_snapshot_schedules=0A=20=20=20=20WHERE=20=
volume_id=20=3D=20v_volume_id;=0A=0A=20=20=20=20UPDATE=20gluster_volumes=0A=
=20=20=20=20SET=20snapshot_scheduled=20=3D=20false=0A=20=20=20=20WHERE=20=
id=20=3D=20v_volume_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterVolumeSnapshotScheduleByVolumeId=20(=0A=20=20=20=20=
v_volume_id=20UUID,=0A=20=20=20=20v_job_id=20VARCHAR(256),=0A=20=20=20=20=
v_snapshot_name_prefix=20VARCHAR(128),=0A=20=20=20=20=
v_snapshot_description=20VARCHAR(1024),=0A=20=20=20=20v_recurrence=20=
VARCHAR(128),=0A=20=20=20=20v_time_zone=20VARCHAR(128),=0A=20=20=20=20=
v_interval=20INT,=0A=20=20=20=20v_start_date=20TIMESTAMP=20WITH=20TIME=20=
ZONE,=0A=20=20=20=20v_execution_time=20TIME,=0A=20=20=20=20v_days=20=
VARCHAR(256),=0A=20=20=20=20v_end_by=20TIMESTAMP=20WITH=20TIME=20ZONE=0A=20=
=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
UPDATE=20gluster_volume_snapshot_schedules=0A=20=20=20=20SET=20job_id=20=
=3D=20v_job_id,=0A=20=20=20=20=20=20=20=20snapshot_name_prefix=20=3D=20=
v_snapshot_name_prefix,=0A=20=20=20=20=20=20=20=20snapshot_description=20=
=3D=20v_snapshot_description,=0A=20=20=20=20=20=20=20=20recurrence=20=3D=20=
v_recurrence,=0A=20=20=20=20=20=20=20=20time_zone=20=3D=20v_time_zone,=0A=
=20=20=20=20=20=20=20=20interval=20=3D=20v_interval,=0A=20=20=20=20=20=20=
=20=20start_date=20=3D=20v_start_date,=0A=20=20=20=20=20=20=20=20=
execution_time=20=3D=20v_execution_time,=0A=20=20=20=20=20=20=20=20days=20=
=3D=20v_days,=0A=20=20=20=20=20=20=20=20end_by=20=3D=20v_end_by,=0A=20=20=
=20=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20=
WHERE=20volume_id=20=3D=20v_volume_id;=0A=0A=20=20=20=20UPDATE=20=
gluster_volumes=0A=20=20=20=20SET=20snapshot_scheduled=20=3D=20true=0A=20=
=20=20=20WHERE=20id=20=3D=20v_volume_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0A/*=20=
----------------------------------------------------------------=0A=20=
Stored=20procedures=20for=20database=20operations=20on=20Gluster=20=
Volume=20Snapshot=0A=20related=20tables:=0A=20=20=20=20=20=20-=20=
gluster_volume_snapshots=0A=20=20=20=20=20=20-=20=
gluster_volume_snapshot_config=0A=
----------------------------------------------------------------*/=0A=
CREATE=20OR=20REPLACE=20FUNCTION=20InsertGlusterVolumeSnapshot=20(=0A=20=20=
=20=20v_snapshot_id=20UUID,=0A=20=20=20=20v_snapshot_name=20=
VARCHAR(1000),=0A=20=20=20=20v_volume_id=20UUID,=0A=20=20=20=20=
v_description=20VARCHAR(1024),=0A=20=20=20=20v_status=20VARCHAR(32),=0A=20=
=20=20=20v__create_date=20TIMESTAMP=20WITH=20TIME=20ZONE=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
gluster_volume_snapshots=20(=0A=20=20=20=20=20=20=20=20snapshot_id,=0A=20=
=20=20=20=20=20=20=20snapshot_name,=0A=20=20=20=20=20=20=20=20volume_id,=0A=
=20=20=20=20=20=20=20=20description,=0A=20=20=20=20=20=20=20=20status,=0A=
=20=20=20=20=20=20=20=20_create_date=0A=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_snapshot_id,=0A=20=20=20=20=20=
=20=20=20v_snapshot_name,=0A=20=20=20=20=20=20=20=20v_volume_id,=0A=20=20=
=20=20=20=20=20=20v_description,=0A=20=20=20=20=20=20=20=20v_status,=0A=20=
=20=20=20=20=20=20=20v__create_date=0A=20=20=20=20=20=20=20=20);=0A=0A=20=
=20=20=20PERFORM=20UpdateSnapshotCountInc(v_volume_id,=201);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetGlusterVolumeSnapshotById=20(v_snapshot_id=20=
UUID)=0ARETURNS=20SETOF=20gluster_volume_snapshots_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20gluster_volume_snapshots_view=0A=20=20=20=20WHERE=20=
snapshot_id=20=3D=20v_snapshot_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterVolumeSnapshotsByVolumeId=20(v_volume_id=20UUID)=0ARETURNS=20=
SETOF=20gluster_volume_snapshots_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20gluster_volume_snapshots_view=0A=20=20=20=20WHERE=20volume_id=20=
=3D=20v_volume_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterVolumeSnapshotsByClusterId=20(v_cluster_id=20UUID)=0ARETURNS=20=
SETOF=20gluster_volume_snapshots_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20gluster_volume_snapshots_view=0A=20=20=20=20WHERE=20cluster_id=20=
=3D=20v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterVolumeSnapshotByName=20(=0A=20=20=20=20v_volume_id=20UUID,=0A=20=
=20=20=20v_snapshot_name=20VARCHAR(1000)=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20gluster_volume_snapshots_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20gluster_volume_snapshots_view=0A=20=20=20=20WHERE=20volume_id=20=
=3D=20v_volume_id=0A=20=20=20=20=20=20=20=20AND=20snapshot_name=20=3D=20=
v_snapshot_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterVolumeSnapshotByGuid=20(v_snapshot_id=20UUID)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ADECLARE=20ref_volume_id=20UUID;=0A=0ABEGIN=0A=20=
=20=20=20SELECT=20volume_id=0A=20=20=20=20INTO=20ref_volume_id=0A=20=20=20=
=20FROM=20gluster_volume_snapshots=0A=20=20=20=20WHERE=20snapshot_id=20=3D=
=20v_snapshot_id;=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_volume_snapshots=0A=20=20=20=20WHERE=20snapshot_id=20=3D=20=
v_snapshot_id;=0A=0A=20=20=20=20PERFORM=20=
UpdateSnapshotCountDec(ref_volume_id,=201);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterVolumeSnapshotsByVolumeId=20(v_volume_id=20UUID)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_volume_snapshots=0A=20=20=20=20WHERE=20volume_id=20=3D=20=
v_volume_id;=0A=0A=20=20=20=20UPDATE=20gluster_volumes=0A=20=20=20=20SET=20=
snapshot_count=20=3D=200=0A=20=20=20=20WHERE=20id=20=3D=20v_volume_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteGlusterVolumeSnapshotByName=20(=0A=20=20=20=20=
v_volume_id=20UUID,=0A=20=20=20=20v_snapshot_name=20VARCHAR(1000)=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=
=20=20=20=20FROM=20gluster_volume_snapshots=0A=20=20=20=20WHERE=20=
volume_id=20=3D=20v_volume_id=0A=20=20=20=20=20=20=20=20AND=20=
snapshot_name=20=3D=20v_snapshot_name;=0A=0A=20=20=20=20PERFORM=20=
UpdateSnapshotCountDec(v_volume_id,=201);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterVolumesSnapshotByIds=20(v_snapshot_ids=20VARCHAR(5000))=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_volume_id=20UUID;=0A=0A=
v_snapshot_count=20INT;=0A=0Av_cur=20CURSOR=0AFOR=0A=0ASELECT=20=
volume_id,=0A=20=20=20=20count(volume_id)=0AFROM=20=
gluster_volume_snapshots=0AWHERE=20snapshot_id=20IN=20(=0A=20=20=20=20=20=
=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20FROM=20=
fnSplitterUuid(v_snapshot_ids)=0A=20=20=20=20=20=20=20=20)=0AGROUP=20BY=20=
volume_id;=0A=0ABEGIN=0A=20=20=20=20OPEN=20v_cur;=0A=0A=20=20=20=20LOOP=0A=
=0A=20=20=20=20FETCH=20v_cur=0A=20=20=20=20INTO=20v_volume_id,=0A=20=20=20=
=20=20=20=20=20v_snapshot_count;=0A=0A=20=20=20=20EXIT=20WHEN=20NOT=20=
FOUND;=0A=0A=20=20=20=20PERFORM=20UpdateSnapshotCountDec(v_volume_id,=20=
v_snapshot_count);=0AEND=20LOOP;=0A=0ACLOSE=20v_cur;=0A=0ADELETE=0AFROM=20=
gluster_volume_snapshots=0AWHERE=20snapshot_id=20IN=20(=0A=20=20=20=20=20=
=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20FROM=20=
fnSplitterUuid(v_snapshot_ids)=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateGlusterVolumeSnapshotStatus=20(=0A=20=20=20=20=
v_snapshot_id=20UUID,=0A=20=20=20=20v_status=20VARCHAR(32)=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
gluster_volume_snapshots=0A=20=20=20=20SET=20status=20=3D=20v_status,=0A=20=
=20=20=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20=
WHERE=20snapshot_id=20=3D=20v_snapshot_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterVolumeSnapshotStatusByName=20(=0A=20=20=20=20v_volume_id=20=
UUID,=0A=20=20=20=20v_snapshot_name=20VARCHAR(1000),=0A=20=20=20=20=
v_status=20VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_volume_snapshots=0A=20=
=20=20=20SET=20status=20=3D=20v_status,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20volume_id=20=3D=20=
v_volume_id=0A=20=20=20=20=20=20=20=20AND=20snapshot_name=20=3D=20=
v_snapshot_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertGlusterVolumeSnapshotConfig=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=
=20=20=20=20v_volume_id=20UUID,=0A=20=20=20=20v_param_name=20=
VARCHAR(128),=0A=20=20=20=20v_param_value=20VARCHAR(128)=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
gluster_volume_snapshot_config=20(=0A=20=20=20=20=20=20=20=20cluster_id,=0A=
=20=20=20=20=20=20=20=20volume_id,=0A=20=20=20=20=20=20=20=20param_name,=0A=
=20=20=20=20=20=20=20=20param_value=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_cluster_id,=0A=20=20=20=20=20=20=
=20=20v_volume_id,=0A=20=20=20=20=20=20=20=20v_param_name,=0A=20=20=20=20=
=20=20=20=20v_param_value=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterVolumeSnapshotConfigByClusterId=20(v_cluster_id=20UUID)=0A=
RETURNS=20SETOF=20gluster_volume_snapshot_config=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20gluster_volume_snapshot_config=0A=20=20=20=20=
WHERE=20cluster_id=20=3D=20v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterVolumeSnapshotConfigByVolumeId=20(=0A=20=20=20=20v_cluster_id=20=
UUID,=0A=20=20=20=20v_volume_id=20UUID=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
gluster_volume_snapshot_config=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_volume_snapshot_config=0A=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20volume_id=20=3D=20=
v_volume_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterVolumeSnapshotConfigByClusterIdAndName=20(=0A=20=20=20=20=
v_cluster_id=20UUID,=0A=20=20=20=20v_param_name=20VARCHAR(128)=0A=20=20=20=
=20)=0ARETURNS=20SETOF=20gluster_volume_snapshot_config=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20gluster_volume_snapshot_config=0A=20=20=20=20=
WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20=
volume_id=20IS=20NULL=0A=20=20=20=20=20=20=20=20AND=20param_name=20=3D=20=
v_param_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterVolumeSnapshotConfigByVolumeIdAndName=20(=0A=20=20=20=20=
v_cluster_id=20UUID,=0A=20=20=20=20v_volume_id=20UUID,=0A=20=20=20=20=
v_param_name=20VARCHAR(128)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
gluster_volume_snapshot_config=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_volume_snapshot_config=0A=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20volume_id=20=3D=20=
v_volume_id=0A=20=20=20=20=20=20=20=20AND=20param_name=20=3D=20=
v_param_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateConfigByClusterIdAndName=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=
=20=20=20v_param_name=20VARCHAR(128),=0A=20=20=20=20v_param_value=20=
VARCHAR(128)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20UPDATE=20gluster_volume_snapshot_config=0A=20=20=20=20SET=20=
param_value=20=3D=20v_param_value,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20cluster_id=20=3D=
=20v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20volume_id=20IS=20NULL=0A=20=
=20=20=20=20=20=20=20AND=20param_name=20=3D=20v_param_name;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateConfigByVolumeIdIdAndName=20(=0A=20=20=20=20=
v_cluster_id=20UUID,=0A=20=20=20=20v_volume_id=20UUID,=0A=20=20=20=20=
v_param_name=20VARCHAR(128),=0A=20=20=20=20v_param_value=20VARCHAR(128)=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
UPDATE=20gluster_volume_snapshot_config=0A=20=20=20=20SET=20param_value=20=
=3D=20v_param_value,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=
=20=20=20=20=20=20=20AND=20volume_id=20=3D=20v_volume_id=0A=20=20=20=20=20=
=20=20=20AND=20param_name=20=3D=20v_param_name;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateSnapshotCountInc=20(=0A=20=20=20=20v_volume_id=20UUID,=0A=20=20=20=20=
v_num=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20UPDATE=20gluster_volumes=0A=20=20=20=20SET=20snapshot_count=20=
=3D=20snapshot_count=20+=20v_num=0A=20=20=20=20WHERE=20id=20=3D=20=
v_volume_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateSnapshotCountDec=20=
(=0A=20=20=20=20v_volume_id=20UUID,=0A=20=20=20=20v_num=20INT=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
gluster_volumes=0A=20=20=20=20SET=20snapshot_count=20=3D=20=
snapshot_count=20-=20v_num=0A=20=20=20=20WHERE=20id=20=3D=20v_volume_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0A/*=20=
----------------------------------------------------------------=0A=20=
Stored=20procedures=20for=20database=20operations=20on=20Gluster=20=
Volume=0A=20related=20tables:=0A=20=20=20=20=20=20-=20gluster_volumes=0A=20=
=20=20=20=20=20-=20gluster_volume_bricks=0A=20=20=20=20=20=20-=20=
gluster_volume_options=0A=20=20=20=20=20=20-=20=
gluster_volume_access_protocols=0A=20=20=20=20=20=20-=20=
gluster_volume_transport_types=0A=
----------------------------------------------------------------*/=0A=
CREATE=20OR=20REPLACE=20FUNCTION=20InsertGlusterVolume=20(=0A=20=20=20=20=
v_id=20UUID,=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_vol_name=20=
VARCHAR(1000),=0A=20=20=20=20v_vol_type=20VARCHAR(32),=0A=20=20=20=20=
v_status=20VARCHAR(32),=0A=20=20=20=20v_replica_count=20INT,=0A=20=20=20=20=
v_stripe_count=20INT,=0A=20=20=20=20v_disperse_count=20INT,=0A=20=20=20=20=
v_redundancy_count=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20gluster_volumes=20(=0A=20=
=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20cluster_id,=0A=20=20=20=
=20=20=20=20=20vol_name,=0A=20=20=20=20=20=20=20=20vol_type,=0A=20=20=20=20=
=20=20=20=20status,=0A=20=20=20=20=20=20=20=20replica_count,=0A=20=20=20=20=
=20=20=20=20stripe_count,=0A=20=20=20=20=20=20=20=20disperse_count,=0A=20=
=20=20=20=20=20=20=20redundancy_count=0A=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20=
v_cluster_id,=0A=20=20=20=20=20=20=20=20v_vol_name,=0A=20=20=20=20=20=20=20=
=20v_vol_type,=0A=20=20=20=20=20=20=20=20v_status,=0A=20=20=20=20=20=20=20=
=20v_replica_count,=0A=20=20=20=20=20=20=20=20v_stripe_count,=0A=20=20=20=
=20=20=20=20=20v_disperse_count,=0A=20=20=20=20=20=20=20=20=
v_redundancy_count=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertGlusterVolumeDetails=20(=0A=20=20=20=20v_volume_id=20UUID,=0A=20=20=
=20=20v_total_space=20BIGINT,=0A=20=20=20=20v_used_space=20BIGINT,=0A=20=20=
=20=20v_free_space=20BIGINT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20gluster_volume_details=20=
(=0A=20=20=20=20=20=20=20=20volume_id,=0A=20=20=20=20=20=20=20=20=
total_space,=0A=20=20=20=20=20=20=20=20used_space,=0A=20=20=20=20=20=20=20=
=20free_space,=0A=20=20=20=20=20=20=20=20_update_date=0A=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_volume_id,=0A=
=20=20=20=20=20=20=20=20v_total_space,=0A=20=20=20=20=20=20=20=20=
v_used_space,=0A=20=20=20=20=20=20=20=20v_free_space,=0A=20=20=20=20=20=20=
=20=20LOCALTIMESTAMP=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertGlusterVolumeBrick=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_volume_id=20UUID,=0A=20=20=20=20v_server_id=20UUID,=0A=20=20=20=20=
v_brick_dir=20VARCHAR(4096),=0A=20=20=20=20v_brick_order=20INT,=0A=20=20=20=
=20v_status=20VARCHAR(32),=0A=20=20=20=20v_network_id=20UUID=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20gluster_volume_bricks=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=
=20=20=20=20=20volume_id,=0A=20=20=20=20=20=20=20=20server_id,=0A=20=20=20=
=20=20=20=20=20brick_dir,=0A=20=20=20=20=20=20=20=20brick_order,=0A=20=20=
=20=20=20=20=20=20status,=0A=20=20=20=20=20=20=20=20network_id=0A=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_id,=0A=20=20=20=20=20=20=20=20v_volume_id,=0A=20=20=20=20=20=20=20=20=
v_server_id,=0A=20=20=20=20=20=20=20=20v_brick_dir,=0A=20=20=20=20=20=20=20=
=20v_brick_order,=0A=20=20=20=20=20=20=20=20v_status,=0A=20=20=20=20=20=20=
=20=20v_network_id=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertGlusterVolumeBrickDetails=20(=0A=20=20=20=20v_brick_id=20UUID,=0A=20=
=20=20=20v_total_space=20BIGINT,=0A=20=20=20=20v_used_space=20BIGINT,=0A=20=
=20=20=20v_free_space=20BIGINT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
gluster_volume_brick_details=20(=0A=20=20=20=20=20=20=20=20brick_id,=0A=20=
=20=20=20=20=20=20=20total_space,=0A=20=20=20=20=20=20=20=20used_space,=0A=
=20=20=20=20=20=20=20=20free_space,=0A=20=20=20=20=20=20=20=20=
_update_date=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=
=20=20=20=20=20=20v_brick_id,=0A=20=20=20=20=20=20=20=20v_total_space,=0A=
=20=20=20=20=20=20=20=20v_used_space,=0A=20=20=20=20=20=20=20=20=
v_free_space,=0A=20=20=20=20=20=20=20=20LOCALTIMESTAMP=0A=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertGlusterVolumeOption=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_volume_id=20UUID,=0A=20=20=20=20v_option_key=20VARCHAR(8192),=0A=20=20=20=
=20v_option_val=20VARCHAR(8192)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20gluster_volume_options=20=
(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20volume_id,=0A=20=
=20=20=20=20=20=20=20option_key,=0A=20=20=20=20=20=20=20=20option_val=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_id,=0A=20=20=20=20=20=20=20=20v_volume_id,=0A=20=20=20=20=20=20=20=20=
v_option_key,=0A=20=20=20=20=20=20=20=20v_option_val=0A=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertGlusterVolumeAccessProtocol=20(=0A=20=20=20=20v_volume_id=20UUID,=0A=
=20=20=20=20v_access_protocol=20VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
gluster_volume_access_protocols=20(=0A=20=20=20=20=20=20=20=20volume_id,=0A=
=20=20=20=20=20=20=20=20access_protocol=0A=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_volume_id,=0A=20=20=20=20=
=20=20=20=20v_access_protocol=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertGlusterVolumeTransportType=20(=0A=20=20=20=20=
v_volume_id=20UUID,=0A=20=20=20=20v_transport_type=20VARCHAR(32)=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20gluster_volume_transport_types=20(=0A=20=20=20=20=20=20=20=20=
volume_id,=0A=20=20=20=20=20=20=20=20transport_type=0A=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_volume_id,=0A=20=
=20=20=20=20=20=20=20v_transport_type=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetGlusterVolumesByClusterGuid=20(v_cluster_id=20=
UUID)=0ARETURNS=20SETOF=20gluster_volumes_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20gluster_volumes_view=0A=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterVolumesByOption=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=
=20=20v_status=20VARCHAR(32),=0A=20=20=20=20v_option_key=20=
VARCHAR(8192),=0A=20=20=20=20v_option_val=20VARCHAR(8192)=0A=20=20=20=20=
)=0ARETURNS=20SETOF=20gluster_volumes_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20gluster_volumes_view=0A=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20status=20=3D=20v_status=0A=20=
=20=20=20=20=20=20=20AND=20id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=20volume_id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
gluster_volume_options=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
option_key=20=3D=20v_option_key=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20AND=20option_val=20=3D=20v_option_val=0A=20=20=20=20=20=20=20=20=
=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterVolumesByStatusTypesAndOption=20(=0A=20=20=20=20v_cluster_id=20=
UUID,=0A=20=20=20=20v_status=20VARCHAR(32),=0A=20=20=20=20v_vol_types=20=
TEXT,=0A=20=20=20=20v_option_key=20VARCHAR(8192),=0A=20=20=20=20=
v_option_val=20VARCHAR(8192)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
gluster_volumes_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_volumes_view=0A=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20status=20=3D=20v_status=0A=20=
=20=20=20=20=20=20=20AND=20vol_type=20IN=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=20ID=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitter(v_vol_types)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20AND=20id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20volume_id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
gluster_volume_options=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
option_key=20=3D=20v_option_key=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20AND=20option_val=20=3D=20v_option_val=0A=20=20=20=20=20=20=20=20=
=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterVolumesByStatusAndTypes=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=
=20=20=20=20v_status=20VARCHAR(32),=0A=20=20=20=20v_vol_types=20TEXT=0A=20=
=20=20=20)=0ARETURNS=20SETOF=20gluster_volumes_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20gluster_volumes_view=0A=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20status=20=
=3D=20v_status=0A=20=20=20=20=20=20=20=20AND=20vol_type=20IN=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20fnSplitter(v_vol_types)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetGlusterVolumeById=20(v_volume_id=20UUID)=0A=
RETURNS=20SETOF=20gluster_volumes_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20gluster_volumes_view=0A=20=20=20=20WHERE=20id=20=3D=20=
v_volume_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetGlusterVolumeByName=20=
(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_vol_name=20=
VARCHAR(1000)=0A=20=20=20=20)=0ARETURNS=20SETOF=20gluster_volumes_view=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20gluster_volumes_view=0A=20=20=20=20=
WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20=
vol_name=20=3D=20v_vol_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterVolumeByGlusterTaskId=20(v_task_id=20UUID)=0ARETURNS=20SETOF=20=
gluster_volumes_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_volumes_view=0A=20=20=20=20WHERE=20task_id=20=3D=20v_task_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetGlusterVolumeDetailsById=20(v_volume_id=20UUID)=0A=
RETURNS=20SETOF=20gluster_volume_details=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20gluster_volume_details=0A=20=20=20=20WHERE=20volume_id=20=3D=20=
v_volume_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetGlusterBrickById=20=
(v_id=20UUID)=0ARETURNS=20SETOF=20gluster_volume_bricks_view=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20*=0A=20=20=20=20FROM=20gluster_volume_bricks_view=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetBricksByGlusterVolumeGuid=20(v_volume_id=20UUID)=0ARETURNS=20SETOF=20=
gluster_volume_bricks_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_volume_bricks_view=0A=20=20=20=20WHERE=20volume_id=20=3D=20=
v_volume_id=0A=20=20=20=20ORDER=20BY=20brick_order;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterVolumeBricksByServerGuid=20(v_server_id=20UUID)=0ARETURNS=20=
SETOF=20gluster_volume_bricks_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20gluster_volume_bricks_view=0A=20=20=20=20WHERE=20server_id=20=3D=20=
v_server_id=0A=20=20=20=20ORDER=20BY=20brick_order;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetBrickByServerIdAndDirectory=20(=0A=20=20=20=20v_server_id=20UUID,=0A=20=
=20=20=20v_brick_dir=20VARCHAR(4096)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
gluster_volume_bricks_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_volume_bricks_view=0A=20=20=20=20WHERE=20server_id=20=3D=20=
v_server_id=0A=20=20=20=20=20=20=20=20AND=20brick_dir=20=3D=20=
v_brick_dir;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetBricksByTaskId=20=
(v_task_id=20UUID)=0ARETURNS=20SETOF=20gluster_volume_bricks_view=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20gluster_volume_bricks_view=0A=20=20=
=20=20WHERE=20task_id=20=3D=20v_task_id=0A=20=20=20=20ORDER=20BY=20=
brick_order;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetBrickDetailsById=20=
(v_brick_id=20UUID)=0ARETURNS=20SETOF=20gluster_volume_brick_details=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20gluster_volume_brick_details=0A=20=20=
=20=20WHERE=20brick_id=20=3D=20v_brick_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterOptionById=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
gluster_volume_options=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
gluster_volume_options=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetOptionsByGlusterVolumeGuid=20(v_volume_id=20=
UUID)=0ARETURNS=20SETOF=20gluster_volume_options=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20gluster_volume_options=0A=20=20=20=20WHERE=20=
volume_id=20=3D=20v_volume_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAccessProtocolsByGlusterVolumeGuid=20(v_volume_id=20UUID)=0ARETURNS=20=
SETOF=20gluster_volume_access_protocols=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20gluster_volume_access_protocols=0A=20=20=20=20WHERE=20=
volume_id=20=3D=20v_volume_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetGlusterTaskByGlusterVolumeGuid=20(v_volume_id=20UUID)=0ARETURNS=20=
SETOF=20gluster_volume_task_steps=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
gluster_volume_task_steps.*=0A=20=20=20=20FROM=20=
gluster_volume_task_steps,=0A=20=20=20=20=20=20=20=20gluster_volumes=20=
vol=0A=20=20=20=20WHERE=20volume_id=20=3D=20v_volume_id=0A=20=20=20=20=20=
=20=20=20AND=20vol.id=20=3D=20volume_id=0A=20=20=20=20=20=20=20=20AND=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20job_status=20=3D=20'STARTED'=0A=20=
=20=20=20=20=20=20=20=20=20=20=20OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20job_status=20!=3D=20'STARTED'=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20external_id=20=3D=20vol.task_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20ORDER=20BY=20job_start_time=20DESC=20LIMIT=201;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetTransportTypesByGlusterVolumeGuid=20(v_volume_id=20=
UUID)=0ARETURNS=20SETOF=20gluster_volume_transport_types=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20gluster_volume_transport_types=0A=20=20=20=20=
WHERE=20volume_id=20=3D=20v_volume_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterVolumeByGuid=20(v_volume_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_volumes=0A=20=20=20=20WHERE=20id=20=3D=20v_volume_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteGlusterVolumesByGuids=20(v_volume_ids=20=
VARCHAR(5000))=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20gluster_volumes=0A=20=20=20=20WHERE=20id=20=
IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20fnSplitterUuid(v_volume_ids)=0A=20=20=20=20=20=
=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterVolumeByName=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=
=20=20v_vol_name=20VARCHAR(1000)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_volumes=0A=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=
=20=20=20=20=20=20=20AND=20vol_name=20=3D=20v_vol_name;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteGlusterVolumesByClusterId=20(v_cluster_id=20=
UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=
=20=20=20=20FROM=20gluster_volumes=0A=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteGlusterVolumeBrick=20=
(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20gluster_volume_bricks=0A=20=20=20=20WHERE=20=
id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterVolumeBricks=20(v_ids=20VARCHAR(5000))=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_volume_bricks=0A=20=20=20=20WHERE=20id=20IN=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20fnSplitterUuid(v_ids)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteGlusterVolumeOption=20(v_id=20UUID)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_volume_options=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteGlusterVolumeOptions=20(v_ids=20=
VARCHAR(5000))=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20gluster_volume_options=0A=20=20=20=20WHERE=20=
id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=
=20=20=20=20=20=20=20=20FROM=20fnSplitterUuid(v_ids)=0A=20=20=20=20=20=20=
=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterVolumeAccessProtocol=20(=0A=20=20=20=20v_volume_id=20UUID,=0A=
=20=20=20=20v_access_protocol=20VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_volume_access_protocols=0A=20=20=20=20WHERE=20volume_id=20=3D=20=
v_volume_id=0A=20=20=20=20=20=20=20=20AND=20access_protocol=20=3D=20=
v_access_protocol;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteGlusterVolumeTransportType=20(=0A=20=20=20=20v_volume_id=20UUID,=0A=
=20=20=20=20v_transport_type=20VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
gluster_volume_transport_types=0A=20=20=20=20WHERE=20volume_id=20=3D=20=
v_volume_id=0A=20=20=20=20=20=20=20=20AND=20transport_type=20=3D=20=
v_transport_type;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateGlusterVolume=20(=0A=
=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20=
v_vol_name=20VARCHAR(1000),=0A=20=20=20=20v_vol_type=20VARCHAR(32),=0A=20=
=20=20=20v_status=20VARCHAR(32),=0A=20=20=20=20v_replica_count=20INT,=0A=20=
=20=20=20v_stripe_count=20INT,=0A=20=20=20=20v_disperse_count=20INT,=0A=20=
=20=20=20v_redundancy_count=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_volumes=0A=20=20=20=20=
SET=20cluster_id=20=3D=20v_cluster_id,=0A=20=20=20=20=20=20=20=20=
vol_name=20=3D=20v_vol_name,=0A=20=20=20=20=20=20=20=20vol_type=20=3D=20=
v_vol_type,=0A=20=20=20=20=20=20=20=20status=20=3D=20v_status,=0A=20=20=20=
=20=20=20=20=20replica_count=20=3D=20v_replica_count,=0A=20=20=20=20=20=20=
=20=20stripe_count=20=3D=20v_stripe_count,=0A=20=20=20=20=20=20=20=20=
disperse_count=20=3D=20v_disperse_count,=0A=20=20=20=20=20=20=20=20=
redundancy_count=20=3D=20v_redundancy_count,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterVolumeDetails=20(=0A=20=20=20=20v_volume_id=20UUID,=0A=20=20=
=20=20v_total_space=20BIGINT,=0A=20=20=20=20v_used_space=20BIGINT,=0A=20=20=
=20=20v_free_space=20BIGINT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_volume_details=0A=20=20=
=20=20SET=20total_space=20=3D=20v_total_space,=0A=20=20=20=20=20=20=20=20=
used_space=20=3D=20v_used_space,=0A=20=20=20=20=20=20=20=20free_space=20=
=3D=20v_free_space,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20volume_id=20=3D=20v_volume_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateGlusterVolumeBrick=20(=0A=20=20=20=20v_id=20=
UUID,=0A=20=20=20=20v_new_id=20UUID,=0A=20=20=20=20v_new_server_id=20=
UUID,=0A=20=20=20=20v_new_brick_dir=20VARCHAR(4096),=0A=20=20=20=20=
v_new_status=20VARCHAR(32),=0A=20=20=20=20v_new_network_id=20UUID=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=20=
FROM=20gluster_volume_brick_details=0A=20=20=20=20WHERE=20brick_id=20=3D=20=
v_id;=0A=20=20=20=20UPDATE=20gluster_volume_bricks=0A=20=20=20=20SET=20=
id=20=3D=20v_new_id,=0A=20=20=20=20=20=20=20=20server_id=20=3D=20=
v_new_server_id,=0A=20=20=20=20=20=20=20=20brick_dir=20=3D=20=
v_new_brick_dir,=0A=20=20=20=20=20=20=20=20status=20=3D=20v_new_status,=0A=
=20=20=20=20=20=20=20=20network_id=20=3D=20v_new_network_id,=0A=20=20=20=20=
=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=
=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterVolumeBrickDetails=20(=0A=20=20=20=20v_brick_id=20UUID,=0A=20=
=20=20=20v_total_space=20BIGINT,=0A=20=20=20=20v_used_space=20BIGINT,=0A=20=
=20=20=20v_free_space=20BIGINT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_volume_brick_details=0A=
=20=20=20=20SET=20total_space=20=3D=20v_total_space,=0A=20=20=20=20=20=20=
=20=20used_space=20=3D=20v_used_space,=0A=20=20=20=20=20=20=20=20=
free_space=20=3D=20v_free_space,=0A=20=20=20=20=20=20=20=20_update_date=20=
=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20brick_id=20=3D=20v_brick_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateGlusterVolumeBrickStatus=20(=0A=20=20=20=20=
v_id=20UUID,=0A=20=20=20=20v_status=20VARCHAR(32)=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
gluster_volume_bricks=0A=20=20=20=20SET=20status=20=3D=20v_status,=0A=20=20=
=20=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterVolumeBrickOrder=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_brick_order=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20UPDATE=20gluster_volume_bricks=0A=20=20=20=20SET=20=
brick_order=20=3D=20v_brick_order,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterVolumeBrickNetworkId=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=
=20=20v_network_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_volume_bricks=0A=20=20=
=20=20SET=20network_id=20=3D=20v_network_id,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterVolumeStatus=20(=0A=20=20=20=20v_volume_id=20UUID,=0A=20=20=20=
=20v_status=20VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_volumes=0A=20=20=20=20=
SET=20status=20=3D=20v_status,=0A=20=20=20=20=20=20=20=20_update_date=20=
=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20v_volume_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateGlusterVolumeAsyncTask=20(=0A=20=20=20=20=
v_volume_id=20UUID,=0A=20=20=20=20v_task_id=20UUID=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
gluster_volumes=0A=20=20=20=20SET=20task_id=20=3D=20v_task_id,=0A=20=20=20=
=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20=
id=20=3D=20v_volume_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterVolumeBrickAsyncTask=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=
=20=20v_task_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_volume_bricks=0A=20=20=
=20=20SET=20task_id=20=3D=20v_task_id,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterBrickTaskByServerIdBrickDir=20(=0A=20=20=20=20v_server_id=20=
UUID,=0A=20=20=20=20v_brick_dir=20VARCHAR(200),=0A=20=20=20=20v_task_id=20=
UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20UPDATE=20gluster_volume_bricks=0A=20=20=20=20SET=20task_id=20=3D=20=
v_task_id,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=
=20=20=20=20WHERE=20server_id=20=3D=20v_server_id=0A=20=20=20=20=20=20=20=
=20AND=20brick_dir=20=3D=20v_brick_dir;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterVolumeBrickUnSyncedEntries=20(=0A=20=20=20=20v_id=20UUID,=0A=
=20=20=20=20v_unsynced_entries=20integer,=0A=20=20=20=20=
v_unsynced_entries_history=20text=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_volume_bricks=0A=20=20=
=20=20SET=20unsynced_entries=20=3D=20v_unsynced_entries,=0A=20=20=20=20=20=
=20=20=20unsynced_entries_history=20=3D=20v_unsynced_entries_history,=0A=20=
=20=20=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterVolumeStatusByName=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=
=20=20=20=20v_vol_name=20VARCHAR(1000),=0A=20=20=20=20v_status=20=
VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20UPDATE=20gluster_volumes=0A=20=20=20=20SET=20status=20=3D=20=
v_status,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=
=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=
=20AND=20vol_name=20=3D=20v_vol_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateGlusterVolumeOption=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_option_val=20VARCHAR(8192)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20gluster_volume_options=0A=20=20=
=20=20SET=20option_val=20=3D=20v_option_val=0A=20=20=20=20WHERE=20id=20=3D=
=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateReplicaCount=20(=0A=
=20=20=20=20v_volume_id=20UUID,=0A=20=20=20=20v_replica_count=20INT=0A=20=
=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
UPDATE=20gluster_volumes=0A=20=20=20=20SET=20replica_count=20=3D=20=
v_replica_count,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20v_volume_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetBricksByClusterIdAndNetworkId=20(=0A=20=20=20=20=
v_cluster_id=20UUID,=0A=20=20=20=20v_network_id=20UUID=0A=20=20=20=20)=0A=
RETURNS=20SETOF=20gluster_volume_bricks_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20gluster_volume_bricks_view=0A=20=20=20=20WHERE=20network_id=20=
=3D=20v_network_id=0A=20=20=20=20=20=20=20=20AND=20cluster_id=20=3D=20=
v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertHostDevice=20(=0A=20=
=20=20=20v_host_id=20UUID,=0A=20=20=20=20v_device_name=20VARCHAR(255),=0A=
=20=20=20=20v_parent_device_name=20VARCHAR(255),=0A=20=20=20=20=
v_capability=20VARCHAR(32),=0A=20=20=20=20v_iommu_group=20INT,=0A=20=20=20=
=20v_product_name=20VARCHAR(255),=0A=20=20=20=20v_product_id=20=
VARCHAR(255),=0A=20=20=20=20v_vendor_name=20VARCHAR(255),=0A=20=20=20=20=
v_vendor_id=20VARCHAR(255),=0A=20=20=20=20v_physfn=20VARCHAR(255),=0A=20=20=
=20=20v_total_vfs=20INT,=0A=20=20=20=20v_net_iface_name=20VARCHAR(50),=0A=
=20=20=20=20v_driver=20VARCHAR(255),=0A=20=20=20=20v_is_assignable=20=
BOOLEAN=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20SET=20CONSTRAINTS=20ALL=20DEFERRED;=0A=0A=20=20=20=20INSERT=20=
INTO=20host_device=20(=0A=20=20=20=20=20=20=20=20host_id,=0A=20=20=20=20=20=
=20=20=20device_name,=0A=20=20=20=20=20=20=20=20parent_device_name,=0A=20=
=20=20=20=20=20=20=20capability,=0A=20=20=20=20=20=20=20=20iommu_group,=0A=
=20=20=20=20=20=20=20=20product_name,=0A=20=20=20=20=20=20=20=20=
product_id,=0A=20=20=20=20=20=20=20=20vendor_name,=0A=20=20=20=20=20=20=20=
=20vendor_id,=0A=20=20=20=20=20=20=20=20physfn,=0A=20=20=20=20=20=20=20=20=
total_vfs,=0A=20=20=20=20=20=20=20=20net_iface_name,=0A=20=20=20=20=20=20=
=20=20driver,=0A=20=20=20=20=20=20=20=20is_assignable=0A=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_host_id,=0A=20=
=20=20=20=20=20=20=20v_device_name,=0A=20=20=20=20=20=20=20=20=
v_parent_device_name,=0A=20=20=20=20=20=20=20=20v_capability,=0A=20=20=20=
=20=20=20=20=20v_iommu_group,=0A=20=20=20=20=20=20=20=20v_product_name,=0A=
=20=20=20=20=20=20=20=20v_product_id,=0A=20=20=20=20=20=20=20=20=
v_vendor_name,=0A=20=20=20=20=20=20=20=20v_vendor_id,=0A=20=20=20=20=20=20=
=20=20v_physfn,=0A=20=20=20=20=20=20=20=20v_total_vfs,=0A=20=20=20=20=20=20=
=20=20v_net_iface_name,=0A=20=20=20=20=20=20=20=20v_driver,=0A=20=20=20=20=
=20=20=20=20v_is_assignable=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateHostDevice=20(=0A=20=20=20=20v_host_id=20=
UUID,=0A=20=20=20=20v_device_name=20VARCHAR(255),=0A=20=20=20=20=
v_parent_device_name=20VARCHAR(255),=0A=20=20=20=20v_capability=20=
VARCHAR(32),=0A=20=20=20=20v_iommu_group=20INT,=0A=20=20=20=20=
v_product_name=20VARCHAR(255),=0A=20=20=20=20v_product_id=20=
VARCHAR(255),=0A=20=20=20=20v_vendor_name=20VARCHAR(255),=0A=20=20=20=20=
v_vendor_id=20VARCHAR(255),=0A=20=20=20=20v_physfn=20VARCHAR(255),=0A=20=20=
=20=20v_total_vfs=20INT,=0A=20=20=20=20v_net_iface_name=20VARCHAR(50),=0A=
=20=20=20=20v_driver=20VARCHAR(255),=0A=20=20=20=20v_is_assignable=20=
BOOLEAN=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20SET=20CONSTRAINTS=20ALL=20DEFERRED;=0A=0A=20=20=20=20UPDATE=20=
host_device=0A=20=20=20=20SET=20host_id=20=3D=20v_host_id,=0A=20=20=20=20=
=20=20=20=20device_name=20=3D=20v_device_name,=0A=20=20=20=20=20=20=20=20=
parent_device_name=20=3D=20v_parent_device_name,=0A=20=20=20=20=20=20=20=20=
capability=20=3D=20v_capability,=0A=20=20=20=20=20=20=20=20iommu_group=20=
=3D=20v_iommu_group,=0A=20=20=20=20=20=20=20=20product_name=20=3D=20=
v_product_name,=0A=20=20=20=20=20=20=20=20product_id=20=3D=20=
v_product_id,=0A=20=20=20=20=20=20=20=20vendor_name=20=3D=20=
v_vendor_name,=0A=20=20=20=20=20=20=20=20vendor_id=20=3D=20v_vendor_id,=0A=
=20=20=20=20=20=20=20=20physfn=20=3D=20v_physfn,=0A=20=20=20=20=20=20=20=20=
total_vfs=20=3D=20v_total_vfs,=0A=20=20=20=20=20=20=20=20net_iface_name=20=
=3D=20v_net_iface_name,=0A=20=20=20=20=20=20=20=20driver=20=3D=20=
v_driver,=0A=20=20=20=20=20=20=20=20is_assignable=20=3D=20=
v_is_assignable=0A=20=20=20=20WHERE=20host_id=20=3D=20v_host_id=0A=20=20=20=
=20=20=20=20=20AND=20device_name=20=3D=20v_device_name;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteHostDevice=20(=0A=20=20=20=20v_host_id=20=
UUID,=0A=20=20=20=20v_device_name=20VARCHAR(255)=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20SET=20=
CONSTRAINTS=20ALL=20DEFERRED;=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
host_device=0A=20=20=20=20WHERE=20host_id=20=3D=20v_host_id=0A=20=20=20=20=
=20=20=20=20AND=20device_name=20=3D=20v_device_name;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetHostDevicesByHostId=20(v_host_id=20UUID)=0ARETURNS=20SETOF=20=
host_device=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20host_device=0A=20=20=
=20=20WHERE=20host_id=20=3D=20v_host_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetHostDevicesByHostIdAndIommuGroup=20(=0A=20=20=20=20v_host_id=20UUID,=0A=
=20=20=20=20v_iommu_group=20INT=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
host_device=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20host_device=0A=20=20=
=20=20WHERE=20host_id=20=3D=20v_host_id=0A=20=20=20=20=20=20=20=20AND=20=
iommu_group=20=3D=20v_iommu_group;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetHostDeviceByHostIdAndDeviceName=20(=0A=20=20=20=20v_host_id=20UUID,=0A=
=20=20=20=20v_device_name=20VARCHAR(255)=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20host_device=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
host_device=0A=20=20=20=20WHERE=20host_id=20=3D=20v_host_id=0A=20=20=20=20=
=20=20=20=20AND=20device_name=20=3D=20v_device_name;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromHostDevices=20()=0ARETURNS=20SETOF=20host_device=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20host_device;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmExtendedHostDevicesByVmId=20(v_vm_id=20UUID)=0ARETURNS=20SETOF=20=
vm_host_device_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vm_host_device_view.*=0A=20=20=20=
=20FROM=20vm_host_device_view=0A=20=20=20=20WHERE=20=
vm_host_device_view.configured_vm_id=20=3D=20v_vm_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetExtendedHostDevicesByHostId=20(v_host_id=20UUID)=0ARETURNS=20SETOF=20=
host_device_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20host_device_view.*=0A=20=20=20=20=
FROM=20host_device_view=0A=20=20=20=20WHERE=20host_device_view.host_id=20=
=3D=20v_host_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CheckVmHostDeviceAvailability=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=
=20v_host_id=20UUID=0A=20=20=20=20)=0ARETURNS=20BOOLEAN=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20NOT=20EXISTS=20(=0A=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vm_device=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vm_id=20=3D=
=20v_vm_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
device=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=20device_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20FROM=20host_device=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20host_id=20=3D=20v_host_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20vm_id=20IS=20=
NOT=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20vm_id=20<>=20v_vm_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);--=20=
device=20free=20or=20already=20belonging=20to=20the=20vm=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20MarkHostDevicesUsedByVmId=20(=0A=20=20=20=20v_vm_id=20=
UUID,=0A=20=20=20=20v_host_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20host_device=0A=20=20=20=20=
SET=20vm_id=20=3D=20v_vm_id=0A=20=20=20=20WHERE=20host_id=20=3D=20=
v_host_id=0A=20=20=20=20=20=20=20=20AND=20device_name=20IN=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=20device=0A=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20vm_device=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20type=20=3D=20'hostdev'=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20SetVmIdOnHostDevice=20(=0A=20=20=20=20v_host_id=20=
UUID,=0A=20=20=20=20v_device_name=20VARCHAR(255),=0A=20=20=20=20v_vm_id=20=
UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20UPDATE=20host_device=0A=20=20=20=20SET=20vm_id=20=3D=20v_vm_id=0A=20=
=20=20=20WHERE=20host_id=20=3D=20v_host_id=0A=20=20=20=20=20=20=20=20AND=20=
device_name=20=3D=20v_device_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
FreeHostDevicesUsedByVmId=20(v_vm_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20host_device=0A=20=20=20=20SET=20=
vm_id=20=3D=20NULL=0A=20=20=20=20WHERE=20vm_id=20=3D=20v_vm_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20CleanDownVms=20()=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20host_device=0A=20=20=20=20SET=20=
vm_id=20=3D=20NULL=0A=20=20=20=20FROM=20vm_dynamic=0A=20=20=20=20WHERE=20=
host_device.vm_id=20=3D=20vm_dynamic.vm_guid=0A=20=20=20=20=20=20=20=20=
AND=20vm_dynamic.status=20=3D=200;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmDevicesAttachedToHost=20(v_host_id=20UUID)=0ARETURNS=20SETOF=20=
vm_device=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=
=20=20=20SELECT=20vm_device.*=0A=20=20=20=20FROM=20vm_device=0A=20=20=20=20=
INNER=20JOIN=20vm_host_pinning_map=0A=20=20=20=20=20=20=20=20ON=20=
vm_device.vm_id=20=3D=20vm_host_pinning_map.vm_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20vm_host_pinning_map.vds_id=20=3D=20v_host_id=0A=20=20=
=20=20WHERE=20vm_device.type=20=3D=20'hostdev';=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertImage=20(=0A=20=20=20=20v_creation_date=20TIMESTAMP=20WITH=20TIME=20=
ZONE,=0A=20=20=20=20v_image_guid=20UUID,=0A=20=20=20=20v_it_guid=20UUID,=0A=
=20=20=20=20v_size=20BIGINT,=0A=20=20=20=20v_ParentId=20UUID,=0A=20=20=20=
=20v_imageStatus=20INT,=0A=20=20=20=20v_lastModified=20TIMESTAMP=20WITH=20=
TIME=20ZONE,=0A=20=20=20=20v_vm_snapshot_id=20UUID,=0A=20=20=20=20=
v_volume_type=20INT,=0A=20=20=20=20v_volume_format=20INT,=0A=20=20=20=20=
v_image_group_id=20UUID,=0A=20=20=20=20v_active=20BOOLEAN,=0A=20=20=20=20=
v_volume_classification=20SMALLINT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20images=20(=0A=20=20=20=20=
=20=20=20=20creation_date,=0A=20=20=20=20=20=20=20=20image_guid,=0A=20=20=
=20=20=20=20=20=20it_guid,=0A=20=20=20=20=20=20=20=20size,=0A=20=20=20=20=
=20=20=20=20ParentId,=0A=20=20=20=20=20=20=20=20imageStatus,=0A=20=20=20=20=
=20=20=20=20lastModified,=0A=20=20=20=20=20=20=20=20vm_snapshot_id,=0A=20=
=20=20=20=20=20=20=20volume_type,=0A=20=20=20=20=20=20=20=20=
image_group_id,=0A=20=20=20=20=20=20=20=20volume_format,=0A=20=20=20=20=20=
=20=20=20active,=0A=20=20=20=20=20=20=20=20volume_classification=0A=20=20=
=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_creation_date,=0A=20=20=20=20=20=20=20=20v_image_guid,=0A=20=20=20=20=20=
=20=20=20v_it_guid,=0A=20=20=20=20=20=20=20=20v_size,=0A=20=20=20=20=20=20=
=20=20v_ParentId,=0A=20=20=20=20=20=20=20=20v_imageStatus,=0A=20=20=20=20=
=20=20=20=20v_lastModified,=0A=20=20=20=20=20=20=20=20v_vm_snapshot_id,=0A=
=20=20=20=20=20=20=20=20v_volume_type,=0A=20=20=20=20=20=20=20=20=
v_image_group_id,=0A=20=20=20=20=20=20=20=20v_volume_format,=0A=20=20=20=20=
=20=20=20=20v_active,=0A=20=20=20=20=20=20=20=20v_volume_classification=0A=
=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateImageStatus=20(=0A=20=
=20=20=20v_image_id=20UUID,=0A=20=20=20=20v_status=20INT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20images=0A=
=20=20=20=20SET=20imageStatus=20=3D=20v_status=0A=20=20=20=20WHERE=20=
image_guid=20=3D=20v_image_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateStatusOfImagesByImageGroupId=20(=0A=20=20=20=20v_image_group_id=20=
UUID,=0A=20=20=20=20v_status=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20images=0A=20=20=20=20SET=20=
imageStatus=20=3D=20v_status=0A=20=20=20=20WHERE=20image_group_id=20=3D=20=
v_image_group_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateImageVmSnapshotId=20=
(=0A=20=20=20=20v_image_id=20UUID,=0A=20=20=20=20v_vm_snapshot_id=20UUID=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
UPDATE=20images=0A=20=20=20=20SET=20vm_snapshot_id=20=3D=20=
v_vm_snapshot_id=0A=20=20=20=20WHERE=20image_guid=20=3D=20v_image_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateImageSize=20(=0A=20=20=20=20v_image_id=20=
UUID,=0A=20=20=20=20v_size=20BIGINT,=0A=20=20=20=20v_lastModified=20=
TIMESTAMP=20WITH=20TIME=20ZONE=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20images=0A=20=20=20=20SET=20=
size=20=3D=20v_size,=0A=20=20=20=20=20=20=20=20lastModified=20=3D=20=
v_lastModified=0A=20=20=20=20WHERE=20image_guid=20=3D=20v_image_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateImage=20(=0A=20=20=20=20v_creation_date=20=
TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20v_image_guid=20UUID,=0A=20=20=
=20=20v_it_guid=20UUID,=0A=20=20=20=20v_size=20BIGINT,=0A=20=20=20=20=
v_ParentId=20UUID,=0A=20=20=20=20v_imageStatus=20INT,=0A=20=20=20=20=
v_lastModified=20TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20=
v_vm_snapshot_id=20UUID,=0A=20=20=20=20v_volume_type=20INT,=0A=20=20=20=20=
v_volume_format=20INT,=0A=20=20=20=20v_image_group_id=20UUID,=0A=20=20=20=
=20v_active=20BOOLEAN,=0A=20=20=20=20v_volume_classification=20SMALLINT=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
UPDATE=20images=0A=20=20=20=20SET=20creation_date=20=3D=20=
v_creation_date,=0A=20=20=20=20=20=20=20=20it_guid=20=3D=20v_it_guid,=0A=20=
=20=20=20=20=20=20=20size=20=3D=20v_size,=0A=20=20=20=20=20=20=20=20=
ParentId=20=3D=20v_ParentId,=0A=20=20=20=20=20=20=20=20imageStatus=20=3D=20=
v_imageStatus,=0A=20=20=20=20=20=20=20=20lastModified=20=3D=20=
v_lastModified,=0A=20=20=20=20=20=20=20=20vm_snapshot_id=20=3D=20=
v_vm_snapshot_id,=0A=20=20=20=20=20=20=20=20volume_type=20=3D=20=
v_volume_type,=0A=20=20=20=20=20=20=20=20image_group_id=20=3D=20=
v_image_group_id,=0A=20=20=20=20=20=20=20=20volume_format=20=3D=20=
v_volume_format,=0A=20=20=20=20=20=20=20=20active=20=3D=20v_active,=0A=20=
=20=20=20=20=20=20=20volume_classification=20=3D=20=
v_volume_classification,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20image_guid=20=3D=20v_image_guid;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteImage=20(v_image_guid=20UUID)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_val=20UUID;=0A=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20images=0A=20=20=20=20WHERE=20image_guid=20=3D=20=
v_image_guid;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromImages=20()=0A=
RETURNS=20SETOF=20images=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20images;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetImageByImageId=20(v_image_guid=20UUID)=0ARETURNS=20=
SETOF=20images=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20images=0A=20=20=20=
=20WHERE=20image_guid=20=3D=20v_image_guid;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Insertimage_storage_domain_map=20(=0A=20=20=20=20v_image_id=20UUID,=0A=20=
=20=20=20v_storage_domain_id=20UUID,=0A=20=20=20=20v_quota_id=20UUID,=0A=20=
=20=20=20v_disk_profile_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
image_storage_domain_map=20(=0A=20=20=20=20=20=20=20=20image_id,=0A=20=20=
=20=20=20=20=20=20storage_domain_id,=0A=20=20=20=20=20=20=20=20quota_id,=0A=
=20=20=20=20=20=20=20=20disk_profile_id=0A=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_image_id,=0A=20=20=20=20=20=
=20=20=20v_storage_domain_id,=0A=20=20=20=20=20=20=20=20v_quota_id,=0A=20=
=20=20=20=20=20=20=20v_disk_profile_id=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Deleteimage_storage_domain_map=20(=0A=20=20=20=20=
v_image_id=20UUID,=0A=20=20=20=20v_storage_domain_id=20UUID=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=
=20=20FROM=20image_storage_domain_map=0A=20=20=20=20WHERE=20image_id=20=3D=
=20v_image_id=0A=20=20=20=20=20=20=20=20AND=20storage_domain_id=20=3D=20=
v_storage_domain_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Deleteimage_storage_domain_map_by_image_id=20(v_image_id=20UUID)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20image_storage_domain_map=0A=20=20=20=20WHERE=20image_id=20=3D=20=
v_image_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getimage_storage_domain_mapByimage_id=20(v_image_id=20UUID)=0ARETURNS=20=
SETOF=20image_storage_domain_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
image_storage_domain_map=0A=20=20=20=20WHERE=20image_id=20=3D=20=
v_image_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getimage_storage_domain_mapBystorage_domain_id=20(v_storage_domain_id=20=
UUID)=0ARETURNS=20SETOF=20image_storage_domain_map=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20image_storage_domain_map=0A=20=20=20=20WHERE=20=
storage_domain_id=20=3D=20v_storage_domain_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateQuotaForImageAndSnapshots=20(=0A=20=20=20=20v_disk_id=20UUID,=0A=20=
=20=20=20v_storage_domain_id=20UUID,=0A=20=20=20=20v_quota_id=20UUID=0A=20=
=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
UPDATE=20image_storage_domain_map=20AS=20isdm=0A=20=20=20=20SET=20=
quota_id=20=3D=20v_quota_id=0A=20=20=20=20FROM=20images=20AS=20i=0A=20=20=
=20=20WHERE=20i.image_group_id=20=3D=20v_disk_id=0A=20=20=20=20=20=20=20=20=
AND=20i.image_guid=20=3D=20isdm.image_id=0A=20=20=20=20=20=20=20=20AND=20=
storage_domain_id=20=3D=20v_storage_domain_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateDiskProfileByImageGroupId=20(=0A=20=20=20=20v_image_group_id=20=
UUID,=0A=20=20=20=20v_storage_domain_id=20UUID,=0A=20=20=20=20=
v_disk_profile_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20image_storage_domain_map=20AS=20=
isdm=0A=20=20=20=20SET=20disk_profile_id=20=3D=20v_disk_profile_id=0A=20=20=
=20=20FROM=20images=20AS=20i=0A=20=20=20=20WHERE=20i.image_group_id=20=3D=20=
v_image_group_id=0A=20=20=20=20=20=20=20=20AND=20i.image_guid=20=3D=20=
isdm.image_id=0A=20=20=20=20=20=20=20=20AND=20storage_domain_id=20=3D=20=
v_storage_domain_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromImageUploads()=0A=
RETURNS=20SETOF=20image_transfers=20STABLE=0AAS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=20=20=20=20SELECT=20image_transfers.*=0A=20=20=
=20=20FROM=20image_transfers;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllImageUploadIds()=0A=
RETURNS=20SETOF=20UUID=20STABLE=0AAS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=20=20=20=20SELECT=20image_transfers.command_id=0A=20=20=
=20=20FROM=20image_transfers;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetImageUploadsByCommandId(v_command_id=20UUID)=0ARETURNS=20SETOF=20=
image_transfers=20STABLE=0AAS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=20=20=20=20SELECT=20image_transfers.*=0A=20=20=20=20FROM=20=
image_transfers=0A=20=20=20=20WHERE=20image_transfers.command_id=20=3D=20=
v_command_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetImageUploadsByDiskId(v_disk_id=20UUID)=0ARETURNS=20SETOF=20=
image_transfers=20STABLE=0AAS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=20=20=20=20SELECT=20image_transfers.*=0A=20=20=20=20FROM=20=
image_transfers=0A=20=20=20=20WHERE=20image_transfers.disk_id=20=3D=20=
v_disk_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateImageUploads(=0A=20=
=20=20=20v_command_id=20UUID,=0A=20=20=20=20v_command_type=20INTEGER,=0A=20=
=20=20=20v_phase=20INTEGER,=0A=20=20=20=20v_last_updated=20TIMESTAMP,=0A=20=
=20=20=20v_message=20VARCHAR,=0A=20=20=20=20v_vds_id=20UUID,=0A=20=20=20=20=
v_disk_id=20UUID,=0A=20=20=20=20v_imaged_ticket_id=20UUID,=0A=20=20=20=20=
v_proxy_uri=20VARCHAR,=0A=20=20=20=20v_signed_ticket=20VARCHAR,=0A=20=20=20=
=20v_bytes_sent=20BIGINT,=0A=20=20=20=20v_bytes_total=20BIGINT=0A=20=20=20=
=20)=0ARETURNS=20VOID=0AAS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
image_transfers=0A=20=20=20=20SET=20command_id=20=3D=20v_command_id,=0A=20=
=20=20=20=20=20=20=20command_type=20=3D=20v_command_type,=0A=20=20=20=20=20=
=20=20=20phase=20=3D=20v_phase,=0A=20=20=20=20=20=20=20=20last_updated=20=
=3D=20v_last_updated,=0A=20=20=20=20=20=20=20=20message=20=3D=20=
v_message,=0A=20=20=20=20=20=20=20=20vds_id=20=3D=20v_vds_id,=0A=20=20=20=
=20=20=20=20=20disk_id=20=3D=20v_disk_id,=0A=20=20=20=20=20=20=20=20=
imaged_ticket_id=20=3D=20v_imaged_ticket_id,=0A=20=20=20=20=20=20=20=20=
proxy_uri=20=3D=20v_proxy_uri,=0A=20=20=20=20=20=20=20=20signed_ticket=20=
=3D=20v_signed_ticket,=0A=20=20=20=20=20=20=20=20bytes_sent=20=3D=20=
v_bytes_sent,=0A=20=20=20=20=20=20=20=20bytes_total=20=3D=20=
v_bytes_total=0A=20=20=20=20WHERE=20command_id=20=3D=20v_command_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteImageUploads(v_command_id=20UUID)=0ARETURNS=20=
VOID=0AAS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
image_transfers=0A=20=20=20=20WHERE=20command_id=20=3D=20v_command_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertImageUploads(=0A=20=20=20=20v_command_id=20=
UUID,=0A=20=20=20=20v_command_type=20INTEGER,=0A=20=20=20=20v_phase=20=
INTEGER,=0A=20=20=20=20v_last_updated=20TIMESTAMP,=0A=20=20=20=20=
v_message=20VARCHAR,=0A=20=20=20=20v_vds_id=20UUID,=0A=20=20=20=20=
v_disk_id=20UUID,=0A=20=20=20=20v_imaged_ticket_id=20UUID,=0A=20=20=20=20=
v_proxy_uri=20VARCHAR,=0A=20=20=20=20v_signed_ticket=20VARCHAR,=0A=20=20=20=
=20v_bytes_sent=20BIGINT,=0A=20=20=20=20v_bytes_total=20BIGINT=0A=20=20=20=
=20)=0ARETURNS=20VOID=0AAS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20image_transfers(=0A=20=20=20=20=20=20=20=20command_id,=0A=20=20=20=
=20=20=20=20=20command_type,=0A=20=20=20=20=20=20=20=20phase,=0A=20=20=20=
=20=20=20=20=20last_updated,=0A=20=20=20=20=20=20=20=20message,=0A=20=20=20=
=20=20=20=20=20vds_id,=0A=20=20=20=20=20=20=20=20disk_id,=0A=20=20=20=20=20=
=20=20=20imaged_ticket_id,=0A=20=20=20=20=20=20=20=20proxy_uri,=0A=20=20=20=
=20=20=20=20=20signed_ticket,=0A=20=20=20=20=20=20=20=20bytes_sent,=0A=20=
=20=20=20=20=20=20=20bytes_total=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_command_id,=0A=20=20=20=20=20=20=20=
=20v_command_type,=0A=20=20=20=20=20=20=20=20v_phase,=0A=20=20=20=20=20=20=
=20=20v_last_updated,=0A=20=20=20=20=20=20=20=20v_message,=0A=20=20=20=20=
=20=20=20=20v_vds_id,=0A=20=20=20=20=20=20=20=20v_disk_id,=0A=20=20=20=20=
=20=20=20=20v_imaged_ticket_id,=0A=20=20=20=20=20=20=20=20v_proxy_uri,=0A=
=20=20=20=20=20=20=20=20v_signed_ticket,=0A=20=20=20=20=20=20=20=20=
v_bytes_sent,=0A=20=20=20=20=20=20=20=20v_bytes_total=0A=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
inst_update_default_storage_pool_type=20(v_is_local=20boolean)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20storage_pool=0A=20=
=20=20=20SET=20is_local=20=3D=20v_is_local,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20=
storage_pool.name=20=3D=20'Default'=0A=20=20=20=20=20=20=20=20AND=20NOT=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=
=20=20=20=20=20=20=20=20FROM=20storage_domains=0A=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20storage_domains.storage_pool_name=20=3D=20'Default'=0A=
=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
inst_add_iso_storage_domain=20(=0A=20=20=20=20v_storage_domain_id=20=
UUID,=0A=20=20=20=20v_name=20VARCHAR(250),=0A=20=20=20=20v_connection_id=20=
uuid,=0A=20=20=20=20v_connection=20VARCHAR(250),=0A=20=20=20=20=
v_available=20INT,=0A=20=20=20=20v_used=20INT=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ADECLARE=0A=0ABEGIN=0A=20=20=20=20IF=20NOT=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=
=20=20=20=20=20=20=20=20FROM=20storage_server_connections=0A=20=20=20=20=20=
=20=20=20=20=20=20=20WHERE=20connection=20=3D=20v_connection=0A=20=20=20=20=
=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20--=20Insert=20=
storage=20server=20connection=20info=0A=20=20=20=20=20=20=20=20perform=20=
Insertstorage_server_connections(v_connection,=20cast(v_connection_id=20=
AS=20VARCHAR(250)),=20NULL,=20NULL,=20NULL,=20NULL,=201,=20NULL,=20NULL,=20=
NULL,=20NULL,=20NULL,=20NULL);=0A=20=20=20=20=20=20=20=20--=20Insert=20=
storage=20domain=20static=20info=0A=20=20=20=20=20=20=20=20perform=20=
Insertstorage_domain_static(v_storage_domain_id,=20cast(v_connection_id=20=
AS=20VARCHAR(250)),=20v_name,=20v_name,=20'',=201,=202,=20'0',=200,=20=
FALSE,=20NULL,=20NULL);=0A=0A=20=20=20=20--=20Insert=20storage=20domain=20=
dynamic=20=20info=0A=20=20=20=20perform=20=
Insertstorage_domain_dynamic(v_available,=20v_storage_domain_id,=20=
v_used);=0A=20=20=20=20END=20IF;=0A=0A=20=20=20=20exception=20when=20=
others=20then=20RAISE=20EXCEPTION=20'NUM:%,=20DETAILS:%',=0A=20=20=20=20=20=
=20=20=20SQLSTATE,=0A=20=20=20=20=20=20=20=20SQLERRM;=0A=20=20=20=20=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20inst_update_service_type=20(=0A=20=20=20=20=
v_cluster_id=20uuid,=0A=20=20=20=20v_virt_service=20boolean,=0A=20=20=20=20=
v_gluster_service=20boolean=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20cluster=0A=20=20=20=20SET=20=
virt_service=20=3D=20v_virt_service,=0A=20=20=20=20=20=20=20=20=
gluster_service=20=3D=20v_gluster_service=0A=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20inst_add_glance_provider=20=
(=0A=20=20=20=20v_provider_id=20UUID,=0A=20=20=20=20v_provider_name=20=
VARCHAR(128),=0A=20=20=20=20v_provider_description=20VARCHAR(4000),=0A=20=
=20=20=20v_provider_url=20VARCHAR(512),=0A=20=20=20=20=
v_storage_domain_id=20UUID,=0A=20=20=20=20v_auth_required=20boolean=20=
DEFAULT=20false,=0A=20=20=20=20v_auth_username=20VARCHAR(64)=20DEFAULT=20=
NULL,=0A=20=20=20=20v_auth_password=20TEXT=20DEFAULT=20NULL,=0A=20=20=20=20=
v_auth_url=20TEXT=20DEFAULT=20NULL,=0A=20=20=20=20v_tenant_name=20=
VARCHAR(128)=20DEFAULT=20NULL=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20--=20Adding=20the=20Glance=20provider=0A=
=20=20=20=20INSERT=20INTO=20providers=20(=0A=20=20=20=20=20=20=20=20id,=0A=
=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20description,=0A=20=
=20=20=20=20=20=20=20url,=0A=20=20=20=20=20=20=20=20provider_type,=0A=20=20=
=20=20=20=20=20=20auth_required,=0A=20=20=20=20=20=20=20=20=
auth_username,=0A=20=20=20=20=20=20=20=20auth_password,=0A=20=20=20=20=20=
=20=20=20auth_url,=0A=20=20=20=20=20=20=20=20tenant_name=0A=20=20=20=20=20=
=20=20=20)=0A=20=20=20=20SELECT=20v_provider_id,=0A=20=20=20=20=20=20=20=20=
v_provider_name,=0A=20=20=20=20=20=20=20=20v_provider_description,=0A=20=20=
=20=20=20=20=20=20v_provider_url,=0A=20=20=20=20=20=20=20=20=
'OPENSTACK_IMAGE',=0A=20=20=20=20=20=20=20=20v_auth_required,=0A=20=20=20=
=20=20=20=20=20v_auth_username,=0A=20=20=20=20=20=20=20=20=
v_auth_password,=0A=20=20=20=20=20=20=20=20v_auth_url,=0A=20=20=20=20=20=20=
=20=20v_tenant_name=0A=20=20=20=20WHERE=20NOT=20EXISTS=20(=0A=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=20id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20providers=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20id=20=3D=20=
v_provider_id=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=
--=20Adding=20a=20proper=20storage=20domain=20static=20entry=0A=20=20=20=20=
INSERT=20INTO=20storage_domain_static=20(=0A=20=20=20=20=20=20=20=20id,=0A=
=20=20=20=20=20=20=20=20storage,=0A=20=20=20=20=20=20=20=20storage_name,=0A=
=20=20=20=20=20=20=20=20storage_domain_type,=0A=20=20=20=20=20=20=20=20=
storage_type,=0A=20=20=20=20=20=20=20=20storage_domain_format_type,=0A=20=
=20=20=20=20=20=20=20recoverable=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
SELECT=20v_storage_domain_id,=0A=20=20=20=20=20=20=20=20v_provider_id,=0A=
=20=20=20=20=20=20=20=20v_provider_name,=0A=20=20=20=20=20=20=20=204,=0A=20=
=20=20=20=20=20=20=208,=0A=20=20=20=20=20=20=20=200,=0A=20=20=20=20=20=20=
=20=20true=0A=20=20=20=20WHERE=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
storage_domain_static=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20id=20=
=3D=20v_storage_domain_id=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=
=20=20=20--=20Adding=20a=20proper=20storage=20domain=20dynamic=20entry=0A=
=20=20=20=20INSERT=20INTO=20storage_domain_dynamic=20(=0A=20=20=20=20=20=20=
=20=20id,=0A=20=20=20=20=20=20=20=20available_disk_size,=0A=20=20=20=20=20=
=20=20=20used_disk_size=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20SELECT=20=
v_storage_domain_id,=0A=20=20=20=20=20=20=20=20NULL,=0A=20=20=20=20=20=20=
=20=20NULL=0A=20=20=20=20WHERE=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
storage_domain_dynamic=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20id=20=
=3D=20v_storage_domain_id=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetIscsiBondByIscsiBondId=20(v_id=20UUID)=0ARETURNS=20=
SETOF=20iscsi_bonds=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20iscsi_bonds.*=0A=20=20=20=20=
FROM=20iscsi_bonds=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromIscsiBonds=20()=0ARETURNS=20SETOF=20=
iscsi_bonds=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20iscsi_bonds.*=0A=20=20=20=20FROM=20=
iscsi_bonds;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetIscsiBondsByStoragePoolId=20(v_storage_pool_id=20UUID)=0ARETURNS=20=
SETOF=20iscsi_bonds=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20iscsi_bonds.*=0A=20=20=20=20=
FROM=20iscsi_bonds=0A=20=20=20=20WHERE=20storage_pool_id=20=3D=20=
v_storage_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetNetworksByIscsiBondId=20=
(v_iscsi_bond_id=20UUID)=0ARETURNS=20SETOF=20UUID=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
iscsi_bonds_networks_map.network_id=0A=20=20=20=20FROM=20=
iscsi_bonds_networks_map=0A=20=20=20=20WHERE=20iscsi_bond_id=20=3D=20=
v_iscsi_bond_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetIscsiBondsByNetworkId=20=
(v_network_id=20UUID)=0ARETURNS=20SETOF=20iscsi_bonds=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
iscsi_bonds.*=0A=20=20=20=20FROM=20iscsi_bonds_networks_map,=0A=20=20=20=20=
=20=20=20=20iscsi_bonds=0A=20=20=20=20WHERE=20iscsi_bonds.id=20=3D=20=
iscsi_bonds_networks_map.iscsi_bond_id=0A=20=20=20=20=20=20=20=20AND=20=
network_id=20=3D=20v_network_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertIscsiBond=20(=0A=20=
=20=20=20v_id=20UUID,=0A=20=20=20=20v_name=20VARCHAR(50),=0A=20=20=20=20=
v_description=20VARCHAR(4000),=0A=20=20=20=20v_storage_pool_id=20UUID=0A=20=
=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
INSERT=20INTO=20iscsi_bonds=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=
=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20description,=0A=20=20=20=20=
=20=20=20=20storage_pool_id=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20=
v_name,=0A=20=20=20=20=20=20=20=20v_description,=0A=20=20=20=20=20=20=20=20=
v_storage_pool_id=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateIscsiBond=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_name=20=
VARCHAR(50),=0A=20=20=20=20v_description=20VARCHAR(4000)=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
iscsi_bonds=0A=20=20=20=20SET=20name=20=3D=20v_name,=0A=20=20=20=20=20=20=
=20=20description=20=3D=20v_description=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteIscsiBond=20(v_id=20=
UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_val=20UUID;=0A=0A=
BEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20iscsi_bonds=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20AddNetworkToIscsiBond=20=
(=0A=20=20=20=20v_iscsi_bond_id=20UUID,=0A=20=20=20=20v_network_id=20=
UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20INSERT=20INTO=20iscsi_bonds_networks_map=20(=0A=20=20=20=20=20=20=20=
=20iscsi_bond_id,=0A=20=20=20=20=20=20=20=20network_id=0A=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_iscsi_bond_id,=0A=20=20=20=20=20=20=20=20v_network_id=0A=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
RemoveNetworkFromIscsiBond=20(=0A=20=20=20=20v_iscsi_bond_id=20UUID,=0A=20=
=20=20=20v_network_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
iscsi_bonds_networks_map=0A=20=20=20=20WHERE=20iscsi_bond_id=20=3D=20=
v_iscsi_bond_id=0A=20=20=20=20=20=20=20=20AND=20network_id=20=3D=20=
v_network_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20AddConnectionToIscsiBond=20=
(=0A=20=20=20=20v_iscsi_bond_id=20UUID,=0A=20=20=20=20v_connection_id=20=
VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20INSERT=20INTO=20iscsi_bonds_storage_connections_map=20(=0A=20=
=20=20=20=20=20=20=20iscsi_bond_id,=0A=20=20=20=20=20=20=20=20=
connection_id=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=
=20=20=20=20=20=20v_iscsi_bond_id,=0A=20=20=20=20=20=20=20=20=
v_connection_id=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
RemoveConnectionFromIscsiBond=20(=0A=20=20=20=20v_iscsi_bond_id=20UUID,=0A=
=20=20=20=20v_connection_id=20VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
iscsi_bonds_storage_connections_map=0A=20=20=20=20WHERE=20iscsi_bond_id=20=
=3D=20v_iscsi_bond_id=0A=20=20=20=20=20=20=20=20AND=20connection_id=20=3D=20=
v_connection_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetConnectionsByIscsiBondId=20(v_iscsi_bond_id=20UUID)=0ARETURNS=20SETOF=20=
VARCHAR(50)=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20=
iscsi_bonds_storage_connections_map.connection_id=0A=20=20=20=20FROM=20=
iscsi_bonds_storage_connections_map=0A=20=20=20=20WHERE=20iscsi_bond_id=20=
=3D=20v_iscsi_bond_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertJob=20(=0A=20=20=20=
=20v_job_id=20UUID,=0A=20=20=20=20v_action_type=20VARCHAR(50),=0A=20=20=20=
=20v_description=20TEXT,=0A=20=20=20=20v_status=20VARCHAR(32),=0A=20=20=20=
=20v_owner_id=20UUID,=0A=20=20=20=20v_engine_session_seq_id=20BIGINT,=0A=20=
=20=20=20v_visible=20BOOLEAN,=0A=20=20=20=20v_start_time=20TIMESTAMP=20=
WITH=20TIME=20ZONE,=0A=20=20=20=20v_end_time=20TIMESTAMP=20WITH=20TIME=20=
ZONE,=0A=20=20=20=20v_last_update_time=20TIMESTAMP=20WITH=20TIME=20ZONE,=0A=
=20=20=20=20v_correlation_id=20VARCHAR(50),=0A=20=20=20=20v_is_external=20=
boolean,=0A=20=20=20=20v_is_auto_cleared=20boolean=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
job=20(=0A=20=20=20=20=20=20=20=20job_id,=0A=20=20=20=20=20=20=20=20=
action_type,=0A=20=20=20=20=20=20=20=20description,=0A=20=20=20=20=20=20=20=
=20status,=0A=20=20=20=20=20=20=20=20owner_id,=0A=20=20=20=20=20=20=20=20=
engine_session_seq_id,=0A=20=20=20=20=20=20=20=20visible,=0A=20=20=20=20=20=
=20=20=20start_time,=0A=20=20=20=20=20=20=20=20end_time,=0A=20=20=20=20=20=
=20=20=20last_update_time,=0A=20=20=20=20=20=20=20=20correlation_id,=0A=20=
=20=20=20=20=20=20=20is_external,=0A=20=20=20=20=20=20=20=20=
is_auto_cleared=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=
=20=20=20=20=20=20=20v_job_id,=0A=20=20=20=20=20=20=20=20v_action_type,=0A=
=20=20=20=20=20=20=20=20v_description,=0A=20=20=20=20=20=20=20=20=
v_status,=0A=20=20=20=20=20=20=20=20v_owner_id,=0A=20=20=20=20=20=20=20=20=
v_engine_session_seq_id,=0A=20=20=20=20=20=20=20=20v_visible,=0A=20=20=20=
=20=20=20=20=20v_start_time,=0A=20=20=20=20=20=20=20=20v_end_time,=0A=20=20=
=20=20=20=20=20=20v_last_update_time,=0A=20=20=20=20=20=20=20=20=
v_correlation_id,=0A=20=20=20=20=20=20=20=20v_is_external,=0A=20=20=20=20=
=20=20=20=20v_is_auto_cleared=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetJobByJobId=20(v_job_id=20UUID)=0ARETURNS=20SETOF=20=
job=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=
=20=20=20=20SELECT=20job.*=0A=20=20=20=20FROM=20JOB=0A=20=20=20=20WHERE=20=
job_id=20=3D=20v_job_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllJobs=20()=0A=
RETURNS=20SETOF=20job=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20job.*=0A=20=20=20=20FROM=20JOB=0A=
=20=20=20=20WHERE=20status=20!=3D=20'UNKNOWN'=0A=20=20=20=20ORDER=20BY=20=
start_time=20DESC;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetJobsByOffsetAndPageSize=20(=0A=20=20=20=20v_position=20INT,=0A=20=20=20=
=20v_page_size=20INT=0A=20=20=20=20)=0ARETURNS=20SETOF=20job=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY(SELECT=20job.*=20=
FROM=20JOB=20WHERE=20status=20=3D=20'STARTED'=20ORDER=20BY=20=
last_update_time=20DESC)=0A=0A=20=20=20=20UNION=20ALL=0A=0A=20=20=20=20(=0A=
=20=20=20=20=20=20=20=20SELECT=20job.*=0A=20=20=20=20=20=20=20=20FROM=20=
JOB=0A=20=20=20=20=20=20=20=20WHERE=20status=20NOT=20IN=20(=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20'STARTED',=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20'UNKNOWN'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20)=0A=20=20=20=20=20=20=20=20ORDER=20BY=20last_update_time=20=
DESC=0A=20=20=20=20=20=20=20=20)=20OFFSET=20v_position=20LIMIT=20=
v_page_size;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetJobsByCorrelationId=20=
(v_correlation_id=20VARCHAR(50))=0ARETURNS=20SETOF=20job=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
job.*=0A=20=20=20=20FROM=20JOB=0A=20=20=20=20WHERE=20correlation_id=20=3D=20=
v_correlation_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetJobsByEngineSessionSeqIdAndStatus=20(=0A=20=20=20=20=
v_engine_session_seq_id=20BIGINT,=0A=20=20=20=20v_status=20VARCHAR(32)=0A=
=20=20=20=20)=0ARETURNS=20SETOF=20job=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=20=20=20=20SELECT=20job.*=0A=20=20=20=
=20FROM=20JOB=0A=20=20=20=20WHERE=20engine_session_seq_id=20=3D=20=
v_engine_session_seq_id=0A=20=20=20=20=20=20=20=20AND=20status=20=3D=20=
v_status;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateJob=20(=0A=20=20=20=
=20v_job_id=20UUID,=0A=20=20=20=20v_action_type=20VARCHAR(50),=0A=20=20=20=
=20v_description=20TEXT,=0A=20=20=20=20v_status=20VARCHAR(32),=0A=20=20=20=
=20v_owner_id=20UUID,=0A=20=20=20=20v_engine_session_seq_id=20BIGINT,=0A=20=
=20=20=20v_visible=20BOOLEAN,=0A=20=20=20=20v_start_time=20TIMESTAMP=20=
WITH=20TIME=20ZONE,=0A=20=20=20=20v_end_time=20TIMESTAMP=20WITH=20TIME=20=
ZONE,=0A=20=20=20=20v_last_update_time=20TIMESTAMP=20WITH=20TIME=20ZONE,=0A=
=20=20=20=20v_correlation_id=20VARCHAR(50),=0A=20=20=20=20v_is_external=20=
boolean,=0A=20=20=20=20v_is_auto_cleared=20boolean=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20job=0A=20=
=20=20=20SET=20action_type=20=3D=20v_action_type,=0A=20=20=20=20=20=20=20=
=20description=20=3D=20v_description,=0A=20=20=20=20=20=20=20=20status=20=
=3D=20v_status,=0A=20=20=20=20=20=20=20=20owner_id=20=3D=20v_owner_id,=0A=
=20=20=20=20=20=20=20=20engine_session_seq_id=20=3D=20=
v_engine_session_seq_id,=0A=20=20=20=20=20=20=20=20visible=20=3D=20=
v_visible,=0A=20=20=20=20=20=20=20=20start_time=20=3D=20v_start_time,=0A=20=
=20=20=20=20=20=20=20end_time=20=3D=20v_end_time,=0A=20=20=20=20=20=20=20=
=20last_update_time=20=3D=20v_last_update_time,=0A=20=20=20=20=20=20=20=20=
correlation_id=20=3D=20v_correlation_id,=0A=20=20=20=20=20=20=20=20=
is_external=20=3D=20v_is_external,=0A=20=20=20=20=20=20=20=20=
is_auto_cleared=20=3D=20v_is_auto_cleared=0A=20=20=20=20WHERE=20job_id=20=
=3D=20v_job_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateJobLastUpdateTime=20=
(=0A=20=20=20=20v_job_id=20UUID,=0A=20=20=20=20v_last_update_time=20=
TIMESTAMP=20WITH=20TIME=20ZONE=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20job=0A=20=20=20=20SET=20=
last_update_time=20=3D=20v_last_update_time=0A=20=20=20=20WHERE=20job_id=20=
=3D=20v_job_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteJobOlderThanDateWithStatus=20(=0A=20=20=20=20v_end_time=20=
TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20v_status=20TEXT=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=
=20=20=20FROM=20job=0A=20=20=20=20WHERE=20is_auto_cleared=0A=20=20=20=20=20=
=20=20=20AND=20end_time=20<=20v_end_time=0A=20=20=20=20=20=20=20=20AND=20=
status=20=3D=20ANY=20(string_to_array(v_status,=20',')::VARCHAR=20[]);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteJob=20(v_job_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20job=0A=20=20=
=20=20WHERE=20job_id=20=3D=20v_job_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertJobSubjectEntity=20(=0A=20=20=20=20v_job_id=20UUID,=0A=20=20=20=20=
v_entity_id=20UUID,=0A=20=20=20=20v_entity_type=20VARCHAR(32)=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20job_subject_entity=20(=0A=20=20=20=20=20=20=20=20job_id,=0A=20=20=20=
=20=20=20=20=20entity_id,=0A=20=20=20=20=20=20=20=20entity_type=0A=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_job_id,=0A=20=20=20=20=20=20=20=20v_entity_id,=0A=20=20=20=20=20=20=20=20=
v_entity_type=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetJobSubjectEntityByJobId=20(v_job_id=20UUID)=0ARETURNS=20SETOF=20=
job_subject_entity=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20job_subject_entity.*=0A=20=20=20=
=20FROM=20job_subject_entity=0A=20=20=20=20WHERE=20job_id=20=3D=20=
v_job_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllJobIdsByEntityId=20=
(v_entity_id=20UUID)=0ARETURNS=20SETOF=20UUID=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
job_subject_entity.job_id=0A=20=20=20=20FROM=20job_subject_entity=0A=20=20=
=20=20WHERE=20entity_id=20=3D=20v_entity_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertStep=20(=0A=20=20=20=20v_step_id=20UUID,=0A=20=20=20=20=
v_parent_step_id=20UUID,=0A=20=20=20=20v_job_id=20UUID,=0A=20=20=20=20=
v_step_type=20VARCHAR(32),=0A=20=20=20=20v_description=20TEXT,=0A=20=20=20=
=20v_step_number=20INT,=0A=20=20=20=20v_status=20VARCHAR(32),=0A=20=20=20=
=20v_start_time=20TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20=
v_end_time=20TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20=
v_correlation_id=20VARCHAR(50),=0A=20=20=20=20v_external_id=20UUID,=0A=20=
=20=20=20v_external_system_type=20VARCHAR(32),=0A=20=20=20=20=
v_is_external=20boolean=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20step=20(=0A=20=20=20=20=
=20=20=20=20step_id,=0A=20=20=20=20=20=20=20=20parent_step_id,=0A=20=20=20=
=20=20=20=20=20job_id,=0A=20=20=20=20=20=20=20=20step_type,=0A=20=20=20=20=
=20=20=20=20description,=0A=20=20=20=20=20=20=20=20step_number,=0A=20=20=20=
=20=20=20=20=20status,=0A=20=20=20=20=20=20=20=20start_time,=0A=20=20=20=20=
=20=20=20=20end_time,=0A=20=20=20=20=20=20=20=20correlation_id,=0A=20=20=20=
=20=20=20=20=20external_id,=0A=20=20=20=20=20=20=20=20=
external_system_type,=0A=20=20=20=20=20=20=20=20is_external=0A=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_step_id,=0A=20=20=20=20=20=20=20=20v_parent_step_id,=0A=20=20=20=20=20=20=
=20=20v_job_id,=0A=20=20=20=20=20=20=20=20v_step_type,=0A=20=20=20=20=20=20=
=20=20v_description,=0A=20=20=20=20=20=20=20=20v_step_number,=0A=20=20=20=
=20=20=20=20=20v_status,=0A=20=20=20=20=20=20=20=20v_start_time,=0A=20=20=
=20=20=20=20=20=20v_end_time,=0A=20=20=20=20=20=20=20=20=
v_correlation_id,=0A=20=20=20=20=20=20=20=20v_external_id,=0A=20=20=20=20=
=20=20=20=20v_external_system_type,=0A=20=20=20=20=20=20=20=20=
v_is_external=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateStep=20(=0A=
=20=20=20=20v_step_id=20UUID,=0A=20=20=20=20v_parent_step_id=20UUID,=0A=20=
=20=20=20v_job_id=20UUID,=0A=20=20=20=20v_step_type=20VARCHAR(32),=0A=20=20=
=20=20v_description=20TEXT,=0A=20=20=20=20v_step_number=20INT,=0A=20=20=20=
=20v_status=20VARCHAR(32),=0A=20=20=20=20v_start_time=20TIMESTAMP=20WITH=20=
TIME=20ZONE,=0A=20=20=20=20v_end_time=20TIMESTAMP=20WITH=20TIME=20ZONE,=0A=
=20=20=20=20v_correlation_id=20VARCHAR(50),=0A=20=20=20=20v_external_id=20=
UUID,=0A=20=20=20=20v_external_system_type=20VARCHAR(32)=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20step=0A=20=
=20=20=20SET=20parent_step_id=20=3D=20v_parent_step_id,=0A=20=20=20=20=20=
=20=20=20job_id=20=3D=20v_job_id,=0A=20=20=20=20=20=20=20=20step_type=20=
=3D=20v_step_type,=0A=20=20=20=20=20=20=20=20description=20=3D=20=
v_description,=0A=20=20=20=20=20=20=20=20step_number=20=3D=20=
v_step_number,=0A=20=20=20=20=20=20=20=20status=20=3D=20v_status,=0A=20=20=
=20=20=20=20=20=20start_time=20=3D=20v_start_time,=0A=20=20=20=20=20=20=20=
=20end_time=20=3D=20v_end_time,=0A=20=20=20=20=20=20=20=20correlation_id=20=
=3D=20v_correlation_id,=0A=20=20=20=20=20=20=20=20external_id=20=3D=20=
v_external_id,=0A=20=20=20=20=20=20=20=20external_system_type=20=3D=20=
v_external_system_type=0A=20=20=20=20WHERE=20step_id=20=3D=20v_step_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateStepStatusAndEndTime=20(=0A=20=20=20=20=
v_step_id=20UUID,=0A=20=20=20=20v_status=20VARCHAR(32),=0A=20=20=20=20=
v_end_time=20TIMESTAMP=20WITH=20TIME=20ZONE=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20step=0A=20=20=20=20=
SET=20status=20=3D=20v_status,=0A=20=20=20=20=20=20=20=20end_time=20=3D=20=
v_end_time=0A=20=20=20=20WHERE=20step_id=20=3D=20v_step_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateStepExternalIdAndType=20(=0A=20=20=20=20=
v_step_id=20UUID,=0A=20=20=20=20v_external_id=20UUID,=0A=20=20=20=20=
v_external_system_type=20VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20step=0A=20=20=20=20SET=20=
external_id=20=3D=20v_external_id,=0A=20=20=20=20=20=20=20=20=
external_system_type=20=3D=20v_external_system_type=0A=20=20=20=20WHERE=20=
step_id=20=3D=20v_step_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetStepByStepId=20=
(v_step_id=20UUID)=0ARETURNS=20SETOF=20step=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20step.*=0A=20=
=20=20=20FROM=20step=0A=20=20=20=20WHERE=20step_id=20=3D=20v_step_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetStepsByJobId=20(v_job_id=20UUID)=0ARETURNS=20=
SETOF=20step=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20step.*=0A=20=20=20=20FROM=20step=0A=20=20=
=20=20WHERE=20job_id=20=3D=20v_job_id=0A=20=20=20=20ORDER=20BY=20=
parent_step_id=20nulls=20first,=0A=20=20=20=20=20=20=20=20step_number;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetStepsByParentStepId=20(v_parent_step_id=20UUID)=0A=
RETURNS=20SETOF=20step=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20step.*=0A=20=20=20=20FROM=20=
step=0A=20=20=20=20WHERE=20parent_step_id=20=3D=20v_parent_step_id=0A=20=20=
=20=20ORDER=20BY=20step_number;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllSteps=20()=0A=
RETURNS=20SETOF=20step=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20step.*=0A=20=20=20=20FROM=20=
step;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteStep=20(v_step_id=20=
UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=
=20=20=20=20FROM=20step=0A=20=20=20=20WHERE=20step_id=20=3D=20v_step_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20updateJobStepsCompleted=20(=0A=20=20=20=20v_job_id=20=
UUID,=0A=20=20=20=20v_status=20VARCHAR(32),=0A=20=20=20=20v_end_time=20=
TIMESTAMP=20WITH=20TIME=20ZONE=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20step=0A=20=20=20=20SET=20=
status=20=3D=20v_status,=0A=20=20=20=20=20=20=20=20end_time=20=3D=20=
v_end_time=0A=20=20=20=20WHERE=20job_id=20=3D=20v_job_id=0A=20=20=20=20=20=
=20=20=20AND=20status=20=3D=20'STARTED'=0A=20=20=20=20=20=20=20=20AND=20=
status=20!=3D=20v_status;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateStartedExecutionEntitiesToUnknown=20(v_end_time=20TIMESTAMP=20WITH=20=
TIME=20ZONE)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
UPDATE=20job=0A=20=20=20=20SET=20status=20=3D=20'UNKNOWN',=0A=20=20=20=20=
=20=20=20=20end_time=20=3D=20v_end_time,=0A=20=20=20=20=20=20=20=20=
last_update_time=20=3D=20v_end_time=0A=20=20=20=20WHERE=20job.status=20=3D=
=20'STARTED'=0A=20=20=20=20=20=20=20=20AND=20job_id=20NOT=20IN=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20SELECT=20job_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20step=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
external_id=20IS=20NOT=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=0A=20=20=20=20UPDATE=20step=0A=20=20=20=20SET=20status=20=3D=20=
'UNKNOWN',=0A=20=20=20=20=20=20=20=20end_time=20=3D=20v_end_time=0A=20=20=
=20=20WHERE=20status=20=3D=20'STARTED'=0A=20=20=20=20=20=20=20=20AND=20=
job_id=20NOT=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
step.job_id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20step=20step=0A=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20step.external_id=20IS=20NOT=20=
NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteRunningJobsOfTasklessCommands=20()=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20job=0A=20=20=
=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20status=20=3D=20=
'STARTED'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20action_type=20IN=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'MigrateVm',=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20'MigrateVmToServer',=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20'RunVm',=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20'RunVmOnce'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=
=20=20AND=20job_id=20NOT=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20job_id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20step=0A=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20step_id=20IN=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20step_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20async_tasks=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=
=20=20=20=20=20=20=20);=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20job=0A=
=20=20=20=20WHERE=20job_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20job_id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20step=0A=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20status=20=3D=20'STARTED'=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20step_type=20=3D=20=
'MIGRATE_VM'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteCompletedJobsOlderThanDate=20(=0A=20=20=20=20v_succeeded_end_time=20=
TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20v_failed_end_time=20=
TIMESTAMP=20WITH=20TIME=20ZONE=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20job=0A=20=20=
=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20is_auto_cleared=0A=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20end_time=20<=20v_succeeded_end_time=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20status=20=3D=20'FINISHED'=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20end_time=20<=20v_failed_end_time=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20status=20IN=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
'FAILED',=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20'ABORTED',=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20'UNKNOWN'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CheckIfJobHasTasks=20(v_job_id=20UUID)=0ARETURNS=20SETOF=20=
booleanResultType=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20EXISTS=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
step=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20job_id=20=3D=20=
v_job_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
external_id=20IS=20NOT=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20AND=20external_system_type=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20'VDSM',=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20'GLUSTER'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetStepsByExternalTaskId=20(v_external_id=20UUID)=0A=
RETURNS=20SETOF=20step=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20step.*=0A=20=20=20=20FROM=20=
step=0A=20=20=20=20WHERE=20external_id=20=3D=20v_external_id=0A=20=20=20=20=
ORDER=20BY=20parent_step_id=20nulls=20first,=0A=20=20=20=20=20=20=20=20=
step_number;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetExternalIdsFromSteps=20=
(=0A=20=20=20=20v_status=20VARCHAR(32),=0A=20=20=20=20=
v_external_system_type=20VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
UUID=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=
=20=20=20=20SELECT=20step.external_id=0A=20=20=20=20FROM=20step=0A=20=20=20=
=20INNER=20JOIN=20job=0A=20=20=20=20=20=20=20=20ON=20step.job_id=20=3D=20=
job.job_id=0A=20=20=20=20WHERE=20job.status=20=3D=20v_status=0A=20=20=20=20=
=20=20=20=20AND=20step.external_system_type=20=3D=20=
v_external_system_type;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20CreateLabel=20(=0A=20=20=20=
=20v_label_id=20UUID,=0A=20=20=20=20v_label_name=20VARCHAR(50),=0A=20=20=20=
=20v_readonly=20BOOLEAN,=0A=20=20=20=20v_vms=20uuid[],=0A=20=20=20=20=
v_hosts=20uuid[]=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
DECLARE=0A=20=20=20o=20uuid;=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
labels=20(=0A=20=20=20=20=20=20=20=20label_id,=0A=20=20=20=20=20=20=20=20=
label_name,=0A=20=20=20=20=20=20=20=20read_only=0A=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_label_id,=0A=20=20=
=20=20=20=20=20=20v_label_name,=0A=20=20=20=20=20=20=20=20v_readonly=0A=20=
=20=20=20=20=20=20=20);=0A=0A=20=20=20=20--=20Insert=20VM=20references=0A=
=20=20=20=20FOREACH=20o=20IN=20ARRAY=20v_vms=0A=20=20=20=20LOOP=0A=20=20=20=
=20=20=20=20=20INSERT=20INTO=20labels_map=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20label_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20vm_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_label_id,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20o=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20END=20=
LOOP;=0A=0A=20=20=20=20--=20Insert=20host=20references=0A=20=20=20=20=
FOREACH=20o=20IN=20ARRAY=20v_hosts=0A=20=20=20=20LOOP=0A=20=20=20=20=20=20=
=20=20INSERT=20INTO=20labels_map=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
label_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20vds_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20v_label_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20o=0A=
=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20END=20LOOP;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateLabel=20(=0A=20=20=20=20v_label_id=20UUID,=0A=20=
=20=20=20v_label_name=20VARCHAR(50),=0A=20=20=20=20v_readonly=20BOOLEAN,=0A=
=20=20=20=20v_vms=20uuid[],=0A=20=20=20=20v_hosts=20uuid[]=0A=20=20=20=20=
)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0A=
DECLARE=0A=20=20=20o=20uuid;=0ABEGIN=0A=20=20=20=20UPDATE=20labels=0A=20=20=
=20=20SET=20label_name=20=3D=20v_label_name,=0A=20=20=20=20=20=20=20=20=
read_only=20=3D=20v_readonly=0A=20=20=20=20WHERE=20label_id=20=3D=20=
v_label_id;=0A=0A=20=20=20=20DELETE=20FROM=20labels_map=0A=20=20=20=20=
WHERE=20label_id=20=3D=20v_label_id;=0A=0A=20=20=20=20--=20Insert=20VM=20=
references=0A=20=20=20=20FOREACH=20o=20IN=20ARRAY=20v_vms=0A=20=20=20=20=
LOOP=0A=20=20=20=20=20=20=20=20INSERT=20INTO=20labels_map=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20label_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vm_id=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20v_label_id,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20o=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=
=20=20END=20LOOP;=0A=0A=20=20=20=20--=20Insert=20host=20references=0A=20=20=
=20=20FOREACH=20o=20IN=20ARRAY=20v_hosts=0A=20=20=20=20LOOP=0A=20=20=20=20=
=20=20=20=20INSERT=20INTO=20labels_map=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20label_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20vds_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_label_id,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20o=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20END=20LOOP;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteLabel=20(v_label_id=20UUID)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
labels=0A=20=20=20=20WHERE=20label_id=20=3D=20v_label_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllLabels=20()=0ARETURNS=20SETOF=20=
labels_map_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20labels_map_view.*=0A=20=20=20=20FROM=20=
labels_map_view;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetLabelById=20=
(v_label_id=20UUID)=0ARETURNS=20SETOF=20labels_map_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
labels_map_view.*=0A=20=20=20=20FROM=20labels_map_view=0A=20=20=20=20=
WHERE=20label_id=20=3D=20v_label_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetLabelByIds=20=
(v_label_ids=20UUID[])=0ARETURNS=20SETOF=20labels_map_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
labels_map_view.*=0A=20=20=20=20FROM=20labels_map_view=0A=20=20=20=20=
WHERE=20label_id=20=3D=20ANY(v_label_ids);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetLabelByName=20=
(v_label_name=20varchar(50))=0ARETURNS=20SETOF=20labels_map_view=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20labels_map_view.*=0A=20=20=20=20FROM=20labels_map_view=0A=20=
=20=20=20WHERE=20label_name=20=3D=20v_label_name;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetLabelsByReferencedIds=20(v_entity_ids=20UUID[])=0ARETURNS=20SETOF=20=
labels_map_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20labels_map_view.*=0A=20=20=20=20FROM=20=
labels_map_view=0A=20=20=20=20WHERE=20vm_ids::uuid[]=20&&=20v_entity_ids=0A=
=20=20=20=20=20=20=20=20OR=20vds_ids::uuid[]=20&&=20v_entity_ids;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetLibvirtSecretByLibvirtSecretId=20(v_secret_id=20=
UUID)=0ARETURNS=20SETOF=20libvirt_secrets=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20libvirt_secrets=0A=20=20=20=20WHERE=20secret_id=20=3D=20=
v_secret_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertLibvirtSecret=20(=0A=
=20=20=20=20v_secret_id=20UUID,=0A=20=20=20=20v_secret_value=20TEXT,=0A=20=
=20=20=20v_secret_usage_type=20INT,=0A=20=20=20=20v_secret_description=20=
TEXT,=0A=20=20=20=20v_provider_id=20UUID,=0A=20=20=20=20v__create_date=20=
TIMESTAMP=20WITH=20TIME=20ZONE=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20libvirt_secrets=20(=0A=20=
=20=20=20=20=20=20=20secret_id,=0A=20=20=20=20=20=20=20=20secret_value,=0A=
=20=20=20=20=20=20=20=20secret_usage_type,=0A=20=20=20=20=20=20=20=20=
secret_description,=0A=20=20=20=20=20=20=20=20provider_id,=0A=20=20=20=20=
=20=20=20=20_create_date=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_secret_id,=0A=20=20=20=20=20=20=20=
=20v_secret_value,=0A=20=20=20=20=20=20=20=20v_secret_usage_type,=0A=20=20=
=20=20=20=20=20=20v_secret_description,=0A=20=20=20=20=20=20=20=20=
v_provider_id,=0A=20=20=20=20=20=20=20=20v__create_date=0A=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateLibvirtSecret=20(=0A=
=20=20=20=20v_secret_id=20UUID,=0A=20=20=20=20v_secret_value=20TEXT,=0A=20=
=20=20=20v_secret_usage_type=20INT,=0A=20=20=20=20v_secret_description=20=
TEXT,=0A=20=20=20=20v_provider_id=20UUID=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20libvirt_secrets=0A=
=20=20=20=20SET=20secret_id=20=3D=20v_secret_id,=0A=20=20=20=20=20=20=20=20=
secret_value=20=3D=20v_secret_value,=0A=20=20=20=20=20=20=20=20=
secret_usage_type=20=3D=20v_secret_usage_type,=0A=20=20=20=20=20=20=20=20=
secret_description=20=3D=20v_secret_description,=0A=20=20=20=20=20=20=20=20=
provider_id=20=3D=20v_provider_id,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20secret_id=20=3D=20=
v_secret_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteLibvirtSecret=20=
(v_secret_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20DELETE=0A=20=20=20=20FROM=20libvirt_secrets=0A=20=20=20=20WHERE=20=
secret_id=20=3D=20v_secret_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromLibvirtSecrets=20=
()=0ARETURNS=20SETOF=20libvirt_secrets=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20libvirt_secrets;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllLibvirtSecretsByProviderId=20(v_provider_id=20UUID)=0ARETURNS=20=
SETOF=20libvirt_secrets=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
libvirt_secrets=0A=20=20=20=20WHERE=20provider_id=20=3D=20v_provider_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetLibvirtSecretsByPoolIdOnActiveDomains=20=
(v_storage_pool_id=20UUID)=0ARETURNS=20SETOF=20libvirt_secrets=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20libvirt_secrets.*=0A=20=20=20=20FROM=20libvirt_secrets=0A=20=20=20=
=20INNER=20JOIN=20storage_domain_static=0A=20=20=20=20=20=20=20=20ON=20=
CAST(libvirt_secrets.provider_id=20AS=20VARCHAR)=20=3D=20=
storage_domain_static.storage=0A=20=20=20=20INNER=20JOIN=20=
storage_pool_iso_map=0A=20=20=20=20=20=20=20=20ON=20=
storage_domain_static.id=20=3D=20storage_pool_iso_map.storage_id=0A=20=20=
=20=20WHERE=20storage_pool_iso_map.storage_pool_id=20=3D=20=
v_storage_pool_id=0A=20=20=20=20=20=20=20=20AND=20=
storage_pool_iso_map.status=20=3D=203;--=20Active=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertMacPool=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_name=20=
VARCHAR(40),=0A=20=20=20=20v_allow_duplicate_mac_addresses=20BOOLEAN,=0A=20=
=20=20=20v_description=20VARCHAR(4000)=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20mac_pools=20(=0A=20=
=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=
=20=20=20allow_duplicate_mac_addresses,=0A=20=20=20=20=20=20=20=20=
description=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=
=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20v_name,=0A=20=20=20=20=20=
=20=20=20v_allow_duplicate_mac_addresses,=0A=20=20=20=20=20=20=20=20=
v_description=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateMacPool=20=
(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_name=20VARCHAR(40),=0A=20=20=
=20=20v_allow_duplicate_mac_addresses=20BOOLEAN,=0A=20=20=20=20=
v_description=20VARCHAR(4000)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20mac_pools=0A=20=20=20=20SET=20=
id=20=3D=20v_id,=0A=20=20=20=20=20=20=20=20name=20=3D=20v_name,=0A=20=20=20=
=20=20=20=20=20allow_duplicate_mac_addresses=20=3D=20=
v_allow_duplicate_mac_addresses,=0A=20=20=20=20=20=20=20=20description=20=
=3D=20v_description=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteMacPool=20(v_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20mac_pools=0A=
=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetMacPoolByMacPoolId=20(v_id=20UUID)=0ARETURNS=20SETOF=20mac_pools=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20mac_pools=0A=20=20=20=20WHERE=20id=20=
=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetDefaultMacPool=20()=0A=
RETURNS=20SETOF=20mac_pools=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
mac_pools=0A=20=20=20=20WHERE=20default_pool=20IS=20true;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromMacPools=20()=0ARETURNS=20SETOF=20=
mac_pools=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20mac_pools;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllMacsByMacPoolId=20(v_id=20UUID)=0ARETURNS=20=
SETOF=20VARCHAR=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20mac_addr=0A=20=20=20=20FROM=20=
vm_interface=0A=20=20=20=20WHERE=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vm_static=0A=20=20=20=20=20=20=20=20=20=20=20=20INNER=20JOIN=20cluster=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
vm_static.cluster_id=20=3D=20cluster.cluster_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20cluster.storage_pool_id=20IN=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20sp.id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20storage_pool=20sp=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
sp.mac_pool_id=20=3D=20v_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
vm_static.vm_guid=20=3D=20vm_interface.vm_guid=0A=20=20=20=20=20=20=20=20=
=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertMacPoolRange=20(=0A=
=20=20=20=20v_mac_pool_id=20UUID,=0A=20=20=20=20v_from_mac=20=
VARCHAR(17),=0A=20=20=20=20v_to_mac=20VARCHAR(17)=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
mac_pool_ranges=20(=0A=20=20=20=20=20=20=20=20mac_pool_id,=0A=20=20=20=20=
=20=20=20=20from_mac,=0A=20=20=20=20=20=20=20=20to_mac=0A=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_mac_pool_id,=0A=20=20=20=20=20=20=20=20v_from_mac,=0A=20=20=20=20=20=20=
=20=20v_to_mac=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteMacPoolRangesByMacPoolId=20(v_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
mac_pool_ranges=0A=20=20=20=20WHERE=20mac_pool_id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllMacPoolRangesByMacPoolId=20(v_id=20UUID)=0A=
RETURNS=20SETOF=20mac_pool_ranges=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
mac_pool_ranges=0A=20=20=20=20WHERE=20mac_pool_id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0A/*=0AThis=20file=20=
adds=20Snapshot=20Materialized=20Views=20support=20to=20Postgres.=0AA=20=
Snapshot=20Materialized=20View=20is=20actually=20a=20table=20built=20on=20=
top=20of=0Aa=20real=20view=20that=20enables=20to=20select=20data=20from=20=
the=20Snapshot=20Materialized=20View=0Aeasily=20and=20efficiently.=0A=
Candidates=20for=20Snapshot=20Materialized=20Views=20are=20views=20that=20=
are=20based=20on=0Aslowly-changing=20data.=20The=20Snapshot=20=
Materialized=20Views=20is=20actually=0Afunctioning=20as=20a=20cache.=0A=
The=20Snapshot=20Materialized=20View=20is=20refreshed=20per=20request.=0A=
The=20Snapshot=20Materialized=20View=20definitions=20are=20stored=20in=20=
the=20materialized_views=20table.=0A=0AFlow:=0A1)=20Create=20the=20=
Materialized=20View=20by=20calling:=0A=20=20=20CreateMaterializedView=20=
-=20if=20you=20are=20creating=20a=20new=20view=0A=20=20=20=
CreateMaterializedViewAs=20-=20If=20you=20want=20to=20preserve=20the=20=
original=20view=20name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20in=20this=20case=20the=20=
original=20view=20will=20be=20renamed=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20and=20the=20new=20=
Materialized=20View=20will=20have=20the=20original=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
view=20name.=0A=20=20=20The=20following=20should=20be=20called=20for=20=
Custom=20Materialized=20Views=0A=20=20=20CreateCustomMaterializedView=0A=20=
=20=20CreateCustomMaterializedViewAs=0A2)=20If=20your=20Snapshot=20=
Materialized=20View=20is=20my_mt=20you=20should=20create=20Stored=20=
Procedures:=0A=20=20=20=20MtDropmy_mtIndexes=20-=20Drops=20indexes=20on=20=
my_mt=0A=20=20=20=20MtCreatemy_mtIndexes=20-=20Creates=20needed=20=
indexes=20on=20my_mt=0A=20=20=20=20Those=20indexes=20should=20be=20=
defined=20in=20the=20"Snapshot=20Materialized=20Views=20Index=20=
Definitions=20Section"=0A=20=20=20=20in=20=
post_upgrade/0020_create_materialized_views.sql=20file.=0A=0A=20=20=20=
Those=20SP=20are=20called=20automatically=20when=20a=20Snapshot=20=
Materialized=20View=20is=20refreshed=0A=20=20=20to=20boost=20refresh=20=
performance.=0A=0A3)=20You=20can=20call=20IsMaterializedViewRefreshed=20=
to=20check=20if=20it=20is=20time=20to=20refresh=20the=20view=0A=20=20=20=
and=20if=20yes=20call=20RefreshMaterializedView=20manually.=0A=20=20=20=
or=0A=20=20=20You=20can=20define=20a=20cron=20job=20that=20calls=20=
RefreshAllMaterializedViews=20that=20loops=20over=0A=20=20=20all=20=20=
Snapshot=20Materialized=20Views=20and=20refreshes=20it=20automatically=0A=
=20=20=20RefreshAllMaterializedViews=20recieves=20a=20boolean=20v_force=20=
flag,=20please=20set=20this=20flag=20to=20false=0A=20=20=20when=20=
calling=20it=20from=20a=20cron=20job=20in=20order=20to=20update=20the=20=
materialized=20views=20only=20when=20needed.=0A=20=20=20(This=20SP=20is=20=
called=20with=20v_force=20=3D=20true=20after=20create/upgrade=20DB)=0A=0A=
There=20are=20also=20additional=20functions=20:=0A=20=20=20=
CreateAllMaterializedViewsiIndexes=20-=20Creates=20indexes=20for=20all=20=
Snapshot=20Materialized=20views=0A=20=20=20DropMaterializedView=20-=20=
Drops=20the=20Materialized=20View=0A=20=20=20DropAllMaterializedViews=20=
-=20Drop=20all=20Materialized=20Views=0A=20=20=20=
DropAllCustomMaterializedViews=20-=20Drop=20all=20custom=20Materialized=20=
Views=0A=20=20=20UpdateMaterializedViewRefreshRate=20-=20Updates=20the=20=
Materialized=20View=20refresh=20rate=0A=20=20=20=
UpdateMaterializedViewMinRefreshRate=20-=20Updates=20the=20Materialized=20=
View=20minimal=20refresh=20rate=0A=20=20=20ActivateMaterializedView=20-=20=
activates/decativates=20a=20=20Materialized=20View=0A=20=20=20=
ActivateAllMaterializedViews=20-=20activates/decativates=20all=20=
Materialized=20Views=0A=0AIn=20addition,=20you=20can=20create=20a=20file=20=
named=20create_materialized_views.sql=20under=20=
dbscripts/upgrade/post_upgrade/custom/=0AThis=20file=20may=20include=20=
other=20custom=20materialized=20views=20settings=20and=20is=20executed=20=
by=20the=20create/upgrade=20database=20scripts.=0A=0ANOTE=20:=20=
Materialized=20Views=20are=20automatically=20refreshed=20upon=20=
create/upgrade=0A*/=0A=0A=0A=0A=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
to_interval=20(sec=20INT)=0ARETURNS=20INTERVAL=20AS=20$$=0A=0ABEGIN=0A=20=
=20=20=20RETURN=20(sec=20||=20'=20seconds')::INTERVAL;=0AEND;$$=0A=
LANGUAGE=20'plpgsql'=20IMMUTABLE=20STRICT;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20CreateMaterializedView=20(=0A=20=20=20=20v_matview=20=
NAME,=0A=20=20=20=20v_view_NAME=20NAME,=0A=20=20=20=20=
v_refresh_rate_in_sec=20INT,=0A=20=20=20=20v_custom=20BOOLEAN,=0A=20=20=20=
=20v_min_refresh_rate_in_sec=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ADECLARE=20v_entry=20materialized_views=20%=20ROWTYPE;=0A=0A=
BEGIN=0A=20=20=20=20SELECT=20*=0A=20=20=20=20INTO=20v_entry=0A=20=20=20=20=
FROM=20materialized_views=0A=20=20=20=20WHERE=20mv_name=20=3D=20=
v_matview;=0A=0A=20=20=20=20IF=20FOUND=20THEN=20RAISE=20EXCEPTION=20=
'Materialized=20view=20%=20already=20exists.',=0A=20=20=20=20=20=20=20=20=
v_matview;=0A=20=20=20=20END=20IF;=0A=20=20=20=20IF=20current_user=20!=3D=20=
usename=20FROM=20pg_database,=0A=20=20=20=20=20=20=20=20pg_user=20WHERE=20=
datdba=20=3D=20usesysid=0A=20=20=20=20=20=20=20=20AND=20datname=20=3D=20=
current_database=20THEN=20RAISE=20EXCEPTION=20'Materialized=20view=20%=20=
should=20be=20created=20with=20user=20''engine''.',=0A=20=20=20=20=20=20=20=
=20v_matview;=0A=20=20=20=20END=20IF=20;=0A=20=20=20=20EXECUTE=20'REVOKE=20=
ALL=20ON=20'=20||=20v_view_name=20||=20'=20FROM=20PUBLIC';=0A=0A=20=20=20=
=20EXECUTE=20'GRANT=20SELECT=20ON=20'=20||=20v_view_name=20||=20'=20TO=20=
PUBLIC';=0A=0A=20=20=20=20EXECUTE=20'CREATE=20TABLE=20'=20||=20v_matview=20=
||=20'=20AS=20SELECT=20*=20FROM=20'=20||=20v_view_name;=0A=0A=20=20=20=20=
EXECUTE=20'REVOKE=20ALL=20ON=20'=20||=20v_matview=20||=20'=20FROM=20=
PUBLIC';=0A=0A=20=20=20=20EXECUTE=20'GRANT=20SELECT=20ON=20'=20||=20=
v_matview=20||=20'=20TO=20PUBLIC';=0A=0A=20=20=20=20INSERT=20INTO=20=
materialized_views=20(=0A=20=20=20=20=20=20=20=20mv_name,=0A=20=20=20=20=20=
=20=20=20v_name,=0A=20=20=20=20=20=20=20=20refresh_rate_in_sec,=0A=20=20=20=
=20=20=20=20=20last_refresh,=0A=20=20=20=20=20=20=20=20custom,=0A=20=20=20=
=20=20=20=20=20min_refresh_rate_in_sec=0A=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_matview,=0A=20=20=20=20=20=20=
=20=20v_view_name,=0A=20=20=20=20=20=20=20=20v_refresh_rate_in_sec,=0A=20=
=20=20=20=20=20=20=20CURRENT_TIMESTAMP,=0A=20=20=20=20=20=20=20=20=
v_custom,=0A=20=20=20=20=20=20=20=20v_min_refresh_rate_in_sec=0A=20=20=20=
=20=20=20=20=20);=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CreateMaterializedView=20(=0A=20=20=20=20v_matview=20NAME,=0A=20=20=20=20=
v_view_name=20NAME,=0A=20=20=20=20v_refresh_rate_in_sec=20INT,=0A=20=20=20=
=20v_min_refresh_rate_in_sec=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
CreateMaterializedView(v_matview,=20v_view_name,=20=
v_refresh_rate_in_sec,=20false,=20v_min_refresh_rate_in_sec);=0A=0A=20=20=
=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CreateCustomMaterializedView=20(=0A=20=20=20=20v_matview=20NAME,=0A=20=20=
=20=20v_view_name=20NAME,=0A=20=20=20=20v_refresh_rate_in_sec=20INT,=0A=20=
=20=20=20v_min_refresh_rate_in_sec=20INT=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
CreateMaterializedView(v_matview,=20v_view_name,=20=
v_refresh_rate_in_sec,=20true,=20v_min_refresh_rate_in_sec);=0A=0A=20=20=20=
=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20CreateMaterializedView=20=
(=0A=20=20=20=20v_matview=20NAME,=0A=20=20=20=20v_view_name=20NAME,=0A=20=
=20=20=20v_refresh_rate_in_sec=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
CreateMaterializedView(v_matview,=20v_view_name,=20=
v_refresh_rate_in_sec,=20false,=200);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CreateCustomMaterializedView=20(=0A=20=20=20=20v_matview=20NAME,=0A=20=20=
=20=20v_view_name=20NAME,=0A=20=20=20=20v_refresh_rate_in_sec=20INT=0A=20=
=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
PERFORM=20CreateMaterializedView(v_matview,=20v_view_name,=20=
v_refresh_rate_in_sec,=20true,=200);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CreateMaterializedViewAs=20(=0A=20=20=20=20v_view_name=20NAME,=0A=20=20=20=
=20v_refresh_rate_in_sec=20INT,=0A=20=20=20=20v_custom=20BOOLEAN,=0A=20=20=
=20=20v_min_refesh_rate_in_sec=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ADECLARE=20v_entry=20materialized_views=20%=20ROWTYPE;=0A=
=0Av_renamed_view=20NAME;=0A=0ABEGIN=0A=20=20=20=20IF=20FOUND=20THEN=0A=20=
=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Materialized=20view=20%=20=
already=20exists.',=20v_view_name;=0A=20=20=20=20END=20IF;=0A=20=20=20=20=
v_renamed_view=20:=3D=20v_view_name=20||=20'_mt_base';=0A=0A=20=20=20=20=
EXECUTE=20'ALTER=20VIEW=20'=20||=20v_view_name=20||=20'=20RENAME=20TO=20=
'=20||=20v_renamed_view;=0A=0A=20=20=20=20perform=20=
CreateMaterializedView(v_view_name,=20v_renamed_view,=20=
v_refresh_rate_in_sec,=20v_custom,=20v_min_refesh_rate_in_sec);=0A=0A=20=20=
=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20CreateMaterializedViewAs=20=
(=0A=20=20=20=20v_view_name=20NAME,=0A=20=20=20=20v_refresh_rate_in_sec=20=
INT,=0A=20=20=20=20v_min_refesh_rate_in_sec=20INT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
CreateMaterializedViewAs(v_view_name,=20v_refresh_rate_in_sec,=20false,=20=
v_min_refesh_rate_in_sec);=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CreateCustomMaterializedViewAs=20(=0A=20=20=20=20v_view_name=20NAME,=0A=20=
=20=20=20v_refresh_rate_in_sec=20INT,=0A=20=20=20=20=
v_min_refesh_rate_in_sec=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
CreateMaterializedViewAs(v_view_name,=20v_refresh_rate_in_sec,=20true,=20=
v_min_refesh_rate_in_sec);=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CreateMaterializedViewAs=20(=0A=20=20=20=20v_view_name=20NAME,=0A=20=20=20=
=20v_refresh_rate_in_sec=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
CreateMaterializedViewAs(v_view_name,=20v_refresh_rate_in_sec,=20false,=20=
0);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20CreateCustomMaterializedViewAs=20(=0A=20=20=20=20=
v_view_name=20NAME,=0A=20=20=20=20v_refresh_rate_in_sec=20INT=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
CreateMaterializedViewAs(v_view_name,=20v_refresh_rate_in_sec,=20true,=20=
0);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DropMaterializedView=20(v_matview=20NAME)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_entry=20materialized_views=20%=20=
ROWTYPE;=0A=0ABEGIN=0A=20=20=20=20SELECT=20*=0A=20=20=20=20INTO=20=
v_entry=0A=20=20=20=20FROM=20materialized_views=0A=20=20=20=20WHERE=20=
mv_name=20=3D=20v_matview;=0A=0A=20=20=20=20IF=20NOT=20FOUND=20THEN=0A=20=
=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Materialized=20view=20%=20does=20=
not=20exist.',=20v_matview;=0A=20=20=20=20END=20IF;=0A=20=20=20=20=
EXECUTE=20'DROP=20TABLE=20'=20||=20v_matview=20||=20'=20CASCADE';=0A=0A=20=
=20=20=20DELETE=0A=20=20=20=20FROM=20materialized_views=0A=20=20=20=20=
WHERE=20mv_name=20=3D=20v_matview;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DropAllMaterializedViews=20()=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v_cur=20CURSOR=0AFOR=0ASELECT=20*=0AFROM=20=
materialized_views;=0A=0Av_record=20materialized_views=20%=20ROWTYPE;=0A=0A=
BEGIN=0A=20=20=20=20OPEN=20v_cur;=0A=0A=20=20=20=20--=20loop=20on=20all=20=
entries=20in=20materialized_views=0A=20=20=20=20LOOP=0A=0A=20=20=20=20=
FETCH=20v_cur=0A=20=20=20=20INTO=20v_record;=0A=0A=20=20=20=20EXIT=20=
WHEN=20NOT=20FOUND;=0A=0A=20=20=20=20perform=20=
DropMaterializedView(v_record.mv_name);=0A=20=20=20=20END=20LOOP;=0A=0A=
CLOSE=20v_cur;END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DropAllCustomMaterializedViews=20()=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
DECLARE=20v_cur=20CURSOR=0AFOR=0ASELECT=20*=0AFROM=20materialized_views=0A=
WHERE=20custom;=0A=0Av_record=20materialized_views=20%=20ROWTYPE;=0A=0A=
BEGIN=0A=20=20=20=20OPEN=20v_cur;=0A=0A=20=20=20=20--=20loop=20on=20all=20=
entries=20in=20materialized_views=0A=20=20=20=20LOOP=0A=0A=20=20=20=20=
FETCH=20v_cur=0A=20=20=20=20INTO=20v_record;=0A=0A=20=20=20=20EXIT=20=
WHEN=20NOT=20FOUND;=0A=0A=20=20=20=20perform=20=
DropMaterializedView(v_record.mv_name);=0A=20=20=20=20END=20LOOP;=0A=0A=0A=
CLOSE=20v_cur;END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
IsMaterializedViewRefreshed=20(v_matview=20NAME)=0ARETURNS=20boolean=20=
STABLE=20AS=20$PROCEDURE$=0ADECLARE=20v_entry=20materialized_views=20%=20=
ROWTYPE;=0A=0Av_is_refreshed=20boolean;=0A=0ABEGIN=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20INTO=20v_entry=0A=20=20=20=20FROM=20materialized_views=0A=
=20=20=20=20WHERE=20mv_name=20=3D=20v_matview;=0A=0A=20=20=20=20IF=20NOT=20=
FOUND=20THEN=20RAISE=20EXCEPTION=20'Materialized=20view=20%=20does=20not=20=
exist.',=0A=20=20=20=20=20=20=20=20v_matview;=0A=20=20=20=20END=20IF;=0A=20=
=20=20=20--=20check=20if=20materialized=20View=20should=20refresh=0A=20=20=
=20=20v_is_refreshed=20:=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
((CURRENT_TIMESTAMP=20-=20to_interval(refresh_rate_in_sec))=20<=3D=20=
last_refresh)=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
((CURRENT_TIMESTAMP=20-=20to_interval(min_refresh_rate_in_sec))=20<=3D=20=
last_refresh)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=
=20=20OR=20NOT=20active=0A=20=20=20=20FROM=20materialized_views=0A=20=20=20=
=20WHERE=20mv_name=20=3D=20v_matview;=0A=0A=20=20=20=20RETURN=20=
v_is_refreshed;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20RefreshMaterializedView=20=
(v_matview=20NAME)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20=
v_entry=20materialized_views=20%=20ROWTYPE;=0A=0Av_drop_index_sp=20NAME;=0A=
=0Av_create_index_sp=20NAME;=0A=0Av_start_time=20TIMESTAMP=0AWITH=20TIME=20=
ZONE;=0A=0Av_avg_cost_ms=20INT;=0A=0ABEGIN=0A=20=20=20=20SELECT=20*=0A=20=
=20=20=20INTO=20v_entry=0A=20=20=20=20FROM=20materialized_views=0A=20=20=20=
=20WHERE=20mv_name=20=3D=20v_matview;=0A=0A=20=20=20=20IF=20NOT=20FOUND=20=
THEN=0A=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Materialized=20view=20=
%=20does=20not=20exist.',=20v_matview;=0A=20=20=20=20END=20IF;=0A=20=20=20=
=20--=20get=20start=20time=0A=20=20=20=20v_start_time:=3D=20=
CURRENT_TIMESTAMP;=0A=0A=20=20=20=20--=20SP=20for=20Drop=20/=20create=20=
Index=20should=20follow=20naming=20convention=20=
Mt[Drop|Create]<v_matview>Indexes=0A=20=20=20=20v_drop_index_sp=20:=3D=20=
'MtDrop'=20||=20v_matview=20||=20'Indexes';=0A=0A=20=20=20=20=
v_create_index_sp=20:=3D=20'MtCreate'=20||=20v_matview=20||=20'Indexes';=0A=
=0A=20=20=20=20IF=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.routines=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
routine_name=20ilike=20v_drop_index_sp=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=20THEN=20v_drop_index_sp=20:=3D=20NULL;=0A=20=20=20=20END=20IF;=0A=20=
=20=20=20IF=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.routines=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
routine_name=20ilike=20v_create_index_sp=0A=20=20=20=20=20=20=20=20=20=20=
=20=20)=20THEN=20v_create_index_sp=20:=3D=20NULL;=0A=20=20=20=20END=20=
IF;=0A=20=20=20=20--=20Lock=20materialized_views=20table=20until=20=
refresh=20completes=20to=20prevent=20duplicate=20refreshes=20by=20other=20=
threads=0A=20=20=20=20LOCK=20TABLE=20materialized_views;=0A=0A=20=20=20=20=
--=20taking=20a=20lock=20on=20the=20snapshot=20materialized=20view=20=
until=20it=20refreshed=0A=20=20=20=20EXECUTE=20'LOCK=20TABLE=20'=20||=20=
v_matview;=0A=0A=20=20=20=20--=20drop=20indexes=20on=20the=20snapshot=20=
materialized=20view=20if=20exists=0A=20=20=20=20IF=20(v_drop_index_sp=20=
IS=20NOT=20NULL)=20THEN=0A=20=20=20=20=20=20=20=20EXECUTE=20'select=20'=20=
||=20v_drop_index_sp=20||=20'()';=0A=20=20=20=20END=20IF;=0A=0A=20=20=20=20=
--=20refresh=20the=20view=0A=20=20=20=20EXECUTE=20'TRUNCATE=20TABLE=20'=20=
||=20v_matview;=0A=0A=20=20=20=20EXECUTE=20'INSERT=20INTO=20'=20||=20=
v_matview=20||=20'=20SELECT=20*=20FROM=20'=20||=20v_entry.v_name;=0A=0A=20=
=20=20=20--=20restore=20=20indexes=20on=20the=20snapshot=20materialized=20=
view=20if=20exists=0A=20=20=20=20IF=20(v_create_index_sp=20IS=20NOT=20=
NULL)=20THEN=0A=20=20=20=20=20=20=20=20EXECUTE=20'select=20'=20||=20=
v_create_index_sp=20||=20'()';=0A=20=20=20=20END=20IF;=0A=0A=20=20=20=20=
--=20update=20last=20refresh=20time=20and=20average=20cost=20in=20[ms]=0A=
=20=20=20=20IF=20(v_entry.avg_cost_ms=20=3D=200)=20THEN=0A=20=20=20=20=20=
=20=20=20v_avg_cost_ms:=3D=20EXTRACT(EPOCH=20FROM=20current_timestamp=20=
-=20v_start_time)=20*=201000;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=
v_avg_cost_ms:=3D=20((EXTRACT(EPOCH=20FROM=20current_timestamp=20-=20=
v_start_time)=20*=201000)=20+=20v_entry.avg_cost_ms)=20/=202;=0A=20=20=20=
=20END=20IF;=0A=0A=20=20=20=20UPDATE=20materialized_views=0A=20=20=20=20=
SET=20last_refresh=20=3D=20CURRENT_TIMESTAMP,=0A=20=20=20=20=20=20=20=20=
avg_cost_ms=20=3D=20v_avg_cost_ms=0A=20=20=20=20WHERE=20mv_name=20=3D=20=
v_matview;=0A=0ARETURN;END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
RefreshAllMaterializedViews=20(v_force=20boolean)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v_cur=20CURSOR=0AFOR=0ASELECT=20*=0AFROM=20=
materialized_views;=0A=0Av_record=20materialized_views=20%=20ROWTYPE;=0A=0A=
BEGIN=0A=20=20=20=20OPEN=20v_cur;=0A=0A=20=20=20=20--=20loop=20on=20all=20=
entries=20in=20materialized_views=20and=20refresh=20only=20needed=20=
snapshots=0A=20=20=20=20LOOP=0A=0A=20=20=20=20FETCH=20v_cur=0A=20=20=20=20=
INTO=20v_record;=0A=0A=20=20=20=20EXIT=20WHEN=20NOT=20FOUND;=0A=0A=20=20=20=
=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20v_force=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20v_record.min_refresh_rate_in_sec=20=3D=200=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=
=20OR=20NOT=20IsMaterializedViewRefreshed(v_record.mv_name)=0A=20=20=20=20=
=20=20=20=20=20=20=20=20)=20THEN=20perform=20=
RefreshMaterializedView(v_record.mv_name);=0A=20=20=20=20END=20IF;=0A=20=20=
=20=20END=20LOOP;=0A=0A=20=20=20=20CLOSE=20v_cur;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CreateAllMaterializedViewsiIndexes=20()=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v_cur=20CURSOR=0AFOR=0ASELECT=20*=0AFROM=20=
materialized_views;=0A=0Av_record=20materialized_views=20%=20ROWTYPE;=0A=0A=
v_create_index_sp=20NAME;=0A=0ABEGIN=0A=20=20=20=20OPEN=20v_cur;=0A=0A=20=
=20=20=20--=20loop=20on=20all=20entries=20in=20materialized_views=20and=20=
create=20indexes(if=20defined)=0A=20=20=20=20LOOP=0A=0A=20=20=20=20FETCH=20=
v_cur=0A=20=20=20=20INTO=20v_record;=0A=0A=20=20=20=20EXIT=20WHEN=20NOT=20=
FOUND;=0A=0A=20=20=20=20v_create_index_sp=20:=3D=20'MtCreate'=20||=20=
v_record.mv_name=20||=20'Indexes';=0A=0A=20=20=20=20--=20Check=20if=20SP=20=
that=20creates=20the=20indexes=20exists=0A=20=20=20=20IF=20NOT=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20information_schema.routines=0A=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20routine_name=20ilike=20v_create_index_sp=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=20THEN=20v_create_index_sp=20:=3D=20NULL;=0A=
=20=20=20=20END=20IF;=0A=20=20=20=20IF=20(v_create_index_sp=20IS=20NOT=20=
NULL)=20THEN=0A=20=20=20=20=20=20=20=20EXECUTE=20'select=20'=20||=20=
v_create_index_sp=20||=20'()';=0A=20=20=20=20END=20IF;=0A=0A=20=20=20=20=
END=20LOOP;=0A=0ACLOSE=20v_cur;END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateMaterializedViewRefreshRate=20(=0A=20=20=20=20v_matview=20NAME,=0A=20=
=20=20=20v_refresh_rate=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ADECLARE=20v_entry=20materialized_views=20%=20ROWTYPE;=0A=0A=
BEGIN=0A=20=20=20=20SELECT=20*=0A=20=20=20=20INTO=20v_entry=0A=20=20=20=20=
FROM=20materialized_views=0A=20=20=20=20WHERE=20mv_name=20=3D=20=
v_matview;=0A=0A=20=20=20=20IF=20NOT=20FOUND=20THEN=20RAISE=20EXCEPTION=20=
'Materialized=20view=20%=20does=20not=20exist.',=0A=20=20=20=20=20=20=20=20=
v_matview;=0A=20=20=20=20END=20IF;=0A=20=20=20=20UPDATE=20=
materialized_views=0A=20=20=20=20SET=20refresh_rate_in_sec=20=3D=20=
v_refresh_rate=0A=20=20=20=20WHERE=20mv_name=20=3D=20v_matview;=0A=0A=20=20=
=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateMaterializedViewMinRefreshRate=20(=0A=20=20=20=20v_matview=20NAME,=0A=
=20=20=20=20v_min_refresh_rate=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ADECLARE=20v_entry=20materialized_views=20%=20ROWTYPE;=0A=
=0ABEGIN=0A=20=20=20=20SELECT=20*=0A=20=20=20=20INTO=20v_entry=0A=20=20=20=
=20FROM=20materialized_views=0A=20=20=20=20WHERE=20mv_name=20=3D=20=
v_matview;=0A=0A=20=20=20=20IF=20NOT=20FOUND=20THEN=20RAISE=20EXCEPTION=20=
'Materialized=20view=20%=20does=20not=20exist.',=0A=20=20=20=20=20=20=20=20=
v_matview;=0A=20=20=20=20END=20IF;=0A=20=20=20=20UPDATE=20=
materialized_views=0A=20=20=20=20SET=20min_refresh_rate_in_sec=20=3D=20=
v_min_refresh_rate=0A=20=20=20=20WHERE=20mv_name=20=3D=20v_matview;=0A=0A=
=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20ActivateMaterializedView=20=
(=0A=20=20=20=20v_matview=20NAME,=0A=20=20=20=20v_active=20BOOLEAN=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_entry=20=
materialized_views=20%=20ROWTYPE;=0A=0ABEGIN=0A=20=20=20=20SELECT=20*=0A=20=
=20=20=20INTO=20v_entry=0A=20=20=20=20FROM=20materialized_views=0A=20=20=20=
=20WHERE=20mv_name=20=3D=20v_matview;=0A=0A=20=20=20=20IF=20NOT=20FOUND=20=
THEN=20RAISE=20EXCEPTION=20'Materialized=20view=20%=20does=20not=20=
exist.',=0A=20=20=20=20=20=20=20=20v_matview;=0A=20=20=20=20END=20IF;=0A=20=
=20=20=20UPDATE=20materialized_views=0A=20=20=20=20SET=20active=20=3D=20=
v_active=0A=20=20=20=20WHERE=20mv_name=20=3D=20v_matview;=0A=0A=20=20=20=20=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
ActivateAllMaterializedViews=20(v_active=20BOOLEAN)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ADECLARE=20v_entry=20materialized_views=20%=20ROWTYPE;=0A=
=0ABEGIN=0A=20=20=20=20UPDATE=20materialized_views=0A=20=20=20=20SET=20=
active=20=3D=20v_active;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertPermission=20(=0A=20=20=20=20v_ad_element_id=20UUID,=0A=20=20=20=20=
v_id=20UUID,=0A=20=20=20=20v_role_id=20UUID,=0A=20=20=20=20v_object_id=20=
UUID,=0A=20=20=20=20v_object_type_id=20INT=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
permissions=20(=0A=20=20=20=20=20=20=20=20ad_element_id,=0A=20=20=20=20=20=
=20=20=20id,=0A=20=20=20=20=20=20=20=20role_id,=0A=20=20=20=20=20=20=20=20=
object_id,=0A=20=20=20=20=20=20=20=20object_type_id=0A=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_ad_element_id,=0A=
=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20v_role_id,=0A=20=20=
=20=20=20=20=20=20v_object_id,=0A=20=20=20=20=20=20=20=20=
v_object_type_id=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeletePermission=20(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
DECLARE=20v_val=20UUID;=0A=0ABEGIN=0A=20=20=20=20--=20Get=20(and=20keep)=20=
a=20shared=20lock=20with=20"right=20to=20upgrade=20to=20exclusive"=0A=20=20=
=20=20--=20in=20order=20to=20force=20locking=20parent=20before=20=
children=0A=20=20=20=20SELECT=20id=0A=20=20=20=20INTO=20v_val=0A=20=20=20=
=20FROM=20permissions=0A=20=20=20=20WHERE=20id=20=3D=20v_id=0A=20=20=20=20=
FOR=0A=0A=20=20=20=20UPDATE;=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
permissions=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetPermissionsByid=20(v_id=20UUID)=0ARETURNS=20SETOF=20permissions_view=20=
STABLE=0AAS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20permissions_view=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
get_user_permissions_for_domain=20(=0A=20=20=20=20v_name=20VARCHAR(255),=0A=
=20=20=20=20v_domain=20VARCHAR(255)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
permissions_view=20STABLE=20AS=20$PROCEDURE$=0ADECLARE=20v_user_name=20=
VARCHAR(255);=0A=0Av_index=20INT;=0A=0ABEGIN=0A=20=20=20=20--=20find=20=
if=20name=20already=20includes=20domain=20(@)=0A=20=20=20=20v_index=20:=3D=
=20POSITION('@'=20IN=20v_name);=0A=0A=20=20=20=20IF=20(v_index=20>=200)=20=
THEN=0A=20=20=20=20=20=20=20=20v_user_name=20:=3D=20substr(v_name,=200,=20=
v_index);=0A=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20v_user_name=20:=3D=20=
v_name;=0A=20=20=20=20END=20IF;=0A=0A=20=20=20=20RETURN=20QUERY=0A=0A=
SELECT=20*=0AFROM=20permissions_view=0AWHERE=20=
permissions_view.ad_element_id=20IN=20(=0A=20=20=20=20=20=20=20=20SELECT=20=
users.user_id=0A=20=20=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=20=20=
=20=20WHERE=20users.domain=20=3D=20v_domain=0A=20=20=20=20=20=20=20=20=20=
=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
users.name=20=3D=20v_user_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20OR=20users.name=20=3D=20v_user_name=20||=20'@'=20||=20=
upper(v_domain)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20);END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetConsumedPermissionsForQuotaId=20(v_quota_id=20UUID)=0ARETURNS=20SETOF=20=
permissions_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
permissions_view=0A=20=20=20=20WHERE=20role_id=20IN=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=20role_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20ROLES_groups=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
action_group_id=20=3D=20901=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20AND=20object_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=20id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fn_get_entity_parents(v_quota_id,=2017)=0A=20=20=20=20=20=20=20=20=20=20=20=
=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetPermissionsByAdElementId=20(=0A=20=20=20=20v_ad_element_id=20UUID,=0A=20=
=20=20=20v_engine_session_seq_id=20INT,=0A=20=20=20=20v_is_filtered=20=
BOOLEAN,=0A=20=20=20=20v_app_mode=20INT=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20permissions_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
permissions_view=0A=20=20=20=20WHERE=20(permissions_view.app_mode=20&=20=
v_app_mode)=20>=200=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20permissions_view.ad_element_id=20=3D=20v_ad_element_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20OR=20ad_element_id=20IN=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20=
GetSessionUserAndGroupsById(v_ad_element_id,=20v_engine_session_seq_id)=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20=
OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
1=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_permissions_permissions_view=20uv,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20engine_sessions=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20uv.user_id=20=3D=20engine_sessions.user_id=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
engine_sessions.id=20=3D=20v_engine_session_seq_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetPermissionsByRoleId=20(v_role_id=20UUID)=0A=
RETURNS=20SETOF=20permissions_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20permissions_view=0A=20=20=20=20WHERE=20role_id=20=3D=20v_role_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetPermissionsByRoleIdAndAdElementId=20(=0A=20=20=20=
=20v_role_id=20UUID,=0A=20=20=20=20v_ad_element_id=20UUID=0A=20=20=20=20=
)=0ARETURNS=20SETOF=20permissions_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20permissions_view=0A=20=20=20=20WHERE=20role_id=20=3D=20=
v_role_id=0A=20=20=20=20=20=20=20=20AND=20ad_element_id=20=3D=20=
v_ad_element_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetPermissionsByRoleIdAndAdElementIdAndObjectId=20(=0A=20=20=20=20=
v_role_id=20UUID,=0A=20=20=20=20v_ad_element_id=20UUID,=0A=20=20=20=20=
v_object_id=20UUID=0A=20=20=20=20)=0ARETURNS=20SETOF=20permissions_view=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20permissions_view=0A=20=20=20=20=
WHERE=20role_id=20=3D=20v_role_id=0A=20=20=20=20=20=20=20=20AND=20=
ad_element_id=20=3D=20v_ad_element_id=0A=20=20=20=20=20=20=20=20AND=20=
object_id=20=3D=20v_object_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetDirectPermissionsByAdElementId=20(v_ad_element_id=20UUID)=0ARETURNS=20=
SETOF=20permissions_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
permissions_view=0A=20=20=20=20WHERE=20permissions_view.ad_element_id=20=
=3D=20v_ad_element_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertRole=20(=0A=20=20=20=
=20v_description=20VARCHAR(4000),=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_name=20VARCHAR(126),=0A=20=20=20=20v_is_readonly=20BOOLEAN,=0A=20=20=20=
=20v_role_type=20INT,=0A=20=20=20=20v_allows_viewing_children=20BOOLEAN,=0A=
=20=20=20=20v_app_mode=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20roles=20(=0A=20=20=20=20=
=20=20=20=20description,=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=
=20=20name,=0A=20=20=20=20=20=20=20=20is_readonly,=0A=20=20=20=20=20=20=20=
=20role_type,=0A=20=20=20=20=20=20=20=20allows_viewing_children,=0A=20=20=
=20=20=20=20=20=20app_mode=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_description,=0A=20=20=20=20=20=20=20=
=20v_id,=0A=20=20=20=20=20=20=20=20v_name,=0A=20=20=20=20=20=20=20=20=
v_is_readonly,=0A=20=20=20=20=20=20=20=20v_role_type,=0A=20=20=20=20=20=20=
=20=20v_allows_viewing_children,=0A=20=20=20=20=20=20=20=20v_app_mode=0A=20=
=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateRole=20(=0A=20=20=20=
=20v_description=20VARCHAR(4000),=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_name=20VARCHAR(126),=0A=20=20=20=20v_is_readonly=20BOOLEAN,=0A=20=20=20=
=20v_role_type=20INT,=0A=20=20=20=20v_allows_viewing_children=20BOOLEAN=0A=
=20=20=20=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20roles=0A=20=20=20=20SET=20=
description=20=3D=20v_description,=0A=20=20=20=20=20=20=20=20name=20=3D=20=
v_name,=0A=20=20=20=20=20=20=20=20is_readonly=20=3D=20v_is_readonly,=0A=20=
=20=20=20=20=20=20=20role_type=20=3D=20v_role_type,=0A=20=20=20=20=20=20=20=
=20allows_viewing_children=20=3D=20v_allows_viewing_children=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteRole=20(v_id=20=
UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_val=20UUID;=0A=0A=
BEGIN=0A=20=20=20=20--=20Get=20(and=20keep)=20a=20shared=20lock=20with=20=
"right=20to=20upgrade=20to=20exclusive"=0A=20=20=20=20--=20in=20order=20=
to=20force=20locking=20parent=20before=20children=0A=20=20=20=20SELECT=20=
id=0A=20=20=20=20INTO=20v_val=0A=20=20=20=20FROM=20roles=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id=0A=20=20=20=20FOR=0A=0A=20=20=20=20UPDATE;=0A=0A=20=
=20=20=20DELETE=0A=20=20=20=20FROM=20roles=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromRole(v_app_mode=20INTEGER)=0ARETURNS=20SETOF=20roles=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20RETURN=20QUERY=20SELECT=20*=0A=
=20=20=20FROM=20roles=0A=20=20=20WHERE=20(roles.app_mode=20&=20=
v_app_mode)=20>=200;=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllNonAdminRoles(v_app_mode=20INTEGER)=0ARETURNS=20SETOF=20roles=20=
STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20RETURN=20QUERY=20=
SELECT=20*=0A=20=20=20FROM=20roles=0A=20=20=20WHERE=20(roles.app_mode=20=
&=20v_app_mode)=20>=200=0A=20=20=20=20=20=20AND=20role_type=20!=3D=201;=0A=
=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetRolsByid(v_id=20UUID)=0ARETURNS=20SETOF=20roles=20=
STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20RETURN=20QUERY=20=
SELECT=20*=0A=20=20=20FROM=20roles=0A=20=20=20WHERE=20id=20=3D=20v_id;=0A=
=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetRoleByName(v_name=20VARCHAR(126))=0ARETURNS=20=
SETOF=20roles=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=
RETURN=20QUERY=20SELECT=20*=0A=20=20=20FROM=20roles=0A=20=20=20WHERE=20=
name=20=3D=20v_name;=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAnyAdminRoleByUserIdAndGroupIds(=0A=20=20=20=20v_user_id=20UUID,=0A=20=
=20=20=20v_group_ids=20text,=0A=20=20=20=20v_app_mode=20INTEGER)=0A=
RETURNS=20SETOF=20roles=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=
=20=20RETURN=20QUERY=20SELECT=20roles.*=0A=20=20=20FROM=20roles=20INNER=20=
JOIN=0A=20=20=20permissions=20ON=20permissions.role_id=20=3D=20roles.id=0A=
=20=20=20WHERE=20(roles.app_mode=20&=20v_app_mode)=20>=200=0A=20=20=20=20=
=20=20=20AND=20role_type=20=3D=201=20--=20admin=0A=20=20=20=20=20=20=20=
AND=20(permissions.ad_element_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=
=20=20=20=20OR=20permissions.ad_element_id=20in(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=20id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20getElementIdsByIdAndGroups(v_user_id,=20v_group_ids))=0A=20=20=
=20=20=20=20=20)=20LIMIT=201;=0A=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetPermissionByRoleId(v_role_id=20UUID)=0ARETURNS=20SETOF=20permissions=20=
STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20RETURN=20QUERY=20=
SELECT=20*=0A=20=20=20FROM=20permissions=0A=20=20=20WHERE=20role_id=20=3D=20=
v_role_id;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20get_entity_permissions(=0A=
=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_action_group_id=20INTEGER,=0A=
=20=20=20=20v_object_id=20UUID,v_object_type_id=20INTEGER)=0ARETURNS=20=
SETOF=20UUID=20STABLE=0A=20=20=20=0A=20=20=20AS=20$procedure$=0A=20=20=20=
DECLARE=0A=20=20=20v_everyone_object_id=20=20UUID;=0ABEGIN=0A=20=20=20=
v_everyone_object_id=20:=3D=20getGlobalIds('everyone');=20--=20hardcoded=20=
also=20in=20MLA=20Handler=0A=20=20=20RETURN=20QUERY=0A=20=20=20SELECT=20=20=
=20id=0A=20=20=20FROM=20permissions=0A=20=20=20WHERE=0A=20=20=20=20=20=20=
=20role_id=20IN(=0A=20=20=20=20=20=20=20=20=20=20=20SELECT=20role_id=0A=20=
=20=20=20=20=20=20=20=20=20=20FROM=20roles_groups=0A=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20action_group_id=20=3D=20v_action_group_id)=0A=20=20=20=
=20=20=20=20--=20get=20allparents=20of=20object=0A=20=20=20=20=20=20=20=
AND=20(object_id=20IN(=0A=20=20=20=20=20=20=20=20=20=20=20SELECT=20id=0A=20=
=20=20=20=20=20=20=20=20=20=20FROM=20=
fn_get_entity_parents(v_object_id,v_object_type_id)))=0A=20=20=20=20=20=20=
=20--=20get=20user=20and=20his=20groups=0A=20=20=20=20=20=20=20AND=20=
(ad_element_id=20=3D=20v_everyone_object_id=0A=20=20=20=20=20=20=20OR=20=
ad_element_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20OR=20=
ad_element_id=20IN(=0A=20=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=
=20=20=20=20=20=20=20=20=20FROM=20getUserAndGroupsById(v_user_id)=0A=20=20=
=20=20=20=20=20))=20LIMIT=201;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
get_entity_permissions_for_user_and_groups(=0A=20=20=20=20v_user_id=20=
UUID,=0A=20=20=20=20v_group_ids=20text,=0A=20=20=20=20v_action_group_id=20=
INTEGER,=0A=20=20=20=20v_object_id=20UUID,=0A=20=20=20=20=
v_object_type_id=20INTEGER,=0A=20=20=20=20v_ignore_everyone=20BOOLEAN)=0A=
RETURNS=20SETOF=20UUID=20STABLE=0A=09=0AAS=20$procedure$=0A=20=20=20=
DECLARE=0A=20=20=20v_everyone_object_id=20=20UUID;=0ABEGIN=0A=20=20=20=
v_everyone_object_id=20:=3D=20getGlobalIds('everyone');=20--=20hardcoded=20=
also=20in=20MLA=20Handler=0A=20=20=20RETURN=20QUERY=0A=20=20=20SELECT=20=
id=20from=20permissions=0A=20=20=20WHERE=0A=20=20=20--=20get=20all=20=
roles=20of=20action=0A=20=20=20=20=20=20=20role_id=20IN(=0A=20=20=20=20=20=
=20=20=20=20=20=20SELECT=20role_id=20from=20roles_groups=0A=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20action_group_id=20=3D=20v_action_group_id)=0A=09=
--=20get=20allparents=20of=20object=0A=20=20=20=20=20=20=20AND=20=
(object_id=20IN(=0A=20=20=20=20=20=20=20=20=20=20=20SELECT=20id=0A=20=20=20=
=20=20=20=20=20=20=20=20FROM=20=
fn_get_entity_parents(v_object_id,v_object_type_id)))=0A=09--=20get=20=
user=20and=20his=20groups=0A=20=20=20=20=20=20=20AND=20((NOT=20=
v_ignore_everyone=0A=20=20=20=20=20=20=20=20=20=20=20AND=20ad_element_id=20=
=3D=20v_everyone_object_id)=0A=20=20=20=20=20=20=20OR=20ad_element_id=20=
=3D=20v_user_id=0A=20=20=20=20=20=20=20OR=20ad_element_id=20IN(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20fnsplitteruuid(v_group_ids)=0A=20=20=20=20=20=20=20))=20LIMIT=20=
1;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Insert_roles_groups(=0A=20=
=20=20=20v_action_group_id=20INTEGER,=0A=20=20=20=20v_role_id=20UUID)=0A=
RETURNS=20VOID=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20roles_groups(=0A=20=20=20=20=20=20=20=20action_group_id,=0A=20=20=20=
=20=20=20=20=20role_id)=0A=20=20=20=20VALUES(=0A=20=20=20=20=20=20=20=20=
v_action_group_id,=0A=20=20=20=20=20=20=20=20v_role_id);=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Delete_roles_groups(=0A=20=20=20=20=
v_action_group_id=20INTEGER,=0A=20=20=20=20v_role_id=20UUID)=0ARETURNS=20=
VOID=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=0A=20=20=20=20DELETE=20FROM=20=
roles_groups=0A=20=20=20=20WHERE=20action_group_id=20=3D=20=
v_action_group_id=0A=20=20=20=20=20=20=20=20AND=20role_id=20=3D=20=
v_role_id;=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Get_roles_groups_By_action_group_id_And_By_role_id(=0A=20=20=20=20=
v_action_group_id=20INTEGER,=0A=20=20=20=20v_role_id=20UUID)=0ARETURNS=20=
SETOF=20roles_groups=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=20=20FROM=20roles_groups=0A=20=
=20=20=20WHERE=0A=20=20=20=20=20=20=20=20action_group_id=20=3D=20=
v_action_group_id=0A=20=20=20=20=20=20=20=20AND=20role_id=20=3D=20=
v_role_id;=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Get_role_groups_By_role_id(v_role_id=20UUID)=0ARETURNS=20SETOF=20=
roles_groups=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=20SELECT=20*=0A=20=20=20=20FROM=20roles_groups=0A=20=20=20=
=20WHERE=0A=20=20=20=20=20=20=20=20role_id=20=3D=20v_role_id;=0A=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetPermissionsByEntityId(=0A=20=20=20=20v_id=20=
UUID,=0A=20=20=20=20v_engine_session_seq_id=20INTEGER,=0A=20=20=20=20=
v_is_filtered=20BOOLEAN,=0A=20=20=20=20v_app_mode=20INTEGER)=0ARETURNS=20=
SETOF=20permissions_view=20STABLE=0A=0A=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=20=20FROM=20=
permissions_view=0A=20=20=20=20WHERE=20=20(permissions_view.app_mode=20&=20=
v_app_mode)=20>=200=0A=20=20=20=20=20=20=20=20AND=20object_id=20=3D=20=
v_id=0A=20=20=20=20=20=20=20=20AND=20(NOT=20v_is_filtered=20OR=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20GetUserPermissionsByEntityId(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20v_engine_session_seq_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20v_is_filtered)=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20);=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllUsersWithPermissionsOnEntityByEntityId(=0A=20=20=
=20=20v_id=20UUID,=0A=20=20=20=20v_engine_session_seq_id=20INTEGER,=0A=20=
=20=20=20v_is_filtered=20BOOLEAN,=0A=20=20=20=20v_app_mode=20INTEGER)=0A=
RETURNS=20SETOF=20permissions_view=20STABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=20=20FROM=20=
permissions_view=0A=20=20=20=20WHERE=20(permissions_view.app_mode=20&=20=
v_app_mode)=20>=200=0A=20=20=20=20=20=20=20=20AND=20object_id=20=3D=20=
v_id=0A=20=20=20=20=20=20=20=20AND=20(NOT=20v_is_filtered=20OR=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20GetAllUsersWithPermissionsByEntityId(=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20v_engine_session_seq_id,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20v_is_filtered)=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
);=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetUserPermissionsByEntityId(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_engine_session_seq_id=20INTEGER,=0A=20=20=20=20v_is_filtered=20=
BOOLEAN)=0ARETURNS=20SETOF=20permissions_view=20STABLE=0A=0A=0A=20=20=20=
AS=20$procedure$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=
=20=20FROM=20permissions_view=20p=0A=20=20=20=20WHERE=20object_id=20=3D=20=
v_id=0A=20=20=20=20AND=20(NOT=20v_is_filtered=20OR=20EXISTS=20(=0A=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20FROM=20=20=
engine_session_user_flat_groups=20u=0A=20=20=20=20=20=20=20=20WHERE=20=20=
p.ad_element_id=20=3D=20u.granted_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20u.engine_session_seq_id=20=3D=20v_engine_session_seq_id));=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllUsersWithPermissionsByEntityId(=0A=20=20=20=20=
=20v_id=20UUID,=0A=20=20=20=20=20v_engine_session_seq_id=20INTEGER,=0A=20=
=20=20=20=20v_is_filtered=20BOOLEAN)=0ARETURNS=20SETOF=20=
permissions_view=20STABLE=0A=20=20=20AS=20$procedure$=0ADECLARE=0A=20=20=20=
=20r_type=20int4;=0ABEGIN=0A=20=20=20=20FOR=20r_type=20IN=20(=0A=20=20=20=
=20=20=20=20=20SELECT=20DISTINCT=20role_type=0A=20=20=20=20=20=20=20=20=
FROM=20permissions_view=20p=0A=20=20=20=20=20=20=20=20WHERE=20object_id=20=
=3D=20v_id)=0A=20=20=20=20LOOP=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=20=
SELECT=20*=0A=20=20=20=20=20=20=20=20FROM=20permissions_view=20p=0A=20=20=
=20=20=20=20=20=20WHERE=20object_id=20in=20(select=20id=20from=20=
fn_get_entity_parents(v_id,=20r_type))=0A=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20(NOT=20v_is_filtered=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20FROM=20=20=20engine_session_user_flat_groups=20u=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=20p.ad_element_id=20=3D=20=
u.granted_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20u.engine_session_seq_id=20=3D=20v_engine_session_seq_id));=0A=20=20=
=20=20END=20LOOP;=0A=20=20=20=20RETURN;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeletePermissionsByEntityId(v_id=20UUID)=0ARETURNS=20VOID=0A=09=0A=09=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20DELETE=20FROM=20permissions=0A=20=
=20=20WHERE=20object_id=20=3D=20v_id;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetRoleActionGroupsByRoleId(v_id=20UUID)=0ARETURNS=20SETOF=20=
roles_groups=20STABLE=0A=20=20=20=20=0A=20=20=20=20=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=20=
FROM=20roles_groups=0A=20=20=20WHERE=20role_id=20=3D=20v_id;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetPermissionsTreeByEntityId(=0A=20=20=20=20v_id=20=
UUID,=0A=20=20=20=20v_object_type_id=20INTEGER,=0A=20=20=20=20=
v_engine_session_seq_id=20INTEGER,=0A=20=20=20=20v_is_filtered=20=
BOOLEAN,=20v_app_mode=20INTEGER)=0ARETURNS=20SETOF=20permissions_view=20=
STABLE=0A=09=0A=09=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=20SELECT=20*=0A=20=20=20=20FROM=20=20permissions_view=20p=0A=
=20=20=20=20WHERE=20=20(p.app_mode=20&=20v_app_mode)=20>=200=0A=20=20=20=20=
=20=20=20=20AND=20object_id=20IN(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fn_get_entity_parents(v_id,v_object_type_id))=0A=20=20=20=20=20=20=20=20=
AND=20(NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
1=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
engine_session_user_flat_groups=20u=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20=20p.ad_element_id=20=3D=20u.granted_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
u.engine_session_seq_id=20=3D=20v_engine_session_seq_id)=0A=20=20=20=20=20=
=20=20=20);=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetPermissionsByRoleIdAndObjectId(=0A=20=20=20=20v_role_id=20UUID,=0A=20=20=
=20=20v_object_id=20UUID)=0ARETURNS=20SETOF=20permissions_view=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20RETURN=20QUERY=20SELECT=20*=0A=
=20=20=20FROM=20permissions_view=0A=20=20=20WHERE=20role_id=20=3D=20=
v_role_id=0A=20=20=20=20=20=20=20AND=20object_id=20=3D=20v_object_id;=0A=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetForRoleAndAdElementAndObject_wGroupCheck(=0A=20=20=
=20=20v_role_id=20UUID,=0A=20=20=20=20v_ad_element_id=20UUID,=0A=20=20=20=
=20v_object_id=20UUID)=0ARETURNS=20SETOF=20permissions_view=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20RETURN=20QUERY=20SELECT=20*=0A=20=
=20=20FROM=20permissions_view=0A=20=20=20WHERE=20role_id=20=3D=20=
v_role_id=0A=20=20=20=20=20=20=20AND=20object_id=20=3D=20v_object_id=0A=20=
=20=20=20=20=20=20AND=20ad_element_id=20IN=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20FROM=20=
getUserAndGroupsById(v_ad_element_id)=0A=20=20=20=20=20=20=20);=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Insertnetwork=20(=0A=20=20=20=20v_addr=20=
VARCHAR(50),=0A=20=20=20=20v_description=20VARCHAR(4000),=0A=20=20=20=20=
v_free_text_comment=20TEXT,=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_name=20VARCHAR(50),=0A=20=20=20=20v_subnet=20VARCHAR(20),=0A=20=20=20=20=
v_gateway=20VARCHAR(20),=0A=20=20=20=20v_type=20INT,=0A=20=20=20=20=
v_vlan_id=20INT,=0A=20=20=20=20v_stp=20BOOLEAN,=0A=20=20=20=20=
v_storage_pool_id=20UUID,=0A=20=20=20=20v_mtu=20INT,=0A=20=20=20=20=
v_vm_network=20BOOLEAN,=0A=20=20=20=20v_provider_network_provider_id=20=
UUID,=0A=20=20=20=20v_provider_network_external_id=20TEXT,=0A=20=20=20=20=
v_qos_id=20UUID,=0A=20=20=20=20v_label=20TEXT=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20network=20=
(=0A=20=20=20=20=20=20=20=20addr,=0A=20=20=20=20=20=20=20=20description,=0A=
=20=20=20=20=20=20=20=20free_text_comment,=0A=20=20=20=20=20=20=20=20id,=0A=
=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20subnet,=0A=20=20=20=
=20=20=20=20=20gateway,=0A=20=20=20=20=20=20=20=20type,=0A=20=20=20=20=20=
=20=20=20vlan_id,=0A=20=20=20=20=20=20=20=20stp,=0A=20=20=20=20=20=20=20=20=
storage_pool_id,=0A=20=20=20=20=20=20=20=20mtu,=0A=20=20=20=20=20=20=20=20=
vm_network,=0A=20=20=20=20=20=20=20=20provider_network_provider_id,=0A=20=
=20=20=20=20=20=20=20provider_network_external_id,=0A=20=20=20=20=20=20=20=
=20qos_id,=0A=20=20=20=20=20=20=20=20label=0A=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_addr,=0A=20=20=20=20=20=
=20=20=20v_description,=0A=20=20=20=20=20=20=20=20v_free_text_comment,=0A=
=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20v_name,=0A=20=20=20=
=20=20=20=20=20v_subnet,=0A=20=20=20=20=20=20=20=20v_gateway,=0A=20=20=20=
=20=20=20=20=20v_type,=0A=20=20=20=20=20=20=20=20v_vlan_id,=0A=20=20=20=20=
=20=20=20=20v_stp,=0A=20=20=20=20=20=20=20=20v_storage_pool_id,=0A=20=20=20=
=20=20=20=20=20v_mtu,=0A=20=20=20=20=20=20=20=20v_vm_network,=0A=20=20=20=
=20=20=20=20=20v_provider_network_provider_id,=0A=20=20=20=20=20=20=20=20=
v_provider_network_external_id,=0A=20=20=20=20=20=20=20=20v_qos_id,=0A=20=
=20=20=20=20=20=20=20v_label=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Updatenetwork=20(=0A=20=20=20=20v_addr=20=
VARCHAR(50),=0A=20=20=20=20v_description=20VARCHAR(4000),=0A=20=20=20=20=
v_free_text_comment=20TEXT,=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_name=20VARCHAR(50),=0A=20=20=20=20v_subnet=20VARCHAR(20),=0A=20=20=20=20=
v_gateway=20VARCHAR(20),=0A=20=20=20=20v_type=20INT,=0A=20=20=20=20=
v_vlan_id=20INT,=0A=20=20=20=20v_stp=20BOOLEAN,=0A=20=20=20=20=
v_storage_pool_id=20UUID,=0A=20=20=20=20v_mtu=20INT,=0A=20=20=20=20=
v_vm_network=20BOOLEAN,=0A=20=20=20=20v_provider_network_provider_id=20=
UUID,=0A=20=20=20=20v_provider_network_external_id=20TEXT,=0A=20=20=20=20=
v_qos_id=20UUID,=0A=20=20=20=20v_label=20TEXT=0A=20=20=20=20)=0ARETURNS=20=
VOID=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
UPDATE=20network=0A=20=20=20=20SET=20addr=20=3D=20v_addr,=0A=20=20=20=20=20=
=20=20=20description=20=3D=20v_description,=0A=20=20=20=20=20=20=20=20=
free_text_comment=20=3D=20v_free_text_comment,=0A=20=20=20=20=20=20=20=20=
name=20=3D=20v_name,=0A=20=20=20=20=20=20=20=20subnet=20=3D=20v_subnet,=0A=
=20=20=20=20=20=20=20=20gateway=20=3D=20v_gateway,=0A=20=20=20=20=20=20=20=
=20type=20=3D=20v_type,=0A=20=20=20=20=20=20=20=20vlan_id=20=3D=20=
v_vlan_id,=0A=20=20=20=20=20=20=20=20stp=20=3D=20v_stp,=0A=20=20=20=20=20=
=20=20=20storage_pool_id=20=3D=20v_storage_pool_id,=0A=20=20=20=20=20=20=20=
=20mtu=20=3D=20v_mtu,=0A=20=20=20=20=20=20=20=20vm_network=20=3D=20=
v_vm_network,=0A=20=20=20=20=20=20=20=20provider_network_provider_id=20=3D=
=20v_provider_network_provider_id,=0A=20=20=20=20=20=20=20=20=
provider_network_external_id=20=3D=20v_provider_network_external_id,=0A=20=
=20=20=20=20=20=20=20qos_id=20=3D=20v_qos_id,=0A=20=20=20=20=20=20=20=20=
label=20=3D=20v_label=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Deletenetwork=20(v_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ADECLARE=20v_val=20UUID;=0A=0ABEGIN=0A=20=20=20=20--=20Get=20=
(and=20keep)=20a=20shared=20lock=20with=20"right=20to=20upgrade=20to=20=
exclusive"=0A=20=20=20=20--=20in=20order=20to=20force=20locking=20parent=20=
before=20children=0A=20=20=20=20SELECT=20id=0A=20=20=20=20INTO=20v_val=0A=
=20=20=20=20FROM=20network=0A=20=20=20=20WHERE=20id=20=3D=20v_id=0A=20=20=
=20=20FOR=20UPDATE;=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20network=0A=
=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=0A=20=20=20=20--=20Delete=20the=20=
network's=20permissions=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
permissions=0A=20=20=20=20WHERE=20object_id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromnetwork=20(=0A=20=20=20=20v_user_id=20=
uuid,=0A=20=20=20=20v_is_filtered=20boolean=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20network=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20network=0A=20=20=20=
=20WHERE=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=
=20=20=20=20FROM=20user_network_permissions_view=0A=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20entity_id=20=3D=20network.id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetnetworkByid=20(=0A=20=20=
=20=20v_id=20UUID,=0A=20=20=20=20v_user_id=20uuid,=0A=20=20=20=20=
v_is_filtered=20boolean=0A=20=20=20=20)=0ARETURNS=20SETOF=20network=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20network=0A=20=20=20=20WHERE=20id=20=
=3D=20v_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_network_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20v_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetnetworkByName=20(v_networkName=20VARCHAR(50))=0A=
RETURNS=20SETOF=20network=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
network=0A=20=20=20=20WHERE=20name=20=3D=20v_networkName;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetNetworkByNameAndDataCenter=20(=0A=20=20=20=20=
v_name=20VARCHAR(50),=0A=20=20=20=20v_storage_pool_id=20UUID=0A=20=20=20=20=
)=0ARETURNS=20SETOF=20network=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20network.*=0A=20=20=20=20=
FROM=20network=0A=20=20=20=20WHERE=20network.name=20=3D=20v_name=0A=20=20=
=20=20=20=20=20=20AND=20network.storage_pool_id=20=3D=20=
v_storage_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetNetworkByNameAndCluster=20(=0A=20=20=20=20v_name=20VARCHAR(50),=0A=20=20=
=20=20v_cluster_id=20UUID=0A=20=20=20=20)=0ARETURNS=20SETOF=20network=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20network.*=0A=20=20=20=20FROM=20network=0A=20=20=20=20=
WHERE=20network.name=20=3D=20v_name=0A=20=20=20=20=20=20=20=20AND=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=
=20=20=20=20=20=20=20=20FROM=20network_cluster=0A=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20network.id=20=3D=20network_cluster.network_id=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
network_cluster.cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetManagementNetworkByCluster=20(v_cluster_id=20UUID)=0ARETURNS=20SETOF=20=
network=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=
=0A=20=20=20=20SELECT=20network.*=0A=20=20=20=20FROM=20network=0A=20=20=20=
=20WHERE=20id=20=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
network_id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20network_cluster=0A=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20network_cluster.cluster_id=20=
=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
network_cluster.management=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllNetworkByStoragePoolId=20(=0A=20=20=20=20v_id=20=
UUID,=0A=20=20=20=20v_user_id=20uuid,=0A=20=20=20=20v_is_filtered=20=
boolean=0A=20=20=20=20)=0ARETURNS=20SETOF=20network=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20network=0A=20=20=20=20WHERE=20storage_pool_id=20=3D=
=20v_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_network_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20network.id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20TYPE=20IF=20EXISTS=20networkViewClusterType=20=
CASCADE;=0A**************************=0A=0ADROP=20TYPE=0A*********=20=
QUERY=20**********=0ACREATE=20TYPE=20networkViewClusterType=20AS=20(=0A=20=
=20=20=20=20=20=20=20id=20uuid,=0A=20=20=20=20=20=20=20=20name=20=
VARCHAR(50),=0A=20=20=20=20=20=20=20=20description=20VARCHAR(4000),=0A=20=
=20=20=20=20=20=20=20free_text_comment=20TEXT,=0A=20=20=20=20=20=20=20=20=
type=20INT,=0A=20=20=20=20=20=20=20=20addr=20VARCHAR(50),=0A=20=20=20=20=20=
=20=20=20subnet=20VARCHAR(20),=0A=20=20=20=20=20=20=20=20gateway=20=
VARCHAR(20),=0A=20=20=20=20=20=20=20=20vlan_id=20INT,=0A=20=20=20=20=20=20=
=20=20stp=20BOOLEAN,=0A=20=20=20=20=20=20=20=20storage_pool_id=20UUID,=0A=
=20=20=20=20=20=20=20=20mtu=20INT,=0A=20=20=20=20=20=20=20=20vm_network=20=
BOOLEAN,=0A=20=20=20=20=20=20=20=20label=20TEXT,=0A=20=20=20=20=20=20=20=20=
provider_network_provider_id=20UUID,=0A=20=20=20=20=20=20=20=20=
provider_network_external_id=20TEXT,=0A=20=20=20=20=20=20=20=20qos_id=20=
UUID,=0A=20=20=20=20=20=20=20=20network_id=20UUID,=0A=20=20=20=20=20=20=20=
=20cluster_id=20UUID,=0A=20=20=20=20=20=20=20=20status=20INT,=0A=20=20=20=
=20=20=20=20=20is_display=20BOOLEAN,=0A=20=20=20=20=20=20=20=20required=20=
BOOLEAN,=0A=20=20=20=20=20=20=20=20migration=20BOOLEAN,=0A=20=20=20=20=20=
=20=20=20management=20BOOLEAN,=0A=20=20=20=20=20=20=20=20is_gluster=20=
BOOLEAN=0A=20=20=20=20=20=20=20=20);=0A**************************=0A=0A=
CREATE=20TYPE=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
FUNCTION=20GetAllNetworkByClusterId=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=
=20=20v_user_id=20uuid,=0A=20=20=20=20v_is_filtered=20boolean=0A=20=20=20=
=20)=0ARETURNS=20SETOF=20networkViewClusterType=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
DISTINCT=20network.id,=0A=20=20=20=20=20=20=20=20network.name,=0A=20=20=20=
=20=20=20=20=20network.description,=0A=20=20=20=20=20=20=20=20=
network.free_text_comment,=0A=20=20=20=20=20=20=20=20network.type,=0A=20=20=
=20=20=20=20=20=20network.addr,=0A=20=20=20=20=20=20=20=20=
network.subnet,=0A=20=20=20=20=20=20=20=20network.gateway,=0A=20=20=20=20=
=20=20=20=20network.vlan_id,=0A=20=20=20=20=20=20=20=20network.stp,=0A=20=
=20=20=20=20=20=20=20network.storage_pool_id,=0A=20=20=20=20=20=20=20=20=
network.mtu,=0A=20=20=20=20=20=20=20=20network.vm_network,=0A=20=20=20=20=
=20=20=20=20network.label,=0A=20=20=20=20=20=20=20=20=
network.provider_network_provider_id,=0A=20=20=20=20=20=20=20=20=
network.provider_network_external_id,=0A=20=20=20=20=20=20=20=20=
network.qos_id,=0A=20=20=20=20=20=20=20=20network_cluster.network_id,=0A=20=
=20=20=20=20=20=20=20network_cluster.cluster_id,=0A=20=20=20=20=20=20=20=20=
network_cluster.status,=0A=20=20=20=20=20=20=20=20=
network_cluster.is_display,=0A=20=20=20=20=20=20=20=20=
network_cluster.required,=0A=20=20=20=20=20=20=20=20=
network_cluster.migration,=0A=20=20=20=20=20=20=20=20=
network_cluster.management,=0A=20=20=20=20=20=20=20=20=
network_cluster.is_gluster=0A=20=20=20=20FROM=20network=0A=20=20=20=20=
INNER=20JOIN=20network_cluster=0A=20=20=20=20=20=20=20=20ON=20network.id=20=
=3D=20network_cluster.network_id=0A=20=20=20=20WHERE=20=
network_cluster.cluster_id=20=3D=20v_id=0A=20=20=20=20=20=20=20=20AND=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=
=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20user_network_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20network.id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20ORDER=20BY=20network.name;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllNetworksByQosId=20(v_id=20UUID)=0ARETURNS=20=
SETOF=20network=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20network=0A=20=20=20=
=20WHERE=20qos_id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllNetworksByNetworkProviderId=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
network=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=
=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20network=0A=20=20=20=20=
WHERE=20provider_network_provider_id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllNetworkViewsByNetworkProviderId=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
network_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20network_view=0A=20=
=20=20=20WHERE=20provider_network_provider_id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllNetworkLabelsByDataCenterId=20(v_id=20UUID)=0A=
RETURNS=20SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20DISTINCT=20label=0A=20=20=20=20=
FROM=20network=0A=20=20=20=20WHERE=20network.storage_pool_id=20=3D=20=
v_id=0A=20=20=20=20=20=20=20=20AND=20label=20IS=20NOT=20NULL;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Insertvds_interface=20(=0A=20=20=20=20v_addr=20=
VARCHAR(20),=0A=20=20=20=20v_bond_name=20VARCHAR(50),=0A=20=20=20=20=
v_bond_type=20INT,=0A=20=20=20=20v_gateway=20VARCHAR(20),=0A=20=20=20=20=
v_id=20UUID,=0A=20=20=20=20v_is_bond=20BOOLEAN,=0A=20=20=20=20=
v_reported_switch_type=20VARCHAR(6),=0A=20=20=20=20v_bond_opts=20=
VARCHAR(4000),=0A=20=20=20=20v_mac_addr=20VARCHAR(20),=0A=20=20=20=20=
v_name=20VARCHAR(50),=0A=20=20=20=20v_network_name=20VARCHAR(50),=0A=20=20=
=20=20v_speed=20INT,=0A=20=20=20=20v_subnet=20VARCHAR(20),=0A=20=20=20=20=
v_boot_protocol=20INT,=0A=20=20=20=20v_type=20INT,=0A=20=20=20=20=
v_vds_id=20UUID,=0A=20=20=20=20v_base_interface=20VARCHAR(50),=0A=20=20=20=
=20v_vlan_id=20INT,=0A=20=20=20=20v_mtu=20INT,=0A=20=20=20=20v_bridged=20=
BOOLEAN,=0A=20=20=20=20v_labels=20TEXT,=0A=20=20=20=20=
v_ipv6_boot_protocol=20INT,=0A=20=20=20=20v_ipv6_address=20VARCHAR(50),=0A=
=20=20=20=20v_ipv6_prefix=20INT,=0A=20=20=20=20v_ipv6_gateway=20=
VARCHAR(50),=0A=20=20=20=20v_ad_partner_mac=20VARCHAR(50)=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20vds_interface=20(=0A=20=20=20=20=20=20=20=20addr,=0A=20=20=20=20=20=
=20=20=20bond_name,=0A=20=20=20=20=20=20=20=20bond_type,=0A=20=20=20=20=20=
=20=20=20gateway,=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20=
is_bond,=0A=20=20=20=20=20=20=20=20reported_switch_type,=0A=20=20=20=20=20=
=20=20=20bond_opts,=0A=20=20=20=20=20=20=20=20mac_addr,=0A=20=20=20=20=20=
=20=20=20name,=0A=20=20=20=20=20=20=20=20network_name,=0A=20=20=20=20=20=20=
=20=20speed,=0A=20=20=20=20=20=20=20=20subnet,=0A=20=20=20=20=20=20=20=20=
boot_protocol,=0A=20=20=20=20=20=20=20=20type,=0A=20=20=20=20=20=20=20=20=
VDS_ID,=0A=20=20=20=20=20=20=20=20base_interface,=0A=20=20=20=20=20=20=20=
=20vlan_id,=0A=20=20=20=20=20=20=20=20mtu,=0A=20=20=20=20=20=20=20=20=
bridged,=0A=20=20=20=20=20=20=20=20labels,=0A=20=20=20=20=20=20=20=20=
ipv6_address,=0A=20=20=20=20=20=20=20=20ipv6_gateway,=0A=20=20=20=20=20=20=
=20=20ipv6_prefix,=0A=20=20=20=20=20=20=20=20ipv6_boot_protocol,=0A=20=20=
=20=20=20=20=20=20ad_partner_mac=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_addr,=0A=20=20=20=20=20=20=20=20=
v_bond_name,=0A=20=20=20=20=20=20=20=20v_bond_type,=0A=20=20=20=20=20=20=20=
=20v_gateway,=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20=
v_is_bond,=0A=20=20=20=20=20=20=20=20v_reported_switch_type,=0A=20=20=20=20=
=20=20=20=20v_bond_opts,=0A=20=20=20=20=20=20=20=20v_mac_addr,=0A=20=20=20=
=20=20=20=20=20v_name,=0A=20=20=20=20=20=20=20=20v_network_name,=0A=20=20=
=20=20=20=20=20=20v_speed,=0A=20=20=20=20=20=20=20=20v_subnet,=0A=20=20=20=
=20=20=20=20=20v_boot_protocol,=0A=20=20=20=20=20=20=20=20v_type,=0A=20=20=
=20=20=20=20=20=20v_vds_id,=0A=20=20=20=20=20=20=20=20v_base_interface,=0A=
=20=20=20=20=20=20=20=20v_vlan_id,=0A=20=20=20=20=20=20=20=20v_mtu,=0A=20=
=20=20=20=20=20=20=20v_bridged,=0A=20=20=20=20=20=20=20=20v_labels,=0A=20=
=20=20=20=20=20=20=20v_ipv6_address,=0A=20=20=20=20=20=20=20=20=
v_ipv6_gateway,=0A=20=20=20=20=20=20=20=20v_ipv6_prefix,=0A=20=20=20=20=20=
=20=20=20v_ipv6_boot_protocol,=0A=20=20=20=20=20=20=20=20=
v_ad_partner_mac=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Updatevds_interface=20(=0A=20=20=20=20v_addr=20VARCHAR(20),=0A=20=20=20=20=
v_bond_name=20VARCHAR(50),=0A=20=20=20=20v_bond_type=20INT,=0A=20=20=20=20=
v_gateway=20VARCHAR(20),=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_is_bond=20BOOLEAN,=0A=20=20=20=20v_reported_switch_type=20VARCHAR(6),=0A=
=20=20=20=20v_bond_opts=20VARCHAR(4000),=0A=20=20=20=20v_mac_addr=20=
VARCHAR(20),=0A=20=20=20=20v_name=20VARCHAR(50),=0A=20=20=20=20=
v_network_name=20VARCHAR(50),=0A=20=20=20=20v_speed=20INT,=0A=20=20=20=20=
v_subnet=20VARCHAR(20),=0A=20=20=20=20v_boot_protocol=20INT,=0A=20=20=20=20=
v_type=20INT,=0A=20=20=20=20v_vds_id=20UUID,=0A=20=20=20=20=
v_base_interface=20VARCHAR(50),=0A=20=20=20=20v_vlan_id=20INT,=0A=20=20=20=
=20v_mtu=20INT,=0A=20=20=20=20v_bridged=20BOOLEAN,=0A=20=20=20=20=
v_labels=20TEXT,=0A=20=20=20=20v_ipv6_address=20VARCHAR(50),=0A=20=20=20=20=
v_ipv6_gateway=20VARCHAR(50),=0A=20=20=20=20v_ipv6_prefix=20INT,=0A=20=20=
=20=20v_ipv6_boot_protocol=20INT,=0A=20=20=20=20v_ad_partner_mac=20=
VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vds_interface=0A=20=20=20=
=20SET=20addr=20=3D=20v_addr,=0A=20=20=20=20=20=20=20=20bond_name=20=3D=20=
v_bond_name,=0A=20=20=20=20=20=20=20=20bond_type=20=3D=20v_bond_type,=0A=20=
=20=20=20=20=20=20=20gateway=20=3D=20v_gateway,=0A=20=20=20=20=20=20=20=20=
is_bond=20=3D=20v_is_bond,=0A=20=20=20=20=20=20=20=20=
reported_switch_type=20=3D=20v_reported_switch_type,=0A=20=20=20=20=20=20=
=20=20bond_opts=20=3D=20v_bond_opts,=0A=20=20=20=20=20=20=20=20mac_addr=20=
=3D=20v_mac_addr,=0A=20=20=20=20=20=20=20=20name=20=3D=20v_name,=0A=20=20=
=20=20=20=20=20=20network_name=20=3D=20v_network_name,=0A=20=20=20=20=20=20=
=20=20speed=20=3D=20v_speed,=0A=20=20=20=20=20=20=20=20subnet=20=3D=20=
v_subnet,=0A=20=20=20=20=20=20=20=20boot_protocol=20=3D=20=
v_boot_protocol,=0A=20=20=20=20=20=20=20=20type=20=3D=20v_type,=0A=20=20=20=
=20=20=20=20=20VDS_ID=20=3D=20v_vds_id,=0A=20=20=20=20=20=20=20=20=
base_interface=20=3D=20v_base_interface,=0A=20=20=20=20=20=20=20=20=
vlan_id=20=3D=20v_vlan_id,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP,=0A=20=20=20=20=20=20=20=20mtu=20=3D=20v_mtu,=0A=20=20=20=20=
=20=20=20=20bridged=20=3D=20v_bridged,=0A=20=20=20=20=20=20=20=20labels=20=
=3D=20v_labels,=0A=20=20=20=20=20=20=20=20ipv6_address=20=3D=20=
v_ipv6_address,=0A=20=20=20=20=20=20=20=20ipv6_gateway=20=3D=20=
v_ipv6_gateway,=0A=20=20=20=20=20=20=20=20ipv6_prefix=20=3D=20=
v_ipv6_prefix,=0A=20=20=20=20=20=20=20=20ipv6_boot_protocol=20=3D=20=
v_ipv6_boot_protocol,=0A=20=20=20=20=20=20=20=20ad_partner_mac=20=3D=20=
v_ad_partner_mac=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Deletevds_interface=20(v_id=20UUID)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vds_interface=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Clear_network_from_nics=20(v_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vds_interface=0A=20=20=20=20=
SET=20network_name=20=3D=20NULL=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Getinterface_viewByvds_id=20(=0A=20=20=20=20=
v_vds_id=20UUID,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20=
v_is_filtered=20boolean=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
vds_interface_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vds_interface_view=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id=0A=20=20=
=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20=
v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20user_vds_permissions_view=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20=
v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20entity_id=20=3D=20v_vds_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ADROP=20TYPE=20IF=20EXISTS=20=
host_networks_by_cluster_rs=20CASCADE;=0A**************************=0A=0A=
DROP=20TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
host_networks_by_cluster_rs=20AS=20(=0A=20=20=20=20=20=20=20=20vds_id=20=
UUID,=0A=20=20=20=20=20=20=20=20network_name=20VARCHAR=0A=20=20=20=20=20=20=
=20=20);=0A**************************=0A=0ACREATE=20TYPE=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetHostNetworksByCluster=20(v_cluster_id=20UUID)=0ARETURNS=20SETOF=20=
host_networks_by_cluster_rs=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vds_static.vds_id,=0A=20=20=20=
=20=20=20=20=20vds_interface.network_name=0A=20=20=20=20FROM=20=
vds_static=0A=20=20=20=20INNER=20JOIN=20vds_interface=0A=20=20=20=20=20=20=
=20=20ON=20vds_interface.vds_id=20=3D=20vds_static.vds_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20vds_static.cluster_id=20=3D=20v_cluster_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Getinterface_viewByAddr=20(=0A=20=20=20=20=
v_cluster_id=20UUID,=0A=20=20=20=20v_addr=20VARCHAR(50)=0A=20=20=20=20)=0A=
RETURNS=20SETOF=20vds_interface_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
vds_interface_view.*=0A=20=20=20=20FROM=20vds_interface_view=0A=20=20=20=20=
INNER=20JOIN=20vds_static=0A=20=20=20=20=20=20=20=20ON=20=
vds_interface_view.vds_id=20=3D=20vds_static.vds_id=0A=20=20=20=20WHERE=20=
vds_interface_view.addr=20=3D=20v_addr=0A=20=20=20=20=20=20=20=20AND=20=
vds_static.cluster_id=20=3D=20v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVdsManagedInterfaceByVdsId=20(=0A=20=20=20=20v_vds_id=20UUID,=0A=20=20=
=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20boolean=0A=20=20=20=
=20)=0ARETURNS=20SETOF=20vds_interface_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20vds_interface_view=0A=20=20=20=20--=20Checking=20if=20the=20=
2nd=20bit=20in=20the=20type=20column=20is=20set,=20meaning=20that=20the=20=
interface=20is=20managed=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id=0A=
=20=20=20=20=20=20=20=20AND=20(type=20&=202)=20=3D=202=0A=20=20=20=20=20=20=
=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=
=20=20=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20user_vds_permissions_view=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20=
v_vds_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVdsInterfacesByNetworkId=20(v_network_id=20UUID)=0ARETURNS=20SETOF=20=
vds_interface_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vds_interface_view.*=0A=20=20=20=
=20FROM=20vds_interface_view=0A=20=20=20=20INNER=20JOIN=20vds=0A=20=20=20=
=20=20=20=20=20ON=20vds.vds_id=20=3D=20vds_interface_view.vds_id=0A=20=20=
=20=20INNER=20JOIN=20network_cluster=0A=20=20=20=20=20=20=20=20ON=20=
network_cluster.cluster_id=20=3D=20vds.cluster_id=0A=20=20=20=20INNER=20=
JOIN=20network=0A=20=20=20=20=20=20=20=20ON=20network.id=20=3D=20=
network_cluster.network_id=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
network.name=20=3D=20vds_interface_view.network_name=0A=20=20=20=20WHERE=20=
network.id=20=3D=20v_network_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVdsInterfaceById=20=
(v_vds_interface_id=20UUID)=0ARETURNS=20SETOF=20vds_interface_view=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20vds_interface_view=0A=20=20=20=20=
WHERE=20id=20=3D=20v_vds_interface_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVdsInterfaceByName=20(=0A=20=20=20=20v_host_id=20UUID,=0A=20=20=20=20=
v_name=20VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
vds_interface_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vds_interface_view=0A=20=20=20=20WHERE=20name=20=3D=20v_name=0A=20=20=20=20=
=20=20=20=20AND=20vds_id=20=3D=20v_host_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetInterfacesByClusterId=20(v_cluster_id=20UUID)=0ARETURNS=20SETOF=20=
vds_interface_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vds_interface_view.*=0A=20=20=20=
=20FROM=20vds_interface_view=0A=20=20=20=20INNER=20JOIN=20vds_static=0A=20=
=20=20=20=20=20=20=20ON=20vds_interface_view.vds_id=20=3D=20=
vds_static.vds_id=0A=20=20=20=20WHERE=20vds_static.cluster_id=20=3D=20=
v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetInterfacesByDataCenterId=20(v_data_center_id=20UUID)=0ARETURNS=20=
SETOF=20vds_interface_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vds_interface_view.*=0A=20=20=
=20=20FROM=20vds_interface_view=0A=20=20=20=20INNER=20JOIN=20vds_static=0A=
=20=20=20=20=20=20=20=20ON=20vds_interface_view.vds_id=20=3D=20=
vds_static.vds_id=0A=20=20=20=20INNER=20JOIN=20cluster=0A=20=20=20=20=20=20=
=20=20ON=20vds_static.cluster_id=20=3D=20cluster.cluster_id=0A=20=20=20=20=
WHERE=20cluster.storage_pool_id=20=3D=20v_data_center_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertVmInterface=20(=0A=20=20=20=20v_id=20UUID,=0A=20=
=20=20=20v_mac_addr=20VARCHAR(20),=0A=20=20=20=20v_name=20VARCHAR(50),=0A=
=20=20=20=20v_speed=20INT,=0A=20=20=20=20v_vnic_profile_id=20UUID,=0A=20=20=
=20=20v_vm_guid=20UUID,=0A=20=20=20=20v_vmt_guid=20UUID,=0A=20=20=20=20=
v_type=20INT,=0A=20=20=20=20v_linked=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
vm_interface=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20=
mac_addr,=0A=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20=
speed,=0A=20=20=20=20=20=20=20=20vnic_profile_id,=0A=20=20=20=20=20=20=20=
=20vm_guid,=0A=20=20=20=20=20=20=20=20vmt_guid,=0A=20=20=20=20=20=20=20=20=
type,=0A=20=20=20=20=20=20=20=20linked=0A=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20=
v_mac_addr,=0A=20=20=20=20=20=20=20=20v_name,=0A=20=20=20=20=20=20=20=20=
v_speed,=0A=20=20=20=20=20=20=20=20v_vnic_profile_id,=0A=20=20=20=20=20=20=
=20=20v_vm_guid,=0A=20=20=20=20=20=20=20=20v_vmt_guid,=0A=20=20=20=20=20=20=
=20=20v_type,=0A=20=20=20=20=20=20=20=20v_linked=0A=20=20=20=20=20=20=20=20=
);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateVmInterface=20(=0A=20=20=20=20v_id=20UUID,=0A=20=
=20=20=20v_mac_addr=20VARCHAR(20),=0A=20=20=20=20v_name=20VARCHAR(50),=0A=
=20=20=20=20v_speed=20INT,=0A=20=20=20=20v_vnic_profile_id=20UUID,=0A=20=20=
=20=20v_vm_guid=20UUID,=0A=20=20=20=20v_vmt_guid=20UUID,=0A=20=20=20=20=
v_type=20INT,=0A=20=20=20=20v_linked=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vm_interface=0A=20=
=20=20=20SET=20mac_addr=20=3D=20v_mac_addr,=0A=20=20=20=20=20=20=20=20=
name=20=3D=20v_name,=0A=20=20=20=20=20=20=20=20speed=20=3D=20v_speed,=0A=20=
=20=20=20=20=20=20=20vnic_profile_id=20=3D=20v_vnic_profile_id,=0A=20=20=20=
=20=20=20=20=20vm_guid=20=3D=20v_vm_guid,=0A=20=20=20=20=20=20=20=20=
vmt_guid=20=3D=20v_vmt_guid,=0A=20=20=20=20=20=20=20=20type=20=3D=20=
v_type,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP,=0A=
=20=20=20=20=20=20=20=20linked=20=3D=20v_linked=0A=20=20=20=20WHERE=20id=20=
=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteVmInterface=20=
(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_val=20=
UUID;=0A=0ABEGIN=0A=20=20=20=20--=20Get=20(and=20keep)=20a=20shared=20=
lock=20with=20"right=20to=20upgrade=20to=20exclusive"=0A=20=20=20=20--=20=
in=20order=20to=20force=20locking=20parent=20before=20children=0A=20=20=20=
=20SELECT=20id=0A=20=20=20=20INTO=20v_val=0A=20=20=20=20FROM=20=
vm_interface=0A=20=20=20=20WHERE=20id=20=3D=20v_id=0A=20=20=20=20FOR=0A=0A=
=20=20=20=20UPDATE;=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vm_interface=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmInterfaceByVmInterfaceId=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
vm_interface=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20vm_interface=0A=20=
=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromVmInterfaces=20()=0ARETURNS=20SETOF=20vm_interface=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20*=0A=20=20=20=20FROM=20vm_interface;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmInterfacesByVmId=20(v_vm_id=20UUID)=0ARETURNS=20SETOF=20=
vm_interface=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20vm_interface=0A=20=
=20=20=20WHERE=20vm_guid=20=3D=20v_vm_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmInterfaceByTemplateId=20(v_template_id=20UUID)=0ARETURNS=20SETOF=20=
vm_interface=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20vm_interface=0A=20=
=20=20=20WHERE=20vmt_guid=20=3D=20v_template_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmInterfacesByNetworkId=20(v_network_id=20UUID)=0ARETURNS=20SETOF=20=
vm_interface=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20vm_interface.*=0A=20=20=20=20FROM=20=
vm_interface=0A=20=20=20=20INNER=20JOIN=20vnic_profiles=0A=20=20=20=20=20=
=20=20=20ON=20vm_interface.vnic_profile_id=20=3D=20vnic_profiles.id=0A=20=
=20=20=20INNER=20JOIN=20vm_static=0A=20=20=20=20=20=20=20=20ON=20=
vm_interface.vm_guid=20=3D=20vm_static.vm_guid=0A=20=20=20=20WHERE=20=
vnic_profiles.network_id=20=3D=20v_network_id=0A=20=20=20=20=20=20=20=20=
AND=20vm_static.entity_type=20=3D=20'VM';=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmTemplateInterfacesByNetworkId=20(v_network_id=20UUID)=0ARETURNS=20=
SETOF=20vm_interface=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vm_interface.*=0A=20=20=20=20=
FROM=20vm_interface=0A=20=20=20=20INNER=20JOIN=20vm_static=0A=20=20=20=20=
=20=20=20=20ON=20vm_interface.vmt_guid=20=3D=20vm_static.vm_guid=0A=20=20=
=20=20INNER=20JOIN=20vnic_profiles=0A=20=20=20=20=20=20=20=20ON=20=
vm_interface.vnic_profile_id=20=3D=20vnic_profiles.id=0A=20=20=20=20=
WHERE=20vnic_profiles.network_id=20=3D=20v_network_id=0A=20=20=20=20=20=20=
=20=20AND=20vm_static.entity_type=20=3D=20'TEMPLATE';=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetMacsByDataCenterId=20(v_data_center_id=20UUID)=0ARETURNS=20SETOF=20=
VARCHAR=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=
=0A=20=20=20=20SELECT=20mac_addr=0A=20=20=20=20FROM=20vm_interface=0A=20=20=
=20=20WHERE=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
1=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vm_static=0A=20=20=20=20=20=
=20=20=20=20=20=20=20INNER=20JOIN=20cluster=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20ON=20vm_static.cluster_id=20=3D=20=
cluster.cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
cluster.storage_pool_id=20=3D=20v_data_center_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20vm_static.vm_guid=20=3D=20=
vm_interface.vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromVmNetworkInterfaceViews=20()=0ARETURNS=20=
SETOF=20vm_interface_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vm_interface_view;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmNetworkInterfaceViewByVmNetworkInterfaceViewId=20(v_id=20UUID)=0A=
RETURNS=20SETOF=20vm_interface_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20vm_interface_view=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetPluggedVmInterfacesByMac=20(v_mac_address=20=
VARCHAR(20))=0ARETURNS=20SETOF=20vm_interface_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20vm_interface_view=0A=20=20=20=20WHERE=20mac_addr=20=
=3D=20v_mac_address=0A=20=20=20=20=20=20=20=20AND=20is_plugged=20=3D=20=
true;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmNetworkInterfaceViewByVmId=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=
=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20BOOLEAN=0A=20=20=20=
=20)=0ARETURNS=20SETOF=20vm_interface_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20vm_interface_view=0A=20=20=20=20WHERE=20vm_guid=20=3D=20=
v_vm_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vm_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20entity_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVmNetworkInterfaceToMonitorByVmId=20(v_vm_id=20=
UUID)=0ARETURNS=20SETOF=20vm_interface_monitoring_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20vm_interface_monitoring_view=0A=20=20=20=20WHERE=20=
vm_guid=20=3D=20v_vm_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmNetworkInterfaceViewByTemplateId=20(=0A=20=20=20=20v_template_id=20=
UUID,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20=
boolean=0A=20=20=20=20)=0ARETURNS=20SETOF=20vm_interface_view=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20*=0A=20=20=20=20FROM=20vm_interface_view=0A=20=20=20=20WHERE=20=
vmt_guid=20=3D=20v_template_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=
=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vm_template_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20v_template_id=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=
=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmInterfaceViewsByNetworkId=20(v_network_id=20UUID)=0ARETURNS=20SETOF=20=
vm_interface_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vm_interface_view.*=0A=20=20=20=20=
FROM=20vm_interface_view=0A=20=20=20=20INNER=20JOIN=20vnic_profiles=0A=20=
=20=20=20=20=20=20=20ON=20vnic_profiles.id=20=3D=20=
vm_interface_view.vnic_profile_id=0A=20=20=20=20WHERE=20=
vnic_profiles.network_id=20=3D=20v_network_id=0A=20=20=20=20=20=20=20=20=
AND=20vm_interface_view.vm_entity_type=20=3D=20'VM';=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmTemplateInterfaceViewsByNetworkId=20(v_network_id=20UUID)=0ARETURNS=20=
SETOF=20vm_interface_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vm_interface_view.*=0A=20=20=20=
=20FROM=20vm_interface_view=0A=20=20=20=20INNER=20JOIN=20vnic_profiles=0A=
=20=20=20=20=20=20=20=20ON=20vnic_profiles.id=20=3D=20=
vm_interface_view.vnic_profile_id=0A=20=20=20=20WHERE=20=
vnic_profiles.network_id=20=3D=20v_network_id=0A=20=20=20=20=20=20=20=20=
AND=20vm_interface_view.vm_entity_type=20=3D=20'TEMPLATE';=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Getvm_interface_statisticsById=20(v_id=20UUID)=0A=
RETURNS=20SETOF=20vm_interface_statistics=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20vm_interface_statistics=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Insertvm_interface_statistics=20(=0A=20=20=20=20=
v_id=20UUID,=0A=20=20=20=20v_rx_drop=20DECIMAL(18,=200),=0A=20=20=20=20=
v_rx_rate=20DECIMAL(18,=200),=0A=20=20=20=20v_rx_total=20BIGINT,=0A=20=20=
=20=20v_rx_offset=20BIGINT,=0A=20=20=20=20v_tx_drop=20DECIMAL(18,=200),=0A=
=20=20=20=20v_tx_rate=20DECIMAL(18,=200),=0A=20=20=20=20v_tx_total=20=
BIGINT,=0A=20=20=20=20v_tx_offset=20BIGINT,=0A=20=20=20=20v_iface_status=20=
INT,=0A=20=20=20=20v_sample_time=20FLOAT,=0A=20=20=20=20v_vm_id=20UUID=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
INSERT=20INTO=20vm_interface_statistics=20(=0A=20=20=20=20=20=20=20=20=
id,=0A=20=20=20=20=20=20=20=20rx_drop,=0A=20=20=20=20=20=20=20=20=
rx_rate,=0A=20=20=20=20=20=20=20=20rx_total,=0A=20=20=20=20=20=20=20=20=
rx_offset,=0A=20=20=20=20=20=20=20=20tx_drop,=0A=20=20=20=20=20=20=20=20=
tx_rate,=0A=20=20=20=20=20=20=20=20tx_total,=0A=20=20=20=20=20=20=20=20=
tx_offset,=0A=20=20=20=20=20=20=20=20vm_id,=0A=20=20=20=20=20=20=20=20=
iface_status,=0A=20=20=20=20=20=20=20=20sample_time=0A=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=
=20=20=20=20=20v_rx_drop,=0A=20=20=20=20=20=20=20=20v_rx_rate,=0A=20=20=20=
=20=20=20=20=20v_rx_total,=0A=20=20=20=20=20=20=20=20v_rx_offset,=0A=20=20=
=20=20=20=20=20=20v_tx_drop,=0A=20=20=20=20=20=20=20=20v_tx_rate,=0A=20=20=
=20=20=20=20=20=20v_tx_total,=0A=20=20=20=20=20=20=20=20v_tx_offset,=0A=20=
=20=20=20=20=20=20=20v_vm_id,=0A=20=20=20=20=20=20=20=20v_iface_status,=0A=
=20=20=20=20=20=20=20=20v_sample_time=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Updatevm_interface_statistics=20(=0A=20=20=20=20=
v_id=20UUID,=0A=20=20=20=20v_rx_drop=20DECIMAL(18,=200),=0A=20=20=20=20=
v_rx_rate=20DECIMAL(18,=200),=0A=20=20=20=20v_rx_total=20BIGINT,=0A=20=20=
=20=20v_rx_offset=20BIGINT,=0A=20=20=20=20v_tx_drop=20DECIMAL(18,=200),=0A=
=20=20=20=20v_tx_rate=20DECIMAL(18,=200),=0A=20=20=20=20v_tx_total=20=
BIGINT,=0A=20=20=20=20v_tx_offset=20BIGINT,=0A=20=20=20=20v_iface_status=20=
INT,=0A=20=20=20=20v_sample_time=20FLOAT,=0A=20=20=20=20v_vm_id=20UUID=0A=
=20=20=20=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vm_interface_statistics=0A=20=20=
=20=20SET=20rx_drop=20=3D=20v_rx_drop,=0A=20=20=20=20=20=20=20=20rx_rate=20=
=3D=20v_rx_rate,=0A=20=20=20=20=20=20=20=20rx_total=20=3D=20v_rx_total,=0A=
=20=20=20=20=20=20=20=20rx_offset=20=3D=20v_rx_offset,=0A=20=20=20=20=20=20=
=20=20tx_drop=20=3D=20v_tx_drop,=0A=20=20=20=20=20=20=20=20tx_rate=20=3D=20=
v_tx_rate,=0A=20=20=20=20=20=20=20=20tx_total=20=3D=20v_tx_total,=0A=20=20=
=20=20=20=20=20=20tx_offset=20=3D=20v_tx_offset,=0A=20=20=20=20=20=20=20=20=
vm_id=20=3D=20v_vm_id,=0A=20=20=20=20=20=20=20=20iface_status=20=3D=20=
v_iface_status,=0A=20=20=20=20=20=20=20=20sample_time=20=3D=20=
v_sample_time,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Deletevm_interface_statistics=20(v_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ADECLARE=20v_val=20UUID;=0A=0ABEGIN=0A=20=20=20=20--=20Get=20=
(and=20keep)=20a=20shared=20lock=20with=20"right=20to=20upgrade=20to=20=
exclusive"=0A=20=20=20=20--=20in=20order=20to=20force=20locking=20parent=20=
before=20children=0A=20=20=20=20SELECT=20id=0A=20=20=20=20INTO=20v_val=0A=
=20=20=20=20FROM=20vm_interface_statistics=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id=0A=20=20=20=20FOR=0A=0A=20=20=20=20UPDATE;=0A=0A=20=20=20=20DELETE=0A=
=20=20=20=20FROM=20vm_interface_statistics=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmGuestAgentInterfacesByVmId=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=
=20=20v_user_id=20UUID,=0A=20=20=20=20v_filtered=20BOOLEAN=0A=20=20=20=20=
)=0ARETURNS=20SETOF=20vm_guest_agent_interfaces=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20vm_guest_agent_interfaces=0A=20=20=20=20WHERE=20=
vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20NOT=20v_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=
=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vm_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20entity_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteVmGuestAgentInterfacesByVmId=20(v_vm_id=20=
UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=
=20=20=20=20FROM=20vm_guest_agent_interfaces=0A=20=20=20=20WHERE=20vm_id=20=
=3D=20v_vm_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertVmGuestAgentInterface=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=
=20v_interface_name=20VARCHAR(50),=0A=20=20=20=20v_mac_address=20=
VARCHAR(59),=0A=20=20=20=20v_ipv4_addresses=20TEXT,=0A=20=20=20=20=
v_ipv6_addresses=20TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
vm_guest_agent_interfaces=20(=0A=20=20=20=20=20=20=20=20vm_id,=0A=20=20=20=
=20=20=20=20=20interface_name,=0A=20=20=20=20=20=20=20=20mac_address,=0A=20=
=20=20=20=20=20=20=20ipv4_addresses,=0A=20=20=20=20=20=20=20=20=
ipv6_addresses=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=
=20=20=20=20=20=20=20v_vm_id,=0A=20=20=20=20=20=20=20=20=
v_interface_name,=0A=20=20=20=20=20=20=20=20v_mac_address,=0A=20=20=20=20=
=20=20=20=20v_ipv4_addresses,=0A=20=20=20=20=20=20=20=20v_ipv6_addresses=0A=
=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Insertvds_interface_statistics=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=
=20v_rx_drop=20DECIMAL(18,=200),=0A=20=20=20=20v_rx_rate=20DECIMAL(18,=20=
0),=0A=20=20=20=20v_rx_total=20BIGINT,=0A=20=20=20=20v_rx_offset=20=
BIGINT,=0A=20=20=20=20v_tx_drop=20DECIMAL(18,=200),=0A=20=20=20=20=
v_tx_rate=20DECIMAL(18,=200),=0A=20=20=20=20v_tx_total=20BIGINT,=0A=20=20=
=20=20v_tx_offset=20BIGINT,=0A=20=20=20=20v_iface_status=20INT,=0A=20=20=20=
=20v_sample_time=20FLOAT,=0A=20=20=20=20v_vds_id=20UUID=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
vds_interface_statistics=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=
=20=20=20=20rx_drop,=0A=20=20=20=20=20=20=20=20rx_rate,=0A=20=20=20=20=20=
=20=20=20rx_total,=0A=20=20=20=20=20=20=20=20rx_offset,=0A=20=20=20=20=20=
=20=20=20tx_drop,=0A=20=20=20=20=20=20=20=20tx_rate,=0A=20=20=20=20=20=20=
=20=20tx_total,=0A=20=20=20=20=20=20=20=20tx_offset,=0A=20=20=20=20=20=20=
=20=20vds_id,=0A=20=20=20=20=20=20=20=20iface_status,=0A=20=20=20=20=20=20=
=20=20sample_time=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=
=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20v_rx_drop,=0A=20=20=
=20=20=20=20=20=20v_rx_rate,=0A=20=20=20=20=20=20=20=20v_rx_total,=0A=20=20=
=20=20=20=20=20=20v_rx_offset,=0A=20=20=20=20=20=20=20=20v_tx_drop,=0A=20=
=20=20=20=20=20=20=20v_tx_rate,=0A=20=20=20=20=20=20=20=20v_tx_total,=0A=20=
=20=20=20=20=20=20=20v_tx_offset,=0A=20=20=20=20=20=20=20=20v_vds_id,=0A=20=
=20=20=20=20=20=20=20v_iface_status,=0A=20=20=20=20=20=20=20=20=
v_sample_time=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Updatevds_interface_statistics=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=
=20v_rx_drop=20DECIMAL(18,=200),=0A=20=20=20=20v_rx_rate=20DECIMAL(18,=20=
0),=0A=20=20=20=20v_rx_total=20BIGINT,=0A=20=20=20=20v_rx_offset=20=
BIGINT,=0A=20=20=20=20v_tx_drop=20DECIMAL(18,=200),=0A=20=20=20=20=
v_tx_rate=20DECIMAL(18,=200),=0A=20=20=20=20v_tx_total=20BIGINT,=0A=20=20=
=20=20v_tx_offset=20BIGINT,=0A=20=20=20=20v_iface_status=20INT,=0A=20=20=20=
=20v_sample_time=20FLOAT,=0A=20=20=20=20v_vds_id=20UUID=0A=20=20=20=20)=0A=
RETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20UPDATE=20vds_interface_statistics=0A=20=20=20=20SET=20rx_drop=20=
=3D=20v_rx_drop,=0A=20=20=20=20=20=20=20=20rx_rate=20=3D=20v_rx_rate,=0A=20=
=20=20=20=20=20=20=20rx_total=20=3D=20v_rx_total,=0A=20=20=20=20=20=20=20=
=20rx_offset=20=3D=20v_rx_offset,=0A=20=20=20=20=20=20=20=20tx_drop=20=3D=20=
v_tx_drop,=0A=20=20=20=20=20=20=20=20tx_rate=20=3D=20v_tx_rate,=0A=20=20=20=
=20=20=20=20=20tx_total=20=3D=20v_tx_total,=0A=20=20=20=20=20=20=20=20=
tx_offset=20=3D=20v_tx_offset,=0A=20=20=20=20=20=20=20=20vds_id=20=3D=20=
v_vds_id,=0A=20=20=20=20=20=20=20=20iface_status=20=3D=20v_iface_status,=0A=
=20=20=20=20=20=20=20=20sample_time=20=3D=20v_sample_time,=0A=20=20=20=20=
=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=
=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Deletevds_interface_statistics=20(v_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ADECLARE=20v_val=20UUID;=0A=0ABEGIN=0A=20=20=20=20--=20Get=20=
(and=20keep)=20a=20shared=20lock=20with=20"right=20to=20upgrade=20to=20=
exclusive"=0A=20=20=20=20--=20in=20order=20to=20force=20locking=20parent=20=
before=20children=0A=20=20=20=20SELECT=20id=0A=20=20=20=20INTO=20v_val=0A=
=20=20=20=20FROM=20vds_interface_statistics=0A=20=20=20=20WHERE=20id=20=3D=
=20v_id=0A=20=20=20=20FOR=0A=0A=20=20=20=20UPDATE;=0A=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20vds_interface_statistics=0A=20=20=20=20WHERE=20=
id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Insertnetwork_cluster=20=
(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_network_id=20UUID,=0A=
=20=20=20=20v_status=20INT,=0A=20=20=20=20v_is_display=20BOOLEAN,=0A=20=20=
=20=20v_required=20BOOLEAN,=0A=20=20=20=20v_migration=20BOOLEAN,=0A=20=20=
=20=20v_management=20BOOLEAN,=0A=20=20=20=20v_is_gluster=20BOOLEAN=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20network_cluster=20(=0A=20=20=20=20=20=20=20=20cluster_id,=0A=20=20=
=20=20=20=20=20=20network_id,=0A=20=20=20=20=20=20=20=20status,=0A=20=20=20=
=20=20=20=20=20is_display,=0A=20=20=20=20=20=20=20=20required,=0A=20=20=20=
=20=20=20=20=20migration,=0A=20=20=20=20=20=20=20=20management,=0A=20=20=20=
=20=20=20=20=20is_gluster=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_cluster_id,=0A=20=20=20=20=20=20=20=
=20v_network_id,=0A=20=20=20=20=20=20=20=20v_status,=0A=20=20=20=20=20=20=
=20=20v_is_display,=0A=20=20=20=20=20=20=20=20v_required,=0A=20=20=20=20=20=
=20=20=20v_migration,=0A=20=20=20=20=20=20=20=20v_management,=0A=20=20=20=
=20=20=20=20=20v_is_gluster=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Updatenetwork_cluster=20(=0A=20=20=20=20=
v_cluster_id=20UUID,=0A=20=20=20=20v_network_id=20UUID,=0A=20=20=20=20=
v_status=20INT,=0A=20=20=20=20v_is_display=20BOOLEAN,=0A=20=20=20=20=
v_required=20BOOLEAN,=0A=20=20=20=20v_migration=20BOOLEAN,=0A=20=20=20=20=
v_management=20BOOLEAN,=0A=20=20=20=20v_is_gluster=20BOOLEAN=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
network_cluster=0A=20=20=20=20SET=20status=20=3D=20v_status,=0A=20=20=20=20=
=20=20=20=20is_display=20=3D=20v_is_display,=0A=20=20=20=20=20=20=20=20=
required=20=3D=20v_required,=0A=20=20=20=20=20=20=20=20migration=20=3D=20=
v_migration,=0A=20=20=20=20=20=20=20=20management=20=3D=20v_management,=0A=
=20=20=20=20=20=20=20=20is_gluster=20=3D=20v_is_gluster=0A=20=20=20=20=
WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20=
network_id=20=3D=20v_network_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Updatenetwork_cluster_status=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=
=20=20=20v_network_id=20UUID,=0A=20=20=20=20v_status=20INT=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
network_cluster=0A=20=20=20=20SET=20status=20=3D=20v_status=0A=20=20=20=20=
WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20=
network_id=20=3D=20v_network_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Deletenetwork_cluster=20=
(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_network_id=20UUID=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20network_cluster=0A=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20=
network_id=20=3D=20v_network_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromnetwork_cluster=20()=0ARETURNS=20SETOF=20network_cluster=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20network_cluster;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromnetwork_clusterByClusterId=20(v_cluster_id=20UUID)=0ARETURNS=20=
SETOF=20network_cluster=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
network_cluster=0A=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllManagementNetworksByDataCenterId=20=
(v_data_center_id=20UUID)=0ARETURNS=20SETOF=20network=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
network.*=0A=20=20=20=20FROM=20network=0A=20=20=20=20INNER=20JOIN=20=
network_cluster=0A=20=20=20=20=20=20=20=20ON=20network.id=20=3D=20=
network_cluster.network_id=0A=20=20=20=20INNER=20JOIN=20cluster=0A=20=20=20=
=20=20=20=20=20ON=20network_cluster.cluster_id=20=3D=20=
cluster.cluster_id=0A=20=20=20=20WHERE=20cluster.storage_pool_id=20=3D=20=
v_data_center_id=0A=20=20=20=20=20=20=20=20AND=20=
network_cluster.management;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromnetwork_clusterByNetworkId=20(v_network_id=20UUID)=0ARETURNS=20=
SETOF=20network_cluster=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
network_cluster=0A=20=20=20=20WHERE=20network_id=20=3D=20v_network_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Getnetwork_clusterBycluster_idAndBynetwork_id=20(=0A=
=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_network_id=20UUID=0A=20=20=
=20=20)=0ARETURNS=20SETOF=20network_cluster=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20network_cluster=0A=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20network_id=20=3D=20=
v_network_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetvmStaticByGroupIdAndNetwork=20(=0A=20=20=20=20v_groupId=20UUID,=0A=20=20=
=20=20v_networkName=20VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
vm_static=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20vm_static.*=0A=20=20=20=20FROM=20=
vm_static=0A=20=20=20=20INNER=20JOIN=20vm_interface_view=0A=20=20=20=20=20=
=20=20=20ON=20vm_static.vm_guid=20=3D=20vm_interface_view.vm_guid=0A=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20network_name=20=3D=20v_networkName=0A=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20vm_static.cluster_id=20=3D=20=
v_groupId;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
set_network_exclusively_as_display=20(=0A=20=20=20=20v_cluster_id=20=
UUID,=0A=20=20=20=20v_network_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20network_cluster=0A=20=20=20=
=20SET=20is_display=20=3D=20true=0A=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20network_id=20=3D=20=
v_network_id;=0A=0A=20=20=20=20IF=20FOUND=20THEN=0A=20=20=20=20=20=20=20=20=
UPDATE=20network_cluster=0A=20=20=20=20=20=20=20=20SET=20is_display=20=3D=20=
false=0A=20=20=20=20=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20network_id=20!=3D=20=
v_network_id;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
set_network_exclusively_as_migration=20(=0A=20=20=20=20v_cluster_id=20=
UUID,=0A=20=20=20=20v_network_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20network_cluster=0A=20=20=20=
=20SET=20migration=20=3D=20true=0A=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20network_id=20=3D=20=
v_network_id;=0A=0A=20=20=20=20IF=20FOUND=20THEN=0A=20=20=20=20=20=20=20=20=
UPDATE=20network_cluster=0A=20=20=20=20=20=20=20=20SET=20migration=20=3D=20=
false=0A=20=20=20=20=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20network_id=20!=3D=20=
v_network_id;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
set_network_exclusively_as_gluster=20(=0A=20=20=20=20v_cluster_id=20=
UUID,=0A=20=20=20=20v_network_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20network_cluster=0A=20=20=20=
=20SET=20is_gluster=20=3D=20COALESCE(network_id=20=3D=20v_network_id,=20=
false)=0A=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20set_network_exclusively_as_management=20(=0A=20=20=20=
=20v_cluster_id=20UUID,=0A=20=20=20=20v_network_id=20UUID=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
network_cluster=0A=20=20=20=20SET=20management=20=3D=20true=0A=20=20=20=20=
WHERE=20cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20AND=20=
network_id=20=3D=20v_network_id;=0A=0A=20=20=20=20IF=20FOUND=20THEN=0A=20=
=20=20=20=20=20=20=20UPDATE=20network_cluster=0A=20=20=20=20=20=20=20=20=
SET=20management=20=3D=20false=0A=20=20=20=20=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20network_id=20!=3D=20v_network_id;=0A=20=20=20=20END=20IF;=0A=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVnicProfileByVnicProfileId=20(v_id=20UUID)=0A=
RETURNS=20SETOF=20vnic_profiles=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vnic_profiles=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertVnicProfile=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_name=20=
VARCHAR(50),=0A=20=20=20=20v_network_id=20UUID,=0A=20=20=20=20=
v_network_qos_id=20UUID,=0A=20=20=20=20v_port_mirroring=20BOOLEAN,=0A=20=20=
=20=20v_passthrough=20BOOLEAN,=0A=20=20=20=20v_custom_properties=20TEXT,=0A=
=20=20=20=20v_description=20TEXT,=0A=20=20=20=20v_network_filter_id=20=
UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20INSERT=20INTO=20vnic_profiles=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=
=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20network_id,=0A=20=20=
=20=20=20=20=20=20network_qos_id,=0A=20=20=20=20=20=20=20=20=
port_mirroring,=0A=20=20=20=20=20=20=20=20passthrough,=0A=20=20=20=20=20=20=
=20=20custom_properties,=0A=20=20=20=20=20=20=20=20description,=0A=20=20=20=
=20=20=20=20=20network_filter_id=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20=
v_name,=0A=20=20=20=20=20=20=20=20v_network_id,=0A=20=20=20=20=20=20=20=20=
v_network_qos_id,=0A=20=20=20=20=20=20=20=20v_port_mirroring,=0A=20=20=20=
=20=20=20=20=20v_passthrough,=0A=20=20=20=20=20=20=20=20=
v_custom_properties,=0A=20=20=20=20=20=20=20=20v_description,=0A=20=20=20=
=20=20=20=20=20v_network_filter_id=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateVnicProfile=20(=0A=20=20=20=20v_id=20UUID,=0A=20=
=20=20=20v_name=20VARCHAR(50),=0A=20=20=20=20v_network_id=20UUID,=0A=20=20=
=20=20v_network_qos_id=20UUID,=0A=20=20=20=20v_port_mirroring=20BOOLEAN,=0A=
=20=20=20=20v_passthrough=20BOOLEAN,=0A=20=20=20=20v_custom_properties=20=
TEXT,=0A=20=20=20=20v_description=20TEXT,=0A=20=20=20=20=
v_network_filter_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vnic_profiles=0A=20=20=20=20=
SET=20id=20=3D=20v_id,=0A=20=20=20=20=20=20=20=20name=20=3D=20v_name,=0A=20=
=20=20=20=20=20=20=20network_id=20=3D=20v_network_id,=0A=20=20=20=20=20=20=
=20=20network_qos_id=20=3D=20v_network_qos_id,=0A=20=20=20=20=20=20=20=20=
port_mirroring=20=3D=20v_port_mirroring,=0A=20=20=20=20=20=20=20=20=
passthrough=20=3D=20v_passthrough,=0A=20=20=20=20=20=20=20=20=
custom_properties=20=3D=20v_custom_properties,=0A=20=20=20=20=20=20=20=20=
description=20=3D=20v_description,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP,=0A=20=20=20=20=20=20=20=20=
network_filter_id=20=3D=20v_network_filter_id=0A=20=20=20=20WHERE=20id=20=
=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteVnicProfile=20=
(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_val=20=
UUID;=0A=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20vnic_profiles=0A=
=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=0A=20=20=20=20--=20Delete=20the=20=
vnic=20profiles=20permissions=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
permissions=0A=20=20=20=20WHERE=20object_id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromVnicProfiles=20()=0ARETURNS=20SETOF=20=
vnic_profiles=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20vnic_profiles;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVnicProfilesByNetworkId=20(v_network_id=20UUID)=0A=
RETURNS=20SETOF=20vnic_profiles=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vnic_profiles=0A=20=20=20=20WHERE=20network_id=20=3D=20v_network_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVnicProfileViewByVnicProfileViewId=20(=0A=20=20=20=
=20v_id=20UUID,=0A=20=20=20=20v_user_id=20uuid,=0A=20=20=20=20=
v_is_filtered=20boolean=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
vnic_profiles_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vnic_profiles_view=0A=20=20=20=20WHERE=20id=20=3D=20v_id=0A=20=20=20=20=20=
=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20=
v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vnic_profile_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20=
vnic_profiles_view.id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromVnicProfileViews=20(=0A=20=20=20=20v_user_id=20uuid,=0A=20=20=20=
=20v_is_filtered=20boolean=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
vnic_profiles_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vnic_profiles_view=0A=20=20=20=20WHERE=20NOT=20v_is_filtered=0A=20=20=20=20=
=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
1=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vnic_profile_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20AND=20entity_id=20=3D=20vnic_profiles_view.id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVnicProfileViewsByNetworkId=20(=0A=20=20=20=20v_network_id=20UUID,=0A=20=
=20=20=20v_user_id=20uuid,=0A=20=20=20=20v_is_filtered=20boolean=0A=20=20=
=20=20)=0ARETURNS=20SETOF=20vnic_profiles_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20vnic_profiles_view=0A=20=20=20=20WHERE=20=
network_id=20=3D=20v_network_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=
=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vnic_profile_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20=
vnic_profiles_view.id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVnicProfileViewsByDataCenterId=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=
=20=20v_user_id=20uuid,=0A=20=20=20=20v_is_filtered=20boolean=0A=20=20=20=
=20)=0ARETURNS=20SETOF=20vnic_profiles_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20vnic_profiles_view=0A=20=20=20=20WHERE=20data_center_id=20=3D=20=
v_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vnic_profile_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20=
vnic_profiles_view.id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVnicProfileViewsByNetworkQosId=20(v_network_qos_id=20UUID)=0ARETURNS=20=
SETOF=20vnic_profiles_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vnic_profiles_view=0A=20=20=20=20WHERE=20network_qos_id=20=3D=20=
v_network_qos_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetIscsiIfacesByHostIdAndStorageTargetId=20(=0A=20=20=20=20v_host_id=20=
UUID,=0A=20=20=20=20v_target_id=20VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20vds_interface_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vds_interface_view.*=0A=20=20=
=20=20FROM=20vds_interface_view,=0A=20=20=20=20=20=20=20=20=
network_cluster,=0A=20=20=20=20=20=20=20=20network,=0A=20=20=20=20=20=20=20=
=20iscsi_bonds_networks_map,=0A=20=20=20=20=20=20=20=20=
iscsi_bonds_storage_connections_map=0A=20=20=20=20WHERE=20=
iscsi_bonds_storage_connections_map.connection_id=20=3D=20v_target_id=0A=20=
=20=20=20=20=20=20=20AND=20=
iscsi_bonds_storage_connections_map.iscsi_bond_id=20=3D=20=
iscsi_bonds_networks_map.iscsi_bond_id=0A=20=20=20=20=20=20=20=20AND=20=
iscsi_bonds_networks_map.network_id=20=3D=20network.id=0A=20=20=20=20=20=20=
=20=20AND=20network.id=20=3D=20network_cluster.network_id=0A=20=20=20=20=20=
=20=20=20AND=20network.name=20=3D=20vds_interface_view.network_name=0A=20=
=20=20=20=20=20=20=20AND=20network_cluster.cluster_id=20=3D=20=
vds_interface_view.cluster_id=0A=20=20=20=20=20=20=20=20AND=20=
vds_interface_view.vds_id=20=3D=20v_host_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
getActiveMigrationNetworkInterfaceForHost=20(v_host_id=20UUID)=0ARETURNS=20=
SETOF=20active_migration_network_interfaces=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20active_migration_network_interfaces=0A=20=20=20=20WHERE=20=
vds_id=20=3D=20v_host_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertHostNicVfsConfig=20=
(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_nic_id=20UUID,=0A=20=20=20=20=
v_is_all_networks_allowed=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
host_nic_vfs_config=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=
=20=20nic_id,=0A=20=20=20=20=20=20=20=20is_all_networks_allowed=0A=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_id,=0A=20=20=20=20=20=20=20=20v_nic_id,=0A=20=20=20=20=20=20=20=20=
v_is_all_networks_allowed=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateHostNicVfsConfig=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_nic_id=20UUID,=0A=20=20=20=20v_is_all_networks_allowed=20BOOLEAN=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
host_nic_vfs_config=0A=20=20=20=20SET=20id=20=3D=20v_id,=0A=20=20=20=20=20=
=20=20=20nic_id=20=3D=20v_nic_id,=0A=20=20=20=20=20=20=20=20=
is_all_networks_allowed=20=3D=20v_is_all_networks_allowed,=0A=20=20=20=20=
=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=
=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteHostNicVfsConfig=20=
(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20host_nic_vfs_config=0A=20=20=20=20WHERE=20id=20=
=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetHostNicVfsConfigById=20=
(v_id=20UUID)=0ARETURNS=20SETOF=20host_nic_vfs_config=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20host_nic_vfs_config=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVfsConfigByNicId=20=
(v_nic_id=20UUID)=0ARETURNS=20SETOF=20host_nic_vfs_config=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20host_nic_vfs_config=0A=20=20=20=20WHERE=20nic_id=20=
=3D=20v_nic_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromHostNicVfsConfigs=20()=0ARETURNS=20SETOF=20host_nic_vfs_config=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20host_nic_vfs_config;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllVfsConfigByHostId=20(v_host_id=20UUID)=0A=
RETURNS=20SETOF=20host_nic_vfs_config=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
host_nic_vfs_config.*=0A=20=20=20=20FROM=20host_nic_vfs_config=0A=20=20=20=
=20INNER=20JOIN=20vds_interface=0A=20=20=20=20=20=20=20=20ON=20=
host_nic_vfs_config.nic_id=20=3D=20vds_interface.id=0A=20=20=20=20WHERE=20=
vds_interface.vds_id=20=3D=20v_host_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetNetworkAttachmentByNetworkAttachmentId=20(v_id=20UUID)=0ARETURNS=20=
SETOF=20network_attachments=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
network_attachments=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertNetworkAttachment=20(=0A=20=20=20=20v_id=20=
UUID,=0A=20=20=20=20v_network_id=20UUID,=0A=20=20=20=20v_nic_id=20UUID,=0A=
=20=20=20=20v_boot_protocol=20VARCHAR(20),=0A=20=20=20=20v_address=20=
VARCHAR(20),=0A=20=20=20=20v_netmask=20VARCHAR(20),=0A=20=20=20=20=
v_gateway=20VARCHAR(20),=0A=20=20=20=20v_ipv6_boot_protocol=20=
VARCHAR(20),=0A=20=20=20=20v_ipv6_address=20VARCHAR(50),=0A=20=20=20=20=
v_ipv6_prefix=20INT,=0A=20=20=20=20v_ipv6_gateway=20VARCHAR(50),=0A=20=20=
=20=20v_custom_properties=20TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20network_attachments=20=
(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20network_id,=0A=20=
=20=20=20=20=20=20=20nic_id,=0A=20=20=20=20=20=20=20=20boot_protocol,=0A=20=
=20=20=20=20=20=20=20address,=0A=20=20=20=20=20=20=20=20netmask,=0A=20=20=
=20=20=20=20=20=20gateway,=0A=20=20=20=20=20=20=20=20ipv6_boot_protocol,=0A=
=20=20=20=20=20=20=20=20ipv6_address,=0A=20=20=20=20=20=20=20=20=
ipv6_prefix,=0A=20=20=20=20=20=20=20=20ipv6_gateway,=0A=20=20=20=20=20=20=
=20=20custom_properties=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20=
(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20=
v_network_id,=0A=20=20=20=20=20=20=20=20v_nic_id,=0A=20=20=20=20=20=20=20=
=20v_boot_protocol,=0A=20=20=20=20=20=20=20=20v_address,=0A=20=20=20=20=20=
=20=20=20v_netmask,=0A=20=20=20=20=20=20=20=20v_gateway,=0A=20=20=20=20=20=
=20=20=20v_ipv6_boot_protocol,=0A=20=20=20=20=20=20=20=20v_ipv6_address,=0A=
=20=20=20=20=20=20=20=20v_ipv6_prefix,=0A=20=20=20=20=20=20=20=20=
v_ipv6_gateway,=0A=20=20=20=20=20=20=20=20v_custom_properties=0A=20=20=20=
=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateNetworkAttachment=20=
(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_network_id=20UUID,=0A=20=20=20=
=20v_nic_id=20UUID,=0A=20=20=20=20v_boot_protocol=20VARCHAR(20),=0A=20=20=
=20=20v_address=20VARCHAR(20),=0A=20=20=20=20v_netmask=20VARCHAR(20),=0A=20=
=20=20=20v_gateway=20VARCHAR(20),=0A=20=20=20=20v_ipv6_boot_protocol=20=
VARCHAR(20),=0A=20=20=20=20v_ipv6_address=20VARCHAR(50),=0A=20=20=20=20=
v_ipv6_prefix=20INT,=0A=20=20=20=20v_ipv6_gateway=20VARCHAR(50),=0A=20=20=
=20=20v_custom_properties=20TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20network_attachments=0A=20=20=20=
=20SET=20network_id=20=3D=20v_network_id,=0A=20=20=20=20=20=20=20=20=
nic_id=20=3D=20v_nic_id,=0A=20=20=20=20=20=20=20=20boot_protocol=20=3D=20=
v_boot_protocol,=0A=20=20=20=20=20=20=20=20address=20=3D=20v_address,=0A=20=
=20=20=20=20=20=20=20netmask=20=3D=20v_netmask,=0A=20=20=20=20=20=20=20=20=
gateway=20=3D=20v_gateway,=0A=20=20=20=20=20=20=20=20custom_properties=20=
=3D=20v_custom_properties,=0A=20=20=20=20=20=20=20=20ipv6_boot_protocol=20=
=3D=20v_ipv6_boot_protocol,=0A=20=20=20=20=20=20=20=20ipv6_address=20=3D=20=
v_ipv6_address,=0A=20=20=20=20=20=20=20=20ipv6_prefix=20=3D=20=
v_ipv6_prefix,=0A=20=20=20=20=20=20=20=20ipv6_gateway=20=3D=20=
v_ipv6_gateway,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteNetworkAttachment=20(v_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
network_attachments=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromNetworkAttachments=20()=0ARETURNS=20SETOF=20=
network_attachments=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
network_attachments;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetNetworkAttachmentsByNicId=20(v_nic_id=20UUID)=0ARETURNS=20SETOF=20=
network_attachments=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
network_attachments=0A=20=20=20=20WHERE=20nic_id=20=3D=20v_nic_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetNetworkAttachmentsByNetworkId=20(v_network_id=20=
UUID)=0ARETURNS=20SETOF=20network_attachments=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20network_attachments=0A=20=20=20=20WHERE=20=
network_id=20=3D=20v_network_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetNetworkAttachmentsByHostId=20(v_host_id=20UUID)=0ARETURNS=20SETOF=20=
network_attachments=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
network_attachments=0A=20=20=20=20WHERE=20EXISTS=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vds_interface=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
network_attachments.nic_id=20=3D=20vds_interface.id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20AND=20vds_interface.vds_id=20=3D=20v_host_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetNetworkAttachmentByNicIdAndNetworkId=20(=0A=20=20=20=20v_nic_id=20=
UUID,=0A=20=20=20=20v_network_id=20UUID=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20network_attachments=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20na.*=0A=20=20=20=20FROM=20=
network_attachments=20na=0A=20=20=20=20WHERE=20na.network_id=20=3D=20=
v_network_id=0A=20=20=20=20=20=20=20=20AND=20na.nic_id=20=3D=20v_nic_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20RemoveNetworkAttachmentByNetworkId=20(v_id=20UUID)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20network_attachments=20na=0A=20=20=20=20WHERE=20na.network_id=20=
=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertVfsConfigNetwork=20=
(=0A=20=20=20=20v_vfs_config_id=20UUID,=0A=20=20=20=20v_network_id=20=
UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20INSERT=20INTO=20vfs_config_networks=20(=0A=20=20=20=20=20=20=20=20=
vfs_config_id,=0A=20=20=20=20=20=20=20=20network_id=0A=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_vfs_config_id,=0A=
=20=20=20=20=20=20=20=20v_network_id=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteVfsConfigNetwork=20(=0A=20=20=20=20=
v_vfs_config_id=20UUID,=0A=20=20=20=20v_network_id=20UUID=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=
=20=20FROM=20vfs_config_networks=0A=20=20=20=20WHERE=20vfs_config_id=20=3D=
=20v_vfs_config_id=0A=20=20=20=20=20=20=20=20AND=20network_id=20=3D=20=
v_network_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteAllVfsConfigNetworks=20(v_vfs_config_id=20UUID)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vfs_config_networks=0A=20=20=20=20WHERE=20vfs_config_id=20=3D=20=
v_vfs_config_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetNetworksByVfsConfigId=20=
(v_vfs_config_id=20UUID)=0ARETURNS=20SETOF=20UUID=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
network_id=0A=20=20=20=20FROM=20vfs_config_networks=0A=20=20=20=20WHERE=20=
vfs_config_id=20=3D=20v_vfs_config_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertVfsConfigLabel=20(=0A=20=20=20=20v_vfs_config_id=20UUID,=0A=20=20=20=
=20v_label=20TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20vfs_config_labels=20(=0A=20=20=20=20=20=
=20=20=20vfs_config_id,=0A=20=20=20=20=20=20=20=20label=0A=20=20=20=20=20=
=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_vfs_config_id,=0A=20=20=20=20=20=20=20=20v_label=0A=20=20=20=20=20=20=20=
=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteVfsConfigLabel=20(=0A=
=20=20=20=20v_vfs_config_id=20UUID,=0A=20=20=20=20v_label=20TEXT=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=
=20=20=20=20FROM=20vfs_config_labels=0A=20=20=20=20WHERE=20vfs_config_id=20=
=3D=20v_vfs_config_id=0A=20=20=20=20=20=20=20=20AND=20label=20=3D=20=
v_label;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteAllVfsConfigLabels=20=
(v_vfs_config_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20DELETE=0A=20=20=20=20FROM=20vfs_config_labels=0A=20=20=20=20=
WHERE=20vfs_config_id=20=3D=20v_vfs_config_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetLabelsByVfsConfigId=20(v_vfs_config_id=20UUID)=0ARETURNS=20SETOF=20=
TEXT=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=
=20=20=20=20SELECT=20label=0A=20=20=20=20FROM=20vfs_config_labels=0A=20=20=
=20=20WHERE=20vfs_config_id=20=3D=20v_vfs_config_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllNetworkFilters=20()=0ARETURNS=20SETOF=20network_filter=20STABLE=0A=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20*=0A=20=20=20=20FROM=20network_filter;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllSupportedNetworkFiltersByVersion=20(v_version=20VARCHAR(40))=0A=
RETURNS=20SETOF=20network_filter=20STABLE=0AAS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
network_filter=0A=20=20=20=20WHERE=20v_version=20>=3D=20version;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetNetworkFilterById=20(v_filter_id=20UUID)=0A=
RETURNS=20SETOF=20network_filter=20STABLE=0AAS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
network_filter=0A=20=20=20=20WHERE=20filter_id=20=3D=20v_filter_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetNetworkFilterByName=20(v_filter_name=20=
VARCHAR(50))=0ARETURNS=20SETOF=20network_filter=20STABLE=0AAS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20network_filter=0A=20=20=20=20WHERE=20filter_name=20=
like=20v_filter_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertNumaNode=20(=0A=20=20=
=20=20v_numa_node_id=20UUID,=0A=20=20=20=20v_vds_id=20UUID,=0A=20=20=20=20=
v_vm_id=20UUID,=0A=20=20=20=20v_numa_node_index=20SMALLINT,=0A=20=20=20=20=
v_mem_total=20BIGINT,=0A=20=20=20=20v_cpu_count=20SMALLINT,=0A=20=20=20=20=
v_mem_free=20BIGINT,=0A=20=20=20=20v_usage_mem_percent=20INT,=0A=20=20=20=
=20v_cpu_sys=20DECIMAL(5,=202),=0A=20=20=20=20v_cpu_user=20DECIMAL(5,=20=
2),=0A=20=20=20=20v_cpu_idle=20DECIMAL(5,=202),=0A=20=20=20=20=
v_usage_cpu_percent=20INT,=0A=20=20=20=20v_distance=20TEXT=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=
=20=20=20=20=20=20INSERT=20INTO=20numa_node=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20numa_node_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20vds_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20vm_id,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20numa_node_index,=0A=20=20=20=20=20=20=20=20=20=20=20=20mem_total,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20cpu_count,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20mem_free,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
usage_mem_percent,=0A=20=20=20=20=20=20=20=20=20=20=20=20cpu_sys,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20cpu_user,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20cpu_idle,=0A=20=20=20=20=20=20=20=20=20=20=20=20usage_cpu_percent,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20distance=0A=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_numa_node_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_vds_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_vm_id,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_numa_node_index,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_mem_total,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_cpu_count,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_mem_free,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20v_usage_mem_percent,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_cpu_sys,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_cpu_user,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_cpu_idle,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_usage_cpu_percent,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_distance=0A=20=
=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20END;=0A=0A=20=20=20=20=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateNumaNode=20(=0A=20=20=
=20=20v_numa_node_id=20UUID,=0A=20=20=20=20v_numa_node_index=20SMALLINT,=0A=
=20=20=20=20v_mem_total=20BIGINT,=0A=20=20=20=20v_cpu_count=20SMALLINT,=0A=
=20=20=20=20v_distance=20TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20UPDATE=20=
numa_node=0A=20=20=20=20=20=20=20=20SET=20numa_node_index=20=3D=20=
v_numa_node_index,=0A=20=20=20=20=20=20=20=20=20=20=20=20mem_total=20=3D=20=
v_mem_total,=0A=20=20=20=20=20=20=20=20=20=20=20=20cpu_count=20=3D=20=
v_cpu_count,=0A=20=20=20=20=20=20=20=20=20=20=20=20distance=20=3D=20=
v_distance=0A=20=20=20=20=20=20=20=20WHERE=20numa_node_id=20=3D=20=
v_numa_node_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateNumaNodeStatistics=20(=0A=20=20=20=20=
v_numa_node_id=20UUID,=0A=20=20=20=20v_mem_free=20BIGINT,=0A=20=20=20=20=
v_usage_mem_percent=20INT,=0A=20=20=20=20v_cpu_sys=20DECIMAL(5,=202),=0A=20=
=20=20=20v_cpu_user=20DECIMAL(5,=202),=0A=20=20=20=20v_cpu_idle=20=
DECIMAL(5,=202),=0A=20=20=20=20v_usage_cpu_percent=20INT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20UPDATE=20numa_node=0A=20=20=20=20=20=20=20=20SET=20=
mem_free=20=3D=20v_mem_free,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
usage_mem_percent=20=3D=20v_usage_mem_percent,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20cpu_sys=20=3D=20v_cpu_sys,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20cpu_user=20=3D=20v_cpu_user,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
cpu_idle=20=3D=20v_cpu_idle,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
usage_cpu_percent=20=3D=20v_usage_cpu_percent=0A=20=20=20=20=20=20=20=20=
WHERE=20numa_node_id=20=3D=20v_numa_node_id;=0A=20=20=20=20END;=0A=0A=20=20=
=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteNumaNode=20=
(v_numa_node_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=20=
FROM=20numa_node=0A=20=20=20=20=20=20=20=20WHERE=20numa_node_id=20=3D=20=
v_numa_node_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromNumaNode=20()=0ARETURNS=20SETOF=20=
numa_node=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=
=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
numa_node.*=0A=20=20=20=20=20=20=20=20FROM=20numa_node;=0A=20=20=20=20=
END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetNumaNodeByNumaNodeId=20=
(v_numa_node_id=20UUID)=0ARETURNS=20SETOF=20numa_node=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20numa_node.*=0A=20=20=20=20=20=
=20=20=20FROM=20numa_node=0A=20=20=20=20=20=20=20=20WHERE=20numa_node_id=20=
=3D=20v_numa_node_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetNumaNodeByVdsId=20(v_vds_id=20UUID)=0ARETURNS=20=
SETOF=20numa_node_cpus_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=
=20=20SELECT=20numa_node_cpus_view.*=0A=20=20=20=20=20=20=20=20FROM=20=
numa_node_cpus_view=0A=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20=
v_vds_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetNumaNodeByVmId=20(v_vm_id=20UUID)=0ARETURNS=20SETOF=20=
numa_node_cpus_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20numa_node_cpus_view.*=0A=20=20=20=20=20=20=20=20FROM=20=
numa_node_cpus_view=0A=20=20=20=20=20=20=20=20WHERE=20vm_id=20=3D=20=
v_vm_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertNumaNodeCpu=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_numa_node_id=20UUID,=0A=20=20=20=20v_cpu_core_id=20INT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20INSERT=20INTO=20numa_node_cpu_map=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
numa_node_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20cpu_core_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_numa_node_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_cpu_core_id=0A=20=
=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20END;=0A=0A=20=20=20=20=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteNumaNodeCpuByNumaNodeId=20(v_numa_node_id=20UUID)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
DELETE=0A=20=20=20=20=20=20=20=20FROM=20numa_node_cpu_map=0A=20=20=20=20=20=
=20=20=20WHERE=20numa_node_id=20=3D=20v_numa_node_id;=0A=20=20=20=20END;=0A=
=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromNumaNodeCpuMap=20=
()=0ARETURNS=20SETOF=20numa_node_cpu_map=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=
=20=20=20=20=20=20=20SELECT=20numa_node_cpu_map.*=0A=20=20=20=20=20=20=20=
=20FROM=20numa_node_cpu_map;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetNumaNodeCpuByNumaNodeId=20(v_numa_node_id=20=
UUID)=0ARETURNS=20SETOF=20INT=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=
=20=20=20SELECT=20numa_node_cpu_map.cpu_core_id=0A=20=20=20=20=20=20=20=20=
FROM=20numa_node_cpu_map=0A=20=20=20=20=20=20=20=20WHERE=20numa_node_id=20=
=3D=20v_numa_node_id=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
numa_node_cpu_map.cpu_core_id=20ASC;=0A=20=20=20=20END;=0A=0A=20=20=20=20=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertNumaNodeMap=20(=0A=20=
=20=20=20v_id=20UUID,=0A=20=20=20=20v_vm_numa_node_id=20UUID,=0A=20=20=20=
=20v_vds_numa_node_id=20UUID,=0A=20=20=20=20v_vds_numa_node_index=20=
SMALLINT,=0A=20=20=20=20v_is_pinned=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=
=20INSERT=20INTO=20vm_vds_numa_node_map=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20id,=0A=20=20=20=20=20=20=20=20=20=20=20=20vm_numa_node_id,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20vds_numa_node_id,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20vds_numa_node_index,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
is_pinned=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20v_vm_numa_node_id,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20v_vds_numa_node_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_vds_numa_node_index,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_is_pinned=0A=
=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20END;=0A=0A=20=20=20=20=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteNumaNodeMapByVmNumaNodeId=20(v_vm_numa_node_id=20UUID)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=
=20DELETE=0A=20=20=20=20=20=20=20=20FROM=20vm_vds_numa_node_map=0A=20=20=20=
=20=20=20=20=20WHERE=20vm_numa_node_id=20=3D=20v_vm_numa_node_id;=0A=20=20=
=20=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteNumaNodeMapByVdsNumaNodeId=20(v_vds_numa_node_id=20UUID)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=
=20DELETE=0A=20=20=20=20=20=20=20=20FROM=20vm_vds_numa_node_map=0A=20=20=20=
=20=20=20=20=20WHERE=20vds_numa_node_id=20=3D=20v_vds_numa_node_id;=0A=20=
=20=20=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteUnpinnedNumaNodeMapByVmNumaNodeId=20(v_vm_numa_node_id=20UUID)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=20FROM=20=
vm_vds_numa_node_map=0A=20=20=20=20=20=20=20=20WHERE=20vm_numa_node_id=20=
=3D=20v_vm_numa_node_id=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
is_pinned=20=3D=20FALSE;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVmNumaNodeByVdsNumaNodeIdWithPinnedInfo=20(=0A=20=
=20=20=20v_vds_numa_node_id=20UUID,=0A=20=20=20=20v_is_pinned=20BOOLEAN=0A=
=20=20=20=20)=0ARETURNS=20SETOF=20numa_node=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=
=20=20=20=20=20=20=20SELECT=20=
numa_node_assignment_view.assigned_vm_numa_node_id,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20numa_node_assignment_view.run_in_vds_id,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20numa_node_assignment_view.vm_numa_node_vm_id,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=
numa_node_assignment_view.vm_numa_node_index,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20numa_node_assignment_view.vm_numa_node_mem_total,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=
numa_node_assignment_view.vm_numa_node_cpu_count,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20numa_node_assignment_view.vm_numa_node_mem_free,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=
numa_node_assignment_view.vm_numa_node_usage_mem_percent,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20numa_node_assignment_view.vm_numa_node_cpu_sys,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=
numa_node_assignment_view.vm_numa_node_cpu_user,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20numa_node_assignment_view.vm_numa_node_cpu_idle,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=
numa_node_assignment_view.vm_numa_node_usage_cpu_percent,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20numa_node_assignment_view.vm_numa_node_distance=0A=20=
=20=20=20=20=20=20=20FROM=20numa_node_assignment_view=0A=20=20=20=20=20=20=
=20=20WHERE=20run_in_vds_numa_node_id=20=3D=20v_vds_numa_node_id=0A=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20is_pinned=20=3D=20v_is_pinned;=0A=20=20=
=20=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmNumaNodeByVdsNumaNodeId=20(v_vds_numa_node_id=20UUID)=0ARETURNS=20=
SETOF=20numa_node=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20numa_node_assignment_view.assigned_vm_numa_node_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20numa_node_assignment_view.run_in_vds_id,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=
numa_node_assignment_view.vm_numa_node_vm_id,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20numa_node_assignment_view.vm_numa_node_index,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20numa_node_assignment_view.vm_numa_node_mem_total,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=
numa_node_assignment_view.vm_numa_node_cpu_count,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20numa_node_assignment_view.vm_numa_node_mem_free,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=
numa_node_assignment_view.vm_numa_node_usage_mem_percent,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20numa_node_assignment_view.vm_numa_node_cpu_sys,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=
numa_node_assignment_view.vm_numa_node_cpu_user,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20numa_node_assignment_view.vm_numa_node_cpu_idle,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=
numa_node_assignment_view.vm_numa_node_usage_cpu_percent,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20numa_node_assignment_view.vm_numa_node_distance=0A=20=
=20=20=20=20=20=20=20FROM=20numa_node_assignment_view=0A=20=20=20=20=20=20=
=20=20WHERE=20run_in_vds_numa_node_id=20=3D=20v_vds_numa_node_id;=0A=20=20=
=20=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllAssignedNumaNodeInfomation=20()=0ARETURNS=20SETOF=20=
numa_node_assignment_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=
=20=20SELECT=20numa_node_assignment_view.*=0A=20=20=20=20=20=20=20=20=
FROM=20numa_node_assignment_view;=0A=20=20=20=20END;=0A=0A=20=20=20=20=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetLastRunInPnodeInfoByVmId=20(v_vm_id=20UUID)=0ARETURNS=20SETOF=20=
numa_node_assignment_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=
=20=20SELECT=20numa_node_assignment_view.*=0A=20=20=20=20=20=20=20=20=
FROM=20numa_node_assignment_view=0A=20=20=20=20=20=20=20=20WHERE=20=
vm_numa_node_vm_id=20=3D=20v_vm_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVmNumaNodeByCluster=20=
(v_cluster_id=20UUID)=0ARETURNS=20SETOF=20numa_node_with_cluster_view=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
numa_node_with_cluster_view.*=0A=20=20=20=20=20=20=20=20FROM=20=
numa_node_with_cluster_view=0A=20=20=20=20=20=20=20=20WHERE=20cluster_id=20=
=3D=20v_cluster_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromPolicyUnits=20()=0ARETURNS=20SETOF=20=
policy_units=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20policy_units;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetPolicyUnitByPolicyUnitId=20(v_id=20UUID)=0A=
RETURNS=20SETOF=20policy_units=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
policy_units=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertPolicyUnit=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_name=20=
VARCHAR(128),=0A=20=20=20=20v_description=20TEXT,=0A=20=20=20=20=
v_is_internal=20BOOLEAN,=0A=20=20=20=20v_type=20SMALLINT,=0A=20=20=20=20=
v_custom_properties_regex=20TEXT,=0A=20=20=20=20v_enabled=20BOOLEAN=0A=20=
=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
INSERT=20INTO=20policy_units=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=
=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20description,=0A=20=20=20=20=
=20=20=20=20is_internal,=0A=20=20=20=20=20=20=20=20type,=0A=20=20=20=20=20=
=20=20=20custom_properties_regex,=0A=20=20=20=20=20=20=20=20enabled=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_id,=0A=20=20=20=20=20=20=20=20v_name,=0A=20=20=20=20=20=20=20=20=
v_description,=0A=20=20=20=20=20=20=20=20v_is_internal,=0A=20=20=20=20=20=
=20=20=20v_type,=0A=20=20=20=20=20=20=20=20v_custom_properties_regex,=0A=20=
=20=20=20=20=20=20=20v_enabled=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdatePolicyUnit=20(=0A=20=20=20=20v_id=20UUID,=0A=20=
=20=20=20v_enabled=20BOOLEAN,=0A=20=20=20=20v_custom_properties_regex=20=
TEXT,=0A=20=20=20=20v_description=20TEXT=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20policy_units=0A=20=
=20=20=20SET=20custom_properties_regex=20=3D=20=
v_custom_properties_regex,=0A=20=20=20=20=20=20=20=20enabled=20=3D=20=
v_enabled,=0A=20=20=20=20=20=20=20=20description=20=3D=20v_description=0A=
=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeletePolicyUnit=20=
(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20policy_units=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertProvider=20(=0A=20=20=
=20=20v_id=20UUID,=0A=20=20=20=20v_name=20VARCHAR(128),=0A=20=20=20=20=
v_description=20VARCHAR(4000),=0A=20=20=20=20v_url=20VARCHAR(512),=0A=20=20=
=20=20v_provider_type=20VARCHAR(32),=0A=20=20=20=20v_auth_required=20=
BOOLEAN,=0A=20=20=20=20v_auth_username=20VARCHAR(64),=0A=20=20=20=20=
v_auth_password=20TEXT,=0A=20=20=20=20v_custom_properties=20TEXT,=0A=20=20=
=20=20v_tenant_name=20VARCHAR=20DEFAULT=20NULL,=0A=20=20=20=20=
v_plugin_type=20VARCHAR=20DEFAULT=20NULL,=0A=20=20=20=20=
v_agent_configuration=20TEXT=20DEFAULT=20NULL,=0A=20=20=20=20=
v_additional_properties=20TEXT=20DEFAULT=20NULL,=0A=20=20=20=20=
v_auth_url=20TEXT=20DEFAULT=20NULL,=0A=20=20=20=20v_read_only=20BOOLEAN=20=
DEFAULT=20FALSE=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20providers=20(=0A=20=20=20=20=20=20=20=
=20id,=0A=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20=
description,=0A=20=20=20=20=20=20=20=20url,=0A=20=20=20=20=20=20=20=20=
provider_type,=0A=20=20=20=20=20=20=20=20auth_required,=0A=20=20=20=20=20=
=20=20=20auth_username,=0A=20=20=20=20=20=20=20=20auth_password,=0A=20=20=
=20=20=20=20=20=20custom_properties,=0A=20=20=20=20=20=20=20=20=
tenant_name,=0A=20=20=20=20=20=20=20=20plugin_type,=0A=20=20=20=20=20=20=20=
=20agent_configuration,=0A=20=20=20=20=20=20=20=20additional_properties,=0A=
=20=20=20=20=20=20=20=20auth_url,=0A=20=20=20=20=20=20=20=20read_only=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_id,=0A=20=20=20=20=20=20=20=20v_name,=0A=20=20=20=20=20=20=20=20=
v_description,=0A=20=20=20=20=20=20=20=20v_url,=0A=20=20=20=20=20=20=20=20=
v_provider_type,=0A=20=20=20=20=20=20=20=20v_auth_required,=0A=20=20=20=20=
=20=20=20=20v_auth_username,=0A=20=20=20=20=20=20=20=20v_auth_password,=0A=
=20=20=20=20=20=20=20=20v_custom_properties,=0A=20=20=20=20=20=20=20=20=
v_tenant_name,=0A=20=20=20=20=20=20=20=20v_plugin_type,=0A=20=20=20=20=20=
=20=20=20v_agent_configuration,=0A=20=20=20=20=20=20=20=20=
v_additional_properties,=0A=20=20=20=20=20=20=20=20v_auth_url,=0A=20=20=20=
=20=20=20=20=20v_read_only=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateProvider=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=
=20=20v_name=20VARCHAR(128),=0A=20=20=20=20v_description=20=
VARCHAR(4000),=0A=20=20=20=20v_url=20VARCHAR(512),=0A=20=20=20=20=
v_provider_type=20VARCHAR(32),=0A=20=20=20=20v_auth_required=20BOOLEAN,=0A=
=20=20=20=20v_auth_username=20VARCHAR(64),=0A=20=20=20=20v_auth_password=20=
TEXT,=0A=20=20=20=20v_custom_properties=20TEXT,=0A=20=20=20=20=
v_tenant_name=20VARCHAR=20DEFAULT=20NULL,=0A=20=20=20=20v_plugin_type=20=
VARCHAR=20DEFAULT=20NULL,=0A=20=20=20=20v_agent_configuration=20TEXT=20=
DEFAULT=20NULL,=0A=20=20=20=20v_additional_properties=20TEXT=20DEFAULT=20=
NULL,=0A=20=20=20=20v_auth_url=20TEXT=20DEFAULT=20NULL,=0A=20=20=20=20=
v_read_only=20BOOLEAN=20DEFAULT=20FALSE=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20providers=0A=20=20=20=20=
SET=20name=20=3D=20v_name,=0A=20=20=20=20=20=20=20=20description=20=3D=20=
v_description,=0A=20=20=20=20=20=20=20=20url=20=3D=20v_url,=0A=20=20=20=20=
=20=20=20=20provider_type=20=3D=20v_provider_type,=0A=20=20=20=20=20=20=20=
=20auth_required=20=3D=20v_auth_required,=0A=20=20=20=20=20=20=20=20=
auth_username=20=3D=20v_auth_username,=0A=20=20=20=20=20=20=20=20=
auth_password=20=3D=20v_auth_password,=0A=20=20=20=20=20=20=20=20=
custom_properties=20=3D=20v_custom_properties,=0A=20=20=20=20=20=20=20=20=
tenant_name=20=3D=20v_tenant_name,=0A=20=20=20=20=20=20=20=20plugin_type=20=
=3D=20v_plugin_type,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
NOW(),=0A=20=20=20=20=20=20=20=20agent_configuration=20=3D=20=
v_agent_configuration,=0A=20=20=20=20=20=20=20=20additional_properties=20=
=3D=20v_additional_properties,=0A=20=20=20=20=20=20=20=20auth_url=20=3D=20=
v_auth_url,=0A=20=20=20=20=20=20=20=20read_only=20=3D=20v_read_only=0A=20=
=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteProvider=20=
(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20providers=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromProviders=20()=0A=
RETURNS=20SETOF=20providers=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
providers;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromProvidersByTypes(v_provider_types=20varchar[])=0ARETURNS=20=
SETOF=20providers=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20providers=0A=20=20=
=20=20WHERE=20provider_type=20=3D=20ANY(v_provider_types);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetProviderByProviderId=20(v_id=20UUID)=0ARETURNS=20=
SETOF=20providers=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
providers=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetProviderByName=20(v_name=20VARCHAR)=0ARETURNS=20SETOF=20providers=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20providers=0A=20=20=20=20WHERE=20=
name=20=3D=20v_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertStorageQos=20(=0A=20=
=20=20=20v_id=20uuid,=0A=20=20=20=20v_qos_type=20SMALLINT,=0A=20=20=20=20=
v_name=20VARCHAR(50),=0A=20=20=20=20v_description=20TEXT,=0A=20=20=20=20=
v_storage_pool_id=20uuid,=0A=20=20=20=20v_max_throughput=20INT,=0A=20=20=20=
=20v_max_read_throughput=20INT,=0A=20=20=20=20v_max_write_throughput=20=
INT,=0A=20=20=20=20v_max_iops=20INT,=0A=20=20=20=20v_max_read_iops=20=
INT,=0A=20=20=20=20v_max_write_iops=20INT=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20qos=20(=0A=20=
=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20qos_type,=0A=20=20=20=20=
=20=20=20=20name,=0A=20=20=20=20=20=20=20=20description,=0A=20=20=20=20=20=
=20=20=20storage_pool_id,=0A=20=20=20=20=20=20=20=20max_throughput,=0A=20=
=20=20=20=20=20=20=20max_read_throughput,=0A=20=20=20=20=20=20=20=20=
max_write_throughput,=0A=20=20=20=20=20=20=20=20max_iops,=0A=20=20=20=20=20=
=20=20=20max_read_iops,=0A=20=20=20=20=20=20=20=20max_write_iops=0A=20=20=
=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_id,=0A=20=20=20=20=20=20=20=20v_qos_type,=0A=20=20=20=20=20=20=20=20=
v_name,=0A=20=20=20=20=20=20=20=20v_description,=0A=20=20=20=20=20=20=20=20=
v_storage_pool_id,=0A=20=20=20=20=20=20=20=20v_max_throughput,=0A=20=20=20=
=20=20=20=20=20v_max_read_throughput,=0A=20=20=20=20=20=20=20=20=
v_max_write_throughput,=0A=20=20=20=20=20=20=20=20v_max_iops,=0A=20=20=20=
=20=20=20=20=20v_max_read_iops,=0A=20=20=20=20=20=20=20=20=
v_max_write_iops=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertCpuQos=20(=0A=20=20=20=20v_id=20uuid,=0A=20=20=20=20v_qos_type=20=
SMALLINT,=0A=20=20=20=20v_name=20VARCHAR(50),=0A=20=20=20=20=
v_description=20TEXT,=0A=20=20=20=20v_storage_pool_id=20uuid,=0A=20=20=20=
=20v_cpu_limit=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20qos=20(=0A=20=20=20=20=20=20=20=20=
id,=0A=20=20=20=20=20=20=20=20qos_type,=0A=20=20=20=20=20=20=20=20name,=0A=
=20=20=20=20=20=20=20=20description,=0A=20=20=20=20=20=20=20=20=
storage_pool_id,=0A=20=20=20=20=20=20=20=20cpu_limit=0A=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=
=20=20=20=20=20=20v_qos_type,=0A=20=20=20=20=20=20=20=20v_name,=0A=20=20=20=
=20=20=20=20=20v_description,=0A=20=20=20=20=20=20=20=20=
v_storage_pool_id,=0A=20=20=20=20=20=20=20=20v_cpu_limit=0A=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertNetworkQos=20(=0A=20=
=20=20=20v_id=20uuid,=0A=20=20=20=20v_qos_type=20SMALLINT,=0A=20=20=20=20=
v_name=20VARCHAR(50),=0A=20=20=20=20v_description=20TEXT,=0A=20=20=20=20=
v_storage_pool_id=20uuid,=0A=20=20=20=20v_inbound_average=20INT,=0A=20=20=
=20=20v_inbound_peak=20INT,=0A=20=20=20=20v_inbound_burst=20INT,=0A=20=20=
=20=20v_outbound_average=20INT,=0A=20=20=20=20v_outbound_peak=20INT,=0A=20=
=20=20=20v_outbound_burst=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20qos=20(=0A=20=20=20=20=20=
=20=20=20id,=0A=20=20=20=20=20=20=20=20qos_type,=0A=20=20=20=20=20=20=20=20=
name,=0A=20=20=20=20=20=20=20=20description,=0A=20=20=20=20=20=20=20=20=
storage_pool_id,=0A=20=20=20=20=20=20=20=20inbound_average,=0A=20=20=20=20=
=20=20=20=20inbound_peak,=0A=20=20=20=20=20=20=20=20inbound_burst,=0A=20=20=
=20=20=20=20=20=20outbound_average,=0A=20=20=20=20=20=20=20=20=
outbound_peak,=0A=20=20=20=20=20=20=20=20outbound_burst=0A=20=20=20=20=20=
=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=
=20=20=20=20=20=20=20v_qos_type,=0A=20=20=20=20=20=20=20=20v_name,=0A=20=20=
=20=20=20=20=20=20v_description,=0A=20=20=20=20=20=20=20=20=
v_storage_pool_id,=0A=20=20=20=20=20=20=20=20v_inbound_average,=0A=20=20=20=
=20=20=20=20=20v_inbound_peak,=0A=20=20=20=20=20=20=20=20=
v_inbound_burst,=0A=20=20=20=20=20=20=20=20v_outbound_average,=0A=20=20=20=
=20=20=20=20=20v_outbound_peak,=0A=20=20=20=20=20=20=20=20=
v_outbound_burst=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertHostNetworkQos=20(=0A=20=20=20=20v_id=20uuid,=0A=20=20=20=20=
v_qos_type=20SMALLINT,=0A=20=20=20=20v_name=20VARCHAR(50),=0A=20=20=20=20=
v_description=20TEXT,=0A=20=20=20=20v_storage_pool_id=20uuid,=0A=20=20=20=
=20v_out_average_linkshare=20INT,=0A=20=20=20=20v_out_average_upperlimit=20=
INT,=0A=20=20=20=20v_out_average_realtime=20INT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
qos=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20=
qos_type,=0A=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20=
description,=0A=20=20=20=20=20=20=20=20storage_pool_id,=0A=20=20=20=20=20=
=20=20=20out_average_linkshare,=0A=20=20=20=20=20=20=20=20=
out_average_upperlimit,=0A=20=20=20=20=20=20=20=20out_average_realtime=0A=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=
=20v_id,=0A=20=20=20=20=20=20=20=20v_qos_type,=0A=20=20=20=20=20=20=20=20=
v_name,=0A=20=20=20=20=20=20=20=20v_description,=0A=20=20=20=20=20=20=20=20=
v_storage_pool_id,=0A=20=20=20=20=20=20=20=20v_out_average_linkshare,=0A=20=
=20=20=20=20=20=20=20v_out_average_upperlimit,=0A=20=20=20=20=20=20=20=20=
v_out_average_realtime=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateStorageQos=20(=0A=20=20=20=20v_id=20uuid,=0A=20=20=20=20v_qos_type=20=
SMALLINT,=0A=20=20=20=20v_name=20VARCHAR(50),=0A=20=20=20=20=
v_description=20TEXT,=0A=20=20=20=20v_storage_pool_id=20uuid,=0A=20=20=20=
=20v_max_throughput=20INT,=0A=20=20=20=20v_max_read_throughput=20INT,=0A=20=
=20=20=20v_max_write_throughput=20INT,=0A=20=20=20=20v_max_iops=20INT,=0A=
=20=20=20=20v_max_read_iops=20INT,=0A=20=20=20=20v_max_write_iops=20INT=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
UPDATE=20qos=0A=20=20=20=20SET=20qos_type=20=3D=20v_qos_type,=0A=20=20=20=
=20=20=20=20=20name=20=3D=20v_name,=0A=20=20=20=20=20=20=20=20=
description=20=3D=20v_description,=0A=20=20=20=20=20=20=20=20=
storage_pool_id=20=3D=20v_storage_pool_id,=0A=20=20=20=20=20=20=20=20=
max_throughput=20=3D=20v_max_throughput,=0A=20=20=20=20=20=20=20=20=
max_read_throughput=20=3D=20v_max_read_throughput,=0A=20=20=20=20=20=20=20=
=20max_write_throughput=20=3D=20v_max_write_throughput,=0A=20=20=20=20=20=
=20=20=20max_iops=20=3D=20v_max_iops,=0A=20=20=20=20=20=20=20=20=
max_read_iops=20=3D=20v_max_read_iops,=0A=20=20=20=20=20=20=20=20=
max_write_iops=20=3D=20v_max_write_iops,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateCpuQos=20(=0A=20=20=
=20=20v_id=20uuid,=0A=20=20=20=20v_qos_type=20SMALLINT,=0A=20=20=20=20=
v_name=20VARCHAR(50),=0A=20=20=20=20v_description=20TEXT,=0A=20=20=20=20=
v_storage_pool_id=20uuid,=0A=20=20=20=20v_cpu_limit=20INT=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20qos=0A=
=20=20=20=20SET=20qos_type=20=3D=20v_qos_type,=0A=20=20=20=20=20=20=20=20=
name=20=3D=20v_name,=0A=20=20=20=20=20=20=20=20description=20=3D=20=
v_description,=0A=20=20=20=20=20=20=20=20storage_pool_id=20=3D=20=
v_storage_pool_id,=0A=20=20=20=20=20=20=20=20cpu_limit=20=3D=20=
v_cpu_limit,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateNetworkQos=20(=0A=20=20=20=20v_id=20uuid,=0A=20=20=20=20v_qos_type=20=
SMALLINT,=0A=20=20=20=20v_name=20VARCHAR(50),=0A=20=20=20=20=
v_description=20TEXT,=0A=20=20=20=20v_storage_pool_id=20uuid,=0A=20=20=20=
=20v_inbound_average=20INT,=0A=20=20=20=20v_inbound_peak=20INT,=0A=20=20=20=
=20v_inbound_burst=20INT,=0A=20=20=20=20v_outbound_average=20INT,=0A=20=20=
=20=20v_outbound_peak=20INT,=0A=20=20=20=20v_outbound_burst=20INT=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
qos=0A=20=20=20=20SET=20qos_type=20=3D=20v_qos_type,=0A=20=20=20=20=20=20=
=20=20name=20=3D=20v_name,=0A=20=20=20=20=20=20=20=20description=20=3D=20=
v_description,=0A=20=20=20=20=20=20=20=20storage_pool_id=20=3D=20=
v_storage_pool_id,=0A=20=20=20=20=20=20=20=20inbound_average=20=3D=20=
v_inbound_average,=0A=20=20=20=20=20=20=20=20inbound_peak=20=3D=20=
v_inbound_peak,=0A=20=20=20=20=20=20=20=20inbound_burst=20=3D=20=
v_inbound_burst,=0A=20=20=20=20=20=20=20=20outbound_average=20=3D=20=
v_outbound_average,=0A=20=20=20=20=20=20=20=20outbound_peak=20=3D=20=
v_outbound_peak,=0A=20=20=20=20=20=20=20=20outbound_burst=20=3D=20=
v_outbound_burst,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateHostNetworkQos=20(=0A=20=20=20=20v_id=20uuid,=0A=20=20=20=20=
v_qos_type=20SMALLINT,=0A=20=20=20=20v_name=20VARCHAR(50),=0A=20=20=20=20=
v_description=20TEXT,=0A=20=20=20=20v_storage_pool_id=20uuid,=0A=20=20=20=
=20v_out_average_linkshare=20INT,=0A=20=20=20=20v_out_average_upperlimit=20=
INT,=0A=20=20=20=20v_out_average_realtime=20INT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20qos=0A=20=
=20=20=20SET=20qos_type=20=3D=20v_qos_type,=0A=20=20=20=20=20=20=20=20=
name=20=3D=20v_name,=0A=20=20=20=20=20=20=20=20description=20=3D=20=
v_description,=0A=20=20=20=20=20=20=20=20storage_pool_id=20=3D=20=
v_storage_pool_id,=0A=20=20=20=20=20=20=20=20out_average_linkshare=20=3D=20=
v_out_average_linkshare,=0A=20=20=20=20=20=20=20=20=
out_average_upperlimit=20=3D=20v_out_average_upperlimit,=0A=20=20=20=20=20=
=20=20=20out_average_realtime=20=3D=20v_out_average_realtime,=0A=20=20=20=
=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20=
id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteQos=20(v_id=20=
UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=
=20=20=20=20FROM=20qos=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetQosByQosId=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
qos=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=
=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20qos=0A=20=20=20=20WHERE=20id=20=
=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllQosForStoragePoolByQosType=20(=0A=20=20=20=20v_storage_pool_id=20=
UUID,=0A=20=20=20=20v_qos_type=20SMALLINT=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20qos=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20qos=0A=20=20=20=20=
WHERE=20storage_pool_id=20=3D=20v_storage_pool_id=0A=20=20=20=20=20=20=20=
=20AND=20qos_type=20=3D=20v_qos_type;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllQosForStoragePool=20(v_storage_pool_id=20UUID)=0ARETURNS=20SETOF=20=
qos=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=
=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20qos=0A=20=20=20=20WHERE=20=
storage_pool_id=20=3D=20v_storage_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllQosByQosType=20(v_qos_type=20SMALLINT)=0ARETURNS=20SETOF=20qos=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20qos=0A=20=20=20=20WHERE=20qos_type=20=
=3D=20v_qos_type;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetQosByDiskProfiles=20=
(v_disk_profile_ids=20UUID[])=0ARETURNS=20SETOF=20=
qos_for_disk_profile_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
qos_for_disk_profile_view=0A=20=20=20=20WHERE=20disk_profile_id=20=3D=20=
ANY(v_disk_profile_ids);=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetQosByVmIds=20=
(v_vm_ids=20UUID[])=0ARETURNS=20SETOF=20qos_for_vm_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20qos_for_vm_view=0A=20=20=20=20WHERE=20vm_id=20=3D=20=
ANY(v_vm_ids);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetHostNetworkQosOfMigrationNetworkByClusterId=20(v_cluster_id=20UUID)=0A=
RETURNS=20SETOF=20host_network_qos_of_migration_network_by_cluster=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20=
host_network_qos_of_migration_network_by_cluster=0A=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertQuota=20(=0A=20=20=20=
=20v_id=20UUID,=0A=20=20=20=20v_storage_pool_id=20UUID,=0A=20=20=20=20=
v_quota_name=20VARCHAR(50),=0A=20=20=20=20v_description=20VARCHAR(500),=0A=
=20=20=20=20v_threshold_cluster_percentage=20INT,=0A=20=20=20=20=
v_threshold_storage_percentage=20INT,=0A=20=20=20=20=
v_grace_cluster_percentage=20INT,=0A=20=20=20=20=
v_grace_storage_percentage=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20quota=20(=0A=20=20=20=20=
=20=20=20=20id,=0A=20=20=20=20=20=20=20=20storage_pool_id,=0A=20=20=20=20=
=20=20=20=20quota_name,=0A=20=20=20=20=20=20=20=20description,=0A=20=20=20=
=20=20=20=20=20threshold_cluster_percentage,=0A=20=20=20=20=20=20=20=20=
threshold_storage_percentage,=0A=20=20=20=20=20=20=20=20=
grace_cluster_percentage,=0A=20=20=20=20=20=20=20=20=
grace_storage_percentage=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20=
v_storage_pool_id,=0A=20=20=20=20=20=20=20=20v_quota_name,=0A=20=20=20=20=
=20=20=20=20v_description,=0A=20=20=20=20=20=20=20=20=
v_threshold_cluster_percentage,=0A=20=20=20=20=20=20=20=20=
v_threshold_storage_percentage,=0A=20=20=20=20=20=20=20=20=
v_grace_cluster_percentage,=0A=20=20=20=20=20=20=20=20=
v_grace_storage_percentage=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertQuotaLimitation=20(=0A=20=20=20=20v_id=20=
UUID,=0A=20=20=20=20v_quota_id=20UUID,=0A=20=20=20=20v_storage_id=20=
UUID,=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_virtual_cpu=20=
INT,=0A=20=20=20=20v_mem_size_mb=20BIGINT,=0A=20=20=20=20=
v_storage_size_gb=20BIGINT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20quota_limitation=20(=0A=
=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20quota_id,=0A=20=20=20=
=20=20=20=20=20storage_id,=0A=20=20=20=20=20=20=20=20cluster_id,=0A=20=20=
=20=20=20=20=20=20virtual_cpu,=0A=20=20=20=20=20=20=20=20mem_size_mb,=0A=20=
=20=20=20=20=20=20=20storage_size_gb=0A=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20=
v_quota_id,=0A=20=20=20=20=20=20=20=20v_storage_id,=0A=20=20=20=20=20=20=20=
=20v_cluster_id,=0A=20=20=20=20=20=20=20=20v_virtual_cpu,=0A=20=20=20=20=20=
=20=20=20v_mem_size_mb,=0A=20=20=20=20=20=20=20=20v_storage_size_gb=0A=20=
=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetQuotaStorageByStorageGuid=20(=0A=20=20=20=20v_storage_id=20UUID,=0A=20=
=20=20=20v_id=20UUID,=0A=20=20=20=20v_allow_empty=20BOOLEAN=0A=20=20=20=20=
)=0ARETURNS=20SETOF=20quota_storage_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20(=0A=20=20=20=20=20=20=20=20SELECT=20=
COALESCE(q_storage_view.quota_storage_id,=20q_g_view.quota_id)=20AS=20=
quota_storage_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
q_g_view.quota_id=20AS=20quota_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
q_storage_view.storage_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
q_storage_view.storage_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
COALESCE(q_storage_view.storage_size_gb,=20q_g_view.storage_size_gb)=20=
AS=20storage_size_gb,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
COALESCE(q_storage_view.storage_size_gb_usage,=20=
q_g_view.storage_size_gb_usage)=20AS=20storage_size_gb_usage=0A=20=20=20=20=
=20=20=20=20FROM=20quota_global_view=20q_g_view=0A=20=20=20=20=20=20=20=20=
LEFT=20JOIN=20quota_storage_view=20q_storage_view=0A=20=20=20=20=20=20=20=
=20=20=20=20=20ON=20q_g_view.quota_id=20=3D=20q_storage_view.quota_id=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_storage_id=20=3D=20=
q_storage_view.storage_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20OR=20v_storage_id=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20WHERE=20=
q_g_view.quota_id=20=3D=20v_id=0A=20=20=20=20=20=20=20=20)=20sub=0A=20=20=
=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20v_allow_empty=0A=20=
=20=20=20=20=20=20=20=20=20=20=20OR=20storage_size_gb=20IS=20NOT=20NULL=0A=
=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetQuotaByAdElementId=20(=0A=20=20=20=20v_ad_element_id=20UUID,=0A=20=20=20=
=20v_storage_pool_id=20UUID,=0A=20=20=20=20v_recursive=20BOOLEAN=0A=20=20=
=20=20)=0ARETURNS=20SETOF=20quota_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20quota_view=0A=20=20=20=20WHERE=20quota_view.quota_id=20IN=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20object_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20FROM=20PERMISSIONS=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20object_type_id=20=3D=2017=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20AND=20role_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=20role_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20ROLES_groups=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20action_group_id=20=3D=20901=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20ad_element_id=20=3D=20=
v_ad_element_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_recursive=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
ad_element_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
getUserAndGroupsById(v_ad_element_id)=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_storage_pool_id=20=3D=20quota_view.storage_pool_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20OR=20v_storage_pool_id=20IS=20NULL=0A=20=20=20=20=20=20=
=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20getAllThinQuota=20()=0A=
RETURNS=20SETOF=20quota_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
quota_view;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20getQuotaCount=20()=0A=
RETURNS=20SETOF=20BIGINT=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20count(*)=20AS=20num_quota=0A=20=20=
=20=20FROM=20quota;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetQuotaStorageByQuotaGuid=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
quota_storage_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
quota_storage_view=0A=20=20=20=20WHERE=20quota_id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetQuotaClusterByClusterGuid=20(=0A=20=20=20=20=
v_cluster_id=20UUID,=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_allow_empty=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
quota_cluster_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20(=0A=20=20=
=20=20=20=20=20=20SELECT=20COALESCE(q_vds_view.quota_cluster_id,=20=
q_g_view.quota_id)=20AS=20quota_cluster_id,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20q_g_view.quota_id=20AS=20quota_id,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20q_vds_view.cluster_id=20AS=20cluster_id,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20q_vds_view.cluster_name=20AS=20cluster_name,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20COALESCE(q_vds_view.virtual_cpu,=20=
q_g_view.virtual_cpu)=20AS=20virtual_cpu,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20COALESCE(q_vds_view.virtual_cpu_usage,=20=
q_g_view.virtual_cpu_usage)=20AS=20virtual_cpu_usage,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20COALESCE(q_vds_view.mem_size_mb,=20=
q_g_view.mem_size_mb)=20AS=20mem_size_mb,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20COALESCE(q_vds_view.mem_size_mb_usage,=20=
q_g_view.mem_size_mb_usage)=20AS=20mem_size_mb_usage=0A=20=20=20=20=20=20=
=20=20FROM=20quota_global_view=20q_g_view=0A=20=20=20=20=20=20=20=20LEFT=20=
JOIN=20quota_cluster_view=20q_vds_view=0A=20=20=20=20=20=20=20=20=20=20=20=
=20ON=20q_g_view.quota_id=20=3D=20q_vds_view.quota_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20v_cluster_id=20=3D=20q_vds_view.cluster_id=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
v_cluster_id=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20WHERE=20q_g_view.quota_id=20=3D=20=
v_id=0A=20=20=20=20=20=20=20=20)=20sub=0A=20=20=20=20WHERE=20=
v_allow_empty=0A=20=20=20=20=20=20=20=20OR=20virtual_cpu=20IS=20NOT=20=
NULL=0A=20=20=20=20=20=20=20=20OR=20mem_size_mb=20IS=20NOT=20NULL;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetQuotaClusterByQuotaGuid=20(v_id=20UUID)=0A=
RETURNS=20SETOF=20quota_cluster_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
quota_cluster_view.*=0A=20=20=20=20FROM=20quota_cluster_view=0A=20=20=20=20=
WHERE=20quota_id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteQuotaByQuotaGuid=20=
(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20quota=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteQuotaLimitationByQuotaGuid=20(v_id=20UUID)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20quota_limitation=0A=20=20=20=20WHERE=20quota_id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateQuotaMetaData=20(=0A=20=20=20=20v_id=20UUID,=0A=
=20=20=20=20v_storage_pool_id=20UUID,=0A=20=20=20=20v_quota_name=20=
VARCHAR(50),=0A=20=20=20=20v_description=20VARCHAR(500),=0A=20=20=20=20=
v_threshold_cluster_percentage=20INT,=0A=20=20=20=20=
v_threshold_storage_percentage=20INT,=0A=20=20=20=20=
v_grace_cluster_percentage=20INT,=0A=20=20=20=20=
v_grace_storage_percentage=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20quota=0A=20=20=20=20SET=20=
storage_pool_id=20=3D=20v_storage_pool_id,=0A=20=20=20=20=20=20=20=20=
quota_name=20=3D=20v_quota_name,=0A=20=20=20=20=20=20=20=20description=20=
=3D=20v_description,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP,=0A=20=20=20=20=20=20=20=20threshold_cluster_percentage=20=
=3D=20v_threshold_cluster_percentage,=0A=20=20=20=20=20=20=20=20=
threshold_storage_percentage=20=3D=20v_threshold_storage_percentage,=0A=20=
=20=20=20=20=20=20=20grace_cluster_percentage=20=3D=20=
v_grace_cluster_percentage,=0A=20=20=20=20=20=20=20=20=
grace_storage_percentage=20=3D=20v_grace_storage_percentage=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetQuotaByStoragePoolGuid=20(v_storage_pool_id=20UUID)=0ARETURNS=20SETOF=20=
quota_global_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
quota_global_view=0A=20=20=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20storage_pool_id=20=3D=20v_storage_pool_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20OR=20v_storage_pool_id=20IS=20NULL=0A=20=20=20=20=20=20=20=20=
=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetQuotaByQuotaGuid=20=
(v_id=20UUID)=0ARETURNS=20SETOF=20quota_global_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20quota_global_view=0A=20=20=20=20WHERE=20quota_id=20=
=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetQuotaByQuotaName=20=
(v_quota_name=20VARCHAR)=0ARETURNS=20SETOF=20quota_global_view=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20*=0A=20=20=20=20FROM=20quota_global_view=0A=20=20=20=20WHERE=20=
quota_name=20=3D=20v_quota_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllThinQuotasByStorageId=20(=0A=20=20=20=20v_storage_id=20UUID,=0A=20=20=
=20=20v_engine_session_seq_id=20INT,=0A=20=20=20=20v_is_filtered=20=
boolean=0A=20=20=20=20)=0ARETURNS=20SETOF=20quota_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
DISTINCT=20quota_id,=0A=20=20=20=20=20=20=20=20storage_pool_id,=0A=20=20=20=
=20=20=20=20=20storage_pool_name,=0A=20=20=20=20=20=20=20=20quota_name,=0A=
=20=20=20=20=20=20=20=20description,=0A=20=20=20=20=20=20=20=20=
threshold_cluster_percentage,=0A=20=20=20=20=20=20=20=20=
threshold_storage_percentage,=0A=20=20=20=20=20=20=20=20=
grace_cluster_percentage,=0A=20=20=20=20=20=20=20=20=
grace_storage_percentage,=0A=20=20=20=20=20=20=20=20=
quota_enforcement_type=0A=20=20=20=20FROM=20quota_limitations_view=0A=20=20=
=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20storage_id=20=3D=20=
v_storage_id=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20is_global=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20AND=20NOT=20is_empty=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20storage_size_gb=20IS=20NOT=20NULL=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20storage_pool_id=20IN=20(=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20storage_pool_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
storage_pool_iso_map=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20storage_id=20=3D=20v_storage_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=
=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20=
v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20permissions=20p=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20INNER=20JOIN=20=
engine_session_user_flat_groups=20u=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20ON=20u.granted_id=20=3D=20p.ad_element_id=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
u.engine_session_seq_id=20=3D=20v_engine_session_seq_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20p.object_type_id=20=3D=20=
17=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
--=20quota=20object=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20p.role_id=20=3D=20'def0000a-0000-0000-0000-def00000000a'=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20--=20consume=20=
quota=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
quota_id=20=3D=20p.object_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllThinQuotasByClusterId=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=
=20=20v_engine_session_seq_id=20INT,=0A=20=20=20=20v_is_filtered=20=
boolean=0A=20=20=20=20)=0ARETURNS=20SETOF=20quota_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
DISTINCT=20quota_id,=0A=20=20=20=20=20=20=20=20storage_pool_id,=0A=20=20=20=
=20=20=20=20=20storage_pool_name,=0A=20=20=20=20=20=20=20=20quota_name,=0A=
=20=20=20=20=20=20=20=20description,=0A=20=20=20=20=20=20=20=20=
threshold_cluster_percentage,=0A=20=20=20=20=20=20=20=20=
threshold_storage_percentage,=0A=20=20=20=20=20=20=20=20=
grace_cluster_percentage,=0A=20=20=20=20=20=20=20=20=
grace_storage_percentage,=0A=20=20=20=20=20=20=20=20=
quota_enforcement_type=0A=20=20=20=20FROM=20quota_limitations_view=0A=20=20=
=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20is_global=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20AND=20NOT=20is_empty=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20virtual_cpu=20IS=20NOT=20NULL=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20AND=20storage_pool_id=20IN=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20storage_pool_id=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20cluster=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20AND=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=
=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20permissions=20p=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20INNER=20JOIN=20engine_session_user_flat_groups=20u=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20ON=20u.granted_id=20=3D=20=
p.ad_element_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
u.engine_session_seq_id=20=3D=20v_engine_session_seq_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20p.object_type_id=20=3D=20=
17=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
--=20quota=20object=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20p.role_id=20=3D=20'def0000a-0000-0000-0000-def00000000a'=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20--=20consume=20=
quota=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
quota_id=20=3D=20p.object_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
IsQuotaInUse=20(v_quota_id=20UUID)=0ARETURNS=20boolean=20STABLE=20AS=20=
$BODY$=0A=0ADECLARE=20result=20boolean=20:=3D=20FALSE;=0A=0ABEGIN=0A=20=20=
=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
quota_id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
image_storage_domain_map=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
quota_id=20=3D=20v_quota_id=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UNION=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20quota_id=0A=20=20=
=20=20=20=20=20=20=20=20=20=20FROM=20vm_static=0A=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20quota_id=20=3D=20v_quota_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20)=20THEN=20result=20:=3D=20TRUE;=0A=20=20=20=20END=20IF;=0A=20=
=20=20=20RETURN=20result;=0AEND;$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertRepo_domain_file_meta_data=20(=0A=20=20=20=20v_repo_domain_id=20=
UUID,=0A=20=20=20=20v_repo_image_id=20VARCHAR(256),=0A=20=20=20=20=
v_repo_image_name=20VARCHAR(256),=0A=20=20=20=20v_size=20BIGINT,=0A=20=20=
=20=20v_date_created=20TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20=
v_last_refreshed=20BIGINT,=0A=20=20=20=20v_file_type=20INT=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20repo_file_meta_data=20(=0A=20=20=20=20=20=20=20=20repo_domain_id,=0A=
=20=20=20=20=20=20=20=20repo_image_id,=0A=20=20=20=20=20=20=20=20=
repo_image_name,=0A=20=20=20=20=20=20=20=20size,=0A=20=20=20=20=20=20=20=20=
date_created,=0A=20=20=20=20=20=20=20=20last_refreshed,=0A=20=20=20=20=20=
=20=20=20file_type=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=
=20=20=20=20=20=20=20=20v_repo_domain_id,=0A=20=20=20=20=20=20=20=20=
v_repo_image_id,=0A=20=20=20=20=20=20=20=20v_repo_image_name,=0A=20=20=20=
=20=20=20=20=20v_size,=0A=20=20=20=20=20=20=20=20v_date_created,=0A=20=20=
=20=20=20=20=20=20v_last_refreshed,=0A=20=20=20=20=20=20=20=20=
v_file_type=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteRepo_domain_file_list=20(=0A=20=20=20=20v_storage_domain_id=20=
UUID,=0A=20=20=20=20v_file_type=20INT=20DEFAULT=20NULL=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20repo_file_meta_data=0A=20=20=20=20WHERE=20repo_domain_id=20=3D=20=
v_storage_domain_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_file_type=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=
=20=20OR=20file_type=20=3D=20v_file_type=0A=20=20=20=20=20=20=20=20=20=20=
=20=20);=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetRepo_files_by_storage_domain=20(=0A=20=20=20=20v_storage_domain_id=20=
UUID,=0A=20=20=20=20v_file_type=20INT=20DEFAULT=20NULL=0A=20=20=20=20)=0A=
RETURNS=20SETOF=20repo_file_meta_data=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
repo_file_meta_data.*=0A=20=20=20=20FROM=20repo_file_meta_data=0A=20=20=20=
=20WHERE=20repo_domain_id=20=3D=20v_storage_domain_id=0A=20=20=20=20=20=20=
=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20v_file_type=20IS=20=
NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
repo_file_meta_data.file_type=20=3D=20v_file_type=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20ORDER=20BY=20=
repo_file_meta_data.last_refreshed;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ADROP=20TYPE=20IF=20EXISTS=20=
GetRepo_files_in_all_storage_pools_rs=20CASCADE;=0A=
**************************=0A=0ADROP=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20TYPE=20GetRepo_files_in_all_storage_pools_rs=20AS=20=
(=0A=20=20=20=20=20=20=20=20storage_domain_id=20UUID,=0A=20=20=20=20=20=20=
=20=20last_refreshed=20BIGINT,=0A=20=20=20=20=20=20=20=20file_type=20INT=0A=
=20=20=20=20=20=20=20=20);=0A**************************=0A=0ACREATE=20=
TYPE=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetRepo_files_in_all_storage_pools=20(=0A=20=20=20=20=
v_storage_domain_type=20INT,=0A=20=20=20=20v_storage_pool_status=20INT,=0A=
=20=20=20=20v_vds_status=20INT,=0A=20=20=20=20v_storage_domain_status=20=
INT=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
GetRepo_files_in_all_storage_pools_rs=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20DISTINCT=20=
b.storage_domain_id,=0A=20=20=20=20=20=20=20=20c.last_refreshed,=0A=20=20=
=20=20=20=20=20=20b.file_type=0A=20=20=20=20FROM=20=
storage_domain_file_repos=20b=0A=20=20=20=20LEFT=20JOIN=20(=0A=20=20=20=20=
=20=20=20=20SELECT=20storage_domain_id,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20file_type,=0A=20=20=20=20=20=20=20=20=20=20=20=20min(last_refreshed)=20=
AS=20last_refreshed=0A=20=20=20=20=20=20=20=20FROM=20=
storage_domain_file_repos=20a=0A=20=20=20=20=20=20=20=20GROUP=20BY=20=
storage_domain_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20file_type=0A=20=20=
=20=20=20=20=20=20)=20AS=20c=0A=20=20=20=20=20=20=20=20ON=20=
b.storage_domain_id=20=3D=20c.storage_domain_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20b.file_type=20=3D=20c.file_type=0A=20=20=20=20WHERE=20=
b.storage_domain_type=20=3D=20v_storage_domain_type=0A=20=20=20=20=20=20=20=
=20AND=20b.storage_pool_status=20=3D=20v_storage_pool_status=0A=20=20=20=20=
=20=20=20=20AND=20b.storage_domain_status=20=3D=20=
v_storage_domain_status=0A=20=20=20=20=20=20=20=20AND=20b.vds_status=20=3D=
=20v_vds_status;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertSnapshot=20(=0A=20=20=
=20=20v_snapshot_id=20UUID,=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20=
v_snapshot_type=20VARCHAR(32),=0A=20=20=20=20v_status=20VARCHAR(32),=0A=20=
=20=20=20v_description=20VARCHAR(4000),=0A=20=20=20=20v_creation_date=20=
TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20v_app_list=20TEXT,=0A=20=20=
=20=20v_vm_configuration=20TEXT,=0A=20=20=20=20v_memory_volume=20=
VARCHAR(255),=0A=20=20=20=20v_memory_dump_disk_id=20UUID,=0A=20=20=20=20=
v_memory_metadata_disk_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20snapshots=20(=0A=20=20=20=
=20=20=20=20=20snapshot_id,=0A=20=20=20=20=20=20=20=20status,=0A=20=20=20=
=20=20=20=20=20vm_id,=0A=20=20=20=20=20=20=20=20snapshot_type,=0A=20=20=20=
=20=20=20=20=20description,=0A=20=20=20=20=20=20=20=20creation_date,=0A=20=
=20=20=20=20=20=20=20app_list,=0A=20=20=20=20=20=20=20=20=
vm_configuration,=0A=20=20=20=20=20=20=20=20memory_volume,=0A=20=20=20=20=
=20=20=20=20memory_dump_disk_id,=0A=20=20=20=20=20=20=20=20=
memory_metadata_disk_id=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES(=0A=20=20=20=20=20=20=20=20v_snapshot_id,=0A=20=20=20=20=20=20=20=20=
v_status,=0A=20=20=20=20=20=20=20=20v_vm_id,=0A=20=20=20=20=20=20=20=20=
v_snapshot_type,=0A=20=20=20=20=20=20=20=20v_description,=0A=20=20=20=20=20=
=20=20=20v_creation_date,=0A=20=20=20=20=20=20=20=20v_app_list,=0A=20=20=20=
=20=20=20=20=20v_vm_configuration,=0A=20=20=20=20=20=20=20=20=
v_memory_volume,=0A=20=20=20=20=20=20=20=20v_memory_dump_disk_id,=0A=20=20=
=20=20=20=20=20=20v_memory_metadata_disk_id=0A=20=20=20=20=20=20=20=20);=0A=
END;=20$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateSnapshot=20(=0A=20=20=20=20v_snapshot_id=20=
UUID,=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20v_snapshot_type=20=
VARCHAR(32),=0A=20=20=20=20v_status=20VARCHAR(32),=0A=20=20=20=20=
v_description=20VARCHAR(4000),=0A=20=20=20=20v_creation_date=20TIMESTAMP=20=
WITH=20TIME=20ZONE,=0A=20=20=20=20v_app_list=20TEXT,=0A=20=20=20=20=
v_vm_configuration=20TEXT,=0A=20=20=20=20v_memory_volume=20VARCHAR(255),=0A=
=20=20=20=20v_memory_dump_disk_id=20UUID,=0A=20=20=20=20=
v_memory_metadata_disk_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20snapshots=0A=20=20=20=20SET=20=
status=20=3D=20v_status,=0A=20=20=20=20=20=20=20=20vm_id=20=3D=20=
v_vm_id,=0A=20=20=20=20=20=20=20=20snapshot_type=20=3D=20=
v_snapshot_type,=0A=20=20=20=20=20=20=20=20description=20=3D=20=
v_description,=0A=20=20=20=20=20=20=20=20creation_date=20=3D=20=
v_creation_date,=0A=20=20=20=20=20=20=20=20app_list=20=3D=20v_app_list,=0A=
=20=20=20=20=20=20=20=20vm_configuration=20=3D=20v_vm_configuration,=0A=20=
=20=20=20=20=20=20=20memory_volume=20=3D=20v_memory_volume,=0A=20=20=20=20=
=20=20=20=20memory_dump_disk_id=20=3D=20v_memory_dump_disk_id,=0A=20=20=20=
=20=20=20=20=20memory_metadata_disk_id=20=3D=20=
v_memory_metadata_disk_id,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
NOW()=0A=20=20=20=20WHERE=20snapshot_id=20=3D=20v_snapshot_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateSnapshotStatus=20(=0A=20=20=20=20=
v_snapshot_id=20UUID,=0A=20=20=20=20v_status=20VARCHAR(32)=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
snapshots=0A=20=20=20=20SET=20status=20=3D=20v_status=0A=20=20=20=20=
WHERE=20snapshot_id=20=3D=20v_snapshot_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateSnapshotId=20=
(=0A=20=20=20=20v_snapshot_id=20UUID,=0A=20=20=20=20v_new_snapshot_id=20=
UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20UPDATE=20snapshots=0A=20=20=20=20SET=20snapshot_id=20=3D=20=
v_new_snapshot_id=0A=20=20=20=20WHERE=20snapshot_id=20=3D=20=
v_snapshot_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteSnapshot=20=
(v_snapshot_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20DELETE=0A=20=20=20=20FROM=20snapshots=0A=20=20=20=20WHERE=20=
snapshot_id=20=3D=20v_snapshot_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromSnapshots=20()=0ARETURNS=20SETOF=20snapshots=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20snapshots;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllSnapshotsByStorageDomainId=20(v_storage_id=20UUID)=0ARETURNS=20=
SETOF=20snapshots=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20snapshots.*=0A=20=20=20=20FROM=20=
snapshots=0A=20=20=20=20INNER=20JOIN=20images=0A=20=20=20=20=20=20=20=20=
ON=20snapshots.snapshot_id=20=3D=20images.vm_snapshot_id=0A=20=20=20=20=
INNER=20JOIN=20image_storage_domain_map=0A=20=20=20=20=20=20=20=20ON=20=
image_storage_domain_map.storage_domain_id=20=3D=20v_storage_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20AND=20image_storage_domain_map.image_id=20=3D=20=
images.image_guid;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetSnapshotByVmIdAndType=20=
(=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20v_snapshot_type=20=
VARCHAR(32),=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20=
BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20snapshots=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20snapshots=0A=20=20=20=20WHERE=20vm_id=20=3D=20=
v_vm_id=0A=20=20=20=20=20=20=20=20AND=20snapshot_type=20=3D=20=
v_snapshot_type=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20=
OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
1=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vm_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20entity_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20ORDER=20BY=20creation_date=20ASC=20LIMIT=201;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetSnapshotByVmIdAndTypeAndStatus=20(=0A=20=20=20=20=
v_vm_id=20UUID,=0A=20=20=20=20v_snapshot_type=20VARCHAR(32),=0A=20=20=20=20=
v_status=20VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20SETOF=20snapshots=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20snapshots=0A=20=20=20=20WHERE=20=
vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20AND=20snapshot_type=20=3D=20=
v_snapshot_type=0A=20=20=20=20=20=20=20=20AND=20status=20=3D=20v_status=0A=
=20=20=20=20ORDER=20BY=20creation_date=20ASC=20LIMIT=201;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetSnapshotByVmIdAndStatus=20(=0A=20=20=20=20=
v_vm_id=20UUID,=0A=20=20=20=20v_status=20VARCHAR(32)=0A=20=20=20=20)=0A=
RETURNS=20SETOF=20snapshots=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
snapshots=0A=20=20=20=20WHERE=20vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=
=20=20AND=20status=20=3D=20v_status=0A=20=20=20=20ORDER=20BY=20=
creation_date=20ASC=20LIMIT=201;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20TYPE=20IF=20EXISTS=20GetAllFromSnapshotsByVmId_rs=20=
CASCADE;=0A**************************=0A=0ADROP=20TYPE=0A*********=20=
QUERY=20**********=0ACREATE=20TYPE=20GetAllFromSnapshotsByVmId_rs=20AS=20=
(=0A=20=20=20=20=20=20=20=20snapshot_id=20UUID,=0A=20=20=20=20=20=20=20=20=
vm_id=20UUID,=0A=20=20=20=20=20=20=20=20snapshot_type=20VARCHAR(32),=0A=20=
=20=20=20=20=20=20=20status=20VARCHAR(32),=0A=20=20=20=20=20=20=20=20=
description=20VARCHAR(4000),=0A=20=20=20=20=20=20=20=20creation_date=20=
TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20=20=20=20=20app_list=20=
TEXT,=0A=20=20=20=20=20=20=20=20memory_volume=20VARCHAR(255),=0A=20=20=20=
=20=20=20=20=20memory_dump_disk_id=20UUID,=0A=20=20=20=20=20=20=20=20=
memory_metadata_disk_id=20UUID,=0A=20=20=20=20=20=20=20=20=
vm_configuration=20TEXT,=0A=20=20=20=20=20=20=20=20=
vm_configuration_available=20BOOLEAN=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromSnapshotsByVmId=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20=
v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20BOOLEAN,=0A=20=20=20=20=
v_fill_configuration=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
GetAllFromSnapshotsByVmId_rs=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20snapshot_id,=0A=20=20=20=20=
=20=20=20=20vm_id,=0A=20=20=20=20=20=20=20=20snapshot_type,=0A=20=20=20=20=
=20=20=20=20status,=0A=20=20=20=20=20=20=20=20description,=0A=20=20=20=20=
=20=20=20=20creation_date,=0A=20=20=20=20=20=20=20=20app_list,=0A=20=20=20=
=20=20=20=20=20memory_volume,=0A=20=20=20=20=20=20=20=20=
memory_dump_disk_id,=0A=20=20=20=20=20=20=20=20memory_metadata_disk_id,=0A=
=20=20=20=20=20=20=20=20CASE=0A=20=20=20=20=20=20=20=20=20=20=20=20WHEN=20=
v_fill_configuration=20=3D=20TRUE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20THEN=20vm_configuration=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ELSE=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20END,=0A=20=20=20=20=20=20=
=20=20vm_configuration=20IS=20NOT=20NULL=0A=20=20=20=20=20=20=20=20AND=20=
LENGTH(vm_configuration)=20>=200=0A=20=20=20=20FROM=20snapshots=0A=20=20=20=
=20WHERE=20vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=
=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vm_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20entity_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20ORDER=20BY=20creation_date=20ASC;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetSnapshotBySnapshotId=20(=0A=20=20=20=20v_snapshot_id=20UUID,=0A=20=20=20=
=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20BOOLEAN=0A=20=20=20=20=
)=0ARETURNS=20SETOF=20snapshots=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
snapshots=0A=20=20=20=20WHERE=20snapshot_id=20=3D=20v_snapshot_id=0A=20=20=
=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20=
v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20user_vm_permissions_view=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20=
v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20entity_id=20=3D=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=20vm_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20snapshots=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
snapshot_id=20=3D=20v_snapshot_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetSnapshotIdsByVmIdAndType=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=
=20v_snapshot_type=20VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
idUuidType=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20snapshot_id=0A=20=20=20=20FROM=20=
snapshots=0A=20=20=20=20WHERE=20vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=
=20=20AND=20snapshot_type=20=3D=20v_snapshot_type=0A=20=20=20=20ORDER=20=
BY=20creation_date=20ASC;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetSnapshotIdsByVmIdAndTypeAndStatus=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=
=20=20=20=20v_snapshot_type=20VARCHAR(32),=0A=20=20=20=20v_status=20=
VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20SETOF=20idUuidType=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
snapshot_id=0A=20=20=20=20FROM=20snapshots=0A=20=20=20=20WHERE=20vm_id=20=
=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20AND=20snapshot_type=20=3D=20=
v_snapshot_type=0A=20=20=20=20=20=20=20=20AND=20status=20=3D=20v_status=0A=
=20=20=20=20ORDER=20BY=20creation_date=20ASC;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CheckIfSnapshotExistsByVmIdAndType=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=20=
=20=20=20v_snapshot_type=20VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
booleanResultType=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20EXISTS=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
snapshots=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vm_id=20=3D=20=
v_vm_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
snapshot_type=20=3D=20v_snapshot_type=0A=20=20=20=20=20=20=20=20=20=20=20=
=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
CheckIfSnapshotExistsByVmIdAndStatus=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=
=20=20=20=20v_status=20VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
booleanResultType=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20EXISTS=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
snapshots=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vm_id=20=3D=20=
v_vm_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20status=20=
=3D=20v_status=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20CheckIfSnapshotExistsByVmIdAndSnapshotId=20(=0A=20=20=
=20=20v_vm_id=20UUID,=0A=20=20=20=20v_snapshot_id=20UUID=0A=20=20=20=20)=0A=
RETURNS=20SETOF=20booleanResultType=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20EXISTS=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20snapshots=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vm_id=20=
=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
snapshot_id=20=3D=20v_snapshot_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetNumOfSnapshotsByMemoryVolume=20(v_memory_volume=20=
VARCHAR(255))=0ARETURNS=20SETOF=20BIGINT=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20COUNT(*)=0A=20=
=20=20=20FROM=20snapshots=0A=20=20=20=20WHERE=20memory_volume=20=3D=20=
v_memory_volume;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateMemory=20(=0A=20=20=
=20=20v_memory_volume=20VARCHAR(255),=0A=20=20=20=20=
v_memory_dump_disk_id=20UUID,=0A=20=20=20=20v_memory_metadata_disk_id=20=
UUID,=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20v_snapshot_type=20=
VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20UPDATE=20snapshots=0A=20=20=20=20SET=20=20=20=20=
memory_volume=20=3D=20v_memory_volume,=0A=20=20=20=20=20=20=20=20=20=20=20=
memory_dump_disk_id=20=3D=20v_memory_dump_disk_id,=0A=20=20=20=20=20=20=20=
=20=20=20=20memory_metadata_disk_id=20=3D=20v_memory_metadata_disk_id=0A=20=
=20=20=20WHERE=20vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20AND=20=
snapshot_type=20=3D=20v_snapshot_type;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
RemoveMemoryFromSnapshotByVmIdAndType=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=
=20=20=20=20v_snapshot_type=20VARCHAR(32)=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20snapshots=0A=20=20=
=20=20SET=20=20=20=20memory_volume=20=3D=20NULL,=0A=20=20=20=20=20=20=20=20=
=20=20=20memory_dump_disk_id=20=3D=20NULL,=0A=20=20=20=20=20=20=20=20=20=20=
=20memory_metadata_disk_id=20=3D=20NULL=0A=20=20=20=20WHERE=20=20vm_id=20=
=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20AND=20snapshot_type=20=3D=20=
v_snapshot_type;=0AEND;=20$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
RemoveMemoryFromSnapshotBySnapshotId=20(v_snapshot_id=20UUID)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20snapshots=0A=20=20=
=20=20SET=20=20=20=20memory_volume=20=3D=20NULL,=0A=20=20=20=20=20=20=20=20=
=20=20=20memory_dump_disk_id=20=3D=20NULL,=0A=20=20=20=20=20=20=20=20=20=20=
=20memory_metadata_disk_id=20=3D=20NULL=0A=20=20=20=20WHERE=20=20=
snapshot_id=20=3D=20v_snapshot_id;=0AEND;=20$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
sso_oauth_register_client=20(=0A=20=20=20=20v_client_id=20VARCHAR(128),=0A=
=20=20=20=20v_client_secret=20VARCHAR(1024),=0A=20=20=20=20v_scope=20=
VARCHAR(1024),=0A=20=20=20=20v_certificate_location=20VARCHAR(1024)=20=
DEFAULT=20NULL,=0A=20=20=20=20v_callback_prefix=20VARCHAR(1024)=20=
DEFAULT=20NULL,=0A=20=20=20=20v_description=20TEXT=20DEFAULT=20'oVirt=20=
Engine',=0A=20=20=20=20v_email=20VARCHAR(256)=20DEFAULT=20'',=0A=20=20=20=
=20v_trusted=20BOOLEAN=20DEFAULT=20TRUE,=0A=20=20=20=20=
v_notification_callback=20VARCHAR(1024)=20DEFAULT=20NULL,=0A=20=20=20=20=
v_notification_callback_protocol=20VARCHAR(32)=20DEFAULT=20'TLSv1',=0A=20=
=20=20=20v_notification_callback_verify_host=20BOOLEAN=20DEFAULT=20TRUE,=0A=
=20=20=20=20v_notification_callback_verify_chain=20BOOLEAN=20DEFAULT=20=
TRUE=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=
=20=20=20--=20Adding=20the=20sso=20client=0A=20=20=20=20INSERT=20INTO=20=
sso_clients=20(=0A=20=20=20=20=20=20=20=20client_id,=0A=20=20=20=20=20=20=
=20=20client_secret,=0A=20=20=20=20=20=20=20=20scope,=0A=20=20=20=20=20=20=
=20=20certificate_location,=0A=20=20=20=20=20=20=20=20callback_prefix,=0A=
=20=20=20=20=20=20=20=20description,=0A=20=20=20=20=20=20=20=20email,=0A=20=
=20=20=20=20=20=20=20trusted,=0A=20=20=20=20=20=20=20=20=
notification_callback,=0A=20=20=20=20=20=20=20=20=
notification_callback_protocol,=0A=20=20=20=20=20=20=20=20=
notification_callback_verify_host,=0A=20=20=20=20=20=20=20=20=
notification_callback_verify_chain=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_client_id,=0A=20=20=20=20=20=20=
=20=20v_client_secret,=0A=20=20=20=20=20=20=20=20v_scope,=0A=20=20=20=20=20=
=20=20=20v_certificate_location,=0A=20=20=20=20=20=20=20=20=
v_callback_prefix,=0A=20=20=20=20=20=20=20=20v_description,=0A=20=20=20=20=
=20=20=20=20v_email,=0A=20=20=20=20=20=20=20=20v_trusted,=0A=20=20=20=20=20=
=20=20=20v_notification_callback,=0A=20=20=20=20=20=20=20=20=
v_notification_callback_protocol,=0A=20=20=20=20=20=20=20=20=
v_notification_callback_verify_host,=0A=20=20=20=20=20=20=20=20=
v_notification_callback_verify_chain=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20sso_oauth_unregister_client=20(v_client_id=20=
VARCHAR(128))=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20=
--=20Removing=20the=20sso=20client=0A=20=20=20=20DELETE=0A=20=20=20=20=
FROM=20sso_clients=0A=20=20=20=20WHERE=20client_id=20=3D=20v_client_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20sso_oauth_client_exists=20(v_client_id=20=
VARCHAR(128))=0ARETURNS=20SETOF=20INT=20IMMUTABLE=20AS=20$PROCEDURE$=0A=0A=
BEGIN=0A=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20sso_clients=0A=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20client_id=20=3D=20v_client_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=
RETURN=20QUERY=0A=20=20=20=20=20=20=20=20SELECT=201;=0A=20=20=20=20ELSE=0A=
=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=20=20=20=20=20=20=20=20=
SELECT=200;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20get_oauth_client=20=
(v_client_id=20VARCHAR(128))=0ARETURNS=20SETOF=20sso_clients=20STABLE=20=
AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20*=0A=20=20=20=20FROM=20sso_clients=0A=20=20=20=20WHERE=20=
client_id=20=3D=20v_client_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20update_oauth_client=20(=0A=
=20=20=20=20v_client_id=20VARCHAR(128),=0A=20=20=20=20v_scope=20=
VARCHAR(1024),=0A=20=20=20=20v_certificate_location=20VARCHAR(1024)=20=
DEFAULT=20NULL,=0A=20=20=20=20v_callback_prefix=20VARCHAR(1024)=20=
DEFAULT=20NULL,=0A=20=20=20=20v_description=20TEXT=20DEFAULT=20'oVirt=20=
Engine',=0A=20=20=20=20v_email=20VARCHAR(256)=20DEFAULT=20'',=0A=20=20=20=
=20v_trusted=20BOOLEAN=20DEFAULT=20TRUE,=0A=20=20=20=20=
v_notification_callback=20VARCHAR(1024)=20DEFAULT=20NULL=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=20=20=20UPDATE=20=
sso_clients=0A=20=20=20=20SET=20scope=20=3D=20v_scope,=0A=20=20=20=20=20=20=
=20=20certificate_location=20=3D=20v_certificate_location,=0A=20=20=20=20=
=20=20=20=20callback_prefix=20=3D=20v_callback_prefix,=0A=20=20=20=20=20=20=
=20=20description=20=3D=20v_description,=0A=20=20=20=20=20=20=20=20email=20=
=3D=20v_email,=0A=20=20=20=20=20=20=20=20trusted=20=3D=20v_trusted,=0A=20=
=20=20=20=20=20=20=20notification_callback=20=3D=20=
v_notification_callback=0A=20=20=20=20WHERE=20client_id=20=3D=20=
v_client_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
update_oauth_client_callback_prefix=20(=0A=20=20=20=20v_client_id=20=
VARCHAR(128),=0A=20=20=20=20v_callback_prefix=20VARCHAR(1024)=20DEFAULT=20=
NULL=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=0ABEGIN=0A=20=
=20=20=20UPDATE=20sso_clients=0A=20=20=20=20SET=20callback_prefix=20=3D=20=
v_callback_prefix=0A=20=20=20=20WHERE=20client_id=20=3D=20v_client_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0A/*=20=
----------------------------------------------------------------=0A=20=
Stored=20procedures=20for=20database=20operations=20on=20Storage=20=
Device=0A=20related=20table:=20storage_device=0A=
----------------------------------------------------------------*/=0A=
CREATE=20OR=20REPLACE=20FUNCTION=20InsertStorageDevice=20(=0A=20=20=20=20=
v_id=20UUID,=0A=20=20=20=20v_name=20TEXT,=0A=20=20=20=20v_device_uuid=20=
VARCHAR(38),=0A=20=20=20=20v_filesystem_uuid=20VARCHAR(38),=0A=20=20=20=20=
v_vds_id=20UUID,=0A=20=20=20=20v_description=20TEXT,=0A=20=20=20=20=
v_device_type=20VARCHAR(50),=0A=20=20=20=20v_device_path=20TEXT,=0A=20=20=
=20=20v_filesystem_type=20VARCHAR(50),=0A=20=20=20=20v_mount_point=20=
TEXT,=0A=20=20=20=20v_size=20BIGINT,=0A=20=20=20=20v_is_free=20BOOLEAN,=0A=
=20=20=20=20v_is_gluster_brick=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
storage_device=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20=
name,=0A=20=20=20=20=20=20=20=20device_uuid,=0A=20=20=20=20=20=20=20=20=
filesystem_uuid,=0A=20=20=20=20=20=20=20=20vds_id,=0A=20=20=20=20=20=20=20=
=20description,=0A=20=20=20=20=20=20=20=20device_type,=0A=20=20=20=20=20=20=
=20=20device_path,=0A=20=20=20=20=20=20=20=20filesystem_type,=0A=20=20=20=
=20=20=20=20=20mount_point,=0A=20=20=20=20=20=20=20=20size,=0A=20=20=20=20=
=20=20=20=20is_free,=0A=20=20=20=20=20=20=20=20is_gluster_brick=0A=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_id,=0A=20=20=20=20=20=20=20=20v_name,=0A=20=20=20=20=20=20=20=20=
v_device_uuid,=0A=20=20=20=20=20=20=20=20v_filesystem_uuid,=0A=20=20=20=20=
=20=20=20=20v_vds_id,=0A=20=20=20=20=20=20=20=20v_description,=0A=20=20=20=
=20=20=20=20=20v_device_type,=0A=20=20=20=20=20=20=20=20v_device_path,=0A=
=20=20=20=20=20=20=20=20v_filesystem_type,=0A=20=20=20=20=20=20=20=20=
v_mount_point,=0A=20=20=20=20=20=20=20=20v_size,=0A=20=20=20=20=20=20=20=20=
v_is_free,=0A=20=20=20=20=20=20=20=20v_is_gluster_brick=0A=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateStorageDevice=20(=0A=
=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_name=20TEXT,=0A=20=20=20=20=
v_device_uuid=20VARCHAR(38),=0A=20=20=20=20v_filesystem_uuid=20=
VARCHAR(38),=0A=20=20=20=20v_description=20TEXT,=0A=20=20=20=20=
v_device_type=20VARCHAR(50),=0A=20=20=20=20v_device_path=20TEXT,=0A=20=20=
=20=20v_filesystem_type=20VARCHAR(50),=0A=20=20=20=20v_mount_point=20=
TEXT,=0A=20=20=20=20v_size=20BIGINT,=0A=20=20=20=20v_is_free=20BOOLEAN=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
UPDATE=20storage_device=0A=20=20=20=20SET=20name=20=3D=20v_name,=0A=20=20=
=20=20=20=20=20=20device_uuid=20=3D=20v_device_uuid,=0A=20=20=20=20=20=20=
=20=20filesystem_uuid=20=3D=20v_filesystem_uuid,=0A=20=20=20=20=20=20=20=20=
description=20=3D=20v_description,=0A=20=20=20=20=20=20=20=20device_type=20=
=3D=20v_device_type,=0A=20=20=20=20=20=20=20=20device_path=20=3D=20=
v_device_path,=0A=20=20=20=20=20=20=20=20filesystem_type=20=3D=20=
v_filesystem_type,=0A=20=20=20=20=20=20=20=20mount_point=20=3D=20=
v_mount_point,=0A=20=20=20=20=20=20=20=20size=20=3D=20v_size,=0A=20=20=20=
=20=20=20=20=20is_free=20=3D=20v_is_free,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetStorageDeviceById=20=
(v_id=20UUID)=0ARETURNS=20SETOF=20storage_device=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20storage_device=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetStorageDevicesByVdsId=20=
(v_vds_id=20UUID)=0ARETURNS=20SETOF=20storage_device=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20storage_device=0A=20=20=20=20WHERE=20vds_id=20=3D=20=
v_vds_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteStorageDeviceById=20=
(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20storage_device=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateIsFreeFlagById=20(=0A=
=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_is_free=20BOOLEAN=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
storage_device=0A=20=20=20=20SET=20is_free=20=3D=20v_is_free,=0A=20=20=20=
=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20=
id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertLUNs=20(=0A=20=20=20=
=20v_LUN_id=20VARCHAR(50),=0A=20=20=20=20v_physical_volume_id=20=
VARCHAR(50),=0A=20=20=20=20v_volume_group_id=20VARCHAR(50),=0A=20=20=20=20=
v_serial=20VARCHAR(4000),=0A=20=20=20=20v_lun_mapping=20INT,=0A=20=20=20=20=
v_vendor_id=20VARCHAR(50),=0A=20=20=20=20v_product_id=20VARCHAR(50),=0A=20=
=20=20=20v_device_size=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20LUNs=20(=0A=20=20=20=20=
=20=20=20=20LUN_id,=0A=20=20=20=20=20=20=20=20physical_volume_id,=0A=20=20=
=20=20=20=20=20=20volume_group_id,=0A=20=20=20=20=20=20=20=20serial,=0A=20=
=20=20=20=20=20=20=20lun_mapping,=0A=20=20=20=20=20=20=20=20vendor_id,=0A=
=20=20=20=20=20=20=20=20product_id,=0A=20=20=20=20=20=20=20=20=
device_size=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=
=20=20=20=20=20=20v_LUN_id,=0A=20=20=20=20=20=20=20=20=
v_physical_volume_id,=0A=20=20=20=20=20=20=20=20v_volume_group_id,=0A=20=20=
=20=20=20=20=20=20v_serial,=0A=20=20=20=20=20=20=20=20v_lun_mapping,=0A=20=
=20=20=20=20=20=20=20v_vendor_id,=0A=20=20=20=20=20=20=20=20=
v_product_id,=0A=20=20=20=20=20=20=20=20v_device_size=0A=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateLUNs=20(=0A=20=20=20=
=20v_LUN_id=20VARCHAR(50),=0A=20=20=20=20v_physical_volume_id=20=
VARCHAR(50),=0A=20=20=20=20v_volume_group_id=20VARCHAR(50),=0A=20=20=20=20=
v_serial=20VARCHAR(4000),=0A=20=20=20=20v_lun_mapping=20INT,=0A=20=20=20=20=
v_vendor_id=20VARCHAR(50),=0A=20=20=20=20v_product_id=20VARCHAR(50),=0A=20=
=20=20=20v_device_size=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20LUNs=0A=20=20=20=20SET=20=
LUN_id=20=3D=20v_LUN_id,=0A=20=20=20=20=20=20=20=20physical_volume_id=20=
=3D=20v_physical_volume_id,=0A=20=20=20=20=20=20=20=20volume_group_id=20=
=3D=20v_volume_group_id,=0A=20=20=20=20=20=20=20=20serial=20=3D=20=
v_serial,=0A=20=20=20=20=20=20=20=20lun_mapping=20=3D=20v_lun_mapping,=0A=
=20=20=20=20=20=20=20=20vendor_id=20=3D=20v_vendor_id,=0A=20=20=20=20=20=20=
=20=20product_id=20=3D=20v_product_id,=0A=20=20=20=20=20=20=20=20=
device_size=20=3D=20v_device_size=0A=20=20=20=20WHERE=20LUN_id=20=3D=20=
v_LUN_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteLUN=20(v_LUN_id=20=
VARCHAR(50))=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_val=20=
VARCHAR(50);=0A=0ABEGIN=0A=20=20=20=20--=20Get=20(and=20keep)=20a=20=
shared=20lock=20with=20"right=20to=20upgrade=20to=20exclusive"=0A=20=20=20=
=20--=20in=20order=20to=20force=20locking=20parent=20before=20children=0A=
=20=20=20=20SELECT=20LUN_id=0A=20=20=20=20INTO=20v_val=0A=20=20=20=20=
FROM=20LUNs=0A=20=20=20=20WHERE=20LUN_id=20=3D=20v_LUN_id=0A=20=20=20=20=
FOR=20UPDATE;=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20LUNs=0A=20=20=20=
=20WHERE=20LUN_id=20=3D=20v_LUN_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromLUNs=20=
()=0ARETURNS=20SETOF=20luns_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
luns_view;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetLUNsBystorage_server_connection=20(v_storage_server_connection=20=
VARCHAR(50))=0ARETURNS=20SETOF=20luns_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20luns_view.*=0A=
=20=20=20=20FROM=20luns_view=0A=20=20=20=20INNER=20JOIN=20=
LUN_storage_server_connection_map=0A=20=20=20=20=20=20=20=20ON=20=
LUN_storage_server_connection_map.LUN_id=20=3D=20luns_view.LUN_id=0A=20=20=
=20=20WHERE=20=
LUN_storage_server_connection_map.storage_server_connection=20=3D=20=
v_storage_server_connection;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetLUNsByVolumeGroupId=20=
(v_volume_group_id=20VARCHAR(50))=0ARETURNS=20SETOF=20luns_view=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20*=0A=20=20=20=20FROM=20luns_view=0A=20=20=20=20WHERE=20=
volume_group_id=20=3D=20v_volume_group_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetLUNByLUNId=20=
(v_LUN_id=20VARCHAR(50))=0ARETURNS=20SETOF=20luns_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20luns_view=0A=20=20=20=20WHERE=20LUN_id=20=3D=20=
v_LUN_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Insertstorage_domain_dynamic=20(=0A=20=20=20=20v_available_disk_size=20=
INT,=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_used_disk_size=20INT=0A=20=
=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
INSERT=20INTO=20storage_domain_dynamic=20(=0A=20=20=20=20=20=20=20=20=
available_disk_size,=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=
=20used_disk_size=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=
=20=20=20=20=20=20=20=20v_available_disk_size,=0A=20=20=20=20=20=20=20=20=
v_id,=0A=20=20=20=20=20=20=20=20v_used_disk_size=0A=20=20=20=20=20=20=20=20=
);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Updatestorage_domain_dynamic=20(=0A=20=20=20=20=
v_available_disk_size=20INT,=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_used_disk_size=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=
=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
storage_domain_dynamic=0A=20=20=20=20SET=20available_disk_size=20=3D=20=
v_available_disk_size,=0A=20=20=20=20=20=20=20=20used_disk_size=20=3D=20=
v_used_disk_size,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateStorageDomainExternalStatus=20(=0A=20=20=20=20v_storage_id=20UUID,=0A=
=20=20=20=20v_external_status=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20storage_domain_dynamic=0A=
=20=20=20=20SET=20external_status=20=3D=20v_external_status=0A=20=20=20=20=
WHERE=20id=20=3D=20v_storage_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Deletestorage_domain_dynamic=20(v_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
storage_domain_dynamic=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromstorage_domain_dynamic=20()=0ARETURNS=20=
SETOF=20storage_domain_dynamic=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_domain_dynamic;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_domain_dynamicByid=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
storage_domain_dynamic=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_domain_dynamic=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Insertstorage_pool_iso_map=20(=0A=20=20=20=20=
v_storage_id=20UUID,=0A=20=20=20=20v_storage_pool_id=20UUID,=0A=20=20=20=20=
v_status=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20storage_pool_iso_map=20(=0A=20=20=20=20=
=20=20=20=20storage_id,=0A=20=20=20=20=20=20=20=20storage_pool_id,=0A=20=20=
=20=20=20=20=20=20status=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_storage_id,=0A=20=20=20=20=20=20=20=
=20v_storage_pool_id,=0A=20=20=20=20=20=20=20=20v_status=0A=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Deletestorage_pool_iso_map=20(=0A=20=20=20=20v_storage_id=20UUID,=0A=20=20=
=20=20v_storage_pool_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
storage_pool_iso_map=0A=20=20=20=20WHERE=20storage_id=20=3D=20=
v_storage_id=0A=20=20=20=20=20=20=20=20AND=20storage_pool_id=20=3D=20=
v_storage_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromstorage_pool_iso_map=20()=0ARETURNS=20SETOF=20=
storage_pool_iso_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_pool_iso_map;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_pool_iso_mapBystorage_idAndBystorage_pool_id=20(=0A=20=20=20=20=
v_storage_id=20UUID,=0A=20=20=20=20v_storage_pool_id=20UUID=0A=20=20=20=20=
)=0ARETURNS=20SETOF=20storage_pool_iso_map=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20storage_pool_iso_map=0A=20=20=20=20WHERE=20storage_id=20=3D=20=
v_storage_id=0A=20=20=20=20=20=20=20=20AND=20storage_pool_id=20=3D=20=
v_storage_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_pool_iso_mapsBystorage_id=20(v_storage_id=20UUID)=0ARETURNS=20=
SETOF=20storage_pool_iso_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_pool_iso_map=0A=20=20=20=20WHERE=20storage_id=20=3D=20=
v_storage_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_pool_iso_mapsByBystorage_pool_id=20(=0A=20=20=20=20=
v_storage_id=20UUID,=0A=20=20=20=20v_storage_pool_id=20UUID=0A=20=20=20=20=
)=0ARETURNS=20SETOF=20storage_pool_iso_map=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
storage_pool_iso_map.*=0A=20=20=20=20FROM=20storage_pool_iso_map=0A=20=20=
=20=20INNER=20JOIN=20storage_domain_static=0A=20=20=20=20=20=20=20=20ON=20=
storage_pool_iso_map.storage_id=20=3D=20storage_domain_static.id=0A=20=20=
=20=20WHERE=20storage_pool_id=20=3D=20v_storage_pool_id=0A=20=20=20=20=20=
=20=20=20AND=20storage_domain_static.storage_type=20!=3D=209;--=20filter=20=
Cinder=20storage=20domains=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Updatestorage_pool_iso_map_status=20(=0A=20=20=20=20v_storage_id=20UUID,=0A=
=20=20=20=20v_storage_pool_id=20UUID,=0A=20=20=20=20v_status=20INT=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
storage_pool_iso_map=0A=20=20=20=20SET=20status=20=3D=20v_status=0A=20=20=
=20=20WHERE=20storage_pool_id=20=3D=20v_storage_pool_id=0A=20=20=20=20=20=
=20=20=20AND=20storage_id=20=3D=20v_storage_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Insertstorage_server_connections=20(=0A=20=20=20=20v_connection=20=
VARCHAR(250),=0A=20=20=20=20v_id=20VARCHAR(50),=0A=20=20=20=20v_iqn=20=
VARCHAR(128),=0A=20=20=20=20v_port=20VARCHAR(50),=0A=20=20=20=20v_portal=20=
VARCHAR(50),=0A=20=20=20=20v_password=20TEXT,=0A=20=20=20=20=
v_storage_type=20INT,=0A=20=20=20=20v_user_name=20TEXT,=0A=20=20=20=20=
v_mount_options=20VARCHAR(500),=0A=20=20=20=20v_vfs_type=20VARCHAR(128),=0A=
=20=20=20=20v_nfs_version=20VARCHAR(4),=0A=20=20=20=20v_nfs_timeo=20=
SMALLINT,=0A=20=20=20=20v_nfs_retrans=20SMALLINT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
storage_server_connections=20(=0A=20=20=20=20=20=20=20=20connection,=0A=20=
=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20iqn,=0A=20=20=20=20=20=
=20=20=20port,=0A=20=20=20=20=20=20=20=20portal,=0A=20=20=20=20=20=20=20=20=
password,=0A=20=20=20=20=20=20=20=20storage_type,=0A=20=20=20=20=20=20=20=
=20user_name,=0A=20=20=20=20=20=20=20=20mount_options,=0A=20=20=20=20=20=20=
=20=20vfs_type,=0A=20=20=20=20=20=20=20=20nfs_version,=0A=20=20=20=20=20=20=
=20=20nfs_timeo,=0A=20=20=20=20=20=20=20=20nfs_retrans=0A=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_connection,=0A=
=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20v_iqn,=0A=20=20=20=
=20=20=20=20=20v_port,=0A=20=20=20=20=20=20=20=20v_portal,=0A=20=20=20=20=
=20=20=20=20v_password,=0A=20=20=20=20=20=20=20=20v_storage_type,=0A=20=20=
=20=20=20=20=20=20v_user_name,=0A=20=20=20=20=20=20=20=20=
v_mount_options,=0A=20=20=20=20=20=20=20=20v_vfs_type,=0A=20=20=20=20=20=20=
=20=20v_nfs_version,=0A=20=20=20=20=20=20=20=20v_nfs_timeo,=0A=20=20=20=20=
=20=20=20=20v_nfs_retrans=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Updatestorage_server_connections=20(=0A=20=20=20=20v_connection=20=
VARCHAR(250),=0A=20=20=20=20v_id=20VARCHAR(50),=0A=20=20=20=20v_iqn=20=
VARCHAR(128),=0A=20=20=20=20v_password=20TEXT,=0A=20=20=20=20=
v_storage_type=20INT,=0A=20=20=20=20v_port=20VARCHAR(50),=0A=20=20=20=20=
v_portal=20VARCHAR(50),=0A=20=20=20=20v_user_name=20TEXT,=0A=20=20=20=20=
v_mount_options=20VARCHAR(500),=0A=20=20=20=20v_vfs_type=20VARCHAR(128),=0A=
=20=20=20=20v_nfs_version=20VARCHAR(4),=0A=20=20=20=20v_nfs_timeo=20=
SMALLINT,=0A=20=20=20=20v_nfs_retrans=20SMALLINT=0A=20=20=20=20)=0A=
RETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20UPDATE=20storage_server_connections=0A=20=20=20=20SET=20=
connection=20=3D=20v_connection,=0A=20=20=20=20=20=20=20=20iqn=20=3D=20=
v_iqn,=0A=20=20=20=20=20=20=20=20password=20=3D=20v_password,=0A=20=20=20=
=20=20=20=20=20port=20=3D=20v_port,=0A=20=20=20=20=20=20=20=20portal=20=3D=
=20v_portal,=0A=20=20=20=20=20=20=20=20storage_type=20=3D=20=
v_storage_type,=0A=20=20=20=20=20=20=20=20user_name=20=3D=20v_user_name,=0A=
=20=20=20=20=20=20=20=20mount_options=20=3D=20v_mount_options,=0A=20=20=20=
=20=20=20=20=20vfs_type=20=3D=20v_vfs_type,=0A=20=20=20=20=20=20=20=20=
nfs_version=20=3D=20v_nfs_version,=0A=20=20=20=20=20=20=20=20nfs_timeo=20=
=3D=20v_nfs_timeo,=0A=20=20=20=20=20=20=20=20nfs_retrans=20=3D=20=
v_nfs_retrans=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Deletestorage_server_connections=20(v_id=20VARCHAR(50))=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ADECLARE=20v_val=20VARCHAR(50);=0A=0ABEGIN=0A=20=20=20=20=
--=20Get=20(and=20keep)=20a=20shared=20lock=20with=20"right=20to=20=
upgrade=20to=20exclusive"=0A=20=20=20=20--=20in=20order=20to=20force=20=
locking=20parent=20before=20children=0A=20=20=20=20SELECT=20id=0A=20=20=20=
=20INTO=20v_val=0A=20=20=20=20FROM=20storage_server_connections=0A=20=20=20=
=20WHERE=20id=20=3D=20v_id=0A=20=20=20=20FOR=20UPDATE;=0A=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20storage_server_connections=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_server_connectionsByid=20(v_id=20VARCHAR(50))=0ARETURNS=20=
SETOF=20storage_server_connections=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20storage_server_connections=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Getstorage_server_connectionsByConnection=20=
(v_connection=20VARCHAR(250))=0ARETURNS=20SETOF=20=
storage_server_connections=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_server_connections=0A=20=20=20=20WHERE=20connection=20=3D=20=
v_connection;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_server_connectionsByIqn=20(v_iqn=20VARCHAR(128))=0ARETURNS=20=
SETOF=20storage_server_connections=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20storage_server_connections=0A=20=20=20=20WHERE=20iqn=20=3D=20=
v_iqn=0A=20=20=20=20=20=20=20=20OR=20iqn=20IS=20NULL=0A=20=20=20=20=20=20=
=20=20AND=20v_iqn=20IS=20NULL;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_server_connectionsByIqnAndConnection=20(=0A=20=20=20=20v_iqn=20=
VARCHAR(128),=0A=20=20=20=20v_connection=20VARCHAR(250)=0A=20=20=20=20)=0A=
RETURNS=20SETOF=20storage_server_connections=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20storage_server_connections=0A=20=20=20=20WHERE=20iqn=20=3D=20=
v_iqn=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20connection=20=3D=20v_connection=0A=20=20=20=20=20=20=20=20=20=20=20=20=
OR=20connection=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Getstorage_server_connectionsByKey=20(=0A=20=20=20=20=
v_iqn=20VARCHAR(128),=0A=20=20=20=20v_connection=20VARCHAR(250),=0A=20=20=
=20=20v_port=20VARCHAR(50),=0A=20=20=20=20v_portal=20VARCHAR(50),=0A=20=20=
=20=20v_username=20VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
storage_server_connections=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_server_connections=0A=20=20=20=20WHERE=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20iqn=20=3D=20v_iqn=0A=20=20=20=20=20=20=20=20=20=20=20=20=
OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20iqn=20IS=20NULL=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20v_iqn=20IS=20NULL=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20AND=20(connection=20=3D=20=
v_connection)=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20port=20=3D=20v_port=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20port=20IS=20NULL=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20v_port=20IS=20NULL=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20portal=20=3D=20v_portal=0A=20=20=20=20=20=20=20=20=20=20=20=20=
OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20portal=20IS=20=
NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20v_portal=20=
IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20user_name=20=3D=20v_username=0A=20=20=20=20=20=
=20=20=20=20=20=20=20OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20user_name=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20v_username=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_server_connectionsByStorageType=20(v_storage_type=20INT)=0A=
RETURNS=20SETOF=20storage_server_connections=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20storage_server_connections=0A=20=20=20=20WHERE=20storage_type=20=
=3D=20v_storage_type;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllstorage_server_connections=20()=0ARETURNS=20SETOF=20=
storage_server_connections=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_server_connections;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetStorageServerConnectionsByIds=20(v_ids=20TEXT)=0ARETURNS=20SETOF=20=
storage_server_connections=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_server_connections=0A=20=20=20=20WHERE=20id=20=3D=20ANY=20=
(string_to_array(v_ids,=20',')::VARCHAR=20[]);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_server_connectionsByVolumeGroupId=20(v_volume_group_id=20=
VARCHAR(50))=0ARETURNS=20SETOF=20storage_server_connections=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20DISTINCT=20storage_server_connections.*=0A=20=20=20=20FROM=20=
LUN_storage_server_connection_map=20LUN_storage_server_connection_map=0A=20=
=20=20=20INNER=20JOIN=20LUNs=0A=20=20=20=20=20=20=20=20ON=20=
LUN_storage_server_connection_map.LUN_id=20=3D=20LUNs.LUN_id=0A=20=20=20=20=
INNER=20JOIN=20storage_domain_static=0A=20=20=20=20=20=20=20=20ON=20=
LUNs.volume_group_id=20=3D=20storage_domain_static.storage=0A=20=20=20=20=
INNER=20JOIN=20storage_server_connections=0A=20=20=20=20=20=20=20=20ON=20=
LUN_storage_server_connection_map.storage_server_connection=20=3D=20=
storage_server_connections.id=0A=20=20=20=20WHERE=20=
(storage_domain_static.storage=20=3D=20v_volume_group_id);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetStorageConnectionsByStorageTypeAndStatus=20(=0A=20=
=20=20=20v_storage_pool_id=20UUID,=0A=20=20=20=20v_storage_type=20INT,=0A=
=20=20=20=20v_statuses=20VARCHAR(20)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
storage_server_connections=20STABLE=20AS=20$PROCEDURE$=0ADECLARE=20=
statuses=20INT=20[];=0A=0ABEGIN=0A=20=20=20=20statuses=20:=3D=20=
string_to_array(v_statuses,=20',')::INT=20[];=0A=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_server_connections=0A=20=20=20=20WHERE=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20v_storage_type=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=
=20=20OR=20storage_server_connections.storage_type=20=3D=20=
v_storage_type=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=
=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20id=20IN=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20storage=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20storage_domains=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20storage_domains.storage_pool_id=20=
=3D=20v_storage_pool_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20storage_domains.status=20=3D=20ANY=20(statuses)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=
=20=20=20OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20id=20=
IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20lun_storage_server_connection_map.storage_server_connection=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
lun_storage_server_connection_map=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20INNER=20JOIN=20luns=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
lun_storage_server_connection_map.lun_id=20=3D=20luns.lun_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20INNER=20JOIN=20=
storage_domains=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20ON=20luns.volume_group_id=20=3D=20storage_domains.storage=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20storage_domains.storage_pool_id=20=3D=20v_storage_pool_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20storage_domains.status=20=3D=20ANY=20(statuses)=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=
=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_server_connectionsByLunId=20(v_lunId=20VARCHAR(50))=0ARETURNS=20=
SETOF=20storage_server_connections=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
storage_server_connections.*=0A=20=20=20=20FROM=20=
storage_server_connections=20storage_server_connections=0A=20=20=20=20=
INNER=20JOIN=20lun_storage_server_connection_map=0A=20=20=20=20=20=20=20=20=
ON=20lun_storage_server_connection_map.storage_server_connection=20=3D=20=
storage_server_connections.id=0A=20=20=20=20WHERE=20=
(lun_storage_server_connection_map.lun_id=20=3D=20v_lunId);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertLUN_storage_server_connection_map=20(=0A=20=20=
=20=20v_LUN_id=20VARCHAR(50),=0A=20=20=20=20v_storage_server_connection=20=
VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20INSERT=20INTO=20LUN_storage_server_connection_map=20(=0A=20=20=
=20=20=20=20=20=20LUN_id,=0A=20=20=20=20=20=20=20=20=
storage_server_connection=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_LUN_id,=0A=20=20=20=20=20=20=20=20=
v_storage_server_connection=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateLUN_storage_server_connection_map=20(=0A=20=20=
=20=20v_LUN_id=20VARCHAR(50),=0A=20=20=20=20v_storage_server_connection=20=
VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20=
AS=20$PROCEDURE$=0ABEGIN=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteLUN_storage_server_connection_map=20(=0A=20=20=20=20v_LUN_id=20=
VARCHAR(50),=0A=20=20=20=20v_storage_server_connection=20VARCHAR(50)=0A=20=
=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20LUN_storage_server_connection_map=0A=20=20=20=
=20WHERE=20LUN_id=20=3D=20v_LUN_id=0A=20=20=20=20=20=20=20=20AND=20=
storage_server_connection=20=3D=20v_storage_server_connection;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromLUN_storage_server_connection_map=20()=0A=
RETURNS=20SETOF=20LUN_storage_server_connection_map=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20LUN_storage_server_connection_map=20=
lUN_storage_server_connection_map;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetLUN_storage_server_connection_mapByLUN=20(=0A=20=20=20=20v_LUN_id=20=
VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
LUN_storage_server_connection_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
LUN_storage_server_connection_map=20lUN_storage_server_connection_map=0A=20=
=20=20=20WHERE=20LUN_id=20=3D=20v_LUN_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetLUN_storage_server_connection_mapByLUNBystorage_server_conn=20(=0A=20=20=
=20=20v_LUN_id=20VARCHAR(50),=0A=20=20=20=20v_storage_server_connection=20=
VARCHAR(50)=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
LUN_storage_server_connection_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
LUN_storage_server_connection_map=20lUN_storage_server_connection_map=0A=20=
=20=20=20WHERE=20LUN_id=20=3D=20v_LUN_id=0A=20=20=20=20=20=20=20=20AND=20=
storage_server_connection=20=3D=20v_storage_server_connection;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertStorageServerConnectionExtension=20(=0A=20=20=20=
=20v_id=20UUID,=0A=20=20=20=20v_vds_id=20UUID,=0A=20=20=20=20v_iqn=20=
VARCHAR(128),=0A=20=20=20=20v_user_name=20TEXT,=0A=20=20=20=20v_password=20=
TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20INSERT=20INTO=20storage_server_connection_extension=20(=0A=20=20=20=
=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20vds_id,=0A=20=20=20=20=20=20=
=20=20iqn,=0A=20=20=20=20=20=20=20=20user_name,=0A=20=20=20=20=20=20=20=20=
password=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=
=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20v_vds_id,=0A=20=20=20=20=20=
=20=20=20v_iqn,=0A=20=20=20=20=20=20=20=20v_user_name,=0A=20=20=20=20=20=20=
=20=20v_password=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateStorageServerConnectionExtension=20(=0A=20=20=20=20v_id=20UUID,=0A=20=
=20=20=20v_vds_id=20UUID,=0A=20=20=20=20v_iqn=20VARCHAR(128),=0A=20=20=20=
=20v_user_name=20TEXT,=0A=20=20=20=20v_password=20TEXT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
storage_server_connection_extension=0A=20=20=20=20SET=20vds_id=20=3D=20=
v_vds_id,=0A=20=20=20=20=20=20=20=20iqn=20=3D=20v_iqn,=0A=20=20=20=20=20=20=
=20=20user_name=20=3D=20v_user_name,=0A=20=20=20=20=20=20=20=20password=20=
=3D=20v_password=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteStorageServerConnectionExtension=20(v_id=20=
UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=
=20=20=20=20FROM=20storage_server_connection_extension=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetStorageServerConnectionExtensionById=20(v_id=20UUID)=0ARETURNS=20=
SETOF=20storage_server_connection_extension=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20storage_server_connection_extension=0A=20=20=20=20WHERE=20id=20=
=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetStorageServerConnectionExtensionsByHostId=20(v_vds_id=20UUID)=0A=
RETURNS=20SETOF=20storage_server_connection_extension=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20storage_server_connection_extension=0A=20=20=20=20=
WHERE=20vds_id=20=3D=20v_vds_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetStorageServerConnectionExtensionsByHostIdAndTarget=20(=0A=20=20=20=20=
v_vds_id=20UUID,=0A=20=20=20=20v_iqn=20VARCHAR(128)=0A=20=20=20=20)=0A=
RETURNS=20SETOF=20storage_server_connection_extension=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20storage_server_connection_extension=0A=20=20=20=20=
WHERE=20vds_id=20=3D=20v_vds_id=0A=20=20=20=20=20=20=20=20AND=20iqn=20=3D=20=
v_iqn;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromStorageServerConnectionExtensions=20()=0ARETURNS=20SETOF=20=
storage_server_connection_extension=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20storage_server_connection_extension;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Insertstorage_pool=20(=0A=20=20=20=20v_description=20VARCHAR(4000),=0A=20=
=20=20=20v_free_text_comment=20TEXT,=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=
=20v_name=20VARCHAR(40),=0A=20=20=20=20v_status=20INT,=0A=20=20=20=20=
v_is_local=20BOOLEAN,=0A=20=20=20=20v_master_domain_version=20INT,=0A=20=20=
=20=20v_spm_vds_id=20UUID,=0A=20=20=20=20v_compatibility_version=20=
VARCHAR(40),=0A=20=20=20=20v_quota_enforcement_type=20INT,=0A=20=20=20=20=
v_mac_pool_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20storage_pool=20(=0A=20=20=20=20=20=20=
=20=20description,=0A=20=20=20=20=20=20=20=20free_text_comment,=0A=20=20=20=
=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=
=20status,=0A=20=20=20=20=20=20=20=20is_local,=0A=20=20=20=20=20=20=20=20=
master_domain_version,=0A=20=20=20=20=20=20=20=20spm_vds_id,=0A=20=20=20=20=
=20=20=20=20compatibility_version,=0A=20=20=20=20=20=20=20=20=
quota_enforcement_type,=0A=20=20=20=20=20=20=20=20mac_pool_id=0A=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_description,=0A=20=20=20=20=20=20=20=20v_free_text_comment,=0A=20=20=20=
=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20v_name,=0A=20=20=20=20=20=20=
=20=20v_status,=0A=20=20=20=20=20=20=20=20v_is_local,=0A=20=20=20=20=20=20=
=20=20v_master_domain_version,=0A=20=20=20=20=20=20=20=20v_spm_vds_id,=0A=
=20=20=20=20=20=20=20=20v_compatibility_version,=0A=20=20=20=20=20=20=20=20=
v_quota_enforcement_type,=0A=20=20=20=20=20=20=20=20v_mac_pool_id=0A=20=20=
=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Updatestorage_pool=20(=0A=
=20=20=20=20v_description=20VARCHAR(4000),=0A=20=20=20=20=
v_free_text_comment=20TEXT,=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_name=20VARCHAR(40),=0A=20=20=20=20v_status=20INT,=0A=20=20=20=20=
v_is_local=20BOOLEAN,=0A=20=20=20=20v_storage_pool_format_type=20=
VARCHAR(50),=0A=20=20=20=20v_master_domain_version=20INT,=0A=20=20=20=20=
v_spm_vds_id=20UUID,=0A=20=20=20=20v_compatibility_version=20=
VARCHAR(40),=0A=20=20=20=20v_quota_enforcement_type=20INT,=0A=20=20=20=20=
v_mac_pool_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=
=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20storage_pool=0A=20=
=20=20=20SET=20description=20=3D=20v_description,=0A=20=20=20=20=20=20=20=
=20free_text_comment=20=3D=20v_free_text_comment,=0A=20=20=20=20=20=20=20=
=20name=20=3D=20v_name,=0A=20=20=20=20=20=20=20=20is_local=20=3D=20=
v_is_local,=0A=20=20=20=20=20=20=20=20status=20=3D=20v_status,=0A=20=20=20=
=20=20=20=20=20storage_pool_format_type=20=3D=20=
v_storage_pool_format_type,=0A=20=20=20=20=20=20=20=20=
master_domain_version=20=3D=20v_master_domain_version,=0A=20=20=20=20=20=20=
=20=20spm_vds_id=20=3D=20v_spm_vds_id,=0A=20=20=20=20=20=20=20=20=
compatibility_version=20=3D=20v_compatibility_version,=0A=20=20=20=20=20=20=
=20=20_update_date=20=3D=20LOCALTIMESTAMP,=0A=20=20=20=20=20=20=20=20=
quota_enforcement_type=20=3D=20v_quota_enforcement_type,=0A=20=20=20=20=20=
=20=20=20mac_pool_id=20=3D=20v_mac_pool_id=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Updatestorage_pool_partial=20(=0A=20=20=20=20v_description=20=
VARCHAR(4000),=0A=20=20=20=20v_free_text_comment=20TEXT,=0A=20=20=20=20=
v_id=20UUID,=0A=20=20=20=20v_name=20VARCHAR(40),=0A=20=20=20=20=
v_is_local=20BOOLEAN,=0A=20=20=20=20v_storage_pool_format_type=20=
VARCHAR(50),=0A=20=20=20=20v_compatibility_version=20VARCHAR(40),=0A=20=20=
=20=20v_quota_enforcement_type=20INT,=0A=20=20=20=20v_mac_pool_id=20UUID=0A=
=20=20=20=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20storage_pool=0A=20=20=20=20=
SET=20description=20=3D=20v_description,=0A=20=20=20=20=20=20=20=20=
free_text_comment=20=3D=20v_free_text_comment,=0A=20=20=20=20=20=20=20=20=
name=20=3D=20v_name,=0A=20=20=20=20=20=20=20=20is_local=20=3D=20=
v_is_local,=0A=20=20=20=20=20=20=20=20storage_pool_format_type=20=3D=20=
v_storage_pool_format_type,=0A=20=20=20=20=20=20=20=20=
compatibility_version=20=3D=20v_compatibility_version,=0A=20=20=20=20=20=20=
=20=20_update_date=20=3D=20LOCALTIMESTAMP,=0A=20=20=20=20=20=20=20=20=
quota_enforcement_type=20=3D=20v_quota_enforcement_type,=0A=20=20=20=20=20=
=20=20=20mac_pool_id=20=3D=20v_mac_pool_id=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Updatestorage_pool_status=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_status=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20UPDATE=20storage_pool=0A=20=20=20=20SET=20status=20=3D=
=20v_status,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
LOCALTIMESTAMP=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
IncreaseStoragePoolMasterVersion=20(v_id=20UUID)=0ARETURNS=20INT=20AS=20=
$PROCEDURE$=0ADECLARE=20v_master_domain_version=20INT;=0A=0ABEGIN=0A=20=20=
=20=20UPDATE=20storage_pool=0A=20=20=20=20SET=20master_domain_version=20=
=3D=20master_domain_version=20+=201=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id=20RETURNING=20master_domain_version=0A=20=20=20=20INTO=20=
v_master_domain_version;=0A=0A=20=20=20=20RETURN=20=
v_master_domain_version;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Deletestorage_pool=20=
(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_val=20=
UUID;=0A=0ABEGIN=0A=20=20=20=20--=20Get=20(and=20keep)=20a=20shared=20=
lock=20with=20"right=20to=20upgrade=20to=20exclusive"=0A=20=20=20=20=
SELECT=20vm_guid=0A=20=20=20=20INTO=20v_val=0A=20=20=20=20FROM=20=
vm_static=0A=20=20=20=20WHERE=20vm_guid=20IN=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=20vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vms=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20storage_pool_id=20=3D=20=
v_id=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20FOR=0A=0A=20=20=
=20=20UPDATE;=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20snapshots=0A=20=
=20=20=20WHERE=20vm_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vms=0A=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20storage_pool_id=20=3D=20v_id=0A=20=20=
=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20DELETE=0A=20=20=20=20=
FROM=20vm_static=0A=20=20=20=20WHERE=20vm_guid=20IN=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=20vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20vms=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
storage_pool_id=20=3D=20v_id=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=
=20=20=20=20--=20Delete=20vm=20pools=20as=20empty=20pools=20are=20not=20=
supported=0A=20=20=20=20--=20Get=20(and=20keep)=20a=20shared=20lock=20=
with=20"right=20to=20upgrade=20to=20exclusive"=0A=20=20=20=20SELECT=20=
vm_pool_id=0A=20=20=20=20INTO=20v_val=0A=20=20=20=20FROM=20vm_pools=0A=20=
=20=20=20WHERE=20vm_pool_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20vm_pool_id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vm_pools_view=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
storage_pool_id=20=3D=20v_id=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20FOR=0A=0A=20=20=20=20UPDATE;=0A=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20vm_pools=0A=20=20=20=20WHERE=20vm_pool_id=20IN=20(=0A=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=20vm_pool_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20vm_pools_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20storage_pool_id=20=3D=20v_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=0A=20=20=20=20--=20Get=20(and=20keep)=20a=20shared=20lock=20with=20=
"right=20to=20upgrade=20to=20exclusive"=0A=20=20=20=20--=20in=20order=20=
to=20force=20locking=20parent=20before=20children=0A=20=20=20=20SELECT=20=
id=0A=20=20=20=20INTO=20v_val=0A=20=20=20=20FROM=20storage_pool=0A=20=20=20=
=20WHERE=20id=20=3D=20v_id=0A=20=20=20=20FOR=0A=0A=20=20=20=20UPDATE;=0A=0A=
=20=20=20=20DELETE=0A=20=20=20=20FROM=20storage_pool=0A=20=20=20=20WHERE=20=
id=20=3D=20v_id;=0A=0A=20=20=20=20--=20delete=20StoragePool=20=
permissions=20--=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20permissions=0A=
=20=20=20=20WHERE=20object_id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromstorage_pool=20(=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20=
v_is_filtered=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20storage_pool=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20storage_pool=0A=20=20=20=20WHERE=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=
=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20user_storage_pool_permissions_view=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20id=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=
=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllByStatus=20=
(v_status=20INT)=0ARETURNS=20SETOF=20storage_pool=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20storage_pool=0A=20=20=20=20WHERE=20status=20=3D=20=
v_status;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Getstorage_poolByid=20(=0A=
=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20=
v_is_filtered=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20storage_pool=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20storage_pool=0A=20=20=20=20WHERE=20=
id=20=3D=20v_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20=
OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
1=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_storage_pool_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20v_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Getstorage_poolByName=20=
(=0A=20=20=20=20v_name=20VARCHAR(40),=0A=20=20=20=20v_is_case_sensitive=20=
BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20storage_pool=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20storage_pool=0A=20=20=20=20WHERE=20name=20=3D=20=
v_name=0A=20=20=20=20=20=20=20=20OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20NOT=20v_is_case_sensitive=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
name=20ilike=20v_name=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Getstorage_poolsByStorageDomainId=20=
(v_storage_domain_id=20UUID)=0ARETURNS=20SETOF=20storage_pool=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20storage_pool.*=0A=20=20=20=20FROM=20storage_pool=0A=20=20=20=20=
INNER=20JOIN=20storage_pool_iso_map=0A=20=20=20=20=20=20=20=20ON=20=
storage_pool.id=20=3D=20storage_pool_iso_map.storage_pool_id=0A=20=20=20=20=
WHERE=20storage_pool_iso_map.storage_id=20=3D=20v_storage_domain_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVmAndTemplatesIdsByStorageDomainId=20(=0A=20=20=20=
=20v_storage_domain_id=20UUID,=0A=20=20=20=20v_include_shareable=20=
BOOLEAN,=0A=20=20=20=20v_active_only=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20UUID=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20DISTINCT=20vd.vm_id=0A=20=20=20=20FROM=20=
vm_device=20vd=0A=20=20=20=20INNER=20JOIN=20images_storage_domain_view=20=
i=0A=20=20=20=20=20=20=20=20ON=20i.image_group_id=20=3D=20vd.device_id=0A=
=20=20=20=20WHERE=20i.storage_id=20=3D=20v_storage_domain_id=0A=20=20=20=20=
=20=20=20=20AND=20i.active=20=3D=20v_active_only=0A=20=20=20=20=20=20=20=20=
AND=20i.shareable=20=3D=20v_include_shareable;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_poolsByVdsId=20(v_vdsId=20UUID)=0ARETURNS=20SETOF=20=
storage_pool=20STABLE=20AS=20$PROCEDURE$=0ADECLARE=20v_clusterId=20UUID;=0A=
=0ABEGIN=0A=20=20=20=20SELECT=20cluster_id=0A=20=20=20=20INTO=20=
v_clusterId=0A=20=20=20=20FROM=20Vds_static=0A=20=20=20=20WHERE=20vds_id=20=
=3D=20v_vdsId;=0A=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20storage_pool=0A=20=20=20=20WHERE=20=
storage_pool.id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
storage_pool_id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20cluster=0A=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20cluster_id=20=3D=20v_clusterId=0A=
=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_poolsByClusterId=20(v_clusterId=20UUID)=0ARETURNS=20SETOF=20=
storage_pool=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20storage_pool=0A=20=
=20=20=20WHERE=20storage_pool.id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=20storage_pool_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20cluster=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20cluster_id=20=
=3D=20v_clusterId=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20LoadStorageDomainInfoByDomainId=20=
(v_storage_domain_id=20UUID)=0ARETURNS=20SETOF=20=
storage_domains_ovf_info=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_domains_ovf_info=20ovf=0A=20=20=20=20WHERE=20=
ovf.storage_domain_id=20=3D=20v_storage_domain_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
LoadStorageDomainInfoByDiskId=20(v_disk_id=20UUID)=0ARETURNS=20SETOF=20=
storage_domains_ovf_info=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_domains_ovf_info=20ovf=0A=20=20=20=20WHERE=20ovf.ovf_disk_id=20=3D=
=20v_disk_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertStorageDomainOvfInfo=20(=0A=20=20=20=20v_storage_domain_id=20UUID,=0A=
=20=20=20=20v_status=20INT,=0A=20=20=20=20v_ovf_disk_id=20UUID,=0A=20=20=20=
=20v_stored_ovfs_ids=20TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
storage_domains_ovf_info=20(=0A=20=20=20=20=20=20=20=20=
storage_domain_id,=0A=20=20=20=20=20=20=20=20status,=0A=20=20=20=20=20=20=
=20=20ovf_disk_id,=0A=20=20=20=20=20=20=20=20stored_ovfs_ids=0A=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=
v_storage_domain_id,=0A=20=20=20=20=20=20=20=20v_status,=0A=20=20=20=20=20=
=20=20=20v_ovf_disk_id,=0A=20=20=20=20=20=20=20=20v_stored_ovfs_ids=0A=20=
=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
LoadStorageDomainsForOvfIds=20(v_ovfs_ids=20TEXT)=0ARETURNS=20SETOF=20=
UUID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=
=20SELECT=20ovf.storage_domain_id=0A=20=20=20=20FROM=20=
storage_domains_ovf_info=20ovf=0A=20=20=20=20WHERE=20=
string_to_array(ovf.stored_ovfs_ids,=20',')=20&&=20=
string_to_array(v_ovfs_ids,=20',');=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateStorageDomainOvfInfo=20(=0A=20=20=20=20v_storage_domain_id=20UUID,=0A=
=20=20=20=20v_status=20INT,=0A=20=20=20=20v_ovf_disk_id=20UUID,=0A=20=20=20=
=20v_stored_ovfs_ids=20TEXT,=0A=20=20=20=20v_last_updated=20TIMESTAMP=20=
WITH=20TIME=20ZONE=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20UPDATE=20storage_domains_ovf_info=0A=20=20=20=20SET=20=
status=20=3D=20v_status,=0A=20=20=20=20=20=20=20=20storage_domain_id=20=3D=
=20v_storage_domain_id,=0A=20=20=20=20=20=20=20=20ovf_disk_id=20=3D=20=
v_ovf_disk_id,=0A=20=20=20=20=20=20=20=20stored_ovfs_ids=20=3D=20=
v_stored_ovfs_ids,=0A=20=20=20=20=20=20=20=20last_updated=20=3D=20=
v_last_updated=0A=20=20=20=20WHERE=20ovf_disk_id=20=3D=20v_ovf_disk_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteStorageDomainOvfInfo=20(v_ovf_disk_id=20UUID)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20storage_domains_ovf_info=0A=20=20=20=20WHERE=20ovf_disk_id=20=3D=
=20v_ovf_disk_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateOvfUpdatedInfo=20(=0A=
=20=20=20=20v_storage_domains_ids=20VARCHAR(5000),=0A=20=20=20=20=
v_status=20INT,=0A=20=20=20=20v_except_status=20INT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20curs_storages_ids=20CURSOR=0A=
FOR=0ASELECT=20*=0AFROM=20fnSplitterUuid(v_storage_domains_ids);=0A=0Aid=20=
UUID;=0A=0ABEGIN=0A=20=20=20=20OPEN=20curs_storages_ids;=0A=0A=20=20=20=20=
LOOP=0A=0A=20=20=20=20=20=20=20=20FETCH=20curs_storages_ids=0A=20=20=20=20=
=20=20=20=20INTO=20id;=0A=0A=20=20=20=20=20=20=20=20IF=20NOT=20FOUND=20=
THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20EXIT;=0A=20=20=20=20=20=20=20=20=
END=20IF;=0A=20=20=20=20=20=20=20=20UPDATE=20storage_domains_ovf_info=0A=20=
=20=20=20=20=20=20=20SET=20status=20=3D=20v_status=0A=20=20=20=20=20=20=20=
=20WHERE=20storage_domain_id=20=3D=20id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20status=20!=3D=20v_except_status;=0A=20=20=20=20END=20LOOP;=0A=0A=
=20=20=20=20CLOSE=20curs_storages_ids;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Insertstorage_domain_static=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_storage=20VARCHAR(250),=0A=20=20=20=20v_storage_name=20VARCHAR(250),=0A=
=20=20=20=20v_storage_description=20VARCHAR(4000),=0A=20=20=20=20=
v_storage_comment=20TEXT,=0A=20=20=20=20v_storage_type=20INT,=0A=20=20=20=
=20v_storage_domain_type=20INT,=0A=20=20=20=20=
v_storage_domain_format_type=20VARCHAR(50),=0A=20=20=20=20=
v_last_time_used_as_master=20BIGINT,=0A=20=20=20=20v_wipe_after_delete=20=
BOOLEAN,=0A=20=20=20=20v_warning_low_space_indicator=20INT,=0A=20=20=20=20=
v_critical_space_action_blocker=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
storage_domain_static=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=
=20=20=20storage,=0A=20=20=20=20=20=20=20=20storage_name,=0A=20=20=20=20=20=
=20=20=20storage_description,=0A=20=20=20=20=20=20=20=20storage_comment,=0A=
=20=20=20=20=20=20=20=20storage_type,=0A=20=20=20=20=20=20=20=20=
storage_domain_type,=0A=20=20=20=20=20=20=20=20=
storage_domain_format_type,=0A=20=20=20=20=20=20=20=20=
last_time_used_as_master,=0A=20=20=20=20=20=20=20=20wipe_after_delete,=0A=
=20=20=20=20=20=20=20=20warning_low_space_indicator,=0A=20=20=20=20=20=20=
=20=20critical_space_action_blocker=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20=
v_storage,=0A=20=20=20=20=20=20=20=20v_storage_name,=0A=20=20=20=20=20=20=
=20=20v_storage_description,=0A=20=20=20=20=20=20=20=20=
v_storage_comment,=0A=20=20=20=20=20=20=20=20v_storage_type,=0A=20=20=20=20=
=20=20=20=20v_storage_domain_type,=0A=20=20=20=20=20=20=20=20=
v_storage_domain_format_type,=0A=20=20=20=20=20=20=20=20=
v_last_time_used_as_master,=0A=20=20=20=20=20=20=20=20=
v_wipe_after_delete,=0A=20=20=20=20=20=20=20=20=
v_warning_low_space_indicator,=0A=20=20=20=20=20=20=20=20=
v_critical_space_action_blocker=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Getstorage_domains_List_By_ImageId=20(v_image_id=20=
UUID)=0ARETURNS=20SETOF=20storage_domains=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20storage_domains=0A=20=20=20=20WHERE=20id=20IN=20(=0A=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=20storage_domain_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20image_storage_domain_map=0A=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20image_id=20=3D=20v_image_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Updatestorage_domain_static=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_storage=20VARCHAR(250),=0A=20=20=20=20v_storage_name=20VARCHAR(250),=0A=
=20=20=20=20v_storage_description=20VARCHAR(4000),=0A=20=20=20=20=
v_storage_comment=20TEXT,=0A=20=20=20=20v_storage_type=20INT,=0A=20=20=20=
=20v_storage_domain_type=20INT,=0A=20=20=20=20=
v_storage_domain_format_type=20INT,=0A=20=20=20=20=
v_last_time_used_as_master=20BIGINT,=0A=20=20=20=20v_wipe_after_delete=20=
BOOLEAN,=0A=20=20=20=20v_warning_low_space_indicator=20INT,=0A=20=20=20=20=
v_critical_space_action_blocker=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=0A=
=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
storage_domain_static=0A=20=20=20=20SET=20storage=20=3D=20v_storage,=0A=20=
=20=20=20=20=20=20=20storage_name=20=3D=20v_storage_name,=0A=20=20=20=20=20=
=20=20=20storage_type=20=3D=20v_storage_type,=0A=20=20=20=20=20=20=20=20=
storage_domain_type=20=3D=20v_storage_domain_type,=0A=20=20=20=20=20=20=20=
=20_update_date=20=3D=20LOCALTIMESTAMP,=0A=20=20=20=20=20=20=20=20=
storage_domain_format_type=20=3D=20v_storage_domain_format_type,=0A=20=20=
=20=20=20=20=20=20last_time_used_as_master=20=3D=20=
v_last_time_used_as_master,=0A=20=20=20=20=20=20=20=20wipe_after_delete=20=
=3D=20v_wipe_after_delete,=0A=20=20=20=20=20=20=20=20storage_description=20=
=3D=20v_storage_description,=0A=20=20=20=20=20=20=20=20storage_comment=20=
=3D=20v_storage_comment,=0A=20=20=20=20=20=20=20=20=
warning_low_space_indicator=20=3D=20v_warning_low_space_indicator,=0A=20=20=
=20=20=20=20=20=20critical_space_action_blocker=20=3D=20=
v_critical_space_action_blocker=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Deletestorage_domain_static=20(v_id=20UUID)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_val=20UUID;=0A=0ABEGIN=0A=
=20=20=20=20--=20Get=20(and=20keep)=20a=20shared=20lock=20with=20"right=20=
to=20upgrade=20to=20exclusive"=0A=20=20=20=20--=20in=20order=20to=20=
force=20locking=20parent=20before=20children=0A=20=20=20=20SELECT=20id=0A=
=20=20=20=20INTO=20v_val=0A=20=20=20=20FROM=20storage_domain_static=0A=20=
=20=20=20WHERE=20id=20=3D=20v_id=0A=20=20=20=20FOR=20UPDATE;=0A=0A=20=20=20=
=20DELETE=0A=20=20=20=20FROM=20storage_domain_static=0A=20=20=20=20WHERE=20=
id=20=3D=20v_id;=0A=0A=20=20=20=20--=20delete=20Storage=20permissions=20=
--=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20permissions=0A=20=20=20=20=
WHERE=20object_id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromstorage_domain_static=20()=0ARETURNS=20SETOF=20=
storage_domain_static=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_domain_static;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_domain_staticByid=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
storage_domain_static=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_domain_static=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Getstorage_domain_staticByName=20(v_name=20=
VARCHAR(250))=0ARETURNS=20SETOF=20storage_domain_static=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20storage_domain_static=0A=20=20=20=20WHERE=20=
storage_name=20=3D=20v_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_domain_staticByNameFiltered=20(=0A=20=20=20=20v_name=20=
VARCHAR(250),=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20=
v_is_filtered=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
storage_domain_static=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_domain_static=20sds=0A=20=20=20=20WHERE=20storage_name=20=3D=20=
v_name=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_storage_domain_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20sds.id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_domain_staticBystorage_pool_id=20(v_storage_pool_id=20UUID)=0A=
RETURNS=20SETOF=20storage_domain_static=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
storage_domain_static.*=0A=20=20=20=20FROM=20storage_domain_static=0A=20=20=
=20=20INNER=20JOIN=20storage_pool_iso_map=0A=20=20=20=20=20=20=20=20ON=20=
storage_pool_iso_map.storage_id=20=3D=20storage_domain_static.id=0A=20=20=
=20=20WHERE=20storage_pool_iso_map.storage_pool_id=20=3D=20=
v_storage_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20TYPE=20IF=20EXISTS=20=
GetStorageDomainIdsByStoragePoolIdAndStatus_rs=20CASCADE;=0A=
**************************=0A=0ADROP=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20TYPE=20=
GetStorageDomainIdsByStoragePoolIdAndStatus_rs=20AS=20(storage_id=20=
UUID);=0A**************************=0A=0ACREATE=20TYPE=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetStorageDomainIdsByStoragePoolIdAndStatus=20(=0A=20=20=20=20=
v_storage_pool_id=20UUID,=0A=20=20=20=20v_status=20INT=0A=20=20=20=20)=0A=
RETURNS=20SETOF=20GetStorageDomainIdsByStoragePoolIdAndStatus_rs=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20storage_id=0A=20=20=20=20FROM=20storage_pool_iso_map=0A=20=
=20=20=20INNER=20JOIN=20storage_domain_static=0A=20=20=20=20=20=20=20=20=
ON=20storage_pool_iso_map.storage_id=20=3D=20storage_domain_static.id=0A=20=
=20=20=20WHERE=20storage_pool_id=20=3D=20v_storage_pool_id=0A=20=20=20=20=
=20=20=20=20AND=20status=20=3D=20v_status=0A=20=20=20=20=20=20=20=20AND=20=
storage_domain_static.storage_type=20!=3D=209;--=20filter=20Cinder=20=
storage=20domains=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Getstorage_domains_By_id=20=
(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20=
v_is_filtered=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
storage_domains_without_storage_pools=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20storage_domains_without_storage_pools=0A=20=20=20=20WHERE=20id=20=
=3D=20v_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_storage_domain_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20v_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_domains_by_storage_pool_id_with_permitted_action=20(=0A=20=20=20=
=20v_user_id=20UUID,=0A=20=20=20=20v_action_group_id=20INT,=0A=20=20=20=20=
v_storage_pool_id=20UUID=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
storage_domains=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20storage_domains=0A=
=20=20=20=20WHERE=20storage_pool_id=20=3D=20v_storage_pool_id=0A=20=20=20=
=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
get_entity_permissions(v_user_id,=20v_action_group_id,=20id,=2011)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20)=20IS=20NOT=20NULL;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_domains_By_id_and_by_storage_pool_id=20(=0A=20=20=20=20v_id=20=
UUID,=0A=20=20=20=20v_storage_pool_id=20UUID=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20storage_domains=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_domains=0A=20=20=20=20WHERE=20id=20=3D=20v_id=0A=20=20=20=20=20=20=
=20=20AND=20storage_pool_id=20=3D=20v_storage_pool_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_domains_By_storagePoolId=20(=0A=20=20=20=20v_storage_pool_id=20=
UUID,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20=
BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20storage_domains=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20*=0A=20=20=20=20FROM=20storage_domains=0A=20=20=20=20WHERE=20=
storage_pool_id=20=3D=20v_storage_pool_id=0A=20=20=20=20=20=20=20=20AND=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=
=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20user_storage_domain_permissions_view=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_domain_by_type_storagePoolId_and_status=20(=0A=20=20=20=20=
v_storage_domain_type=20INT,=0A=20=20=20=20v_storage_pool_id=20UUID,=0A=20=
=20=20=20v_status=20INT=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
storage_domains=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20storage_domains=0A=
=20=20=20=20WHERE=20storage_pool_id=20=3D=20v_storage_pool_id=0A=20=20=20=
=20=20=20=20=20AND=20storage_domain_type=20=3D=20v_storage_domain_type=0A=
=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_status=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20status=20=
=3D=20v_status=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Getstorage_domains_By_connection=20(v_connection=20=
VARCHAR)=0ARETURNS=20SETOF=20storage_domains=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20storage_domains=0A=20=20=20=20WHERE=20storage=20IN=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20SELECT=20id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20storage_server_connections=0A=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20connection=20=3D=20v_connection=0A=20=20=20=20=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromStorageDomainsByConnectionId=20(v_connection_id=20VARCHAR)=0A=
RETURNS=20SETOF=20storage_domains=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
storage_domains=0A=20=20=20=20WHERE=20storage=20=3D=20v_connection_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromstorage_domains=20(=0A=20=20=20=20=
v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20BOOLEAN=0A=20=20=20=20)=0A=
RETURNS=20SETOF=20storage_domains=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20DISTINCT=20ON=20(id)=20=
*=0A=20=20=20=20FROM=20storage_domains=0A=20=20=20=20WHERE=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=
=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_storage_domain_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=
=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Remove_Entities_From_storage_domain=20(v_storage_domain_id=20UUID)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20--=20Creating=20a=20temporary=20table=20which=20will=20=
give=20all=20the=20images=20and=20the=20disks=20which=20resids=20on=20=
only=20the=20specified=20storage=20domain.=20(copied=20template=20disks=20=
on=20multiple=20storage=20domains=20will=20not=20be=20part=20of=20this=20=
table)=0A=20=20=20=20=20=20=20=20CREATE=20TEMPORARY=20TABLE=20=
STORAGE_DOMAIN_MAP_TABLE=20AS=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
image_guid=20AS=20image_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
disk_id=0A=20=20=20=20=20=20=20=20FROM=20images_storage_domain_view=0A=20=
=20=20=20=20=20=20=20WHERE=20storage_id=20=3D=20v_storage_domain_id=0A=0A=
=20=20=20=20=20=20=20=20EXCEPT=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
image_guid=20AS=20image_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
disk_id=0A=20=20=20=20=20=20=20=20FROM=20images_storage_domain_view=0A=20=
=20=20=20=20=20=20=20WHERE=20storage_id=20!=3D=20v_storage_domain_id;=0A=0A=
=20=20=20=20=20=20=20=20exception=20when=20others=20then=0A=0A=20=20=20=20=
=20=20=20=20TRUNCATE=20TABLE=20STORAGE_DOMAIN_MAP_TABLE;=0A=0A=20=20=20=20=
=20=20=20=20INSERT=20INTO=20STORAGE_DOMAIN_MAP_TABLE=0A=20=20=20=20=20=20=
=20=20SELECT=20image_guid=20AS=20image_id,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20disk_id=0A=20=20=20=20=20=20=20=20FROM=20=
images_storage_domain_view=0A=20=20=20=20=20=20=20=20WHERE=20storage_id=20=
=3D=20v_storage_domain_id=0A=0A=20=20=20=20=20=20=20=20EXCEPT=0A=0A=20=20=
=20=20=20=20=20=20SELECT=20image_guid=20AS=20image_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20disk_id=0A=20=20=20=20=20=20=20=20FROM=20=
images_storage_domain_view=0A=20=20=20=20=20=20=20=20WHERE=20storage_id=20=
!=3D=20v_storage_domain_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20--=20All=20the=20VMs/Templates=20which=20have=20=
disks=20both=20on=20the=20specified=20domain=20and=20other=20domains.=0A=20=
=20=20=20=20=20=20=20CREATE=20TEMPORARY=20TABLE=20=
ENTITY_IDS_ON_OTHER_STORAGE_DOMAINS_TEMPORARY_TABLE=20AS=0A=0A=20=20=20=20=
=20=20=20=20SELECT=20DISTINCT=20vm_static.vm_guid=0A=20=20=20=20=20=20=20=
=20FROM=20vm_static=0A=20=20=20=20=20=20=20=20INNER=20JOIN=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20--=20Join=20vm_static=20only=20with=20VMs=20=
and=20Templates=20that=20have=20images=20on=20the=20storage=20domain=20=
v_storage_domain_id=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
vm_static.vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vm_static=0A=
=20=20=20=20=20=20=20=20=20=20=20=20INNER=20JOIN=20vm_device=20vd=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20ON=20vd.vm_id=20=3D=20=
vm_static.vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20INNER=20JOIN=20=
images=20i=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
i.image_group_id=20=3D=20vd.device_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20INNER=20JOIN=20STORAGE_DOMAIN_MAP_TABLE=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20ON=20i.image_guid=20=3D=20=
STORAGE_DOMAIN_MAP_TABLE.image_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
)=20vm_guids_with_disks_on_storage_domain=0A=20=20=20=20=20=20=20=20=20=20=
=20=20ON=20vm_static.vm_guid=20=3D=20=
vm_guids_with_disks_on_storage_domain.vm_guid=0A=20=20=20=20=20=20=20=20=
--=20With=20all=20the=20VMs=20which=20have=20images=20on=20the=20storage=20=
domain,=20get=20all=20of=20their=20images=20and=20check=20if=20there=20=
is=20an=20image=20on=20another=20storage=20domain.=0A=20=20=20=20=20=20=20=
=20INNER=20JOIN=20vm_device=20vd=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ON=20vd.vm_id=20=3D=20vm_static.vm_guid=0A=20=20=20=20=20=20=20=20INNER=20=
JOIN=20images=20i=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
i.image_group_id=20=3D=20vd.device_id=0A=20=20=20=20=20=20=20=20INNER=20=
JOIN=20image_storage_domain_map=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
i.image_guid=20=3D=20image_storage_domain_map.image_id=0A=20=20=20=20=20=20=
=20=20WHERE=20image_storage_domain_map.storage_domain_id=20!=3D=20=
v_storage_domain_id;=0A=0A=20=20=20=20=20=20=20=20exception=20when=20=
others=20then=0A=0A=20=20=20=20=20=20=20=20TRUNCATE=20TABLE=20=
ENTITY_IDS_ON_OTHER_STORAGE_DOMAINS_TEMPORARY_TABLE;=0A=0A=20=20=20=20=20=
=20=20=20INSERT=20INTO=20=
ENTITY_IDS_ON_OTHER_STORAGE_DOMAINS_TEMPORARY_TABLE=0A=20=20=20=20=20=20=20=
=20SELECT=20DISTINCT=20vm_static.vm_guid=0A=20=20=20=20=20=20=20=20FROM=20=
vm_static=0A=20=20=20=20=20=20=20=20INNER=20JOIN=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=20vm_static.vm_guid=0A=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20vm_static=0A=20=20=20=20=20=20=20=20=20=20=20=20INNER=20=
JOIN=20vm_device=20vd=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
ON=20vd.vm_id=20=3D=20vm_static.vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=
=20INNER=20JOIN=20images=20i=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20ON=20i.image_group_id=20=3D=20vd.device_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20INNER=20JOIN=20STORAGE_DOMAIN_MAP_TABLE=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20ON=20i.image_guid=20=3D=20=
STORAGE_DOMAIN_MAP_TABLE.image_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
)=20vm_guids_with_disks_on_storage_domain=0A=20=20=20=20=20=20=20=20=20=20=
=20=20ON=20vm_static.vm_guid=20=3D=20=
vm_guids_with_disks_on_storage_domain.vm_guid=0A=20=20=20=20=20=20=20=20=
INNER=20JOIN=20vm_device=20vd=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
vd.vm_id=20=3D=20vm_static.vm_guid=0A=20=20=20=20=20=20=20=20INNER=20=
JOIN=20images=20i=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
i.image_group_id=20=3D=20vd.device_id=0A=20=20=20=20=20=20=20=20INNER=20=
JOIN=20image_storage_domain_map=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
i.image_guid=20=3D=20image_storage_domain_map.image_id=0A=20=20=20=20=20=20=
=20=20WHERE=20image_storage_domain_map.storage_domain_id=20!=3D=20=
v_storage_domain_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20--=20Templates=20with=20any=20images=20residing=20on=20=
only=20the=20specified=20storage=20domain=0A=20=20=20=20=20=20=20=20=
CREATE=20TEMPORARY=20TABLE=20TEMPLATES_IDS_TEMPORARY_TABLE=20AS=0A=0A=20=20=
=20=20=20=20=20=20SELECT=20vm_device.vm_id=20AS=20vm_guid=0A=20=20=20=20=20=
=20=20=20FROM=20images_storage_domain_view=0A=20=20=20=20=20=20=20=20=
INNER=20JOIN=20vm_device=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
vm_device.device_id=20=3D=20images_storage_domain_view.disk_id=0A=20=20=20=
=20=20=20=20=20INNER=20JOIN=20STORAGE_DOMAIN_MAP_TABLE=0A=20=20=20=20=20=20=
=20=20=20=20=20=20ON=20STORAGE_DOMAIN_MAP_TABLE.image_id=20=3D=20=
images_storage_domain_view.image_guid=0A=20=20=20=20=20=20=20=20WHERE=20=
entity_type=20=3D=20'TEMPLATE'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
storage_id=20=3D=20v_storage_domain_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20vm_device.vm_id=20NOT=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20ENTITY_IDS_ON_OTHER_STORAGE_DOMAINS_TEMPORARY_TABLE=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=
=20exception=20when=20others=20then=0A=0A=20=20=20=20=20=20=20=20=
TRUNCATE=20TABLE=20TEMPLATES_IDS_TEMPORARY_TABLE;=0A=0A=20=20=20=20=20=20=
=20=20INSERT=20INTO=20TEMPLATES_IDS_TEMPORARY_TABLE=0A=20=20=20=20=20=20=20=
=20SELECT=20vm_device.vm_id=20AS=20vm_guid=0A=20=20=20=20=20=20=20=20=
FROM=20images_storage_domain_view=0A=20=20=20=20=20=20=20=20INNER=20JOIN=20=
vm_device=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20vm_device.device_id=20=
=3D=20images_storage_domain_view.disk_id=0A=20=20=20=20=20=20=20=20INNER=20=
JOIN=20STORAGE_DOMAIN_MAP_TABLE=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
STORAGE_DOMAIN_MAP_TABLE.image_id=20=3D=20=
images_storage_domain_view.image_guid=0A=20=20=20=20=20=20=20=20WHERE=20=
entity_type=20=3D=20'TEMPLATE'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
storage_id=20=3D=20v_storage_domain_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20vm_device.vm_id=20NOT=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20ENTITY_IDS_ON_OTHER_STORAGE_DOMAINS_TEMPORARY_TABLE=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20END;=0A=0A=20=
=20=20=20--=20Add=20also=20Template=20Versions=20based=20on=20the=20=
selected=20templates=0A=20=20=20=20INSERT=20INTO=20=
TEMPLATES_IDS_TEMPORARY_TABLE=0A=20=20=20=20SELECT=20vm_guid=0A=20=20=20=20=
FROM=20vm_static=0A=20=20=20=20WHERE=20vmt_guid=20IN=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=20vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20TEMPLATES_IDS_TEMPORARY_TABLE=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20=20=20=20=20AND=20entity_type=20=3D=20'TEMPLATE';=0A=0A=
=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20--=20Vms=20which=20resides=20=
on=20the=20storage=20domain=0A=20=20=20=20=20=20=20=20CREATE=20TEMPORARY=20=
TABLE=20VM_IDS_TEMPORARY_TABLE=20AS=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
vm_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20vm_images_view.entity_type=20=
AS=20entity_type=0A=20=20=20=20=20=20=20=20FROM=20vm_images_view=0A=20=20=
=20=20=20=20=20=20INNER=20JOIN=20vm_device=0A=20=20=20=20=20=20=20=20=20=20=
=20=20ON=20vm_device.device_id=20=3D=20vm_images_view.disk_id=0A=20=20=20=
=20=20=20=20=20WHERE=20v_storage_domain_id=20IN=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20fnsplitteruuid(storage_id)=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
vm_id=20NOT=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
ENTITY_IDS_ON_OTHER_STORAGE_DOMAINS_TEMPORARY_TABLE=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=20exception=20=
when=20others=20then=0A=0A=20=20=20=20=20=20=20=20TRUNCATE=20TABLE=20=
VM_IDS_TEMPORARY_TABLE;=0A=0A=20=20=20=20=20=20=20=20INSERT=20INTO=20=
VM_IDS_TEMPORARY_TABLE=0A=20=20=20=20=20=20=20=20SELECT=20vm_id,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20vm_images_view.entity_type=20AS=20=
entity_type=0A=20=20=20=20=20=20=20=20FROM=20vm_images_view=0A=20=20=20=20=
=20=20=20=20INNER=20JOIN=20vm_device=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ON=20vm_device.device_id=20=3D=20vm_images_view.disk_id=0A=20=20=20=20=20=
=20=20=20WHERE=20v_storage_domain_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20fnsplitteruuid(storage_id)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20vm_id=20=
NOT=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
ENTITY_IDS_ON_OTHER_STORAGE_DOMAINS_TEMPORARY_TABLE=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20END;=0A=0A=20=20=20=20DELETE=0A=
=20=20=20=20FROM=20permissions=0A=20=20=20=20WHERE=20object_id=20IN=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20vm_id=20AS=20vm_guid=0A=20=20=
=20=20=20=20=20=20=20=20=20=20FROM=20VM_IDS_TEMPORARY_TABLE=0A=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20entity_type=20<>=20'TEMPLATE'=0A=20=20=20=
=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
snapshots=0A=20=20=20=20WHERE=20vm_id=20IN=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=20vm_id=20AS=20vm_guid=0A=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20VM_IDS_TEMPORARY_TABLE=0A=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20image_storage_domain_map=0A=
=20=20=20=20WHERE=20storage_domain_id=20=3D=20v_storage_domain_id;=0A=0A=20=
=20=20=20DELETE=0A=20=20=20=20FROM=20images=0A=20=20=20=20WHERE=20=
image_guid=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
image_id=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
STORAGE_DOMAIN_MAP_TABLE=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=
=20=20=20DELETE=0A=20=20=20=20FROM=20vm_interface=0A=20=20=20=20WHERE=20=
vmt_guid=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20vm_guid=0A=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20TEMPLATES_IDS_TEMPORARY_TABLE=0A=
=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20permissions=0A=20=20=20=20WHERE=20object_id=20IN=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=20vm_guid=0A=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20TEMPLATES_IDS_TEMPORARY_TABLE=0A=20=20=20=20=20=20=20=20=20=
=20=20=20);=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20vm_static=0A=20=20=
=20=20WHERE=20vm_guid=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20vm_id=20AS=20vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
VM_IDS_TEMPORARY_TABLE=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
entity_type=20<>=20'TEMPLATE'=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=0A=20=20=20=20--=20Delete=20devices=20which=20are=20related=20to=20=
VMs/Templates=20with=20Multiple=20Storage=20Domain=20(VMs/Templates=20=
which=20has=20not=20removed)=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vm_device=0A=20=20=20=20WHERE=20device_id=20IN=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20disk_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20STORAGE_DOMAIN_MAP_TABLE=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=0A=20=20=20=20--=20Delete=20pools=20and=20snapshots=20of=20pools=20=
based=20on=20templates=20from=20the=20storage=20domain=20to=20be=20=
removed=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20snapshots=0A=20=20=20=20=
WHERE=20vm_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vm_static=0A=20=20=20=
=20=20=20=20=20=20=20=20=20WHERE=20vmt_guid=20IN=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20vm_guid=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
TEMPLATES_IDS_TEMPORARY_TABLE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=
=20DELETE=0A=20=20=20=20FROM=20vm_static=0A=20=20=20=20WHERE=20vmt_guid=20=
IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20vm_guid=0A=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20TEMPLATES_IDS_TEMPORARY_TABLE=0A=20=20=20=
=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vm_static=0A=20=20=20=20WHERE=20vm_guid=20IN=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=20vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
TEMPLATES_IDS_TEMPORARY_TABLE=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=0A=20=20=20=20--=20Deletes=20the=20disks=20which=20the=20only=20storage=20=
domain=20they=20are=20reside=20on,=20is=20the=20storage=20domain.=0A=20=20=
=20=20DELETE=0A=20=20=20=20FROM=20base_disks=0A=20=20=20=20WHERE=20=
disk_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20disk_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20STORAGE_DOMAIN_MAP_TABLE=0A=20=
=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20--=20Deletes=20the=20=
disks's=20permissions=20which=20the=20only=20storage=20domain=20they=20=
are=20reside=20on,=20is=20the=20storage=20domain.=0A=20=20=20=20DELETE=0A=
=20=20=20=20FROM=20permissions=0A=20=20=20=20WHERE=20object_id=20IN=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20disk_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20FROM=20STORAGE_DOMAIN_MAP_TABLE=0A=20=20=20=20=20=20=20=
=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Force_Delete_storage_domain=20(v_storage_domain_id=20UUID)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20=
Remove_Entities_From_storage_domain(v_storage_domain_id);=0A=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20permissions=0A=20=20=20=20WHERE=20object_id=20=
=3D=20v_storage_domain_id;=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
storage_domain_dynamic=0A=20=20=20=20WHERE=20id=20=3D=20=
v_storage_domain_id;=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
storage_domain_static=0A=20=20=20=20WHERE=20id=20=3D=20=
v_storage_domain_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_domains_List_By_storageDomainId=20(v_storage_domain_id=20=
UUID)=0ARETURNS=20SETOF=20storage_domains=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20storage_domains=0A=20=20=20=20WHERE=20storage_domains.id=20=3D=20=
v_storage_domain_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_perms_get_storage_pools_with_permitted_action_on_clusters=20(=0A=20=20=
=20=20v_user_id=20UUID,=0A=20=20=20=20v_action_group_id=20INT,=0A=20=20=20=
=20v_supports_virt_service=20boolean,=0A=20=20=20=20=
v_supports_gluster_service=20boolean=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
storage_pool=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20sp.*=0A=20=20=20=20FROM=20storage_pool=20=
sp=0A=20=20=20=20WHERE=20sp.id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=20vg.storage_pool_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20cluster=20vg=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
get_entity_permissions(v_user_id,=20v_action_group_id,=20vg.cluster_id,=20=
9)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=20IS=20=
NOT=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_supports_virt_service=20=3D=20TRUE=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20vg.virt_service=20=3D=20TRUE=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_supports_gluster_service=20=3D=20TRUE=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20vg.gluster_service=20=3D=20=
TRUE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getstorage_domains_By_storage_pool_id_and_connection=20(=0A=20=20=20=20=
v_storage_pool_id=20UUID,=0A=20=20=20=20v_connection=20VARCHAR=0A=20=20=20=
=20)=0ARETURNS=20SETOF=20storage_domains=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20storage_domains=0A=20=20=20=20WHERE=20storage_pool_id=20=3D=20=
v_storage_pool_id=0A=20=20=20=20=20=20=20=20AND=20storage=20IN=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20SELECT=20id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20storage_server_connections=0A=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20connection=20=3D=20v_connection=0A=20=20=20=20=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetFailingStorage_domains=20()=0ARETURNS=20SETOF=20storage_domains=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20storage_domains=0A=20=20=20=20=
WHERE=20recoverable=0A=20=20=20=20=20=20=20=20AND=20status=20=3D=20=
4;--inactive=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetFailingVdss=20()=0A=
RETURNS=20SETOF=20vds=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20vds=0A=20=
=20=20=20WHERE=20recoverable=0A=20=20=20=20=20=20=20=20AND=20status=20=3D=20=
10;--non=20operational=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetStoragePoolsByClusterService=20(=0A=20=20=20=20=
v_supports_virt_service=20BOOLEAN,=0A=20=20=20=20=
v_supports_gluster_service=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
storage_pool=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20sp.*=0A=20=20=20=20FROM=20storage_pool=20=
SP=0A=20=20=20=20WHERE=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20cluster=20vg=0A=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20v_supports_virt_service=20=3D=20TRUE=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
vg.virt_service=20=3D=20TRUE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20v_supports_gluster_service=20=3D=20TRUE=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
vg.gluster_service=20=3D=20TRUE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20vg.storage_pool_id=20=3D=20sp.id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetStorageServerConnectionsForDomain=20(v_storage_domain_id=20UUID)=0A=
RETURNS=20SETOF=20storage_server_connections=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20storage_server_connections=0A=20=20=20=20WHERE=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20storage_domain_static=0A=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20storage_domain_static.id=20=3D=20v_storage_domain_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
storage_domain_static.storage_type=20IN=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=201,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=204,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=206,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=207=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=20=
--=20file=20storage=20domains=20-=20nfs,posix,local,gluster=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20storage_server_connections.id=20=
=3D=20storage_domain_static.storage=0A=0A=20=20=20=20=20=20=20=20=20=20=20=
=20UNION=20ALL=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=
=20=20=20=20=20=20=20=20=20=20FROM=20storage_domain_static=0A=20=20=20=20=
=20=20=20=20=20=20=20=20INNER=20JOIN=20luns=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20ON=20storage_domain_static.storage=20=3D=20=
luns.volume_group_id=0A=20=20=20=20=20=20=20=20=20=20=20=20INNER=20JOIN=20=
lun_storage_server_connection_map=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20ON=20luns.lun_id=20=3D=20=
lun_storage_server_connection_map.lun_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20storage_server_connections.id=20=3D=20=
lun_storage_server_connection_map.storage_server_connection=0A=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20storage_domain_static.id=20=3D=20=
v_storage_domain_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20storage_domain_static.storage_type=20=3D=203=20--=20storage=20type=20=
=3D=20iscsi=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetDcIdByExternalNetworkId=20(v_external_id=20TEXT)=0ARETURNS=20SETOF=20=
UUID=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=
=20=20=20=20SELECT=20storage_pool_id=0A=20=20=20=20FROM=20network=0A=20=20=
=20=20WHERE=20provider_network_external_id=20=3D=20v_external_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetNumberOfImagesInStorageDomain=20=
(v_storage_domain_id=20UUID)=0ARETURNS=20SETOF=20BIGINT=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
COUNT(*)=0A=20=20=20=20FROM=20image_storage_domain_map=0A=20=20=20=20=
WHERE=20storage_domain_id=20=3D=20v_storage_domain_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllDataCentersByMacPoolId=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
storage_pool=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20sp.*=0A=20=20=20=20FROM=20storage_pool=20=
sp=0A=20=20=20=20WHERE=20sp.mac_pool_id=20=3D=20v_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ADROP=20TYPE=20IF=20EXISTS=20=
Getsystem_statistics_rs=20CASCADE;=0A**************************=0A=0A=
DROP=20TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
Getsystem_statistics_rs=20AS=20(val=20INT);=0A**************************=0A=
=0ACREATE=20TYPE=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Getsystem_statistics=20(=0A=20=20=20=20v_entity=20=
VARCHAR(10),=20=0A=20=20=20=20v_status=20VARCHAR(20)=0A=20=20=20=20)=20=0A=
RETURNS=20Getsystem_statistics_rs=20STABLE=20AS=20$PROCEDURE$=0ADECLARE=20=
v_i=20Getsystem_statistics_rs;=0A=0Av_sql=20VARCHAR(4000);=0A=0A=
v_sys_entity=20VARCHAR(10);=0A=0ABEGIN=0A=20=20=20=20v_sql=20:=3D=20=
NULL;=0A=0A=20=20=20=20v_sys_entity=20:=3D=20upper(v_entity);=0A=0A=20=20=
=20=20IF=20v_sys_entity=20=3D=20'VM'=20THEN=0A=20=20=20=20=20=20=20=20=
v_sql=20:=3D=20'SELECT=20count(vm_guid)=20FROM=20vm_dynamic';=0A=20=20=20=
=20ELSIF=20v_sys_entity=20=3D=20'HOST'=20THEN=0A=20=20=20=20=20=20=20=20=
v_sql=20:=3D=20'SELECT=20count(vds_id)=20FROM=20vds_dynamic';=0A=0A=20=20=
=20=20ELSIF=20v_sys_entity=20=3D=20'USER'=20THEN=0A=20=20=20=20=20=20=20=20=
v_sql=20:=3D=20'SELECT=20count(user_id)=20FROM=20users';=0A=0A=20=20=20=20=
ELSIF=20v_sys_entity=20=3D=20'TSD'=20THEN=0A=20=20=20=20=20=20=20=20=
v_sql=20:=3D=20'SELECT=20count(id)=20FROM=20storage_domain_static';=0A=0A=
=20=20=20=20ELSIF=20v_sys_entity=20=3D=20'ASD'=20THEN=0A=20=20=20=20=20=20=
=20=20v_sql=20:=3D=20'SELECT=20count(storage_id)=20FROM=20=
storage_pool_iso_map';=0A=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=
RAISE=20'Unknown=20entity=20type=20"%"',=20v_entity;=0A=20=20=20=20END=20=
IF;=0A=0A=20=20=20=20IF=20v_status=20!=3D=20''=20THEN=0A=20=20=20=20=20=20=
=20=20IF=20v_sys_entity=20!=3D=20'USER'=0A=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20v_sys_entity=20!=3D=20'TSD'=20THEN=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_sql=20:=3D=20coalesce(v_sql,=20'')=20||=20'=20where=20status=20=
in=20('=20||=20coalesce(v_status,=20'')=20||=20')';=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=20=20=20=20END=20IF;=0A=20=20=20=20EXECUTE=20v_sql=0A=20=20=
=20=20INTO=20v_i;=0A=0ARETURN=20v_i;END;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Inserttags=20(=0A=
=20=20=20=20v_description=20VARCHAR(4000),=0A=20=20=20=20v_tag_id=20=
UUID,=0A=20=20=20=20v_tag_name=20VARCHAR(50),=0A=20=20=20=20v_parent_id=20=
UUID,=0A=20=20=20=20v_readonly=20BOOLEAN,=0A=20=20=20=20v_type=20INT=0A=20=
=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
INSERT=20INTO=20tags=20(=0A=20=20=20=20=20=20=20=20tag_id,=0A=20=20=20=20=
=20=20=20=20description,=0A=20=20=20=20=20=20=20=20tag_name,=0A=20=20=20=20=
=20=20=20=20parent_id,=0A=20=20=20=20=20=20=20=20readonly,=0A=20=20=20=20=
=20=20=20=20type=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=
=20=20=20=20=20=20=20v_tag_id,=0A=20=20=20=20=20=20=20=20v_description,=0A=
=20=20=20=20=20=20=20=20v_tag_name,=0A=20=20=20=20=20=20=20=20=
v_parent_id,=0A=20=20=20=20=20=20=20=20v_readonly,=0A=20=20=20=20=20=20=20=
=20v_type=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Updatetags=20(=0A=
=20=20=20=20v_description=20VARCHAR(4000),=0A=20=20=20=20v_tag_id=20=
UUID,=0A=20=20=20=20v_tag_name=20VARCHAR(50),=0A=20=20=20=20v_parent_id=20=
UUID,=0A=20=20=20=20v_readonly=20BOOLEAN,=0A=20=20=20=20v_type=20INT=0A=20=
=20=20=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20tags=0A=20=20=20=20SET=20=
description=20=3D=20v_description,=0A=20=20=20=20=20=20=20=20tag_name=20=
=3D=20v_tag_name,=0A=20=20=20=20=20=20=20=20parent_id=20=3D=20=
v_parent_id,=0A=20=20=20=20=20=20=20=20readonly=20=3D=20v_readonly,=0A=20=
=20=20=20=20=20=20=20type=20=3D=20v_type,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20WHERE=20tag_id=20=3D=20=
v_tag_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Deletetags=20(v_tag_id=20=
UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20v_val=20UUID;=0A=0A=
BEGIN=0A=20=20=20=20--=20Get=20(and=20keep)=20a=20shared=20lock=20with=20=
"right=20to=20upgrade=20to=20exclusive"=0A=20=20=20=20--=20in=20order=20=
to=20force=20locking=20parent=20before=20children=0A=20=20=20=20SELECT=20=
tag_id=0A=20=20=20=20INTO=20v_val=0A=20=20=20=20FROM=20tags=0A=20=20=20=20=
WHERE=20tag_id=20=3D=20v_tag_id=0A=20=20=20=20FOR=0A=0A=20=20=20=20=
UPDATE;=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20tags_user_group_map=0A=
=20=20=20=20WHERE=20tag_id=20=3D=20v_tag_id;=0A=0A=20=20=20=20DELETE=0A=20=
=20=20=20FROM=20tags_user_map=0A=20=20=20=20WHERE=20tag_id=20=3D=20=
v_tag_id;=0A=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20tags_vm_map=0A=20=20=
=20=20WHERE=20tag_id=20=3D=20v_tag_id;=0A=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20tags_vds_map=0A=20=20=20=20WHERE=20tag_id=20=3D=20v_tag_id;=0A=0A=
=20=20=20=20DELETE=0A=20=20=20=20FROM=20tags_vm_pool_map=0A=20=20=20=20=
WHERE=20tag_id=20=3D=20v_tag_id;=0A=0A=20=20=20=20DELETE=0A=20=20=20=20=
FROM=20tags=0A=20=20=20=20WHERE=20tag_id=20=3D=20v_tag_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromtags=20()=0ARETURNS=20SETOF=20tags=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20tags.*=0A=20=20=20=20FROM=20tags;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GettagsBytag_id=20(v_tag_id=20UUID)=0ARETURNS=20SETOF=20tags=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20tags.*=0A=20=20=20=20FROM=20tags=0A=20=20=20=20WHERE=20tag_id=20=
=3D=20v_tag_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GettagsByparent_id=20=
(v_parent_id=20UUID)=0ARETURNS=20SETOF=20tags=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
tags.*=0A=20=20=20=20FROM=20tags=0A=20=20=20=20WHERE=20parent_id=20=3D=20=
v_parent_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GettagsBytag_name=20=
(v_tag_name=20VARCHAR(50))=0ARETURNS=20SETOF=20tags=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
tags.*=0A=20=20=20=20FROM=20tags=0A=20=20=20=20WHERE=20tag_name=20=3D=20=
v_tag_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Inserttags_user_group_map=20(=0A=20=20=20=20v_group_id=20UUID,=0A=20=20=20=
=20v_tag_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20tags_user_group_map=20(=0A=20=20=20=20=
=20=20=20=20group_id,=0A=20=20=20=20=20=20=20=20tag_id=0A=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_group_id,=0A=
=20=20=20=20=20=20=20=20v_tag_id=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Deletetags_user_group_map=20(=0A=20=20=20=20=
v_group_id=20UUID,=0A=20=20=20=20v_tag_id=20UUID=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20tags_user_group_map=0A=20=20=20=20WHERE=20group_id=20=3D=20=
v_group_id=0A=20=20=20=20=20=20=20=20AND=20tag_id=20=3D=20v_tag_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromtags_user_group_map=20()=0ARETURNS=20=
SETOF=20tags_user_group_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20tags_user_group_map.*=0A=20=20=
=20=20FROM=20tags_user_group_map;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetTagUserGroupByGroupIdAndByTagId=20(=0A=20=20=20=20v_group_id=20UUID,=0A=
=20=20=20=20v_tag_id=20UUID=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
tags_user_group_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20tags_user_group_map.*=0A=20=20=20=
=20FROM=20tags_user_group_map=0A=20=20=20=20WHERE=20group_id=20=3D=20=
v_group_id=0A=20=20=20=20=20=20=20=20AND=20tag_id=20=3D=20v_tag_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetTagsByUserGroupId=20(v_group_ids=20=
VARCHAR(4000))=0ARETURNS=20SETOF=20tags_user_group_map_view=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20DISTINCT=20tags_user_group_map_view.*=0A=20=20=20=20FROM=20=
tags_user_group_map_view=0A=20=20=20=20WHERE=20group_id=20IN=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20fnSplitterUuid(v_group_ids)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Inserttags_user_map=20(=0A=
=20=20=20=20v_tag_id=20UUID,=0A=20=20=20=20v_user_id=20UUID=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20tags_user_map=20(=0A=20=20=20=20=20=20=20=20tag_id,=0A=20=20=20=20=
=20=20=20=20user_id=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=
=20=20=20=20=20=20=20=20v_tag_id,=0A=20=20=20=20=20=20=20=20v_user_id=0A=20=
=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Deletetags_user_map=20(=0A=
=20=20=20=20v_tag_id=20UUID,=0A=20=20=20=20v_user_id=20UUID=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=
=20=20FROM=20tags_user_map=0A=20=20=20=20WHERE=20tag_id=20=3D=20v_tag_id=0A=
=20=20=20=20=20=20=20=20AND=20user_id=20=3D=20v_user_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromtags_user_map=20()=0ARETURNS=20SETOF=20=
tags_user_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20tags_user_map.*=0A=20=20=20=20FROM=20=
tags_user_map;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetTagUserByTagIdAndByuserId=20(=0A=20=20=20=20v_tag_id=20UUID,=0A=20=20=20=
=20v_user_id=20UUID=0A=20=20=20=20)=0ARETURNS=20SETOF=20tags_user_map=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20tags_user_map.*=0A=20=20=20=20FROM=20tags_user_map=0A=20=20=
=20=20WHERE=20tag_id=20=3D=20v_tag_id=0A=20=20=20=20=20=20=20=20AND=20=
user_id=20=3D=20v_user_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetTagsByUserId=20=
(v_user_ids=20VARCHAR(4000))=0ARETURNS=20SETOF=20tags_user_map_view=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20DISTINCT=20tags_user_map_view.*=0A=20=20=20=20FROM=20=
tags_user_map_view=0A=20=20=20=20WHERE=20user_id=20IN=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20fnSplitterUuid(v_user_ids)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetUserTagsByTagIds=20(v_tag_ids=20VARCHAR(4000))=0A=
RETURNS=20SETOF=20tags_user_map_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20DISTINCT=20=
tags_user_map_view.*=0A=20=20=20=20FROM=20tags_user_map_view=0A=20=20=20=20=
WHERE=20tag_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20fnSplitterUuid(v_tag_ids)=0A=20=
=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Inserttags_vds_map=20(=0A=20=20=20=20v_tag_id=20UUID,=0A=20=20=20=20=
v_vds_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20tags_vds_map=20(=0A=20=20=20=20=20=20=
=20=20tag_id,=0A=20=20=20=20=20=20=20=20vds_id=0A=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_tag_id,=0A=20=20=20=
=20=20=20=20=20v_vds_id=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Deletetags_vds_map=20(=0A=20=20=20=20v_tag_id=20UUID,=0A=20=20=20=20=
v_vds_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20tags_vds_map=0A=20=20=20=20=
WHERE=20tag_id=20=3D=20v_tag_id=0A=20=20=20=20=20=20=20=20AND=20vds_id=20=
=3D=20v_vds_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromtags_vds_map=20=
()=0ARETURNS=20SETOF=20tags_vds_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20tags_vds_map.*=0A=20=
=20=20=20FROM=20tags_vds_map;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetTagVdsBytagIdAndByVdsId=20(=0A=20=20=20=20v_tag_id=20UUID,=0A=20=20=20=
=20v_vds_id=20UUID=0A=20=20=20=20)=0ARETURNS=20SETOF=20tags_vds_map=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20tags_vds_map.*=0A=20=20=20=20FROM=20tags_vds_map=0A=20=20=20=
=20WHERE=20tag_id=20=3D=20v_tag_id=0A=20=20=20=20=20=20=20=20AND=20=
vds_id=20=3D=20v_vds_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetTagsByVdsId=20=
(v_vds_ids=20VARCHAR(4000))=0ARETURNS=20SETOF=20tags_vds_map_view=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20DISTINCT=20tags_vds_map_view.*=0A=20=20=20=20FROM=20=
tags_vds_map_view=0A=20=20=20=20WHERE=20vds_id=20IN=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20fnSplitterUuid(v_vds_ids)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Inserttags_vm_map=20(=0A=20=20=20=20v_tag_id=20=
UUID,=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20v_DefaultDisplayType=20=
INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20INSERT=20INTO=20tags_vm_map=20(=0A=20=20=20=20=20=20=20=20tag_id,=0A=20=
=20=20=20=20=20=20=20vm_id,=0A=20=20=20=20=20=20=20=20DefaultDisplayType=0A=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=
=20v_tag_id,=0A=20=20=20=20=20=20=20=20v_vm_id,=0A=20=20=20=20=20=20=20=20=
v_DefaultDisplayType=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Deletetags_vm_map=20(=0A=20=20=20=20v_tag_id=20UUID,=0A=20=20=20=20=
v_vm_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20tags_vm_map=0A=20=20=20=20=
WHERE=20tag_id=20=3D=20v_tag_id=0A=20=20=20=20=20=20=20=20AND=20vm_id=20=
=3D=20v_vm_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromtags_vm_map=20=
()=0ARETURNS=20SETOF=20tags_vm_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20tags_vm_map.*=0A=20=20=
=20=20FROM=20tags_vm_map;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetTagVmByTagIdAndByvmId=20=
(=0A=20=20=20=20v_tag_id=20UUID,=0A=20=20=20=20v_vm_id=20UUID=0A=20=20=20=
=20)=0ARETURNS=20SETOF=20tags_vm_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20tags_vm_map.*=0A=20=20=
=20=20FROM=20tags_vm_map=0A=20=20=20=20WHERE=20tag_id=20=3D=20v_tag_id=0A=
=20=20=20=20=20=20=20=20AND=20vm_id=20=3D=20v_vm_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetTagsByVmId=20(v_vm_ids=20VARCHAR(4000))=0ARETURNS=20SETOF=20=
tags_vm_map_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20DISTINCT=20tags_vm_map_view.*=0A=
=20=20=20=20FROM=20tags_vm_map_view=0A=20=20=20=20WHERE=20vm_id=20IN=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=
=20=20=20=20FROM=20fnSplitterUuid(v_vm_ids)=0A=20=20=20=20=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVmTagsByTagId=20=
(v_tag_ids=20VARCHAR(4000))=0ARETURNS=20SETOF=20tags_vm_map_view=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20DISTINCT=20tags_vm_map_view.*=0A=20=20=20=20FROM=20=
tags_vm_map_view=0A=20=20=20=20WHERE=20tag_id=20IN=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitterUuid(v_tag_ids)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateVmTagsDefaultDisplayType=20(=0A=20=20=20=20=
v_tag_id=20UUID,=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20=
v_DefaultDisplayType=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20tags_vm_map=0A=20=20=20=20SET=20=
DefaultDisplayType=20=3D=20v_DefaultDisplayType=0A=20=20=20=20WHERE=20=
tags_vm_map.tag_id=20=3D=20v_tag_id=0A=20=20=20=20=20=20=20=20AND=20=
tags_vm_map.vm_id=20=3D=20v_vm_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetnVmTagsByVmId=20=
(v_vm_id=20UUID)=0ARETURNS=20SETOF=20tags_vm_map=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20tags_vm_map=0A=20=20=20=20WHERE=20=
tags_vm_map.vm_id=20=3D=20v_vm_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetnVmTagsByVmIdAndDefaultTag=20(v_vm_id=20UUID)=0ARETURNS=20SETOF=20=
tags_vm_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20tags_vm_map.*=0A=20=20=20=20FROM=20=
tags_vm_map=0A=20=20=20=20INNER=20JOIN=20tags=0A=20=20=20=20=20=20=20=20=
ON=20tags.tag_id=20=3D=20tags_vm_map.tag_id=0A=20=20=20=20WHERE=20=
tags_vm_map.vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20AND=20=
tags.type=20=3D=201;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20RemoveAllVmTagsByVmId=20=
(v_vm_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20tags_vm_map=0A=20=20=20=20WHERE=20vm_id=20=3D=20=
v_vm_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Inserttags_vm_pool_map=20=
(=0A=20=20=20=20v_tag_id=20UUID,=0A=20=20=20=20v_vm_pool_id=20UUID=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20tags_vm_pool_map=20(=0A=20=20=20=20=20=20=20=20tag_id,=0A=20=20=20=
=20=20=20=20=20vm_pool_id=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_tag_id,=0A=20=20=20=20=20=20=20=20=
v_vm_pool_id=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Updatetags_vm_pool_map=20(=0A=20=20=20=20v_tag_id=20INT,=0A=20=20=20=20=
v_vm_pool_id=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=
=20=20AS=20$PROCEDURE$=0ABEGIN=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20Deletetags_vm_pool_map=20=
(=0A=20=20=20=20v_tag_id=20UUID,=0A=20=20=20=20v_vm_pool_id=20UUID=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=
=20=20=20=20FROM=20tags_vm_pool_map=0A=20=20=20=20WHERE=20tag_id=20=3D=20=
v_tag_id=0A=20=20=20=20=20=20=20=20AND=20vm_pool_id=20=3D=20=
v_vm_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromtags_vm_pool_map=20()=0ARETURNS=20SETOF=20tags_vm_pool_map=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20tags_vm_pool_map.*=0A=20=20=20=20FROM=20tags_vm_pool_map;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Gettags_vm_pool_mapBytag_idAndByvm_pool_id=20(=0A=20=
=20=20=20v_tag_id=20UUID,=0A=20=20=20=20v_vm_pool_id=20UUID=0A=20=20=20=20=
)=0ARETURNS=20SETOF=20tags_vm_pool_map=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
tags_vm_pool_map.*=0A=20=20=20=20FROM=20tags_vm_pool_map=0A=20=20=20=20=
WHERE=20tag_id=20=3D=20v_tag_id=0A=20=20=20=20=20=20=20=20AND=20=
vm_pool_id=20=3D=20v_vm_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetTagsByVmpoolId=20=
(v_vm_pool_ids=20VARCHAR(4000))=0ARETURNS=20SETOF=20=
tags_vm_pool_map_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20DISTINCT=20=
tags_vm_pool_map_view.*=0A=20=20=20=20FROM=20tags_vm_pool_map_view=0A=20=20=
=20=20WHERE=20vm_pool_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitterUuid(v_vm_pool_ids)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertUnregisteredDisk=20(=0A=20=20=20=20v_disk_id=20=
UUID,=0A=20=20=20=20v_image_id=20UUID,=0A=20=20=20=20v_disk_alias=20=
VARCHAR(255),=0A=20=20=20=20v_disk_description=20VARCHAR(255),=0A=20=20=20=
=20v_storage_domain_id=20UUID,=0A=20=20=20=20v_creation_date=20TIMESTAMP=20=
WITH=20TIME=20ZONE,=0A=20=20=20=20v_last_modified=20TIMESTAMP=20WITH=20=
TIME=20ZONE,=0A=20=20=20=20v_volume_type=20INTEGER,=0A=20=20=20=20=
v_volume_format=20INTEGER,=0A=20=20=20=20v_actual_size=20bigint,=0A=20=20=
=20=20v_size=20bigint=0A=20=20=20=20)=0ARETURNS=20VOID=0AAS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20unregistered_disks=20(=0A=
=20=20=20=20=20=20=20=20disk_id,=0A=20=20=20=20=20=20=20=20image_id,=0A=20=
=20=20=20=20=20=20=20disk_alias,=0A=20=20=20=20=20=20=20=20=
disk_description,=0A=20=20=20=20=20=20=20=20storage_domain_id,=0A=20=20=20=
=20=20=20=20=20creation_date,=0A=20=20=20=20=20=20=20=20last_modified,=0A=
=20=20=20=20=20=20=20=20volume_type,=0A=20=20=20=20=20=20=20=20=
volume_format,=0A=20=20=20=20=20=20=20=20actual_size,=0A=20=20=20=20=20=20=
=20=20size=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=
=20=20=20=20=20v_disk_id,=0A=20=20=20=20=20=20=20=20v_image_id,=0A=20=20=20=
=20=20=20=20=20v_disk_alias,=0A=20=20=20=20=20=20=20=20=
v_disk_description,=0A=20=20=20=20=20=20=20=20v_storage_domain_id,=0A=20=20=
=20=20=20=20=20=20v_creation_date,=0A=20=20=20=20=20=20=20=20=
v_last_modified,=0A=20=20=20=20=20=20=20=20v_volume_type,=0A=20=20=20=20=20=
=20=20=20v_volume_format,=0A=20=20=20=20=20=20=20=20v_actual_size,=0A=20=20=
=20=20=20=20=20=20v_size=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertUnregisteredDisksToVms=20(=0A=20=20=20=20v_disk_id=20UUID,=0A=20=20=
=20=20v_entity_id=20UUID,=0A=20=20=20=20v_entity_name=20VARCHAR(255),=0A=20=
=20=20=20v_storage_domain_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=0A=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
unregistered_disks_to_vms=20(=0A=20=20=20=20=20=20=20=20disk_id,=0A=20=20=
=20=20=20=20=20=20entity_id,=0A=20=20=20=20=20=20=20=20entity_name,=0A=20=
=20=20=20=20=20=20=20storage_domain_id=0A=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_disk_id,=0A=20=20=20=20=20=20=
=20=20v_entity_id,=0A=20=20=20=20=20=20=20=20v_entity_name,=0A=20=20=20=20=
=20=20=20=20v_storage_domain_id=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20RemoveDiskFromUnregistered=20(=0A=20=20=20=20=
v_disk_id=20UUID,=0A=20=20=20=20v_storage_domain_id=20UUID=0A=20=20=20=20=
)=0ARETURNS=20VOID=0AAS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=
=20=20FROM=20unregistered_disks=0A=20=20=20=20WHERE=20(disk_id=20=3D=20=
v_disk_id=0A=20=20=20=20=20=20=20=20OR=20v_disk_id=20IS=20NULL)=0A=20=20=20=
=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
storage_domain_id=20=3D=20v_storage_domain_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20OR=20v_storage_domain_id=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
RemoveDiskFromUnregisteredRelatedToVM=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=
=20=20=20=20v_storage_domain_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=0A=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
unregistered_disks=0A=20=20=20=20WHERE=20disk_id=20IN=20(SELECT=20=
disk_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20unregistered_disks_to_vms=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20entity_id=20=3D=20v_vm_id)=0A=20=20=
=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
storage_domain_id=20=3D=20v_storage_domain_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20OR=20v_storage_domain_id=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetDiskByDiskIdAndStorageDomainId=20(=0A=20=20=20=20v_disk_id=20UUID,=0A=20=
=20=20=20v_storage_domain_id=20UUID=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
unregistered_disks=20STABLE=0AAS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
unregistered_disks=0A=20=20=20=20WHERE=20(disk_id=20=3D=20v_disk_id=0A=20=
=20=20=20=20=20=20=20OR=20v_disk_id=20IS=20NULL)=0A=20=20=20=20=20=20=20=20=
AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20storage_domain_id=20=3D=20=
v_storage_domain_id=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
v_storage_domain_id=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetEntitiesByDiskId=20(=0A=20=20=20=20v_disk_id=20=
UUID)=0ARETURNS=20SETOF=20unregistered_disks_to_vms=20STABLE=0AAS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20unregistered_disks_to_vms=0A=20=20=20=20WHERE=20=
disk_id=20=3D=20v_disk_id=0A=20=20=20=20=20=20=20OR=20v_disk_id=20IS=20=
NULL;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertOVFDataForEntities=20=
(=0A=20=20=20=20v_entity_guid=20UUID,=0A=20=20=20=20v_entity_name=20=
VARCHAR(255),=0A=20=20=20=20v_entity_type=20VARCHAR(32),=0A=20=20=20=20=
v_architecture=20INT,=0A=20=20=20=20v_lowest_comp_version=20VARCHAR(40),=0A=
=20=20=20=20v_storage_domain_id=20UUID,=0A=20=20=20=20v_ovf_data=20TEXT,=0A=
=20=20=20=20v_ovf_extra_data=20TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
unregistered_ovf_of_entities=20(=0A=20=20=20=20=20=20=20=20entity_guid,=0A=
=20=20=20=20=20=20=20=20entity_name,=0A=20=20=20=20=20=20=20=20=
entity_type,=0A=20=20=20=20=20=20=20=20architecture,=0A=20=20=20=20=20=20=
=20=20lowest_comp_version,=0A=20=20=20=20=20=20=20=20storage_domain_id,=0A=
=20=20=20=20=20=20=20=20ovf_extra_data,=0A=20=20=20=20=20=20=20=20=
ovf_data=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=
=20=20=20=20=20v_entity_guid,=0A=20=20=20=20=20=20=20=20v_entity_name,=0A=
=20=20=20=20=20=20=20=20v_entity_type,=0A=20=20=20=20=20=20=20=20=
v_architecture,=0A=20=20=20=20=20=20=20=20v_lowest_comp_version,=0A=20=20=
=20=20=20=20=20=20v_storage_domain_id,=0A=20=20=20=20=20=20=20=20=
v_ovf_extra_data,=0A=20=20=20=20=20=20=20=20v_ovf_data=0A=20=20=20=20=20=20=
=20=20);=0A=0A=20=20=20=20UPDATE=20unregistered_ovf_of_entities=20u=0A=20=
=20=20=20SET=20ovf_data=20=3D=20vog.ovf_data=0A=20=20=20=20FROM=20=
vm_ovf_generations=20vog=0A=20=20=20=20WHERE=20vog.vm_guid=20=3D=20=
u.entity_guid=0A=20=20=20=20=20=20=20=20AND=20u.entity_guid=20=3D=20=
v_entity_guid;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
RemoveEntityFromUnregistered=20(=0A=20=20=20=20v_entity_guid=20UUID,=0A=20=
=20=20=20v_storage_domain_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
unregistered_ovf_of_entities=0A=20=20=20=20WHERE=20entity_guid=20=3D=20=
v_entity_guid=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20storage_domain_id=20=3D=20v_storage_domain_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20OR=20v_storage_domain_id=20IS=20NULL=0A=20=20=20=20=20=
=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllOVFEntitiesForStorageDomainByEntityType=20(=0A=20=20=20=20=
v_storage_domain_id=20UUID,=0A=20=20=20=20v_entity_type=20VARCHAR(20)=0A=20=
=20=20=20)=0ARETURNS=20SETOF=20unregistered_ovf_of_entities=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20*=0A=20=20=20=20FROM=20unregistered_ovf_of_entities=0A=20=20=20=20=
WHERE=20storage_domain_id=20=3D=20v_storage_domain_id=0A=20=20=20=20=20=20=
=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20entity_type=20=3D=20=
v_entity_type=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20v_entity_type=20=
IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetOVFDataByEntityIdAndStorageDomain=20(=0A=20=20=20=20v_entity_guid=20=
UUID,=0A=20=20=20=20v_storage_domain_id=20UUID=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20unregistered_ovf_of_entities=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20unregistered_ovf_of_entities=0A=20=20=20=20WHERE=20entity_guid=20=
=3D=20v_entity_guid=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20storage_domain_id=20=3D=20v_storage_domain_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20OR=20v_storage_domain_id=20IS=20NULL=0A=20=20=20=
=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertUserProfile=20(=0A=20=
=20=20=20v_profile_id=20UUID,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=
=20v_ssh_public_key_id=20UUID,=0A=20=20=20=20v_ssh_public_key=20TEXT,=0A=20=
=20=20=20v_user_portal_vm_auto_login=20boolean=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
user_profiles=20(=0A=20=20=20=20=20=20=20=20profile_id,=0A=20=20=20=20=20=
=20=20=20user_id,=0A=20=20=20=20=20=20=20=20ssh_public_key_id,=0A=20=20=20=
=20=20=20=20=20ssh_public_key,=0A=20=20=20=20=20=20=20=20=
user_portal_vm_auto_login=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_profile_id,=0A=20=20=20=20=20=20=20=
=20v_user_id,=0A=20=20=20=20=20=20=20=20v_ssh_public_key_id,=0A=20=20=20=20=
=20=20=20=20v_ssh_public_key,=0A=20=20=20=20=20=20=20=20=
v_user_portal_vm_auto_login=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateUserProfile=20(=0A=20=20=20=20v_profile_id=20=
UUID,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_ssh_public_key_id=20=
UUID,=0A=20=20=20=20v_ssh_public_key=20TEXT,=0A=20=20=20=20=
v_user_portal_vm_auto_login=20boolean=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20user_profiles=0A=20=20=20=
=20SET=20profile_id=20=3D=20v_profile_id,=0A=20=20=20=20=20=20=20=20=
user_id=20=3D=20v_user_id,=0A=20=20=20=20=20=20=20=20ssh_public_key_id=20=
=3D=20v_ssh_public_key_id,=0A=20=20=20=20=20=20=20=20ssh_public_key=20=3D=20=
v_ssh_public_key,=0A=20=20=20=20=20=20=20=20user_portal_vm_auto_login=20=
=3D=20v_user_portal_vm_auto_login=0A=20=20=20=20WHERE=20profile_id=20=3D=20=
v_profile_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteUserProfile=20=
(v_profile_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20DELETE=0A=20=20=20=20FROM=20user_profiles=0A=20=20=20=20WHERE=20=
profile_id=20=3D=20v_profile_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromUserProfiles=20=
()=0ARETURNS=20SETOF=20user_profiles_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
user_profiles_view.*=0A=20=20=20=20FROM=20user_profiles_view;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetUserProfileByUserId=20(v_user_id=20UUID)=0A=
RETURNS=20SETOF=20user_profiles_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20user_profiles_view=0A=20=20=20=20WHERE=20user_id=20=3D=20=
v_user_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetUserProfileByProfileId=20(v_profile_id=20UUID)=0ARETURNS=20SETOF=20=
user_profiles_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
user_profiles_view=0A=20=20=20=20WHERE=20profile_id=20=3D=20=
v_profile_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertUser=20(=0A=20=20=20=
=20v_department=20VARCHAR(255),=0A=20=20=20=20v_domain=20VARCHAR(255),=0A=
=20=20=20=20v_email=20VARCHAR(255),=0A=20=20=20=20v_name=20VARCHAR(255),=0A=
=20=20=20=20v_note=20VARCHAR(255),=0A=20=20=20=20v_surname=20=
VARCHAR(255),=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_username=20=
VARCHAR(255),=0A=20=20=20=20v_external_id=20TEXT,=0A=20=20=20=20=
v_namespace=20VARCHAR(2048)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20users=20(=0A=20=20=20=20=
=20=20=20=20department,=0A=20=20=20=20=20=20=20=20domain,=0A=20=20=20=20=20=
=20=20=20email,=0A=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20=
note,=0A=20=20=20=20=20=20=20=20surname,=0A=20=20=20=20=20=20=20=20=
user_id,=0A=20=20=20=20=20=20=20=20username,=0A=20=20=20=20=20=20=20=20=
external_id,=0A=20=20=20=20=20=20=20=20namespace=0A=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_department,=0A=20=20=
=20=20=20=20=20=20v_domain,=0A=20=20=20=20=20=20=20=20v_email,=0A=20=20=20=
=20=20=20=20=20v_name,=0A=20=20=20=20=20=20=20=20v_note,=0A=20=20=20=20=20=
=20=20=20v_surname,=0A=20=20=20=20=20=20=20=20v_user_id,=0A=20=20=20=20=20=
=20=20=20v_username,=0A=20=20=20=20=20=20=20=20v_external_id,=0A=20=20=20=
=20=20=20=20=20v_namespace=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateUserImpl=20(=0A=20=20=20=20v_department=20=
VARCHAR(255),=0A=20=20=20=20v_domain=20VARCHAR(255),=0A=20=20=20=20=
v_email=20VARCHAR(255),=0A=20=20=20=20v_name=20VARCHAR(255),=0A=20=20=20=20=
v_note=20VARCHAR(255),=0A=20=20=20=20v_surname=20VARCHAR(255),=0A=20=20=20=
=20v_user_id=20UUID,=0A=20=20=20=20v_username=20VARCHAR(255),=0A=20=20=20=
=20v_external_id=20TEXT,=0A=20=20=20=20v_namespace=20VARCHAR(2048)=0A=20=20=
=20=20)=0ARETURNS=20INT=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0A=
DECLARE=20updated_rows=20INT;=0A=0ABEGIN=0A=20=20=20=20UPDATE=20users=0A=20=
=20=20=20SET=20department=20=3D=20v_department,=0A=20=20=20=20=20=20=20=20=
domain=20=3D=20v_domain,=0A=20=20=20=20=20=20=20=20email=20=3D=20=
v_email,=0A=20=20=20=20=20=20=20=20name=20=3D=20v_name,=0A=20=20=20=20=20=
=20=20=20note=20=3D=20v_note,=0A=20=20=20=20=20=20=20=20surname=20=3D=20=
v_surname,=0A=20=20=20=20=20=20=20=20username=20=3D=20v_username,=0A=20=20=
=20=20=20=20=20=20external_id=20=3D=20v_external_id,=0A=20=20=20=20=20=20=
=20=20namespace=20=3D=20v_namespace,=0A=20=20=20=20=20=20=20=20=
_update_date=20=3D=20CURRENT_TIMESTAMP=0A=20=20=20=20WHERE=20external_id=20=
=3D=20v_external_id=0A=20=20=20=20=20=20=20=20AND=20domain=20=3D=20=
v_domain;=0A=0A=20=20=20=20GET=20DIAGNOSTICS=20updated_rows=20=3D=20=
ROW_COUNT;=0A=0A=20=20=20=20RETURN=20updated_rows;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateUser=20(=0A=20=20=20=20v_department=20VARCHAR(255),=0A=20=20=20=20=
v_domain=20VARCHAR(255),=0A=20=20=20=20v_email=20VARCHAR(255),=0A=20=20=20=
=20v_name=20VARCHAR(255),=0A=20=20=20=20v_note=20VARCHAR(255),=0A=20=20=20=
=20v_surname=20VARCHAR(255),=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20=
v_username=20VARCHAR(255),=0A=20=20=20=20v_last_admin_check_status=20=
BOOLEAN,=0A=20=20=20=20v_external_id=20TEXT,=0A=20=20=20=20v_namespace=20=
VARCHAR(2048)=0A=20=20=20=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=
=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20PERFORM=20UpdateUserImpl(=0A=20=
=20=20=20=20=20=20=20v_department,=0A=20=20=20=20=20=20=20=20v_domain,=0A=
=20=20=20=20=20=20=20=20v_email,=0A=20=20=20=20=20=20=20=20v_name,=0A=20=20=
=20=20=20=20=20=20v_note,=0A=20=20=20=20=20=20=20=20v_surname,=0A=20=20=20=
=20=20=20=20=20v_user_id,=0A=20=20=20=20=20=20=20=20v_username,=0A=20=20=20=
=20=20=20=20=20v_external_id,=0A=20=20=20=20=20=20=20=20v_namespace);=0A=0A=
=20=20=20=20UPDATE=20users=0A=20=20=20=20SET=20last_admin_check_status=20=
=3D=20v_last_admin_check_status=0A=20=20=20=20WHERE=20domain=20=3D=20=
v_domain=0A=20=20=20=20=20=20=20=20AND=20external_id=20=3D=20=
v_external_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertOrUpdateUser=20(=0A=
=20=20=20=20v_department=20VARCHAR(255),=0A=20=20=20=20v_domain=20=
VARCHAR(255),=0A=20=20=20=20v_email=20VARCHAR(255),=0A=20=20=20=20v_name=20=
VARCHAR(255),=0A=20=20=20=20v_note=20VARCHAR(255),=0A=20=20=20=20=
v_surname=20VARCHAR(255),=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20=
v_username=20VARCHAR(255),=0A=20=20=20=20v_external_id=20TEXT,=0A=20=20=20=
=20v_namespace=20VARCHAR(2048)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ADECLARE=20updated_rows=20INT;=0A=0ABEGIN=0A=20=20=20=20=
SELECT=20UpdateUserImpl(=0A=20=20=20=20=20=20=20=20v_department,=0A=20=20=
=20=20=20=20=20=20v_domain,=0A=20=20=20=20=20=20=20=20v_email,=0A=20=20=20=
=20=20=20=20=20v_name,=0A=20=20=20=20=20=20=20=20v_note,=0A=20=20=20=20=20=
=20=20=20v_surname,=0A=20=20=20=20=20=20=20=20v_user_id,=0A=20=20=20=20=20=
=20=20=20v_username,=0A=20=20=20=20=20=20=20=20v_external_id,=0A=20=20=20=
=20=20=20=20=20v_namespace)=0A=20=20=20=20INTO=20updated_rows;=0A=0A=20=20=
=20=20IF=20(updated_rows=20=3D=200)=20THEN=0A=20=20=20=20=20=20=20=20=
PERFORM=20InsertUser(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_department,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_domain,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_email,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_note,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_surname,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_user_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_username,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20v_external_id,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20v_namespace);=0A=20=20=20=20END=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20=
FUNCTION=20DeleteUser=20(v_user_id=20UUID)=0A=20=20=20=20RETURNS=20VOID=20=
AS=20$PROCEDURE$=0A=0A=20=20=20=20DECLARE=20v_val=20UUID;=0A=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20--=20Get=20(and=20keep)=20a=20shared=20=
lock=20with=20"right=20to=20upgrade=20to=20exclusive"=0A=20=20=20=20=20=20=
=20=20--=20in=20order=20to=20force=20locking=20parent=20before=20=
children=0A=20=20=20=20=20=20=20=20SELECT=20user_id=0A=20=20=20=20=20=20=20=
=20INTO=20v_val=0A=20=20=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=20=20=
=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20FOR=0A=0A=
=20=20=20=20=20=20=20=20UPDATE;=0A=0A=20=20=20=20=20=20=20=20DELETE=0A=20=
=20=20=20=20=20=20=20FROM=20tags_user_map=0A=20=20=20=20=20=20=20=20=
WHERE=20user_id=20=3D=20v_user_id;=0A=0A=20=20=20=20=20=20=20=20DELETE=0A=
=20=20=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=20=20=20=20WHERE=20=
user_id=20=3D=20v_user_id;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
REPLACE=20FUNCTION=20GetAllFromUsers=20(=0A=20=20=20=20=20=20=20=20=
v_user_id=20UUID,=0A=20=20=20=20=20=20=20=20v_is_filtered=20BOOLEAN=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20RETURNS=20SETOF=20users=20STABLE=20=
AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20users.*=0A=20=20=20=20=20=20=20=
=20FROM=20users=0A=20=20=20=20=20=20=20=20WHERE=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20users=20u,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
user_db_users_permissions_view=20p=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20u.user_id=20=3D=20v_user_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
u.user_id=20=3D=20p.ad_element_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20FUNCTION=20=
GetUserByUserId=20(=0A=20=20=20=20=20=20=20=20v_user_id=20UUID,=0A=20=20=20=
=20=20=20=20=20v_is_filtered=20BOOLEAN=0A=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20RETURNS=20SETOF=20users=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20users.*=0A=20=20=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=
=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20NOT=20=
v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20users=20u,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20user_db_users_permissions_view=20p=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20u.user_id=20=3D=20=
v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20AND=20u.user_id=20=3D=20p.ad_element_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20);=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20=
FUNCTION=20GetUserByExternalId=20(=0A=20=20=20=20=20=20=20=20v_domain=20=
VARCHAR(255),=0A=20=20=20=20=20=20=20=20v_external_id=20TEXT=0A=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20RETURNS=20SETOF=20users=20STABLE=20AS=20=
$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20users.*=0A=20=20=20=20=20=20=20=
=20FROM=20users=0A=20=20=20=20=20=20=20=20WHERE=20domain=20=3D=20=
v_domain=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20external_id=20=3D=20=
v_external_id;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20=
FUNCTION=20GetUserByUserNameAndDomain=20(=0A=20=20=20=20=20=20=20=20=
v_username=20VARCHAR(255),=0A=20=20=20=20=20=20=20=20v_domain=20=
VARCHAR(255)=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20RETURNS=20SETOF=20=
users=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20users.*=0A=20=
=20=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=20=20=20=20WHERE=20=
username=20=3D=20v_username=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
domain=20=3D=20v_domain;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
REPLACE=20FUNCTION=20GetUsersByVmGuid=20(v_vm_guid=20UUID)=0A=20=20=20=20=
RETURNS=20SETOF=20users=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20users.*=0A=20=20=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=
=20=20=20=20INNER=20JOIN=20permissions=0A=20=20=20=20=20=20=20=20=20=20=20=
=20ON=20users.user_id=20=3D=20permissions.ad_element_id=0A=20=20=20=20=20=
=20=20=20WHERE=20permissions.object_type_id=20=3D=202=0A=20=20=20=20=20=20=
=20=20=20=20=20=20AND=20permissions.object_id=20=3D=20v_vm_guid;=0A=20=20=
=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20FUNCTION=20=
UpdateLastAdminCheckStatus=20(v_userIds=20VARCHAR(4000))=0A=20=20=20=20=
RETURNS=20VOID=20AS=20$PROCEDURE$=0A=0A=20=20=20=20DECLARE=20v_id=20=
UUID;=0A=0A=20=20=20=20v_tempId=20VARCHAR(4000);=0A=0A=20=20=20=20=
myCursor=20CURSOR=0A=20=20=20=20FOR=0A=0A=20=20=20=20SELECT=20id=0A=20=20=
=20=20FROM=20fnSplitter(v_userIds);=0A=0A=20=20=20=20v_result=20INT;=0A=0A=
=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20--=20get=20users=20and=20its=20=
groups=0A=20=20=20=20=20=20=20=20--=20get=20their=20permission=20based=20=
on=20ad_element_id.=0A=20=20=20=20=20=20=20=20--=20if=20one=20=
permissions=20role's=20type=20is=20ADMIN(1)=20THEN=20set=20the=20user=20=
last_admin_check_status=20to=201=0A=20=20=20=20=20=20=20=20OPEN=20=
myCursor;=0A=0A=20=20=20=20=20=20=20=20FETCH=20myCursor=0A=20=20=20=20=20=
=20=20=20INTO=20v_tempId;=0A=0A=20=20=20=20=20=20=20=20WHILE=20FOUND=20=
LOOP=20v_id=20:=3D=20CAST(v_tempId=20AS=20UUID);=0A=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=20count(*)=0A=20=20=20=20=20=20=20=20=20=20=20=20INTO=20=
v_result=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20user_id=20IN=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20ad_element_id=20AS=20=
user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20permissions,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20roles=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20permissions.role_id=20=3D=20roles.id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
ad_element_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
ad_groups.id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20ad_groups,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20engine_sessions=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
engine_sessions.user_id=20=3D=20v_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20ad_groups.id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnsplitteruuid(engine_sessions.group_ids)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20)=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20UNION=0A=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=20v_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20roles.role_type=20=3D=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20permissions.role_id=20=
=3D=20'00000000-0000-0000-0000-000000000001'=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=
=20=20UPDATE=20users=0A=20=20=20=20=20=20=20=20SET=20=
last_admin_check_status=20=3D=20CASE=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20WHEN=20v_result=20=3D=200=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20THEN=20FALSE=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20ELSE=20TRUE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20END=0A=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20v_id;=0A=0A=20=20=
=20=20=20=20=20=20FETCH=20myCursor=0A=20=20=20=20=20=20=20=20INTO=20=
v_tempId;=0A=20=20=20=20END=20LOOP;=0A=0A=0A=20=20=20=20CLOSE=20=
myCursor;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetSessionUserAndGroupsById=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20=
v_engine_session_seq_id=20INT=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
idUuidType=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20ad_groups.ID=0A=20=20=20=20FROM=20=
ad_groups,=0A=20=20=20=20=20=20=20=20engine_sessions=0A=20=20=20=20WHERE=20=
engine_sessions.id=20=3D=20v_engine_session_seq_id=0A=20=20=20=20=20=20=20=
=20AND=20ad_groups.id=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnsplitteruuid(engine_sessions.group_ids)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=0A=20=20=20=20UNION=0A=0A=20=20=20=20SELECT=20v_id=0A=0A=20=20=
=20=20UNION=0A=0A=20=20=20=20--=20user=20is=20also=20member=20of=20=
'Everyone'=0A=20=20=20=20SELECT=20=
'EEE00000-0000-0000-0000-123456789EEE';=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertVdcOption=20=
(=0A=20=20=20=20v_option_name=20VARCHAR(50),=0A=20=20=20=20=
v_option_value=20VARCHAR(50),=0A=20=20=20=20v_version=20VARCHAR(40),=0A=20=
=20=20=20INOUT=20v_option_id=20INT=0A=20=20=20=20)=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20vdc_options=20(=0A=20=20=20=20=20=20=20=
=20OPTION_name,=0A=20=20=20=20=20=20=20=20option_value,=0A=20=20=20=20=20=
=20=20=20version=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=
=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=20=20=20=
v_option_value,=0A=20=20=20=20=20=20=20=20v_version=0A=20=20=20=20=20=20=20=
=20);=0A=0A=20=20=20=20v_option_id=20:=3D=20CURRVAL('vdc_options_seq');=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateVdcOption=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(50),=0A=20=20=20=20v_option_value=20VARCHAR(50),=0A=20=20=20=20=
v_option_id=20INT,=0A=20=20=20=20v_version=20VARCHAR(40)=0A=20=20=20=20)=0A=
RETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20UPDATE=20vdc_options=0A=20=20=20=20SET=20OPTION_name=20=3D=20=
v_option_name,=0A=20=20=20=20=20=20=20=20option_value=20=3D=20=
v_option_value,=0A=20=20=20=20=20=20=20=20version=20=3D=20v_version=0A=20=
=20=20=20WHERE=20option_id=20=3D=20v_option_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteVdcOption=20(v_option_id=20INT)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20WHERE=20option_id=20=3D=20v_option_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromVdcOption=20()=0ARETURNS=20SETOF=20=
vdc_options=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20vdc_options.*=0A=20=20=20=20FROM=20=
vdc_options;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVdcOptionById=20=
(v_option_id=20INT)=0ARETURNS=20SETOF=20vdc_options=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
vdc_options.*=0A=20=20=20=20FROM=20vdc_options=0A=20=20=20=20WHERE=20=
option_id=20=3D=20v_option_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVdcOptionByName=20(=0A=
=20=20=20=20v_option_name=20VARCHAR(50),=0A=20=20=20=20v_version=20=
VARCHAR(40)=0A=20=20=20=20)=0ARETURNS=20SETOF=20vdc_options=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20vdc_options.*=0A=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=
WHERE=20OPTION_name=20=3D=20v_option_name=0A=20=20=20=20=20=20=20=20AND=20=
version=20=3D=20v_version;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpsertKdumpStatus=20(=0A=20=
=20=20=20v_vds_id=20UUID,=0A=20=20=20=20v_status=20VARCHAR(20),=0A=20=20=20=
=20v_address=20VARCHAR(255)=0A=20=20=20=20)=0ARETURNS=20INT=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vds_kdump_status=0A=20=20=20=20=
SET=20status=20=3D=20v_status,=0A=20=20=20=20=20=20=20=20address=20=3D=20=
v_address=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id;=0A=0A=20=20=20=20=
IF=20NOT=20found=20THEN=0A=20=20=20=20=20=20=20=20INSERT=20INTO=20=
vds_kdump_status=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20vds_id,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20status,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20address=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20v_vds_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_status,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_address=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20END=20=
IF;=0A=0A=20=20=20=20RETURN=201;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpsertKdumpStatusForIp=20=
(=0A=20=20=20=20v_ip=20VARCHAR(20),=0A=20=20=20=20v_status=20=
VARCHAR(20),=0A=20=20=20=20v_address=20VARCHAR(255)=0A=20=20=20=20)=0A=
RETURNS=20INT=20AS=20$PROCEDURE$=0ADECLARE=20v_vds_id=20UUID;=0A=0A=
updated_rows=20INT;=0A=0ABEGIN=0A=20=20=20=20updated_rows=20:=3D=200;=0A=0A=
=20=20=20=20SELECT=20vds_id=0A=20=20=20=20INTO=20v_vds_id=0A=20=20=20=20=
FROM=20vds_interface=0A=20=20=20=20WHERE=20addr=20=3D=20v_ip;=0A=0A=20=20=
=20=20IF=20v_vds_id=20IS=20NOT=20NULL=20THEN=0A=20=20=20=20=20=20=20=20=
SELECT=20UpsertKdumpStatus(v_vds_id,=20v_status,=20v_address)=0A=20=20=20=
=20=20=20=20=20INTO=20updated_rows;=0A=20=20=20=20END=20IF;=0A=0A=20=20=20=
=20RETURN=20updated_rows;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
RemoveFinishedKdumpStatusForVds=20(v_vds_id=20UUID)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vds_kdump_status=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id=0A=20=20=20=
=20=20=20=20=20AND=20status=20=3D=20'finished';=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetKdumpStatusForVds=20(v_vds_id=20UUID)=0ARETURNS=20SETOF=20=
vds_kdump_status=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vds_kdump_status=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllUnfinishedVdsKdumpStatus=20()=0ARETURNS=20=
SETOF=20vds_kdump_status=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vds_kdump_status=0A=20=20=20=20WHERE=20status=20<>=20'finished';=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Insertvds_spm_id_map=20(=0A=20=20=20=20=
v_storage_pool_id=20UUID,=0A=20=20=20=20v_vds_id=20UUID,=0A=20=20=20=20=
v_vds_spm_id=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20vds_spm_id_map=20(=0A=20=20=20=20=20=20=
=20=20storage_pool_id,=0A=20=20=20=20=20=20=20=20vds_id,=0A=20=20=20=20=20=
=20=20=20vds_spm_id=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=
=20=20=20=20=20=20=20=20v_storage_pool_id,=0A=20=20=20=20=20=20=20=20=
v_vds_id,=0A=20=20=20=20=20=20=20=20v_vds_spm_id=0A=20=20=20=20=20=20=20=20=
);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20Deletevds_spm_id_map=20(v_vds_id=20UUID)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vds_spm_id_map=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteByPoolvds_spm_id_map=20(=0A=20=20=20=20=
v_vds_id=20UUID,=0A=20=20=20=20v_storage_pool_id=20UUID=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20vds_spm_id_map=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id=0A=
=20=20=20=20=20=20=20=20AND=20storage_pool_id=20=3D=20v_storage_pool_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromvds_spm_id_map=20()=0ARETURNS=20SETOF=20=
vds_spm_id_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20vds_spm_id_map.*=0A=20=20=20=20FROM=20=
vds_spm_id_map;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getvds_spm_id_mapBystorage_pool_idAndByvds_spm_id=20(=0A=20=20=20=20=
v_storage_pool_id=20UUID,=0A=20=20=20=20v_vds_spm_id=20INT=0A=20=20=20=20=
)=0ARETURNS=20SETOF=20vds_spm_id_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vds_spm_id_map.*=0A=20=
=20=20=20FROM=20vds_spm_id_map=0A=20=20=20=20WHERE=20storage_pool_id=20=3D=
=20v_storage_pool_id=0A=20=20=20=20=20=20=20=20AND=20vds_spm_id=20=3D=20=
v_vds_spm_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getvds_spm_id_mapBystorage_pool_id=20(v_storage_pool_id=20UUID)=0A=
RETURNS=20SETOF=20vds_spm_id_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vds_spm_id_map.*=0A=20=20=
=20=20FROM=20vds_spm_id_map=0A=20=20=20=20WHERE=20storage_pool_id=20=3D=20=
v_storage_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
Getvds_spm_id_mapByvds_id=20(v_vds_id=20UUID)=0ARETURNS=20SETOF=20=
vds_spm_id_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20vds_spm_id_map.*=0A=20=20=20=20FROM=20=
vds_spm_id_map=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertVdsStatistics=20(=0A=20=20=20=20v_cpu_idle=20=
DECIMAL(18,=200),=0A=20=20=20=20v_cpu_load=20DECIMAL(18,=200),=0A=20=20=20=
=20v_cpu_sys=20DECIMAL(18,=200),=0A=20=20=20=20v_cpu_user=20DECIMAL(18,=20=
0),=0A=20=20=20=20v_usage_cpu_percent=20INT,=0A=20=20=20=20=
v_usage_mem_percent=20INT,=0A=20=20=20=20v_usage_network_percent=20INT,=0A=
=20=20=20=20v_vds_id=20UUID,=0A=20=20=20=20v_mem_available=20BIGINT,=0A=20=
=20=20=20v_mem_free=20BIGINT,=0A=20=20=20=20v_mem_shared=20BIGINT,=0A=20=20=
=20=20v_swap_free=20BIGINT,=0A=20=20=20=20v_swap_total=20BIGINT,=0A=20=20=
=20=20v_ksm_cpu_percent=20INT,=0A=20=20=20=20v_ksm_pages=20BIGINT,=0A=20=20=
=20=20v_ksm_state=20BOOLEAN,=0A=20=20=20=20v_anonymous_hugepages=20INT,=0A=
=20=20=20=20v_boot_time=20BIGINT,=0A=20=20=20=20v_ha_score=20INT,=0A=20=20=
=20=20v_ha_configured=20BOOLEAN,=0A=20=20=20=20v_ha_active=20BOOLEAN,=0A=20=
=20=20=20v_ha_global_maintenance=20BOOLEAN,=0A=20=20=20=20=
v_ha_local_maintenance=20BOOLEAN,=0A=20=20=20=20=
v_cpu_over_commit_time_stamp=20TIMESTAMP=20WITH=20TIME=20ZONE=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20INSERT=20INTO=20vds_statistics=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20cpu_idle,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
cpu_load,=0A=20=20=20=20=20=20=20=20=20=20=20=20cpu_sys,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20cpu_user,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
usage_cpu_percent,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
usage_mem_percent,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
usage_network_percent,=0A=20=20=20=20=20=20=20=20=20=20=20=20vds_id,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20mem_available,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20mem_free,=0A=20=20=20=20=20=20=20=20=20=20=20=20mem_shared,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20swap_free,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20swap_total,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ksm_cpu_percent,=0A=20=20=20=20=20=20=20=20=20=20=20=20ksm_pages,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20ksm_state,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20anonymous_hugepages,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
boot_time,=0A=20=20=20=20=20=20=20=20=20=20=20=20ha_score,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20ha_configured,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20ha_active,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ha_global_maintenance,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ha_local_maintenance,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
cpu_over_commit_time_stamp=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_cpu_idle,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_cpu_load,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_cpu_sys,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20v_cpu_user,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_usage_cpu_percent,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_usage_mem_percent,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_usage_network_percent,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_vds_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_mem_available,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_mem_free,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_mem_shared,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_swap_free,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_swap_total,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_ksm_cpu_percent,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_ksm_pages,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_ksm_state,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_anonymous_hugepages,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20v_boot_time,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_ha_score,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_ha_configured,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_ha_active,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20v_ha_global_maintenance,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_ha_local_maintenance,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_cpu_over_commit_time_stamp=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=
=20=20=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateVdsStatistics=20(=0A=20=20=20=20v_cpu_idle=20DECIMAL(18,=200),=0A=20=
=20=20=20v_cpu_load=20DECIMAL(18,=200),=0A=20=20=20=20v_cpu_sys=20=
DECIMAL(18,=200),=0A=20=20=20=20v_cpu_user=20DECIMAL(18,=200),=0A=20=20=20=
=20v_usage_cpu_percent=20INT,=0A=20=20=20=20v_usage_mem_percent=20INT,=0A=
=20=20=20=20v_usage_network_percent=20INT,=0A=20=20=20=20v_vds_id=20=
UUID,=0A=20=20=20=20v_mem_available=20BIGINT,=0A=20=20=20=20v_mem_free=20=
BIGINT,=0A=20=20=20=20v_mem_shared=20BIGINT,=0A=20=20=20=20v_swap_free=20=
BIGINT,=0A=20=20=20=20v_swap_total=20BIGINT,=0A=20=20=20=20=
v_ksm_cpu_percent=20INT,=0A=20=20=20=20v_ksm_pages=20BIGINT,=0A=20=20=20=20=
v_ksm_state=20BOOLEAN,=0A=20=20=20=20v_anonymous_hugepages=20INT,=0A=20=20=
=20=20v_boot_time=20BIGINT,=0A=20=20=20=20v_ha_score=20INT,=0A=20=20=20=20=
v_ha_configured=20BOOLEAN,=0A=20=20=20=20v_ha_active=20BOOLEAN,=0A=20=20=20=
=20v_ha_global_maintenance=20BOOLEAN,=0A=20=20=20=20=
v_ha_local_maintenance=20BOOLEAN,=0A=20=20=20=20=
v_cpu_over_commit_time_stamp=20TIMESTAMP=20WITH=20TIME=20ZONE=0A=20=20=20=
=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20UPDATE=20=
vds_statistics=0A=20=20=20=20=20=20=20=20SET=20cpu_idle=20=3D=20=
v_cpu_idle,=0A=20=20=20=20=20=20=20=20=20=20=20=20cpu_load=20=3D=20=
v_cpu_load,=0A=20=20=20=20=20=20=20=20=20=20=20=20cpu_sys=20=3D=20=
v_cpu_sys,=0A=20=20=20=20=20=20=20=20=20=20=20=20cpu_user=20=3D=20=
v_cpu_user,=0A=20=20=20=20=20=20=20=20=20=20=20=20usage_cpu_percent=20=3D=20=
v_usage_cpu_percent,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
usage_mem_percent=20=3D=20v_usage_mem_percent,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20usage_network_percent=20=3D=20v_usage_network_percent,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20mem_available=20=3D=20v_mem_available,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20mem_free=20=3D=20v_mem_free,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20mem_shared=20=3D=20v_mem_shared,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20swap_free=20=3D=20v_swap_free,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20swap_total=20=3D=20v_swap_total,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20ksm_cpu_percent=20=3D=20v_ksm_cpu_percent,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20ksm_pages=20=3D=20v_ksm_pages,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20ksm_state=20=3D=20v_ksm_state,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20anonymous_hugepages=20=3D=20v_anonymous_hugepages,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20boot_time=20=3D=20v_boot_time,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20ha_score=20=3D=20v_ha_score,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20ha_configured=20=3D=20v_ha_configured,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20ha_active=20=3D=20v_ha_active,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20ha_global_maintenance=20=3D=20v_ha_global_maintenance,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20ha_local_maintenance=20=3D=20=
v_ha_local_maintenance,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
_update_date=20=3D=20LOCALTIMESTAMP,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
cpu_over_commit_time_stamp=20=3D=20v_cpu_over_commit_time_stamp=0A=20=20=20=
=20=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id;=0A=20=20=20=20END;=0A=0A=20=
=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteVdsStatistics=20=
(v_vds_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=20FROM=20=
vds_statistics=0A=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20=
v_vds_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromVdsStatistics=20()=0ARETURNS=20SETOF=20vds_statistics=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20vds_statistics.*=0A=20=
=20=20=20=20=20=20=20FROM=20vds_statistics;=0A=20=20=20=20END;=0A=0A=20=20=
=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVdsStatisticsByVdsId=20=
(v_vds_id=20UUID)=0ARETURNS=20SETOF=20vds_statistics=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20vds_statistics.*=0A=20=20=20=20=
=20=20=20=20FROM=20vds_statistics=0A=20=20=20=20=20=20=20=20WHERE=20=
vds_id=20=3D=20v_vds_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertVdsDynamic=20(=0A=20=20=20=20v_cpu_cores=20=
INT,=0A=20=20=20=20v_cpu_threads=20INT,=0A=20=20=20=20v_cpu_model=20=
VARCHAR(255),=0A=20=20=20=20v_cpu_speed_mh=20DECIMAL(18,=200),=0A=20=20=20=
=20v_if_total_speed=20VARCHAR(40),=0A=20=20=20=20v_kvm_enabled=20=
BOOLEAN,=0A=20=20=20=20v_mem_commited=20INT,=0A=20=20=20=20=
v_physical_mem_mb=20INT,=0A=20=20=20=20v_status=20INT,=0A=20=20=20=20=
v_vds_id=20UUID,=0A=20=20=20=20v_vm_active=20INT,=0A=20=20=20=20=
v_vm_count=20INT,=0A=20=20=20=20v_vms_cores_count=20INT,=0A=20=20=20=20=
v_vm_migrating=20INT,=0A=20=20=20=20v_incoming_migrations=20INT,=0A=20=20=
=20=20v_outgoing_migrations=20INT,=0A=20=20=20=20v_reserved_mem=20INT,=0A=
=20=20=20=20v_guest_overhead=20INT,=0A=20=20=20=20v_rpm_version=20=
VARCHAR(255),=0A=20=20=20=20v_software_version=20VARCHAR(40),=0A=20=20=20=
=20v_version_name=20VARCHAR(40),=0A=20=20=20=20v_build_name=20=
VARCHAR(40),=0A=20=20=20=20v_previous_status=20INT,=0A=20=20=20=20=
v_cpu_flags=20VARCHAR(4000),=0A=20=20=20=20v_pending_vcpus_count=20INT,=0A=
=20=20=20=20v_pending_vmem_size=20INT,=0A=20=20=20=20v_cpu_sockets=20=
INT,=0A=20=20=20=20v_net_config_dirty=20BOOLEAN,=0A=20=20=20=20=
v_supported_cluster_levels=20VARCHAR(40),=0A=20=20=20=20=
v_supported_engines=20VARCHAR(40),=0A=20=20=20=20v_host_os=20=
VARCHAR(4000),=0A=20=20=20=20v_kvm_version=20VARCHAR(4000),=0A=20=20=20=20=
v_libvirt_version=20VARCHAR(4000),=0A=20=20=20=20v_spice_version=20=
VARCHAR(4000),=0A=20=20=20=20v_gluster_version=20VARCHAR(4000),=0A=20=20=20=
=20v_librbd1_version=20VARCHAR(4000),=0A=20=20=20=20=
v_glusterfs_cli_version=20VARCHAR(4000),=0A=20=20=20=20v_kernel_version=20=
VARCHAR(4000),=0A=20=20=20=20v_iscsi_initiator_name=20VARCHAR(4000),=0A=20=
=20=20=20v_transparent_hugepages_state=20INT,=0A=20=20=20=20v_hooks=20=
TEXT,=0A=20=20=20=20v_hw_manufacturer=20VARCHAR(255),=0A=20=20=20=20=
v_hw_product_name=20VARCHAR(255),=0A=20=20=20=20v_hw_version=20=
VARCHAR(255),=0A=20=20=20=20v_hw_serial_number=20VARCHAR(255),=0A=20=20=20=
=20v_hw_uuid=20VARCHAR(255),=0A=20=20=20=20v_hw_family=20VARCHAR(255),=0A=
=20=20=20=20v_hbas=20TEXT,=0A=20=20=20=20v_supported_emulated_machines=20=
TEXT,=0A=20=20=20=20v_controlled_by_pm_policy=20BOOLEAN,=0A=20=20=20=20=
v_kdump_status=20SMALLINT,=0A=20=20=20=20v_selinux_enforce_mode=20INT,=0A=
=20=20=20=20v_auto_numa_balancing=20SMALLINT,=0A=20=20=20=20=
v_is_numa_supported=20BOOLEAN,=0A=20=20=20=20v_supported_rng_sources=20=
VARCHAR(255),=0A=20=20=20=20v_online_cpus=20TEXT,=0A=20=20=20=20=
v_is_update_available=20BOOLEAN,=0A=20=20=20=20v_is_hostdev_enabled=20=
BOOLEAN,=0A=20=20=20=20v_kernel_args=20TEXT=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=
=20INSERT=20INTO=20vds_dynamic=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
cpu_cores,=0A=20=20=20=20=20=20=20=20=20=20=20=20cpu_threads,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20cpu_model,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20cpu_speed_mh,=0A=20=20=20=20=20=20=20=20=20=20=20=20if_total_speed,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20kvm_enabled,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20mem_commited,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
physical_mem_mb,=0A=20=20=20=20=20=20=20=20=20=20=20=20status,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20vds_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vm_active,=0A=20=20=20=20=20=20=20=20=20=20=20=20vm_count,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20vm_migrating,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20incoming_migrations,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
outgoing_migrations,=0A=20=20=20=20=20=20=20=20=20=20=20=20reserved_mem,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20guest_overhead,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20rpm_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
software_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20version_name,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20build_name,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20previous_status,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
cpu_flags,=0A=20=20=20=20=20=20=20=20=20=20=20=20vms_cores_count,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20pending_vcpus_count,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20pending_vmem_size,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
cpu_sockets,=0A=20=20=20=20=20=20=20=20=20=20=20=20net_config_dirty,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20supported_cluster_levels,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20supported_engines,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20host_os,=0A=20=20=20=20=20=20=20=20=20=20=20=20kvm_version,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20libvirt_version,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20spice_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
gluster_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20librbd1_version,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20glusterfs_cli_version,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20kernel_version,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20iscsi_initiator_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
transparent_hugepages_state,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
hooks,=0A=20=20=20=20=20=20=20=20=20=20=20=20hw_manufacturer,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20hw_product_name,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20hw_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
hw_serial_number,=0A=20=20=20=20=20=20=20=20=20=20=20=20hw_uuid,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20hw_family,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20hbas,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
supported_emulated_machines,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
controlled_by_pm_policy,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
kdump_status,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
selinux_enforce_mode,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
auto_numa_balancing,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
is_numa_supported,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
supported_rng_sources,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
online_cpus,=0A=20=20=20=20=20=20=20=20=20=20=20=20is_update_available,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20is_hostdev_enabled,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20kernel_args=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_cpu_cores,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_cpu_threads,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_cpu_model,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20v_cpu_speed_mh,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_if_total_speed,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_kvm_enabled,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_mem_commited,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20v_physical_mem_mb,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_status,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_vds_id,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20v_vm_active,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_vm_count,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_vm_migrating,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_incoming_migrations,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_outgoing_migrations,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20v_reserved_mem,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_guest_overhead,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_rpm_version,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_software_version,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20v_version_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_build_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_previous_status,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_cpu_flags,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_vms_cores_count,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_pending_vcpus_count,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_pending_vmem_size,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_cpu_sockets,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_net_config_dirty,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_supported_cluster_levels,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_supported_engines,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_host_os,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_kvm_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_libvirt_version,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_spice_version,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_gluster_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_librbd1_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_glusterfs_cli_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_kernel_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_iscsi_initiator_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_transparent_hugepages_state,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_hooks,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_hw_manufacturer,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_hw_product_name,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_hw_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_hw_serial_number,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_hw_uuid,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20v_hw_family,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_hbas,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_supported_emulated_machines,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_controlled_by_pm_policy,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_kdump_status,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_selinux_enforce_mode,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_auto_numa_balancing,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_is_numa_supported,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_supported_rng_sources,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_online_cpus,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_is_update_available,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_is_hostdev_enabled,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_kernel_args=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=
END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateVdsDynamicPowerManagementPolicyFlag=20(=0A=20=20=20=20v_vds_id=20=
UUID,=0A=20=20=20=20v_controlled_by_pm_policy=20BOOLEAN=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20UPDATE=20vds_dynamic=0A=20=20=20=20=20=20=20=20SET=20=
controlled_by_pm_policy=20=3D=20v_controlled_by_pm_policy=0A=20=20=20=20=20=
=20=20=20WHERE=20vds_id=20=3D=20v_vds_id;=0A=20=20=20=20END;=0A=0A=20=20=20=
=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateVdsDynamic=20(=0A=20=
=20=20=20v_cpu_cores=20INT,=0A=20=20=20=20v_cpu_threads=20INT,=0A=20=20=20=
=20v_cpu_model=20VARCHAR(255),=0A=20=20=20=20v_cpu_speed_mh=20=
DECIMAL(18,=200),=0A=20=20=20=20v_if_total_speed=20VARCHAR(40),=0A=20=20=20=
=20v_kvm_enabled=20BOOLEAN,=0A=20=20=20=20v_mem_commited=20INT,=0A=20=20=20=
=20v_physical_mem_mb=20INT,=0A=20=20=20=20v_status=20INT,=0A=20=20=20=20=
v_vds_id=20UUID,=0A=20=20=20=20v_vm_active=20INT,=0A=20=20=20=20=
v_vm_count=20INT,=0A=20=20=20=20v_vms_cores_count=20INT,=0A=20=20=20=20=
v_vm_migrating=20INT,=0A=20=20=20=20v_incoming_migrations=20INT,=0A=20=20=
=20=20v_outgoing_migrations=20INT,=0A=20=20=20=20v_reserved_mem=20INT,=0A=
=20=20=20=20v_guest_overhead=20INT,=0A=20=20=20=20v_rpm_version=20=
VARCHAR(255),=0A=20=20=20=20v_software_version=20VARCHAR(40),=0A=20=20=20=
=20v_version_name=20VARCHAR(40),=0A=20=20=20=20v_build_name=20=
VARCHAR(40),=0A=20=20=20=20v_previous_status=20INT,=0A=20=20=20=20=
v_cpu_flags=20VARCHAR(4000),=0A=20=20=20=20v_pending_vcpus_count=20INT,=0A=
=20=20=20=20v_pending_vmem_size=20INT,=0A=20=20=20=20v_cpu_sockets=20=
INT,=0A=20=20=20=20v_net_config_dirty=20BOOLEAN,=0A=20=20=20=20=
v_supported_cluster_levels=20VARCHAR(40),=0A=20=20=20=20=
v_supported_engines=20VARCHAR(40),=0A=20=20=20=20v_host_os=20=
VARCHAR(4000),=0A=20=20=20=20v_kvm_version=20VARCHAR(4000),=0A=20=20=20=20=
v_libvirt_version=20VARCHAR(4000),=0A=20=20=20=20v_spice_version=20=
VARCHAR(4000),=0A=20=20=20=20v_gluster_version=20VARCHAR(4000),=0A=20=20=20=
=20v_librbd1_version=20VARCHAR(4000),=0A=20=20=20=20=
v_glusterfs_cli_version=20VARCHAR(4000),=0A=20=20=20=20v_kernel_version=20=
VARCHAR(4000),=0A=20=20=20=20v_iscsi_initiator_name=20VARCHAR(4000),=0A=20=
=20=20=20v_transparent_hugepages_state=20INT,=0A=20=20=20=20v_hooks=20=
TEXT,=0A=20=20=20=20v_non_operational_reason=20INT,=0A=20=20=20=20=
v_hw_manufacturer=20VARCHAR(255),=0A=20=20=20=20v_hw_product_name=20=
VARCHAR(255),=0A=20=20=20=20v_hw_version=20VARCHAR(255),=0A=20=20=20=20=
v_hw_serial_number=20VARCHAR(255),=0A=20=20=20=20v_hw_uuid=20=
VARCHAR(255),=0A=20=20=20=20v_hw_family=20VARCHAR(255),=0A=20=20=20=20=
v_hbas=20TEXT,=0A=20=20=20=20v_supported_emulated_machines=20TEXT,=0A=20=20=
=20=20v_kdump_status=20SMALLINT,=0A=20=20=20=20v_selinux_enforce_mode=20=
INT,=0A=20=20=20=20v_auto_numa_balancing=20SMALLINT,=0A=20=20=20=20=
v_is_numa_supported=20BOOLEAN,=0A=20=20=20=20v_supported_rng_sources=20=
VARCHAR(255),=0A=20=20=20=20v_online_cpus=20TEXT,=0A=20=20=20=20=
v_maintenance_reason=20TEXT,=0A=20=20=20=20v_is_update_available=20=
BOOLEAN,=0A=20=20=20=20v_is_hostdev_enabled=20BOOLEAN,=0A=20=20=20=20=
v_kernel_args=20TEXT,=0A=20=20=20=20v_pretty_name=20VARCHAR(255)=0A=20=20=
=20=20)=0ARETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20UPDATE=20vds_dynamic=0A=
=20=20=20=20=20=20=20=20SET=20cpu_cores=20=3D=20v_cpu_cores,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20cpu_threads=20=3D=20v_cpu_threads,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20cpu_model=20=3D=20v_cpu_model,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20cpu_speed_mh=20=3D=20v_cpu_speed_mh,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20if_total_speed=20=3D=20v_if_total_speed,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20kvm_enabled=20=3D=20v_kvm_enabled,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20mem_commited=20=3D=20v_mem_commited,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20physical_mem_mb=20=3D=20v_physical_mem_mb,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20status=20=3D=20v_status,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20vm_active=20=3D=20v_vm_active,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20vm_count=20=3D=20v_vm_count,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20vm_migrating=20=3D=20v_vm_migrating,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20incoming_migrations=20=3D=20v_incoming_migrations,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20outgoing_migrations=20=3D=20v_outgoing_migrations,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20reserved_mem=20=3D=20v_reserved_mem,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20guest_overhead=20=3D=20=
v_guest_overhead,=0A=20=20=20=20=20=20=20=20=20=20=20=20rpm_version=20=3D=20=
v_rpm_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20software_version=20=
=3D=20v_software_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
version_name=20=3D=20v_version_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
build_name=20=3D=20v_build_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
previous_status=20=3D=20v_previous_status,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20cpu_flags=20=3D=20v_cpu_flags,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vms_cores_count=20=3D=20v_vms_cores_count,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20pending_vcpus_count=20=3D=20v_pending_vcpus_count,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20pending_vmem_size=20=3D=20v_pending_vmem_size,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20cpu_sockets=20=3D=20v_cpu_sockets,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20net_config_dirty=20=3D=20=
v_net_config_dirty,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
supported_cluster_levels=20=3D=20v_supported_cluster_levels,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20supported_engines=20=3D=20v_supported_engines,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20host_os=20=3D=20v_host_os,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20kvm_version=20=3D=20v_kvm_version,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20libvirt_version=20=3D=20v_libvirt_version,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20spice_version=20=3D=20v_spice_version,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20gluster_version=20=3D=20=
v_gluster_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20librbd1_version=20=
=3D=20v_librbd1_version,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
glusterfs_cli_version=20=3D=20v_glusterfs_cli_version,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20kernel_version=20=3D=20v_kernel_version,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20iscsi_initiator_name=20=3D=20=
v_iscsi_initiator_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
transparent_hugepages_state=20=3D=20v_transparent_hugepages_state,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20hooks=20=3D=20v_hooks,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20non_operational_reason=20=3D=20=
v_non_operational_reason,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
hw_manufacturer=20=3D=20v_hw_manufacturer,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20hw_product_name=20=3D=20v_hw_product_name,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20hw_version=20=3D=20v_hw_version,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20hw_serial_number=20=3D=20v_hw_serial_number,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20hw_uuid=20=3D=20v_hw_uuid,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20hw_family=20=3D=20v_hw_family,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20hbas=20=3D=20v_hbas,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
supported_emulated_machines=20=3D=20v_supported_emulated_machines,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20kdump_status=20=3D=20v_kdump_status,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20selinux_enforce_mode=20=3D=20=
v_selinux_enforce_mode,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
auto_numa_balancing=20=3D=20v_auto_numa_balancing,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20is_numa_supported=20=3D=20v_is_numa_supported,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20supported_rng_sources=20=3D=20=
v_supported_rng_sources,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
online_cpus=20=3D=20v_online_cpus,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
maintenance_reason=20=3D=20v_maintenance_reason,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20is_update_available=20=3D=20v_is_update_available,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20is_hostdev_enabled=20=3D=20=
v_is_hostdev_enabled,=0A=20=20=20=20=20=20=20=20=20=20=20=20kernel_args=20=
=3D=20v_kernel_args,=0A=20=20=20=20=20=20=20=20=20=20=20=20pretty_name=20=
=3D=20v_pretty_name=0A=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20=
v_vds_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteVdsDynamic=20(v_vds_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=
=20=20=20=20FROM=20vds_dynamic=0A=20=20=20=20=20=20=20=20WHERE=20vds_id=20=
=3D=20v_vds_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromVdsDynamic=20()=0ARETURNS=20SETOF=20=
vds_dynamic=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
vds_dynamic.*=0A=20=20=20=20=20=20=20=20FROM=20vds_dynamic;=0A=20=20=20=20=
END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVdsDynamicByVdsId=20=
(v_vds_id=20UUID)=0ARETURNS=20SETOF=20vds_dynamic=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20vds_dynamic.*=0A=20=20=20=20=20=
=20=20=20FROM=20vds_dynamic=0A=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=
=20v_vds_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertVdsStatic=20(=0A=20=20=20=20=
v_free_text_comment=20TEXT,=0A=20=20=20=20v_vds_id=20UUID,=0A=20=20=20=20=
v_host_name=20VARCHAR(255),=0A=20=20=20=20v_vds_unique_id=20=
VARCHAR(128),=0A=20=20=20=20v_port=20INT,=0A=20=20=20=20v_protocol=20=
SMALLINT,=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_vds_name=20=
VARCHAR(255),=0A=20=20=20=20v_server_SSL_enabled=20BOOLEAN,=0A=20=20=20=20=
v_vds_type=20INT,=0A=20=20=20=20v_vds_strength=20INT,=0A=20=20=20=20=
v_pm_enabled=20BOOLEAN,=0A=20=20=20=20v_pm_proxy_preferences=20=
VARCHAR(255),=0A=20=20=20=20v_pm_detect_kdump=20BOOLEAN,=0A=20=20=20=20=
v_vds_spm_priority=20INT,=0A=20=20=20=20v_sshKeyFingerprint=20=
VARCHAR(128),=0A=20=20=20=20v_console_address=20VARCHAR(255),=0A=20=20=20=
=20v_ssh_port=20INT,=0A=20=20=20=20v_ssh_username=20VARCHAR(255),=0A=20=20=
=20=20v_disable_auto_pm=20BOOLEAN,=0A=20=20=20=20v_host_provider_id=20=
UUID,=0A=20=20=20=20v_openstack_network_provider_id=20UUID,=0A=20=20=20=20=
v_kernel_cmdline=20TEXT,=0A=20=20=20=20v_last_stored_kernel_cmdline=20=
TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20IF=20v_vds_unique_id=20IS=20NULL=0A=20=20=20=20=20=20=20=20OR=20=
NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20vds_name=0A=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vds_static=0A=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20vds_unique_id=20=3D=20v_vds_unique_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=
=20=20=20INSERT=20INTO=20vds_static=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20vds_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20host_name,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20free_text_comment,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20vds_unique_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20port,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20protocol,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20cluster_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20vds_name,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20server_SSL_enabled,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20vds_type,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vds_strength,=0A=20=20=20=20=20=20=20=20=20=20=20=20pm_enabled,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20pm_proxy_preferences,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20pm_detect_kdump,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vds_spm_priority,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
sshKeyFingerprint,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
console_address,=0A=20=20=20=20=20=20=20=20=20=20=20=20ssh_port,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20ssh_username,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20disable_auto_pm,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
host_provider_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
openstack_network_provider_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
kernel_cmdline,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
last_stored_kernel_cmdline=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_vds_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_host_name,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20v_free_text_comment,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_vds_unique_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_port,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_protocol,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_cluster_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_vds_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_server_SSL_enabled,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_vds_type,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_vds_strength,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_pm_enabled,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_pm_proxy_preferences,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_pm_detect_kdump,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_vds_spm_priority,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_sshKeyFingerprint,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_console_address,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_ssh_port,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20v_ssh_username,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_disable_auto_pm,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_host_provider_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_openstack_network_provider_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_kernel_cmdline,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_last_stored_kernel_cmdline=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=
=20=20=20END;=0AEND=20IF;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateVdsStaticLastStoredKernelCmdline=20(=0A=20=20=20=20v_vds_id=20=
UUID,=0A=20=20=20=20v_last_stored_kernel_cmdline=20TEXT=0A=20=20=20=20)=0A=
RETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20UPDATE=20vds_static=0A=20=20=20=20=
=20=20=20=20SET=20last_stored_kernel_cmdline=20=3D=20=
v_last_stored_kernel_cmdline=0A=20=20=20=20=20=20=20=20WHERE=20vds_id=20=
=3D=20v_vds_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateVdsStatic=20(=0A=20=20=20=20v_host_name=20=
VARCHAR(255),=0A=20=20=20=20v_free_text_comment=20TEXT,=0A=20=20=20=20=
v_vds_unique_id=20VARCHAR(128),=0A=20=20=20=20v_port=20INT,=0A=20=20=20=20=
v_protocol=20SMALLINT,=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20=
v_vds_id=20UUID,=0A=20=20=20=20v_vds_name=20VARCHAR(255),=0A=20=20=20=20=
v_server_SSL_enabled=20BOOLEAN,=0A=20=20=20=20v_vds_type=20INT,=0A=20=20=20=
=20v_vds_strength=20INT,=0A=20=20=20=20v_pm_enabled=20BOOLEAN,=0A=20=20=20=
=20v_pm_proxy_preferences=20VARCHAR(255),=0A=20=20=20=20=
v_pm_detect_kdump=20BOOLEAN,=0A=20=20=20=20v_otp_validity=20BIGINT,=0A=20=
=20=20=20v_vds_spm_priority=20INT,=0A=20=20=20=20v_sshKeyFingerprint=20=
VARCHAR(128),=0A=20=20=20=20v_console_address=20VARCHAR(255),=0A=20=20=20=
=20v_ssh_port=20INT,=0A=20=20=20=20v_ssh_username=20VARCHAR(255),=0A=20=20=
=20=20v_disable_auto_pm=20BOOLEAN,=0A=20=20=20=20v_host_provider_id=20=
UUID,=0A=20=20=20=20v_openstack_network_provider_id=20UUID,=0A=20=20=20=20=
v_kernel_cmdline=20TEXT=0A)=0A=20=20=20=20RETURNS=20VOID=0A=20=20=20=20=0A=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
UPDATE=20vds_static=0A=20=20=20=20=20=20=20=20SET=20host_name=20=3D=20=
v_host_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20free_text_comment=20=3D=
=20v_free_text_comment,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vds_unique_id=20=3D=20v_vds_unique_id,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20port=20=3D=20v_port,=0A=20=20=20=20=20=20=20=20=20=20=20=20protocol=20=
=3D=20v_protocol,=0A=20=20=20=20=20=20=20=20=20=20=20=20cluster_id=20=3D=20=
v_cluster_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20vds_name=20=3D=20=
v_vds_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20server_SSL_enabled=20=3D=
=20v_server_SSL_enabled,=0A=20=20=20=20=20=20=20=20=20=20=20=20vds_type=20=
=3D=20v_vds_type,=0A=20=20=20=20=20=20=20=20=20=20=20=20_update_date=20=3D=
=20LOCALTIMESTAMP,=0A=20=20=20=20=20=20=20=20=20=20=20=20vds_strength=20=
=3D=20v_vds_strength,=0A=20=20=20=20=20=20=20=20=20=20=20=20pm_enabled=20=
=3D=20v_pm_enabled,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
pm_proxy_preferences=20=3D=20v_pm_proxy_preferences,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20pm_detect_kdump=20=3D=20v_pm_detect_kdump,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20otp_validity=20=3D=20v_otp_validity,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20vds_spm_priority=20=3D=20v_vds_spm_priority,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20sshKeyFingerprint=20=3D=20=
v_sshKeyFingerprint,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
host_provider_id=20=3D=20v_host_provider_id,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20openstack_network_provider_id=20=3D=20=
v_openstack_network_provider_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
console_address=20=3D=20v_console_address,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20ssh_port=20=3D=20v_ssh_port,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ssh_username=20=3D=20v_ssh_username,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
disable_auto_pm=20=3D=20v_disable_auto_pm,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20kernel_cmdline=20=3D=20v_kernel_cmdline=0A=20=20=20=20=20=20=20=20=
WHERE=20vds_id=20=3D=20v_vds_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteVdsStatic=20=
(v_vds_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=20FROM=20=
tags_vds_map=0A=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id;=0A=
=0A=20=20=20=20=20=20=20=20--=20Delete=20all=20Vds=20Alerts=20from=20the=20=
database=0A=20=20=20=20=20=20=20=20PERFORM=20=
DeleteAuditLogAlertsByVdsID(v_vds_id);=0A=0A=20=20=20=20=20=20=20=20=
DELETE=0A=20=20=20=20=20=20=20=20FROM=20vds_static=0A=20=20=20=20=20=20=20=
=20WHERE=20vds_id=20=3D=20v_vds_id;=0A=0A=20=20=20=20=20=20=20=20--=20=
delete=20VDS=20permissions=20--=0A=20=20=20=20=20=20=20=20DELETE=0A=20=20=
=20=20=20=20=20=20FROM=20permissions=0A=20=20=20=20=20=20=20=20WHERE=20=
object_id=20=3D=20v_vds_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromVdsStatic=20()=0ARETURNS=20SETOF=20=
vds_static=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20vds_static.*=0A=20=20=20=20FROM=20=
vds_static;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVdsStaticByIp=20=
(v_ip=20VARCHAR(40))=0ARETURNS=20SETOF=20vds_static=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20vds_static.*=0A=20=20=20=20=20=
=20=20=20FROM=20vds_static=20vds_static,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20fence_agents=20fence_agents=0A=20=20=20=20=20=20=20=20WHERE=20=
fence_agents.ip=20=3D=20v_ip=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
fence_agents.vds_id=20=3D=20vds_static.vds_id;=0A=20=20=20=20END;=0A=0A=20=
=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVdsStaticByHostName=20=
(v_host_name=20VARCHAR(255))=0ARETURNS=20SETOF=20vds_static=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20vds_static.*=0A=20=20=20=20FROM=20vds_static=0A=20=20=20=20=
WHERE=20host_name=20=3D=20v_host_name;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVdsStaticByVdsId=20(v_vds_id=20UUID)=0ARETURNS=20=
SETOF=20vds_static=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vds_static.*=0A=20=20=20=20FROM=20=
vds_static=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id;=0A=0A=20=20=20=20=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVdsStaticByVdsName=20=
(v_host_name=20VARCHAR(255))=0ARETURNS=20SETOF=20vds_static=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20vds_static.*=0A=20=20=20=20FROM=20vds_static=0A=20=20=20=20=
WHERE=20vds_name=20=3D=20v_host_name;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVdsByUniqueID=20(v_vds_unique_id=20VARCHAR(128))=0A=
RETURNS=20SETOF=20vds=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20DISTINCT=20vds.*=0A=20=20=20=20=20=20=20=20FROM=20vds=0A=20=20=
=20=20=20=20=20=20WHERE=20vds_unique_id=20=3D=20v_vds_unique_id;=0A=20=20=
=20=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVdsStaticByClusterId=20(v_cluster_id=20UUID)=0ARETURNS=20SETOF=20=
vds_static=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=
=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
vds_static.*=0A=20=20=20=20=20=20=20=20FROM=20vds_static=20vds_static=0A=20=
=20=20=20=20=20=20=20WHERE=20cluster_id=20=3D=20v_cluster_id;=0A=20=20=20=
=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetUpAndPrioritizedVds=20=
(v_storage_pool_id=20UUID)=0ARETURNS=20SETOF=20vds=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20vds.*=0A=20=20=20=20=20=20=20=
=20FROM=20vds=20vds,=0A=20=20=20=20=20=20=20=20=20=20=20=20cluster=20=
cluster=0A=20=20=20=20=20=20=20=20WHERE=20(vds.status=20=3D=203)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20(vds.storage_pool_id=20=3D=20=
v_storage_pool_id)=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20vds_spm_priority=20IS=20NULL=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20vds_spm_priority=20=
>=20-=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20AND=20vds.cluster_id=20=3D=20=
cluster.cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
cluster.virt_service=20=3D=20true=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
vds_spm_priority=20DESC,=20RANDOM();=0A=20=20=20=20END;=0A=0A=20=20=20=20=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromVds=20(=0A=20=20=
=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20BOOLEAN=0A=20=20=20=
=20)=0ARETURNS=20SETOF=20vds=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=
=20=20=20SELECT=20DISTINCT=20vds.*=0A=20=20=20=20=20=20=20=20FROM=20vds=0A=
=20=20=20=20=20=20=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20user_vds_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
entity_id=20=3D=20vds_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=
=20=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVdsByVdsId=20=
(=0A=20=20=20=20v_vds_id=20UUID,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=
=20=20v_is_filtered=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20vds=20=
STABLE=20AS=20$PROCEDURE$=0ADECLARE=20v_columns=20TEXT=20[];=0A=0ABEGIN=0A=
=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20(v_is_filtered)=20THEN=0A=
=20=20=20=20=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=20DISTINCT=20(rec).*=0A=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20fn_db_mask_object('vds')=20AS=20q(rec=20vds)=0A=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20(rec).vds_id=20=3D=20v_vds_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vds_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20=
v_vds_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20ELSE=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
DISTINCT=20vds.*=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vds=0A=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id;=0A=20=20=20=
=20=20=20=20=20END=20IF;=0A=0A=20=20=20=20END;=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVdsWithoutMigratingVmsByClusterId=20=
(v_cluster_id=20UUID)=0ARETURNS=20SETOF=20vds=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20--=20this=20sp=20returns=20all=20vds=20=
in=20given=20cluster=20that=20have=20no=20pending=20vms=20and=20no=20vms=20=
in=20migration=20states=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20DISTINCT=20vds.*=0A=20=
=20=20=20=20=20=20=20FROM=20vds=0A=20=20=20=20=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20pending_vcpus_count=20=3D=200=0A=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20vds.status=20=3D=203=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
vds_id=20NOT=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20DISTINCT=20run_on_vds=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20vm_dynamic=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20status=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=205,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=206,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=2011,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=2012=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20);=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteVds=20(v_vds_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20DELETE=0A=
=20=20=20=20=20=20=20=20FROM=20tags_vds_map=0A=20=20=20=20=20=20=20=20=
WHERE=20vds_id=20=3D=20v_vds_id;=0A=0A=20=20=20=20=20=20=20=20--=20=
Delete=20all=20Vds=20Alerts=20from=20the=20database=0A=20=20=20=20=20=20=20=
=20PERFORM=20DeleteAuditLogAlertsByVdsID(v_vds_id);=0A=0A=20=20=20=20=20=20=
=20=20DELETE=0A=20=20=20=20=20=20=20=20FROM=20vds_statistics=0A=20=20=20=20=
=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_id;=0A=0A=20=20=20=20=20=20=20=20=
DELETE=0A=20=20=20=20=20=20=20=20FROM=20vds_dynamic=0A=20=20=20=20=20=20=20=
=20WHERE=20vds_id=20=3D=20v_vds_id;=0A=0A=20=20=20=20=20=20=20=20DELETE=0A=
=20=20=20=20=20=20=20=20FROM=20vds_static=0A=20=20=20=20=20=20=20=20=
WHERE=20vds_id=20=3D=20v_vds_id;=0A=0A=20=20=20=20=20=20=20=20DELETE=0A=20=
=20=20=20=20=20=20=20FROM=20permissions=0A=20=20=20=20=20=20=20=20WHERE=20=
object_id=20=3D=20v_vds_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVdsByType=20(v_vds_type=20INT)=0ARETURNS=20SETOF=20=
vds=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
DISTINCT=20vds.*=0A=20=20=20=20=20=20=20=20FROM=20vds=0A=20=20=20=20=20=20=
=20=20WHERE=20vds_type=20=3D=20v_vds_type;=0A=20=20=20=20END;=0A=0A=20=20=
=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVdsByName=20=
(v_vds_name=20VARCHAR(255))=0ARETURNS=20SETOF=20vds=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20DISTINCT=20vds.*=0A=20=20=20=20=
=20=20=20=20FROM=20vds=0A=20=20=20=20=20=20=20=20WHERE=20vds_name=20=3D=20=
v_vds_name;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVdsByHostName=20(v_host_name=20VARCHAR(255))=0A=
RETURNS=20SETOF=20vds=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20DISTINCT=20vds.*=0A=20=20=20=20=20=20=20=20FROM=20vds=0A=20=20=
=20=20=20=20=20=20WHERE=20host_name=20=3D=20v_host_name;=0A=20=20=20=20=
END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVdsByClusterId=20(=0A=20=
=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=
=20v_is_filtered=20boolean=0A=20=20=20=20)=0ARETURNS=20SETOF=20vds=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20--=20this=20sp=20returns=20=
all=20vds=20for=20a=20given=20cluster=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=
=20=20=20IF=20(v_is_filtered)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20DISTINCT=20(rec).*=0A=
=20=20=20=20=20=20=20=20FROM=20fn_db_mask_object('vds')=20AS=20q(rec=20=
vds)=0A=20=20=20=20=20=20=20=20WHERE=20(rec).cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20user_vds_permissions_view=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20=
v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20entity_id=20=3D=20(rec).vds_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20);ELSE=0A=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20=20=20=20=20SELECT=20DISTINCT=20vds.*=0A=20=20=20=20=20=20=20=20=
FROM=20vds=0A=20=20=20=20=20=20=20=20WHERE=20cluster_id=20=3D=20=
v_cluster_id;=0A=20=20=20=20=20=20=20=20END=20IF;=0A=0A=20=20=20=20END;=0A=
=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVdsByStoragePoolId=20=
(=0A=20=20=20=20v_storage_pool_id=20UUID,=0A=20=20=20=20v_user_id=20=
UUID,=0A=20=20=20=20v_is_filtered=20boolean=0A=20=20=20=20)=0ARETURNS=20=
SETOF=20vds=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
DISTINCT=20vds.*=0A=20=20=20=20=20=20=20=20FROM=20vds=0A=20=20=20=20=20=20=
=20=20WHERE=20storage_pool_id=20=3D=20v_storage_pool_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20user_vds_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
entity_id=20=3D=20vds_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=
=20=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
getVdsForClusterWithStatus=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=
=20=20v_status=20INT=0A=20=20=20=20)=0ARETURNS=20SETOF=20vds=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20vds.*=0A=20=20=20=20=
=20=20=20=20FROM=20vds=0A=20=20=20=20=20=20=20=20WHERE=20(status=20=3D=20=
v_status)=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20(cluster_id=20=3D=20=
v_cluster_id)=0A=20=20=20=20=20=20=20=20ORDER=20BY=20vds.vds_id=20ASC;=0A=
=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
getVdsForClusterWithPeerStatus=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=
=20=20=20v_status=20INT,=0A=20=20=20=20v_peer_status=20VARCHAR(50)=0A=20=20=
=20=20)=0ARETURNS=20SETOF=20vds=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
=20=20=20=20SELECT=20vds.*=0A=20=20=20=20=20=20=20=20FROM=20vds=0A=20=20=20=
=20=20=20=20=20INNER=20JOIN=20gluster_server=0A=20=20=20=20=20=20=20=20=20=
=20=20=20ON=20vds_id=20=3D=20server_id=0A=20=20=20=20=20=20=20=20WHERE=20=
(status=20=3D=20v_status)=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
(peer_status=20=3D=20v_peer_status)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20(cluster_id=20=3D=20v_cluster_id)=0A=20=20=20=20=20=20=20=20ORDER=20=
BY=20vds.vds_id=20ASC;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20getVdsByStoragePoolIdWithStatuses(=0A=20=20=20=20=
v_storage_pool_id=20UUID,=0A=20=20=20=20v_statuses=20VARCHAR(150))=0A=
RETURNS=20SETOF=20vds=20STABLE=0A=20=20=20=20AS=20$procedure$=0ABEGIN=0A=20=
=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=20=20=20=20=20=
=20=20=20SELECT=20vds.*=0A=20=20=20=20=20=20=20=20FROM=20vds=0A=20=20=20=20=
=20=20=20=20INNER=20JOIN=20cluster=20cluster=0A=20=20=20=20=20=20=20=20=20=
=20=20=20ON=20vds.cluster_id=20=3D=20cluster.cluster_id=0A=20=20=20=20=20=
=20=20=20WHERE=20(v_statuses=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=
=20=20OR=20vds.status=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitterInteger(v_statuses)))=0A=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20(vds.storage_pool_id=20=3D=20v_storage_pool_id)=0A=20=20=20=20=20=20=
=20=20=20=20=20=20AND=20cluster.virt_service=20=3D=20true;=0A=20=20=20=20=
END;=0A=20=20=20=20RETURN;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
getHostsForStorageOperation=20(=0A=20=20=20=20v_storage_pool_id=20UUID,=0A=
=20=20=20=20v_local_fs_only=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
vds=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20vds.*=0A=
=20=20=20=20=20=20=20=20FROM=20vds=0A=20=20=20=20=20=20=20=20LEFT=20JOIN=20=
cluster=20vg=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20vds.cluster_id=20=
=3D=20vg.cluster_id=0A=20=20=20=20=20=20=20=20LEFT=20JOIN=20storage_pool=20=
sp=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20vds.storage_pool_id=20=3D=20=
sp.id=0A=20=20=20=20=20=20=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20v_storage_pool_id=20IS=20NULL=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20OR=20vds.storage_pool_id=20=3D=20=
v_storage_pool_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20(vg.virt_service=20=3D=20true)=0A=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20NOT=20v_local_fs_only=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20OR=20sp.is_local=20=3D=20true=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_storage_pool_id=20IS=20=
NOT=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
vds.status=20=3D=203=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);--=20if=20DC=20is=20unspecified=20return=20only=20hosts=20with=20=
status=20=3D=20UP=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateVdsDynamicStatus=20(=0A=20=20=20=20v_vds_guid=20=
UUID,=0A=20=20=20=20v_status=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vds_dynamic=0A=20=20=20=20SET=20=
status=20=3D=20v_status=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_guid;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateVdsDynamicStatusAndReasons=20(=0A=20=20=20=20=
v_vds_guid=20UUID,=0A=20=20=20=20v_status=20INT,=0A=20=20=20=20=
v_non_operational_reason=20INT,=0A=20=20=20=20v_maintenance_reason=20=
TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20UPDATE=20vds_dynamic=0A=20=20=20=20SET=20status=20=3D=20v_status,=0A=
=20=20=20=20=20=20=20=20non_operational_reason=20=3D=20=
v_non_operational_reason,=0A=20=20=20=20=20=20=20=20maintenance_reason=20=
=3D=20v_maintenance_reason=0A=20=20=20=20WHERE=20vds_id=20=3D=20=
v_vds_guid;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateHostExternalStatus=20=
(=0A=20=20=20=20v_vds_guid=20UUID,=0A=20=20=20=20v_external_status=20INT=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
UPDATE=20vds_dynamic=0A=20=20=20=20SET=20external_status=20=3D=20=
v_external_status=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_guid;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateVdsDynamicNetConfigDirty=20(=0A=20=20=20=20=
v_vds_guid=20UUID,=0A=20=20=20=20v_net_config_dirty=20BOOLEAN=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
vds_dynamic=0A=20=20=20=20SET=20net_config_dirty=20=3D=20=
v_net_config_dirty=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_guid;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateVdsDynamicIsUpdateAvailable=20(=0A=20=20=20=20=
v_vds_guid=20UUID,=0A=20=20=20=20v_is_update_available=20BOOLEAN=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
vds_dynamic=0A=20=20=20=20SET=20is_update_available=20=3D=20=
v_is_update_available=0A=20=20=20=20WHERE=20vds_id=20=3D=20v_vds_guid;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVdsByNetworkId=20(v_network_id=20UUID)=0ARETURNS=20=
SETOF=20vds=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20vds=0A=20=20=20=20=
WHERE=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20vds_interface=0A=20=20=20=20=20=20=
=20=20=20=20=20=20INNER=20JOIN=20network=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20ON=20network.name=20=3D=20vds_interface.network_name=0A=
=20=20=20=20=20=20=20=20=20=20=20=20INNER=20JOIN=20network_cluster=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20ON=20network.id=20=3D=20=
network_cluster.network_id=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
network_id=20=3D=20v_network_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20AND=20vds.cluster_id=20=3D=20network_cluster.cluster_id=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20vds_interface.vds_id=20=3D=
=20vds.vds_id=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVdsWithoutNetwork=20(v_network_id=20UUID)=0ARETURNS=20SETOF=20vds=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20vds.*=0A=20=20=20=20FROM=20vds=0A=20=20=20=20INNER=20JOIN=20=
network_cluster=0A=20=20=20=20=20=20=20=20ON=20vds.cluster_id=20=3D=20=
network_cluster.cluster_id=0A=20=20=20=20WHERE=20=
network_cluster.network_id=20=3D=20v_network_id=0A=20=20=20=20=20=20=20=20=
AND=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vds_interface=0A=20=20=20=20=20=
=20=20=20=20=20=20=20INNER=20JOIN=20network=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20ON=20network.name=20=3D=20=
vds_interface.network_name=0A=20=20=20=20=20=20=20=20=20=20=20=20INNER=20=
JOIN=20network_cluster=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
ON=20network.id=20=3D=20network_cluster.network_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20network_cluster.network_id=20=3D=20v_network_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20vds.cluster_id=20=3D=
=20network_cluster.cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20AND=20vds_interface.vds_id=20=3D=20vds.vds_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateCpuFlags=20(=0A=20=20=
=20=20v_vds_id=20UUID,=0A=20=20=20=20v_cpu_flags=20VARCHAR(4000)=0A=20=20=
=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
vds_dynamic=0A=20=20=20=20SET=20cpu_flags=20=3D=20v_cpu_flags=0A=20=20=20=
=20WHERE=20vds_id=20=3D=20v_vds_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetIdsOfHostsWithStatus=20(v_status=20INT)=0ARETURNS=20SETOF=20UUID=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20vds_id=0A=20=20=20=20FROM=20vds_dynamic=0A=20=20=20=20=
WHERE=20status=20=3D=20v_status;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertVdsCpuStatistics=20=
(=0A=20=20=20=20v_vds_cpu_id=20UUID,=0A=20=20=20=20v_vds_id=20UUID,=0A=20=
=20=20=20v_cpu_core_id=20INT,=0A=20=20=20=20v_cpu_sys=20DECIMAL(18,=20=
0),=0A=20=20=20=20v_cpu_user=20DECIMAL(18,=200),=0A=20=20=20=20=
v_cpu_idle=20DECIMAL(18,=200),=0A=20=20=20=20v_usage_cpu_percent=20INT=0A=
=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20INSERT=20INTO=20vds_cpu_statistics=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20vds_cpu_id,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20vds_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20cpu_core_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20cpu_sys,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20cpu_user,=0A=20=20=20=20=20=20=20=20=20=20=20=20cpu_idle,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20usage_cpu_percent=0A=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20v_vds_cpu_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_vds_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_cpu_core_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_cpu_sys,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20v_cpu_user,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_cpu_idle,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_usage_cpu_percent=0A=20=20=20=20=20=20=20=
=20=20=20=20=20);=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateVdsCpuStatistics=20(=0A=20=20=20=20v_vds_id=20=
UUID,=0A=20=20=20=20v_cpu_core_id=20INT,=0A=20=20=20=20v_cpu_sys=20=
DECIMAL(18,=200),=0A=20=20=20=20v_cpu_user=20DECIMAL(18,=200),=0A=20=20=20=
=20v_cpu_idle=20DECIMAL(18,=200),=0A=20=20=20=20v_usage_cpu_percent=20=
INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20UPDATE=20vds_cpu_statistics=0A=20=20=20=
=20=20=20=20=20SET=20cpu_sys=20=3D=20v_cpu_sys,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20cpu_user=20=3D=20v_cpu_user,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20cpu_idle=20=3D=20v_cpu_idle,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
usage_cpu_percent=20=3D=20v_usage_cpu_percent=0A=20=20=20=20=20=20=20=20=
WHERE=20vds_id=20=3D=20v_vds_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20cpu_core_id=20=3D=20v_cpu_core_id;=0A=20=20=20=20END;=0A=0A=20=20=20=
=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteVdsCpuStatisticsByVdsId=20(v_vds_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20DELETE=0A=
=20=20=20=20=20=20=20=20FROM=20vds_cpu_statistics=0A=20=20=20=20=20=20=20=
=20WHERE=20vds_id=20=3D=20v_vds_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVdsCpuStatisticsByVdsId=20(v_vds_id=20UUID)=0ARETURNS=20SETOF=20=
vds_cpu_statistics=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20vds_cpu_statistics.*=0A=20=20=20=20=20=20=20=20FROM=20=
vds_cpu_statistics=0A=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20=
v_vds_id;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromVdsCpuStatistics=20()=0ARETURNS=20SETOF=20vds_cpu_statistics=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
vds_cpu_statistics.*=0A=20=20=20=20=20=20=20=20FROM=20=
vds_cpu_statistics;=0A=20=20=20=20END;=0A=0A=20=20=20=20RETURN;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20getFirstUpRhelForClusterId=20(v_cluster_id=20UUID)=0A=
RETURNS=20SETOF=20vds=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20--=20both=20centos=20and=20RHEL=20return=20=
RHEL=20as=20host_os=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=
=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20FROM=20vds=0A=20=20=20=
=20=20=20=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
host_os=20LIKE=20'RHEL%'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
OR=20host_os=20LIKE=20'oVirt=20Node%'=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20OR=20host_os=20LIKE=20'RHEV=20Hypervisor%'=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20status=20=3D=203=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
cluster_id=20=3D=20v_cluster_id=20LIMIT=201;=0A=20=20=20=20END;=0A=0A=20=20=
=20=20RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetNamesOfHostsDedicatedToVm=20(v_vm_guid=20UUID)=0ARETURNS=20SETOF=20=
VARCHAR=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20vds_name=0A=20=
=20=20=20=20=20=20=20FROM=20vm_host_pinning_view=0A=20=20=20=20=20=20=20=20=
WHERE=20vm_id=20=3D=20v_vm_guid;=0A=20=20=20=20END;=0A=0A=20=20=20=20=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertVmDevice=20(=0A=20=20=
=20=20v_device_id=20UUID,=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20=
v_device=20VARCHAR(30),=0A=20=20=20=20v_type=20VARCHAR(30),=0A=20=20=20=20=
v_address=20VARCHAR(255),=0A=20=20=20=20v_boot_order=20INT,=0A=20=20=20=20=
v_spec_params=20TEXT,=0A=20=20=20=20v_is_managed=20boolean,=0A=20=20=20=20=
v_is_plugged=20boolean,=0A=20=20=20=20v_is_readonly=20boolean,=0A=20=20=20=
=20v_alias=20VARCHAR(255),=0A=20=20=20=20v_custom_properties=20TEXT,=0A=20=
=20=20=20v_snapshot_id=20uuid,=0A=20=20=20=20v_logical_name=20=
VARCHAR(255),=0A=20=20=20=20v_is_using_scsi_reservation=20boolean,=0A=20=20=
=20=20v_host_device=20VARCHAR(255)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20vm_device=20(=0A=20=20=20=
=20=20=20=20=20device_id,=0A=20=20=20=20=20=20=20=20vm_id,=0A=20=20=20=20=
=20=20=20=20device,=0A=20=20=20=20=20=20=20=20type,=0A=20=20=20=20=20=20=20=
=20address,=0A=20=20=20=20=20=20=20=20boot_order,=0A=20=20=20=20=20=20=20=
=20spec_params,=0A=20=20=20=20=20=20=20=20is_managed,=0A=20=20=20=20=20=20=
=20=20is_plugged,=0A=20=20=20=20=20=20=20=20is_readonly,=0A=20=20=20=20=20=
=20=20=20alias,=0A=20=20=20=20=20=20=20=20custom_properties,=0A=20=20=20=20=
=20=20=20=20snapshot_id,=0A=20=20=20=20=20=20=20=20logical_name,=0A=20=20=
=20=20=20=20=20=20is_using_scsi_reservation,=0A=20=20=20=20=20=20=20=20=
host_device=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=
=20=20=20=20=20=20v_device_id,=0A=20=20=20=20=20=20=20=20v_vm_id,=0A=20=20=
=20=20=20=20=20=20v_device,=0A=20=20=20=20=20=20=20=20v_type,=0A=20=20=20=
=20=20=20=20=20v_address,=0A=20=20=20=20=20=20=20=20v_boot_order,=0A=20=20=
=20=20=20=20=20=20v_spec_params,=0A=20=20=20=20=20=20=20=20v_is_managed,=0A=
=20=20=20=20=20=20=20=20v_is_plugged,=0A=20=20=20=20=20=20=20=20=
v_is_readonly,=0A=20=20=20=20=20=20=20=20v_alias,=0A=20=20=20=20=20=20=20=
=20v_custom_properties,=0A=20=20=20=20=20=20=20=20v_snapshot_id,=0A=20=20=
=20=20=20=20=20=20v_logical_name,=0A=20=20=20=20=20=20=20=20=
v_is_using_scsi_reservation,=0A=20=20=20=20=20=20=20=20v_host_device=0A=20=
=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateVmDevice=20(=0A=20=20=
=20=20v_device_id=20UUID,=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20=
v_device=20VARCHAR(30),=0A=20=20=20=20v_type=20VARCHAR(30),=0A=20=20=20=20=
v_address=20VARCHAR(255),=0A=20=20=20=20v_boot_order=20INT,=0A=20=20=20=20=
v_spec_params=20TEXT,=0A=20=20=20=20v_is_managed=20boolean,=0A=20=20=20=20=
v_is_plugged=20boolean,=0A=20=20=20=20v_is_readonly=20boolean,=0A=20=20=20=
=20v_alias=20VARCHAR(255),=0A=20=20=20=20v_custom_properties=20TEXT,=0A=20=
=20=20=20v_snapshot_id=20uuid,=0A=20=20=20=20v_logical_name=20=
VARCHAR(255),=0A=20=20=20=20v_is_using_scsi_reservation=20boolean,=0A=20=20=
=20=20v_host_device=20VARCHAR(255)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vm_device=0A=20=20=20=20SET=20=
device=20=3D=20v_device,=0A=20=20=20=20=20=20=20=20type=20=3D=20v_type,=0A=
=20=20=20=20=20=20=20=20address=20=3D=20v_address,=0A=20=20=20=20=20=20=20=
=20boot_order=20=3D=20v_boot_order,=0A=20=20=20=20=20=20=20=20=
spec_params=20=3D=20v_spec_params,=0A=20=20=20=20=20=20=20=20is_managed=20=
=3D=20v_is_managed,=0A=20=20=20=20=20=20=20=20is_plugged=20=3D=20=
v_is_plugged,=0A=20=20=20=20=20=20=20=20is_readonly=20=3D=20=
v_is_readonly,=0A=20=20=20=20=20=20=20=20alias=20=3D=20v_alias,=0A=20=20=20=
=20=20=20=20=20custom_properties=20=3D=20v_custom_properties,=0A=20=20=20=
=20=20=20=20=20snapshot_id=20=3D=20v_snapshot_id,=0A=20=20=20=20=20=20=20=
=20logical_name=20=3D=20v_logical_name,=0A=20=20=20=20=20=20=20=20=
is_using_scsi_reservation=20=3D=20v_is_using_scsi_reservation,=0A=20=20=20=
=20=20=20=20=20host_device=20=3D=20v_host_device,=0A=20=20=20=20=20=20=20=
=20_update_date=20=3D=20current_timestamp=0A=20=20=20=20WHERE=20=
device_id=20=3D=20v_device_id=0A=20=20=20=20=20=20=20=20AND=20vm_id=20=3D=20=
v_vm_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateVmDeviceRuntimeInfo=20(=0A=20=20=20=20v_device_id=20UUID,=0A=20=20=20=
=20v_vm_id=20UUID,=0A=20=20=20=20v_address=20VARCHAR(255),=0A=20=20=20=20=
v_alias=20VARCHAR(255)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vm_device=0A=20=20=20=20SET=20=
address=20=3D=20v_address,=0A=20=20=20=20=20=20=20=20alias=20=3D=20=
v_alias,=0A=20=20=20=20=20=20=20=20_update_date=20=3D=20=
current_timestamp=0A=20=20=20=20WHERE=20device_id=20=3D=20v_device_id=0A=20=
=20=20=20=20=20=20=20AND=20vm_id=20=3D=20v_vm_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateVmDeviceForHotPlugDisk=20(=0A=20=20=20=20v_device_id=20UUID,=0A=20=20=
=20=20v_vm_id=20UUID,=0A=20=20=20=20v_is_plugged=20boolean=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
vm_device=0A=20=20=20=20SET=20is_plugged=20=3D=20v_is_plugged,=0A=20=20=20=
=20=20=20=20=20_update_date=20=3D=20current_timestamp=0A=20=20=20=20=
WHERE=20device_id=20=3D=20v_device_id=0A=20=20=20=20=20=20=20=20AND=20=
vm_id=20=3D=20v_vm_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateVmDeviceBootOrder=20=
(=0A=20=20=20=20v_device_id=20UUID,=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=
=20=20v_boot_order=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vm_device=0A=20=20=20=20SET=20=
boot_order=20=3D=20v_boot_order,=0A=20=20=20=20=20=20=20=20_update_date=20=
=3D=20current_timestamp=0A=20=20=20=20WHERE=20device_id=20=3D=20=
v_device_id=0A=20=20=20=20=20=20=20=20AND=20vm_id=20=3D=20v_vm_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteVmDevice=20(=0A=20=20=20=20v_device_id=20=
UUID,=0A=20=20=20=20v_vm_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20vm_device=0A=
=20=20=20=20WHERE=20device_id=20=3D=20v_device_id=0A=20=20=20=20=20=20=20=
=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20v_vm_id=20IS=20NULL=0A=20=
=20=20=20=20=20=20=20=20=20=20=20OR=20vm_id=20=3D=20v_vm_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteVmDevicesByVmIdAndType=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=
=20v_type=20VARCHAR(30)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20vm_device=0A=
=20=20=20=20WHERE=20vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20AND=20=
type=20=3D=20v_type;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromVmDevice=20()=0A=
RETURNS=20SETOF=20vm_device_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vm_device_view;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVmDeviceByDeviceId=20=
(=0A=20=20=20=20v_device_id=20UUID,=0A=20=20=20=20v_vm_id=20UUID=0A=20=20=
=20=20)=0ARETURNS=20SETOF=20vm_device_view=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20vm_device_view=0A=20=20=20=20WHERE=20device_id=20=3D=20=
v_device_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_vm_id=20IS=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVmDeviceByVmId=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=
=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20BOOLEAN=0A=20=
=20=20=20)=0ARETURNS=20SETOF=20vm_device_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20vm_device_view=0A=20=20=20=20WHERE=20vm_id=20=3D=20=
v_vm_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vm_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20entity_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20ORDER=20BY=20device_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmDeviceByVmIdAndType=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20=
v_type=20VARCHAR(30)=0A=20=20=20=20)=0ARETURNS=20SETOF=20vm_device_view=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20vm_device_view=0A=20=20=20=20WHERE=20=
vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20AND=20type=20=3D=20=
v_type=0A=20=20=20=20ORDER=20BY=20NULLIF(alias,=20'')=20NULLS=20LAST;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVmDeviceByVmIdTypeAndDevice=20(=0A=20=20=20=20=
v_vm_id=20UUID,=0A=20=20=20=20v_type=20VARCHAR(30),=0A=20=20=20=20=
v_device=20VARCHAR(30),=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=20=
v_is_filtered=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
vm_device_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20vm_device_view=0A=20=
=20=20=20WHERE=20vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20AND=20=
type=20=3D=20v_type=0A=20=20=20=20=20=20=20=20AND=20device=20=3D=20=
v_device=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vm_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20entity_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20UNION=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20user_vm_template_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20v_vm_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20ORDER=20BY=20NULLIF(alias,=20'')=20NULLS=20LAST;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmDeviceByTypeAndDevice=20(=0A=20=20=20=20v_vm_ids=20UUID[],=0A=20=20=20=
=20v_type=20VARCHAR(30),=0A=20=20=20=20v_device=20VARCHAR(30),=0A=20=20=20=
=20v_user_id=20UUID,=0A=20=20=20=20v_is_filtered=20BOOLEAN=0A=20=20=20=20=
)=0ARETURNS=20SETOF=20vm_device_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20vm_device_view=0A=20=20=20=20WHERE=20vm_id=20=3D=20ANY(v_vm_ids)=0A=
=20=20=20=20=20=20=20=20AND=20type=20=3D=20v_type=0A=20=20=20=20=20=20=20=
=20AND=20device=20=3D=20v_device=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=
=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vm_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20entity_id=20=3D=20vm_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20ORDER=20BY=20NULLIF(alias,=20'')=20NULLS=20LAST;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVmUnmanagedDevicesByVmId=20(v_vm_id=20UUID)=0A=
RETURNS=20SETOF=20vm_device_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vm_device_view.*=0A=20=20=
=20=20FROM=20vm_device_view=0A=20=20=20=20WHERE=20vm_id=20=3D=20v_vm_id=0A=
=20=20=20=20=20=20=20=20AND=20is_managed=20=3D=20false;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20isMemBalloonEnabled=20(v_vm_id=20UUID)=0ARETURNS=20=
boolean=20STABLE=20AS=20$BODY$=0A=0ADECLARE=20result=20boolean=20:=3D=20=
false;=0A=0ABEGIN=0A=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vm_device=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vm_id=20=3D=20=
v_vm_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20type=20=3D=
=20'balloon'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
device=20=3D=20'memballoon'=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20=
THEN=20result=20:=3D=20true;=0A=20=20=20=20END=20IF;=0A=20=20=20=20=20=20=
=20=20RETURN=20result;=0AEND;$BODY$=0ALANGUAGE=20'plpgsql';=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20clearVmDeviceAddress=20=
(v_device_id=20UUID)=0ARETURNS=20VOID=20AS=20$BODY$=0A=0ABEGIN=0A=20=20=20=
=20UPDATE=20vm_device=0A=20=20=20=20SET=20address=20=3D=20''=0A=20=20=20=20=
WHERE=20device_id=20=3D=20v_device_id;=0AEND;$BODY$=0ALANGUAGE=20=
'plpgsql';=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
clearAllDeviceAddressesByVmId=20(v_vm_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$BODY$=0A=0ABEGIN=0A=20=20=20=20UPDATE=20vm_device=0A=20=20=20=20SET=20=
address=20=3D=20''=0A=20=20=20=20WHERE=20vm_id=20=3D=20v_vm_id;=0A=
END;$BODY$=0ALANGUAGE=20'plpgsql';=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20ExistsVmDeviceByVmIdAndType=20(=0A=20=20=20=20=
v_vm_id=20UUID,=0A=20=20=20=20v_type=20VARCHAR(30)=0A=20=20=20=20)=0A=
RETURNS=20BOOLEAN=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20vm_device=0A=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20vm_id=20=3D=20v_vm_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20type=20=3D=20v_type=0A=20=20=20=20=20=20=20=20=
=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVmDeviceByType=20=
(v_type=20VARCHAR(30))=0ARETURNS=20SETOF=20vm_device_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
*=0A=20=20=20=20FROM=20vm_device_view=0A=20=20=20=20WHERE=20type=20=3D=20=
v_type;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVmIconByVmIconId=20=
(v_id=20UUID)=0ARETURNS=20SETOF=20vm_icons=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=
=20FROM=20vm_icons=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromVmIcons=20()=0ARETURNS=20SETOF=20vm_icons=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=
=20=20SELECT=20*=0A=20=20=20=20FROM=20vm_icons;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllFromVmIconsFiltered=20(=0A=20=20=20=20v_user_id=20UUID,=0A=20=20=20=
=20v_is_filtered=20boolean=0A=20=20=20=20)=0ARETURNS=20SETOF=20vm_icons=20=
STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20v_is_filtered=20=
THEN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20--=20=
icons=20associated=20with=20owned=20vms=20and=20templates=0A=20=20=20=20=
SELECT=20DISTINCT=20vm_icons.*=0A=20=20=20=20FROM=20(=0A=20=20=20=20=20=20=
=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20FROM=20=
user_vm_template_permissions_view=0A=0A=20=20=20=20=20=20=20=20UNION=0A=0A=
=20=20=20=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20FROM=20=
user_vm_permissions_view=0A=20=20=20=20=20=20=20=20)=20AS=20permissions,=0A=
=20=20=20=20=20=20=20=20vm_static,=0A=20=20=20=20=20=20=20=20vm_icons=0A=20=
=20=20=20WHERE=20permissions.entity_id=20=3D=20vm_static.vm_guid=0A=20=20=
=20=20=20=20=20=20AND=20vm_static.entity_type=20IN=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20'TEMPLATE',=0A=20=20=20=20=20=20=20=20=20=20=20=20'VM'=0A=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20AND=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20vm_icons.id=20=3D=20=
vm_static.small_icon_id=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
vm_icons.id=20=3D=20vm_static.large_icon_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20)=0A=20=20=20=20=20=20=20=20AND=20permissions.user_id=20=3D=20=
v_user_id=0A=0A=20=20=20=20UNION=0A=0A=20=20=20=20--=20predefined=20=
icons=0A=20=20=20=20SELECT=20vm_icons.*=0A=20=20=20=20FROM=20vm_icons,=0A=
=20=20=20=20=20=20=20=20vm_icon_defaults=0A=20=20=20=20WHERE=20=
vm_icon_defaults.small_icon_id=20=3D=20vm_icons.id=0A=20=20=20=20=20=20=20=
=20OR=20vm_icon_defaults.large_icon_id=20=3D=20vm_icons.id;ELSE=0A=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vm_icons;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertVmIcon=20(=0A=
=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_data_url=20TEXT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
vm_icons=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20=
data_url=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=20=20=
=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20v_data_url=0A=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateVmIcon=20(=0A=20=20=
=20=20v_id=20UUID,=0A=20=20=20=20v_data_url=20TEXT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
vm_icons=0A=20=20=20=20SET=20id=20=3D=20v_id,=0A=20=20=20=20=20=20=20=20=
data_url=20=3D=20v_data_url=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteVmIcon=20(v_id=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20vm_icons=0A=
=20=20=20=20WHERE=20id=20=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmIconByVmIconDataUrl=20(v_data_url=20TEXT)=0ARETURNS=20SETOF=20=
vm_icons=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20vm_icons=0A=20=20=20=
=20WHERE=20data_url=20=3D=20v_data_url;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteVmIconIfUnused=20(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20vm_icons=0A=20=20=20=20=
WHERE=20id=20=3D=20v_id=0A=20=20=20=20=20=20=20=20AND=20NOT=20EXISTS=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=
=20=20=20=20FROM=20vm_icon_defaults=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20vm_icon_defaults.small_icon_id=20=3D=20vm_icons.id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20OR=20vm_icon_defaults.large_icon_id=20=
=3D=20vm_icons.id=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=
=20=20=20AND=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vm_static=0A=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20vm_static.small_icon_id=20=3D=20=
vm_icons.id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
vm_static.large_icon_id=20=3D=20vm_icons.id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteAllUnusedVmIcons=20=
()=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=
=20=20=20FROM=20vm_icons=0A=20=20=20=20WHERE=20NOT=20EXISTS=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20vm_icon_defaults=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
vm_icon_defaults.small_icon_id=20=3D=20vm_icons.id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20OR=20vm_icon_defaults.large_icon_id=20=3D=20=
vm_icons.id=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20AND=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
1=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vm_static=0A=20=20=20=20=20=
=20=20=20=20=20=20=20WHERE=20vm_static.small_icon_id=20=3D=20vm_icons.id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
vm_static.large_icon_id=20=3D=20vm_icons.id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20IsVmIconExist=20(v_id=20=
UUID)=0ARETURNS=20BOOLEAN=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20EXISTS=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vm_icons=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20id=20=3D=20v_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmIconDefaultByVmIconDefaultId=20(v_id=20UUID)=0ARETURNS=20SETOF=20=
vm_icon_defaults=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vm_icon_defaults=0A=20=20=20=20WHERE=20id=20=3D=20v_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromVmIconDefaults=20()=0ARETURNS=20SETOF=20=
vm_icon_defaults=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vm_icon_defaults;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertVmIconDefault=20(=0A=
=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_os_id=20INT,=0A=20=20=20=20=
v_small_icon_id=20UUID,=0A=20=20=20=20v_large_icon_id=20UUID=0A=20=20=20=20=
)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20=
INTO=20vm_icon_defaults=20(=0A=20=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=
=20=20=20os_id,=0A=20=20=20=20=20=20=20=20small_icon_id,=0A=20=20=20=20=20=
=20=20=20large_icon_id=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20=
(=0A=20=20=20=20=20=20=20=20v_id,=0A=20=20=20=20=20=20=20=20v_os_id,=0A=20=
=20=20=20=20=20=20=20v_small_icon_id,=0A=20=20=20=20=20=20=20=20=
v_large_icon_id=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateVmIconDefault=20(=0A=20=20=20=20v_id=20UUID,=0A=20=20=20=20v_os_id=20=
INT,=0A=20=20=20=20v_small_icon_id=20UUID,=0A=20=20=20=20v_large_icon_id=20=
UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20UPDATE=20vm_icon_defaults=0A=20=20=20=20SET=20id=20=3D=20v_id,=0A=20=
=20=20=20=20=20=20=20os_id=20=3D=20v_os_id,=0A=20=20=20=20=20=20=20=20=
small_icon_id=20=3D=20v_small_icon_id,=0A=20=20=20=20=20=20=20=20=
large_icon_id=20=3D=20v_large_icon_id=0A=20=20=20=20WHERE=20id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteVmIconDefault=20=
(v_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20vm_icon_defaults=0A=20=20=20=20WHERE=20id=20=
=3D=20v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmIconDefaultByVmIconDefaultLargeIconId=20(v_large_icon_id=20UUID)=0A=
RETURNS=20SETOF=20vm_icon_defaults=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20vm_icon_defaults=0A=20=20=20=20WHERE=20large_icon_id=20=3D=20=
v_large_icon_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmIconDefaultByVmIconDefaultOsId=20(v_os_id=20INT)=0ARETURNS=20SETOF=20=
vm_icon_defaults=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20FROM=20=
vm_icon_defaults=0A=20=20=20=20WHERE=20os_id=20=3D=20v_os_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteAllFromVmIconDefaults=20()=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vm_icon_defaults;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllVmJobs=20()=0A=
RETURNS=20SETOF=20vm_jobs=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vm_jobs.*=0A=20=20=20=20FROM=20=
vm_jobs;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateVmJobs=20(=0A=20=20=
=20=20v_vm_job_id=20UUID,=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20=
v_job_state=20INT,=0A=20=20=20=20v_job_type=20INT,=0A=20=20=20=20=
v_block_job_type=20INT,=0A=20=20=20=20v_bandwidth=20INT,=0A=20=20=20=20=
v_cursor_cur=20BIGINT,=0A=20=20=20=20v_cursor_end=20BIGINT,=0A=20=20=20=20=
v_image_group_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vm_jobs=0A=20=20=20=20SET=20=
vm_job_id=20=3D=20v_vm_job_id,=0A=20=20=20=20=20=20=20=20vm_id=20=3D=20=
v_vm_id,=0A=20=20=20=20=20=20=20=20job_state=20=3D=20v_job_state,=0A=20=20=
=20=20=20=20=20=20job_type=20=3D=20v_job_type,=0A=20=20=20=20=20=20=20=20=
block_job_type=20=3D=20v_block_job_type,=0A=20=20=20=20=20=20=20=20=
bandwidth=20=3D=20v_bandwidth,=0A=20=20=20=20=20=20=20=20cursor_cur=20=3D=20=
v_cursor_cur,=0A=20=20=20=20=20=20=20=20cursor_end=20=3D=20v_cursor_end,=0A=
=20=20=20=20=20=20=20=20image_group_id=20=3D=20v_image_group_id=0A=20=20=20=
=20WHERE=20vm_job_id=20=3D=20v_vm_job_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteVmJobs=20=
(v_vm_job_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20DELETE=0A=20=20=20=20FROM=20vm_jobs=0A=20=20=20=20WHERE=20=
vm_job_id=20=3D=20v_vm_job_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertVmJobs=20(=0A=20=20=
=20=20v_vm_job_id=20UUID,=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20=
v_job_state=20INT,=0A=20=20=20=20v_job_type=20INT,=0A=20=20=20=20=
v_block_job_type=20INT,=0A=20=20=20=20v_bandwidth=20INT,=0A=20=20=20=20=
v_cursor_cur=20BIGINT,=0A=20=20=20=20v_cursor_end=20BIGINT,=0A=20=20=20=20=
v_image_group_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20vm_jobs=20(=0A=20=20=20=
=20=20=20=20=20vm_job_id,=0A=20=20=20=20=20=20=20=20vm_id,=0A=20=20=20=20=
=20=20=20=20job_state,=0A=20=20=20=20=20=20=20=20job_type,=0A=20=20=20=20=
=20=20=20=20block_job_type,=0A=20=20=20=20=20=20=20=20bandwidth,=0A=20=20=
=20=20=20=20=20=20cursor_cur,=0A=20=20=20=20=20=20=20=20cursor_end,=0A=20=
=20=20=20=20=20=20=20image_group_id=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_vm_job_id,=0A=20=20=20=20=20=20=
=20=20v_vm_id,=0A=20=20=20=20=20=20=20=20v_job_state,=0A=20=20=20=20=20=20=
=20=20v_job_type,=0A=20=20=20=20=20=20=20=20v_block_job_type,=0A=20=20=20=
=20=20=20=20=20v_bandwidth,=0A=20=20=20=20=20=20=20=20v_cursor_cur,=0A=20=
=20=20=20=20=20=20=20v_cursor_end,=0A=20=20=20=20=20=20=20=20=
v_image_group_id=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertVm_pool_map=20(=0A=20=20=20=20v_vm_guid=20UUID,=0A=20=20=20=20=
v_vm_pool_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20INSERT=20INTO=20vm_pool_map=20(=0A=20=20=20=20=20=20=20=
=20vm_guid,=0A=20=20=20=20=20=20=20=20vm_pool_id=0A=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_vm_guid,=0A=20=20=20=
=20=20=20=20=20v_vm_pool_id=0A=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateVm_pool_map=20(=0A=20=20=20=20v_vm_guid=20=
UUID,=0A=20=20=20=20v_vm_pool_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=0A=
=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
vm_pool_map=0A=20=20=20=20SET=20vm_pool_id=20=3D=20v_vm_pool_id=0A=20=20=20=
=20WHERE=20vm_guid=20=3D=20v_vm_guid;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteVm_pool_map=20(v_vm_guid=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ADECLARE=20v_val=20VARCHAR(50);=0A=0ABEGIN=0A=20=20=20=20--=20=
Get=20(and=20keep)=20a=20shared=20lock=20with=20"right=20to=20upgrade=20=
to=20exclusive"=0A=20=20=20=20--=20in=20order=20to=20force=20locking=20=
parent=20before=20children=0A=20=20=20=20SELECT=20vm_guid=0A=20=20=20=20=
INTO=20v_val=0A=20=20=20=20FROM=20vm_pool_map=0A=20=20=20=20WHERE=20=
vm_guid=20=3D=20v_vm_guid=0A=20=20=20=20FOR=20UPDATE;=0A=0A=20=20=20=20=
DELETE=0A=20=20=20=20FROM=20vm_pool_map=0A=20=20=20=20WHERE=20vm_guid=20=
=3D=20v_vm_guid;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromVm_pool_map=20=
()=0ARETURNS=20SETOF=20vm_pool_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vm_pool_map.*=0A=20=20=
=20=20FROM=20vm_pool_map;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVm_pool_mapByvm_pool_id=20(v_vm_pool_id=20UUID)=0ARETURNS=20SETOF=20=
vm_pool_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20vm_pool_map.*=0A=20=20=20=20FROM=20=
vm_pool_map=0A=20=20=20=20INNER=20JOIN=20vm_static=0A=20=20=20=20=20=20=20=
=20ON=20vm_pool_map.vm_guid=20=3D=20vm_static.vm_guid=0A=20=20=20=20=
WHERE=20vm_pool_id=20=3D=20v_vm_pool_id=0A=20=20=20=20ORDER=20BY=20=
vm_static.vm_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
getVmMapsInVmPoolByVmPoolIdAndStatus=20(=0A=20=20=20=20v_vm_pool_id=20=
UUID,=0A=20=20=20=20v_status=20INT=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
vm_pool_map=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20vm_pool_id,=0A=20=20=20=20=20=20=20=20=
vm_pool_map.vm_guid=0A=20=20=20=20FROM=20vm_pool_map,=0A=20=20=20=20=20=20=
=20=20vm_dynamic=0A=20=20=20=20WHERE=20vm_pool_map.vm_guid=20=3D=20=
vm_dynamic.vm_guid=0A=20=20=20=20=20=20=20=20AND=20vm_pool_id=20=3D=20=
v_vm_pool_id=0A=20=20=20=20=20=20=20=20AND=20vm_dynamic.status=20=3D=20=
v_status;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertVm_pools=20(=0A=20=20=
=20=20v_vm_pool_description=20VARCHAR(4000),=0A=20=20=20=20=
v_vm_pool_comment=20TEXT,=0A=20=20=20=20v_vm_pool_id=20UUID,=0A=20=20=20=20=
v_vm_pool_name=20VARCHAR(255),=0A=20=20=20=20v_vm_pool_type=20INT,=0A=20=20=
=20=20v_stateful=20BOOLEAN,=0A=20=20=20=20v_parameters=20VARCHAR(200),=0A=
=20=20=20=20v_prestarted_vms=20INT,=0A=20=20=20=20v_cluster_id=20UUID,=0A=
=20=20=20=20v_max_assigned_vms_per_user=20SMALLINT,=0A=20=20=20=20=
v_spice_proxy=20VARCHAR(255)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20vm_pools=20(=0A=20=20=20=
=20=20=20=20=20vm_pool_id,=0A=20=20=20=20=20=20=20=20=
vm_pool_description,=0A=20=20=20=20=20=20=20=20vm_pool_comment,=0A=20=20=20=
=20=20=20=20=20vm_pool_name,=0A=20=20=20=20=20=20=20=20vm_pool_type,=0A=20=
=20=20=20=20=20=20=20stateful,=0A=20=20=20=20=20=20=20=20parameters,=0A=20=
=20=20=20=20=20=20=20prestarted_vms,=0A=20=20=20=20=20=20=20=20=
cluster_id,=0A=20=20=20=20=20=20=20=20max_assigned_vms_per_user,=0A=20=20=
=20=20=20=20=20=20spice_proxy=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_vm_pool_id,=0A=20=20=20=20=20=20=20=
=20v_vm_pool_description,=0A=20=20=20=20=20=20=20=20v_vm_pool_comment,=0A=
=20=20=20=20=20=20=20=20v_vm_pool_name,=0A=20=20=20=20=20=20=20=20=
v_vm_pool_type,=0A=20=20=20=20=20=20=20=20v_stateful,=0A=20=20=20=20=20=20=
=20=20v_parameters,=0A=20=20=20=20=20=20=20=20v_prestarted_vms,=0A=20=20=20=
=20=20=20=20=20v_cluster_id,=0A=20=20=20=20=20=20=20=20=
v_max_assigned_vms_per_user,=0A=20=20=20=20=20=20=20=20v_spice_proxy=0A=20=
=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateVm_pools=20(=0A=20=20=
=20=20v_vm_pool_description=20VARCHAR(4000),=0A=20=20=20=20=
v_vm_pool_comment=20TEXT,=0A=20=20=20=20v_vm_pool_id=20UUID,=0A=20=20=20=20=
v_vm_pool_name=20VARCHAR(255),=0A=20=20=20=20v_vm_pool_type=20INT,=0A=20=20=
=20=20v_stateful=20BOOLEAN,=0A=20=20=20=20v_parameters=20VARCHAR(200),=0A=
=20=20=20=20v_prestarted_vms=20INT,=0A=20=20=20=20v_cluster_id=20UUID,=0A=
=20=20=20=20v_max_assigned_vms_per_user=20SMALLINT,=0A=20=20=20=20=
v_spice_proxy=20VARCHAR(255)=0A=20=20=20=20)=0ARETURNS=20VOID=0A=20=20=20=
=20=0A=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
vm_pools=0A=20=20=20=20SET=20vm_pool_description=20=3D=20=
v_vm_pool_description,=0A=20=20=20=20=20=20=20=20vm_pool_comment=20=3D=20=
v_vm_pool_comment,=0A=20=20=20=20=20=20=20=20vm_pool_name=20=3D=20=
v_vm_pool_name,=0A=20=20=20=20=20=20=20=20vm_pool_type=20=3D=20=
v_vm_pool_type,=0A=20=20=20=20=20=20=20=20stateful=20=3D=20v_stateful,=0A=
=20=20=20=20=20=20=20=20parameters=20=3D=20v_parameters,=0A=20=20=20=20=20=
=20=20=20prestarted_vms=20=3D=20v_prestarted_vms,=0A=20=20=20=20=20=20=20=
=20cluster_id=20=3D=20v_cluster_id,=0A=20=20=20=20=20=20=20=20=
max_assigned_vms_per_user=20=3D=20v_max_assigned_vms_per_user,=0A=20=20=20=
=20=20=20=20=20spice_proxy=20=3D=20v_spice_proxy=0A=20=20=20=20WHERE=20=
vm_pool_id=20=3D=20v_vm_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteVm_pools=20=
(v_vm_pool_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ADECLARE=20=
v_val=20UUID;=0A=0ABEGIN=0A=20=20=20=20--=20Get=20(and=20keep)=20a=20=
shared=20lock=20with=20"right=20to=20upgrade=20to=20exclusive"=0A=20=20=20=
=20--=20in=20order=20to=20force=20locking=20parent=20before=20children=0A=
=20=20=20=20SELECT=20vm_pool_id=0A=20=20=20=20INTO=20v_val=0A=20=20=20=20=
FROM=20vm_pools=0A=20=20=20=20WHERE=20vm_pool_id=20=3D=20v_vm_pool_id=0A=20=
=20=20=20FOR=0A=0A=20=20=20=20UPDATE;=0A=0A=20=20=20=20DELETE=0A=20=20=20=
=20FROM=20vm_pools=0A=20=20=20=20WHERE=20vm_pool_id=20=3D=20=
v_vm_pool_id;=0A=0A=20=20=20=20--=20delete=20VmPool=20permissions=20--=0A=
=20=20=20=20DELETE=0A=20=20=20=20FROM=20permissions=0A=20=20=20=20WHERE=20=
object_id=20=3D=20v_vm_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20SetVmPoolBeingDestroyed=20=
(=0A=20=20=20=20v_vm_pool_id=20UUID,=0A=20=20=20=20v_is_being_destroyed=20=
BOOLEAN=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20UPDATE=20vm_pools=0A=20=20=20=20SET=20is_being_destroyed=20=3D=20=
v_is_being_destroyed=0A=20=20=20=20WHERE=20vm_pool_id=20=3D=20=
v_vm_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20TYPE=20IF=20EXISTS=20GetAllFromVm_pools_rs=20=
CASCADE;=0A**************************=0A=0ADROP=20TYPE=0A*********=20=
QUERY=20**********=0ACREATE=20type=20GetAllFromVm_pools_rs=20AS=20(=0A=20=
=20=20=20=20=20=20=20vm_pool_id=20UUID,=0A=20=20=20=20=20=20=20=20=
assigned_vm_count=20INT,=0A=20=20=20=20=20=20=20=20vm_running_count=20=
INT,=0A=20=20=20=20=20=20=20=20vm_pool_description=20VARCHAR(4000),=0A=20=
=20=20=20=20=20=20=20vm_pool_comment=20TEXT,=0A=20=20=20=20=20=20=20=20=
vm_pool_name=20VARCHAR(255),=0A=20=20=20=20=20=20=20=20vm_pool_type=20=
INT,=0A=20=20=20=20=20=20=20=20stateful=20BOOLEAN,=0A=20=20=20=20=20=20=20=
=20parameters=20VARCHAR(200),=0A=20=20=20=20=20=20=20=20prestarted_vms=20=
INT,=0A=20=20=20=20=20=20=20=20cluster_id=20UUID,=0A=20=20=20=20=20=20=20=
=20cluster_name=20VARCHAR(40),=0A=20=20=20=20=20=20=20=20=
max_assigned_vms_per_user=20SMALLINT,=0A=20=20=20=20=20=20=20=20=
spice_proxy=20VARCHAR(255),=0A=20=20=20=20=20=20=20=20is_being_destroyed=20=
BOOLEAN=0A=20=20=20=20=20=20=20=20);=0A**************************=0A=0A=
CREATE=20TYPE=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
FUNCTION=20GetAllFromVm_pools=20()=0ARETURNS=20SETOF=20=
GetAllFromVm_pools_rs=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20--=20=
BEGIN=20TRAN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20CREATE=20=
TEMPORARY=20TABLE=20tt_VM_POOL_GROUP=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20vm_pool_id=20UUID,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
assigned_vm_count=20INT=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20WITH=20OIDS;=0A=0A=20=20=20=20=20=20=20=20=
exception=20when=20others=20then=0A=0A=20=20=20=20=20=20=20=20TRUNCATE=20=
TABLE=20tt_VM_POOL_GROUP;=0A=20=20=20=20END;=0A=0A=20=20=20=20INSERT=20=
INTO=20tt_VM_POOL_GROUP=20(=0A=20=20=20=20=20=20=20=20vm_pool_id,=0A=20=20=
=20=20=20=20=20=20assigned_vm_count=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20SELECT=20vm_pools_view.vm_pool_id,=0A=20=20=20=20=20=20=20=20=
count(vm_pool_map.vm_pool_id)=0A=20=20=20=20FROM=20vm_pools_view=0A=20=20=
=20=20LEFT=20JOIN=20vm_pool_map=0A=20=20=20=20=20=20=20=20ON=20=
vm_pools_view.vm_pool_id=20=3D=20vm_pool_map.vm_pool_id=0A=20=20=20=20=
GROUP=20BY=20vm_pools_view.vm_pool_id,=0A=20=20=20=20=20=20=20=20=
vm_pool_map.vm_pool_id;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
CREATE=20TEMPORARY=20TABLE=20tt_VM_POOL_RUNNING=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20vm_pool_id=20UUID,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vm_running_count=20INT=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20WITH=20OIDS;=0A=0A=20=20=20=20=20=20=20=20=
exception=20when=20others=20then=0A=0A=20=20=20=20=20=20=20=20TRUNCATE=20=
TABLE=20tt_VM_POOL_RUNNING;=0A=20=20=20=20END;=0A=0A=20=20=20=20INSERT=20=
INTO=20tt_VM_POOL_RUNNING=20(=0A=20=20=20=20=20=20=20=20vm_pool_id,=0A=20=
=20=20=20=20=20=20=20vm_running_count=0A=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20SELECT=20vm_pools_view.vm_pool_id,=0A=20=20=20=20=20=20=20=20=
count(vm_pools_view.vm_pool_id)=0A=20=20=20=20FROM=20vm_pools_view=0A=20=20=
=20=20LEFT=20JOIN=20vm_pool_map=0A=20=20=20=20=20=20=20=20ON=20=
vm_pools_view.vm_pool_id=20=3D=20vm_pool_map.vm_pool_id=0A=20=20=20=20=
LEFT=20JOIN=20vm_dynamic=0A=20=20=20=20=20=20=20=20ON=20=
vm_pool_map.vm_guid=20=3D=20vm_dynamic.vm_guid=0A=20=20=20=20WHERE=20=
vm_dynamic.status=20>=200=0A=20=20=20=20GROUP=20BY=20=
vm_pools_view.vm_pool_id;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
CREATE=20TEMPORARY=20TABLE=20tt_VM_POOL_PRERESULT=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20vm_pool_id=20UUID,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
assigned_vm_count=20INT,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vm_running_count=20INT=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20WITH=20OIDS;=0A=0A=20=20=20=20=20=20=20=20=
exception=20when=20others=20then=0A=0A=20=20=20=20=20=20=20=20TRUNCATE=20=
TABLE=20tt_VM_POOL_PRERESULT;=0A=20=20=20=20END;=0A=0A=20=20=20=20INSERT=20=
INTO=20tt_VM_POOL_PRERESULT=20(=0A=20=20=20=20=20=20=20=20vm_pool_id,=0A=20=
=20=20=20=20=20=20=20assigned_vm_count,=0A=20=20=20=20=20=20=20=20=
vm_running_count=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20SELECT=20=
pg.vm_pool_id,=0A=20=20=20=20=20=20=20=20pg.assigned_vm_count,=0A=20=20=20=
=20=20=20=20=20pr.vm_running_count=0A=20=20=20=20FROM=20tt_VM_POOL_GROUP=20=
pg=0A=20=20=20=20LEFT=20JOIN=20tt_VM_POOL_RUNNING=20pr=0A=20=20=20=20=20=20=
=20=20ON=20pg.vm_pool_id=20=3D=20pr.vm_pool_id;=0A=0A=20=20=20=20UPDATE=20=
tt_VM_POOL_PRERESULT=0A=20=20=20=20SET=20vm_running_count=20=3D=200=0A=20=
=20=20=20WHERE=20vm_running_count=20IS=20NULL;=0A=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20CREATE=20TEMPORARY=20TABLE=20tt_VM_POOL_RESULT=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20vm_pool_id=20UUID,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20assigned_vm_count=20INT,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20vm_running_count=20INT,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vm_pool_description=20VARCHAR(4000),=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vm_pool_comment=20TEXT,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vm_pool_name=20VARCHAR(255),=0A=20=20=20=20=20=20=20=20=20=20=20=20=
vm_pool_type=20INT,=0A=20=20=20=20=20=20=20=20=20=20=20=20stateful=20=
BOOLEAN,=0A=20=20=20=20=20=20=20=20=20=20=20=20parameters=20=
VARCHAR(200),=0A=20=20=20=20=20=20=20=20=20=20=20=20prestarted_vms=20=
INT,=0A=20=20=20=20=20=20=20=20=20=20=20=20cluster_id=20UUID,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20cluster_name=20VARCHAR(40),=0A=20=20=20=20=20=20=
=20=20=20=20=20=20max_assigned_vms_per_user=20SMALLINT,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20spice_proxy=20VARCHAR(255),=0A=20=20=20=20=20=20=20=20=
=20=20=20=20is_being_destroyed=20BOOLEAN=0A=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20WITH=20OIDS;=0A=0A=20=20=20=
=20=20=20=20=20exception=20when=20others=20then=0A=0A=20=20=20=20=20=20=20=
=20TRUNCATE=20TABLE=20tt_VM_POOL_RESULT;=0A=20=20=20=20END;=0A=0A=20=20=20=
=20INSERT=20INTO=20tt_VM_POOL_RESULT=20(=0A=20=20=20=20=20=20=20=20=
vm_pool_id,=0A=20=20=20=20=20=20=20=20assigned_vm_count,=0A=20=20=20=20=20=
=20=20=20vm_running_count,=0A=20=20=20=20=20=20=20=20=
vm_pool_description,=0A=20=20=20=20=20=20=20=20vm_pool_comment,=0A=20=20=20=
=20=20=20=20=20vm_pool_name,=0A=20=20=20=20=20=20=20=20vm_pool_type,=0A=20=
=20=20=20=20=20=20=20stateful,=0A=20=20=20=20=20=20=20=20parameters,=0A=20=
=20=20=20=20=20=20=20prestarted_vms,=0A=20=20=20=20=20=20=20=20=
cluster_id,=0A=20=20=20=20=20=20=20=20cluster_name,=0A=20=20=20=20=20=20=20=
=20max_assigned_vms_per_user,=0A=20=20=20=20=20=20=20=20spice_proxy,=0A=20=
=20=20=20=20=20=20=20is_being_destroyed=0A=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20SELECT=20ppr.vm_pool_id,=0A=20=20=20=20=20=20=20=20=
ppr.assigned_vm_count,=0A=20=20=20=20=20=20=20=20ppr.vm_running_count,=0A=
=20=20=20=20=20=20=20=20p.vm_pool_description,=0A=20=20=20=20=20=20=20=20=
p.vm_pool_comment,=0A=20=20=20=20=20=20=20=20p.vm_pool_name,=0A=20=20=20=20=
=20=20=20=20p.vm_pool_type,=0A=20=20=20=20=20=20=20=20p.stateful,=0A=20=20=
=20=20=20=20=20=20p.parameters,=0A=20=20=20=20=20=20=20=20=
p.prestarted_vms,=0A=20=20=20=20=20=20=20=20p.cluster_id,=0A=20=20=20=20=20=
=20=20=20p.cluster_name,=0A=20=20=20=20=20=20=20=20=
p.max_assigned_vms_per_user,=0A=20=20=20=20=20=20=20=20p.spice_proxy,=0A=20=
=20=20=20=20=20=20=20p.is_being_destroyed=0A=20=20=20=20FROM=20=
tt_VM_POOL_PRERESULT=20ppr=0A=20=20=20=20INNER=20JOIN=20vm_pools_view=20=
p=0A=20=20=20=20=20=20=20=20ON=20ppr.vm_pool_id=20=3D=20p.vm_pool_id;=0A=0A=
=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20*=0A=20=20=20=20=
FROM=20tt_VM_POOL_RESULT;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVm_poolsByvm_pool_id=20=
(=0A=20=20=20=20v_vm_pool_id=20UUID,=0A=20=20=20=20v_user_id=20UUID,=0A=20=
=20=20=20v_is_filtered=20BOOLEAN=0A=20=20=20=20)=0ARETURNS=20SETOF=20=
vm_pools_full_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vm_pools_full_view.*=0A=20=20=20=
=20FROM=20vm_pools_full_view=0A=20=20=20=20WHERE=20vm_pool_id=20=3D=20=
v_vm_pool_id=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20NOT=20v_is_filtered=0A=20=20=20=20=20=20=20=20=20=20=20=20OR=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
user_vm_pool_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20v_vm_pool_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVm_poolsByvm_pool_name=20(v_vm_pool_name=20VARCHAR(255))=0ARETURNS=20=
SETOF=20vm_pools_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vm_pools_view.*=0A=20=20=20=20=
FROM=20vm_pools_view=0A=20=20=20=20WHERE=20vm_pool_name=20=3D=20=
v_vm_pool_name;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllVm_poolsByUser_id=20=
(v_user_id=20UUID)=0ARETURNS=20SETOF=20vm_pools_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
DISTINCT=20vm_pools_view.*=0A=20=20=20=20FROM=20=
users_and_groups_to_vm_pool_map_view=0A=20=20=20=20INNER=20JOIN=20=
vm_pools_view=0A=20=20=20=20=20=20=20=20ON=20=
users_and_groups_to_vm_pool_map_view.vm_pool_id=20=3D=20=
vm_pools_view.vm_pool_id=0A=20=20=20=20WHERE=20=
(users_and_groups_to_vm_pool_map_view.user_id=20=3D=20v_user_id);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVm_poolsByAdGroup_names=20(v_ad_group_names=20=
VARCHAR(4000))=0ARETURNS=20SETOF=20vm_pools_view=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
DISTINCT=20vm_pools_view.*=0A=20=20=20=20FROM=20ad_groups=0A=20=20=20=20=
INNER=20JOIN=20users_and_groups_to_vm_pool_map_view=0A=20=20=20=20=20=20=20=
=20ON=20ad_groups.id=20=3D=20=
users_and_groups_to_vm_pool_map_view.user_id=0A=20=20=20=20INNER=20JOIN=20=
vm_pools_view=0A=20=20=20=20=20=20=20=20ON=20=
users_and_groups_to_vm_pool_map_view.vm_pool_id=20=3D=20=
vm_pools_view.vm_pool_id=0A=20=20=20=20WHERE=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20ad_groups.name=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=20Id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20fnSplitter(v_ad_group_names)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmDataFromPoolByPoolId=20(=0A=20=20=20=20v_pool_id=20uuid,=0A=20=20=20=
=20v_user_id=20uuid,=0A=20=20=20=20v_is_filtered=20boolean=0A=20=20=20=20=
)=0ARETURNS=20SETOF=20vms=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vms.*=0A=20=20=20=20FROM=20=
vms=0A=20=20=20=20WHERE=20vm_pool_id=20=3D=20v_pool_id=0A=20=20=20=20=20=20=
=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20v_is_filtered=0A=
=20=20=20=20=20=20=20=20=20=20=20=20OR=20EXISTS=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20user_vm_pool_permissions_view=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20WHERE=20user_id=20=3D=20v_user_id=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20=
v_pool_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20--=20Limiting=20=
results=20to=201=20since=20we=20only=20need=20a=20single=20VM=20from=20=
the=20pool=20to=20retrieve=20the=20pool=20data=0A=20=20=20=20=20=20=20=20=
LIMIT=201;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllVm_poolsByUser_id_with_groups_and_UserRoles=20(v_user_id=20UUID)=0A=
RETURNS=20SETOF=20vm_pools_view=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20DISTINCT=20pools.*=0A=20=
=20=20=20FROM=20vm_pools_view=20pools=0A=20=20=20=20INNER=20JOIN=20=
user_vm_pool_permissions_view=0A=20=20=20=20=20=20=20=20ON=20user_id=20=3D=
=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20=
pools.vm_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20BoundVmPoolPrestartedVms=20=
(v_vm_pool_id=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20UPDATE=20vm_pools=0A=20=20=20=20SET=20prestarted_vms=20=3D=20LEAST=20=
(=0A=20=20=20=20=20=20=20=20prestarted_vms,=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=20COUNT=20(*)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vm_pool_map=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
vm_pool_id=20=3D=20v_vm_pool_id=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20WHERE=20vm_pool_id=20=3D=20=
v_vm_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20UpdateOvfGenerations=20(=0A=
=20=20=20=20v_vms_ids=20VARCHAR(5000),=0A=20=20=20=20=
v_vms_db_generations=20VARCHAR(5000),=0A=20=20=20=20v_ovf_data=20TEXT,=0A=
=20=20=20=20v_ovf_data_seperator=20VARCHAR(10)=0A=20=20=20=20)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ADECLARE=20curs_vmids=20CURSOR=0AFOR=0ASELECT=20=
*=0AFROM=20fnSplitterUuid(v_vms_ids);=0A=0Acurs_newovfgen=20CURSOR=0AFOR=0A=
=0ASELECT=20*=0AFROM=20fnSplitter(v_vms_db_generations);=0A=0A=
curs_newovfdata=20CURSOR=0AFOR=0A=0ASELECT=20*=0AFROM=20=
fnSplitterWithSeperator(v_ovf_data,=20v_ovf_data_seperator);=0A=0Aid=20=
UUID;=0A=0Anew_ovf_gen=20BIGINT;=0A=0Anew_ovf_config=20TEXT;=0A=0ABEGIN=0A=
=20=20=20=20OPEN=20curs_vmids;=0A=0A=20=20=20=20OPEN=20curs_newovfgen;=0A=
=0A=20=20=20=20OPEN=20curs_newovfdata;=0A=0A=20=20=20=20LOOP=0A=0A=20=20=20=
=20FETCH=20curs_vmids=0A=20=20=20=20INTO=20id;=0A=0A=20=20=20=20FETCH=20=
curs_newovfgen=0A=20=20=20=20INTO=20new_ovf_gen;=0A=0A=20=20=20=20FETCH=20=
curs_newovfdata=0A=20=20=20=20INTO=20new_ovf_config;=0A=0A=20=20=20=20IF=20=
NOT=20FOUND=20THEN=20EXIT;=0A=20=20=20=20END=20IF;=0A=20=20=20=20UPDATE=20=
vm_ovf_generations=0A=20=20=20=20SET=20ovf_generation=20=3D=20=
new_ovf_gen,=0A=20=20=20=20=20=20=20=20ovf_data=20=3D=20new_ovf_config=0A=
=20=20=20=20WHERE=20vm_guid=20=3D=20id;=0A=20=20=20=20END=20LOOP;=0A=0A=
CLOSE=20curs_vmids;=0A=0ACLOSE=20curs_newovfgen;=0A=0ACLOSE=20=
curs_newovfdata;END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20LoadOvfDataForIds=20=
(v_ids=20VARCHAR(5000))=0ARETURNS=20SETOF=20vm_ovf_generations=20STABLE=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=
SELECT=20*=0A=20=20=20=20FROM=20vm_ovf_generations=20ovf=0A=20=20=20=20=
WHERE=20ovf.vm_guid=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitterUuid(v_ids)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetIdsForOvfDeletion=20(v_storage_pool_id=20UUID)=0A=
RETURNS=20SETOF=20UUID=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20ovf.vm_guid=20AS=20vm_guid=0A=20=
=20=20=20FROM=20vm_ovf_generations=20ovf=0A=20=20=20=20WHERE=20=
ovf.storage_pool_id=20=3D=20v_storage_pool_id=0A=20=20=20=20=20=20=20=20=
AND=20ovf.vm_guid=20NOT=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vm_static=0A=
=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetOvfGeneration=20=
(v_vm_id=20UUID)=0ARETURNS=20SETOF=20BIGINT=20STABLE=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
vm.ovf_generation=0A=20=20=20=20FROM=20vm_ovf_generations=20vm=0A=20=20=20=
=20WHERE=20vm.vm_guid=20=3D=20v_vm_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmTemplatesIdsForOvfUpdate=20(v_storage_pool_id=20UUID)=0ARETURNS=20=
SETOF=20UUID=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20templates.vmt_guid=20AS=20vm_guid=0A=20=20=
=20=20FROM=20vm_templates_based_view=20templates,=0A=20=20=20=20=20=20=20=
=20vm_ovf_generations=20generations=0A=20=20=20=20WHERE=20=
generations.vm_guid=20=3D=20templates.vmt_guid=0A=20=20=20=20=20=20=20=20=
AND=20templates.db_generation=20>=20generations.ovf_generation=0A=20=20=20=
=20=20=20=20=20AND=20templates.storage_pool_id=20=3D=20=
v_storage_pool_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVmsIdsForOvfUpdate=20=
(v_storage_pool_id=20UUID)=0ARETURNS=20SETOF=20UUID=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
vm.vm_guid=20AS=20vm_guid=0A=20=20=20=20FROM=20vms=20vm,=0A=20=20=20=20=20=
=20=20=20vm_ovf_generations=20ovf_gen=0A=20=20=20=20WHERE=20vm.vm_guid=20=
=3D=20ovf_gen.vm_guid=0A=20=20=20=20=20=20=20=20AND=20vm.db_generation=20=
>=20ovf_gen.ovf_generation=0A=20=20=20=20=20=20=20=20AND=20=
vm.storage_pool_id=20=3D=20v_storage_pool_id=0A=20=20=20=20=20=20=20=20=
--=20filter=20out=20external=20VMs=20if=20needed.=0A=20=20=20=20=20=20=20=
=20AND=20vm.origin=20!=3D=204;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteOvfGenerations=20=
(v_vms_ids=20VARCHAR(5000))=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=
=20=20=20=20DELETE=0A=20=20=20=20FROM=20vm_ovf_generations=0A=20=20=20=20=
WHERE=20vm_guid=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
*=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20fnSplitterUuid(v_vms_ids)=0A=
=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20--=20=
needed=20here=20to=20ensure=20that=20vm=20with=20the=20same=20id=20=
hasn't=20been=20added=20by=20import=20vm/template=20command=0A=20=20=20=20=
=20=20=20=20AND=20vm_guid=20NOT=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=20vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vm_static=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertVmStatistics=20(=0A=20=20=20=20v_cpu_sys=20DECIMAL(18,=200),=0A=20=20=
=20=20v_cpu_user=20DECIMAL(18,=200),=0A=20=20=20=20v_elapsed_time=20=
DECIMAL(18,=200),=0A=20=20=20=20v_usage_cpu_percent=20INT,=0A=20=20=20=20=
v_usage_mem_percent=20INT,=0A=20=20=20=20v_migration_progress_percent=20=
INT,=0A=20=20=20=20v_usage_network_percent=20INT,=0A=20=20=20=20=
v_disks_usage=20TEXT,=0A=20=20=20=20v_memory_usage_history=20TEXT,=0A=20=20=
=20=20v_cpu_usage_history=20TEXT,=0A=20=20=20=20v_network_usage_history=20=
TEXT,=0A=20=20=20=20v_vm_guid=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20vm_statistics=20(=0A=
=20=20=20=20=20=20=20=20cpu_sys,=0A=20=20=20=20=20=20=20=20cpu_user,=0A=20=
=20=20=20=20=20=20=20elapsed_time,=0A=20=20=20=20=20=20=20=20=
usage_cpu_percent,=0A=20=20=20=20=20=20=20=20usage_mem_percent,=0A=20=20=20=
=20=20=20=20=20migration_progress_percent,=0A=20=20=20=20=20=20=20=20=
usage_network_percent,=0A=20=20=20=20=20=20=20=20disks_usage,=0A=20=20=20=
=20=20=20=20=20vm_guid,=0A=20=20=20=20=20=20=20=20memory_usage_history,=0A=
=20=20=20=20=20=20=20=20cpu_usage_history,=0A=20=20=20=20=20=20=20=20=
network_usage_history=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20=
(=0A=20=20=20=20=20=20=20=20v_cpu_sys,=0A=20=20=20=20=20=20=20=20=
v_cpu_user,=0A=20=20=20=20=20=20=20=20v_elapsed_time,=0A=20=20=20=20=20=20=
=20=20v_usage_cpu_percent,=0A=20=20=20=20=20=20=20=20=
v_usage_mem_percent,=0A=20=20=20=20=20=20=20=20=
v_migration_progress_percent,=0A=20=20=20=20=20=20=20=20=
v_usage_network_percent,=0A=20=20=20=20=20=20=20=20v_disks_usage,=0A=20=20=
=20=20=20=20=20=20v_vm_guid,=0A=20=20=20=20=20=20=20=20=
v_memory_usage_history,=0A=20=20=20=20=20=20=20=20v_cpu_usage_history,=0A=
=20=20=20=20=20=20=20=20v_network_usage_history=0A=20=20=20=20=20=20=20=20=
);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateVmStatistics=20(=0A=20=20=20=20v_cpu_sys=20=
DECIMAL(18,=200),=0A=20=20=20=20v_cpu_user=20DECIMAL(18,=200),=0A=20=20=20=
=20v_elapsed_time=20DECIMAL(18,=200),=0A=20=20=20=20v_usage_cpu_percent=20=
INT,=0A=20=20=20=20v_migration_progress_percent=20INT,=0A=20=20=20=20=
v_usage_mem_percent=20INT,=0A=20=20=20=20v_usage_network_percent=20INT,=0A=
=20=20=20=20v_disks_usage=20TEXT,=0A=20=20=20=20v_memory_usage_history=20=
TEXT,=0A=20=20=20=20v_cpu_usage_history=20TEXT,=0A=20=20=20=20=
v_network_usage_history=20TEXT,=0A=20=20=20=20v_vm_guid=20UUID=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
vm_statistics=0A=20=20=20=20SET=20cpu_sys=20=3D=20v_cpu_sys,=0A=20=20=20=20=
=20=20=20=20cpu_user=20=3D=20v_cpu_user,=0A=20=20=20=20=20=20=20=20=
elapsed_time=20=3D=20v_elapsed_time,=0A=20=20=20=20=20=20=20=20=
usage_cpu_percent=20=3D=20v_usage_cpu_percent,=0A=20=20=20=20=20=20=20=20=
usage_mem_percent=20=3D=20v_usage_mem_percent,=0A=20=20=20=20=20=20=20=20=
migration_progress_percent=20=3D=20v_migration_progress_percent,=0A=20=20=
=20=20=20=20=20=20usage_network_percent=20=3D=20v_usage_network_percent,=0A=
=20=20=20=20=20=20=20=20disks_usage=20=3D=20v_disks_usage,=0A=20=20=20=20=
=20=20=20=20memory_usage_history=20=3D=20v_memory_usage_history,=0A=20=20=
=20=20=20=20=20=20cpu_usage_history=20=3D=20v_cpu_usage_history,=0A=20=20=
=20=20=20=20=20=20network_usage_history=20=3D=20v_network_usage_history,=0A=
=20=20=20=20=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP=0A=20=20=20=20=
WHERE=20vm_guid=20=3D=20v_vm_guid;=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
DeleteVmStatistics=20(v_vm_guid=20UUID)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vm_statistics=0A=20=20=20=20WHERE=20vm_guid=20=3D=20v_vm_guid;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetAllFromVmStatistics=20()=0ARETURNS=20SETOF=20=
vm_statistics=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=0A=0A=20=20=20=20SELECT=20vm_statistics.*=0A=20=20=20=20FROM=20=
vm_statistics;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVmStatisticsByVmGuid=20=
(v_vm_guid=20UUID)=0ARETURNS=20SETOF=20vm_statistics=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
vm_statistics.*=0A=20=20=20=20FROM=20vm_statistics=0A=20=20=20=20WHERE=20=
vm_guid=20=3D=20v_vm_guid;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertVmDynamic=20(=0A=20=
=20=20=20v_app_list=20TEXT,=0A=20=20=20=20v_guest_cur_user_name=20=
VARCHAR(255),=0A=20=20=20=20v_console_cur_user_name=20VARCHAR(255),=0A=20=
=20=20=20v_console_user_id=20UUID,=0A=20=20=20=20v_guest_os=20=
VARCHAR(255),=0A=20=20=20=20v_migrating_to_vds=20UUID,=0A=20=20=20=20=
v_run_on_vds=20UUID,=0A=20=20=20=20v_status=20INT,=0A=20=20=20=20=
v_vm_guid=20UUID,=0A=20=20=20=20v_vm_host=20VARCHAR(255),=0A=20=20=20=20=
v_vm_ip=20VARCHAR(255),=0A=20=20=20=20v_vm_fqdn=20VARCHAR(255),=0A=20=20=20=
=20v_last_start_time=20TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20=
v_last_stop_time=20TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20=20=20=20=
v_vm_pid=20INT,=0A=20=20=20=20v_acpi_enable=20BOOLEAN,=0A=20=20=20=20=
v_session=20INT,=0A=20=20=20=20v_kvm_enable=20BOOLEAN,=0A=20=20=20=20=
v_boot_sequence=20INT,=0A=20=20=20=20v_utc_diff=20INT,=0A=20=20=20=20=
v_last_vds_run_on=20UUID,=0A=20=20=20=20v_client_ip=20VARCHAR(255),=0A=20=
=20=20=20v_guest_requested_memory=20INT,=0A=20=20=20=20v_exit_status=20=
INT,=0A=20=20=20=20v_pause_status=20INT,=0A=20=20=20=20v_exit_message=20=
VARCHAR(4000),=0A=20=20=20=20v_guest_agent_nics_hash=20INT,=0A=20=20=20=20=
v_last_watchdog_event=20NUMERIC,=0A=20=20=20=20v_last_watchdog_action=20=
VARCHAR(8),=0A=20=20=20=20v_is_run_once=20BOOLEAN,=0A=20=20=20=20=
v_cpu_name=20VARCHAR(255),=0A=20=20=20=20v_emulated_machine=20=
VARCHAR(255),=0A=20=20=20=20v_current_cd=20VARCHAR(4000),=0A=20=20=20=20=
v_exit_reason=20INT,=0A=20=20=20=20v_guest_cpu_count=20INT,=0A=20=20=20=20=
v_spice_port=20INT,=0A=20=20=20=20v_spice_tls_port=20INT,=0A=20=20=20=20=
v_spice_ip=20VARCHAR(32),=0A=20=20=20=20v_vnc_port=20INT,=0A=20=20=20=20=
v_vnc_ip=20VARCHAR(32),=0A=20=20=20=20v_guest_agent_status=20INT,=0A=20=20=
=20=20v_guest_mem_free=20BIGINT,=0A=20=20=20=20v_guest_mem_buffered=20=
BIGINT,=0A=20=20=20=20v_guest_mem_cached=20BIGINT,=0A=20=20=20=20=
v_guest_timezone_offset=20INT,=0A=20=20=20=20v_guest_timezone_name=20=
VARCHAR(255),=0A=20=20=20=20v_guestos_arch=20INT,=0A=20=20=20=20=
v_guestos_codename=20VARCHAR(255),=0A=20=20=20=20v_guestos_distribution=20=
VARCHAR(255),=0A=20=20=20=20v_guestos_kernel_version=20VARCHAR(255),=0A=20=
=20=20=20v_guestos_type=20VARCHAR(255),=0A=20=20=20=20v_guestos_version=20=
VARCHAR(255),=0A=20=20=20=20v_guest_containers=20TEXT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
vm_dynamic=20(=0A=20=20=20=20=20=20=20=20app_list,=0A=20=20=20=20=20=20=20=
=20guest_cur_user_name,=0A=20=20=20=20=20=20=20=20console_cur_user_name,=0A=
=20=20=20=20=20=20=20=20console_user_id,=0A=20=20=20=20=20=20=20=20=
guest_os,=0A=20=20=20=20=20=20=20=20migrating_to_vds,=0A=20=20=20=20=20=20=
=20=20run_on_vds,=0A=20=20=20=20=20=20=20=20status,=0A=20=20=20=20=20=20=20=
=20vm_guid,=0A=20=20=20=20=20=20=20=20vm_host,=0A=20=20=20=20=20=20=20=20=
vm_ip,=0A=20=20=20=20=20=20=20=20last_start_time,=0A=20=20=20=20=20=20=20=
=20last_stop_time,=0A=20=20=20=20=20=20=20=20vm_pid,=0A=20=20=20=20=20=20=
=20=20acpi_enable,=0A=20=20=20=20=20=20=20=20session,=0A=20=20=20=20=20=20=
=20=20kvm_enable,=0A=20=20=20=20=20=20=20=20boot_sequence,=0A=20=20=20=20=
=20=20=20=20utc_diff,=0A=20=20=20=20=20=20=20=20last_vds_run_on,=0A=20=20=
=20=20=20=20=20=20client_ip,=0A=20=20=20=20=20=20=20=20=
guest_requested_memory,=0A=20=20=20=20=20=20=20=20exit_status,=0A=20=20=20=
=20=20=20=20=20pause_status,=0A=20=20=20=20=20=20=20=20exit_message,=0A=20=
=20=20=20=20=20=20=20guest_agent_nics_hash,=0A=20=20=20=20=20=20=20=20=
last_watchdog_event,=0A=20=20=20=20=20=20=20=20last_watchdog_action,=0A=20=
=20=20=20=20=20=20=20is_run_once,=0A=20=20=20=20=20=20=20=20vm_fqdn,=0A=20=
=20=20=20=20=20=20=20cpu_name,=0A=20=20=20=20=20=20=20=20=
emulated_machine,=0A=20=20=20=20=20=20=20=20current_cd,=0A=20=20=20=20=20=
=20=20=20exit_reason,=0A=20=20=20=20=20=20=20=20guest_cpu_count,=0A=20=20=
=20=20=20=20=20=20spice_port,=0A=20=20=20=20=20=20=20=20spice_tls_port,=0A=
=20=20=20=20=20=20=20=20spice_ip,=0A=20=20=20=20=20=20=20=20vnc_port,=0A=20=
=20=20=20=20=20=20=20vnc_ip,=0A=20=20=20=20=20=20=20=20=
guest_agent_status,=0A=20=20=20=20=20=20=20=20guest_mem_buffered,=0A=20=20=
=20=20=20=20=20=20guest_mem_cached,=0A=20=20=20=20=20=20=20=20=
guest_mem_free,=0A=20=20=20=20=20=20=20=20guest_timezone_offset,=0A=20=20=
=20=20=20=20=20=20guest_timezone_name,=0A=20=20=20=20=20=20=20=20=
guestos_arch,=0A=20=20=20=20=20=20=20=20guestos_codename,=0A=20=20=20=20=20=
=20=20=20guestos_distribution,=0A=20=20=20=20=20=20=20=20=
guestos_kernel_version,=0A=20=20=20=20=20=20=20=20guestos_type,=0A=20=20=20=
=20=20=20=20=20guestos_version,=0A=20=20=20=20=20=20=20=20=
guest_containers=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20VALUES=20(=0A=20=
=20=20=20=20=20=20=20v_app_list,=0A=20=20=20=20=20=20=20=20=
v_guest_cur_user_name,=0A=20=20=20=20=20=20=20=20=
v_console_cur_user_name,=0A=20=20=20=20=20=20=20=20v_console_user_id,=0A=20=
=20=20=20=20=20=20=20v_guest_os,=0A=20=20=20=20=20=20=20=20=
v_migrating_to_vds,=0A=20=20=20=20=20=20=20=20v_run_on_vds,=0A=20=20=20=20=
=20=20=20=20v_status,=0A=20=20=20=20=20=20=20=20v_vm_guid,=0A=20=20=20=20=
=20=20=20=20v_vm_host,=0A=20=20=20=20=20=20=20=20v_vm_ip,=0A=20=20=20=20=20=
=20=20=20v_last_start_time,=0A=20=20=20=20=20=20=20=20v_last_stop_time,=0A=
=20=20=20=20=20=20=20=20v_vm_pid,=0A=20=20=20=20=20=20=20=20=
v_acpi_enable,=0A=20=20=20=20=20=20=20=20v_session,=0A=20=20=20=20=20=20=20=
=20v_kvm_enable,=0A=20=20=20=20=20=20=20=20v_boot_sequence,=0A=20=20=20=20=
=20=20=20=20v_utc_diff,=0A=20=20=20=20=20=20=20=20v_last_vds_run_on,=0A=20=
=20=20=20=20=20=20=20v_client_ip,=0A=20=20=20=20=20=20=20=20=
v_guest_requested_memory,=0A=20=20=20=20=20=20=20=20v_exit_status,=0A=20=20=
=20=20=20=20=20=20v_pause_status,=0A=20=20=20=20=20=20=20=20=
v_exit_message,=0A=20=20=20=20=20=20=20=20v_guest_agent_nics_hash,=0A=20=20=
=20=20=20=20=20=20v_last_watchdog_event,=0A=20=20=20=20=20=20=20=20=
v_last_watchdog_action,=0A=20=20=20=20=20=20=20=20v_is_run_once,=0A=20=20=
=20=20=20=20=20=20v_vm_fqdn,=0A=20=20=20=20=20=20=20=20v_cpu_name,=0A=20=20=
=20=20=20=20=20=20v_emulated_machine,=0A=20=20=20=20=20=20=20=20=
v_current_cd,=0A=20=20=20=20=20=20=20=20v_exit_reason,=0A=20=20=20=20=20=20=
=20=20v_guest_cpu_count,=0A=20=20=20=20=20=20=20=20v_spice_port,=0A=20=20=
=20=20=20=20=20=20v_spice_tls_port,=0A=20=20=20=20=20=20=20=20=
v_spice_ip,=0A=20=20=20=20=20=20=20=20v_vnc_port,=0A=20=20=20=20=20=20=20=
=20v_vnc_ip,=0A=20=20=20=20=20=20=20=20v_guest_agent_status,=0A=20=20=20=20=
=20=20=20=20v_guest_mem_buffered,=0A=20=20=20=20=20=20=20=20=
v_guest_mem_cached,=0A=20=20=20=20=20=20=20=20v_guest_mem_free,=0A=20=20=20=
=20=20=20=20=20v_guest_timezone_offset,=0A=20=20=20=20=20=20=20=20=
v_guest_timezone_name,=0A=20=20=20=20=20=20=20=20v_guestos_arch,=0A=20=20=
=20=20=20=20=20=20v_guestos_codename,=0A=20=20=20=20=20=20=20=20=
v_guestos_distribution,=0A=20=20=20=20=20=20=20=20=
v_guestos_kernel_version,=0A=20=20=20=20=20=20=20=20v_guestos_type,=0A=20=
=20=20=20=20=20=20=20v_guestos_version,=0A=20=20=20=20=20=20=20=20=
v_guest_containers=0A=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateVmDynamic=20(=0A=20=20=20=20v_app_list=20TEXT,=0A=20=20=20=20=
v_guest_cur_user_name=20VARCHAR(255),=0A=20=20=20=20=
v_console_cur_user_name=20VARCHAR(255),=0A=20=20=20=20v_console_user_id=20=
UUID,=0A=20=20=20=20v_guest_os=20VARCHAR(255),=0A=20=20=20=20=
v_migrating_to_vds=20UUID,=0A=20=20=20=20v_run_on_vds=20UUID,=0A=20=20=20=
=20v_status=20INT,=0A=20=20=20=20v_vm_guid=20UUID,=0A=20=20=20=20=
v_vm_host=20VARCHAR(255),=0A=20=20=20=20v_vm_ip=20VARCHAR(255),=0A=20=20=20=
=20v_vm_fqdn=20VARCHAR(255),=0A=20=20=20=20v_last_start_time=20TIMESTAMP=20=
WITH=20TIME=20ZONE,=0A=20=20=20=20v_last_stop_time=20TIMESTAMP=20WITH=20=
TIME=20ZONE,=0A=20=20=20=20v_vm_pid=20INT,=0A=20=20=20=20v_acpi_enable=20=
BOOLEAN,=0A=20=20=20=20v_session=20INT,=0A=20=20=20=20v_kvm_enable=20=
BOOLEAN,=0A=20=20=20=20v_boot_sequence=20INT,=0A=20=20=20=20v_utc_diff=20=
INT,=0A=20=20=20=20v_last_vds_run_on=20UUID,=0A=20=20=20=20v_client_ip=20=
VARCHAR(255),=0A=20=20=20=20v_guest_requested_memory=20INT,=0A=20=20=20=20=
v_exit_status=20INT,=0A=20=20=20=20v_pause_status=20INT,=0A=20=20=20=20=
v_exit_message=20VARCHAR(4000),=0A=20=20=20=20v_guest_agent_nics_hash=20=
INT,=0A=20=20=20=20v_last_watchdog_event=20NUMERIC,=0A=20=20=20=20=
v_last_watchdog_action=20VARCHAR(8),=0A=20=20=20=20v_is_run_once=20=
BOOLEAN,=0A=20=20=20=20v_cpu_name=20VARCHAR(255),=0A=20=20=20=20=
v_emulated_machine=20VARCHAR(255),=0A=20=20=20=20v_current_cd=20=
VARCHAR(4000),=0A=20=20=20=20v_reason=20VARCHAR(4000),=0A=20=20=20=20=
v_exit_reason=20INT,=0A=20=20=20=20v_guest_cpu_count=20INT,=0A=20=20=20=20=
v_spice_port=20INT,=0A=20=20=20=20v_spice_tls_port=20INT,=0A=20=20=20=20=
v_spice_ip=20VARCHAR(32),=0A=20=20=20=20v_vnc_port=20INT,=0A=20=20=20=20=
v_vnc_ip=20VARCHAR(32),=0A=20=20=20=20v_guest_agent_status=20INT,=0A=20=20=
=20=20v_guest_mem_buffered=20BIGINT,=0A=20=20=20=20v_guest_mem_free=20=
BIGINT,=0A=20=20=20=20v_guest_mem_cached=20BIGINT,=0A=20=20=20=20=
v_guest_timezone_offset=20INT,=0A=20=20=20=20v_guest_timezone_name=20=
VARCHAR(255),=0A=20=20=20=20v_guestos_arch=20INT,=0A=20=20=20=20=
v_guestos_codename=20VARCHAR(255),=0A=20=20=20=20v_guestos_distribution=20=
VARCHAR(255),=0A=20=20=20=20v_guestos_kernel_version=20VARCHAR(255),=0A=20=
=20=20=20v_guestos_type=20VARCHAR(255),=0A=20=20=20=20v_guestos_version=20=
VARCHAR(255),=0A=20=20=20=20v_guest_containers=20TEXT=0A=20=20=20=20)=0A=
RETURNS=20VOID=0A=20=20=20=20=0A=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=20=
=20=20=20UPDATE=20vm_dynamic=0A=20=20=20=20SET=20app_list=20=3D=20=
v_app_list,=0A=20=20=20=20=20=20=20=20guest_cur_user_name=20=3D=20=
v_guest_cur_user_name,=0A=20=20=20=20=20=20=20=20console_cur_user_name=20=
=3D=20v_console_cur_user_name,=0A=20=20=20=20=20=20=20=20console_user_id=20=
=3D=20v_console_user_id,=0A=20=20=20=20=20=20=20=20guest_os=20=3D=20=
v_guest_os,=0A=20=20=20=20=20=20=20=20migrating_to_vds=20=3D=20=
v_migrating_to_vds,=0A=20=20=20=20=20=20=20=20run_on_vds=20=3D=20=
v_run_on_vds,=0A=20=20=20=20=20=20=20=20status=20=3D=20v_status,=0A=20=20=
=20=20=20=20=20=20vm_host=20=3D=20v_vm_host,=0A=20=20=20=20=20=20=20=20=
vm_ip=20=3D=20v_vm_ip,=0A=20=20=20=20=20=20=20=20vm_fqdn=20=3D=20=
v_vm_fqdn,=0A=20=20=20=20=20=20=20=20last_start_time=20=3D=20=
v_last_start_time,=0A=20=20=20=20=20=20=20=20last_stop_time=20=3D=20=
v_last_stop_time,=0A=20=20=20=20=20=20=20=20vm_pid=20=3D=20v_vm_pid,=0A=20=
=20=20=20=20=20=20=20acpi_enable=20=3D=20v_acpi_enable,=0A=20=20=20=20=20=
=20=20=20session=20=3D=20v_session,=0A=20=20=20=20=20=20=20=20kvm_enable=20=
=3D=20v_kvm_enable,=0A=20=20=20=20=20=20=20=20boot_sequence=20=3D=20=
v_boot_sequence,=0A=20=20=20=20=20=20=20=20utc_diff=20=3D=20v_utc_diff,=0A=
=20=20=20=20=20=20=20=20last_vds_run_on=20=3D=20v_last_vds_run_on,=0A=20=20=
=20=20=20=20=20=20client_ip=20=3D=20v_client_ip,=0A=20=20=20=20=20=20=20=20=
guest_requested_memory=20=3D=20v_guest_requested_memory,=0A=20=20=20=20=20=
=20=20=20exit_status=20=3D=20v_exit_status,=0A=20=20=20=20=20=20=20=20=
pause_status=20=3D=20v_pause_status,=0A=20=20=20=20=20=20=20=20=
exit_message=20=3D=20v_exit_message,=0A=20=20=20=20=20=20=20=20=
guest_agent_nics_hash=20=3D=20v_guest_agent_nics_hash,=0A=20=20=20=20=20=20=
=20=20last_watchdog_event=20=3D=20v_last_watchdog_event,=0A=20=20=20=20=20=
=20=20=20last_watchdog_action=20=3D=20v_last_watchdog_action,=0A=20=20=20=
=20=20=20=20=20is_run_once=20=3D=20v_is_run_once,=0A=20=20=20=20=20=20=20=
=20cpu_name=20=3D=20v_cpu_name,=0A=20=20=20=20=20=20=20=20=
emulated_machine=20=3D=20v_emulated_machine,=0A=20=20=20=20=20=20=20=20=
current_cd=20=3D=20v_current_cd,=0A=20=20=20=20=20=20=20=20reason=20=3D=20=
v_reason,=0A=20=20=20=20=20=20=20=20exit_reason=20=3D=20v_exit_reason,=0A=
=20=20=20=20=20=20=20=20guest_cpu_count=20=3D=20v_guest_cpu_count,=0A=20=20=
=20=20=20=20=20=20spice_port=20=3D=20v_spice_port,=0A=20=20=20=20=20=20=20=
=20spice_tls_port=20=3D=20v_spice_tls_port,=0A=20=20=20=20=20=20=20=20=
spice_ip=20=3D=20v_spice_ip,=0A=20=20=20=20=20=20=20=20vnc_port=20=3D=20=
v_vnc_port,=0A=20=20=20=20=20=20=20=20vnc_ip=20=3D=20v_vnc_ip,=0A=20=20=20=
=20=20=20=20=20guest_agent_status=20=3D=20v_guest_agent_status,=0A=20=20=20=
=20=20=20=20=20guest_mem_buffered=20=3D=20v_guest_mem_buffered,=0A=20=20=20=
=20=20=20=20=20guest_mem_free=20=3D=20v_guest_mem_free,=0A=20=20=20=20=20=
=20=20=20guest_mem_cached=20=3D=20v_guest_mem_cached,=0A=20=20=20=20=20=20=
=20=20guest_timezone_offset=20=3D=20v_guest_timezone_offset,=0A=20=20=20=20=
=20=20=20=20guest_timezone_name=20=3D=20v_guest_timezone_name,=0A=20=20=20=
=20=20=20=20=20guestos_arch=20=3D=20v_guestos_arch,=0A=20=20=20=20=20=20=20=
=20guestos_codename=20=3D=20v_guestos_codename,=0A=20=20=20=20=20=20=20=20=
guestos_distribution=20=3D=20v_guestos_distribution,=0A=20=20=20=20=20=20=
=20=20guestos_kernel_version=20=3D=20v_guestos_kernel_version,=0A=20=20=20=
=20=20=20=20=20guestos_type=20=3D=20v_guestos_type,=0A=20=20=20=20=20=20=20=
=20guestos_version=20=3D=20v_guestos_version,=0A=20=20=20=20=20=20=20=20=
guest_containers=20=3D=20v_guest_containers=0A=20=20=20=20WHERE=20=
vm_guid=20=3D=20v_vm_guid;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateConsoleUserWithOptimisticLocking=20(=0A=20=20=20=20v_vm_guid=20=
UUID,=0A=20=20=20=20v_console_user_id=20UUID,=0A=20=20=20=20=
v_guest_cur_user_name=20VARCHAR(255),=0A=20=20=20=20=
v_console_cur_user_name=20VARCHAR(255),=0A=20=20=20=20OUT=20v_updated=20=
BOOLEAN=0A=20=20=20=20)=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
vm_dynamic=0A=20=20=20=20SET=20console_user_id=20=3D=20=
v_console_user_id,=0A=20=20=20=20=20=20=20=20guest_cur_user_name=20=3D=20=
v_guest_cur_user_name,=0A=20=20=20=20=20=20=20=20console_cur_user_name=20=
=3D=20v_console_cur_user_name=0A=20=20=20=20WHERE=20vm_guid=20=3D=20=
v_vm_guid=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20console_user_id=20=3D=20v_console_user_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20OR=20console_user_id=20IS=20NULL=0A=20=20=20=20=20=20=20=20=
=20=20=20=20);=0A=0A=20=20=20=20v_updated=20:=3D=20FOUND;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateVmDynamicStatus=20(=0A=20=20=20=20v_vm_guid=20=
UUID,=0A=20=20=20=20v_status=20INT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vm_dynamic=0A=20=20=20=20SET=20=
status=20=3D=20v_status=0A=20=20=20=20WHERE=20vm_guid=20=3D=20v_vm_guid;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20ClearMigratingToVds=20(v_vm_guid=20UUID)=0ARETURNS=20=
VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vm_dynamic=0A=20=20=
=20=20SET=20migrating_to_vds=20=3D=20NULL=0A=20=20=20=20WHERE=20vm_guid=20=
=3D=20v_vm_guid;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20DeleteVmDynamic=20=
(v_vm_guid=20UUID)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=
=20DELETE=0A=20=20=20=20FROM=20vm_dynamic=0A=20=20=20=20WHERE=20vm_guid=20=
=3D=20v_vm_guid;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetAllFromVmDynamic=20()=0A=
RETURNS=20SETOF=20vm_dynamic=20STABLE=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vm_dynamic.*=0A=20=20=20=20=
FROM=20vm_dynamic;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVmDynamicByVmGuid=20=
(v_vm_guid=20UUID)=0ARETURNS=20SETOF=20vm_dynamic=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
vm_dynamic.*=0A=20=20=20=20FROM=20vm_dynamic=0A=20=20=20=20WHERE=20=
vm_guid=20=3D=20v_vm_guid;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20TYPE=20IF=20EXISTS=20GetAllHashesFromVmDynamic_rs=20=
CASCADE;=0A**************************=0A=0ADROP=20TYPE=0A*********=20=
QUERY=20**********=0ACREATE=20TYPE=20GetAllHashesFromVmDynamic_rs=20AS=20=
(vm_guid=20UUID,=20hash=20VARCHAR);=0A**************************=0A=0A=
CREATE=20TYPE=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
FUNCTION=20GetAllHashesFromVmDynamic=20()=0ARETURNS=20SETOF=20=
GetAllHashesFromVmDynamic_rs=20STABLE=0AAS=20$procedure$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20vm_guid,=20hash=0A=20=20=20=
=20FROM=20vm_dynamic;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20SetHashByVmGuid=20=
(v_vm_guid=20UUID,=20v_hash=20VARCHAR(30))=0ARETURNS=20VOID=0AAS=20=
$procedure$=0ABEGIN=0A=20=20=20=20UPDATE=20vm_dynamic=0A=20=20=20=20SET=20=
hash=20=3D=20v_hash=0A=20=20=20=20WHERE=20vm_guid=20=3D=20v_vm_guid;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20InsertVmStatic=20(=0A=20=20=20=20v_description=20=
VARCHAR(4000),=0A=20=20=20=20v_free_text_comment=20TEXT,=0A=20=20=20=20=
v_mem_size_mb=20INT,=0A=20=20=20=20v_num_of_io_threads=20INT,=0A=20=20=20=
=20v_os=20INT,=0A=20=20=20=20v_cluster_id=20UUID,=0A=20=20=20=20=
v_vm_guid=20UUID,=0A=20=20=20=20v_vm_name=20VARCHAR(255),=0A=20=20=20=20=
v_vmt_guid=20UUID,=0A=20=20=20=20v_creation_date=20TIMESTAMP=20WITH=20=
TIME=20ZONE,=0A=20=20=20=20v_num_of_monitors=20INT,=0A=20=20=20=20=
v_single_qxl_pci=20BOOLEAN,=0A=20=20=20=20v_allow_console_reconnect=20=
BOOLEAN,=0A=20=20=20=20v_is_initialized=20BOOLEAN,=0A=20=20=20=20=
v_num_of_sockets=20INT,=0A=20=20=20=20v_cpu_per_socket=20INT,=0A=20=20=20=
=20v_threads_per_cpu=20INT,=0A=20=20=20=20v_usb_policy=20INT,=0A=20=20=20=
=20v_time_zone=20VARCHAR(40),=0A=20=20=20=20v_auto_startup=20BOOLEAN,=0A=20=
=20=20=20v_is_stateless=20BOOLEAN,=0A=20=20=20=20v_is_smartcard_enabled=20=
BOOLEAN,=0A=20=20=20=20v_is_delete_protected=20BOOLEAN,=0A=20=20=20=20=
v_sso_method=20VARCHAR(32),=0A=20=20=20=20v_dedicated_vm_for_vds=20TEXT,=0A=
=20=20=20=20v_fail_back=20BOOLEAN,=0A=20=20=20=20v_vm_type=20INT,=0A=20=20=
=20=20v_nice_level=20INT,=0A=20=20=20=20v_cpu_shares=20INT,=0A=20=20=20=20=
v_default_boot_sequence=20INT,=0A=20=20=20=20v_default_display_type=20=
INT,=0A=20=20=20=20v_priority=20INT,=0A=20=20=20=20v_iso_path=20=
VARCHAR(4000),=0A=20=20=20=20v_origin=20INT,=0A=20=20=20=20v_initrd_url=20=
VARCHAR(4000),=0A=20=20=20=20v_kernel_url=20VARCHAR(4000),=0A=20=20=20=20=
v_kernel_params=20VARCHAR(4000),=0A=20=20=20=20v_migration_support=20=
INT,=0A=20=20=20=20v_predefined_properties=20VARCHAR(4000),=0A=20=20=20=20=
v_userdefined_properties=20VARCHAR(4000),=0A=20=20=20=20=
v_min_allocated_mem=20INT,=0A=20=20=20=20v_quota_id=20UUID,=0A=20=20=20=20=
v_cpu_pinning=20VARCHAR(4000),=0A=20=20=20=20v_host_cpu_flags=20BOOLEAN,=0A=
=20=20=20=20v_tunnel_migration=20BOOLEAN,=0A=20=20=20=20=
v_vnc_keyboard_layout=20VARCHAR(16),=0A=20=20=20=20v_is_run_and_pause=20=
BOOLEAN,=0A=20=20=20=20v_created_by_user_id=20UUID,=0A=20=20=20=20=
v_instance_type_id=20UUID,=0A=20=20=20=20v_image_type_id=20UUID,=0A=20=20=
=20=20v_original_template_id=20UUID,=0A=20=20=20=20=
v_original_template_name=20VARCHAR(255),=0A=20=20=20=20=
v_migration_downtime=20INT,=0A=20=20=20=20v_template_version_number=20=
INT,=0A=20=20=20=20v_serial_number_policy=20SMALLINT,=0A=20=20=20=20=
v_custom_serial_number=20VARCHAR(255),=0A=20=20=20=20=
v_is_boot_menu_enabled=20BOOLEAN,=0A=20=20=20=20v_numatune_mode=20=
VARCHAR(20),=0A=20=20=20=20v_is_spice_file_transfer_enabled=20BOOLEAN,=0A=
=20=20=20=20v_is_spice_copy_paste_enabled=20BOOLEAN,=0A=20=20=20=20=
v_cpu_profile_id=20UUID,=0A=20=20=20=20v_is_auto_converge=20BOOLEAN,=0A=20=
=20=20=20v_is_migrate_compressed=20BOOLEAN,=0A=20=20=20=20=
v_custom_emulated_machine=20VARCHAR(40),=0A=20=20=20=20v_custom_cpu_name=20=
VARCHAR(40),=0A=20=20=20=20v_small_icon_id=20UUID,=0A=20=20=20=20=
v_large_icon_id=20UUID,=0A=20=20=20=20v_console_disconnect_action=20=
VARCHAR(64),=0A=20=20=20=20v_custom_compatibility_version=20VARCHAR(40),=0A=
=20=20=20=20v_migration_policy_id=20UUID)=0A=20=20RETURNS=20VOID=0A=20=20=
=20AS=20$procedure$=0ADECLARE=0A=20=20v_val=20UUID;=0ABEGIN=0A--=20lock=20=
template=20for=20child=20count=20update=0Aselect=20vm_guid=20into=20=
v_val=20FROM=20vm_static=20WHERE=20vm_guid=20=3D=20v_vmt_guid=20for=20=
update;=0A=0AINSERT=20INTO=20vm_static(description,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20free_text_comment,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20mem_size_mb,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
num_of_io_threads,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20os,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20cluster_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20vm_guid,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20vm_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20vmt_guid,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20creation_date,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20num_of_monitors,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20single_qxl_pci,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
allow_console_reconnect,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20is_initialized,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20num_of_sockets,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20cpu_per_socket,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20threads_per_cpu,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20usb_policy,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
time_zone,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20auto_startup,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20is_stateless,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20dedicated_vm_for_vds,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20fail_back,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20default_boot_sequence,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20vm_type,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
nice_level,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20cpu_shares,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20default_display_type,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20priority,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20iso_path,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20origin,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20initrd_url,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20kernel_url,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20kernel_params,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
migration_support,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20predefined_properties,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20userdefined_properties,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20min_allocated_mem,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20entity_type,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
quota_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20cpu_pinning,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20is_smartcard_enabled,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20is_delete_protected,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20sso_method,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20host_cpu_flags,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20tunnel_migration,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
vnc_keyboard_layout,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20is_run_and_pause,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20created_by_user_id,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20instance_type_id,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20image_type_id,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
original_template_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20original_template_name,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20migration_downtime,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20template_version_number,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
serial_number_policy,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20custom_serial_number,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20is_boot_menu_enabled,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20numatune_mode,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
is_spice_file_transfer_enabled,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20is_spice_copy_paste_enabled,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20cpu_profile_id,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
is_auto_converge,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20is_migrate_compressed,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20custom_emulated_machine,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20custom_cpu_name,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
small_icon_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20large_icon_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20console_disconnect_action,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20custom_compatibility_version,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
migration_policy_id)=0A=20=20=20=20VALUES(v_description,=0A=20=20=20=20=20=
=20=20=20=20=20=20v_free_text_comment,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_mem_size_mb,=0A=20=20=20=20=20=20=20=20=20=20=20v_num_of_io_threads,=0A=
=20=20=20=20=20=20=20=20=20=20=20v_os,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_cluster_id,=0A=20=20=20=20=20=20=20=20=20=20=20v_vm_guid,=0A=20=20=20=20=
=20=20=20=20=20=20=20v_vm_name,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_vmt_guid,=0A=20=20=20=20=20=20=20=20=20=20=20v_creation_date,=0A=20=20=20=
=20=20=20=20=20=20=20=20v_num_of_monitors,=0A=20=20=20=20=20=20=20=20=20=20=
=20v_single_qxl_pci,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_allow_console_reconnect,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_is_initialized,=0A=20=20=20=20=20=20=20=20=20=20=20v_num_of_sockets,=0A=
=20=20=20=20=20=20=20=20=20=20=20v_cpu_per_socket,=0A=20=20=20=20=20=20=20=
=20=20=20=20v_threads_per_cpu,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_usb_policy,=0A=20=20=20=20=20=20=20=20=20=20=20v_time_zone,=0A=20=20=20=
=20=20=20=20=20=20=20=20v_auto_startup,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_is_stateless,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_dedicated_vm_for_vds,=0A=20=20=20=20=20=20=20=20=20=20=20v_fail_back,=0A=
=20=20=20=20=20=20=20=20=20=20=20v_default_boot_sequence,=0A=20=20=20=20=20=
=20=20=20=20=20=20v_vm_type,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_nice_level,=0A=20=20=20=20=20=20=20=20=20=20=20v_cpu_shares,=0A=20=20=20=
=20=20=20=20=20=20=20=20v_default_display_type,=0A=20=20=20=20=20=20=20=20=
=20=20=20v_priority,=0A=20=20=20=20=20=20=20=20=20=20=20v_iso_path,=0A=20=
=20=20=20=20=20=20=20=20=20=20v_origin,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_initrd_url,=0A=20=20=20=20=20=20=20=20=20=20=20v_kernel_url,=0A=20=20=20=
=20=20=20=20=20=20=20=20v_kernel_params,=0A=20=20=20=20=20=20=20=20=20=20=
=20v_migration_support,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_predefined_properties,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_userdefined_properties,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_min_allocated_mem,=0A=20=20=20=20=20=20=20=20=20=20=20'VM',=0A=20=20=20=
=20=20=20=20=20=20=20=20v_quota_id,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_cpu_pinning,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_is_smartcard_enabled,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_is_delete_protected,=0A=20=20=20=20=20=20=20=20=20=20=20v_sso_method,=0A=
=20=20=20=20=20=20=20=20=20=20=20v_host_cpu_flags,=0A=20=20=20=20=20=20=20=
=20=20=20=20v_tunnel_migration,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_vnc_keyboard_layout,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_is_run_and_pause,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_created_by_user_id,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_instance_type_id,=0A=20=20=20=20=20=20=20=20=20=20=20v_image_type_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20v_original_template_id,=0A=20=20=20=20=20=
=20=20=20=20=20=20v_original_template_name,=0A=20=20=20=20=20=20=20=20=20=
=20=20v_migration_downtime,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_template_version_number,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_serial_number_policy,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_custom_serial_number,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_is_boot_menu_enabled,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_numatune_mode,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_is_spice_file_transfer_enabled,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_is_spice_copy_paste_enabled,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_cpu_profile_id,=0A=20=20=20=20=20=20=20=20=20=20=20v_is_auto_converge,=0A=
=20=20=20=20=20=20=20=20=20=20=20v_is_migrate_compressed,=0A=20=20=20=20=20=
=20=20=20=20=20=20v_custom_emulated_machine,=0A=20=20=20=20=20=20=20=20=20=
=20=20v_custom_cpu_name,=0A=20=20=20=20=20=20=20=20=20=20=20=
v_small_icon_id,=0A=20=20=20=20=20=20=20=20=20=20=20v_large_icon_id,=0A=20=
=20=20=20=20=20=20=20=20=20=20v_console_disconnect_action,=0A=20=20=20=20=
=20=20=20=20=20=20=20v_custom_compatibility_version,=0A=20=20=20=20=20=20=
=20=20=20=20=20v_migration_policy_id);=0A=0A=20=20=20=20--=20perform=20=
deletion=20from=20vm_ovf_generations=20to=20ensure=20that=20no=20record=20=
exists=20when=20performing=20insert=20to=20avoid=20PK=20violation.=0A=20=20=
=20=20DELETE=0A=20=20=20=20FROM=20vm_ovf_generations=20gen=0A=20=20=20=20=
WHERE=20gen.vm_guid=20=3D=20v_vm_guid=0A=20=20=20=20=20=20=20=20AND=20=
v_origin=20!=3D=204;=0A=20=20=20=20INSERT=20INTO=20=
vm_ovf_generations(vm_guid,=20storage_pool_id)=0A=20=20=20=20=20=20=20=20=
SELECT=0A=20=20=20=20=20=20=20=20=20=20=20=20v_vm_guid,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20storage_pool_id=0A=20=20=20=20=20=20=20=20FROM=20=
cluster=20vg=0A=20=20=20=20=20=20=20=20WHERE=20vg.cluster_id=20=3D=20=
v_cluster_id=0A=20=20=20=20=20=20=20=20=20=20=20AND=20v_origin=20!=3D=20=
4;=0A=0A=20=20=20=20--=20add=20connections=20to=20dedicated=20hosts=0A=20=
=20=20=20PERFORM=20InsertDedicatedHostsToVm(=0A=20=20=20=20=20=20=20=20=
v_vm_guid,=0A=20=20=20=20=20=20=20=20v_dedicated_vm_for_vds);=0A=0A=20=20=
=20=20--=20set=20child_count=20for=20the=20template=0A=20=20=20=20UPDATE=20=
vm_static=0A=20=20=20=20SET=20child_count=20=3D=20child_count+1=0A=20=20=20=
=20WHERE=20vm_guid=20=3D=20v_vmt_guid;=0A=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
IncrementDbGeneration(v_vm_guid=20UUID)=0ARETURNS=20VOID=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20=20UPDATE=20vm_static=0A=20=20=20=20=
=20=20SET=20db_generation=20=20=3D=20db_generation=20+=201=0A=20=20=20=20=
=20=20WHERE=20vm_guid=20=3D=20v_vm_guid;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetDbGeneration(v_vm_guid=20UUID)=0ARETURNS=20SETOF=20BIGINT=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20=20=20RETURN=20QUERY=20=
SELECT=20db_generation=0A=20=20=20=20=20=20FROM=20vm_static=0A=20=20=20=20=
=20=20WHERE=20vm_guid=20=3D=20v_vm_guid;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
IncrementDbGenerationForAllInStoragePool(v_storage_pool_id=20UUID)=0A=
RETURNS=20VOID=0A=20=20=20AS=20$procedure$=0ADECLARE=0A=20=20=20=20=20=
curs=20CURSOR=20FOR=20SELECT=20vms.vm_guid=20FROM=20vm_static=20vms=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
vms.cluster_id=20IN=20(SELECT=20vgs.cluster_id=20FROM=20cluster=20vgs=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
vgs.storage_pool_id=3Dv_storage_pool_id)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20ORDER=20BY=20vm_guid;=0A=20=20=20=20=20=
id=20UUID;=0ABEGIN=0A=20=20=20=20=20=20OPEN=20curs;=0A=20=20=20=20=20=20=
LOOP=0A=20=20=20=20=20=20=20=20=20FETCH=20curs=20INTO=20id;=0A=20=20=20=20=
=20=20=20=20=20IF=20NOT=20FOUND=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=
=20EXIT;=0A=20=20=20=20=20=20=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20=
=20UPDATE=20vm_static=20SET=20db_generation=20=20=3D=20db_generation=20+=20=
1=20WHERE=20vm_guid=20=3D=20id;=0A=20=20=20=20=20=20END=20LOOP;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20=
GetVmsAndTemplatesIdsWithoutAttachedImageDisks(v_storage_pool_id=20UUID,=20=
v_shareable=20BOOLEAN)=0ARETURNS=20SETOF=20UUID=20STABLE=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20=20RETURN=20QUERY=20SELECT=20=
vs.vm_guid=0A=20=20=20=20=20=20FROM=20vm_static=20vs=0A=20=20=20=20=20=20=
WHERE=20vs.vm_guid=20NOT=20IN=20(SELECT=20DISTINCT=20vd.vm_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20vm_device=20vd=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20INNER=20JOIN=20=
base_disks=20i=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20ON=20i.disk_id=20=3D=20vd.device_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20AND=20vd.snapshot_id=20IS=20NULL=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20i.disk_storage_type=20in=20(0,=202)=20=20--=20Filter=20VMs=20=
with=20Images=20(0)=20or=20Cinder=20(2)=20disks.=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20i.shareable=20=3D=20v_shareable)=0A=20=20=20=20=20=20AND=20=
vs.cluster_id=20IN=20(SELECT=20vg.cluster_id=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
cluster=20vg,=20storage_pool=20sp=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
vg.storage_pool_id=20=3D=20v_storage_pool_id);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
UpdateVmStatic(v_description=20VARCHAR(4000)=20,=0A=20=
v_free_text_comment=20text,=0A=20v_mem_size_mb=20INTEGER,=0A=20=
v_num_of_io_threads=20INTEGER,=0A=20v_os=20INTEGER,=0A=20v_cluster_id=20=
UUID,=0A=20v_vm_guid=20UUID,=0A=20v_vm_name=20VARCHAR(255),=0A=20=
v_vmt_guid=20UUID,=0A=20v_creation_date=20TIMESTAMP=20WITH=20TIME=20=
ZONE,=0A=20v_num_of_monitors=20INTEGER,=0A=20v_single_qxl_pci=20BOOLEAN,=0A=
=20v_allow_console_reconnect=20BOOLEAN,=0A=20v_is_initialized=20BOOLEAN,=0A=
=20=20=20=20v_num_of_sockets=20INTEGER,=0A=20=20=20=20v_cpu_per_socket=20=
INTEGER,=0A=20=20=20=20v_threads_per_cpu=20INTEGER,=0A=20v_usb_policy=20=20=
INTEGER,=0A=20v_time_zone=20VARCHAR(40)=20,=0A=20v_auto_startup=20=
BOOLEAN,=0A=20v_is_stateless=20BOOLEAN,=0A=20v_is_smartcard_enabled=20=
BOOLEAN,=0A=20v_is_delete_protected=20BOOLEAN,=0A=20v_sso_method=20=
VARCHAR(32),=0A=20v_dedicated_vm_for_vds=20text=20,=0A=20=20=20=20=
v_fail_back=20BOOLEAN=20,=0A=20=20=20=20v_vm_type=20INTEGER=20,=0A=20=20=20=
=20v_nice_level=20INTEGER,=0A=20=20=20=20v_cpu_shares=20INTEGER,=0A=20=20=
=20=20v_default_boot_sequence=20INTEGER,=0A=20v_default_display_type=20=
INTEGER,=0A=20v_priority=20INTEGER,=0A=20=20=20=20v_iso_path=20=
VARCHAR(4000)=20,=0A=20=20=20=20v_origin=20INTEGER=20,=0A=20=20=20=20=
v_initrd_url=20=20=20=20VARCHAR(4000)=20,=0A=20=20=20=20v_kernel_url=20=20=
=20=20VARCHAR(4000)=20,=0A=20=20=20=20v_kernel_params=20VARCHAR(4000)=20=
,=0A=20=20=20=20v_migration_support=20INTEGER=20,=0A=
v_predefined_properties=20VARCHAR(4000),=0Av_userdefined_properties=20=
VARCHAR(4000),=0Av_min_allocated_mem=20INTEGER,=0Av_quota_id=20UUID,=0A=
v_cpu_pinning=20VARCHAR(4000),=0Av_host_cpu_flags=20BOOLEAN,=0A=
v_tunnel_migration=20BOOLEAN,=0Av_vnc_keyboard_layout=09VARCHAR(16),=0A=
v_is_run_and_pause=20BOOLEAN,=0Av_created_by_user_id=20UUID,=0A=
v_instance_type_id=20UUID,=0Av_image_type_id=20UUID,=0A=
v_original_template_id=20UUID,=0Av_original_template_name=20=
VARCHAR(255),=0Av_migration_downtime=20INTEGER,=0A=
v_template_version_number=20INTEGER,=0Av_serial_number_policy=20=
SMALLINT,=0Av_custom_serial_number=20VARCHAR(255),=0A=
v_is_boot_menu_enabled=20BOOLEAN,=0Av_numatune_mode=20VARCHAR(20),=0A=
v_is_spice_file_transfer_enabled=20BOOLEAN,=0A=
v_is_spice_copy_paste_enabled=20BOOLEAN,=0Av_cpu_profile_id=20UUID,=0A=
v_is_auto_converge=20BOOLEAN,=0Av_is_migrate_compressed=20BOOLEAN,=0A=
v_custom_emulated_machine=20VARCHAR(40),=0Av_custom_cpu_name=20=
VARCHAR(40),=0Av_small_icon_id=20UUID,=0Av_large_icon_id=20UUID,=0A=
v_provider_id=20UUID,=0Av_console_disconnect_action=20VARCHAR(64),=0A=
v_custom_compatibility_version=20VARCHAR(40),=0Av_migration_policy_id=20=
UUID)=0ARETURNS=20VOID=0A=09=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=
=20=20=20UPDATE=20vm_static=0A=20=20=20=20=20SET=0A=20=20=20=20=20=
description=20=3D=20v_description,=0A=20=20=20=20=20free_text_comment=20=
=3D=20v_free_text_comment=20,=0A=20=20=20=20=20mem_size_mb=20=3D=20=
v_mem_size_mb,=0A=20=20=20=20=20num_of_io_threads=20=3D=20=
v_num_of_io_threads,=0A=20=20=20=20=20os=20=3D=20v_os,=0A=20=20=20=20=20=
cluster_id=20=3D=20v_cluster_id,=0A=20=20=20=20=20vm_name=20=3D=20=
v_vm_name,=0A=20=20=20=20=20vmt_guid=20=3D=20v_vmt_guid,=0A=20=20=20=20=20=
creation_date=20=3D=20v_creation_date,=0A=20=20=20=20=20num_of_monitors=20=
=3D=20v_num_of_monitors,=0A=20=20=20=20=20single_qxl_pci=20=3D=20=
v_single_qxl_pci,=0A=20=20=20=20=20allow_console_reconnect=20=3D=20=
v_allow_console_reconnect,=0A=20=20=20=20=20is_initialized=20=3D=20=
v_is_initialized,=0A=20=20=20=20=20num_of_sockets=20=3D=20=
v_num_of_sockets,=0A=20=20=20=20=20cpu_per_socket=20=3D=20=
v_cpu_per_socket,=0A=20=20=20=20=20threads_per_cpu=20=3D=20=
v_threads_per_cpu,=0A=20=20=20=20=20usb_policy=20=3D=20v_usb_policy,=0A=20=
=20=20=20=20time_zone=20=3D=20v_time_zone,=0A=20=20=20=20=20auto_startup=20=
=3D=20v_auto_startup,=0A=20=20=20=20=20is_stateless=20=3D=20=
v_is_stateless,=0A=20=20=20=20=20dedicated_vm_for_vds=20=3D=20=
v_dedicated_vm_for_vds,=0A=20=20=20=20=20fail_back=20=3D=20v_fail_back,=0A=
=20=20=20=20=20vm_type=20=3D=20v_vm_type,=0A=20=20=20=20=20nice_level=20=
=3D=20v_nice_level,=0A=20=20=20=20=20cpu_shares=20=3D=20v_cpu_shares,=0A=20=
=20=20=20=20_update_date=20=3D=20LOCALTIMESTAMP,=0A=20=20=20=20=20=
default_boot_sequence=20=3D=20v_default_boot_sequence,=0A=20=20=20=20=20=
default_display_type=20=3D=20v_default_display_type,=0A=20=20=20=20=20=
priority=20=3D=20v_priority,=0A=20=20=20=20=20iso_path=20=3D=20=
v_iso_path,origin=20=3D=20v_origin,=0A=20=20=20=20=20initrd_url=20=3D=20=
v_initrd_url,=0A=20=20=20=20=20kernel_url=20=3D=20v_kernel_url,=0A=20=20=20=
=20=20kernel_params=20=3D=20v_kernel_params,=0A=20=20=20=20=20=
migration_support=20=3D=20v_migration_support,=0A=20=20=20=20=20=
predefined_properties=20=3D=20v_predefined_properties,=0A=20=20=20=20=20=
userdefined_properties=20=3D=20v_userdefined_properties,=0A=20=20=20=20=20=
min_allocated_mem=20=3D=20v_min_allocated_mem,=0A=20=20=20=20=20quota_id=20=
=3D=20v_quota_id,=0A=20=20=20=20=20cpu_pinning=20=3D=20v_cpu_pinning,=0A=20=
=20=20=20=20is_smartcard_enabled=20=3D=20v_is_smartcard_enabled,=0A=20=20=
=20=20=20is_delete_protected=20=3D=20v_is_delete_protected,=0A=20=20=20=20=
=20sso_method=20=3D=20v_sso_method,=0A=20=20=20=20=20host_cpu_flags=20=3D=20=
v_host_cpu_flags,=0A=20=20=20=20=20tunnel_migration=20=3D=20=
v_tunnel_migration,=0A=20=20=20=20=20vnc_keyboard_layout=20=3D=20=
v_vnc_keyboard_layout,=0A=20=20=20=20=20is_run_and_pause=20=3D=20=
v_is_run_and_pause,=0A=20=20=20=20=20created_by_user_id=20=3D=20=
v_created_by_user_id,=0A=20=20=20=20=20instance_type_id=20=3D=20=
v_instance_type_id,=0A=20=20=20=20=20image_type_id=20=3D=20=
v_image_type_id,=0A=20=20=20=20=20original_template_id=20=3D=20=
v_original_template_id,=0A=20=20=20=20=20original_template_name=20=3D=20=
v_original_template_name,=0A=20=20=20=20=20migration_downtime=20=3D=20=
v_migration_downtime,=0A=20=20=20=20=20template_version_number=20=3D=20=
v_template_version_number,=0A=20=20=20=20=20serial_number_policy=20=3D=20=
v_serial_number_policy,=0A=20=20=20=20=20custom_serial_number=20=3D=20=
v_custom_serial_number,=0A=20=20=20=20=20is_boot_menu_enabled=20=3D=20=
v_is_boot_menu_enabled,=0A=20=20=20=20=20numatune_mode=20=3D=20=
v_numatune_mode,=0A=20=20=20=20=20is_spice_file_transfer_enabled=20=3D=20=
v_is_spice_file_transfer_enabled,=0A=20=20=20=20=20=
is_spice_copy_paste_enabled=20=3D=20v_is_spice_copy_paste_enabled,=0A=20=20=
=20=20=20cpu_profile_id=20=3D=20v_cpu_profile_id,=0A=20=20=20=20=20=
is_auto_converge=20=3D=20v_is_auto_converge,=0A=20=20=20=20=20=
is_migrate_compressed=20=3D=20v_is_migrate_compressed,=0A=20=20=20=20=20=
custom_emulated_machine=20=3D=20v_custom_emulated_machine,=0A=20=20=20=20=
=20custom_cpu_name=20=3D=20v_custom_cpu_name,=0A=20=20=20=20=20=
small_icon_id=20=3D=20v_small_icon_id,=0A=20=20=20=20=20large_icon_id=20=
=3D=20v_large_icon_id,=0A=20=20=20=20=20provider_id=20=3D=20=
v_provider_id,=0A=20=20=20=20=20console_disconnect_action=20=3D=20=
v_console_disconnect_action,=0A=20=20=20=20=20=
custom_compatibility_version=3Dv_custom_compatibility_version,=0A=20=20=20=
=20=20migration_policy_id=20=3D=20v_migration_policy_id=0A=20=20=20=20=20=
WHERE=20vm_guid=20=3D=20v_vm_guid=0A=20=20=20=20=20=20=20=20=20AND=20=
entity_type=20=3D=20'VM';=0A=0A=20=20=20=20=20=20--=20Update=20=
connections=20to=20dedicated=20hosts=0A=20=20=20=20=20=20PERFORM=20=
UpdateDedicatedHostsToVm(=0A=20=20=20=20=20=20=20=20=20=20v_vm_guid,=0A=20=
=20=20=20=20=20=20=20=20=20v_dedicated_vm_for_vds);=0A=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20DeleteVmStatic(v_vm_guid=20UUID,=20=
v_remove_permissions=20boolean)=0ARETURNS=20VOID=0A=20=20=20AS=20=
$procedure$=0A=20=20=20DECLARE=0A=20=20=20v_val=20=20UUID;=0A=20=20=20=
v_vmt_guid=20=20UUID;=0ABEGIN=0A=20=20=20=20=20=20--=20store=20vmt_guid=20=
for=20setting=20the=20child_count=0A=20=20=20=20=20=20SELECT=20=20=20=
vm_static.vmt_guid=20INTO=20v_vmt_guid=20FROM=20vm_static=20WHERE=20=
vm_guid=20=3D=20v_vm_guid;=0A=0A=09=09=09--=20Get=20(and=20keep)=20a=20=
shared=20lock=20with=20"right=20to=20upgrade=20to=20exclusive"=0A=20=20=20=
=20=20=20=20=20=20=20=20=20--=20in=20order=20to=20force=20locking=20=
parent=20before=20children=0A=20=20=20=20=20=20select=20=20=20vm_guid=20=
INTO=20v_val=20FROM=20vm_static=20=20WHERE=20vm_guid=20=3D=20v_vm_guid=20=
=20=20=20=20FOR=20UPDATE;=0A=20=20=20=20=20=20DELETE=20FROM=20vm_static=0A=
=20=20=20=20=20=20WHERE=20vm_guid=20=3D=20v_vm_guid=0A=20=20=20=20=20=20=
AND=20=20=20entity_type=20=3D=20'VM';=0A=0A=09=09=09--=20delete=20VM=20=
permissions=20--=0A=20=20=20=20=20=20if=20v_remove_permissions=20then=0A=20=
=20=20=20=20=20=20=20DELETE=20FROM=20permissions=20where=20object_id=20=3D=
=20v_vm_guid;=0A=20=20=20=20=20=20end=20if;=0A=0A=20=20=20=20=20=20--=20=
set=20the=20child_count=20for=20the=20template=0A=20=20=20=20=20=20=
UPDATE=20vm_static=0A=20=20=20=20=20=20=20=20=20=20SET=20child_count=20=3D=
=20child_count=20-=201=20WHERE=20vm_guid=20=3D=20v_vmt_guid;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetAllFromVmStatic()=20RETURNS=20SETOF=20vm_static=20=
STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20SELECT=20=
vm_static.*=0A=20=20=20FROM=20vm_static=0A=20=20=20WHERE=20entity_type=20=
=3D=20'VM';=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20GetVmStaticWithoutIcon()=20=
RETURNS=20SETOF=20vm_static=20STABLE=0AAS=20$procedure$=0ABEGIN=0ARETURN=20=
QUERY=20SELECT=20vm_static.*=0A=20=20=20FROM=20vm_static=0A=20=20=20=
WHERE=20entity_type=20=3D=20'VM'=0A=20=20=20=20=20=20AND=20=
(small_icon_id=20IS=20NULL=20OR=20large_icon_id=20IS=20NULL);=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20UpdateOriginalTemplateName(=0A=
v_original_template_id=20UUID,=0Av_original_template_name=20=
VARCHAR(255))=0ARETURNS=20VOID=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=
=20=20=20=20UPDATE=20vm_static=0A=20=20=20=20=20=20SET=20=
original_template_name=20=3D=20v_original_template_name=0A=20=20=20=20=20=
=20WHERE=20original_template_id=20=3D=20v_original_template_id;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetVmStaticByVmGuid(v_vm_guid=20UUID)=20RETURNS=20=
SETOF=20vm_static=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20=
QUERY=20SELECT=20vm_static.*=0A=20=20=20FROM=20vm_static=0A=20=20=20=
WHERE=20vm_guid=20=3D=20v_vm_guid=0A=20=20=20=20=20=20=20AND=20=20=20=
entity_type=20=3D=20'VM';=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20TYPE=20IF=20EXISTS=20=
GetNamesOfVmStaticDedicatedToVds_rs=20CASCADE;=0A=
**************************=0A=0ADROP=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20TYPE=20GetNamesOfVmStaticDedicatedToVds_rs=20AS=20=
(vm_name=20CHARACTER=20VARYING);=0A**************************=0A=0A=
CREATE=20TYPE=0A*********=20QUERY=20**********=0ACreate=20or=20replace=20=
FUNCTION=20GetNamesOfVmStaticDedicatedToVds(v_vds_id=20UUID)=20RETURNS=20=
SETOF=20GetNamesOfVmStaticDedicatedToVds_rs=20STABLE=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20RETURN=20QUERY=0A=20=20=20=20=20=20SELECT=20=
vm_name=0A=20=20=20=20=20=20FROM=20vm_static=0A=20=20=20=20=20=20WHERE=20=
dedicated_vm_for_vds=20LIKE=20'%'||v_vds_id::text||'%'=0A=20=20=20=20=20=20=
=20=20=20=20AND=20=20=20migration_support=20=3D=202=0A=20=20=20=20=20=20=20=
=20=20=20AND=20=20=20entity_type=20=3D=20'VM';=0A=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetAllFromVmStaticByStoragePoolId(v_sp_id=20uuid)=20RETURNS=20SETOF=20=
vm_static=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20=
SELECT=20vm_static.*=0A=20=20=20FROM=20vm_static=20INNER=20JOIN=0A=20=20=20=
=20=20=20=20=20cluster=20ON=20vm_static.cluster_id=20=3D=20=
cluster.cluster_id=20LEFT=20OUTER=20JOIN=0A=20=20=20=20=20=20=20=20=
storage_pool=20ON=20vm_static.cluster_id=20=3D=20cluster.cluster_id=0A=20=
=20=20=20=20=20=20=20AND=20cluster.storage_pool_id=20=3D=20=
storage_pool.id=0A=20=20=20WHERE=20v_sp_id=20=3D=20storage_pool.id=0A=20=20=
=20=20=20=20=20AND=20=20=20entity_type=20=3D=20'VM';=0A=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetVmStaticByName(v_vm_name=20VARCHAR(255))=20=
RETURNS=20SETOF=20vm_static=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=
RETURN=20QUERY=20SELECT=20vm_static.*=0A=20=20=20FROM=20vm_static=0A=20=20=
=20WHERE=20vm_name=20=3D=20v_vm_name=0A=20=20=20=20=20=20=20AND=20=20=20=
entity_type=20=3D=20'VM';=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmStaticByCluster(v_cluster_id=20UUID)=20RETURNS=20SETOF=20vm_static=20=
STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20SELECT=20=
vm_static.*=0A=20=20=20FROM=20vm_static=0A=20=20=20WHERE=20cluster_id=20=
=3D=20v_cluster_id=0A=20=20=20=20=20=20=20AND=20=20=20entity_type=20=3D=20=
'VM';=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmStaticWithFailbackByVdsId(v_vds_id=20UUID)=20RETURNS=20SETOF=20=
vm_static=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20=
SELECT=20vm_static.*=0A=20=20=20FROM=20vm_static=0A=20=20=20WHERE=20=
dedicated_vm_for_vds=20LIKE=20'%'||v_vds_id::text||'%'=0A=20=20=20=20=20=20=
=20AND=20fail_back=20=3D=20TRUE=0A=20=20=20=20=20=20=20AND=20=20=20=
entity_type=20=3D=20'VM';=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20GetAllFromVms(v_user_id=20=
UUID,=20v_is_filtered=20boolean)=20RETURNS=20SETOF=20vms=20STABLE=0A=20=20=
=20AS=20$procedure$=0ABEGIN=0AIF=20v_is_filtered=20THEN=0A=20=20=20=
RETURN=20QUERY=20SELECT=20vms.*=0A=20=20=20=20=20=20FROM=20vms=20INNER=20=
JOIN=20user_vm_permissions_view=20ON=20vms.vm_guid=20=3D=20=
user_vm_permissions_view.entity_id=0A=20=20=20=20=20=20WHERE=20user_id=20=
=3D=20v_user_id=0A=20=20=20=20=20=20ORDER=20BY=20vm_guid;=0AELSE=0A=20=20=
=20RETURN=20QUERY=20SELECT=20DISTINCT=20vms.*=0A=20=20=20=20=20=20FROM=20=
vms=0A=20=20=20=20=20=20ORDER=20BY=20vm_guid;=0AEND=20IF;=0A=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetAllFromVmsForUserAndActionGroup(v_user_id=20=
UUID,=20v_action_group_id=20INTEGER)=20RETURNS=20SETOF=20vms=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20SELECT=20DISTINCT=20=
vms.*=0A=20=20=20=20=20=20FROM=20vms,=20vm_permissions_view,=20=
permissions_view,=20engine_session_user_flat_groups=0A=20=20=20=20=20=20=
WHERE=20vms.vm_guid=20=3D=20vm_permissions_view.entity_id=0A=0A=20=20=20=20=
=20=20=20=20=20=20AND=20=20=20vm_permissions_view.user_id=20=3D=20=
v_user_id=0A=20=20=20=20=20=20=20=20=20=20AND=20=20=20=
engine_session_user_flat_groups.user_id=20=3D=20=
vm_permissions_view.user_id=0A=20=20=20=20=20=20=20=20=20=20--=20check=20=
the=20user=20has=20permission=20on=20any=20parent=20for=20this=20vm=20id=20=
and=20Object=20type=202=20(vm)=0A=20=20=20=20=20=20=20=20=20=20AND=20=20=20=
permissions_view.object_id=20IN=20(SELECT=20id=20FROM=20=
fn_get_entity_parents(vms.vm_guid,=202))=0A=20=20=20=20=20=20=20=20=20=20=
AND=20=20=20permissions_view.ad_element_id=20=3D=20=
engine_session_user_flat_groups.granted_id=0A=20=20=20=20=20=20=20=20=20=20=
AND=20=20=20permissions_view.role_id=20IN=20(SELECT=20role_id=20FROM=20=
roles_groups=20WHERE=20action_group_id=20=3D=20v_action_group_id)=0A=20=20=
=20=20=20=20ORDER=20BY=20vm_guid;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmsByIds(v_vms_ids=20UUID[])=20RETURNS=20SETOF=20vms=20STABLE=0A=20=20=
=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20SELECT=20vm.*=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20vms=20vm=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20vm.vm_guid=20=3D=20ANY(v_vms_ids);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmByVmGuid(v_vm_guid=20UUID,=20v_user_id=20UUID,=20v_is_filtered=20=
boolean)=20RETURNS=20SETOF=20vms=20STABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0ARETURN=20QUERY=20SELECT=20DISTINCT=20vms.*=0A=20=20=20FROM=20vms=0A=
=20=20=20WHERE=20vm_guid=20=3D=20v_vm_guid=0A=20=20=20=20=20=20=20AND=20=20=
=20(NOT=20v_is_filtered=20OR=20EXISTS=20(SELECT=201=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20=20=20user_vm_permissions_view=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20=20user_id=20=3D=20v_user_id=20AND=20=
entity_id=20=3D=20v_vm_guid));=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmByVmNameForDataCenter(v_data_center_id=20UUID,=20v_vm_name=20=
VARCHAR(255),=20v_user_id=20UUID,=20v_is_filtered=20boolean)=20RETURNS=20=
SETOF=20vms=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20=
QUERY=20SELECT=20DISTINCT=20vms.*=0A=20=20=20FROM=20vms=0A=20=20=20WHERE=20=
vm_name=20=3D=20v_vm_name=0A=20=20=20=20=20=20=20AND=20=20=20=
(v_data_center_id=20is=20null=20OR=20storage_pool_id=20=3D=20=
v_data_center_id)=0A=20=20=20=20=20=20=20AND=20=20=20(NOT=20=
v_is_filtered=20OR=20EXISTS=20(SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20FROM=20=20=20user_vm_permissions_view=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20WHERE=20=20user_id=20=3D=20v_user_id=20AND=20=
entity_id=20=3D=20vms.vm_guid));=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmsByVmtGuid(v_vmt_guid=20UUID)=20RETURNS=20SETOF=20vms=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20SELECT=20DISTINCT=20=
vms.*=0A=20=20=20FROM=20vms=0A=20=20=20WHERE=20vmt_guid=20=3D=20=
v_vmt_guid;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20GetVmsByUserId(v_user_id=20=
UUID)=20RETURNS=20SETOF=20vms=20STABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0ARETURN=20QUERY=20select=20vms.*=20from=20vms=0A=20=20=20INNER=20=
JOIN=20permissions=20on=20vms.vm_guid=20=3D=20permissions.object_id=0A=20=
=20=20WHERE=20permissions.ad_element_id=20=3D=20v_user_id;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetVmsByInstanceTypeId(v_instance_type_id=20UUID)=20=
RETURNS=20SETOF=20vms=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=
RETURN=20QUERY=20select=20vms.*=20from=20vms=0A=20=20=20WHERE=20=
instance_type_id=20=3D=20v_instance_type_id;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmsByUserIdWithGroupsAndUserRoles(v_user_id=20UUID)=20RETURNS=20SETOF=20=
vms=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20=
SELECT=20DISTINCT=20vms.*=0A=20=20=20from=20vms=0A=20=20=20inner=20join=20=
permissions_view=20as=20perms=20on=20vms.vm_guid=20=3D=20perms.object_id=0A=
=20=20=20WHERE=20(perms.ad_element_id=20=3D=20v_user_id=0A=20=20=20=20=20=
=20=20OR=20perms.ad_element_id=20IN(=0A=20=20=20=20=20=20=20=20=20=20=20=
SELECT=20id=0A=20=20=20=20=20=20=20=20=20=20=20FROM=20=
getUserAndGroupsById(v_user_id)))=0A=20=20=20=20=20=20=20AND=20=
perms.role_type=20=3D=202;=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmsRunningOnVds(v_vds_id=20UUID)=20RETURNS=20SETOF=20vms=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20SELECT=20DISTINCT=20=
vms.*=0A=20=20=20FROM=20vms=0A=20=20=20WHERE=20run_on_vds=20=3D=20=
v_vds_id;=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmsMigratingToVds(v_vds_id=20UUID)=20RETURNS=20SETOF=20vms=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20SELECT=20DISTINCT=20=
vms.*=0A=20=20=20FROM=20vms=0A=20=20=20WHERE=20migrating_to_vds=20=3D=20=
v_vds_id;=0A=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmsRunningOnOrMigratingToVds(v_vds_id=20UUID)=20RETURNS=20SETOF=20vms=20=
STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20--=20use=20=
migrating_to_vds=20column=20when=20the=20VM=20is=20in=20status=20=
Migrating=20From=0A=20=20=20=20RETURN=20QUERY=20SELECT=20DISTINCT=20V.*=20=
FROM=20VMS=20V=0A=20=20=20=20WHERE=20V.run_on_vds=3Dv_vds_id=0A=20=20=20=20=
=20=20=20=20OR=20(V.status=20=3D=205=0A=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20V.migrating_to_vds=3Dv_vds_id)=0A=20=20=20=20ORDER=20BY=20=
V.vm_name;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetAllForStoragePool(v_storage_pool_id=20UUID)=20RETURNS=20SETOF=20vms=20=
STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20SELECT=20*=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vms=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20storage_pool_id=20=3D=20v_storage_pool_id;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20UpdateGuestAgentStatus(=0A=09v_vm_guid=20UUID,=0A=09=
v_guest_agent_status=20INTEGER)=0ARETURNS=20VOID=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20=20UPDATE=20vm_dynamic=0A=20=20=20=20=
=20=20SET=0A=20=20=20=20=20=20guest_agent_status=20=3D=20=
v_guest_agent_status=0A=20=20=20=20=20=20WHERE=20vm_guid=20=3D=20=
v_vm_guid;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmsDynamicRunningOnVds(v_vds_id=20UUID)=20RETURNS=20SETOF=20=
vm_dynamic=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20=20=
=20RETURN=20QUERY=20SELECT=20vm_dynamic.*=0A=20=20=20=20=20=20FROM=20=
vm_dynamic=0A=20=20=20=20=20=20WHERE=20run_on_vds=20=3D=20v_vds_id;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20IsAnyVmRunOnVds(v_vds_id=20UUID)=0ARETURNS=20SETOF=20=
booleanResultType=20STABLE=0A=20=20=20=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=20vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20vm_dynamic=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
run_on_vds=20=3D=20v_vds_id=0A=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20DeleteVm(v_vm_guid=20UUID)=0ARETURNS=20VOID=0A=20=20=
=20AS=20$procedure$=0A=20=20=20DECLARE=0A=20=20=20v_vmt_guid=20=20UUID;=0A=
BEGIN=0A=20=20=20=20=20=20select=20=20=20vm_static.vmt_guid=20INTO=20=
v_vmt_guid=20FROM=20vm_static=20WHERE=20vm_guid=20=3D=20v_vm_guid;=0A=20=20=
=20=20=20=20UPDATE=20vm_static=0A=20=20=20=20=20=20SET=20child_count=20=
=3D(SELECT=20COUNT(*)=20FROM=20vm_static=20WHERE=20vmt_guid=20=3D=20=
v_vmt_guid)=20-1=0A=20=20=20=20=20=20WHERE=20vm_guid=20=3D=20v_vmt_guid;=0A=
=20=20=20=20=20=20DELETE=20FROM=20tags_vm_map=0A=20=20=20=20=20=20WHERE=20=
vm_id=20=3D=20v_vm_guid;=0A=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=
FROM=20=20=20snapshots=0A=20=20=20=20=20=20WHERE=20=20vm_id=20=3D=20=
v_vm_guid;=0A=20=20=20=20=20=20DELETE=20FROM=20vm_statistics=20WHERE=20=
vm_guid=20=3D=20v_vm_guid;=0A=20=20=20=20=20=20DELETE=20FROM=20=
vm_dynamic=20WHERE=20vm_guid=20=3D=20v_vm_guid;=0A=20=20=20=20=20=20=
DELETE=20FROM=20vm_static=20WHERE=20vm_guid=20=3D=20v_vm_guid;=0A=20=20=20=
=20=20=20DELETE=20FROM=20permissions=20where=20object_id=20=3D=20=
v_vm_guid;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmsByAdGroupNames(v_ad_group_names=20VARCHAR(250))=20RETURNS=20SETOF=20=
vms=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20=
select=20distinct=20vms.*=20from=20vms=0A=20=20=20inner=20join=20=
permissions=20on=20vms.vm_guid=20=3D=20permissions.object_id=0A=20=20=20=
inner=20join=20ad_groups=20on=20ad_groups.id=20=3D=20=
permissions.ad_element_id=0A=20=20=20WHERE=20=20=20=20=20(ad_groups.name=20=
in(select=20Id=20from=20fnSplitter(v_ad_group_names)));=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetVmsByDiskId(v_disk_guid=20UUID)=20RETURNS=20=
SETOF=20vms_with_plug_info=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=
=20=20=20=20=20=20RETURN=20QUERY=20SELECT=20DISTINCT=20=
vms_with_plug_info.*=0A=20=20=20=20=20=20FROM=20vms_with_plug_info=0A=20=20=
=20=20=20=20WHERE=20device_id=20=3D=20v_disk_guid;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetAllVMsWithDisksOnOtherStorageDomain(v_storage_domain_id=20UUID)=20=
RETURNS=20SETOF=20vms=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=
=20=20=20=20RETURN=20QUERY=20SELECT=20DISTINCT=20vms.*=0A=20=20=20=20=20=20=
FROM=20vms=0A=20=20=20=20=20=20INNER=20JOIN=20(SELECT=20=
vm_static.vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vm_static=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
INNER=20JOIN=20vm_device=20vd=20ON=20vd.vm_id=20=3D=20vm_static.vm_guid=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20INNER=20JOIN=20=
images=20i=20ON=20i.image_group_id=20=3D=20vd.device_id=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20INNER=20JOIN=20(SELECT=20image_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20image_storage_domain_map=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
image_storage_domain_map.storage_domain_id=20=3D=20v_storage_domain_id)=20=
isd_map=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20ON=20i.image_guid=20=3D=20isd_map.image_id=20=
WHERE=20entity_type=20=3D=20'VM')=20vms_with_disks_on_storage_domain=20=
ON=20vms.vm_guid=20=3D=20vms_with_disks_on_storage_domain.vm_guid=0A=20=20=
=20=20=20=20INNER=20JOIN=20vm_device=20vd=20ON=20vd.vm_id=20=3D=20=
vms.vm_guid=0A=20=20=20=20=20=20INNER=20JOIN=20images=20i=20ON=20=
i.image_group_id=20=3D=20vd.device_id=0A=20=20=20=20=20=20INNER=20JOIN=20=
image_storage_domain_map=20on=20i.image_guid=20=3D=20=
image_storage_domain_map.image_id=0A=20=20=20=20=20=20WHERE=20=
image_storage_domain_map.storage_domain_id=20!=3D=20v_storage_domain_id;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetActiveVmsByStorageDomainId(v_storage_domain_id=20=
UUID)=20RETURNS=20SETOF=20vms=20STABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20=20=20RETURN=20QUERY=20SELECT=20DISTINCT=20vms.*=0A=20=
=20=20=20=20=20FROM=20vms=0A=20=20=20=20=20=20INNER=20JOIN=20vm_device=20=
vd=20ON=20vd.vm_id=20=3D=20vms.vm_guid=0A=20=20=20=20=20=20INNER=20JOIN=20=
images=20i=20ON=20i.image_group_id=20=3D=20vd.device_id=0A=20=20=20=20=20=
=20inner=20join=20image_storage_domain_map=20on=20i.image_guid=20=3D=20=
image_storage_domain_map.image_id=0A=20=20=20=20=20=20WHERE=20status=20=
<>=200=0A=20=20=20=20=20=20AND=20is_plugged=20=3D=20TRUE=0A=20=20=20=20=20=
=20AND=20image_storage_domain_map.storage_domain_id=20=3D=20=
v_storage_domain_id;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmsByStorageDomainId(v_storage_domain_id=20UUID)=20RETURNS=20SETOF=20=
vms=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20=20=20=
RETURN=20QUERY=20SELECT=20DISTINCT=20vms.*=0A=20=20=20=20=20=20FROM=20=
vms=0A=20=20=20=20=20=20INNER=20JOIN=20vm_device=20vd=20ON=20vd.vm_id=20=
=3D=20vms.vm_guid=0A=20=20=20=20=20=20INNER=20JOIN=20images=20ON=20=
images.image_group_id=20=3D=20vd.device_id=0A=20=20=20=20=20=20=20=20=20=20=
AND=20images.active=20=3D=20TRUE=0A=20=20=20=20=20=20INNER=20JOIN=20=
image_storage_domain_map=20on=20images.image_guid=20=3D=20=
image_storage_domain_map.image_id=0A=20=20=20=20=20=20WHERE=20=
image_storage_domain_map.storage_domain_id=20=3D=20v_storage_domain_id;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20getAllVmsRelatedToQuotaId(v_quota_id=20UUID)=20=
RETURNS=20SETOF=20vms=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=
=20=20=20=20RETURN=20QUERY=20SELECT=20vms.*=0A=20=20=20=20=20=20FROM=20=
vms=0A=20=20=20=20=20=20WHERE=20quota_id=20=3D=20v_quota_id=0A=20=20=20=20=
=20=20UNION=0A=20=20=20=20=20=20SELECT=20DISTINCT=20vms.*=0A=20=20=20=20=20=
=20FROM=20vms=0A=20=20=20=20=20=20INNER=20JOIN=20vm_device=20vd=20ON=20=
vd.vm_id=20=3D=20vms.vm_guid=0A=20=20=20=20=20=20INNER=20JOIN=20images=20=
ON=20images.image_group_id=20=3D=20vd.device_id=0A=20=20=20=20=20=20=20=20=
=20=20AND=20images.active=20=3D=20TRUE=0A=20=20=20=20=20=20INNER=20JOIN=20=
image_storage_domain_map=20ON=20image_storage_domain_map.image_id=20=3D=20=
images.image_guid=0A=20=20=20=20=20=20WHERE=20=
image_storage_domain_map.quota_id=20=3D=20v_quota_id;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20UpdateIsInitialized(v_vm_guid=20UUID,=0A=20=
v_is_initialized=20BOOLEAN)=0ARETURNS=20VOID=0A=09=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20=20UPDATE=20vm_static=0A=20=20=20=20=
=20=20SET=20is_initialized=20=3D=20v_is_initialized=0A=20=20=20=20=20=20=
WHERE=20vm_guid=20=3D=20v_vm_guid=0A=20=20=20=20=20=20=20=20=20=20AND=20=
entity_type=20=3D=20'VM';=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ADROP=20TYPE=20IF=20EXISTS=20=
GetOrderedVmGuidsForRunMultipleActions_rs=20CASCADE;=0A=
**************************=0A=0ADROP=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20TYPE=20GetOrderedVmGuidsForRunMultipleActions_rs=20=
AS=20(vm_guid=20UUID);=0A**************************=0A=0ACREATE=20TYPE=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetOrderedVmGuidsForRunMultipleActions(v_vm_guids=20VARCHAR(4000))=20=
RETURNS=20SETOF=20GetOrderedVmGuidsForRunMultipleActions_rs=20STABLE=0A=20=
=20=20AS=20$procedure$=0A=20=20=20DECLARE=0A=20=20=20v_ordered_guids=20=
GetOrderedVmGuidsForRunMultipleActions_rs;=0ABEGIN=0A=20=20=20FOR=20=
v_ordered_guids=20IN=0A=20=20=20=20=20=20=20EXECUTE=20'SELECT=20vm_guid=20=
from=20vm_static=20where=20vm_guid=20in(=20'=20||=20v_vm_guids=20||=20'=20=
)=20AND=20entity_type=20=3D=20''VM''=20=20order=20by=20auto_startup=20=
desc,priority=20desc,=20migration_support=20desc'=0A=20=20=20LOOP=0A=20=20=
=20=20=20=20RETURN=20NEXT=20v_ordered_guids;=0A=20=20=20END=20LOOP;=0A=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetVmsByNetworkId(v_network_id=20UUID)=20RETURNS=20=
SETOF=20vms=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=
RETURN=20QUERY=20SELECT=20*=0A=20=20=20FROM=20vms=0A=20=20=20WHERE=20=
EXISTS=20(=0A=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20FROM=20=
vm_interface=0A=20=20=20=20=20=20INNER=20JOIN=20vnic_profiles=0A=20=20=20=
=20=20=20ON=20vnic_profiles.id=20=3D=20vm_interface.vnic_profile_id=0A=20=
=20=20=20=20=20WHERE=20vnic_profiles.network_id=20=3D=20v_network_id=0A=20=
=20=20=20=20=20=20=20=20=20AND=20vm_interface.vm_guid=20=3D=20=
vms.vm_guid);=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmsByVnicProfileId(v_vnic_profile_id=20UUID)=20RETURNS=20SETOF=20vms=20=
STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20RETURN=20QUERY=20=
SELECT=20*=0A=20=20=20FROM=20vms=0A=20=20=20WHERE=20EXISTS=20(=0A=20=20=20=
=20=20=20SELECT=201=0A=20=20=20=20=20=20FROM=20vm_interface=0A=20=20=20=20=
=20=20WHERE=20vm_interface.vnic_profile_id=20=3D=20v_vnic_profile_id=0A=20=
=20=20=20=20=20=20=20=20=20AND=20vm_interface.vm_guid=20=3D=20=
vms.vm_guid);=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmsByClusterId(v_cluster_id=20UUID)=20RETURNS=20SETOF=20vms=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20=20=20RETURN=20QUERY=20=
SELECT=20vms.*=0A=20=20=20=20=20=20FROM=20vms=0A=20=20=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmsByVmPoolId(v_vm_pool_id=20UUID)=20RETURNS=20SETOF=20vms=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20=20=20RETURN=20QUERY=20=
SELECT=20vms.*=0A=20=20=20=20=20=20FROM=20vms=0A=20=20=20=20=20=20WHERE=20=
vm_pool_id=20=3D=20v_vm_pool_id;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetFailedAutoStartVms()=20RETURNS=20SETOF=20vms=20STABLE=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20=20RETURN=20QUERY=20SELECT=20vms.*=0A=
=20=20=20=20=20=20FROM=20vms=0A=20=20=20=20=20=20WHERE=20auto_startup=20=
=3D=20TRUE=0A=20=20=20=20=20=20=20=20=20=20AND=20status=20=3D=200=0A=20=20=
=20=20=20=20=20=20=20=20AND=20exit_status=20=3D=201;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetRunningVmsByClusterId(v_cluster_id=20UUID)=20=
RETURNS=20SETOF=20vms=20STABLE=0A=20=20=20=20AS=20$procedure$=0ABEGIN=0A=20=
=20=20=20RETURN=20QUERY=20SELECT=20DISTINCT=20vms.*=0A=20=20=20=20FROM=20=
vms=0A=20=20=20=20WHERE=20run_on_vds=20IS=20NOT=20NULL=0A=20=20=20=20=20=20=
=20=20AND=20cluster_id=20=3D=20v_cluster_id;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmInitByVmId(v_vm_id=20UUID)=20RETURNS=20SETOF=20vm_init=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20SELECT=20vm_init.*=0A=20=
=20=20FROM=20vm_init=0A=20=20=20WHERE=20vm_id=20=3D=20v_vm_id;=0A=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetVmInitByids(v_vm_init_ids=20TEXT)=20RETURNS=20=
SETOF=20vm_init=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20=
QUERY=20SELECT=20*=0A=20=20=20=20=20FROM=20vm_init=0A=20=20=20=20=20=
WHERE=20vm_init.vm_id=20IN=20(=0A=20=20=20=20=20=20=20=20=20SELECT=20*=0A=
=20=20=20=20=20=20=20=20=20FROM=20fnSplitterUuid(v_vm_init_ids));=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20UpdateVmInit(=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=
=20=20v_host_name=20TEXT,=0A=20=20=20=20v_domain=20TEXT,=0A=20=20=20=20=
v_authorized_keys=20TEXT,=0A=20=20=20=20v_regenerate_keys=20BOOLEAN,=0A=20=
=20=20=20v_time_zone=20VARCHAR(40),=0A=20=20=20=20v_dns_servers=20TEXT,=0A=
=20=20=20=20v_dns_search_domains=20TEXT,=0A=20=20=20=20v_networks=20=
TEXT,=0A=20=20=20=20v_password=20TEXT,=0A=20=20=20=20v_winkey=20=
VARCHAR(30),=0A=20=20=20=20v_custom_script=20TEXT,=0A=20=20=20=20=
v_input_locale=20VARCHAR(256),=0A=20=20=20=20v_ui_language=20=
VARCHAR(256),=0A=20=20=20=20v_system_locale=20VARCHAR(256),=0A=20=20=20=20=
v_user_locale=20VARCHAR(256),=0A=20=20=20=20v_user_name=20VARCHAR(256),=0A=
=20=20=20=20v_active_directory_ou=20VARCHAR(256),=0A=20=20=20=20=
v_org_name=20VARCHAR(256)=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vm_init=0A=20=20=20=20SET=20=
host_name=20=3D=20v_host_name,=0A=20=20=20=20=20=20=20=20domain=20=3D=20=
v_domain,=0A=20=20=20=20=20=20=20=20authorized_keys=20=3D=20=
v_authorized_keys,=0A=20=20=20=20=20=20=20=20regenerate_keys=20=3D=20=
v_regenerate_keys,=0A=20=20=20=20=20=20=20=20time_zone=20=3D=20=
v_time_zone,=0A=20=20=20=20=20=20=20=20dns_servers=20=3D=20=
v_dns_servers,=0A=20=20=20=20=20=20=20=20dns_search_domains=20=3D=20=
v_dns_search_domains,=0A=20=20=20=20=20=20=20=20networks=20=3D=20=
v_networks,=0A=20=20=20=20=20=20=20=20password=20=3D=20v_password,=0A=20=20=
=20=20=20=20=20=20winkey=20=3D=20v_winkey,=0A=20=20=20=20=20=20=20=20=
custom_script=20=3D=20v_custom_script,=0A=20=20=20=20=20=20=20=20=
input_locale=20=3D=20v_input_locale,=0A=20=20=20=20=20=20=20=20=
ui_language=20=3D=20v_ui_language,=0A=20=20=20=20=20=20=20=20=
system_locale=20=3D=20v_system_locale,=0A=20=20=20=20=20=20=20=20=
user_locale=20=3D=20v_user_locale,=0A=20=20=20=20=20=20=20=20user_name=20=
=3D=20v_user_name,=0A=20=20=20=20=20=20=20=20active_directory_ou=20=3D=20=
v_active_directory_ou,=0A=20=20=20=20=20=20=20=20org_name=20=3D=20=
v_org_name=0A=20=20=20=20WHERE=20vm_id=20=3D=20v_vm_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20DeleteVmInit=20(v_vm_id=20UUID)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vm_init=0A=20=20=20=20WHERE=20vm_id=20=3D=20v_vm_id;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
InsertVmInit=20(=0A=20=20=20=20v_vm_id=20UUID,=0A=20=20=20=20v_host_name=20=
TEXT,=0A=20=20=20=20v_domain=20TEXT,=0A=20=20=20=20v_authorized_keys=20=
TEXT,=0A=20=20=20=20v_regenerate_keys=20BOOLEAN,=0A=20=20=20=20=
v_time_zone=20VARCHAR(40),=0A=20=20=20=20v_dns_servers=20TEXT,=0A=20=20=20=
=20v_dns_search_domains=20TEXT,=0A=20=20=20=20v_networks=20TEXT,=0A=20=20=
=20=20v_password=20TEXT,=0A=20=20=20=20v_winkey=20VARCHAR(30),=0A=20=20=20=
=20v_custom_script=20TEXT,=0A=20=20=20=20v_input_locale=20VARCHAR(256),=0A=
=20=20=20=20v_ui_language=20VARCHAR(256),=0A=20=20=20=20v_system_locale=20=
VARCHAR(256),=0A=20=20=20=20v_user_locale=20VARCHAR(256),=0A=20=20=20=20=
v_user_name=20VARCHAR(256),=0A=20=20=20=20v_active_directory_ou=20=
VARCHAR(256),=0A=20=20=20=20v_org_name=20VARCHAR(256)=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20=
vm_init=20(=0A=20=20=20=20=20=20=20=20vm_id,=0A=20=20=20=20=20=20=20=20=
host_name,=0A=20=20=20=20=20=20=20=20domain,=0A=20=20=20=20=20=20=20=20=
authorized_keys,=0A=20=20=20=20=20=20=20=20regenerate_keys,=0A=20=20=20=20=
=20=20=20=20time_zone,=0A=20=20=20=20=20=20=20=20dns_servers,=0A=20=20=20=
=20=20=20=20=20dns_search_domains,=0A=20=20=20=20=20=20=20=20networks,=0A=
=20=20=20=20=20=20=20=20password,=0A=20=20=20=20=20=20=20=20winkey,=0A=20=
=20=20=20=20=20=20=20custom_script,=0A=20=20=20=20=20=20=20=20=
input_locale,=0A=20=20=20=20=20=20=20=20ui_language,=0A=20=20=20=20=20=20=
=20=20system_locale,=0A=20=20=20=20=20=20=20=20user_locale,=0A=20=20=20=20=
=20=20=20=20user_name,=0A=20=20=20=20=20=20=20=20active_directory_ou,=0A=20=
=20=20=20=20=20=20=20org_name=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_vm_id,=0A=20=20=20=20=20=20=20=20=
v_host_name,=0A=20=20=20=20=20=20=20=20v_domain,=0A=20=20=20=20=20=20=20=20=
v_authorized_keys,=0A=20=20=20=20=20=20=20=20v_regenerate_keys,=0A=20=20=20=
=20=20=20=20=20v_time_zone,=0A=20=20=20=20=20=20=20=20v_dns_servers,=0A=20=
=20=20=20=20=20=20=20v_dns_search_domains,=0A=20=20=20=20=20=20=20=20=
v_networks,=0A=20=20=20=20=20=20=20=20v_password,=0A=20=20=20=20=20=20=20=
=20v_winkey,=0A=20=20=20=20=20=20=20=20v_custom_script,=0A=20=20=20=20=20=
=20=20=20v_input_locale,=0A=20=20=20=20=20=20=20=20v_ui_language,=0A=20=20=
=20=20=20=20=20=20v_system_locale,=0A=20=20=20=20=20=20=20=20=
v_user_locale,=0A=20=20=20=20=20=20=20=20v_user_name,=0A=20=20=20=20=20=20=
=20=20v_active_directory_ou,=0A=20=20=20=20=20=20=20=20v_org_name=0A=20=20=
=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVmIdsForVersionUpdate=20=
(v_base_template_id=20UUID)=0ARETURNS=20SETOF=20UUID=20STABLE=20AS=20=
$PROCEDURE$=0ABEGIN=0A=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20SELECT=20=
vs.vm_guid=0A=20=20=20=20FROM=20vm_static=20vs=20natural=0A=20=20=20=20=
INNER=20JOIN=20vm_dynamic=0A=20=20=20=20WHERE=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20vmt_guid=20=3D=20v_base_template_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20OR=20vmt_guid=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20vm_static=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20vmt_guid=20=3D=20v_base_template_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20AND=20template_version_number=20IS=20NULL=0A=20=20=20=20=
=20=20=20=20AND=20entity_type=20=3D=20'VM'=0A=20=20=20=20=20=20=20=20AND=20=
status=20=3D=200=0A=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20is_stateless=20=3D=20TRUE=0A=20=20=20=20=20=20=20=20=20=20=
=20=20OR=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
*=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vm_pool_map=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20vm_guid=20=3D=20vs.vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20*=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20snapshots=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20WHERE=20vm_id=20=3D=20vs.vm_guid=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
snapshot_type=20=3D=20'STATELESS'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateVmCpuProfileIdForClusterId=20(=0A=20=20=20=20v_cluster_id=20UUID,=0A=
=20=20=20=20v_cpu_profile_id=20UUID=0A=20=20=20=20)=0ARETURNS=20VOID=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20vm_static=0A=20=20=20=20=
SET=20cpu_profile_id=20=3D=20v_cpu_profile_id=0A=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20InsertDedicatedHostsToVm=20=
(=0A=20=20=20=20v_vm_guid=20UUID,=0A=20=20=20=20v_dedicated_vm_for_vds=20=
TEXT=0A=20=20=20=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=
=20=20INSERT=20INTO=20vm_host_pinning_map=20(=0A=20=20=20=20=20=20=20=20=
vm_id,=0A=20=20=20=20=20=20=20=20vds_id=0A=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20SELECT=20v_vm_guid,=0A=20=20=20=20=20=20=20=20vds_id=0A=20=20=20=
=20FROM=20fnSplitterUuid(v_dedicated_vm_for_vds)=20AS=20vds_id;=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20UpdateDedicatedHostsToVm=20(=0A=20=20=20=20=
v_vm_guid=20UUID,=0A=20=20=20=20v_dedicated_vm_for_vds=20TEXT=0A=20=20=20=
=20)=0ARETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=
=20=20=20FROM=20vm_host_pinning_map=0A=20=20=20=20WHERE=20vm_id=20=3D=20=
v_vm_guid;=0A=0A=20=20=20=20PERFORM=20=
InsertDedicatedHostsToVm(v_vm_guid,=20v_dedicated_vm_for_vds);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20GetVmsByCpuProfileIds(v_cpu_profile_ids=20UUID[])=0A=
RETURNS=20SETOF=20vms=20STABLE=0AAS=20$procedure$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=20SELECT=20vms.*=0A=20=20=20=20=20=20=20=20FROM=20vms=0A=20=
=20=20=20=20=20=20=20WHERE=20cpu_profile_id=20=3D=20=
ANY(v_cpu_profile_ids);=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllVmsRelatedToDiskProfiles(v_disk_profile_ids=20UUID[])=0ARETURNS=20=
SETOF=20vms=20STABLE=0AAS=20$procedure$=0ABEGIN=0A=20=20RETURN=20QUERY=20=
SELECT=20vms.*=0A=20=20=20=20=20=20FROM=20vms=0A=20=20=20=20=20=20=20=20=20=
=20INNER=20JOIN=20vm_device=20vd=20ON=20vd.vm_id=20=3D=20vms.vm_guid=0A=20=
=20=20=20=20=20=20=20=20=20INNER=20JOIN=20images=20ON=20=
images.image_group_id=20=3D=20vd.device_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20images.active=20=3D=20TRUE=0A=20=20=20=20=20=20=20=20=20=
=20INNER=20JOIN=20image_storage_domain_map=20ON=20=
image_storage_domain_map.image_id=20=3D=20images.image_guid=0A=20=20=20=20=
=20=20=20=20=20=20WHERE=20image_storage_domain_map.disk_profile_id=20=3D=20=
ANY(v_disk_profile_ids);=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetVmsByOrigin(v_origins=20=
INT[])=0ARETURNS=20SETOF=20vms=20STABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=0A=20=20=20=20SELECT=20vms.*=0A=20=20=20=
=20=20=20=20=20FROM=20vms=0A=20=20=20=20=20=20=20=20WHERE=20origin=20=3D=20=
ANY(v_origins);=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20SetToUnknown=20(=0A=20=20=
=20=20v_vm_ids=20UUID[],=0A=20=20=20=20v_status=20INT=0A=20=20=20=20)=0A=
RETURNS=20VOID=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20UPDATE=20=
vm_dynamic=0A=20=20=20=20SET=20status=20=3D=20v_status=0A=20=20=20=20=
WHERE=20vm_guid=20=3D=20ANY(v_vm_ids)=0A=20=20=20=20=20=20=20=20AND=20=
run_on_vds=20IS=20NOT=20NULL;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
InsertVmTemplate(v_child_count=20INTEGER,=0A=20v_creation_date=20=
TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20v_description=20VARCHAR(4000)=20,=0A=
=20v_free_text_comment=20text,=0A=20v_mem_size_mb=20INTEGER,=0A=20=
v_num_of_io_threads=20INTEGER,=0A=20v_name=20VARCHAR(40),=0A=20=
v_num_of_sockets=20INTEGER,=0A=20v_cpu_per_socket=20INTEGER,=0A=20=
v_threads_per_cpu=20INTEGER,=0A=20v_os=20INTEGER,=0A=20v_vmt_guid=20=
UUID,=0A=20v_cluster_id=20UUID,=0A=20v_num_of_monitors=20INTEGER,=0A=20=
v_single_qxl_pci=20BOOLEAN,=0A=20v_allow_console_reconnect=20BOOLEAN,=0A=20=
v_status=20INTEGER,=0A=20v_usb_policy=20INTEGER,=0A=20v_time_zone=20=
VARCHAR(40)=20,=0A=20v_fail_back=20BOOLEAN=20,=0A=20v_vm_type=20INTEGER=20=
,=0A=20v_nice_level=20INTEGER,=0A=20v_cpu_shares=20INTEGER,=0A=20=
v_default_boot_sequence=20INTEGER,=0A=20v_default_display_type=20=
INTEGER,=0A=20v_priority=20INTEGER,=0A=20v_auto_startup=20BOOLEAN,=0A=20=
v_is_stateless=20BOOLEAN,=0A=20v_is_smartcard_enabled=20BOOLEAN,=0A=20=
v_is_delete_protected=20BOOLEAN,=0A=20v_sso_method=20VARCHAR(32),=0A=20=
v_is_disabled=20BOOLEAN,=0A=20v_iso_path=20VARCHAR(4000)=20,=0A=20=
v_origin=20INTEGER=20,=0A=20v_initrd_url=20=20=20=20VARCHAR(4000)=20,=0A=20=
v_kernel_url=20=20=20=20VARCHAR(4000)=20,=0A=20v_kernel_params=20=
VARCHAR(4000)=20,=0A=20v_quota_id=20UUID,=0A=20v_migration_support=20=
integer,=0A=20v_dedicated_vm_for_vds=20text,=0A=20v_tunnel_migration=20=
BOOLEAN,=0A=20v_vnc_keyboard_layout=09VARCHAR(16),=0A=20=
v_min_allocated_mem=20INTEGER,=0A=20v_is_run_and_pause=20BOOLEAN,=0A=20=
v_created_by_user_id=20UUID,=0A=20v_template_type=20VARCHAR(40),=0A=20=
v_migration_downtime=20INTEGER,=0A=20v_base_template_id=20UUID,=0A=20=
v_template_version_name=20VARCHAR(40),=0A=20v_serial_number_policy=20=
SMALLINT,=0A=20v_custom_serial_number=20VARCHAR(255),=0A=20=
v_is_boot_menu_enabled=20BOOLEAN,=0A=20v_is_spice_file_transfer_enabled=20=
BOOLEAN,=0A=20v_is_spice_copy_paste_enabled=20BOOLEAN,=0A=20=
v_cpu_profile_id=20UUID,=0A=20v_numatune_mode=20VARCHAR(20),=0A=20=
v_is_auto_converge=20BOOLEAN,=0A=20v_is_migrate_compressed=20BOOLEAN,=0A=20=
v_predefined_properties=20VARCHAR(4000),=0A=20v_userdefined_properties=20=
VARCHAR(4000),=0A=20v_custom_emulated_machine=20VARCHAR(40),=0A=20=
v_custom_cpu_name=20VARCHAR(40),=0A=20v_small_icon_id=20UUID,=0A=20=
v_large_icon_id=20UUID,=0A=20v_console_disconnect_action=20VARCHAR(64),=0A=
=20v_custom_compatibility_version=20VARCHAR(40),=0A=20=
v_migration_policy_id=20UUID)=0ARETURNS=20VOID=0A=20=20=20AS=20=
$procedure$=0ADECLARE=0Av_template_version_number=20INTEGER;=0ABEGIN=0A=20=
=20--=20get=20current=20max=20version=20and=20use=20next=0A=20=20SELECT=20=
max(template_version_number)=20+=201=20into=20v_template_version_number=0A=
=20=20from=20vm_static=0A=20=20where=20vmt_guid=20=3D=20=
v_base_template_id=0A=20=20=20=20=20=20=20=20and=20entity_type=20=3D=20=
'TEMPLATE';=0A=0A=20=20--=20if=20no=20versions=20exist=20it=20might=20=
return=20null,=20so=20this=20is=20a=20new=20base=20template=0A=20=20if=20=
v_template_version_number=20is=20null=20then=0A=20=20=20=20=
v_template_version_number=20=3D=201;=0A=20=20end=20if;=0A=0A=20=20=20=20=
INSERT=0A=20=20=20=20INTO=20vm_static(=0A=20=20=20=20=20=20=20=20=
child_count,=0A=20=20=20=20=20=20=20=20creation_date,=0A=20=20=20=20=20=20=
=20=20description,=0A=20=20=20=20=20=20=20=20free_text_comment,=0A=20=20=20=
=20=20=20=20=20mem_size_mb,=0A=20=20=20=20=20=20=20=20num_of_io_threads,=0A=
=20=20=20=20=20=20=20=20vm_name,=0A=20=20=20=20=20=20=20=20=
num_of_sockets,=0A=20=20=20=20=20=20=20=20cpu_per_socket,=0A=20=20=20=20=20=
=20=20=20threads_per_cpu,=0A=20=20=20=20=20=20=20=20os,=0A=20=20=20=20=20=
=20=20=20vm_guid,=0A=20=20=20=20=20=20=20=20cluster_id,=0A=20=20=20=20=20=
=20=20=20num_of_monitors,=0A=20=20=20=20=20=20=20=20single_qxl_pci,=0A=20=
=20=20=20=20=20=20=20allow_console_reconnect,=0A=20=20=20=20=20=20=20=20=
template_status,=0A=20=20=20=20=20=20=20=20usb_policy,=0A=20=20=20=20=20=20=
=20=20time_zone,=0A=20=20=20=20=20=20=20=20fail_back,=0A=20=20=20=20=20=20=
=20=20vm_type,=0A=20=20=20=20=20=20=20=20nice_level,=0A=20=20=20=20=20=20=
=20=20cpu_shares,=0A=20=20=20=20=20=20=20=20default_boot_sequence,=0A=20=20=
=20=20=20=20=20=20default_display_type,=0A=20=20=20=20=20=20=20=20=
priority,=0A=20=20=20=20=20=20=20=20auto_startup,=0A=20=20=20=20=20=20=20=
=20is_stateless,=0A=20=20=20=20=20=20=20=20iso_path,=0A=20=20=20=20=20=20=
=20=20origin,=0A=20=20=20=20=20=20=20=20initrd_url,=0A=20=20=20=20=20=20=20=
=20kernel_url,=0A=20=20=20=20=20=20=20=20kernel_params,=0A=20=20=20=20=20=
=20=20=20entity_type,=0A=20=20=20=20=20=20=20=20quota_id,=0A=20=20=20=20=20=
=20=20=20migration_support,=0A=20=20=20=20=20=20=20=20is_disabled,=0A=20=20=
=20=20=20=20=20=20dedicated_vm_for_vds,=0A=20=20=20=20=20=20=20=20=
is_smartcard_enabled,=0A=20=20=20=20=20=20=20=20is_delete_protected,=0A=20=
=20=20=20=20=20=20=20sso_method,=0A=20=20=20=20=20=20=20=20=
tunnel_migration,=0A=20=20=20=20=20=20=20=20vnc_keyboard_layout,=0A=20=20=
=20=20=20=20=20=20min_allocated_mem,=0A=20=20=20=20=20=20=20=20=
is_run_and_pause,=0A=20=20=20=20=20=20=20=20created_by_user_id,=0A=20=20=20=
=20=20=20=20=20migration_downtime,=0A=20=20=20=20=20=20=20=20=
template_version_number,=0A=20=20=20=20=20=20=20=20vmt_guid,=0A=20=20=20=20=
=20=20=20=20template_version_name,=0A=20=20=20=20=20=20=20=20=
serial_number_policy,=0A=20=20=20=20=20=20=20=20custom_serial_number,=0A=20=
=20=20=20=20=20=20=20is_boot_menu_enabled,=0A=20=20=20=20=20=20=20=20=
is_spice_file_transfer_enabled,=0A=20=20=20=20=20=20=20=20=
is_spice_copy_paste_enabled,=0A=20=20=20=20=20=20=20=20cpu_profile_id,=0A=
=20=20=20=20=20=20=20=20numatune_mode,=0A=20=20=20=20=20=20=20=20=
is_auto_converge,=0A=20=20=20=20=20=20=20=20is_migrate_compressed,=0A=20=20=
=20=20=20=20=20=20predefined_properties,=0A=20=20=20=20=20=20=20=20=
userdefined_properties,=0A=20=20=20=20=20=20=20=20=
custom_emulated_machine,=0A=20=20=20=20=20=20=20=20custom_cpu_name,=0A=20=
=20=20=20=20=20=20=20small_icon_id,=0A=20=20=20=20=20=20=20=20=
large_icon_id,=0A=20=20=20=20=20=20=20=20console_disconnect_action,=0A=20=
=20=20=20=20=20=20=20custom_compatibility_version,=0A=20=20=20=20=20=20=20=
=20migration_policy_id)=0A=20=20=20=20VALUES(=0A=20=20=20=20=20=20=20=20=
v_child_count,=0A=20=20=20=20=20=20=20=20v_creation_date,=0A=20=20=20=20=20=
=20=20=20v_description,=0A=20=20=20=20=20=20=20=20v_free_text_comment,=0A=
=20=20=20=20=20=20=20=20v_mem_size_mb,=0A=20=20=20=20=20=20=20=20=
v_num_of_io_threads,=0A=20=20=20=20=20=20=20=20v_name,=0A=20=20=20=20=20=20=
=20=20v_num_of_sockets,=0A=20=20=20=20=20=20=20=20v_cpu_per_socket,=0A=20=
=20=20=20=20=20=20=20v_threads_per_cpu,=0A=20=20=20=20=20=20=20=20v_os,=0A=
=20=20=20=20=20=20=20=20v_vmt_guid,=0A=20=20=20=20=20=20=20=20=
v_cluster_id,=0A=20=20=20=20=20=20=20=20v_num_of_monitors,=0A=20=20=20=20=
=20=20=20=20v_single_qxl_pci,=0A=20=20=20=20=20=20=20=20=
v_allow_console_reconnect,=0A=20=20=20=20=20=20=20=20v_status,=0A=20=20=20=
=20=20=20=20=20v_usb_policy,=0A=20=20=20=20=20=20=20=20v_time_zone,=0A=20=
=20=20=20=20=20=20=20v_fail_back,=0A=20=20=20=20=20=20=20=20v_vm_type,=0A=
=20=20=20=20=20=20=20=20v_nice_level,=0A=20=20=20=20=20=20=20=20=
v_cpu_shares,=0A=20=20=20=20=20=20=20=20v_default_boot_sequence,=0A=20=20=
=20=20=20=20=20=20v_default_display_type,=0A=20=20=20=20=20=20=20=20=
v_priority,=0A=20=20=20=20=20=20=20=20v_auto_startup,=0A=20=20=20=20=20=20=
=20=20v_is_stateless,=0A=20=20=20=20=20=20=20=20v_iso_path,=0A=20=20=20=20=
=20=20=20=20v_origin,=0A=20=20=20=20=20=20=20=20v_initrd_url,=0A=20=20=20=
=20=20=20=20=20v_kernel_url,=0A=20=20=20=20=20=20=20=20v_kernel_params,=0A=
=20=20=20=20=20=20=20=20v_template_type,=0A=20=20=20=20=20=20=20=20=
v_quota_id,=0A=20=20=20=20=20=20=20=20v_migration_support,=0A=20=20=20=20=
=20=20=20=20v_is_disabled,=0A=20=20=20=20=20=20=20=20=
v_dedicated_vm_for_vds,=0A=20=20=20=20=20=20=20=20=
v_is_smartcard_enabled,=0A=20=20=20=20=20=20=20=20v_is_delete_protected,=0A=
=20=20=20=20=20=20=20=20v_sso_method,=0A=20=20=20=20=20=20=20=20=
v_tunnel_migration,=0A=20=20=20=20=20=20=20=20v_vnc_keyboard_layout,=0A=20=
=20=20=20=20=20=20=20v_min_allocated_mem,=0A=20=20=20=20=20=20=20=20=
v_is_run_and_pause,=0A=20=20=20=20=20=20=20=20v_created_by_user_id,=0A=20=
=20=20=20=20=20=20=20v_migration_downtime,=0A=20=20=20=20=20=20=20=20=
v_template_version_number,=0A=20=20=20=20=20=20=20=20v_base_template_id,=0A=
=20=20=20=20=20=20=20=20v_template_version_name,=0A=20=20=20=20=20=20=20=20=
v_serial_number_policy,=0A=20=20=20=20=20=20=20=20=
v_custom_serial_number,=0A=20=20=20=20=20=20=20=20=
v_is_boot_menu_enabled,=0A=20=20=20=20=20=20=20=20=
v_is_spice_file_transfer_enabled,=0A=20=20=20=20=20=20=20=20=
v_is_spice_copy_paste_enabled,=0A=20=20=20=20=20=20=20=20=
v_cpu_profile_id,=0A=20=20=20=20=20=20=20=20v_numatune_mode,=0A=20=20=20=20=
=20=20=20=20v_is_auto_converge,=0A=20=20=20=20=20=20=20=20=
v_is_migrate_compressed,=0A=20=20=20=20=20=20=20=20=
v_predefined_properties,=0A=20=20=20=20=20=20=20=20=
v_userdefined_properties,=0A=20=20=20=20=20=20=20=20=
v_custom_emulated_machine,=0A=20=20=20=20=20=20=20=20v_custom_cpu_name,=0A=
=20=20=20=20=20=20=20=20v_small_icon_id,=0A=20=20=20=20=20=20=20=20=
v_large_icon_id,=0A=20=20=20=20=20=20=20=20v_console_disconnect_action,=0A=
=20=20=20=20=20=20=20=20v_custom_compatibility_version,=0A=20=20=20=20=20=
=20=20=20v_migration_policy_id);=0A=20=20=20=20--=20perform=20deletion=20=
from=20vm_ovf_generations=20to=20ensure=20that=20no=20record=20exists=20=
when=20performing=20insert=20to=20avoid=20PK=20violation.=0A=20=20=20=20=
DELETE=20FROM=20vm_ovf_generations=20gen=20WHERE=20gen.vm_guid=20=3D=20=
v_vmt_guid;=0A=20=20=20=20INSERT=20INTO=20vm_ovf_generations(=0A=20=20=20=
=20=20=20=20=20vm_guid,=0A=20=20=20=20=20=20=20=20storage_pool_id)=0A=20=20=
=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20v_vmt_guid,=0A=20=20=20=20=20=20=
=20=20(SELECT=20storage_pool_id=0A=20=20=20=20=20=20=20=20=20FROM=20=
cluster=20vg=0A=20=20=20=20=20=20=20=20=20WHERE=20vg.cluster_id=20=3D=20=
v_cluster_id));=0A=0A=20=20=20=20--=20add=20connections=20to=20dedicated=20=
hosts=0A=20=20=20=20PERFORM=20InsertDedicatedHostsToVm(=0A=20=20=20=20=20=
=20=20=20v_vmt_guid,=0A=20=20=20=20=20=20=20=20v_dedicated_vm_for_vds);=0A=
=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=
=0ACREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20UpdateVmTemplate(v_child_count=20INTEGER,=0A=20=
v_creation_date=20TIMESTAMP=20WITH=20TIME=20ZONE,=0A=20v_description=20=
VARCHAR(4000)=20,=0A=20v_free_text_comment=20text,=0A=20v_mem_size_mb=20=
INTEGER,=0A=20v_num_of_io_threads=20INTEGER,=0A=20v_name=20VARCHAR(40),=0A=
=20v_num_of_sockets=20INTEGER,=0A=20v_cpu_per_socket=20INTEGER,=0A=20=
v_threads_per_cpu=20INTEGER,=0A=20v_os=20INTEGER,=0A=20v_vmt_guid=20=
UUID,=0A=20v_cluster_id=20UUID,=0A=20v_num_of_monitors=20INTEGER,=0A=20=
v_single_qxl_pci=20BOOLEAN,=0A=20v_allow_console_reconnect=20BOOLEAN,=0A=20=
v_status=20INTEGER,=0A=20v_usb_policy=20INTEGER,=0A=20v_time_zone=20=
VARCHAR(40)=20,=0A=20v_fail_back=20BOOLEAN=20,=0A=20v_vm_type=20INTEGER=20=
,=0A=20v_nice_level=20INTEGER,=0A=20v_cpu_shares=20INTEGER,=0A=20=
v_default_boot_sequence=20INTEGER,=0A=20v_default_display_type=20=
INTEGER,=0A=20v_priority=20INTEGER,=0A=20v_auto_startup=20BOOLEAN,=0A=20=
v_is_stateless=20BOOLEAN,=0A=20v_is_smartcard_enabled=20BOOLEAN,=0A=20=
v_is_delete_protected=20BOOLEAN,=0A=20v_sso_method=20VARCHAR(32),=0A=20=
v_is_disabled=20BOOLEAN,=0A=20v_iso_path=20VARCHAR(4000)=20,=0A=20=
v_origin=20INTEGER=20,=0A=20v_initrd_url=20VARCHAR(4000)=20,=0A=20=
v_kernel_url=20VARCHAR(4000)=20,=0A=20v_kernel_params=20VARCHAR(4000),=0A=
=20v_quota_id=20UUID,=0A=20v_migration_support=20integer,=0A=20=
v_dedicated_vm_for_vds=20text,=0A=20v_tunnel_migration=20BOOLEAN,=0A=20=
v_vnc_keyboard_layout=20VARCHAR(16),=0A=20v_min_allocated_mem=20INTEGER,=0A=
=20v_is_run_and_pause=20BOOLEAN,=0A=20v_created_by_user_id=20UUID,=0A=20=
v_template_type=20VARCHAR(40),=0A=20v_migration_downtime=20INTEGER,=0A=20=
v_template_version_name=20VARCHAR(40),=0A=20v_serial_number_policy=20=
SMALLINT,=0A=20v_custom_serial_number=20VARCHAR(255),=0A=20=
v_is_boot_menu_enabled=20BOOLEAN,=0A=20v_is_spice_file_transfer_enabled=20=
BOOLEAN,=0A=20v_is_spice_copy_paste_enabled=20BOOLEAN,=0A=20=
v_cpu_profile_id=20UUID,=0A=20v_numatune_mode=20VARCHAR(20),=0A=20=
v_is_auto_converge=20BOOLEAN,=0A=20v_is_migrate_compressed=20BOOLEAN,=0A=20=
v_predefined_properties=20VARCHAR(4000),=0A=20v_userdefined_properties=20=
VARCHAR(4000),=0A=20v_custom_emulated_machine=20VARCHAR(40),=0A=20=
v_custom_cpu_name=20VARCHAR(40),=0A=20v_small_icon_id=20UUID,=0A=20=
v_large_icon_id=20UUID,=0A=20v_console_disconnect_action=20VARCHAR(64),=0A=
=20v_custom_compatibility_version=20VARCHAR(40),=0A=20=
v_migration_policy_id=20UUID)=0ARETURNS=20VOID=0A=09=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20=20UPDATE=20vm_static=0A=20=20=20=20=
=20=20SET=20child_count=20=3D=20v_child_count,=0A=20=20=20=20=20=20=
creation_date=20=3D=20v_creation_date,=0A=20=20=20=20=20=20description=20=
=3D=20v_description,=0A=20=20=20=20=20=20free_text_comment=20=3D=20=
v_free_text_comment,=0A=20=20=20=20=20=20mem_size_mb=20=3D=20=
v_mem_size_mb,=0A=20=20=20=20=20=20num_of_io_threads=20=3D=20=
v_num_of_io_threads,=0A=20=20=20=20=20=20vm_name=20=3D=20v_name,=0A=20=20=
=20=20=20=20num_of_sockets=20=3D=20v_num_of_sockets,=0A=20=20=20=20=20=20=
cpu_per_socket=20=3D=20v_cpu_per_socket,=0A=20=20=20=20=20=20=
threads_per_cpu=20=3D=20v_threads_per_cpu,=0A=20=20=20=20=20=20os=20=3D=20=
v_os,=0A=20=20=20=20=20=20cluster_id=20=3D=20v_cluster_id,=0A=20=20=20=20=
=20=20num_of_monitors=20=3D=20v_num_of_monitors,=0A=20=20=20=20=20=20=
single_qxl_pci=20=3D=20v_single_qxl_pci,=0A=20=20=20=20=20=20=
allow_console_reconnect=20=3D=20v_allow_console_reconnect,=0A=20=20=20=20=
=20=20template_status=20=3D=20v_status,=0A=20=20=20=20=20=20usb_policy=20=
=3D=20v_usb_policy,=0A=20=20=20=20=20=20time_zone=20=3D=20v_time_zone,=0A=
=20=20=20=20=20=20fail_back=20=3D=20v_fail_back,=0A=20=20=20=20=20=20=
vm_type=20=3D=20v_vm_type,=0A=20=20=20=20=20=20nice_level=20=3D=20=
v_nice_level,=0A=20=20=20=20=20=20cpu_shares=20=3D=20v_cpu_shares,=0A=20=20=
=20=20=20=20default_boot_sequence=20=3D=20v_default_boot_sequence,=0A=20=20=
=20=20=20=20default_display_type=20=3D=20v_default_display_type,=0A=20=20=
=20=20=20=20priority=20=3D=20v_priority,=0A=20=20=20=20=20=20=
auto_startup=20=3D=20v_auto_startup,=0A=20=20=20=20=20=20is_stateless=20=
=3D=20v_is_stateless,=0A=20=20=20=20=20=20iso_path=20=3D=20v_iso_path,=0A=
=20=20=20=20=20=20origin=20=3D=20v_origin,=0A=20=20=20=20=20=20=
initrd_url=20=3D=20v_initrd_url,=0A=20=20=20=20=20=20kernel_url=20=3D=20=
v_kernel_url,=0A=20=20=20=20=20=20kernel_params=20=3D=20v_kernel_params,=0A=
=20=20=20=20=20=20_update_date=20=3D=20CURRENT_TIMESTAMP,=0A=20=20=20=20=20=
=20quota_id=20=3D=20v_quota_id,=0A=20=20=20=20=20=20migration_support=20=
=3D=20v_migration_support,=0A=20=20=20=20=20=20dedicated_vm_for_vds=20=3D=20=
v_dedicated_vm_for_vds,=0A=20=20=20=20=20=20is_smartcard_enabled=20=3D=20=
v_is_smartcard_enabled,=0A=20=20=20=20=20=20is_delete_protected=20=3D=20=
v_is_delete_protected,=0A=20=20=20=20=20=20sso_method=20=3D=20=
v_sso_method,=0A=20=20=20=20=20=20is_disabled=20=3D=20v_is_disabled,=0A=20=
=20=20=20=20=20tunnel_migration=20=3D=20v_tunnel_migration,=0A=20=20=20=20=
=20=20vnc_keyboard_layout=20=3D=20v_vnc_keyboard_layout,=0A=20=20=20=20=20=
=20min_allocated_mem=20=3D=20v_min_allocated_mem,=0A=20=20=20=20=20=20=
is_run_and_pause=20=3D=20v_is_run_and_pause,=0A=20=20=20=20=20=20=
created_by_user_id=20=3D=20v_created_by_user_id,=0A=20=20=20=20=20=20=
migration_downtime=20=3D=20v_migration_downtime,=0A=20=20=20=20=20=20=
template_version_name=20=3D=20v_template_version_name,=0A=20=20=20=20=20=20=
serial_number_policy=20=3D=20v_serial_number_policy,=0A=20=20=20=20=20=20=
custom_serial_number=20=3D=20v_custom_serial_number,=0A=20=20=20=20=20=20=
is_boot_menu_enabled=20=3D=20v_is_boot_menu_enabled,=0A=20=20=20=20=20=20=
is_spice_file_transfer_enabled=20=3D=20v_is_spice_file_transfer_enabled,=0A=
=20=20=20=20=20=20is_spice_copy_paste_enabled=20=3D=20=
v_is_spice_copy_paste_enabled,=0A=20=20=20=20=20=20cpu_profile_id=20=3D=20=
v_cpu_profile_id,=0A=20=20=20=20=20=20numatune_mode=20=3D=20=
v_numatune_mode,=0A=20=20=20=20=20=20is_auto_converge=20=3D=20=
v_is_auto_converge,=0A=20=20=20=20=20=20is_migrate_compressed=20=3D=20=
v_is_migrate_compressed,=0A=20=20=20=20=20=20predefined_properties=20=3D=20=
v_predefined_properties,=0A=20=20=20=20=20=20userdefined_properties=20=3D=20=
v_userdefined_properties,=0A=20=20=20=20=20=20custom_emulated_machine=20=
=3D=20v_custom_emulated_machine,=0A=20=20=20=20=20=20custom_cpu_name=20=3D=
=20v_custom_cpu_name,=0A=20=20=20=20=20=20small_icon_id=20=3D=20=
v_small_icon_id,=0A=20=20=20=20=20=20large_icon_id=20=3D=20=
v_large_icon_id,=0A=20=20=20=20=20=20console_disconnect_action=20=3D=20=
v_console_disconnect_action,=0A=20=20=20=20=20=20=
custom_compatibility_version=20=3D=20v_custom_compatibility_version,=0A=20=
=20=20=20=20=20migration_policy_id=20=3D=20v_migration_policy_id=0A=20=20=
=20=20=20=20WHERE=20vm_guid=20=3D=20v_vmt_guid=0A=20=20=20=20=20=20=20=20=
=20=20AND=20entity_type=20=3D=20v_template_type;=0A=0A=20=20=20=20=20=20=
--=20update=20template=20versions=20to=20new=20name=0A=20=20=20=20=20=20=
UPDATE=20vm_static=0A=20=20=20=20=20=20=20=20SET=20vm_name=20=3D=20=
v_name=0A=20=20=20=20=20=20WHERE=20vm_guid=20<>=20v_vmt_guid=0A=20=20=20=20=
=20=20=20=20=20=20AND=20vmt_guid=20=3D=20v_vmt_guid=0A=20=20=20=20=20=20=20=
=20=20=20AND=20entity_type=20=3D=20v_template_type;=0A=0A=20=20=20=20=20=20=
--=20Update=20connections=20to=20dedicated=20hosts=0A=20=20=20=20=20=20=
PERFORM=20UpdateDedicatedHostsToVm(v_vmt_guid,=20=
v_dedicated_vm_for_vds);=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20UpdateVmTemplateStatus(=0A=
=20=20=20=20=20=20=20=20v_vmt_guid=20UUID,=0A=20=20=20=20=20=20=20=20=
v_status=20INTEGER)=0ARETURNS=20VOID=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=
=20=20=20=20=20=20UPDATE=20vm_static=0A=20=20=20=20=20=20SET=20=20=20=20=
template_status=20=3D=20v_status=0A=20=20=20=20=20=20WHERE=20=20vm_guid=20=
=3D=20v_vmt_guid;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
UpdateVmTemplateShiftBaseTemplate(v_base_template_id=20UUID)=0ARETURNS=20=
VOID=0A=20=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20UPDATE=20=
vm_static=0A=20=20=20=20SET=20vmt_guid=20=3D=20(SELECT=20vm_guid=0A=20=20=
=20=20=20=20=20=20FROM=20vm_static=0A=20=20=20=20=20=20=20=20WHERE=20=
entity_type=20=3D=20'TEMPLATE'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
vmt_guid=20=3D=20v_base_template_id=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
template_version_number=0A=20=20=20=20=20=20=20=20OFFSET=201=0A=20=20=20=20=
=20=20=20=20LIMIT=201=0A=20=20=20=20)=0A=20=20=20=20WHERE=20entity_type=20=
=3D=20'TEMPLATE'=0A=20=20=20=20=20=20=20=20AND=20vmt_guid=20=3D=20=
v_base_template_id=0A=20=20=20=20=20=20=20=20AND=20vm_guid=20!=3D=20=
vmt_guid;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
DeleteVmTemplates(v_vmt_guid=20UUID)=0ARETURNS=20VOID=0A=20=20=20AS=20=
$procedure$=0A=20=20=20DECLARE=0A=20=20=20v_val=20=20UUID;=0ABEGIN=0A=20=20=
=20=20=20=20=20=20--=20Get=20(and=20keep)=20a=20shared=20lock=20with=20=
"right=20to=20upgrade=20to=20exclusive"=0A=20=20=20=20=20=20=20=20--=20=
in=20order=20to=20force=20locking=20parent=20before=20children=0A=20=20=20=
=20=20=20SELECT=20=20=20vm_guid=20INTO=20v_val=0A=20=20=20=20=20=20FROM=20=
vm_static=0A=20=20=20=20=20=20WHERE=20vm_guid=20=3D=20v_vmt_guid=0A=20=20=
=20=20=20=20FOR=20UPDATE;=0A=0A=20=20=20=20=20=20DELETE=20FROM=20=
vm_static=0A=20=20=20=20=20=20WHERE=20vm_guid=20=3D=20v_vmt_guid;=0A=20=20=
=20=20=20=20--=20delete=20Template=20permissions=20--=0A=20=20=20=20=20=20=
DELETE=20FROM=20permissions=0A=20=20=20=20=20=20WHERE=20object_id=20=3D=20=
v_vmt_guid;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetAllFromVmTemplates(v_user_id=20UUID,=20v_is_filtered=20boolean,=20=
v_entity_type=20VARCHAR(32))=20RETURNS=20SETOF=20vm_templates_based_view=20=
STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20=20=20RETURN=20=
QUERY=0A=20=20=20=20=20=20SELECT=20vm_templates.*=0A=20=20=20=20=20=20=
FROM=20vm_templates_based_view=20vm_templates=0A=20=20=20=20=20=20WHERE=20=
entity_type=20=3D=20v_entity_type=0A=20=20=20=20=20=20=20=20=20=20AND=20=
(NOT=20v_is_filtered=20OR=20EXISTS=20(SELECT=201=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20FROM=20=20=20user_vm_template_permissions_view=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=20user_id=20=3D=20v_user_id=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=
=3D=20vmt_guid))=0A=20=20=20=20=20=20ORDER=20BY=20name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetVmTemplatesWithoutIcon()=20RETURNS=20SETOF=20=
vm_templates_view=20STABLE=0AAS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=0A=
=20=20=20SELECT=20vm_template.*=0A=20=20=20FROM=20vm_templates_view=20AS=20=
vm_template=0A=20=20=20WHERE=20small_icon_id=20IS=20NULL=20OR=20=
large_icon_id=20IS=20NULL;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20GetTemplateCount()=20=
RETURNS=20SETOF=20BIGINT=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=
=20=20=20=20=20RETURN=20QUERY=0A=20=20=20=20=20=20SELECT=20count=20=
(vm_templates.*)=0A=20=20=20=20=20=20FROM=20vm_templates_based_view=20=
vm_templates;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmTemplatesByIds(v_vm_templates_ids=20VARCHAR(5000))=20RETURNS=20=
SETOF=20vm_templates_based_view=20STABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0ARETURN=20QUERY=0A=20=20=20SELECT=20vm_templates.*=0A=20=20=20=
FROM=20vm_templates_based_view=20vm_templates=0A=20=20=20WHERE=20=
vm_templates.vmt_guid=20IN=20(SELECT=20*=20FROM=20=
fnSplitterUuid(v_vm_templates_ids));=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
getAllVmTemplatesRelatedToQuotaId(v_quota_id=20UUID)=20RETURNS=20SETOF=20=
vm_templates_based_view=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=
=20=20=20=20=20RETURN=20QUERY=0A=20=20=20=20=20=20SELECT=20=
vm_templates.*=0A=20=20=20=20=20=20FROM=20vm_templates_based_view=20=
vm_templates=0A=20=20=20=20=20=20WHERE=20quota_id=20=3D=20v_quota_id=0A=20=
=20=20=20=20=20UNION=0A=20=20=20=20=20=20SELECT=20DISTINCT=20=
vm_templates.*=0A=20=20=20=20=20=20FROM=20vm_templates_based_view=20=
vm_templates=0A=20=20=20=20=20=20INNER=20JOIN=20vm_device=20vd=20ON=20=
vd.vm_id=20=3D=20vm_templates.vmt_guid=0A=20=20=20=20=20=20INNER=20JOIN=20=
images=20ON=20images.image_group_id=20=3D=20vd.device_id=20AND=20=
images.active=20=3D=20TRUE=0A=20=20=20=20=20=20INNER=20JOIN=20=
image_storage_domain_map=20ON=20image_storage_domain_map.image_id=20=3D=20=
images.image_guid=0A=20=20=20=20=20=20WHERE=20=
image_storage_domain_map.quota_id=20=3D=20v_quota_id;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetVmTemplateByVmtGuid(v_vmt_guid=20UUID,=20=
v_user_id=20UUID,=20v_is_filtered=20boolean)=20RETURNS=20SETOF=20=
vm_templates_based_view=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=
=20=20=20=20=20RETURN=20QUERY=0A=20=20=20=20=20=20SELECT=20=
vm_templates.*=0A=20=20=20=20=20=20FROM=20vm_templates_based_view=20=
vm_templates=0A=20=20=20=20=20=20WHERE=20vmt_guid=20=3D=20v_vmt_guid=0A=20=
=20=20=20=20=20=20=20=20=20AND=20(NOT=20v_is_filtered=20OR=20EXISTS=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20FROM=20=20=20user_vm_template_permissions_view=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=20user_id=20=3D=20=
v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
entity_id=20=3D=20v_vmt_guid));=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmTemplateByVmtName(v_storage_pool_id=20UUID,=20v_vmt_name=20=
VARCHAR(255),=20v_user_id=20UUID,=20v_is_filtered=20boolean)=20RETURNS=20=
SETOF=20vm_templates_based_view=20STABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20=20=20RETURN=20QUERY=0A=20=20=20=20=20=20SELECT=20=
vm_templates.*=0A=20=20=20=20=20=20FROM=20vm_templates_based_view=20=
vm_templates=0A=20=20=20=20=20=20WHERE=20name=20=3D=20v_vmt_name=0A=20=20=
=20=20=20=20=20=20=20=20AND=20=20=20(v_storage_pool_id=20is=20null=20OR=20=
storage_pool_id=20=3D=20v_storage_pool_id=20OR=20storage_pool_id=20is=20=
null)=0A=20=20=20=20=20=20=20=20=20=20AND=20(NOT=20v_is_filtered=20OR=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=20=20=
user_vm_template_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20entity_id=20=3D=20vmt_guid))=0A=20=20=20=20=20=
=20ORDER=20BY=20vm_templates.template_version_number=20DESC;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetVmTemplateByClusterId(v_cluster_id=20UUID)=20=
RETURNS=20SETOF=20vm_templates_based_view=20STABLE=0A=20=20=20AS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20=20RETURN=20QUERY=0A=20=20=20=20=20=20=
SELECT=20vm_templates.*=0A=20=20=20=20=20=20FROM=20=
vm_templates_based_view=20vm_templates=0A=20=20=20=20=20=20WHERE=20=
cluster_id=20=3D=20v_cluster_id;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmTemplatesByStoragePoolId(v_storage_pool_id=20UUID)=20RETURNS=20=
SETOF=20vm_templates_based_view=20STABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20=20=20RETURN=20QUERY=0A=20=20=20=20=20=20SELECT=20=
DISTINCT=20vm_templates.*=0A=20=20=20=20=20=20FROM=20=
vm_templates_based_view=20vm_templates=0A=20=20=20=20=20=20WHERE=20=
vm_templates.storage_pool_id=20=3D=20v_storage_pool_id;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20GetVmTemplatesByImageId(v_image_guid=20UUID)=20=
RETURNS=20SETOF=20vm_templates_based_with_plug_info=20STABLE=0A=20=20=20=
AS=20$procedure$=0ABEGIN=0A=20=20=20=20=20=20RETURN=20QUERY=0A=20=20=20=20=
=20=20SELECT=20*=0A=20=20=20=20=20=20FROM=20=
vm_templates_based_with_plug_info=20t=0A=20=20=20=20=20=20WHERE=20=
t.image_guid=20=3D=20v_image_guid;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmTemplatesByStorageDomainId(v_storage_domain_id=20UUID,=20v_user_id=20=
UUID,=20v_is_filtered=20boolean)=20RETURNS=20SETOF=20=
vm_templates_based_view=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=
=20=20=20=20=20RETURN=20QUERY=0A=20=20=20=20=20=20SELECT=20DISTINCT=20=
vm_templates.*=0A=20=20=20=20=20=20FROM=20vm_templates_based_view=20=
vm_templates=0A=20=20=20=20=20=20INNER=20JOIN=20vm_device=20vd=20ON=20=
vd.vm_id=20=3D=20vm_templates.vmt_guid=0A=20=20=20=20=20=20INNER=20JOIN=20=
images=20i=20ON=20i.image_group_id=20=3D=20vd.device_id=20AND=20i.active=20=
=3D=20TRUE=0A=20=20=20=20=20=20WHERE=20i.image_guid=20in(=0A=20=20=20=20=20=
=20=20=20=20=20SELECT=20image_id=0A=20=20=20=20=20=20=20=20=20=20FROM=20=
image_storage_domain_map=0A=20=20=20=20=20=20=20=20=20=20WHERE=20=
storage_domain_id=20=3D=20v_storage_domain_id)=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20AND=20(NOT=20v_is_filtered=20OR=20EXISTS=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=20=20=
user_vm_template_permissions_view=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20=20user_id=20=3D=20v_user_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20entity_id=20=3D=20=
vm_templates.vmt_guid));=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_perms_get_templates_with_permitted_action(v_user_id=20UUID,=20=
v_action_group_id=20integer)=20RETURNS=20SETOF=20vm_templates_based_view=20=
STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20=20=20RETURN=20=
QUERY=20SELECT=20vm_templates_based_view.*=0A=20=20=20=20=20=20FROM=20=
vm_templates_based_view,=20user_vm_template_permissions_view=0A=20=20=20=20=
=20=20WHERE=20vm_templates_based_view.vmt_guid=20=3D=20=
user_vm_template_permissions_view.entity_id=0A=20=20=20=20=20=20=20=20=20=
=20AND=20user_vm_template_permissions_view.user_id=20=3D=20v_user_id=0A=20=
=20=20=20=20=20=20=20=20=20AND=20(SELECT=20get_entity_permissions(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20v_user_id,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20v_action_group_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20vm_templates_based_view.vmt_guid,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=204)=20IS=20NOT=20NULL);=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmTemplatesByNetworkId(v_network_id=20UUID)=20RETURNS=20SETOF=20=
vm_templates_based_view=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=
=20=20RETURN=20QUERY=20SELECT=20*=0A=20=20=20FROM=20=
vm_templates_based_view=0A=20=20=20WHERE=20EXISTS=20(=0A=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20FROM=20vm_interface=0A=20=20=20=20=20=20=
INNER=20JOIN=20vnic_profiles=0A=20=20=20=20=20=20ON=20vnic_profiles.id=20=
=3D=20vm_interface.vnic_profile_id=0A=20=20=20=20=20=20WHERE=20=
vnic_profiles.network_id=20=3D=20v_network_id=0A=20=20=20=20=20=20=20=20=20=
=20AND=20vm_interface.vmt_guid=20=3D=20=
vm_templates_based_view.vmt_guid);=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetVmTemplatesByVnicProfileId(v_vnic_profile_id=20UUID)=20RETURNS=20=
SETOF=20vm_templates_based_view=20STABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20RETURN=20QUERY=0A=20=20=20SELECT=20*=0A=20=20=20FROM=20=
vm_templates_based_view=0A=20=20=20WHERE=20EXISTS=20(=0A=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20FROM=20vm_interface=0A=20=20=20=20=20=20=
WHERE=20vm_interface.vnic_profile_id=20=3D=20v_vnic_profile_id=0A=20=20=20=
=20=20=20AND=20vm_interface.vmt_guid=20=3D=20=
vm_templates_based_view.vmt_guid);=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
GetTemplateVersionsForBaseTemplate(v_base_template_id=20UUID)=20RETURNS=20=
SETOF=20vm_templates_based_view=20STABLE=0AAS=20$procedure$=0ABEGIN=0A=20=
=20=20RETURN=20QUERY=0A=20=20=20SELECT=20*=0A=20=20=20FROM=20=
vm_templates_based_view=0A=20=20=20WHERE=20base_template_id=20=3D=20=
v_base_template_id=0A=20=20=20=20=20=20=20AND=20vmt_guid=20!=3D=20=
v_base_template_id=0A=20=20=20ORDER=20BY=20template_version_number=20=
desc;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
GetTemplateWithLatestVersionInChain(v_template_id=20UUID)=20RETURNS=20=
SETOF=20vm_templates_based_view=20STABLE=0AAS=20$procedure$=0ABEGIN=0A=20=
=20=20RETURN=20QUERY=0A=20=20=20SELECT=20*=0A=20=20=20FROM=20=
vm_templates_based_view=0A=20=20=20WHERE=20base_template_id=20=3D=0A=20=20=
=20=20=20=20(SELECT=20vmt_guid=0A=20=20=20=20=20=20=20FROM=20vm_static=0A=
=20=20=20=20=20=20=20WHERE=20vm_guid=20=3D=20v_template_id)=0A=20=20=20=
ORDER=20BY=20template_version_number=20DESC=0A=20=20=20LIMIT=201;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20=
GetAllVmTemplatesWithDisksOnOtherStorageDomain(v_storage_domain_id=20=
UUID)=20RETURNS=20SETOF=20vm_templates_based_view=20STABLE=0AAS=20=
$procedure$=0ABEGIN=0ARETURN=20QUERY=20SELECT=20DISTINCT=20templates.*=0A=
=20=20=20=20=20=20FROM=20vm_templates_based_view=20templates=0A=20=20=20=20=
=20=20INNER=20JOIN=20(SELECT=20vm_static.vm_guid=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20FROM=20vm_static=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20INNER=20JOIN=20vm_device=20vd=20ON=20=
vd.vm_id=20=3D=20vm_static.vm_guid=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20INNER=20JOIN=20images=20i=20ON=20i.image_group_id=20=3D=20=
vd.device_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
INNER=20JOIN=20(SELECT=20image_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
image_storage_domain_map=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
image_storage_domain_map.storage_domain_id=20=3D=20v_storage_domain_id)=20=
isd_map=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20ON=20i.image_guid=20=3D=20isd_map.image_id=20=
WHERE=20entity_type=20=3D=20'TEMPLATE')=20=
vms_with_disks_on_storage_domain=20ON=20templates.vmt_guid=20=3D=20=
vms_with_disks_on_storage_domain.vm_guid=0A=20=20=20=20=20=20INNER=20=
JOIN=20vm_device=20vd=20ON=20vd.vm_id=20=3D=20templates.vmt_guid=0A=20=20=
=20=20=20=20INNER=20JOIN=20images=20i=20ON=20i.image_group_id=20=3D=20=
vd.device_id=0A=20=20=20=20=20=20INNER=20JOIN=20image_storage_domain_map=20=
on=20i.image_guid=20=3D=20image_storage_domain_map.image_id=0A=20=20=20=20=
=20=20WHERE=20image_storage_domain_map.storage_domain_id=20!=3D=20=
v_storage_domain_id;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetVmTemplatesByCpuProfileId(v_cpu_profile_id=20UUID)=0ARETURNS=20SETOF=20=
vm_templates_based_view=20STABLE=0AAS=20$procedure$=0ABEGIN=0A=20=20=20=20=
RETURN=20QUERY=20SELECT=20vm_templates_based_view.*=0A=20=20=20=20=20=20=20=
=20FROM=20vm_templates_based_view=0A=20=20=20=20=20=20=20=20WHERE=20=
cpu_profile_id=20=3D=20v_cpu_profile_id;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetAllVmTemplatesRelatedToDiskProfile(v_disk_profile_id=20UUID)=0A=
RETURNS=20SETOF=20vm_templates_based_view=20STABLE=0AAS=20$procedure$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=20SELECT=20vm_templates.*=0A=20=20=20=20=
=20=20=20=20FROM=20vm_templates_based_view=20vm_templates=0A=20=20=20=20=20=
=20=20=20INNER=20JOIN=20vm_device=20vd=20ON=20vd.vm_id=20=3D=20=
vm_templates.vmt_guid=0A=20=20=20=20=20=20=20=20INNER=20JOIN=20images=20=
ON=20images.image_group_id=20=3D=20vd.device_id=0A=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20images.active=20=3D=20TRUE=0A=20=20=20=20=20=20=20=20=
INNER=20JOIN=20image_storage_domain_map=20ON=20=
image_storage_domain_map.image_id=20=3D=20images.image_guid=0A=20=20=20=20=
=20=20=20=20WHERE=20image_storage_domain_map.disk_profile_id=20=3D=20=
v_disk_profile_id;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_add_column=20(=0A=20=
=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=20v_column=20VARCHAR(128),=0A=
=20=20=20=20v_column_def=20TEXT=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20=
ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20column_name=20ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20=
||=20v_table=20||=20'=20ADD=20COLUMN=20'=20||=20v_column=20||=20'=20'=20=
||=20v_column_def;=0A=0A=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=
=20=20END;=0AEND=0A=0AIF=20;END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_drop_column=20(=0A=20=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=20=
v_column=20VARCHAR(128)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20=
v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20column_name=20ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20=
v_table=20||=20'=20DROP=20COLUMN=20'=20||=20v_column;=0A=0A=20=20=20=20=20=
=20=20=20EXECUTE=20v_sql;=0A=20=20=20=20END;=0A=20=20=20=20ELSE=0A=20=20=20=
=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20Column=20%=20does=20=
not=20exist.',=0A=20=20=20=20=20=20=20=20=20=20=20=20v_table,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20v_column;=0A=20=20=20=20END=20IF;=0A=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_change_column_type=20(=0A=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20v_column=20VARCHAR(128),=0A=20=20=20=20=
v_type=20VARCHAR(128),=0A=20=20=20=20v_new_type=20VARCHAR(128)=0A=20=20=20=
=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=0A=
BEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20information_schema.columns=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20table_schema=20=3D=
=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20table_name=20ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20column_name=20ilike=20v_column=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20udt_name=20=
ilike=20v_type=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20OR=20data_type=20ilike=20v_type=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20=
THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20ALTER=20COLUMN=20'=20||=20v_column=20=
||=20'=20TYPE=20'=20||=20v_new_type;=0A=0A=20=20=20=20=20=20=20=20=
EXECUTE=20v_sql;=0A=20=20=20=20END;=0A=0A=20=20=20=20---=20ignore=20=
operation=20if=20requested=20type=20is=20already=20there=0A=20=20=20=20=
ELSIF(NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20v_table=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20column_name=20=
ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20AND=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20udt_name=20ilike=20v_new_type=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20OR=20data_type=20ilike=20=
v_new_type=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20))=20=
THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20RAISE=20=
EXCEPTION=20'Table=20%=20or=20Column=20%=20does=20not=20exist.',=20=
v_table,=20v_column;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_rename_column=20(=0A=20=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=
=20v_column=20VARCHAR(128),=0A=20=20=20=20v_new_name=20VARCHAR(128)=0A=20=
=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20v_sql=20TEXT;=0A=
=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20v_table=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20column_name=20=
ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=
=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20=
RENAME=20COLUMN=20'=20||=20v_column=20||=20'=20TO=20'=20||=20v_new_name;=0A=
=0A=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=20=20END;=0A=20=20=20=
=20ELSE=0A=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20=
Column=20%=20does=20not=20exist.',=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_table,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_column;=0AEND=0A=0AIF=20=
;END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_rename_table=20(=0A=
=20=20=20=20v_table=20VARCHAR(128),=0A=20=20=20=20v_new_name=20=
VARCHAR(128)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
DECLARE=20v_sql=20TEXT;=0A=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ilike=20v_table=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20RENAME=20TO=20=
'=20||=20v_new_name;=0A=0A=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=
=20=20END;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20RAISE=20=
EXCEPTION=20'Table=20%=20does=20not=20exist.',=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_table;=0AEND=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_add_config_value=20=
(=0A=20=20=20=20v_option_name=20VARCHAR(100),=0A=20=20=20=20=
v_option_value=20VARCHAR(4000),=0A=20=20=20=20v_version=20VARCHAR(40)=0A=20=
=20=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20=20=20=20=20INSERT=20INTO=20vdc_options=20(=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20option_name,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20option_value,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20END;=0A=20=20=20=20END=20IF;=0A=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_delete_config_value_all_versions=20=
(v_option_name=20VARCHAR(100))=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
BEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20BEGIN=0A=
=20=20=20=20=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
option_name=20ilike=20v_option_name;=0A=20=20=20=20=20=20=20=20END;=0A=20=
=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_delete_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_version=20TEXT=0A=20=20=20=20)=0ARETURNS=20=
void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20version=20IN=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitter(v_version)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20=20=20=20=20DELETE=0A=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20version=20IN=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20FROM=20fnSplitter(v_version)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=20=20=20=20=20=20=
=20=20END;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_delete_config_for_version=20(v_version=20TEXT)=0ARETURNS=20void=20=
AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20DELETE=0A=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20WHERE=20version=20IN=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=20ID=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
fnSplitter(v_version)=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
END;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_update_config_value=20(=0A=20=20=20=20=
v_option_name=20VARCHAR(100),=0A=20=20=20=20v_option_value=20=
VARCHAR(4000),=0A=20=20=20=20v_version=20VARCHAR(40)=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=
=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=
=20=20=20=20=20UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
SET=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20=
=20=20=20=20END;=0A=20=20=20=20END=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_update_default_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_default_option_value=20VARCHAR(4000),=0A=20=
=20=20=20v_option_value=20VARCHAR(4000),=0A=20=20=20=20v_version=20=
VARCHAR(40),=0A=20=20=20=20v_ignore_default_value_case=20boolean=0A=20=20=
=20=20)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=
=20=20=20=20=20=20=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20v_version=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20=
(v_ignore_default_value_case)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20option_value=20ilike=20v_default_option_value=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=20=20=
=20=20UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20option_name=20ilike=20v_option_name=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20option_value=20=3D=20v_default_option_value=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20END=20IF;=0A=0A=20=20=20=20END;=0A=20=
=20=20=20END=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_db_rename_config_key=20(=0A=20=20=20=20=20=20=20=20v_old_option_name=20=
VARCHAR(100),=0A=20=20=20=20=20=20=20=20v_new_option_name=20=
VARCHAR(100),=0A=20=20=20=20=20=20=20=20v_version=20VARCHAR(40)=0A=20=20=20=
=20=20=20=20=20)=0A=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=
=20=20=20DECLARE=20v_current_option_value=20VARCHAR(4000);=0A=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20v_old_option_name=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20version=20=3D=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20v_current_option_value:=3D=20=
option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=
=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_old_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
version=20=3D=20v_version;=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20=
UPDATE=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20SET=20=
option_name=20=3D=20v_new_option_name,=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20option_value=20=3D=20v_current_option_value=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20option_name=20ilike=20=
v_old_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20=20=20=20=20END=20=
IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_db_create_constraint=20(=0A=20=20=20=20=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_constraint=20VARCHAR(128),=0A=20=
=20=20=20=20=20=20=20v_constraint_sql=20TEXT=0A=20=20=20=20=20=20=20=20)=0A=
=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20IF=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_constraint=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20conname=20ilike=20v_constraint=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20EXECUTE=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ADD=20CONSTRAINT=20'=20||=20=
v_constraint=20||=20'=20'=20||=20v_constraint_sql;=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20fn_db_drop_constraint=20(=0A=20=20=20=20=20=20=20=20v_table=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_constraint=20VARCHAR(128)=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20RETURNS=20void=20AS=20$PROCEDURE$=0A=
=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20FROM=20pg_constraint=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20WHERE=20conname=20ilike=20v_constraint=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=
=20=20=20=20EXECUTE=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20DROP=20=
CONSTRAINT=20'=20||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=20=20=
=20=20=20END=20IF;=0A=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
replace=20FUNCTION=20CheckDBConnection=20()=0A=20=20=20=20RETURNS=20=
SETOF=20INT=20IMMUTABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=
=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
1;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax=20()=0A=20=20=20=20RETURNS=20SETOF=20=
TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=0A=20=20=
=20=20=20=20=20=20FROM=20pg_proc=0A=20=20=20=20=20=20=20=20INNER=20JOIN=20=
pg_namespace=20ns=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20=
(pg_proc.pronamespace=20=3D=20ns.oid)=0A=20=20=20=20=20=20=20=20WHERE=20=
ns.nspname=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
proname;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
generate_drop_all_views_syntax=20()=0A=20=20=20=20RETURNS=20SETOF=20TEXT=20=
STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20'DROP=20VIEW=20if=20=
exists=20'=20||=20table_name=20||=20'=20CASCADE;'=0A=20=20=20=20=20=20=20=
=20FROM=20information_schema.VIEWS=0A=20=20=20=20=20=20=20=20WHERE=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
table_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20generate_drop_all_tables_syntax=20()=0A=20=20=20=20RETURNS=20=
SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20BEGIN=0A=20=20=20=
=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=20SELECT=20=
'DROP=20TABLE=20if=20exists=20'=20||=20table_name=20||=20'=20CASCADE;'=0A=
=20=20=20=20=20=20=20=20FROM=20information_schema.tables=0A=20=20=20=20=20=
=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20table_type=20=3D=20'BASE=20TABLE'=0A=20=20=20=20=20=20=20=
=20ORDER=20BY=20table_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
replace=20FUNCTION=20generate_drop_all_seq_syntax=20()=0A=20=20=20=20=
RETURNS=20SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20'DROP=20SEQUENCE=20if=20exists=20'=20||=20sequence_name=20||=20=
'=20CASCADE;'=0A=20=20=20=20=20=20=20=20FROM=20=
information_schema.sequences=0A=20=20=20=20=20=20=20=20WHERE=20=
sequence_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20ORDER=20BY=20=
sequence_name;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20generate_drop_all_user_types_syntax=20()=0A=20=20=20=20=
RETURNS=20SETOF=20TEXT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
BEGIN=0A=20=20=20=20=20=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20=20=20=20=
=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20=20=20=20=20=20FROM=20pg_namespace=20n,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20pg_class=20c,=0A=20=20=20=20=20=20=20=20=20=20=20=20pg_type=20t=0A=20=
=20=20=20=20=20=20=20WHERE=20n.oid=20=3D=20c.relnamespace=0A=20=20=20=20=20=
=20=20=20=20=20=20=20AND=20t.typrelid=20=3D=20c.oid=0A=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20c.relkind=20=3D=20'c'::"char"=0A=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20n.nspname=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
ORDER=20BY=20c.relname::information_schema.sql_identifier;=0A=20=20=20=20=
END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20FUNCTION=20=
fn_get_column_size=20(=0A=20=20=20=20=20=20=20=20v_table=20VARCHAR(64),=0A=
=20=20=20=20=20=20=20=20v_column=20VARCHAR(64)=0A=20=20=20=20=20=20=20=20=
)=0A=20=20=20=20RETURNS=20INT=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20=
DECLARE=20retvalue=20INT;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=
retvalue=20:=3D=20character_maximum_length=0A=20=20=20=20=20=20=20=20=
FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20WHERE=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
table_name=20ilike=20v_table=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
column_name=20ilike=20v_column=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
udt_name=20IN=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
'char',=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'varchar'=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=
=20RETURN=20retvalue;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20=
REPLACE=20FUNCTION=20attach_user_to_role=20(=0A=20=20=20=20=20=20=20=20=
v_user_name=20VARCHAR(255),=0A=20=20=20=20=20=20=20=20v_domain=20=
VARCHAR(255),=0A=20=20=20=20=20=20=20=20v_namespace=20VARCHAR(255),=0A=20=
=20=20=20=20=20=20=20v_domain_entry_id=20TEXT,=0A=20=20=20=20=20=20=20=20=
v_role_name=20VARCHAR(255)=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$BODY$=0A=0A=20=20=20=20DECLARE=20selected_user_id=20=
uuid;=0A=0A=20=20=20=20input_role_id=20uuid;=0A=0A=20=20=20=20BEGIN=0A=20=
=20=20=20=20=20=20=20SELECT=20roles.id=0A=20=20=20=20=20=20=20=20INTO=20=
input_role_id=0A=20=20=20=20=20=20=20=20FROM=20roles=0A=20=20=20=20=20=20=
=20=20WHERE=20roles.name=20=3D=20v_role_name;=0A=0A=20=20=20=20=20=20=20=20=
--=20The=20external=20identifier=20is=20the=20user=20identifier=20=
converted=20to=20an=20array=20of=0A=20=20=20=20=20=20=20=20--=20bytes:=0A=
=20=20=20=20=20=20=20=20INSERT=20INTO=20users=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20user_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
external_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20namespace,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
domain,=0A=20=20=20=20=20=20=20=20=20=20=20=20username,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20last_admin_check_status=0A=20=20=20=20=20=20=20=20=20=
=20=20=20)=0A=20=20=20=20=20=20=20=20SELECT=20uuid_generate_v1(),=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_domain_entry_id,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_namespace,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_user_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20v_domain,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20v_user_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
true=0A=20=20=20=20=20=20=20=20WHERE=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20FROM=20users=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20domain=20=3D=20v_domain=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20external_id=20=3D=20=
v_domain_entry_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=0A=20=20=20=20=20=20=20=20SELECT=20user_id=0A=20=20=20=20=20=20=20=20=
FROM=20users=0A=20=20=20=20=20=20=20=20WHERE=20domain=20=3D=20v_domain=0A=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20external_id=20=3D=20=
v_domain_entry_id=0A=20=20=20=20=20=20=20=20INTO=20selected_user_id;=0A=0A=
=20=20=20=20=20=20=20=20INSERT=20INTO=20permissions=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20id,=0A=20=20=20=20=20=20=20=20=20=20=20=20role_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20ad_element_id,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20object_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
object_type_id=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=
=20=20SELECT=20uuid_generate_v1(),=0A=20=20=20=20=20=20=20=20=20=20=20=20=
input_role_id,=0A=20=20=20=20=20=20=20=20=20=20=20=20selected_user_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20getGlobalIds('system'),=0A=20=20=20=20=
=20=20=20=20=20=20=20=201=0A=20=20=20=20=20=20=20=20WHERE=20NOT=20EXISTS=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20role_id,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ad_element_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20object_id,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
object_type_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
permissions=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20input_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20AND=20ad_element_id=20=3D=20selected_user_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20object_id=20=3D=20=
getGlobalIds('system')=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20object_type_id=20=3D=201=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20);=0A=20=20=20=20END;$BODY$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20=
FUNCTION=20fn_db_add_action_group_to_role=20(=0A=20=20=20=20=20=20=20=20=
v_role_id=20UUID,=0A=20=20=20=20=20=20=20=20v_action_group_id=20INT=0A=20=
=20=20=20=20=20=20=20)=0A=20=20=20=20RETURNS=20VOID=20AS=20$PROCEDURE$=0A=
=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20INSERT=20INTO=20=
roles_groups=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20role_id,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20action_group_id=0A=20=20=20=20=20=20=20=20=20=20=
=20=20)=0A=20=20=20=20=20=20=20=20SELECT=20v_role_id,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_action_group_id=0A=20=20=20=20=20=20=20=20WHERE=20=
NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
roles_groups=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20v_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20AND=20action_group_id=20=3D=20v_action_group_id=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=20=
RETURN;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20FUNCTION=20=
fn_db_split_config_value=20(=0A=20=20=20=20=20=20=20=20v_option_name=20=
VARCHAR,=0A=20=20=20=20=20=20=20=20v_old_option_value=20VARCHAR,=0A=20=20=
=20=20=20=20=20=20v_new_option_value=20VARCHAR,=0A=20=20=20=20=20=20=20=20=
v_update_from_version=20VARCHAR=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$BODY$=0A=0A=20=20=20=20DECLARE=20v_old_value=20=
VARCHAR(4000);=0A=0A=20=20=20=20v_cur=20CURSOR=0A=20=20=20=20FOR=0A=0A=20=
=20=20=20SELECT=20DISTINCT=20version=0A=20=20=20=20FROM=20vdc_options=0A=20=
=20=20=20WHERE=20version=20<>=20'general'=0A=20=20=20=20ORDER=20BY=20=
version;=0A=0A=20=20=20=20v_version=20VARCHAR(40);=0A=0A=20=20=20=20=
v_index=20INT;=0A=0A=20=20=20=20v_count=20INT;=0A=0A=20=20=20=20=
v_total_count=20INT;=0A=0A=20=20=20=20v_version_count=20INT;=0A=0A=20=20=20=
=20BEGIN=0A=20=20=20=20=20=20=20=20v_total_count=20:=3D=20count(version)=0A=
=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=
WHERE=20option_name=20=3D=20v_option_name;=0A=0A=20=20=20=20=20=20=20=20=
v_old_value=20:=3D=20option_value=0A=20=20=20=20=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20=20=20=20=20WHERE=20option_name=20=3D=20=
v_option_name=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20version=20=3D=20=
'general';=0A=0A=20=20=20=20=20=20=20=20v_version_count=20:=3D=20=
count(DISTINCT=20version)=0A=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=
=20=20=20=20=20=20=20=20WHERE=20version=20<>=20'general';=0A=0A=20=20=20=20=
=20=20=20=20IF=20(v_total_count=20<=3D=20v_version_count)=20THEN=0A=20=20=
=20=20=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20=20=20=20=20IF=20=
(v_old_value=20IS=20NULL)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20v_old_value=20:=3D=20v_old_option_value;=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=20=20=20=20=20=20=20=20v_count=20:=3D=20count(DISTINCT=20=
version)=0A=20=20=20=20=20=20=20=20FROM=20vdc_options=0A=20=20=20=20=20=20=
=20=20WHERE=20version=20<>=20'general';=0A=0A=20=20=20=20=20=20=20=20=
v_index=20:=3D=201;=0A=0A=20=20=20=20=20=20=20=20OPEN=20v_cur;=0A=0A=20=20=
=20=20=20=20=20=20LOOP=0A=0A=20=20=20=20=20=20=20=20=20=20=20=20FETCH=20=
v_cur=0A=20=20=20=20=20=20=20=20=20=20=20=20INTO=20v_version;=0A=0A=20=20=
=20=20=20=20=20=20=20=20=20=20EXIT=20when=20NOT=20found;=0A=0A=20=20=20=20=
=20=20=20=20=20=20=20=20--=20We=20shouldn't=20update=20if=20already=20=
exists=0A=20=20=20=20=20=20=20=20=20=20=20=20IF=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vdc_options=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20option_name=20=3D=20v_option_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
AND=20version=20=3D=20v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20--=20Might=20not=20work=20well=20for=20versions=20such=20as=20=
3.10,=20but=20we=20currently=20don't=20have=20any=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20IF=20(v_version=20>=3D=20=
v_update_from_version)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20INSERT=20INTO=20vdc_options=20(=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20option_name,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_new_option_value,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_version=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20INSERT=20INTO=20vdc_options=20=
(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20option_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20option_value,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20version=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_option_name,=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_old_value,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
v_version=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20END=20IF;=0A=
=0A=20=20=20=20=20=20=20=20=20=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20=
=20=20=20=20v_index=20:=3D=20v_index=20+=201;=0A=20=20=20=20=20=20=20=20=
END=20LOOP;=0A=0A=20=20=20=20CLOSE=20v_cur;=0A=0A=20=20=20=20DELETE=0A=20=
=20=20=20FROM=20vdc_options=0A=20=20=20=20WHERE=20option_name=20=3D=20=
v_option_name=0A=20=20=20=20=20=20=20=20AND=20version=20=3D=20'general';=0A=
=20=20=20=20END;=0AEND=20IF;=0A=0AEND;$BODY$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_grant_action_group_to_all_roles_filter=20(=0A=20=20=20=20=
v_action_group_id=20INT,=0A=20=20=20=20uuid=20[]=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$BODY$=0A=0ADECLARE=20v_role_id_to_filter=20alias=0A=
FOR=20$2;=0A=0ABEGIN=0A=20=20=20=20INSERT=20INTO=20roles_groups=20(=0A=20=
=20=20=20=20=20=20=20role_id,=0A=20=20=20=20=20=20=20=20action_group_id=0A=
=20=20=20=20=20=20=20=20)=0A=20=20=20=20SELECT=20DISTINCT=20role_id,=0A=20=
=20=20=20=20=20=20=20v_action_group_id=0A=20=20=20=20FROM=20roles_groups=20=
rg=0A=20=20=20=20WHERE=20NOT=20ARRAY=20[role_id]=20<@=20=
v_role_id_to_filter=0A=20=20=20=20=20=20=20=20AND=20NOT=20EXISTS=20(=0A=20=
=20=20=20=20=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20roles_groups=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
role_id=20=3D=20rg.role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20action_group_id=20=3D=20v_action_group_id=0A=20=20=20=20=20=20=20=
=20=20=20=20=20);=0AEND;$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_mask_object=20=
(v_object=20regclass)=0ARETURNS=20setof=20record=20AS=20$BODY$=0A=0A=
DECLARE=20v_sql=20TEXT;=0A=0Av_table=20record;=0A=0Av_table_name=20TEXT;=0A=
=0Atemprec=20record;=0A=0ABEGIN=0A=20=20=20=20--=20get=20full=20=
table/view=20name=20from=20v_object=20(i.e=20<namespace>.<name>)=0A=20=20=
=20=20SELECT=20c.relname,=0A=20=20=20=20=20=20=20=20n.nspname=0A=20=20=20=
=20INTO=20v_table=0A=20=20=20=20FROM=20pg_class=20c=0A=20=20=20=20INNER=20=
JOIN=20pg_namespace=20n=0A=20=20=20=20=20=20=20=20ON=20c.relnamespace=20=
=3D=20n.oid=0A=20=20=20=20WHERE=20c.oid=20=3D=20v_object;=0A=0A=20=20=20=20=
--=20try=20to=20get=20filtered=20query=20syntax=20from=20previous=20=
execution=0A=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
object_column_white_list_sql=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20=
object_name=20=3D=20v_table.relname=0A=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=0A=20=20=20=20=20=20=20=20SELECT=20sql=0A=20=20=20=20=20=20=20=20=
INTO=20v_sql=0A=20=20=20=20=20=20=20=20FROM=20=
object_column_white_list_sql=0A=20=20=20=20=20=20=20=20WHERE=20=
object_name=20=3D=20v_table.relname;=0A=20=20=20=20ELSE=0A=20=20=20=20=20=
=20=20=20v_table_name=20:=3D=20quote_ident(v_table.nspname)=20||=20'.'=20=
||=20quote_ident(v_table.relname);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20FOR=20temprec=20IN=0A=20=20=20=20SELECT=20a.attname,=0A=20=20=20=
=20=20=20=20=20t.typname=0A=20=20=20=20FROM=20pg_attribute=20a=0A=20=20=20=
=20INNER=20JOIN=20pg_type=20t=0A=20=20=20=20=20=20=20=20ON=20a.atttypid=20=
=3D=20t.oid=0A=20=20=20=20WHERE=20a.attrelid=20=3D=20v_object=0A=20=20=20=
=20=20=20=20=20AND=20a.attnum=20>=200=0A=20=20=20=20=20=20=20=20AND=20=
NOT=20a.attisdropped=0A=20=20=20=20ORDER=20BY=20a.attnum=20LOOP=20v_sql=20=
:=3D=20coalesce(v_sql=20||=20',=20',=20'SELECT=20');=0A=0A=20=20=20=20=20=
=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20=
1=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20object_column_white_list=0A=
=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20object_name=20=3D=20=
v_table.relname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
column_name=20=3D=20temprec.attname=0A=20=20=20=20=20=20=20=20=20=20=20=20=
)=20THEN=20v_sql=20:=3D=20v_sql=20||=20quote_ident(temprec.attname);=0A=20=
=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20=
:=3D=20v_sql=20||=20'NULL::'=20||=20quote_ident(temprec.typname)=20||=20=
'=20as=20'=20||=20quote_ident(temprec.attname);=0A=20=20=20=20=20=20=20=20=
END=20IF;=0A=0A=20=20=20=20END=20LOOP;=0A=0A=20=20=20=20v_sql=20:=3D=20=
v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=0A=20=20=20=20v_sql=20=
:=3D=20'SELECT=20x::'=20||=20v_table_name=20||=20'=20as=20rec=20FROM=20=
('=20||=20v_sql=20||=20')=20as=20x';=0A=0A=20=20=20=20--=20save=20=
generated=20query=20for=20further=20use=0A=20=20=20=20INSERT=20INTO=20=
object_column_white_list_sql=20(=0A=20=20=20=20=20=20=20=20object_name,=0A=
=20=20=20=20=20=20=20=20sql=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
VALUES=20(=0A=20=20=20=20=20=20=20=20v_table.relname,=0A=20=20=20=20=20=20=
=20=20v_sql=0A=20=20=20=20=20=20=20=20);=0A=20=20=20=20END=20IF;=0A=0A=20=
=20=20=20RETURN=20QUERY=0A=0A=20=20=20=20EXECUTE=20v_sql;=0AEND;$BODY$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_add_column_to_object_white_list=20(=0A=20=20=20=20v_object_name=20=
VARCHAR(128),=0A=20=20=20=20v_column_name=20VARCHAR(128)=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ABEGIN=0A=20=20=20=20IF=20(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20NOT=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20FROM=20object_column_white_list=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20WHERE=20object_name=20=3D=20v_object_name=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20column_name=20=3D=20=
v_column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=
=20=20=20=20=20=20=20=20=20=20)=20THEN=0A=20=20=20=20BEGIN=0A=20=20=20=20=
=20=20=20=20--=20verify=20that=20there=20is=20such=20object=20in=20db=0A=20=
=20=20=20=20=20=20=20IF=20EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20information_schema.columns=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20AND=20table_name=20=3D=20=
v_object_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20AND=20column_name=20=3D=20v_column_name=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20)=20THEN=0A=20=20=20=20=20=20=20=20=20=20=20=20INSERT=20=
INTO=20object_column_white_list=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20object_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20VALUES=20(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20v_object_name,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20v_column_name=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=
=20=20=20=20=20=20=20=20END=20IF;=0A=0A=20=20=20=20END;=0A=20=20=20=20=
END=20IF;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20REPLACE=20FUNCTION=20=
fn_db_is_table_exists=20(v_table=20VARCHAR(64))=0A=20=20=20=20RETURNS=20=
boolean=20STABLE=20AS=20$PROCEDURE$=0A=0A=20=20=20=20DECLARE=20retvalue=20=
boolean;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20retvalue=20:=3D=20=
EXISTS=20(=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20SELECT=20*=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20FROM=20=
information_schema.tables=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20WHERE=20table_schema=20=3D=20'public'=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20AND=20table_name=20ILIKE=20v_table=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=20=20=20=20=
RETURN=20retvalue;=0A=20=20=20=20END;$PROCEDURE$=0A=20=20=20=20LANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=0A=20=20=20=20=20=20=20=20OR=20replace=20=
FUNCTION=20fn_db_create_index=20(=0A=20=20=20=20=20=20=20=20v_index_name=20=
VARCHAR(128),=0A=20=20=20=20=20=20=20=20v_table_name=20VARCHAR(128),=0A=20=
=20=20=20=20=20=20=20v_column_names=20TEXT,=0A=20=20=20=20=20=20=20=20=
v_where_predicate=20TEXT=0A=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
RETURNS=20void=20AS=20$PROCEDURE$=0A=0A=20=20=20=20DECLARE=20v_sql=20=
TEXT;=0A=0A=20=20=20=20BEGIN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
'DROP=20INDEX=20'=20||=20'=20IF=20EXISTS=20'=20||=20v_index_name=20||=20=
';=20CREATE=20INDEX=20'=20||=20v_index_name=20||=20'=20ON=20'=20||=20=
v_table_name=20||=20'('=20||=20v_column_names=20||=20')';=0A=0A=20=20=20=20=
=20=20=20=20IF=20v_where_predicate=20=3D=20''=20THEN=20v_sql=20:=3D=20=
v_sql=20||=20';';ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
v_sql=20||=20'=20WHERE=20'=20||=20v_where_predicate=20||=20';';=0A=20=20=20=
=20END=20IF;=0A=0A=20=20=20=20EXECUTE=20v_sql;=0AEND;$PROCEDURE$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_unlock_disk=20(v_id=20UUID)=0ARETURNS=20void=20AS=20$PROCEDURE$=0A=
DECLARE=20OK=20INT;=0A=0ALOCKED=20INT;=0A=0ABEGIN=0A=20=20=20=20OK:=3D=20=
1;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20UPDATE=20images=0A=20=
=20=20=20SET=20imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=
=3D=20LOCKED=0A=20=20=20=20=20=20=20=20AND=20image_group_id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_snapshot=20=
(v_id=20UUID)=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20OK=20=
VARCHAR;=0A=0ALOCKED=20VARCHAR;=0A=0ABEGIN=0A=20=20=20=20OK:=3D=20'OK';=0A=
=0A=20=20=20=20LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20UPDATE=20=
snapshots=0A=20=20=20=20SET=20status=20=3D=20OK=0A=20=20=20=20WHERE=20=
status=20=3D=20LOCKED=0A=20=20=20=20=20=20=20=20AND=20snapshot_id=20=3D=20=
v_id;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_entity=20(=0A=
=20=20=20=20v_object_type=20VARCHAR(10),=0A=20=20=20=20v_name=20=
VARCHAR(255),=0A=20=20=20=20v_recursive=20boolean=0A=20=20=20=20)=0A=
RETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20DOWN=20INT;=0A=0AOK=20INT;=0A=
=0ALOCKED=20INT;=0A=0ATEMPLATE_OK=20INT;=0A=0ATEMPLATE_LOCKED=20INT;=0A=0A=
IMAGE_LOCKED=20INT;=0A=0ASNAPSHOT_OK=20VARCHAR;=0A=0ASNAPSHOT_LOCKED=20=
VARCHAR;=0A=0Av_id=20UUID;=0A=0ABEGIN=0A=20=20=20=20DOWN:=3D=200;=0A=0A=20=
=20=20=20OK:=3D=201;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20=
TEMPLATE_OK:=3D=200;=0A=0A=20=20=20=20TEMPLATE_LOCKED:=3D=201;=0A=0A=20=20=
=20=20IMAGE_LOCKED:=3D=2015;=0A=0A=20=20=20=20SNAPSHOT_OK:=3D=20'OK';=0A=0A=
=20=20=20=20SNAPSHOT_LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20v_id=20:=3D=20=
vm_guid=0A=20=20=20=20FROM=20vm_static=0A=20=20=20=20WHERE=20vm_name=20=3D=
=20v_name=0A=20=20=20=20=20=20=20=20AND=20entity_type=20ilike=20=
v_object_type;=0A=0A=20=20=20=20--=20set=20VM=20status=20to=20DOWN=0A=20=20=
=20=20IF=20(v_object_type=20=3D=20'vm')=20THEN=0A=20=20=20=20=20=20=20=20=
UPDATE=20vm_dynamic=0A=20=20=20=20=20=20=20=20SET=20status=20=3D=20DOWN=0A=
=20=20=20=20=20=20=20=20WHERE=20status=20=3D=20IMAGE_LOCKED=0A=20=20=20=20=
=20=20=20=20=20=20=20=20AND=20vm_guid=20=3D=20v_id;=0A=20=20=20=20=20=20=20=
=20=20=20=20=20--=20set=20Template=20status=20to=20OK=0A=20=20=20=20ELSE=20=
IF=20(v_object_type=20=3D=20'template')=20THEN=0A=20=20=20=20=20=20=20=20=
UPDATE=20vm_static=0A=20=20=20=20=20=20=20=20SET=20template_status=20=3D=20=
TEMPLATE_OK=0A=20=20=20=20=20=20=20=20WHERE=20template_status=20=3D=20=
TEMPLATE_LOCKED=0A=20=20=20=20=20=20=20=20=20=20=20=20AND=20vm_guid=20=3D=20=
v_id;=0A=20=20=20=20END=20IF;=0A=0AEND=20IF;=0A=20--unlock=20images=20=
and=20snapshots=20=20if=20recursive=20flag=20is=20set=0AIF=20=
(v_recursive)=20THEN=0A=20=20=20=20UPDATE=20images=0A=20=20=20=20SET=20=
imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=3D=20LOCKED=0A=
=20=20=20=20=20=20=20=20AND=20image_group_id=20IN=20(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20SELECT=20device_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=
FROM=20vm_device=0A=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20vm_id=20=3D=
=20v_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20=
is_plugged=0A=20=20=20=20=20=20=20=20=20=20=20=20);=0A=0A=20=20=20=20=
UPDATE=20snapshots=0A=20=20=20=20SET=20status=20=3D=20SNAPSHOT_OK=0A=20=20=
=20=20WHERE=20status=20ilike=20SNAPSHOT_LOCKED=0A=20=20=20=20=20=20=20=20=
AND=20vm_id=20=3D=20v_id;=0AEND=20IF;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_unlock_all=20=
()=0ARETURNS=20void=20AS=20$PROCEDURE$=0ADECLARE=20DOWN=20INT;=0A=0AOK=20=
INT;=0A=0ALOCKED=20INT;=0A=0ATEMPLATE_OK=20INT;=0A=0ATEMPLATE_LOCKED=20=
INT;=0A=0AIMAGE_LOCKED=20INT;=0A=0ASNAPSHOT_OK=20VARCHAR;=0A=0A=
SNAPSHOT_LOCKED=20VARCHAR;=0A=0ABEGIN=0A=20=20=20=20DOWN:=3D=200;=0A=0A=20=
=20=20=20OK:=3D=201;=0A=0A=20=20=20=20LOCKED:=3D=202;=0A=0A=20=20=20=20=
TEMPLATE_OK:=3D=200;=0A=0A=20=20=20=20TEMPLATE_LOCKED:=3D=201;=0A=0A=20=20=
=20=20IMAGE_LOCKED:=3D=2015;=0A=0A=20=20=20=20SNAPSHOT_OK:=3D=20'OK';=0A=0A=
=20=20=20=20SNAPSHOT_LOCKED:=3D=20'LOCKED';=0A=0A=20=20=20=20UPDATE=20=
vm_static=0A=20=20=20=20SET=20template_status=20=3D=20TEMPLATE_OK=0A=20=20=
=20=20WHERE=20template_status=20=3D=20TEMPLATE_LOCKED;=0A=0A=20=20=20=20=
UPDATE=20vm_dynamic=0A=20=20=20=20SET=20status=20=3D=20DOWN=0A=20=20=20=20=
WHERE=20status=20=3D=20IMAGE_LOCKED;=0A=0A=20=20=20=20UPDATE=20images=0A=20=
=20=20=20SET=20imagestatus=20=3D=20OK=0A=20=20=20=20WHERE=20imagestatus=20=
=3D=20LOCKED;=0A=0A=20=20=20=20UPDATE=20snapshots=0A=20=20=20=20SET=20=
status=20=3D=20SNAPSHOT_OK=0A=20=20=20=20WHERE=20status=20ilike=20=
SNAPSHOT_LOCKED;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A/*=20Displays=20DC=20id=20,=20DC=20name,=20SPM=20Host=20id=20=
,=20SPM=20Host=20name=20and=20number=20of=20async=20tasks=20awaiting.=0A=0A=
1)=20create=20a=20record=20type=20with=20DC=20name,=20DC=20id,=20SPM=20=
host=20id,=20SPM=20host=20name,=20count=0A=0A2)=20get=20all=20distinct=20=
DC=20ids=20from=20async_tasks=20table=0A=0A3)=20Run=20a=20cursor=20for=20=
each=20result=20in=202)=0A=0A=20=20=20a)=20get=20DC=20name=0A=20=20=20b)=20=
get=20SPM=20Host=20id=20&=20name=20if=20available=0A=20=20=20c)=20get=20=
count=20of=20tasks=0A=0A=20=20=20return=20current=20record=0A=0A4)=20=
return=20set=20of=20generated=20records=0A*/=0ADROP=20TYPE=20IF=20EXISTS=20=
async_tasks_info_rs=20CASCADE;=0A**************************=0A=0ADROP=20=
TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
async_tasks_info_rs=20AS=20(=0A=20=20=20=20=20=20=20=20dc_id=20uuid,=0A=20=
=20=20=20=20=20=20=20dc_name=20VARCHAR,=0A=20=20=20=20=20=20=20=20=
spm_host_id=20uuid,=0A=20=20=20=20=20=20=20=20spm_host_name=20VARCHAR,=0A=
=20=20=20=20=20=20=20=20task_count=20INT=0A=20=20=20=20=20=20=20=20);=0A=
**************************=0A=0ACREATE=20TYPE=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_get_async_tasks=20=
()=0ARETURNS=20SETOF=20async_tasks_info_rs=20STABLE=20AS=20$PROCEDURE$=0A=
DECLARE=20v_record=20async_tasks_info_rs;=0A=0A--=20selects=20=
storage_pool_id=20uuid=20found=20in=20async_tasks=0Av_tasks_cursor=20=
CURSOR=0AFOR=0A=0ASELECT=20DISTINCT=20storage_pool_id=0AFROM=20=
async_tasks;=0A=0ABEGIN=0A=20=20=20=20OPEN=20v_tasks_cursor;=0A=0A=20=20=20=
=20FETCH=20v_tasks_cursor=0A=20=20=20=20INTO=20v_record.dc_id;=0A=0A=20=20=
=20=20WHILE=20FOUND=0A=20=20=20=20LOOP=0A=20=20=20=20=20=20=20=20--=20=
get=20dc_name=20and=20SPM=20Host=20id=0A=20=20=20=20=20=20=20=20=
v_record.dc_name=20:=3D=20name=20FROM=20storage_pool=20WHERE=20id=20=3D=20=
v_record.dc_id;=0A=20=20=20=20=20=20=20=20v_record.spm_host_id=20:=3D=20=
spm_vds_id=0A=20=20=20=20=20=20=20=20FROM=20storage_pool=0A=20=20=20=20=20=
=20=20=20WHERE=20id=20=3D=20v_record.dc_id;=0A=0A=20=20=20=20=20=20=20=20=
--=20get=20Host=20name=20if=20we=20have=20non=20NULL=20SPM=20Host=0A=20=20=
=20=20=20=20=20=20IF=20(v_record.spm_host_id=20IS=20NOT=20NULL)=20THEN=0A=
=20=20=20=20=20=20=20=20=20=20=20=20v_record.spm_host_name=20:=3D=20=
vds_name=0A=20=20=20=20=20=20=20=20=20=20=20=20FROM=20vds_static=0A=20=20=
=20=20=20=20=20=20=20=20=20=20WHERE=20vds_id=20=3D=20=
v_record.spm_host_id;=0A=20=20=20=20=20=20=20=20ELSE=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_record.spm_host_name:=3D=20'';=0A=20=20=20=20=20=20=20=
=20END=20IF;=0A=20=20=20=20=20=20=20=20--=20get=20tasks=20count=20for=20=
this=20DC=0A=20=20=20=20=20=20=20=20v_record.task_count=20:=3D=20=
count(*)=0A=20=20=20=20=20=20=20=20FROM=20async_tasks=0A=20=20=20=20=20=20=
=20=20WHERE=20position(cast(v_record.dc_id=20AS=20VARCHAR)=20IN=20=
action_parameters)=20>=200;=0A=0A=20=20=20=20=20=20=20=20--=20return=20=
the=20record=0A=20=20=20=20=20=20=20=20RETURN=20NEXT=20v_record;=0A=0A=20=
=20=20=20=20=20=20=20FETCH=20v_tasks_cursor=0A=20=20=20=20INTO=20=
v_record.dc_id;=0A=0A=20=20=20=20END=20LOOP;=0A=0ACLOSE=20=
v_tasks_cursor;=0A=0A--=20return=20full=20set=20of=20generated=20records=0A=
RETURN;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_remove_csv_config_value=20(=0A=20=20=20=20v_option_name=20=
VARCHAR(100),=0A=20=20=20=20v_value=20VARCHAR(4000),=0A=20=20=20=20=
v_version=20VARCHAR(40)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20v=20VARCHAR=20[];=0A=0Ae=20VARCHAR;=0A=0A=
v_result=20VARCHAR;=0A=0Av_sep=20VARCHAR(1);=0A=0ABEGIN=0A=20=20=20=20=
v_result=20:=3D=20'';=0A=0A=20=20=20=20v_sep=20:=3D=20'';=0A=0A=20=20=20=20=
v=20:=3D=20string_to_array(option_value,=20',')=0A=20=20=20=20FROM=20=
vdc_options=0A=20=20=20=20WHERE=20option_name=20=3D=20v_option_name=0A=20=
=20=20=20=20=20=20=20AND=20version=20=3D=20v_version;=0A=20=20=20=20FOR=0A=
=0A=20=20=20=20e=20IN=0A=0A=20=20=20=20SELECT=20unnest(v)=20LOOP=0A=0A=20=
=20=20=20IF=20(e=20!=3D=20v_value)=20THEN=20v_result=20:=3D=20v_result=20=
||=20v_sep=20||=20e;=0A=20=20=20=20=20=20=20=20v_sep=20:=3D=20',';=0A=20=20=
=20=20END=20IF;=0A=0AEND=0ALOOP;=0A=0A=20=20=20=20UPDATE=20vdc_options=0A=
=20=20=20=20SET=20option_value=20=3D=20v_result=0A=20=20=20=20WHERE=20=
option_name=20=3D=20v_option_name=0A=20=20=20=20=20=20=20=20AND=20=
version=20=3D=20v_version;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_remove_uuid_from_csv=20(=0A=20=20=20=20v_csv_text=20TEXT,=0A=20=20=20=
=20v_uuid=20uuid=0A=20=20=20=20)=0ARETURNS=20TEXT=20STABLE=20AS=20=
$PROCEDURE$=0ADECLARE=20v=20uuid=20[];=0A=0Ae=20uuid;=0A=0Av_result=20=
TEXT;=0A=0Av_sep=20VARCHAR(1);=0A=0ABEGIN=0A=20=20=20=20v_result=20:=3D=20=
'';=0A=0A=20=20=20=20v_sep=20:=3D=20'';=0A=0A=20=20=20=20v=20:=3D=20=
string_to_array(v_csv_text,=20',');=0A=20=20=20=20FOR=0A=0A=20=20=20=20e=20=
IN=0A=0A=20=20=20=20SELECT=20unnest(v)=20LOOP=0A=0A=20=20=20=20IF=20(e=20=
!=3D=20v_uuid)=20THEN=20v_result=20:=3D=20v_result=20||=20v_sep=20||=20=
e;=0A=20=20=20=20=20=20=20=20v_sep=20:=3D=20',';=0A=20=20=20=20END=20IF;=0A=
=0A=20=20=20=20END=20LOOP;=0A=0A=20=20=20=20IF=20(v_result=20=3D=20'')=20=
THEN=20v_result=20:=3D=20NULL;=0A=20=20=20=20END=20IF;=0A=20=20=20=20=
RETURN=20v_result;=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_add_config_value_for_versions_up_to=20(=0A=20=20=20=20=
v_option_name=20VARCHAR(100),=0A=20=20=20=20v_val=20VARCHAR(4000),=0A=20=20=
=20=20v_version=20VARCHAR(40)=0A=20=20=20=20)=0ARETURNS=20void=20AS=20=
$PROCEDURE$=0ADECLARE=20i=20INT;=0A=0Aarr=20VARCHAR=20[]=20:=3D=20array=20=
['3.6',=20'4.0'];=0A=0ABEGIN=0A=20=20=20=20FOR=20i=20IN=20=
array_lower(arr,=201)..array_upper(arr,=201)=20LOOP=20PERFORM=20=
fn_db_add_config_value(v_option_name,=20v_val,=20arr=20[i]);=0A=20=20=20=20=
=20=20=20=20EXIT=20WHEN=20arr=20[i]=20=3D=20v_version;=0A=20=20=20=20END=20=
LOOP;=0A=0AEND;$PROCEDURE$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
__temp_add_object_column_white_list_table()=0ARETURNS=20void=0AAS=20=
$function$=0ABEGIN=0A=20=20=20--=20This=20table=20holds=20the=20column=20=
white=20list=20per=20object=0A=20=20=20IF=20EXISTS=20(SELECT=20*=20FROM=20=
pg_tables=20WHERE=20tablename=20ILIKE=20'object_column_white_list')=20=
THEN=0A=20=20=20=20=20=20=20truncate=20table=20object_column_white_list;=0A=
=20=20=20ELSE=0A=20=20=20=20=20=20CREATE=20TABLE=20=
object_column_white_list=0A=20=20=20=20=20=20(=0A=20=20=20=20=20=20=20=20=
=20object_name=20varchar(128)=20NOT=20NULL,=0A=20=20=20=20=20=20=20=20=20=
column_name=20varchar(128)=20NOT=20NULL,=0A=20=20=20=20=20=20=20=20=20=
CONSTRAINT=20pk_object_column_white_list=20PRIMARY=20=
KEY(object_name,column_name)=0A=20=20=20=20=20=20)=20WITH=20OIDS;=0A=20=20=
=20END=20IF;=0A=0A=20=20=20--=20this=20table=20holds=20generated=20sql=20=
per=20object=20and=20is=20truncated=20upon=20upgrade=20to=20reflect=20=
schema=20changes=0A=20=20=20IF=20EXISTS=20(SELECT=20*=20FROM=20pg_tables=20=
WHERE=20tablename=20ILIKE=20'object_column_white_list_sql')=20THEN=0A=20=20=
=20=20=20=20=20truncate=20table=20object_column_white_list_sql;=0A=20=20=20=
ELSE=0A=20=20=20=20=20=20CREATE=20TABLE=20object_column_white_list_sql=0A=
=20=20=20=20=20=20(=0A=20=20=20=20=20=20=20=20=20object_name=20=
varchar(128)=20NOT=20NULL,=0A=20=20=20=20=20=20=20=20=20sql=20text=20NOT=20=
NULL,=0A=20=20=20=20=20=20=20=20=20CONSTRAINT=20=
pk_object_column_white_list_sql=20PRIMARY=20KEY(object_name)=0A=20=20=20=20=
=20=20)=20WITH=20OIDS;=0A=0A=20=20=20END=20IF;=0A=20=20=20=
-----------------------------------=0A=20=20=20--=20Initial=20white=20=
list=20settings=20=20---=0A=20=20=20-----------------------------------=0A=
=20=20=20--=20=20=20=20=20=20=20=20=20=20=20=20vds=20view=0A=20=20=20=
-----------------------------------=0A=20=20=20--=20=20A=20new=20added=20=
column=20will=20not=20be=20displayed=20for=20the=20user=20unless=20added=20=
specifically.=0A=20=20=20=20=20=20insert=20into=20=
object_column_white_list(object_name,column_name)=0A=20=20=20=20=20=20=
(select=20'vds',=20column_name=0A=20=20=20=20=20=20=20from=20=
information_schema.columns=0A=20=20=20=20=20=20=20where=20table_schema=20=
=3D=20'public'=20and=0A=20=20=20=20=20=20=20table_name=20=3D=20'vds'=20=
and=0A=20=20=20=20=20=20=20column_name=20in=20(=0A=20=20=20=20=20=20=20=20=
=20=20'cluster_id',=20'cluster_name',=20'cluster_description',=0A=20=20=20=
=20=20=20=20=20=20=20'vds_id',=20'vds_name',=20'ip',=20'vds_unique_id',=20=
'host_name',=20'port',=20'vds_strength',=0A=20=20=20=20=20=20=20=20=20=20=
'server_ssl_enabled',=20'vds_type',=20'pm_enabled',=20=
'pm_proxy_preferences',=20'vds_spm_priority',=20'hooks',=20'status',=20=
'cpu_cores',=0A=20=20=20=20=20=20=20=20=20=20'cpu_model',=20=
'cpu_speed_mh',=20'if_total_speed',=20'kvm_enabled',=20=
'physical_mem_mb',=0A=20=20=20=20=20=20=20=20=20=20=
'pending_vcpus_count',=20'pending_vmem_size',=20'mem_commited',=20=
'vm_active',=20'vm_count',=0A=20=20=20=20=20=20=20=20=20=20=
'vm_migrating',=20'incoming_migrations',=20'outgoing_migrations',=20=
'vms_cores_count',=20'cpu_over_commit_time_stamp',=20'hypervisor_type',=0A=
=20=20=20=20=20=20=20=20=20=20'net_config_dirty',=20=
'max_vds_memory_over_commit',=20'storage_pool_id',=20=
'storage_pool_name',=20'reserved_mem',=0A=20=20=20=20=20=20=20=20=20=20=
'guest_overhead',=20'software_version',=20'version_name',=20=
'build_name',=20'previous_status',=0A=20=20=20=20=20=20=20=20=20=20=
'cpu_idle',=20'cpu_load',=20'cpu_sys',=20'cpu_user',=20=
'usage_mem_percent',=20'usage_cpu_percent',=0A=20=20=20=20=20=20=20=20=20=
=20'usage_network_percent',=20'mem_available',=20'mem_shared',=20=
'swap_free',=20'swap_total',=20'ksm_cpu_percent',=0A=20=20=20=20=20=20=20=
=20=20=20'ksm_pages',=20'ksm_state',=20'cpu_flags',=20=
'cluster_cpu_name',=20'cpu_sockets',=20'vds_spm_id',=0A=20=20=20=20=20=20=
=20=20=20=20'otp_validity',=20'spm_status',=20=
'supported_cluster_levels',=20'supported_engines',=0A=20=20=20=20=20=20=20=
=20=20=20'cluster_compatibility_version',=20'cluster_virt_service',=20=
'cluster_gluster_service',=20'host_os',=20'kvm_version',=20=
'libvirt_version',=20'spice_version',=20'kernel_version',=0A=20=20=20=20=20=
=20=20=20=20=20'iscsi_initiator_name',=20'transparent_hugepages_state',=20=
'anonymous_hugepages',=0A=20=20=20=20=20=20=20=20=20=20=
'non_operational_reason',=20'recoverable',=20'sshkeyfingerprint',=20=
'count_threads_as_cores',=20'cpu_threads',=0A=20=20=20=20=20=20=20=20=20=20=
'hw_manufacturer',=20'hw_product_name',=20'hw_version',=20=
'hw_serial_number',=20'hw_uuid',=20'hw_family',=20'ssh_port',=20=
'ssh_username',=20'boot_time',=0A=20=20=20=20=20=20=20=20=20=20=
'pm_detect_kdump',=20'protocol'));=0A--=20pm_options=20are=20missing=0A=
END;=20$function$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ASELECT=20*=20FROM=20=
__temp_add_object_column_white_list_table();=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
DROP=20FUNCTION=20__temp_add_object_column_white_list_table();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0Aselect=20fn_db_add_column_to_object_white_list('vds',=20=
'selinux_enforce_mode');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_column_to_object_white_list('vds',=20'auto_numa_balancing');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_column_to_object_white_list('vds',=20=
'is_numa_supported');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0Aselect=20=
fn_db_add_column_to_object_white_list('vds',=20'protocol');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
select=20fn_db_add_column_to_object_white_list('vds',=20=
'supported_emulated_machines');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0ASELECT=20=
fn_db_add_column_to_object_white_list('vds',=20'kernel_cmdline');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
SELECT=20fn_db_add_column_to_object_white_list('vds',=20=
'last_stored_kernel_cmdline');=0A**************************=0A=0A=20=0A=0A=
*********=20QUERY=20**********=0ASELECT=20=
fn_db_add_column_to_object_white_list('vds',=20'pretty_name');=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
/*************************************************************************=
*****************************=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20Snapshot=20Materialized=20Views=20=
Definitions=20Section=0A=
**************************************************************************=
****************************/=0A=
/*************************************************************************=
*****************************=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20Snapshot=20Materialized=20Views=20=
Index=20Definitions=20Section=0A=
**************************************************************************=
****************************/=0A=
/*************************************************************************=
*****************************=0AIf=20your=20Snapshot=20Materialized=20=
View=20is=20my_mt=20you=20should=20create=20Stored=20Procedures:=0A=
MtDropmy_mtIndexes=20-=20Drops=20indexes=20on=20my_mt=0A=
MtCreatemy_mtIndexes=20-=20Creates=20needed=20indexes=20on=20my_mt=0A=
**************************************************************************=
****************************/=0A**************************=0A=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
__temp_set_default_cluster_for_registration()=0A=20=20RETURNS=20void=20=
AS=0A$BODY$=0ABEGIN=0A=20=20=20=20IF=20EXISTS=20(select=201=20from=20=
cluster=20where=20name=20ilike=20'Default')=20THEN=0A=20=20=20=20=20=20=20=
=20update=20vdc_options=0A=20=20=20=20=20=20=20=20set=20option_value=20=3D=
=20(select=20cluster_id=20from=20cluster=20where=20name=20ilike=20=
'Default')=0A=20=20=20=20=20=20=20=20where=20option_name=20=3D=20=
'AutoRegistrationDefaultClusterID'=20and=20version=20=3D=20'general';=0A=20=
=20=20=20ELSE=0A=20=20=20=20=20=20=20=20--=20Default=20cluster=20name=20=
was=20changed=20from=20'Default'=20to=20something=20else=0A=20=20=20=20=20=
=20=20=20--=20taking=20the=20first=20cluster=20we=20found=20as=20default=0A=
=20=20=20=20=20=20=20=20update=20vdc_options=0A=20=20=20=20=20=20=20=20=
set=20option_value=20=3D=20(select=20cluster_id=20from=20cluster=20LIMIT=20=
1)=0A=20=20=20=20=20=20=20=20where=20option_name=20=3D=20=
'AutoRegistrationDefaultClusterID'=20and=20version=20=3D=20'general';=0A=20=
=20=20=20END=20IF;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Aselect=20__temp_set_default_cluster_for_registration();=0A=
**************************=0A=0A=20=0A=0A*********=20QUERY=20**********=0A=
drop=20function=20__temp_set_default_cluster_for_registration();=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0AREINDEX=20TABLE=20vdc_options;=0A**************************=0A=
=0AREINDEX=0A*********=20QUERY=20**********=0Aselect=20=
RefreshAllMaterializedViews(true);=0A**************************=0A=0A=20=0A=
=0A*********=20QUERY=20**********=0A=0A**************************=0A=0A=
2016-08-18=2013:00:12=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema=20=
plugin.executeRaw:863=20execute-result:=20=
['/usr/share/ovirt-engine/dbscripts/schema.sh',=20'-s',=20'localhost',=20=
'-p',=20'5432',=20'-u',=20'engine',=20'-d',=20'engine',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-c',=20'apply'],=20rc=3D0=0A2016-08-18=2013:00:12=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema=20=
plugin.execute:921=20execute-output:=20=
['/usr/share/ovirt-engine/dbscripts/schema.sh',=20'-s',=20'localhost',=20=
'-p',=20'5432',=20'-u',=20'engine',=20'-d',=20'engine',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-c',=20'apply']=20stdout:=0ACreating=20schema=20=
engine@localhost:5432/engine=0ASaving=20custom=20users=20permissions=20=
on=20database=20objects...=0Aupgrade=20script=20detected=20a=20change=20=
in=20Config,=20View=20or=20Stored=20Procedure...=0ARunning=20upgrade=20=
sql=20script=20=
'/usr/share/ovirt-engine/dbscripts/upgrade/pre_upgrade/0000_config.sql'...=
=0ARunning=20upgrade=20sql=20script=20=
'/usr/share/ovirt-engine/dbscripts/upgrade/pre_upgrade/0010_custom.sql'...=
=0ARunning=20upgrade=20sql=20script=20=
'/usr/share/ovirt-engine/dbscripts/upgrade/pre_upgrade/0020_add_materializ=
ed_views_table.sql'...=0ARunning=20upgrade=20sql=20script=20=
'/usr/share/ovirt-engine/dbscripts/upgrade/pre_upgrade/0030_materialized_v=
iews_extensions.sql'...=0ARunning=20upgrade=20sql=20script=20=
'/usr/share/ovirt-engine/dbscripts/upgrade/pre_upgrade/0040_extend_install=
ed_by_column.sql'...=0ADropping=20materialized=20views...=0ACreating=20=
views...=0ACreating=20stored=20procedures...=0ACreating=20stored=20=
procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/ad_groups_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/affinity_groups_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/all_disks_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/async_tasks_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/audit_log_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/base_disks_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/bookmarks_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/business_entity_snapshot_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/cluster_features_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/cluster_policy_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/clusters_sp.sql...=0ACreating=20stored=20=
procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/command_entities_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/common_sp.sql...=0ACreating=20stored=20=
procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/cpu_profiles_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/custom_actions_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/disk_image_dynamic_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/disk_images_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/disk_lun_map_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/disk_profiles_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/disk_vm_element_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/dwh_history_timekeeping_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/dwh_translation_tables_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/engine_backup_log_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/engine_sessions_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/event_sp.sql...=0ACreating=20stored=20=
procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/external_variable_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/fence_agents_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/gluster_georep_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/gluster_hooks_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/gluster_server_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/gluster_services_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/gluster_volume_snapshot_schedule_sp.sql.=
..=0ACreating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/gluster_volume_snapshot_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/gluster_volumes_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/host_device_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/images_sp.sql...=0ACreating=20stored=20=
procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/image_storage_domain_map_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/image_transfers_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/inst_sp.sql...=0ACreating=20stored=20=
procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/iscsi_bonds_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/job_sp.sql...=0ACreating=20stored=20=
procedures=20from=20/usr/share/ovirt-engine/dbscripts/labels_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/libvirt_secrets_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/mac_pools_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/materialized_views_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/multi_level_administration_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/network_sp.sql...=0ACreating=20stored=20=
procedures=20from=20/usr/share/ovirt-engine/dbscripts/numa_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/policy_unit_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/providers_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/qos_sp.sql...=0ACreating=20stored=20=
procedures=20from=20/usr/share/ovirt-engine/dbscripts/quota_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/repo_files_meta_data_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/snapshots_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/sso_clients_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/storage_device_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/storages_san_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/storages_sp.sql...=0ACreating=20stored=20=
procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/system_statistics_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/tags_sp.sql...=0ACreating=20stored=20=
procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/tags_vm_pool_map_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/unregistered_disks_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/unregistered_OVF_data_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/user_profiles_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/user_sp.sql...=0ACreating=20stored=20=
procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/vdc_option_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/vds_kdump_status_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/vds_spm_id_map_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/vds_sp.sql...=0ACreating=20stored=20=
procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/vm_device_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/vm_icons_sp.sql...=0ACreating=20stored=20=
procedures=20from=20/usr/share/ovirt-engine/dbscripts/vm_jobs_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/vm_pool_maps_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/vm_pools_sp.sql...=0ACreating=20stored=20=
procedures=20from=20/usr/share/ovirt-engine/dbscripts/vms_sp.sql...=0A=
Creating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine/dbscripts/vm_templates_sp.sql...=0ARunning=20=
upgrade=20sql=20script=20=
'/usr/share/ovirt-engine/dbscripts/upgrade/post_upgrade/0010_add_object_co=
lumn_white_list_table.sql'...=0ARunning=20upgrade=20sql=20script=20=
'/usr/share/ovirt-engine/dbscripts/upgrade/post_upgrade/0020_create_materi=
alized_views.sql'...=0ARunning=20upgrade=20sql=20script=20=
'/usr/share/ovirt-engine/dbscripts/upgrade/post_upgrade/0030_set_default_c=
luster_for_registration.sql'...=0ARunning=20upgrade=20sql=20script=20=
'/usr/share/ovirt-engine/dbscripts/upgrade/post_upgrade/0040_reindex_vdc_o=
ptions.sql'...=0ARefreshing=20materialized=20views...=0AApplying=20=
custom=20users=20permissions=20on=20database=20objects...=0A=0A=
2016-08-18=2013:00:12=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.schema=20=
plugin.execute:926=20execute-output:=20=
['/usr/share/ovirt-engine/dbscripts/schema.sh',=20'-s',=20'localhost',=20=
'-p',=20'5432',=20'-u',=20'engine',=20'-d',=20'engine',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-c',=20'apply']=20stderr:=0A=0A=0A2016-08-18=2013:00:12=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh.Plugin._misc=0A=
2016-08-18=2013:00:12=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh=20=
plugin.executeRaw:813=20execute:=20=
('/usr/share/ovirt-engine/bin/pki-pkcs12-extract.sh',=20'--name=3Dengine',=
=20'--passin=3D**FILTERED**',=20'--key=3D-'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2013:00:12=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh=20=
plugin.executeRaw:863=20execute-result:=20=
('/usr/share/ovirt-engine/bin/pki-pkcs12-extract.sh',=20'--name=3Dengine',=
=20'--passin=3D**FILTERED**',=20'--key=3D-'),=20rc=3D0=0A2016-08-18=20=
13:00:12=20DEBUG=20otopi.transaction=20transaction._prepare:61=20=
preparing=20'File=20transaction=20for=20=
'/etc/pki/ovirt-engine/keys/engine_id_rsa''=0A2016-08-18=2013:00:12=20=
DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20file=20=
'/etc/pki/ovirt-engine/keys/engine_id_rsa'=20exists=0A2016-08-18=20=
13:00:12=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:189=20=
file=20'/etc/pki/ovirt-engine/keys/engine_id_rsa'=20already=20has=20=
content=0A2016-08-18=2013:00:12=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh=20=
plugin.executeRaw:813=20execute:=20=
('/usr/share/ovirt-engine/bin/pki-pkcs12-extract.sh',=20'--name=3Dengine',=
=20'--passin=3D**FILTERED**',=20'--cert=3D-'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2013:00:12=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh=20=
plugin.executeRaw:863=20execute-result:=20=
('/usr/share/ovirt-engine/bin/pki-pkcs12-extract.sh',=20'--name=3Dengine',=
=20'--passin=3D**FILTERED**',=20'--cert=3D-'),=20rc=3D0=0A2016-08-18=20=
13:00:12=20DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh=20=
plugin.execute:921=20execute-output:=20=
('/usr/share/ovirt-engine/bin/pki-pkcs12-extract.sh',=20'--name=3Dengine',=
=20'--passin=3D**FILTERED**',=20'--cert=3D-')=20stdout:=0ABag=20=
Attributes=0A=20=20=20=20localKeyID:=2089=20E5=20AB=203D=207E=20A8=2092=20=
B5=20CC=20D0=2085=20C9=2072=2033=20D4=2096=201F=2056=20DA=20FF=20=0A=
subject=3D/C=3DUS/O=3Dgrove.silverorange.com/CN=3Dcultivar.grove.silverora=
nge.com=0A=
issuer=3D/C=3DUS/O=3Dgrove.silverorange.com/CN=3Dcultivar.grove.silveroran=
ge.com.10292=0A-----BEGIN=20CERTIFICATE-----=0A=
MIIEuDCCA6CgAwIBAgICEAEwDQYJKoZIhvcNAQEFBQAwXjELMAkGA1UEBhMCVVMx=0A=
HzAdBgNVBAoTFmdyb3ZlLnNpbHZlcm9yYW5nZS5jb20xLjAsBgNVBAMTJWN1bHRp=0A=
dmFyLmdyb3ZlLnNpbHZlcm9yYW5nZS5jb20uMTAyOTIwHhcNMTYwMjAyMTk0NTE0=0A=
WhcNMjEwMTA3MTk0NTE0WjBYMQswCQYDVQQGEwJVUzEfMB0GA1UEChMWZ3JvdmUu=0A=
c2lsdmVyb3JhbmdlLmNvbTEoMCYGA1UEAxMfY3VsdGl2YXIuZ3JvdmUuc2lsdmVy=0A=
b3JhbmdlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALHxnjZj=0A=
J1JWfyrGA2TDMIJxmuuZ6jracpCofxj2aWLU7zSFG1Ss4wApX0YP8D9WskkwC/PT=0A=
suPH+lANoqKAsxYAooUPVT22slLLLGVgyjWi9jm5Np8Pzo+4jM2u2N0PRU82fQ5a=0A=
axgRcE/eh2K5ji+eagVKuMajkkTwxjhywok6K6Bwp3ycMs5ouOheuPnNOc4ttQ3K=0A=
0iunaRmJKhCkz1TZXtm5mTkb4Uf6J42eUTMJNkokRUikNBiOJSB4utTB+1upm49p=0A=
/qg/Ew36UNA0URDExLLnuUWONjvQmoYJSkjX+iTQUxlYyLgcrdu30Yuipc7VCoWV=0A=
ZimMRaoFZWMzoKUCAwEAAaOCAYQwggGAMB0GA1UdDgQWBBSs3rKhJytZgKp/WDVw=0A=
SVWpnouFfDCBlgYIKwYBBQUHAQEEgYkwgYYwgYMGCCsGAQUFBzAChndodHRwOi8v=0A=
Y3VsdGl2YXIuZ3JvdmUuc2lsdmVyb3JhbmdlLmNvbTo4MC9vdmlydC1lbmdpbmUv=0A=
c2VydmljZXMvcGtpLXJlc291cmNlP3Jlc291cmNlPWNhLWNlcnRpZmljYXRlJmZv=0A=
cm1hdD1YNTA5LVBFTS1DQTCBiAYDVR0jBIGAMH6AFAoj+gxGoTwVxi8F71fxj0mr=0A=
TtftoWKkYDBeMQswCQYDVQQGEwJVUzEfMB0GA1UEChMWZ3JvdmUuc2lsdmVyb3Jh=0A=
bmdlLmNvbTEuMCwGA1UEAxMlY3VsdGl2YXIuZ3JvdmUuc2lsdmVyb3JhbmdlLmNv=0A=
bS4xMDI5MoICEAAwCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMCBaAwIAYDVR0lAQH/=0A=
BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4IBAQCp13KD=0A=
2dWrxUwI8o/AHUuRgzIJWD2Y+GJuPu97OkTqV6GvSNDst2iMQdIhSMVz7WWgCynP=0A=
ju+bJDz8VWakzSCRZc0Tj8rIYkw1sCUuprf/iZ0pOCBm8CWnGPb2vxgDXgY0xspL=0A=
GmD0k9Fh7BxhQD1VPo9Ef2EnHsnTTRpQO6cuDZnHYje7JKpJIaTEUYUdM1vTo92R=0A=
Tn9kEb0wK5X7ajREy2a3Awl/tAMDrK/3bLNEMJNnKMmrcZaNrtHsKhyV6Eypwx5n=0A=
Rn6f/7ghCQ0vFoZpBgDDic0pQE8M4aXSj9uvISRsGguH/28wrhdgGhppjFxLuyX+=0A=
LIw32vYNj/WCTT5y=0A-----END=20CERTIFICATE-----=0A=0A2016-08-18=20=
13:00:12=20DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh=20=
plugin.execute:926=20execute-output:=20=
('/usr/share/ovirt-engine/bin/pki-pkcs12-extract.sh',=20'--name=3Dengine',=
=20'--passin=3D**FILTERED**',=20'--cert=3D-')=20stderr:=0AMAC=20verified=20=
OK=0A=0A2016-08-18=2013:00:12=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh=20=
plugin.execute:903=20execute-input:=20('/bin/ssh-keygen',=20'-i',=20=
'-m',=20'PKCS8',=20'-f',=20'/proc/self/fd/0')=20stdin:=0A-----BEGIN=20=
PUBLIC=20KEY-----=0A=
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsfGeNmMnUlZ/KsYDZMMw=0A=
gnGa65nqOtpykKh/GPZpYtTvNIUbVKzjAClfRg/wP1aySTAL89Oy48f6UA2iooCz=0A=
FgCihQ9VPbayUsssZWDKNaL2Obk2nw/Oj7iMza7Y3Q9FTzZ9DlprGBFwT96HYrmO=0A=
L55qBUq4xqOSRPDGOHLCiToroHCnfJwyzmi46F64+c05zi21DcrSK6dpGYkqEKTP=0A=
VNle2bmZORvhR/onjZ5RMwk2SiRFSKQ0GI4lIHi61MH7W6mbj2n+qD8TDfpQ0DRR=0A=
EMTEsue5RY42O9CahglKSNf6JNBTGVjIuByt27fRi6KlztUKhZVmKYxFqgVlYzOg=0A=
pQIDAQAB=0A-----END=20PUBLIC=20KEY-----=0A=0A=0A2016-08-18=2013:00:12=20=
DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh=20=
plugin.executeRaw:813=20execute:=20('/bin/ssh-keygen',=20'-i',=20'-m',=20=
'PKCS8',=20'-f',=20'/proc/self/fd/0'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2013:00:12=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh=20=
plugin.executeRaw:863=20execute-result:=20('/bin/ssh-keygen',=20'-i',=20=
'-m',=20'PKCS8',=20'-f',=20'/proc/self/fd/0'),=20rc=3D0=0A2016-08-18=20=
13:00:12=20DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh=20=
plugin.execute:921=20execute-output:=20('/bin/ssh-keygen',=20'-i',=20=
'-m',=20'PKCS8',=20'-f',=20'/proc/self/fd/0')=20stdout:=0Assh-rsa=20=
AAAAB3NzaC1yc2EAAAADAQABAAABAQCx8Z42YydSVn8qxgNkwzCCcZrrmeo62nKQqH8Y9mli1O=
80hRtUrOMAKV9GD/A/VrJJMAvz07Ljx/pQDaKigLMWAKKFD1U9trJSyyxlYMo1ovY5uTafD86P=
uIzNrtjdD0VPNn0OWmsYEXBP3odiuY4vnmoFSrjGo5JE8MY4csKJOiugcKd8nDLOaLjoXrj5zT=
nOLbUNytIrp2kZiSoQpM9U2V7ZuZk5G+FH+ieNnlEzCTZKJEVIpDQYjiUgeLrUwftbqZuPaf6o=
PxMN+lDQNFEQxMSy57lFjjY70JqGCUpI1/ok0FMZWMi4HK3bt9GLoqXO1QqFlWYpjEWqBWVjM6=
Cl=0A=0A2016-08-18=2013:00:12=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ssh=20=
plugin.execute:926=20execute-output:=20('/bin/ssh-keygen',=20'-i',=20=
'-m',=20'PKCS8',=20'-f',=20'/proc/self/fd/0')=20stderr:=0A=0A=0A=
2016-08-18=2013:00:12=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2013:00:12=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PKI/sshPublicKey=3Dunicode:'ssh-rsa=20=
AAAAB3NzaC1yc2EAAAADAQABAAABAQCx8Z42YydSVn8qxgNkwzCCcZrrmeo62nKQqH8Y9mli1O=
80hRtUrOMAKV9GD/A/VrJJMAvz07Ljx/pQDaKigLMWAKKFD1U9trJSyyxlYMo1ovY5uTafD86P=
uIzNrtjdD0VPNn0OWmsYEXBP3odiuY4vnmoFSrjGo5JE8MY4csKJOiugcKd8nDLOaLjoXrj5zT=
nOLbUNytIrp2kZiSoQpM9U2V7ZuZk5G+FH+ieNnlEzCTZKJEVIpDQYjiUgeLrUwftbqZuPaf6o=
PxMN+lDQNFEQxMSy57lFjjY70JqGCUpI1/ok0FMZWMi4HK3bt9GLoqXO1QqFlWYpjEWqBWVjM6=
Cl'=0A2016-08-18=2013:00:12=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
13:00:12=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._misc=0A=
2016-08-18=2013:00:12=20INFO=20=
otopi.ovirt_engine_setup.engine_common.database=20database.backup:606=20=
Backing=20up=20database=20localhost:ovirt_engine_history=20to=20=
'/var/lib/ovirt-engine-dwh/backups/dwh-20160818130012.aZ8Sq8.dump'.=0A=
2016-08-18=2013:00:12=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema=20=
plugin.executePipeRaw:481=20executePipeRaw:=20[0]=20popen=20kw=3D{'stdin':=
=20None,=20'stdout':=20-1,=20'preexec_fn':=20<function=20_enableSignals=20=
at=200x29cfa28>,=20'env':=20{'LANG':=20'en_US.UTF-8',=20'PGPASSFILE':=20=
'/tmp/tmp8s8Ayx',=20'TERM':=20'xterm-256color',=20'SHELL':=20=
'/bin/bash',=20'MAIL':=20'/var/spool/mail/root',=20'SHLVL':=20'1',=20=
'PYTHONPATH':=20'/usr/share/ovirt-engine/setup/bin/..::',=20'HOSTNAME':=20=
'cultivar.grove.silverorange.com',=20'LS_COLORS':=20=
'rs=3D0:di=3D38;5;27:ln=3D38;5;51:mh=3D44;38;5;15:pi=3D40;38;5;11:so=3D38;=
5;13:do=3D38;5;5:bd=3D48;5;232;38;5;11:cd=3D48;5;232;38;5;3:or=3D48;5;232;=
38;5;9:mi=3D05;48;5;232;38;5;15:su=3D48;5;196;38;5;15:sg=3D48;5;11;38;5;16=
:ca=3D48;5;196;38;5;226:tw=3D48;5;10;38;5;16:ow=3D48;5;10;38;5;21:st=3D48;=
5;21;38;5;15:ex=3D38;5;34:*.tar=3D38;5;9:*.tgz=3D38;5;9:*.arc=3D38;5;9:*.a=
rj=3D38;5;9:*.taz=3D38;5;9:*.lha=3D38;5;9:*.lz4=3D38;5;9:*.lzh=3D38;5;9:*.=
lzma=3D38;5;9:*.tlz=3D38;5;9:*.txz=3D38;5;9:*.tzo=3D38;5;9:*.t7z=3D38;5;9:=
*.zip=3D38;5;9:*.z=3D38;5;9:*.Z=3D38;5;9:*.dz=3D38;5;9:*.gz=3D38;5;9:*.lrz=
=3D38;5;9:*.lz=3D38;5;9:*.lzo=3D38;5;9:*.xz=3D38;5;9:*.bz2=3D38;5;9:*.bz=3D=
38;5;9:*.tbz=3D38;5;9:*.tbz2=3D38;5;9:*.tz=3D38;5;9:*.deb=3D38;5;9:*.rpm=3D=
38;5;9:*.jar=3D38;5;9:*.war=3D38;5;9:*.ear=3D38;5;9:*.sar=3D38;5;9:*.rar=3D=
38;5;9:*.alz=3D38;5;9:*.ace=3D38;5;9:*.zoo=3D38;5;9:*.cpio=3D38;5;9:*.7z=3D=
38;5;9:*.rz=3D38;5;9:*.cab=3D38;5;9:*.jpg=3D38;5;13:*.jpeg=3D38;5;13:*.gif=
=3D38;5;13:*.bmp=3D38;5;13:*.pbm=3D38;5;13:*.pgm=3D38;5;13:*.ppm=3D38;5;13=
:*.tga=3D38;5;13:*.xbm=3D38;5;13:*.xpm=3D38;5;13:*.tif=3D38;5;13:*.tiff=3D=
38;5;13:*.png=3D38;5;13:*.svg=3D38;5;13:*.svgz=3D38;5;13:*.mng=3D38;5;13:*=
.pcx=3D38;5;13:*.mov=3D38;5;13:*.mpg=3D38;5;13:*.mpeg=3D38;5;13:*.m2v=3D38=
;5;13:*.mkv=3D38;5;13:*.webm=3D38;5;13:*.ogm=3D38;5;13:*.mp4=3D38;5;13:*.m=
4v=3D38;5;13:*.mp4v=3D38;5;13:*.vob=3D38;5;13:*.qt=3D38;5;13:*.nuv=3D38;5;=
13:*.wmv=3D38;5;13:*.asf=3D38;5;13:*.rm=3D38;5;13:*.rmvb=3D38;5;13:*.flc=3D=
38;5;13:*.avi=3D38;5;13:*.fli=3D38;5;13:*.flv=3D38;5;13:*.gl=3D38;5;13:*.d=
l=3D38;5;13:*.xcf=3D38;5;13:*.xwd=3D38;5;13:*.yuv=3D38;5;13:*.cgm=3D38;5;1=
3:*.emf=3D38;5;13:*.axv=3D38;5;13:*.anx=3D38;5;13:*.ogv=3D38;5;13:*.ogx=3D=
38;5;13:*.aac=3D38;5;45:*.au=3D38;5;45:*.flac=3D38;5;45:*.mid=3D38;5;45:*.=
midi=3D38;5;45:*.mka=3D38;5;45:*.mp3=3D38;5;45:*.mpc=3D38;5;45:*.ogg=3D38;=
5;45:*.ra=3D38;5;45:*.wav=3D38;5;45:*.axa=3D38;5;45:*.oga=3D38;5;45:*.spx=3D=
38;5;45:*.xspf=3D38;5;45:',=20'PGPASSWORD':=20'',=20'LESSOPEN':=20=
'||/usr/bin/lesspipe.sh=20%s',=20'HISTCONTROL':=20'ignoredups',=20'PWD':=20=
'/root',=20'LOGNAME':=20'root',=20'USER':=20'root',=20'OTOPI_LOGFILE':=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'HOME':=20'/root',=20'HISTSIZE':=20'1000',=20'XDG_SESSION_ID':=20=
'6',=20'OTOPI_EXECDIR':=20'/root',=20'PATH':=20=
'/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin'},=
=20'close_fds':=20True,=20'args':=20['/bin/pg_dump',=20'-E',=20'UTF8',=20=
'--disable-dollar-quoting',=20'--disable-triggers',=20'-U',=20=
'ovirt_engine_history',=20'-h',=20'localhost',=20'-p',=20'5432',=20=
'--format=3Dcustom',=20=
'--file=3D/var/lib/ovirt-engine-dwh/backups/dwh-20160818130012.aZ8Sq8.dump=
',=20'ovirt_engine_history'],=20'stderr':=20-1}=0A2016-08-18=2013:00:12=20=
DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema=20=
plugin.executePipeRaw:486=20executePipeRaw:=20[0]=20pid=20pid=3D23026=0A=
2016-08-18=2013:00:17=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema=20=
plugin.executePipeRaw:603=20executePipe-result:=20[0]=20['/bin/pg_dump',=20=
'-E',=20'UTF8',=20'--disable-dollar-quoting',=20'--disable-triggers',=20=
'-U',=20'ovirt_engine_history',=20'-h',=20'localhost',=20'-p',=20'5432',=20=
'--format=3Dcustom',=20=
'--file=3D/var/lib/ovirt-engine-dwh/backups/dwh-20160818130012.aZ8Sq8.dump=
',=20'ovirt_engine_history'],=20rc=3D0=0A2016-08-18=2013:00:17=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.backup:654=20=
db=20backup=20res=20{'result':=20[{'stderr':=20'',=20'rc':=200}],=20=
'stdout':=20''}=0A2016-08-18=2013:00:17=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'DWH=20schema=20Transaction'=0A=
2016-08-18=2013:00:17=20INFO=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema=20=
schema._misc:329=20Creating/refreshing=20DWH=20database=20schema=0A=
2016-08-18=2013:00:17=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema=20=
plugin.executeRaw:813=20execute:=20=
['/usr/share/ovirt-engine-dwh/dbscripts/schema.sh',=20'-s',=20=
'localhost',=20'-p',=20'5432',=20'-u',=20'ovirt_engine_history',=20'-d',=20=
'ovirt_engine_history',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-c',=20'apply'],=20executable=3D'None',=20cwd=3D'None',=20=
env=3D{'LANG':=20'en_US.UTF-8',=20'TERM':=20'xterm-256color',=20'SHELL':=20=
'/bin/bash',=20'MAIL':=20'/var/spool/mail/root',=20'SHLVL':=20'1',=20=
'PYTHONPATH':=20'/usr/share/ovirt-engine/setup/bin/..::',=20'HOSTNAME':=20=
'cultivar.grove.silverorange.com',=20'LS_COLORS':=20=
'rs=3D0:di=3D38;5;27:ln=3D38;5;51:mh=3D44;38;5;15:pi=3D40;38;5;11:so=3D38;=
5;13:do=3D38;5;5:bd=3D48;5;232;38;5;11:cd=3D48;5;232;38;5;3:or=3D48;5;232;=
38;5;9:mi=3D05;48;5;232;38;5;15:su=3D48;5;196;38;5;15:sg=3D48;5;11;38;5;16=
:ca=3D48;5;196;38;5;226:tw=3D48;5;10;38;5;16:ow=3D48;5;10;38;5;21:st=3D48;=
5;21;38;5;15:ex=3D38;5;34:*.tar=3D38;5;9:*.tgz=3D38;5;9:*.arc=3D38;5;9:*.a=
rj=3D38;5;9:*.taz=3D38;5;9:*.lha=3D38;5;9:*.lz4=3D38;5;9:*.lzh=3D38;5;9:*.=
lzma=3D38;5;9:*.tlz=3D38;5;9:*.txz=3D38;5;9:*.tzo=3D38;5;9:*.t7z=3D38;5;9:=
*.zip=3D38;5;9:*.z=3D38;5;9:*.Z=3D38;5;9:*.dz=3D38;5;9:*.gz=3D38;5;9:*.lrz=
=3D38;5;9:*.lz=3D38;5;9:*.lzo=3D38;5;9:*.xz=3D38;5;9:*.bz2=3D38;5;9:*.bz=3D=
38;5;9:*.tbz=3D38;5;9:*.tbz2=3D38;5;9:*.tz=3D38;5;9:*.deb=3D38;5;9:*.rpm=3D=
38;5;9:*.jar=3D38;5;9:*.war=3D38;5;9:*.ear=3D38;5;9:*.sar=3D38;5;9:*.rar=3D=
38;5;9:*.alz=3D38;5;9:*.ace=3D38;5;9:*.zoo=3D38;5;9:*.cpio=3D38;5;9:*.7z=3D=
38;5;9:*.rz=3D38;5;9:*.cab=3D38;5;9:*.jpg=3D38;5;13:*.jpeg=3D38;5;13:*.gif=
=3D38;5;13:*.bmp=3D38;5;13:*.pbm=3D38;5;13:*.pgm=3D38;5;13:*.ppm=3D38;5;13=
:*.tga=3D38;5;13:*.xbm=3D38;5;13:*.xpm=3D38;5;13:*.tif=3D38;5;13:*.tiff=3D=
38;5;13:*.png=3D38;5;13:*.svg=3D38;5;13:*.svgz=3D38;5;13:*.mng=3D38;5;13:*=
.pcx=3D38;5;13:*.mov=3D38;5;13:*.mpg=3D38;5;13:*.mpeg=3D38;5;13:*.m2v=3D38=
;5;13:*.mkv=3D38;5;13:*.webm=3D38;5;13:*.ogm=3D38;5;13:*.mp4=3D38;5;13:*.m=
4v=3D38;5;13:*.mp4v=3D38;5;13:*.vob=3D38;5;13:*.qt=3D38;5;13:*.nuv=3D38;5;=
13:*.wmv=3D38;5;13:*.asf=3D38;5;13:*.rm=3D38;5;13:*.rmvb=3D38;5;13:*.flc=3D=
38;5;13:*.avi=3D38;5;13:*.fli=3D38;5;13:*.flv=3D38;5;13:*.gl=3D38;5;13:*.d=
l=3D38;5;13:*.xcf=3D38;5;13:*.xwd=3D38;5;13:*.yuv=3D38;5;13:*.cgm=3D38;5;1=
3:*.emf=3D38;5;13:*.axv=3D38;5;13:*.anx=3D38;5;13:*.ogv=3D38;5;13:*.ogx=3D=
38;5;13:*.aac=3D38;5;45:*.au=3D38;5;45:*.flac=3D38;5;45:*.mid=3D38;5;45:*.=
midi=3D38;5;45:*.mka=3D38;5;45:*.mp3=3D38;5;45:*.mpc=3D38;5;45:*.ogg=3D38;=
5;45:*.ra=3D38;5;45:*.wav=3D38;5;45:*.axa=3D38;5;45:*.oga=3D38;5;45:*.spx=3D=
38;5;45:*.xspf=3D38;5;45:',=20'LESSOPEN':=20'||/usr/bin/lesspipe.sh=20=
%s',=20'HISTCONTROL':=20'ignoredups',=20'PWD':=20'/root',=20'LOGNAME':=20=
'root',=20'USER':=20'root',=20'OTOPI_LOGFILE':=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'HOME':=20'/root',=20'HISTSIZE':=20'1000',=20'XDG_SESSION_ID':=20=
'6',=20'OTOPI_EXECDIR':=20'/root',=20'DBFUNC_DB_PGPASSFILE':=20=
'/tmp/tmp8s8Ayx',=20'PATH':=20=
'/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin'}=0A=
*********=20QUERY=20**********=0Aselect=201;=0A=
**************************=0A=0A=20=20=20=20=20=20=20=201=0A=0A*********=20=
QUERY=20**********=0Acopy=20(=0A=09=09select=20count(*)=20as=20count=0A=09=
=09from=20pg_catalog.pg_tables=0A=09=09where=0A=09=09=09tablename=20=3D=20=
'schema_version'=20and=0A=09=09=09schemaname=20=3D=20'public'=0A=09)=20=
to=20stdout=20with=20delimiter=20as=20'|';=0A**************************=0A=
=0A*********=20QUERY=20**********=0Aselect=203020000;=0A=
**************************=0A=0A=20=203020000=0A=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20fn_db_add_column(v_table=20=
varchar(128),=20v_column=20varchar(128),=20v_column_def=20text)=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0A=0Abegin=0A=
=09if=20(not=20exists=20(select=201=20from=20information_schema.columns=20=
where=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column))=20then=0A=09=20=20=20=20begin=0A=09=09v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20ADD=20COLUMN=20'=20||=20v_column=20=
||=20'=20'=20||=20v_column_def;=0A=09=09EXECUTE=20v_sql;=0A=20=20=20=20=20=
=20=20=20=20=20=20=20end;=0A=09end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_drop_column(v_table=20varchar(128),=20v_column=20varchar(128))=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0Abegin=0A=20=
=20=20=20=20=20=20=20if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column))=20then=0A=20=20=20=20=20=20=20=20=20=20=20=
=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20DROP=20COLUMN=20'=20||=20=
v_column;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20EXECUTE=20=
v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=
=20end=20if;=0Aend;$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_change_column_type(v_table=20varchar(128),=20v_column=20=
varchar(128),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_type=20varchar(128),=20v_new_type=20=
varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20=
text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column=20and=20(udt_name=20ilike=20v_type=20or=20=
data_type=20ilike=20v_type)))=20then=0A=09=20=20=20=20begin=0A=09=09=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ALTER=20=
COLUMN=20'=20||=20v_column=20||=20'=20TYPE=20'=20||=20v_new_type;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_rename_column(v_table=20varchar(128),=20v_column=20varchar(128),=20=
v_new_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0A=
v_sql=20text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column))=20then=0A=09=20=20=20=20begin=0A=09=09=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20RENAME=20=
COLUMN=20'=20||=20v_column=20||=20'=20TO=20'=20||=20v_new_name;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_add_config_value(v_option_name=20varchar(100),=20v_option_value=20=
varchar(4000),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20v_version=20varchar(40))=0Areturns=20void=0AAS=20=
$procedure$=0Abegin=0A=20=20=20=20if=20(not=20exists=20(select=201=20=
from=20vdc_options=20where=20option_name=20ilike=20v_option_name=20and=20=
version=20=3D=20v_version))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=
=20=20=20=20=20=20=20=20=20=20insert=20into=20vdc_options=20=
(option_name,=20option_value,=20version)=20values=20(v_option_name,=20=
v_option_value,=20v_version);=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_value_all_versions(v_option_name=20varchar(100))=0A=
returns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20(exists=20=
(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=20=20=20=
=20=20=20=20=20=20delete=20from=20vdc_options=20where=20option_name=20=
ilike=20v_option_name;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_value(v_option_name=20varchar(100),=20v_version=20=
text)=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name=20and=20version=20in=20(select=20ID=20from=20=
fnSplitter(v_version))))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=
=20=20=20=20=20=20=20=20=20delete=20from=20vdc_options=20where=20=
option_name=20ilike=20v_option_name=20and=20version=20in=20(select=20ID=20=
from=20fnSplitter(v_version));=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_for_version(v_version=20text)=0Areturns=20void=0AAS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20delete=20from=20vdc_options=20where=20=
version=20in=20(select=20ID=20from=20fnSplitter(v_version));=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20FUNCTION=20fn_db_update_config_value(v_option_name=20=
varchar(100),=20v_option_value=20varchar(4000),=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_version=20=
varchar(40))=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20=
if=20(exists=20(select=201=20from=20vdc_options=20where=20option_name=20=
ilike=20v_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=
=20=20=20=20=20=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20update=20=20=
vdc_options=20set=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=
=20=20=20=20=20=20=20where=20option_name=20ilike=20v_option_name=20and=20=
version=20=3D=20v_version;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_update_default_config_value(v_option_name=20=
varchar(100),v_default_option_value=20varchar(4000),v_option_value=20=
varchar(4000),v_version=20varchar(40),v_ignore_default_value_case=20=
boolean)=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=20=20=20=
=20=20=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20if=20=
(v_ignore_default_value_case)=0A=20=20=20=20=20=20=20=20=20=20=20=20then=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20update=20=20vdc_options=20=
set=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20where=20option_name=20ilike=20v_option_name=20and=20=
option_value=20ilike=20v_default_option_value=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20update=20=20vdc_options=20set=20option_value=20=
=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
where=20option_name=20ilike=20v_option_name=20and=20option_value=20=3D=20=
v_default_option_value=20and=20version=20=3D=20v_version;=0A=20=20=20=20=20=
=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_rename_config_key(v_old_option_name=20=
varchar(100),v_new_option_name=20varchar(100),v_version=20varchar(40))=0A=
returns=20void=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20=
v_current_option_value=20varchar(4000);=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_old_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=20=20=
=20=20=20v_current_option_value:=3Doption_value=20from=20vdc_options=20=
where=20option_name=20ilike=20v_old_option_name=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20update=20vdc_options=20set=20=
option_name=20=3D=20v_new_option_name,=20option_value=20=3D=20=
v_current_option_value=0A=20=20=20=20=20=20=20=20=20=20=20where=20=20=
option_name=20ilike=20v_old_option_name=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0Acreate=20or=20replace=20function=20=
fn_db_create_constraint=20(=0A=20=20=20=20v_table=20varchar(128),=20=
v_constraint=20varchar(128),=20v_constraint_sql=20text)=0Areturns=20void=0A=
AS=20$procedure$=0Abegin=0A=20=20=20=20if=20=20NOT=20EXISTS=20(SELECT=20=
1=20from=20pg_constraint=20where=20conname=20ilike=20v_constraint)=20=
then=0A=20=20=20=20=20=20=20=20execute=20'ALTER=20TABLE=20'=20||=20=
v_table=20||=20=20'=20ADD=20CONSTRAINT=20'=20||=20v_constraint=20||=20'=20=
'=20||=20v_constraint_sql;=0A=20=20=20=20end=20if;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0Acreate=20or=20replace=20function=20=
fn_db_drop_constraint=20(=0A=20=20=20=20v_table=20varchar(128),=20=
v_constraint=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=
=20=20=20=20if=20=20EXISTS=20(SELECT=201=20from=20pg_constraint=20where=20=
conname=20ilike=20v_constraint)=20then=0A=20=20=20=20=20=20=20=20execute=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20=20'=20DROP=20CONSTRAINT=20'=20=
||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20attach_user_to_su_role(v_permission_id=20uuid)=0A=20=
=20RETURNS=20void=20AS=0A$procedure$=0A=20=20=20DECLARE=0A=20=20=20=
v_user_entry=20VARCHAR(255);=0A=20=20=20v_user_id=20=20UUID;=0A=20=20=20=
v_name=20=20VARCHAR(255);=0A=20=20=20v_domain=20=20VARCHAR(255);=0A=20=20=
=20v_user_name=20=20VARCHAR(255);=0A=0A=20=20=20v_document=20=20=
VARCHAR(64);=0A=20=20=20v_index=20=20INTEGER;=0ABEGIN=0A=0A=20=20=20=
select=20=20=20option_value=20INTO=20v_user_entry=20from=20vdc_options=20=
where=20option_name=20=3D=20'AdUserId';=0A=20=20=20select=20=20=20=
option_value=20INTO=20v_name=20from=20vdc_options=20where=20option_name=20=
=3D=20'AdUserName';=0A=20=20=20select=20=20=20option_value=20INTO=20=
v_domain=20from=20vdc_options=20where=20option_name=20=3D=20=
'DomainName';=0A=0A=20=20=20v_index=20:=3D=20POSITION(':'=20IN=20=
v_user_entry);=0A=20=20=20if=20(=20v_index=20<>=200=20)=20then=0A=20=20=20=
=20=20=20v_user_entry=20:=3D=20substring(=20v_user_entry=20from=20=
v_index=20+=201=20);=0A=20=20=20=20=20=20v_user_id=20:=3D=20CAST(=20=
v_user_entry=20AS=20uuid=20);=0A=20=20=20end=20if;=0A=0A=20=20=20v_index=20=
:=3D=20POSITION(':'=20IN=20v_name);=0A=20=20=20if=20(=20v_index=20<>=200=20=
)=20then=0A=20=20=20=20=20=20v_name=20:=3D=20substring(=20v_name=20from=20=
v_index=20+=201=20);=0A=20=20=20end=20if;=0A=0A--=20find=20if=20name=20=
already=20includes=20domain=20(@)=0A=20=20=20v_index=20:=3D=20=
POSITION('@'=20IN=20v_name);=0A=0A=20=20=20if=20(v_index=20=3D=200)=20=
then=0A=20=20=20=20=20=20v_user_name=20:=3D=20coalesce(v_name,'')=20||=20=
'@'=20||=20coalesce(v_domain,'');=0A=20=20=20else=0A=20=20=20=20=20=20=
v_user_name=20:=3D=20v_name;=0A=20=20=20end=20if;=0A=0A=0Ainsert=20into=20=
users(user_id,name,domain,username,groups,status)=20select=20v_user_id,=20=
v_name,=20v_domain,=20v_user_name,'',1=20where=20not=20exists=20(select=20=
user_id,name,domain,username,groups,status=20from=20users=20where=20=
user_id=20=3D=20v_user_id=20and=20name=20=3D=20v_name=20and=20domain=20=3D=
=20v_domain=20and=20username=20=3D=20v_user_name=20and=20groups=20=3D=20=
''=20and=20status=20=3D=201);=0A=0Ainsert=20into=20=
permissions(id,role_id,ad_element_id,object_id,object_type_id)=20select=20=
v_permission_id,=20'00000000-0000-0000-0000-000000000001',=20v_user_id,=20=
getGlobalIds('system'),=201=20where=20not=20exists(select=20=
role_id,ad_element_id,object_id,object_type_id=20from=20permissions=20=
where=20role_id=20=3D=20'00000000-0000-0000-0000-000000000001'=20and=20=
ad_element_id=20=3D=20v_user_id=20and=20object_id=3D=20=
getGlobalIds('system')=20and=20object_type_id=20=3D=201);=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20CheckDBConnection()=20RETURNS=20SETOF=20integer=20=
IMMUTABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=20SELECT=201;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=20from=20=
pg_proc=20inner=20join=20pg_namespace=20ns=20on=20=
(pg_proc.pronamespace=3Dns.oid)=20where=20ns.nspname=20=3D=20'public'=20=
and=20proname=20not=20ilike=20'uuid%'=20order=20by=20proname;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_views_syntax()=20RETURNS=20SETOF=20=
text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20=
select=20'DROP=20VIEW=20if=20exists=20'=20||=20table_name=20||=20'=20=
CASCADE;'=20from=20information_schema.views=20where=20table_schema=20=3D=20=
'public'=20order=20by=20table_name;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_tables_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20TABLE=20=
if=20exists=20'=20||=20table_name=20||=20'=20CASCADE;'=20from=20=
information_schema.tables=20where=20table_schema=20=3D=20'public'=20and=20=
table_type=20=3D=20'BASE=20TABLE'=20order=20by=20table_name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_seq_syntax()=20RETURNS=20SETOF=20=
text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20=
select=20'DROP=20SEQUENCE=20if=20exists=20'=20||=20sequence_name=20||=20=
'=20CASCADE;'=20from=20information_schema.sequences=20=20where=20=
sequence_schema=20=3D=20'public'=20order=20by=20sequence_name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_user_types_syntax()=20RETURNS=20=
SETOF=20text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20=
QUERY=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20FROM=20pg_namespace=20n,=20pg_class=20c,=20pg_type=20t=0A=20=20=20=
WHERE=20n.oid=20=3D=20c.relnamespace=20and=20t.typrelid=20=3D=20c.oid=20=
and=20c.relkind=20=3D=20'c'::"char"=20and=0A=20=20=20n.nspname=20=3D=20=
'public'=0A=20=20=20ORDER=20BY=20=20=
c.relname::information_schema.sql_identifier;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_get_column_size(=20v_table=20varchar(64),=20v_column=20varchar(64))=20=
returns=20integer=20STABLE=0A=20=20=20AS=20$procedure$=0A=20=20=20=
declare=0A=20=20=20retvalue=20=20integer;=0ABEGIN=0A=20=20=20retvalue=20=
:=3D=20character_maximum_length=20from=20information_schema.columns=0A=20=
=20=20=20where=0A=20=20=20=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column=20and=0A=20=20=20=20table_schema=20=3D=20=
'public'=20and=20udt_name=20in=20('char','varchar');=0A=20=20=20return=20=
retvalue;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
attach_user_to_su_role(v_permission_id=20uuid,=20v_user_id=20=
VARCHAR(255),=20v_name=20VARCHAR(255),=20v_domain=20VARCHAR(255))=0A=20=20=
RETURNS=20void=20AS=0A$BODY$=0A=20=20=20DECLARE=0A=20=20=20v_user_name=20=
VARCHAR(255);=0A=20=20=20v_document=20=20VARCHAR(64);=0A=20=20=20v_index=20=
=20INTEGER;=0A=20=20=20input_uuid=20uuid;=0ABEGIN=0A=20=20=20input_uuid=20=
=3D=20CAST(=20v_user_id=20AS=20uuid=20);=0A--=20find=20if=20name=20=
already=20includes=20domain=20(@)=0A=20=20=20v_index=20:=3D=20=
POSITION('@'=20IN=20v_name);=0A=0A=20=20=20if=20(v_index=20=3D=200)=20=
then=0A=20=20=20=20=20=20v_user_name=20:=3D=20coalesce(v_name,'')=20||=20=
'@'=20||=20coalesce(v_domain,'');=0A=20=20=20else=0A=20=20=20=20=20=20=
v_user_name=20:=3D=20v_name;=0A=20=20=20end=20if;=0A=0A=0Ainsert=20into=20=
users(user_id,name,domain,username,groups,status)=20select=20input_uuid,=20=
v_name,=20v_domain,=20v_user_name,'',1=20where=20not=20exists=20(select=20=
user_id,name,domain,username,groups,status=20from=20users=20where=20=
user_id=20=3D=20input_uuid);=0A=0Ainsert=20into=20=
permissions(id,role_id,ad_element_id,object_id,object_type_id)=20select=20=
v_permission_id,=20'00000000-0000-0000-0000-000000000001',=20input_uuid,=20=
getGlobalIds('system'),=201=20where=20not=20exists(select=20=
role_id,ad_element_id,object_id,object_type_id=20from=20permissions=20=
where=20role_id=20=3D=20'00000000-0000-0000-0000-000000000001'=20and=20=
ad_element_id=20=3D=20input_uuid=20and=20object_id=3D=20=
getGlobalIds('system')=20and=20object_type_id=20=3D=201);=0AEND;=20=
$BODY$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20=
FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
FUNCTION=20fn_db_add_action_group_to_role(v_role_id=20UUID,=20=
v_action_group_id=20INTEGER)=0ARETURNS=20VOID=0AAS=20$procedure$=0ABEGIN=0A=
=20=20=20=20=20=20=20INSERT=20INTO=20=
roles_groups(role_id,action_group_id)=0A=20=20=20=20=20=20=20SELECT=20=
v_role_id,=20v_action_group_id=0A=20=20=20=20=20=20=20WHERE=20NOT=20=
EXISTS=20(SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20FROM=20roles_groups=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20role_id=20=3D=20=
v_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20action_group_id=20=3D=20v_action_group_id);=0ARETURN;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_split_config_value(v_option_name=20character=20=
varying,=20v_old_option_value=20character=20varying,=20=
v_new_option_value=20character=20varying,=20v_update_from_version=20=
character=20varying)=0A=20=20RETURNS=20void=20AS=0A$BODY$=0Adeclare=0A=
v_old_value=20varchar(4000);=0Av_cur=20cursor=20for=20select=20distinct=20=
version=20from=20vdc_options=20where=20version=20<>=20'general'=20order=20=
by=20version;=0Av_version=20varchar(40);=0Av_index=20integer;=0Av_count=20=
integer;=0Av_total_count=20integer;=0Av_version_count=20integer;=0Abegin=0A=
=20=20=20=20v_total_count=20:=3D=20count(version)=20from=20vdc_options=20=
where=20option_name=20=3D=20v_option_name;=0A=20=20=20=20v_old_value=20=
:=3D=20option_value=20from=20vdc_options=20where=20option_name=20=3D=20=
v_option_name=20and=20version=20=3D=20'general';=0A=20=20=20=20=
v_version_count=20:=3D=20count(distinct=20version)=20from=20vdc_options=20=
where=20version=20<>=20'general';=0A=20=20=20=20if=20(v_total_count=20<=3D=
=20v_version_count)=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=20=
=20=20=20=20=20=20=20=20if=20(v_old_value=20IS=20NULL)=20then=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20v_old_value=20:=3D=20=
v_old_option_value;=0A=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=20=
=20=20=20=20=20=20=20=20=20=20=20v_count=20:=3D=20count(distinct=20=
version)=20from=20vdc_options=20where=20version=20<>=20'general';=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_index=20:=3D=201;=0A=20=20=20=20=20=20=20=
=20open=20v_cur;=0A=20=20=20=20=20=20=20=20loop=0A=20=20=20=20=20=20=20=20=
=20=20=20=20fetch=20v_cur=20into=20v_version;=0A=20=20=20=20=20=20=20=20=20=
=20=20=20exit=20when=20not=20found;=0A=20=20=20=20=20=20=20=20=20=20=20=20=
--=20We=20shouldn't=20update=20if=20already=20exists=0A=20=20=20=20=20=20=
=20=20=20=20=20=20if=20(not=20exists=20(select=201=20from=20vdc_options=20=
where=20option_name=20=3D=20v_option_name=20and=20version=20=3D=20=
v_version))=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=20=
Might=20not=20work=20well=20for=20versions=20such=20as=203.10,=20but=20=
we=20currently=20don't=20have=20any=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20if=20(v_version=20>=3D=20v_update_from_version)=20then=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20insert=20into=20=
vdc_options=20(option_name,=20option_value,=20version)=20values=20=
(v_option_name,=20v_new_option_value,=20v_version);=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20insert=20into=20vdc_options=20(option_name,=20=
option_value,=20version)=20values=20(v_option_name,=20v_old_value,=20=
v_version);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=
=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_index=20:=3D=20v_index=20+1;=0A=20=20=20=20=20=20=20=20end=20=
loop;=0A=20=20=20=20=20=20=20=20close=20v_cur;=0A=20=20=20=20=20=20=20=20=
delete=20from=20vdc_options=20where=20option_name=20=3D=20v_option_name=20=
and=20version=20=3D=20'general';=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_grant_action_group_to_all_roles_filter(v_action_group_id=20=
integer,=20uuid[])=0A=20=20RETURNS=20void=20AS=0A$BODY$=0Adeclare=0A=
v_role_id_to_filter=20alias=20for=20$2;=0Abegin=0A=20=20=20=20insert=20=
into=20roles_groups=20(role_id,=20action_group_id)=0A=20=20=20=20select=20=
distinct=20role_id,=20v_action_group_id=0A=20=20=20=20from=20=
roles_groups=20rg=0A=20=20=20=20where=20not=20ARRAY=20[role_id]=20<@=20=
v_role_id_to_filter=20and=20not=20exists=20(select=201=20from=20=
roles_groups=20where=20role_id=20=3D=20rg.role_id=20and=20=
action_group_id=20=3D=20v_action_group_id);=0AEND;=20$BODY$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_mask_object(v_object=20regclass)=20RETURNS=20setof=20record=20as=0A=
$BODY$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=20=20=20=20v_table=20=
record;=0A=20=20=20=20v_table_name=20TEXT;=0A=20=20=20=20temprec=20=
record;=0ABEGIN=0A=20=20=20=20--=20get=20full=20table/view=20name=20from=20=
v_object=20(i.e=20<namespace>.<name>)=0A=20=20=20=20select=20c.relname,=20=
n.nspname=20INTO=20v_table=0A=20=20=20=20=20=20=20=20FROM=20pg_class=20c=20=
join=20pg_namespace=20n=20on=20c.relnamespace=20=3D=20n.oid=20WHERE=20=
c.oid=20=3D=20v_object;=0A=20=20=20=20--=20try=20to=20get=20filtered=20=
query=20syntax=20from=20previous=20execution=0A=20=20=20=20if=20exists=20=
(select=201=20from=20object_column_white_list_sql=20where=20object_name=20=
=3D=20v_table.relname)=20then=0A=09select=20sql=20into=20v_sql=20from=20=
object_column_white_list_sql=20where=20object_name=20=3D=20=
v_table.relname;=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
v_table_name=20:=3D=20quote_ident(=20v_table.nspname=20)=20||=20'.'=20||=20=
quote_ident(=20v_table.relname=20);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20=20=20=20=20for=20temprec=20in=20select=20a.attname,=20=
t.typname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_attribute=20a=20join=20pg_type=20t=20on=20a.atttypid=20=3D=
=20t.oid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20a.attrelid=20=3D=20v_object=20AND=20a.attnum=20>=200=20AND=20=
NOT=20a.attisdropped=20ORDER=20BY=20a.attnum=0A=20=20=20=20=20=20=20=20=
loop=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20coalesce(=20=
v_sql=20||=20',=20',=20'SELECT=20'=20);=0A=20=20=20=20=20=20=20=20=20=20=20=
=20if=20exists(select=201=20from=20object_column_white_list=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20where=20object_name=20=3D=20=
v_table.relname=20and=20column_name=20=3D=20temprec.attname)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20=
quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20=
||=20'NULL::'=20||=20quote_ident(=20temprec.typname=20)=20||=20'=20as=20=
'=20||=20quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=
=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20END=20LOOP;=0A=20=20=20=20=20=
=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=
=20=20=20=20=20=20=20=20v_sql=20:=3D=20'SELECT=20x::'=20||=20=
v_table_name=20||=20'=20as=20rec=20FROM=20('=20||=20v_sql=20||=20')=20as=20=
x';=0A=20=20=20=20=20=20=20=20--=20save=20generated=20query=20for=20=
further=20use=0A=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list_sql(object_name,sql)=20values=20=
(v_table.relname,=20v_sql);=0A=20=20=20=20end=20if;=0A=20=20=20=20RETURN=20=
QUERY=20EXECUTE=20v_sql;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_add_column_to_object_white_list(v_object_name=20varchar(128),=20=
v_column_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0A=
begin=0A=20=20=20=20if=20(not=20exists=20(select=201=20from=20=
object_column_white_list=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20where=20object_name=20=3D=20v_object_name=20and=20=
column_name=20=3D=20v_column_name))=20then=0A=20=20=20=20=20=20=20=20=
begin=0A=20=20=20=20=20=20=20=20=20=20=20=20--=20verify=20that=20there=20=
is=20such=20object=20in=20db=0A=20=20=20=20=20=20=20=20=20=20=20=20if=20=
exists=20(select=201=20from=20information_schema.columns=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20where=20table_name=20=
=3D=20v_object_name=20and=20column_name=20=3D=20v_column_name)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list=20(object_name,=20column_name)=20values=20=
(v_object_name,=20v_column_name);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
end=20if;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20FUNCTION=20fn_db_unlock_disk(v_id=20UUID)=0Areturns=20void=0A=
AS=20$procedure$=0Adeclare=0A=20=20=20=20OK=20integer;=0A=20=20=20=20=
LOCKED=20integer;=0Abegin=0A=20=20=20=20OK:=3D1;=0A=20=20=20=20=
LOCKED:=3D2;=0A=20=20=20=20update=20images=20set=20imagestatus=20=3D=20=
OK=20where=20imagestatus=20=3D=20LOCKED=20and=0A=20=20=20=20=
image_group_id=20in=20(select=20device_id=20from=20vm_device=20where=20=
device_id=20=3D=20v_id=20and=20is_plugged);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_unlock_snapshot(v_id=20UUID)=0Areturns=20void=0AAS=20$procedure$=0A=
declare=0A=20=20=20=20OK=20varchar;=0A=20=20=20=20LOCKED=20varchar;=0A=
begin=0A=20=20=20=20OK:=3D'OK';=0A=20=20=20=20LOCKED:=3D'LOCKED';=0A=20=20=
=20=20update=20snapshots=20set=20status=20=3D=20OK=20where=20status=20=3D=20=
LOCKED=20and=20snapshot_id=20=3D=20v_id;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_unlock_entity(v_object_type=20varchar(10),=20v_name=20=
varchar(255),=20v_recursive=20boolean)=0Areturns=20void=0AAS=20=
$procedure$=0Adeclare=0A=20=20=20=20DOWN=20integer;=0A=20=20=20=20OK=20=
integer;=0A=20=20=20=20LOCKED=20integer;=0A=20=20=20=20TEMPLATE_OK=20=
integer;=0A=20=20=20=20TEMPLATE_LOCKED=20integer;=0A=20=20=20=20=
IMAGE_LOCKED=20integer;=0A=20=20=20=20SNAPSHOT_OK=20varchar;=0A=20=20=20=20=
SNAPSHOT_LOCKED=20varchar;=0A=20=20=20=20v_id=20UUID;=0Abegin=0A=20=20=20=
=20DOWN:=3D0;=0A=20=20=20=20OK:=3D1;=0A=20=20=20=20LOCKED:=3D2;=0A=20=20=20=
=20TEMPLATE_OK:=3D0;=0A=20=20=20=20TEMPLATE_LOCKED:=3D1;=0A=20=20=20=20=
IMAGE_LOCKED:=3D15;=0A=20=20=20=20SNAPSHOT_OK:=3D'OK';=0A=20=20=20=20=
SNAPSHOT_LOCKED:=3D'LOCKED';=0A=20=20=20=20v_id=20:=3D=20vm_guid=20from=20=
vm_static=20where=20vm_name=20=3D=20v_name=20and=20entity_type=20ilike=20=
v_object_type;=0A=20=20=20=20--=20set=20VM=20status=20to=20DOWN=0A=20=20=20=
=20if=20(v_object_type=20=3D=20'vm')=20then=0A=20=20=20=20=20=20=20=20=
update=20vm_dynamic=20set=20status=20=3D=20DOWN=20where=20status=20=3D=20=
IMAGE_LOCKED=20and=20vm_guid=20=20=3D=20v_id;=0A=20=20=20=20--=20set=20=
Template=20status=20to=20OK=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
if=20(v_object_type=20=3D=20'template')=20then=0A=20=20=20=20=20=20=20=20=
=20=20=20=20update=20vm_static=20set=20template_status=20=3D=20=
TEMPLATE_OK=20where=20template_status=20=3D=20TEMPLATE_LOCKED=20and=20=
vm_guid=20=20=3D=20v_id;=0A=20=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=
end=20if;=0A=20=20=20=20--unlock=20images=20and=20snapshots=20=20if=20=
recursive=20flag=20is=20set=0A=20=20=20=20if=20(v_recursive)=20then=0A=20=
=20=20=20=20=20=20=20update=20images=20set=20imagestatus=20=3D=20OK=20=
where=20imagestatus=20=3D=20LOCKED=20and=0A=20=20=20=20=20=20=20=20=
image_group_id=20in=20(select=20device_id=20from=20vm_device=20where=20=
vm_id=20=3D=20v_id=20and=20is_plugged);=0A=0A=20=20=20=20=20=20=20=20=
update=20snapshots=20set=20status=20=3D=20SNAPSHOT_OK=20where=20status=20=
ilike=20SNAPSHOT_LOCKED=20and=20vm_id=20=3D=20v_id;=0A=20=20=20=20end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A/*=20Displays=20DC=20id=20,=20DC=20name,=20SPM=20Host=20id=20=
,=20SPM=20Host=20name=20and=20number=20of=20async=20tasks=20awaiting.=0A=0A=
1)=20create=20a=20record=20type=20with=20DC=20name,=20DC=20id,=20SPM=20=
host=20id,=20SPM=20host=20name,=20count=0A=0A2)=20get=20all=20distinct=20=
DC=20ids=20from=20async_tasks=20table=0A=0A3)=20Run=20a=20cursor=20for=20=
each=20result=20in=202)=0A=0A=20=20=20a)=20get=20DC=20name=0A=20=20=20b)=20=
get=20SPM=20Host=20id=20&=20name=20if=20available=0A=20=20=20c)=20get=20=
count=20of=20tasks=0A=0A=20=20=20return=20current=20record=0A=0A4)=20=
return=20set=20of=20generated=20records=0A*/=0ADROP=20TYPE=20IF=20EXISTS=20=
async_tasks_info_rs=20CASCADE;=0A**************************=0A=0ADROP=20=
TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
async_tasks_info_rs=20AS=20(=0A=20=20=20=20dc_id=20UUID,=20dc_name=20=
CHARACTER=20VARYING,=20spm_host_id=20UUID,=20spm_host_name=20CHARACTER=20=
VARYING,=20task_count=20integer);=0A**************************=0A=0A=
CREATE=20TYPE=0A*********=20QUERY=20**********=0Acreate=20or=20replace=20=
FUNCTION=20fn_db_get_async_tasks()=0Areturns=20SETOF=20=
async_tasks_info_rs=20STABLE=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20=
v_record=20async_tasks_info_rs;=0A=0A=20=20=20=20--=20selects=20=
storage_pool_id=20uuid=20found=20in=20async_tasks=0A=20=20=20=20=
v_tasks_cursor=20cursor=20for=20select=20distinct=20storage_pool_id=20=
from=20async_tasks;=0Abegin=0A=0A=20=20=20=20OPEN=20v_tasks_cursor;=0A=20=
=20=20=20FETCH=20v_tasks_cursor=20into=20v_record.dc_id;=0A=20=20=20=20=
WHILE=20FOUND=20LOOP=0A=20=20=20=20=20=20=20=20--=20get=20dc_name=20and=20=
SPM=20Host=20id=0A=20=20=20=20=20=20=20=20v_record.dc_name=20:=3D=20name=20=
from=20storage_pool=20where=20id=20=3D=20v_record.dc_id;=0A=20=20=20=20=20=
=20=20=20v_record.spm_host_id=20:=3D=0A=20=20=20=20=20=20=20=20=20=20=20=20=
spm_vds_id=20from=20storage_pool=20where=20id=20=3D=20v_record.dc_id;=0A=20=
=20=20=20=20=20=20=20--=20get=20Host=20name=20if=20we=20have=20non=20=
NULL=20SPM=20Host=0A=20=20=20=20=20=20=20=20if=20(v_record.spm_host_id=20=
IS=20NOT=20NULL)=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_record.spm_host_name=20:=3D=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20vds_name=20from=20vds_static=20where=20vds_id=20=3D=20=
v_record.spm_host_id;=0A=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_record.spm_host_name:=3D'';=0A=20=20=20=20=20=20=20=20=
end=20if;=0A=20=20=20=20=20=20=20=20--=20get=20tasks=20count=20for=20=
this=20DC=0A=20=20=20=20=20=20=20=20v_record.task_count=20:=3D=20=
count(*)=20from=20async_tasks=0A=20=20=20=20=20=20=20=20=20=20=20=20=
where=20position=20(cast(v_record.dc_id=20as=20varchar)=20in=20=
action_parameters)=20>=200;=0A=20=20=20=20=20=20=20=20--=20return=20the=20=
record=0A=20=20=20=20=20=20=20=20RETURN=20NEXT=20v_record;=0A=20=20=20=20=
=20=20=20=20FETCH=20v_tasks_cursor=20into=20v_record.dc_id;=0A=20=20=20=20=
END=20LOOP;=0A=20=20=20=20CLOSE=20v_tasks_cursor;=0A=20=20=20=20--=20=
return=20full=20set=20of=20generated=20records=0A=20=20=20=20RETURN;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Aselect=20*=20from=20=
generate_drop_all_views_syntax();=0A**************************=0A=0A=20=
DROP=20VIEW=20if=20exists=20disks_vm_map=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v3_6_configuration_history_clusters=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20v3_6_configuration_history_datacenters=20CASCADE;=0A=
=20DROP=20VIEW=20if=20exists=20v3_6_configuration_history_hosts=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v3_6_configuration_history_hosts_interfaces=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v3_6_configuration_history_storage_domains=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v3_6_configuration_history_vms=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v3_6_configuration_history_vms_devices=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v3_6_configuration_history_vms_disks=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20v3_6_configuration_history_vms_interfaces=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20v3_6_enum_translator=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v3_6_latest_configuration_clusters=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20v3_6_latest_configuration_datacenters=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v3_6_latest_configuration_hosts=20CASCADE;=0A=
=20DROP=20VIEW=20if=20exists=20=
v3_6_latest_configuration_hosts_interfaces=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v3_6_latest_configuration_storage_domains=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v3_6_latest_configuration_vms=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v3_6_latest_configuration_vms_devices=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v3_6_latest_configuration_vms_disks=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20v3_6_latest_configuration_vms_interfaces=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20v3_6_latest_map_datacenters_storage_domains=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20v3_6_latest_tags_details=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20v3_6_latest_tags_relations=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20v3_6_latest_users_details=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v3_6_map_history_datacenters_storage_domains=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v3_6_statistics_datacenters_resources_usage_daily=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v3_6_statistics_datacenters_resources_usage_hourly=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20v3_6_statistics_datacenters_resources_usage_samples=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v3_6_statistics_hosts_interfaces_resources_usage_daily=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v3_6_statistics_hosts_interfaces_resources_usage_hourly=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v3_6_statistics_hosts_interfaces_resources_usage_samples=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v3_6_statistics_hosts_resources_usage_daily=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v3_6_statistics_hosts_resources_usage_hourly=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v3_6_statistics_hosts_resources_usage_samples=20CASCADE;=0A=
=20DROP=20VIEW=20if=20exists=20=
v3_6_statistics_storage_domains_resources_usage_daily=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v3_6_statistics_storage_domains_resources_usage_hourly=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v3_6_statistics_storage_domains_resources_usage_samples=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_disks_resources_usage_daily=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20v3_6_statistics_vms_disks_resources_usage_hourly=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_disks_resources_usage_samples=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20=
v3_6_statistics_vms_interfaces_resources_usage_daily=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_interfaces_resources_usage_hourly=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_interfaces_resources_usage_samples=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v3_6_statistics_vms_resources_usage_daily=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_resources_usage_hourly=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v3_6_statistics_vms_resources_usage_samples=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v3_6_statistics_vms_users_usage_daily=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_users_usage_hourly=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20v3_6_tags_details_history=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20v3_6_tags_relations_history=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20v3_6_users_details_history=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20v4_0_configuration_history_clusters=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v4_0_configuration_history_datacenters=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v4_0_configuration_history_hosts=20CASCADE;=0A=
=20DROP=20VIEW=20if=20exists=20=
v4_0_configuration_history_hosts_interfaces=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v4_0_configuration_history_storage_domains=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v4_0_configuration_history_vms=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v4_0_configuration_history_vms_devices=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v4_0_configuration_history_vms_disks=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20v4_0_configuration_history_vms_interfaces=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20v4_0_enum_translator=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v4_0_fully_joined_statistics_hosts_resources_usage_daily=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v4_0_fully_joined_statistics_hosts_resources_usage_hourly=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v4_0_fully_joined_statistics_hosts_resources_usage_samples=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v4_0_fully_joined_statistics_vms_resources_usage_daily=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v4_0_fully_joined_statistics_vms_resources_usage_hourly=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v4_0_fully_joined_statistics_vms_resources_usage_samples=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v4_0_latest_configuration_clusters=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v4_0_latest_configuration_datacenters=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20v4_0_latest_configuration_hosts=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v4_0_latest_configuration_hosts_interfaces=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v4_0_latest_configuration_storage_domains=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20v4_0_latest_configuration_vms=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v4_0_latest_configuration_vms_devices=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20v4_0_latest_configuration_vms_disks=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v4_0_latest_configuration_vms_interfaces=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v4_0_latest_map_datacenters_storage_domains=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20v4_0_latest_tags_details=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20v4_0_latest_tags_relations=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20v4_0_latest_users_details=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v4_0_map_history_datacenters_storage_domains=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v4_0_statistics_hosts_interfaces_resources_usage_daily=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v4_0_statistics_hosts_interfaces_resources_usage_hourly=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v4_0_statistics_hosts_interfaces_resources_usage_samples=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v4_0_statistics_hosts_resources_usage_daily=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v4_0_statistics_hosts_resources_usage_hourly=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v4_0_statistics_hosts_resources_usage_samples=20CASCADE;=0A=
=20DROP=20VIEW=20if=20exists=20=
v4_0_statistics_storage_domains_resources_usage_daily=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v4_0_statistics_storage_domains_resources_usage_hourly=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v4_0_statistics_storage_domains_resources_usage_samples=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_disks_resources_usage_daily=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20v4_0_statistics_vms_disks_resources_usage_hourly=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_disks_resources_usage_samples=20CASCADE;=0A=20DROP=20=
VIEW=20if=20exists=20=
v4_0_statistics_vms_interfaces_resources_usage_daily=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_interfaces_resources_usage_hourly=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_interfaces_resources_usage_samples=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v4_0_statistics_vms_resources_usage_daily=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_resources_usage_hourly=20CASCADE;=0A=20DROP=20VIEW=20=
if=20exists=20v4_0_statistics_vms_resources_usage_samples=20CASCADE;=0A=20=
DROP=20VIEW=20if=20exists=20v4_0_statistics_vms_users_usage_daily=20=
CASCADE;=0A=20DROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_users_usage_hourly=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20v4_0_tags_details_history=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20v4_0_tags_relations_history=20CASCADE;=0A=20DROP=20VIEW=20if=20=
exists=20v4_0_users_details_history=20CASCADE;=0A=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20disks_vm_map=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_configuration_history_clusters=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_configuration_history_datacenters=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_configuration_history_hosts=20CASCADE;=0A**************************=0A=
=0ADROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20=
exists=20v3_6_configuration_history_hosts_interfaces=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_configuration_history_storage_domains=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20v3_6_configuration_history_vms=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_configuration_history_vms_devices=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_configuration_history_vms_disks=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_configuration_history_vms_interfaces=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20v3_6_enum_translator=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_latest_configuration_clusters=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_latest_configuration_datacenters=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20v3_6_latest_configuration_hosts=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_latest_configuration_hosts_interfaces=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_latest_configuration_storage_domains=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20v3_6_latest_configuration_vms=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_latest_configuration_vms_devices=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_latest_configuration_vms_disks=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_latest_configuration_vms_interfaces=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_latest_map_datacenters_storage_domains=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20v3_6_latest_tags_details=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_latest_tags_relations=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_latest_users_details=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_map_history_datacenters_storage_domains=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_datacenters_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_datacenters_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_datacenters_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_hosts_interfaces_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_hosts_interfaces_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_hosts_interfaces_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_hosts_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_hosts_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_hosts_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_storage_domains_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_storage_domains_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_storage_domains_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_disks_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_disks_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_disks_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_interfaces_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_interfaces_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_interfaces_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_users_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_statistics_vms_users_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20v3_6_tags_details_history=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_tags_relations_history=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v3_6_users_details_history=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_configuration_history_clusters=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_configuration_history_datacenters=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_configuration_history_hosts=20CASCADE;=0A**************************=0A=
=0ADROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20=
exists=20v4_0_configuration_history_hosts_interfaces=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_configuration_history_storage_domains=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20v4_0_configuration_history_vms=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_configuration_history_vms_devices=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_configuration_history_vms_disks=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_configuration_history_vms_interfaces=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20v4_0_enum_translator=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_fully_joined_statistics_hosts_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_fully_joined_statistics_hosts_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_fully_joined_statistics_hosts_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_fully_joined_statistics_vms_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_fully_joined_statistics_vms_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_fully_joined_statistics_vms_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_latest_configuration_clusters=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_latest_configuration_datacenters=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20v4_0_latest_configuration_hosts=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_latest_configuration_hosts_interfaces=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_latest_configuration_storage_domains=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20v4_0_latest_configuration_vms=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_latest_configuration_vms_devices=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_latest_configuration_vms_disks=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_latest_configuration_vms_interfaces=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_latest_map_datacenters_storage_domains=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20v4_0_latest_tags_details=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_latest_tags_relations=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_latest_users_details=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_map_history_datacenters_storage_domains=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_hosts_interfaces_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_hosts_interfaces_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_hosts_interfaces_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_hosts_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_hosts_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_hosts_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_storage_domains_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_storage_domains_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_storage_domains_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_disks_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_disks_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_disks_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_interfaces_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_interfaces_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_interfaces_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_resources_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_resources_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_resources_usage_samples=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_users_usage_daily=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_statistics_vms_users_usage_hourly=20CASCADE;=0A=
**************************=0A=0ADROP=20VIEW=0A*********=20QUERY=20=
**********=0ADROP=20VIEW=20if=20exists=20v4_0_tags_details_history=20=
CASCADE;=0A**************************=0A=0ADROP=20VIEW=0A*********=20=
QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_tags_relations_history=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ADROP=20VIEW=20if=20exists=20=
v4_0_users_details_history=20CASCADE;=0A**************************=0A=0A=
DROP=20VIEW=0A*********=20QUERY=20**********=0ACreate=20or=20replace=20=
FUNCTION=20fn_db_add_column(v_table=20varchar(128),=20v_column=20=
varchar(128),=20v_column_def=20text)=0Areturns=20void=0AAS=20$procedure$=0A=
declare=0Av_sql=20text;=0A=0Abegin=0A=09if=20(not=20exists=20(select=201=20=
from=20information_schema.columns=20where=20table_name=20ilike=20v_table=20=
and=20column_name=20ilike=20v_column))=20then=0A=09=20=20=20=20begin=0A=09=
=09v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ADD=20=
COLUMN=20'=20||=20v_column=20||=20'=20'=20||=20v_column_def;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_drop_column(v_table=20varchar(128),=20v_column=20varchar(128))=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0Abegin=0A=20=
=20=20=20=20=20=20=20if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column))=20then=0A=20=20=20=20=20=20=20=20=20=20=20=
=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20DROP=20COLUMN=20'=20||=20=
v_column;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20EXECUTE=20=
v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=
=20end=20if;=0Aend;$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_change_column_type(v_table=20varchar(128),=20v_column=20=
varchar(128),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_type=20varchar(128),=20v_new_type=20=
varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20=
text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column=20and=20(udt_name=20ilike=20v_type=20or=20=
data_type=20ilike=20v_type)))=20then=0A=09=20=20=20=20begin=0A=09=09=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ALTER=20=
COLUMN=20'=20||=20v_column=20||=20'=20TYPE=20'=20||=20v_new_type;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_rename_column(v_table=20varchar(128),=20v_column=20varchar(128),=20=
v_new_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0A=
v_sql=20text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column))=20then=0A=09=20=20=20=20begin=0A=09=09=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20RENAME=20=
COLUMN=20'=20||=20v_column=20||=20'=20TO=20'=20||=20v_new_name;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_add_config_value(v_option_name=20varchar(100),=20v_option_value=20=
varchar(4000),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20v_version=20varchar(40))=0Areturns=20void=0AAS=20=
$procedure$=0Abegin=0A=20=20=20=20if=20(not=20exists=20(select=201=20=
from=20vdc_options=20where=20option_name=20ilike=20v_option_name=20and=20=
version=20=3D=20v_version))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=
=20=20=20=20=20=20=20=20=20=20insert=20into=20vdc_options=20=
(option_name,=20option_value,=20version)=20values=20(v_option_name,=20=
v_option_value,=20v_version);=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_value_all_versions(v_option_name=20varchar(100))=0A=
returns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20(exists=20=
(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=20=20=20=
=20=20=20=20=20=20delete=20from=20vdc_options=20where=20option_name=20=
ilike=20v_option_name;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_value(v_option_name=20varchar(100),=20v_version=20=
text)=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name=20and=20version=20in=20(select=20ID=20from=20=
fnSplitter(v_version))))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=
=20=20=20=20=20=20=20=20=20delete=20from=20vdc_options=20where=20=
option_name=20ilike=20v_option_name=20and=20version=20in=20(select=20ID=20=
from=20fnSplitter(v_version));=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_for_version(v_version=20text)=0Areturns=20void=0AAS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20delete=20from=20vdc_options=20where=20=
version=20in=20(select=20ID=20from=20fnSplitter(v_version));=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20FUNCTION=20fn_db_update_config_value(v_option_name=20=
varchar(100),=20v_option_value=20varchar(4000),=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_version=20=
varchar(40))=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20=
if=20(exists=20(select=201=20from=20vdc_options=20where=20option_name=20=
ilike=20v_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=
=20=20=20=20=20=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20update=20=20=
vdc_options=20set=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=
=20=20=20=20=20=20=20where=20option_name=20ilike=20v_option_name=20and=20=
version=20=3D=20v_version;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_update_default_config_value(v_option_name=20=
varchar(100),v_default_option_value=20varchar(4000),v_option_value=20=
varchar(4000),v_version=20varchar(40),v_ignore_default_value_case=20=
boolean)=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=20=20=20=
=20=20=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20if=20=
(v_ignore_default_value_case)=0A=20=20=20=20=20=20=20=20=20=20=20=20then=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20update=20=20vdc_options=20=
set=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20where=20option_name=20ilike=20v_option_name=20and=20=
option_value=20ilike=20v_default_option_value=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20update=20=20vdc_options=20set=20option_value=20=
=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
where=20option_name=20ilike=20v_option_name=20and=20option_value=20=3D=20=
v_default_option_value=20and=20version=20=3D=20v_version;=0A=20=20=20=20=20=
=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_rename_config_key(v_old_option_name=20=
varchar(100),v_new_option_name=20varchar(100),v_version=20varchar(40))=0A=
returns=20void=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20=
v_current_option_value=20varchar(4000);=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_old_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=20=20=
=20=20=20v_current_option_value:=3Doption_value=20from=20vdc_options=20=
where=20option_name=20ilike=20v_old_option_name=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20update=20vdc_options=20set=20=
option_name=20=3D=20v_new_option_name,=20option_value=20=3D=20=
v_current_option_value=0A=20=20=20=20=20=20=20=20=20=20=20where=20=20=
option_name=20ilike=20v_old_option_name=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0Acreate=20or=20replace=20function=20=
fn_db_create_constraint=20(=0A=20=20=20=20v_table=20varchar(128),=20=
v_constraint=20varchar(128),=20v_constraint_sql=20text)=0Areturns=20void=0A=
AS=20$procedure$=0Abegin=0A=20=20=20=20if=20=20NOT=20EXISTS=20(SELECT=20=
1=20from=20pg_constraint=20where=20conname=20ilike=20v_constraint)=20=
then=0A=20=20=20=20=20=20=20=20execute=20'ALTER=20TABLE=20'=20||=20=
v_table=20||=20=20'=20ADD=20CONSTRAINT=20'=20||=20v_constraint=20||=20'=20=
'=20||=20v_constraint_sql;=0A=20=20=20=20end=20if;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0Acreate=20or=20replace=20function=20=
fn_db_drop_constraint=20(=0A=20=20=20=20v_table=20varchar(128),=20=
v_constraint=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=
=20=20=20=20if=20=20EXISTS=20(SELECT=201=20from=20pg_constraint=20where=20=
conname=20ilike=20v_constraint)=20then=0A=20=20=20=20=20=20=20=20execute=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20=20'=20DROP=20CONSTRAINT=20'=20=
||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20attach_user_to_su_role(v_permission_id=20uuid)=0A=20=
=20RETURNS=20void=20AS=0A$procedure$=0A=20=20=20DECLARE=0A=20=20=20=
v_user_entry=20VARCHAR(255);=0A=20=20=20v_user_id=20=20UUID;=0A=20=20=20=
v_name=20=20VARCHAR(255);=0A=20=20=20v_domain=20=20VARCHAR(255);=0A=20=20=
=20v_user_name=20=20VARCHAR(255);=0A=0A=20=20=20v_document=20=20=
VARCHAR(64);=0A=20=20=20v_index=20=20INTEGER;=0ABEGIN=0A=0A=20=20=20=
select=20=20=20option_value=20INTO=20v_user_entry=20from=20vdc_options=20=
where=20option_name=20=3D=20'AdUserId';=0A=20=20=20select=20=20=20=
option_value=20INTO=20v_name=20from=20vdc_options=20where=20option_name=20=
=3D=20'AdUserName';=0A=20=20=20select=20=20=20option_value=20INTO=20=
v_domain=20from=20vdc_options=20where=20option_name=20=3D=20=
'DomainName';=0A=0A=20=20=20v_index=20:=3D=20POSITION(':'=20IN=20=
v_user_entry);=0A=20=20=20if=20(=20v_index=20<>=200=20)=20then=0A=20=20=20=
=20=20=20v_user_entry=20:=3D=20substring(=20v_user_entry=20from=20=
v_index=20+=201=20);=0A=20=20=20=20=20=20v_user_id=20:=3D=20CAST(=20=
v_user_entry=20AS=20uuid=20);=0A=20=20=20end=20if;=0A=0A=20=20=20v_index=20=
:=3D=20POSITION(':'=20IN=20v_name);=0A=20=20=20if=20(=20v_index=20<>=200=20=
)=20then=0A=20=20=20=20=20=20v_name=20:=3D=20substring(=20v_name=20from=20=
v_index=20+=201=20);=0A=20=20=20end=20if;=0A=0A--=20find=20if=20name=20=
already=20includes=20domain=20(@)=0A=20=20=20v_index=20:=3D=20=
POSITION('@'=20IN=20v_name);=0A=0A=20=20=20if=20(v_index=20=3D=200)=20=
then=0A=20=20=20=20=20=20v_user_name=20:=3D=20coalesce(v_name,'')=20||=20=
'@'=20||=20coalesce(v_domain,'');=0A=20=20=20else=0A=20=20=20=20=20=20=
v_user_name=20:=3D=20v_name;=0A=20=20=20end=20if;=0A=0A=0Ainsert=20into=20=
users(user_id,name,domain,username,groups,status)=20select=20v_user_id,=20=
v_name,=20v_domain,=20v_user_name,'',1=20where=20not=20exists=20(select=20=
user_id,name,domain,username,groups,status=20from=20users=20where=20=
user_id=20=3D=20v_user_id=20and=20name=20=3D=20v_name=20and=20domain=20=3D=
=20v_domain=20and=20username=20=3D=20v_user_name=20and=20groups=20=3D=20=
''=20and=20status=20=3D=201);=0A=0Ainsert=20into=20=
permissions(id,role_id,ad_element_id,object_id,object_type_id)=20select=20=
v_permission_id,=20'00000000-0000-0000-0000-000000000001',=20v_user_id,=20=
getGlobalIds('system'),=201=20where=20not=20exists(select=20=
role_id,ad_element_id,object_id,object_type_id=20from=20permissions=20=
where=20role_id=20=3D=20'00000000-0000-0000-0000-000000000001'=20and=20=
ad_element_id=20=3D=20v_user_id=20and=20object_id=3D=20=
getGlobalIds('system')=20and=20object_type_id=20=3D=201);=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20CheckDBConnection()=20RETURNS=20SETOF=20integer=20=
IMMUTABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=20SELECT=201;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=20from=20=
pg_proc=20inner=20join=20pg_namespace=20ns=20on=20=
(pg_proc.pronamespace=3Dns.oid)=20where=20ns.nspname=20=3D=20'public'=20=
and=20proname=20not=20ilike=20'uuid%'=20order=20by=20proname;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_views_syntax()=20RETURNS=20SETOF=20=
text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20=
select=20'DROP=20VIEW=20if=20exists=20'=20||=20table_name=20||=20'=20=
CASCADE;'=20from=20information_schema.views=20where=20table_schema=20=3D=20=
'public'=20order=20by=20table_name;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_tables_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20TABLE=20=
if=20exists=20'=20||=20table_name=20||=20'=20CASCADE;'=20from=20=
information_schema.tables=20where=20table_schema=20=3D=20'public'=20and=20=
table_type=20=3D=20'BASE=20TABLE'=20order=20by=20table_name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_seq_syntax()=20RETURNS=20SETOF=20=
text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20=
select=20'DROP=20SEQUENCE=20if=20exists=20'=20||=20sequence_name=20||=20=
'=20CASCADE;'=20from=20information_schema.sequences=20=20where=20=
sequence_schema=20=3D=20'public'=20order=20by=20sequence_name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_user_types_syntax()=20RETURNS=20=
SETOF=20text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20=
QUERY=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20FROM=20pg_namespace=20n,=20pg_class=20c,=20pg_type=20t=0A=20=20=20=
WHERE=20n.oid=20=3D=20c.relnamespace=20and=20t.typrelid=20=3D=20c.oid=20=
and=20c.relkind=20=3D=20'c'::"char"=20and=0A=20=20=20n.nspname=20=3D=20=
'public'=0A=20=20=20ORDER=20BY=20=20=
c.relname::information_schema.sql_identifier;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_get_column_size(=20v_table=20varchar(64),=20v_column=20varchar(64))=20=
returns=20integer=20STABLE=0A=20=20=20AS=20$procedure$=0A=20=20=20=
declare=0A=20=20=20retvalue=20=20integer;=0ABEGIN=0A=20=20=20retvalue=20=
:=3D=20character_maximum_length=20from=20information_schema.columns=0A=20=
=20=20=20where=0A=20=20=20=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column=20and=0A=20=20=20=20table_schema=20=3D=20=
'public'=20and=20udt_name=20in=20('char','varchar');=0A=20=20=20return=20=
retvalue;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
attach_user_to_su_role(v_permission_id=20uuid,=20v_user_id=20=
VARCHAR(255),=20v_name=20VARCHAR(255),=20v_domain=20VARCHAR(255))=0A=20=20=
RETURNS=20void=20AS=0A$BODY$=0A=20=20=20DECLARE=0A=20=20=20v_user_name=20=
VARCHAR(255);=0A=20=20=20v_document=20=20VARCHAR(64);=0A=20=20=20v_index=20=
=20INTEGER;=0A=20=20=20input_uuid=20uuid;=0ABEGIN=0A=20=20=20input_uuid=20=
=3D=20CAST(=20v_user_id=20AS=20uuid=20);=0A--=20find=20if=20name=20=
already=20includes=20domain=20(@)=0A=20=20=20v_index=20:=3D=20=
POSITION('@'=20IN=20v_name);=0A=0A=20=20=20if=20(v_index=20=3D=200)=20=
then=0A=20=20=20=20=20=20v_user_name=20:=3D=20coalesce(v_name,'')=20||=20=
'@'=20||=20coalesce(v_domain,'');=0A=20=20=20else=0A=20=20=20=20=20=20=
v_user_name=20:=3D=20v_name;=0A=20=20=20end=20if;=0A=0A=0Ainsert=20into=20=
users(user_id,name,domain,username,groups,status)=20select=20input_uuid,=20=
v_name,=20v_domain,=20v_user_name,'',1=20where=20not=20exists=20(select=20=
user_id,name,domain,username,groups,status=20from=20users=20where=20=
user_id=20=3D=20input_uuid);=0A=0Ainsert=20into=20=
permissions(id,role_id,ad_element_id,object_id,object_type_id)=20select=20=
v_permission_id,=20'00000000-0000-0000-0000-000000000001',=20input_uuid,=20=
getGlobalIds('system'),=201=20where=20not=20exists(select=20=
role_id,ad_element_id,object_id,object_type_id=20from=20permissions=20=
where=20role_id=20=3D=20'00000000-0000-0000-0000-000000000001'=20and=20=
ad_element_id=20=3D=20input_uuid=20and=20object_id=3D=20=
getGlobalIds('system')=20and=20object_type_id=20=3D=201);=0AEND;=20=
$BODY$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20=
FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
FUNCTION=20fn_db_add_action_group_to_role(v_role_id=20UUID,=20=
v_action_group_id=20INTEGER)=0ARETURNS=20VOID=0AAS=20$procedure$=0ABEGIN=0A=
=20=20=20=20=20=20=20INSERT=20INTO=20=
roles_groups(role_id,action_group_id)=0A=20=20=20=20=20=20=20SELECT=20=
v_role_id,=20v_action_group_id=0A=20=20=20=20=20=20=20WHERE=20NOT=20=
EXISTS=20(SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20FROM=20roles_groups=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20role_id=20=3D=20=
v_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20action_group_id=20=3D=20v_action_group_id);=0ARETURN;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_split_config_value(v_option_name=20character=20=
varying,=20v_old_option_value=20character=20varying,=20=
v_new_option_value=20character=20varying,=20v_update_from_version=20=
character=20varying)=0A=20=20RETURNS=20void=20AS=0A$BODY$=0Adeclare=0A=
v_old_value=20varchar(4000);=0Av_cur=20cursor=20for=20select=20distinct=20=
version=20from=20vdc_options=20where=20version=20<>=20'general'=20order=20=
by=20version;=0Av_version=20varchar(40);=0Av_index=20integer;=0Av_count=20=
integer;=0Av_total_count=20integer;=0Av_version_count=20integer;=0Abegin=0A=
=20=20=20=20v_total_count=20:=3D=20count(version)=20from=20vdc_options=20=
where=20option_name=20=3D=20v_option_name;=0A=20=20=20=20v_old_value=20=
:=3D=20option_value=20from=20vdc_options=20where=20option_name=20=3D=20=
v_option_name=20and=20version=20=3D=20'general';=0A=20=20=20=20=
v_version_count=20:=3D=20count(distinct=20version)=20from=20vdc_options=20=
where=20version=20<>=20'general';=0A=20=20=20=20if=20(v_total_count=20<=3D=
=20v_version_count)=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=20=
=20=20=20=20=20=20=20=20if=20(v_old_value=20IS=20NULL)=20then=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20v_old_value=20:=3D=20=
v_old_option_value;=0A=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=20=
=20=20=20=20=20=20=20=20=20=20=20v_count=20:=3D=20count(distinct=20=
version)=20from=20vdc_options=20where=20version=20<>=20'general';=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_index=20:=3D=201;=0A=20=20=20=20=20=20=20=
=20open=20v_cur;=0A=20=20=20=20=20=20=20=20loop=0A=20=20=20=20=20=20=20=20=
=20=20=20=20fetch=20v_cur=20into=20v_version;=0A=20=20=20=20=20=20=20=20=20=
=20=20=20exit=20when=20not=20found;=0A=20=20=20=20=20=20=20=20=20=20=20=20=
--=20We=20shouldn't=20update=20if=20already=20exists=0A=20=20=20=20=20=20=
=20=20=20=20=20=20if=20(not=20exists=20(select=201=20from=20vdc_options=20=
where=20option_name=20=3D=20v_option_name=20and=20version=20=3D=20=
v_version))=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=20=
Might=20not=20work=20well=20for=20versions=20such=20as=203.10,=20but=20=
we=20currently=20don't=20have=20any=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20if=20(v_version=20>=3D=20v_update_from_version)=20then=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20insert=20into=20=
vdc_options=20(option_name,=20option_value,=20version)=20values=20=
(v_option_name,=20v_new_option_value,=20v_version);=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20insert=20into=20vdc_options=20(option_name,=20=
option_value,=20version)=20values=20(v_option_name,=20v_old_value,=20=
v_version);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=
=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_index=20:=3D=20v_index=20+1;=0A=20=20=20=20=20=20=20=20end=20=
loop;=0A=20=20=20=20=20=20=20=20close=20v_cur;=0A=20=20=20=20=20=20=20=20=
delete=20from=20vdc_options=20where=20option_name=20=3D=20v_option_name=20=
and=20version=20=3D=20'general';=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_grant_action_group_to_all_roles_filter(v_action_group_id=20=
integer,=20uuid[])=0A=20=20RETURNS=20void=20AS=0A$BODY$=0Adeclare=0A=
v_role_id_to_filter=20alias=20for=20$2;=0Abegin=0A=20=20=20=20insert=20=
into=20roles_groups=20(role_id,=20action_group_id)=0A=20=20=20=20select=20=
distinct=20role_id,=20v_action_group_id=0A=20=20=20=20from=20=
roles_groups=20rg=0A=20=20=20=20where=20not=20ARRAY=20[role_id]=20<@=20=
v_role_id_to_filter=20and=20not=20exists=20(select=201=20from=20=
roles_groups=20where=20role_id=20=3D=20rg.role_id=20and=20=
action_group_id=20=3D=20v_action_group_id);=0AEND;=20$BODY$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_mask_object(v_object=20regclass)=20RETURNS=20setof=20record=20as=0A=
$BODY$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=20=20=20=20v_table=20=
record;=0A=20=20=20=20v_table_name=20TEXT;=0A=20=20=20=20temprec=20=
record;=0ABEGIN=0A=20=20=20=20--=20get=20full=20table/view=20name=20from=20=
v_object=20(i.e=20<namespace>.<name>)=0A=20=20=20=20select=20c.relname,=20=
n.nspname=20INTO=20v_table=0A=20=20=20=20=20=20=20=20FROM=20pg_class=20c=20=
join=20pg_namespace=20n=20on=20c.relnamespace=20=3D=20n.oid=20WHERE=20=
c.oid=20=3D=20v_object;=0A=20=20=20=20--=20try=20to=20get=20filtered=20=
query=20syntax=20from=20previous=20execution=0A=20=20=20=20if=20exists=20=
(select=201=20from=20object_column_white_list_sql=20where=20object_name=20=
=3D=20v_table.relname)=20then=0A=09select=20sql=20into=20v_sql=20from=20=
object_column_white_list_sql=20where=20object_name=20=3D=20=
v_table.relname;=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
v_table_name=20:=3D=20quote_ident(=20v_table.nspname=20)=20||=20'.'=20||=20=
quote_ident(=20v_table.relname=20);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20=20=20=20=20for=20temprec=20in=20select=20a.attname,=20=
t.typname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_attribute=20a=20join=20pg_type=20t=20on=20a.atttypid=20=3D=
=20t.oid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20a.attrelid=20=3D=20v_object=20AND=20a.attnum=20>=200=20AND=20=
NOT=20a.attisdropped=20ORDER=20BY=20a.attnum=0A=20=20=20=20=20=20=20=20=
loop=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20coalesce(=20=
v_sql=20||=20',=20',=20'SELECT=20'=20);=0A=20=20=20=20=20=20=20=20=20=20=20=
=20if=20exists(select=201=20from=20object_column_white_list=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20where=20object_name=20=3D=20=
v_table.relname=20and=20column_name=20=3D=20temprec.attname)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20=
quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20=
||=20'NULL::'=20||=20quote_ident(=20temprec.typname=20)=20||=20'=20as=20=
'=20||=20quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=
=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20END=20LOOP;=0A=20=20=20=20=20=
=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=
=20=20=20=20=20=20=20=20v_sql=20:=3D=20'SELECT=20x::'=20||=20=
v_table_name=20||=20'=20as=20rec=20FROM=20('=20||=20v_sql=20||=20')=20as=20=
x';=0A=20=20=20=20=20=20=20=20--=20save=20generated=20query=20for=20=
further=20use=0A=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list_sql(object_name,sql)=20values=20=
(v_table.relname,=20v_sql);=0A=20=20=20=20end=20if;=0A=20=20=20=20RETURN=20=
QUERY=20EXECUTE=20v_sql;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_add_column_to_object_white_list(v_object_name=20varchar(128),=20=
v_column_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0A=
begin=0A=20=20=20=20if=20(not=20exists=20(select=201=20from=20=
object_column_white_list=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20where=20object_name=20=3D=20v_object_name=20and=20=
column_name=20=3D=20v_column_name))=20then=0A=20=20=20=20=20=20=20=20=
begin=0A=20=20=20=20=20=20=20=20=20=20=20=20--=20verify=20that=20there=20=
is=20such=20object=20in=20db=0A=20=20=20=20=20=20=20=20=20=20=20=20if=20=
exists=20(select=201=20from=20information_schema.columns=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20where=20table_name=20=
=3D=20v_object_name=20and=20column_name=20=3D=20v_column_name)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list=20(object_name,=20column_name)=20values=20=
(v_object_name,=20v_column_name);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
end=20if;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20FUNCTION=20fn_db_unlock_disk(v_id=20UUID)=0Areturns=20void=0A=
AS=20$procedure$=0Adeclare=0A=20=20=20=20OK=20integer;=0A=20=20=20=20=
LOCKED=20integer;=0Abegin=0A=20=20=20=20OK:=3D1;=0A=20=20=20=20=
LOCKED:=3D2;=0A=20=20=20=20update=20images=20set=20imagestatus=20=3D=20=
OK=20where=20imagestatus=20=3D=20LOCKED=20and=0A=20=20=20=20=
image_group_id=20in=20(select=20device_id=20from=20vm_device=20where=20=
device_id=20=3D=20v_id=20and=20is_plugged);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_unlock_snapshot(v_id=20UUID)=0Areturns=20void=0AAS=20$procedure$=0A=
declare=0A=20=20=20=20OK=20varchar;=0A=20=20=20=20LOCKED=20varchar;=0A=
begin=0A=20=20=20=20OK:=3D'OK';=0A=20=20=20=20LOCKED:=3D'LOCKED';=0A=20=20=
=20=20update=20snapshots=20set=20status=20=3D=20OK=20where=20status=20=3D=20=
LOCKED=20and=20snapshot_id=20=3D=20v_id;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_unlock_entity(v_object_type=20varchar(10),=20v_name=20=
varchar(255),=20v_recursive=20boolean)=0Areturns=20void=0AAS=20=
$procedure$=0Adeclare=0A=20=20=20=20DOWN=20integer;=0A=20=20=20=20OK=20=
integer;=0A=20=20=20=20LOCKED=20integer;=0A=20=20=20=20TEMPLATE_OK=20=
integer;=0A=20=20=20=20TEMPLATE_LOCKED=20integer;=0A=20=20=20=20=
IMAGE_LOCKED=20integer;=0A=20=20=20=20SNAPSHOT_OK=20varchar;=0A=20=20=20=20=
SNAPSHOT_LOCKED=20varchar;=0A=20=20=20=20v_id=20UUID;=0Abegin=0A=20=20=20=
=20DOWN:=3D0;=0A=20=20=20=20OK:=3D1;=0A=20=20=20=20LOCKED:=3D2;=0A=20=20=20=
=20TEMPLATE_OK:=3D0;=0A=20=20=20=20TEMPLATE_LOCKED:=3D1;=0A=20=20=20=20=
IMAGE_LOCKED:=3D15;=0A=20=20=20=20SNAPSHOT_OK:=3D'OK';=0A=20=20=20=20=
SNAPSHOT_LOCKED:=3D'LOCKED';=0A=20=20=20=20v_id=20:=3D=20vm_guid=20from=20=
vm_static=20where=20vm_name=20=3D=20v_name=20and=20entity_type=20ilike=20=
v_object_type;=0A=20=20=20=20--=20set=20VM=20status=20to=20DOWN=0A=20=20=20=
=20if=20(v_object_type=20=3D=20'vm')=20then=0A=20=20=20=20=20=20=20=20=
update=20vm_dynamic=20set=20status=20=3D=20DOWN=20where=20status=20=3D=20=
IMAGE_LOCKED=20and=20vm_guid=20=20=3D=20v_id;=0A=20=20=20=20--=20set=20=
Template=20status=20to=20OK=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
if=20(v_object_type=20=3D=20'template')=20then=0A=20=20=20=20=20=20=20=20=
=20=20=20=20update=20vm_static=20set=20template_status=20=3D=20=
TEMPLATE_OK=20where=20template_status=20=3D=20TEMPLATE_LOCKED=20and=20=
vm_guid=20=20=3D=20v_id;=0A=20=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=
end=20if;=0A=20=20=20=20--unlock=20images=20and=20snapshots=20=20if=20=
recursive=20flag=20is=20set=0A=20=20=20=20if=20(v_recursive)=20then=0A=20=
=20=20=20=20=20=20=20update=20images=20set=20imagestatus=20=3D=20OK=20=
where=20imagestatus=20=3D=20LOCKED=20and=0A=20=20=20=20=20=20=20=20=
image_group_id=20in=20(select=20device_id=20from=20vm_device=20where=20=
vm_id=20=3D=20v_id=20and=20is_plugged);=0A=0A=20=20=20=20=20=20=20=20=
update=20snapshots=20set=20status=20=3D=20SNAPSHOT_OK=20where=20status=20=
ilike=20SNAPSHOT_LOCKED=20and=20vm_id=20=3D=20v_id;=0A=20=20=20=20end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A/*=20Displays=20DC=20id=20,=20DC=20name,=20SPM=20Host=20id=20=
,=20SPM=20Host=20name=20and=20number=20of=20async=20tasks=20awaiting.=0A=0A=
1)=20create=20a=20record=20type=20with=20DC=20name,=20DC=20id,=20SPM=20=
host=20id,=20SPM=20host=20name,=20count=0A=0A2)=20get=20all=20distinct=20=
DC=20ids=20from=20async_tasks=20table=0A=0A3)=20Run=20a=20cursor=20for=20=
each=20result=20in=202)=0A=0A=20=20=20a)=20get=20DC=20name=0A=20=20=20b)=20=
get=20SPM=20Host=20id=20&=20name=20if=20available=0A=20=20=20c)=20get=20=
count=20of=20tasks=0A=0A=20=20=20return=20current=20record=0A=0A4)=20=
return=20set=20of=20generated=20records=0A*/=0ADROP=20TYPE=20IF=20EXISTS=20=
async_tasks_info_rs=20CASCADE;=0A**************************=0A=0ADROP=20=
TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
async_tasks_info_rs=20AS=20(=0A=20=20=20=20dc_id=20UUID,=20dc_name=20=
CHARACTER=20VARYING,=20spm_host_id=20UUID,=20spm_host_name=20CHARACTER=20=
VARYING,=20task_count=20integer);=0A**************************=0A=0A=
CREATE=20TYPE=0A*********=20QUERY=20**********=0Acreate=20or=20replace=20=
FUNCTION=20fn_db_get_async_tasks()=0Areturns=20SETOF=20=
async_tasks_info_rs=20STABLE=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20=
v_record=20async_tasks_info_rs;=0A=0A=20=20=20=20--=20selects=20=
storage_pool_id=20uuid=20found=20in=20async_tasks=0A=20=20=20=20=
v_tasks_cursor=20cursor=20for=20select=20distinct=20storage_pool_id=20=
from=20async_tasks;=0Abegin=0A=0A=20=20=20=20OPEN=20v_tasks_cursor;=0A=20=
=20=20=20FETCH=20v_tasks_cursor=20into=20v_record.dc_id;=0A=20=20=20=20=
WHILE=20FOUND=20LOOP=0A=20=20=20=20=20=20=20=20--=20get=20dc_name=20and=20=
SPM=20Host=20id=0A=20=20=20=20=20=20=20=20v_record.dc_name=20:=3D=20name=20=
from=20storage_pool=20where=20id=20=3D=20v_record.dc_id;=0A=20=20=20=20=20=
=20=20=20v_record.spm_host_id=20:=3D=0A=20=20=20=20=20=20=20=20=20=20=20=20=
spm_vds_id=20from=20storage_pool=20where=20id=20=3D=20v_record.dc_id;=0A=20=
=20=20=20=20=20=20=20--=20get=20Host=20name=20if=20we=20have=20non=20=
NULL=20SPM=20Host=0A=20=20=20=20=20=20=20=20if=20(v_record.spm_host_id=20=
IS=20NOT=20NULL)=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_record.spm_host_name=20:=3D=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20vds_name=20from=20vds_static=20where=20vds_id=20=3D=20=
v_record.spm_host_id;=0A=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_record.spm_host_name:=3D'';=0A=20=20=20=20=20=20=20=20=
end=20if;=0A=20=20=20=20=20=20=20=20--=20get=20tasks=20count=20for=20=
this=20DC=0A=20=20=20=20=20=20=20=20v_record.task_count=20:=3D=20=
count(*)=20from=20async_tasks=0A=20=20=20=20=20=20=20=20=20=20=20=20=
where=20position=20(cast(v_record.dc_id=20as=20varchar)=20in=20=
action_parameters)=20>=200;=0A=20=20=20=20=20=20=20=20--=20return=20the=20=
record=0A=20=20=20=20=20=20=20=20RETURN=20NEXT=20v_record;=0A=20=20=20=20=
=20=20=20=20FETCH=20v_tasks_cursor=20into=20v_record.dc_id;=0A=20=20=20=20=
END=20LOOP;=0A=20=20=20=20CLOSE=20v_tasks_cursor;=0A=20=20=20=20--=20=
return=20full=20set=20of=20generated=20records=0A=20=20=20=20RETURN;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Aselect=20*=20from=20=
generate_drop_all_functions_syntax();=0A**************************=0A=0A=20=
drop=20function=20if=20exists=20public.attach_user_to_su_role(uuid)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.attach_user_to_su_role(uuid,=20character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.checkdbconnection()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_add_action_group_to_role(uuid,=20integer)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_add_column(character=20varying,=20character=20varying,=20=
text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_add_column_to_object_white_list(character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_add_config_value(character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_change_column_type(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_create_constraint(character=20varying,=20character=20=
varying,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_delete_config_for_version(text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.fn_db_delete_config_value(character=20=
varying,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_delete_config_value_all_versions(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_drop_column(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_drop_constraint(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_get_async_tasks()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_grant_action_group_to_all_roles_filter(integer,=20=
uuid[])=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_mask_object(regclass)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_rename_column(character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_rename_config_key(character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_split_config_value(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_unlock_disk(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_unlock_entity(character=20varying,=20character=20=
varying,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_unlock_snapshot(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_update_config_value(character=20varying,=20=
character=20varying,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.fn_db_update_default_config_value(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_get_column_size(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.generate_drop_all_functions_syntax()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.generate_drop_all_seq_syntax()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.generate_drop_all_tables_syntax()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.generate_drop_all_user_types_syntax()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.generate_drop_all_views_syntax()=20=
cascade;=0A=20drop=20function=20if=20exists=20public.getpathids(uuid,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getpathinnames(integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.update_enum_translator(character=20varying,=20smallint,=20=
character=20varying,=20text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.update_tags_path_child(timestamp=20with=20time=20zone)=20=
cascade;=0A=0A*********=20QUERY=20**********=0A=20drop=20function=20if=20=
exists=20public.attach_user_to_su_role(uuid)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.attach_user_to_su_role(uuid,=20character=20=
varying,=20character=20varying,=20character=20varying)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.checkdbconnection()=20cascade;=0A=20=
drop=20function=20if=20exists=20=
public.fn_db_add_action_group_to_role(uuid,=20integer)=20cascade;=0A=20=
drop=20function=20if=20exists=20public.fn_db_add_column(character=20=
varying,=20character=20varying,=20text)=20cascade;=0A=20drop=20function=20=
if=20exists=20public.fn_db_add_column_to_object_white_list(character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_add_config_value(character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_change_column_type(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_create_constraint(character=20varying,=20character=20=
varying,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_delete_config_for_version(text)=20cascade;=0A=20drop=20=
function=20if=20exists=20public.fn_db_delete_config_value(character=20=
varying,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_delete_config_value_all_versions(character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_drop_column(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_drop_constraint(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_get_async_tasks()=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_grant_action_group_to_all_roles_filter(integer,=20=
uuid[])=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_mask_object(regclass)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_rename_column(character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_rename_config_key(character=20varying,=20character=20=
varying,=20character=20varying)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_split_config_value(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_unlock_disk(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_unlock_entity(character=20varying,=20character=20=
varying,=20boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_db_unlock_snapshot(uuid)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.fn_db_update_config_value(character=20varying,=20=
character=20varying,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20=
public.fn_db_update_default_config_value(character=20varying,=20=
character=20varying,=20character=20varying,=20character=20varying,=20=
boolean)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.fn_get_column_size(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.generate_drop_all_functions_syntax()=20cascade;=0A=20drop=20=
function=20if=20exists=20public.generate_drop_all_seq_syntax()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
public.generate_drop_all_tables_syntax()=20cascade;=0A=20drop=20function=20=
if=20exists=20public.generate_drop_all_user_types_syntax()=20cascade;=0A=20=
drop=20function=20if=20exists=20public.generate_drop_all_views_syntax()=20=
cascade;=0A=20drop=20function=20if=20exists=20public.getpathids(uuid,=20=
integer)=20cascade;=0A=20drop=20function=20if=20exists=20=
public.getpathinnames(integer)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.update_enum_translator(character=20varying,=20smallint,=20=
character=20varying,=20text)=20cascade;=0A=20drop=20function=20if=20=
exists=20public.update_tags_path_child(timestamp=20with=20time=20zone)=20=
cascade;=0A**************************=0A=0ADROP=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
GetPathInNames(tagHistoryID=20int)=0ARETURNS=20VARCHAR(4000)=0A=20=20=20=
AS=20$function$=0A=20=20=20DECLARE=0A=20=20=20v_id=20=20UUID;=0A=20=20=20=
v_path_names=20=20VARCHAR(4000);=0A=20=20=20SWV_path=20VARCHAR(4000);=0A=
BEGIN=0A=20=20=20SELECT=20tag_path=20into=20SWV_path=20FROM=20=
tag_details=20WHERE=20history_id=20=3D=20tagHistoryID;=0A=20=20=20=
v_path_names=20:=3D=20'/root';=0A=20=20=20IF=20(SWV_path=20IS=20NULL=20=
or=20SWV_path=20=3D=20'')=20THEN=0A=20=20=20=20RETURN=20SWV_path;=0A=20=20=
=20ELSEIF=20(SWV_path=20=3D=20'/00000000-0000-0000-0000-000000000000')=20=
THEN=0A=20=20=20=20RETURN=20v_path_names;=0A=20=20=20ELSE=0A=20=20=20=20=20=
=20SWV_path=20:=3D=20SUBSTR(SWV_path,38);=0A=20=20=20=20=20=20WHILE=20=
(LENGTH(SWV_path)=20>=200)=20LOOP=0A=20=20=20=20=20=20=20=20=20v_id=20:=3D=
=20cast(SUBSTR(SWV_path,2,36)=20as=20UUID);=0A=20=20=20=20=20=20=20=20=20=
SWV_path=20:=3D=20SUBSTR(SWV_path,38);=0A=20=20=20=20=20=20=20=20=20=
SELECT=20=20v_path_names=20||=20'/'=20||=20tag_name=20INTO=20=
v_path_names=20FROM=20tag_details=20where=20tag_id=20=3D=20v_id;=0A=20=20=
=20=20=20=20END=20LOOP;=0A=20=20=20end=20if;=0A=20=20=20RETURN=20=
v_path_names;=0AEND;=20$function$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20GetPathIDs(currentTagID=20=
UUID,=20runNumber=20int=20default=200)=0ARETURNS=20VARCHAR(4000)=0A=20=20=
=20AS=20$function$=0A=20=20=20DECLARE=0A=20=20=20=20ParentID=20UUID;=0A=
BEGIN=0A=20=20=20IF=20currentTagID=20IS=20NULL=20then=0A=20=20=20=20=20=20=
RETURN=20NULL;=0A=20=20=20end=20if;=0A=20=20=20select=20parent_id=20INTO=20=
ParentID=20FROM=20tag_relations_history=20WHERE=20entity_id=20=3D=20=
currentTagID=20and=20history_id=20in=20=20(SELECT=20max(a.history_id)=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20tag_relations_history=20a=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
WHERE=20a.entity_id=20=3D=20currentTagID);=0A=20=20=20=20IF=20runNumber=20=
=3D=200=20then=0A=20=20=20=20=20=20=20=20RETURN=20=
coalesce(GetPathIDs(ParentID,=20runNumber=20+=201),'/');=0A=20=20=20=20=
ELSE=0A=20=20=20=20=20=20=20=20RETURN=20coalesce(GetPathIDs(ParentID,=20=
runNumber=20+=201)=20||=20'/'=20,'/')=20||=20currentTagID;=0A=20=20=20=
end=20if;=0AEND;=20$function$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
update_tags_path_child(thisUpdate=20TIMESTAMP=20WITH=20TIME=20ZONE)=0A=
RETURNS=20VOID=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20/*This=20inserts=20=
all=20children=20of=20the=20changed=20nodes=20with=20their=20new=20=
path*/=0A=20=20=20=20Insert=20into=20=20tag_details(tag_id,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20tag_name,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20tag_description,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20tag_path,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20tag_level,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20create_date,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20update_date)=0A=20=20=20=20select=20distinct=20a.tag_id,=0A=20=
=20=20=20=20=20=20=20=20=20=20=20a.tag_name,=0A=20=20=20=20=20=20=20=20=20=
=20=20=20a.tag_description,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
c.new_child_path=20||=20SUBSTR(a.tag_path,LENGTH(b.old_child_path)=20+=20=
1),=0A=20=20=20=20=20=20=20=20=20=20=20=20LENGTH(c.new_child_path=20||=20=
SUBSTR(a.tag_path,LENGTH(b.old_child_path)=20+=201))=20-=20=
LENGTH(REPLACE((c.new_child_path=20||=20=
SUBSTR(a.tag_path,LENGTH(b.old_child_path)=20+=201)),'/','')),=0A=20=20=20=
=20=20=20=20=20=20=20=20=20a.create_date,=0A=20=20=20=20=20=20=20=20=20=20=
=20=20thisUpdate=0A=20=20=20=20FROM=20tag_details=20a,=0A=20=20=20=20=20=20=
=20=20=20(select=20e.tag_path=20||=20'/'=20||=20CAST(e.tag_id=20AS=20=
VARCHAR(36))=20as=20old_child_path,=20e.tag_id=20as=20parent=20/*36=20is=20=
the=20uuid=20length*/=0A=20=20=20=20=20=20=20=20=20=20from=20tag_details=20=
e=0A=20=20=20=20=20=20=20=20=20=20where=20e.history_id=20in=20(SELECT=20=
max(f.history_id)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20tag_details=20f=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20WHERE=20(f.update_date=20<=20thisUpdate=20or=20=
f.update_date=20IS=20NULL)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20GROUP=20BY=20f.tag_id)=0A=20=20=20=20=20=20=20=20=20=20=20=
AND=20e.delete_date=20IS=20NULL)=20b,=0A=20=20=20=20=20=20=20=20=20=
(select=20tag_path=20||=20'/'=20||=20CAST(tag_id=20AS=20VARCHAR(36))=20=
as=20new_child_path,=20tag_id=20as=20parent=20/*36=20is=20the=20uuid=20=
length*/=0A=20=20=20=20=20=20=20=20=20=20from=20tag_details=0A=20=20=20=20=
=20=20=20=20=20=20where=20update_date=20=3D=20thisUpdate=0A=20=20=20=20=20=
=20=20=20=20=20=20=20and=20delete_date=20IS=20NULL)=20c=0A=20=20=20=20=
Where=20a.tag_path=20like=20b.old_child_path=20||=20'%'=20and=0A=20=20=20=
=20=20=20=20=20=20=20b.parent=20=3D=20c.parent=20and=0A=20=20=20=20=20=20=
=20=20=20=20not=20exists=20(SELECT=20z.tag_id,=20z.tag_path=20FROM=20=
tag_details=20as=20z=20WHERE=20tag_id=20=3D=20a.tag_id=20and=20=
z.tag_path=20=3D=20c.new_child_path=20||=20=
SUBSTR(a.tag_path,LENGTH(b.old_child_path)=20+=201));=0A=20=20=20=20=
RETURN;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20fn_db_add_column(v_table=20=
varchar(128),=20v_column=20varchar(128),=20v_column_def=20text)=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0A=0Abegin=0A=
=09if=20(not=20exists=20(select=201=20from=20information_schema.columns=20=
where=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column))=20then=0A=09=20=20=20=20begin=0A=09=09v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20ADD=20COLUMN=20'=20||=20v_column=20=
||=20'=20'=20||=20v_column_def;=0A=09=09EXECUTE=20v_sql;=0A=20=20=20=20=20=
=20=20=20=20=20=20=20end;=0A=09end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_drop_column(v_table=20varchar(128),=20v_column=20varchar(128))=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0Abegin=0A=20=
=20=20=20=20=20=20=20if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column))=20then=0A=20=20=20=20=20=20=20=20=20=20=20=
=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20DROP=20COLUMN=20'=20||=20=
v_column;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20EXECUTE=20=
v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=
=20end=20if;=0Aend;$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_change_column_type(v_table=20varchar(128),=20v_column=20=
varchar(128),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_type=20varchar(128),=20v_new_type=20=
varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20=
text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column=20and=20(udt_name=20ilike=20v_type=20or=20=
data_type=20ilike=20v_type)))=20then=0A=09=20=20=20=20begin=0A=09=09=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ALTER=20=
COLUMN=20'=20||=20v_column=20||=20'=20TYPE=20'=20||=20v_new_type;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_rename_column(v_table=20varchar(128),=20v_column=20varchar(128),=20=
v_new_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0A=
v_sql=20text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column))=20then=0A=09=20=20=20=20begin=0A=09=09=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20RENAME=20=
COLUMN=20'=20||=20v_column=20||=20'=20TO=20'=20||=20v_new_name;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_add_config_value(v_option_name=20varchar(100),=20v_option_value=20=
varchar(4000),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20v_version=20varchar(40))=0Areturns=20void=0AAS=20=
$procedure$=0Abegin=0A=20=20=20=20if=20(not=20exists=20(select=201=20=
from=20vdc_options=20where=20option_name=20ilike=20v_option_name=20and=20=
version=20=3D=20v_version))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=
=20=20=20=20=20=20=20=20=20=20insert=20into=20vdc_options=20=
(option_name,=20option_value,=20version)=20values=20(v_option_name,=20=
v_option_value,=20v_version);=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_value_all_versions(v_option_name=20varchar(100))=0A=
returns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20(exists=20=
(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=20=20=20=
=20=20=20=20=20=20delete=20from=20vdc_options=20where=20option_name=20=
ilike=20v_option_name;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_value(v_option_name=20varchar(100),=20v_version=20=
text)=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name=20and=20version=20in=20(select=20ID=20from=20=
fnSplitter(v_version))))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=
=20=20=20=20=20=20=20=20=20delete=20from=20vdc_options=20where=20=
option_name=20ilike=20v_option_name=20and=20version=20in=20(select=20ID=20=
from=20fnSplitter(v_version));=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_for_version(v_version=20text)=0Areturns=20void=0AAS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20delete=20from=20vdc_options=20where=20=
version=20in=20(select=20ID=20from=20fnSplitter(v_version));=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20FUNCTION=20fn_db_update_config_value(v_option_name=20=
varchar(100),=20v_option_value=20varchar(4000),=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_version=20=
varchar(40))=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20=
if=20(exists=20(select=201=20from=20vdc_options=20where=20option_name=20=
ilike=20v_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=
=20=20=20=20=20=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20update=20=20=
vdc_options=20set=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=
=20=20=20=20=20=20=20where=20option_name=20ilike=20v_option_name=20and=20=
version=20=3D=20v_version;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_update_default_config_value(v_option_name=20=
varchar(100),v_default_option_value=20varchar(4000),v_option_value=20=
varchar(4000),v_version=20varchar(40),v_ignore_default_value_case=20=
boolean)=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=20=20=20=
=20=20=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20if=20=
(v_ignore_default_value_case)=0A=20=20=20=20=20=20=20=20=20=20=20=20then=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20update=20=20vdc_options=20=
set=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20where=20option_name=20ilike=20v_option_name=20and=20=
option_value=20ilike=20v_default_option_value=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20update=20=20vdc_options=20set=20option_value=20=
=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
where=20option_name=20ilike=20v_option_name=20and=20option_value=20=3D=20=
v_default_option_value=20and=20version=20=3D=20v_version;=0A=20=20=20=20=20=
=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_rename_config_key(v_old_option_name=20=
varchar(100),v_new_option_name=20varchar(100),v_version=20varchar(40))=0A=
returns=20void=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20=
v_current_option_value=20varchar(4000);=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_old_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=20=20=
=20=20=20v_current_option_value:=3Doption_value=20from=20vdc_options=20=
where=20option_name=20ilike=20v_old_option_name=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20update=20vdc_options=20set=20=
option_name=20=3D=20v_new_option_name,=20option_value=20=3D=20=
v_current_option_value=0A=20=20=20=20=20=20=20=20=20=20=20where=20=20=
option_name=20ilike=20v_old_option_name=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0Acreate=20or=20replace=20function=20=
fn_db_create_constraint=20(=0A=20=20=20=20v_table=20varchar(128),=20=
v_constraint=20varchar(128),=20v_constraint_sql=20text)=0Areturns=20void=0A=
AS=20$procedure$=0Abegin=0A=20=20=20=20if=20=20NOT=20EXISTS=20(SELECT=20=
1=20from=20pg_constraint=20where=20conname=20ilike=20v_constraint)=20=
then=0A=20=20=20=20=20=20=20=20execute=20'ALTER=20TABLE=20'=20||=20=
v_table=20||=20=20'=20ADD=20CONSTRAINT=20'=20||=20v_constraint=20||=20'=20=
'=20||=20v_constraint_sql;=0A=20=20=20=20end=20if;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0Acreate=20or=20replace=20function=20=
fn_db_drop_constraint=20(=0A=20=20=20=20v_table=20varchar(128),=20=
v_constraint=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=
=20=20=20=20if=20=20EXISTS=20(SELECT=201=20from=20pg_constraint=20where=20=
conname=20ilike=20v_constraint)=20then=0A=20=20=20=20=20=20=20=20execute=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20=20'=20DROP=20CONSTRAINT=20'=20=
||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20attach_user_to_su_role(v_permission_id=20uuid)=0A=20=
=20RETURNS=20void=20AS=0A$procedure$=0A=20=20=20DECLARE=0A=20=20=20=
v_user_entry=20VARCHAR(255);=0A=20=20=20v_user_id=20=20UUID;=0A=20=20=20=
v_name=20=20VARCHAR(255);=0A=20=20=20v_domain=20=20VARCHAR(255);=0A=20=20=
=20v_user_name=20=20VARCHAR(255);=0A=0A=20=20=20v_document=20=20=
VARCHAR(64);=0A=20=20=20v_index=20=20INTEGER;=0ABEGIN=0A=0A=20=20=20=
select=20=20=20option_value=20INTO=20v_user_entry=20from=20vdc_options=20=
where=20option_name=20=3D=20'AdUserId';=0A=20=20=20select=20=20=20=
option_value=20INTO=20v_name=20from=20vdc_options=20where=20option_name=20=
=3D=20'AdUserName';=0A=20=20=20select=20=20=20option_value=20INTO=20=
v_domain=20from=20vdc_options=20where=20option_name=20=3D=20=
'DomainName';=0A=0A=20=20=20v_index=20:=3D=20POSITION(':'=20IN=20=
v_user_entry);=0A=20=20=20if=20(=20v_index=20<>=200=20)=20then=0A=20=20=20=
=20=20=20v_user_entry=20:=3D=20substring(=20v_user_entry=20from=20=
v_index=20+=201=20);=0A=20=20=20=20=20=20v_user_id=20:=3D=20CAST(=20=
v_user_entry=20AS=20uuid=20);=0A=20=20=20end=20if;=0A=0A=20=20=20v_index=20=
:=3D=20POSITION(':'=20IN=20v_name);=0A=20=20=20if=20(=20v_index=20<>=200=20=
)=20then=0A=20=20=20=20=20=20v_name=20:=3D=20substring(=20v_name=20from=20=
v_index=20+=201=20);=0A=20=20=20end=20if;=0A=0A--=20find=20if=20name=20=
already=20includes=20domain=20(@)=0A=20=20=20v_index=20:=3D=20=
POSITION('@'=20IN=20v_name);=0A=0A=20=20=20if=20(v_index=20=3D=200)=20=
then=0A=20=20=20=20=20=20v_user_name=20:=3D=20coalesce(v_name,'')=20||=20=
'@'=20||=20coalesce(v_domain,'');=0A=20=20=20else=0A=20=20=20=20=20=20=
v_user_name=20:=3D=20v_name;=0A=20=20=20end=20if;=0A=0A=0Ainsert=20into=20=
users(user_id,name,domain,username,groups,status)=20select=20v_user_id,=20=
v_name,=20v_domain,=20v_user_name,'',1=20where=20not=20exists=20(select=20=
user_id,name,domain,username,groups,status=20from=20users=20where=20=
user_id=20=3D=20v_user_id=20and=20name=20=3D=20v_name=20and=20domain=20=3D=
=20v_domain=20and=20username=20=3D=20v_user_name=20and=20groups=20=3D=20=
''=20and=20status=20=3D=201);=0A=0Ainsert=20into=20=
permissions(id,role_id,ad_element_id,object_id,object_type_id)=20select=20=
v_permission_id,=20'00000000-0000-0000-0000-000000000001',=20v_user_id,=20=
getGlobalIds('system'),=201=20where=20not=20exists(select=20=
role_id,ad_element_id,object_id,object_type_id=20from=20permissions=20=
where=20role_id=20=3D=20'00000000-0000-0000-0000-000000000001'=20and=20=
ad_element_id=20=3D=20v_user_id=20and=20object_id=3D=20=
getGlobalIds('system')=20and=20object_type_id=20=3D=201);=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20CheckDBConnection()=20RETURNS=20SETOF=20integer=20=
IMMUTABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=20SELECT=201;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=20from=20=
pg_proc=20inner=20join=20pg_namespace=20ns=20on=20=
(pg_proc.pronamespace=3Dns.oid)=20where=20ns.nspname=20=3D=20'public'=20=
and=20proname=20not=20ilike=20'uuid%'=20order=20by=20proname;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_views_syntax()=20RETURNS=20SETOF=20=
text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20=
select=20'DROP=20VIEW=20if=20exists=20'=20||=20table_name=20||=20'=20=
CASCADE;'=20from=20information_schema.views=20where=20table_schema=20=3D=20=
'public'=20order=20by=20table_name;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_tables_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20TABLE=20=
if=20exists=20'=20||=20table_name=20||=20'=20CASCADE;'=20from=20=
information_schema.tables=20where=20table_schema=20=3D=20'public'=20and=20=
table_type=20=3D=20'BASE=20TABLE'=20order=20by=20table_name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_seq_syntax()=20RETURNS=20SETOF=20=
text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20=
select=20'DROP=20SEQUENCE=20if=20exists=20'=20||=20sequence_name=20||=20=
'=20CASCADE;'=20from=20information_schema.sequences=20=20where=20=
sequence_schema=20=3D=20'public'=20order=20by=20sequence_name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_user_types_syntax()=20RETURNS=20=
SETOF=20text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20=
QUERY=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20FROM=20pg_namespace=20n,=20pg_class=20c,=20pg_type=20t=0A=20=20=20=
WHERE=20n.oid=20=3D=20c.relnamespace=20and=20t.typrelid=20=3D=20c.oid=20=
and=20c.relkind=20=3D=20'c'::"char"=20and=0A=20=20=20n.nspname=20=3D=20=
'public'=0A=20=20=20ORDER=20BY=20=20=
c.relname::information_schema.sql_identifier;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_get_column_size(=20v_table=20varchar(64),=20v_column=20varchar(64))=20=
returns=20integer=20STABLE=0A=20=20=20AS=20$procedure$=0A=20=20=20=
declare=0A=20=20=20retvalue=20=20integer;=0ABEGIN=0A=20=20=20retvalue=20=
:=3D=20character_maximum_length=20from=20information_schema.columns=0A=20=
=20=20=20where=0A=20=20=20=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column=20and=0A=20=20=20=20table_schema=20=3D=20=
'public'=20and=20udt_name=20in=20('char','varchar');=0A=20=20=20return=20=
retvalue;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
attach_user_to_su_role(v_permission_id=20uuid,=20v_user_id=20=
VARCHAR(255),=20v_name=20VARCHAR(255),=20v_domain=20VARCHAR(255))=0A=20=20=
RETURNS=20void=20AS=0A$BODY$=0A=20=20=20DECLARE=0A=20=20=20v_user_name=20=
VARCHAR(255);=0A=20=20=20v_document=20=20VARCHAR(64);=0A=20=20=20v_index=20=
=20INTEGER;=0A=20=20=20input_uuid=20uuid;=0ABEGIN=0A=20=20=20input_uuid=20=
=3D=20CAST(=20v_user_id=20AS=20uuid=20);=0A--=20find=20if=20name=20=
already=20includes=20domain=20(@)=0A=20=20=20v_index=20:=3D=20=
POSITION('@'=20IN=20v_name);=0A=0A=20=20=20if=20(v_index=20=3D=200)=20=
then=0A=20=20=20=20=20=20v_user_name=20:=3D=20coalesce(v_name,'')=20||=20=
'@'=20||=20coalesce(v_domain,'');=0A=20=20=20else=0A=20=20=20=20=20=20=
v_user_name=20:=3D=20v_name;=0A=20=20=20end=20if;=0A=0A=0Ainsert=20into=20=
users(user_id,name,domain,username,groups,status)=20select=20input_uuid,=20=
v_name,=20v_domain,=20v_user_name,'',1=20where=20not=20exists=20(select=20=
user_id,name,domain,username,groups,status=20from=20users=20where=20=
user_id=20=3D=20input_uuid);=0A=0Ainsert=20into=20=
permissions(id,role_id,ad_element_id,object_id,object_type_id)=20select=20=
v_permission_id,=20'00000000-0000-0000-0000-000000000001',=20input_uuid,=20=
getGlobalIds('system'),=201=20where=20not=20exists(select=20=
role_id,ad_element_id,object_id,object_type_id=20from=20permissions=20=
where=20role_id=20=3D=20'00000000-0000-0000-0000-000000000001'=20and=20=
ad_element_id=20=3D=20input_uuid=20and=20object_id=3D=20=
getGlobalIds('system')=20and=20object_type_id=20=3D=201);=0AEND;=20=
$BODY$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20=
FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
FUNCTION=20fn_db_add_action_group_to_role(v_role_id=20UUID,=20=
v_action_group_id=20INTEGER)=0ARETURNS=20VOID=0AAS=20$procedure$=0ABEGIN=0A=
=20=20=20=20=20=20=20INSERT=20INTO=20=
roles_groups(role_id,action_group_id)=0A=20=20=20=20=20=20=20SELECT=20=
v_role_id,=20v_action_group_id=0A=20=20=20=20=20=20=20WHERE=20NOT=20=
EXISTS=20(SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20FROM=20roles_groups=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20role_id=20=3D=20=
v_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20action_group_id=20=3D=20v_action_group_id);=0ARETURN;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_split_config_value(v_option_name=20character=20=
varying,=20v_old_option_value=20character=20varying,=20=
v_new_option_value=20character=20varying,=20v_update_from_version=20=
character=20varying)=0A=20=20RETURNS=20void=20AS=0A$BODY$=0Adeclare=0A=
v_old_value=20varchar(4000);=0Av_cur=20cursor=20for=20select=20distinct=20=
version=20from=20vdc_options=20where=20version=20<>=20'general'=20order=20=
by=20version;=0Av_version=20varchar(40);=0Av_index=20integer;=0Av_count=20=
integer;=0Av_total_count=20integer;=0Av_version_count=20integer;=0Abegin=0A=
=20=20=20=20v_total_count=20:=3D=20count(version)=20from=20vdc_options=20=
where=20option_name=20=3D=20v_option_name;=0A=20=20=20=20v_old_value=20=
:=3D=20option_value=20from=20vdc_options=20where=20option_name=20=3D=20=
v_option_name=20and=20version=20=3D=20'general';=0A=20=20=20=20=
v_version_count=20:=3D=20count(distinct=20version)=20from=20vdc_options=20=
where=20version=20<>=20'general';=0A=20=20=20=20if=20(v_total_count=20<=3D=
=20v_version_count)=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=20=
=20=20=20=20=20=20=20=20if=20(v_old_value=20IS=20NULL)=20then=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20v_old_value=20:=3D=20=
v_old_option_value;=0A=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=20=
=20=20=20=20=20=20=20=20=20=20=20v_count=20:=3D=20count(distinct=20=
version)=20from=20vdc_options=20where=20version=20<>=20'general';=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_index=20:=3D=201;=0A=20=20=20=20=20=20=20=
=20open=20v_cur;=0A=20=20=20=20=20=20=20=20loop=0A=20=20=20=20=20=20=20=20=
=20=20=20=20fetch=20v_cur=20into=20v_version;=0A=20=20=20=20=20=20=20=20=20=
=20=20=20exit=20when=20not=20found;=0A=20=20=20=20=20=20=20=20=20=20=20=20=
--=20We=20shouldn't=20update=20if=20already=20exists=0A=20=20=20=20=20=20=
=20=20=20=20=20=20if=20(not=20exists=20(select=201=20from=20vdc_options=20=
where=20option_name=20=3D=20v_option_name=20and=20version=20=3D=20=
v_version))=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=20=
Might=20not=20work=20well=20for=20versions=20such=20as=203.10,=20but=20=
we=20currently=20don't=20have=20any=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20if=20(v_version=20>=3D=20v_update_from_version)=20then=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20insert=20into=20=
vdc_options=20(option_name,=20option_value,=20version)=20values=20=
(v_option_name,=20v_new_option_value,=20v_version);=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20insert=20into=20vdc_options=20(option_name,=20=
option_value,=20version)=20values=20(v_option_name,=20v_old_value,=20=
v_version);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=
=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_index=20:=3D=20v_index=20+1;=0A=20=20=20=20=20=20=20=20end=20=
loop;=0A=20=20=20=20=20=20=20=20close=20v_cur;=0A=20=20=20=20=20=20=20=20=
delete=20from=20vdc_options=20where=20option_name=20=3D=20v_option_name=20=
and=20version=20=3D=20'general';=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_grant_action_group_to_all_roles_filter(v_action_group_id=20=
integer,=20uuid[])=0A=20=20RETURNS=20void=20AS=0A$BODY$=0Adeclare=0A=
v_role_id_to_filter=20alias=20for=20$2;=0Abegin=0A=20=20=20=20insert=20=
into=20roles_groups=20(role_id,=20action_group_id)=0A=20=20=20=20select=20=
distinct=20role_id,=20v_action_group_id=0A=20=20=20=20from=20=
roles_groups=20rg=0A=20=20=20=20where=20not=20ARRAY=20[role_id]=20<@=20=
v_role_id_to_filter=20and=20not=20exists=20(select=201=20from=20=
roles_groups=20where=20role_id=20=3D=20rg.role_id=20and=20=
action_group_id=20=3D=20v_action_group_id);=0AEND;=20$BODY$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_mask_object(v_object=20regclass)=20RETURNS=20setof=20record=20as=0A=
$BODY$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=20=20=20=20v_table=20=
record;=0A=20=20=20=20v_table_name=20TEXT;=0A=20=20=20=20temprec=20=
record;=0ABEGIN=0A=20=20=20=20--=20get=20full=20table/view=20name=20from=20=
v_object=20(i.e=20<namespace>.<name>)=0A=20=20=20=20select=20c.relname,=20=
n.nspname=20INTO=20v_table=0A=20=20=20=20=20=20=20=20FROM=20pg_class=20c=20=
join=20pg_namespace=20n=20on=20c.relnamespace=20=3D=20n.oid=20WHERE=20=
c.oid=20=3D=20v_object;=0A=20=20=20=20--=20try=20to=20get=20filtered=20=
query=20syntax=20from=20previous=20execution=0A=20=20=20=20if=20exists=20=
(select=201=20from=20object_column_white_list_sql=20where=20object_name=20=
=3D=20v_table.relname)=20then=0A=09select=20sql=20into=20v_sql=20from=20=
object_column_white_list_sql=20where=20object_name=20=3D=20=
v_table.relname;=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
v_table_name=20:=3D=20quote_ident(=20v_table.nspname=20)=20||=20'.'=20||=20=
quote_ident(=20v_table.relname=20);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20=20=20=20=20for=20temprec=20in=20select=20a.attname,=20=
t.typname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_attribute=20a=20join=20pg_type=20t=20on=20a.atttypid=20=3D=
=20t.oid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20a.attrelid=20=3D=20v_object=20AND=20a.attnum=20>=200=20AND=20=
NOT=20a.attisdropped=20ORDER=20BY=20a.attnum=0A=20=20=20=20=20=20=20=20=
loop=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20coalesce(=20=
v_sql=20||=20',=20',=20'SELECT=20'=20);=0A=20=20=20=20=20=20=20=20=20=20=20=
=20if=20exists(select=201=20from=20object_column_white_list=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20where=20object_name=20=3D=20=
v_table.relname=20and=20column_name=20=3D=20temprec.attname)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20=
quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20=
||=20'NULL::'=20||=20quote_ident(=20temprec.typname=20)=20||=20'=20as=20=
'=20||=20quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=
=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20END=20LOOP;=0A=20=20=20=20=20=
=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=
=20=20=20=20=20=20=20=20v_sql=20:=3D=20'SELECT=20x::'=20||=20=
v_table_name=20||=20'=20as=20rec=20FROM=20('=20||=20v_sql=20||=20')=20as=20=
x';=0A=20=20=20=20=20=20=20=20--=20save=20generated=20query=20for=20=
further=20use=0A=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list_sql(object_name,sql)=20values=20=
(v_table.relname,=20v_sql);=0A=20=20=20=20end=20if;=0A=20=20=20=20RETURN=20=
QUERY=20EXECUTE=20v_sql;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_add_column_to_object_white_list(v_object_name=20varchar(128),=20=
v_column_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0A=
begin=0A=20=20=20=20if=20(not=20exists=20(select=201=20from=20=
object_column_white_list=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20where=20object_name=20=3D=20v_object_name=20and=20=
column_name=20=3D=20v_column_name))=20then=0A=20=20=20=20=20=20=20=20=
begin=0A=20=20=20=20=20=20=20=20=20=20=20=20--=20verify=20that=20there=20=
is=20such=20object=20in=20db=0A=20=20=20=20=20=20=20=20=20=20=20=20if=20=
exists=20(select=201=20from=20information_schema.columns=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20where=20table_name=20=
=3D=20v_object_name=20and=20column_name=20=3D=20v_column_name)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list=20(object_name,=20column_name)=20values=20=
(v_object_name,=20v_column_name);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
end=20if;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20FUNCTION=20fn_db_unlock_disk(v_id=20UUID)=0Areturns=20void=0A=
AS=20$procedure$=0Adeclare=0A=20=20=20=20OK=20integer;=0A=20=20=20=20=
LOCKED=20integer;=0Abegin=0A=20=20=20=20OK:=3D1;=0A=20=20=20=20=
LOCKED:=3D2;=0A=20=20=20=20update=20images=20set=20imagestatus=20=3D=20=
OK=20where=20imagestatus=20=3D=20LOCKED=20and=0A=20=20=20=20=
image_group_id=20in=20(select=20device_id=20from=20vm_device=20where=20=
device_id=20=3D=20v_id=20and=20is_plugged);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_unlock_snapshot(v_id=20UUID)=0Areturns=20void=0AAS=20$procedure$=0A=
declare=0A=20=20=20=20OK=20varchar;=0A=20=20=20=20LOCKED=20varchar;=0A=
begin=0A=20=20=20=20OK:=3D'OK';=0A=20=20=20=20LOCKED:=3D'LOCKED';=0A=20=20=
=20=20update=20snapshots=20set=20status=20=3D=20OK=20where=20status=20=3D=20=
LOCKED=20and=20snapshot_id=20=3D=20v_id;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_unlock_entity(v_object_type=20varchar(10),=20v_name=20=
varchar(255),=20v_recursive=20boolean)=0Areturns=20void=0AAS=20=
$procedure$=0Adeclare=0A=20=20=20=20DOWN=20integer;=0A=20=20=20=20OK=20=
integer;=0A=20=20=20=20LOCKED=20integer;=0A=20=20=20=20TEMPLATE_OK=20=
integer;=0A=20=20=20=20TEMPLATE_LOCKED=20integer;=0A=20=20=20=20=
IMAGE_LOCKED=20integer;=0A=20=20=20=20SNAPSHOT_OK=20varchar;=0A=20=20=20=20=
SNAPSHOT_LOCKED=20varchar;=0A=20=20=20=20v_id=20UUID;=0Abegin=0A=20=20=20=
=20DOWN:=3D0;=0A=20=20=20=20OK:=3D1;=0A=20=20=20=20LOCKED:=3D2;=0A=20=20=20=
=20TEMPLATE_OK:=3D0;=0A=20=20=20=20TEMPLATE_LOCKED:=3D1;=0A=20=20=20=20=
IMAGE_LOCKED:=3D15;=0A=20=20=20=20SNAPSHOT_OK:=3D'OK';=0A=20=20=20=20=
SNAPSHOT_LOCKED:=3D'LOCKED';=0A=20=20=20=20v_id=20:=3D=20vm_guid=20from=20=
vm_static=20where=20vm_name=20=3D=20v_name=20and=20entity_type=20ilike=20=
v_object_type;=0A=20=20=20=20--=20set=20VM=20status=20to=20DOWN=0A=20=20=20=
=20if=20(v_object_type=20=3D=20'vm')=20then=0A=20=20=20=20=20=20=20=20=
update=20vm_dynamic=20set=20status=20=3D=20DOWN=20where=20status=20=3D=20=
IMAGE_LOCKED=20and=20vm_guid=20=20=3D=20v_id;=0A=20=20=20=20--=20set=20=
Template=20status=20to=20OK=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
if=20(v_object_type=20=3D=20'template')=20then=0A=20=20=20=20=20=20=20=20=
=20=20=20=20update=20vm_static=20set=20template_status=20=3D=20=
TEMPLATE_OK=20where=20template_status=20=3D=20TEMPLATE_LOCKED=20and=20=
vm_guid=20=20=3D=20v_id;=0A=20=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=
end=20if;=0A=20=20=20=20--unlock=20images=20and=20snapshots=20=20if=20=
recursive=20flag=20is=20set=0A=20=20=20=20if=20(v_recursive)=20then=0A=20=
=20=20=20=20=20=20=20update=20images=20set=20imagestatus=20=3D=20OK=20=
where=20imagestatus=20=3D=20LOCKED=20and=0A=20=20=20=20=20=20=20=20=
image_group_id=20in=20(select=20device_id=20from=20vm_device=20where=20=
vm_id=20=3D=20v_id=20and=20is_plugged);=0A=0A=20=20=20=20=20=20=20=20=
update=20snapshots=20set=20status=20=3D=20SNAPSHOT_OK=20where=20status=20=
ilike=20SNAPSHOT_LOCKED=20and=20vm_id=20=3D=20v_id;=0A=20=20=20=20end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A/*=20Displays=20DC=20id=20,=20DC=20name,=20SPM=20Host=20id=20=
,=20SPM=20Host=20name=20and=20number=20of=20async=20tasks=20awaiting.=0A=0A=
1)=20create=20a=20record=20type=20with=20DC=20name,=20DC=20id,=20SPM=20=
host=20id,=20SPM=20host=20name,=20count=0A=0A2)=20get=20all=20distinct=20=
DC=20ids=20from=20async_tasks=20table=0A=0A3)=20Run=20a=20cursor=20for=20=
each=20result=20in=202)=0A=0A=20=20=20a)=20get=20DC=20name=0A=20=20=20b)=20=
get=20SPM=20Host=20id=20&=20name=20if=20available=0A=20=20=20c)=20get=20=
count=20of=20tasks=0A=0A=20=20=20return=20current=20record=0A=0A4)=20=
return=20set=20of=20generated=20records=0A*/=0ADROP=20TYPE=20IF=20EXISTS=20=
async_tasks_info_rs=20CASCADE;=0A**************************=0A=0ADROP=20=
TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
async_tasks_info_rs=20AS=20(=0A=20=20=20=20dc_id=20UUID,=20dc_name=20=
CHARACTER=20VARYING,=20spm_host_id=20UUID,=20spm_host_name=20CHARACTER=20=
VARYING,=20task_count=20integer);=0A**************************=0A=0A=
CREATE=20TYPE=0A*********=20QUERY=20**********=0Acreate=20or=20replace=20=
FUNCTION=20fn_db_get_async_tasks()=0Areturns=20SETOF=20=
async_tasks_info_rs=20STABLE=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20=
v_record=20async_tasks_info_rs;=0A=0A=20=20=20=20--=20selects=20=
storage_pool_id=20uuid=20found=20in=20async_tasks=0A=20=20=20=20=
v_tasks_cursor=20cursor=20for=20select=20distinct=20storage_pool_id=20=
from=20async_tasks;=0Abegin=0A=0A=20=20=20=20OPEN=20v_tasks_cursor;=0A=20=
=20=20=20FETCH=20v_tasks_cursor=20into=20v_record.dc_id;=0A=20=20=20=20=
WHILE=20FOUND=20LOOP=0A=20=20=20=20=20=20=20=20--=20get=20dc_name=20and=20=
SPM=20Host=20id=0A=20=20=20=20=20=20=20=20v_record.dc_name=20:=3D=20name=20=
from=20storage_pool=20where=20id=20=3D=20v_record.dc_id;=0A=20=20=20=20=20=
=20=20=20v_record.spm_host_id=20:=3D=0A=20=20=20=20=20=20=20=20=20=20=20=20=
spm_vds_id=20from=20storage_pool=20where=20id=20=3D=20v_record.dc_id;=0A=20=
=20=20=20=20=20=20=20--=20get=20Host=20name=20if=20we=20have=20non=20=
NULL=20SPM=20Host=0A=20=20=20=20=20=20=20=20if=20(v_record.spm_host_id=20=
IS=20NOT=20NULL)=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_record.spm_host_name=20:=3D=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20vds_name=20from=20vds_static=20where=20vds_id=20=3D=20=
v_record.spm_host_id;=0A=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_record.spm_host_name:=3D'';=0A=20=20=20=20=20=20=20=20=
end=20if;=0A=20=20=20=20=20=20=20=20--=20get=20tasks=20count=20for=20=
this=20DC=0A=20=20=20=20=20=20=20=20v_record.task_count=20:=3D=20=
count(*)=20from=20async_tasks=0A=20=20=20=20=20=20=20=20=20=20=20=20=
where=20position=20(cast(v_record.dc_id=20as=20varchar)=20in=20=
action_parameters)=20>=200;=0A=20=20=20=20=20=20=20=20--=20return=20the=20=
record=0A=20=20=20=20=20=20=20=20RETURN=20NEXT=20v_record;=0A=20=20=20=20=
=20=20=20=20FETCH=20v_tasks_cursor=20into=20v_record.dc_id;=0A=20=20=20=20=
END=20LOOP;=0A=20=20=20=20CLOSE=20v_tasks_cursor;=0A=20=20=20=20--=20=
return=20full=20set=20of=20generated=20records=0A=20=20=20=20RETURN;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Aselect=20=
fn_db_add_column('schema_version',=20'comment',=20'text=20NULL=20default=20=
''''=20');=0A**************************=0A=0A=20=0A=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
update_enum_translator(enum_type=20varchar(40),=20enum_key=20smallint,=20=
language_code=20varchar(40),=20value=20text)=20RETURNS=20void=20AS=20$$=0A=
BEGIN=0A=20=20=20=20DELETE=20FROM=20enum_translator=0A=20=20=20=20WHERE=20=
enum_translator.enum_type=20=3D=20update_enum_translator.enum_type=0A=20=20=
=20=20=20=20=20=20=20=20AND=20enum_translator.enum_key=20=3D=20=
update_enum_translator.enum_key=0A=20=20=20=20=20=20=20=20=20=20AND=20=
enum_translator.language_code=20=3D=20=
update_enum_translator.language_code=0A=20=20=20=20=20=20=20=20=20=20AND=20=
EXISTS=20(SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20FROM=20enum_translator=20as=20a=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20a.enum_type=20=3D=20=
update_enum_translator.enum_type=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20a.enum_key=20=3D=20=
update_enum_translator.enum_key=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20AND=20a.language_code=20=3D=20=
update_enum_translator.language_code);=0A=20=20=20=20INSERT=20INTO=20=
enum_translator=20VALUES=20(update_enum_translator.enum_type,=20=
update_enum_translator.enum_key,=20update_enum_translator.language_code,=20=
update_enum_translator.value);=0AEND;=0A$$=20LANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0AALTER=20TABLE=20schema_version=20ALTER=20COLUMN=20=
installed_by=20TYPE=20varchar(63);=0A**************************=0A=0A=
ALTER=20TABLE=0A*********=20QUERY=20**********=0AINSERT=20INTO=20=
history_configuration(var_name,var_value)=20SELECT=20=
'default_language','en_US'=20WHERE=20not=20exists=20(SELECT=20var_name=20=
FROM=20history_configuration=20WHERE=20var_name=20=3D=20=
'default_language');=0A**************************=0A=0AINSERT=200=200=0A=
*********=20QUERY=20**********=0AUPDATE=20history_configuration=20SET=20=
var_value=20=3D=20'en_US'=20WHERE=20var_name=20=3D=20'default_language'=20=
and=20var_value=20=3D=20'us-en';=0A**************************=0A=0A=
UPDATE=200=0A*********=20QUERY=20**********=0AINSERT=20INTO=20=
history_configuration(var_name,var_value)=20SELECT=20=
'MinimalETLVersion','4.0.0'=20WHERE=20not=20exists=20(SELECT=20var_name=20=
FROM=20history_configuration=20WHERE=20var_name=20=3D=20=
'MinimalETLVersion');=0A**************************=0A=0AINSERT=200=200=0A=
*********=20QUERY=20**********=0AUPDATE=20history_configuration=20SET=20=
var_value=20=3D=20'4.0.0'=20WHERE=20var_name=20=3D=20=
'MinimalETLVersion';=0A**************************=0A=0AUPDATE=201=0A=
*********=20QUERY=20**********=0Acopy=20(=0A=09=09select=20version=0A=09=09=
from=20schema_version=0A=09=09where=20current=20=3D=20true=0A=09=09order=20=
by=20id=0A=09=09LIMIT=201=0A=09)=20to=20stdout=20with=20delimiter=20as=20=
'|';=0A**************************=0A=0A*********=20QUERY=20**********=0A=
copy=20(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(select=20now())=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(=0A=09=09=09select=20max(id)=0A=09=09=09from=20schema_version=0A=09=09=09=
where=20state=20in=20('INSTALLED','SKIPPED')=0A=09=09)=20to=20stdout=20=
with=20delimiter=20as=20'|';=0A**************************=0A=0A*********=20=
QUERY=20**********=0A=0A=09=09update=20schema_version=0A=09=09set=20=
current=3D(id=3D42);=0A=09=0A**************************=0A=0AUPDATE=2042=0A=
*********=20QUERY=20**********=0A/**************************************=0A=
=20=20=20=20=20=20=20=20=20=20=20VERSIONED=20VIEWS=20(3.6)=0A=
**************************************/=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_enum_translator=0A=20AS=0ASELECT=0A=20=20=20=20=
enum_translator.enum_type=20as=20enum_type,=0A=20=20=20=20=
enum_translator.enum_key=20as=20enum_key,=0A=20=20=20=20=
enum_translator.value=20as=20value=0AFROM=20enum_translator=20INNER=20=
JOIN=0A=20=20=20=20=20=20=20=20=20=20=20=20history_configuration=20ON=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
(enum_translator.language_code=20=3D=20history_configuration.var_value=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20and=20=
history_configuration.var_name=20=3D=20'default_language');=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_configuration_history_datacenters=0A=20AS=0ASELECT=0A=20=20=20=20=20=
=20history_id=20as=20history_id,=0A=20=20=20=20=20=20datacenter_id=20as=20=
datacenter_id,=0A=20=20=20=20=20=20datacenter_name=20as=20=
datacenter_name,=0A=20=20=20=20=20=20datacenter_description=20as=20=
datacenter_description,=0A=20=20=20=20=20=20is_local_storage=20as=20=
is_local_storage,=0A=20=20=20=20=20=20create_date=20as=20create_date,=0A=20=
=20=20=20=20=20update_date=20as=20update_date,=0A=20=20=20=20=20=20=
delete_date=20as=20delete_date=0AFROM=20datacenter_configuration;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_latest_configuration_datacenters=0A=20AS=0ASELECT=0A=20=20=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20=20=20datacenter_id=20as=20=
datacenter_id,=0A=20=20=20=20=20=20datacenter_name=20as=20=
datacenter_name,=0A=20=20=20=20=20=20datacenter_description=20as=20=
datacenter_description,=0A=20=20=20=20=20=20is_local_storage=20as=20=
is_local_storage,=0A=20=20=20=20=20=20create_date=20as=20create_date,=0A=20=
=20=20=20=20=20update_date=20as=20update_date=0AFROM=20=
datacenter_configuration=0AWHERE=20history_id=20in=20(SELECT=20=
max(a.history_id)=20FROM=20datacenter_configuration=20as=20a=20GROUP=20=
BY=20a.datacenter_id)=0A=20=20=20=20=20=20and=20delete_date=20IS=20NULL;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_datacenters_resources_usage_samples=0A=20AS=0ASELECT=0A=20=
=20=20=20=20=20cast(NULL=20as=20bigint)=20=20as=20history_id,=0A=20=20=20=
=20=20=20cast(NULL=20as=20timestamp=20with=20time=20zone)=20=20as=20=
history_datetime,=0A=20=20=20=20=20=20cast(NULL=20as=20uuid)=20as=20=
datacenter_id,=0A=20=20=20=20=20=20cast(NULL=20as=20smallint=20)=20as=20=
datacenter_status,=0A=20=20=20=20=20=20cast(NULL=20as=20numeric(7,2))=20=
as=20minutes_in_status,=0A=20=20=20=20=20=20cast(NULL=20as=20integer)=20=
as=20datacenter_configuration_version;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20v3_6_statistics_datacenters_resources_usage_hourly=0A=20AS=0A=
SELECT=0A=20=20=20=20=20=20cast(NULL=20as=20bigint)=20=20as=20=
history_id,=0A=20=20=20=20=20=20cast(NULL=20as=20timestamp=20with=20time=20=
zone)=20=20as=20history_datetime,=0A=20=20=20=20=20=20cast(NULL=20as=20=
uuid)=20as=20datacenter_id,=0A=20=20=20=20=20=20cast(NULL=20as=20=
smallint=20)=20as=20datacenter_status,=0A=20=20=20=20=20=20cast(NULL=20=
as=20numeric(7,2))=20as=20minutes_in_status,=0A=20=20=20=20=20=20=
cast(NULL=20as=20integer)=20as=20datacenter_configuration_version;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_datacenters_resources_usage_daily=0A=20AS=0ASELECT=0A=20=20=
=20=20=20=20cast(NULL=20as=20bigint)=20=20as=20history_id,=0A=20=20=20=20=
=20=20cast(NULL=20as=20date)=20=20as=20history_datetime,=0A=20=20=20=20=20=
=20cast(NULL=20as=20uuid)=20as=20datacenter_id,=0A=20=20=20=20=20=20=
cast(NULL=20as=20smallint=20)=20as=20datacenter_status,=0A=20=20=20=20=20=
=20cast(NULL=20as=20numeric(7,2))=20as=20minutes_in_status,=0A=20=20=20=20=
=20=20cast(NULL=20as=20integer)=20as=20datacenter_configuration_version;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_map_history_datacenters_storage_domains=0A=20AS=0ASELECT=0A=20=20=20=
=20history_id=20as=20history_id,=0A=20=20=20=20storage_domain_id=20as=20=
storage_domain_id,=0A=20=20=20=20datacenter_id=20as=20datacenter_id,=0A=20=
=20=20=20attach_date=20as=20attach_date,=0A=20=20=20=20detach_date=20as=20=
detach_date=0AFROM=20=20=20=20=20=20=20=20=20=
datacenter_storage_domain_map;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_latest_map_datacenters_storage_domains=0A=20AS=0ASELECT=0A=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20storage_domain_id=20as=20=
storage_domain_id,=0A=20=20=20=20datacenter_id=20as=20datacenter_id,=0A=20=
=20=20=20attach_date=20as=20attach_date=0AFROM=20=20=20=20=20=20=20=20=20=
datacenter_storage_domain_map=0AWHERE=20history_id=20in=20(SELECT=20=
max(a.history_id)=20FROM=20datacenter_storage_domain_map=20as=20a=20=
GROUP=20BY=20a.storage_domain_id,=20a.datacenter_id)=0A=20=20=20=20=20=20=
and=20detach_date=20IS=20NULL;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_configuration_history_storage_domains=0A=20AS=0ASELECT=0A=20=20=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
storage_domain_id=20as=20storage_domain_id,=0A=20=20=20=20=20=20=
storage_domain_name=20as=20storage_domain_name,=0A=20=20=20=20=20=20=
storage_domain_type=20as=20storage_domain_type,=0A=20=20=20=20=20=20=
storage_type=20as=20storage_type,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date,=0A=20=20=
=20=20=20=20delete_date=20as=20delete_date=0AFROM=20=
storage_domain_configuration;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_latest_configuration_storage_domains=0A=20AS=0ASELECT=0A=20=20=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
storage_domain_id=20as=20storage_domain_id,=0A=20=20=20=20=20=20=
storage_domain_name=20as=20storage_domain_name,=0A=20=20=20=20=20=20=
storage_domain_type=20as=20storage_domain_type,=0A=20=20=20=20=20=20=
storage_type=20as=20storage_type,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date=0AFROM=20=
storage_domain_configuration=0AWHERE=20history_id=20in=20(SELECT=20=
max(a.history_id)=20FROM=20storage_domain_configuration=20as=20a=20GROUP=20=
BY=20a.storage_domain_id)=0A=20=20=20=20=20=20and=20delete_date=20IS=20=
NULL;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_storage_domains_resources_usage_samples=0A=20AS=0ASELECT=0A=
=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
storage_domain_id=20as=20storage_domain_id,=0A=20=20=20=20=20=20=
storage_domain_status,=0A=20=20=20=20=20=20cast(seconds_in_status=20as=20=
numeric(7,2))=20/=2060=20as=20minutes_in_status,=0A=20=20=20=20=20=20=
available_disk_size_gb=20as=20available_disk_size_gb,=0A=20=20=20=20=20=20=
used_disk_size_gb=20as=20used_disk_size_gb,=0A=20=20=20=20=20=20=
storage_configuration_version=20as=20storage_configuration_version=0A=
FROM=20storage_domain_samples_history;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20v3_6_statistics_storage_domains_resources_usage_hourly=0A=20AS=0A=
SELECT=0A=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=
=20history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
storage_domain_id=20as=20storage_domain_id,=0A=20=20=20=20=20=20=
storage_domain_status,=0A=20=20=20=20=20=20minutes_in_status,=0A=20=20=20=
=20=20=20available_disk_size_gb=20as=20available_disk_size_gb,=0A=20=20=20=
=20=20=20used_disk_size_gb=20as=20used_disk_size_gb,=0A=20=20=20=20=20=20=
storage_configuration_version=20as=20storage_configuration_version=0A=
FROM=20storage_domain_hourly_history;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20v3_6_statistics_storage_domains_resources_usage_daily=0A=20AS=0A=
SELECT=0A=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=
=20history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
storage_domain_id=20as=20storage_domain_id,=0A=20=20=20=20=20=20=
storage_domain_status,=0A=20=20=20=20=20=20minutes_in_status,=0A=20=20=20=
=20=20=20available_disk_size_gb=20as=20available_disk_size_gb,=0A=20=20=20=
=20=20=20used_disk_size_gb=20as=20used_disk_size_gb,=0A=20=20=20=20=20=20=
storage_configuration_version=20as=20storage_configuration_version=0A=
FROM=20storage_domain_daily_history;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20v3_6_configuration_history_clusters=0A=20AS=0ASELECT=0A=20=20=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20cluster_id=20as=20=
cluster_id,=0A=20=20=20=20=20=20cluster_name=20as=20cluster_name,=0A=20=20=
=20=20=20=20cluster_description=20as=20cluster_description,=0A=20=20=20=20=
=20=20datacenter_id=20as=20datacenter_id,=0A=20=20=20=20=20=20cpu_name=20=
as=20cpu_name,=0A=20=20=20=20=20=20compatibility_version=20as=20=
compatibility_version,=0A=20=20=20=20=20=20=
datacenter_configuration_version=20as=20=
datacenter_configuration_version,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date,=0A=20=20=
=20=20=20=20delete_date=20as=20delete_date=0AFROM=20=
cluster_configuration;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_latest_configuration_clusters=0A=20AS=0ASELECT=0A=20=20=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20=20=20cluster_id=20as=20=
cluster_id,=0A=20=20=20=20=20=20cluster_name=20as=20cluster_name,=0A=20=20=
=20=20=20=20cluster_description=20as=20cluster_description,=0A=20=20=20=20=
=20=20datacenter_id=20as=20datacenter_id,=0A=20=20=20=20=20=20cpu_name=20=
as=20cpu_name,=0A=20=20=20=20=20=20compatibility_version=20as=20=
compatibility_version,=0A=20=20=20=20=20=20=
datacenter_configuration_version=20as=20=
datacenter_configuration_version,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date=0AFROM=20=
cluster_configuration=0AWHERE=20history_id=20in=20(SELECT=20=
max(a.history_id)=20FROM=20cluster_configuration=20as=20a=20GROUP=20BY=20=
a.cluster_id)=0A=20=20=20=20=20=20and=20delete_date=20IS=20NULL;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_configuration_history_hosts=0A=20AS=0ASELECT=0A=20=20=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20=20=20host_id=20as=20=
host_id,=0A=20=20=20=20=20=20host_unique_id=20as=20host_unique_id,=0A=20=20=
=20=20=20=20host_name=20as=20host_name,=0A=20=20=20=20=20=20cluster_id=20=
as=20cluster_id,=0A=20=20=20=20=20=20host_type=20as=20host_type,=0A=20=20=
=20=20=20=20fqdn_or_ip=20as=20fqdn_or_ip,=0A=20=20=20=20=20=20=
memory_size_mb=20as=20memory_size_mb,=0A=20=20=20=20=20=20swap_size_mb=20=
as=20swap_size_mb,=0A=20=20=20=20=20=20cpu_model=20as=20cpu_model,=0A=20=20=
=20=20=20=20number_of_cores=20as=20number_of_cores,=0A=20=20=20=20=20=20=
number_of_sockets,=0A=20=20=20=20=20=20cpu_speed_mh,=0A=20=20=20=20=20=20=
host_os=20as=20host_os,=0A=20=20=20=20=20=20kernel_version=20as=20=
kernel_version,=0A=20=20=20=20=20=20kvm_version=20as=20kvm_version,=0A=20=
=20=20=20=20=20CASE=20SUBSTR(vdsm_version,1,3)=0A=20=20=20=20=20=20=20=20=
WHEN=20'4.4'=20THEN=20'2.1'=20||=20=
SUBSTR(vdsm_version,4,LENGTH(vdsm_version))=0A=20=20=20=20=20=20=20=20=
WHEN=20'4.5'=20THEN=20'2.2'=20||=20=
SUBSTR(vdsm_version,4,LENGTH(vdsm_version))=0A=20=20=20=20=20=20=20=20=
WHEN=20'4.9'=20THEN=20'2.3'=20||=20=
SUBSTR(vdsm_version,4,LENGTH(vdsm_version))=0A=20=20=20=20=20=20ELSE=20=
vdsm_version=0A=20=20=20=20=20=20END=20as=20vdsm_version,=0A=20=20=20=20=20=
=20vdsm_port=20as=20vdsm_port,=0A=20=20=20=20=20=20threads_per_core=20as=20=
threads_per_core,=0A=20=20=20=20=20=20hardware_manufacturer=20as=20=
hardware_manufacturer,=0A=20=20=20=20=20=20hardware_product_name=20as=20=
hardware_product_name,=0A=20=20=20=20=20=20hardware_version=20as=20=
hardware_version,=0A=20=20=20=20=20=20hardware_serial_number=20as=20=
hardware_serial_number,=0A=20=20=20=20=20=20=
cluster_configuration_version=20as=20cluster_configuration_version,=0A=20=
=20=20=20=20=20create_date=20as=20create_date,=0A=20=20=20=20=20=20=
update_date=20as=20update_date,=0A=20=20=20=20=20=20delete_date=20as=20=
delete_date=0AFROM=20host_configuration;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20v3_6_latest_configuration_hosts=0A=20AS=0ASELECT=0A=20=20=20=20=20=
=20history_id=20as=20history_id,=0A=20=20=20=20=20=20host_id=20as=20=
host_id,=0A=20=20=20=20=20=20host_unique_id=20as=20host_unique_id,=0A=20=20=
=20=20=20=20host_name=20as=20host_name,=0A=20=20=20=20=20=20cluster_id=20=
as=20cluster_id,=0A=20=20=20=20=20=20host_type=20as=20host_type,=0A=20=20=
=20=20=20=20fqdn_or_ip=20as=20fqdn_or_ip,=0A=20=20=20=20=20=20=
memory_size_mb=20as=20memory_size_mb,=0A=20=20=20=20=20=20swap_size_mb=20=
as=20swap_size_mb,=0A=20=20=20=20=20=20cpu_model=20as=20cpu_model,=0A=20=20=
=20=20=20=20number_of_cores=20as=20number_of_cores,=0A=20=20=20=20=20=20=
number_of_sockets,=0A=20=20=20=20=20=20cpu_speed_mh,=0A=20=20=20=20=20=20=
host_os=20as=20host_os,=0A=20=20=20=20=20=20kernel_version=20as=20=
kernel_version,=0A=20=20=20=20=20=20kvm_version=20as=20kvm_version,=0A=20=
=20=20=20=20=20CASE=20SUBSTR(vdsm_version,1,3)=0A=20=20=20=20=20=20=20=20=
WHEN=20'4.4'=20THEN=20'2.1'=20||=20=
SUBSTR(vdsm_version,4,LENGTH(vdsm_version))=0A=20=20=20=20=20=20=20=20=
WHEN=20'4.5'=20THEN=20'2.2'=20||=20=
SUBSTR(vdsm_version,4,LENGTH(vdsm_version))=0A=20=20=20=20=20=20=20=20=
WHEN=20'4.9'=20THEN=20'2.3'=20||=20=
SUBSTR(vdsm_version,4,LENGTH(vdsm_version))=0A=20=20=20=20=20=20ELSE=20=
vdsm_version=0A=20=20=20=20=20=20END=20as=20vdsm_version,=0A=20=20=20=20=20=
=20vdsm_port=20as=20vdsm_port,=0A=20=20=20=20=20=20threads_per_core=20as=20=
threads_per_core,=0A=20=20=20=20=20=20hardware_manufacturer=20as=20=
hardware_manufacturer,=0A=20=20=20=20=20=20hardware_product_name=20as=20=
hardware_product_name,=0A=20=20=20=20=20=20hardware_version=20as=20=
hardware_version,=0A=20=20=20=20=20=20hardware_serial_number=20as=20=
hardware_serial_number,=0A=20=20=20=20=20=20=
cluster_configuration_version=20as=20cluster_configuration_version,=0A=20=
=20=20=20=20=20create_date=20as=20create_date,=0A=20=20=20=20=20=20=
update_date=20as=20update_date=0AFROM=20host_configuration=0AWHERE=20=
history_id=20in=20(SELECT=20max(a.history_id)=20FROM=20=
host_configuration=20as=20a=20GROUP=20BY=20a.host_id)=0A=20=20=20=20=20=20=
and=20delete_date=20IS=20NULL;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_hosts_resources_usage_samples=0A=20AS=0ASELECT=0A=20=20=20=
=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20host_id=20=
as=20host_id,=0A=20=20=20=20=20=20host_status=20as=20host_status,=0A=20=20=
=20=20=20=20cast(seconds_in_status=20as=20numeric(7,2))=20/=2060=20as=20=
minutes_in_status,=0A=20=20=20=20=20=20memory_usage_percent=20as=20=
memory_usage_percent,=0A=20=20=20=20=20=20ksm_shared_memory_mb,=0A=20=20=20=
=20=20=20cpu_usage_percent=20as=20cpu_usage_percent,=0A=20=20=20=20=20=20=
ksm_cpu_percent=20as=20ksm_cpu_percent,=0A=20=20=20=20=20=20active_vms=20=
as=20active_vms,=0A=20=20=20=20=20=20total_vms=20as=20total_vms,=0A=20=20=
=20=20=20=20total_vms_vcpus=20as=20total_vms_vcpus,=0A=20=20=20=20=20=20=
cpu_load=20as=20cpu_load,=0A=20=20=20=20=20=20system_cpu_usage_percent=20=
as=20system_cpu_usage_percent,=0A=20=20=20=20=20=20=
user_cpu_usage_percent=20as=20user_cpu_usage_percent,=0A=20=20=20=20=20=20=
swap_used_mb=20as=20swap_used_mb,=0A=20=20=20=20=20=20=
host_configuration_version=20as=20host_configuration_version=0AFROM=20=
host_samples_history;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_hosts_resources_usage_hourly=0A=20AS=0ASELECT=0A=20=20=20=
=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20host_id=20=
as=20host_id,=0A=20=20=20=20=20=20host_status=20as=20host_status,=0A=20=20=
=20=20=20=20minutes_in_status=20as=20minutes_in_status,=0A=20=20=20=20=20=
=20memory_usage_percent=20as=20memory_usage_percent,=0A=20=20=20=20=20=20=
max_memory_usage=20as=20max_memory_usage,=0A=20=20=20=20=20=20=
ksm_shared_memory_mb,=0A=20=20=20=20=20=20max_ksm_shared_memory_mb,=0A=20=
=20=20=20=20=20cpu_usage_percent=20as=20cpu_usage_percent,=0A=20=20=20=20=
=20=20max_cpu_usage=20as=20max_cpu_usage,=0A=20=20=20=20=20=20=
ksm_cpu_percent=20as=20ksm_cpu_percent,=0A=20=20=20=20=20=20=
max_ksm_cpu_percent=20as=20max_ksm_cpu_percent,=0A=20=20=20=20=20=20=
active_vms=20as=20active_vms,=0A=20=20=20=20=20=20max_active_vms=20as=20=
max_active_vms,=0A=20=20=20=20=20=20total_vms=20as=20total_vms,=0A=20=20=20=
=20=20=20max_total_vms=20as=20max_total_vms,=0A=20=20=20=20=20=20=
total_vms_vcpus=20as=20total_vms_vcpus,=0A=20=20=20=20=20=20=
max_total_vms_vcpus=20as=20max_total_vms_vcpus,=0A=20=20=20=20=20=20=
cpu_load=20as=20cpu_load,=0A=20=20=20=20=20=20max_cpu_load=20as=20=
max_cpu_load,=0A=20=20=20=20=20=20system_cpu_usage_percent=20as=20=
system_cpu_usage_percent,=0A=20=20=20=20=20=20=
max_system_cpu_usage_percent=20as=20max_system_cpu_usage_percent,=0A=20=20=
=20=20=20=20user_cpu_usage_percent=20as=20user_cpu_usage_percent,=0A=20=20=
=20=20=20=20max_user_cpu_usage_percent=20as=20=
max_user_cpu_usage_percent,=0A=20=20=20=20=20=20swap_used_mb=20as=20=
swap_used_mb,=0A=20=20=20=20=20=20max_swap_used_mb=20as=20=
max_swap_used_mb,=0A=20=20=20=20=20=20host_configuration_version=20as=20=
host_configuration_version=0AFROM=20host_hourly_history;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_hosts_resources_usage_daily=0A=20AS=0ASELECT=0A=20=20=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20history_datetime=20=
as=20history_datetime,=0A=20=20=20=20=20=20host_id=20as=20host_id,=0A=20=20=
=20=20=20=20host_status=20as=20host_status,=0A=20=20=20=20=20=20=
minutes_in_status=20as=20minutes_in_status,=0A=20=20=20=20=20=20=
memory_usage_percent=20as=20memory_usage_percent,=0A=20=20=20=20=20=20=
max_memory_usage=20as=20max_memory_usage,=0A=20=20=20=20=20=20=
ksm_shared_memory_mb,=0A=20=20=20=20=20=20max_ksm_shared_memory_mb,=0A=20=
=20=20=20=20=20cpu_usage_percent=20as=20cpu_usage_percent,=0A=20=20=20=20=
=20=20max_cpu_usage=20as=20max_cpu_usage,=0A=20=20=20=20=20=20=
ksm_cpu_percent=20as=20ksm_cpu_percent,=0A=20=20=20=20=20=20=
max_ksm_cpu_percent=20as=20max_ksm_cpu_percent,=0A=20=20=20=20=20=20=
active_vms=20as=20active_vms,=0A=20=20=20=20=20=20max_active_vms=20as=20=
max_active_vms,=0A=20=20=20=20=20=20total_vms=20as=20total_vms,=0A=20=20=20=
=20=20=20max_total_vms=20as=20max_total_vms,=0A=20=20=20=20=20=20=
total_vms_vcpus=20as=20total_vms_vcpus,=0A=20=20=20=20=20=20=
max_total_vms_vcpus=20as=20max_total_vms_vcpus,=0A=20=20=20=20=20=20=
cpu_load=20as=20cpu_load,=0A=20=20=20=20=20=20max_cpu_load=20as=20=
max_cpu_load,=0A=20=20=20=20=20=20system_cpu_usage_percent=20as=20=
system_cpu_usage_percent,=0A=20=20=20=20=20=20=
max_system_cpu_usage_percent=20as=20max_system_cpu_usage_percent,=0A=20=20=
=20=20=20=20user_cpu_usage_percent=20as=20user_cpu_usage_percent,=0A=20=20=
=20=20=20=20max_user_cpu_usage_percent=20as=20=
max_user_cpu_usage_percent,=0A=20=20=20=20=20=20swap_used_mb=20as=20=
swap_used_mb,=0A=20=20=20=20=20=20max_swap_used_mb=20as=20=
max_swap_used_mb,=0A=20=20=20=20=20=20host_configuration_version=20as=20=
host_configuration_version=0AFROM=20host_daily_history;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_configuration_history_hosts_interfaces=0A=20AS=0ASELECT=0A=20=20=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
host_interface_id=20as=20host_interface_id,=0A=20=20=20=20=20=20=
host_interface_name=20as=20host_interface_name,=0A=20=20=20=20=20=20=
host_id=20as=20host_id,=0A=20=20=20=20=20=20host_interface_type=20as=20=
host_interface_type,=0A=20=20=20=20=20=20host_interface_speed_bps=20as=20=
host_interface_speed_bps,=0A=20=20=20=20=20=20mac_address=20as=20=
mac_address,=0A=20=20=20=20=20=20logical_network_name,=0A=20=20=20=20=20=20=
ip_address=20as=20ip_address,=0A=20=20=20=20=20=20gateway=20as=20=
gateway,=0A=20=20=20=20=20=20bond=20as=20bond,=0A=20=20=20=20=20=20=
bond_name=20as=20bond_name,=0A=20=20=20=20=20=20vlan_id=20as=20vlan_id,=0A=
=20=20=20=20=20=20host_configuration_version=20as=20=
host_configuration_version,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date,=0A=20=20=
=20=20=20=20delete_date=20as=20delete_date=0AFROM=20=
host_interface_configuration;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_latest_configuration_hosts_interfaces=0A=20AS=0ASELECT=0A=20=20=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
host_interface_id=20as=20host_interface_id,=0A=20=20=20=20=20=20=
host_interface_name=20as=20host_interface_name,=0A=20=20=20=20=20=20=
host_id=20as=20host_id,=0A=20=20=20=20=20=20host_interface_type=20as=20=
host_interface_type,=0A=20=20=20=20=20=20host_interface_speed_bps=20as=20=
host_interface_speed_bps,=0A=20=20=20=20=20=20mac_address=20as=20=
mac_address,=0A=20=20=20=20=20=20logical_network_name,=0A=20=20=20=20=20=20=
ip_address=20as=20ip_address,=0A=20=20=20=20=20=20gateway=20as=20=
gateway,=0A=20=20=20=20=20=20bond=20as=20bond,=0A=20=20=20=20=20=20=
bond_name=20as=20bond_name,=0A=20=20=20=20=20=20vlan_id=20as=20vlan_id,=0A=
=20=20=20=20=20=20host_configuration_version=20as=20=
host_configuration_version,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date=0AFROM=20=
host_interface_configuration=0AWHERE=20history_id=20in=20(SELECT=20=
max(a.history_id)=20FROM=20host_interface_configuration=20as=20a=20GROUP=20=
BY=20a.host_interface_id)=0A=20=20=20=20=20=20and=20delete_date=20IS=20=
NULL;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_hosts_interfaces_resources_usage_samples=0A=20AS=0A=
SELECT=0A=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=
=20history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
host_interface_id=20as=20host_interface_id,=0A=20=20=20=20=20=20=
receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=20=20=
transmit_rate_percent=20as=20transmit_rate_percent,=0A=20=20=20=20=20=20=
received_total_byte=20as=20received_total_byte,=0A=20=20=20=20=20=20=
transmitted_total_byte=20as=20transmitted_total_byte,=0A=20=20=20=20=20=20=
host_interface_configuration_version=20as=20=
host_interface_configuration_version=0AFROM=20=
host_interface_samples_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_hosts_interfaces_resources_usage_hourly=0A=20AS=0ASELECT=0A=
=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
host_interface_id=20as=20host_interface_id,=0A=20=20=20=20=20=20=
receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=20=20=
max_receive_rate_percent=20as=20max_receive_rate_percent,=0A=20=20=20=20=20=
=20transmit_rate_percent=20as=20transmit_rate_percent,=0A=20=20=20=20=20=20=
max_transmit_rate_percent=20as=20max_transmit_rate_percent,=0A=20=20=20=20=
=20=20received_total_byte=20as=20received_total_byte,=0A=20=20=20=20=20=20=
transmitted_total_byte=20as=20transmitted_total_byte,=0A=20=20=20=20=20=20=
host_interface_configuration_version=20as=20=
host_interface_configuration_version=0AFROM=20=
host_interface_hourly_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_hosts_interfaces_resources_usage_daily=0A=20AS=0ASELECT=0A=
=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
host_interface_id=20as=20host_interface_id,=0A=20=20=20=20=20=20=
receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=20=20=
max_receive_rate_percent=20as=20max_receive_rate_percent,=0A=20=20=20=20=20=
=20transmit_rate_percent=20as=20transmit_rate_percent,=0A=20=20=20=20=20=20=
max_transmit_rate_percent=20as=20max_transmit_rate_percent,=0A=20=20=20=20=
=20=20received_total_byte=20as=20received_total_byte,=0A=20=20=20=20=20=20=
transmitted_total_byte=20as=20transmitted_total_byte,=0A=20=20=20=20=20=20=
host_interface_configuration_version=20as=20=
host_interface_configuration_version=0AFROM=20=
host_interface_daily_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_configuration_history_vms=0A=20AS=0ASELECT=0A=20=20=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20=20=20vm_id=20as=20vm_id,=0A=20=
=20=20=20=20=20vm_name=20as=20vm_name,=0A=20=20=20=20=20=20=
vm_description=20as=20vm_description,=0A=20=20=20=20=20=20vm_type=20as=20=
vm_type,=0A=20=20=20=20=20=20cluster_id=20as=20cluster_id,=0A=20=20=20=20=
=20=20template_id=20as=20template_id,=0A=20=20=20=20=20=20template_name=20=
as=20template_name,=0A=20=20=20=20=20=20cpu_per_socket=20as=20=
cpu_per_socket,=0A=20=20=20=20=20=20number_of_sockets=20as=20=
number_of_sockets,=0A=20=20=20=20=20=20memory_size_mb=20as=20=
memory_size_mb,=0A=20=20=20=20=20=20operating_system=20as=20=
operating_system,=0A=20=20=20=20=20=20default_host=20as=20default_host,=0A=
=20=20=20=20=20=20high_availability=20as=20high_availability,=0A=20=20=20=
=20=20=20initialized=20as=20initialized,=0A=20=20=20=20=20=20stateless=20=
as=20stateless,=0A=20=20=20=20=20=20fail_back=20as=20fail_back,=0A=20=20=20=
=20=20=20usb_policy=20as=20usb_policy,=0A=20=20=20=20=20=20time_zone=20=
as=20time_zone,=0A=20=20=20=20=20=20vm_pool_id,=0A=20=20=20=20=20=20=
vm_pool_name,=0A=20=20=20=20=20=20created_by_user_id,=0A=20=20=20=20=20=20=
cluster_configuration_version=20as=20cluster_configuration_version,=0A=20=
=20=20=20=20=20default_host_configuration_version=20as=20=
default_host_configuration_version,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date,=0A=20=20=
=20=20=20=20delete_date=20as=20delete_date=0AFROM=20vm_configuration;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_latest_configuration_vms=0A=20AS=0ASELECT=0A=20=20=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20=20=20vm_id=20as=20vm_id,=0A=20=
=20=20=20=20=20vm_name=20as=20vm_name,=0A=20=20=20=20=20=20=
vm_description=20as=20vm_description,=0A=20=20=20=20=20=20vm_type=20as=20=
vm_type,=0A=20=20=20=20=20=20cluster_id=20as=20cluster_id,=0A=20=20=20=20=
=20=20template_id=20as=20template_id,=0A=20=20=20=20=20=20template_name=20=
as=20template_name,=0A=20=20=20=20=20=20cpu_per_socket=20as=20=
cpu_per_socket,=0A=20=20=20=20=20=20number_of_sockets=20as=20=
number_of_sockets,=0A=20=20=20=20=20=20memory_size_mb=20as=20=
memory_size_mb,=0A=20=20=20=20=20=20operating_system=20as=20=
operating_system,=0A=20=20=20=20=20=20default_host=20as=20default_host,=0A=
=20=20=20=20=20=20high_availability=20as=20high_availability,=0A=20=20=20=
=20=20=20initialized=20as=20initialized,=0A=20=20=20=20=20=20stateless=20=
as=20stateless,=0A=20=20=20=20=20=20fail_back=20as=20fail_back,=0A=20=20=20=
=20=20=20usb_policy=20as=20usb_policy,=0A=20=20=20=20=20=20time_zone=20=
as=20time_zone,=0A=20=20=20=20=20=20vm_pool_id,=0A=20=20=20=20=20=20=
vm_pool_name,=0A=20=20=20=20=20=20created_by_user_id,=0A=20=20=20=20=20=20=
cluster_configuration_version=20as=20cluster_configuration_version,=0A=20=
=20=20=20=20=20default_host_configuration_version=20as=20=
default_host_configuration_version,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date=0AFROM=20=
vm_configuration=0AWHERE=20history_id=20in=20(SELECT=20max(a.history_id)=20=
FROM=20vm_configuration=20as=20a=20GROUP=20BY=20a.vm_id)=0A=20=20=20=20=20=
=20and=20delete_date=20IS=20NULL;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20v3_6_statistics_vms_resources_usage_samples=0A=20AS=0ASELECT=0A=20=
=20=20=20a.history_id=20as=20history_id,=0A=20=20=20=20=
a.history_datetime=20as=20history_datetime,=0A=20=20=20=20a.vm_id=20as=20=
vm_id,=0A=20=20=20=20a.vm_status=20as=20vm_status,=0A=20=20=20=20=
cast(a.seconds_in_status=20as=20numeric(7,2))=20/=2060=20as=20=
minutes_in_status,=0A=20=20=20=20a.cpu_usage_percent=20as=20=
cpu_usage_percent,=0A=20=20=20=20a.memory_usage_percent=20as=20=
memory_usage_percent,=0A=20=20=20=20a.user_cpu_usage_percent=20as=20=
user_cpu_usage_percent,=0A=20=20=20=20a.system_cpu_usage_percent=20as=20=
system_cpu_usage_percent,=0A=20=20=20=20a.vm_ip=20as=20vm_ip,=0A=20=20=20=
=20a.vm_client_ip,=0A=20=20=20=20a.currently_running_on_host=20as=20=
currently_running_on_host,=0A=20=20=20=20a.current_user_id=20as=20=
current_user_id,=0A=20=20=20=20a.user_logged_in_to_guest,=0A=20=20=20=20=
b.disks_usage=20as=20disks_usage,=0A=20=20=20=20=
a.vm_configuration_version=20as=20vm_configuration_version,=0A=20=20=20=20=
a.current_host_configuration_version=20as=20=
current_host_configuration_version,=0A=20=20=20=20a.memory_buffered_kb=20=
as=20memory_buffered_kb,=0A=20=20=20=20a.memory_cached_kb=20as=20=
memory_cached_kb=0AFROM=20=20=20=20=20vm_samples_history=20as=20a=0A=20=20=
=20=20=20=20=20=20LEFT=20OUTER=20JOIN=20vm_disks_usage_samples_history=20=
as=20b=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20(a.history_datetime=20=
=3D=20b.history_datetime=20AND=20a.vm_id=20=3D=20b.vm_id);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_vms_resources_usage_hourly=0A=20AS=0ASELECT=0A=20=20=20=20=
a.history_id=20as=20history_id,=0A=20=20=20=20a.history_datetime=20as=20=
history_datetime,=0A=20=20=20=20a.vm_id=20as=20vm_id,=0A=20=20=20=20=
a.vm_status=20as=20vm_status,=0A=20=20=20=20a.minutes_in_status=20as=20=
minutes_in_status,=0A=20=20=20=20a.cpu_usage_percent=20as=20=
cpu_usage_percent,=0A=20=20=20=20a.max_cpu_usage=20as=20max_cpu_usage,=0A=
=20=20=20=20a.memory_usage_percent=20as=20memory_usage_percent,=0A=20=20=20=
=20a.max_memory_usage=20as=20max_memory_usage,=0A=20=20=20=20=
a.user_cpu_usage_percent=20as=20user_cpu_usage_percent,=0A=20=20=20=20=
a.max_user_cpu_usage_percent=20as=20max_user_cpu_usage_percent,=0A=20=20=20=
=20a.system_cpu_usage_percent=20as=20system_cpu_usage_percent,=0A=20=20=20=
=20a.max_system_cpu_usage_percent=20as=20max_system_cpu_usage_percent,=0A=
=20=20=20=20a.vm_ip=20as=20vm_ip,=0A=20=20=20=20=
a.currently_running_on_host=20as=20currently_running_on_host,=0A=20=20=20=
=20a.current_user_id=20as=20current_user_id,=0A=20=20=20=20b.disks_usage=20=
as=20disks_usage,=0A=20=20=20=20a.vm_configuration_version=20as=20=
vm_configuration_version,=0A=20=20=20=20=
a.current_host_configuration_version=20as=20=
current_host_configuration_version,=0A=20=20=20=20a.memory_buffered_kb=20=
as=20memory_buffered_kb,=0A=20=20=20=20a.memory_cached_kb=20as=20=
memory_cached_kb,=0A=20=20=20=20a.max_memory_buffered_kb=20as=20=
max_memory_buffered_kb,=0A=20=20=20=20a.max_memory_cached_kb=20as=20=
max_memory_cached_kb=0AFROM=20=20=20=20=20vm_hourly_history=20as=20a=0A=20=
=20=20=20=20=20=20=20LEFT=20OUTER=20JOIN=20vm_disks_usage_hourly_history=20=
as=20b=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20(a.history_datetime=20=
=3D=20b.history_datetime=20AND=20a.vm_id=20=3D=20b.vm_id);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_vms_resources_usage_daily=0A=20AS=0ASELECT=0A=20=20=20=20=
a.history_id=20as=20history_id,=0A=20=20=20=20a.history_datetime=20as=20=
history_datetime,=0A=20=20=20=20a.vm_id=20as=20vm_id,=0A=20=20=20=20=
a.vm_status=20as=20vm_status,=0A=20=20=20=20a.minutes_in_status=20as=20=
minutes_in_status,=0A=20=20=20=20a.cpu_usage_percent=20as=20=
cpu_usage_percent,=0A=20=20=20=20a.max_cpu_usage=20as=20max_cpu_usage,=0A=
=20=20=20=20a.memory_usage_percent=20as=20memory_usage_percent,=0A=20=20=20=
=20a.max_memory_usage=20as=20max_memory_usage,=0A=20=20=20=20=
a.user_cpu_usage_percent=20as=20user_cpu_usage_percent,=0A=20=20=20=20=
a.max_user_cpu_usage_percent=20as=20max_user_cpu_usage_percent,=0A=20=20=20=
=20a.system_cpu_usage_percent=20as=20system_cpu_usage_percent,=0A=20=20=20=
=20a.max_system_cpu_usage_percent=20as=20max_system_cpu_usage_percent,=0A=
=20=20=20=20a.vm_ip=20as=20vm_ip,=0A=20=20=20=20=
a.currently_running_on_host=20as=20currently_running_on_host,=0A=20=20=20=
=20a.current_user_id=20as=20current_user_id,=0A=20=20=20=20b.disks_usage=20=
as=20disks_usage,=0A=20=20=20=20a.vm_configuration_version=20as=20=
vm_configuration_version,=0A=20=20=20=20=
a.current_host_configuration_version=20as=20=
current_host_configuration_version,=0A=20=20=20=20a.memory_buffered_kb=20=
as=20memory_buffered_kb,=0A=20=20=20=20a.memory_cached_kb=20as=20=
memory_cached_kb,=0A=20=20=20=20a.max_memory_buffered_kb=20as=20=
max_memory_buffered_kb,=0A=20=20=20=20a.max_memory_cached_kb=20as=20=
max_memory_cached_kb=0AFROM=20=20=20=20=20vm_daily_history=20as=20a=0A=20=
=20=20=20=20=20=20=20LEFT=20OUTER=20JOIN=20vm_disks_usage_daily_history=20=
as=20b=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20(a.history_datetime=20=
=3D=20b.history_datetime=20AND=20a.vm_id=20=3D=20b.vm_id);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_vms_users_usage_hourly=0A=20AS=0ASELECT=20history_id,=0A=20=
=20=20=20=20=20=20history_datetime,=0A=20=20=20=20=20=20=20user_id,=0A=20=
=20=20=20=20=20=20vm_id,=0A=20=20=20=20=20=20=20session_time_in_minutes,=0A=
=20=20=20=20=20=20=20cpu_usage_percent,=0A=20=20=20=20=20=20=20=
max_cpu_usage,=0A=20=20=20=20=20=20=20memory_usage_percent,=0A=20=20=20=20=
=20=20=20max_memory_usage,=0A=20=20=20=20=20=20=20=
user_cpu_usage_percent,=0A=20=20=20=20=20=20=20=
max_user_cpu_usage_percent,=0A=20=20=20=20=20=20=20=
system_cpu_usage_percent,=0A=20=20=20=20=20=20=20=
max_system_cpu_usage_percent,=0A=20=20=20=20=20=20=20vm_ip,=0A=20=20=20=20=
=20=20=20vm_client_ip,=0A=20=20=20=20=20=20=20user_logged_in_to_guest,=0A=
=20=20=20=20=20=20=20currently_running_on_host,=0A=20=20=20=20=20=20=20=
vm_configuration_version,=0A=20=20=20=20=20=20=20=
current_host_configuration_version=0AFROM=20=
statistics_vms_users_usage_hourly;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20v3_6_statistics_vms_users_usage_daily=0A=20AS=0ASELECT=20=
history_id,=0A=20=20=20=20=20=20=20history_datetime,=0A=20=20=20=20=20=20=
=20user_id,=0A=20=20=20=20=20=20=20vm_id,=0A=20=20=20=20=20=20=20=
session_time_in_minutes,=0A=20=20=20=20=20=20=20cpu_usage_percent,=0A=20=20=
=20=20=20=20=20max_cpu_usage,=0A=20=20=20=20=20=20=20=
memory_usage_percent,=0A=20=20=20=20=20=20=20max_memory_usage,=0A=20=20=20=
=20=20=20=20user_cpu_usage_percent,=0A=20=20=20=20=20=20=20=
max_user_cpu_usage_percent,=0A=20=20=20=20=20=20=20=
system_cpu_usage_percent,=0A=20=20=20=20=20=20=20=
max_system_cpu_usage_percent,=0A=20=20=20=20=20=20=20vm_ip,=0A=20=20=20=20=
=20=20=20vm_client_ip,=0A=20=20=20=20=20=20=20user_logged_in_to_guest,=0A=
=20=20=20=20=20=20=20currently_running_on_host,=0A=20=20=20=20=20=20=20=
vm_configuration_version,=0A=20=20=20=20=20=20=20=
current_host_configuration_version=0AFROM=20=
statistics_vms_users_usage_daily;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20v3_6_configuration_history_vms_interfaces=0A=20AS=0ASELECT=0A=20=20=
=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
vm_interface_id=20as=20vm_interface_id,=0A=20=20=20=20=20=20=
vm_interface_name=20as=20vm_interface_name,=0A=20=20=20=20=20=20=
vm_interface_type=20as=20vm_interface_type,=0A=20=20=20=20=20=20=
vm_interface_speed_bps=20as=20vm_interface_speed_bps,=0A=20=20=20=20=20=20=
mac_address=20as=20mac_address,=0A=20=20=20=20=20=20=
logical_network_name,=0A=20=20=20=20=20=20vm_configuration_version=20as=20=
vm_configuration_version,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date,=0A=20=20=
=20=20=20=20delete_date=20as=20delete_date=0AFROM=20=
vm_interface_configuration;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_latest_configuration_vms_interfaces=0A=20AS=0ASELECT=0A=20=20=20=20=20=
=20history_id=20as=20history_id,=0A=20=20=20=20=20=20vm_interface_id=20=
as=20vm_interface_id,=0A=20=20=20=20=20=20vm_interface_name=20as=20=
vm_interface_name,=0A=20=20=20=20=20=20vm_interface_type=20as=20=
vm_interface_type,=0A=20=20=20=20=20=20vm_interface_speed_bps=20as=20=
vm_interface_speed_bps,=0A=20=20=20=20=20=20mac_address=20as=20=
mac_address,=0A=20=20=20=20=20=20logical_network_name,=0A=20=20=20=20=20=20=
vm_configuration_version=20as=20vm_configuration_version,=0A=20=20=20=20=20=
=20create_date=20as=20create_date,=0A=20=20=20=20=20=20update_date=20as=20=
update_date=0AFROM=20vm_interface_configuration=0AWHERE=20history_id=20=
in=20(SELECT=20max(a.history_id)=20FROM=20vm_interface_configuration=20=
as=20a=20GROUP=20BY=20a.vm_interface_id)=0A=20=20=20=20=20=20and=20=
delete_date=20IS=20NULL;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_vms_interfaces_resources_usage_samples=0A=20AS=0ASELECT=0A=
=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
vm_interface_id=20as=20vm_interface_id,=0A=20=20=20=20=20=20=
receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=20=20=
transmit_rate_percent=20as=20transmit_rate_percent,=0A=20=20=20=20=20=20=
received_total_byte=20as=20received_total_byte,=0A=20=20=20=20=20=20=
transmitted_total_byte=20as=20transmitted_total_byte,=0A=20=20=20=20=20=20=
vm_interface_configuration_version=20as=20=
vm_interface_configuration_version=0AFROM=20=
vm_interface_samples_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_vms_interfaces_resources_usage_hourly=0A=20AS=0ASELECT=0A=
=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
vm_interface_id=20as=20vm_interface_id,=0A=20=20=20=20=20=20=
receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=20=20=
max_receive_rate_percent=20as=20max_receive_rate_percent,=0A=20=20=20=20=20=
=20transmit_rate_percent=20as=20transmit_rate_percent,=0A=20=20=20=20=20=20=
max_transmit_rate_percent=20as=20max_transmit_rate_percent,=0A=20=20=20=20=
=20=20received_total_byte=20as=20received_total_byte,=0A=20=20=20=20=20=20=
transmitted_total_byte=20as=20transmitted_total_byte,=0A=20=20=20=20=20=20=
vm_interface_configuration_version=20as=20=
vm_interface_configuration_version=0AFROM=20vm_interface_hourly_history;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_vms_interfaces_resources_usage_daily=0A=20AS=0ASELECT=0A=20=
=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
vm_interface_id=20as=20vm_interface_id,=0A=20=20=20=20=20=20=
receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=20=20=
max_receive_rate_percent=20as=20max_receive_rate_percent,=0A=20=20=20=20=20=
=20transmit_rate_percent=20as=20transmit_rate_percent,=0A=20=20=20=20=20=20=
max_transmit_rate_percent=20as=20max_transmit_rate_percent,=0A=20=20=20=20=
=20=20received_total_byte=20as=20received_total_byte,=0A=20=20=20=20=20=20=
transmitted_total_byte=20as=20transmitted_total_byte,=0A=20=20=20=20=20=20=
vm_interface_configuration_version=20as=20=
vm_interface_configuration_version=0AFROM=20vm_interface_daily_history;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_configuration_history_vms_disks=0A=20AS=0ASELECT=0A=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20vm_disk_id=20as=20=
vm_disk_id,=0A=20=20=20=20CASE=0A=20=20=20=20=20=20=20=20=20=20WHEN=20=
vm_disk_name=20IS=20NOT=20NULL=20THEN=20vm_disk_name=0A=20=20=20=20=20=20=
=20=20=20=20ELSE=20'disk=20'=20||=20cast(vm_internal_drive_mapping=20as=20=
varchar)=0A=20=20=20=20END=20as=20vm_disk_name,=0A=20=20=20=20=
vm_disk_description=20as=20vm_disk_description,=0A=20=20=20=20image_id=20=
as=20image_id,=0A=20=20=20=20storage_domain_id=20as=20storage_domain_id,=0A=
=20=20=20=20vm_disk_size_mb=20as=20vm_disk_size_mb,=0A=20=20=20=20=
vm_disk_type=20as=20vm_disk_type,=0A=20=20=20=20vm_disk_format=20as=20=
vm_disk_format,=0A=20=20=20=20cast(NULL=20as=20smallint)=20as=20=
vm_disk_interface,=0A=20=20=20=20is_shared=20as=20is_shared,=0A=20=20=20=20=
create_date=20as=20create_date,=0A=20=20=20=20update_date=20as=20=
update_date,=0A=20=20=20=20delete_date=20as=20delete_date=0AFROM=20=
vm_disk_configuration;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_latest_configuration_vms_disks=0A=20AS=0ASELECT=0A=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20vm_disk_id=20as=20=
vm_disk_id,=0A=20=20=20=20CASE=0A=20=20=20=20=20=20=20=20=20=20WHEN=20=
vm_disk_name=20IS=20NOT=20NULL=20THEN=20vm_disk_name=0A=20=20=20=20=20=20=
=20=20=20=20ELSE=20'disk=20'=20||=20cast(vm_internal_drive_mapping=20as=20=
varchar)=0A=20=20=20=20END=20as=20vm_disk_name,=0A=20=20=20=20=
vm_disk_description=20as=20vm_disk_description,=0A=20=20=20=20image_id=20=
as=20image_id,=0A=20=20=20=20storage_domain_id=20as=20storage_domain_id,=0A=
=20=20=20=20vm_disk_size_mb=20as=20vm_disk_size_mb,=0A=20=20=20=20=
vm_disk_type=20as=20vm_disk_type,=0A=20=20=20=20vm_disk_format=20as=20=
vm_disk_format,=0A=20=20=20=20cast(NULL=20as=20smallint)=20as=20=
vm_disk_interface,=0A=20=20=20=20is_shared=20as=20is_shared,=0A=20=20=20=20=
create_date=20as=20create_date,=0A=20=20=20=20update_date=20as=20=
update_date=0AFROM=20vm_disk_configuration=0AWHERE=20history_id=20in=20=
(SELECT=20max(a.history_id)=20FROM=20vm_disk_configuration=20as=20a=20=
GROUP=20BY=20a.vm_disk_id)=0A=20=20=20=20=20=20and=20delete_date=20IS=20=
NULL;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20disks_vm_map=0AAS=0A=
SELECT=20history_id,=0A=20=20=20=20device_id=20AS=20vm_disk_id,=0A=20=20=20=
=20vm_id,=0A=20=20=20=20create_date=20AS=20attach_date,=0A=20=20=20=20=
delete_date=20AS=20detach_date=0AFROM=20vm_device_history=0AWHERE=20type=20=
=3D=20'disk';=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_vms_disks_resources_usage_samples=0A=20AS=0ASELECT=0A=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20history_datetime=20as=20=
history_datetime,=0A=20=20=20=20vm_disk_id=20as=20vm_disk_id,=0A=20=20=20=
=20vm_disk_status=20as=20vm_disk_status,=0A=20=20=20=20=
cast(seconds_in_status=20as=20numeric(7,2))=20/=2060=20as=20=
minutes_in_status,=0A=20=20=20=20vm_disk_actual_size_mb=20as=20=
vm_disk_actual_size_mb,=0A=20=20=20=20read_rate_bytes_per_second=20as=20=
read_rate_bytes_per_second,=0A=20=20=20=20read_latency_seconds=20as=20=
read_latency_seconds,=0A=20=20=20=20write_rate_bytes_per_second=20as=20=
write_rate_bytes_per_second,=0A=20=20=20=20write_latency_seconds=20as=20=
write_latency_seconds,=0A=20=20=20=20flush_latency_seconds=20as=20=
flush_latency_seconds,=0A=20=20=20=20vm_disk_configuration_version=20as=20=
vm_disk_configuration_version=0AFROM=20vm_disk_samples_history;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_vms_disks_resources_usage_hourly=0A=20AS=0ASELECT=0A=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20history_datetime=20as=20=
history_datetime,=0A=20=20=20=20vm_disk_id=20as=20vm_disk_id,=0A=20=20=20=
=20vm_disk_status=20as=20vm_disk_status,=0A=20=20=20=20minutes_in_status=20=
as=20minutes_in_status,=0A=20=20=20=20vm_disk_actual_size_mb=20as=20=
vm_disk_actual_size_mb,=0A=20=20=20=20read_rate_bytes_per_second=20as=20=
read_rate_bytes_per_second,=0A=20=20=20=20max_read_rate_bytes_per_second=20=
as=20max_read_rate_bytes_per_second,=0A=20=20=20=20read_latency_seconds=20=
as=20read_latency_seconds,=0A=20=20=20=20max_read_latency_seconds=20as=20=
max_read_latency_seconds,=0A=20=20=20=20write_rate_bytes_per_second=20as=20=
write_rate_bytes_per_second,=0A=20=20=20=20=
max_write_rate_bytes_per_second=20as=20max_write_rate_bytes_per_second,=0A=
=20=20=20=20write_latency_seconds=20as=20write_latency_seconds,=0A=20=20=20=
=20max_write_latency_seconds=20as=20max_write_latency_seconds,=0A=20=20=20=
=20flush_latency_seconds=20as=20flush_latency_seconds,=0A=20=20=20=20=
max_flush_latency_seconds=20as=20max_flush_latency_seconds,=0A=20=20=20=20=
vm_disk_configuration_version=20as=20vm_disk_configuration_version=0A=
FROM=20vm_disk_hourly_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_statistics_vms_disks_resources_usage_daily=0A=20AS=0ASELECT=0A=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20history_datetime=20as=20=
history_datetime,=0A=20=20=20=20vm_disk_id=20as=20vm_disk_id,=0A=20=20=20=
=20vm_disk_status=20as=20vm_disk_status,=0A=20=20=20=20minutes_in_status=20=
as=20minutes_in_status,=0A=20=20=20=20vm_disk_actual_size_mb=20as=20=
vm_disk_actual_size_mb,=0A=20=20=20=20read_rate_bytes_per_second=20as=20=
read_rate_bytes_per_second,=0A=20=20=20=20max_read_rate_bytes_per_second=20=
as=20max_read_rate_bytes_per_second,=0A=20=20=20=20read_latency_seconds=20=
as=20read_latency_seconds,=0A=20=20=20=20max_read_latency_seconds=20as=20=
max_read_latency_seconds,=0A=20=20=20=20write_rate_bytes_per_second=20as=20=
write_rate_bytes_per_second,=0A=20=20=20=20=
max_write_rate_bytes_per_second=20as=20max_write_rate_bytes_per_second,=0A=
=20=20=20=20write_latency_seconds=20as=20write_latency_seconds,=0A=20=20=20=
=20max_write_latency_seconds=20as=20max_write_latency_seconds,=0A=20=20=20=
=20flush_latency_seconds=20as=20flush_latency_seconds,=0A=20=20=20=20=
max_flush_latency_seconds=20as=20max_flush_latency_seconds,=0A=20=20=20=20=
vm_disk_configuration_version=20as=20vm_disk_configuration_version=0A=
FROM=20vm_disk_daily_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_configuration_history_vms_devices=0A=20AS=0ASELECT=0A=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20vm_id,=0A=20=20=20=20=
device_id,=0A=20=20=20=20type,=0A=20=20=20=20address,=0A=20=20=20=20=
is_managed,=0A=20=20=20=20is_plugged,=0A=20=20=20=20is_readonly,=0A=20=20=
=20=20vm_configuration_version,=0A=20=20=20=20=
device_configuration_version,=0A=20=20=20=20create_date,=0A=20=20=20=20=
update_date,=0A=20=20=20=20delete_date=0AFROM=20vm_device_history;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_latest_configuration_vms_devices=0A=20AS=0ASELECT=0A=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20vm_id,=0A=20=20=20=20=
device_id,=0A=20=20=20=20type,=0A=20=20=20=20address,=0A=20=20=20=20=
is_managed,=0A=20=20=20=20is_plugged,=0A=20=20=20=20is_readonly,=0A=20=20=
=20=20vm_configuration_version,=0A=20=20=20=20=
device_configuration_version,=0A=20=20=20=20create_date,=0A=20=20=20=20=
update_date=0AFROM=20vm_device_history=0AWHERE=20history_id=20in=20=
(SELECT=20max(a.history_id)=20FROM=20vm_device_history=20as=20a=20GROUP=20=
BY=20a.vm_id,=20a.device_id)=0A=20=20=20=20=20=20and=20delete_date=20IS=20=
NULL;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_users_details_history=0A=20AS=0ASELECT=0A=20=20=20=20=20=20user_id,=0A=
=20=20=20=20=20=20first_name,=0A=20=20=20=20=20=20last_name,=0A=20=20=20=20=
=20=20domain,=0A=20=20=20=20=20=20username,=0A=20=20=20=20=20=20=
department,=0A=20=20=20=20=20=20user_role_title,=0A=20=20=20=20=20=20=
email,=0A=20=20=20=20=20=20external_id,=0A=20=20=20=20=20=20active,=0A=20=
=20=20=20=20=20create_date,=0A=20=20=20=20=20=20update_date,=0A=20=20=20=20=
=20=20delete_date=0AFROM=20users_details_history;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20v3_6_latest_users_details=0A=20=
AS=0ASELECT=0A=20=20=20=20=20=20user_id,=0A=20=20=20=20=20=20first_name,=0A=
=20=20=20=20=20=20last_name,=0A=20=20=20=20=20=20domain,=0A=20=20=20=20=20=
=20username,=0A=20=20=20=20=20=20department,=0A=20=20=20=20=20=20=
user_role_title,=0A=20=20=20=20=20=20email,=0A=20=20=20=20=20=20=
external_id,=0A=20=20=20=20=20=20active,=0A=20=20=20=20=20=20=
create_date,=0A=20=20=20=20=20=20update_date,=0A=20=20=20=20=20=20=
delete_date=0AFROM=20users_details_history=0AWHERE=20delete_date=20IS=20=
NULL;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_tags_relations_history=0A=20AS=0ASELECT=20=20=20=20history_id=20as=20=
history_id,=0A=20=20=20=20=20=20=20=20entity_id=20as=20entity_id,=0A=20=20=
=20=20=20=20=20=20entity_type=20as=20entity_type,=0A=20=20=20=20=20=20=20=
=20parent_id=20as=20parent_id,=0A=20=20=20=20=20=20=20=20attach_date=20=
as=20attach_date,=0A=20=20=20=20=20=20=20=20detach_date=20as=20=
detach_date=0AFROM=20=20=20=20=20=20=20=20=20tag_relations_history=0A=
WHERE=20=20=20=20=20=20=20entity_type=20in(3,2,5,18,15);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20v3_6_latest_tags_relations=0A=
=20AS=0ASELECT=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=
=20=20=20entity_id=20as=20entity_id,=0A=20=20=20=20=20=20=20=20=
entity_type=20as=20entity_type,=0A=20=20=20=20=20=20=20=20parent_id=20as=20=
parent_id,=0A=20=20=20=20=20=20=20=20attach_date=20as=20attach_date,=0A=20=
=20=20=20=20=20=20=20detach_date=20as=20detach_date=0AFROM=20=20=20=20=20=
=20=20=20=20tag_relations_history=0AWHERE=20=20=20=20=20=20=20=
entity_type=20in(3,2,5,18,15)=0A=20=20=20=20=20=20=20and=20history_id=20=
in=20(SELECT=20max(a.history_id)=20FROM=20tag_relations_history=20as=20a=20=
GROUP=20BY=20a.entity_id,=20a.parent_id)=0A=20=20=20=20=20=20=20and=20=
detach_date=20IS=20NULL;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_tags_details_history=0A=20AS=0ASELECT=20=20history_id=20as=20=
history_id,=0A=20=20=20=20=20=20=20=20tag_id=20as=20tag_id,=0A=20=20=20=20=
=20=20=20=20tag_name=20as=20tag_name,=0A=20=20=20=20=20=20=20=20=
tag_description=20as=20tag_description,=0A=20=20=20=20=20=20=20=20=
tag_path=20as=20tag_path,=0A=20=20=20=20=20=20=20=20tag_level=20as=20=
tag_level,=0A=20=20=20=20=20=20=20=20create_date=20as=20create_date,=0A=20=
=20=20=20=20=20=20=20update_date=20as=20update_date,=0A=20=20=20=20=20=20=
=20=20delete_date=20as=20delete_date=0AFROM=20=20=20=20=20=20=20=20=20=
tag_details;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v3_6_latest_tags_details=0A=20AS=0ASELECT=20=20history_id=20as=20=
history_id,=0A=20=20=20=20=20=20=20=20tag_id=20as=20tag_id,=0A=20=20=20=20=
=20=20=20=20tag_name=20as=20tag_name,=0A=20=20=20=20=20=20=20=20=
tag_description=20as=20tag_description,=0A=20=20=20=20=20=20=20=20=
tag_path=20as=20tag_path,=0A=20=20=20=20=20=20=20=20tag_level=20as=20=
tag_level,=0A=20=20=20=20=20=20=20=20create_date=20as=20create_date,=0A=20=
=20=20=20=20=20=20=20update_date=20as=20update_date,=0A=20=20=20=20=20=20=
=20=20delete_date=20as=20delete_date=0AFROM=20=20=20=20=20=20=20=20=20=
tag_details=0AWHERE=20history_id=20in=20(SELECT=20max(a.history_id)=20=
FROM=20tag_details=20as=20a=20GROUP=20BY=20a.tag_id)=0A=20=20=20=20=20=20=
and=20delete_date=20IS=20NULL;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0A=
/**************************************=0A=20=20=20=20=20=20=20=20=20=20=20=
VERSIONED=20VIEWS=20(4.0)=0A**************************************/=0A=
CREATE=20OR=20REPLACE=20VIEW=20v4_0_enum_translator=0A=20AS=0ASELECT=0A=20=
=20=20=20enum_translator.enum_type=20as=20enum_type,=0A=20=20=20=20=
enum_translator.enum_key=20as=20enum_key,=0A=20=20=20=20=
enum_translator.value=20as=20value=0AFROM=20enum_translator=20INNER=20=
JOIN=0A=20=20=20=20=20=20=20=20=20=20=20=20history_configuration=20ON=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
(enum_translator.language_code=20=3D=20history_configuration.var_value=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20and=20=
history_configuration.var_name=20=3D=20'default_language');=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_configuration_history_datacenters=0A=20AS=0ASELECT=0A=20=20=20=20=20=
=20history_id=20as=20history_id,=0A=20=20=20=20=20=20datacenter_id=20as=20=
datacenter_id,=0A=20=20=20=20=20=20datacenter_name=20as=20=
datacenter_name,=0A=20=20=20=20=20=20datacenter_description=20as=20=
datacenter_description,=0A=20=20=20=20=20=20is_local_storage=20as=20=
is_local_storage,=0A=20=20=20=20=20=20create_date=20as=20create_date,=0A=20=
=20=20=20=20=20update_date=20as=20update_date,=0A=20=20=20=20=20=20=
delete_date=20as=20delete_date=0AFROM=20datacenter_configuration;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_latest_configuration_datacenters=0A=20AS=0ASELECT=0A=20=20=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20=20=20datacenter_id=20as=20=
datacenter_id,=0A=20=20=20=20=20=20datacenter_name=20as=20=
datacenter_name,=0A=20=20=20=20=20=20datacenter_description=20as=20=
datacenter_description,=0A=20=20=20=20=20=20is_local_storage=20as=20=
is_local_storage,=0A=20=20=20=20=20=20create_date=20as=20create_date,=0A=20=
=20=20=20=20=20update_date=20as=20update_date=0AFROM=20=
datacenter_configuration=0AWHERE=20history_id=20in=20(SELECT=20=
max(a.history_id)=20FROM=20datacenter_configuration=20as=20a=20GROUP=20=
BY=20a.datacenter_id)=0A=20=20=20=20=20=20and=20delete_date=20IS=20NULL;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_map_history_datacenters_storage_domains=0A=20AS=0ASELECT=0A=20=20=20=
=20history_id=20as=20history_id,=0A=20=20=20=20storage_domain_id=20as=20=
storage_domain_id,=0A=20=20=20=20datacenter_id=20as=20datacenter_id,=0A=20=
=20=20=20attach_date=20as=20attach_date,=0A=20=20=20=20detach_date=20as=20=
detach_date=0AFROM=20=20=20=20=20=20=20=20=20=
datacenter_storage_domain_map;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_latest_map_datacenters_storage_domains=0A=20AS=0ASELECT=0A=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20storage_domain_id=20as=20=
storage_domain_id,=0A=20=20=20=20datacenter_id=20as=20datacenter_id,=0A=20=
=20=20=20attach_date=20as=20attach_date=0AFROM=20=20=20=20=20=20=20=20=20=
datacenter_storage_domain_map=0AWHERE=20history_id=20in=20(SELECT=20=
max(a.history_id)=20FROM=20datacenter_storage_domain_map=20as=20a=20=
GROUP=20BY=20a.storage_domain_id,=20a.datacenter_id)=0A=20=20=20=20=20=20=
and=20detach_date=20IS=20NULL;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_configuration_history_storage_domains=0A=20AS=0ASELECT=0A=20=20=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
storage_domain_id=20as=20storage_domain_id,=0A=20=20=20=20=20=20=
storage_domain_name=20as=20storage_domain_name,=0A=20=20=20=20=20=20=
storage_domain_type=20as=20storage_domain_type,=0A=20=20=20=20=20=20=
storage_type=20as=20storage_type,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date,=0A=20=20=
=20=20=20=20delete_date=20as=20delete_date=0AFROM=20=
storage_domain_configuration;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_latest_configuration_storage_domains=0A=20AS=0ASELECT=0A=20=20=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
storage_domain_id=20as=20storage_domain_id,=0A=20=20=20=20=20=20=
storage_domain_name=20as=20storage_domain_name,=0A=20=20=20=20=20=20=
storage_domain_type=20as=20storage_domain_type,=0A=20=20=20=20=20=20=
storage_type=20as=20storage_type,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date=0AFROM=20=
storage_domain_configuration=0AWHERE=20history_id=20in=20(SELECT=20=
max(a.history_id)=20FROM=20storage_domain_configuration=20as=20a=20GROUP=20=
BY=20a.storage_domain_id)=0A=20=20=20=20=20=20and=20delete_date=20IS=20=
NULL;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_storage_domains_resources_usage_samples=0A=20AS=0ASELECT=0A=
=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
storage_domain_id=20as=20storage_domain_id,=0A=20=20=20=20=20=20=
storage_domain_status,=0A=20=20=20=20=20=20seconds_in_status=20as=20=
seconds_in_status,=0A=20=20=20=20=20=20cast(seconds_in_status=20as=20=
numeric(7,2))=20/=2060=20as=20minutes_in_status,=0A=20=20=20=20=20=20=
available_disk_size_gb=20as=20available_disk_size_gb,=0A=20=20=20=20=20=20=
used_disk_size_gb=20as=20used_disk_size_gb,=0A=20=20=20=20=20=20=
storage_configuration_version=20as=20storage_configuration_version=0A=
FROM=20storage_domain_samples_history;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20v4_0_statistics_storage_domains_resources_usage_hourly=0A=20AS=0A=
SELECT=0A=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=
=20history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
storage_domain_id=20as=20storage_domain_id,=0A=20=20=20=20=20=20=
storage_domain_status,=0A=20=20=20=20=20=20cast(minutes_in_status=20*=20=
60=20as=20integer)=20as=20seconds_in_status,=0A=20=20=20=20=20=20=
minutes_in_status,=0A=20=20=20=20=20=20available_disk_size_gb=20as=20=
available_disk_size_gb,=0A=20=20=20=20=20=20used_disk_size_gb=20as=20=
used_disk_size_gb,=0A=20=20=20=20=20=20storage_configuration_version=20=
as=20storage_configuration_version=0AFROM=20=
storage_domain_hourly_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_storage_domains_resources_usage_daily=0A=20AS=0ASELECT=0A=
=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
storage_domain_id=20as=20storage_domain_id,=0A=20=20=20=20=20=20=
storage_domain_status,=0A=20=20=20=20=20=20cast(minutes_in_status=20*=20=
60=20as=20integer)=20as=20seconds_in_status,=0A=20=20=20=20=20=20=
minutes_in_status,=0A=20=20=20=20=20=20available_disk_size_gb=20as=20=
available_disk_size_gb,=0A=20=20=20=20=20=20used_disk_size_gb=20as=20=
used_disk_size_gb,=0A=20=20=20=20=20=20storage_configuration_version=20=
as=20storage_configuration_version=0AFROM=20=
storage_domain_daily_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_configuration_history_clusters=0A=20AS=0ASELECT=0A=20=20=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20=20=20cluster_id=20as=20=
cluster_id,=0A=20=20=20=20=20=20cluster_name=20as=20cluster_name,=0A=20=20=
=20=20=20=20cluster_description=20as=20cluster_description,=0A=20=20=20=20=
=20=20datacenter_id=20as=20datacenter_id,=0A=20=20=20=20=20=20cpu_name=20=
as=20cpu_name,=0A=20=20=20=20=20=20compatibility_version=20as=20=
compatibility_version,=0A=20=20=20=20=20=20=
datacenter_configuration_version=20as=20=
datacenter_configuration_version,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date,=0A=20=20=
=20=20=20=20delete_date=20as=20delete_date=0AFROM=20=
cluster_configuration;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_latest_configuration_clusters=0A=20AS=0ASELECT=0A=20=20=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20=20=20cluster_id=20as=20=
cluster_id,=0A=20=20=20=20=20=20cluster_name=20as=20cluster_name,=0A=20=20=
=20=20=20=20cluster_description=20as=20cluster_description,=0A=20=20=20=20=
=20=20datacenter_id=20as=20datacenter_id,=0A=20=20=20=20=20=20cpu_name=20=
as=20cpu_name,=0A=20=20=20=20=20=20compatibility_version=20as=20=
compatibility_version,=0A=20=20=20=20=20=20=
datacenter_configuration_version=20as=20=
datacenter_configuration_version,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date=0AFROM=20=
cluster_configuration=0AWHERE=20history_id=20in=20(SELECT=20=
max(a.history_id)=20FROM=20cluster_configuration=20as=20a=20GROUP=20BY=20=
a.cluster_id)=0A=20=20=20=20=20=20and=20delete_date=20IS=20NULL;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_configuration_history_hosts=0A=20AS=0ASELECT=0A=20=20=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20=20=20host_id=20as=20=
host_id,=0A=20=20=20=20=20=20host_unique_id=20as=20host_unique_id,=0A=20=20=
=20=20=20=20host_name=20as=20host_name,=0A=20=20=20=20=20=20cluster_id=20=
as=20cluster_id,=0A=20=20=20=20=20=20host_type=20as=20host_type,=0A=20=20=
=20=20=20=20fqdn_or_ip=20as=20fqdn_or_ip,=0A=20=20=20=20=20=20=
memory_size_mb=20as=20memory_size_mb,=0A=20=20=20=20=20=20swap_size_mb=20=
as=20swap_size_mb,=0A=20=20=20=20=20=20cpu_model=20as=20cpu_model,=0A=20=20=
=20=20=20=20number_of_cores=20as=20number_of_cores,=0A=20=20=20=20=20=20=
number_of_sockets,=0A=20=20=20=20=20=20cpu_speed_mh,=0A=20=20=20=20=20=20=
host_os=20as=20host_os,=0A=20=20=20=20=20=20kernel_version=20as=20=
kernel_version,=0A=20=20=20=20=20=20kvm_version=20as=20kvm_version,=0A=20=
=20=20=20=20=20CASE=20SUBSTR(vdsm_version,1,3)=0A=20=20=20=20=20=20=20=20=
WHEN=20'4.4'=20THEN=20'2.1'=20||=20=
SUBSTR(vdsm_version,4,LENGTH(vdsm_version))=0A=20=20=20=20=20=20=20=20=
WHEN=20'4.5'=20THEN=20'2.2'=20||=20=
SUBSTR(vdsm_version,4,LENGTH(vdsm_version))=0A=20=20=20=20=20=20=20=20=
WHEN=20'4.9'=20THEN=20'2.3'=20||=20=
SUBSTR(vdsm_version,4,LENGTH(vdsm_version))=0A=20=20=20=20=20=20ELSE=20=
vdsm_version=0A=20=20=20=20=20=20END=20as=20vdsm_version,=0A=20=20=20=20=20=
=20vdsm_port=20as=20vdsm_port,=0A=20=20=20=20=20=20threads_per_core=20as=20=
threads_per_core,=0A=20=20=20=20=20=20hardware_manufacturer=20as=20=
hardware_manufacturer,=0A=20=20=20=20=20=20hardware_product_name=20as=20=
hardware_product_name,=0A=20=20=20=20=20=20hardware_version=20as=20=
hardware_version,=0A=20=20=20=20=20=20hardware_serial_number=20as=20=
hardware_serial_number,=0A=20=20=20=20=20=20=
cluster_configuration_version=20as=20cluster_configuration_version,=0A=20=
=20=20=20=20=20create_date=20as=20create_date,=0A=20=20=20=20=20=20=
update_date=20as=20update_date,=0A=20=20=20=20=20=20delete_date=20as=20=
delete_date=0AFROM=20host_configuration;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20v4_0_latest_configuration_hosts=0A=20AS=0ASELECT=0A=20=20=20=20=20=
=20history_id=20as=20history_id,=0A=20=20=20=20=20=20host_id=20as=20=
host_id,=0A=20=20=20=20=20=20host_unique_id=20as=20host_unique_id,=0A=20=20=
=20=20=20=20host_name=20as=20host_name,=0A=20=20=20=20=20=20cluster_id=20=
as=20cluster_id,=0A=20=20=20=20=20=20host_type=20as=20host_type,=0A=20=20=
=20=20=20=20fqdn_or_ip=20as=20fqdn_or_ip,=0A=20=20=20=20=20=20=
memory_size_mb=20as=20memory_size_mb,=0A=20=20=20=20=20=20swap_size_mb=20=
as=20swap_size_mb,=0A=20=20=20=20=20=20cpu_model=20as=20cpu_model,=0A=20=20=
=20=20=20=20number_of_cores=20as=20number_of_cores,=0A=20=20=20=20=20=20=
number_of_sockets,=0A=20=20=20=20=20=20cpu_speed_mh,=0A=20=20=20=20=20=20=
host_os=20as=20host_os,=0A=20=20=20=20=20=20kernel_version=20as=20=
kernel_version,=0A=20=20=20=20=20=20kvm_version=20as=20kvm_version,=0A=20=
=20=20=20=20=20CASE=20SUBSTR(vdsm_version,1,3)=0A=20=20=20=20=20=20=20=20=
WHEN=20'4.4'=20THEN=20'2.1'=20||=20=
SUBSTR(vdsm_version,4,LENGTH(vdsm_version))=0A=20=20=20=20=20=20=20=20=
WHEN=20'4.5'=20THEN=20'2.2'=20||=20=
SUBSTR(vdsm_version,4,LENGTH(vdsm_version))=0A=20=20=20=20=20=20=20=20=
WHEN=20'4.9'=20THEN=20'2.3'=20||=20=
SUBSTR(vdsm_version,4,LENGTH(vdsm_version))=0A=20=20=20=20=20=20ELSE=20=
vdsm_version=0A=20=20=20=20=20=20END=20as=20vdsm_version,=0A=20=20=20=20=20=
=20vdsm_port=20as=20vdsm_port,=0A=20=20=20=20=20=20threads_per_core=20as=20=
threads_per_core,=0A=20=20=20=20=20=20hardware_manufacturer=20as=20=
hardware_manufacturer,=0A=20=20=20=20=20=20hardware_product_name=20as=20=
hardware_product_name,=0A=20=20=20=20=20=20hardware_version=20as=20=
hardware_version,=0A=20=20=20=20=20=20hardware_serial_number=20as=20=
hardware_serial_number,=0A=20=20=20=20=20=20=
cluster_configuration_version=20as=20cluster_configuration_version,=0A=20=
=20=20=20=20=20create_date=20as=20create_date,=0A=20=20=20=20=20=20=
update_date=20as=20update_date=0AFROM=20host_configuration=0AWHERE=20=
history_id=20in=20(SELECT=20max(a.history_id)=20FROM=20=
host_configuration=20as=20a=20GROUP=20BY=20a.host_id)=0A=20=20=20=20=20=20=
and=20delete_date=20IS=20NULL;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_hosts_resources_usage_samples=0A=20AS=0ASELECT=0A=20=20=20=
=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20host_id=20=
as=20host_id,=0A=20=20=20=20=20=20host_status=20as=20host_status,=0A=20=20=
=20=20=20=20seconds_in_status=20as=20seconds_in_status,=0A=20=20=20=20=20=
=20cast(seconds_in_status=20as=20numeric(7,2))=20/=2060=20as=20=
minutes_in_status,=0A=20=20=20=20=20=20memory_usage_percent=20as=20=
memory_usage_percent,=0A=20=20=20=20=20=20ksm_shared_memory_mb,=0A=20=20=20=
=20=20=20cpu_usage_percent=20as=20cpu_usage_percent,=0A=20=20=20=20=20=20=
ksm_cpu_percent=20as=20ksm_cpu_percent,=0A=20=20=20=20=20=20active_vms=20=
as=20active_vms,=0A=20=20=20=20=20=20total_vms=20as=20total_vms,=0A=20=20=
=20=20=20=20total_vms_vcpus=20as=20total_vms_vcpus,=0A=20=20=20=20=20=20=
cpu_load=20as=20cpu_load,=0A=20=20=20=20=20=20system_cpu_usage_percent=20=
as=20system_cpu_usage_percent,=0A=20=20=20=20=20=20=
user_cpu_usage_percent=20as=20user_cpu_usage_percent,=0A=20=20=20=20=20=20=
swap_used_mb=20as=20swap_used_mb,=0A=20=20=20=20=20=20=
host_configuration_version=20as=20host_configuration_version=0AFROM=20=
host_samples_history;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_hosts_resources_usage_hourly=0A=20AS=0ASELECT=0A=20=20=20=
=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20host_id=20=
as=20host_id,=0A=20=20=20=20=20=20host_status=20as=20host_status,=0A=20=20=
=20=20=20=20cast(minutes_in_status=20*=2060=20as=20integer)=20as=20=
seconds_in_status,=0A=20=20=20=20=20=20minutes_in_status=20as=20=
minutes_in_status,=0A=20=20=20=20=20=20memory_usage_percent=20as=20=
memory_usage_percent,=0A=20=20=20=20=20=20max_memory_usage=20as=20=
max_memory_usage,=0A=20=20=20=20=20=20ksm_shared_memory_mb,=0A=20=20=20=20=
=20=20max_ksm_shared_memory_mb,=0A=20=20=20=20=20=20cpu_usage_percent=20=
as=20cpu_usage_percent,=0A=20=20=20=20=20=20max_cpu_usage=20as=20=
max_cpu_usage,=0A=20=20=20=20=20=20ksm_cpu_percent=20as=20=
ksm_cpu_percent,=0A=20=20=20=20=20=20max_ksm_cpu_percent=20as=20=
max_ksm_cpu_percent,=0A=20=20=20=20=20=20active_vms=20as=20active_vms,=0A=
=20=20=20=20=20=20max_active_vms=20as=20max_active_vms,=0A=20=20=20=20=20=
=20total_vms=20as=20total_vms,=0A=20=20=20=20=20=20max_total_vms=20as=20=
max_total_vms,=0A=20=20=20=20=20=20total_vms_vcpus=20as=20=
total_vms_vcpus,=0A=20=20=20=20=20=20max_total_vms_vcpus=20as=20=
max_total_vms_vcpus,=0A=20=20=20=20=20=20cpu_load=20as=20cpu_load,=0A=20=20=
=20=20=20=20max_cpu_load=20as=20max_cpu_load,=0A=20=20=20=20=20=20=
system_cpu_usage_percent=20as=20system_cpu_usage_percent,=0A=20=20=20=20=20=
=20max_system_cpu_usage_percent=20as=20max_system_cpu_usage_percent,=0A=20=
=20=20=20=20=20user_cpu_usage_percent=20as=20user_cpu_usage_percent,=0A=20=
=20=20=20=20=20max_user_cpu_usage_percent=20as=20=
max_user_cpu_usage_percent,=0A=20=20=20=20=20=20swap_used_mb=20as=20=
swap_used_mb,=0A=20=20=20=20=20=20max_swap_used_mb=20as=20=
max_swap_used_mb,=0A=20=20=20=20=20=20host_configuration_version=20as=20=
host_configuration_version=0AFROM=20host_hourly_history;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_hosts_resources_usage_daily=0A=20AS=0ASELECT=0A=20=20=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20history_datetime=20=
as=20history_datetime,=0A=20=20=20=20=20=20host_id=20as=20host_id,=0A=20=20=
=20=20=20=20host_status=20as=20host_status,=0A=20=20=20=20=20=20=
cast(minutes_in_status=20*=2060=20as=20integer)=20as=20=
seconds_in_status,=0A=20=20=20=20=20=20minutes_in_status=20as=20=
minutes_in_status,=0A=20=20=20=20=20=20memory_usage_percent=20as=20=
memory_usage_percent,=0A=20=20=20=20=20=20max_memory_usage=20as=20=
max_memory_usage,=0A=20=20=20=20=20=20ksm_shared_memory_mb,=0A=20=20=20=20=
=20=20max_ksm_shared_memory_mb,=0A=20=20=20=20=20=20cpu_usage_percent=20=
as=20cpu_usage_percent,=0A=20=20=20=20=20=20max_cpu_usage=20as=20=
max_cpu_usage,=0A=20=20=20=20=20=20ksm_cpu_percent=20as=20=
ksm_cpu_percent,=0A=20=20=20=20=20=20max_ksm_cpu_percent=20as=20=
max_ksm_cpu_percent,=0A=20=20=20=20=20=20active_vms=20as=20active_vms,=0A=
=20=20=20=20=20=20max_active_vms=20as=20max_active_vms,=0A=20=20=20=20=20=
=20total_vms=20as=20total_vms,=0A=20=20=20=20=20=20max_total_vms=20as=20=
max_total_vms,=0A=20=20=20=20=20=20total_vms_vcpus=20as=20=
total_vms_vcpus,=0A=20=20=20=20=20=20max_total_vms_vcpus=20as=20=
max_total_vms_vcpus,=0A=20=20=20=20=20=20cpu_load=20as=20cpu_load,=0A=20=20=
=20=20=20=20max_cpu_load=20as=20max_cpu_load,=0A=20=20=20=20=20=20=
system_cpu_usage_percent=20as=20system_cpu_usage_percent,=0A=20=20=20=20=20=
=20max_system_cpu_usage_percent=20as=20max_system_cpu_usage_percent,=0A=20=
=20=20=20=20=20user_cpu_usage_percent=20as=20user_cpu_usage_percent,=0A=20=
=20=20=20=20=20max_user_cpu_usage_percent=20as=20=
max_user_cpu_usage_percent,=0A=20=20=20=20=20=20swap_used_mb=20as=20=
swap_used_mb,=0A=20=20=20=20=20=20max_swap_used_mb=20as=20=
max_swap_used_mb,=0A=20=20=20=20=20=20host_configuration_version=20as=20=
host_configuration_version=0AFROM=20host_daily_history;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_configuration_history_hosts_interfaces=0A=20AS=0ASELECT=0A=20=20=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
host_interface_id=20as=20host_interface_id,=0A=20=20=20=20=20=20=
host_interface_name=20as=20host_interface_name,=0A=20=20=20=20=20=20=
host_id=20as=20host_id,=0A=20=20=20=20=20=20host_interface_type=20as=20=
host_interface_type,=0A=20=20=20=20=20=20host_interface_speed_bps=20as=20=
host_interface_speed_bps,=0A=20=20=20=20=20=20mac_address=20as=20=
mac_address,=0A=20=20=20=20=20=20logical_network_name,=0A=20=20=20=20=20=20=
ip_address=20as=20ip_address,=0A=20=20=20=20=20=20gateway=20as=20=
gateway,=0A=20=20=20=20=20=20bond=20as=20bond,=0A=20=20=20=20=20=20=
bond_name=20as=20bond_name,=0A=20=20=20=20=20=20vlan_id=20as=20vlan_id,=0A=
=20=20=20=20=20=20host_configuration_version=20as=20=
host_configuration_version,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date,=0A=20=20=
=20=20=20=20delete_date=20as=20delete_date=0AFROM=20=
host_interface_configuration;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_latest_configuration_hosts_interfaces=0A=20AS=0ASELECT=0A=20=20=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
host_interface_id=20as=20host_interface_id,=0A=20=20=20=20=20=20=
host_interface_name=20as=20host_interface_name,=0A=20=20=20=20=20=20=
host_id=20as=20host_id,=0A=20=20=20=20=20=20host_interface_type=20as=20=
host_interface_type,=0A=20=20=20=20=20=20host_interface_speed_bps=20as=20=
host_interface_speed_bps,=0A=20=20=20=20=20=20mac_address=20as=20=
mac_address,=0A=20=20=20=20=20=20logical_network_name,=0A=20=20=20=20=20=20=
ip_address=20as=20ip_address,=0A=20=20=20=20=20=20gateway=20as=20=
gateway,=0A=20=20=20=20=20=20bond=20as=20bond,=0A=20=20=20=20=20=20=
bond_name=20as=20bond_name,=0A=20=20=20=20=20=20vlan_id=20as=20vlan_id,=0A=
=20=20=20=20=20=20host_configuration_version=20as=20=
host_configuration_version,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date=0AFROM=20=
host_interface_configuration=0AWHERE=20history_id=20in=20(SELECT=20=
max(a.history_id)=20FROM=20host_interface_configuration=20as=20a=20GROUP=20=
BY=20a.host_interface_id)=0A=20=20=20=20=20=20and=20delete_date=20IS=20=
NULL;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_hosts_interfaces_resources_usage_samples=0A=20AS=0A=
SELECT=0A=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=
=20history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
host_interface_id=20as=20host_interface_id,=0A=20=20=20=20=20=20=
receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=20=20=
transmit_rate_percent=20as=20transmit_rate_percent,=0A=20=20=20=20=20=20=
received_total_byte=20as=20received_total_byte,=0A=20=20=20=20=20=20=
transmitted_total_byte=20as=20transmitted_total_byte,=0A=20=20=20=20=20=20=
host_interface_configuration_version=20as=20=
host_interface_configuration_version=0AFROM=20=
host_interface_samples_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_hosts_interfaces_resources_usage_hourly=0A=20AS=0ASELECT=0A=
=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
host_interface_id=20as=20host_interface_id,=0A=20=20=20=20=20=20=
receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=20=20=
max_receive_rate_percent=20as=20max_receive_rate_percent,=0A=20=20=20=20=20=
=20transmit_rate_percent=20as=20transmit_rate_percent,=0A=20=20=20=20=20=20=
max_transmit_rate_percent=20as=20max_transmit_rate_percent,=0A=20=20=20=20=
=20=20received_total_byte=20as=20received_total_byte,=0A=20=20=20=20=20=20=
transmitted_total_byte=20as=20transmitted_total_byte,=0A=20=20=20=20=20=20=
host_interface_configuration_version=20as=20=
host_interface_configuration_version=0AFROM=20=
host_interface_hourly_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_hosts_interfaces_resources_usage_daily=0A=20AS=0ASELECT=0A=
=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
host_interface_id=20as=20host_interface_id,=0A=20=20=20=20=20=20=
receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=20=20=
max_receive_rate_percent=20as=20max_receive_rate_percent,=0A=20=20=20=20=20=
=20transmit_rate_percent=20as=20transmit_rate_percent,=0A=20=20=20=20=20=20=
max_transmit_rate_percent=20as=20max_transmit_rate_percent,=0A=20=20=20=20=
=20=20received_total_byte=20as=20received_total_byte,=0A=20=20=20=20=20=20=
transmitted_total_byte=20as=20transmitted_total_byte,=0A=20=20=20=20=20=20=
host_interface_configuration_version=20as=20=
host_interface_configuration_version=0AFROM=20=
host_interface_daily_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_fully_joined_statistics_hosts_resources_usage_samples=0A=20AS=0A=
SELECT=0A=20=20=20=20conf.host_id=20as=20host_id,=0A=20=20=20=20=
conf.host_unique_id=20as=20host_unique_id,=0A=20=20=20=20conf.host_name=20=
as=20host_name,=0A=20=20=20=20conf.cluster_id=20as=20cluster_id,=0A=20=20=
=20=20conf.host_type=20as=20host_type,=0A=20=20=20=20conf.fqdn_or_ip=20=
as=20fqdn_or_ip,=0A=20=20=20=20conf.memory_size_mb=20as=20=
memory_size_mb,=0A=20=20=20=20conf.swap_size_mb=20as=20swap_size_mb,=0A=20=
=20=20=20conf.cpu_model=20as=20cpu_model,=0A=20=20=20=20=
conf.number_of_cores=20as=20number_of_cores,=0A=20=20=20=20=
conf.number_of_sockets=20as=20number_of_sockets,=0A=20=20=20=20=
conf.cpu_speed_mh=20as=20cpu_speed_mh,=0A=20=20=20=20conf.host_os=20as=20=
host_os,=0A=20=20=20=20conf.kernel_version=20as=20kernel_version,=0A=20=20=
=20=20conf.kvm_version=20as=20kvm_version,=0A=20=20=20=20=
conf.vdsm_version=20as=20vdsm_version,=0A=20=20=20=20conf.vdsm_port=20as=20=
vdsm_port,=0A=20=20=20=20conf.threads_per_core=20as=20threads_per_core,=0A=
=20=20=20=20conf.hardware_manufacturer=20as=20hardware_manufacturer,=0A=20=
=20=20=20conf.hardware_product_name=20as=20hardware_product_name,=0A=20=20=
=20=20conf.hardware_version=20as=20hardware_version,=0A=20=20=20=20=
conf.hardware_serial_number=20as=20hardware_serial_number,=0A=20=20=20=20=
conf.cluster_configuration_version=20as=20cluster_configuration_version,=0A=
=20=20=20=20conf.create_date=20as=20host_create_date,=0A=20=20=20=20=
conf.update_date=20as=20host_update_date,=0A=20=20=20=20conf.delete_date=20=
as=20host_delete_date,=0A=20=20=20=20stats.history_datetime=20as=20=
history_datetime,=0A=20=20=20=20stats.host_status=20as=20host_status,=0A=20=
=20=20=20stats.seconds_in_status=20as=20host_seconds_in_status,=0A=20=20=20=
=20cast(stats.seconds_in_status=20as=20numeric(7,2))=20/=2060=20as=20=
host_minutes_in_status,=0A=20=20=20=20stats.memory_usage_percent=20as=20=
memory_usage_percent,=0A=20=20=20=20stats.ksm_shared_memory_mb=20=
ksm_shared_memory_mb,=0A=20=20=20=20stats.cpu_usage_percent=20as=20=
cpu_usage_percent,=0A=20=20=20=20stats.ksm_cpu_percent=20as=20=
ksm_cpu_percent,=0A=20=20=20=20stats.active_vms=20as=20active_vms,=0A=20=20=
=20=20stats.total_vms=20as=20total_vms,=0A=20=20=20=20=
stats.total_vms_vcpus=20as=20total_vms_vcpus,=0A=20=20=20=20=
stats.cpu_load=20as=20cpu_load,=0A=20=20=20=20=
stats.system_cpu_usage_percent=20as=20system_cpu_usage_percent,=0A=20=20=20=
=20stats.user_cpu_usage_percent=20as=20user_cpu_usage_percent,=0A=20=20=20=
=20stats.swap_used_mb=20as=20swap_used_mb,=0A=20=20=20=20=
nic_conf.host_interface_id=20as=20host_interface_id,=0A=20=20=20=20=
nic_conf.host_interface_name=20as=20host_interface_name,=0A=20=20=20=20=
nic_conf.host_interface_type=20as=20host_interface_type,=0A=20=20=20=20=
nic_conf.host_interface_speed_bps=20as=20host_interface_speed_bps,=0A=20=20=
=20=20nic_conf.mac_address=20as=20mac_address,=0A=20=20=20=20=
nic_conf.logical_network_name,=0A=20=20=20=20nic_conf.ip_address=20as=20=
ip_address,=0A=20=20=20=20nic_conf.gateway=20as=20gateway,=0A=20=20=20=20=
nic_conf.bond=20as=20bond,=0A=20=20=20=20nic_conf.bond_name=20as=20=
bond_name,=0A=20=20=20=20nic_conf.vlan_id=20as=20vlan_id,=0A=20=20=20=20=
nic_conf.create_date=20as=20host_interface_create_date,=0A=20=20=20=20=
nic_conf.update_date=20as=20host_interface_update_date,=0A=20=20=20=20=
nic_conf.delete_date=20as=20host_interface_delete_date,=0A=20=20=20=20=
nic_stats.receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=
nic_stats.transmit_rate_percent=20as=20transmit_rate_percent,=0A=20=20=20=
=20nic_stats.received_total_byte=20as=20received_total_byte,=0A=20=20=20=20=
nic_stats.transmitted_total_byte=20as=20transmitted_total_byte=0AFROM=20=
v4_0_configuration_history_hosts=20AS=20conf=0A=20=20=20=20LEFT=20OUTER=20=
JOIN=20v4_0_statistics_hosts_resources_usage_samples=20AS=20stats=0A=20=20=
=20=20=20=20=20=20ON=20(conf.history_id=20=3D=20=
stats.host_configuration_version)=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_configuration_history_hosts_interfaces=20nic_conf=0A=20=20=20=20=20=20=
=20=20ON=20(conf.history_id=20=3D=20nic_conf.host_configuration_version)=0A=
=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_statistics_hosts_interfaces_resources_usage_samples=20nic_stats=0A=20=
=20=20=20=20=20=20=20ON=20(nic_conf.history_id=20=3D=20=
nic_stats.host_interface_configuration_version=20AND=0A=20=20=20=20=20=20=
=20=20=20=20=20=20stats.history_datetime=20=3D=20=
nic_stats.history_datetime);=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_fully_joined_statistics_hosts_resources_usage_hourly=0A=20AS=0A=
SELECT=0A=20=20=20=20conf.host_id=20as=20host_id,=0A=20=20=20=20=
conf.host_unique_id=20as=20host_unique_id,=0A=20=20=20=20conf.host_name=20=
as=20host_name,=0A=20=20=20=20conf.cluster_id=20as=20cluster_id,=0A=20=20=
=20=20conf.host_type=20as=20host_type,=0A=20=20=20=20conf.fqdn_or_ip=20=
as=20fqdn_or_ip,=0A=20=20=20=20conf.memory_size_mb=20as=20=
memory_size_mb,=0A=20=20=20=20conf.swap_size_mb=20as=20swap_size_mb,=0A=20=
=20=20=20conf.cpu_model=20as=20cpu_model,=0A=20=20=20=20=
conf.number_of_cores=20as=20number_of_cores,=0A=20=20=20=20=
conf.number_of_sockets=20as=20number_of_sockets,=0A=20=20=20=20=
conf.cpu_speed_mh=20as=20cpu_speed_mh,=0A=20=20=20=20conf.host_os=20as=20=
host_os,=0A=20=20=20=20conf.kernel_version=20as=20kernel_version,=0A=20=20=
=20=20conf.kvm_version=20as=20kvm_version,=0A=20=20=20=20=
conf.vdsm_version=20as=20vdsm_version,=0A=20=20=20=20conf.vdsm_port=20as=20=
vdsm_port,=0A=20=20=20=20conf.threads_per_core=20as=20threads_per_core,=0A=
=20=20=20=20conf.hardware_manufacturer=20as=20hardware_manufacturer,=0A=20=
=20=20=20conf.hardware_product_name=20as=20hardware_product_name,=0A=20=20=
=20=20conf.hardware_version=20as=20hardware_version,=0A=20=20=20=20=
conf.hardware_serial_number=20as=20hardware_serial_number,=0A=20=20=20=20=
conf.cluster_configuration_version=20as=20cluster_configuration_version,=0A=
=20=20=20=20conf.create_date=20as=20host_create_date,=0A=20=20=20=20=
conf.update_date=20as=20host_update_date,=0A=20=20=20=20conf.delete_date=20=
as=20host_delete_date,=0A=20=20=20=20stats.history_datetime=20as=20=
history_datetime,=0A=20=20=20=20stats.host_status=20as=20host_status,=0A=20=
=20=20=20cast(stats.minutes_in_status=20*=2060=20as=20integer)=20as=20=
host_seconds_in_status,=0A=20=20=20=20stats.minutes_in_status=20as=20=
host_minutes_in_status,=0A=20=20=20=20stats.memory_usage_percent=20as=20=
memory_usage_percent,=0A=20=20=20=20stats.max_memory_usage=20as=20=
max_memory_usage,=0A=20=20=20=20stats.ksm_shared_memory_mb=20=
ksm_shared_memory_mb,=0A=20=20=20=20stats.max_ksm_shared_memory_mb=20as=20=
max_ksm_shared_memory_mb,=0A=20=20=20=20stats.cpu_usage_percent=20as=20=
cpu_usage_percent,=0A=20=20=20=20stats.max_cpu_usage=20as=20=
max_cpu_usage,=0A=20=20=20=20stats.ksm_cpu_percent=20as=20=
ksm_cpu_percent,=0A=20=20=20=20stats.max_ksm_cpu_percent=20as=20=
max_ksm_cpu_percent,=0A=20=20=20=20stats.active_vms=20as=20active_vms,=0A=
=20=20=20=20stats.max_active_vms=20as=20max_active_vms,=0A=20=20=20=20=
stats.total_vms=20as=20total_vms,=0A=20=20=20=20stats.max_total_vms=20as=20=
max_total_vms,=0A=20=20=20=20stats.total_vms_vcpus=20as=20=
total_vms_vcpus,=0A=20=20=20=20stats.max_total_vms_vcpus=20as=20=
max_total_vms_vcpus,=0A=20=20=20=20stats.cpu_load=20as=20cpu_load,=0A=20=20=
=20=20stats.max_cpu_load=20as=20max_cpu_load,=0A=20=20=20=20=
stats.system_cpu_usage_percent=20as=20system_cpu_usage_percent,=0A=20=20=20=
=20stats.max_system_cpu_usage_percent=20as=20=
max_system_cpu_usage_percent,=0A=20=20=20=20stats.user_cpu_usage_percent=20=
as=20user_cpu_usage_percent,=0A=20=20=20=20=
stats.max_user_cpu_usage_percent=20as=20max_user_cpu_usage_percent,=0A=20=
=20=20=20stats.swap_used_mb=20as=20swap_used_mb,=0A=20=20=20=20=
stats.max_swap_used_mb=20as=20max_swap_used_mb,=0A=20=20=20=20=
nic_conf.host_interface_id=20as=20host_interface_id,=0A=20=20=20=20=
nic_conf.host_interface_name=20as=20host_interface_name,=0A=20=20=20=20=
nic_conf.host_interface_type=20as=20host_interface_type,=0A=20=20=20=20=
nic_conf.host_interface_speed_bps=20as=20host_interface_speed_bps,=0A=20=20=
=20=20nic_conf.mac_address=20as=20mac_address,=0A=20=20=20=20=
nic_conf.logical_network_name,=0A=20=20=20=20nic_conf.ip_address=20as=20=
ip_address,=0A=20=20=20=20nic_conf.gateway=20as=20gateway,=0A=20=20=20=20=
nic_conf.bond=20as=20bond,=0A=20=20=20=20nic_conf.bond_name=20as=20=
bond_name,=0A=20=20=20=20nic_conf.vlan_id=20as=20vlan_id,=0A=20=20=20=20=
nic_conf.create_date=20as=20host_interface_create_date,=0A=20=20=20=20=
nic_conf.update_date=20as=20host_interface_update_date,=0A=20=20=20=20=
nic_conf.delete_date=20as=20host_interface_delete_date,=0A=20=20=20=20=
nic_stats.receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=
nic_stats.max_receive_rate_percent=20as=20max_receive_rate_percent,=0A=20=
=20=20=20nic_stats.transmit_rate_percent=20as=20transmit_rate_percent,=0A=
=20=20=20=20nic_stats.max_transmit_rate_percent=20as=20=
max_transmit_rate_percent,=0A=20=20=20=20nic_stats.received_total_byte=20=
as=20received_total_byte,=0A=20=20=20=20nic_stats.transmitted_total_byte=20=
as=20transmitted_total_byte=0AFROM=20v4_0_configuration_history_hosts=20=
AS=20conf=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_statistics_hosts_resources_usage_hourly=20AS=20stats=0A=20=20=20=20=20=
=20=20=20ON=20(conf.history_id=20=3D=20stats.host_configuration_version)=0A=
=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_configuration_history_hosts_interfaces=20nic_conf=0A=20=20=20=20=20=20=
=20=20ON=20(conf.history_id=20=3D=20nic_conf.host_configuration_version)=0A=
=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_statistics_hosts_interfaces_resources_usage_hourly=20nic_stats=0A=20=
=20=20=20=20=20=20=20ON=20(nic_conf.history_id=20=3D=20=
nic_stats.host_interface_configuration_version=20AND=0A=20=20=20=20=20=20=
=20=20=20=20=20=20stats.history_datetime=20=3D=20=
nic_stats.history_datetime);=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_fully_joined_statistics_hosts_resources_usage_daily=0A=20AS=0A=
SELECT=0A=20=20=20=20conf.host_id=20as=20host_id,=0A=20=20=20=20=
conf.host_unique_id=20as=20host_unique_id,=0A=20=20=20=20conf.host_name=20=
as=20host_name,=0A=20=20=20=20conf.cluster_id=20as=20cluster_id,=0A=20=20=
=20=20conf.host_type=20as=20host_type,=0A=20=20=20=20conf.fqdn_or_ip=20=
as=20fqdn_or_ip,=0A=20=20=20=20conf.memory_size_mb=20as=20=
memory_size_mb,=0A=20=20=20=20conf.swap_size_mb=20as=20swap_size_mb,=0A=20=
=20=20=20conf.cpu_model=20as=20cpu_model,=0A=20=20=20=20=
conf.number_of_cores=20as=20number_of_cores,=0A=20=20=20=20=
conf.number_of_sockets=20as=20number_of_sockets,=0A=20=20=20=20=
conf.cpu_speed_mh=20as=20cpu_speed_mh,=0A=20=20=20=20conf.host_os=20as=20=
host_os,=0A=20=20=20=20conf.kernel_version=20as=20kernel_version,=0A=20=20=
=20=20conf.kvm_version=20as=20kvm_version,=0A=20=20=20=20=
conf.vdsm_version=20as=20vdsm_version,=0A=20=20=20=20conf.vdsm_port=20as=20=
vdsm_port,=0A=20=20=20=20conf.threads_per_core=20as=20threads_per_core,=0A=
=20=20=20=20conf.hardware_manufacturer=20as=20hardware_manufacturer,=0A=20=
=20=20=20conf.hardware_product_name=20as=20hardware_product_name,=0A=20=20=
=20=20conf.hardware_version=20as=20hardware_version,=0A=20=20=20=20=
conf.hardware_serial_number=20as=20hardware_serial_number,=0A=20=20=20=20=
conf.cluster_configuration_version=20as=20cluster_configuration_version,=0A=
=20=20=20=20conf.create_date=20as=20host_create_date,=0A=20=20=20=20=
conf.update_date=20as=20host_update_date,=0A=20=20=20=20conf.delete_date=20=
as=20host_delete_date,=0A=20=20=20=20stats.history_datetime=20as=20=
history_datetime,=0A=20=20=20=20stats.host_status=20as=20host_status,=0A=20=
=20=20=20cast(stats.minutes_in_status=20*=2060=20as=20integer)=20as=20=
host_seconds_in_status,=0A=20=20=20=20stats.minutes_in_status=20as=20=
host_minutes_in_status,=0A=20=20=20=20stats.memory_usage_percent=20as=20=
memory_usage_percent,=0A=20=20=20=20stats.max_memory_usage=20as=20=
max_memory_usage,=0A=20=20=20=20stats.ksm_shared_memory_mb=20=
ksm_shared_memory_mb,=0A=20=20=20=20stats.max_ksm_shared_memory_mb=20as=20=
max_ksm_shared_memory_mb,=0A=20=20=20=20stats.cpu_usage_percent=20as=20=
cpu_usage_percent,=0A=20=20=20=20stats.max_cpu_usage=20as=20=
max_cpu_usage,=0A=20=20=20=20stats.ksm_cpu_percent=20as=20=
ksm_cpu_percent,=0A=20=20=20=20stats.max_ksm_cpu_percent=20as=20=
max_ksm_cpu_percent,=0A=20=20=20=20stats.active_vms=20as=20active_vms,=0A=
=20=20=20=20stats.max_active_vms=20as=20max_active_vms,=0A=20=20=20=20=
stats.total_vms=20as=20total_vms,=0A=20=20=20=20stats.max_total_vms=20as=20=
max_total_vms,=0A=20=20=20=20stats.total_vms_vcpus=20as=20=
total_vms_vcpus,=0A=20=20=20=20stats.max_total_vms_vcpus=20as=20=
max_total_vms_vcpus,=0A=20=20=20=20stats.cpu_load=20as=20cpu_load,=0A=20=20=
=20=20stats.max_cpu_load=20as=20max_cpu_load,=0A=20=20=20=20=
stats.system_cpu_usage_percent=20as=20system_cpu_usage_percent,=0A=20=20=20=
=20stats.max_system_cpu_usage_percent=20as=20=
max_system_cpu_usage_percent,=0A=20=20=20=20stats.user_cpu_usage_percent=20=
as=20user_cpu_usage_percent,=0A=20=20=20=20=
stats.max_user_cpu_usage_percent=20as=20max_user_cpu_usage_percent,=0A=20=
=20=20=20stats.swap_used_mb=20as=20swap_used_mb,=0A=20=20=20=20=
stats.max_swap_used_mb=20as=20max_swap_used_mb,=0A=20=20=20=20=
nic_conf.host_interface_id=20as=20host_interface_id,=0A=20=20=20=20=
nic_conf.host_interface_name=20as=20host_interface_name,=0A=20=20=20=20=
nic_conf.host_interface_type=20as=20host_interface_type,=0A=20=20=20=20=
nic_conf.host_interface_speed_bps=20as=20host_interface_speed_bps,=0A=20=20=
=20=20nic_conf.mac_address=20as=20mac_address,=0A=20=20=20=20=
nic_conf.logical_network_name,=0A=20=20=20=20nic_conf.ip_address=20as=20=
ip_address,=0A=20=20=20=20nic_conf.gateway=20as=20gateway,=0A=20=20=20=20=
nic_conf.bond=20as=20bond,=0A=20=20=20=20nic_conf.bond_name=20as=20=
bond_name,=0A=20=20=20=20nic_conf.vlan_id=20as=20vlan_id,=0A=20=20=20=20=
nic_conf.create_date=20as=20host_interface_create_date,=0A=20=20=20=20=
nic_conf.update_date=20as=20host_interface_update_date,=0A=20=20=20=20=
nic_conf.delete_date=20as=20host_interface_delete_date,=0A=20=20=20=20=
nic_stats.receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=
nic_stats.max_receive_rate_percent=20as=20max_receive_rate_percent,=0A=20=
=20=20=20nic_stats.transmit_rate_percent=20as=20transmit_rate_percent,=0A=
=20=20=20=20nic_stats.max_transmit_rate_percent=20as=20=
max_transmit_rate_percent,=0A=20=20=20=20nic_stats.received_total_byte=20=
as=20received_total_byte,=0A=20=20=20=20nic_stats.transmitted_total_byte=20=
as=20transmitted_total_byte=0AFROM=20v4_0_configuration_history_hosts=20=
AS=20conf=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_statistics_hosts_resources_usage_daily=20AS=20stats=0A=20=20=20=20=20=
=20=20=20ON=20(conf.history_id=20=3D=20stats.host_configuration_version)=0A=
=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_configuration_history_hosts_interfaces=20nic_conf=0A=20=20=20=20=20=20=
=20=20ON=20(conf.history_id=20=3D=20nic_conf.host_configuration_version)=0A=
=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_statistics_hosts_interfaces_resources_usage_daily=20nic_stats=0A=20=20=
=20=20=20=20=20=20ON=20(nic_conf.history_id=20=3D=20=
nic_stats.host_interface_configuration_version=20AND=0A=20=20=20=20=20=20=
=20=20=20=20=20=20stats.history_datetime=20=3D=20=
nic_stats.history_datetime);=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_configuration_history_vms=0A=20AS=0ASELECT=0A=20=20=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20=20=20vm_id=20as=20vm_id,=0A=20=
=20=20=20=20=20vm_name=20as=20vm_name,=0A=20=20=20=20=20=20=
vm_description=20as=20vm_description,=0A=20=20=20=20=20=20vm_type=20as=20=
vm_type,=0A=20=20=20=20=20=20cluster_id=20as=20cluster_id,=0A=20=20=20=20=
=20=20template_id=20as=20template_id,=0A=20=20=20=20=20=20template_name=20=
as=20template_name,=0A=20=20=20=20=20=20cpu_per_socket=20as=20=
cpu_per_socket,=0A=20=20=20=20=20=20number_of_sockets=20as=20=
number_of_sockets,=0A=20=20=20=20=20=20memory_size_mb=20as=20=
memory_size_mb,=0A=20=20=20=20=20=20operating_system=20as=20=
operating_system,=0A=20=20=20=20=20=20default_host=20as=20default_host,=0A=
=20=20=20=20=20=20high_availability=20as=20high_availability,=0A=20=20=20=
=20=20=20initialized=20as=20initialized,=0A=20=20=20=20=20=20stateless=20=
as=20stateless,=0A=20=20=20=20=20=20fail_back=20as=20fail_back,=0A=20=20=20=
=20=20=20usb_policy=20as=20usb_policy,=0A=20=20=20=20=20=20time_zone=20=
as=20time_zone,=0A=20=20=20=20=20=20vm_pool_id,=0A=20=20=20=20=20=20=
vm_pool_name,=0A=20=20=20=20=20=20created_by_user_id,=0A=20=20=20=20=20=20=
cluster_configuration_version=20as=20cluster_configuration_version,=0A=20=
=20=20=20=20=20default_host_configuration_version=20as=20=
default_host_configuration_version,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date,=0A=20=20=
=20=20=20=20delete_date=20as=20delete_date=0AFROM=20vm_configuration;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_latest_configuration_vms=0A=20AS=0ASELECT=0A=20=20=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20=20=20vm_id=20as=20vm_id,=0A=20=
=20=20=20=20=20vm_name=20as=20vm_name,=0A=20=20=20=20=20=20=
vm_description=20as=20vm_description,=0A=20=20=20=20=20=20vm_type=20as=20=
vm_type,=0A=20=20=20=20=20=20cluster_id=20as=20cluster_id,=0A=20=20=20=20=
=20=20template_id=20as=20template_id,=0A=20=20=20=20=20=20template_name=20=
as=20template_name,=0A=20=20=20=20=20=20cpu_per_socket=20as=20=
cpu_per_socket,=0A=20=20=20=20=20=20number_of_sockets=20as=20=
number_of_sockets,=0A=20=20=20=20=20=20memory_size_mb=20as=20=
memory_size_mb,=0A=20=20=20=20=20=20operating_system=20as=20=
operating_system,=0A=20=20=20=20=20=20default_host=20as=20default_host,=0A=
=20=20=20=20=20=20high_availability=20as=20high_availability,=0A=20=20=20=
=20=20=20initialized=20as=20initialized,=0A=20=20=20=20=20=20stateless=20=
as=20stateless,=0A=20=20=20=20=20=20fail_back=20as=20fail_back,=0A=20=20=20=
=20=20=20usb_policy=20as=20usb_policy,=0A=20=20=20=20=20=20time_zone=20=
as=20time_zone,=0A=20=20=20=20=20=20vm_pool_id,=0A=20=20=20=20=20=20=
vm_pool_name,=0A=20=20=20=20=20=20created_by_user_id,=0A=20=20=20=20=20=20=
cluster_configuration_version=20as=20cluster_configuration_version,=0A=20=
=20=20=20=20=20default_host_configuration_version=20as=20=
default_host_configuration_version,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date=0AFROM=20=
vm_configuration=0AWHERE=20history_id=20in=20(SELECT=20max(a.history_id)=20=
FROM=20vm_configuration=20as=20a=20GROUP=20BY=20a.vm_id)=0A=20=20=20=20=20=
=20and=20delete_date=20IS=20NULL;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20v4_0_statistics_vms_resources_usage_samples=0A=20AS=0ASELECT=0A=20=
=20=20=20a.history_id=20as=20history_id,=0A=20=20=20=20=
a.history_datetime=20as=20history_datetime,=0A=20=20=20=20a.vm_id=20as=20=
vm_id,=0A=20=20=20=20a.vm_status=20as=20vm_status,=0A=20=20=20=20=
a.seconds_in_status=20as=20seconds_in_status,=0A=20=20=20=20=
cast(a.seconds_in_status=20as=20numeric(7,2))=20/=2060=20as=20=
minutes_in_status,=0A=20=20=20=20a.cpu_usage_percent=20as=20=
cpu_usage_percent,=0A=20=20=20=20a.memory_usage_percent=20as=20=
memory_usage_percent,=0A=20=20=20=20a.user_cpu_usage_percent=20as=20=
user_cpu_usage_percent,=0A=20=20=20=20a.system_cpu_usage_percent=20as=20=
system_cpu_usage_percent,=0A=20=20=20=20a.vm_ip=20as=20vm_ip,=0A=20=20=20=
=20a.vm_client_ip,=0A=20=20=20=20a.currently_running_on_host=20as=20=
currently_running_on_host,=0A=20=20=20=20a.current_user_id=20as=20=
current_user_id,=0A=20=20=20=20a.user_logged_in_to_guest,=0A=20=20=20=20=
b.disks_usage=20as=20disks_usage,=0A=20=20=20=20=
a.vm_configuration_version=20as=20vm_configuration_version,=0A=20=20=20=20=
a.current_host_configuration_version=20as=20=
current_host_configuration_version,=0A=20=20=20=20a.memory_buffered_kb=20=
as=20memory_buffered_kb,=0A=20=20=20=20a.memory_cached_kb=20as=20=
memory_cached_kb=0AFROM=20=20=20=20=20vm_samples_history=20as=20a=0A=20=20=
=20=20=20=20=20=20LEFT=20OUTER=20JOIN=20vm_disks_usage_samples_history=20=
as=20b=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20(a.history_datetime=20=
=3D=20b.history_datetime=20AND=20a.vm_id=20=3D=20b.vm_id);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_vms_resources_usage_hourly=0A=20AS=0ASELECT=0A=20=20=20=20=
a.history_id=20as=20history_id,=0A=20=20=20=20a.history_datetime=20as=20=
history_datetime,=0A=20=20=20=20a.vm_id=20as=20vm_id,=0A=20=20=20=20=
a.vm_status=20as=20vm_status,=0A=20=20=20=20cast(a.minutes_in_status=20*=20=
60=20as=20integer)=20as=20seconds_in_status,=0A=20=20=20=20=
a.minutes_in_status=20as=20minutes_in_status,=0A=20=20=20=20=
a.cpu_usage_percent=20as=20cpu_usage_percent,=0A=20=20=20=20=
a.max_cpu_usage=20as=20max_cpu_usage,=0A=20=20=20=20=
a.memory_usage_percent=20as=20memory_usage_percent,=0A=20=20=20=20=
a.max_memory_usage=20as=20max_memory_usage,=0A=20=20=20=20=
a.user_cpu_usage_percent=20as=20user_cpu_usage_percent,=0A=20=20=20=20=
a.max_user_cpu_usage_percent=20as=20max_user_cpu_usage_percent,=0A=20=20=20=
=20a.system_cpu_usage_percent=20as=20system_cpu_usage_percent,=0A=20=20=20=
=20a.max_system_cpu_usage_percent=20as=20max_system_cpu_usage_percent,=0A=
=20=20=20=20a.vm_ip=20as=20vm_ip,=0A=20=20=20=20=
a.currently_running_on_host=20as=20currently_running_on_host,=0A=20=20=20=
=20a.current_user_id=20as=20current_user_id,=0A=20=20=20=20b.disks_usage=20=
as=20disks_usage,=0A=20=20=20=20a.vm_configuration_version=20as=20=
vm_configuration_version,=0A=20=20=20=20=
a.current_host_configuration_version=20as=20=
current_host_configuration_version,=0A=20=20=20=20a.memory_buffered_kb=20=
as=20memory_buffered_kb,=0A=20=20=20=20a.memory_cached_kb=20as=20=
memory_cached_kb,=0A=20=20=20=20a.max_memory_buffered_kb=20as=20=
max_memory_buffered_kb,=0A=20=20=20=20a.max_memory_cached_kb=20as=20=
max_memory_cached_kb=0AFROM=20=20=20=20=20vm_hourly_history=20as=20a=0A=20=
=20=20=20=20=20=20=20LEFT=20OUTER=20JOIN=20vm_disks_usage_hourly_history=20=
as=20b=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20(a.history_datetime=20=
=3D=20b.history_datetime=20AND=20a.vm_id=20=3D=20b.vm_id);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_vms_resources_usage_daily=0A=20AS=0ASELECT=0A=20=20=20=20=
a.history_id=20as=20history_id,=0A=20=20=20=20a.history_datetime=20as=20=
history_datetime,=0A=20=20=20=20a.vm_id=20as=20vm_id,=0A=20=20=20=20=
a.vm_status=20as=20vm_status,=0A=20=20=20=20cast(a.minutes_in_status=20*=20=
60=20as=20integer)=20as=20seconds_in_status,=0A=20=20=20=20=
a.minutes_in_status=20as=20minutes_in_status,=0A=20=20=20=20=
a.cpu_usage_percent=20as=20cpu_usage_percent,=0A=20=20=20=20=
a.max_cpu_usage=20as=20max_cpu_usage,=0A=20=20=20=20=
a.memory_usage_percent=20as=20memory_usage_percent,=0A=20=20=20=20=
a.max_memory_usage=20as=20max_memory_usage,=0A=20=20=20=20=
a.user_cpu_usage_percent=20as=20user_cpu_usage_percent,=0A=20=20=20=20=
a.max_user_cpu_usage_percent=20as=20max_user_cpu_usage_percent,=0A=20=20=20=
=20a.system_cpu_usage_percent=20as=20system_cpu_usage_percent,=0A=20=20=20=
=20a.max_system_cpu_usage_percent=20as=20max_system_cpu_usage_percent,=0A=
=20=20=20=20a.vm_ip=20as=20vm_ip,=0A=20=20=20=20=
a.currently_running_on_host=20as=20currently_running_on_host,=0A=20=20=20=
=20a.current_user_id=20as=20current_user_id,=0A=20=20=20=20b.disks_usage=20=
as=20disks_usage,=0A=20=20=20=20a.vm_configuration_version=20as=20=
vm_configuration_version,=0A=20=20=20=20=
a.current_host_configuration_version=20as=20=
current_host_configuration_version,=0A=20=20=20=20a.memory_buffered_kb=20=
as=20memory_buffered_kb,=0A=20=20=20=20a.memory_cached_kb=20as=20=
memory_cached_kb,=0A=20=20=20=20a.max_memory_buffered_kb=20as=20=
max_memory_buffered_kb,=0A=20=20=20=20a.max_memory_cached_kb=20as=20=
max_memory_cached_kb=0AFROM=20=20=20=20=20vm_daily_history=20as=20a=0A=20=
=20=20=20=20=20=20=20LEFT=20OUTER=20JOIN=20vm_disks_usage_daily_history=20=
as=20b=0A=20=20=20=20=20=20=20=20=20=20=20=20ON=20(a.history_datetime=20=
=3D=20b.history_datetime=20AND=20a.vm_id=20=3D=20b.vm_id);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_vms_users_usage_hourly=0A=20AS=0ASELECT=20history_id,=0A=20=
=20=20=20=20=20=20history_datetime,=0A=20=20=20=20=20=20=20user_id,=0A=20=
=20=20=20=20=20=20vm_id,=0A=20=20=20=20=20=20=20session_time_in_minutes,=0A=
=20=20=20=20=20=20=20cpu_usage_percent,=0A=20=20=20=20=20=20=20=
max_cpu_usage,=0A=20=20=20=20=20=20=20memory_usage_percent,=0A=20=20=20=20=
=20=20=20max_memory_usage,=0A=20=20=20=20=20=20=20=
user_cpu_usage_percent,=0A=20=20=20=20=20=20=20=
max_user_cpu_usage_percent,=0A=20=20=20=20=20=20=20=
system_cpu_usage_percent,=0A=20=20=20=20=20=20=20=
max_system_cpu_usage_percent,=0A=20=20=20=20=20=20=20vm_ip,=0A=20=20=20=20=
=20=20=20vm_client_ip,=0A=20=20=20=20=20=20=20user_logged_in_to_guest,=0A=
=20=20=20=20=20=20=20currently_running_on_host,=0A=20=20=20=20=20=20=20=
vm_configuration_version,=0A=20=20=20=20=20=20=20=
current_host_configuration_version=0AFROM=20=
statistics_vms_users_usage_hourly;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20v4_0_statistics_vms_users_usage_daily=0A=20AS=0ASELECT=20=
history_id,=0A=20=20=20=20=20=20=20history_datetime,=0A=20=20=20=20=20=20=
=20user_id,=0A=20=20=20=20=20=20=20vm_id,=0A=20=20=20=20=20=20=20=
session_time_in_minutes,=0A=20=20=20=20=20=20=20cpu_usage_percent,=0A=20=20=
=20=20=20=20=20max_cpu_usage,=0A=20=20=20=20=20=20=20=
memory_usage_percent,=0A=20=20=20=20=20=20=20max_memory_usage,=0A=20=20=20=
=20=20=20=20user_cpu_usage_percent,=0A=20=20=20=20=20=20=20=
max_user_cpu_usage_percent,=0A=20=20=20=20=20=20=20=
system_cpu_usage_percent,=0A=20=20=20=20=20=20=20=
max_system_cpu_usage_percent,=0A=20=20=20=20=20=20=20vm_ip,=0A=20=20=20=20=
=20=20=20vm_client_ip,=0A=20=20=20=20=20=20=20user_logged_in_to_guest,=0A=
=20=20=20=20=20=20=20currently_running_on_host,=0A=20=20=20=20=20=20=20=
vm_configuration_version,=0A=20=20=20=20=20=20=20=
current_host_configuration_version=0AFROM=20=
statistics_vms_users_usage_daily;=0A**************************=0A=0A=
CREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
VIEW=20v4_0_configuration_history_vms_interfaces=0A=20AS=0ASELECT=0A=20=20=
=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
vm_interface_id=20as=20vm_interface_id,=0A=20=20=20=20=20=20=
vm_interface_name=20as=20vm_interface_name,=0A=20=20=20=20=20=20=
vm_interface_type=20as=20vm_interface_type,=0A=20=20=20=20=20=20=
vm_interface_speed_bps=20as=20vm_interface_speed_bps,=0A=20=20=20=20=20=20=
mac_address=20as=20mac_address,=0A=20=20=20=20=20=20=
logical_network_name,=0A=20=20=20=20=20=20vm_configuration_version=20as=20=
vm_configuration_version,=0A=20=20=20=20=20=20create_date=20as=20=
create_date,=0A=20=20=20=20=20=20update_date=20as=20update_date,=0A=20=20=
=20=20=20=20delete_date=20as=20delete_date=0AFROM=20=
vm_interface_configuration;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_latest_configuration_vms_interfaces=0A=20AS=0ASELECT=0A=20=20=20=20=20=
=20history_id=20as=20history_id,=0A=20=20=20=20=20=20vm_interface_id=20=
as=20vm_interface_id,=0A=20=20=20=20=20=20vm_interface_name=20as=20=
vm_interface_name,=0A=20=20=20=20=20=20vm_interface_type=20as=20=
vm_interface_type,=0A=20=20=20=20=20=20vm_interface_speed_bps=20as=20=
vm_interface_speed_bps,=0A=20=20=20=20=20=20mac_address=20as=20=
mac_address,=0A=20=20=20=20=20=20logical_network_name,=0A=20=20=20=20=20=20=
vm_configuration_version=20as=20vm_configuration_version,=0A=20=20=20=20=20=
=20create_date=20as=20create_date,=0A=20=20=20=20=20=20update_date=20as=20=
update_date=0AFROM=20vm_interface_configuration=0AWHERE=20history_id=20=
in=20(SELECT=20max(a.history_id)=20FROM=20vm_interface_configuration=20=
as=20a=20GROUP=20BY=20a.vm_interface_id)=0A=20=20=20=20=20=20and=20=
delete_date=20IS=20NULL;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_vms_interfaces_resources_usage_samples=0A=20AS=0ASELECT=0A=
=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
vm_interface_id=20as=20vm_interface_id,=0A=20=20=20=20=20=20=
receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=20=20=
transmit_rate_percent=20as=20transmit_rate_percent,=0A=20=20=20=20=20=20=
received_total_byte=20as=20received_total_byte,=0A=20=20=20=20=20=20=
transmitted_total_byte=20as=20transmitted_total_byte,=0A=20=20=20=20=20=20=
vm_interface_configuration_version=20as=20=
vm_interface_configuration_version=0AFROM=20=
vm_interface_samples_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_vms_interfaces_resources_usage_hourly=0A=20AS=0ASELECT=0A=
=20=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
vm_interface_id=20as=20vm_interface_id,=0A=20=20=20=20=20=20=
receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=20=20=
max_receive_rate_percent=20as=20max_receive_rate_percent,=0A=20=20=20=20=20=
=20transmit_rate_percent=20as=20transmit_rate_percent,=0A=20=20=20=20=20=20=
max_transmit_rate_percent=20as=20max_transmit_rate_percent,=0A=20=20=20=20=
=20=20received_total_byte=20as=20received_total_byte,=0A=20=20=20=20=20=20=
transmitted_total_byte=20as=20transmitted_total_byte,=0A=20=20=20=20=20=20=
vm_interface_configuration_version=20as=20=
vm_interface_configuration_version=0AFROM=20vm_interface_hourly_history;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_vms_interfaces_resources_usage_daily=0A=20AS=0ASELECT=0A=20=
=20=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=
history_datetime=20as=20history_datetime,=0A=20=20=20=20=20=20=
vm_interface_id=20as=20vm_interface_id,=0A=20=20=20=20=20=20=
receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=20=20=
max_receive_rate_percent=20as=20max_receive_rate_percent,=0A=20=20=20=20=20=
=20transmit_rate_percent=20as=20transmit_rate_percent,=0A=20=20=20=20=20=20=
max_transmit_rate_percent=20as=20max_transmit_rate_percent,=0A=20=20=20=20=
=20=20received_total_byte=20as=20received_total_byte,=0A=20=20=20=20=20=20=
transmitted_total_byte=20as=20transmitted_total_byte,=0A=20=20=20=20=20=20=
vm_interface_configuration_version=20as=20=
vm_interface_configuration_version=0AFROM=20vm_interface_daily_history;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_configuration_history_vms_disks=0A=20AS=0ASELECT=0A=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20vm_disk_id=20as=20=
vm_disk_id,=0A=20=20=20=20CASE=0A=20=20=20=20=20=20=20=20=20=20WHEN=20=
vm_disk_name=20IS=20NOT=20NULL=20THEN=20vm_disk_name=0A=20=20=20=20=20=20=
=20=20=20=20ELSE=20'disk=20'=20||=20cast(vm_internal_drive_mapping=20as=20=
varchar)=0A=20=20=20=20END=20as=20vm_disk_name,=0A=20=20=20=20=
vm_disk_description=20as=20vm_disk_description,=0A=20=20=20=20image_id=20=
as=20image_id,=0A=20=20=20=20storage_domain_id=20as=20storage_domain_id,=0A=
=20=20=20=20vm_disk_size_mb=20as=20vm_disk_size_mb,=0A=20=20=20=20=
vm_disk_type=20as=20vm_disk_type,=0A=20=20=20=20vm_disk_format=20as=20=
vm_disk_format,=0A=20=20=20=20is_shared=20as=20is_shared,=0A=20=20=20=20=
create_date=20as=20create_date,=0A=20=20=20=20update_date=20as=20=
update_date,=0A=20=20=20=20delete_date=20as=20delete_date=0AFROM=20=
vm_disk_configuration;=0A**************************=0A=0ACREATE=20VIEW=0A=
*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_latest_configuration_vms_disks=0A=20AS=0ASELECT=0A=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20vm_disk_id=20as=20=
vm_disk_id,=0A=20=20=20=20CASE=0A=20=20=20=20=20=20=20=20=20=20WHEN=20=
vm_disk_name=20IS=20NOT=20NULL=20THEN=20vm_disk_name=0A=20=20=20=20=20=20=
=20=20=20=20ELSE=20'disk=20'=20||=20cast(vm_internal_drive_mapping=20as=20=
varchar)=0A=20=20=20=20END=20as=20vm_disk_name,=0A=20=20=20=20=
vm_disk_description=20as=20vm_disk_description,=0A=20=20=20=20image_id=20=
as=20image_id,=0A=20=20=20=20storage_domain_id=20as=20storage_domain_id,=0A=
=20=20=20=20vm_disk_size_mb=20as=20vm_disk_size_mb,=0A=20=20=20=20=
vm_disk_type=20as=20vm_disk_type,=0A=20=20=20=20vm_disk_format=20as=20=
vm_disk_format,=0A=20=20=20=20is_shared=20as=20is_shared,=0A=20=20=20=20=
create_date=20as=20create_date,=0A=20=20=20=20update_date=20as=20=
update_date=0AFROM=20vm_disk_configuration=0AWHERE=20history_id=20in=20=
(SELECT=20max(a.history_id)=20FROM=20vm_disk_configuration=20as=20a=20=
GROUP=20BY=20a.vm_disk_id)=0A=20=20=20=20=20=20and=20delete_date=20IS=20=
NULL;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_vms_disks_resources_usage_samples=0A=20AS=0ASELECT=0A=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20history_datetime=20as=20=
history_datetime,=0A=20=20=20=20vm_disk_id=20as=20vm_disk_id,=0A=20=20=20=
=20vm_disk_status=20as=20vm_disk_status,=0A=20=20=20=20seconds_in_status=20=
as=20seconds_in_status,=0A=20=20=20=20cast(seconds_in_status=20as=20=
numeric(7,2))=20/=2060=20as=20minutes_in_status,=0A=20=20=20=20=
vm_disk_actual_size_mb=20as=20vm_disk_actual_size_mb,=0A=20=20=20=20=
read_rate_bytes_per_second=20as=20read_rate_bytes_per_second,=0A=20=20=20=
=20read_latency_seconds=20as=20read_latency_seconds,=0A=20=20=20=20=
write_rate_bytes_per_second=20as=20write_rate_bytes_per_second,=0A=20=20=20=
=20write_latency_seconds=20as=20write_latency_seconds,=0A=20=20=20=20=
flush_latency_seconds=20as=20flush_latency_seconds,=0A=20=20=20=20=
vm_disk_configuration_version=20as=20vm_disk_configuration_version=0A=
FROM=20vm_disk_samples_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_vms_disks_resources_usage_hourly=0A=20AS=0ASELECT=0A=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20history_datetime=20as=20=
history_datetime,=0A=20=20=20=20vm_disk_id=20as=20vm_disk_id,=0A=20=20=20=
=20vm_disk_status=20as=20vm_disk_status,=0A=20=20=20=20=
cast(minutes_in_status=20*=2060=20as=20integer)=20as=20=
seconds_in_status,=0A=20=20=20=20minutes_in_status=20as=20=
minutes_in_status,=0A=20=20=20=20vm_disk_actual_size_mb=20as=20=
vm_disk_actual_size_mb,=0A=20=20=20=20read_rate_bytes_per_second=20as=20=
read_rate_bytes_per_second,=0A=20=20=20=20max_read_rate_bytes_per_second=20=
as=20max_read_rate_bytes_per_second,=0A=20=20=20=20read_latency_seconds=20=
as=20read_latency_seconds,=0A=20=20=20=20max_read_latency_seconds=20as=20=
max_read_latency_seconds,=0A=20=20=20=20write_rate_bytes_per_second=20as=20=
write_rate_bytes_per_second,=0A=20=20=20=20=
max_write_rate_bytes_per_second=20as=20max_write_rate_bytes_per_second,=0A=
=20=20=20=20write_latency_seconds=20as=20write_latency_seconds,=0A=20=20=20=
=20max_write_latency_seconds=20as=20max_write_latency_seconds,=0A=20=20=20=
=20flush_latency_seconds=20as=20flush_latency_seconds,=0A=20=20=20=20=
max_flush_latency_seconds=20as=20max_flush_latency_seconds,=0A=20=20=20=20=
vm_disk_configuration_version=20as=20vm_disk_configuration_version=0A=
FROM=20vm_disk_hourly_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_statistics_vms_disks_resources_usage_daily=0A=20AS=0ASELECT=0A=20=20=
=20=20history_id=20as=20history_id,=0A=20=20=20=20history_datetime=20as=20=
history_datetime,=0A=20=20=20=20vm_disk_id=20as=20vm_disk_id,=0A=20=20=20=
=20vm_disk_status=20as=20vm_disk_status,=0A=20=20=20=20=
cast(minutes_in_status=20*=2060=20as=20integer)=20as=20=
seconds_in_status,=0A=20=20=20=20minutes_in_status=20as=20=
minutes_in_status,=0A=20=20=20=20vm_disk_actual_size_mb=20as=20=
vm_disk_actual_size_mb,=0A=20=20=20=20read_rate_bytes_per_second=20as=20=
read_rate_bytes_per_second,=0A=20=20=20=20max_read_rate_bytes_per_second=20=
as=20max_read_rate_bytes_per_second,=0A=20=20=20=20read_latency_seconds=20=
as=20read_latency_seconds,=0A=20=20=20=20max_read_latency_seconds=20as=20=
max_read_latency_seconds,=0A=20=20=20=20write_rate_bytes_per_second=20as=20=
write_rate_bytes_per_second,=0A=20=20=20=20=
max_write_rate_bytes_per_second=20as=20max_write_rate_bytes_per_second,=0A=
=20=20=20=20write_latency_seconds=20as=20write_latency_seconds,=0A=20=20=20=
=20max_write_latency_seconds=20as=20max_write_latency_seconds,=0A=20=20=20=
=20flush_latency_seconds=20as=20flush_latency_seconds,=0A=20=20=20=20=
max_flush_latency_seconds=20as=20max_flush_latency_seconds,=0A=20=20=20=20=
vm_disk_configuration_version=20as=20vm_disk_configuration_version=0A=
FROM=20vm_disk_daily_history;=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_configuration_history_vms_devices=0A=20AS=0ASELECT=0A=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20vm_id,=0A=20=20=20=20=
device_id,=0A=20=20=20=20type,=0A=20=20=20=20address,=0A=20=20=20=20=
is_managed,=0A=20=20=20=20is_plugged,=0A=20=20=20=20is_readonly,=0A=20=20=
=20=20vm_configuration_version,=0A=20=20=20=20=
device_configuration_version,=0A=20=20=20=20create_date,=0A=20=20=20=20=
update_date,=0A=20=20=20=20delete_date=0AFROM=20vm_device_history;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_latest_configuration_vms_devices=0A=20AS=0ASELECT=0A=20=20=20=20=
history_id=20as=20history_id,=0A=20=20=20=20vm_id,=0A=20=20=20=20=
device_id,=0A=20=20=20=20type,=0A=20=20=20=20address,=0A=20=20=20=20=
is_managed,=0A=20=20=20=20is_plugged,=0A=20=20=20=20is_readonly,=0A=20=20=
=20=20vm_configuration_version,=0A=20=20=20=20=
device_configuration_version,=0A=20=20=20=20create_date,=0A=20=20=20=20=
update_date=0AFROM=20vm_device_history=0AWHERE=20history_id=20in=20=
(SELECT=20max(a.history_id)=20FROM=20vm_device_history=20as=20a=20GROUP=20=
BY=20a.vm_id,=20a.device_id)=0A=20=20=20=20=20=20and=20delete_date=20IS=20=
NULL;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_fully_joined_statistics_vms_resources_usage_samples=0A=20AS=0A=20=
SELECT=0A=20=20=20=20conf.vm_id=20as=20vm_id,=0A=20=20=20=20conf.vm_name=20=
as=20vm_name,=0A=20=20=20=20conf.vm_description=20as=20vm_description,=0A=
=20=20=20=20conf.vm_type=20as=20vm_type,=0A=20=20=20=20conf.cluster_id=20=
as=20cluster_id,=0A=20=20=20=20conf.template_id=20as=20template_id,=0A=20=
=20=20=20conf.template_name=20as=20template_name,=0A=20=20=20=20=
conf.cpu_per_socket=20as=20cpu_per_socket,=0A=20=20=20=20=
conf.number_of_sockets=20as=20number_of_sockets,=0A=20=20=20=20=
conf.memory_size_mb=20as=20memory_size_mb,=0A=20=20=20=20=
conf.operating_system=20as=20operating_system,=0A=20=20=20=20=
conf.default_host=20as=20default_host,=0A=20=20=20=20=
conf.high_availability=20as=20high_availability,=0A=20=20=20=20=
conf.initialized=20as=20initialized,=0A=20=20=20=20conf.stateless=20as=20=
stateless,=0A=20=20=20=20conf.fail_back=20as=20fail_back,=0A=20=20=20=20=
conf.usb_policy=20as=20usb_policy,=0A=20=20=20=20conf.time_zone=20as=20=
time_zone,=0A=20=20=20=20conf.vm_pool_id=20as=20vm_pool_id,=0A=20=20=20=20=
conf.vm_pool_name=20as=20vm_pool_name,=0A=20=20=20=20=
conf.created_by_user_id=20as=20created_by_user_id,=0A=20=20=20=20=
conf.cluster_configuration_version=20as=20cluster_configuration_version,=0A=
=20=20=20=20conf.default_host_configuration_version=20as=20=
default_host_configuration_version,=0A=20=20=20=20conf.create_date=20as=20=
vm_create_date,=0A=20=20=20=20conf.update_date=20as=20vm_update_date,=0A=20=
=20=20=20conf.delete_date=20as=20vm_delete_date,=0A=20=20=20=20=
stats.history_datetime=20as=20history_datetime,=0A=20=20=20=20=
stats.vm_status=20as=20vm_status,=0A=20=20=20=20stats.seconds_in_status=20=
as=20seconds_in_status,=0A=20=20=20=20cast(stats.seconds_in_status=20as=20=
numeric(7,2))=20/=2060=20as=20minutes_in_status,=0A=20=20=20=20=
stats.cpu_usage_percent=20as=20cpu_usage_percent,=0A=20=20=20=20=
stats.memory_usage_percent=20as=20memory_usage_percent,=0A=20=20=20=20=
stats.user_cpu_usage_percent=20as=20user_cpu_usage_percent,=0A=20=20=20=20=
stats.system_cpu_usage_percent=20as=20system_cpu_usage_percent,=0A=20=20=20=
=20stats.vm_ip=20as=20vm_ip,=0A=20=20=20=20stats.vm_client_ip=20as=20=
vm_client_ip,=0A=20=20=20=20stats.currently_running_on_host=20as=20=
currently_running_on_host,=0A=20=20=20=20stats.current_user_id=20as=20=
current_user_id,=0A=20=20=20=20stats.user_logged_in_to_guest,=0A=20=20=20=
=20stats.disks_usage=20as=20disks_usage,=0A=20=20=20=20=
stats.current_host_configuration_version=20as=20=
current_host_configuration_version,=0A=20=20=20=20=
stats.memory_buffered_kb=20as=20memory_buffered_kb,=0A=20=20=20=20=
stats.memory_cached_kb=20as=20memory_cached_kb,=0A=20=20=20=20=
device_conf.device_id=20as=20device_id,=0A=20=20=20=20device_conf.type=20=
as=20device_type,=0A=20=20=20=20device_conf.address=20as=20address,=0A=20=
=20=20=20device_conf.is_managed=20as=20is_managed,=0A=20=20=20=20=
device_conf.is_plugged=20as=20is_plugged,=0A=20=20=20=20=
device_conf.is_readonly=20as=20is_readonly,=0A=20=20=20=20=
device_conf.create_date=20as=20device_create_date,=0A=20=20=20=20=
device_conf.update_date=20as=20device_update_date,=0A=20=20=20=20=
device_conf.delete_date=20as=20device_delete_date,=0A=20=20=20=20=
nic_conf.vm_interface_id=20as=20vm_interface_id,=0A=20=20=20=20=
nic_conf.vm_interface_name=20as=20vm_interface_name,=0A=20=20=20=20=
nic_conf.vm_interface_type=20as=20vm_interface_type,=0A=20=20=20=20=
nic_conf.vm_interface_speed_bps=20as=20vm_interface_speed_bps,=0A=20=20=20=
=20nic_conf.mac_address=20as=20mac_address,=0A=20=20=20=20=
nic_conf.logical_network_name=20as=20logical_network_name,=0A=20=20=20=20=
nic_conf.create_date=20as=20vm_interface_create_date,=0A=20=20=20=20=
nic_conf.update_date=20as=20vm_interface_update_date,=0A=20=20=20=20=
nic_conf.delete_date=20as=20vm_interface_delete_date,=0A=20=20=20=20=
nic_stats.receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=
nic_stats.transmit_rate_percent=20as=20transmit_rate_percent,=0A=20=20=20=
=20nic_stats.received_total_byte=20as=20received_total_byte,=0A=20=20=20=20=
nic_stats.transmitted_total_byte=20as=20transmitted_total_byte,=0A=20=20=20=
=20disk_conf.vm_disk_id=20as=20vm_disk_id,=0A=20=20=20=20=
disk_conf.vm_disk_name=20as=20vm_disk_name,=0A=20=20=20=20=
disk_conf.vm_disk_description=20as=20vm_disk_description,=0A=20=20=20=20=
disk_conf.image_id=20as=20image_id,=0A=20=20=20=20=
disk_conf.storage_domain_id=20as=20storage_domain_id,=0A=20=20=20=20=
disk_conf.vm_disk_size_mb=20as=20vm_disk_size_mb,=0A=20=20=20=20=
disk_conf.vm_disk_type=20as=20vm_disk_type,=0A=20=20=20=20=
disk_conf.vm_disk_format=20as=20vm_disk_format,=0A=20=20=20=20=
disk_conf.is_shared=20as=20is_shared,=0A=20=20=20=20=
disk_conf.create_date=20as=20vm_disk_create_date,=0A=20=20=20=20=
disk_conf.update_date=20as=20vm_disk_update_date,=0A=20=20=20=20=
disk_conf.delete_date=20as=20vm_disk_delete_date,=0A=20=20=20=20=
disk_stats.vm_disk_status=20as=20vm_disk_status,=0A=20=20=20=20=
disk_stats.seconds_in_status=20as=20vm_disk_seconds_in_status,=0A=20=20=20=
=20cast(disk_stats.seconds_in_status=20as=20numeric(7,2))=20/=2060=20as=20=
vm_disk_minutes_in_status,=0A=20=20=20=20=
disk_stats.vm_disk_actual_size_mb=20as=20vm_disk_actual_size_mb,=0A=20=20=
=20=20disk_stats.read_rate_bytes_per_second=20as=20=
read_rate_bytes_per_second,=0A=20=20=20=20=
disk_stats.read_latency_seconds=20as=20read_latency_seconds,=0A=20=20=20=20=
disk_stats.write_rate_bytes_per_second=20as=20=
write_rate_bytes_per_second,=0A=20=20=20=20=
disk_stats.write_latency_seconds=20as=20write_latency_seconds,=0A=20=20=20=
=20disk_stats.flush_latency_seconds=20as=20flush_latency_seconds=0AFROM=20=
v4_0_configuration_history_vms=20AS=20conf=0A=20=20=20=20LEFT=20OUTER=20=
JOIN=20v4_0_statistics_vms_resources_usage_samples=20AS=20stats=0A=20=20=20=
=20=20=20=20=20ON=20(conf.history_id=20=3D=20=
stats.vm_configuration_version)=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=20=
v4_0_configuration_history_vms_devices=20device_conf=0A=20=20=20=20=20=20=
=20=20ON=20(conf.history_id=20=3D=20=
device_conf.vm_configuration_version)=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_configuration_history_vms_disks=20disk_conf=0A=20=20=20=20=20=20=20=20=
ON=20(device_conf.device_configuration_version=20=3D=20=
disk_conf.history_id)=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_configuration_history_vms_interfaces=20AS=20nic_conf=0A=20=20=20=20=20=
=20=20=20ON=20(device_conf.device_configuration_version=20=3D=20=
nic_conf.history_id=20=20AND=0A=20=20=20=20=20=20=20=20=20=20=20=20=
conf.history_id=20=3D=20nic_conf.vm_configuration_version)=0A=20=20=20=20=
LEFT=20OUTER=20JOIN=20=
v4_0_statistics_vms_interfaces_resources_usage_samples=20AS=20nic_stats=0A=
=20=20=20=20=20=20=20=20ON=20(nic_conf.history_id=20=3D=20=
nic_stats.vm_interface_configuration_version=20AND=0A=20=20=20=20=20=20=20=
=20=20=20=20=20stats.history_datetime=20=3D=20=
nic_stats.history_datetime)=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_statistics_vms_disks_resources_usage_samples=20disk_stats=0A=20=20=20=
=20=20=20=20=20ON=20(disk_conf.history_id=20=3D=20=
disk_stats.vm_disk_configuration_version=20AND=0A=20=20=20=20=20=20=20=20=
=20=20=20=20stats.history_datetime=20=3D=20disk_stats.history_datetime);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_fully_joined_statistics_vms_resources_usage_hourly=0A=20AS=0A=20=
SELECT=0A=20=20=20=20conf.vm_id=20as=20vm_id,=0A=20=20=20=20conf.vm_name=20=
as=20vm_name,=0A=20=20=20=20conf.vm_description=20as=20vm_description,=0A=
=20=20=20=20conf.vm_type=20as=20vm_type,=0A=20=20=20=20conf.cluster_id=20=
as=20cluster_id,=0A=20=20=20=20conf.template_id=20as=20template_id,=0A=20=
=20=20=20conf.template_name=20as=20template_name,=0A=20=20=20=20=
conf.cpu_per_socket=20as=20cpu_per_socket,=0A=20=20=20=20=
conf.number_of_sockets=20as=20number_of_sockets,=0A=20=20=20=20=
conf.memory_size_mb=20as=20memory_size_mb,=0A=20=20=20=20=
conf.operating_system=20as=20operating_system,=0A=20=20=20=20=
conf.default_host=20as=20default_host,=0A=20=20=20=20=
conf.high_availability=20as=20high_availability,=0A=20=20=20=20=
conf.initialized=20as=20initialized,=0A=20=20=20=20conf.stateless=20as=20=
stateless,=0A=20=20=20=20conf.fail_back=20as=20fail_back,=0A=20=20=20=20=
conf.usb_policy=20as=20usb_policy,=0A=20=20=20=20conf.time_zone=20as=20=
time_zone,=0A=20=20=20=20conf.vm_pool_id=20as=20vm_pool_id,=0A=20=20=20=20=
conf.vm_pool_name=20as=20vm_pool_name,=0A=20=20=20=20=
conf.created_by_user_id=20as=20created_by_user_id,=0A=20=20=20=20=
conf.cluster_configuration_version=20as=20cluster_configuration_version,=0A=
=20=20=20=20conf.default_host_configuration_version=20as=20=
default_host_configuration_version,=0A=20=20=20=20conf.create_date=20as=20=
vm_create_date,=0A=20=20=20=20conf.update_date=20as=20vm_update_date,=0A=20=
=20=20=20conf.delete_date=20as=20vm_delete_date,=0A=20=20=20=20=
stats.history_datetime=20as=20history_datetime,=0A=20=20=20=20=
stats.vm_status=20as=20vm_status,=0A=20=20=20=20=
cast(stats.minutes_in_status=20*=2060=20as=20integer)=20as=20=
vm_seconds_in_status,=0A=20=20=20=20stats.minutes_in_status=20as=20=
vm_minutes_in_status,=0A=20=20=20=20stats.cpu_usage_percent=20as=20=
cpu_usage_percent,=0A=20=20=20=20stats.max_cpu_usage=20as=20=
max_cpu_usage,=0A=20=20=20=20stats.memory_usage_percent=20as=20=
memory_usage_percent,=0A=20=20=20=20stats.max_memory_usage=20as=20=
max_memory_usage,=0A=20=20=20=20stats.user_cpu_usage_percent=20as=20=
user_cpu_usage_percent,=0A=20=20=20=20stats.max_user_cpu_usage_percent=20=
as=20max_user_cpu_usage_percent,=0A=20=20=20=20=
stats.system_cpu_usage_percent=20as=20system_cpu_usage_percent,=0A=20=20=20=
=20stats.max_system_cpu_usage_percent=20as=20=
max_system_cpu_usage_percent,=0A=20=20=20=20stats.vm_ip=20as=20vm_ip,=0A=20=
=20=20=20stats.currently_running_on_host=20as=20=
currently_running_on_host,=0A=20=20=20=20stats.current_user_id=20as=20=
current_user_id,=0A=20=20=20=20stats.disks_usage=20as=20disks_usage,=0A=20=
=20=20=20stats.current_host_configuration_version=20as=20=
current_host_configuration_version,=0A=20=20=20=20=
stats.memory_buffered_kb=20as=20memory_buffered_kb,=0A=20=20=20=20=
stats.memory_cached_kb=20as=20memory_cached_kb,=0A=20=20=20=20=
stats.max_memory_buffered_kb=20as=20max_memory_buffered_kb,=0A=20=20=20=20=
stats.max_memory_cached_kb=20as=20max_memory_cached_kb,=0A=20=20=20=20=
device_conf.device_id=20as=20device_id,=0A=20=20=20=20device_conf.type=20=
as=20device_type,=0A=20=20=20=20device_conf.address=20as=20address,=0A=20=
=20=20=20device_conf.is_managed=20as=20is_managed,=0A=20=20=20=20=
device_conf.is_plugged=20as=20is_plugged,=0A=20=20=20=20=
device_conf.is_readonly=20as=20is_readonly,=0A=20=20=20=20=
device_conf.create_date=20as=20device_create_date,=0A=20=20=20=20=
device_conf.update_date=20as=20device_update_date,=0A=20=20=20=20=
device_conf.delete_date=20as=20device_delete_date,=0A=20=20=20=20=
nic_conf.vm_interface_id=20as=20vm_interface_id,=0A=20=20=20=20=
nic_conf.vm_interface_name=20as=20vm_interface_name,=0A=20=20=20=20=
nic_conf.vm_interface_type=20as=20vm_interface_type,=0A=20=20=20=20=
nic_conf.vm_interface_speed_bps=20as=20vm_interface_speed_bps,=0A=20=20=20=
=20nic_conf.mac_address=20as=20mac_address,=0A=20=20=20=20=
nic_conf.logical_network_name=20as=20logical_network_name,=0A=20=20=20=20=
nic_conf.create_date=20as=20vm_interface_create_date,=0A=20=20=20=20=
nic_conf.update_date=20as=20vm_interface_update_date,=0A=20=20=20=20=
nic_conf.delete_date=20as=20vm_interface_delete_date,=0A=20=20=20=20=
nic_stats.receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=
nic_stats.max_receive_rate_percent=20as=20max_receive_rate_percent,=0A=20=
=20=20=20nic_stats.transmit_rate_percent=20as=20transmit_rate_percent,=0A=
=20=20=20=20nic_stats.max_transmit_rate_percent=20as=20=
max_transmit_rate_percent,=0A=20=20=20=20nic_stats.received_total_byte=20=
as=20received_total_byte,=0A=20=20=20=20nic_stats.transmitted_total_byte=20=
as=20transmitted_total_byte,=0A=20=20=20=20disk_conf.vm_disk_id=20as=20=
vm_disk_id,=0A=20=20=20=20disk_conf.vm_disk_name=20as=20vm_disk_name,=0A=20=
=20=20=20disk_conf.vm_disk_description=20as=20vm_disk_description,=0A=20=20=
=20=20disk_conf.image_id=20as=20image_id,=0A=20=20=20=20=
disk_conf.storage_domain_id=20as=20storage_domain_id,=0A=20=20=20=20=
disk_conf.vm_disk_size_mb=20as=20vm_disk_size_mb,=0A=20=20=20=20=
disk_conf.vm_disk_type=20as=20vm_disk_type,=0A=20=20=20=20=
disk_conf.vm_disk_format=20as=20vm_disk_format,=0A=20=20=20=20=
disk_conf.is_shared=20as=20is_shared,=0A=20=20=20=20=
disk_conf.create_date=20as=20vm_disk_create_date,=0A=20=20=20=20=
disk_conf.update_date=20as=20vm_disk_update_date,=0A=20=20=20=20=
disk_conf.delete_date=20as=20vm_disk_delete_date,=0A=20=20=20=20=
disk_stats.vm_disk_status=20as=20vm_disk_status,=0A=20=20=20=20=
cast(disk_stats.minutes_in_status=20*=2060=20as=20integer)=20as=20=
vm_disk_seconds_in_status,=0A=20=20=20=20disk_stats.minutes_in_status=20=
as=20vm_disk_minutes_in_status,=0A=20=20=20=20=
disk_stats.vm_disk_actual_size_mb=20as=20vm_disk_actual_size_mb,=0A=20=20=
=20=20disk_stats.read_rate_bytes_per_second=20as=20=
read_rate_bytes_per_second,=0A=20=20=20=20=
disk_stats.max_read_rate_bytes_per_second=20as=20=
max_read_rate_bytes_per_second,=0A=20=20=20=20=
disk_stats.read_latency_seconds=20as=20read_latency_seconds,=0A=20=20=20=20=
disk_stats.max_read_latency_seconds=20as=20max_read_latency_seconds,=0A=20=
=20=20=20disk_stats.write_rate_bytes_per_second=20as=20=
write_rate_bytes_per_second,=0A=20=20=20=20=
disk_stats.max_write_rate_bytes_per_second=20as=20=
max_write_rate_bytes_per_second,=0A=20=20=20=20=
disk_stats.write_latency_seconds=20as=20write_latency_seconds,=0A=20=20=20=
=20disk_stats.max_write_latency_seconds=20as=20=
max_write_latency_seconds,=0A=20=20=20=20=
disk_stats.flush_latency_seconds=20as=20flush_latency_seconds,=0A=20=20=20=
=20disk_stats.max_flush_latency_seconds=20as=20max_flush_latency_seconds=0A=
FROM=20v4_0_configuration_history_vms=20AS=20conf=0A=20=20=20=20LEFT=20=
OUTER=20JOIN=20v4_0_statistics_vms_resources_usage_hourly=20AS=20stats=0A=
=20=20=20=20=20=20=20=20ON=20(conf.history_id=20=3D=20=
stats.vm_configuration_version)=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=20=
v4_0_configuration_history_vms_devices=20device_conf=0A=20=20=20=20=20=20=
=20=20ON=20(conf.history_id=20=3D=20=
device_conf.vm_configuration_version)=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_configuration_history_vms_disks=20disk_conf=0A=20=20=20=20=20=20=20=20=
ON=20(device_conf.device_configuration_version=20=3D=20=
disk_conf.history_id)=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_configuration_history_vms_interfaces=20AS=20nic_conf=0A=20=20=20=20=20=
=20=20=20ON=20(device_conf.device_configuration_version=20=3D=20=
nic_conf.history_id=20=20AND=0A=20=20=20=20=20=20=20=20=20=20=20=20=
conf.history_id=20=3D=20nic_conf.vm_configuration_version)=0A=20=20=20=20=
LEFT=20OUTER=20JOIN=20=
v4_0_statistics_vms_interfaces_resources_usage_hourly=20AS=20nic_stats=0A=
=20=20=20=20=20=20=20=20ON=20(nic_conf.history_id=20=3D=20=
nic_stats.vm_interface_configuration_version=20AND=0A=20=20=20=20=20=20=20=
=20=20=20=20=20stats.history_datetime=20=3D=20=
nic_stats.history_datetime)=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_statistics_vms_disks_resources_usage_hourly=20disk_stats=0A=20=20=20=
=20=20=20=20=20ON=20(disk_conf.history_id=20=3D=20=
disk_stats.vm_disk_configuration_version=20AND=0A=20=20=20=20=20=20=20=20=
=20=20=20=20stats.history_datetime=20=3D=20disk_stats.history_datetime);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_fully_joined_statistics_vms_resources_usage_daily=0A=20AS=0A=20=
SELECT=0A=20=20=20=20conf.vm_id=20as=20vm_id,=0A=20=20=20=20conf.vm_name=20=
as=20vm_name,=0A=20=20=20=20conf.vm_description=20as=20vm_description,=0A=
=20=20=20=20conf.vm_type=20as=20vm_type,=0A=20=20=20=20conf.cluster_id=20=
as=20cluster_id,=0A=20=20=20=20conf.template_id=20as=20template_id,=0A=20=
=20=20=20conf.template_name=20as=20template_name,=0A=20=20=20=20=
conf.cpu_per_socket=20as=20cpu_per_socket,=0A=20=20=20=20=
conf.number_of_sockets=20as=20number_of_sockets,=0A=20=20=20=20=
conf.memory_size_mb=20as=20memory_size_mb,=0A=20=20=20=20=
conf.operating_system=20as=20operating_system,=0A=20=20=20=20=
conf.default_host=20as=20default_host,=0A=20=20=20=20=
conf.high_availability=20as=20high_availability,=0A=20=20=20=20=
conf.initialized=20as=20initialized,=0A=20=20=20=20conf.stateless=20as=20=
stateless,=0A=20=20=20=20conf.fail_back=20as=20fail_back,=0A=20=20=20=20=
conf.usb_policy=20as=20usb_policy,=0A=20=20=20=20conf.time_zone=20as=20=
time_zone,=0A=20=20=20=20conf.vm_pool_id=20as=20vm_pool_id,=0A=20=20=20=20=
conf.vm_pool_name=20as=20vm_pool_name,=0A=20=20=20=20=
conf.created_by_user_id=20as=20created_by_user_id,=0A=20=20=20=20=
conf.cluster_configuration_version=20as=20cluster_configuration_version,=0A=
=20=20=20=20conf.default_host_configuration_version=20as=20=
default_host_configuration_version,=0A=20=20=20=20conf.create_date=20as=20=
vm_create_date,=0A=20=20=20=20conf.update_date=20as=20vm_update_date,=0A=20=
=20=20=20conf.delete_date=20as=20vm_delete_date,=0A=20=20=20=20=
stats.history_datetime=20as=20history_datetime,=0A=20=20=20=20=
stats.vm_status=20as=20vm_status,=0A=20=20=20=20=
cast(stats.minutes_in_status=20*=2060=20as=20integer)=20as=20=
vm_seconds_in_status,=0A=20=20=20=20stats.minutes_in_status=20as=20=
vm_minutes_in_status,=0A=20=20=20=20stats.cpu_usage_percent=20as=20=
cpu_usage_percent,=0A=20=20=20=20stats.max_cpu_usage=20as=20=
max_cpu_usage,=0A=20=20=20=20stats.memory_usage_percent=20as=20=
memory_usage_percent,=0A=20=20=20=20stats.max_memory_usage=20as=20=
max_memory_usage,=0A=20=20=20=20stats.user_cpu_usage_percent=20as=20=
user_cpu_usage_percent,=0A=20=20=20=20stats.max_user_cpu_usage_percent=20=
as=20max_user_cpu_usage_percent,=0A=20=20=20=20=
stats.system_cpu_usage_percent=20as=20system_cpu_usage_percent,=0A=20=20=20=
=20stats.max_system_cpu_usage_percent=20as=20=
max_system_cpu_usage_percent,=0A=20=20=20=20stats.vm_ip=20as=20vm_ip,=0A=20=
=20=20=20stats.currently_running_on_host=20as=20=
currently_running_on_host,=0A=20=20=20=20stats.current_user_id=20as=20=
current_user_id,=0A=20=20=20=20stats.disks_usage=20as=20disks_usage,=0A=20=
=20=20=20stats.current_host_configuration_version=20as=20=
current_host_configuration_version,=0A=20=20=20=20=
stats.memory_buffered_kb=20as=20memory_buffered_kb,=0A=20=20=20=20=
stats.memory_cached_kb=20as=20memory_cached_kb,=0A=20=20=20=20=
stats.max_memory_buffered_kb=20as=20max_memory_buffered_kb,=0A=20=20=20=20=
stats.max_memory_cached_kb=20as=20max_memory_cached_kb,=0A=20=20=20=20=
device_conf.device_id=20as=20device_id,=0A=20=20=20=20device_conf.type=20=
as=20device_type,=0A=20=20=20=20device_conf.address=20as=20address,=0A=20=
=20=20=20device_conf.is_managed=20as=20is_managed,=0A=20=20=20=20=
device_conf.is_plugged=20as=20is_plugged,=0A=20=20=20=20=
device_conf.is_readonly=20as=20is_readonly,=0A=20=20=20=20=
device_conf.create_date=20as=20device_create_date,=0A=20=20=20=20=
device_conf.update_date=20as=20device_update_date,=0A=20=20=20=20=
device_conf.delete_date=20as=20device_delete_date,=0A=20=20=20=20=
nic_conf.vm_interface_id=20as=20vm_interface_id,=0A=20=20=20=20=
nic_conf.vm_interface_name=20as=20vm_interface_name,=0A=20=20=20=20=
nic_conf.vm_interface_type=20as=20vm_interface_type,=0A=20=20=20=20=
nic_conf.vm_interface_speed_bps=20as=20vm_interface_speed_bps,=0A=20=20=20=
=20nic_conf.mac_address=20as=20mac_address,=0A=20=20=20=20=
nic_conf.logical_network_name=20as=20logical_network_name,=0A=20=20=20=20=
nic_conf.create_date=20as=20vm_interface_create_date,=0A=20=20=20=20=
nic_conf.update_date=20as=20vm_interface_update_date,=0A=20=20=20=20=
nic_conf.delete_date=20as=20vm_interface_delete_date,=0A=20=20=20=20=
nic_stats.receive_rate_percent=20as=20receive_rate_percent,=0A=20=20=20=20=
nic_stats.max_receive_rate_percent=20as=20max_receive_rate_percent,=0A=20=
=20=20=20nic_stats.transmit_rate_percent=20as=20transmit_rate_percent,=0A=
=20=20=20=20nic_stats.max_transmit_rate_percent=20as=20=
max_transmit_rate_percent,=0A=20=20=20=20nic_stats.received_total_byte=20=
as=20received_total_byte,=0A=20=20=20=20nic_stats.transmitted_total_byte=20=
as=20transmitted_total_byte,=0A=20=20=20=20disk_conf.vm_disk_id=20as=20=
vm_disk_id,=0A=20=20=20=20disk_conf.vm_disk_name=20as=20vm_disk_name,=0A=20=
=20=20=20disk_conf.vm_disk_description=20as=20vm_disk_description,=0A=20=20=
=20=20disk_conf.image_id=20as=20image_id,=0A=20=20=20=20=
disk_conf.storage_domain_id=20as=20storage_domain_id,=0A=20=20=20=20=
disk_conf.vm_disk_size_mb=20as=20vm_disk_size_mb,=0A=20=20=20=20=
disk_conf.vm_disk_type=20as=20vm_disk_type,=0A=20=20=20=20=
disk_conf.vm_disk_format=20as=20vm_disk_format,=0A=20=20=20=20=
disk_conf.is_shared=20as=20is_shared,=0A=20=20=20=20=
disk_conf.create_date=20as=20vm_disk_create_date,=0A=20=20=20=20=
disk_conf.update_date=20as=20vm_disk_update_date,=0A=20=20=20=20=
disk_conf.delete_date=20as=20vm_disk_delete_date,=0A=20=20=20=20=
disk_stats.vm_disk_status=20as=20vm_disk_status,=0A=20=20=20=20=
cast(disk_stats.minutes_in_status=20*=2060=20as=20integer)=20as=20=
vm_disk_seconds_in_status,=0A=20=20=20=20disk_stats.minutes_in_status=20=
as=20vm_disk_minutes_in_status,=0A=20=20=20=20=
disk_stats.vm_disk_actual_size_mb=20as=20vm_disk_actual_size_mb,=0A=20=20=
=20=20disk_stats.read_rate_bytes_per_second=20as=20=
read_rate_bytes_per_second,=0A=20=20=20=20=
disk_stats.max_read_rate_bytes_per_second=20as=20=
max_read_rate_bytes_per_second,=0A=20=20=20=20=
disk_stats.read_latency_seconds=20as=20read_latency_seconds,=0A=20=20=20=20=
disk_stats.max_read_latency_seconds=20as=20max_read_latency_seconds,=0A=20=
=20=20=20disk_stats.write_rate_bytes_per_second=20as=20=
write_rate_bytes_per_second,=0A=20=20=20=20=
disk_stats.max_write_rate_bytes_per_second=20as=20=
max_write_rate_bytes_per_second,=0A=20=20=20=20=
disk_stats.write_latency_seconds=20as=20write_latency_seconds,=0A=20=20=20=
=20disk_stats.max_write_latency_seconds=20as=20=
max_write_latency_seconds,=0A=20=20=20=20=
disk_stats.flush_latency_seconds=20as=20flush_latency_seconds,=0A=20=20=20=
=20disk_stats.max_flush_latency_seconds=20as=20max_flush_latency_seconds=0A=
FROM=20v4_0_configuration_history_vms=20AS=20conf=0A=20=20=20=20LEFT=20=
OUTER=20JOIN=20v4_0_statistics_vms_resources_usage_daily=20AS=20stats=0A=20=
=20=20=20=20=20=20=20ON=20(conf.history_id=20=3D=20=
stats.vm_configuration_version)=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=20=
v4_0_configuration_history_vms_devices=20device_conf=0A=20=20=20=20=20=20=
=20=20ON=20(conf.history_id=20=3D=20=
device_conf.vm_configuration_version)=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_configuration_history_vms_disks=20disk_conf=0A=20=20=20=20=20=20=20=20=
ON=20(device_conf.device_configuration_version=20=3D=20=
disk_conf.history_id)=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_configuration_history_vms_interfaces=20AS=20nic_conf=0A=20=20=20=20=20=
=20=20=20ON=20(device_conf.device_configuration_version=20=3D=20=
nic_conf.history_id=20=20AND=0A=20=20=20=20=20=20=20=20=20=20=20=20=
conf.history_id=20=3D=20nic_conf.vm_configuration_version)=0A=20=20=20=20=
LEFT=20OUTER=20JOIN=20=
v4_0_statistics_vms_interfaces_resources_usage_daily=20AS=20nic_stats=0A=20=
=20=20=20=20=20=20=20ON=20(nic_conf.history_id=20=3D=20=
nic_stats.vm_interface_configuration_version=20AND=0A=20=20=20=20=20=20=20=
=20=20=20=20=20stats.history_datetime=20=3D=20=
nic_stats.history_datetime)=0A=20=20=20=20LEFT=20OUTER=20JOIN=20=
v4_0_statistics_vms_disks_resources_usage_daily=20disk_stats=0A=20=20=20=20=
=20=20=20=20ON=20(disk_conf.history_id=20=3D=20=
disk_stats.vm_disk_configuration_version=20AND=0A=20=20=20=20=20=20=20=20=
=20=20=20=20stats.history_datetime=20=3D=20disk_stats.history_datetime);=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20v4_0_users_details_history=0A=
=20AS=0ASELECT=0A=20=20=20=20=20=20user_id,=0A=20=20=20=20=20=20=
first_name,=0A=20=20=20=20=20=20last_name,=0A=20=20=20=20=20=20domain,=0A=
=20=20=20=20=20=20username,=0A=20=20=20=20=20=20department,=0A=20=20=20=20=
=20=20user_role_title,=0A=20=20=20=20=20=20email,=0A=20=20=20=20=20=20=
external_id,=0A=20=20=20=20=20=20active,=0A=20=20=20=20=20=20=
create_date,=0A=20=20=20=20=20=20update_date,=0A=20=20=20=20=20=20=
delete_date=0AFROM=20users_details_history;=0A**************************=0A=
=0ACREATE=20VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20VIEW=20v4_0_latest_users_details=0A=20AS=0ASELECT=0A=20=20=20=20=
=20=20user_id,=0A=20=20=20=20=20=20first_name,=0A=20=20=20=20=20=20=
last_name,=0A=20=20=20=20=20=20domain,=0A=20=20=20=20=20=20username,=0A=20=
=20=20=20=20=20department,=0A=20=20=20=20=20=20user_role_title,=0A=20=20=20=
=20=20=20email,=0A=20=20=20=20=20=20external_id,=0A=20=20=20=20=20=20=
active,=0A=20=20=20=20=20=20create_date,=0A=20=20=20=20=20=20=
update_date,=0A=20=20=20=20=20=20delete_date=0AFROM=20=
users_details_history=0AWHERE=20delete_date=20IS=20NULL;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20v4_0_tags_relations_history=0A=
=20AS=0ASELECT=20=20=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=
=20=20=20entity_id=20as=20entity_id,=0A=20=20=20=20=20=20=20=20=
entity_type=20as=20entity_type,=0A=20=20=20=20=20=20=20=20parent_id=20as=20=
parent_id,=0A=20=20=20=20=20=20=20=20attach_date=20as=20attach_date,=0A=20=
=20=20=20=20=20=20=20detach_date=20as=20detach_date=0AFROM=20=20=20=20=20=
=20=20=20=20tag_relations_history=0AWHERE=20=20=20=20=20=20=20=
entity_type=20in(3,2,5,18,15);=0A**************************=0A=0ACREATE=20=
VIEW=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20VIEW=20=
v4_0_latest_tags_relations=0A=20AS=0ASELECT=20=20=20=20history_id=20as=20=
history_id,=0A=20=20=20=20=20=20=20=20entity_id=20as=20entity_id,=0A=20=20=
=20=20=20=20=20=20entity_type=20as=20entity_type,=0A=20=20=20=20=20=20=20=
=20parent_id=20as=20parent_id,=0A=20=20=20=20=20=20=20=20attach_date=20=
as=20attach_date,=0A=20=20=20=20=20=20=20=20detach_date=20as=20=
detach_date=0AFROM=20=20=20=20=20=20=20=20=20tag_relations_history=0A=
WHERE=20=20=20=20=20=20=20entity_type=20in(3,2,5,18,15)=0A=20=20=20=20=20=
=20=20and=20history_id=20in=20(SELECT=20max(a.history_id)=20FROM=20=
tag_relations_history=20as=20a=20GROUP=20BY=20a.entity_id,=20=
a.parent_id)=0A=20=20=20=20=20=20=20and=20detach_date=20IS=20NULL;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20v4_0_tags_details_history=0A=20=
AS=0ASELECT=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=20=20=
tag_id=20as=20tag_id,=0A=20=20=20=20=20=20=20=20tag_name=20as=20=
tag_name,=0A=20=20=20=20=20=20=20=20tag_description=20as=20=
tag_description,=0A=20=20=20=20=20=20=20=20tag_path=20as=20tag_path,=0A=20=
=20=20=20=20=20=20=20tag_level=20as=20tag_level,=0A=20=20=20=20=20=20=20=20=
create_date=20as=20create_date,=0A=20=20=20=20=20=20=20=20update_date=20=
as=20update_date,=0A=20=20=20=20=20=20=20=20delete_date=20as=20=
delete_date=0AFROM=20=20=20=20=20=20=20=20=20tag_details;=0A=
**************************=0A=0ACREATE=20VIEW=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20VIEW=20v4_0_latest_tags_details=0A=20=
AS=0ASELECT=20=20history_id=20as=20history_id,=0A=20=20=20=20=20=20=20=20=
tag_id=20as=20tag_id,=0A=20=20=20=20=20=20=20=20tag_name=20as=20=
tag_name,=0A=20=20=20=20=20=20=20=20tag_description=20as=20=
tag_description,=0A=20=20=20=20=20=20=20=20tag_path=20as=20tag_path,=0A=20=
=20=20=20=20=20=20=20tag_level=20as=20tag_level,=0A=20=20=20=20=20=20=20=20=
create_date=20as=20create_date,=0A=20=20=20=20=20=20=20=20update_date=20=
as=20update_date,=0A=20=20=20=20=20=20=20=20delete_date=20as=20=
delete_date=0AFROM=20=20=20=20=20=20=20=20=20tag_details=0AWHERE=20=
history_id=20in=20(SELECT=20max(a.history_id)=20FROM=20tag_details=20as=20=
a=20GROUP=20BY=20a.tag_id)=0A=20=20=20=20=20=20and=20delete_date=20IS=20=
NULL;=0A**************************=0A=0ACREATE=20VIEW=0A*********=20=
QUERY=20**********=0A/**************************************=0A=20=20=20=20=
INTERNAL=20VIEWS=20FOR=20REPORTS=0A=
**************************************/=0A**************************=0A=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_add_column(v_table=20varchar(128),=20v_column=20varchar(128),=20=
v_column_def=20text)=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0A=
v_sql=20text;=0A=0Abegin=0A=09if=20(not=20exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column))=20then=0A=09=20=20=20=20begin=0A=09=09=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ADD=20COLUMN=20=
'=20||=20v_column=20||=20'=20'=20||=20v_column_def;=0A=09=09EXECUTE=20=
v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20fn_db_drop_column(v_table=20varchar(128),=20=
v_column=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0A=
v_sql=20text;=0Abegin=0A=20=20=20=20=20=20=20=20if=20(exists=20(select=20=
1=20from=20information_schema.columns=20where=20table_name=20ilike=20=
v_table=20and=20column_name=20ilike=20v_column))=20then=0A=20=20=20=20=20=
=20=20=20=20=20=20=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20DROP=20=
COLUMN=20'=20||=20v_column;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20=20=20=20=20end=20if;=0Aend;$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_change_column_type(v_table=20varchar(128),=20v_column=20=
varchar(128),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_type=20varchar(128),=20v_new_type=20=
varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20=
text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column=20and=20(udt_name=20ilike=20v_type=20or=20=
data_type=20ilike=20v_type)))=20then=0A=09=20=20=20=20begin=0A=09=09=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ALTER=20=
COLUMN=20'=20||=20v_column=20||=20'=20TYPE=20'=20||=20v_new_type;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_rename_column(v_table=20varchar(128),=20v_column=20varchar(128),=20=
v_new_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0A=
v_sql=20text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column))=20then=0A=09=20=20=20=20begin=0A=09=09=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20RENAME=20=
COLUMN=20'=20||=20v_column=20||=20'=20TO=20'=20||=20v_new_name;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_add_config_value(v_option_name=20varchar(100),=20v_option_value=20=
varchar(4000),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20v_version=20varchar(40))=0Areturns=20void=0AAS=20=
$procedure$=0Abegin=0A=20=20=20=20if=20(not=20exists=20(select=201=20=
from=20vdc_options=20where=20option_name=20ilike=20v_option_name=20and=20=
version=20=3D=20v_version))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=
=20=20=20=20=20=20=20=20=20=20insert=20into=20vdc_options=20=
(option_name,=20option_value,=20version)=20values=20(v_option_name,=20=
v_option_value,=20v_version);=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_value_all_versions(v_option_name=20varchar(100))=0A=
returns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20(exists=20=
(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=20=20=20=
=20=20=20=20=20=20delete=20from=20vdc_options=20where=20option_name=20=
ilike=20v_option_name;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_value(v_option_name=20varchar(100),=20v_version=20=
text)=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name=20and=20version=20in=20(select=20ID=20from=20=
fnSplitter(v_version))))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=
=20=20=20=20=20=20=20=20=20delete=20from=20vdc_options=20where=20=
option_name=20ilike=20v_option_name=20and=20version=20in=20(select=20ID=20=
from=20fnSplitter(v_version));=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_for_version(v_version=20text)=0Areturns=20void=0AAS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20delete=20from=20vdc_options=20where=20=
version=20in=20(select=20ID=20from=20fnSplitter(v_version));=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20FUNCTION=20fn_db_update_config_value(v_option_name=20=
varchar(100),=20v_option_value=20varchar(4000),=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_version=20=
varchar(40))=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20=
if=20(exists=20(select=201=20from=20vdc_options=20where=20option_name=20=
ilike=20v_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=
=20=20=20=20=20=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20update=20=20=
vdc_options=20set=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=
=20=20=20=20=20=20=20where=20option_name=20ilike=20v_option_name=20and=20=
version=20=3D=20v_version;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_update_default_config_value(v_option_name=20=
varchar(100),v_default_option_value=20varchar(4000),v_option_value=20=
varchar(4000),v_version=20varchar(40),v_ignore_default_value_case=20=
boolean)=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=20=20=20=
=20=20=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20if=20=
(v_ignore_default_value_case)=0A=20=20=20=20=20=20=20=20=20=20=20=20then=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20update=20=20vdc_options=20=
set=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20where=20option_name=20ilike=20v_option_name=20and=20=
option_value=20ilike=20v_default_option_value=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20update=20=20vdc_options=20set=20option_value=20=
=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
where=20option_name=20ilike=20v_option_name=20and=20option_value=20=3D=20=
v_default_option_value=20and=20version=20=3D=20v_version;=0A=20=20=20=20=20=
=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_rename_config_key(v_old_option_name=20=
varchar(100),v_new_option_name=20varchar(100),v_version=20varchar(40))=0A=
returns=20void=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20=
v_current_option_value=20varchar(4000);=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_old_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=20=20=
=20=20=20v_current_option_value:=3Doption_value=20from=20vdc_options=20=
where=20option_name=20ilike=20v_old_option_name=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20update=20vdc_options=20set=20=
option_name=20=3D=20v_new_option_name,=20option_value=20=3D=20=
v_current_option_value=0A=20=20=20=20=20=20=20=20=20=20=20where=20=20=
option_name=20ilike=20v_old_option_name=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0Acreate=20or=20replace=20function=20=
fn_db_create_constraint=20(=0A=20=20=20=20v_table=20varchar(128),=20=
v_constraint=20varchar(128),=20v_constraint_sql=20text)=0Areturns=20void=0A=
AS=20$procedure$=0Abegin=0A=20=20=20=20if=20=20NOT=20EXISTS=20(SELECT=20=
1=20from=20pg_constraint=20where=20conname=20ilike=20v_constraint)=20=
then=0A=20=20=20=20=20=20=20=20execute=20'ALTER=20TABLE=20'=20||=20=
v_table=20||=20=20'=20ADD=20CONSTRAINT=20'=20||=20v_constraint=20||=20'=20=
'=20||=20v_constraint_sql;=0A=20=20=20=20end=20if;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0Acreate=20or=20replace=20function=20=
fn_db_drop_constraint=20(=0A=20=20=20=20v_table=20varchar(128),=20=
v_constraint=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=
=20=20=20=20if=20=20EXISTS=20(SELECT=201=20from=20pg_constraint=20where=20=
conname=20ilike=20v_constraint)=20then=0A=20=20=20=20=20=20=20=20execute=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20=20'=20DROP=20CONSTRAINT=20'=20=
||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20attach_user_to_su_role(v_permission_id=20uuid)=0A=20=
=20RETURNS=20void=20AS=0A$procedure$=0A=20=20=20DECLARE=0A=20=20=20=
v_user_entry=20VARCHAR(255);=0A=20=20=20v_user_id=20=20UUID;=0A=20=20=20=
v_name=20=20VARCHAR(255);=0A=20=20=20v_domain=20=20VARCHAR(255);=0A=20=20=
=20v_user_name=20=20VARCHAR(255);=0A=0A=20=20=20v_document=20=20=
VARCHAR(64);=0A=20=20=20v_index=20=20INTEGER;=0ABEGIN=0A=0A=20=20=20=
select=20=20=20option_value=20INTO=20v_user_entry=20from=20vdc_options=20=
where=20option_name=20=3D=20'AdUserId';=0A=20=20=20select=20=20=20=
option_value=20INTO=20v_name=20from=20vdc_options=20where=20option_name=20=
=3D=20'AdUserName';=0A=20=20=20select=20=20=20option_value=20INTO=20=
v_domain=20from=20vdc_options=20where=20option_name=20=3D=20=
'DomainName';=0A=0A=20=20=20v_index=20:=3D=20POSITION(':'=20IN=20=
v_user_entry);=0A=20=20=20if=20(=20v_index=20<>=200=20)=20then=0A=20=20=20=
=20=20=20v_user_entry=20:=3D=20substring(=20v_user_entry=20from=20=
v_index=20+=201=20);=0A=20=20=20=20=20=20v_user_id=20:=3D=20CAST(=20=
v_user_entry=20AS=20uuid=20);=0A=20=20=20end=20if;=0A=0A=20=20=20v_index=20=
:=3D=20POSITION(':'=20IN=20v_name);=0A=20=20=20if=20(=20v_index=20<>=200=20=
)=20then=0A=20=20=20=20=20=20v_name=20:=3D=20substring(=20v_name=20from=20=
v_index=20+=201=20);=0A=20=20=20end=20if;=0A=0A--=20find=20if=20name=20=
already=20includes=20domain=20(@)=0A=20=20=20v_index=20:=3D=20=
POSITION('@'=20IN=20v_name);=0A=0A=20=20=20if=20(v_index=20=3D=200)=20=
then=0A=20=20=20=20=20=20v_user_name=20:=3D=20coalesce(v_name,'')=20||=20=
'@'=20||=20coalesce(v_domain,'');=0A=20=20=20else=0A=20=20=20=20=20=20=
v_user_name=20:=3D=20v_name;=0A=20=20=20end=20if;=0A=0A=0Ainsert=20into=20=
users(user_id,name,domain,username,groups,status)=20select=20v_user_id,=20=
v_name,=20v_domain,=20v_user_name,'',1=20where=20not=20exists=20(select=20=
user_id,name,domain,username,groups,status=20from=20users=20where=20=
user_id=20=3D=20v_user_id=20and=20name=20=3D=20v_name=20and=20domain=20=3D=
=20v_domain=20and=20username=20=3D=20v_user_name=20and=20groups=20=3D=20=
''=20and=20status=20=3D=201);=0A=0Ainsert=20into=20=
permissions(id,role_id,ad_element_id,object_id,object_type_id)=20select=20=
v_permission_id,=20'00000000-0000-0000-0000-000000000001',=20v_user_id,=20=
getGlobalIds('system'),=201=20where=20not=20exists(select=20=
role_id,ad_element_id,object_id,object_type_id=20from=20permissions=20=
where=20role_id=20=3D=20'00000000-0000-0000-0000-000000000001'=20and=20=
ad_element_id=20=3D=20v_user_id=20and=20object_id=3D=20=
getGlobalIds('system')=20and=20object_type_id=20=3D=201);=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20CheckDBConnection()=20RETURNS=20SETOF=20integer=20=
IMMUTABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=20SELECT=201;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=20from=20=
pg_proc=20inner=20join=20pg_namespace=20ns=20on=20=
(pg_proc.pronamespace=3Dns.oid)=20where=20ns.nspname=20=3D=20'public'=20=
and=20proname=20not=20ilike=20'uuid%'=20order=20by=20proname;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_views_syntax()=20RETURNS=20SETOF=20=
text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20=
select=20'DROP=20VIEW=20if=20exists=20'=20||=20table_name=20||=20'=20=
CASCADE;'=20from=20information_schema.views=20where=20table_schema=20=3D=20=
'public'=20order=20by=20table_name;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_tables_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20TABLE=20=
if=20exists=20'=20||=20table_name=20||=20'=20CASCADE;'=20from=20=
information_schema.tables=20where=20table_schema=20=3D=20'public'=20and=20=
table_type=20=3D=20'BASE=20TABLE'=20order=20by=20table_name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_seq_syntax()=20RETURNS=20SETOF=20=
text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20=
select=20'DROP=20SEQUENCE=20if=20exists=20'=20||=20sequence_name=20||=20=
'=20CASCADE;'=20from=20information_schema.sequences=20=20where=20=
sequence_schema=20=3D=20'public'=20order=20by=20sequence_name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_user_types_syntax()=20RETURNS=20=
SETOF=20text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20=
QUERY=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20FROM=20pg_namespace=20n,=20pg_class=20c,=20pg_type=20t=0A=20=20=20=
WHERE=20n.oid=20=3D=20c.relnamespace=20and=20t.typrelid=20=3D=20c.oid=20=
and=20c.relkind=20=3D=20'c'::"char"=20and=0A=20=20=20n.nspname=20=3D=20=
'public'=0A=20=20=20ORDER=20BY=20=20=
c.relname::information_schema.sql_identifier;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_get_column_size(=20v_table=20varchar(64),=20v_column=20varchar(64))=20=
returns=20integer=20STABLE=0A=20=20=20AS=20$procedure$=0A=20=20=20=
declare=0A=20=20=20retvalue=20=20integer;=0ABEGIN=0A=20=20=20retvalue=20=
:=3D=20character_maximum_length=20from=20information_schema.columns=0A=20=
=20=20=20where=0A=20=20=20=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column=20and=0A=20=20=20=20table_schema=20=3D=20=
'public'=20and=20udt_name=20in=20('char','varchar');=0A=20=20=20return=20=
retvalue;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
attach_user_to_su_role(v_permission_id=20uuid,=20v_user_id=20=
VARCHAR(255),=20v_name=20VARCHAR(255),=20v_domain=20VARCHAR(255))=0A=20=20=
RETURNS=20void=20AS=0A$BODY$=0A=20=20=20DECLARE=0A=20=20=20v_user_name=20=
VARCHAR(255);=0A=20=20=20v_document=20=20VARCHAR(64);=0A=20=20=20v_index=20=
=20INTEGER;=0A=20=20=20input_uuid=20uuid;=0ABEGIN=0A=20=20=20input_uuid=20=
=3D=20CAST(=20v_user_id=20AS=20uuid=20);=0A--=20find=20if=20name=20=
already=20includes=20domain=20(@)=0A=20=20=20v_index=20:=3D=20=
POSITION('@'=20IN=20v_name);=0A=0A=20=20=20if=20(v_index=20=3D=200)=20=
then=0A=20=20=20=20=20=20v_user_name=20:=3D=20coalesce(v_name,'')=20||=20=
'@'=20||=20coalesce(v_domain,'');=0A=20=20=20else=0A=20=20=20=20=20=20=
v_user_name=20:=3D=20v_name;=0A=20=20=20end=20if;=0A=0A=0Ainsert=20into=20=
users(user_id,name,domain,username,groups,status)=20select=20input_uuid,=20=
v_name,=20v_domain,=20v_user_name,'',1=20where=20not=20exists=20(select=20=
user_id,name,domain,username,groups,status=20from=20users=20where=20=
user_id=20=3D=20input_uuid);=0A=0Ainsert=20into=20=
permissions(id,role_id,ad_element_id,object_id,object_type_id)=20select=20=
v_permission_id,=20'00000000-0000-0000-0000-000000000001',=20input_uuid,=20=
getGlobalIds('system'),=201=20where=20not=20exists(select=20=
role_id,ad_element_id,object_id,object_type_id=20from=20permissions=20=
where=20role_id=20=3D=20'00000000-0000-0000-0000-000000000001'=20and=20=
ad_element_id=20=3D=20input_uuid=20and=20object_id=3D=20=
getGlobalIds('system')=20and=20object_type_id=20=3D=201);=0AEND;=20=
$BODY$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20=
FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
FUNCTION=20fn_db_add_action_group_to_role(v_role_id=20UUID,=20=
v_action_group_id=20INTEGER)=0ARETURNS=20VOID=0AAS=20$procedure$=0ABEGIN=0A=
=20=20=20=20=20=20=20INSERT=20INTO=20=
roles_groups(role_id,action_group_id)=0A=20=20=20=20=20=20=20SELECT=20=
v_role_id,=20v_action_group_id=0A=20=20=20=20=20=20=20WHERE=20NOT=20=
EXISTS=20(SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20FROM=20roles_groups=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20role_id=20=3D=20=
v_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20action_group_id=20=3D=20v_action_group_id);=0ARETURN;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_split_config_value(v_option_name=20character=20=
varying,=20v_old_option_value=20character=20varying,=20=
v_new_option_value=20character=20varying,=20v_update_from_version=20=
character=20varying)=0A=20=20RETURNS=20void=20AS=0A$BODY$=0Adeclare=0A=
v_old_value=20varchar(4000);=0Av_cur=20cursor=20for=20select=20distinct=20=
version=20from=20vdc_options=20where=20version=20<>=20'general'=20order=20=
by=20version;=0Av_version=20varchar(40);=0Av_index=20integer;=0Av_count=20=
integer;=0Av_total_count=20integer;=0Av_version_count=20integer;=0Abegin=0A=
=20=20=20=20v_total_count=20:=3D=20count(version)=20from=20vdc_options=20=
where=20option_name=20=3D=20v_option_name;=0A=20=20=20=20v_old_value=20=
:=3D=20option_value=20from=20vdc_options=20where=20option_name=20=3D=20=
v_option_name=20and=20version=20=3D=20'general';=0A=20=20=20=20=
v_version_count=20:=3D=20count(distinct=20version)=20from=20vdc_options=20=
where=20version=20<>=20'general';=0A=20=20=20=20if=20(v_total_count=20<=3D=
=20v_version_count)=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=20=
=20=20=20=20=20=20=20=20if=20(v_old_value=20IS=20NULL)=20then=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20v_old_value=20:=3D=20=
v_old_option_value;=0A=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=20=
=20=20=20=20=20=20=20=20=20=20=20v_count=20:=3D=20count(distinct=20=
version)=20from=20vdc_options=20where=20version=20<>=20'general';=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_index=20:=3D=201;=0A=20=20=20=20=20=20=20=
=20open=20v_cur;=0A=20=20=20=20=20=20=20=20loop=0A=20=20=20=20=20=20=20=20=
=20=20=20=20fetch=20v_cur=20into=20v_version;=0A=20=20=20=20=20=20=20=20=20=
=20=20=20exit=20when=20not=20found;=0A=20=20=20=20=20=20=20=20=20=20=20=20=
--=20We=20shouldn't=20update=20if=20already=20exists=0A=20=20=20=20=20=20=
=20=20=20=20=20=20if=20(not=20exists=20(select=201=20from=20vdc_options=20=
where=20option_name=20=3D=20v_option_name=20and=20version=20=3D=20=
v_version))=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=20=
Might=20not=20work=20well=20for=20versions=20such=20as=203.10,=20but=20=
we=20currently=20don't=20have=20any=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20if=20(v_version=20>=3D=20v_update_from_version)=20then=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20insert=20into=20=
vdc_options=20(option_name,=20option_value,=20version)=20values=20=
(v_option_name,=20v_new_option_value,=20v_version);=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20insert=20into=20vdc_options=20(option_name,=20=
option_value,=20version)=20values=20(v_option_name,=20v_old_value,=20=
v_version);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=
=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_index=20:=3D=20v_index=20+1;=0A=20=20=20=20=20=20=20=20end=20=
loop;=0A=20=20=20=20=20=20=20=20close=20v_cur;=0A=20=20=20=20=20=20=20=20=
delete=20from=20vdc_options=20where=20option_name=20=3D=20v_option_name=20=
and=20version=20=3D=20'general';=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_grant_action_group_to_all_roles_filter(v_action_group_id=20=
integer,=20uuid[])=0A=20=20RETURNS=20void=20AS=0A$BODY$=0Adeclare=0A=
v_role_id_to_filter=20alias=20for=20$2;=0Abegin=0A=20=20=20=20insert=20=
into=20roles_groups=20(role_id,=20action_group_id)=0A=20=20=20=20select=20=
distinct=20role_id,=20v_action_group_id=0A=20=20=20=20from=20=
roles_groups=20rg=0A=20=20=20=20where=20not=20ARRAY=20[role_id]=20<@=20=
v_role_id_to_filter=20and=20not=20exists=20(select=201=20from=20=
roles_groups=20where=20role_id=20=3D=20rg.role_id=20and=20=
action_group_id=20=3D=20v_action_group_id);=0AEND;=20$BODY$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_mask_object(v_object=20regclass)=20RETURNS=20setof=20record=20as=0A=
$BODY$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=20=20=20=20v_table=20=
record;=0A=20=20=20=20v_table_name=20TEXT;=0A=20=20=20=20temprec=20=
record;=0ABEGIN=0A=20=20=20=20--=20get=20full=20table/view=20name=20from=20=
v_object=20(i.e=20<namespace>.<name>)=0A=20=20=20=20select=20c.relname,=20=
n.nspname=20INTO=20v_table=0A=20=20=20=20=20=20=20=20FROM=20pg_class=20c=20=
join=20pg_namespace=20n=20on=20c.relnamespace=20=3D=20n.oid=20WHERE=20=
c.oid=20=3D=20v_object;=0A=20=20=20=20--=20try=20to=20get=20filtered=20=
query=20syntax=20from=20previous=20execution=0A=20=20=20=20if=20exists=20=
(select=201=20from=20object_column_white_list_sql=20where=20object_name=20=
=3D=20v_table.relname)=20then=0A=09select=20sql=20into=20v_sql=20from=20=
object_column_white_list_sql=20where=20object_name=20=3D=20=
v_table.relname;=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
v_table_name=20:=3D=20quote_ident(=20v_table.nspname=20)=20||=20'.'=20||=20=
quote_ident(=20v_table.relname=20);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20=20=20=20=20for=20temprec=20in=20select=20a.attname,=20=
t.typname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_attribute=20a=20join=20pg_type=20t=20on=20a.atttypid=20=3D=
=20t.oid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20a.attrelid=20=3D=20v_object=20AND=20a.attnum=20>=200=20AND=20=
NOT=20a.attisdropped=20ORDER=20BY=20a.attnum=0A=20=20=20=20=20=20=20=20=
loop=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20coalesce(=20=
v_sql=20||=20',=20',=20'SELECT=20'=20);=0A=20=20=20=20=20=20=20=20=20=20=20=
=20if=20exists(select=201=20from=20object_column_white_list=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20where=20object_name=20=3D=20=
v_table.relname=20and=20column_name=20=3D=20temprec.attname)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20=
quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20=
||=20'NULL::'=20||=20quote_ident(=20temprec.typname=20)=20||=20'=20as=20=
'=20||=20quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=
=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20END=20LOOP;=0A=20=20=20=20=20=
=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=
=20=20=20=20=20=20=20=20v_sql=20:=3D=20'SELECT=20x::'=20||=20=
v_table_name=20||=20'=20as=20rec=20FROM=20('=20||=20v_sql=20||=20')=20as=20=
x';=0A=20=20=20=20=20=20=20=20--=20save=20generated=20query=20for=20=
further=20use=0A=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list_sql(object_name,sql)=20values=20=
(v_table.relname,=20v_sql);=0A=20=20=20=20end=20if;=0A=20=20=20=20RETURN=20=
QUERY=20EXECUTE=20v_sql;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_add_column_to_object_white_list(v_object_name=20varchar(128),=20=
v_column_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0A=
begin=0A=20=20=20=20if=20(not=20exists=20(select=201=20from=20=
object_column_white_list=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20where=20object_name=20=3D=20v_object_name=20and=20=
column_name=20=3D=20v_column_name))=20then=0A=20=20=20=20=20=20=20=20=
begin=0A=20=20=20=20=20=20=20=20=20=20=20=20--=20verify=20that=20there=20=
is=20such=20object=20in=20db=0A=20=20=20=20=20=20=20=20=20=20=20=20if=20=
exists=20(select=201=20from=20information_schema.columns=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20where=20table_name=20=
=3D=20v_object_name=20and=20column_name=20=3D=20v_column_name)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list=20(object_name,=20column_name)=20values=20=
(v_object_name,=20v_column_name);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
end=20if;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20FUNCTION=20fn_db_unlock_disk(v_id=20UUID)=0Areturns=20void=0A=
AS=20$procedure$=0Adeclare=0A=20=20=20=20OK=20integer;=0A=20=20=20=20=
LOCKED=20integer;=0Abegin=0A=20=20=20=20OK:=3D1;=0A=20=20=20=20=
LOCKED:=3D2;=0A=20=20=20=20update=20images=20set=20imagestatus=20=3D=20=
OK=20where=20imagestatus=20=3D=20LOCKED=20and=0A=20=20=20=20=
image_group_id=20in=20(select=20device_id=20from=20vm_device=20where=20=
device_id=20=3D=20v_id=20and=20is_plugged);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_unlock_snapshot(v_id=20UUID)=0Areturns=20void=0AAS=20$procedure$=0A=
declare=0A=20=20=20=20OK=20varchar;=0A=20=20=20=20LOCKED=20varchar;=0A=
begin=0A=20=20=20=20OK:=3D'OK';=0A=20=20=20=20LOCKED:=3D'LOCKED';=0A=20=20=
=20=20update=20snapshots=20set=20status=20=3D=20OK=20where=20status=20=3D=20=
LOCKED=20and=20snapshot_id=20=3D=20v_id;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_unlock_entity(v_object_type=20varchar(10),=20v_name=20=
varchar(255),=20v_recursive=20boolean)=0Areturns=20void=0AAS=20=
$procedure$=0Adeclare=0A=20=20=20=20DOWN=20integer;=0A=20=20=20=20OK=20=
integer;=0A=20=20=20=20LOCKED=20integer;=0A=20=20=20=20TEMPLATE_OK=20=
integer;=0A=20=20=20=20TEMPLATE_LOCKED=20integer;=0A=20=20=20=20=
IMAGE_LOCKED=20integer;=0A=20=20=20=20SNAPSHOT_OK=20varchar;=0A=20=20=20=20=
SNAPSHOT_LOCKED=20varchar;=0A=20=20=20=20v_id=20UUID;=0Abegin=0A=20=20=20=
=20DOWN:=3D0;=0A=20=20=20=20OK:=3D1;=0A=20=20=20=20LOCKED:=3D2;=0A=20=20=20=
=20TEMPLATE_OK:=3D0;=0A=20=20=20=20TEMPLATE_LOCKED:=3D1;=0A=20=20=20=20=
IMAGE_LOCKED:=3D15;=0A=20=20=20=20SNAPSHOT_OK:=3D'OK';=0A=20=20=20=20=
SNAPSHOT_LOCKED:=3D'LOCKED';=0A=20=20=20=20v_id=20:=3D=20vm_guid=20from=20=
vm_static=20where=20vm_name=20=3D=20v_name=20and=20entity_type=20ilike=20=
v_object_type;=0A=20=20=20=20--=20set=20VM=20status=20to=20DOWN=0A=20=20=20=
=20if=20(v_object_type=20=3D=20'vm')=20then=0A=20=20=20=20=20=20=20=20=
update=20vm_dynamic=20set=20status=20=3D=20DOWN=20where=20status=20=3D=20=
IMAGE_LOCKED=20and=20vm_guid=20=20=3D=20v_id;=0A=20=20=20=20--=20set=20=
Template=20status=20to=20OK=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
if=20(v_object_type=20=3D=20'template')=20then=0A=20=20=20=20=20=20=20=20=
=20=20=20=20update=20vm_static=20set=20template_status=20=3D=20=
TEMPLATE_OK=20where=20template_status=20=3D=20TEMPLATE_LOCKED=20and=20=
vm_guid=20=20=3D=20v_id;=0A=20=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=
end=20if;=0A=20=20=20=20--unlock=20images=20and=20snapshots=20=20if=20=
recursive=20flag=20is=20set=0A=20=20=20=20if=20(v_recursive)=20then=0A=20=
=20=20=20=20=20=20=20update=20images=20set=20imagestatus=20=3D=20OK=20=
where=20imagestatus=20=3D=20LOCKED=20and=0A=20=20=20=20=20=20=20=20=
image_group_id=20in=20(select=20device_id=20from=20vm_device=20where=20=
vm_id=20=3D=20v_id=20and=20is_plugged);=0A=0A=20=20=20=20=20=20=20=20=
update=20snapshots=20set=20status=20=3D=20SNAPSHOT_OK=20where=20status=20=
ilike=20SNAPSHOT_LOCKED=20and=20vm_id=20=3D=20v_id;=0A=20=20=20=20end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A/*=20Displays=20DC=20id=20,=20DC=20name,=20SPM=20Host=20id=20=
,=20SPM=20Host=20name=20and=20number=20of=20async=20tasks=20awaiting.=0A=0A=
1)=20create=20a=20record=20type=20with=20DC=20name,=20DC=20id,=20SPM=20=
host=20id,=20SPM=20host=20name,=20count=0A=0A2)=20get=20all=20distinct=20=
DC=20ids=20from=20async_tasks=20table=0A=0A3)=20Run=20a=20cursor=20for=20=
each=20result=20in=202)=0A=0A=20=20=20a)=20get=20DC=20name=0A=20=20=20b)=20=
get=20SPM=20Host=20id=20&=20name=20if=20available=0A=20=20=20c)=20get=20=
count=20of=20tasks=0A=0A=20=20=20return=20current=20record=0A=0A4)=20=
return=20set=20of=20generated=20records=0A*/=0ADROP=20TYPE=20IF=20EXISTS=20=
async_tasks_info_rs=20CASCADE;=0A**************************=0A=0ADROP=20=
TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
async_tasks_info_rs=20AS=20(=0A=20=20=20=20dc_id=20UUID,=20dc_name=20=
CHARACTER=20VARYING,=20spm_host_id=20UUID,=20spm_host_name=20CHARACTER=20=
VARYING,=20task_count=20integer);=0A**************************=0A=0A=
CREATE=20TYPE=0A*********=20QUERY=20**********=0Acreate=20or=20replace=20=
FUNCTION=20fn_db_get_async_tasks()=0Areturns=20SETOF=20=
async_tasks_info_rs=20STABLE=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20=
v_record=20async_tasks_info_rs;=0A=0A=20=20=20=20--=20selects=20=
storage_pool_id=20uuid=20found=20in=20async_tasks=0A=20=20=20=20=
v_tasks_cursor=20cursor=20for=20select=20distinct=20storage_pool_id=20=
from=20async_tasks;=0Abegin=0A=0A=20=20=20=20OPEN=20v_tasks_cursor;=0A=20=
=20=20=20FETCH=20v_tasks_cursor=20into=20v_record.dc_id;=0A=20=20=20=20=
WHILE=20FOUND=20LOOP=0A=20=20=20=20=20=20=20=20--=20get=20dc_name=20and=20=
SPM=20Host=20id=0A=20=20=20=20=20=20=20=20v_record.dc_name=20:=3D=20name=20=
from=20storage_pool=20where=20id=20=3D=20v_record.dc_id;=0A=20=20=20=20=20=
=20=20=20v_record.spm_host_id=20:=3D=0A=20=20=20=20=20=20=20=20=20=20=20=20=
spm_vds_id=20from=20storage_pool=20where=20id=20=3D=20v_record.dc_id;=0A=20=
=20=20=20=20=20=20=20--=20get=20Host=20name=20if=20we=20have=20non=20=
NULL=20SPM=20Host=0A=20=20=20=20=20=20=20=20if=20(v_record.spm_host_id=20=
IS=20NOT=20NULL)=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_record.spm_host_name=20:=3D=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20vds_name=20from=20vds_static=20where=20vds_id=20=3D=20=
v_record.spm_host_id;=0A=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_record.spm_host_name:=3D'';=0A=20=20=20=20=20=20=20=20=
end=20if;=0A=20=20=20=20=20=20=20=20--=20get=20tasks=20count=20for=20=
this=20DC=0A=20=20=20=20=20=20=20=20v_record.task_count=20:=3D=20=
count(*)=20from=20async_tasks=0A=20=20=20=20=20=20=20=20=20=20=20=20=
where=20position=20(cast(v_record.dc_id=20as=20varchar)=20in=20=
action_parameters)=20>=200;=0A=20=20=20=20=20=20=20=20--=20return=20the=20=
record=0A=20=20=20=20=20=20=20=20RETURN=20NEXT=20v_record;=0A=20=20=20=20=
=20=20=20=20FETCH=20v_tasks_cursor=20into=20v_record.dc_id;=0A=20=20=20=20=
END=20LOOP;=0A=20=20=20=20CLOSE=20v_tasks_cursor;=0A=20=20=20=20--=20=
return=20full=20set=20of=20generated=20records=0A=20=20=20=20RETURN;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20fn_db_add_column(v_table=20varchar(128),=20v_column=20=
varchar(128),=20v_column_def=20text)=0Areturns=20void=0AAS=20$procedure$=0A=
declare=0Av_sql=20text;=0A=0Abegin=0A=09if=20(not=20exists=20(select=201=20=
from=20information_schema.columns=20where=20table_name=20ilike=20v_table=20=
and=20column_name=20ilike=20v_column))=20then=0A=09=20=20=20=20begin=0A=09=
=09v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ADD=20=
COLUMN=20'=20||=20v_column=20||=20'=20'=20||=20v_column_def;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_drop_column(v_table=20varchar(128),=20v_column=20varchar(128))=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0Abegin=0A=20=
=20=20=20=20=20=20=20if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column))=20then=0A=20=20=20=20=20=20=20=20=20=20=20=
=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20DROP=20COLUMN=20'=20||=20=
v_column;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20EXECUTE=20=
v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=
=20end=20if;=0Aend;$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_change_column_type(v_table=20varchar(128),=20v_column=20=
varchar(128),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_type=20varchar(128),=20v_new_type=20=
varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20=
text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column=20and=20(udt_name=20ilike=20v_type=20or=20=
data_type=20ilike=20v_type)))=20then=0A=09=20=20=20=20begin=0A=09=09=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ALTER=20=
COLUMN=20'=20||=20v_column=20||=20'=20TYPE=20'=20||=20v_new_type;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_rename_column(v_table=20varchar(128),=20v_column=20varchar(128),=20=
v_new_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0A=
v_sql=20text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column))=20then=0A=09=20=20=20=20begin=0A=09=09=
v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20RENAME=20=
COLUMN=20'=20||=20v_column=20||=20'=20TO=20'=20||=20v_new_name;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_add_config_value(v_option_name=20varchar(100),=20v_option_value=20=
varchar(4000),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20v_version=20varchar(40))=0Areturns=20void=0AAS=20=
$procedure$=0Abegin=0A=20=20=20=20if=20(not=20exists=20(select=201=20=
from=20vdc_options=20where=20option_name=20ilike=20v_option_name=20and=20=
version=20=3D=20v_version))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=
=20=20=20=20=20=20=20=20=20=20insert=20into=20vdc_options=20=
(option_name,=20option_value,=20version)=20values=20(v_option_name,=20=
v_option_value,=20v_version);=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_value_all_versions(v_option_name=20varchar(100))=0A=
returns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20(exists=20=
(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=20=20=20=
=20=20=20=20=20=20delete=20from=20vdc_options=20where=20option_name=20=
ilike=20v_option_name;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_value(v_option_name=20varchar(100),=20v_version=20=
text)=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name=20and=20version=20in=20(select=20ID=20from=20=
fnSplitter(v_version))))=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=
=20=20=20=20=20=20=20=20=20delete=20from=20vdc_options=20where=20=
option_name=20ilike=20v_option_name=20and=20version=20in=20(select=20ID=20=
from=20fnSplitter(v_version));=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_delete_config_for_version(v_version=20text)=0Areturns=20void=0AAS=20=
$procedure$=0ABEGIN=0A=20=20=20=20=20delete=20from=20vdc_options=20where=20=
version=20in=20(select=20ID=20from=20fnSplitter(v_version));=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20FUNCTION=20fn_db_update_config_value(v_option_name=20=
varchar(100),=20v_option_value=20varchar(4000),=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_version=20=
varchar(40))=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20=
if=20(exists=20(select=201=20from=20vdc_options=20where=20option_name=20=
ilike=20v_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=
=20=20=20=20=20=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20update=20=20=
vdc_options=20set=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=
=20=20=20=20=20=20=20where=20option_name=20ilike=20v_option_name=20and=20=
version=20=3D=20v_version;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_update_default_config_value(v_option_name=20=
varchar(100),v_default_option_value=20varchar(4000),v_option_value=20=
varchar(4000),v_version=20varchar(40),v_ignore_default_value_case=20=
boolean)=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=20=20=20=
=20=20=20begin=0A=20=20=20=20=20=20=20=20=20=20=20=20if=20=
(v_ignore_default_value_case)=0A=20=20=20=20=20=20=20=20=20=20=20=20then=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20update=20=20vdc_options=20=
set=20option_value=20=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20where=20option_name=20ilike=20v_option_name=20and=20=
option_value=20ilike=20v_default_option_value=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20update=20=20vdc_options=20set=20option_value=20=
=3D=20v_option_value=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
where=20option_name=20ilike=20v_option_name=20and=20option_value=20=3D=20=
v_default_option_value=20and=20version=20=3D=20v_version;=0A=20=20=20=20=20=
=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_rename_config_key(v_old_option_name=20=
varchar(100),v_new_option_name=20varchar(100),v_version=20varchar(40))=0A=
returns=20void=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20=
v_current_option_value=20varchar(4000);=0Abegin=0A=20=20=20=20if=20=
(exists=20(select=201=20from=20vdc_options=20where=20option_name=20ilike=20=
v_old_option_name=20and=20version=20=3D=20v_version))=20then=0A=20=20=20=20=
=20=20=20v_current_option_value:=3Doption_value=20from=20vdc_options=20=
where=20option_name=20ilike=20v_old_option_name=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20=20=20=20update=20vdc_options=20set=20=
option_name=20=3D=20v_new_option_name,=20option_value=20=3D=20=
v_current_option_value=0A=20=20=20=20=20=20=20=20=20=20=20where=20=20=
option_name=20ilike=20v_old_option_name=20and=20version=20=3D=20=
v_version;=0A=20=20=20=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0Acreate=20or=20replace=20function=20=
fn_db_create_constraint=20(=0A=20=20=20=20v_table=20varchar(128),=20=
v_constraint=20varchar(128),=20v_constraint_sql=20text)=0Areturns=20void=0A=
AS=20$procedure$=0Abegin=0A=20=20=20=20if=20=20NOT=20EXISTS=20(SELECT=20=
1=20from=20pg_constraint=20where=20conname=20ilike=20v_constraint)=20=
then=0A=20=20=20=20=20=20=20=20execute=20'ALTER=20TABLE=20'=20||=20=
v_table=20||=20=20'=20ADD=20CONSTRAINT=20'=20||=20v_constraint=20||=20'=20=
'=20||=20v_constraint_sql;=0A=20=20=20=20end=20if;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0Acreate=20or=20replace=20function=20=
fn_db_drop_constraint=20(=0A=20=20=20=20v_table=20varchar(128),=20=
v_constraint=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Abegin=0A=
=20=20=20=20if=20=20EXISTS=20(SELECT=201=20from=20pg_constraint=20where=20=
conname=20ilike=20v_constraint)=20then=0A=20=20=20=20=20=20=20=20execute=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20=20'=20DROP=20CONSTRAINT=20'=20=
||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20attach_user_to_su_role(v_permission_id=20uuid)=0A=20=
=20RETURNS=20void=20AS=0A$procedure$=0A=20=20=20DECLARE=0A=20=20=20=
v_user_entry=20VARCHAR(255);=0A=20=20=20v_user_id=20=20UUID;=0A=20=20=20=
v_name=20=20VARCHAR(255);=0A=20=20=20v_domain=20=20VARCHAR(255);=0A=20=20=
=20v_user_name=20=20VARCHAR(255);=0A=0A=20=20=20v_document=20=20=
VARCHAR(64);=0A=20=20=20v_index=20=20INTEGER;=0ABEGIN=0A=0A=20=20=20=
select=20=20=20option_value=20INTO=20v_user_entry=20from=20vdc_options=20=
where=20option_name=20=3D=20'AdUserId';=0A=20=20=20select=20=20=20=
option_value=20INTO=20v_name=20from=20vdc_options=20where=20option_name=20=
=3D=20'AdUserName';=0A=20=20=20select=20=20=20option_value=20INTO=20=
v_domain=20from=20vdc_options=20where=20option_name=20=3D=20=
'DomainName';=0A=0A=20=20=20v_index=20:=3D=20POSITION(':'=20IN=20=
v_user_entry);=0A=20=20=20if=20(=20v_index=20<>=200=20)=20then=0A=20=20=20=
=20=20=20v_user_entry=20:=3D=20substring(=20v_user_entry=20from=20=
v_index=20+=201=20);=0A=20=20=20=20=20=20v_user_id=20:=3D=20CAST(=20=
v_user_entry=20AS=20uuid=20);=0A=20=20=20end=20if;=0A=0A=20=20=20v_index=20=
:=3D=20POSITION(':'=20IN=20v_name);=0A=20=20=20if=20(=20v_index=20<>=200=20=
)=20then=0A=20=20=20=20=20=20v_name=20:=3D=20substring(=20v_name=20from=20=
v_index=20+=201=20);=0A=20=20=20end=20if;=0A=0A--=20find=20if=20name=20=
already=20includes=20domain=20(@)=0A=20=20=20v_index=20:=3D=20=
POSITION('@'=20IN=20v_name);=0A=0A=20=20=20if=20(v_index=20=3D=200)=20=
then=0A=20=20=20=20=20=20v_user_name=20:=3D=20coalesce(v_name,'')=20||=20=
'@'=20||=20coalesce(v_domain,'');=0A=20=20=20else=0A=20=20=20=20=20=20=
v_user_name=20:=3D=20v_name;=0A=20=20=20end=20if;=0A=0A=0Ainsert=20into=20=
users(user_id,name,domain,username,groups,status)=20select=20v_user_id,=20=
v_name,=20v_domain,=20v_user_name,'',1=20where=20not=20exists=20(select=20=
user_id,name,domain,username,groups,status=20from=20users=20where=20=
user_id=20=3D=20v_user_id=20and=20name=20=3D=20v_name=20and=20domain=20=3D=
=20v_domain=20and=20username=20=3D=20v_user_name=20and=20groups=20=3D=20=
''=20and=20status=20=3D=201);=0A=0Ainsert=20into=20=
permissions(id,role_id,ad_element_id,object_id,object_type_id)=20select=20=
v_permission_id,=20'00000000-0000-0000-0000-000000000001',=20v_user_id,=20=
getGlobalIds('system'),=201=20where=20not=20exists(select=20=
role_id,ad_element_id,object_id,object_type_id=20from=20permissions=20=
where=20role_id=20=3D=20'00000000-0000-0000-0000-000000000001'=20and=20=
ad_element_id=20=3D=20v_user_id=20and=20object_id=3D=20=
getGlobalIds('system')=20and=20object_type_id=20=3D=201);=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20CheckDBConnection()=20RETURNS=20SETOF=20integer=20=
IMMUTABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0A=20=20=20=20RETURN=20=
QUERY=20SELECT=201;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=20from=20=
pg_proc=20inner=20join=20pg_namespace=20ns=20on=20=
(pg_proc.pronamespace=3Dns.oid)=20where=20ns.nspname=20=3D=20'public'=20=
and=20proname=20not=20ilike=20'uuid%'=20order=20by=20proname;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_views_syntax()=20RETURNS=20SETOF=20=
text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20=
select=20'DROP=20VIEW=20if=20exists=20'=20||=20table_name=20||=20'=20=
CASCADE;'=20from=20information_schema.views=20where=20table_schema=20=3D=20=
'public'=20order=20by=20table_name;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_tables_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20TABLE=20=
if=20exists=20'=20||=20table_name=20||=20'=20CASCADE;'=20from=20=
information_schema.tables=20where=20table_schema=20=3D=20'public'=20and=20=
table_type=20=3D=20'BASE=20TABLE'=20order=20by=20table_name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_seq_syntax()=20RETURNS=20SETOF=20=
text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20=
select=20'DROP=20SEQUENCE=20if=20exists=20'=20||=20sequence_name=20||=20=
'=20CASCADE;'=20from=20information_schema.sequences=20=20where=20=
sequence_schema=20=3D=20'public'=20order=20by=20sequence_name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_user_types_syntax()=20RETURNS=20=
SETOF=20text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20=
QUERY=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20FROM=20pg_namespace=20n,=20pg_class=20c,=20pg_type=20t=0A=20=20=20=
WHERE=20n.oid=20=3D=20c.relnamespace=20and=20t.typrelid=20=3D=20c.oid=20=
and=20c.relkind=20=3D=20'c'::"char"=20and=0A=20=20=20n.nspname=20=3D=20=
'public'=0A=20=20=20ORDER=20BY=20=20=
c.relname::information_schema.sql_identifier;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_get_column_size(=20v_table=20varchar(64),=20v_column=20varchar(64))=20=
returns=20integer=20STABLE=0A=20=20=20AS=20$procedure$=0A=20=20=20=
declare=0A=20=20=20retvalue=20=20integer;=0ABEGIN=0A=20=20=20retvalue=20=
:=3D=20character_maximum_length=20from=20information_schema.columns=0A=20=
=20=20=20where=0A=20=20=20=20table_name=20ilike=20v_table=20and=20=
column_name=20ilike=20v_column=20and=0A=20=20=20=20table_schema=20=3D=20=
'public'=20and=20udt_name=20in=20('char','varchar');=0A=20=20=20return=20=
retvalue;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
attach_user_to_su_role(v_permission_id=20uuid,=20v_user_id=20=
VARCHAR(255),=20v_name=20VARCHAR(255),=20v_domain=20VARCHAR(255))=0A=20=20=
RETURNS=20void=20AS=0A$BODY$=0A=20=20=20DECLARE=0A=20=20=20v_user_name=20=
VARCHAR(255);=0A=20=20=20v_document=20=20VARCHAR(64);=0A=20=20=20v_index=20=
=20INTEGER;=0A=20=20=20input_uuid=20uuid;=0ABEGIN=0A=20=20=20input_uuid=20=
=3D=20CAST(=20v_user_id=20AS=20uuid=20);=0A--=20find=20if=20name=20=
already=20includes=20domain=20(@)=0A=20=20=20v_index=20:=3D=20=
POSITION('@'=20IN=20v_name);=0A=0A=20=20=20if=20(v_index=20=3D=200)=20=
then=0A=20=20=20=20=20=20v_user_name=20:=3D=20coalesce(v_name,'')=20||=20=
'@'=20||=20coalesce(v_domain,'');=0A=20=20=20else=0A=20=20=20=20=20=20=
v_user_name=20:=3D=20v_name;=0A=20=20=20end=20if;=0A=0A=0Ainsert=20into=20=
users(user_id,name,domain,username,groups,status)=20select=20input_uuid,=20=
v_name,=20v_domain,=20v_user_name,'',1=20where=20not=20exists=20(select=20=
user_id,name,domain,username,groups,status=20from=20users=20where=20=
user_id=20=3D=20input_uuid);=0A=0Ainsert=20into=20=
permissions(id,role_id,ad_element_id,object_id,object_type_id)=20select=20=
v_permission_id,=20'00000000-0000-0000-0000-000000000001',=20input_uuid,=20=
getGlobalIds('system'),=201=20where=20not=20exists(select=20=
role_id,ad_element_id,object_id,object_type_id=20from=20permissions=20=
where=20role_id=20=3D=20'00000000-0000-0000-0000-000000000001'=20and=20=
ad_element_id=20=3D=20input_uuid=20and=20object_id=3D=20=
getGlobalIds('system')=20and=20object_type_id=20=3D=201);=0AEND;=20=
$BODY$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20=
FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20REPLACE=20=
FUNCTION=20fn_db_add_action_group_to_role(v_role_id=20UUID,=20=
v_action_group_id=20INTEGER)=0ARETURNS=20VOID=0AAS=20$procedure$=0ABEGIN=0A=
=20=20=20=20=20=20=20INSERT=20INTO=20=
roles_groups(role_id,action_group_id)=0A=20=20=20=20=20=20=20SELECT=20=
v_role_id,=20v_action_group_id=0A=20=20=20=20=20=20=20WHERE=20NOT=20=
EXISTS=20(SELECT=201=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20FROM=20roles_groups=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20WHERE=20role_id=20=3D=20=
v_role_id=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20AND=20action_group_id=20=3D=20v_action_group_id);=0ARETURN;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_split_config_value(v_option_name=20character=20=
varying,=20v_old_option_value=20character=20varying,=20=
v_new_option_value=20character=20varying,=20v_update_from_version=20=
character=20varying)=0A=20=20RETURNS=20void=20AS=0A$BODY$=0Adeclare=0A=
v_old_value=20varchar(4000);=0Av_cur=20cursor=20for=20select=20distinct=20=
version=20from=20vdc_options=20where=20version=20<>=20'general'=20order=20=
by=20version;=0Av_version=20varchar(40);=0Av_index=20integer;=0Av_count=20=
integer;=0Av_total_count=20integer;=0Av_version_count=20integer;=0Abegin=0A=
=20=20=20=20v_total_count=20:=3D=20count(version)=20from=20vdc_options=20=
where=20option_name=20=3D=20v_option_name;=0A=20=20=20=20v_old_value=20=
:=3D=20option_value=20from=20vdc_options=20where=20option_name=20=3D=20=
v_option_name=20and=20version=20=3D=20'general';=0A=20=20=20=20=
v_version_count=20:=3D=20count(distinct=20version)=20from=20vdc_options=20=
where=20version=20<>=20'general';=0A=20=20=20=20if=20(v_total_count=20<=3D=
=20v_version_count)=20then=0A=20=20=20=20=20=20=20=20begin=0A=20=20=20=20=
=20=20=20=20=20=20=20=20if=20(v_old_value=20IS=20NULL)=20then=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20v_old_value=20:=3D=20=
v_old_option_value;=0A=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=20=
=20=20=20=20=20=20=20=20=20=20=20v_count=20:=3D=20count(distinct=20=
version)=20from=20vdc_options=20where=20version=20<>=20'general';=0A=20=20=
=20=20=20=20=20=20=20=20=20=20v_index=20:=3D=201;=0A=20=20=20=20=20=20=20=
=20open=20v_cur;=0A=20=20=20=20=20=20=20=20loop=0A=20=20=20=20=20=20=20=20=
=20=20=20=20fetch=20v_cur=20into=20v_version;=0A=20=20=20=20=20=20=20=20=20=
=20=20=20exit=20when=20not=20found;=0A=20=20=20=20=20=20=20=20=20=20=20=20=
--=20We=20shouldn't=20update=20if=20already=20exists=0A=20=20=20=20=20=20=
=20=20=20=20=20=20if=20(not=20exists=20(select=201=20from=20vdc_options=20=
where=20option_name=20=3D=20v_option_name=20and=20version=20=3D=20=
v_version))=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20--=20=
Might=20not=20work=20well=20for=20versions=20such=20as=203.10,=20but=20=
we=20currently=20don't=20have=20any=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20if=20(v_version=20>=3D=20v_update_from_version)=20then=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20insert=20into=20=
vdc_options=20(option_name,=20option_value,=20version)=20values=20=
(v_option_name,=20v_new_option_value,=20v_version);=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20insert=20into=20vdc_options=20(option_name,=20=
option_value,=20version)=20values=20(v_option_name,=20v_old_value,=20=
v_version);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=
=20=20=20=20=20=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=20=20=20=20=20=
=20=20=20v_index=20:=3D=20v_index=20+1;=0A=20=20=20=20=20=20=20=20end=20=
loop;=0A=20=20=20=20=20=20=20=20close=20v_cur;=0A=20=20=20=20=20=20=20=20=
delete=20from=20vdc_options=20where=20option_name=20=3D=20v_option_name=20=
and=20version=20=3D=20'general';=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=
=20end=20if;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_grant_action_group_to_all_roles_filter(v_action_group_id=20=
integer,=20uuid[])=0A=20=20RETURNS=20void=20AS=0A$BODY$=0Adeclare=0A=
v_role_id_to_filter=20alias=20for=20$2;=0Abegin=0A=20=20=20=20insert=20=
into=20roles_groups=20(role_id,=20action_group_id)=0A=20=20=20=20select=20=
distinct=20role_id,=20v_action_group_id=0A=20=20=20=20from=20=
roles_groups=20rg=0A=20=20=20=20where=20not=20ARRAY=20[role_id]=20<@=20=
v_role_id_to_filter=20and=20not=20exists=20(select=201=20from=20=
roles_groups=20where=20role_id=20=3D=20rg.role_id=20and=20=
action_group_id=20=3D=20v_action_group_id);=0AEND;=20$BODY$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20=
fn_db_mask_object(v_object=20regclass)=20RETURNS=20setof=20record=20as=0A=
$BODY$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=20=20=20=20v_table=20=
record;=0A=20=20=20=20v_table_name=20TEXT;=0A=20=20=20=20temprec=20=
record;=0ABEGIN=0A=20=20=20=20--=20get=20full=20table/view=20name=20from=20=
v_object=20(i.e=20<namespace>.<name>)=0A=20=20=20=20select=20c.relname,=20=
n.nspname=20INTO=20v_table=0A=20=20=20=20=20=20=20=20FROM=20pg_class=20c=20=
join=20pg_namespace=20n=20on=20c.relnamespace=20=3D=20n.oid=20WHERE=20=
c.oid=20=3D=20v_object;=0A=20=20=20=20--=20try=20to=20get=20filtered=20=
query=20syntax=20from=20previous=20execution=0A=20=20=20=20if=20exists=20=
(select=201=20from=20object_column_white_list_sql=20where=20object_name=20=
=3D=20v_table.relname)=20then=0A=09select=20sql=20into=20v_sql=20from=20=
object_column_white_list_sql=20where=20object_name=20=3D=20=
v_table.relname;=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
v_table_name=20:=3D=20quote_ident(=20v_table.nspname=20)=20||=20'.'=20||=20=
quote_ident(=20v_table.relname=20);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20=20=20=20=20for=20temprec=20in=20select=20a.attname,=20=
t.typname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_attribute=20a=20join=20pg_type=20t=20on=20a.atttypid=20=3D=
=20t.oid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20a.attrelid=20=3D=20v_object=20AND=20a.attnum=20>=200=20AND=20=
NOT=20a.attisdropped=20ORDER=20BY=20a.attnum=0A=20=20=20=20=20=20=20=20=
loop=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20coalesce(=20=
v_sql=20||=20',=20',=20'SELECT=20'=20);=0A=20=20=20=20=20=20=20=20=20=20=20=
=20if=20exists(select=201=20from=20object_column_white_list=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20where=20object_name=20=3D=20=
v_table.relname=20and=20column_name=20=3D=20temprec.attname)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20=
quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20=
||=20'NULL::'=20||=20quote_ident(=20temprec.typname=20)=20||=20'=20as=20=
'=20||=20quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=
=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20END=20LOOP;=0A=20=20=20=20=20=
=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=
=20=20=20=20=20=20=20=20v_sql=20:=3D=20'SELECT=20x::'=20||=20=
v_table_name=20||=20'=20as=20rec=20FROM=20('=20||=20v_sql=20||=20')=20as=20=
x';=0A=20=20=20=20=20=20=20=20--=20save=20generated=20query=20for=20=
further=20use=0A=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list_sql(object_name,sql)=20values=20=
(v_table.relname,=20v_sql);=0A=20=20=20=20end=20if;=0A=20=20=20=20RETURN=20=
QUERY=20EXECUTE=20v_sql;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_add_column_to_object_white_list(v_object_name=20varchar(128),=20=
v_column_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0A=
begin=0A=20=20=20=20if=20(not=20exists=20(select=201=20from=20=
object_column_white_list=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20where=20object_name=20=3D=20v_object_name=20and=20=
column_name=20=3D=20v_column_name))=20then=0A=20=20=20=20=20=20=20=20=
begin=0A=20=20=20=20=20=20=20=20=20=20=20=20--=20verify=20that=20there=20=
is=20such=20object=20in=20db=0A=20=20=20=20=20=20=20=20=20=20=20=20if=20=
exists=20(select=201=20from=20information_schema.columns=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20where=20table_name=20=
=3D=20v_object_name=20and=20column_name=20=3D=20v_column_name)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list=20(object_name,=20column_name)=20values=20=
(v_object_name,=20v_column_name);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
end=20if;=0A=20=20=20=20=20=20=20=20end;=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20FUNCTION=20fn_db_unlock_disk(v_id=20UUID)=0Areturns=20void=0A=
AS=20$procedure$=0Adeclare=0A=20=20=20=20OK=20integer;=0A=20=20=20=20=
LOCKED=20integer;=0Abegin=0A=20=20=20=20OK:=3D1;=0A=20=20=20=20=
LOCKED:=3D2;=0A=20=20=20=20update=20images=20set=20imagestatus=20=3D=20=
OK=20where=20imagestatus=20=3D=20LOCKED=20and=0A=20=20=20=20=
image_group_id=20in=20(select=20device_id=20from=20vm_device=20where=20=
device_id=20=3D=20v_id=20and=20is_plugged);=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_unlock_snapshot(v_id=20UUID)=0Areturns=20void=0AAS=20$procedure$=0A=
declare=0A=20=20=20=20OK=20varchar;=0A=20=20=20=20LOCKED=20varchar;=0A=
begin=0A=20=20=20=20OK:=3D'OK';=0A=20=20=20=20LOCKED:=3D'LOCKED';=0A=20=20=
=20=20update=20snapshots=20set=20status=20=3D=20OK=20where=20status=20=3D=20=
LOCKED=20and=20snapshot_id=20=3D=20v_id;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_unlock_entity(v_object_type=20varchar(10),=20v_name=20=
varchar(255),=20v_recursive=20boolean)=0Areturns=20void=0AAS=20=
$procedure$=0Adeclare=0A=20=20=20=20DOWN=20integer;=0A=20=20=20=20OK=20=
integer;=0A=20=20=20=20LOCKED=20integer;=0A=20=20=20=20TEMPLATE_OK=20=
integer;=0A=20=20=20=20TEMPLATE_LOCKED=20integer;=0A=20=20=20=20=
IMAGE_LOCKED=20integer;=0A=20=20=20=20SNAPSHOT_OK=20varchar;=0A=20=20=20=20=
SNAPSHOT_LOCKED=20varchar;=0A=20=20=20=20v_id=20UUID;=0Abegin=0A=20=20=20=
=20DOWN:=3D0;=0A=20=20=20=20OK:=3D1;=0A=20=20=20=20LOCKED:=3D2;=0A=20=20=20=
=20TEMPLATE_OK:=3D0;=0A=20=20=20=20TEMPLATE_LOCKED:=3D1;=0A=20=20=20=20=
IMAGE_LOCKED:=3D15;=0A=20=20=20=20SNAPSHOT_OK:=3D'OK';=0A=20=20=20=20=
SNAPSHOT_LOCKED:=3D'LOCKED';=0A=20=20=20=20v_id=20:=3D=20vm_guid=20from=20=
vm_static=20where=20vm_name=20=3D=20v_name=20and=20entity_type=20ilike=20=
v_object_type;=0A=20=20=20=20--=20set=20VM=20status=20to=20DOWN=0A=20=20=20=
=20if=20(v_object_type=20=3D=20'vm')=20then=0A=20=20=20=20=20=20=20=20=
update=20vm_dynamic=20set=20status=20=3D=20DOWN=20where=20status=20=3D=20=
IMAGE_LOCKED=20and=20vm_guid=20=20=3D=20v_id;=0A=20=20=20=20--=20set=20=
Template=20status=20to=20OK=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
if=20(v_object_type=20=3D=20'template')=20then=0A=20=20=20=20=20=20=20=20=
=20=20=20=20update=20vm_static=20set=20template_status=20=3D=20=
TEMPLATE_OK=20where=20template_status=20=3D=20TEMPLATE_LOCKED=20and=20=
vm_guid=20=20=3D=20v_id;=0A=20=20=20=20=20=20=20=20end=20if;=0A=20=20=20=20=
end=20if;=0A=20=20=20=20--unlock=20images=20and=20snapshots=20=20if=20=
recursive=20flag=20is=20set=0A=20=20=20=20if=20(v_recursive)=20then=0A=20=
=20=20=20=20=20=20=20update=20images=20set=20imagestatus=20=3D=20OK=20=
where=20imagestatus=20=3D=20LOCKED=20and=0A=20=20=20=20=20=20=20=20=
image_group_id=20in=20(select=20device_id=20from=20vm_device=20where=20=
vm_id=20=3D=20v_id=20and=20is_plugged);=0A=0A=20=20=20=20=20=20=20=20=
update=20snapshots=20set=20status=20=3D=20SNAPSHOT_OK=20where=20status=20=
ilike=20SNAPSHOT_LOCKED=20and=20vm_id=20=3D=20v_id;=0A=20=20=20=20end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A/*=20Displays=20DC=20id=20,=20DC=20name,=20SPM=20Host=20id=20=
,=20SPM=20Host=20name=20and=20number=20of=20async=20tasks=20awaiting.=0A=0A=
1)=20create=20a=20record=20type=20with=20DC=20name,=20DC=20id,=20SPM=20=
host=20id,=20SPM=20host=20name,=20count=0A=0A2)=20get=20all=20distinct=20=
DC=20ids=20from=20async_tasks=20table=0A=0A3)=20Run=20a=20cursor=20for=20=
each=20result=20in=202)=0A=0A=20=20=20a)=20get=20DC=20name=0A=20=20=20b)=20=
get=20SPM=20Host=20id=20&=20name=20if=20available=0A=20=20=20c)=20get=20=
count=20of=20tasks=0A=0A=20=20=20return=20current=20record=0A=0A4)=20=
return=20set=20of=20generated=20records=0A*/=0ADROP=20TYPE=20IF=20EXISTS=20=
async_tasks_info_rs=20CASCADE;=0A**************************=0A=0ADROP=20=
TYPE=0A*********=20QUERY=20**********=0ACREATE=20TYPE=20=
async_tasks_info_rs=20AS=20(=0A=20=20=20=20dc_id=20UUID,=20dc_name=20=
CHARACTER=20VARYING,=20spm_host_id=20UUID,=20spm_host_name=20CHARACTER=20=
VARYING,=20task_count=20integer);=0A**************************=0A=0A=
CREATE=20TYPE=0A*********=20QUERY=20**********=0Acreate=20or=20replace=20=
FUNCTION=20fn_db_get_async_tasks()=0Areturns=20SETOF=20=
async_tasks_info_rs=20STABLE=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20=
v_record=20async_tasks_info_rs;=0A=0A=20=20=20=20--=20selects=20=
storage_pool_id=20uuid=20found=20in=20async_tasks=0A=20=20=20=20=
v_tasks_cursor=20cursor=20for=20select=20distinct=20storage_pool_id=20=
from=20async_tasks;=0Abegin=0A=0A=20=20=20=20OPEN=20v_tasks_cursor;=0A=20=
=20=20=20FETCH=20v_tasks_cursor=20into=20v_record.dc_id;=0A=20=20=20=20=
WHILE=20FOUND=20LOOP=0A=20=20=20=20=20=20=20=20--=20get=20dc_name=20and=20=
SPM=20Host=20id=0A=20=20=20=20=20=20=20=20v_record.dc_name=20:=3D=20name=20=
from=20storage_pool=20where=20id=20=3D=20v_record.dc_id;=0A=20=20=20=20=20=
=20=20=20v_record.spm_host_id=20:=3D=0A=20=20=20=20=20=20=20=20=20=20=20=20=
spm_vds_id=20from=20storage_pool=20where=20id=20=3D=20v_record.dc_id;=0A=20=
=20=20=20=20=20=20=20--=20get=20Host=20name=20if=20we=20have=20non=20=
NULL=20SPM=20Host=0A=20=20=20=20=20=20=20=20if=20(v_record.spm_host_id=20=
IS=20NOT=20NULL)=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20=
v_record.spm_host_name=20:=3D=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20vds_name=20from=20vds_static=20where=20vds_id=20=3D=20=
v_record.spm_host_id;=0A=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=
=20=20=20=20=20=20v_record.spm_host_name:=3D'';=0A=20=20=20=20=20=20=20=20=
end=20if;=0A=20=20=20=20=20=20=20=20--=20get=20tasks=20count=20for=20=
this=20DC=0A=20=20=20=20=20=20=20=20v_record.task_count=20:=3D=20=
count(*)=20from=20async_tasks=0A=20=20=20=20=20=20=20=20=20=20=20=20=
where=20position=20(cast(v_record.dc_id=20as=20varchar)=20in=20=
action_parameters)=20>=200;=0A=20=20=20=20=20=20=20=20--=20return=20the=20=
record=0A=20=20=20=20=20=20=20=20RETURN=20NEXT=20v_record;=0A=20=20=20=20=
=20=20=20=20FETCH=20v_tasks_cursor=20into=20v_record.dc_id;=0A=20=20=20=20=
END=20LOOP;=0A=20=20=20=20CLOSE=20v_tasks_cursor;=0A=20=20=20=20--=20=
return=20full=20set=20of=20generated=20records=0A=20=20=20=20RETURN;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ADELETE=20FROM=20=
enum_translator=0AWHERE=20language_code=20=3D=20'us-en';=0A=
**************************=0A=0ADELETE=200=0A*********=20QUERY=20=
**********=0ADELETE=20FROM=20enum_translator=0AWHERE=20language_code=20=3D=
=20'zh-CN';=0A**************************=0A=0ADELETE=200=0A*********=20=
QUERY=20**********=0ADELETE=20FROM=20enum_translator=0AWHERE=20=
language_code=20=3D=20'pt-BR';=0A**************************=0A=0ADELETE=20=
0=0A*********=20QUERY=20**********=0A=0A**************************=0A=0A=
2016-08-18=2013:00:26=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema=20=
plugin.executeRaw:863=20execute-result:=20=
['/usr/share/ovirt-engine-dwh/dbscripts/schema.sh',=20'-s',=20=
'localhost',=20'-p',=20'5432',=20'-u',=20'ovirt_engine_history',=20'-d',=20=
'ovirt_engine_history',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-c',=20'apply'],=20rc=3D0=0A2016-08-18=2013:00:26=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema=20=
plugin.execute:921=20execute-output:=20=
['/usr/share/ovirt-engine-dwh/dbscripts/schema.sh',=20'-s',=20=
'localhost',=20'-p',=20'5432',=20'-u',=20'ovirt_engine_history',=20'-d',=20=
'ovirt_engine_history',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-c',=20'apply']=20stdout:=0ACreating=20schema=20=
ovirt_engine_history@localhost:5432/ovirt_engine_history=0ASaving=20=
custom=20users=20permissions=20on=20database=20objects...=0Aupgrade=20=
script=20detected=20a=20change=20in=20Config,=20View=20or=20Stored=20=
Procedure...=0ARunning=20upgrade=20sql=20script=20=
'/usr/share/ovirt-engine-dwh/dbscripts/upgrade/pre_upgrade/add_comment_col=
_to_schema_version.sql'...=0ARunning=20upgrade=20sql=20script=20=
'/usr/share/ovirt-engine-dwh/dbscripts/upgrade/pre_upgrade/add_function_to=
_update_enum_table.sql'...=0ARunning=20upgrade=20sql=20script=20=
'/usr/share/ovirt-engine-dwh/dbscripts/upgrade/pre_upgrade/changed_len_of_=
installed_by.sql'...=0ARunning=20upgrade=20sql=20script=20=
'/usr/share/ovirt-engine-dwh/dbscripts/upgrade/pre_upgrade/set_default_lan=
g_code.sql'...=0ARunning=20upgrade=20sql=20script=20=
'/usr/share/ovirt-engine-dwh/dbscripts/upgrade/pre_upgrade/set_etl_minimal=
_version.sql'...=0ACreating=20views=20API=203.6...=0ACreating=20views=20=
API=204.0...=0ACreating=20ovirt=20engine=20reports=20views...=0ACreating=20=
stored=20procedures...=0ACreating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine-dwh/dbscripts/common_sp.sql...=0ACreating=20=
stored=20procedures=20from=20=
/usr/share/ovirt-engine-dwh/dbscripts/create_sp.sql...=0ARunning=20=
upgrade=20sql=20script=20=
'/usr/share/ovirt-engine-dwh/dbscripts/upgrade/post_upgrade/0010_change_en=
um_lang_code.sql'...=0AApplying=20custom=20users=20permissions=20on=20=
database=20objects...=0A=0A2016-08-18=2013:00:26=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema=20=
plugin.execute:926=20execute-output:=20=
['/usr/share/ovirt-engine-dwh/dbscripts/schema.sh',=20'-s',=20=
'localhost',=20'-p',=20'5432',=20'-u',=20'ovirt_engine_history',=20'-d',=20=
'ovirt_engine_history',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-c',=20'apply']=20stderr:=0A=0A=0A2016-08-18=2013:00:26=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._check_=
separate=0A2016-08-18=2013:00:26=20INFO=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config=20=
config._check_separate:192=20Configuring=20Image=20I/O=20Proxy=0A=
2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._misc_V=
DC=0A2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:26=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.pki.Plugin._misc_pki=0A=
2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:26=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.pki.Plugin._miscPK=
IEngine=0A2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:26=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.vmconsole_proxy_helper.pki.Plugin._miscPK=
IProxy=0A2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:26=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._check_sepa=
rate=0A2016-08-18=2013:00:26=20INFO=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config=20=
config._check_separate:187=20Configuring=20WebSocket=20Proxy=0A=
2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.config.Plugin._misc_VDC=0A=
2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:26=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.pki.Plugin._misc_pki=0A=
2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:26=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.db.connection.Plugin._connec=
tion=0A2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/connection=3Dconnection:'<connection=20object=20at=20=
0x3079370;=20dsn:=20'dbname=3Dengine=20user=3Dengine=20=
password=3Dxxxxxxxxxxxxxxxxxxxxxx=20host=3Dlocalhost=20port=3D5432=20=
sslmode=3Dallow',=20closed:=200>'=0A2016-08-18=2013:00:26=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/statement=3DStatement:'<ovirt_engine_setup.engine_common.datab=
ase.Statement=20object=20at=200x30cc1d0>'=0A2016-08-18=2013:00:26=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.connection.Plugin._co=
nnection=0A2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/connection=3Dconnection:'<connection=20object=20at=20=
0x3693a20;=20dsn:=20'dbname=3Dovirt_engine_history=20=
user=3Dovirt_engine_history=20password=3Dxxxxxxxxxxxxxxxxxxxxxx=20=
host=3Dlocalhost=20port=3D5432=20sslmode=3Dallow',=20closed:=200>'=0A=
2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/statement=3DStatement:'<ovirt_engine_setup.engine_common.d=
atabase.Statement=20object=20at=200x30ccb50>'=0A2016-08-18=2013:00:26=20=
DEBUG=20otopi.context=20context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20=
-=20END=0A2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_common.ovirt_engine_dwh.db.engine_connection.Pl=
ugin._engine_connection=0A2016-08-18=2013:00:26=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:26=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._misc=0A=
2016-08-18=2013:00:26=20INFO=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc=20=
aaajdbc._setupSchema:97=20Creating/refreshing=20Engine=20'internal'=20=
domain=20database=20schema=0A2016-08-18=2013:00:26=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc=20=
plugin.executeRaw:813=20execute:=20=
['/usr/share/ovirt-engine-extension-aaa-jdbc/dbscripts/schema.sh',=20=
'-s',=20'localhost',=20'-p',=20'5432',=20'-u',=20'engine',=20'-d',=20=
'engine',=20'-e',=20'aaa_jdbc',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-c',=20'apply'],=20executable=3D'None',=20cwd=3D'None',=20=
env=3D{'LANG':=20'en_US.UTF-8',=20'TERM':=20'xterm-256color',=20'SHELL':=20=
'/bin/bash',=20'MAIL':=20'/var/spool/mail/root',=20'SHLVL':=20'1',=20=
'PYTHONPATH':=20'/usr/share/ovirt-engine/setup/bin/..::',=20'HOSTNAME':=20=
'cultivar.grove.silverorange.com',=20'LS_COLORS':=20=
'rs=3D0:di=3D38;5;27:ln=3D38;5;51:mh=3D44;38;5;15:pi=3D40;38;5;11:so=3D38;=
5;13:do=3D38;5;5:bd=3D48;5;232;38;5;11:cd=3D48;5;232;38;5;3:or=3D48;5;232;=
38;5;9:mi=3D05;48;5;232;38;5;15:su=3D48;5;196;38;5;15:sg=3D48;5;11;38;5;16=
:ca=3D48;5;196;38;5;226:tw=3D48;5;10;38;5;16:ow=3D48;5;10;38;5;21:st=3D48;=
5;21;38;5;15:ex=3D38;5;34:*.tar=3D38;5;9:*.tgz=3D38;5;9:*.arc=3D38;5;9:*.a=
rj=3D38;5;9:*.taz=3D38;5;9:*.lha=3D38;5;9:*.lz4=3D38;5;9:*.lzh=3D38;5;9:*.=
lzma=3D38;5;9:*.tlz=3D38;5;9:*.txz=3D38;5;9:*.tzo=3D38;5;9:*.t7z=3D38;5;9:=
*.zip=3D38;5;9:*.z=3D38;5;9:*.Z=3D38;5;9:*.dz=3D38;5;9:*.gz=3D38;5;9:*.lrz=
=3D38;5;9:*.lz=3D38;5;9:*.lzo=3D38;5;9:*.xz=3D38;5;9:*.bz2=3D38;5;9:*.bz=3D=
38;5;9:*.tbz=3D38;5;9:*.tbz2=3D38;5;9:*.tz=3D38;5;9:*.deb=3D38;5;9:*.rpm=3D=
38;5;9:*.jar=3D38;5;9:*.war=3D38;5;9:*.ear=3D38;5;9:*.sar=3D38;5;9:*.rar=3D=
38;5;9:*.alz=3D38;5;9:*.ace=3D38;5;9:*.zoo=3D38;5;9:*.cpio=3D38;5;9:*.7z=3D=
38;5;9:*.rz=3D38;5;9:*.cab=3D38;5;9:*.jpg=3D38;5;13:*.jpeg=3D38;5;13:*.gif=
=3D38;5;13:*.bmp=3D38;5;13:*.pbm=3D38;5;13:*.pgm=3D38;5;13:*.ppm=3D38;5;13=
:*.tga=3D38;5;13:*.xbm=3D38;5;13:*.xpm=3D38;5;13:*.tif=3D38;5;13:*.tiff=3D=
38;5;13:*.png=3D38;5;13:*.svg=3D38;5;13:*.svgz=3D38;5;13:*.mng=3D38;5;13:*=
.pcx=3D38;5;13:*.mov=3D38;5;13:*.mpg=3D38;5;13:*.mpeg=3D38;5;13:*.m2v=3D38=
;5;13:*.mkv=3D38;5;13:*.webm=3D38;5;13:*.ogm=3D38;5;13:*.mp4=3D38;5;13:*.m=
4v=3D38;5;13:*.mp4v=3D38;5;13:*.vob=3D38;5;13:*.qt=3D38;5;13:*.nuv=3D38;5;=
13:*.wmv=3D38;5;13:*.asf=3D38;5;13:*.rm=3D38;5;13:*.rmvb=3D38;5;13:*.flc=3D=
38;5;13:*.avi=3D38;5;13:*.fli=3D38;5;13:*.flv=3D38;5;13:*.gl=3D38;5;13:*.d=
l=3D38;5;13:*.xcf=3D38;5;13:*.xwd=3D38;5;13:*.yuv=3D38;5;13:*.cgm=3D38;5;1=
3:*.emf=3D38;5;13:*.axv=3D38;5;13:*.anx=3D38;5;13:*.ogv=3D38;5;13:*.ogx=3D=
38;5;13:*.aac=3D38;5;45:*.au=3D38;5;45:*.flac=3D38;5;45:*.mid=3D38;5;45:*.=
midi=3D38;5;45:*.mka=3D38;5;45:*.mp3=3D38;5;45:*.mpc=3D38;5;45:*.ogg=3D38;=
5;45:*.ra=3D38;5;45:*.wav=3D38;5;45:*.axa=3D38;5;45:*.oga=3D38;5;45:*.spx=3D=
38;5;45:*.xspf=3D38;5;45:',=20'LESSOPEN':=20'||/usr/bin/lesspipe.sh=20=
%s',=20'HISTCONTROL':=20'ignoredups',=20'PWD':=20'/root',=20'LOGNAME':=20=
'root',=20'USER':=20'root',=20'OTOPI_LOGFILE':=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'HOME':=20'/root',=20'HISTSIZE':=20'1000',=20'XDG_SESSION_ID':=20=
'6',=20'OTOPI_EXECDIR':=20'/root',=20'DBFUNC_DB_PGPASSFILE':=20=
'/tmp/tmpZ8kHN0',=20'PATH':=20=
'/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin'}=0A=
*********=20QUERY=20**********=0Aselect=201;=0A=
**************************=0A=0A=20=20=20=20=20=20=20=201=0A=0A*********=20=
QUERY=20**********=0Acopy=20(=0A=09=09=09SELECT=20COUNT(schema_name)=0A=09=
=09=09FROM=20information_schema.schemata=0A=09=09=09WHERE=20schema_name=20=
=3D=20'aaa_jdbc'=0A=09=09)=20to=20stdout=20with=20delimiter=20as=20'|';=0A=
**************************=0A=0A*********=20QUERY=20**********=0Acopy=20=
(=0A=09=09select=20count(*)=20as=20count=0A=09=09from=20=
pg_catalog.pg_tables=0A=09=09where=0A=09=09=09tablename=20=3D=20=
'schema_version'=20and=0A=09=09=09schemaname=20=3D=20'aaa_jdbc'=0A=09)=20=
to=20stdout=20with=20delimiter=20as=20'|';=0A**************************=0A=
=0A*********=20QUERY=20**********=0ASET=20search_path=20TO=20aaa_jdbc;=0A=
**************************=0A=0ASET=0A*********=20QUERY=20**********=0A=
select=201000000;=0A**************************=0A=0A=20=201000000=0A=0A=
*********=20QUERY=20**********=0ASET=20search_path=20TO=20aaa_jdbc;=0A=
**************************=0A=0ASET=0A*********=20QUERY=20**********=0A=
Create=20or=20replace=20FUNCTION=20fn_db_add_column(v_table=20=
varchar(128),=20v_column=20varchar(128),=20v_column_def=20text)=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0A=0Abegin=0A=
=09if=20(not=20exists=20(select=201=20from=20information_schema.columns=20=
where=20table_schema=20=3D=20'aaa_jdbc'=20and=20table_name=20ilike=20=
v_table=20and=20column_name=20ilike=20v_column))=20then=0A=09=20=20=20=20=
begin=0A=09=09v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20=
ADD=20COLUMN=20'=20||=20v_column=20||=20'=20'=20||=20v_column_def;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_drop_column(v_table=20varchar(128),=20v_column=20varchar(128))=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0Abegin=0A=20=
=20=20=20=20=20=20=20if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column))=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20begin=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20=
||=20v_table=20||=20'=20DROP=20COLUMN=20'=20||=20v_column;=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=20=20=20=20=
=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=
=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20Column=20%=20=
does=20not=20exist.',=20v_table,=20v_column;=0A=20=20=20=20=20=20=20=20=
end=20if;=0Aend;$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_change_column_type(v_table=20varchar(128),=20v_column=20=
varchar(128),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_type=20varchar(128),=20v_new_type=20=
varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20=
text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column=20and=20(udt_name=20ilike=20v_type=20or=20data_type=20ilike=20=
v_type)))=20then=0A=09=20=20=20=20begin=0A=09=09v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20ALTER=20COLUMN=20'=20||=20v_column=20=
||=20'=20TYPE=20'=20||=20v_new_type;=0A=09=09EXECUTE=20v_sql;=0A=20=20=20=
=20=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20=20=20=20=20=
---=20ignore=20operation=20if=20requested=20type=20is=20already=20there=0A=
=20=20=20=20=20=20=20=20elsif=20(not=20exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column=20and=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
(udt_name=20ilike=20v_new_type=20or=20data_type=20ilike=20v_new_type)))=20=
then=0A=20=20=20=20=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20=
%=20or=20Column=20%=20does=20not=20exist.',=20v_table,=20v_column;=0A=09=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_rename_column(v_table=20varchar(128),=20v_column=20varchar(128),=20=
v_new_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0A=
v_sql=20text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column))=20then=0A=09=20=20=20=20begin=0A=09=09v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20RENAME=20COLUMN=20'=20||=20v_column=20=
||=20'=20TO=20'=20||=20v_new_name;=0A=09=09EXECUTE=20v_sql;=0A=20=20=20=20=
=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20else=0A=20=20=20=20=
=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20Column=20%=20=
does=20not=20exist.',=20v_table,=20v_column;=0A=09end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20function=20fn_db_create_constraint=20(=0A=20=20=20=20v_table=20=
varchar(128),=20v_constraint=20varchar(128),=20v_constraint_sql=20text)=0A=
returns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=20NOT=20=
EXISTS=20(SELECT=201=20from=20pg_constraint=20where=20conname=20ilike=20=
v_constraint)=20then=0A=20=20=20=20=20=20=20=20execute=20'ALTER=20TABLE=20=
'=20||=20v_table=20||=20=20'=20ADD=20CONSTRAINT=20'=20||=20v_constraint=20=
||=20'=20'=20||=20v_constraint_sql;=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20function=20fn_db_drop_constraint=20(=0A=20=20=20=20v_table=20=
varchar(128),=20v_constraint=20varchar(128))=0Areturns=20void=0AAS=20=
$procedure$=0Abegin=0A=20=20=20=20if=20=20EXISTS=20(SELECT=201=20from=20=
pg_constraint=20where=20conname=20ilike=20v_constraint)=20then=0A=20=20=20=
=20=20=20=20=20execute=20'ALTER=20TABLE=20'=20||=20v_table=20||=20=20'=20=
DROP=20CONSTRAINT=20'=20||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20CheckDBConnection()=20=
RETURNS=20SETOF=20integer=20IMMUTABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=20SELECT=201;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=20from=20=
pg_proc=20inner=20join=20pg_namespace=20ns=20on=20=
(pg_proc.pronamespace=3Dns.oid)=20where=20ns.nspname=20=3D=20'aaa_jdbc'=20=
order=20by=20proname;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_views_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=20=
=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20VIEW=20=
if=20exists=20'=20||=20table_schema=20||=20'.'=20||=20table_name=20||=20=
'=20CASCADE;'=20from=20information_schema.views=20where=20table_schema=20=
=3D=20'aaa_jdbc'=20order=20by=20table_name;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_tables_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20TABLE=20=
if=20exists=20'=20||=20table_schema=20||=20'.'=20||=20table_name=20||=20=
'=20CASCADE;'=20from=20information_schema.tables=20where=20table_schema=20=
=3D=20'aaa_jdbc'=20and=20table_type=20=3D=20'BASE=20TABLE'=20order=20by=20=
table_name;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_seq_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=20=
=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20SEQUENCE=20=
if=20exists=20'=20||=20sequence_schema=20||=20'.'=20||=20sequence_name=20=
||=20'=20CASCADE;'=20from=20information_schema.sequences=20=20where=20=
sequence_schema=20=3D=20'aaa_jdbc'=20order=20by=20sequence_name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_user_types_syntax()=20RETURNS=20=
SETOF=20text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20=
QUERY=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20FROM=20pg_namespace=20n,=20pg_class=20c,=20pg_type=20t=0A=20=20=20=
WHERE=20n.oid=20=3D=20c.relnamespace=20and=20t.typrelid=20=3D=20c.oid=20=
and=20c.relkind=20=3D=20'c'::"char"=20and=0A=20=20=20n.nspname=20=3D=20=
'aaa_jdbc'=0A=20=20=20ORDER=20BY=20=20=
c.relname::information_schema.sql_identifier;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_get_column_size(=20v_table=20varchar(64),=20v_column=20varchar(64))=20=
returns=20integer=20STABLE=0A=20=20=20AS=20$procedure$=0A=20=20=20=
declare=0A=20=20=20retvalue=20=20integer;=0ABEGIN=0A=20=20=20retvalue=20=
:=3D=20character_maximum_length=20from=20information_schema.columns=0A=20=
=20=20=20where=0A=20=20=20=20table_schema=20=3D=20'aaa_jdbc'=20and=0A=20=20=
=20=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column=20and=0A=20=20=20=20table_schema=20=3D=20'aaa_jdbc'=20and=20=
udt_name=20in=20('char','varchar');=0A=20=20=20return=20retvalue;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_mask_object(v_object=20regclass)=20RETURNS=20=
setof=20record=20as=0A$BODY$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=20=20=
=20=20v_table=20record;=0A=20=20=20=20v_table_name=20TEXT;=0A=20=20=20=20=
temprec=20record;=0ABEGIN=0A=20=20=20=20--=20get=20full=20table/view=20=
name=20from=20v_object=20(i.e=20<namespace>.<name>)=0A=20=20=20=20select=20=
c.relname,=20n.nspname=20INTO=20v_table=0A=20=20=20=20=20=20=20=20FROM=20=
pg_class=20c=20join=20pg_namespace=20n=20on=20c.relnamespace=20=3D=20=
n.oid=20WHERE=20c.oid=20=3D=20v_object;=0A=20=20=20=20--=20try=20to=20=
get=20filtered=20query=20syntax=20from=20previous=20execution=0A=20=20=20=
=20if=20exists=20(select=201=20from=20object_column_white_list_sql=20=
where=20object_name=20=3D=20v_table.relname)=20then=0A=09select=20sql=20=
into=20v_sql=20from=20object_column_white_list_sql=20where=20object_name=20=
=3D=20v_table.relname;=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
v_table_name=20:=3D=20quote_ident(=20v_table.nspname=20)=20||=20'.'=20||=20=
quote_ident(=20v_table.relname=20);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20=20=20=20=20for=20temprec=20in=20select=20a.attname,=20=
t.typname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_attribute=20a=20join=20pg_type=20t=20on=20a.atttypid=20=3D=
=20t.oid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20a.attrelid=20=3D=20v_object=20AND=20a.attnum=20>=200=20AND=20=
NOT=20a.attisdropped=20ORDER=20BY=20a.attnum=0A=20=20=20=20=20=20=20=20=
loop=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20coalesce(=20=
v_sql=20||=20',=20',=20'SELECT=20'=20);=0A=20=20=20=20=20=20=20=20=20=20=20=
=20if=20exists(select=201=20from=20object_column_white_list=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20where=20object_name=20=3D=20=
v_table.relname=20and=20column_name=20=3D=20temprec.attname)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20=
quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20=
||=20'NULL::'=20||=20quote_ident(=20temprec.typname=20)=20||=20'=20as=20=
'=20||=20quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=
=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20END=20LOOP;=0A=20=20=20=20=20=
=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=
=20=20=20=20=20=20=20=20v_sql=20:=3D=20'SELECT=20x::'=20||=20=
v_table_name=20||=20'=20as=20rec=20FROM=20('=20||=20v_sql=20||=20')=20as=20=
x';=0A=20=20=20=20=20=20=20=20--=20save=20generated=20query=20for=20=
further=20use=0A=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list_sql(object_name,sql)=20values=20=
(v_table.relname,=20v_sql);=0A=20=20=20=20end=20if;=0A=20=20=20=20RETURN=20=
QUERY=20EXECUTE=20v_sql;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_is_table_exists=20=
(v_table=20varchar(64))=20returns=20boolean=20STABLE=0A=20=20=20AS=20=
$procedure$=0A=20=20=20declare=0A=20=20=20retvalue=20=20boolean;=0ABEGIN=0A=
=20=20=20retvalue=20:=3D=20EXISTS=20(=0A=20=20=20=20=20=20=20=20SELECT=20=
*=20FROM=20information_schema.tables=20WHERE=20table_schema=20=3D=20=
'aaa_jdbc'=20AND=20table_name=20ILIKE=20v_table=0A=20=20=20);=0A=20=20=20=
return=20retvalue;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_create_index(v_index_name=20varchar(128),=20v_table_name=20=
varchar(128),=20v_column_names=20text,=20v_where_predicate=20text)=0A=
returns=20void=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=
BEGIN=0A=20=20=20=20v_sql=20:=3D=20'DROP=20INDEX=20'=20||=20'=20IF=20=
EXISTS=20'=20||=20v_index_name=20||=20';=20CREATE=20INDEX=20'=20||=20=
v_index_name=20||=20'=20ON=20'=20||=20v_table_name=20||=20'('=20||=20=
v_column_names=20||=20')';=0A=20=20=20=20IF=20v_where_predicate=20=3D=20=
''=20THEN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20';';=0A=20=
=20=20=20ELSE=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20=
WHERE=20'=20||=20v_where_predicate=20||=20';';=0A=20=20=20=20END=20IF;=0A=
=20=20=20=20EXECUTE=20v_sql;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=20=
fn_db_add_config_value_for_versions_up_to(v_option_name=20varchar(100),=20=
v_val=20varchar(4000),=20v_version=20varchar(40))=0Areturns=20void=0AAS=20=
$procedure$=0Adeclare=0A=20=20=20=20i=20=20=20int;=0A=20=20=20=20arr=20=
varchar[]=20:=3D=20array['3.0',=20'3.1',=20'3.2',=20'3.3',=20'3.4',=20=
'3.5',=20'3.6'];=0Abegin=0A=20=20=20=20FOR=20i=20IN=20array_lower(arr,=20=
1)=20..=20array_upper(arr,=201)=0A=20=20=20=20LOOP=0A=20=20=20=20=20=20=20=
=20PERFORM=20fn_db_add_config_value(v_option_name,=20v_val,=20arr[i]);=0A=
=20=20=20=20=20=20=20=20EXIT=20WHEN=20=20arr[i]=20=3D=20v_version;=0A=20=20=
=20=20END=20LOOP;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Aselect=20*=20from=20=
aaa_jdbc.generate_drop_all_views_syntax();=0A**************************=0A=
=0A=0A*********=20QUERY=20**********=0ASET=20search_path=20TO=20=
aaa_jdbc;=0A**************************=0A=0ASET=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20fn_db_add_column(v_table=20=
varchar(128),=20v_column=20varchar(128),=20v_column_def=20text)=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0A=0Abegin=0A=
=09if=20(not=20exists=20(select=201=20from=20information_schema.columns=20=
where=20table_schema=20=3D=20'aaa_jdbc'=20and=20table_name=20ilike=20=
v_table=20and=20column_name=20ilike=20v_column))=20then=0A=09=20=20=20=20=
begin=0A=09=09v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20=
ADD=20COLUMN=20'=20||=20v_column=20||=20'=20'=20||=20v_column_def;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_drop_column(v_table=20varchar(128),=20v_column=20varchar(128))=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0Abegin=0A=20=
=20=20=20=20=20=20=20if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column))=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20begin=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20=
||=20v_table=20||=20'=20DROP=20COLUMN=20'=20||=20v_column;=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=20=20=20=20=
=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=
=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20Column=20%=20=
does=20not=20exist.',=20v_table,=20v_column;=0A=20=20=20=20=20=20=20=20=
end=20if;=0Aend;$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_change_column_type(v_table=20varchar(128),=20v_column=20=
varchar(128),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_type=20varchar(128),=20v_new_type=20=
varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20=
text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column=20and=20(udt_name=20ilike=20v_type=20or=20data_type=20ilike=20=
v_type)))=20then=0A=09=20=20=20=20begin=0A=09=09v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20ALTER=20COLUMN=20'=20||=20v_column=20=
||=20'=20TYPE=20'=20||=20v_new_type;=0A=09=09EXECUTE=20v_sql;=0A=20=20=20=
=20=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20=20=20=20=20=
---=20ignore=20operation=20if=20requested=20type=20is=20already=20there=0A=
=20=20=20=20=20=20=20=20elsif=20(not=20exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column=20and=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
(udt_name=20ilike=20v_new_type=20or=20data_type=20ilike=20v_new_type)))=20=
then=0A=20=20=20=20=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20=
%=20or=20Column=20%=20does=20not=20exist.',=20v_table,=20v_column;=0A=09=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_rename_column(v_table=20varchar(128),=20v_column=20varchar(128),=20=
v_new_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0A=
v_sql=20text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column))=20then=0A=09=20=20=20=20begin=0A=09=09v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20RENAME=20COLUMN=20'=20||=20v_column=20=
||=20'=20TO=20'=20||=20v_new_name;=0A=09=09EXECUTE=20v_sql;=0A=20=20=20=20=
=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20else=0A=20=20=20=20=
=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20Column=20%=20=
does=20not=20exist.',=20v_table,=20v_column;=0A=09end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20function=20fn_db_create_constraint=20(=0A=20=20=20=20v_table=20=
varchar(128),=20v_constraint=20varchar(128),=20v_constraint_sql=20text)=0A=
returns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=20NOT=20=
EXISTS=20(SELECT=201=20from=20pg_constraint=20where=20conname=20ilike=20=
v_constraint)=20then=0A=20=20=20=20=20=20=20=20execute=20'ALTER=20TABLE=20=
'=20||=20v_table=20||=20=20'=20ADD=20CONSTRAINT=20'=20||=20v_constraint=20=
||=20'=20'=20||=20v_constraint_sql;=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20function=20fn_db_drop_constraint=20(=0A=20=20=20=20v_table=20=
varchar(128),=20v_constraint=20varchar(128))=0Areturns=20void=0AAS=20=
$procedure$=0Abegin=0A=20=20=20=20if=20=20EXISTS=20(SELECT=201=20from=20=
pg_constraint=20where=20conname=20ilike=20v_constraint)=20then=0A=20=20=20=
=20=20=20=20=20execute=20'ALTER=20TABLE=20'=20||=20v_table=20||=20=20'=20=
DROP=20CONSTRAINT=20'=20||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20CheckDBConnection()=20=
RETURNS=20SETOF=20integer=20IMMUTABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=20SELECT=201;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=20from=20=
pg_proc=20inner=20join=20pg_namespace=20ns=20on=20=
(pg_proc.pronamespace=3Dns.oid)=20where=20ns.nspname=20=3D=20'aaa_jdbc'=20=
order=20by=20proname;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_views_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=20=
=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20VIEW=20=
if=20exists=20'=20||=20table_schema=20||=20'.'=20||=20table_name=20||=20=
'=20CASCADE;'=20from=20information_schema.views=20where=20table_schema=20=
=3D=20'aaa_jdbc'=20order=20by=20table_name;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_tables_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20TABLE=20=
if=20exists=20'=20||=20table_schema=20||=20'.'=20||=20table_name=20||=20=
'=20CASCADE;'=20from=20information_schema.tables=20where=20table_schema=20=
=3D=20'aaa_jdbc'=20and=20table_type=20=3D=20'BASE=20TABLE'=20order=20by=20=
table_name;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_seq_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=20=
=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20SEQUENCE=20=
if=20exists=20'=20||=20sequence_schema=20||=20'.'=20||=20sequence_name=20=
||=20'=20CASCADE;'=20from=20information_schema.sequences=20=20where=20=
sequence_schema=20=3D=20'aaa_jdbc'=20order=20by=20sequence_name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_user_types_syntax()=20RETURNS=20=
SETOF=20text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20=
QUERY=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20FROM=20pg_namespace=20n,=20pg_class=20c,=20pg_type=20t=0A=20=20=20=
WHERE=20n.oid=20=3D=20c.relnamespace=20and=20t.typrelid=20=3D=20c.oid=20=
and=20c.relkind=20=3D=20'c'::"char"=20and=0A=20=20=20n.nspname=20=3D=20=
'aaa_jdbc'=0A=20=20=20ORDER=20BY=20=20=
c.relname::information_schema.sql_identifier;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_get_column_size(=20v_table=20varchar(64),=20v_column=20varchar(64))=20=
returns=20integer=20STABLE=0A=20=20=20AS=20$procedure$=0A=20=20=20=
declare=0A=20=20=20retvalue=20=20integer;=0ABEGIN=0A=20=20=20retvalue=20=
:=3D=20character_maximum_length=20from=20information_schema.columns=0A=20=
=20=20=20where=0A=20=20=20=20table_schema=20=3D=20'aaa_jdbc'=20and=0A=20=20=
=20=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column=20and=0A=20=20=20=20table_schema=20=3D=20'aaa_jdbc'=20and=20=
udt_name=20in=20('char','varchar');=0A=20=20=20return=20retvalue;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_mask_object(v_object=20regclass)=20RETURNS=20=
setof=20record=20as=0A$BODY$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=20=20=
=20=20v_table=20record;=0A=20=20=20=20v_table_name=20TEXT;=0A=20=20=20=20=
temprec=20record;=0ABEGIN=0A=20=20=20=20--=20get=20full=20table/view=20=
name=20from=20v_object=20(i.e=20<namespace>.<name>)=0A=20=20=20=20select=20=
c.relname,=20n.nspname=20INTO=20v_table=0A=20=20=20=20=20=20=20=20FROM=20=
pg_class=20c=20join=20pg_namespace=20n=20on=20c.relnamespace=20=3D=20=
n.oid=20WHERE=20c.oid=20=3D=20v_object;=0A=20=20=20=20--=20try=20to=20=
get=20filtered=20query=20syntax=20from=20previous=20execution=0A=20=20=20=
=20if=20exists=20(select=201=20from=20object_column_white_list_sql=20=
where=20object_name=20=3D=20v_table.relname)=20then=0A=09select=20sql=20=
into=20v_sql=20from=20object_column_white_list_sql=20where=20object_name=20=
=3D=20v_table.relname;=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
v_table_name=20:=3D=20quote_ident(=20v_table.nspname=20)=20||=20'.'=20||=20=
quote_ident(=20v_table.relname=20);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20=20=20=20=20for=20temprec=20in=20select=20a.attname,=20=
t.typname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_attribute=20a=20join=20pg_type=20t=20on=20a.atttypid=20=3D=
=20t.oid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20a.attrelid=20=3D=20v_object=20AND=20a.attnum=20>=200=20AND=20=
NOT=20a.attisdropped=20ORDER=20BY=20a.attnum=0A=20=20=20=20=20=20=20=20=
loop=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20coalesce(=20=
v_sql=20||=20',=20',=20'SELECT=20'=20);=0A=20=20=20=20=20=20=20=20=20=20=20=
=20if=20exists(select=201=20from=20object_column_white_list=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20where=20object_name=20=3D=20=
v_table.relname=20and=20column_name=20=3D=20temprec.attname)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20=
quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20=
||=20'NULL::'=20||=20quote_ident(=20temprec.typname=20)=20||=20'=20as=20=
'=20||=20quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=
=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20END=20LOOP;=0A=20=20=20=20=20=
=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=
=20=20=20=20=20=20=20=20v_sql=20:=3D=20'SELECT=20x::'=20||=20=
v_table_name=20||=20'=20as=20rec=20FROM=20('=20||=20v_sql=20||=20')=20as=20=
x';=0A=20=20=20=20=20=20=20=20--=20save=20generated=20query=20for=20=
further=20use=0A=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list_sql(object_name,sql)=20values=20=
(v_table.relname,=20v_sql);=0A=20=20=20=20end=20if;=0A=20=20=20=20RETURN=20=
QUERY=20EXECUTE=20v_sql;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_is_table_exists=20=
(v_table=20varchar(64))=20returns=20boolean=20STABLE=0A=20=20=20AS=20=
$procedure$=0A=20=20=20declare=0A=20=20=20retvalue=20=20boolean;=0ABEGIN=0A=
=20=20=20retvalue=20:=3D=20EXISTS=20(=0A=20=20=20=20=20=20=20=20SELECT=20=
*=20FROM=20information_schema.tables=20WHERE=20table_schema=20=3D=20=
'aaa_jdbc'=20AND=20table_name=20ILIKE=20v_table=0A=20=20=20);=0A=20=20=20=
return=20retvalue;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_create_index(v_index_name=20varchar(128),=20v_table_name=20=
varchar(128),=20v_column_names=20text,=20v_where_predicate=20text)=0A=
returns=20void=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=
BEGIN=0A=20=20=20=20v_sql=20:=3D=20'DROP=20INDEX=20'=20||=20'=20IF=20=
EXISTS=20'=20||=20v_index_name=20||=20';=20CREATE=20INDEX=20'=20||=20=
v_index_name=20||=20'=20ON=20'=20||=20v_table_name=20||=20'('=20||=20=
v_column_names=20||=20')';=0A=20=20=20=20IF=20v_where_predicate=20=3D=20=
''=20THEN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20';';=0A=20=
=20=20=20ELSE=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20=
WHERE=20'=20||=20v_where_predicate=20||=20';';=0A=20=20=20=20END=20IF;=0A=
=20=20=20=20EXECUTE=20v_sql;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=20=
fn_db_add_config_value_for_versions_up_to(v_option_name=20varchar(100),=20=
v_val=20varchar(4000),=20v_version=20varchar(40))=0Areturns=20void=0AAS=20=
$procedure$=0Adeclare=0A=20=20=20=20i=20=20=20int;=0A=20=20=20=20arr=20=
varchar[]=20:=3D=20array['3.0',=20'3.1',=20'3.2',=20'3.3',=20'3.4',=20=
'3.5',=20'3.6'];=0Abegin=0A=20=20=20=20FOR=20i=20IN=20array_lower(arr,=20=
1)=20..=20array_upper(arr,=201)=0A=20=20=20=20LOOP=0A=20=20=20=20=20=20=20=
=20PERFORM=20fn_db_add_config_value(v_option_name,=20v_val,=20arr[i]);=0A=
=20=20=20=20=20=20=20=20EXIT=20WHEN=20=20arr[i]=20=3D=20v_version;=0A=20=20=
=20=20END=20LOOP;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Aselect=20*=20from=20=
aaa_jdbc.generate_drop_all_functions_syntax();=0A=
**************************=0A=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.checkdbconnection()=20cascade;=0A=20drop=20function=20if=20=
exists=20aaa_jdbc.fn_db_add_column(character=20varying,=20character=20=
varying,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_db_add_config_value_for_versions_up_to(character=20varying,=20=
character=20varying,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20aaa_jdbc.fn_db_change_column_type(character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_db_create_constraint(character=20varying,=20character=20=
varying,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_db_create_index(character=20varying,=20character=20varying,=20=
text,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_db_drop_column(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_db_drop_constraint(character=20varying,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_db_is_table_exists(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20aaa_jdbc.fn_db_mask_object(regclass)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_db_rename_column(character=20varying,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_get_column_size(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.generate_drop_all_functions_syntax()=20cascade;=0A=20drop=20=
function=20if=20exists=20aaa_jdbc.generate_drop_all_seq_syntax()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.generate_drop_all_tables_syntax()=20cascade;=0A=20drop=20=
function=20if=20exists=20aaa_jdbc.generate_drop_all_user_types_syntax()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.generate_drop_all_views_syntax()=20cascade;=0A=0A*********=20=
QUERY=20**********=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.checkdbconnection()=20cascade;=0A=20drop=20function=20if=20=
exists=20aaa_jdbc.fn_db_add_column(character=20varying,=20character=20=
varying,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_db_add_config_value_for_versions_up_to(character=20varying,=20=
character=20varying,=20character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20aaa_jdbc.fn_db_change_column_type(character=20=
varying,=20character=20varying,=20character=20varying,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_db_create_constraint(character=20varying,=20character=20=
varying,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_db_create_index(character=20varying,=20character=20varying,=20=
text,=20text)=20cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_db_drop_column(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_db_drop_constraint(character=20varying,=20character=20=
varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_db_is_table_exists(character=20varying)=20cascade;=0A=20drop=20=
function=20if=20exists=20aaa_jdbc.fn_db_mask_object(regclass)=20cascade;=0A=
=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_db_rename_column(character=20varying,=20character=20varying,=20=
character=20varying)=20cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.fn_get_column_size(character=20varying,=20character=20varying)=20=
cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.generate_drop_all_functions_syntax()=20cascade;=0A=20drop=20=
function=20if=20exists=20aaa_jdbc.generate_drop_all_seq_syntax()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.generate_drop_all_tables_syntax()=20cascade;=0A=20drop=20=
function=20if=20exists=20aaa_jdbc.generate_drop_all_user_types_syntax()=20=
cascade;=0A=20drop=20function=20if=20exists=20=
aaa_jdbc.generate_drop_all_views_syntax()=20cascade;=0A=
**************************=0A=0ADROP=20FUNCTION=0A*********=20QUERY=20=
**********=0ASET=20search_path=20TO=20aaa_jdbc;=0A=
**************************=0A=0ASET=0A*********=20QUERY=20**********=0A=
SET=20search_path=20TO=20aaa_jdbc;=0A**************************=0A=0ASET=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_add_column(v_table=20varchar(128),=20v_column=20varchar(128),=20=
v_column_def=20text)=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0A=
v_sql=20text;=0A=0Abegin=0A=09if=20(not=20exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column))=20then=0A=09=20=20=20=20begin=0A=09=09v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20ADD=20COLUMN=20'=20||=20v_column=20=
||=20'=20'=20||=20v_column_def;=0A=09=09EXECUTE=20v_sql;=0A=20=20=20=20=20=
=20=20=20=20=20=20=20end;=0A=09end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_drop_column(v_table=20varchar(128),=20v_column=20varchar(128))=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0Abegin=0A=20=
=20=20=20=20=20=20=20if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column))=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20begin=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20=
||=20v_table=20||=20'=20DROP=20COLUMN=20'=20||=20v_column;=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=20=20=20=20=
=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=
=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20Column=20%=20=
does=20not=20exist.',=20v_table,=20v_column;=0A=20=20=20=20=20=20=20=20=
end=20if;=0Aend;$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_change_column_type(v_table=20varchar(128),=20v_column=20=
varchar(128),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_type=20varchar(128),=20v_new_type=20=
varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20=
text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column=20and=20(udt_name=20ilike=20v_type=20or=20data_type=20ilike=20=
v_type)))=20then=0A=09=20=20=20=20begin=0A=09=09v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20ALTER=20COLUMN=20'=20||=20v_column=20=
||=20'=20TYPE=20'=20||=20v_new_type;=0A=09=09EXECUTE=20v_sql;=0A=20=20=20=
=20=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20=20=20=20=20=
---=20ignore=20operation=20if=20requested=20type=20is=20already=20there=0A=
=20=20=20=20=20=20=20=20elsif=20(not=20exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column=20and=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
(udt_name=20ilike=20v_new_type=20or=20data_type=20ilike=20v_new_type)))=20=
then=0A=20=20=20=20=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20=
%=20or=20Column=20%=20does=20not=20exist.',=20v_table,=20v_column;=0A=09=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_rename_column(v_table=20varchar(128),=20v_column=20varchar(128),=20=
v_new_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0A=
v_sql=20text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column))=20then=0A=09=20=20=20=20begin=0A=09=09v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20RENAME=20COLUMN=20'=20||=20v_column=20=
||=20'=20TO=20'=20||=20v_new_name;=0A=09=09EXECUTE=20v_sql;=0A=20=20=20=20=
=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20else=0A=20=20=20=20=
=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20Column=20%=20=
does=20not=20exist.',=20v_table,=20v_column;=0A=09end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20function=20fn_db_create_constraint=20(=0A=20=20=20=20v_table=20=
varchar(128),=20v_constraint=20varchar(128),=20v_constraint_sql=20text)=0A=
returns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=20NOT=20=
EXISTS=20(SELECT=201=20from=20pg_constraint=20where=20conname=20ilike=20=
v_constraint)=20then=0A=20=20=20=20=20=20=20=20execute=20'ALTER=20TABLE=20=
'=20||=20v_table=20||=20=20'=20ADD=20CONSTRAINT=20'=20||=20v_constraint=20=
||=20'=20'=20||=20v_constraint_sql;=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20function=20fn_db_drop_constraint=20(=0A=20=20=20=20v_table=20=
varchar(128),=20v_constraint=20varchar(128))=0Areturns=20void=0AAS=20=
$procedure$=0Abegin=0A=20=20=20=20if=20=20EXISTS=20(SELECT=201=20from=20=
pg_constraint=20where=20conname=20ilike=20v_constraint)=20then=0A=20=20=20=
=20=20=20=20=20execute=20'ALTER=20TABLE=20'=20||=20v_table=20||=20=20'=20=
DROP=20CONSTRAINT=20'=20||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20CheckDBConnection()=20=
RETURNS=20SETOF=20integer=20IMMUTABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=20SELECT=201;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=20from=20=
pg_proc=20inner=20join=20pg_namespace=20ns=20on=20=
(pg_proc.pronamespace=3Dns.oid)=20where=20ns.nspname=20=3D=20'aaa_jdbc'=20=
order=20by=20proname;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_views_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=20=
=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20VIEW=20=
if=20exists=20'=20||=20table_schema=20||=20'.'=20||=20table_name=20||=20=
'=20CASCADE;'=20from=20information_schema.views=20where=20table_schema=20=
=3D=20'aaa_jdbc'=20order=20by=20table_name;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_tables_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20TABLE=20=
if=20exists=20'=20||=20table_schema=20||=20'.'=20||=20table_name=20||=20=
'=20CASCADE;'=20from=20information_schema.tables=20where=20table_schema=20=
=3D=20'aaa_jdbc'=20and=20table_type=20=3D=20'BASE=20TABLE'=20order=20by=20=
table_name;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_seq_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=20=
=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20SEQUENCE=20=
if=20exists=20'=20||=20sequence_schema=20||=20'.'=20||=20sequence_name=20=
||=20'=20CASCADE;'=20from=20information_schema.sequences=20=20where=20=
sequence_schema=20=3D=20'aaa_jdbc'=20order=20by=20sequence_name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_user_types_syntax()=20RETURNS=20=
SETOF=20text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20=
QUERY=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20FROM=20pg_namespace=20n,=20pg_class=20c,=20pg_type=20t=0A=20=20=20=
WHERE=20n.oid=20=3D=20c.relnamespace=20and=20t.typrelid=20=3D=20c.oid=20=
and=20c.relkind=20=3D=20'c'::"char"=20and=0A=20=20=20n.nspname=20=3D=20=
'aaa_jdbc'=0A=20=20=20ORDER=20BY=20=20=
c.relname::information_schema.sql_identifier;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_get_column_size(=20v_table=20varchar(64),=20v_column=20varchar(64))=20=
returns=20integer=20STABLE=0A=20=20=20AS=20$procedure$=0A=20=20=20=
declare=0A=20=20=20retvalue=20=20integer;=0ABEGIN=0A=20=20=20retvalue=20=
:=3D=20character_maximum_length=20from=20information_schema.columns=0A=20=
=20=20=20where=0A=20=20=20=20table_schema=20=3D=20'aaa_jdbc'=20and=0A=20=20=
=20=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column=20and=0A=20=20=20=20table_schema=20=3D=20'aaa_jdbc'=20and=20=
udt_name=20in=20('char','varchar');=0A=20=20=20return=20retvalue;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_mask_object(v_object=20regclass)=20RETURNS=20=
setof=20record=20as=0A$BODY$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=20=20=
=20=20v_table=20record;=0A=20=20=20=20v_table_name=20TEXT;=0A=20=20=20=20=
temprec=20record;=0ABEGIN=0A=20=20=20=20--=20get=20full=20table/view=20=
name=20from=20v_object=20(i.e=20<namespace>.<name>)=0A=20=20=20=20select=20=
c.relname,=20n.nspname=20INTO=20v_table=0A=20=20=20=20=20=20=20=20FROM=20=
pg_class=20c=20join=20pg_namespace=20n=20on=20c.relnamespace=20=3D=20=
n.oid=20WHERE=20c.oid=20=3D=20v_object;=0A=20=20=20=20--=20try=20to=20=
get=20filtered=20query=20syntax=20from=20previous=20execution=0A=20=20=20=
=20if=20exists=20(select=201=20from=20object_column_white_list_sql=20=
where=20object_name=20=3D=20v_table.relname)=20then=0A=09select=20sql=20=
into=20v_sql=20from=20object_column_white_list_sql=20where=20object_name=20=
=3D=20v_table.relname;=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
v_table_name=20:=3D=20quote_ident(=20v_table.nspname=20)=20||=20'.'=20||=20=
quote_ident(=20v_table.relname=20);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20=20=20=20=20for=20temprec=20in=20select=20a.attname,=20=
t.typname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_attribute=20a=20join=20pg_type=20t=20on=20a.atttypid=20=3D=
=20t.oid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20a.attrelid=20=3D=20v_object=20AND=20a.attnum=20>=200=20AND=20=
NOT=20a.attisdropped=20ORDER=20BY=20a.attnum=0A=20=20=20=20=20=20=20=20=
loop=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20coalesce(=20=
v_sql=20||=20',=20',=20'SELECT=20'=20);=0A=20=20=20=20=20=20=20=20=20=20=20=
=20if=20exists(select=201=20from=20object_column_white_list=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20where=20object_name=20=3D=20=
v_table.relname=20and=20column_name=20=3D=20temprec.attname)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20=
quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20=
||=20'NULL::'=20||=20quote_ident(=20temprec.typname=20)=20||=20'=20as=20=
'=20||=20quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=
=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20END=20LOOP;=0A=20=20=20=20=20=
=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=
=20=20=20=20=20=20=20=20v_sql=20:=3D=20'SELECT=20x::'=20||=20=
v_table_name=20||=20'=20as=20rec=20FROM=20('=20||=20v_sql=20||=20')=20as=20=
x';=0A=20=20=20=20=20=20=20=20--=20save=20generated=20query=20for=20=
further=20use=0A=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list_sql(object_name,sql)=20values=20=
(v_table.relname,=20v_sql);=0A=20=20=20=20end=20if;=0A=20=20=20=20RETURN=20=
QUERY=20EXECUTE=20v_sql;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_is_table_exists=20=
(v_table=20varchar(64))=20returns=20boolean=20STABLE=0A=20=20=20AS=20=
$procedure$=0A=20=20=20declare=0A=20=20=20retvalue=20=20boolean;=0ABEGIN=0A=
=20=20=20retvalue=20:=3D=20EXISTS=20(=0A=20=20=20=20=20=20=20=20SELECT=20=
*=20FROM=20information_schema.tables=20WHERE=20table_schema=20=3D=20=
'aaa_jdbc'=20AND=20table_name=20ILIKE=20v_table=0A=20=20=20);=0A=20=20=20=
return=20retvalue;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_create_index(v_index_name=20varchar(128),=20v_table_name=20=
varchar(128),=20v_column_names=20text,=20v_where_predicate=20text)=0A=
returns=20void=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=
BEGIN=0A=20=20=20=20v_sql=20:=3D=20'DROP=20INDEX=20'=20||=20'=20IF=20=
EXISTS=20'=20||=20v_index_name=20||=20';=20CREATE=20INDEX=20'=20||=20=
v_index_name=20||=20'=20ON=20'=20||=20v_table_name=20||=20'('=20||=20=
v_column_names=20||=20')';=0A=20=20=20=20IF=20v_where_predicate=20=3D=20=
''=20THEN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20';';=0A=20=
=20=20=20ELSE=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20=
WHERE=20'=20||=20v_where_predicate=20||=20';';=0A=20=20=20=20END=20IF;=0A=
=20=20=20=20EXECUTE=20v_sql;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=20=
fn_db_add_config_value_for_versions_up_to(v_option_name=20varchar(100),=20=
v_val=20varchar(4000),=20v_version=20varchar(40))=0Areturns=20void=0AAS=20=
$procedure$=0Adeclare=0A=20=20=20=20i=20=20=20int;=0A=20=20=20=20arr=20=
varchar[]=20:=3D=20array['3.0',=20'3.1',=20'3.2',=20'3.3',=20'3.4',=20=
'3.5',=20'3.6'];=0Abegin=0A=20=20=20=20FOR=20i=20IN=20array_lower(arr,=20=
1)=20..=20array_upper(arr,=201)=0A=20=20=20=20LOOP=0A=20=20=20=20=20=20=20=
=20PERFORM=20fn_db_add_config_value(v_option_name,=20v_val,=20arr[i]);=0A=
=20=20=20=20=20=20=20=20EXIT=20WHEN=20=20arr[i]=20=3D=20v_version;=0A=20=20=
=20=20END=20LOOP;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ASET=20search_path=20TO=20aaa_jdbc;=0A=
**************************=0A=0ASET=0A*********=20QUERY=20**********=0A=
SELECT=20setval('schema_version_seq',=20max(id))=20FROM=20=
schema_version;=0A**************************=0A=0A=20=20=20=20=20=206=0A=0A=
*********=20QUERY=20**********=0Acopy=20(=0A=09=09select=20version=0A=09=09=
from=20aaa_jdbc.schema_version=0A=09=09where=20current=20=3D=20true=0A=09=
=09order=20by=20id=0A=09=09LIMIT=201=0A=09)=20to=20stdout=20with=20=
delimiter=20as=20'|';=0A**************************=0A=0A*********=20=
QUERY=20**********=0Acopy=20(select=20now())=20to=20stdout=20with=20=
delimiter=20as=20'|';=0A**************************=0A=0A*********=20=
QUERY=20**********=0Acopy=20(select=20now())=20to=20stdout=20with=20=
delimiter=20as=20'|';=0A**************************=0A=0A*********=20=
QUERY=20**********=0Acopy=20(select=20now())=20to=20stdout=20with=20=
delimiter=20as=20'|';=0A**************************=0A=0A*********=20=
QUERY=20**********=0Acopy=20(select=20now())=20to=20stdout=20with=20=
delimiter=20as=20'|';=0A**************************=0A=0A*********=20=
QUERY=20**********=0Acopy=20(select=20now())=20to=20stdout=20with=20=
delimiter=20as=20'|';=0A**************************=0A=0A*********=20=
QUERY=20**********=0Acopy=20(select=20now())=20to=20stdout=20with=20=
delimiter=20as=20'|';=0A**************************=0A=0A*********=20=
QUERY=20**********=0Acopy=20(=0A=09=09=09select=20max(id)=0A=09=09=09=
from=20aaa_jdbc.schema_version=0A=09=09=09where=20state=20in=20=
('INSTALLED','SKIPPED')=0A=09=09)=20to=20stdout=20with=20delimiter=20as=20=
'|';=0A**************************=0A=0A*********=20QUERY=20**********=0A=0A=
=09=09update=20aaa_jdbc.schema_version=0A=09=09set=20current=3D(id=3D6);=0A=
=09=0A**************************=0A=0AUPDATE=206=0A*********=20QUERY=20=
**********=0ASET=20search_path=20TO=20aaa_jdbc;=0A=
**************************=0A=0ASET=0A*********=20QUERY=20**********=0A=
Create=20or=20replace=20FUNCTION=20fn_db_add_column(v_table=20=
varchar(128),=20v_column=20varchar(128),=20v_column_def=20text)=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0A=0Abegin=0A=
=09if=20(not=20exists=20(select=201=20from=20information_schema.columns=20=
where=20table_schema=20=3D=20'@SCHEMA_NAME@'=20and=20table_name=20ilike=20=
v_table=20and=20column_name=20ilike=20v_column))=20then=0A=09=20=20=20=20=
begin=0A=09=09v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20=
ADD=20COLUMN=20'=20||=20v_column=20||=20'=20'=20||=20v_column_def;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_drop_column(v_table=20varchar(128),=20v_column=20varchar(128))=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0Abegin=0A=20=
=20=20=20=20=20=20=20if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20=
'@SCHEMA_NAME@'=20and=20table_name=20ilike=20v_table=20and=20column_name=20=
ilike=20v_column))=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20begin=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20DROP=20COLUMN=20'=20||=20v_column;=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=
=20=20=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20else=0A=20=20=
=20=20=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20=
Column=20%=20does=20not=20exist.',=20v_table,=20v_column;=0A=20=20=20=20=20=
=20=20=20end=20if;=0Aend;$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_change_column_type(v_table=20varchar(128),=20v_column=20=
varchar(128),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_type=20varchar(128),=20v_new_type=20=
varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20=
text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20=
'@SCHEMA_NAME@'=20and=20table_name=20ilike=20v_table=20and=20column_name=20=
ilike=20v_column=20and=20(udt_name=20ilike=20v_type=20or=20data_type=20=
ilike=20v_type)))=20then=0A=09=20=20=20=20begin=0A=09=09v_sql=20:=3D=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20ALTER=20COLUMN=20'=20||=20=
v_column=20||=20'=20TYPE=20'=20||=20v_new_type;=0A=09=09EXECUTE=20v_sql;=0A=
=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20=20=20=
=20=20---=20ignore=20operation=20if=20requested=20type=20is=20already=20=
there=0A=20=20=20=20=20=20=20=20elsif=20(not=20exists=20(select=201=20=
from=20information_schema.columns=20where=20table_schema=20=3D=20=
'@SCHEMA_NAME@'=20and=20table_name=20ilike=20v_table=20and=20column_name=20=
ilike=20v_column=20and=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
(udt_name=20ilike=20v_new_type=20or=20data_type=20ilike=20v_new_type)))=20=
then=0A=20=20=20=20=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20=
%=20or=20Column=20%=20does=20not=20exist.',=20v_table,=20v_column;=0A=09=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_rename_column(v_table=20varchar(128),=20v_column=20varchar(128),=20=
v_new_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0A=
v_sql=20text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20=
'@SCHEMA_NAME@'=20and=20table_name=20ilike=20v_table=20and=20column_name=20=
ilike=20v_column))=20then=0A=09=20=20=20=20begin=0A=09=09v_sql=20:=3D=20=
'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20RENAME=20COLUMN=20'=20||=20=
v_column=20||=20'=20TO=20'=20||=20v_new_name;=0A=09=09EXECUTE=20v_sql;=0A=
=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20else=0A=
=20=20=20=20=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20=
Column=20%=20does=20not=20exist.',=20v_table,=20v_column;=0A=09end=20if;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20function=20fn_db_create_constraint=20(=0A=20=20=20=20v_table=20=
varchar(128),=20v_constraint=20varchar(128),=20v_constraint_sql=20text)=0A=
returns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=20NOT=20=
EXISTS=20(SELECT=201=20from=20pg_constraint=20where=20conname=20ilike=20=
v_constraint)=20then=0A=20=20=20=20=20=20=20=20execute=20'ALTER=20TABLE=20=
'=20||=20v_table=20||=20=20'=20ADD=20CONSTRAINT=20'=20||=20v_constraint=20=
||=20'=20'=20||=20v_constraint_sql;=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20function=20fn_db_drop_constraint=20(=0A=20=20=20=20v_table=20=
varchar(128),=20v_constraint=20varchar(128))=0Areturns=20void=0AAS=20=
$procedure$=0Abegin=0A=20=20=20=20if=20=20EXISTS=20(SELECT=201=20from=20=
pg_constraint=20where=20conname=20ilike=20v_constraint)=20then=0A=20=20=20=
=20=20=20=20=20execute=20'ALTER=20TABLE=20'=20||=20v_table=20||=20=20'=20=
DROP=20CONSTRAINT=20'=20||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20CheckDBConnection()=20=
RETURNS=20SETOF=20integer=20IMMUTABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=20SELECT=201;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=20from=20=
pg_proc=20inner=20join=20pg_namespace=20ns=20on=20=
(pg_proc.pronamespace=3Dns.oid)=20where=20ns.nspname=20=3D=20=
'@SCHEMA_NAME@'=20order=20by=20proname;=0AEND;=20$procedure$=0ALANGUAGE=20=
plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A*********=20=
QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_views_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=20=
=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20VIEW=20=
if=20exists=20'=20||=20table_schema=20||=20'.'=20||=20table_name=20||=20=
'=20CASCADE;'=20from=20information_schema.views=20where=20table_schema=20=
=3D=20'@SCHEMA_NAME@'=20order=20by=20table_name;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_tables_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20TABLE=20=
if=20exists=20'=20||=20table_schema=20||=20'.'=20||=20table_name=20||=20=
'=20CASCADE;'=20from=20information_schema.tables=20where=20table_schema=20=
=3D=20'@SCHEMA_NAME@'=20and=20table_type=20=3D=20'BASE=20TABLE'=20order=20=
by=20table_name;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_seq_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=20=
=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20SEQUENCE=20=
if=20exists=20'=20||=20sequence_schema=20||=20'.'=20||=20sequence_name=20=
||=20'=20CASCADE;'=20from=20information_schema.sequences=20=20where=20=
sequence_schema=20=3D=20'@SCHEMA_NAME@'=20order=20by=20sequence_name;=0A=
END;=20$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_user_types_syntax()=20RETURNS=20=
SETOF=20text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20=
QUERY=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20FROM=20pg_namespace=20n,=20pg_class=20c,=20pg_type=20t=0A=20=20=20=
WHERE=20n.oid=20=3D=20c.relnamespace=20and=20t.typrelid=20=3D=20c.oid=20=
and=20c.relkind=20=3D=20'c'::"char"=20and=0A=20=20=20n.nspname=20=3D=20=
'@SCHEMA_NAME@'=0A=20=20=20ORDER=20BY=20=20=
c.relname::information_schema.sql_identifier;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_get_column_size(=20v_table=20varchar(64),=20v_column=20varchar(64))=20=
returns=20integer=20STABLE=0A=20=20=20AS=20$procedure$=0A=20=20=20=
declare=0A=20=20=20retvalue=20=20integer;=0ABEGIN=0A=20=20=20retvalue=20=
:=3D=20character_maximum_length=20from=20information_schema.columns=0A=20=
=20=20=20where=0A=20=20=20=20table_schema=20=3D=20'@SCHEMA_NAME@'=20and=0A=
=20=20=20=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column=20and=0A=20=20=20=20table_schema=20=3D=20'@SCHEMA_NAME@'=20and=20=
udt_name=20in=20('char','varchar');=0A=20=20=20return=20retvalue;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_mask_object(v_object=20regclass)=20RETURNS=20=
setof=20record=20as=0A$BODY$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=20=20=
=20=20v_table=20record;=0A=20=20=20=20v_table_name=20TEXT;=0A=20=20=20=20=
temprec=20record;=0ABEGIN=0A=20=20=20=20--=20get=20full=20table/view=20=
name=20from=20v_object=20(i.e=20<namespace>.<name>)=0A=20=20=20=20select=20=
c.relname,=20n.nspname=20INTO=20v_table=0A=20=20=20=20=20=20=20=20FROM=20=
pg_class=20c=20join=20pg_namespace=20n=20on=20c.relnamespace=20=3D=20=
n.oid=20WHERE=20c.oid=20=3D=20v_object;=0A=20=20=20=20--=20try=20to=20=
get=20filtered=20query=20syntax=20from=20previous=20execution=0A=20=20=20=
=20if=20exists=20(select=201=20from=20object_column_white_list_sql=20=
where=20object_name=20=3D=20v_table.relname)=20then=0A=09select=20sql=20=
into=20v_sql=20from=20object_column_white_list_sql=20where=20object_name=20=
=3D=20v_table.relname;=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
v_table_name=20:=3D=20quote_ident(=20v_table.nspname=20)=20||=20'.'=20||=20=
quote_ident(=20v_table.relname=20);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20=20=20=20=20for=20temprec=20in=20select=20a.attname,=20=
t.typname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_attribute=20a=20join=20pg_type=20t=20on=20a.atttypid=20=3D=
=20t.oid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20a.attrelid=20=3D=20v_object=20AND=20a.attnum=20>=200=20AND=20=
NOT=20a.attisdropped=20ORDER=20BY=20a.attnum=0A=20=20=20=20=20=20=20=20=
loop=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20coalesce(=20=
v_sql=20||=20',=20',=20'SELECT=20'=20);=0A=20=20=20=20=20=20=20=20=20=20=20=
=20if=20exists(select=201=20from=20object_column_white_list=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20where=20object_name=20=3D=20=
v_table.relname=20and=20column_name=20=3D=20temprec.attname)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20=
quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20=
||=20'NULL::'=20||=20quote_ident(=20temprec.typname=20)=20||=20'=20as=20=
'=20||=20quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=
=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20END=20LOOP;=0A=20=20=20=20=20=
=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=
=20=20=20=20=20=20=20=20v_sql=20:=3D=20'SELECT=20x::'=20||=20=
v_table_name=20||=20'=20as=20rec=20FROM=20('=20||=20v_sql=20||=20')=20as=20=
x';=0A=20=20=20=20=20=20=20=20--=20save=20generated=20query=20for=20=
further=20use=0A=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list_sql(object_name,sql)=20values=20=
(v_table.relname,=20v_sql);=0A=20=20=20=20end=20if;=0A=20=20=20=20RETURN=20=
QUERY=20EXECUTE=20v_sql;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_is_table_exists=20=
(v_table=20varchar(64))=20returns=20boolean=20STABLE=0A=20=20=20AS=20=
$procedure$=0A=20=20=20declare=0A=20=20=20retvalue=20=20boolean;=0ABEGIN=0A=
=20=20=20retvalue=20:=3D=20EXISTS=20(=0A=20=20=20=20=20=20=20=20SELECT=20=
*=20FROM=20information_schema.tables=20WHERE=20table_schema=20=3D=20=
'@SCHEMA_NAME@'=20AND=20table_name=20ILIKE=20v_table=0A=20=20=20);=0A=20=20=
=20return=20retvalue;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_create_index(v_index_name=20varchar(128),=20v_table_name=20=
varchar(128),=20v_column_names=20text,=20v_where_predicate=20text)=0A=
returns=20void=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=
BEGIN=0A=20=20=20=20v_sql=20:=3D=20'DROP=20INDEX=20'=20||=20'=20IF=20=
EXISTS=20'=20||=20v_index_name=20||=20';=20CREATE=20INDEX=20'=20||=20=
v_index_name=20||=20'=20ON=20'=20||=20v_table_name=20||=20'('=20||=20=
v_column_names=20||=20')';=0A=20=20=20=20IF=20v_where_predicate=20=3D=20=
''=20THEN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20';';=0A=20=
=20=20=20ELSE=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20=
WHERE=20'=20||=20v_where_predicate=20||=20';';=0A=20=20=20=20END=20IF;=0A=
=20=20=20=20EXECUTE=20v_sql;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=20=
fn_db_add_config_value_for_versions_up_to(v_option_name=20varchar(100),=20=
v_val=20varchar(4000),=20v_version=20varchar(40))=0Areturns=20void=0AAS=20=
$procedure$=0Adeclare=0A=20=20=20=20i=20=20=20int;=0A=20=20=20=20arr=20=
varchar[]=20:=3D=20array['3.0',=20'3.1',=20'3.2',=20'3.3',=20'3.4',=20=
'3.5',=20'3.6'];=0Abegin=0A=20=20=20=20FOR=20i=20IN=20array_lower(arr,=20=
1)=20..=20array_upper(arr,=201)=0A=20=20=20=20LOOP=0A=20=20=20=20=20=20=20=
=20PERFORM=20fn_db_add_config_value(v_option_name,=20v_val,=20arr[i]);=0A=
=20=20=20=20=20=20=20=20EXIT=20WHEN=20=20arr[i]=20=3D=20v_version;=0A=20=20=
=20=20END=20LOOP;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ASET=20search_path=20TO=20aaa_jdbc;=0A=
**************************=0A=0ASET=0A*********=20QUERY=20**********=0A=
Create=20or=20replace=20FUNCTION=20fn_db_add_column(v_table=20=
varchar(128),=20v_column=20varchar(128),=20v_column_def=20text)=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0A=0Abegin=0A=
=09if=20(not=20exists=20(select=201=20from=20information_schema.columns=20=
where=20table_schema=20=3D=20'aaa_jdbc'=20and=20table_name=20ilike=20=
v_table=20and=20column_name=20ilike=20v_column))=20then=0A=09=20=20=20=20=
begin=0A=09=09v_sql=20:=3D=20'ALTER=20TABLE=20'=20||=20v_table=20||=20'=20=
ADD=20COLUMN=20'=20||=20v_column=20||=20'=20'=20||=20v_column_def;=0A=09=09=
EXECUTE=20v_sql;=0A=20=20=20=20=20=20=20=20=20=20=20=20end;=0A=09end=20=
if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_drop_column(v_table=20varchar(128),=20v_column=20varchar(128))=0A=
returns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20text;=0Abegin=0A=20=
=20=20=20=20=20=20=20if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column))=20then=0A=20=20=20=20=20=20=20=20=20=20=20=20begin=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20'ALTER=20TABLE=20'=20=
||=20v_table=20||=20'=20DROP=20COLUMN=20'=20||=20v_column;=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20EXECUTE=20v_sql;=0A=20=20=20=20=20=20=
=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=
=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20Column=20%=20=
does=20not=20exist.',=20v_table,=20v_column;=0A=20=20=20=20=20=20=20=20=
end=20if;=0Aend;$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_change_column_type(v_table=20varchar(128),=20v_column=20=
varchar(128),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20v_type=20varchar(128),=20v_new_type=20=
varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0Av_sql=20=
text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column=20and=20(udt_name=20ilike=20v_type=20or=20data_type=20ilike=20=
v_type)))=20then=0A=09=20=20=20=20begin=0A=09=09v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20ALTER=20COLUMN=20'=20||=20v_column=20=
||=20'=20TYPE=20'=20||=20v_new_type;=0A=09=09EXECUTE=20v_sql;=0A=20=20=20=
=20=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20=20=20=20=20=
---=20ignore=20operation=20if=20requested=20type=20is=20already=20there=0A=
=20=20=20=20=20=20=20=20elsif=20(not=20exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column=20and=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
(udt_name=20ilike=20v_new_type=20or=20data_type=20ilike=20v_new_type)))=20=
then=0A=20=20=20=20=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20=
%=20or=20Column=20%=20does=20not=20exist.',=20v_table,=20v_column;=0A=09=
end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_db_rename_column(v_table=20varchar(128),=20v_column=20varchar(128),=20=
v_new_name=20varchar(128))=0Areturns=20void=0AAS=20$procedure$=0Adeclare=0A=
v_sql=20text;=0A=0Abegin=0A=09if=20(exists=20(select=201=20from=20=
information_schema.columns=20where=20table_schema=20=3D=20'aaa_jdbc'=20=
and=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column))=20then=0A=09=20=20=20=20begin=0A=09=09v_sql=20:=3D=20'ALTER=20=
TABLE=20'=20||=20v_table=20||=20'=20RENAME=20COLUMN=20'=20||=20v_column=20=
||=20'=20TO=20'=20||=20v_new_name;=0A=09=09EXECUTE=20v_sql;=0A=20=20=20=20=
=20=20=20=20=20=20=20=20end;=0A=20=20=20=20=20=20=20=20else=0A=20=20=20=20=
=20=20=20=20=20=20=20=20RAISE=20EXCEPTION=20'Table=20%=20or=20Column=20%=20=
does=20not=20exist.',=20v_table,=20v_column;=0A=09end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20function=20fn_db_create_constraint=20(=0A=20=20=20=20v_table=20=
varchar(128),=20v_constraint=20varchar(128),=20v_constraint_sql=20text)=0A=
returns=20void=0AAS=20$procedure$=0Abegin=0A=20=20=20=20if=20=20NOT=20=
EXISTS=20(SELECT=201=20from=20pg_constraint=20where=20conname=20ilike=20=
v_constraint)=20then=0A=20=20=20=20=20=20=20=20execute=20'ALTER=20TABLE=20=
'=20||=20v_table=20||=20=20'=20ADD=20CONSTRAINT=20'=20||=20v_constraint=20=
||=20'=20'=20||=20v_constraint_sql;=0A=20=20=20=20end=20if;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0Acreate=20or=20=
replace=20function=20fn_db_drop_constraint=20(=0A=20=20=20=20v_table=20=
varchar(128),=20v_constraint=20varchar(128))=0Areturns=20void=0AAS=20=
$procedure$=0Abegin=0A=20=20=20=20if=20=20EXISTS=20(SELECT=201=20from=20=
pg_constraint=20where=20conname=20ilike=20v_constraint)=20then=0A=20=20=20=
=20=20=20=20=20execute=20'ALTER=20TABLE=20'=20||=20v_table=20||=20=20'=20=
DROP=20CONSTRAINT=20'=20||=20v_constraint=20||=20'=20CASCADE';=0A=20=20=20=
=20end=20if;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20CheckDBConnection()=20=
RETURNS=20SETOF=20integer=20IMMUTABLE=0A=20=20=20AS=20$procedure$=0A=
BEGIN=0A=20=20=20=20RETURN=20QUERY=20SELECT=201;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_functions_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=
=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'drop=20=
function=20if=20exists=20'=20||=20ns.nspname=20||=20'.'=20||=20proname=20=
||=20'('=20||=20oidvectortypes(proargtypes)=20||=20')=20cascade;'=20from=20=
pg_proc=20inner=20join=20pg_namespace=20ns=20on=20=
(pg_proc.pronamespace=3Dns.oid)=20where=20ns.nspname=20=3D=20'aaa_jdbc'=20=
order=20by=20proname;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_views_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=20=
=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20VIEW=20=
if=20exists=20'=20||=20table_schema=20||=20'.'=20||=20table_name=20||=20=
'=20CASCADE;'=20from=20information_schema.views=20where=20table_schema=20=
=3D=20'aaa_jdbc'=20order=20by=20table_name;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_tables_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=
=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20TABLE=20=
if=20exists=20'=20||=20table_schema=20||=20'.'=20||=20table_name=20||=20=
'=20CASCADE;'=20from=20information_schema.tables=20where=20table_schema=20=
=3D=20'aaa_jdbc'=20and=20table_type=20=3D=20'BASE=20TABLE'=20order=20by=20=
table_name;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACreate=20or=20replace=20FUNCTION=20=
generate_drop_all_seq_syntax()=20RETURNS=20SETOF=20text=20STABLE=0A=20=20=
=20AS=20$procedure$=0ABEGIN=0ARETURN=20QUERY=20select=20'DROP=20SEQUENCE=20=
if=20exists=20'=20||=20sequence_schema=20||=20'.'=20||=20sequence_name=20=
||=20'=20CASCADE;'=20from=20information_schema.sequences=20=20where=20=
sequence_schema=20=3D=20'aaa_jdbc'=20order=20by=20sequence_name;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACreate=20or=20=
replace=20FUNCTION=20generate_drop_all_user_types_syntax()=20RETURNS=20=
SETOF=20text=20STABLE=0A=20=20=20AS=20$procedure$=0ABEGIN=0ARETURN=20=
QUERY=20SELECT=20'DROP=20TYPE=20if=20exists=20'=20||=20=
c.relname::information_schema.sql_identifier=20||=20'=20CASCADE;'=0A=20=20=
=20FROM=20pg_namespace=20n,=20pg_class=20c,=20pg_type=20t=0A=20=20=20=
WHERE=20n.oid=20=3D=20c.relnamespace=20and=20t.typrelid=20=3D=20c.oid=20=
and=20c.relkind=20=3D=20'c'::"char"=20and=0A=20=20=20n.nspname=20=3D=20=
'aaa_jdbc'=0A=20=20=20ORDER=20BY=20=20=
c.relname::information_schema.sql_identifier;=0AEND;=20$procedure$=0A=
LANGUAGE=20plpgsql;=0A**************************=0A=0ACREATE=20FUNCTION=0A=
*********=20QUERY=20**********=0ACreate=20or=20replace=20FUNCTION=20=
fn_get_column_size(=20v_table=20varchar(64),=20v_column=20varchar(64))=20=
returns=20integer=20STABLE=0A=20=20=20AS=20$procedure$=0A=20=20=20=
declare=0A=20=20=20retvalue=20=20integer;=0ABEGIN=0A=20=20=20retvalue=20=
:=3D=20character_maximum_length=20from=20information_schema.columns=0A=20=
=20=20=20where=0A=20=20=20=20table_schema=20=3D=20'aaa_jdbc'=20and=0A=20=20=
=20=20table_name=20ilike=20v_table=20and=20column_name=20ilike=20=
v_column=20and=0A=20=20=20=20table_schema=20=3D=20'aaa_jdbc'=20and=20=
udt_name=20in=20('char','varchar');=0A=20=20=20return=20retvalue;=0AEND;=20=
$procedure$=0ALANGUAGE=20plpgsql;=0A**************************=0A=0A=
CREATE=20FUNCTION=0A*********=20QUERY=20**********=0ACREATE=20OR=20=
REPLACE=20FUNCTION=20fn_db_mask_object(v_object=20regclass)=20RETURNS=20=
setof=20record=20as=0A$BODY$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=20=20=
=20=20v_table=20record;=0A=20=20=20=20v_table_name=20TEXT;=0A=20=20=20=20=
temprec=20record;=0ABEGIN=0A=20=20=20=20--=20get=20full=20table/view=20=
name=20from=20v_object=20(i.e=20<namespace>.<name>)=0A=20=20=20=20select=20=
c.relname,=20n.nspname=20INTO=20v_table=0A=20=20=20=20=20=20=20=20FROM=20=
pg_class=20c=20join=20pg_namespace=20n=20on=20c.relnamespace=20=3D=20=
n.oid=20WHERE=20c.oid=20=3D=20v_object;=0A=20=20=20=20--=20try=20to=20=
get=20filtered=20query=20syntax=20from=20previous=20execution=0A=20=20=20=
=20if=20exists=20(select=201=20from=20object_column_white_list_sql=20=
where=20object_name=20=3D=20v_table.relname)=20then=0A=09select=20sql=20=
into=20v_sql=20from=20object_column_white_list_sql=20where=20object_name=20=
=3D=20v_table.relname;=0A=20=20=20=20else=0A=20=20=20=20=20=20=20=20=
v_table_name=20:=3D=20quote_ident(=20v_table.nspname=20)=20||=20'.'=20||=20=
quote_ident(=20v_table.relname=20);=0A=20=20=20=20=20=20=20=20--=20=
compose=20sql=20statement=20while=20skipping=20values=20for=20columns=20=
not=20defined=20in=20object_column_white_list=20for=20this=20table.=0A=20=
=20=20=20=20=20=20=20for=20temprec=20in=20select=20a.attname,=20=
t.typname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20FROM=20pg_attribute=20a=20join=20pg_type=20t=20on=20a.atttypid=20=3D=
=20t.oid=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20WHERE=20a.attrelid=20=3D=20v_object=20AND=20a.attnum=20>=200=20AND=20=
NOT=20a.attisdropped=20ORDER=20BY=20a.attnum=0A=20=20=20=20=20=20=20=20=
loop=0A=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20coalesce(=20=
v_sql=20||=20',=20',=20'SELECT=20'=20);=0A=20=20=20=20=20=20=20=20=20=20=20=
=20if=20exists(select=201=20from=20object_column_white_list=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20where=20object_name=20=3D=20=
v_table.relname=20and=20column_name=20=3D=20temprec.attname)=20then=0A=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20=
quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=20=20=20=
ELSE=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20=
||=20'NULL::'=20||=20quote_ident(=20temprec.typname=20)=20||=20'=20as=20=
'=20||=20quote_ident(=20temprec.attname=20);=0A=20=20=20=20=20=20=20=20=20=
=20=20=20END=20IF;=0A=20=20=20=20=20=20=20=20END=20LOOP;=0A=20=20=20=20=20=
=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20FROM=20'=20||=20v_table_name;=0A=
=20=20=20=20=20=20=20=20v_sql=20:=3D=20'SELECT=20x::'=20||=20=
v_table_name=20||=20'=20as=20rec=20FROM=20('=20||=20v_sql=20||=20')=20as=20=
x';=0A=20=20=20=20=20=20=20=20--=20save=20generated=20query=20for=20=
further=20use=0A=20=20=20=20=20=20=20=20insert=20into=20=
object_column_white_list_sql(object_name,sql)=20values=20=
(v_table.relname,=20v_sql);=0A=20=20=20=20end=20if;=0A=20=20=20=20RETURN=20=
QUERY=20EXECUTE=20v_sql;=0AEND;=20$BODY$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0ACREATE=20OR=20REPLACE=20FUNCTION=20fn_db_is_table_exists=20=
(v_table=20varchar(64))=20returns=20boolean=20STABLE=0A=20=20=20AS=20=
$procedure$=0A=20=20=20declare=0A=20=20=20retvalue=20=20boolean;=0ABEGIN=0A=
=20=20=20retvalue=20:=3D=20EXISTS=20(=0A=20=20=20=20=20=20=20=20SELECT=20=
*=20FROM=20information_schema.tables=20WHERE=20table_schema=20=3D=20=
'aaa_jdbc'=20AND=20table_name=20ILIKE=20v_table=0A=20=20=20);=0A=20=20=20=
return=20retvalue;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=
fn_db_create_index(v_index_name=20varchar(128),=20v_table_name=20=
varchar(128),=20v_column_names=20text,=20v_where_predicate=20text)=0A=
returns=20void=0AAS=20$procedure$=0ADECLARE=0A=20=20=20=20v_sql=20TEXT;=0A=
BEGIN=0A=20=20=20=20v_sql=20:=3D=20'DROP=20INDEX=20'=20||=20'=20IF=20=
EXISTS=20'=20||=20v_index_name=20||=20';=20CREATE=20INDEX=20'=20||=20=
v_index_name=20||=20'=20ON=20'=20||=20v_table_name=20||=20'('=20||=20=
v_column_names=20||=20')';=0A=20=20=20=20IF=20v_where_predicate=20=3D=20=
''=20THEN=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20';';=0A=20=
=20=20=20ELSE=0A=20=20=20=20=20=20=20=20v_sql=20:=3D=20v_sql=20||=20'=20=
WHERE=20'=20||=20v_where_predicate=20||=20';';=0A=20=20=20=20END=20IF;=0A=
=20=20=20=20EXECUTE=20v_sql;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0Acreate=20or=20replace=20FUNCTION=20=20=
fn_db_add_config_value_for_versions_up_to(v_option_name=20varchar(100),=20=
v_val=20varchar(4000),=20v_version=20varchar(40))=0Areturns=20void=0AAS=20=
$procedure$=0Adeclare=0A=20=20=20=20i=20=20=20int;=0A=20=20=20=20arr=20=
varchar[]=20:=3D=20array['3.0',=20'3.1',=20'3.2',=20'3.3',=20'3.4',=20=
'3.5',=20'3.6'];=0Abegin=0A=20=20=20=20FOR=20i=20IN=20array_lower(arr,=20=
1)=20..=20array_upper(arr,=201)=0A=20=20=20=20LOOP=0A=20=20=20=20=20=20=20=
=20PERFORM=20fn_db_add_config_value(v_option_name,=20v_val,=20arr[i]);=0A=
=20=20=20=20=20=20=20=20EXIT=20WHEN=20=20arr[i]=20=3D=20v_version;=0A=20=20=
=20=20END=20LOOP;=0AEND;=20$procedure$=0ALANGUAGE=20plpgsql;=0A=
**************************=0A=0ACREATE=20FUNCTION=0A*********=20QUERY=20=
**********=0A=0A**************************=0A=0A2016-08-18=2013:00:31=20=
DEBUG=20otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc=20=
plugin.executeRaw:863=20execute-result:=20=
['/usr/share/ovirt-engine-extension-aaa-jdbc/dbscripts/schema.sh',=20=
'-s',=20'localhost',=20'-p',=20'5432',=20'-u',=20'engine',=20'-d',=20=
'engine',=20'-e',=20'aaa_jdbc',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-c',=20'apply'],=20rc=3D0=0A2016-08-18=2013:00:31=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc=20=
plugin.execute:921=20execute-output:=20=
['/usr/share/ovirt-engine-extension-aaa-jdbc/dbscripts/schema.sh',=20=
'-s',=20'localhost',=20'-p',=20'5432',=20'-u',=20'engine',=20'-d',=20=
'engine',=20'-e',=20'aaa_jdbc',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-c',=20'apply']=20stdout:=0ACreating=20schema=20aaa_jdbc=20in=20=
engine@localhost:5432/engine=0ASaving=20custom=20users=20permissions=20=
on=20database=20objects...=0Aupgrade=20script=20detected=20a=20change=20=
in=20Config,=20View=20or=20Stored=20Procedure...=0ACreating=20stored=20=
procedures...=0ACreating=20stored=20procedures=20from=20=
/usr/share/ovirt-engine-extension-aaa-jdbc/dbscripts/common_sp.sql...=0A=
Applying=20custom=20users=20permissions=20on=20database=20objects...=0A=0A=
2016-08-18=2013:00:31=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc=20=
plugin.execute:926=20execute-output:=20=
['/usr/share/ovirt-engine-extension-aaa-jdbc/dbscripts/schema.sh',=20=
'-s',=20'localhost',=20'-p',=20'5432',=20'-u',=20'engine',=20'-d',=20=
'engine',=20'-e',=20'aaa_jdbc',=20'-l',=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'-c',=20'apply']=20stderr:=0A=0A=0A2016-08-18=2013:00:31=20DEBUG=20=
otopi.transaction=20transaction._prepare:61=20preparing=20'File=20=
transaction=20for=20'/etc/ovirt-engine/aaa/internal.properties''=0A=
2016-08-18=2013:00:31=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine/aaa/internal.properties'=20exists=0A2016-08-18=20=
13:00:31=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:189=20=
file=20'/etc/ovirt-engine/aaa/internal.properties'=20already=20has=20=
content=0A2016-08-18=2013:00:31=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/extensions.d/internal-authn.properties''=0A2016-08-18=20=
13:00:31=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/ovirt-engine/extensions.d/internal-authn.properties'=20=
exists=0A2016-08-18=2013:00:31=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/extensions.d/internal-authn.properties'=20already=20=
has=20content=0A2016-08-18=2013:00:31=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/extensions.d/internal-authz.properties''=0A2016-08-18=20=
13:00:31=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/ovirt-engine/extensions.d/internal-authz.properties'=20=
exists=0A2016-08-18=2013:00:31=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/extensions.d/internal-authz.properties'=20already=20=
has=20content=0A2016-08-18=2013:00:31=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc=20=
plugin.executeRaw:813=20execute:=20('/usr/bin/ovirt-aaa-jdbc-tool',=20=
'--db-config=3D/etc/ovirt-engine/aaa/internal.properties',=20'query',=20=
'--what=3Duser',=20'--pattern=3Dname=3Dadmin'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3D{'OVIRT_ENGINE_JAVA_HOME_FORCE':=20'1',=20=
'PYTHONPATH':=20'/usr/share/ovirt-engine/setup/bin/..::',=20'LESSOPEN':=20=
'||/usr/bin/lesspipe.sh=20%s',=20'PATH':=20=
'/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin',=20=
'LOGNAME':=20'root',=20'USER':=20'root',=20'OVIRT_ENGINE_JAVA_HOME':=20=
u'/usr/lib/jvm/jre',=20'OTOPI_LOGFILE':=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20'HOME':=20'/root',=20'XDG_SESSION_ID':=20'6',=20'LANG':=20=
'en_US.UTF-8',=20'TERM':=20'xterm-256color',=20'SHELL':=20'/bin/bash',=20=
'SHLVL':=20'1',=20'OVIRT_JBOSS_HOME':=20=
'/usr/share/ovirt-engine-wildfly',=20'HOSTNAME':=20=
'cultivar.grove.silverorange.com',=20'HISTSIZE':=20'1000',=20=
'HISTCONTROL':=20'ignoredups',=20'PWD':=20'/root',=20'MAIL':=20=
'/var/spool/mail/root',=20'LS_COLORS':=20=
'rs=3D0:di=3D38;5;27:ln=3D38;5;51:mh=3D44;38;5;15:pi=3D40;38;5;11:so=3D38;=
5;13:do=3D38;5;5:bd=3D48;5;232;38;5;11:cd=3D48;5;232;38;5;3:or=3D48;5;232;=
38;5;9:mi=3D05;48;5;232;38;5;15:su=3D48;5;196;38;5;15:sg=3D48;5;11;38;5;16=
:ca=3D48;5;196;38;5;226:tw=3D48;5;10;38;5;16:ow=3D48;5;10;38;5;21:st=3D48;=
5;21;38;5;15:ex=3D38;5;34:*.tar=3D38;5;9:*.tgz=3D38;5;9:*.arc=3D38;5;9:*.a=
rj=3D38;5;9:*.taz=3D38;5;9:*.lha=3D38;5;9:*.lz4=3D38;5;9:*.lzh=3D38;5;9:*.=
lzma=3D38;5;9:*.tlz=3D38;5;9:*.txz=3D38;5;9:*.tzo=3D38;5;9:*.t7z=3D38;5;9:=
*.zip=3D38;5;9:*.z=3D38;5;9:*.Z=3D38;5;9:*.dz=3D38;5;9:*.gz=3D38;5;9:*.lrz=
=3D38;5;9:*.lz=3D38;5;9:*.lzo=3D38;5;9:*.xz=3D38;5;9:*.bz2=3D38;5;9:*.bz=3D=
38;5;9:*.tbz=3D38;5;9:*.tbz2=3D38;5;9:*.tz=3D38;5;9:*.deb=3D38;5;9:*.rpm=3D=
38;5;9:*.jar=3D38;5;9:*.war=3D38;5;9:*.ear=3D38;5;9:*.sar=3D38;5;9:*.rar=3D=
38;5;9:*.alz=3D38;5;9:*.ace=3D38;5;9:*.zoo=3D38;5;9:*.cpio=3D38;5;9:*.7z=3D=
38;5;9:*.rz=3D38;5;9:*.cab=3D38;5;9:*.jpg=3D38;5;13:*.jpeg=3D38;5;13:*.gif=
=3D38;5;13:*.bmp=3D38;5;13:*.pbm=3D38;5;13:*.pgm=3D38;5;13:*.ppm=3D38;5;13=
:*.tga=3D38;5;13:*.xbm=3D38;5;13:*.xpm=3D38;5;13:*.tif=3D38;5;13:*.tiff=3D=
38;5;13:*.png=3D38;5;13:*.svg=3D38;5;13:*.svgz=3D38;5;13:*.mng=3D38;5;13:*=
.pcx=3D38;5;13:*.mov=3D38;5;13:*.mpg=3D38;5;13:*.mpeg=3D38;5;13:*.m2v=3D38=
;5;13:*.mkv=3D38;5;13:*.webm=3D38;5;13:*.ogm=3D38;5;13:*.mp4=3D38;5;13:*.m=
4v=3D38;5;13:*.mp4v=3D38;5;13:*.vob=3D38;5;13:*.qt=3D38;5;13:*.nuv=3D38;5;=
13:*.wmv=3D38;5;13:*.asf=3D38;5;13:*.rm=3D38;5;13:*.rmvb=3D38;5;13:*.flc=3D=
38;5;13:*.avi=3D38;5;13:*.fli=3D38;5;13:*.flv=3D38;5;13:*.gl=3D38;5;13:*.d=
l=3D38;5;13:*.xcf=3D38;5;13:*.xwd=3D38;5;13:*.yuv=3D38;5;13:*.cgm=3D38;5;1=
3:*.emf=3D38;5;13:*.axv=3D38;5;13:*.anx=3D38;5;13:*.ogv=3D38;5;13:*.ogx=3D=
38;5;13:*.aac=3D38;5;45:*.au=3D38;5;45:*.flac=3D38;5;45:*.mid=3D38;5;45:*.=
midi=3D38;5;45:*.mka=3D38;5;45:*.mp3=3D38;5;45:*.mpc=3D38;5;45:*.ogg=3D38;=
5;45:*.ra=3D38;5;45:*.wav=3D38;5;45:*.axa=3D38;5;45:*.oga=3D38;5;45:*.spx=3D=
38;5;45:*.xspf=3D38;5;45:',=20'OTOPI_EXECDIR':=20'/root'}=0A2016-08-18=20=
13:00:33=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc=20=
plugin.executeRaw:863=20execute-result:=20=
('/usr/bin/ovirt-aaa-jdbc-tool',=20=
'--db-config=3D/etc/ovirt-engine/aaa/internal.properties',=20'query',=20=
'--what=3Duser',=20'--pattern=3Dname=3Dadmin'),=20rc=3D0=0A2016-08-18=20=
13:00:33=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc=20=
plugin.execute:921=20execute-output:=20('/usr/bin/ovirt-aaa-jdbc-tool',=20=
'--db-config=3D/etc/ovirt-engine/aaa/internal.properties',=20'query',=20=
'--what=3Duser',=20'--pattern=3Dname=3Dadmin')=20stdout:=0A--=20User=20=
admin(40cc61cd-b603-4067-b8c2-00c7fd39e241)=20--=0ANamespace:=20*=0A=
Name:=20admin=0AID:=2040cc61cd-b603-4067-b8c2-00c7fd39e241=0ADisplay=20=
Name:=20=0AEmail:=20=0AFirst=20Name:=20admin=0ALast=20Name:=20=0A=
Department:=20=0ATitle:=20=0ADescription:=20=0AAccount=20Disabled:=20=
false=0AAccount=20Unlocked=20At:=201970-01-01=2000:00:00Z=0AAccount=20=
Valid=20From:=202016-02-03=2019:41:29Z=0AAccount=20Valid=20To:=20=
2216-02-03=2019:41:29Z=0AAccount=20Without=20Password:=20false=0ALast=20=
successful=20Login=20At:=202016-08-18=2014:06:32Z=0ALast=20unsuccessful=20=
Login=20At:=202016-06-01=2015:34:11Z=0APassword=20Valid=20To:=20=
2215-12-17=2019:41:30Z=0A=0A2016-08-18=2013:00:33=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc=20=
plugin.execute:926=20execute-output:=20('/usr/bin/ovirt-aaa-jdbc-tool',=20=
'--db-config=3D/etc/ovirt-engine/aaa/internal.properties',=20'query',=20=
'--what=3Duser',=20'--pattern=3Dname=3Dadmin')=20stderr:=0A=0A=0A=
2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.appmode.Plugin._misc=0A=
2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:33=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.ca.Plugin._misc=0A=
2016-08-18=2013:00:33=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-pki.conf''=0A2016-08-18=20=
13:00:33=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/ovirt-engine/engine.conf.d/10-setup-pki.conf'=20exists=0A=
2016-08-18=2013:00:33=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-pki.conf'=20already=20has=20=
content=0A2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_FILE_GROUP/ca_config=3Dlist:'[[]]'=0A2016-08-18=20=
13:00:33=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_LINES_GROUP/ca_config=3Ddict:'{}'=0A2016-08-18=20=
13:00:33=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2013:00:33=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.domain_type.Plugin._m=
isc=0A2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:33=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.iso_domain.Plugin._ad=
d_iso_domain_to_db=0A2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:33=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.options.Plugin._miscA=
lways=0A2016-08-18=2013:00:33=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20select=20count(*)=20as=20count=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20from=20vdc_options=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20where=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
option_name=3D%(name)s=20and=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20version=3D%(version)s=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20',=20args:=20{'version':=20'general',=20=
'name':=20'ProductRPMVersion'}=0A2016-08-18=2013:00:33=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'count':=201L}]=0A2016-08-18=2013:00:33=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20update=20vdc_options=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20set=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
option_value=3D%(value)s=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20where=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20option_name=3D%(name)s=20and=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20version=3D%(version)s=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20',=20args:=20{'version':=20'general',=20'name':=20=
'ProductRPMVersion',=20'value':=20'4.0.2.6-1.el7.centos'}=0A2016-08-18=20=
13:00:33=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:222=20Result:=20[]=0A2016-08-18=2013:00:33=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.options.Plugin._miscN=
ewDatabase=0A2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:33=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.public_glance_reposit=
ory.Plugin._misc=0A2016-08-18=2013:00:33=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20select=20inst_add_glance_provider(=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20%(provider_id)s,=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20%(provider_name)s,=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
%(provider_description)s,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20%(provider_url)s,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20%(storage_domain_id)s=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20=20=20=20=20',=20args:=20=
{'provider_url':=20'http://glance.ovirt.org:9292',=20'provider_name':=20=
'ovirt-image-repository',=20'storage_domain_id':=20=
'072fbaa1-08f3-4a40-9f34-a5ca22dd1d74',=20'provider_description':=20=
'Public=20Glance=20repository=20for=20oVirt',=20'provider_id':=20=
'ceab03af-7220-4d42-8f5c-9b557f5d29af'}=0A2016-08-18=2013:00:33=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'inst_add_glance_provider':=20''}]=0A2016-08-18=2013:00:33=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.sso.Plugin._misc=0A=
2016-08-18=2013:00:33=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20select=20sso_oauth_client_exists(=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20%(client_id)s=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20)=20as=20r=0A=20=20=20=20=20=20=20=20=20=20=20=20=
',=20args:=20{'client_id':=20'ovirt-engine-core'}=0A2016-08-18=20=
13:00:33=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:222=20Result:=20[{'r':=201}]=0A2016-08-18=2013:00:33=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.storage.Plugin._updat=
eSANWipeAfterDelete=0A2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:33=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.pki.ca.Plugin.miscOptions=0A=
2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:33=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._databa=
seOptions=0A2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:33=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaajdbc.Plugin._setup=
AdminPassword=0A2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:33=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.exportfs.Plugin._misc=
=0A2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:33=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.image_upload.Plugin._=
misc=0A2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:33=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.single_etl.Plugin._=
misc=0A2016-08-18=2013:00:33=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-uuid.conf''=0A=
2016-08-18=2013:00:33=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:185=20file=20=
'/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-uuid.conf'=20=
exists=0A2016-08-18=2013:00:33=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-uuid.conf'=20=
already=20has=20content=0A2016-08-18=2013:00:33=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
select=20*=20from=20GetDwhHistoryTimekeepingByVarName(=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20%(name)s=0A=20=20=20=20=20=20=20=20=20=20=20=
=20)=0A=20=20=20=20=20=20=20=20',=20args:=20{'name':=20'dwhHostname'}=0A=
2016-08-18=2013:00:33=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:177=20=
Creating=20own=20connection=0A2016-08-18=2013:00:33=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'var_value':=20'cultivar.grove.silverorange.com',=20=
'var_datetime':=20None,=20'var_name':=20'dwhHostname'}]=0A2016-08-18=20=
13:00:33=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'=0A=20=20=20=20=
=20=20=20=20=20=20=20=20select=20UpdateDwhHistoryTimekeeping(=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20%(name)s,=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20%(value)s,=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20NULL=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=
=20=20=20',=20args:=20{'name':=20'dwhHostname',=20'value':=20=
'cultivar.grove.silverorange.com'}=0A2016-08-18=2013:00:33=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'updatedwhhistorytimekeeping':=20''}]=0A2016-08-18=20=
13:00:33=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:172=20Database:=20'None',=20Statement:=20'=0A=20=20=20=20=
=20=20=20=20=20=20=20=20select=20*=20from=20=
GetDwhHistoryTimekeepingByVarName(=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20%(name)s=0A=20=20=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=
=20=20=20=20',=20args:=20{'name':=20'dwhUuid'}=0A2016-08-18=2013:00:33=20=
DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:177=20Creating=20own=20connection=0A2016-08-18=20=
13:00:33=20DEBUG=20otopi.ovirt_engine_setup.engine_common.database=20=
database.execute:222=20Result:=20[{'var_value':=20=
'86e6524b-9cc3-4693-988c-161a1af65356',=20'var_datetime':=20None,=20=
'var_name':=20'dwhUuid'}]=0A2016-08-18=2013:00:33=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:172=20=
Database:=20'None',=20Statement:=20'=0A=20=20=20=20=20=20=20=20=20=20=20=20=
select=20UpdateDwhHistoryTimekeeping(=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20%(name)s,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
%(value)s,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20NULL=0A=20=20=
=20=20=20=20=20=20=20=20=20=20)=0A=20=20=20=20=20=20=20=20',=20args:=20=
{'name':=20'dwhUuid',=20'value':=20=
'86e6524b-9cc3-4693-988c-161a1af65356'}=0A2016-08-18=2013:00:33=20DEBUG=20=
otopi.ovirt_engine_setup.engine_common.database=20database.execute:222=20=
Result:=20[{'updatedwhhistorytimekeeping':=20''}]=0A2016-08-18=20=
13:00:33=20DEBUG=20otopi.context=20context.dumpEnvironment:760=20=
ENVIRONMENT=20DUMP=20-=20BEGIN=0A2016-08-18=2013:00:33=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_FILE_GROUP/ovirt_dwh_files=3Dlist:'[[],=20[],=20=
[]]'=0A2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
13:00:33=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.config.aaa.Plugin._misc=0A=
2016-08-18=2013:00:33=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:33=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20misc=20=
METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.selinux.Plugin._misc=0A=
2016-08-18=2013:00:33=20DEBUG=20=
otopi.plugins.ovirt_engine_common.base.system.selinux=20=
plugin.executeRaw:813=20execute:=20('/sbin/semanage',=20'boolean',=20=
'--modify',=20'--on',=20'httpd_can_network_connect'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.plugins.ovirt_engine_common.base.system.selinux=20=
plugin.executeRaw:863=20execute-result:=20('/sbin/semanage',=20=
'boolean',=20'--modify',=20'--on',=20'httpd_can_network_connect'),=20=
rc=3D0=0A2016-08-18=2013:00:36=20DEBUG=20=
otopi.plugins.ovirt_engine_common.base.system.selinux=20=
plugin.execute:921=20execute-output:=20('/sbin/semanage',=20'boolean',=20=
'--modify',=20'--on',=20'httpd_can_network_connect')=20stdout:=0A=0A=0A=
2016-08-18=2013:00:36=20DEBUG=20=
otopi.plugins.ovirt_engine_common.base.system.selinux=20=
plugin.execute:926=20execute-output:=20('/sbin/semanage',=20'boolean',=20=
'--modify',=20'--on',=20'httpd_can_network_connect')=20stderr:=0A=0A=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.apache.misc.Plugin._m=
isc=0A2016-08-18=2013:00:36=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20misc=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.postinstall.Plugin._misc=0A=
2016-08-18=2013:00:36=20INFO=20=
otopi.plugins.ovirt_engine_common.base.core.postinstall=20=
postinstall._misc:57=20Generating=20post=20install=20configuration=20=
file=20'/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf'=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction._prepare:61=20preparing=20'File=20transaction=20for=20=
'/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.filetransaction=20filetransaction.prepare:185=20=
file=20'/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf'=20=
exists=0A2016-08-18=2013:00:36=20DEBUG=20otopi.filetransaction=20=
filetransaction.prepare:189=20file=20=
'/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf'=20already=20=
has=20content=0A2016-08-18=2013:00:36=20INFO=20otopi.context=20=
context.runSequence:687=20Stage:=20Transaction=20commit=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.context=20context.runSequence:691=20STAGE=20=
cleanup=0A2016-08-18=2013:00:36=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20cleanup=20METHOD=20=
otopi.plugins.otopi.core.transaction.Plugin._main_end=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-uuid.conf''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-pki.conf''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/extensions.d/internal-authz.properties''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/extensions.d/internal-authn.properties''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/aaa/internal.properties''=0A2016-08-18=2013:00:36=20=
DEBUG=20otopi.transaction=20transaction.commit:147=20committing=20'DWH=20=
schema=20Transaction'=0A2016-08-18=2013:00:36=20DEBUG=20=
otopi.transaction=20transaction.commit:147=20committing=20'File=20=
transaction=20for=20'/etc/pki/ovirt-engine/keys/engine_id_rsa''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'Engine=20schema=20Transaction'=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/ovirt-websocket-proxy.conf.d/10-setup.conf''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/ovirt-vmconsole/ovirt-vmconsole-proxy/conf.d/20-ovirt-vmconsole-prox=
y-helper.conf''=0A2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/ovirt-vmconsole-proxy-helper.conf.d/10-setup.conf''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/ovirt-imageio-proxy/ovirt-imageio-proxy.conf''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-scale.conf''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine-dwh/examples/10-setup-dwh-database.conf''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine-dwh/ovirt-engine-dwhd.conf.d/10-setup-database.conf''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/logcollector.conf.d/10-engine-setup.conf''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/imageuploader.conf.d/10-engine-setup.conf''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/isouploader.conf.d/10-engine-setup.conf''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-protocols.conf''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/notifier/notifier.conf.d/10-setup-jboss.conf''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-jboss.conf''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-dwh-database.conf''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/engine.conf.d/10-setup-database.conf''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/httpd/conf.d/z-ovirt-engine-proxy.conf''=0A2016-08-18=2013:00:36=20=
DEBUG=20otopi.transaction=20transaction.commit:147=20committing=20'File=20=
transaction=20for=20'/etc/ovirt-engine/iptables.example''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-postgres.xml''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-postgres.xml''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-fence-kdump-listener.xml''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-websocket-proxy.xml''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-imageio-proxy.xml''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-vmconsole-proxy.xml''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/ovirt-engine/firewalld/ovirt-https.xml''=0A2016-08-18=2013:00:36=20=
DEBUG=20otopi.transaction=20transaction.commit:147=20committing=20'File=20=
transaction=20for=20'/etc/ovirt-engine/firewalld/ovirt-http.xml''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/firewalld/services/ovirt-vmconsole-proxy.xml''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/firewalld/services/ovirt-http.xml''=0A2016-08-18=2013:00:36=20=
DEBUG=20otopi.transaction=20transaction.commit:147=20committing=20'File=20=
transaction=20for=20'/etc/firewalld/services/ovirt-websocket-proxy.xml''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'File=20transaction=20for=20=
'/etc/firewalld/services/ovirt-imageio-proxy.xml''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/firewalld/services/ovirt-fence-kdump-listener.xml''=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.transaction=20transaction.commit:147=20=
committing=20'File=20transaction=20for=20=
'/etc/firewalld/services/ovirt-https.xml''=0A2016-08-18=2013:00:36=20=
DEBUG=20otopi.transaction=20transaction.commit:147=20committing=20'File=20=
transaction=20for=20'/etc/firewalld/services/ovirt-postgres.xml''=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'Firewalld=20Transaction'=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'DWH=20database=20Transaction'=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'Version=20Lock=20Transaction'=0A=
2016-08-18=2013:00:36=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
plugin.executeRaw:813=20execute:=20('/bin/rpm',=20'-q',=20=
'ovirt-engine-webadmin-portal',=20'ovirt-engine-dwh',=20'ovirt-engine',=20=
'ovirt-engine-restapi',=20'ovirt-engine-dbscripts',=20=
'ovirt-engine-tools-backup',=20'ovirt-engine-dashboard',=20=
'ovirt-engine-userportal',=20'ovirt-engine-wildfly',=20=
'ovirt-engine-backend',=20'ovirt-engine-wildfly-overlay',=20=
'ovirt-engine-tools',=20'ovirt-engine-extension-aaa-jdbc'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
13:00:36=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
plugin.executeRaw:863=20execute-result:=20('/bin/rpm',=20'-q',=20=
'ovirt-engine-webadmin-portal',=20'ovirt-engine-dwh',=20'ovirt-engine',=20=
'ovirt-engine-restapi',=20'ovirt-engine-dbscripts',=20=
'ovirt-engine-tools-backup',=20'ovirt-engine-dashboard',=20=
'ovirt-engine-userportal',=20'ovirt-engine-wildfly',=20=
'ovirt-engine-backend',=20'ovirt-engine-wildfly-overlay',=20=
'ovirt-engine-tools',=20'ovirt-engine-extension-aaa-jdbc'),=20rc=3D0=0A=
2016-08-18=2013:00:36=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
plugin.execute:921=20execute-output:=20('/bin/rpm',=20'-q',=20=
'ovirt-engine-webadmin-portal',=20'ovirt-engine-dwh',=20'ovirt-engine',=20=
'ovirt-engine-restapi',=20'ovirt-engine-dbscripts',=20=
'ovirt-engine-tools-backup',=20'ovirt-engine-dashboard',=20=
'ovirt-engine-userportal',=20'ovirt-engine-wildfly',=20=
'ovirt-engine-backend',=20'ovirt-engine-wildfly-overlay',=20=
'ovirt-engine-tools',=20'ovirt-engine-extension-aaa-jdbc')=20stdout:=0A=
ovirt-engine-webadmin-portal-4.0.2.6-1.el7.centos.noarch=0A=
ovirt-engine-dwh-4.0.2-1.el7.centos.noarch=0A=
ovirt-engine-4.0.2.6-1.el7.centos.noarch=0A=
ovirt-engine-restapi-4.0.2.6-1.el7.centos.noarch=0A=
ovirt-engine-dbscripts-4.0.2.6-1.el7.centos.noarch=0A=
ovirt-engine-tools-backup-4.0.2.6-1.el7.centos.noarch=0A=
ovirt-engine-dashboard-1.0.2-1.el7.centos.noarch=0A=
ovirt-engine-userportal-4.0.2.6-1.el7.centos.noarch=0A=
ovirt-engine-wildfly-10.0.0-1.el7.x86_64=0A=
ovirt-engine-backend-4.0.2.6-1.el7.centos.noarch=0A=
ovirt-engine-wildfly-overlay-10.0.0-1.el7.noarch=0A=
ovirt-engine-tools-4.0.2.6-1.el7.centos.noarch=0A=
ovirt-engine-extension-aaa-jdbc-1.1.0-1.el7.noarch=0A=0A2016-08-18=20=
13:00:36=20DEBUG=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_common.distro-rpm.packages=20=
plugin.execute:926=20execute-output:=20('/bin/rpm',=20'-q',=20=
'ovirt-engine-webadmin-portal',=20'ovirt-engine-dwh',=20'ovirt-engine',=20=
'ovirt-engine-restapi',=20'ovirt-engine-dbscripts',=20=
'ovirt-engine-tools-backup',=20'ovirt-engine-dashboard',=20=
'ovirt-engine-userportal',=20'ovirt-engine-wildfly',=20=
'ovirt-engine-backend',=20'ovirt-engine-wildfly-overlay',=20=
'ovirt-engine-tools',=20'ovirt-engine-extension-aaa-jdbc')=20stderr:=0A=0A=
=0A2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'Database=20Transaction'=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'DWH=20Engine=20database=20=
Transaction'=0A2016-08-18=2013:00:36=20DEBUG=20otopi.transaction=20=
transaction.commit:147=20committing=20'Yum=20Transaction'=0ALoaded=20=
plugins:=20fastestmirror,=20versionlock=0A2016-08-18=2013:00:36=20DEBUG=20=
otopi.context=20context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20=
BEGIN=0A2016-08-18=2013:00:36=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/uninstallUnremovableFiles=3Dlist:'['/etc/exports',=20=
'/etc/yum/pluginconf.d/versionlock.list',=20=
'/etc/dnf/plugins/versionlock.list']'=0A2016-08-18=2013:00:36=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_FILE_GROUP/versionlock=3Dlist:'[]'=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_LINES_GROUP/versionlock=3Ddict:'{'/etc/yum/pluginco=
nf.d/versionlock.list':=20[{'added':=20=
u'ovirt-engine-webadmin-portal-4.0.2.6-1.el7.centos.noarch'},=20=
{'added':=20u'ovirt-engine-dwh-4.0.2-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-4.0.2.6-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-restapi-4.0.2.6-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-dbscripts-4.0.2.6-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-tools-backup-4.0.2.6-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-dashboard-1.0.2-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-userportal-4.0.2.6-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-wildfly-10.0.0-1.el7.x86_64'},=20{'added':=20=
u'ovirt-engine-backend-4.0.2.6-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-wildfly-overlay-10.0.0-1.el7.noarch'},=20{'added':=20=
u'ovirt-engine-tools-4.0.2.6-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-extension-aaa-jdbc-1.1.0-1.el7.noarch'}]}'=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.context=20context.dumpEnvironment:774=20=
ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=2013:00:36=20INFO=20=
otopi.context=20context.runSequence:687=20Stage:=20Closing=20up=0A=
2016-08-18=2013:00:36=20DEBUG=20otopi.context=20context.runSequence:691=20=
STAGE=20closeup=0A2016-08-18=2013:00:36=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20closeup=20METHOD=20=
otopi.plugins.otopi.network.firewalld.Plugin._closeup=0A2016-08-18=20=
13:00:36=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.executeRaw:813=20execute:=20('/bin/firewall-cmd',=20'--reload'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
13:00:43=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.executeRaw:863=20execute-result:=20('/bin/firewall-cmd',=20=
'--reload'),=20rc=3D0=0A2016-08-18=2013:00:43=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.execute:921=20=
execute-output:=20('/bin/firewall-cmd',=20'--reload')=20stdout:=0A=
success=0A=0A2016-08-18=2013:00:43=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.execute:926=20=
execute-output:=20('/bin/firewall-cmd',=20'--reload')=20stderr:=0A=0A=0A=
2016-08-18=2013:00:43=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.executeRaw:813=20execute:=20('/bin/firewall-cmd',=20=
'--get-active-zones'),=20executable=3D'None',=20cwd=3D'None',=20env=3DNone=
=0A2016-08-18=2013:00:43=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.executeRaw:863=20execute-result:=20('/bin/firewall-cmd',=20=
'--get-active-zones'),=20rc=3D0=0A2016-08-18=2013:00:43=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.execute:921=20=
execute-output:=20('/bin/firewall-cmd',=20'--get-active-zones')=20=
stdout:=0Apublic=0A=20=20interfaces:=20eth0=0A=0A2016-08-18=2013:00:43=20=
DEBUG=20otopi.plugins.otopi.network.firewalld=20plugin.execute:926=20=
execute-output:=20('/bin/firewall-cmd',=20'--get-active-zones')=20=
stderr:=0A=0A=0A2016-08-18=2013:00:43=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.executeRaw:813=20execute:=20=
('/bin/firewall-cmd',=20'--zone',=20u'public',=20'--permanent',=20=
'--add-service',=20'ovirt-postgres'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2013:00:43=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.executeRaw:863=20=
execute-result:=20('/bin/firewall-cmd',=20'--zone',=20u'public',=20=
'--permanent',=20'--add-service',=20'ovirt-postgres'),=20rc=3D0=0A=
2016-08-18=2013:00:43=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.execute:921=20execute-output:=20('/bin/firewall-cmd',=20'--zone',=20=
u'public',=20'--permanent',=20'--add-service',=20'ovirt-postgres')=20=
stdout:=0Asuccess=0A=0A2016-08-18=2013:00:43=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.execute:926=20=
execute-output:=20('/bin/firewall-cmd',=20'--zone',=20u'public',=20=
'--permanent',=20'--add-service',=20'ovirt-postgres')=20stderr:=0A=0A=0A=
2016-08-18=2013:00:43=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.executeRaw:813=20execute:=20('/bin/firewall-cmd',=20'--zone',=20=
u'public',=20'--permanent',=20'--add-service',=20'ovirt-https'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
13:00:44=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.executeRaw:863=20execute-result:=20('/bin/firewall-cmd',=20=
'--zone',=20u'public',=20'--permanent',=20'--add-service',=20=
'ovirt-https'),=20rc=3D0=0A2016-08-18=2013:00:44=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.execute:921=20=
execute-output:=20('/bin/firewall-cmd',=20'--zone',=20u'public',=20=
'--permanent',=20'--add-service',=20'ovirt-https')=20stdout:=0Asuccess=0A=
=0A2016-08-18=2013:00:44=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.execute:926=20execute-output:=20('/bin/firewall-cmd',=20'--zone',=20=
u'public',=20'--permanent',=20'--add-service',=20'ovirt-https')=20=
stderr:=0A=0A=0A2016-08-18=2013:00:44=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.executeRaw:813=20execute:=20=
('/bin/firewall-cmd',=20'--zone',=20u'public',=20'--permanent',=20=
'--add-service',=20'ovirt-fence-kdump-listener'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2013:00:44=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.executeRaw:863=20=
execute-result:=20('/bin/firewall-cmd',=20'--zone',=20u'public',=20=
'--permanent',=20'--add-service',=20'ovirt-fence-kdump-listener'),=20=
rc=3D0=0A2016-08-18=2013:00:44=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.execute:921=20=
execute-output:=20('/bin/firewall-cmd',=20'--zone',=20u'public',=20=
'--permanent',=20'--add-service',=20'ovirt-fence-kdump-listener')=20=
stdout:=0Asuccess=0A=0A2016-08-18=2013:00:44=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.execute:926=20=
execute-output:=20('/bin/firewall-cmd',=20'--zone',=20u'public',=20=
'--permanent',=20'--add-service',=20'ovirt-fence-kdump-listener')=20=
stderr:=0A=0A=0A2016-08-18=2013:00:44=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.executeRaw:813=20execute:=20=
('/bin/firewall-cmd',=20'--zone',=20u'public',=20'--permanent',=20=
'--add-service',=20'ovirt-imageio-proxy'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2013:00:45=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.executeRaw:863=20=
execute-result:=20('/bin/firewall-cmd',=20'--zone',=20u'public',=20=
'--permanent',=20'--add-service',=20'ovirt-imageio-proxy'),=20rc=3D0=0A=
2016-08-18=2013:00:45=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.execute:921=20execute-output:=20('/bin/firewall-cmd',=20'--zone',=20=
u'public',=20'--permanent',=20'--add-service',=20'ovirt-imageio-proxy')=20=
stdout:=0Asuccess=0A=0A2016-08-18=2013:00:45=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.execute:926=20=
execute-output:=20('/bin/firewall-cmd',=20'--zone',=20u'public',=20=
'--permanent',=20'--add-service',=20'ovirt-imageio-proxy')=20stderr:=0A=0A=
=0A2016-08-18=2013:00:45=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.executeRaw:813=20execute:=20('/bin/firewall-cmd',=20'--zone',=20=
u'public',=20'--permanent',=20'--add-service',=20=
'ovirt-websocket-proxy'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2013:00:45=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.executeRaw:863=20=
execute-result:=20('/bin/firewall-cmd',=20'--zone',=20u'public',=20=
'--permanent',=20'--add-service',=20'ovirt-websocket-proxy'),=20rc=3D0=0A=
2016-08-18=2013:00:45=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.execute:921=20execute-output:=20('/bin/firewall-cmd',=20'--zone',=20=
u'public',=20'--permanent',=20'--add-service',=20=
'ovirt-websocket-proxy')=20stdout:=0Asuccess=0A=0A2016-08-18=2013:00:45=20=
DEBUG=20otopi.plugins.otopi.network.firewalld=20plugin.execute:926=20=
execute-output:=20('/bin/firewall-cmd',=20'--zone',=20u'public',=20=
'--permanent',=20'--add-service',=20'ovirt-websocket-proxy')=20stderr:=0A=
=0A=0A2016-08-18=2013:00:45=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.executeRaw:813=20execute:=20=
('/bin/firewall-cmd',=20'--zone',=20u'public',=20'--permanent',=20=
'--add-service',=20'ovirt-http'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2013:00:46=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.executeRaw:863=20=
execute-result:=20('/bin/firewall-cmd',=20'--zone',=20u'public',=20=
'--permanent',=20'--add-service',=20'ovirt-http'),=20rc=3D0=0A2016-08-18=20=
13:00:46=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.execute:921=20execute-output:=20('/bin/firewall-cmd',=20'--zone',=20=
u'public',=20'--permanent',=20'--add-service',=20'ovirt-http')=20stdout:=0A=
success=0A=0A2016-08-18=2013:00:46=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.execute:926=20=
execute-output:=20('/bin/firewall-cmd',=20'--zone',=20u'public',=20=
'--permanent',=20'--add-service',=20'ovirt-http')=20stderr:=0A=0A=0A=
2016-08-18=2013:00:46=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.executeRaw:813=20execute:=20('/bin/firewall-cmd',=20'--zone',=20=
u'public',=20'--permanent',=20'--add-service',=20=
'ovirt-vmconsole-proxy'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2013:00:46=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.executeRaw:863=20=
execute-result:=20('/bin/firewall-cmd',=20'--zone',=20u'public',=20=
'--permanent',=20'--add-service',=20'ovirt-vmconsole-proxy'),=20rc=3D0=0A=
2016-08-18=2013:00:46=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.execute:921=20execute-output:=20('/bin/firewall-cmd',=20'--zone',=20=
u'public',=20'--permanent',=20'--add-service',=20=
'ovirt-vmconsole-proxy')=20stdout:=0Asuccess=0A=0A2016-08-18=2013:00:46=20=
DEBUG=20otopi.plugins.otopi.network.firewalld=20plugin.execute:926=20=
execute-output:=20('/bin/firewall-cmd',=20'--zone',=20u'public',=20=
'--permanent',=20'--add-service',=20'ovirt-vmconsole-proxy')=20stderr:=0A=
=0A=0A2016-08-18=2013:00:46=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.executeRaw:813=20execute:=20=
('/bin/firewall-cmd',=20'--reload'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2013:00:53=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.executeRaw:863=20=
execute-result:=20('/bin/firewall-cmd',=20'--reload'),=20rc=3D0=0A=
2016-08-18=2013:00:53=20DEBUG=20otopi.plugins.otopi.network.firewalld=20=
plugin.execute:921=20execute-output:=20('/bin/firewall-cmd',=20=
'--reload')=20stdout:=0Asuccess=0A=0A2016-08-18=2013:00:53=20DEBUG=20=
otopi.plugins.otopi.network.firewalld=20plugin.execute:926=20=
execute-output:=20('/bin/firewall-cmd',=20'--reload')=20stderr:=0A=0A=0A=
2016-08-18=2013:00:53=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20closeup=20METHOD=20=
otopi.plugins.otopi.network.iptables.Plugin._closeup=0A2016-08-18=20=
13:00:53=20DEBUG=20otopi.context=20context._executeMethod:134=20=
condition=20False=0A2016-08-18=2013:00:53=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20closeup=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.system.hostile_services.Plugin._clo=
seup=0A2016-08-18=2013:00:53=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20closeup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.fence_kdump_listener.config.=
Plugin._closeup=0A2016-08-18=2013:00:53=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.state:130=20stopping=20=
service=20ovirt-fence-kdump-listener=0A2016-08-18=2013:00:53=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'stop',=20'ovirt-fence-kdump-listener.service'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
13:00:53=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20'stop',=20=
'ovirt-fence-kdump-listener.service'),=20rc=3D0=0A2016-08-18=2013:00:53=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'stop',=20=
'ovirt-fence-kdump-listener.service')=20stdout:=0A=0A=0A2016-08-18=20=
13:00:53=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'stop',=20=
'ovirt-fence-kdump-listener.service')=20stderr:=0A=0A=0A2016-08-18=20=
13:00:53=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
systemd.state:130=20starting=20service=20ovirt-fence-kdump-listener=0A=
2016-08-18=2013:00:53=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'start',=20=
'ovirt-fence-kdump-listener.service'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2013:00:53=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'start',=20=
'ovirt-fence-kdump-listener.service'),=20rc=3D0=0A2016-08-18=2013:00:53=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'start',=20=
'ovirt-fence-kdump-listener.service')=20stdout:=0A=0A=0A2016-08-18=20=
13:00:53=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'start',=20=
'ovirt-fence-kdump-listener.service')=20stderr:=0A=0A=0A2016-08-18=20=
13:00:53=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
systemd.startup:99=20set=20service=20ovirt-fence-kdump-listener=20=
startup=20to=20True=0A2016-08-18=2013:00:53=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'show',=20'-p',=20'Id',=20=
'ovirt-fence-kdump-listener.service'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2013:00:53=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'show',=20'-p',=20'Id',=20=
'ovirt-fence-kdump-listener.service'),=20rc=3D0=0A2016-08-18=2013:00:53=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'Id',=20=
'ovirt-fence-kdump-listener.service')=20stdout:=0A=
Id=3Dovirt-fence-kdump-listener.service=0A=0A2016-08-18=2013:00:53=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'Id',=20=
'ovirt-fence-kdump-listener.service')=20stderr:=0A=0A=0A2016-08-18=20=
13:00:53=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'enable',=20=
u'ovirt-fence-kdump-listener.service'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2013:00:54=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'enable',=20=
u'ovirt-fence-kdump-listener.service'),=20rc=3D0=0A2016-08-18=2013:00:54=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'enable',=20=
u'ovirt-fence-kdump-listener.service')=20stdout:=0A=0A=0A2016-08-18=20=
13:00:54=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'enable',=20=
u'ovirt-fence-kdump-listener.service')=20stderr:=0A=0A=0A2016-08-18=20=
13:00:54=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
closeup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.engine.Plugin._closeu=
p=0A2016-08-18=2013:00:54=20INFO=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.engine=20=
engine._closeup:53=20Starting=20engine=20service=0A2016-08-18=2013:00:54=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20systemd.state:130=20=
starting=20service=20ovirt-engine=0A2016-08-18=2013:00:54=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'start',=20'ovirt-engine.service'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
13:00:56=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20'start',=20=
'ovirt-engine.service'),=20rc=3D0=0A2016-08-18=2013:00:56=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'start',=20=
'ovirt-engine.service')=20stdout:=0A=0A=0A2016-08-18=2013:00:56=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'start',=20=
'ovirt-engine.service')=20stderr:=0A=0A=0A2016-08-18=2013:00:56=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20systemd.startup:99=20set=20=
service=20ovirt-engine=20startup=20to=20True=0A2016-08-18=2013:00:56=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20=
execute:=20('/bin/systemctl',=20'show',=20'-p',=20'Id',=20=
'ovirt-engine.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2013:00:56=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'show',=20'-p',=20'Id',=20=
'ovirt-engine.service'),=20rc=3D0=0A2016-08-18=2013:00:56=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'Id',=20=
'ovirt-engine.service')=20stdout:=0AId=3Dovirt-engine.service=0A=0A=
2016-08-18=2013:00:56=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'Id',=20'ovirt-engine.service')=20stderr:=0A=0A=0A2016-08-18=20=
13:00:56=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'enable',=20=
u'ovirt-engine.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2013:00:56=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'enable',=20=
u'ovirt-engine.service'),=20rc=3D0=0A2016-08-18=2013:00:56=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'enable',=20=
u'ovirt-engine.service')=20stdout:=0A=0A=0A2016-08-18=2013:00:56=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'enable',=20=
u'ovirt-engine.service')=20stderr:=0A=0A=0A2016-08-18=2013:00:56=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20closeup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine.system.nfs.Plugin._closeup=0A=
2016-08-18=2013:00:56=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:56=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20closeup=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.service.Plugin._clo=
seup=0A2016-08-18=2013:00:56=20INFO=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.service=20=
service._closeup:52=20Starting=20dwh=20service=0A2016-08-18=2013:00:56=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20systemd.state:130=20=
starting=20service=20ovirt-engine-dwhd=0A2016-08-18=2013:00:56=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'start',=20'ovirt-engine-dwhd.service'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
13:00:58=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20'start',=20=
'ovirt-engine-dwhd.service'),=20rc=3D0=0A2016-08-18=2013:00:58=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'start',=20=
'ovirt-engine-dwhd.service')=20stdout:=0A=0A=0A2016-08-18=2013:00:58=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'start',=20=
'ovirt-engine-dwhd.service')=20stderr:=0A=0A=0A2016-08-18=2013:00:58=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20systemd.startup:99=20set=20=
service=20ovirt-engine-dwhd=20startup=20to=20True=0A2016-08-18=20=
13:00:58=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'show',=20'-p',=20=
'Id',=20'ovirt-engine-dwhd.service'),=20executable=3D'None',=20=
cwd=3D'None',=20env=3DNone=0A2016-08-18=2013:00:58=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'show',=20'-p',=20'Id',=20=
'ovirt-engine-dwhd.service'),=20rc=3D0=0A2016-08-18=2013:00:58=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'show',=20'-p',=20'Id',=20=
'ovirt-engine-dwhd.service')=20stdout:=0AId=3Dovirt-engine-dwhd.service=0A=
=0A2016-08-18=2013:00:58=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.execute:926=20execute-output:=20('/bin/systemctl',=20'show',=20=
'-p',=20'Id',=20'ovirt-engine-dwhd.service')=20stderr:=0A=0A=0A=
2016-08-18=2013:00:58=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'enable',=20=
u'ovirt-engine-dwhd.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2013:00:59=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'enable',=20=
u'ovirt-engine-dwhd.service'),=20rc=3D0=0A2016-08-18=2013:00:59=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'enable',=20=
u'ovirt-engine-dwhd.service')=20stdout:=0A=0A=0A2016-08-18=2013:00:59=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'enable',=20=
u'ovirt-engine-dwhd.service')=20stderr:=0A=0A=0A2016-08-18=2013:00:59=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20closeup=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.legacy.config.Plugin._cl=
oseup=0A2016-08-18=2013:00:59=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:00:59=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20closeup=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.config.Plugin._closeu=
p=0A2016-08-18=2013:00:59=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
systemd.state:130=20stopping=20service=20ovirt-imageio-proxy=0A=
2016-08-18=2013:00:59=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:813=20execute:=20('/bin/systemctl',=20'stop',=20=
'ovirt-imageio-proxy.service'),=20executable=3D'None',=20cwd=3D'None',=20=
env=3DNone=0A2016-08-18=2013:00:59=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:863=20=
execute-result:=20('/bin/systemctl',=20'stop',=20=
'ovirt-imageio-proxy.service'),=20rc=3D0=0A2016-08-18=2013:00:59=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'stop',=20=
'ovirt-imageio-proxy.service')=20stdout:=0A=0A=0A2016-08-18=2013:00:59=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'stop',=20=
'ovirt-imageio-proxy.service')=20stderr:=0A=0A=0A2016-08-18=2013:00:59=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20systemd.state:130=20=
starting=20service=20ovirt-imageio-proxy=0A2016-08-18=2013:00:59=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.executeRaw:813=20execute:=20=
('/bin/systemctl',=20'start',=20'ovirt-imageio-proxy.service'),=20=
executable=3D'None',=20cwd=3D'None',=20env=3DNone=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.plugins.otopi.services.systemd=20=
plugin.executeRaw:863=20execute-result:=20('/bin/systemctl',=20'start',=20=
'ovirt-imageio-proxy.service'),=20rc=3D1=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.plugins.otopi.services.systemd=20plugin.execute:921=20=
execute-output:=20('/bin/systemctl',=20'start',=20=
'ovirt-imageio-proxy.service')=20stdout:=0A=0A=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.plugins.otopi.services.systemd=20plugin.execute:926=20=
execute-output:=20('/bin/systemctl',=20'start',=20=
'ovirt-imageio-proxy.service')=20stderr:=0AJob=20for=20=
ovirt-imageio-proxy.service=20failed=20because=20the=20control=20process=20=
exited=20with=20error=20code.=20See=20"systemctl=20status=20=
ovirt-imageio-proxy.service"=20and=20"journalctl=20-xe"=20for=20details.=0A=
=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context._executeMethod:142=20method=20exception=0ATraceback=20(most=20=
recent=20call=20last):=0A=20=20File=20=
"/usr/lib/python2.7/site-packages/otopi/context.py",=20line=20132,=20in=20=
_executeMethod=0A=20=20=20=20method['method']()=0A=20=20File=20=
"/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-setup/ovirt_ima=
geio_proxy/config.py",=20line=20351,=20in=20_closeup=0A=20=20=20=20=
state=3Dstate,=0A=20=20File=20=
"/usr/share/otopi/plugins/otopi/services/systemd.py",=20line=20141,=20in=20=
state=0A=20=20=20=20service=3Dname,=0ARuntimeError:=20Failed=20to=20=
start=20service=20'ovirt-imageio-proxy'=0A2016-08-18=2013:01:00=20ERROR=20=
otopi.context=20context._executeMethod:151=20Failed=20to=20execute=20=
stage=20'Closing=20up':=20Failed=20to=20start=20service=20=
'ovirt-imageio-proxy'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:760=20ENVIRONMENT=20DUMP=20-=20BEGIN=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/error=3Dbool:'True'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/exceptionInfo=3Dlist:'[(<type=20=
'exceptions.RuntimeError'>,=20RuntimeError("Failed=20to=20start=20=
service=20'ovirt-imageio-proxy'",),=20<traceback=20object=20at=20=
0x3125e18>)]'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
13:01:00=20INFO=20otopi.context=20context.runSequence:687=20Stage:=20=
Clean=20up=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.runSequence:691=20STAGE=20cleanup=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20cleanup=20=
METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.misc.Plugin._cleanup=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.plugins.otopi.dialog.human=20=
dialog.__logString:204=20DIALOG:SEND=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20Log=20file=20is=20located=20at=20=
/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20cleanup=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine.Plugin.=
_cleanup=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20cleanup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.core.remote_engine.Plugi=
n._cleanupEngineAccess=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20cleanup=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_imageio_proxy.pki.Plugin._cleanup=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20cleanup=20=
METHOD=20=
otopi.plugins.ovirt_engine_setup.websocket_proxy.pki.Plugin._cleanup=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20cleanup=20=
METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.uninstall.Plugin._cleanup=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20cleanup=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.answerfile.Plugin._cleanup=0A=
2016-08-18=2013:01:00=20INFO=20=
otopi.plugins.ovirt_engine_common.base.core.answerfile=20=
answerfile._cleanup:74=20Generating=20answer=20file=20=
'/var/lib/ovirt-engine/setup/answers/20160818130100-setup.conf'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20cleanup=20METHOD=20=
otopi.plugins.ovirt_engine_setup.ovirt_engine_dwh.db.schema.Plugin._rollba=
ck=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context._executeMethod:134=20condition=20False=0A2016-08-18=2013:01:00=20=
INFO=20otopi.context=20context.runSequence:687=20Stage:=20=
Pre-termination=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.runSequence:691=20STAGE=20pre-terminate=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
pre-terminate=20METHOD=20=
otopi.plugins.otopi.core.misc.Plugin._preTerminate=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:760=20=
ENVIRONMENT=20DUMP=20-=20BEGIN=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
BASE/aborted=3Dbool:'False'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20BASE/debug=3Dint:'0'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/error=3Dbool:'True'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/exceptionInfo=3Dlist:'[(<type=20=
'exceptions.RuntimeError'>,=20RuntimeError("Failed=20to=20start=20=
service=20'ovirt-imageio-proxy'",),=20<traceback=20object=20at=20=
0x3125e18>)]'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/executionDirectory=3Dstr:'/root'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/exitCode=3Dlist:'[{'priority':=20=
90001,=20'code':=200}]'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20BASE/log=3Dbool:'True'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
BASE/pluginGroups=3Dstr:'otopi:ovirt-engine-common:ovirt-engine-setup'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
BASE/pluginPath=3Dstr:'/usr/share/otopi/plugins:/usr/share/ovirt-engine/se=
tup/bin/../plugins'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
BASE/suppressEnvironmentKeys=3Dlist:'[]'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/chkconfig=3Dstr:'/sbin/chkconfig'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/chronyc=3Dstr:'/bin/chronyc'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/date=3Dstr:'/bin/date'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/dig=3Dstr:'/bin/dig'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/exportfs=3Dstr:'/sbin/exportfs'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/firewall-cmd=3Dstr:'/bin/firewall-cmd'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/hwclock=3Dstr:'/sbin/hwclock'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/initctl=3DNoneType:'None'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/ip=3Dstr:'/sbin/ip'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/ntpq=3DNoneType:'None'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/openssl=3Dstr:'/bin/openssl'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/pg_dump=3Dstr:'/bin/pg_dump'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/pg_restore=3Dstr:'/bin/pg_restore'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/psql=3Dstr:'/bin/psql'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/rc=3DNoneType:'None'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/rc-update=3DNoneType:'None'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/reboot=3Dstr:'/sbin/reboot'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/restorecon=3Dstr:'/sbin/restorecon'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/rpm=3Dstr:'/bin/rpm'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/selinuxenabled=3Dstr:'/sbin/selinuxenabled'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/semanage=3Dstr:'/sbin/semanage'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/service=3Dstr:'/sbin/service'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/ssh-keygen=3Dstr:'/bin/ssh-keygen'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/sysctl=3Dstr:'/sbin/sysctl'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
COMMAND/systemctl=3Dstr:'/bin/systemctl'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/configFileAppend=3DNoneType:'None'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/configFileName=3Dstr:'/etc/ovirt-engine-setup.conf'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/failOnPrioOverride=3Dbool:'True'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/internalPackageTransaction=3DTransaction:'transaction'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logDir=3Dstr:'/var/log/ovirt-engine/setup'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFileHandle=3Dfile:'<open=20file=20=
'/var/log/ovirt-engine/setup/ovirt-engine-setup-20160818125822-b8g6ku.log'=
,=20mode=20'a'=20at=200x223cf60>'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFileName=3Dstr:'/var/log/ovirt-engine/setup/ovirt-engine-setup-201=
60818125822-b8g6ku.log'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/logFileNamePrefix=3Dstr:'ovirt-engine-setup'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFilter=3D_MyLoggerFilter:'filter'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFilterKeys=3Dlist:'['OVESETUP_DB/password',=20=
'OVESETUP_DWH_DB/password',=20'OVESETUP_DB/password',=20=
'OVESETUP_CONFIG/adminPassword',=20'OVESETUP_PKI/storePassword',=20=
'OVESETUP_CONFIG/remoteEngineHostRootPassword']'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/logFilterRe=3Dlist:'[<_sre.SRE_Pattern=20object=20at=200x22bd2c0>]'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20CORE/logRemoveAtExit=3Dbool:'False'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
CORE/mainTransaction=3DTransaction:'transaction'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/modifiedFiles=3Dlist:'[]'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
CORE/randomizeEvents=3Dbool:'False'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
DIALOG/autoAcceptDefault=3Dbool:'False'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
DIALOG/boundary=3Dstr:'--=3D451b80dc-996f-432e-9e4f-2b29ef6d1141=3D--'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20DIALOG/cliVersion=3Dint:'1'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20DIALOG/customization=3Dbool:'False'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20DIALOG/dialect=3Dstr:'human'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20INFO/PACKAGE_NAME=3Dstr:'otopi'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20INFO/PACKAGE_VERSION=3Dstr:'1.5.1'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
NETWORK/firewalldAvailable=3Dbool:'True'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/firewalldDisableServices=3Dlist:'[]'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/firewalldEnable=3Dbool:'True'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/iptablesEnable=3Dbool:'False'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/iptablesRules=3DNoneType:'None'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/sshEnable=3Dbool:'False'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/sshKey=3DNoneType:'None'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK/sshUser=3Dstr:''=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
NETWORK_FIREWALLD_SERVICE/ovirt-fence-kdump-listener=3Dstr:'<?xml=20=
version=3D"1.0"=20encoding=3D"utf-8"?>=0A<service>=0A=20=20=
<short>ovirt-fence-kdump-listener</short>=0A=20=20<description>oVirt=20=
configured=20fence_kdump=20listener=20service</description>=0A=20=20=
<port=20protocol=3D"udp"=20port=3D"7410"/>=0A</service>=0A'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK_FIREWALLD_SERVICE/ovirt-http=3Dstr:'<?xml=20version=3D"1.0"=20=
encoding=3D"utf-8"?>=0A<service>=0A=20=20<short>ovirt-http</short>=0A=20=20=
<description>oVirt=20configured=20http=20service</description>=0A=20=20=
<port=20protocol=3D"tcp"=20port=3D"80"/>=0A</service>=0A'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK_FIREWALLD_SERVICE/ovirt-https=3Dstr:'<?xml=20version=3D"1.0"=20=
encoding=3D"utf-8"?>=0A<service>=0A=20=20<short>ovirt-https</short>=0A=20=
=20<description>oVirt=20configured=20https=20service</description>=0A=20=20=
<port=20protocol=3D"tcp"=20port=3D"443"/>=0A</service>=0A'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK_FIREWALLD_SERVICE/ovirt-imageio-proxy=3Dstr:'<?xml=20=
version=3D"1.0"=20encoding=3D"utf-8"?>=0A<service>=0A=20=20=
<short>ovirt-imageio-proxy</short>=0A=20=20<description>oVirt=20ImageIO=20=
Proxy=20service</description>=0A=20=20<port=20protocol=3D"tcp"=20=
port=3D"54323"/>=0A</service>=0A'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK_FIREWALLD_SERVICE/ovirt-postgres=3Dstr:'<?xml=20version=3D"1.0"=20=
encoding=3D"utf-8"?>=0A<service>=0A=20=20<short>ovirt-postgres</short>=0A=
=20=20<description>oVirt=20configured=20postgres=20service</description>=0A=
=20=20<port=20protocol=3D"tcp"=20port=3D"5432"/>=0A</service>=0A'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
NETWORK_FIREWALLD_SERVICE/ovirt-vmconsole-proxy=3Dstr:'<?xml=20=
version=3D"1.0"=20encoding=3D"utf-8"?>=0A<service>=0A=20=20=
<short>ovirt-vmconsole-proxy</short>=0A=20=20<description>oVirt=20=
configured=20VM=20Console=20Proxy=20service</description>=0A=20=20<port=20=
protocol=3D"tcp"=20port=3D"2222"/>=0A</service>=0A'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
NETWORK_FIREWALLD_SERVICE/ovirt-websocket-proxy=3Dstr:'<?xml=20=
version=3D"1.0"=20encoding=3D"utf-8"?>=0A<service>=0A=20=20=
<short>ovirt-websocket-proxy</short>=0A=20=20<description>oVirt=20=
configured=20WebSocket=20Proxy=20service</description>=0A=20=20<port=20=
protocol=3D"tcp"=20port=3D"6100"/>=0A</service>=0A'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/enableUpgrade=3DNoneType:'None'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/requireRollback=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/versionLockApply=3Dlist:'['ovirt-engine-extension-aaa-jdb=
c',=20'ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay',=20=
'ovirt-engine',=20'ovirt-engine-backend',=20'ovirt-engine-dbscripts',=20=
'ovirt-engine-restapi',=20'ovirt-engine-tools',=20=
'ovirt-engine-tools-backup',=20'ovirt-engine-userportal',=20=
'ovirt-engine-webadmin-portal',=20'ovirt-engine-dashboard',=20=
'ovirt-engine-dwh']'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OSETUP_RPMDISTRO/versionLockFilter=3Dlist:'['ovirt-engine-extension-aaa-jd=
bc',=20'ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay',=20=
'ovirt-engine']'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configFileOvirtEngine=3Dstr:'/etc/httpd/conf.d/z-ovirt-eng=
ine-proxy.conf'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configFileOvirtRoot=3Dstr:'/etc/httpd/conf.d/ovirt-engine-=
root-redirect.conf'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configFileSsl=3Dstr:'/etc/httpd/conf.d/ssl.conf'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configureRootRedirection=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configureRootRedirectionDefault=3Dbool:'True'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configureSsl=3DNoneType:'None'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/configured=3Dbool:'True'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/enable=3Dbool:'True'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/httpdService=3Dstr:'httpd'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_APACHE/needRestart=3Dbool:'True'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_ASYNC/clearTasks=3Dbool:'True'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_ASYNC/clearTasksWait=3Dint:'20'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/addOvirtGlanceRepository=3Dbool:'True'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminPassword=3DNoneType:'None'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUser=3Dstr:'admin@internal'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUserAuthzName=3Dstr:'internal-authz'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUserAuthzType=3Dstr:'ovirt-engine-extension-aaa-jdbc'=
=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUserId=3Dstr:'40cc61cd-b603-4067-b8c2-00c7fd39e241'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/adminUserNamespace=3Dstr:'*'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/applicationMode=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/continueSetupOnHEVM=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/engineDbBackupDir=3Dstr:'/var/lib/ovirt-engine/backups'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/engineHeapMax=3Dstr:'1955M'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/engineHeapMin=3Dstr:'1955M'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/engineServiceStopNeeded=3Dbool:'True'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/fenceKdumpListenerStopNeeded=3Dbool:'True'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/firewallChangesReview=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/firewallManager=3Dstr:'firewalld'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/firewallManagers=3Dlist:'[<otopi.plugins.ovirt_engine_comm=
on.base.network.firewall_manager_firewalld._FirewalldManager=20object=20=
at=200x29bced0>,=20=
<otopi.plugins.ovirt_engine_common.base.network.firewall_manager_human._Hu=
manManager=20object=20at=200x29bcad0>,=20=
<otopi.plugins.ovirt_engine_common.base.network.firewall_manager_iptables.=
_IpTablesManager=20object=20at=200x29bcfd0>]'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/fqdn=3Dstr:'cultivar.grove.silverorange.com'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/fqdnNonLoopback=3Dbool:'False'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/fqdnReverseValidation=3Dbool:'False'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/httpPort=3Dint:'80'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/httpsPort=3Dint:'443'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/ignoreVdsgroupInNotifier=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/imageioProxyConfig=3Dbool:'True'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/imageioProxyHost=3Dstr:'localhost'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/imageioProxyPort=3Dint:'54323'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/imageioProxyStopNeeded=3Dbool:'True'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainACL=3DNoneType:'None'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainDefaultMountPoint=3Dstr:'/var/lib/exports/iso'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainExists=3Dbool:'False'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainMountPoint=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainName=3DNoneType:'None'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainSdUuid=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoDomainStorageDir=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/isoPathsToUpload=3Dlist:'['/usr/share/virtio-win/virtio-wi=
n_x86.vfd',=20'/usr/share/virtio-win/virtio-win_amd64.vfd',=20=
'/usr/share/virtio-win/virtio-win.iso',=20=
'/usr/share/ovirt-guest-tools-iso/ovirt-tools-setup.iso',=20=
'/usr/share/rhev-guest-tools-iso/rhev-tools-setup.iso']'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/javaHome=3Dunicode:'/usr/lib/jvm/jre'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/javaNeeded=3Dbool:'True'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossAjpPort=3Dint:'8702'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossDebugAddress=3Dstr:'127.0.0.1:8787'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossDirectHttpPort=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossDirectHttpsPort=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossHome=3Dstr:'/usr/share/ovirt-engine-wildfly'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossHttpPort=3Dint:'8080'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossHttpsPort=3Dint:'8443'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/jbossNeeded=3Dbool:'True'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/keySize=3Dint:'2048'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/pkiOIPCSRFilename=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/pkiRenewalDocUrl=3Dstr:'http://www.ovirt.org/OVirt_3.5.4_R=
elease_Notes#PKI'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/pkiWSPCSRFilename=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/publicHttpPort=3Dint:'80'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/publicHttpsPort=3Dint:'443'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineHostClientKey=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineHostKnownHosts=3DNoneType:'None'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineHostRootPassword=3DNoneType:'None'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineHostSshPort=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineSetupStyle=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/remoteEngineSetupStyles=3Dlist:'[<otopi.plugins.ovirt_engi=
ne_common.base.remote_engine.remote_engine_root_ssh._RootSshManager=20=
object=20at=200x29bcb10>,=20=
<otopi.plugins.ovirt_engine_common.base.remote_engine.remote_engine_manual=
_files._ManualFiles=20object=20at=200x29bca10>]'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/sanWipeAfterDelete=3Dbool:'False'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/storageIsLocal=3Dbool:'False'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/storageType=3DNoneType:'None'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/totalMemoryMB=3Dint:'7823'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/updateFirewall=3Dbool:'True'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/validFirewallManagers=3Dstr:''=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/websocketProxyConfig=3Dbool:'True'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/websocketProxyHost=3Dstr:'localhost'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/websocketProxyPort=3Dint:'6100'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CONFIG/websocketProxyStopNeeded=3Dbool:'True'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/action=3Dstr:'setup'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/answerFile=3DNoneType:'None'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/developerMode=3Dbool:'False'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/engineStop=3Dbool:'True'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/generatePostInstall=3Dbool:'True'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/generatedByVersion=3Dstr:'4.0.2.6'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/offlinePackager=3Dbool:'False'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/originalGeneratedByVersion=3Dstr:'4.0.2.6'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/reconfigureOptionalComponents=3DNoneType:'None'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/registerUninstallGroups=3DRegisterGroups:'<otopi.plugins.ovi=
rt_engine_common.base.core.uninstall.RegisterGroups=20object=20at=20=
0x29bc450>'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/remoteEngine=3DRemoteEngine:'<ovirt_engine_setup.remote_engi=
ne.RemoteEngine=20object=20at=200x29bcd50>'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/setupAttributesModules=3Dlist:'[<module=20=
'ovirt_engine_setup.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.engine_common.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine_common/constants.=
pyc'>,=20<module=20'ovirt_engine_setup.dwh.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/dwh/constants.pyc'>,=20=
<module=20'ovirt_engine_setup.ovirt_imageio_proxy.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/ovirt_imageio_proxy/cons=
tants.pyc'>,=20<module=20=
'ovirt_engine_setup.vmconsole_proxy_helper.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/vmconsole_proxy_helper/c=
onstants.pyc'>,=20<module=20=
'ovirt_engine_setup.websocket_proxy.constants'=20from=20=
'/usr/share/ovirt-engine/setup/ovirt_engine_setup/websocket_proxy/constant=
s.pyc'>]'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/uninstallUnremovableFiles=3Dlist:'['/etc/exports',=20=
'/etc/yum/pluginconf.d/versionlock.list',=20=
'/etc/dnf/plugins/versionlock.list']'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE/upgradeSupportedVersions=3Dstr:'3.6,4.0'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_FILE_GROUP/ca_config=3Dlist:'[[]]'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_FILE_GROUP/ca_pki=3Dlist:'[[]]'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_FILE_GROUP/ovirt_dwh_files=3Dlist:'[[],=20[],=20=
[]]'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_FILE_GROUP/versionlock=3Dlist:'[]'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_LINES_GROUP/ca_config=3Ddict:'{}'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_LINES_GROUP/ca_pki=3Ddict:'{}'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_LINES_GROUP/ovirt_dwh_files=3Ddict:'{}'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_CORE_MODIFIED_LINES_GROUP/versionlock=3Ddict:'{'/etc/yum/pluginco=
nf.d/versionlock.list':=20[{'added':=20=
u'ovirt-engine-webadmin-portal-4.0.2.6-1.el7.centos.noarch'},=20=
{'added':=20u'ovirt-engine-dwh-4.0.2-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-4.0.2.6-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-restapi-4.0.2.6-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-dbscripts-4.0.2.6-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-tools-backup-4.0.2.6-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-dashboard-1.0.2-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-userportal-4.0.2.6-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-wildfly-10.0.0-1.el7.x86_64'},=20{'added':=20=
u'ovirt-engine-backend-4.0.2.6-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-wildfly-overlay-10.0.0-1.el7.noarch'},=20{'added':=20=
u'ovirt-engine-tools-4.0.2.6-1.el7.centos.noarch'},=20{'added':=20=
u'ovirt-engine-extension-aaa-jdbc-1.1.0-1.el7.noarch'}]}'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/connection=3Dconnection:'<connection=20object=20at=20=
0x3079370;=20dsn:=20'dbname=3Dengine=20user=3Dengine=20=
password=3Dxxxxxxxxxxxxxxxxxxxxxx=20host=3Dlocalhost=20port=3D5432=20=
sslmode=3Dallow',=20closed:=200>'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/database=3Dstr:'engine'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/dumper=3Dstr:'pg_custom'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/filter=3DNoneType:'None'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/fixDbViolations=3DNoneType:'None'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/host=3Dstr:'localhost'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/newDatabase=3Dbool:'False'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/password=3Dstr:'**FILTERED**'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/pgPassFile=3Dstr:'/tmp/tmpZ8kHN0'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/port=3Dstr:'5432'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/restoreJobs=3Dint:'2'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/secured=3Dbool:'False'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/securedHostValidation=3Dbool:'False'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/statement=3DStatement:'<ovirt_engine_setup.engine_common.datab=
ase.Statement=20object=20at=200x30cc1d0>'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DB/user=3Dstr:'engine'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DIALOG/confirmSettings=3Dbool:'True'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DOCS/docsAreLocal=3Dbool:'False'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DOCS/dwhDocUrl=3Dstr:'http://www.ovirt.org/Ovirt_DWH'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DOCS/reportsDocUrl=3Dstr:'http://www.ovirt.org/Ovirt_Reports'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CONFIG/dwhDbBackupDir=3Dstr:'/var/lib/ovirt-engine-dwh/backup=
s'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CONFIG/dwhServiceStopNeeded=3Dbool:'True'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CONFIG/remoteEngineConfigured=3Dbool:'False'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CONFIG/scale=3Dstr:'1'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CORE/enable=3Dbool:'True'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_CORE/uuid=3Dstr:'86e6524b-9cc3-4693-988c-161a1af65356'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/connection=3Dconnection:'<connection=20object=20at=20=
0x3693a20;=20dsn:=20'dbname=3Dovirt_engine_history=20=
user=3Dovirt_engine_history=20password=3Dxxxxxxxxxxxxxxxxxxxxxx=20=
host=3Dlocalhost=20port=3D5432=20sslmode=3Dallow',=20closed:=200>'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/database=3Dstr:'ovirt_engine_history'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/disconnectExistingDwh=3DNoneType:'None'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/dumper=3Dstr:'pg_custom'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/filter=3DNoneType:'None'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/host=3Dstr:'localhost'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/newDatabase=3Dbool:'False'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/password=3Dstr:'**FILTERED**'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/performBackup=3Dbool:'True'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/pgPassFile=3Dstr:'/tmp/tmp8s8Ayx'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/port=3Dstr:'5432'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/restoreBackupLate=3Dbool:'True'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/restoreJobs=3Dint:'2'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/secured=3Dbool:'False'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/securedHostValidation=3Dbool:'False'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/statement=3DStatement:'<ovirt_engine_setup.engine_common.d=
atabase.Statement=20object=20at=200x30ccb50>'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_DB/user=3Dstr:'ovirt_engine_history'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_PROVISIONING/postgresProvisioningEnabled=3DNoneType:'None'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_RPMDISRO_PACKAGES=3Dstr:'ovirt-engine-dwh'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_DWH_RPMDISRO_PACKAGES_SETUP=3Dstr:'ovirt-engine-dwh-setup'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_ENGINE_CONFIG/fqdn=3Dstr:'cultivar.grove.silverorange.com'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_ENGINE_CORE/enable=3Dbool:'True'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldServices=3Dlist:'[{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-http'},=20{'directory':=20=
'ovirt-common',=20'name':=20'ovirt-https'},=20{'directory':=20=
'vmconsole-proxy',=20'name':=20'ovirt-vmconsole-proxy'},=20{'directory':=20=
'ovirt-imageio-proxy',=20'name':=20'ovirt-imageio-proxy'},=20=
{'directory':=20'websocket-proxy',=20'name':=20'ovirt-websocket-proxy'},=20=
{'directory':=20'ovirt-engine',=20'name':=20=
'ovirt-fence-kdump-listener'},=20{'directory':=20'ovirt-common',=20=
'name':=20'ovirt-postgres'},=20{'directory':=20'ovirt-common',=20'name':=20=
'ovirt-postgres'}]'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_NETWORK/firewalldSubst=3Ddict:'{'@WEBSOCKET_PROXY_PORT@':=20=
6100,=20'@HTTPS_PORT@':=20443,=20'@VMCONSOLE_PROXY_PORT@':=202222,=20=
'@HTTP_PORT@':=2080,=20'@IMAGEIO_PROXY_PORT@':=2054323,=20=
'@JBOSS_HTTPS_PORT@':=20None,=20'@JBOSS_HTTP_PORT@':=20None}'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20OVESETUP_PKI/country=3Dstr:'US'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PKI/organization=3Dstr:'grove.silverorange.com'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_PKI/renew=3DNoneType:'None'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_PKI/sshPublicKey=3Dunicode:'ssh-rsa=20=
AAAAB3NzaC1yc2EAAAADAQABAAABAQCx8Z42YydSVn8qxgNkwzCCcZrrmeo62nKQqH8Y9mli1O=
80hRtUrOMAKV9GD/A/VrJJMAvz07Ljx/pQDaKigLMWAKKFD1U9trJSyyxlYMo1ovY5uTafD86P=
uIzNrtjdD0VPNn0OWmsYEXBP3odiuY4vnmoFSrjGo5JE8MY4csKJOiugcKd8nDLOaLjoXrj5zT=
nOLbUNytIrp2kZiSoQpM9U2V7ZuZk5G+FH+ieNnlEzCTZKJEVIpDQYjiUgeLrUwftbqZuPaf6o=
PxMN+lDQNFEQxMSy57lFjjY70JqGCUpI1/ok0FMZWMi4HK3bt9GLoqXO1QqFlWYpjEWqBWVjM6=
Cl'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PKI/storePassword=3Dstr:'**FILTERED**'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresConf=3Dstr:'/var/lib/pgsql/data/postgresql.c=
onf'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresLCMessages=3Dstr:''en_US.UTF-8''=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresListenAddress=3Dstr:''*''=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresMaxConn=3Dint:'150'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresPgHba=3Dstr:'/var/lib/pgsql/data/pg_hba.conf=
'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresPgVersion=3Dstr:'/var/lib/pgsql/data/PG_VERS=
ION'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresProvisioningEnabled=3DNoneType:'None'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_PROVISIONING/postgresService=3Dstr:'postgresql'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/aaaJdbcPackage=3Dstr:'ovirt-engine-extension-aaa-jdbc'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/additionalPackages=3Dstr:'ovirt-host-deploy,ovirt-engin=
e-cli,ovirt-image-uploader,ovirt-iso-uploader,ovirt-engine-dashboard'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/enginePackages=3Dstr:'ovirt-engine'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/engineSetupPackages=3Dstr:'ovirt-engine-setup'=0A=
2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/jbossPackages=3Dstr:'ovirt-engine-wildfly,ovirt-engine-=
wildfly-overlay'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/packagesSetup=3Dlist:'['ovirt-engine-setup',=20=
'ovirt-engine-setup-plugin-websocket-proxy',=20=
'ovirt-engine-dwh-setup']'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/packagesUpgradeList=3Dlist:'[{'packages':=20=
['ovirt-engine-extension-aaa-jdbc']},=20{'packages':=20=
['ovirt-engine-wildfly',=20'ovirt-engine-wildfly-overlay']},=20=
{'packages':=20['ovirt-engine',=20'ovirt-host-deploy',=20=
'ovirt-engine-cli',=20'ovirt-image-uploader',=20'ovirt-iso-uploader',=20=
'ovirt-engine-dashboard'],=20'group':=20'ovirt-engine-4.0'},=20=
{'packages':=20['ovirt-engine-websocket-proxy']},=20{'packages':=20=
['ovirt-engine-dwh']}]'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_RPMDISTRO/upgradeYumGroup=3Dstr:'ovirt-engine-4.0'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/groupEngine=3Dstr:'ovirt'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/groupKvm=3Dstr:'kvm'=0A2016-08-18=2013:01:00=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/groupVmConsole=3Dstr:'ovirt-vmconsole'=0A2016-08-18=20=
13:01:00=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/hostileServices=3Dstr:'ovirt-engine-dwhd,ovirt-engine-noti=
fier'=0A2016-08-18=2013:01:00=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/memCheckEnabled=3Dbool:'True'=0A2016-08-18=2013:01:00=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/memCheckMinimumMB=3Dint:'4096'=0A2016-08-18=2013:01:01=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/memCheckRecommendedMB=3Dint:'16384'=0A2016-08-18=20=
13:01:01=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/memCheckThreshold=3Dint:'90'=0A2016-08-18=2013:01:01=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/nfsConfigEnabled=3Dbool:'False'=0A2016-08-18=2013:01:01=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/nfsConfigEnabled_legacyInPostInstall=3Dbool:'False'=0A=
2016-08-18=2013:01:01=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/nfsServiceName=3Dstr:'nfs-server'=0A2016-08-18=20=
13:01:01=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/selinuxBooleans=3Dlist:'[{'state':=20'on',=20'boolean':=20=
'httpd_can_network_connect'}]'=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/selinuxContexts=3Dlist:'[]'=0A2016-08-18=2013:01:01=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/selinuxRestorePaths=3Dlist:'[]'=0A2016-08-18=2013:01:01=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/shmmax=3Dint:'68719476736'=0A2016-08-18=2013:01:01=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userApache=3Dstr:'apache'=0A2016-08-18=2013:01:01=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userEngine=3Dstr:'ovirt'=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userPostgres=3Dstr:'postgres'=0A2016-08-18=2013:01:01=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userRoot=3Dstr:'root'=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userVdsm=3Dstr:'vdsm'=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_SYSTEM/userVmConsole=3Dstr:'ovirt-vmconsole'=0A2016-08-18=20=
13:01:01=20DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
OVESETUP_VMCONSOLE_PROXY_CONFIG/vmconsoleProxyConfig=3Dbool:'True'=0A=
2016-08-18=2013:01:01=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_VMCONSOLE_PROXY_CONFIG/vmconsoleProxyPort=3Dint:'2222'=0A=
2016-08-18=2013:01:01=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_WSP_RPMDISTRO_PACKAGES=3Dstr:'ovirt-engine-websocket-proxy'=0A=
2016-08-18=2013:01:01=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
OVESETUP_WSP_RPMDISTRO_PACKAGES_SETUP=3Dstr:'ovirt-engine-setup-plugin-web=
socket-proxy'=0A2016-08-18=2013:01:01=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfDisabledPlugins=3Dlist:'[]'=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfExpireCache=3Dbool:'True'=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfRollback=3Dbool:'True'=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/dnfpackagerEnabled=3Dbool:'True'=0A2016-08-18=2013:01:01=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/keepAliveInterval=3Dint:'30'=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumDisabledPlugins=3Dlist:'[]'=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumEnabledPlugins=3Dlist:'[]'=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumExpireCache=3Dbool:'True'=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumRollback=3Dbool:'True'=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
PACKAGER/yumpackagerEnabled=3Dbool:'True'=0A2016-08-18=2013:01:01=20=
DEBUG=20otopi.context=20context.dumpEnvironment:770=20ENV=20=
SYSTEM/clockMaxGap=3Dint:'5'=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
SYSTEM/clockSet=3Dbool:'False'=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context.dumpEnvironment:770=20ENV=20=
SYSTEM/commandPath=3Dstr:'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bi=
n:/sbin:/bin'=0A2016-08-18=2013:01:01=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20SYSTEM/reboot=3Dbool:'False'=0A=
2016-08-18=2013:01:01=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20SYSTEM/rebootAllow=3Dbool:'True'=0A=
2016-08-18=2013:01:01=20DEBUG=20otopi.context=20=
context.dumpEnvironment:770=20ENV=20SYSTEM/rebootDeferTime=3Dint:'10'=0A=
2016-08-18=2013:01:01=20DEBUG=20otopi.context=20=
context.dumpEnvironment:774=20ENVIRONMENT=20DUMP=20-=20END=0A2016-08-18=20=
13:01:01=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
pre-terminate=20METHOD=20=
otopi.plugins.otopi.dialog.cli.Plugin._pre_terminate=0A2016-08-18=20=
13:01:01=20DEBUG=20otopi.context=20context._executeMethod:134=20=
condition=20False=0A2016-08-18=2013:01:01=20INFO=20otopi.context=20=
context.runSequence:687=20Stage:=20Termination=0A2016-08-18=2013:01:01=20=
DEBUG=20otopi.context=20context.runSequence:691=20STAGE=20terminate=0A=
2016-08-18=2013:01:01=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20terminate=20METHOD=20=
otopi.plugins.ovirt_engine_common.base.core.misc.Plugin._terminate=0A=
2016-08-18=2013:01:01=20ERROR=20=
otopi.plugins.ovirt_engine_common.base.core.misc=20misc._terminate:148=20=
Execution=20of=20setup=20failed=0A2016-08-18=2013:01:01=20DEBUG=20=
otopi.context=20context._executeMethod:128=20Stage=20terminate=20METHOD=20=
otopi.plugins.otopi.dialog.human.Plugin._terminate=0A2016-08-18=20=
13:01:01=20DEBUG=20otopi.context=20context._executeMethod:128=20Stage=20=
terminate=20METHOD=20=
otopi.plugins.otopi.dialog.machine.Plugin._terminate=0A2016-08-18=20=
13:01:01=20DEBUG=20otopi.context=20context._executeMethod:134=20=
condition=20False=0A2016-08-18=2013:01:01=20DEBUG=20otopi.context=20=
context._executeMethod:128=20Stage=20terminate=20METHOD=20=
otopi.plugins.otopi.core.log.Plugin._terminate=0A=
--Apple-Mail=_C1BE0CFC-CBE4-404A-90F6-90FC379EF629
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=us-ascii
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" =
class=3D""><blockquote style=3D"margin: 0 0 0 40px; border: none; =
padding: 0px;" class=3D""></blockquote><div class=3D"">2(a). Can I just =
disable ovirt-imageio-proxy somewhere? Is this just supposed to make =
uploading ISO images simpler? I don't really need this.<br =
class=3D""></div><div class=3D"">2(b). Do I need to have DWH enabled? I =
am not certain when this was added into my hosted-engine setup, but I =
don't think I need it.</div><div class=3D""><div class=3D""><br =
class=3D""></div><div class=3D"">3. My vdsm.log is full of entries like, =
"JsonRpc (StompReactor)::ERROR::2016-08-18 =
12:59:56,783::betterAsyncore::113::vds.dispatcher::(recv) SSL error =
during reading data: unexpected eof"</div><div class=3D""><br =
class=3D""></div><div class=3D"">4. Commands throwing deprecation =
warning. Example:</div><blockquote style=3D"margin: 0 0 0 40px; border: =
none; padding: 0px;" class=3D""><div class=3D""><div =
class=3D"">[root@cultivar2 ~]# hosted-engine --vm-status</div></div><div =
class=3D""><div =
class=3D"">/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/lib/sto=
rage_backends.py:15: DeprecationWarning: vdscli uses xmlrpc. since ovirt =
3.6 xmlrpc is deprecated, please use vdsm.jsonrpcvdscli</div></div><div =
class=3D""><div class=3D""> import =
vdsm.vdscli</div></div></blockquote>or in the logs:</div><blockquote =
style=3D"margin: 0 0 0 40px; border: none; padding: 0px;" class=3D""><div =
class=3D"">Aug 18 13:56:17 cultivar3 ovirt-ha-agent: =
/usr/lib/python2.7/site-packages/yajsonrpc/stomp.py:352: =
DeprecationWarning: Dispatcher.pending is deprecated. Use =
Dispatcher.socket.pending instead.</div></blockquote><div class=3D""><div =
class=3D""><br class=3D"webkit-block-placeholder"></div><div class=3D"">5.=
This error in the console: "ETL service sampling has encountered an =
error. Please consult the service log for more details." ETL service =
sampling log? Where's that?</div><div class=3D""><br class=3D""></div><div=
class=3D"">6. The host that is running the NFS server had network =
issues on Monday and I have had to remove it from the cluster. It was =
working fine up until I did the lastest yum updates. The networking just =
stopped working when vdsm restarted. Could this be related to my =
switching the cluster "Switch type" to OVS from Legacy? I have since =
switched it back to Legacy. I'm going to completely remove oVirt and =
reinstall/re-add it to the cluster. As it is the NFS server, I do need =
the network to continue to function throughout the process. Any advice =
would be appreciated.</div><div class=3D""><br class=3D""></div><div =
class=3D"">Lastly... If I clear up the above, how feasible is it to GoGO =
GlusterFS instead of my existing straight NFS server setup that I have =
now? Any advice on how to best move my hosted_engine, data, ISO, export =
Storage Domains to Gluster?</div><div class=3D""><br =
class=3D"webkit-block-placeholder"></div><div class=3D""><div =
id=3D"signature" class=3D"">Cheers,<br class=3D"">Gervais<br =
class=3D""><br class=3D""><br class=3D""></div>
</div>
<br class=3D""></div></body></html>=
--Apple-Mail=_C1BE0CFC-CBE4-404A-90F6-90FC379EF629--
--Apple-Mail=_EB775E1A-FC47-42AA-9215-C7F2FC973E04--
8 years, 3 months