Novell Home

XEN: Install SLES 9 SP3 domU on SLES 10 XEN dom0

Novell Cool Solutions: Feature
By Cameron Seader

Digg This - Slashdot This

Posted: 14 Dec 2006
 

What will be required in order to get this to work is to install SLES 9 into a directory using the YaST2 > Software > Installation into Directory module. Now this directory could be a mounted block device, such as a partition of your current hard disk or it could be another hard disk attached to this machine, even some SAN storage that has been allocated and partitioned. You could also create an Image file and mount this as well into a directory. I find it easiest to use physical block devices, and disk is cheap so why not keep things simple. So this directory that we will prepare with a SLES 9 installation in it will be the block device that will load and run the SLES 9 system we are about to install in a paravirtualized mode. Follow the steps below once you have a block device or Image file ready and mounted to a directory of your choice.

Create an Image file and mount it

  1. You can put the images where ever you would like on your system, so choose a spot and change your directory to that location. Issue the commands below from command line to create your Image file.
    	Create Image file:
    		dd if=/dev/zero of=base.img bs=1M count=1 seek=4096
    	
    	Create Filesystem on Image:
    		mkreiserfs -q -f base.img
    	
    	Copy your image to a new name so you can use it several times:
    		cp -a base.img SLES_9_SP3_root.img
    	
    	Mount your image to a directory:
    		mount -o loop SLES_9_SP3_root.img /mnt
    Now that you have an image file created, continue on with installing SLES 9 SP3.

