[SOLVED] Online vm disk resizing not possible

VoRoN

New Member
Oct 4, 2022
4
1
3
Hi all,

I came across the situation that VM disk resizing on the fly on Proxmox is not working.

Bash:
# pveversion
pve-manager/7.2-11/b76d3178 (running kernel: 5.15.53-1-pve)


1.) Proxmox is running on ZFS.
2.) VM disks are created as zfs volume.

As soon i increase either via GUI or via qm command the new size of the disk, it will be not recognized inside the vm.

For example, vm disk size is 18G and if i increase the disk size by +2G, i can see the correct size on the proxmox.

Bash:
# zfs get volsize rpool/data/vm-102-disk-0
NAME                      PROPERTY  VALUE    SOURCE
rpool/data/vm-102-disk-0  volsize   20G      local

But when i check the size on vm itself with fdisk, the new size is not applied, which i could then expand.

Bash:
# fdisk -l /dev/sda
Disk /dev/sda: 18 GiB, 19327352832 bytes, 37748736 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6c9d0a72

Device     Boot Start      End  Sectors Size Id Type
/dev/sda1  *     2048 20971519 20969472  10G 83 Linux

Could that be, that i need to activate something on zfs level on proxmox?

Thanks

PS: on PVE with ext4 fs online resizing works fine
 
Last edited:
That's odd - since it works here ... (and since it only seems not to work for ZFS on your system)

* check inside the guest if the disk-size change is detected (`dmesg` output)
* how are the vm-disks connected? (`qm config <vmid>`)

I hope this helps!
 
The partition table inside the VM is not updated automatically. You need to do that yourself by booting GParted Live or tools that come with the operating system inside the VM (like gdisk or gparted on Linux). An ext4 filesystem can be extended on-line using resize2fs.
 
That's odd - since it works here ... (and since it only seems not to work for ZFS on your system)

* check inside the guest if the disk-size change is detected (`dmesg` output)
* how are the vm-disks connected? (`qm config <vmid>`)

I hope this helps!


Yes, it seems odd also for me. Like i already said, vm is not recognizing the new size of the disk.
Logs on the vm showing nothing about disk changes...

Only after i power off and power on the vm, i see the changes.... and can expand it via fdisk and resize2fs. But the goal is to change it on the fly... like we can do it with PVE on top of ext4 fs

The partition table inside the VM is not updated automatically. You need to do that yourself by booting GParted Live or tools that come with the operating system inside the VM (like gdisk or gparted on Linux). An ext4 filesystem can be extended on-line using resize2fs.


Yes, i am aware of it, I mentioned that already. After successful change, you should see with fdisk the new size of disk

Bash:
# fdisk -l /dev/sda
Disk /dev/sda: 18 GiB, 19327352832 bytes, 37748736 sectors


PS: VM itself has ext4 as filesystem


* how are the vm-disks connected? (`qm config <vmid>`)

YAML:
agent: 1
boot: c
bootdisk: virtio0
cores: 1
memory: 2048
meta: creation-qemu=6.2.0,ctime=1659639769
name: test01.local.int
net0: virtio=XX:XX:XX:XX:XX:XX,bridge=vmbr212
protection: 0
sata0: local-zfs:vm-102-disk-0,size=20G
scsihw: virtio-scsi-single
smbios1: uuid=13c759c4-9b44-4938-80ad-79a61a45a55f
sockets: 1
vmgenid: 91f61ec3-2e1b-4ecd-8b4b-da65b5faca07
 
Last edited:
If possible - please use code-tags for the config files - makes reading them a bit easier (if it's more text)

on a hunch - could you try connecting the disk as scsi instead of sata?
(have not tried running with sata disks for quite a long while - since scsi is the by far recommended transport for everything that somehow supports it)
 
  • Like
Reactions: VoRoN
If possible - please use code-tags for the config files - makes reading them a bit easier (if it's more text)

on a hunch - could you try connecting the disk as scsi instead of sata?
(have not tried running with sata disks for quite a long while - since scsi is the by far recommended transport for everything that somehow supports it)
Ack, sry about code tags!

Indeed, scsi works.....

Resolution: re-attach disk as scsi controller

Thank you!

You can close it
 
If you already updated the partition table, try running partprobe inside the VM (or restating the VM) to make the change visible to Linux inside the VM.

EDIT: It was probabl;y the restart, not changing the controller that fixed the issue.
You cannot close it, but you can mark the issue as SOLVED by editing your first post in this thread.
 
Last edited:
If you already updated the partition table, try running partprobe inside the VM (or restating the VM) to make the change visible to Linux inside the VM.

EDIT: It was probabl;y the restart, not changing the controller that fixed the issue.
You cannot close it, but you can mark the issue as SOLVED by editing your first post in this thread.

Nope, after i changed the controller and try to resize the disk, it was also recognized by vm, without stopping and starting the vm. So the solution was correct, change the disk controller, to be able to change the disk size on the fly.

1.) Stop vm
2.) change controller
3.) start vm and check the disk size
4.) increase vm disk size on proxmox
5.) check if it was applied in vm without restarting it
6.) Approved, that without restart the disk size was applied.

Cheers
 
Last edited:
  • Like
Reactions: Stoiko Ivanov
I know it's an old thread, but I have same /equal problem with V 8.1
VMs ar on ZFS Storage, VM filesystem is ext4, hd controller is SCSI
First I expanded a Debian 11 by 100Gb, not recognized by Linux, even not after reboot.
tried parted, geprated (sees the free space but does let me resize sda1), etc.
tried nearly everthing from here https://pve.proxmox.com/wiki/Resize_disks no change,
as it is a production VM, I have a snapshot, I install a SUSE SLES 15 SP4 (had it by hand) ext4 too
added to 2Gb to the existing 32Gb, same thing the base disk is expanded if I look in the storage, but no change to to give this space to the VM itself

above solution do no work

Thanks for any help
 

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!