Resize LVM storage disk without stop VMs

Informatique BDA

Active Member
Feb 9, 2016
6
0
41
41
Hello,

I use Proxmox VE 4.0.
My virtual machines are stored in a directory of local LVM partition ( "vm0" ) with a size of 100G .
LVM " vm0 " is in a volume group "vg-raid" of 400G.
My volume group has 300G of unallocated space.
But I extend this storage "vm0" for new virtual machines.
I wish to add 100G "vm0" without stopping virtual machines.

Did I increase the size of the VM without stopping the VM with the command and "lvresize" "resizefs" ?

example command in SSH (su root) : lvresize -L+100G --resizefs /dev/vg-raid/vm0
 
Generally you only need to resize the volume group and can use the GUI or qm/pct CLI to resize the VM and container disks.
This is the preferred way especially for running VMs because
a) with LXC the resizefs option in lvresize will run into the MMP-protection and then error after a while
b) with KVM you only resize the storage but QEMU also needs to know this happened, so you'd have to manually send a monitor command to propagate the change through qemu to the guest OS and so on. (If you use the tools provided by PVE this part is automated)
 
I don't resize a VM but I want resize the LVM "vm0" where are stored the VMs in PVE.

how do I proceed ?

Thanks you

Cluster : Yes but any node except this proxmox
vm0 : images disk local directory (/dev/vg-raid/vm0, ext4)
 
Ah so you have a directory storage on that LV, with the LV not managed by proxmox. Then yes the usual lvresize+resizefs should work.
 
so I can use the command on SSH su "lvresize -l 100G --resizefs /dev/vg-raid/vm0" knowing that the LVM is online and stored the images disk VM and all VMs are started. Will be no problem for the PVE to see the new size of the LVM or would I need to restart the server and VM completely for apply this modification ?
 
It *should* work, since ext4 supports online-resizing.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!