Nova dhcp_domain flag overwrites the dnsmasq config file

Bug #1033675 reported by Han-sebastien
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned

Bug Description

Hi,

I'm trying to manage my DNS with a combination of dnsmasq trickery. I would like to be able to have specific domain per subnet. This is already done by the adding a specific configuration file to dnsmasq via the nova flag --dnsmasq_config_file=/etc/dnsmasq.conf. I fulfilled this file like so:

domain=tenant1.domain.net,10.0.20.0/24
domain=tenant2.domain.net,10.0.21.0/24
domain=tenant3.domain.net,10.0.22.0/24
...

Within the VMs, the /etc/resolv.conf is ok. No problem.

But the problem is on the lease file generated by nova. The default --domain, setup or not in nova.conf overwrites the lease file. If I don't set anything in nova.conf, my lease file gets:

fa:16:3e:7d:d3:9f,un.novalocal,10.0.20.3
fa:16:3e:69:4e:53,deux.novalocal,10.0.20.8
fa:16:3e:76:d2:43,troi.novalocal,10.0.20.11

And if I put something on this flag, the behavior is the same. It tried to put an empty flag but nova complains about an empty parameter which makes sense.

I would like to be able to get lease file like so:

fa:16:3e:7d:d3:9f,vm1.tenant1.domain.net,10.0.20.3
fa:16:3e:69:4e:53,vm2.tenant1.domain.net,10.0.20.8
fa:16:3e:76:d2:43,vm3.tenant1.domain.net,10.0.20.11
...

And so on according to each tenant lease file. I think I will be able to get what I want by removing the dhcp_domain flag from the nova code.

At the moment nova seems overwrite the dnsmasq config file, I don't understand why since --domain is not a mandatory parameter. I dived into the code, removed everything related to --domain : flag etc... In those files:

-/usr/lib/python2.7/dist-packages/nova/network/linux_net.py
-/usr/lib/python2.7/dist-packages/nova/network/manager.py
-/usr/lib/python2.7/dist-packages/nova/api/metadata/handler.py

But I discovered that nova builds his own lease file so the lease file is written but without any domain now. It's not a problem to rollback my files but I wish I could achieve my goal.

Any idea?
Thank you in advance.

Cheers!

Revision history for this message
Vish Ishaya (vishvananda) wrote :

you could do something tricky like set config option to:
--dhcp_domain=domain.net

and modify the server create code nova/compute/api.py that sets the hostname to append the tenant name.
so the instance hostname would be xxx.tenant1, then you would get a different domain name per tenant.

Revision history for this message
Han-sebastien (han-sebastien) wrote :

Hi,

Thanks, I will give a try :)

Btw why the dhcp_domain somehow overwrite the dnsmasq file? This should be all the way around right?

Cheers!

Yaguang Tang (heut2008)
Changed in nova:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.