canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.39k stars 929 forks source link

Add support for online resizing (growing) of Ceph RBD block volumes #14462

Open kadinsayani opened 1 week ago

kadinsayani commented 1 week ago

https://github.com/canonical/lxd/pull/14211 adds support for online resizing (growing) of zfs and lvm storage block volumes (root disks). An initial discovery of adding support for Ceph RBD volumes has been performed with the following findings:

  1. RBD has an exclusive lock feature and supports online resizing with RBD client kernel > 3.10.
  2. Ceph backed VM's have a read only snapshot which can't be updated when the root disk size is updated. The snapshot is used for instance creation.
  3. After an initial implementation similar to the approach for zfs volumes, we observe the following error when attempting to grow the root disk size:
    root@testbox:~# lxc config device set v1 root size=11GiB
    Error: Failed to update device "root": Could not grow underlying "ext4" filesystem for "/dev/rbd0": Failed to run: resize2fs /dev/rbd0: exit status 1 (resize2fs 1.47.0 (5-Feb-2023)
    resize2fs: Bad magic number in super-block while trying to open /dev/rbd0)

More research and exploration are necessary to assess the feasibility of incorporating this feature.

kadinsayani commented 1 week ago

@simondeziel @tomponline feel free to chime in here if I've missed anything :)

kadinsayani commented 1 week ago

For reference, we've decided to move the PR which adds support for zfs and lvm along and track this improvement separately.