[lxc-users] container name limit includes snapshot names? unable to create snapshots

Tomasz Chmielewski mangoo at wpkg.org
Thu Jan 28 06:27:21 UTC 2016


It's not possible to create snapshots for containers with long names.

To reproduce:

Container name seems to be limited to 63 characters:

* trying to create a container with 64 characters fails - that's OK, 
here, we just wanted to know what the limit for a container name is:

# lxc copy base 
aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgggg
error: Container name isn't a valid hostname.


* trying to create a container with less characters (63, 62 and 61) 
succeeds:

# lxc copy base-uni-web01 
aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg
# lxc copy base-uni-web01 
aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgg
# lxc copy base-uni-web01 
aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffg


* Now, let's try to create a snapshot - container name with 63 
characters:

# lxc snapshot 
aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg snapname
error: Failed to set LXC config: 
lxc.utsname=aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg/snapname

# lxc snapshot 
aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg snap
error: Failed to set LXC config: 
lxc.utsname=aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg/snap

# lxc snapshot 
aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg s
error: Failed to set LXC config: 
lxc.utsname=aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffggg/s



* Trying to create a snapshot for a container with 62 character name - 
it's only possible to set one character snapshot name:

# lxc snapshot 
aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgg snapshot
error: Failed to set LXC config: 
lxc.utsname=aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgg/snapshot

# lxc snapshot 
aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgg snap
error: Failed to set LXC config: 
lxc.utsname=aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgg/snap

# lxc snapshot 
aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgg sn
error: Failed to set LXC config: 
lxc.utsname=aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgg/sn

# lxc snapshot 
aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgg s
#



Feature or bug?

In my opinion a bug, counter intuitive, makes scripting hard.


Tomasz Chmielewski
http://wpkg.org



More information about the lxc-users mailing list