Virtualization

Unlimited Resources in an OpenVZ Container

To change the resource limitation on an OpenVZ container, we can first generate a sample unlimited file:

host# vzsplit -n 1 -f unlimit

This will generate a sample file for an container with unlimited resource in /etc/vz/conf/ve-unlimited.conf-sample. Open this file, and then replace the resource limitation on the item that you wish to replace in the config file for your container, in /etc/sysconfig/vz-scripts/{CID}.conf.

The restart the container

host# vzctl restart CID

Yum Update "can't start new thread" in OpenVZ Container

In one of my OpenVZ containers, when I tried to run "yum update" today, I kept getting the error "can't start new thread". The entire error message is like this:

Loaded plugins: fastestmirror

CPAN "couldn't Untar" error

I tried to install something via CPAN, but kept getting this error. Even "perl -MCPAN -e 'install CPAN'" gave such error:

Using Tar:/bin/tar xvf /root/.cpan/sources/authors/id/A/AN/ANDK/CPAN-1.9402.tar:
Couldn't untar /root/.cpan/sources/authors/id/A/AN/ANDK/CPAN-1.9402.tar

It wasn't permission, because I was running from root. Maybe the memory. Since this is a OpenVZ container, we would check the /proc/user_beancounters

# cat /proc/user_beancounters

Named for OpenVZ Containers

To have the containers use the named on the host, we first install the bind package on the host. For CentOS, we just need to do

# yum install bind-chroot

Then follow a post like this one http://www.wains.be/index.php/2007/12/13/centos-5-chroot-dns-with-bind/, and configure the local named.

After that, just set the nameservers for each container:

# vzctl set 101 --nameserver 192.168.1.10 --save

(Assume the local host's IP is 192.168.1.10).

Firewall on OpenVZ

This post is a good one for Setting up an iptables firewall on OpenVZ.

In this article, there is a sample /etc/init.d/firewall file. The line for "chkconfig 2345 08 82" was apparently coppied from /etc/init.d/iptables. While iptables can start at sequence number 8, the openvz firewall should only be invoked after vz has started. Thus, we change the number to

# chkconfig: 2345 97 87

 

Install OpenVZ on a X86_64 CentOS

In wiki.openvz.org, there is an article on Install OpenVZ on a x86 64 system Centos-Fedora.

Some problems and fixes:

 

404 file not found

I kept getting random "404 file not found" when running "vzpkgcache" to install the cache template. To fix this, I found some  "yum.conf" files

OpenVZ Yum Repository

OpenVZ has its own yum repository. You can find more information on the OpenVZ Wiki Yum. The repo file http://download.openvz.org/openvz.repo does get updated from time to time. So it is important to check once every few months to ensure you get the latest great version.

 

 

Install Zimbra on OpenVZ CentOS

Prepare the VPS

Before we install Zimbra, we must install the follow packages

root@HN# vzctl exec 101 yum install ant sysstat gmp compat-libstdc++-296 compat-libstdc++-33

The above list should be good enough for Zimbra 6. If installing Zimbra 5, then we also have to have:

OpenVZ Unable to open pty: No such file or directory

http://www.canfield.com/content/openvz-unable-open-pty-no-such-file-or-d... has a post to the problem on the error message

Unable to open pty: No such file or directory

Quote:

 

The fix then becomes a two step process. The first steps are done from the node, adjust your vz container ID from 101 as needed. Re-create the missing devices.