Recently I was running out of disk space on one of my NextCloud installations and I needed to increase the disk space. As I was not familiar with the partition commands I pinged my friend stsimb. Thanks!!!
I have tested this procedure on Hyper V and on ESXi but I guess it will work also on other Hypervisors.
First, shutdown the VM and increase/expand the disk size to the desired value.
Start up the VM and SSH to it. Of course we need root access
Then let’s make sure we can see the increased size of the sda
The lvm is under sda3 so in order to increase the size of sda3 and resize the volume
growpart /dev/sda 3
And increase the capacity of the lvm
lvextend --extents +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv -r
and you are done