This is a multi-part message in MIME format.
--------------41E2A2E7BDDDE004731E6DAE
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Thanks, I knew this python script, but I believed it was possible to do=20
the same with an ansible module.
That's mean we need several tools to do different tasks, it is not a=20
very convergent way to proceed... but it is feasable.
Le 10/05/2017 =C3=A0 07:56, Ondra Machacek a =C3=A9crit :
On Tue, May 9, 2017 at 6:52 PM, Nathana=C3=ABl Blanchet <blanchet(a)abes.=
fr=20
<mailto:blanchet@abes.fr>> wrote:
Hello,
I didn't find anyway to easy list all my vms thanks to the ansible
modules...
I tried the ovirt4.py script which is able to list the whole
facts, so vms list, when the number of them is small in a test
datacenter, but in a production datacenter, I get an issue:
File "./ovirt4.py", line 262, in <module
main()
File "./ovirt4.py", line 254, in main
vm_name=3Dargs.host,
File "./ovirt4.py", line 213, in get_data
vms[name] =3D get_dict_of_struct(connection, vm)
File "./ovirt4.py", line 185, in get_dict_of_struct
(device.name <
http://device.name>, [ip.address for ip in
device.ips]) for device in devices
File "./ovirt4.py", line 185, in <genexpr
(device.name <
http://device.name>, [ip.address for ip in
device.ips]) for device in devices
TypeError: 'NoneType' object is not iterable
This error was fixed already, try to download latest ovirt4.py file.
The other way is to use fatcs[1] module.
[1]
http://docs.ansible.com/ansible/ovirt_vms_facts_module.html
What is the simpliest way to get this basic information with
sdk4??? (with sdk3 : ovirt-shell -E "list vms")
Please take a look at the following example:
https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/list= _vms.py
--=20
Nathana=C3=ABl Blanchet
Supervision r=C3=A9seau
P=C3=B4le Infrastrutures Informatiques
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5
T=C3=A9l. 33 (0)4 67 54 84 55
Fax 33 (0)4 67 54 84 14
blanchet(a)abes.fr <mailto:blanchet@abes.fr
_______________________________________________
Users mailing list
Users(a)ovirt.org <mailto:Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users
<
http://lists.ovirt.org/mailman/listinfo/users
--=20
Nathana=C3=ABl Blanchet
Supervision r=C3=A9seau
P=C3=B4le Infrastrutures Informatiques
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5 =09
T=C3=A9l. 33 (0)4 67 54 84 55
Fax 33 (0)4 67 54 84 14
blanchet(a)abes.fr
--------------41E2A2E7BDDDE004731E6DAE
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<html
<head
<meta content=3D"text/html; charset=3Dutf-8"
http-equiv=3D"Content-Ty=
pe"
</head
<body bgcolor=3D"#FFFFFF"
text=3D"#000000"
<p>Thanks, I knew this
python script, but I believed it was possible
to do the same with an ansible module.</p
<p>That's mean we need several tools to do different tasks, it is
not a very convergent way to proceed... but it is feasable.<br
</p
<br
<div class=3D"moz-cite-prefix">Le
10/05/2017 =C3=A0 07:56, Ondra Mach=
acek a
=C3=A9crit=C2=A0:<br
</div
<blockquote
cite=3D"mid:CAJCqMsVGdN9wBmB7DJ=3DtSd4EiM9a=3Dmkm_0s_MG34ygSOdqoyQg@mail.=
gmail.com"
type=3D"cite"
<div
dir=3D"ltr"><br
<div
class=3D"gmail_extra"><br
<div class=3D"gmail_quote">On Tue, May 9, 2017 at 6:52 PM,
Nathana=C3=ABl Blanchet <span dir=3D"ltr"><<a
moz-do-not-send=3D"true"
href=3D"mailto:blanchet@abes.fr"
target=3D"_blank">blanchet(a)abes.fr</a>&gt;</span>
wrote:<=
br
<blockquote class=3D"gmail_quote"
style=3D"margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">Hello,<br
<br
I didn't find anyway to easy list all my vms thanks to the
ansible modules...<br
I tried the ovirt4.py script which is able to list the
whole facts, so vms list, when the number of them is small
in a test datacenter, but in a production datacenter, I
get an issue:<br
<br
=C2=A0 File "./ovirt4.py", line 262, in
<module><br
=C2=A0 =C2=A0
main()<br
=C2=A0 File
"./ovirt4.py", line 254, in main<br
=C2=A0 =C2=A0 vm_name=3Dargs.host,<br
=C2=A0 File "./ovirt4.py", line 213, in get_data<br
=C2=A0 =C2=A0 vms[name] =3D
get_dict_of_struct(connection, =
vm)<br
=C2=A0 File
"./ovirt4.py", line 185, in get_dict_of_struct<=
br
=C2=A0 =C2=A0 (<a
moz-do-not-send=3D"true" href=3D"http://d=
evice.name"
rel=3D"noreferrer"
target=3D"_blank">device.name</a>,
[ip.address for ip in device.ips]) for device in devices<br=
=C2=A0 File "./ovirt4.py", line 185, in
<genexpr><br
=C2=A0 =C2=A0 (<a
moz-do-not-send=3D"true" href=3D"http://d=
evice.name"
rel=3D"noreferrer"
target=3D"_blank">device.name</a>,
[ip.address for ip in device.ips]) for device in devices<br=
TypeError: 'NoneType' object is not
iterable<br
</blockquote
<div><br
</div
<div>This error
was fixed already, try to download latest
ovirt4.py file.<br
<br
</div
<div>The other way is to use fatcs[1]
module.<br
<br
[1] <a moz-do-not-send=3D"true"
href=3D"http://docs.ansible.com/ansible/ovirt_vms_facts_m=
odule.html">http://docs.ansible.com/ansible/ovirt_vms_facts_modul...
a><br
</div
<div>=C2=A0</div
<blockquote class=3D"gmail_quote"
style=3D"margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex"
<br
<br
What is the simpliest way to get this basic
information
with sdk4??? (with sdk3 : ovirt-shell -E "list vms")<br
</blockquote
<div><br
</div
<div>Please take a look at the following
example:<br
<br
=C2=A0<a moz-do-not-send=3D"true"
href=3D"https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/ex...
s/list_vms.py">https://github.com/oVirt/ovirt-engine-sdk/blob/mas...
examples/list_vms.py</a><br
</div
<div>=C2=A0</div
<blockquote
class=3D"gmail_quote" style=3D"margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex"
<br
<br
<br
-- <br
Nathana=C3=ABl
Blanchet<br
<br
Supervision r=C3=A9seau<br
P=C3=B4le Infrastrutures Informatiques<br
227 avenue Professeur-Jean-Louis-Viala<br
34193 MONTPELLIER CEDEX 5=C2=A0 =C2=A0 =C2=A0
=C2=A0<br
T=C3=A9l. 33 (0)4 67
54 84 55<br
Fax=C2=A0 33 (0)4 67
54 84 14<br
<a
moz-do-not-send=3D"true" href=3D"mailto:blanchet@abes.fr=
"
target=3D"_blank">blanchet(a)abes.fr</a><br
<br
______________________________<wbr>_________________<br
Users mailing list<br
<a moz-do-not-send=3D"true"
href=3D"mailto:Users@ovirt.org"
target=3D"_blank">Users(a)ovirt.org</a><br
<a moz-do-not-send=3D"true"
href=3D"http://lists.ovirt.org/mailman/listinfo/users"
rel=3D"noreferrer"
target=3D"_blank">http://lists.ovirt.o=
rg/mailman<wbr>/listinfo/users</a><br
</blockquote
</div
<br
</div
</div
</blockquote
<br
<pre class=3D"moz-signature"
cols=3D"72">--=20
Nathana=C3=ABl Blanchet
Supervision r=C3=A9seau
P=C3=B4le Infrastrutures Informatiques
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5 =09
T=C3=A9l. 33 (0)4 67 54 84 55
Fax 33 (0)4 67 54 84 14
<a class=3D"moz-txt-link-abbreviated"
href=3D"mailto:blanchet@abes.fr">bl=
anchet(a)abes.fr</a> </pre
</body
</html
--------------41E2A2E7BDDDE004731E6DAE--