[ovirt-users] ansible and list of vms
Nathanaël Blanchet
blanchet at abes.fr
Wed May 10 08:13:38 UTC 2017
Thanks, I knew this python script, but I believed it was possible to do
the same with an ansible module.
That's mean we need several tools to do different tasks, it is not a
very convergent way to proceed... but it is feasable.
Le 10/05/2017 à 07:56, Ondra Machacek a écrit :
>
>
> On Tue, May 9, 2017 at 6:52 PM, Nathanaël Blanchet <blanchet at abes.fr
> <mailto:blanchet at 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=args.host,
> File "./ovirt4.py", line 213, in get_data
> vms[name] = 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
>
>
>
>
> --
> Nathanaël Blanchet
>
> Supervision réseau
> Pôle Infrastrutures Informatiques
> 227 avenue Professeur-Jean-Louis-Viala
> 34193 MONTPELLIER CEDEX 5
> Tél. 33 (0)4 67 54 84 55
> Fax 33 (0)4 67 54 84 14
> blanchet at abes.fr <mailto:blanchet at abes.fr>
>
> _______________________________________________
> Users mailing list
> Users at ovirt.org <mailto:Users at ovirt.org>
> http://lists.ovirt.org/mailman/listinfo/users
> <http://lists.ovirt.org/mailman/listinfo/users>
>
>
--
Nathanaël Blanchet
Supervision réseau
Pôle Infrastrutures Informatiques
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5
Tél. 33 (0)4 67 54 84 55
Fax 33 (0)4 67 54 84 14
blanchet at abes.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20170510/1952c263/attachment.html>
More information about the Users
mailing list