[openstack-dev] [Fuel] Question about unique default hostname for node

Igor Kalnitsky ikalnitsky at mirantis.com
Tue Jul 21 12:57:26 UTC 2015


Hi Fedor,

> Use 'node-{ID}-{#}' format, where {#} we'll chose in loop till the first unique.

I don't like this approach by many reasons. Here's some of them:

* With a loop you're going to perform N SQL queries in order to check
for uniqueness, and that's a bad design and it'd be better to avoid
it.
* What if user wants to use exactly the same schema? For instance, he
use the first number as a rack id and the second one as a node id in
this rack. The proposed approach will implicitly set some wrong
hostname, and detecting it may be a challenge.

> Use some unique value, shorter than UUID (for example - number of microseconds from current timestamp)

Usually, it's incredibly rare situation, so solving it by adding UUID
is a more than enough. Moreover, it will take attention of the cloud
operator, so he will easily detect a conflicting node and fix its name
as he wishes. And that's probable what he wants to do almost all the
time - to fix its hostname, none want to work with names like: node-1,
node-2, node-2-2, node-3, because what is the node-2-2? Does it store
some backup or what? It confuses.

So, I think current approach - node-UUID - is the way we should do.

Thanks,
Igor

On Tue, Jul 21, 2015 at 3:38 PM, Fedor Zhadaev <fzhadaev at mirantis.com> wrote:
> Hi all,
>
> The next issue was found during implementation
> https://blueprints.launchpad.net/fuel/+spec/node-naming :
>
>   User may change node hostname to any another, including default-like
> 'node-{№}', where № may be bigger than maximum nodeID existing at that
> moment.
>   Later when node with ID == № will be created it's default name 'node-{ID}'
> will break hostnames uniqueness.
>
> To avoid this now it was decided to generate in such situation another
> default hostname.
>
> The current solution is to generate hostname 'node-{UUID}'. It works, but
> may look terribly.
>
> There are a few another possible solutions:
>
> Use 'node-{ID}-{#}' format, where {#} we'll chose in loop till the first
> unique.
> Use some unique value, shorter than UUID (for example - number of
> microseconds from current timestamp)
>
> Please share you opinion - what is better?
>
> Also you can propose your own solutions.
>
> --
> Kind Regards,
> Fedor Zhadaev
> Junior Software Engineer, Mirantis Inc.
> Skype: zhadaevfm
> E-mail: fzhadaev at mirantis.com
>
> __________________________________________________________________________
> 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
>



More information about the OpenStack-dev mailing list