Article ID: 118880, created on Nov 27, 2013, last review on May 22, 2015

  • Applies to:
  • Virtuozzo 6.0

Symptoms

In some cases ploop-based containers with real_data_size much less than image_size are not getting shrunk with the pcompact tool. Example:

[root@test ~]# ploop list | grep 100500
ploop53778   /vz/private/100500/root.hdd/root.hds

[root@test ~]# ploop-balloon discard -d /dev/ploop53778 --stat
Balloon size:        0MB
Data size:        4776MB
Ploop size:      80000MB
Image size:      25639MB

But from /var/log/pcompact.log you can see that this container wasn't shrunk:

2013-11-20T02:00:15+0400 pcompact : Inspect d4t5687c-g2g4-527e-9956-85g4ff86trfd
2013-11-20T02:00:15+0400 pcompact : Inspect /vz/private/100500/root.hdd/DiskDescriptor.xml
2013-11-20T02:00:15+0400 pcompact : Disk: /vz/private/100500/root.hdd/DiskDescriptor.xml
2013-11-20T02:00:15+0400 pcompact : ploop=80000MB image=25638MB data=4776MB balloon=0MB
2013-11-20T02:00:15+0400 pcompact : Rate: 26.1 (threshold=10)
2013-11-20T02:00:15+0400 pcompact : Start compacting (to free 16861MB)
2013-11-20T02:00:15+0400 : 0 clusters have been relocated                           
2013-11-20T02:00:15+0400 pcompact : ploop=80000MB image=25638MB data=4776MB balloon=0MB
2013-11-20T02:00:15+0400 pcompact : End compacting

Cause

"ploop" devices are created with 1MB block size by design, whereas the filesystem inside of it is formatted in 4kb blocks. If some piece of data inside the container occupies a 4kb block, it will use the whole 1MB block of ploop it is located on. The rest of the blocks will be unused, but they cannot be freed with pcompact utility, because it only removes the unused 1MB ploop blocks.

Resolution

Optimizations of pcompact are planned in future Virtuozzo updates in scope of request with internal ID #PSBM-30164.

Search Words

pcompact

disk space

shrink

ploop-balloon

diskspace

0dd5b9380c7d4884d77587f3eb0fa8ef 2897d76d56d2010f4e3a28f864d69223 c62e8726973f80975db0531f1ed5c6a2

Email subscription for changes to this article
Save as PDF