CephNotes

Some notes about Ceph
Laurent Barbe @SIB

Ceph RBD Online Resize

Extend rbd drive with libvirt and XFS

First, resize the device on the physical host.

Get the current size :

$ qemu-img info -f rbd "rbd:rbd/myrbd"

Be careful, you must specify a bigger size, shrink a volume is destructive for the FS.

$ qemu-img resize -f rbd "rbd:rbd/myrbd" 600G

List device define for myVM :

$ virsh domblklist myVM

Resize libvirt blockdevice :

$ virsh blockresize --domain myVM --path vdb --size 600G
$ rbd info rbd/myrb

Extend xfs on guest :

$ xfs_growfs /mnt/rbd/myrbd

Extend rbd with kernel module

You need at least kernel 3.10 on ceph client to support resizing. For previous version look at https://blog.dachary.org/2013/07/30/ceph-rbd-live-resize-with-krbd/

Get current size :

$ rbd info rbd/myrbd

Just do :

$ rbd resize rbd/myrbd --size 600000
$ xfs_growfs /mnt/rbd/myrbd

Also, since cuttlefish you can't shrink a bloc device without specify additional option (–allow-shrink)

RBD RBD

Comments