openshift-metal3 / dev-scripts

Scripts to automate development/test setup for openshift integration with https://github.com/metal3-io/
Apache License 2.0
94 stars 186 forks source link

bridge interface baremetal does not get deleted as part of cleanup script and make clean. #375

Closed suppawar closed 5 years ago

suppawar commented 5 years ago

While cleaning the installation by ocp_cleanup.sh script Bridge interface baremetal does not get deleted. Getting below error while re-install using make.

EXEC /bin/sh -c 'rm -f -r /home/rhhi/.ansible/tmp/ansible-tmp-1555494928.82-52755323505618/ > /dev/null 2>&1 && sleep 0' The full traceback is: WARNING: The below traceback may *not* be related to the actual failure. File "/tmp/ansible_virt_net_payload_WehKMN/__main__.py", line 612, in main rc, result = core(module) File "/tmp/ansible_virt_net_payload_WehKMN/__main__.py", line 509, in core res['msg'] = v.start(name) File "/tmp/ansible_virt_net_payload_WehKMN/__main__.py", line 421, in start return self.conn.create(entryid) File "/tmp/ansible_virt_net_payload_WehKMN/__main__.py", line 223, in create return self.find_entry(entryid).create() File "/usr/lib64/python2.7/site-packages/libvirt.py", line 2990, in create if ret == -1: raise libvirtError ('virNetworkCreate() failed', net=self) failed: [localhost] (item={u'bridge': u'baremetal', u'domain': u'ostest.test.metalkube.org', u'dhcp_hosts': [{u'ip': u'192.168.111.20', u'name': u'master-0'}, {u'ip': u'192.168.111.21', u'name': u'master-1'}, {u'ip': u'192.168.111.22', u'name': u'master-2'}, {u'ip': u'192.168.111.25', u'name': u'worker-0'}], u'name': u'baremetal', u'netmask': u'255.255.255.0', u'forward_mode': u'nat', u'dhcp_range': [u'192.168.111.20', u'192.168.111.60'], u'dns': {u'hosts': [{u'ip': u'192.168.111.5', u'hostnames': [u'api']}, {u'ip': u'192.168.111.2', u'hostnames': [u'ns1']}], u'forwarders': [{u'domain': u'apps.ostest.test.metalkube.org', u'addr': u'127.0.0.1'}]}, u'address': u'192.168.111.1', u'nat_port_range': [1024, 65535]}) => { "changed": false, "invocation": { "module_args": { "autostart": null, "command": "start", "name": "baremetal", "state": "active", "uri": "qemu:///system", "xml": null } }, "item": { "address": "192.168.111.1", "bridge": "baremetal", "dhcp_hosts": [ { "ip": "192.168.111.20", "name": "master-0" }, { "ip": "192.168.111.21", "name": "master-1" }, { "ip": "192.168.111.22", "name": "master-2" }, { "ip": "192.168.111.25", "name": "worker-0" } ], "dhcp_range": [ "192.168.111.20", "192.168.111.60" ], "dns": { "forwarders": [ { "addr": "127.0.0.1", "domain": "apps.ostest.test.metalkube.org" } ], "hosts": [ { "hostnames": [ "api" ], "ip": "192.168.111.5" }, { "hostnames": [ "ns1" ], "ip": "192.168.111.2" } ] }, "domain": "ostest.test.metalkube.org", "forward_mode": "nat", "name": "baremetal", "nat_port_range": [ 1024, 65535 ], "netmask": "255.255.255.0" }, "msg": "error creating bridge interface baremetal: File exists" } to retry, use: --limit @/home/rhhi/dev-scripts/tripleo-quickstart-config/metalkube-setup-playbook.retry PLAY RECAP ******************************************************************************************************************************************************************************************************** localhost : ok=14 changed=3 unreachable=0 failed=1
suppawar commented 5 years ago

I will have to manually delete this bridge. brctl show ip link set baremetal down brctl delbr baremetal

cybertron commented 5 years ago

IME this happens if you reboot the host machine. It looks to me like the problem is that an ifcfg-baremetal file is left in /etc/sysconfig/network-scripts that has ONBOOT=true, so when the host comes back up it starts the baremetal bridge automatically. Then when libvirt goes to create it it's already there.

If I just run "sudo ip l del baremetal" it gets me past this problem until the next time I reboot.

Note that we don't have a similar problem with the provisioning interface because we explicitly delete its ifcfg file: https://github.com/openshift-metalkube/dev-scripts/blob/master/host_cleanup.sh#L30

hardys commented 5 years ago

https://github.com/openshift-metal3/dev-scripts/pull/444 merged so this can be closed I think