Receta de instalación OpenVZ

Esta instalación está pensada para Debian etch (estable).

Preparación de Debian

El kernel empaquetado con soporte OpenVZ solo se encuentra en Debian lenny (testing), por lo que hay que actualizar la distribución a esta versión:

Actualizar apt

1. Agregar los repositorios de Debian testing a /etc/apt/sources.list

 deb http://MIRROR/debian/ testing main
 deb http://MIRROR/debian-security/ testing/updates main 

Se debe cambiar MIRROR por el mirror deseado.

2. Ampliar cache de apt, pues ahora se tendrá conviviendo paquetes de etch y lenny, editar archivo /etc/apt/apt.conf (crearlo si no existe):

 APT::Cache-Limit "100000000";

3. Darle preferencia a los paquetes de etch antes que los de lenny, editar archivo /etc/apt/preferences:

 Package: *
 Pin: release a=etch
 Pin-Priority: 700
 
 Package: *
 Pin: release a=lenny
 Pin-Priority: 650

4. Actualizar repositorios apt-get upgrade, actualizar distribución apt-get dist-upgrade, esto debería dejar instalado todo lo nuevo e inclusive el último kernel de etch.

Instalación

Ahora aparecen en la búsqueda (apt-cache) paquetes del kernel con OpenVZ. Instalarlo:

 apt-get install linux-image-openvz-686

Esto bajará los paquetes necesarios:

 iproute libatm1 linux-image-2.6.26-1-openvz-686 linux-image-openvz-686 rsync vzctl vzquota

… entonces reiniciar.

Verificar instalación

El kernel correcto:

 # uname -r
 2.6.26-1-openvz-686
 #

el daemon corriendo:

 # ps ax | grep vz
 2349 ?        S      0:00 [vzmond]

la interfaz virtual para nuevas 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)

Configurar HN

Editar el archivo /etc/sysctl.conf y agregar lo siguiente:

 # On Hardware Node we generally need
 # packet forwarding enabled and proxy arp disabled
 
 net.ipv4.conf.default.forwarding = 1
 net.ipv4.conf.default.proxy_arp = 0
 net.ipv4.ip_forward = 1
 
 # Enables source route verification
 net.ipv4.conf.all.rp_filter = 1
 
 # Enables the magic-sysrq key
 kernel.sysrq = 1
 
 # TCP Explict Congestion Notification
 #net.ipv4.tcp_ecn = 0
 
 # we do not want all our interfaces to send redirects
 net.ipv4.conf.default.send_redirects = 1
 net.ipv4.conf.all.send_redirects = 0

Activar la configuración con el comando:

 # sysctl -p

Hacer un enlace en /vz para que sea fácilmente accesible y quede semejante a un CentOS:

 ln -s /var/lib/vz /vz

Instalar Template

  cd /var/lib/vz/template/cache/
  wget http://download.openvz.org/contrib/t...minimal.tar.gz
  sudo cp /etc/vz/dists/debian.conf /etc/vz/dists/ubuntu.conf
  sudo vzctl create 101 --ostemplate ubuntu-6.06-i386-minimal
  sudo vzctl set 101 --onboot yes --save
  sudo vzctl set 101 --ipadd 192.168.1.210 --save
  sudo vzctl set 101 --nameserver 192.168.1.2 --save
  sudo vzctl set 101 --name host --save
  sudo vzctl set 101 --hostname host.name.com --save
  sudo vzctl start 101
  sudo vzctl exec 101 passwd
  sudo vzctl exec 101 ps fauwx

Revisar maquina virtual

  sudo vzlist -a
  
  sudo vzctl status 101

Conectar a maquina virtual

  ssh root@192.168.1.210
 
virtualizacion/openvz/instalar-debian.txt · Última modificación: 2009/11/13 14:44 por rodolfo
Recent changes RSS feed Creative Commons License Driven by DokuWiki Made on Mac