Thanks Ondra,
I will follow them on Github.
Keep up the good work. Also if there is any possibility to start testing the other
modules(like managing networks) due to come out with ansible 2.3 please let me know.
Regards,
Jean Paul Gatt
-----Original Message-----
From: Ondra Machacek [mailto:omachace@redhat.com]
Sent: 28 November 2016 16:51
To: Jean Paul Gatt <jeanpaul.gatt(a)gamesysnetwork.com>; users(a)ovirt.org
Subject: Re: [ovirt-users] Ansible Modules for ovirt
Hi,
thank you very much for your feedback. I am sending few notes inline.
On 11/25/2016 04:27 PM, Jean Paul Gatt wrote:
Hi,
I have been trying to use the following ansible modules (based on the
last devel commit in the ansible github repo for the extras modules
43bb97bc3763b0335e245606eb2985314902cc91):
* ovirt_vms
* ovirt_disks
I have had varying degrees of success, and I would like to list the
following issues:
* Through the REST API, I can define multiple nic card
configurations for cloud-init, however only 1 can be done with Ansible.
This issue was already opened here:
https://github.com/ansible/ansible-modules-extras/issues/3447
I will be very happy if you will take a look and tell what you think about the proposed
fix.
Also, when using templates, it automatically assumes I will be using
the last version of the template, this had to be defined when using REST.
I've opened an issue here:
https://github.com/ansible/ansible-modules-extras/issues/3555
Feel free to comment there any additional requests regarding that issue.
* Assume I have deployed from a template. This will create a VM
with a disk that is already attached. Now, let's say I want to
confirm, or add more disks to the VM. If I pass a number of disks,
that have already been attached, and I reference them by name (in
ovirt_disks), I get an error. If I do the same operation by ID it
seems to work. However I cannot get the ID when running ansible, I need to get it from
REST.
When I query ovirt_vms, disk attachments comes up as
o "disk_attachments": [],
If that field gets populated, I could then in turn run ovirt_disks
with the ID, after querying the VM to get the attachments, but as it
is it cannot be done.
I'll give an example
- name: Get Disks
ovirt_disks:
auth: "{{ovirt_auth}}"
vm_name: "{{item.0.name}}"
name: "{{item.1.name}}"
interface: "{{item.1.interface}}"
register: r_disks
with_subelements:
- "{{virtual_machines }}"
- drives
If the drives have already been attached this will
fail... but
- name: Add Disks to VMs
ovirt_disks:
auth: "{{ovirt_auth}}"
vm_name: "{{item.0.name}}"
id: 8fc2811e-7774-4903-a5b3-489fdedb377b
size: "100GiB"
format: "{{item.1.format}}"
storage_domain: "{{item.1.storage_domain.name}}"
bootable: "{{item.1.bootable}}"
interface: "{{item.1.interface}}"
state: attached
with_subelements:
- "{{virtual_machines }}"
- drives
The second example is working, even if the disk has
already been attached.
I'm assuming that since I'm creating the VM from a template, there
might be multiple disks with the same name, and the wrong ID is being retrieved.
Yes, that is the problem. To work reliably with disks, the only way is the ID. I will
document it better, so users aren't confused.
I've opened following issue:
https://github.com/ansible/ansible/issues/18650
I will work on it, feel free to comment any ideas there.
I'm happy to do more testing as further commits appear.
Thank you, the fixes will be during this week, so hopefully merged soon.
Regards*,*
* *
*Jean Paul Gatt*
This email (including any attachments) is confidential, protected by
copyright and/or other intellectual property rights and may be
privileged. If you have received it in error, please notify the sender
immediately before deleting the email from your device. Do not use,
copy or disclose the information contained in this message or in any
attachment. We accept no responsibility for malware that we may have
unintentionally transmitted to you within this email. Those
communicating with us by email will be deemed to have consented to us
intercepting and monitoring those communications. Gamesys Network Ltd
is registered in Malta, with company registration number C47555 and
VAT registered number MT19542837. The registered office is at Capital
Business Centre, Entrance A, Level 1, Taz-Zwejt Street, San Gwann SGN3000.
_______________________________________________
Users mailing list
Users(a)ovirt.org
http://lists.ovirt.org/mailman/listinfo/users
This email (including any attachments) is confidential, protected by copyright and/or
other intellectual property rights and may be privileged. If you have received it in
error, please notify the sender immediately before deleting the email from your device. Do
not use, copy or disclose the information contained in this message or in any attachment.
We accept no responsibility for malware that we may have unintentionally transmitted to
you within this email. Those communicating with us by email will be deemed to have
consented to us intercepting and monitoring those communications. Gamesys Network Ltd is
registered in Malta, with company registration number C47555 and VAT registered number
MT19542837. The registered office is at Capital Business Centre, Entrance A, Level 1,
Taz-Zwejt Street, San Gwann SGN3000.