Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1027321: lxd init run as non-root fails to find LVM thin provisioning tools

117 views
Skip to first unread message

Michael reports bugs

unread,
Dec 30, 2022, 6:10:03 AM12/30/22
to
Package: lxd
Version: 5.0.1-3+b1
Severity: normal

Fresh bookworm system. Running `lxd init` as myself (after adding myself to
lxd group of course):

michael@grook:~$ lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]:
Name of the storage backend to use (zfs, dir, lvm) [default=zfs]: lvm
Create a new LVM pool? (yes/no) [default=yes]: n
Name of the existing LVM pool or dataset: lxd

The LVM thin provisioning tools couldn't be found. LVM can still be used
without thin provisioning but this will disable over-provisioning,
increase the space requirements and creation time of images, containers
and snapshots.

If you wish to use thin provisioning, abort now, install the tools from
your Linux distribution and run "lxd init" again afterwards.

Do you want to continue without thin provisioning? (yes/no) [default=yes]: no
Error: The LVM thin provisioning tools couldn't be found on the system

But I do have thin-provisioning-tools installed:

michael@grook:~$ dpkg -l thin-provisioning-tools
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=======================-============-============-=============================================================
ii thin-provisioning-tools 0.9.0-2 amd64 Tools for handling thinly provisioned device-mapper meta-data

I'm hoping this is not a case of "well don't do that then", though I feel
that it should either succeed, or lxd should complain "you should run me as
root".

-- System Information:
Debian Release: bookworm/sid
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'oldstable-updates'), (500, 'oldstable-debug'), (500, 'testing'), (500, 'stable'), (500, 'oldstable'), (400, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.0.0-6-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE=en_AU:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages lxd depends on:
ii adduser 3.129
ii attr 1:2.5.1-3
ii ca-certificates 20211016
ii init-system-helpers 1.65.2
ii libacl1 2.3.1-2
ii libc6 2.36-6
ii libcap2 1:2.66-3
ii libdqlite0 1.11.1-1
ii libgcc-s1 12.2.0-10
ii liblxc-common 1:5.0.1-2
ii liblxc1 1:5.0.1-2
ii libsqlite3-0 3.40.0-2
ii libudev1 252.4-1
ii lxcfs 5.0.2-1+b1
ii lxd-client 5.0.1-3+b1
ii rsync 3.2.7-1
ii squashfs-tools 1:4.5.1-1
ii uidmap 1:4.13+dfsg1-1
ii xz-utils 5.4.0-0.1

Versions of packages lxd recommends:
ii apparmor 3.0.8-1
pn dnsmasq <none>
ii lxd-agent 5.0.1-3+b1

Versions of packages lxd suggests:
pn btrfs-progs <none>
pn ceph-common <none>
ii gdisk 1.0.9-2.1
ii lvm2 2.03.16-2
ii lxd-tools 5.0.1-3+b1
pn tomoyo-tools <none>
ii zfsutils-linux 2.1.7-1

-- no debconf information

Mathias Gibbens

unread,
Dec 31, 2022, 6:20:04 PM12/31/22
to
Hi,

I think the root of this problem is the difference in $PATH between
root and a normal user -- root includes /usr/sbin/, which is where the
`thin_check` binary is installed. LXD attempts to find it in the
current $PATH when deciding whether or not to enable LVM thin
provisioning [1].

If you include /usr/sbin/ in your $PATH, can you successfully run
`lxd init`?

> $ PATH=$PATH:/usr/sbin lxd init

I don't have LVM setup on my test machine at the moment, but the LXD
init process appeared was successful (except for actually creating the
storage pool in LVM) when I replicated this bug.

I suspect this will have to be forwarded upstream, but would
appreciate hearing from you if this fixes the problem you've
experienced.

Mathias

[1] -- https://github.com/lxc/lxd/blob/master/lxd/main_init_interactive.go#L913
signature.asc

Mathias Gibbens

unread,
Feb 26, 2023, 12:40:04 PM2/26/23
to
signature.asc
0 new messages