rook: How can I resize pv created by "ceph.rook.io/block"
How can I resize a pv with preserving data. PV is created dynamically through storageclass.
provisioner: ceph.rook.io/block
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (5 by maintainers)
Login to rook toolbox pod, run
rbd resize <pv_id> --size=<size, f.e. 1T>Then either go to a node where this PV is mapped to, if it’s being used, orrbd map <pv> && mount /dev/... /mntin toolbox pod Thenxfs_growfs mount_pointUnmount, unmap if that was in toolbox. For running pods no need to stop pod - can be done on active oneNow sure how to do for ext4, I’ve done it for XFS only
I tried to resize (extend size, havn’t tried to shrink the image) ext4 format. Here the steps that work for me:
stop the pods which are currently using the volume
get the rbd image name
Hi, here is a list of commands executed in the toolbox pod for xfs:
which seem to work (xfs_growfs stated: blocks changed from 2621440 to 52428800). A status gives me this:
However my pod still thinks it is out of disk. What am I missing?
EDIT I had to go to the node the pod was on. I ran:
bash cat /etc/mtaband found my volume:bash /dev/rbd0 /var/lib/kubelet/plugins/ceph.rook.io/rook-ceph-system/mounts/pvc-0785a7e1-731b-11e9-aa6e-0050568292c7 xfs rw,seclabel,relatime,attr2,inode64,sunit=8192,swidth=8192,noquota 0 0.I then ran
bash xfs_growfs /var/lib/kubelet/plugins/ceph.rook.io/rook-ceph-system/mounts/pvc-0785a7e1-731b-11e9-aa6e-0050568292c7and the pod started again.regards
Other simply method (with ext4) :
If you add the package “resize2fs” on your app container, you can just run on it “resize2fs /dev/rbd[number]” after resize the image on Ceph admin for avoid service downtime.
Is there any tutorial/documentation how to get this working?
Yup, that’s fine. It doesn’t matter much after it’s been allocated.