In my current job, we are using Openstack to test and deploy our projects locally. Last week, I got an email from my colleague, and he told me that he cannot install any software in his Openstack’s instance.
When I checked the instance using the following command:
df -h –total
I found out that its root disk is full. That is why, he cannot install any software. After taking help from my friend GOOGLE. I found the following article (https://access.redhat.com/solutions/2151971) to resize cinder volume of an Openstack instance. I followed the following steps:
- Stop the instance (nova stop <isntance id>)
- Reset state of the volume to available (cinder reset-state –state available <cinder volume id>)
- Extend volume size (cinder extend <cinder volume id> <size in GB>)
- Change the status of volume to in-use (cinder reset-state –state in-use <cinder volume id>)
- Start the instance (nova start <isntance id>)
After doing that, I was able to see disk size has increased but Ubuntu OS was still showing full disk. Then I found one more article (https://devops.ionos.com/tutorials/increase-the-size-of-a-linux-root-partition-without-rebooting/) to extend the root disk in Ubuntu OS. I did the following steps:
- Use fdisk utility on your root disk (fdisk /dev/vda)
- Delete your primary disk by pressing “d“
- Recreate it using “n“
- First sector, choose default
- Last sector, give maximum size using “+size“
- Write the changes by pressing “w“
- Now run “df -h –total” to see the effect