Get error NetworkAlreadyExists if network is unsync between docker and Zun DB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zun |
Fix Released
|
Medium
|
hongbin |
Bug Description
Steps to reproduce:
$ source /opt/stack/
$ openstack network create test
$ NET_ID=$(openstack network show test -c id -f value)
$ openstack subnet create --subnet-range 10.10.10.0/24 --network $NET_ID testsubnet
$ zun run --name testcontainer --net network=$NET_ID nginx
$ zun delete --stop testcontainer
$ docker network rm $NET_ID
$ zun run --name testcontainer --net network=$NET_ID nginx # this container will fail
Above create a network in neutron, run a container on that network. Then, use docker command to remove the network. This make the Zun DB inconsistent with docker. Then, run another container on that network will fail.
The following error on the zun_compute's log:
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: Traceback (most recent call last):
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/usr/local/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: timer()
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/usr/local/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: cb(*args, **kw)
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/opt/stack/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: func(*args, **kwargs)
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/usr/local/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: return f(*args, **kwargs)
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/opt/stack/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: pci_requests, limits)
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/opt/stack/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: return function(self, context, *args, **kwargs)
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/opt/stack/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: sandbox, limits)
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/opt/stack/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: unset_host=True)
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/usr/local/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: self.force_
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/usr/local/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: six.reraise(
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/opt/stack/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: requested_volumes)
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/opt/stack/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: network_api = zun_network.
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/opt/stack/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]:
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/opt/stack/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: neutron_net_id)
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/opt/stack/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: network.
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/usr/local/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: return fn(self, *args, **kwargs)
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/opt/stack/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: db_network = dbapi.create_
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/usr/local/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: result = f(*args, **kwargs)
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/opt/stack/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: return _get_dbdriver_
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: File "/opt/stack/
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: field='
Oct 10 02:59:39 ip-172-31-1-38 zun-compute[16487]: NetworkAlreadyE
Changed in zun: | |
importance: | Undecided → Medium |
Fix proposed to branch: master /review. openstack. org/609204
Review: https:/