Merge ~andersson123/autopkgtest-cloud:lxd-security-nesting-true into autopkgtest-cloud:master

Proposed by Tim Andersson
Status: Merged
Merged at revision: 7e2db60fdb52a81febf88f462383f557abe5b7dd
Proposed branch: ~andersson123/autopkgtest-cloud:lxd-security-nesting-true
Merge into: autopkgtest-cloud:master
Diff against target: 12 lines (+1/-0)
1 file modified
charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/armhf-lxd.userdata (+1/-0)
Reviewer Review Type Date Requested Status
Skia Approve
Review via email: mp+467776@code.launchpad.net

Commit message

fix: lxd-worker: add security.nesting=true to lxd config

There's a version of systemd in oracular-proposed which is purported to
break armhf tests (for oracular) once it migrates to the release pocket.

TLDR; Any systemd units with credentials on unprivileged containers will
fail on oracular tests with the new version of systemd in proposed.

This would cause systemd-tmpfiles-setup.service to be broken on the lxd
containers, which is a service which creates /var/run/utmp, which is how
runlevel is stored. runlevel is checked in lib/VirtSubProc.py [1] in the
wait_booted function. So, subsequently, wait_booted would eventually
timeout, as systemd-tmpfiles-setup.service would never store runlevel
appropriately on the testbed.

The workaround was discussed [2] between the systemd maintainer (enr0n)
and the lxd team, and the solution was to enable security.nesting for
the lxd containers running our armhf tests.

security.nesting simply allows for nested containerisation. [3]

To summarise, we would be hitting [4] because of [5].

[1] https://salsa.debian.org/ubuntu-ci-team/autopkgtest/-/blob/master/lib/VirtSubproc.py?ref_type=heads#L454
[2] https://github.com/canonical/lxd/issues/13631
[3] https://discuss.linuxcontainers.org/t/what-does-security-nesting-true/7156/4
[4] https://bugs.launchpad.net/ubuntu/+source/autopkgtest/+bug/1998943
[5] https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2046486

Description of the change

This is a change requested by enr0n (the systemd maintainer). The new version of systemd in oracular-proposed will break all oracular armhf tests. It's currently block-proposed, so it won't migrate, but it's waiting on us adding this change to our lxd containers to migrate.

To post a comment you must log in.
Revision history for this message
Tim Andersson (andersson123) wrote :

How do we know that this indeed will enable security.nesting?

I need to find a link that states that this is the correct section for this - or at least something close
also come up with a way to deploy this live/next steps

Revision history for this message
Skia (hyask) wrote :

Fair enough, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/armhf-lxd.userdata b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/armhf-lxd.userdata
2index 9141db5..e413ac7 100644
3--- a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/armhf-lxd.userdata
4+++ b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/armhf-lxd.userdata
5@@ -58,6 +58,7 @@ write_files:
6 config:
7 core.https_address: '[::]:8443'
8 core.trust_password: autopkgtest
9+ security.nesting: "true"
10 networks:
11 - config:
12 bridge.mtu: "1458"

Subscribers

People subscribed via source and target branches