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 100600="100600" 820928="820928" 22796788="22796788" 24999168="24999168" 100000000="100000000" value="value" [root@node="[root@node" ~]#="~]#" vzctl="vzctl" set="set" --save="--save" --diskspace="--diskspace" ...="..." the="The" filesystem="filesystem" dev="dev" ploop11773p1="ploop11773p1" is="is" now="now" blocks="blocks" long.="long." saved="Saved" parameters="parameters" for="for" container="Container" vzlist="vzlist" -o="-o" diskspace,diskspace.h="diskspace,diskspace.h" dqblocks="DQBLOCKS" dqblocks.h="DQBLOCKS.H"><----incorrect value="value"></----incorrect></----initial>
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 1="1" 15="15" 40="40" 100600="100600" 837036="837036" 98427524="98427524" value="value" [root@node="[root@node" ~]#="~]#" ls="ls" -al="-al" vz="vz" private="private" root.hdd="root.hdd" .statfs=".statfs" -rwx------="-rwx------" root="root" mar="Mar" 16:51="16:51" rm="rm" -f="-f" ls:="ls:" cannot="cannot" access="access" .statfs:=".statfs:" no="No" such="such" file="file" or="or" directory="directory" vzlist="vzlist" -o="-o" diskspace,diskspace.h="diskspace,diskspace.h" dqblocks="DQBLOCKS" dqblocks.h="DQBLOCKS.H"><----correct value="value"></----correct></----incorrect>