<div dir="ltr">Thanks Dennis. Neutron and Nova are two different databases. Either Neutron need to query the hostname using nova client or nova should pass in the hostname to neutron agent. It is doable if not impossible to get the hostname associated with vif/port pair. It needs to be part of the code. There are pending blue prints describing this feature. Hopefully it makes it to Juno.<div>
<br></div><div>Floating IPs are another way to get around this issue, but VMs that are closely related such as hadoop nodes should resolve fixed IP addresses and be able to communicate over its private network.</div><div>
<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 28, 2014 at 6:38 PM, Qin, Xiaohong <span dir="ltr"><<a href="mailto:Xiaohong.Qin@emc.com" target="_blank">Xiaohong.Qin@emc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Murali,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The actual code to invoke this dnsmasq process is in this Python code,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">/opt/stack/neutron/neutron/agent/linux/dhcp.py<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">You have to play around it to make it work to suit your needs. Neutron does know which Vif/port associated with which VM,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">neutron port-list<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">| fb607957-ea21-46a4-98ed-5801849d6fc6 | | fa:16:3e:90:1d:1e | {"subnet_id": "0f49455c-a4bb-4d81-bec5-3203620200fd", "ip_address": "</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:red">10.0.0.2</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">"}<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">nova list<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">| 8c2419a7-6927-4fce-bc64-a71789cf63b1 | demo_img1 | ACTIVE | - | Running | private=</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:red">10.0.0.2</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">, 10.10.166.171 |<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">So the vif port for this VM (8c2419a7-6927-4fce-bc64-a71789cf63b1) is fb607957-ea21-46a4-98ed-5801849d6fc6.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">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.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Dennis Qin<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Muralidhar Balcha [mailto:<a href="mailto:muralidharb@gmail.com" target="_blank">muralidharb@gmail.com</a>] <br>
<b>Sent:</b> Monday, April 28, 2014 3:00 PM<br><b>To:</b> Qin, Xiaohong<br><b>Cc:</b> <a href="mailto:openstack@lists.openstack.org" target="_blank">openstack@lists.openstack.org</a><br><b>Subject:</b> Re: [Openstack] Neutron dnsmasq question<u></u><u></u></span></p>
<div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Dennis,<u></u><u></u></p><div><p class="MsoNormal">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.<u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Also this should be part of VM provisioning logic. I don't want to manually edit the host file.<u></u><u></u></p></div><div><p class="MsoNormal">
<u></u> <u></u></p></div><div><p class="MsoNormal">Murali Balcha<u></u><u></u></p></div></div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p><div><p class="MsoNormal">On Mon, Apr 28, 2014 at 12:08 PM, Qin, Xiaohong <<a href="mailto:Xiaohong.Qin@emc.com" target="_blank">Xiaohong.Qin@emc.com</a>> wrote:<u></u><u></u></p>
<div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Murali,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The dnsmasq process is been invoked as the following in the controller,</span><u></u><u></u></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">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</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:red">=/opt/stack/data/neutron/dhcp/90a8a84a-d4dd-4c98-bf87-492342c55b94/host</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> --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</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">So it is consulting this file for name resolution,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">/opt/stack/data/neutron/dhcp/90a8a84a-d4dd-4c98-bf87-492342c55b94/host</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">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.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Dennis Qin</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Muralidhar Balcha [mailto:<a href="mailto:muralidharb@gmail.com" target="_blank">muralidharb@gmail.com</a>] <br>
<b>Sent:</b> Friday, April 25, 2014 5:23 PM<br><b>To:</b> <a href="mailto:openstack@lists.openstack.org" target="_blank">openstack@lists.openstack.org</a><br><b>Subject:</b> [Openstack] Neutron dnsmasq question</span><u></u><u></u></p>
<div><div><p class="MsoNormal"> <u></u><u></u></p><div><p class="MsoNormal">Folks,<u></u><u></u></p><div><p class="MsoNormal">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?<u></u><u></u></p>
</div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">Regards, <u></u><u></u></p><div><div><p class="MsoNormal"> <u></u><u></u></p></div><p class="MsoNormal">-- <br>Muralidhar Balcha<br><a href="tel:508%20494%205007" target="_blank">508 494 5007</a> <u></u><u></u></p>
</div></div></div></div></div></div></div></div><p class="MsoNormal"><br><br clear="all"><u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal">-- <br>Muralidhar Balcha<br><a href="tel:508%20494%205007" value="+15084945007" target="_blank">508 494 5007</a> <u></u><u></u></p>
</div></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Muralidhar Balcha<br>508 494 5007
</div>