Help resizing bootstack VM kvm which is 100% full
Hi
Background:
I have inherrited sole ownership of an 14 node openstack which was setup via Canonical "jumpstart" which was working fine for the mostpart but is now broken completely..
cant juju or anything
Error / warning:
@maas:~$ juju status
WARNING ignoring invalid API endpoint environment UUID
but can luckily still ssh to VMs from maas, and ssh to other VMs that are part of the infrastructure from there.
Problem:
bootstack vm on the main hypervisor is at 100% disk usage.
@bootstrap:/home$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 9.8G 9.8G 0 100% /
What I've done: ps –faux | grep bootstrap -> shows the drive file is under /dev/mapper/system-bootstrap
and
@hypervisor:~$ ls -ahlti /dev/mapper
total 0
1440 lrwxrwxrwx 1 root root 8 Sep 22 15:50 system-bootstrap -> ../dm-11
I've done a extention of the lvm
@hypervisor:
sudo lvextend --size +10G /dev/system/bootstrap
Extending logical volume bootstrap to 20.00 GiB
Logical volume bootstrap successfully resized
but I'm not very use to openstack style virtualization (mostly work with VSphere )
PS: We're getting a Canonical support contract in place but that might take ages and researchers want the data out of some VMs which were happily working even though the dashboard was inaccessible.
Confusion:
I know that after resizing the LVM partitions would then usually need to be resized but super confused with the way this was setup...
hypervisor:~$ ls -ahlti /dev/mapper | grep bootstrap
1440 lrwxrwxrwx 1 root root 8 Sep 22 15:50 system-bootstrap -> ../dm-11
@hypervisor:~$ ls -ahlti /dev/ | grep dm-11
9267 brw-rw---- 1 libvirt-qemu kvm 252, 11 Sep 22 17:13 dm-11
Question:
Can I just do a
virsh shutdown bootstrap
and then resize using qemu-img ?
http://serverfault.com/questions/324281/how-do-you-increase-a-kvm-guests-disk-space
1. stop the VM
2. run qemu-img resize vmdisk.img +10G to increase image size by 10Gb
3. start the VM, resize the partitions and LVM structure within it normally
Help *sigh
qemu-img won't work on a device file. It only works on disk files of type qcow2 and similar. If there is a filesystem on /dev/dm-11, you need to increase it as well. If it's ext[234], use
resize2fs
, or if XFS,xfs_growfs
.After that, I guess the VM must be told that the disk size has changed. If it's a SCSI disk, it would be
echo > /sys/block/sda/device/rescan
. You seem to have virtio though, and I don't know what to do there. Based on http://linux-kvm.com/content/how-resi..., reboot the VM.Note I know nothing about Juju and Jumpstart and how it's implemented
Thanks Bernd. Yeah openstack is a beast (powerful but a beast)
I've tried resizefs inside the bootstrap VM and no luck.
I've also tried growing the filesystem from the Hypervisor: @hypervisor:~$ sudo resize2fs /dev/system/bootstrap resize2fs 1.42.9 (4-Feb-2014) resize2fs: Bad magic number in super-block while trying to open /dev/system/bootstrap Couldn't find valid filesystem superblock.