Moving Disk, increase Storage Usage.

camaronh

Active Member
Sep 13, 2016
4
1
41
37
Hello, I would like to comment on a case that happened to me.
In a Kvm VM, I did a resize to increase the storage space, from 250GB to 750GB.
Of the 250GB configured in the VM, only 200GB was in use (OS + Softwares).
I did the resize without problems through the graphical interface.
Then I wanted to move this VM to a 1TB Storage. At the time of the migration, task and storage show was copying 750GB of information (I only had 200GB in use) and the 1TB Storage space I have at 75% + of use.

Looking at other Hypervisors / VMs and Storages, only the% usage of the consumption in the storage of each VM counts.

Running tests, i create a 200Gb test VM with a centos and it only consumes 900mb. I made an increase of storage to 400GB and moved to another storage, and in the new storage it only consumed the fart itself of the VM (900mb) but when increasing to 700GB again, and moving again to another storage. It consumes me again and migrate 750GB of information (the new vm only has 900mb of use).

Has it happened to someone else, or a possible solution to use only the space that the VM files occupy?
 
Last edited:
What you are talking about is thin-provisioning. If you install proxmox using ZFS or "LVM thin" the default VM storage is already using thin-provisioning and only consumes the space the guest is acually using.
I would bet you installed your 1TB disk later and didn't choose a filesystem that supports thin-provisioning.
 
  • Like
Reactions: camaronh
Solved!
By doing several tests, I was able to verify that when moving a disk from one storage to another with the VM turned on, information is passed according to the size of the disk (not just the use in the VM).

I was able to solve by following some guidelines and recommendations.
1- Activate the check in "Discard" in the Disk options in VM hardware.
2- Then inside the VM (Linux) as root, execute the following command: fstrim -av

With this last command it reclaims the unused space, which marks in consumption and is reduced only to the use of the VM.
 
Last edited:
  • Like
Reactions: inlinexmr

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!