Esta instalación está pensada para Debian squeeze (estable).
Instalar un Debian (se sugiere amd64) de forma estandar, se puede seguir esta guía de instalación de Debian.
Agregar repositorio de wheezy en /etc/apt/sources.list
deb http://download.openvz.org/debian wheezy main
Bajar e instalar certificado de este repositorio:
wget http://ftp.openvz.org/debian/archive.key apt-key add archive.key
Instalar kernel con soporte OpenVZ
apt-get install vzkernel
Correr update-grub
y fijarse que posición tiene el kernel openvz 2.6 (posiblemente la 4, empezando en 0) y editar /etc/default/grub
y configurar el boot por defecto:
GRUB_DEFAULT=4
y correr update-grub
nuevamente.
Instalar paquetes adicionales:
apt-get instals rsync vzctl vzquota
Reiniciar (o hacerlo más adelante).
Ahora aparecen en la búsqueda (apt-cache
) paquetes del kernel con soporte OpenVZ.
apt-get install linux-image-openvz-amd64
Esto bajará los paquetes necesarios, entre ellos
rsync vzctl vzquota
Reiniciar (o hacerlo mas adelante)
Crear un archivo /etc/sysctl.d/openvz.conf
y agregar configuración:
wget -O - http://pi.lastr.us/sysctl.conf >> /etc/sysctl.d/openvz.conf
que pondrá lo siguiente al final del archivo existente:
# # OpenVZ # ignorar los paquetes de broadcasts net.ipv4.icmp_echo_ignore_broadcasts=1 # Interfaz sobre la que se levantará el bridge net.ipv4.conf.eth0.proxy_arp=1 # packet forwarding habilitado y proxy arp deshabilitado net.ipv4.conf.default.forwarding = 1 net.ipv4.conf.default.proxy_arp = 0 net.ipv4.ip_forward = 1 # Habiliar verificación de fuente de ruteo net.ipv4.conf.all.rp_filter = 1 # Habilitar llaves magic-sysrq kernel.sysrq = 1 # No todas las interfaces envian redirección net.ipv4.conf.default.send_redirects = 1 net.ipv4.conf.all.send_redirects = 0 # Soporte equivalente para IPv6 net.ipv6.conf.default.forwarding = 1 net.ipv6.conf.all.forwarding = 1 net.ipv6.conf.default.proxy_ndp = 1 net.ipv6.conf.all.proxy_ndp = 1
Activar la configuración con el comando:
sysctl -p /etc/sysctl.d/openvz.conf
Hacer un enlace en /vz
para que sea fácilmente accesible y quede semejante a un CentOS:
ln -s /var/lib/vz /vz
Activar soporte IPv6 en /etc/vz/vz.conf
## Enable IPv6 IPV6="yes"
… entonces reiniciar.
El kernel correcto:
# uname -r 2.6.32-5-openvz-amd64 #
el daemon corriendo:
# ps ax | grep vz 2349 ? S 0:00 [vzmond]
la interfaz virtual para nuevos contenedores:
# ifconfig venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Descargar templates (todos los que se quieran tener) y dejar los archivos descargados en /vz/template/cache/
Sugerencia para descarga:
cd /vz/template/cache/ wget http://download.openvz.org/contrib/t...minimal.tar.gz
Crear una configuación de ejemplo para luego utilizar al crear máquinas virutales
vzsplit -n 4 -f 4vm
vzctl create 101 --ostemplate debian-6.0-x86_64 --config 4vm vzctl set 101 --onboot yes --save vzctl set 101 --ipadd 6.6.6.3 --save vzctl set 101 --ipadd 2607:f0d0:2001:000a:0000:0000:0000:0210 --save vzctl set 101 --nameserver 192.168.1.2 --save vzctl set 101 --name host --save vzctl set 101 --hostname host.name.com --save vzctl start 101
vzctl set 101 --userpasswd root:AfxT34m0Hx11F vzctl exec 101 ps fauwx
Ver un script aqui: script-instalar.sh
vzctl create 101 --ostemplate debian-6.0-x86_64 --ipadd 6.6.6.3 --name host --hostname host.name.com --config 4vm vzctl set 101 --nameserver 192.168.1.2 --save
el parámetro –config 4
levanta el archivo /etc/vz/conf/ve-4.conf-sample
que se puede crear con el comando vzsplit -n 4 -f 4vm
sudo vzlist -a sudo vzctl status 101
ssh root@192.168.1.210