OpenVZ

Backup OpenVZ Containers

Here are some posts on backing up the OpenVZ containers:

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.

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.

Install OpenVZ Template

http://wiki.openvz.org/OS_template_cache_preparation is where to start.

  1. To see which templates are available, run
    # yum search vztmpl
  2. To install some of the templates, run

    # yum install vztmpl-XXX [...]
  3. Run the vzpkgcache utility; see the vzpkgcache(8) man page for details. It will create or update the caches of all the templates for which the corresponding metadata exist.

Create OpenVZ Template

Based on http://www.neonhost.com/openvz/. This shows how to create a CentOS 5 OpenVZ template based on CentOS-4 OpenVZ template metadata.