[lxc-users] Dotted container names now invalid?
lxc v0.19 on Ubuntu 15.10 host. ~ lxc launch wily abc Creating abc done. Starting abc done. ~ lxc launch wily abc.lxc Creating abc.lxc error: Invalid container name The 2nd one above used to work. Why are dotted domain-like container names now invalid? ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Dotted container names now invalid?
Mark, you are probably talking about lxD, not lxC, right? b. On 6 October 2015 at 07:36, Mark Constable wrote: > lxc v0.19 on Ubuntu 15.10 host. > > ~ lxc launch wily abc > Creating abc done. > Starting abc done. > > ~ lxc launch wily abc.lxc > Creating abc.lxc error: Invalid container name > > The 2nd one above used to work. > > Why are dotted domain-like container names now invalid? > ___ > lxc-users mailing list > lxc-users@lists.linuxcontainers.org > http://lists.linuxcontainers.org/listinfo/lxc-users ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Dotted container names now invalid?
That's a change we had to make with 0.19. As the container name is set as the container hostname and may be included in DNS records through the use of DHCP, we needed it to comply to both hostname and DNS records specifications. We used the most restrictive set of criteria for both hostnames and DNS records from all operating systems we may want to be running LXD on at some point. This results in the following rule: - Hostname must be between 1 and 63 characters in length - The character set is alpha numberical characters and hyphens - Hostname may not started with a digit or an hyphen - Hostname may not end with an hyphen We realize it's pretty restrictive but that way we can ensure that those names will always work, regardless of what operating system you're using as the client or the server. On Tue, Oct 06, 2015 at 12:00:39PM +0200, Bostjan Skufca wrote: > Mark, you are probably talking about lxD, not lxC, right? > > b. > > > On 6 October 2015 at 07:36, Mark Constable wrote: > > > lxc v0.19 on Ubuntu 15.10 host. > > > > ~ lxc launch wily abc > > Creating abc done. > > Starting abc done. > > > > ~ lxc launch wily abc.lxc > > Creating abc.lxc error: Invalid container name > > > > The 2nd one above used to work. > > > > Why are dotted domain-like container names now invalid? > > ___ > > lxc-users mailing list > > lxc-users@lists.linuxcontainers.org > > http://lists.linuxcontainers.org/listinfo/lxc-users > ___ > lxc-users mailing list > lxc-users@lists.linuxcontainers.org > http://lists.linuxcontainers.org/listinfo/lxc-users -- Stéphane Graber Ubuntu developer http://www.ubuntu.com signature.asc Description: Digital signature ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Dotted container names now invalid?
On 06/10/15 20:48, Stéphane Graber wrote: Why are dotted domain-like container names now invalid? As the container name is set as the container hostname and may be included in DNS records through the use of DHCP, we needed it to comply to both hostname and DNS records specifications. Right, so I was abusing the hostname part and using it as a full domainname for the container, which was very convenient. It also allowed me to easily see the full domainname of each container via lxc list. However this change now introduces a problem I am not sure how to get around in that if I want to set up various vhosts such as... www.example1.org www.example2.org www.example3.org and... mail.example1.org mail.example2.org mail.example3.org for typical hosting purposes then I cannot have multiple hostnames of www, www and another www (times 1000+). So now I have to come up with some otherwise useless scheme to provide dummy hostnames where I have to use some persistent centralised database to map and keep track of, ie;... client1w -> www.example1.org client2w -> www.example2.org client3w -> www.example3.org client1m -> mail.example1.org client2m -> mail.example2.org client3m -> mail.example3.org Which is incredibly lame compared to how 0.18 worked. This results in the following rule: - Hostname must be between 1 and 63 characters in length - The character set is alpha numberical characters and hyphens - Hostname may not started with a digit or an hyphen - Hostname may not end with an hyphen Surely DHCP can also work with full domainnames? Is there any chance this restriction could be loosened slightly to include a dot char to re-enable a FQDN for container names? ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Dotted container names now invalid?
> Von: lxc-users [mailto:lxc-users-boun...@lists.linuxcontainers.org] Im Auftrag > > On 06/10/15 20:48, Stéphane Graber wrote: > >>> Why are dotted domain-like container names now invalid? > > > > As the container name is set as the container hostname and may be > > included in DNS records through the use of DHCP, we needed it to comply > > to both hostname and DNS records specifications. > > Right, so I was abusing the hostname part and using it as a full domainname > for the container, which was very convenient. It also allowed me to easily > see the full domainname of each container via lxc list. > > However this change now introduces a problem I am not sure how to get > around in that if I want to set up various vhosts such as... > > www.example1.org > www.example2.org > [snip] > > for typical hosting purposes then I cannot have multiple hostnames of > www, www and another www (times 1000+). > > So now I have to come up with some otherwise useless scheme to provide > dummy hostnames where I have to use some persistent centralised database > to map and keep track of, ie;... > > client1w -> www.example1.org > client2w -> www.example2.org Having the same problem, I was just replacing the dots with dashes, which does not really impair readability. So you do not need a lookup map. smime.p7s Description: S/MIME cryptographic signature ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Dotted container names now invalid?
On Wed, Oct 07, 2015 at 10:28:02AM +1000, Mark Constable wrote: > On 06/10/15 20:48, Stéphane Graber wrote: > >>>Why are dotted domain-like container names now invalid? > > > >As the container name is set as the container hostname and may be > >included in DNS records through the use of DHCP, we needed it to comply > >to both hostname and DNS records specifications. > > Right, so I was abusing the hostname part and using it as a full domainname > for the container, which was very convenient. It also allowed me to easily > see the full domainname of each container via lxc list. > > However this change now introduces a problem I am not sure how to get > around in that if I want to set up various vhosts such as... > > www.example1.org > www.example2.org > www.example3.org > > and... > > mail.example1.org > mail.example2.org > mail.example3.org > > for typical hosting purposes then I cannot have multiple hostnames of > www, www and another www (times 1000+). > > So now I have to come up with some otherwise useless scheme to provide > dummy hostnames where I have to use some persistent centralised database > to map and keep track of, ie;... > > client1w -> www.example1.org > client2w -> www.example2.org > client3w -> www.example3.org > > client1m -> mail.example1.org > client2m -> mail.example2.org > client3m -> mail.example3.org > > Which is incredibly lame compared to how 0.18 worked. > > >This results in the following rule: > > - Hostname must be between 1 and 63 characters in length > > - The character set is alpha numberical characters and hyphens > > - Hostname may not started with a digit or an hyphen > > - Hostname may not end with an hyphen > > Surely DHCP can also work with full domainnames? > > Is there any chance this restriction could be loosened slightly to include > a dot char to re-enable a FQDN for container names? Not all operating systems we may run on at some point support dots in their hostnames, so allowing this would make things inconsistent across platforms and I'd really rather avoid this. Note that if what you need is a way to find containers easily, you can do: lxc config set container-name user.customer=blah lxc list user.customer=blah -- Stéphane Graber Ubuntu developer http://www.ubuntu.com signature.asc Description: Digital signature ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Dotted container names now invalid?
On 07/10/15 18:53, Stéphane Graber wrote: Is there any chance this restriction could be loosened slightly to include a dot char to re-enable a FQDN for container names? Not all operating systems we may run on at some point support dots in their hostnames, so allowing this would make things inconsistent across platforms and I'd really rather avoid this. Well how about lxc itself transform any dots to hyphens on just those systems? Rather than require the majority of sane posix platforms to manually transform a dotted FQDN to some hyphenated version why not just apply this "magically" within lxc for the systems that can't cope with a dotted hostname? Note that if what you need is a way to find containers easily, you can do: lxc config set container-name user.customer=blah lxc list user.customer=blah Times thousand of hosts compared to just a plain "lxc list"? On 07/10/15 17:37, Fiedler Roman wrote: Having the same problem, I was just replacing the dots with dashes, which does not really impair readability. So you do not need a lookup map. I've got at least half a dozen clients with hyphens in their domainnames so mapping - to dot will result in an invalid domain. ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Dotted container names now invalid?
Greetings, Mark Constable! >>> Is there any chance this restriction could be loosened slightly to include >>> a dot char to re-enable a FQDN for container names? >> >> Not all operating systems we may run on at some point support dots in >> their hostnames, so allowing this would make things inconsistent across >> platforms and I'd really rather avoid this. > Well how about lxc itself transform any dots to hyphens on just those systems? That's an overhead and conditional code that needs to be maintained by someone. > Rather than require the majority of sane posix platforms to manually transform > a dotted FQDN to some hyphenated version why not just apply this "magically" > within lxc for the systems that can't cope with a dotted hostname? >> Note that if what you need is a way to find containers easily, you can do: >> lxc config set container-name user.customer=blah >> lxc list user.customer=blah > Times thousand of hosts compared to just a plain "lxc list"? If this is your typical use case, make an alias or otherwise automate it. It will also allow you to store any other metadata you might want to add in the future. IMO, this is much more elegant and straightforward way to deal with it, rather than abusing container names for unrelated intentions. Though, I would like to know, which systems are not allowing dots as valid filename characters. To avoid them in the future. -- With best regards, Andrey Repin Wednesday, October 7, 2015 15:21:31 Sorry for my terrible english... ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users