Installing SLES 9 SP3

  1. Login to the XEN host via ssh using the -X so that we can export our display through ssh, then from the command line we can run YaST2 for the GUI version of YaST. ( the XEN tools require the GUI YaST2 ) Once YaST2 is open we can launch the Software > Installation Source module.


  2. We will now need to add the SLES 9 SP3 installation Sources into the list, enable them, and disable the SLES 10 installation source. Once complete it will look similar to this screen shot below. If it looks like this then click Finish. ( Note: your installation source for SLES 9 will be different from mine. You will need to make sure that you have the SUSE SLES Version 9, SUSE CORE Version 9, and the SUSE SLES 9 Service-Pack Version 3 Sources Setup. If you do not have these setup you can refer to my document here http://www.novell.com/coolsolutions/tools/17656.html or setup your installation sources via YaST2. SUSE SLES Version 9 source is CD1 of the base SLES 9 CD's, SUSE CORE Version 9 source is CD2 of the base SLES 9 CD's, and SUSE SLES 9 Service-Pack Version 3 source is CD1 of the SLES 9 Service Pack 3 CD's. )



  3. Now we are back to YaST2 and can now Select Software > Installation into Directory. Once open it will look like this screen shot below initially. Notice right off the bat that there are things that need to be changed from Options and Software.

  4. Click on the Options Link so that we can change the Target Directory to the directory you have setup for installing SLES 9 into. Also make sure you put a check mark in the box for Run YaST and SuSEconfig on First Boot so that it looks like this screen shot below. Then select Accept once you have it the way you want. ( In this example we use /mnt as our mount point, so change this to what you are using in your configuration. )

  5. Now click on the Software Link and select your desired Software configuration. I selected minimal in this example as seen in the screen shot. Once you have your desired Software configuration then you can click Accept.

  6. Once your Software configuration is complete we can now click Next to proceed with the installation of SLES 9 and watch the packages be installed. Once it is complete the YaST module will close automatically.


  7. Now we will need to configure a few things within this directory we installed SLES 9, so we will need to first download the XEN Kernel from http://developer.novell.com/wiki/index.php/Special:Downloads/xenpreview/SUSE~~~Linux~~~Enterprise Server/9 SP3/i586/. This link will have a few dates listed as links and we will want to select the newest date available. Once you select a date you will now see a few download links for a kernel file. Your going to see kernel-xen, kernel-xenpae, and kernel-source. The only ones you will need at this point are the kernel-xen or the kernel-xenpae. In order to find out which one you should use, check which one your host system is running, by issuing the uname -r on the host. If it is kernel-xen then you will need use that, and if its the other then download that. The kernel-xenpae (PAE = physical address extensions) allows a 32 bit machine to access memory in excess of 4 G. On XEN we can support up to 16G of physical memory on PAE machines. So lets download the proper kernel file and save it to the XEN host system in /root or something. Once downloaded we can now copy that file to the folder where SLES 9 was installed. In the case of this example i would issue the command "cp kernel-xen kernel-xen-2.6.5-7.282.i586.rpm /mnt/root/". Now this file is located within the installed system.


  8. Create an /etc/fstab with "vi /mnt/etc/fstab" with the following contents (/mnt being the directory you installed SLES 9 into).
    /dev/sdb3     /                   reiserfs         acl,user_xattr      1 1
    proc          /proc               proc             defaults            0 0
    sysfs         /sys                sysfs            noauto              0 0
    debugfs       /sys/kernel/debug   debugfs          noauto              0 0
    usbfs         /proc/bus/usb       usbfs            noauto              0 0
    devpts        /dev/pts  devpts    mode=0620,gid=5                      0 0
    
    Notice the / mount point with the device /dev/sdb3. In this example /dev/sdb3 was the partition that I installed this SLES 9 system into, your device could be different. If you are installing into an Image file that is mounted to a directory you can use /dev/sda1 as your / mount point in the /etc/fstab and i will reference this later.


  9. Now we need to install the kernel by entering a chrooted environment. Issue the command "chroot /mnt" (/mnt being the directory you installed SLES 9 into). Once chrooted we can change our directory to where we saved the new kernel to or just issue the command "rpm -Uvh /root/kernel-xen-2.6.5-7.282.i586.rpm" and watch it install the new kernel into the chrooted system. If you get errors such as these you can ignore them.

    "You may now have to update your boot loader configuration. Warning! Your bootloader type could not be determined or the configuration is inconsistent."

    "By consequence, your system might not be bootable after performing this kernel update. Please check manually if your bootloader is properly initialized!"


  10. Edit your /etc/sysconfig/kernel file on the line INITRD_MODULES="" change to INITRD_MODULES="reiserfs", or whatever modules you need for the file system your using. Save and Exit the file and run SuSEconfig from command line.


  11. Now we will create an initrd with the command "mkinitrd -s off"


  12. Rename /lib/tls to /lib/tls.disabled with the command "mv /lib/tls /lib/tls.disabled"


  13. In /etc/sysconfig/network create a file called ifcfg-eth0 with the command "touch /etc/sysconfig/network/ifcfg-eth0"


  14. Turn off a few services with the commands below.
    chkconfig -f boot.clock off
    chkconfig powersaved off
    chkconfig kbd off
  15. Exit the chrooted environment by typing the command "exit".


  16. umount the block device or Image file that you installed your SLES 9 system in. with "umount /mnt".


  17. Now lets go to YaST2 > System > Virtual Machine Management (XEN) module. Once you have this open we can now add a new Virtual Machine, by clicking the Add button. This will bring you to the Create a Virtual Machine Wizard.


    Select the option "Use a disk image or a physical disk that contains OS boot files" then click Next.


  18. Use 18 a. for Block device configuration and 18 b. for Image file configuration.

    1. Now we will change the proper settings for this Virtual Machine. Leave Virtualization Mode alone, and click on VM Properties and change the name of your VM to a desired Name and the rest can stay defaults. Next click on Hardware and set your desired memory allocation and amount of CPU's that you want the VM to have. Next click on Disks and click Add and in this example we are using a block device, so select whatever you have setup that has the SLES 9 system installed on it, and click next and it will ask you for Virtual Disk and Block Device. First select the correct Block Device from the list, if its not there you have done something wrong. Once you have selected your block device ( in this example we are using /dev/sdb3 ) you can now fill in your Virtual Device, which in this case we have to set our Virtual Device to the same as our Block Device. So now our Virtual Disks will look like the screen shot below.


      Once we have the Disk that we configured and installed SLES 9 into added as a Virtual Disk, we now need to add another one for swap space. So click Add again and select whatever you want for your swap space, If you have already allocated some with a block device, then you can use that, or you can create a new disk image and click next and then select your Virtual Device Name ( for this example i used hda ), then select the size and whether or not create a sparse image file, then Click Next and now your configuration will look like the screen shot below, unless you are using an Image file.


      Now Click Accept, unless you have more Disks you would like to add. Continue on to Step 19.

    1. Now we will change the proper settings for this Virtual Machine. Leave Virtualization Mode alone, and click on VM Properties and change the name of your VM to a desired Name and the rest can stay defaults. Next click on Hardware and set your desired memory allocation and amount of CPU's that you want the VM to have. Next click on Disks and click Add and for an Image file click on Use and existing Disk Image and click next. Now it will ask you for Virtual Disk and Disk Image File. First select the Disk Image File that you installed SLES 9 SP3 into. Once you have selected your Disk Image file you can now fill in your Virtual Device, which in this case we have set our Virtual Device to whatever we want it to be. I have set it to sda1. So now our Virtual Disks will look like the screen shot below.


      Once we have the Disk that we configured and installed SLES 9 into added as a Virtual Disk, we now need to add another one for swap space. So click Add again and select whatever you want for your swap space, If you have already allocated some with a block device, then you can use that, or you can create a new disk image and click next and then select your Virtual Device Name ( for this example i used hda ), then select the size and whether or not create a sparse image file, then Click Next and now your configuration will look like the screen shot below, unless you are using an Image file.



      Now Click Accept, unless you have more Disks you would like to add. Continue on to Step 19.


  19. Now we are back to our Virtual Machine Settings and we can move down to whats next in the list. Click on Network if you wish to add another network interface, otherwise you don't need to mess with the Network. Also if you need to find out what the MAC address is going to be then you can click on it to find that out. Now lets move down the list to the last item of Operating System Boot. Click on it so that we can modify these settings and select the partition that contains our boot files. In the Combo Box you will see the Virtual Device that we added in the list, if you don't see it there, then you have done something wrong. Select that device and then if you are doing your configuration with a block device go to the Boot Options field and we will add the line "root=/dev/sdb3" ( /dev/sdb3 is the physical block device which is being used for root, so this could be different on your configuration ). So now your configuration should look similar to this in the screen shot, unless you are configuring this with an Image file, then you would leave out the extra boot options and just have "TERM=xterm".


    Click Next once you have everything the way you want it, you will be brought back to the VM settings, which should look similar to this screen shot below.

  20. Click Next and it will Update your Virtual Machine configuration in /etc/xen/vm and then start your Virtual Machine.


  21. Once your Virtual Machine is started it will start YaST2 for the first time and you can go through the rest of its configuration like you would on a normal installation. Make sure to setup your Network settings during this process so that you have your networking all configured.(If there are errors in YaST configuration you can just skip past those, or select ok.)


  22. Once YaST is complete and you can now login to your system don't forget to configure your Swap space that you allocated earlier. You can enable this by going into YaST > System > Partitioner and setting things up there.

Enjoy!


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell