Symptoms

Container was migrated using pmigrate and resized. Now vzctl shows incorrect diskspace value:

[root@node ~]# vzlist 100600 -o diskspace,diskspace.h
  DQBLOCKS DQBLOCKS.H
    820928   22796788        <----initial value

[root@node ~]# vzctl set 100600 --save --diskspace 100000000
...
The filesystem on /dev/ploop11773p1 is now 24999168 blocks long.
Saved parameters for Container 100600

[root@node ~]# vzlist 100600 -o diskspace,diskspace.h
  DQBLOCKS DQBLOCKS.H
    820928   22796788        <----incorrect value

Cause

There is a .statfs ( /vz/private/$CTID/root.hdd/.statfs ) file that is created when a container is stopped. It contains the details about diskspace and inode quotas, so vzlist can get this information without the access to the file system. After container is started, .statfs is deleted.

Online migration of a running ploop container over shared storage results in an existing .statfs file for a running container. The file persists over online disk resize and it was is to show quota values unconditionally.

This behavior is recognized as a product bug with internal id PSBM-24412.

Resolution

Delete .statfs file and vzctl will be able get the actual diskspace value:

[root@node ~]# vzlist 100600 -o diskspace,diskspace.h
  DQBLOCKS DQBLOCKS.H
    820928   22796788       <----incorrect value

[root@node ~]# ls -al /vz/private/100600/root.hdd/.statfs
-rwx------ 1 root root 40 Mar 15 16:51 /vz/private/100600/root.hdd/.statfs

[root@node ~]# rm -f /vz/private/100600/root.hdd/.statfs

[root@node ~]# ls -al /vz/private/100600/root.hdd/.statfs
ls: cannot access /vz/private/100600/root.hdd/.statfs: No such file or directory

[root@node ~]# vzlist 100600 -o diskspace,diskspace.h
  DQBLOCKS DQBLOCKS.H
    837036   98427524       <----correct value

Internal content