Is it safe to use lvextend to increase size of my lvm thin storage pool?

Hello,

With SNAP, LXD version 4.0.3 and lvm storage backend, thin pool, I would like to increase the size of the thin pool. Is it safe to use the normal “lvextend” command?

I just read the discussion here and this has me worried:

In other words, the only way LVM can at present be safely used with (snapped) LXD is if LVM is only used for LXD and nothing else on the host. Perhaps I am slow in this regard, but I would suggest that is a limitation unlikely to occur to many server admins unless it’s quite explicitly pointed out.

If a hypothetical server admin has a VG dedicated to (snapped) LXD which (I believe?) doesn’t currently raise any kind of warning during LXD setup, and that admin later decides to perform some maintenance on that VG (adding some more storage perhaps), are the potential consequences not sufficiently severe to warrant some sort of warning?

https://github.com/lxc/lxd-pkg-snap/issues/41#issuecomment-656646212

We have since introduced an option to use the host’s LVM tools.
So you may want to do snap set lxd lvm.external=true followed by a reboot of the system (to ensure no wonky LVM state), then after reboot, make sure your containers start as usual.

If that all looks good, you’ll be using your host’s LVM tools and configs, then there is nothing to worry about with running the tools from there.

3 Likes

Hello,

Thank you very much for a fast reply and the good news as well as the solution.
Very much appreciated.
Huge sigh of relief here :smiley:

@stgraber After lvm.external=true is performed, should we remove the the following container config? The following was added to resize LVM thin partition after default container creation. Should we now remove this container config now that lxd is no longer handling LVM/sizing operations?

devices:
  root:
    path: /
    pool: default
    size: 100GB
    type: disk
1 Like

LXD will still handle sizing operations, it’s just that it now uses the host LVM binaries and config instead of those bundled in the snap.

All LVM features that LXD uses should still work the way they normally do, but now also respecting the host LVM config and using the host LVM cache.

1 Like