<div dir="ltr"><div>On Mon, Nov 30, 2020 at 6:56 AM Stephen Finucane <<a href="mailto:stephenfin@redhat.com">stephenfin@redhat.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">When attaching a port to an instance, nova will check for DNS support in neutron<br>
and set a 'dns_name' attribute if found. To populate this attribute, nova uses a<br>
sanitised version of the instance name, stored in the instance.hostname<br>
attribute. This sanitisation simply strips out any unicode characters and<br>
replaces underscores and spaces with dashes, before truncating to 63 characters.<br>
It does not currently replace periods and this is the cause of bug 1581977 [1],<br>
where an instance name such as 'ubuntu20.04' will fail to schedule since neutron<br>
identifies '04' as an invalid TLD.<br>
<br>
The question now is what to do to resolve this. There are two obvious paths<br>
available to us. The first is to simply catch these invalid hostnames and<br>
replace them with an arbitrary hostname of format 'Server-{serverUUID}'. This is<br>
what we currently do for purely unicode instance names and is what I've proposed<br>
at [2]. The other option is to strip all periods, or rather replace them with<br>
hyphens, when sanitizing the instance name. This is more predictable but breaks<br>
the ability to use the instance name as a FQDN. Such usage is something I'm told<br>
we've never supported, but I'm concerned that there are users out there who are<br>
relying on this all the same and I'd like to get a feel for whether this is the<br>
case first.<br>
<br>
So, the question: does anyone currently rely on this inadvertent "feature"?<br></blockquote><div><br></div><div> I took a look and we (at Verizon Media) have users that create instances with fqdn-like names (VMs and BMs). I didn't look to see how many instances have such names, but we have tens of thousands of instances and eyeballing one of our clusters, > 90% of them have such names.</div><div><br></div><div>--ruby</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
Cheers,<br>
Stephen<br>
<br>
[1] <a href="https://launchpad.net/bugs/1581977" rel="noreferrer" target="_blank">https://launchpad.net/bugs/1581977</a><br>
[2] <a href="https://review.opendev.org/c/openstack/nova/+/764482" rel="noreferrer" target="_blank">https://review.opendev.org/c/openstack/nova/+/764482</a><br>
<br>
<br>
</blockquote></div></div>