I migrated my laptop to the lxd snap this morning after using the deb for many years. I previously had version 3.0.3-0ubuntu1~18.04.1 installed, and now have 3.18 from the stable channel. I ran sudo lxd.migrate
and it seems to have correctly migrated all my existing containers (they’re in a ZFS pool, so it just rewrote the mountpoint property of the datasets rather than actually moving any data around).
Most things seem to work fine, but I use ephemeral copies of containers quite heavily to run Launchpad tests, and that no longer seems to work. I have a base container with the following configuration:
$ lxc config show --expanded xenial-lptest-base
architecture: i686
config:
raw.lxc: |
lxc.idmap = u 400000 1000 1
lxc.idmap = g 400000 1000 1
user.user-data: |
#cloud-config
runcmd:
- "groupadd cjwatson --gid 400000"
- "useradd cjwatson --uid 400000 --gid cjwatson --groups adm,sudo --shell /bin/bash"
- "mkdir -p /etc/sudoers.d"
- "echo 'cjwatson ALL=(ALL) NOPASSWD:ALL' >/etc/sudoers.d/90-cloud-init-users"
- "chmod 0440 /etc/sudoers.d/90-cloud-init-users"
volatile.base_image: 658d08cdd3225fbe5586a86543db8835f068880c55a8b19b078a23c367e005ea
volatile.eth0.host_name: veth1ba64fee
volatile.eth0.hwaddr: 00:16:3e:c5:2b:d7
volatile.idmap.base: "0"
volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
volatile.last_state.power: RUNNING
volatile.virbr0.host_name: veth16c021a9
volatile.virbr0.hwaddr: 00:16:3e:f2:f9:e5
devices:
eth0:
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
home:
path: /home/cjwatson
source: /home/cjwatson
type: disk
root:
path: /
pool: lxd
type: disk
virbr0:
name: virbr0
nictype: bridged
parent: virbr0
type: nic
ephemeral: false
profiles:
- default
- cjwatson
stateful: false
description: ""
If I then run lxc copy --ephemeral xenial-lptest-base xenial-lptest-45902a9a-7cb0-4ef3-bdc8-0f6ed3e758bf
(the name is just from uuidgen
) and then lxc start xenial-lptest-45902a9a-7cb0-4ef3-bdc8-0f6ed3e758bf
, the container ostensibly starts, but then I see this in /var/snap/lxd/common/lxd/logs/lxd.log
:
t=2019-12-06T13:09:58+0000 lvl=info msg="Creating container" ephemeral=true name=xenial-lptest-45902a9a-7cb0-4ef3-bdc8-0f6ed3e758bf project=default
t=2019-12-06T13:09:58+0000 lvl=info msg="Created container" ephemeral=true name=xenial-lptest-45902a9a-7cb0-4ef3-bdc8-0f6ed3e758bf project=default
t=2019-12-06T13:11:30+0000 lvl=info msg="Starting container" action=start created=2019-12-06T13:09:58+0000 ephemeral=true name=xenial-lptest-45902a9a-7cb0-4ef3-bdc8-0f6ed3e758bf project=default stateful=false used=1970-01-01T01:00:00+0100
t=2019-12-06T13:11:46+0000 lvl=info msg="Started container" action=start created=2019-12-06T13:09:58+0000 ephemeral=true name=xenial-lptest-45902a9a-7cb0-4ef3-bdc8-0f6ed3e758bf project=default stateful=false used=1970-01-01T01:00:00+0100
t=2019-12-06T13:12:01+0000 lvl=eror msg="balance: Unable to set cpuset" err="Failed to set cgroup cpuset.cpus=\"0,1,2,3\": setting cgroup item for the container failed" name=xenial-lptest-45902a9a-7cb0-4ef3-bdc8-0f6ed3e758bf value=0,1,2,3
t=2019-12-06T13:12:01+0000 lvl=eror msg="Failed to stop device 'home': Error unmounting the device path inside container: Can't remove mount from stopped container"
t=2019-12-06T13:12:02+0000 lvl=info msg="Container initiated stop" action=stop created=2019-12-06T13:09:58+0000 ephemeral=true name=xenial-lptest-45902a9a-7cb0-4ef3-bdc8-0f6ed3e758bf project=default stateful=false used=2019-12-06T13:11:31+0000
t=2019-12-06T13:12:02+0000 lvl=info msg="Deleting container" created=2019-12-06T13:09:58+0000 ephemeral=true name=xenial-lptest-45902a9a-7cb0-4ef3-bdc8-0f6ed3e758bf project=default used=2019-12-06T13:11:31+0000
t=2019-12-06T13:12:02+0000 lvl=info msg="Deleted container" created=2019-12-06T13:09:58+0000 ephemeral=true name=xenial-lptest-45902a9a-7cb0-4ef3-bdc8-0f6ed3e758bf project=default used=2019-12-06T13:11:31+0000
Help? I don’t understand what’s going on with this cgroup complaint. I can file a bug if need be, but I’m not sure whether this is a bug rather than some kind of local configuration error.