Fix/assign extnet earlier
Created by: garloff
Should be merged after #106.
This one may resolve the observed trouble on wave-scs.
Currently, we do the openstack server create JH
call immediately before assigning the FIP to the JH port; the FIP creation and assignment is preceeded by the external-gateway-set
call for the router to ensure that the FIP can be assigned which is preceeded by a openstack network list --external
.
If for whatever reason the network list
or router set --external-gateway
calls are very slow, the VM may have started to boot already before the gateway is set on the router. In the worst case, this could lead to the VM not being able to talk to the outside world via SNAT (nor via the FIP) in its early boot stage.
When we later connect to the VM, we of course have the external-gateway configured and the FIP assigned (we connect via the FIP). Nevertheless, occasioanlly, the external gateway seems to be delayed in being effective by a minute or two in such cases. This should not happen and looks like a bug to me. However, it's relatively harmless, as setting the external gateway to a router (just) after VM creation is unusual.
This fix moves the router set --external-gateway
to happen immediately after the router creation. Thus well ahead of any VM creation. If the effectiveness of the router gateway setting is delayed enough, we might still see the bug, but I'm optimistic that this will not happen.