====== Crear Màquina ====== Crear dues interfícies de xarxa: bridged mode vmbr0 bridged mode vmbr1 Configurar xarxa: auto eth0 iface eth0 inet static address 192.168.1.101 netmask 255.255.255.0 gateway 192.168.1.1 auto eth1 iface eth1 inet static address 10.139.67.101 netmask 255.255.255.224 up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.139.67.97 ====== Arrancar máquina ====== ===== Listar las máquina ===== # vzlist -a CTID NPROC STATUS IP_ADDR HOSTNAME 100 - stopped - porta.escorxador.matarosensefils.net 101 43 running - web1escp.matarosensefils.net 102 15 running - mld1escp.matarosensefils.net 103 - stopped - vpn1.esc1.matarosensefils.net 104 - stopped - ldap1.escorxador.matarosensefils.net ===== Arrancar una máquina ===== # vzctl start 103 Starting container ... Container is mounted Setting CPU units: 1000 Setting CPUs: 1 Setting devices Configure veth devices: veth103.0 veth103.1 Adding interface veth103.0 to bridge vmbr0 on CT0 for CT103 Adding interface veth103.1 to bridge vmbr1 on CT0 for CT103 Container start in progress... Conectarse a la máquina # vzctl enter 103 entered into CT 103 **Ficheros de configuración:** /etc/vz/conf ===== Montar recurso ===== Si tenemos un recurso montado en el host, por ejemplo **/mnt/sdc/datos/mldonkey** y lo queremos montar en **/mnt/mldonkey/** de la máquina 103 /etc/vz/conf/103.mount #!/bin/bash if [ ! -e /var/lib/vz/root/103/mnt/mldonkey ]; then mkdir -p /var/lib/vz/root/103/mnt/mldonkey; fi mount -n -t simfs /mnt/mldonkey/ /var/lib/vz/root/103/mnt/mldonkey/ -o /mnt/sdc/datos/mldonkey