[lxc-devel] [RFC] Container name vs utsname... All templates.

Serge Hallyn serge.hallyn at ubuntu.com
Fri May 17 13:43:45 UTC 2013


Quoting Michael H. Warfield (mhw at WittsEnd.com):
> This is my second of two requests for comments.  This one applies to ALL
> the templates.
> 
> I noticed, in working on the Fedora template, lxc-fedora, that the host
> name and utsname configuration value is set to the simple name of the
> container.  IMHO, that's suboptimal.
> 
> In practice, the hostname and utsname should be the FQDN (fully
> qualified domain name) of the system.  Often, on installation of a new
> Fedora system, I find that it's derived from the DHCP information and I
> end up with something like "rasputin.local" on the install screens,
> which I generally change.
> 
> I don't want to use the FQDN as the container name, but rather the
> simple name (or something different).  Should we provide a separate
> (optional) option for the utsname which is then used for the hostname?
> 
> Logic, maybe, as follows???
> 
> -n Container_Name
> -u UTS_Name
> 
> (-u is just a thought - I want other thoughts there.)
> 
> If UTS_Name is NULL, set UTS_Name to Container_Name
> 
> If UTS_Name does not contain a domain (no "."), extract domain from host
> name of host and append domain to UTS_Name.
> 
> Assign utsname and hostname of container to UTS_Name rather than
> Container_Name.
> 
> This way, container "Rasputin" could be created with "-n Rasputin -u
> Rasputin.WittsEnd.com" and have the hostname set properly in the
> container and not have the container namespace polluted with multiple
> instantiations of "WittsEnd.com".  Creating just "-n Rasputin" would
> cause the script to extract a ".WittsEnd.com" to be extracted from the
> host "Forest.WittsEnd.com" and appended for "Rasputin.WittsEnd.com",
> which is what I would want.
> 
> Another thought would be to overburden -n with the concept that the
> container name would be a simple name (strip from the first "." to the
> end) but that would be too many changes in too many places and result in
> too many headaches, in my mind.
> 
> Thoughts?

On the one hand I fear adding too many options for the many things we
might want configured on the host.  On the other hand what you're
asking for makes sense...

Do you think it makes sense to have only the longname (--utsname or
--fqdn) and not use -u for this?

-serge




More information about the lxc-devel mailing list