Tags:
create new tag
view all tags

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

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
  • Perform the installation:
    • The least software installed the better
    • make sure you install virtualization
    • Configure networking manually.
    • If you need to change disk, perform: xm block-configure [Dom-ID] file:/scratch/SL.56.061711.DVD.x86_64.disc2.iso hdc:cdrom r
    • confirm reboot. Then shut down the machine with xm destroy ui64
  • 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"
    on_reboot = 'restart'
    on_crash = 'destroy'
    extra = "xencons=tty"
  • Boot up (with console) and change the boot parameters in grub (for the xen kernel) so that it contains the root(hd0,0), a kernel line and an initrd line. If the boot is ok, change it definately in /boot/grub/menu.lst. If it doesn't boot then you can always go back to full virtual and fix whatever needed.
  • Backup the basic installation if wanted. From the Xen Host perform
    dd if=/dev/vg_root/ui64_root of=/root/ui64_root.img
  • After the first backup, it's a good idea to install the software needed (or most likely needed) in all machines that it's going to be replicated to. This is a suggestion:
    • Disable selinux

Installing in a PV (para-virtualized) machine

OBSOLETE, DOESN'T WORK because it doesn't install a kernel... maybe using kickstart could do

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

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

Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r11 - 2011-08-08 - PabloFernandez
 
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback