Murali,

The actual code to invoke this dnsmasq process is in this Python code,

/opt/stack/neutron/neutron/agent/linux/dhcp.py

You have to play around it to make it work to suit your needs. Neutron does 
know which Vif/port associated with which VM,

neutron port-list

| fb607957-ea21-46a4-98ed-5801849d6fc6 |      | fa:16:3e:90:1d:1e | 
{"subnet_id": "0f49455c-a4bb-4d81-bec5-3203620200fd", "ip_address": "10.0.0.2"}

nova list

| 8c2419a7-6927-4fce-bc64-a71789cf63b1 | demo_img1 | ACTIVE | -          | 
Running     | private=10.0.0.2, 10.10.166.171 |

So the vif port for this VM (8c2419a7-6927-4fce-bc64-a71789cf63b1) is 
fb607957-ea21-46a4-98ed-5801849d6fc6.

Also you can associate a floating IP address to the dnsmasq interface, just 
like you do for VM interface. One thing I noticed is that dnsmasq was not 
invoked during Neutron startup service. It was started when the first VM got 
booted up.

Dennis Qin

From: Muralidhar Balcha [mailto:[email protected]]
Sent: Monday, April 28, 2014 3:00 PM
To: Qin, Xiaohong
Cc: [email protected]
Subject: Re: [Openstack] Neutron dnsmasq question

Dennis,
That does not work. Next time when a new VM is created, it replaces the file 
with default host names. I think part of the challenge is Neutron does not know 
the host name associated with the port/vif, so it fabricates a hostname based 
on the IP address. DNS lookup works for the fabricated host name, but  I need 
host entry with real host name.

Also this should be part of VM provisioning logic. I don't want to manually 
edit the host file.

Murali Balcha

On Mon, Apr 28, 2014 at 12:08 PM, Qin, Xiaohong 
<[email protected]<mailto:[email protected]>> wrote:
Hi Murali,

The dnsmasq process is been invoked as the following in the controller,

dnsmasq --no-hosts --no-resolv --strict-order --bind-interfaces 
--interface=tap7e1faebd-1c --except-interface=lo 
--pid-file=/opt/stack/data/neutron/dhcp/90a8a84a-d4dd-4c98-bf87-492342c55b94/pid
 
--dhcp-hostsfile=/opt/stack/data/neutron/dhcp/90a8a84a-d4dd-4c98-bf87-492342c55b94/host
 
--dhcp-optsfile=/opt/stack/data/neutron/dhcp/90a8a84a-d4dd-4c98-bf87-492342c55b94/opts
 --leasefile-ro --dhcp-range=set:tag0,10.0.0.0,static,86400s 
--dhcp-lease-max=256 --conf-file= --domain=openstacklocal

So it is consulting this file for name resolution,

/opt/stack/data/neutron/dhcp/90a8a84a-d4dd-4c98-bf87-492342c55b94/host

You can modify this file to map your hosts to different names as a work around. 
It might be possible to force this file to be auto generated with your desired 
options.

Dennis Qin

From: Muralidhar Balcha 
[mailto:[email protected]<mailto:[email protected]>]
Sent: Friday, April 25, 2014 5:23 PM
To: [email protected]<mailto:[email protected]>
Subject: [Openstack] Neutron dnsmasq question

Folks,
Neutron is populating dnsmasq host file with hostname something like 
"host-192-168-0-0". This is not particularly useful for me. I need name 
resolution on the host name. How can I override this behavior? I am using 
Havana and this behavior is hardcoded in the code. Is there any workaround for 
this issue?

Regards,

--
Muralidhar Balcha
508 494 5007<tel:508%20494%205007>



--
Muralidhar Balcha
508 494 5007
_______________________________________________
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to     : [email protected]
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack

Reply via email to