Thorolf Godawa
2007-Nov-18 20:13 UTC
[Xen-users] Installing openSuSE 10.3 as PV-guest on a LVM-drive of a openSuSE 10.3 host
Hi, how can I install a openSuSE 10.3 PV-guest on a LVM-drive of a openSuSE 10.3 host with Xen 3.10? On 10.2 with Xen 3.0.3 the openSuSE-YaST-module for managing VMs could install the system also on block-devices, unfortunately this is not possible anymore with OSS 10.3 :-( What I have tried: - I created two LVM-partitions, one for "/" one for swap. - Installing an OSS 10.2 PV-guest on the 10.2-host using block-devices works without any problems, but the upgrade of the guest to OSS 10.3 failed (the system hangs during boot). - It was NOT possible to install OSS 10.3 as PV-guest on LVM-partitions on the 10.2-host using the YaST-module, the installation stops and tells me that it can''t extract kernel/initrd from the installation media (I tried DVD-, CD- and network-install). - On OSS 10.3 as host I can install 10.3 as PV-guest using a file as image-container, everything works as expected. - I tried to move this working image to the LVM-drives: - I create one primary partition on each LVM-drive, formated one with ext3 and the other with swap. - I mounted the the OSS 10.3 image-file as loop with offset that it matches the internal partition table. - I mounted the new LVM-drive that should be used, also with loop and offset. - I can access both mounted filesystems correctly, so I copied everything from the image-file to the LVM-drive. - I checked the /etc/fstab in the new copy: /dev/xvda1 / ext3 acl,user_xattr 1 1 /dev/xvdb2 swap swap defaults 0 0 - I created a new xen-config: name="OSS103.lvm" ostype="opensuse" uuid="fa0be596..." memory=384 vcpus=1 on_crash="destroy" on_poweroff="destroy" on_reboot="restart" localtime=0 builder="linux" bootloader="/usr/lib/xen/boot/domUloader.py" bootentry="xvda1:/boot/vmlinuz-xen,/boot/initrd-xen" #extra=" " extra=" TERM=xterm" disk=[ ''phy:/dev/vg01/pv-sys,xvda,w'', ''phy:/dev/vg01/pv-swap,xvdb,w'' ] vif=[ ''mac=00:12:34:56:78:9a'', ] - I start this system , but mostly nothing happens, no error, no boot: # xm create OSS103.lvm -> Using config file "./OSS103.lvm". # xm list -> Name ID Mem VCPUs State Time(s) OSS103.lvm 2 384 0 -bp--- 0.0 # xm unpause OSS103.lvm # xm list -> Name ID Mem VCPUs State Time(s) OSS103.lvm 2 384 0 -b---- 0.0 - There is are only entries in the xend.log: 57:27 3636] DEBUG (XendDomainInfo:78) XendDomainInfo.create([''vm'', [''name'', ''OSS103.lvm''], [''memory'', 384], [''on_poweroff'', ''destroy''], [''on_reboot'', ''restart''], [''on_crash'', ''destroy''], [''vcpus'', 1], [''on_xend_start'', ''ignore''], [''on_xend_stop'', ''ignore''], [''uuid'', ''fa0be596-08aa-361b-a10b-51056bf71c45''], [''bootloader'', ''/usr/lib/xen/boot/domUloader.py''], [''bootloader_args'', ''-q''], [''image'', [''linux'', [''args'', '' TERM=xterm'']]], [''device'', [''vbd'', [''uname'', ''phy:/dev/vg01/pv-sys''], [''dev'', ''xvda''], [''mode'', ''w'']]], [''device'', [''vbd'', [''uname'', ''phy:/dev/vg01/pv-swap''], [''dev'', ''xvdb''], [''mode'', ''w'']]], [''device'', [''vif'', [''mac'', ''00:16:3e:5d:16:c2'']]]]) 57:27 3636] DEBUG (XendDomainInfo:1512) XendDomainInfo.constructDomain 57:27 3636] DEBUG (balloon:132) Balloon: 94628 KiB free; need 2048; done. 57:27 3636] DEBUG (XendDomain:435) Adding Domain: 2 57:27 3636] DEBUG (XendDomainInfo:1566) XendDomainInfo.initDomain: 2 256 57:27 4423] DEBUG (XendBootloader:101) Launching bootloader as [''/usr/lib/xen/boot/domUloader.py'', ''--args= TERM=xterm'', ''--o utput=/var/run/xend/boot/xenbl.20430'', ''-q'', ''/dev/vg01/domino-sys'']. 59:49 3636] INFO (XendDomain:1141) Domain OSS103.lvm (2) unpaused. 05:57 3636] DEBUG (XendDomainInfo:1758) XendDomainInfo.destroy: domid=2 05:57 3636] DEBUG (XendDomainInfo:1775) XendDomainInfo.destroyDomain(2) - Finally I made a directory-install of OSS 10.3 into the mounted LVM-drive, adjusted the /etc/fstab and passwd/shadow/group but the result was exactly the same :-( Any ideas how I can solve this problem? Thanks a lot, -- Chau y hasta luego, Thorolf _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Ralf Müller
2007-Nov-19 10:33 UTC
Re: [Xen-users] Installing openSuSE 10.3 as PV-guest on a LVM-drive of a openSuSE 10.3 host
Am 18.11.2007 um 21:13 schrieb Thorolf Godawa:> how can I install a openSuSE 10.3 PV-guest on a LVM-drive of a > openSuSE > 10.3 host with Xen 3.10?Actually - I don''t know the official way to do this and I don''t know exactly why it doesn''t work for you. I assume domUloader.py has problems detecting a valid kernel/initrd/bootloader or whatever in your installed system. So I try to describe what I did to get running domU''s ... As you did, I used to install systems directly into a logical volumes - but I had to find out that it is near to impossible to upgrade a SuSE system without a master boot record to play with. So I switched to "virtual hard disks" within LV''s. What I currently do is to create two logical volumes: /dev/vg0/test-hda /dev/vg0/test-swap Then I "fdisk /dev/vg0/test-hda" with one single primary partition and use "kpartx -a /dev/vg0/test-hda" to import this virtual disk via device-mapper. Then I create a filesystem on /dev/mapper/vg0-test--hda1 and mount the newly created filesystem. After that I can dir-install to this filesystem via YaST. Now you have to create a valid fstab in the new system and you have to place a valid /etc/YaST2/control.xml file. I use just a copy of the dom0 for that - without this you will have problems to use Community Repositories. Important: you have to umount /dev/mapper/vg0-test--hda1 There is no detection that this filesystem is still mounted when you start your new domU and you will kill the filesystem when it is mounted twice. As there is no correctly installed kernel/initrd/bootloader within the dir-installed system you have to boot it otherwise. The following script creates an usable initrd to boot such a system. After booting the system I install a bootloader within the booted system via yast. Now you can switch to domUloader.py for booting this system. === mkinitrd-xen.sh ==#!/bin/bash . /etc/rc.status . /etc/sysconfig/xen-bj rc_reset echo -n "Create initrd for domU''s" if [ -z "$DOMU_KERNEL" ]; then DOMU_KERNEL="vmlinuz-xen" fi if [ -z "$DOMU_INITRD" ]; then DOMU_KERNEL="initrd-domU" fi if [ -z "$DOMU_INITRD_MODULES" ]; then DOMU_INITRD_MODULES="xennet xenblk" fi if [ -z "$DOMU_BOOT_DIRECTORY" ]; then DOMU_BOOT_DIRECTORY="/etc/xen/images/boot" fi mkdir -p "$DOMU_BOOT_DIRECTORY" cp -p "/boot/$DOMU_KERNEL" "$DOMU_BOOT_DIRECTORY" mkinitrd -b "$DOMU_BOOT_DIRECTORY" -k "$DOMU_KERNEL" \ -i "$DOMU_INITRD" -u "$DOMU_INITRD_MODULES" rc_status -v -r === snip == my configuration for this: === /etc/sysconfig/xen-bj ==# base kernel to be used for xen domU''s DOMU_KERNEL="vmlinuz-xenpae" DOMU_INITRD="initrd-domU" # modules to include in domU initrd DOMU_INITRD_MODULES="xennet xenblk reiserfs nfs nfsd xfs dm_mod" # directory to place kernel and initrd for domU''s DOMU_BOOT_DIRECTORY="/etc/xen/images/boot" === snip == and finally the working xen config: === /etc/xen/vm/test ==name="test" ostype="opensuse" memory=192 vcpus=1 on_crash="destroy" on_poweroff="destroy" on_reboot="restart" localtime=0 builder="linux" #bootloader="/usr/lib/xen/boot/domUloader.py" #bootargs="--entry=xvda1:/boot/vmlinuz-xenpae,/boot/initrd-xenpae" kernel="/etc/xen/images/boot/vmlinuz-xenpae" ramdisk="/etc/xen/images/boot/initrd-domU" root="xvda1" extra="xencons=tty" disk=[ ''phy:/dev/vg0/test-hda,xvda,w'', ''phy:/dev/vg0/test-swap,xvdb2,w'', ] vif=[ ''mac=00:16:3e:34:00:16,bridge=xenbr0'', ] serial="pty" === snip == Regards Ralf _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users