Xen Vm paravirtualise

De BlaxWiki
Aller à la navigationAller à la recherche

Ficher de configuration de base d'une VM paravirtualisé

Sur ce type de VM, le noyau est celui du dom0 mais que l’initrd est specifique au domu (c’est ce qui permet d’eviter le /dev/root not found).

import os, re
arch = os.uname()[4]
if re.search('64', arch):
    arch_libdir = 'lib64'
else:
    arch_libdir = 'lib'
kernel = "/boot/vmlinuz_xend "
ramdisk = "/boot/initrd-domu "
builder='linux'
memory = 2048
shadow_memory = 8
name = "www1"
vcpus=2
pae=1
acpi=1
apic=1
cpus = "0-1" # run on cpus 0,2,3,5
vif = [ 'bridge=xenbr0', 'bridge=xenbr1' ]
disk = [ 'file:/data/image/www1.img,hda1,w','file:/data/image/www1.swp,hda2,w' ]
on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
boot="c"
vnc=0
stdvga=0
serial='pty'
keymap='fr'
root="/dev/hda1"