Symptoms
Ploop container consumes significantly more disk space on the server, than the data size inside it:
[root@vz ~]# du -h /vz/private/101/root.hdd/root.hds 154G /vz/private/101/root.hdd/root.hds [root@vz ~]# vzctl enter 101 entered into Container 101 CT-101-bash-4.1# df -h Filesystem Size Used Avail Use% Mounted on /dev/ploop18346p1 197G 62G 133G 32% / none 1.0G 4.0K 1.0G 1% /dev
Cause
Depending on the data structure inside a container, a scheduled daily job that compacts ploop images automatically, /etc/cron.d/pcompact, might not be effective. One of the possible reasons of such behavior is high fragmentation level inside a container.
Resolution
There are few methods to compact a container manually.
-
Truncate unused blocks with the help of
prl_disk_toolutility on stopped container:# prl_disk_tool compact --hdd /vz/private/101/root.hdd/
-
Downsize stopped container and upsize it back to the original value:
# vzctl stop 101 # prl_disk_tool resize --hdd /vz/private/101/root.hdd --size 75000M # prl_disk_tool resize --hdd /vz/private/101/root.hdd --size 199000M