Replace storage pool

I’m running LXC/LXD version 2.0.11 and I’ve got a ZFS storage pool that looks like this:

pool                                         alloc   free   read  write   read  write
-------------------------------------------  -----  -----  -----  -----  -----  -----
lxd                                          80.2G  38.8G     22     45  1.53M   329K
  /var/lib/lxd/zfs.img                       54.9G  4.63G     17     23  1.04M  81.4K
  /var/lib/lxd/zfs2.img                      25.4G  34.1G      4     21   494K   248K

And I want to replace those imgs with a (larger) disk.

According to this I cannot replace the two disks with one without creating a new pool and move all data to it.

How would I make LXC/LXD use this new pool?

you could :

  • stop all containers & lxd
  • create the new (bigger) pool
  • transfer all the data to the new pool;
  • rename the old pool ;
  • rename the new pool to match the old poolname used by LXD
  • start lxd & containers

didn’t test this though

1 Like