User Tools

Site Tools


xen:creation_of_a_domu

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
xen:creation_of_a_domu [2009/07/20 20:54]
Luc Nieland debian lenny addition
xen:creation_of_a_domu [2011/02/07 19:05] (current)
Luc Nieland
Line 1: Line 1:
 +======DomU creation======
 +
 +
 +=====Debian 6 (Squeeze)=====
 +
 +====with KVM====
 +A convenient way to prepair an image is by using KVM on your workstion. Install from the Net or the netinst.iso Keep in mind:
 +  * install minimal, (use expertmode).
 +  * it installs with grub2 only, so you will you will need xen-4 on your Dom0 to use pygrub.
 +
 +After the reboot test, before the shutdown and copy-over to the Xen dom0, a few modifications are needed:
 +
 +
 +
 +
 +To have a console (with xm console on the Dom0), including a login prompt, you need to have a line in /​etc/​inittab with:
 +
 +  1:​2345:​respawn:/​sbin/​getty 38400 hvc0
 +
 +
 +Adapt the filesystemlines in /etc/fstab from /dev/sda1 to /​dev/​vda1 ​
 +
 +
 +
 +
 +Now shutdown, and copy over the image file to the dom0 system. KVM usually leaves its image files in /​var/​lib/​libvirt/​images/​*.img
 +
 +Use dd to place this disk-image file on a logicalvolume.
 +
 +
 +An example minimal config with pygrub:
 +<​code>​
 +name       = "​deb6"​
 +memory ​    ​= ​ 1024
 +vcpus      =  1
 +bootloader = "/​usr/​lib/​xen-4.0/​bin/​pygrub"​
 +disk       ​= ​ [ "​phy:/​dev/​mapper/​vg00-deb6disk0,​xvda,​w"​ ]
 +vif        =  [ "​mac=00:​16:​3c:​53:​ba:​f9,​bridge=xenbr0"​ ]
 +extra      = "​clocksource=jiffies"​
 +</​code>​
 +
 +
 +
 +
 +
 +
 +====with debbootstrap====
 +See below.
 +
 +
 +
 +
 +
 +====upgrade from a Debian 5 (Lenny) domU ====
 +
 +As preparation,​ adapt /​etc/​apt/​sources and execute:
 +  apt-get update
 +
 +Now comes the more tricky part, execute the steps below, and do not reboot in between:
 +
 +  touch /​etc/​udev/​kernel-upgrade
 +  apt-get dist-upgrade -fu
 +
 +
 +
 +Only when the Dom0 is xen-3 (i.e. pygrub is not grub-2 capable)
 +
 +  apt-get install grub-legacy
 +
 +
 +Adapt /​boot/​grub/​menu.lst and append console=hvc0 to the kernel line, like this:
 +
 +  kernel /​vmlinuz-2.6.... ​  ​root=/​..... ​  ​ro ​ console=hvc0 xencons=tty
 +
 +
 +
 +When the Dom0 is xen-4 or later (i.e. pygrub is grub-2 capable)
 +
 +  upgrade-from-grub-legacy
 +  rm -f /​boot/​grub/​menu.lst*
 +
 +
 +
 +In /​etc/​inittab you need at least this line:
 +
 +  1:​2345:​respawn:/​sbin/​getty 38400 hvc0
 +
 +
 +Done. Now you can safe reboot the domU system. You will have a working console.
 +
 +
 +
 +===clock===
 +New clock behaviour in newer kernels. The  result is 'clock went backwards'​ problems. ​ Add the line below to the domU.conf start file:
 +
 +  extra="​clocksource=jiffies"​
 +
 +  * See: [[http://​wiki.debian.org/​Xen#​A.27clocksource.2BAC8-0.3ATimewentbackwards.27]]
 +
 +
 +
 +=====Opensolaris PV domU=====
 +In case your hardware does not match de Solaris-x86 hardware compatibility list, but you do want to run one or more Solaris machines, Xen is a solution. In this case, Linux is used for the dom0, so all drivers of Linux can be used to adress the hardware. The Xen hypervisor layer does the i/o translation :-)
 +
 +Nexenta is a recently developed distribution of OpenSolaris,​ which combines the kernel and some great features like ZFS with the usability developed by Debian. A good direction for Solaris in my opinion.
 +
 +The link below is describes the installation steps of the Solaris/​Linux combination:​
 +See: http://​wiki.tardis.ed.ac.uk/​index.php/​OpenSolaris_Xen_domU
 +
 +
 +
 +=====RedHat 6 PV domU =====
 +RHEL6 runs as Xen PV (paravirtual) domU using the pvops framework in the default kernel. ​
 +
 +A convenient way to make the raw image for domU usage is with KVM. Install from the CDrom, the usual way.
 +To use this image as a domU, edit the /​etc/​grub.conf in the image (by using KVM) and add to the kernel line:
 +
 +  console=hvc0
 +
 +After this, this machine will not have a console with KVM anymore when rebooted in KVM. So shut it down, and copy it over to the xen dom0 machine.
 +
 +
 +A minimal domU.conf file example is:
 +
 +  name       ​= ​  "​rh6beta"​
 +  memory ​    ​= ​   1024
 +  vcpus      =    2
 +  bootloader =   "/​usr/​lib/​xen-4.0/​bin/​pygrub"​
 +  disk       = [ "​phy:/​dev/​mapper/​vg00-rh6disk0,​xvda,​w" ​ ]
 +  vif        = [ "​mac=00:​16:​34:​f2:​3b:​7f,​bridge=xenbr3"​]
 +  extra      =   "​clocksource=jiffies"​
 +
 +
 +When the mac-adres of the domU has changed, update the configfiles:​
 +  * /​etc/​sysconfig/​network-scripts/​ifcfg-eth* ​   (HWADDR=... )
 +  * /​etc/​udev/​rules.d/​70-persistent-net.rules
 +
 +
 +=====Ubuntu-10.04 PV domU =====
 +
 +A convenent way to make the raw image is with KVM. Install from the Net or the CDrom, the usual way, but keep in mind:
 +  * install 10.04 with commandline only, and use expertmode.
 +  * best choose for grub1 and not grub2, so you will end up with a normal /​boot/​grub/​menu.lst so pygrub will work without hacking it.
 +
 +
 +After the reboot test, before the shutdown and copy-over to the Xen dom0, a few modifications are needed:
 +
 +Install a kernel with the pv_ops externtions:​
 +  apt-get install linux-image-virtual
 +
 +
 +
 +  * To have the xm-console, including a login prompt, do:
 +<​code>​
 +# most important:
 +cp  /​etc/​init/​tty0.conf ​ /​etc/​init/​hvc0.conf
 +sed -i '​s|tty0|hvc0|g'​ /​etc/​init/​hvc0.conf
 +# to be complete:
 +mv /​etc/​init/​tty1.conf /​etc/​init/​tty1.conf.disabled
 +mv /​etc/​init/​tty2.conf /​etc/​init/​tty2.conf.disabled
 +mv /​etc/​init/​tty3.conf /​etc/​init/​tty3.conf.disabled
 +mv /​etc/​init/​tty4.conf /​etc/​init/​tty4.conf.disabled
 +mv /​etc/​init/​tty5.conf /​etc/​init/​tty5.conf.disabled
 +mv /​etc/​init/​tty6.conf /​etc/​init/​tty6.conf.disabled
 +</​code>​
 +
 +  * Optionally disable ureadahead:
 +<​code>​
 +mv /​etc/​init/​ureadahead.conf ​ /​etc/​init/​ureadahead.conf.disable
 +mv ureadahead-other.conf ureadahead-other.conf.disable
 +</​code>​
 +
 +
 +Now shutdown, and copy over the image file to the dom0 system. KVM usually leaves its image files in /​var/​lib/​libvirt/​images/​*.img
 +
 +Use dd to place this disk-image file on a logicalvolume.
 +
 +
 +  * Use this xm create config:
 +<​code>​
 +name = "​ubu1004serv"​
 +memory = 1024
 +vcpus = 1
 +#kernel = "/​var/​xen/​kernels/​ubuntu/​vmlinuz-2.6.32-24-server"​
 +#ramdisk = "/​var/​xen/​kernels/​ubuntu/​initrd.img-2.6.32-24-server"​
 +#root = "/​dev/​mapper/​vg01-root ro"
 +#
 +bootloader = "/​usr/​lib/​xen-3.4/​bin/​pygrub"​
 +#extra = "​console=hvc0 xencons=tty"​
 +#
 +vfb = [  ]
 +on_poweroff = "​destroy"​
 +on_reboot = "​restart"​
 +on_crash = "​restart"​
 +#
 +disk = [ "​phy:/​dev/​mapper/​vg00-ubu1004disk0,​xvda,​w" ​ ]
 +vif = [ "​mac=00:​16:​3c:​53:​ba:​f9,​bridge=xenbr0"​]
 +</​code>​
 +
 +
 +See also:
 +  * [[http://​www.panticz.de/​Ubuntu-Lucid-domU-under-Debian-Lenny-Dom0]]
 +  * [[https://​help.ubuntu.com/​community/​Xen]]
 +
 +
 +
 +=====Opensolaris PV domU=====
 +In case your hardware does not match de Solaris-x86 hardware compatibility list, but you do want to run one or more Solaris machines, Xen is a solution. In this case, Linux is used for the dom0, so all drivers of Linux can be used to adress the hardware. The Xen hypervisor layer does the i/o translation :-)
 +
 +Nexenta is a recently developed distribution of OpenSolaris,​ which combines the kernel and some great features like ZFS with the usability developed by Debian. A good direction for Solaris in my opinion.
 +
 +The link below is describes the installation steps of the Solaris/​Linux combination:​
 +See: http://​wiki.tardis.ed.ac.uk/​index.php/​OpenSolaris_Xen_domU
 +
 +
 +
 +
 +
 +======Debbootstrap creation======
  
 =====Debian domU===== =====Debian domU=====
Line 126: Line 345:
  
  
-===Automatic domU startup===+ 
 + 
 + 
 + 
 +======Automatic domU startup======
  
 Create a directory /​etc/​xen/​auto and put the domU configuration file in this directory (or create a symbolic link). Create a directory /​etc/​xen/​auto and put the domU configuration file in this directory (or create a symbolic link).
Line 132: Line 355:
 In case you have a lot of domU'​s,​ a problem might arise that networking fails when using automatic startup. In case you have a lot of domU'​s,​ a problem might arise that networking fails when using automatic startup.
  
-===extra software and config===+======extra software and config======
 Configure locales to get rid of the message ​ Setting locale failed Configure locales to get rid of the message ​ Setting locale failed
   apt-get install locales   apt-get install locales
Line 149: Line 372:
  
  
-=====Opensolaris domU===== 
-In case your hardware does not match de Solaris-x86 hardware compatibility list, but you do want to run one or more Solaris machines, Xen is a solution. In this case, Linux is used for the dom0, so all drivers of Linux can be used to adress the hardware. The Xen hypervisor layer does the i/o translation :-) 
  
-Nexenta is a recently developed distribution of OpenSolaris,​ which combines the kernel and some great features like ZFS with the usability developed by Debian. A good direction for Solaris in my opinion. 
  
-The link below is describes the installation steps of the Solaris/​Linux combination:​ +
-See: http://​wiki.tardis.ed.ac.uk/​index.php/​OpenSolaris_Xen_domU+
  
  
xen/creation_of_a_domu.1248116058.txt.gz · Last modified: 2009/07/20 20:54 by Luc Nieland