Hi Mark, I used or instructions to create a minimal Solaris DomU. I changed some minor things to get it work (see below) but in principle it worked very well (I did not test the use of a USB drive /compact flash card for the Dom0/DomU until now).
I've documented my efforts here: http://home.arcor.de/bnsmb/public/htdocs/Xen_and_Solaris.html#How_to_create_a_minimal_Solaris_DomU_or and here http://home.arcor.de/bnsmb/public/htdocs/Xen_and_Solaris.html#How_to_create_a_Solaris_DomU_or_Dom0_that_boots_from_a_RAM_disk The script to create the minimal DomU is here http://home.arcor.de/bnsmb/public/solaris/xen/buildDomU.sh The script to create the ram disk is here: http://home.arcor.de/bnsmb/public/solaris/xen/buildDomU_ramdisk.sh There's only one open issue with a failed SMF service in the DomU. And I could not start a Dom0 using the ramdisk until now. regards Bernd Tested in Solaris snv_78 ------------------------ Changes made to the script to create the minimal DomU/Dom0 ========================================================== 1. I changed "> PKGLOG" to ">> $PKGLOG" ---------------------------------------------------------- 2. Added mkdir $ROOTDIR/boot/grub before /usr/sbin/bootadm update-archive -R $ROOTDIR Without creating the directory the bootadm command fails: build boot_archive /mnt/: not a GRUB boot OS instance And the image is not bootable: bash-3.2# xm create -c embbed_solaris.cfg Using config file "./embbed_solaris.cfg". Error: Boot loader didn't return any data! ---------------------------------------------------------- 3. Added the packages with mkisofs to the DomU disk image added SUNWmkcdr and SUNWmkcd to the packages to install reason: The update of the boot-archive failed most of the times in the minimal DomU because of not enough memory without mkisofs. If mksiofs does not exist bootadm creates a boot-archive with UFS and that process uses much more memory than creating a boot-archive with hsfs (using mkisofs). ---------------------------------------------------------- 3. Added some echo and check commands ---------------------------------------------------------- Changes to the Solaris configuration after booting the new DomU: bash-3.2# svcs -x svc:/system/intrd:default (interrupt balancer) State: maintenance since Fri Jan 18 23:14:17 2008 Reason: Restarting too quickly. See: http://sun.com/msg/SMF-8000-L5 See: intrd(1M) See: /var/svc/log/system-intrd:default.log Impact: This service is not running. svc:/system/fmd:default (Solaris Fault Manager) State: offline since Fri Jan 18 23:14:03 2008 Reason: Dependency file://localhost/usr/lib/fm/fmd/fmd is absent. See: http://sun.com/msg/SMF-8000-E2 See: fmd(1M) Impact: This service is not running. bash-3.2# Disabled both services before creating the ram disk svcadm disable svc:/system/intrd:default svcadm disable svc:/system/fmd:default Note: sys:/system/intrd:default is not running because the service needs Perl which is not installed in the Image. bash-3.2# tail /var/svc/log/system-intrd:default.log /lib/svc/method/svc-intrd: /usr/lib/intrd: not found [ Jan 18 23:14:17 Method "start" exited with status 0. ] [ Jan 18 23:14:17 Stopping because all processes in service exited. ] [ Jan 18 23:14:17 Executing stop method (:kill). ] [ Jan 18 23:14:17 Executing start method ("/lib/svc/method/svc-intrd"). ] /lib/svc/method/svc-intrd: /usr/lib/intrd: not found [ Jan 18 23:14:17 Method "start" exited with status 0. ] [ Jan 18 23:14:17 Stopping because all processes in service exited. ] [ Jan 18 23:14:17 Executing stop method (:kill). ] [ Jan 18 23:14:17 Restarting too quickly, changing state to maintenance. ] bash-3.2# file /usr/lib/intrd /usr/lib/intrd: executable /usr/perl5/bin/perl script Question: Do we need this service? If yes, Perl (and maybe other packages) must be added to the image. --------------------------------------------------------- In preparation for the creation of the ramdisk I disabled the service to update the boot-archive in the DomU image before creating the ramdisk: svcadm disable svc:/system/boot-archive-update:default --------------------------------------------------------- Changes made to the code to create a ramdisk for the minimal DomU/Dom0 ====================================================================== Corrected the links for the root device /dev/{r}dsk/c0d0s0 in the image file before creating the ramdisk: echo "Correcting the devices links for the root disk in the image ..." TMP_MOUNTPOINT="/mnt" ... mount ${LOFI_DEVICE} ${TMP_MOUNTPOINT} # new code: # change the root device in the image rm ${TMP_MOUNTPOINT}/dev/dsk/c0d0s0 rm ${TMP_MOUNTPOINT}/dev/rdsk/c0d0s0 ln -s ../../devices/ramdisk:a ${TMP_MOUNTPOINT}/dev/dsk/c0d0s0 ln -s ../../devices/ramdisk:a,raw ${TMP_MOUNTPOINT}/dev/rdsk/c0d0s0 Without these changes the DomU will always boot in the maintenance mode with root readonly mounted and no /tmp because the service to mount the local filesystem fails. Open Issues =========== I could not boot the ramdisk in a Dom0 until now, my grub menu entries are: title Embedded Solaris xVM 64 Bit (serial console) kernel$ /boot/$ISADIR/xen.gz com1=96008n1 console=com1 module$ /platform/i86xpv/kernel/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix -k -B console=ttya module$ /boot/solaris.ramdisk title Embedded Solaris xVM 32 Bit (serial console) kernel$ /boot/xen.gz com1=9600,8n1 console=com1 module$ /platform/i86xpv/kernel/unix /platform/i86xpv/kernel/unix -k -B console=ttya module$ /boot/solaris.ramdisk title Embedded Solaris xVM 64 Bit (vga) kernel$ /boot/$ISADIR/xen.gz module$ /platform/i86xpv/kernel/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix -k module$ /boot/solaris.ramdisk title Embedded Solaris xVM 32 Bit (vga) kernel$ /boot/xen.gz module$ /platform/i86xpv/kernel/unix /platform/i86xpv/kernel/unix -k module$ /boot/solaris.ramdisk Booting the 64 Bit kernel only loads the Xen kernel and then reboots immediately; booting the 32 Bit kernel stops with the error message saying there is "not enough memory for Dom0". My Ferrari has 1 GB memory --IMHO that should be enough to load the ramdisk and start a Dom0. The size of the ramdisk file is: bash-3.2# ls -l /boot/solaris.ramdisk -rw-r--r-- 1 root root 98759429 Jan 19 22:00 /boot/solaris.ramdisk The size of the unpacked ramdisk file is: bash-3.2# ls -l ./myramdisk -rw-r--r-- 1 root root 383283200 Jan 20 14:40 ./myramdisk The size of the filesystem in the ramdisk file is: bash-3.2# df -k /mnt1 Filesystem kbytes used avail capacity Mounted on /dev/lofi/2 350994 264939 50956 84% /mnt1 Mark Johnson wrote: > I have been meaning to do a blog entry on how to do > this but haven't found the time yet... > > Here's a quick way to build a minimal domU which > can also be used for an embedded dom0. > > I have a dom0 which I run off of a ram disk booted > >from a USB flash and then can start multiple domUs > using the same ramdisk used to boot dom0. > > I'll just cover how to build the domU and then > follow up how to build the ramdisk and put it > on a USB flash in a later e-mail. > > > -- Bernd Schemmer, Frankfurt am Main, Germany http://home.arcor.de/bnsmb/index.html M s temprano que tarde el mundo cambiar . Fidel Castro _______________________________________________ xen-discuss mailing list [email protected]
