Resize Root Volume in Openstack Without Downtime

December 11, 2021

Resize Root Volume in Openstack Without Downtime

Terkadang kita perlu scale up volume pada partisi root (biasanya /dev/sda), yang menjadi masalah adalah volume tersebut tidak bisa di-deatach. Lalu bagaimana cara me-resize-nya ? berikut hal yang dapat dilakukan dengan syarat dan ketentuan yang berlaku..


Syarat dan Ketentuan

Pastikan VM tidak menggunakan Ephemeral storage, dalam kasus ini Saya menggunakan Backend Storage CEPH.

Resize From Openstack Side

## set status to available to a volume
openstack volume set --state available {volume id}

## resize the volume
openstack volume set --size 40 {volume id}

## check size and status again
openstack volume show {volume id}

## set status to in-use again
openstack volume set --state in-use {volume id}

Resize from Inside VM Side

## Grow part (Contoh akan resize root partisi)
sudo growpart /dev/vda 1

## Check apakah volume sudah grow sesuai size baru
lsblk

## Resize ‘/’ partition to fill all space
sudo resize2fs /dev/vda1

## (option) If your filesystem is XFS, it can be grown while mounted using the xfs_growfs command:

sudo xfs_growfs /

## Verify
sudo df -H

Reference

  • How To resize an ext2/3/4 and XFS root partition without LVM | ComputingForGeeks

https://computingforgeeks.com/resize-ext-and-xfs-root-partition-without-lvm/

  • How to resize a volume in an instance on OpenStack? - Server Fault

https://serverfault.com/questions/1006906/how-to-resize-a-volume-in-an-instance-on-openstack

  • Extend a Linux file system after resizing a volume - Amazon Elastic Compute Cloud

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html


Profile picture

Written by Nicolas Julian Seseorang yang mencoba berkarya. Chit Chat with me in Twitter