Because a colleague of mine noticed that the containers on one of the build machines didn’t work any longer, I investigated.
Oddly enough I noticed how the
lxd package had disappeared. I have no recollection of having done that myself.
Either way, so I checked regarding the PPA and saw that I’m supposed to install the snap package. And so I did
snap install lxd and all seemed fine at first.
Until, of course, I found there were no containers. So I found one of the threads here in the forum and bind-mounted the old location to the new one and LXD seemed happy with that (
lxc list returned the expected list).
I couldn’t run
lxd.migrate, because if complained about the sockets being unavailable (my guess here was that normally
lxd.migrate is run when the
.deb package is still installed and two
lxd daemons are running):
=> Connecting to source server error: Unable to connect to the source LXD: Get http://unix.socket/1.0: dial unix /var/lib/lxd/unix.socket: connect: no such file or directory
But bind-mounting seems to do the job, so it’s all fine, I reckoned.
Except it wasn’t fine. For starters I can no longer start the containers that are bind-mounted into the new location. Autostart also doesn’t work, but that seems only natural given that the startup of containers fails in general.
$ lxc start sheep01 error: Failed to run: /snap/lxd/current/bin/lxd forkstart sheep01 /var/snap/lxd/common/lxd/containers /var/snap/lxd/common/lxd/logs/sheep01/lxc.conf: Try `lxc info --show-log sheep01` for more info
so looking at the output of the suggested
lxc info --show-log sheep01 I got:
$ lxc info --show-log sheep01 Name: sheep01 Remote: unix:// Architecture: x86_64 Created: 2017/10/31 14:02 UTC Status: Stopped Type: persistent Profiles: default Log: lxc sheep01 20180815095750.939 WARN lxc_conf - conf.c:lxc_map_ids:2862 - newuidmap binary is missing lxc sheep01 20180815095750.939 WARN lxc_conf - conf.c:lxc_map_ids:2868 - newgidmap binary is missing lxc sheep01 20180815095750.988 WARN lxc_conf - conf.c:lxc_map_ids:2862 - newuidmap binary is missing lxc sheep01 20180815095750.988 WARN lxc_conf - conf.c:lxc_map_ids:2868 - newgidmap binary is missing lxc sheep01 20180815095751.257 ERROR dir - storage/dir.c:dir_mount:189 - No such file or directory - Failed to mount "/var/snap/lxd/common/lxd/containers/sheep01/rootfs" on "/var/snap/lxd/common/lxc/" lxc sheep01 20180815095751.258 ERROR lxc_conf - conf.c:lxc_setup_rootfs:1370 - Failed to mount rootfs "/var/snap/lxd/common/lxd/containers/sheep01/rootfs" onto "/var/snap/lxd/common/lxc/" with options "(null)" lxc sheep01 20180815095751.258 ERROR lxc_conf - conf.c:do_rootfs_setup:3318 - Failed to setup rootfs for lxc sheep01 20180815095751.258 ERROR lxc_conf - conf.c:lxc_setup:3382 - Failed to setup rootfs lxc sheep01 20180815095751.258 ERROR lxc_start - start.c:do_start:1219 - Failed to setup container "sheep01" lxc sheep01 20180815095751.259 ERROR lxc_sync - sync.c:__sync_wait:57 - An error occurred in another process (expected sequence number 5) lxc sheep01 20180815095751.673 ERROR lxc_start - start.c:__lxc_start:1887 - Failed to spawn container "sheep01" lxc sheep01 20180815095751.673 ERROR lxc_container - lxccontainer.c:wait_on_daemonized_start:834 - Received container state "ABORTING" instead of "RUNNING" lxc sheep01 20180815095751.682 WARN lxc_conf - conf.c:lxc_map_ids:2862 - newuidmap binary is missing lxc sheep01 20180815095751.683 WARN lxc_conf - conf.c:lxc_map_ids:2868 - newgidmap binary is missing lxc 20180815095751.711 WARN lxc_commands - commands.c:lxc_cmd_rsp_recv:130 - Connection reset by peer - Failed to receive response for command "get_state"
With no idea what to make of all of that.
lxd.migrate isn’t merely a script I am unsure what other it’s doing than shoveling data from
What exactly am I doing wrong other than the fact that somehow magically the old (
.deb-based) package disappeared and left the LXD installation in a state that prevents me from using
# snap list && lsb_release -a Name Version Rev Tracking Publisher Notes core 16-2.34.3 5145 stable canonical core lxd 3.3 8011 stable canonical - No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.5 LTS Release: 16.04 Codename: xenial
By bind-mounting the
lxd folder the permissions on that folder become:
drwxr-xr-x 15 lxd nogroup 4096 2018-08-15 08:41 lxd