First time here? Check out the FAQ!
![]() | 1 | initial version |
OK. I figured it out in Sept 2015 but forgot to add the solution here... Today we had to do it again and with the help of the Canonical support my memory was jogged. Here's the solution to resizing VMs running under Virsh using LVM's on the Hypervisor..
TO DO : Increase Controller from 10Gb to 20Gb
=====================
virsh shutdown controller
sudo virt-filesystems --long --parts --blkdevs -h -a /dev/system/controller
sudo lvrename /dev/system/controller /dev/system/controller.backup
sudo lvcreate system -n controller -L 20GB
sudo virt-resize /dev/system/controller.backup /dev/system/controller --expand /dev/vda1
Then after that
virsh start controller
@hypervisor: ssh maas
from maas
ssh controller
df -h to make sure the controller VM (or whichever VM you were increasing it's size did get it's Filesystem resized)
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 20G 8.5G 11G 46% /
Then when you are happy your Openstack is working again Remove the Temporary backups of the FileSystems you made
sudo lvremove /dev/system/controller.backup
![]() | 2 | No.2 Revision |
OK. I figured it out in Sept 2015 but forgot to add the solution here... Today we had to do it again and with the help of the Canonical support my memory was jogged. Here's the solution to resizing VMs running under Virsh using LVM's on the Hypervisor..
Firstly increase the Logical Volume: (in this case we are trying to resize the controller VM
sudo lvextend --size +10G /dev/system/controller
After it has resized the LVM to make space for a larger VM disk, we need to use "virt-" commands to rename the current disk to .backup, make new vm disks, and basically copy and expand the data from the old disks onto the new disks.
You can do a
man virt-resize
before you begin.
TO DO : Increase Controller from 10Gb to 20Gb
=====================
virsh shutdown controller
sudo virt-filesystems --long --parts --blkdevs -h -a /dev/system/controller
sudo lvrename /dev/system/controller /dev/system/controller.backup
sudo lvcreate system -n controller -L 20GB
sudo virt-resize /dev/system/controller.backup /dev/system/controller --expand /dev/vda1
Then after that
virsh start controller
@hypervisor: ssh maas
from maas
ssh controller
df -h to make sure the controller VM (or whichever VM you were increasing it's size did get it's Filesystem resized)
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 20G 8.5G 11G 46% /
Then when you are happy your Openstack is working again Remove the Temporary backups of the FileSystems you made
sudo lvremove /dev/system/controller.backup