Outils pour utilisateurs

Outils du site


xen_robin

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

xen_robin [2014/02/16 13:46] (Version actuelle)
Ligne 1: Ligne 1:
 +:!: Before installing the dedicated server, please follow this layout as we'll use the left free space for LVM (once the machine is installed) :
 +
 +^ Mountpoint ^ Size ^ FS type ^ Partition type ^
 +| /boot | 256M | ext4 | Primary |
 +| / | 2048M | ext4 | Primary |
 +| swap | 1024 | swap | Primary |
 +| n/a | all free space | n/a | Extended |
 +| /usr| 4096| swap | Logical|
 +| /var | 4096| swap | Logical |
 +
 +====== Xen install ======
 +
 +  * Retrieve Xen version and install package
 +
 +  apt-cache search xen-hypervisor
 +  apt-get install xen-hypervisor-4.x-amd64
 +
 +  * Check if Xen has been integrated to grub
 +
 +  grep Xen /boot/grub/grub.cfg
 +
 +  * Specify dedicated CPUs and memory for dom0 in **/etc/default/grub** :
 +
 +I prefer not to restrict memory for dom0, let's allocate only one CPU :
 +
 +<code>
 +GRUB_CMDLINE_LINUX="apparmor=0"
 +GRUB_CMDLINE_XEN="dom0_max_vcpus=1 dom0_vcpus_pin"
 +</code>
 +
 +  * Launch **update-grub**
 +
 +  * Reboot
 +
 +  * Check if Xen kernel has been loaded on boot
 +
 +  xm list
 +
 +====== Xen configuration ======
 +
 +  * Comment and uncomment those lines in **/etc/xen/xend-config.sxp**
 +
 +<code>
 +#(vif-script vif-bridge)
 +#(vif-script     vif-route)
 +(network-script network-nat)
 +(vif-script     vif-nat)
 +</code>
 +
 +  * Launch **/etc/init.d/xen restart**
 +
 +====== VMs setup ======
 +
 +  * Create a 32 bits virtual machine 
 +
 +<code>
 +xen-create-image --lvm=datavg --size=4G --memory=256M --swap=256M --dist=wheezy --mirror=http://ftp.fr.debian.org/debian --force --ip=192.168.1.1  --netmask=255.255.255.0 --gateway=192.168.1.254 --hostname=wheezy32bits --kernel=/boot/vmlinuz-3.2.0-4-686-pae --initrd=/boot/initrd.img-3.2.0-4-686-pae --arch=i386 --fs=ext4
 +</code>
 +
 +:!: kernel and initrd files can be retrieved here :
 +
 +  * kernel : [[http://files.ndlp.info/xen/vmlinuz-3.2.0-4-686-pae|vmlinuz-3.2.0-4-686-pae]]
 +  * initrd : [[http://files.ndlp.info/xen/initrd.img-3.2.0-4-686-pae|initrd.img-3.2.0-4-686-pae]]
 +
 +===== VM configuration file =====
 +
 +**/etc/xen/wheezy32bits.cfg**
 +
 +<code>
 +#
 +# Configuration file for the Xen instance wheezy32bits, created
 +# by xen-tools 4.3.1 on Sun Feb  9 16:25:13 2014.
 +#
 +
 +#
 +#  Kernel + memory size
 +#
 +kernel      = '/boot/vmlinuz-3.2.0-4-686-pae'
 +ramdisk     = '/boot/initrd.img-3.2.0-4-686-pae'
 +
 +vcpus       = '1'
 +cpus        = '1,2,3'
 +memory      = '256M'
 +
 +#
 +#  Disk device(s).
 +#
 +root        = '/dev/xvda2 ro'
 +disk        = [
 +                  'phy:/dev/datavg/wheezy32bits-disk,xvda2,w',
 +                  'phy:/dev/datavg/wheezy32bits-swap,xvda1,w',
 +              ]
 +
 +
 +#
 +#  Physical volumes
 +#
 +
 +
 +#
 +#  Hostname
 +#
 +name        = 'wheezy32bits'
 +
 +#
 +#  Networking
 +#
 +vif         = [ 'ip=192.168.1.1 ,vifname=vif1.1' ]
 +
 +#
 +#  Behaviour
 +#
 +on_poweroff = 'destroy'
 +on_reboot   = 'restart'
 +on_crash    = 'restart'
 +</code>
 +
 +===== Starting the VM =====
 +
 +  * with console :
 +
 +  xm create wheezy32bits.cfg -c
 +
 +  * without console :
 +
 +  xm create wheezy32bits.cfg
 +
 +====== Firewall ======
 +
 +  * dom0 firewall rules : [[http://www.ndlp.info/_fW_/firewall|firewall]]
 +  * VMs firewall rules : [[http://www.ndlp.info/_fW_/firewall.VM|firewall.VM]]
 +
 +
 +
  
xen_robin.txt · Dernière modification: 2014/02/16 13:46 (modification externe)