OpenVZ and CentOS 5.0
After installing OpenVZ on CentOS 5.0, I created a couple of CentOS 5.0 VEs using the minimal template available on the OpenVZ wiki but when I “entered” the VE I noticed a “cp” operation consuming 100% of the CPU. Checking back on the host system, I saw the same “cp” consuming 100% CPU there too.
According to OpenVZ, the problem is due to FC5 bug #190601 (ovz bug #297) which remains unfixed in CentOS 5.0. The /etc/vz/dists/scripts/functions file contains a workaround for Fedora but not CentOS or Redhat. To fix, duplicate line 24, and replace “fedora” with “redhat”. When done, it should look like this:
CP='/bin/cp -fp' # overwrite copy arguments as a workaround for FC5 bug #190601 (ovz bug #297) [ -f /etc/fedora-release ] && CP='/bin/cp -f --preserve=mode,ownership' [ -f /etc/redhat-release ] && CP='/bin/cp -f --preserve=mode,ownership'