[openstack-dev] [Neutron][dns]What the meaning of "dns_assignment" and "dns_name"?

Miguel Lavalle miguel at mlavalle.com
Sun Nov 8 19:14:20 UTC 2015


Hi Neil,

You are correct about dns_name and dns_assignment.

Prior to adding this feature to Neutron, all your ports were getting
implicitly what I named "dns_assignment". It was created by the the DHCP
agent and pushed to the dnsmasq instance associated with the port's
network. This implicit  dns_assignment was of the form 'hostname' =
'host-10.65.0.4', 'ip_address' = '10.65.0.4', 'fqdn' =
'host-10-65-0-4.opentacklocal'. It wasn't a dictionary. It was just a
record in the files that the DHCP agent uses to control the behavior of the
dnsmasq instances and it was never seen (for the most part) by the users.
All I did was to make this "dns_assignment" explicit, give it a name as an
attribute in the API, give the user visibility of it and give the user
control of the names associated with it through the API (moving its
generation to the Neutron server as a consequence). This is turn is
allowing me to implement  on the Nova side functionality to assign to ports
associated with an instance the hostname of said instance, per this spec:
https://review.openstack.org/#/c/90150/

Thanks for your interest ion this feature.

Regards

Miguel


On Fri, Nov 6, 2015 at 4:28 AM, Neil Jerram <Neil.Jerram at metaswitch.com>
wrote:

> Hi Miguel,
>
> I’ve just been looking at this, and have deduced the following summary of
> the new dns_name and dns_assignment fields:
>
> - dns_name is a simple name, like 'vm17'. It is a writable port field, and
> gets combined with a dns_domain that is specified elsewhere.
>

> - dns_assignment is a server-generated read-only field‎, holding a list of
> dicts like {'hostname': 'vm17', 'ip_address': '10.65.0.4', 'fqdn': '
> vm17.datcon.co.uk'}.
>
> Can you confirm whether that's correct?
>
> What is the reason (or requirement) for dns_assignment being able to
> specify hostname and fqdn on a per-IP-address basis?  Does it ever make
> sense for a VM to associate a different hostname with different NICs or IP
> addresses?
>
> Many thanks,
>         Neil
>
>
>
> From: Miguel Lavalle [mailto:miguel at mlavalle.com]
> Sent: 14 October 2015 04:22
> To: OpenStack Development Mailing List (not for usage questions) <
> openstack-dev at lists.openstack.org>
> Subject: Re: [openstack-dev] [Neutron][dns]What the meaning of
> "dns_assignment" and "dns_name"?
>
> Zhi Chang,
> Thank you for your questions. We are in the process of integrating Neutron
> and Nova with an external DNS service, using Designate as the reference
> implementation. This integration is being achieved in 3 steps. What you are
> seeing is the result of only the first one. These steps are:
> 1) Internal DNS integration in Neutron, which merged recently:
> https://review.openstack.org/#/c/200952/. As you may know, Neutron has an
> internal DHCP / DNS service based on dnsmasq for each virtual network that
> you create. Previously, whenever you created a port on a given network,
> your port would get a default host name in dnsmasq of the form
> 'host-xx-xx-xx-xx.openstacklocal.", where xx-xx-xx-xx came from the port's
> fixed ip address "xx.xx.xx.xx" and "openstacklocal" is the default domain
> used by Neutron. This name was generated by the dhcp agent. In the above
> mentioned patchset, we are moving the generation of these dns names to the
> Neutron server, with the intent of allowing the user to specify it. In
> order to do that, you need to enable it by defining in neutron.conf the
> 'dns_domain' parameter with a value different to the default
> 'openstacklocal'. Once you do that, you can create or update a port and
> assign a value to its 'dns_name' attribute. Why is this useful? Please read
> on.
>
> 2) External DNS integration in Neutron. The patchset is being worked now:
> https://review.openstack.org/#/c/212213/. The functionality implemented
> here allows Neutron to publish the dns_name associated with a floating ip
> under a domain in an external dns service. We are using Designate as the
> reference implementation, but the idea is that in the future other DNS
> services can be integrated.. Where does the dns name and domain of the
> floating ip come from? It can come from 2 sources. Source number 1 is the
> floating ip itself, because in this patchset we are adding a dns_name and a
> dns_domain attributes to it. If the floating ip doesn't have a dns name and
> domain associated with it, then they can come from source number 2: the
> port that the floating ip is associated with (as explained in point 1,
> ports now can have a dns_name attribute) and the port's network, since this
> patchset adds dns_domain to networks.
> 3) Integration of Nova with Neutron's DNS. I have started the
> implementation of this and over the next few days will push the code to
> Gerrit for first review. When an instance is created, nova will request to
> Neutron the creation of the corresponding port specifying the instance's
> hostname in the port's 'dns_name' attribute (as explained in point 1). If
> the network where that port lives has a dns_domain associated with it (as
> explained in point 2) and you assign a floating ip to the port, your
> instance's hostname will be published in the external dns service.
> To make it clearer, here I walk you through an example that I executed in
> my devstack: http://paste.openstack.org/show/476210/
> As mentioned above, we also allow the dns_name and dns_domain to be
> published in the external dns to be defined at the floating ip level. The
> reason for this is that we envision a use case where the name and ip
> address made public in the dns service are stable, regardless of the nova
> instance associated with the floating ip.
> If you are attending the upcoming Tokyo summit, you could attend the
> following talk for further information:
> http://openstacksummitoctober2015tokyo.sched.org/event/5cbdd5fb4a6d080f93a5f321ff59009c#.Vh3KMZflRz2
> Looking forward to see you there!
>
> Hope this answers your questions
> Best regards
> Miguel Lavalle
>
> On Tue, Oct 13, 2015 at 9:58 AM, Zhi Chang <changzhi at unitedstack.com>
> wrote:
> Hi, all
>     I install the latest devstack and create a vm by nova. I get the
> port's info which created by Neutron. I'm confused that what the meaning of
> column "dns_assignment" and column "dns_name".
>     First, column "dns_assignment" is a read-only attribute. What is it
> used for? I think that this column is useless except shows DNS infomation
> (include hostname, ip, fqdn). Does my thought right?
>     Second, I don't quite understand what the meaning of column
> "dns_name". I can update this column, but there is nothing happen when my
> operation was done. In other words, this column has no change when I run
> "neutron port-update xxx --dns_name=test". What the column "dns_name" use
> for?
>
>
>
> Thanks
> Zhi Chang
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20151108/dbc803df/attachment.html>


More information about the OpenStack-dev mailing list