Xen

Utilizaremos como estándar de documentación:
# para referirnos a superusuario (root)
$ para referirnos a un usuario

1. Instalo ifrename.

zaphod:~#apt-get install ifrename xen-linux-system-2.6.26-1-xen-amd64 xen-tools xen-utils bridge-utils -t testing

2. Configuro el ifrename.

zaphod:~# echo "intranet mac 00:22:19:18:29:7b" > /etc/iftab
zaphod:~# ifdown eth4
zaphod:~# ifup intranet
zaphod:~# /etc/init.d/ifrename start

3. Configuro la interfaz de red en modo estático.

zaphod:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug xenbr0
iface xenbr0 inet static
address 172.16.0.44
netmask 255.255.128.0
gateway 172.16.0.1
bridge_ports intranet
bridge_stp off
bridge_fd 0

4. Aparentemente tenemos el xen andando:

zaphod:~# ps ax|grep xen
31 ? S< 0:00 [xenwatch]
32 ? S< 0:00 [xenbus]
3340 ? S 0:00 /usr/lib/xen-3.2-1/bin/xenstored --pid-file /var/run/xenstore.pid
3348 ? S 0:00 python /usr/lib/xen-3.2-1/bin/xend start
3350 ? Sl 0:01 python /usr/lib/xen-3.2-1/bin/xend start
3352 ? Sl 0:00 /usr/lib/xen-3.2-1/bin/xenconsoled
3655 pts/0 R+ 0:00 grep xen

5. Configuración inicial de bridge

zaphod:~# brctl show
bridge name bridge id STP enabled interfaces
xenbr0 8000.00221918297b no intranet


6. Levantar un domU. Copiar la imagen generada al dom0.

6.1. marte:/etc/xen# mkdir zaphod
6.2. marte:/etc/xen/zaphod# scp -r root@cualquiera:/srv/xendomains/imagen_test .
6.3. marte:/etc/xen/zaphod# scp -r root@cualquiera:/etc/xen/imagen_test.cfg .
6.4. marte:/etc/xen/zaphod# xm create -c imagen_test.cfg

7. Una vez levantado el domU: se prueba loguearse al mismo y salir a internet.
7.1. Se comprueba que el domU ya esté levantado.

zaphod:~# xm list
Name ID Mem VCPUs State Time(s)
Domain-0 0 1024 4 r----- 144.4
imagen_test 1 512 2 -b---- 1.5

7.2. Se accede al domU (minmei), y se prueba salir a internet.

user@imagen_test:~$ ping google.com

PING google.com (74.125.45.100) 56(84) bytes of data.
64 bytes from yx-in-f100.google.com (74.125.45.100): icmp_seq=1 ttl=243 time=173 ms

No hay comentarios.: