<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>Thx vish,</div><div><br></div><div>Ok, maybe something to work on.</div><div><br></div><div>I have a need/want… to make the hostname based off the IP (or one of the IPs if many) so it almost needs to hook-in to those places (and/or plugin extension like) to change that, might be something that others want also.</div><div><br></div><div>What say everyone :-P</div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Vishvananda Ishaya <<a href="mailto:vishvananda@gmail.com">vishvananda@gmail.com</a>><br><span style="font-weight:bold">Reply-To: </span> OpenStack Development Mailing List <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br><span style="font-weight:bold">Date: </span> Fri, 10 Aug 2012 21:14:02 -0700<br><span style="font-weight:bold">To: </span> OpenStack Development Mailing List <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br><span style="font-weight:bold">Subject: </span> Re: [openstack-dev] Question on hostname generation?<br></div><div><br></div><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 10, 2012, at 6:37 PM, Joshua Harlow <<a href="mailto:harlowja@yahoo-inc.com">harlowja@yahoo-inc.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif; "><div><br></div><span id="OLK_SRC_BODY_SECTION"><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif; "><div>I was wondering about the following case (and am not sure if its been addressed in folsom).</div><div><br></div><div>At yahoo, instead of the default hostname that seems to be automatically established (ie 'server-XYZ.novalocal' was in essex) we were wondering if there is anything in folsom that say lets us override that generation with either a module (or a subclass) or a new function without having to patch nova code. Sometimes we want a default hostname of a different format (as probably do others) and I just am not sure if quantum is directing this default hostname, or if nova still is, or if its some mix of both (the metadata + cloud-init can affect the hostname as well, so perhaps the configdrive work should be the only one establish a 'real' hostname?). </div><div><br></div><div>I have found the following pieces of hostname related code but am not sure if this is all the places that make hostnames :-)</div><ul><li><a href="https://github.com/openstack/nova/blob/master/nova/api/metadata/base.py#L109">https://github.com/openstack/nova/blob/master/nova/api/metadata/base.py#L109</a></li></ul><div>Is this the only place nowadays?? Is there something in quantum also?</div></div></div></span></div></blockquote><div><br></div><div>Hostname in metadata (it moved a little):</div><div><br></div><div><a href="https://github.com/openstack/nova/blob/master/nova/api/metadata/base.py#L122">https://github.com/openstack/nova/blob/master/nova/api/metadata/base.py#L122</a></div><div><br></div><div>Hostname from dhcp:</div><div><br></div><div><a href="https://github.com/openstack/nova/blob/master/nova/network/linux_net.py#L811">https://github.com/openstack/nova/blob/master/nova/network/linux_net.py#L811</a></div><div><br></div>instance_hostname comes from instance['hostname'] in the db, which is generated here:</div><div><br></div><div><a href="https://github.com/openstack/nova/blob/master/nova/compute/api.py#L636">https://github.com/openstack/nova/blob/master/nova/compute/api.py#L636</a></div><div><br></div><div>Seems like there is no plugin mechanism, but one we could easily add a flag that could be a format string applied to the instance record so it is easy to customize.</div><div><br></div><div>Vish</div><br></div></div></span></body></html>