Problem with an enlarged virtual disk

sacarias

Active Member
Oct 2, 2019
64
1
26
I enlarged an old Centos 7 guest's virtual disk with file system XFS, by first enlarging disk in Proxmox host (web interface or qm command), then enlarging partition from within VM with "growpart" and "xfs_growfs" commands.

Problem is, I made a mistake...
The Proxmox host physical disk is 1 Tb; Centos 7 VM was originally 300 Gb size and wanted to enlarge it to use all rest of available physical space. But though I did specify the correct values when enlarging the VM's file system, in Proxmox host I enlarged the "disk" to 1.3 Tb total...
I really expected to get an error, but didn't. And then I read on Proxmox host shrinking back is not supported at all...

Since I specified correct values in VM's partition, it should perhaps work well for now, but what if I add more VM guests in the future?
Is there a way to fix this mistake?

Thanks again.
 
hi,

Is there a way to fix this mistake?
do you have a backup or snapshot of the VM? if yes you can restore that and have the old disk size.

And then I read on Proxmox host shrinking back is not supported at all...
yes because we can't always know about the partition table inside the disk, shrinking it can break things

But though I did specify the correct values when enlarging the VM's file system, in Proxmox host I enlarged the "disk" to 1.3 Tb total...
the value you give when growing the disk is the amount by which it will grow, i guess that's why you got 1.3T

if no backups/snapshots:
you could try creating a new disk with the size you want, and then use rsync to move the files over from one disk to the other.
 
As mentioned, new size in guest's file system is right.

But, what consequences will it have to have a virtual disk in Proxmox host interface larger than host disk's physical size?
 
But, what consequences will it have to have a virtual disk in Proxmox host interface larger than host disk's physical size?
where's the VM disk stored? if it's on a storage with thin provisioning (e.g. LVM-thin or ZFS) then you can overprovision your disk, and only the used bits will be allocated on the real device.

one drawback would be if you actually use up all the physical space but still have space inside your VM disk. then the VM might stop or the host might start misbehaving (since there's no space left).
 
where's the VM disk stored? if it's on a storage with thin provisioning (e.g. LVM-thin or ZFS) then you can overprovision your disk, and only the used bits will be allocated on the real device.

one drawback would be if you actually use up all the physical space but still have space inside your VM disk. then the VM might stop or the host might start misbehaving (since there's no space left).
Just attempting again in case I wasn't able to explain myself.

In Proxmox host web interface, I erroneously set the VM's disk to 1.3 Tb in the VM's hardware options in web interface. Physical disk in bare metal server is just 1 Tb.

The VM is stored in Proxmox's default local storage, I think it's lvm-thin.

What do you mean with "overprovisioning" it?
 
Just attempting again in case I wasn't able to explain myself.
you've explained yourself fine :)

In Proxmox host web interface, I erroneously set the VM's disk to 1.3 Tb in the VM's hardware options in web interface. Physical disk in bare metal server is just 1 Tb.

The VM is stored in Proxmox's default local storage, I think it's lvm-thin.
in that case, your disk is thin provisioned. if that doesn't ring any bell for you, take a look here [0]

What do you mean with "overprovisioning" it?
it just means allocating more resources than you physically have.

that can be okay. for example one use case would be if you have limited disks at the moment. then you could overprovision your VM disks (but be careful to not actually fill up your whole physical disk). later on you could add another disk to your lvm thinpool, thus increasing your total capacity when you need.

i hope it's clear enough :)

[0]: https://pve.proxmox.com/wiki/Storage#_thin_provisioning
 

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!