Reassign ovirtmgmt to a new bond with ansible

Hello, I'm trying to create a playbook for deployment of a new node in my ovirt deployment. I'm using the role ovirt-infra from ovirt-infra-roles 1.1.1. I'm creating a new bond and assigning ovirtmgmt to that bond: This is the value of the variable host_networks printed out by ansible: TASK [host_networks] ********************************************************************************************************************************* ok: [localhost] => { "host_networks": [ { "bond": { "interfaces": [ "enp2s0f0", "enp2s0f1" ], "mode": 1, "name": "bond0" }, "check": true, "name": "ovirt01.intranet.company.it", "networks": [ { "address": "10.5.40.197", "boot_protocol": "static", "gateway": "10.5.43.254", "name": "ovirtmgmt", "prefix": "255.255.252.0" } ], "save": true }, { "bond": { "interfaces": [ "enp2s0f2", "enp2s0f3" ], "mode": 1, "name": "bond1" }, "check": true, "name": "ovirt01.intranet.company.it", "networks": [ { "address": "10.5.160.47", "boot_protocol": "static", "name": "NFS", "netmask": "255.255.252.0" } ], "save": true } ] } When running the playbook i get: Error: Fault reason is "Operation Failed". Fault detail is "[Cannot setup Networks. Network ovirtmgmt is already attached via attachment 3315148d-f669-48b0-9c16-601faaea9ce5. A new attachment cannot be used for the same network, please reuse the existing one.]" How do i reuse the existing attachment? The other network (NFS) has been attached without issues. -- "E' assurdo impiegare gli uomini di intelligenza eccellente per fare calcoli che potrebbero essere affidati a chiunque se si usassero delle macchine" Gottfried Wilhelm von Leibnitz, Filosofo e Matematico (1646-1716) "Internet è la più grande biblioteca del mondo. Ma il problema è che i libri sono tutti sparsi sul pavimento" John Allen Paulos, Matematico (1945-vivente) Luca 'remix_tj' Lorenzetto, http://www.remixtj.net , <lorenzetto.luca@gmail.com>

Hi, On 12/13/2017 11:52 AM, Luca 'remix_tj' Lorenzetto wrote:
Hello,
I'm trying to create a playbook for deployment of a new node in my ovirt deployment. I'm using the role ovirt-infra from ovirt-infra-roles 1.1.1.
I'm creating a new bond and assigning ovirtmgmt to that bond:
This is the value of the variable host_networks printed out by ansible:
TASK [host_networks] ********************************************************************************************************************************* ok: [localhost] => { "host_networks": [ { "bond": { "interfaces": [ "enp2s0f0", "enp2s0f1" ], "mode": 1, "name": "bond0" }, "check": true, "name": "ovirt01.intranet.company.it", "networks": [ { "address": "10.5.40.197", "boot_protocol": "static", "gateway": "10.5.43.254", "name": "ovirtmgmt", "prefix": "255.255.252.0" } ], "save": true }, { "bond": { "interfaces": [ "enp2s0f2", "enp2s0f3" ], "mode": 1, "name": "bond1" }, "check": true, "name": "ovirt01.intranet.company.it", "networks": [ { "address": "10.5.160.47", "boot_protocol": "static", "name": "NFS", "netmask": "255.255.252.0" } ], "save": true } ] }
When running the playbook i get:
Error: Fault reason is "Operation Failed". Fault detail is "[Cannot setup Networks. Network ovirtmgmt is already attached via attachment 3315148d-f669-48b0-9c16-601faaea9ce5. A new attachment cannot be used for the same network, please reuse the existing one.]"
How do i reuse the existing attachment?
The other network (NFS) has been attached without issues.
This is unfortunately a bug, David(CCed) yesterday reported same issue to me. He will (or did) open an issue on github. I will fix it for 2.5, release and hopefully also for 2.4.3.

On Thu, Dec 14, 2017 at 10:10 AM, Ondra Machacek <omachace@redhat.com> wrote:.
This is unfortunately a bug, David(CCed) yesterday reported same issue to me. He will (or did) open an issue on github. I will fix it for 2.5, release and hopefully also for 2.4.3.
What do you suggest to do? I think would be nice to make the first setup of a node directly with ansible, but if is not possible i can write down some python code for some tasks. Luca -- "E' assurdo impiegare gli uomini di intelligenza eccellente per fare calcoli che potrebbero essere affidati a chiunque se si usassero delle macchine" Gottfried Wilhelm von Leibnitz, Filosofo e Matematico (1646-1716) "Internet è la più grande biblioteca del mondo. Ma il problema è che i libri sono tutti sparsi sul pavimento" John Allen Paulos, Matematico (1945-vivente) Luca 'remix_tj' Lorenzetto, http://www.remixtj.net , <lorenzetto.luca@gmail.com>

On Fri, 2017-12-15 at 16:09 +0100, Luca 'remix_tj' Lorenzetto wrote:
On Thu, Dec 14, 2017 at 10:10 AM, Ondra Machacek <omachace@redhat.com
wrote:.
This is unfortunately a bug, David(CCed) yesterday reported same issue to me. He will (or did) open an issue on github. I will fix it for 2.5, release and hopefully also for 2.4.3.
What do you suggest to do?
I think would be nice to make the first setup of a node directly with ansible, but if is not possible i can write down some python code for some tasks.
Luca
Hi Luca, In my case (bond-vlans-bridges), the problem turned out to be missing interface parameter: - name: setup host networks: ovirt_host_networks: interface: bond0 # I missed this one bond: name: bond0 interfaces - slave1 - slave2 networks: - name: rhevm # untagged, vm_network: no boot_protocol: dhcp - name: vms # vlan_tag: TAG, vm_network: yes boot_protocol: none If the ansible + ovirt network setup doesn't work for for you (it did for me), I'd suggest to move the interfaces configuration to a separate playbook that you have to keep anyway for repositories, NTP or engine ssh key. David (working on Spice, close but not oVirt proper :))
participants (3)
-
David Jaša
-
Luca 'remix_tj' Lorenzetto
-
Ondra Machacek