Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Work around neutron floatingip race condition
Browse files Browse the repository at this point in the history
Neutron has a problem where neutron-server will only return externally
visible networks after the service has started sometimes. In order to
deal with that we are ssh'ing into the controller node and restarting
neutron-server before trying to create a floatingip. We try for two
minutes before giving up.

Change-Id: Ia4e476339a3d73a8c13ca898e0f0b582adc53828
Related-Bug: #1254555
  • Loading branch information
SpamapS committed Nov 25, 2013
1 parent 8e95a47 commit 38ac22c
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions scripts/devtest_overcloud.sh
Expand Up @@ -184,12 +184,32 @@ user-config

nova boot --key-name default --flavor m1.tiny --image user demo

## #. Add an external IP for it.
## #. Add an external IP for it. If this process times out or produces an
## error, you may need to restart neutron-server on the controller and try
## it again. This is due to https://bugs.launchpad.net/neutron/+bug/1254555
## ::

wait_for 10 5 neutron port-list -f csv -c id --quote none \| grep id
PORT=$(neutron port-list -f csv -c id --quote none | tail -n1)
neutron floatingip-create ext-net --port-id "${PORT//[[:space:]]/}"
## neutron floatingip-create ext-net --port-id "${PORT//[[:space:]]/}"
### --end
# Ugly hack kept out of docs intentionally.
# Workaround neutron bug https://bugs.launchpad.net/tripleo/+bug/1254555
ext_net=
for try in {1..12} ; do
ssh -l heat-admin -o StrictHostKeyChecking=no -t $OVERCLOUD_IP sudo service neutron-server restart
# Give things time to synchronize.. I think.
sleep 10
if neutron floatingip-create ext-net --port-id "${PORT//[[:space:]]/}" ; then
ext_net=1
break
fi
done
if [ -z "$ext_net" ] ; then
echo Still cannot find ext-net after $try tries.
exit 42
fi
### --include

## #. And allow network access to it.
## ::
Expand Down

0 comments on commit 38ac22c

Please sign in to comment.