How does LXC interact with e.g. lvm?

Following on from the discussion in Resize LXD container

How does lxc interact with storage volumes? Is it linked against some OS libraries that expose LVM functionality? Is it statically linked against something that was present on the build-box? Does it do system-calls under the hood?

A quick search on the projects github page didn’t come up with any hit for lvm.

And while the search on the github page didn’t turn out to be useful, downloading lxd-lxd-3.0.2.tar.gz and grepping did :slight_smile:

Apologies for the noise, it utilises the lvm executable (and its varied symlinks) in the system path.

Yes, and the LVM tools are bundled inside the snap package rather than using the ones installed on the host.

However you can use sudo snap set lxd lvm.external=true and sudo systemctl reload snap.lxd.daemon to get LXD to use the host’s LVM tools (and config files).

The LVM storage driver code is here for future reference:

Also, ideally you should be using lxd-4.0.x.tar.gz as LXD 3.0.x is getting quite old now.

Thanks for all the input, @tomp , I hear what you’re saying, we’re currently looking at our options.

We’re not too keen on the whole snaps idea, but also reluctant to become a “package maintainer” and build LXD in house to go w/ the current release of Ubuntu. So we’re weighing up alternative approaches atm, e.g. abandon Ubuntu for Debian … but making an informed decision on the benefits vs risks will take a while and probably won’t happen this side of Christmas.

You may have already seen it, but there is some additional info on managing the LXD snap here which may help: