LXC-2.1.0-pre: My experiences so far - pretty OK, config file migration does not work perfectly

Introduction

I’ve noticed there is a call for testing of the current git master. I do have experiences with lxc since a couple of years, so I decided to contribute a little bit of my time.

Building deb packages

Here are my findings:

  • I do build my own deb packages. Basically, I take the existing source and modify it a little bit for no special reason.
  • Using the 2.0.8 packages and doing a uupdate -u ../lxc-2.1.0.tar.xz I realized on trusty:
    • there is a dependency to python3-setuptools
    • there is a dependency to graphviz/dot
    • there are some issues related to bash-completion
    • there are some perl warnings (Use of uninitialized value $filename in concatenation (.) or string at /usr/share/perl5/Debian/Debhelper/Dh_Lib.pm line 410.) . ignored
    • there are lots of warnings related to fix-shebang (E: dh_python3 tools:93: fix_shebang (debian/lxc1/usr/bin/lxc-cgroup): cannot parse binary file) - ignored

Error related to bash completion

...
# move the bash completion profile
mkdir -p debian/tmp/usr/share/bash-completion
mv debian/tmp/etc/bash_completion.d debian/tmp/usr/share/bash-completion/completions
mv: Aufruf von stat für »debian/tmp/etc/bash_completion.d“ nicht möglich: Datei oder Verzeichnis nicht gefunden
make[1]: *** [override_dh_install] Fehler 1
make[1]: Verzeichnis »/home/ubuntu/build/lxc/lxc-2.1.0« wird verlassen
make: *** [binary] Fehler 2
dpkg-buildpackage: Fehler: Fehler-Exitstatus von fakeroot debian/rules binary war 2

Work around: Place a hash before the cp command. I don’t care about command completion.

Installing the deb packages

I used to use lxc-2.0.8. Upgrading to the previously built packages works without any issue.
Rebooting now…

Using the new packages

Warning: The configuration file contains legacy configuration keys.

Running lxc-ls --fancy shows warnings like these:

The configuration file contains legacy configuration keys.
Please update your configuration file!
lxc-ls: confile.c: parse_line: 1982 Unknown configuration key "lxc.pivotdir"
lxc-ls: parse.c: lxc_file_for_each_line: 58 Failed to parse config: lxc.pivotdir = lxc_putold

A lot of LXC containers are missing from the list, maybe this is related to the warning?

grep -l pivotdir */config … shows lots of containers, none of which shows up on lxc-ls

According to this discussion, the pivotdir isn’t needed any more. So I removed the entry, now the container shows up on lxc-ls. Starting the container still produces a warning:

uli@ulinuc:~$ sudo lxc-start -d -n ubuntu1404-64-build
The configuration file contains legacy configuration keys.
Please update your configuration file!

The container seems to work nevertheless… lxc-stop -n ubuntu1404-64-build hangs forever.

Upgrading the config file using lxc-update-config -c .../config works. I don’t see any warning any more. lxc-stop still hangs forever, I have to use lxc-stop -k ...

lxc-update-config doesn’t fix all config files - lxc.net.0.ipv4

I applied lxc-update-config to all my config files: ls */config|xargs -n1 lxc-update-config -c.
Now most of the warnings are gone. Unfortunately, new warnings show up:

uli@ulinuc:~$ sudo lxc-ls --fancy
lxc-ls: parse.c: lxc_file_for_each_line: 58 Failed to parse config: lxc.net.0.ipv4 = 10.0.3.100/24
lxc-ls: parse.c: lxc_file_for_each_line: 58 Failed to parse config: lxc.net.0.ipv4 = 10.0.3.7/24
The configuration file contains legacy configuration keys.
Please update your configuration file!
The configuration file contains legacy configuration keys.
Please update your configuration file!
NAME                STATE   AUTOSTART GROUPS IPV4 IPV6 
apache-worker       STOPPED 0         -      -    -    
host-only           STOPPED 0         -      -    -    
...

The warnings related to parse.c are easy to fix by modifying the config files:

  • wrong: lxc.net.0.ipv4 = 10.0.3.100/24
  • ok: lxc.net.0.ipv4.address = 10.0.3.100/24

Remaining legacy configuration keys

lxc-ls --fancy still gives me the warning about legacy configuration keys. Checking this with lxc-info shows four lxc containers. They are the most recent ones I created with lxc-2.0.8.

This line produce the warnings:

lxc.rootfs.backend = btrfs

I prepended it with a hash and the warnings disappeared.

Final words

The new version works pretty OK. I think I’ll switch to the released version now and do some tests based on this.

Note that you can also grab automatically built packages from
https://launchpad.net/~ubuntu-lxc/+archive/ubuntu/lxc-git-master/+packages

Hi Stephane,

thanks for pointing me on this. I fact, I do use these as basis for “my” packages. I don’t like to import lots of apt keys into my system, that’s why I’m repackaging. Maybe it is enough to sign the prebuilt packages with my key, but I like to be able to build them from source…

2.0.8+master means current master (or master 15 hours ago which is probably current enough). Maybe I’ll test these…

Best regards and thanks a lot for LXC and LXD, I really like both of them - Uli

Hi,

I can’t figure out which legacy options are still on…I updated all configs using lxc-update-config but I still get:

The configuration file contains legacy configuration keys.
Please update your configuration file!

for each container.
lxc-info -n $container doesn’t pinpoint the problem.
Starting container with --logfile didn’t help either (probably because I don’t know what to look for :smiley: )

Any tips?

There’s at least one bug in lxc-update-config that may be causing this.

So if you have a lxc.rootfs.backend line in your container config, remove it, that should fix the issue.

1 Like