Support request: Container disk usage differences

Apr 26, 2018
111
10
23
This probably has been asked several times but likely I am using incorrect search terms.

I'm trying to understand container disk usage differences.

I have a container that shows the following with df:

Code:
/dev/mapper/pve-vm--301--disk--1 ext4   591G  257G  304G  46%

From inside the container the system sees 46% disk usage.

From outside the container the lvs command shows the allotted disk as almost full:

Code:
vm-301-disk-1 pve Vwi-aotz-- 600.00g data        99.90

My understanding is I need to (fs)trim the container?

If I need to trim the container, do I need to first shut down the system?

What is the correct or preferred way to automate trimming containers?

This particular system is on Proxmox 5 but is scheduled to be upgraded to 6 before the end of the month.

Thanks again.
 
My understanding is I need to (fs)trim the container?

Your LVM is thin, so it is almost thick provisioned (as in needs almost all space it would require if it would not be thin provisioned)

If I need to trim the container, do I need to first shut down the system?

No, you can do this online.

What is the correct or preferred way to automate trimming containers?

looping over all containers and running pct fstrim <vmid>. Another possible way would be to use ZFS as your underlying storage. Containers do not need to be trimmed with ZFS.
 
Thank you for replying.

Your LVM is thin, so it is almost thick provisioned (as in needs almost all space it would require if it would not be thin provisioned)

Are you saying this specific container is thick provisioned? That would explain the 99.90%? I do not see this usage with other containers. Does that means those containers are thin provisioned?

How do I tell if a container is thick or thin? Looks like I'm missing the big picture.

> looping over all containers and running pct fstrim <vmid>

I have tried this. I see respective stdout messages that the space was trimmed. Confusing to me is the next vzdump is bigger than the previous, not smaller, as though no shrinking occurred at all.

The vzdumps use snapshot mode and are smaller in size than the allocated disk size, but I'm confused that immediately after trimming the next vzdump is larger by a few MBs.

Am I doing something wrong? Are the systems configured incorrectly?
 
Are you saying this specific container is thick provisioned? That would explain the 99.90%? I do not see this usage with other containers. Does that means those containers are thin provisioned?

The 99.0 in your ouput suggests that to me. If it is 99% used, then you practically have a thick provisioned volume (not technically, but from a storage point of view).

How do I tell if a container is thick or thin? Looks like I'm missing the big picture.

the 't' in the ouput states that it is a thin provisioned volume.

Am I doing something wrong?

Not that I can see. Running pct fstrim is a simple tool.

Are the systems configured incorrectly?

There is nothing to configure per se. It could be that you will get a better/smaller vzdump if you do the zeroing yourself:

Code:
dd if=/dev/zero of=zero bs=64k; sync; sync; sync; rm -f zero
 

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!