Installing in a PV (para-virtualized) machine

To install a Xen Guest Os from the first time, you need to:

  • Create the Filesystems for it on the Xen Host:
    vgdisplay
    lvcreate -L 12G -n ui64_root vg_root
    lvcreate -L 4G -n ui64_swap vg_root
    lvdisplay
  • Create the Xen config file for the machine in /etc/xen/ui64 with this content:
    name = "ui64"
    
    vcpus = 2
    memory = 2048
    disk = ['phy:/dev/vg_root/ui64_root,xvda,w',
            'phy:/dev/vg_root/ui64_swap,xvdb,w']
    vif = ['mac=00:16:3E:64:00:64,bridge=xenbr0']
    
    kernel = '/root/xenkernel/sl54_64/vmlinuz'
    ramdisk = '/root/xenkernel/sl54_64/initrd.img'
    on_reboot = 'destroy'
    on_crash = 'destroy'
  • Make sure there exists both vmlinuz and initrd.img from above in the Xen Host. They come from the /images/xen directory on the SL54 first CD, or in the repo.
  • Start the virtual machine and open the vnc console: xm create -c ui64
  • The xen console will come up, just make a normal installation as desired. Network is left to be configured with dhcp. You may also want to use a local repository or the one at ftp://mirror.switch.ch/mirror/scientificlinux/54/x86_64/
  • After installation the machine will halt. To go on we need to replace the old /etc/xen/ui64 with this new one:
    name = "ui64"
    
    vcpus = 2
    memory = 2048
    disk = ['phy:/dev/vg_root/ui64_root,xvda,w',
            'phy:/dev/vg_root/ui64_swap,xvdb,w']
    vif = ['mac=00:16:3E:64:00:64,bridge=xenbr0']
    
    bootloader = "/usr/bin/pygrub"
  • Then you can boot up again with xm create -c ui64

Installing in a HVM with CD and then converting it to PV.

OBSOLETE, DOESN'T WORK

There's some info here:

http://markmail.org/message/ib5bctd3amqqzl5u#query:convert%20hvm%20xen%20to%20paravirtual%20initrd+page:1+mid:pg3g44k5cdmuyqes+state:results
http://old.nabble.com/Converting-full-virtualized-Linux-domUs-to-use-paravirtualized-drivers-td18942359.html

To install a Xen Guest Os from the first time, you need to:

  • Create the Filesystems for it on the Xen Host:
    vgdisplay
    lvcreate -L 12G -n ui64_root vg_root
    lvcreate -L 4G -n ui64_swap vg_root
    lvdisplay
  • Create the Xen config file for the machine in /etc/xen/ui64 with this content:
    name = "ui64"
    
    vcpus = 2
    memory = 2048
    disk = ['phy:/dev/vg_root/ui64_root,hda,w',
            'file:/root/SL.54.110309.DVD.x86_64.disc1.iso,hdc:cdrom,r',
            'phy:/dev/vg_root/ui64_swap,hdb,w']
    vif = ['mac=00:16:3E:64:00:64,bridge=xenbr0']
    
    builder = "hvm"
    kernel = "/usr/lib/xen/boot/hvmloader"
    device_model = "/usr/lib64/xen/bin/qemu-dm"
    pae = 1
    boot = "cd"
    vnc = 1
    vncviewer = 1
    vncdisplay = 7
  • Start the virtual machine and open the vnc console:
    xm create ui64
    vncviewer localhost:7
  • Finish the installation (the least software installed the better), confirm reboot. Then shut down the machine with xm destroy ui64
  • Backup the basic installation if wanted. From the Xen Host perform
    dd if=/dev/vg_root/ui64_root of=/root/ui64_root.img
  • Upon restart remove all unnecesary services from bootup, and edit the /etc/modprobe.conf file to be like this. After a kernel reinstallation (or running mkinitrd manually) the initrd image will be able to boot from paravirtualized devices:
    alias eth0 xennet
    alias scsi_hostadapter xenblk 
  • Finally install the xen kernel, which should be on the cdrom (mount it first) and uninstall the non-xen one.
    mount /dev/hdc /mnt
    rpm -i /mnt/SL/kernel-xen-2.6.18-164.2.1.el5.x86_64.rpm
    rpm -i /mnt/SL/kernel-xen-devel-2.6.18-164.2.1.el5.x86_64.rpm
    rpm -e kernel-devel-2.6.18-164.2.1.el5.x86_64 kernel-2.6.18-164.2.1.el5.x86_64
    cat /boot/grub/menu.lst
  • Then check the xen kernel is the default to be loaded on boot, and halt the VM.
  • Before starting it again, replace the /etc/xen/ui64 xen config file to match this content (to be para-virtualized):
    name = "ui64"
    
    vcpus = 2
    memory = 2048
    disk = ['phy:/dev/vg_root/ui64_root,hda,w',
            'phy:/dev/vg_root/ui64_swap,hdb,w']
    vif = ['mac=00:16:3E:64:00:64,bridge=xenbr0']
    
    bootloader = "/usr/bin/pygrub"

-- PabloFernandez - 2010-02-15</verbatim>


This topic: LCGTier2 > OsInstallation > XenGuestOsInstallation
Topic revision: r7 - 2010-02-17 - PabloFernandez
 
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback