---+ Installing in a HVM with CD and then converting it to PV. There's some info here: <verbatim>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</verbatim> To install a Xen Guest Os from the first time, you need to: * Create the Filesystems for it on the Xen Host: <verbatim>vgdisplay lvcreate -L 12G -n ui64_root vg_root lvcreate -L 4G -n ui64_swap vg_root lvdisplay</verbatim> * Create the Xen config file for the machine in /etc/xen/ui64 with this content:<verbatim>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</verbatim> * Start the virtual machine and open the vnc console: <verbatim>xm create ui64 vncviewer localhost:7</verbatim> * 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:<verbatim>alias eth0 xennet alias scsi_hostadapter xenblk </verbatim> * Finally install the xen kernel, which should be on the cdrom (mount it first) and uninstall the non-xen one. <verbatim>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</verbatim> * 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):<verbatim>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"</verbatim> * 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 <verbatim>dd if=/dev/vg_root/ui64_root of=/root/ui64_root.img</verbatim> * 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 <font color="crimson">OBSOLETE, DOESN'T WORK because it doesn't install a kernel... maybe using kickstart could do</font> To install a Xen Guest Os from the first time, you need to: * Create the Filesystems for it on the Xen Host: <verbatim>vgdisplay lvcreate -L 12G -n ui64_root vg_root lvcreate -L 4G -n ui64_swap vg_root lvdisplay</verbatim> * Create the Xen config file for the machine in /etc/xen/ui64 with this content:<verbatim>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'</verbatim> * 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:<verbatim>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"</verbatim> * Then you can boot up again with =xm create -c ui64= -- Main.PabloFernandez - 2010-02-15</verbatim>
This topic: LCGTier2
>
WebHome
>
HardwareInformation
>
XenGuestOsInstallation
Topic revision: r11 - 2011-08-08 - PabloFernandez
Copyright © 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