Search

 

Here you can search and view our site Knowledge Base.
To find a specific article, use KB-article number format (ex. KB-1)

Article number: Article number: kb-46
Q. How to install OpenVZ Virtualization on CentOS 6

A. OpenVZ Virtualization quick installation

This document briefly describes the steps needed to install OpenVZ on your RHEL 6 (CentOS 6, Scientific Linux 6) machine.

# cd /etc/yum.repos.d
# wget http://download.openvz.org/openvz.repo
# rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ
# yum install ovzkernel.x86_64 vzctl.x86_64 vzquota.x86_64
# yum install vzctl vzquota ploop

To disable SELinux change the file
# vi /etc/sysconfig/selinux
and add the line
SELINUX=disabled

# reboot



How to download OS Templates?

Precreated template caches for different distributions. To install, download and put to the host system's /vz/template/cache directory.

# cd /vz/template/cache/
# wget https://download.openvz.org/template/precreated/centos-6-x86_64-minimal.tar.gz
# wget https://download.openvz.org/template/precreated/centos-7-x86_64-minimal.tar.gz
# wget https://download.openvz.org/template/precreated/debian-7.0-x86-minimal.tar.gz
# wget https://download.openvz.org/template/precreated/debian-8.0-x86_64-minimal.tar.gz
# wget https://download.openvz.org/template/precreated/suse-13.1-x86_64-minimal.tar.gz
# wget https://download.openvz.org/template/precreated/ubuntu-14.04-x86_64-minimal.tar.gz
# wget https://download.openvz.org/template/precreated/ubuntu-15.04-x86_64-minimal.tar.gz
# wget https://download.openvz.org/template/precreated/scientific-6-x86_64.tar.gz



Creating Container

After the Container ID and the installed OS template have been chosen, you can create the Container private area with the vzctl create command. The private area is the directory containing the actual files of the given Container; it is usually residing in /vz/private/CTID/. The private area is mounted to the /vz/root/CTID directory on the Hardware Node and provides Container users with a complete Linux file system tree.

For example, you can create a new Container CTID with centos-6-x86_64-minimal, by typing the following string:

# vzctl create CTID --ostemplate centos-6-x86_64-minimal
# vzctl set CTID --save --name HOSTNAME
# vzctl set CTID --save --onboot yes
# vzctl set CTID --save --hostname HOSTDOMAIN
# vzctl set CTID --save --ipadd IPADDRES
# vzctl set CTID --save --searchdomain HOSTDOMAIN
# vzctl set CTID --save --nameserver 8.8.8.8 --nameserver 8.8.4.4
# vzctl set CTID --save --cpus 1
# vzctl set CTID --save --ram 1G
# vzctl set CTID --save --swap 1G
# vzctl set CTID --save --diskspace 50g
# vzctl set CTID --save --quotaugidlimit 50
# vzctl set CTID --userpasswd root:password
# vzctl start CTID
# vzctl enter CTID



OpenVZ Commands

# vzctl start CTID
# vzctl restart CTID
# vzctl status CTID
# vzctl stop CTID
# vzctl destroy CTID

# vzmemcheck -v
# vzcpucheck -v
# vzlist -a

This page has been viewed 4581 times

Return to Search

Back to Top