3

check using volume from list

openstack volume list

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]

status become in-use, size become 40. It's attached to /dev/vda.

However, login into the vm, use df -h check, didn't find /dev/vda.

Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        20G  1.8G   19G   9% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           1.9G   17M  1.9G   1% /run
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           379M     0  379M   0% /run/user/1000

Why it doesn't change?

rawmain
  • 291
  • 1
  • 7
  • 17

3 Answers3

2

Openstack just increases the physical disk size. You will need to use the operating system utilities to increase the disk space allocated to / for example.

skyman
  • 156
  • 4
2

I had a similar issue, and it was not clear for me how to resize the partition if you use an openstack volume. This did it for me:

Start with unmounting sudo umount /dev/sdb

Then make the system aware of the new size:

sudo e2fsck -f /dev/sdb

After that you can resize the volume

sudo resize2fs /dev/sdb

Finally mount the volume and check if the new filesize is set

sudo mount /dev/sdb /mount_point
df -h
Arie
  • 21
  • 2
  • Note that you should first use `cfdisk /dev/sdb` and resize the partition before you can resize the filesystem using `e2fsck -f /dev/sdb && resize2fs /dev/sdb` – Daan Bakker Nov 15 '21 at 00:33
2

I had exactly same issue. Than i found the solution, here's mine :

After you finally resize the Volume from Ceph (Like the question above)

Login to your VM

## Grow part (i.e resize root partition)
sudo growpart /dev/vda 1

## Check if already extend
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

I wrote my prod case in here, https://nicolas.my.id/resize-root-volume-openstack-without-downtime/

  • Hi Nicolas - can you clarify how your answer builds on the others and is different from them? Thanks! – shearn89 Dec 17 '21 at 10:12
  • My answer is no different I'm just wrapping up everything from the first answer and another reference. Also, I didn't see any mention `growpart` command which is the key for this resize action. – Nicolas Julian Dec 17 '21 at 16:07