nova-network DHCP server not correct when creating multiple networks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Undecided
|
Edmund Rhudy |
Bug Description
This bug pertains to stable Kilo, package versions below:
ii nova-api 1:2015.
ii nova-cert 1:2015.
ii nova-common 1:2015.
ii nova-compute 1:2015.
ii nova-compute-kvm 1:2015.
ii nova-compute-
ii nova-conductor 1:2015.
ii nova-consoleauth 1:2015.
ii nova-network 1:2015.
ii nova-novncproxy 1:2015.
ii nova-scheduler 1:2015.
ii python-nova 1:2015.
ii python-
ii python-novaclient 1:2.22.
This bug was originally reported at https:/
In essence, we have a command in a Chef recipe that builds out a number of fixed IP networks using nova-manage during initial setup of an OpenStack cluster. The command looks like this:
nova-manage network create --label fixed --fixed_
As per the original bug report on GitHub, all subnets after the first one were being created with a DHCP server address of the gateway of the first subnet to be created. I dug in and found the problem code in nova/network/
This causes things to break for us pretty badly. When launching instances in any network other than the first one, launch will fail because Nova tries to launch dnsmasq and bind it to an IP that's already bound by another instance of dnsmasq, which fails.
I patched manager.py in the following way, which writes the DHCP server IP to a local variable in the loop. Specifying a DHCP server manually will still override inferring the DHCP server from the gateway address. Tests pass after this change (sorry that it is not in Gerrit already, but I haven't been able to sit down and get git review working yet):
diff --git a/nova/
index 3e8e8b1..832fd1b 100644
--- a/nova/
+++ b/nova/
@@ -1351,13 +1351,15 @@ class NetworkManager(
- if not dhcp_server:
- dhcp_server = net.gateway
+ if dhcp_server:
+ subnet_dhcp_server = dhcp_server
+ else:
+ subnet_dhcp_server = net.gateway
- if str(net.dhcp_start) == dhcp_server:
+ if str(net.dhcp_start) == subnet_dhcp_server:
- net.dhcp_server = dhcp_server
+ net.dhcp_server = subnet_dhcp_server
Fix proposed to branch: stable/kilo /review. openstack. org/184620
Review: https:/