Hello, FC5 Xen folks. When I tried to install Xen3.0 on FC5, it has failed in making a guest OS image. It seems to be because that pygrub.py can not recognize my dom0 menu.lst correctly. Or, maybe it is wrong that I used LVM, but this is default of current FC5 (Why?). BTW, I am testing FC5 Xen dom0 on VMware 5.5.1, and it runs, although many guys have reported that it has a lot of trouble. For me, the problem is not VMware or dom0, but installer of domU. Any help? --- Okajima, Jun. Tokyo, Japan. --------------------------- [root@localhost ~]# xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 164 1 r----- 427.8 [root@localhost ~]# xenguest-install.py What is the name of your virtual machine? FC5_1 How much RAM should be allocated (in megabytes)? 256 What would you like to use as the disk (path)? /XEN/FC5_1.img What is the install location? http://ring.sakura.ad.jp/archives/linux/fedora/linux/core/5/i386/os/ Starting install... Using config file "/etc/xen/FC5_1". Error: Error creating domain: The privileged domain did not balloon! If your install has exited, you can restart your guest by running ''xm create -c FC5_1''. Otherwise, you can reconnect to the console by running ''xm console FC5_1'' [root@localhost ~]# xm create -c FC5_1 Using config file "/etc/xen/FC5_1". Traceback (most recent call last): File "/usr/bin/pygrub", line 256, in ? cf = get_config(file, isconfig) File "/usr/bin/pygrub", line 139, in get_config raise RuntimeError, "Unable to read filesystem" RuntimeError: Unable to read filesystem Error: Boot loader didn''t return any data! [root@localhost ~]# cat /etc/xen/ FC5_1 scripts/ xmexample.vti auto/ xend-config.sxp xmexample1 qemu-ifup xmexample.hvm xmexample2 [root@localhost ~]# cat /etc/xen/FC5_1 # Automatically generated xen config file name = "FC5_1" memory = "256" disk = [ ''file:/XEN/FC5_1.img,xvda,w'' ] vif = [ ''mac=00:16:3e:60:8f:ea'' ] bootloader="/usr/bin/pygrub" on_reboot = ''restart'' on_crash = ''restart'' [root@localhost ~]# cat /boot/grub/menu.lst # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00 # initrd /initrd-version.img #boot=/dev/hda default=2 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Fedora Core (2.6.16-1.2080_FC5xenU) root (hd0,0) kernel /vmlinuz-2.6.16-1.2080_FC5xenU ro root=/dev/VolGroup00/LogVol00 rhgb quiet initrd /initrd-2.6.16-1.2080_FC5xenU.img title Fedora Core (2.6.16-1.2080_FC5xen0) root (hd0,0) kernel /xen.gz-2.6.16-1.2080_FC5 module /vmlinuz-2.6.16-1.2080_FC5xen0 ro root=/dev/VolGroup00/LogVol00 rhgb quiet module /initrd-2.6.16-1.2080_FC5xen0.img title Fedora Core (2.6.16-1.2080_FC5) root (hd0,0) kernel /vmlinuz-2.6.16-1.2080_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet initrd /initrd-2.6.16-1.2080_FC5.img title Fedora Core (2.6.15-1.2054_FC5) root (hd0,0) kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet initrd /initrd-2.6.15-1.2054_FC5.img [root@localhost ~]# cat /proc/partitions major minor #blocks name 3 0 8388608 hda 3 1 104391 hda1 3 2 8281507 hda2 253 0 7831552 dm-0 253 1 393216 dm-1 [root@localhost ~]# xm dmesg __ __ _____ ___ ___ \ \/ /___ _ __ |___ / / _ \ / _ \ \ // _ \ ''_ \ |_ \| | | | | | | / \ __/ | | | ___) | |_| | |_| | /_/\_\___|_| |_| |____(_)___(_)___/ http://www.cl.cam.ac.uk/netos/xen University of Cambridge Computer Laboratory Xen version 3.0.0 (bhcompile@build.redhat.com) (gcc version 4.1.0 20060304 (Red Hat 4.1.0-3)) Tue Mar 28 03:35:03 EST 2006 Latest ChangeSet: unavailable (XEN) Physical RAM map: (XEN) 0000000000000000 - 000000000009f800 (usable) (XEN) 000000000009f800 - 00000000000a0000 (reserved) (XEN) 00000000000dc000 - 0000000000100000 (reserved) (XEN) 0000000000100000 - 000000000bef0000 (usable) (XEN) 000000000bef0000 - 000000000befc000 (ACPI data) (XEN) 000000000befc000 - 000000000bf00000 (ACPI NVS) (XEN) 000000000bf00000 - 000000000c000000 (usable) (XEN) 00000000fec00000 - 00000000fec10000 (reserved) (XEN) 00000000fee00000 - 00000000fee01000 (reserved) (XEN) 00000000fffe0000 - 0000000100000000 (reserved) (XEN) System RAM: 191MB (196156kB) (XEN) Xen heap: 10MB (10344kB) (XEN) Using scheduler: Simple EDF Scheduler (sedf) (XEN) PAE disabled. (XEN) found SMP MP-table at 000f6ce0 (XEN) DMI present. (XEN) Using APIC driver default (XEN) ACPI: RSDP (v000 PTLTD ) @ 0x000f6c70 (XEN) ACPI: RSDT (v001 PTLTD RSDT 0x06040000 LTP 0x00000000) @ 0x0bef7c02 (XEN) ACPI: FADT (v001 INTEL 440BX 0x06040000 PTL 0x000f4240) @ 0x0befbf14 (XEN) ACPI: MADT (v001 PTLTD APIC 0x06040000 LTP 0x00000000) @ 0x0befbf88 (XEN) ACPI: BOOT (v001 PTLTD $SBFTBL$ 0x06040000 LTP 0x00000001) @ 0x0befbfd8 (XEN) ACPI: DSDT (v001 PTLTD Custom 0x06040000 MSFT 0x0100000d) @ 0x00000000 (XEN) ACPI: Local APIC address 0xfee00000 (XEN) ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled) (XEN) Processor #0 15:12 APIC version 17 (XEN) ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1]) (XEN) ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0]) (XEN) IOAPIC[0]: apic_id 1, version 17, address 0xfec00000, GSI 0-23 (XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 high edge) (XEN) ACPI: IRQ0 used by override. (XEN) ACPI: IRQ2 used by override. (XEN) Enabling APIC mode: Flat. Using 1 I/O APICs (XEN) Using ACPI (MADT) for SMP configuration information (XEN) Initializing CPU#0 (XEN) Detected 1599.572 MHz processor. (XEN) CPU0: AMD Flush Filter disabled (XEN) CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) (XEN) CPU: L2 Cache: 128K (64 bytes/line) (XEN) Intel machine check architecture supported. (XEN) Intel machine check reporting enabled on CPU#0. (XEN) CPU0: AMD Sempron(tm) Processor 2600+ stepping 02 (XEN) Total of 1 processors activated. (XEN) ENABLING IO-APIC IRQs (XEN) ..TIMER: vector=0x31 apic1=0 pin1=2 apic2=-1 pin2=-1 (XEN) Platform timer is 1.193MHz PIT (XEN) Brought up 1 CPUs (XEN) Machine check exception polling timer started. (XEN) *** LOADING DOMAIN 0 *** (XEN) Domain 0 kernel supports features = { 0000001f }. (XEN) Domain 0 kernel requires features = { 00000000 }. (XEN) PHYSICAL MEMORY ARRANGEMENT: (XEN) Dom0 alloc.: 0a000000->0b000000 (37859 pages to be allocated) (XEN) VIRTUAL MEMORY ARRANGEMENT: (XEN) Loaded kernel: c0100000->c0455b7c (XEN) Init. ramdisk: c0456000->c07e2200 (XEN) Phys-Mach map: c07e3000->c080bf8c (XEN) Start info: c080c000->c080d000 (XEN) Page tables: c080d000->c0811000 (XEN) Boot stack: c0811000->c0812000 (XEN) TOTAL: c0000000->c0c00000 (XEN) ENTRY ADDRESS: c0100000 (XEN) Dom0 has maximum 1 VCPUs (XEN) Initrd len 0x38c200, start at 0xc0456000 (XEN) Scrubbing Free RAM: ..done. (XEN) Xen trace buffers: disabled (XEN) *** Serial input -> DOM0 (type ''CTRL-a'' three times to switch input to Xen). [root@localhost ~]# cat /etc/redhat-release Fedora Core release 5 (Bordeaux) [root@localhost ~]#
I believe the error "Error: Error creating domain: The privileged domain did not balloon!" happens when you don''t have enough available memory for the domU to boot. The xenguest-install.py script tells you to restart the domain by running "xm create -c xxxx'', but I think the error message is just a generic one that is printed if the script crashes out, and it it is the wrong thing to do in this case. When I had the same problem, I had to allocate less memory to dom0 and re-run the xenguest-install script. I see you have about 196MB of RAM. Since the FC5 script needs 256MB of RAM, I don''t think you''ll be able to install it unless you increase the amount of RAM you have. But since the machine is a virtual one in VMWare, this shouldn''t be too difficult. --Winston On Apr 2, 2006, at 7:49 AM, Jun OKAJIMA wrote:> > Hello, FC5 Xen folks. > > When I tried to install Xen3.0 on FC5, it has failed in making a > guest OS image. > It seems to be because that pygrub.py can not recognize my dom0 > menu.lst correctly. > Or, maybe it is wrong that I used LVM, but this is default of > current FC5 (Why?). > > BTW, I am testing FC5 Xen dom0 on VMware 5.5.1, and it runs, although > many guys have reported that it has a lot of trouble. > For me, the problem is not VMware or dom0, but installer of domU. > > Any help? > > --- Okajima, Jun. Tokyo, Japan. > > > > --------------------------- > > [root@localhost ~]# xm list > Name ID Mem(MiB) VCPUs State Time(s) > Domain-0 0 164 1 r----- 427.8 > [root@localhost ~]# xenguest-install.py > What is the name of your virtual machine? FC5_1 > How much RAM should be allocated (in megabytes)? 256 > What would you like to use as the disk (path)? /XEN/FC5_1.img > What is the install location? http://ring.sakura.ad.jp/archives/ > linux/fedora/linux/core/5/i386/os/ > > > Starting install... > Using config file "/etc/xen/FC5_1". > Error: Error creating domain: The privileged domain did not balloon! > If your install has exited, you can restart your guest by running > ''xm create -c FC5_1''. Otherwise, you can reconnect to the console > by running ''xm console FC5_1'' > [root@localhost ~]# xm create -c FC5_1 > Using config file "/etc/xen/FC5_1". > Traceback (most recent call last): > File "/usr/bin/pygrub", line 256, in ? > cf = get_config(file, isconfig) > File "/usr/bin/pygrub", line 139, in get_config > raise RuntimeError, "Unable to read filesystem" > RuntimeError: Unable to read filesystem > Error: Boot loader didn''t return any data! > [root@localhost ~]# cat /etc/xen/ > FC5_1 scripts/ xmexample.vti > auto/ xend-config.sxp xmexample1 > qemu-ifup xmexample.hvm xmexample2 > [root@localhost ~]# cat /etc/xen/FC5_1 > # Automatically generated xen config file > name = "FC5_1" > memory = "256" > disk = [ ''file:/XEN/FC5_1.img,xvda,w'' ] > vif = [ ''mac=00:16:3e:60:8f:ea'' ] > bootloader="/usr/bin/pygrub" > > on_reboot = ''restart'' > on_crash = ''restart'' > [root@localhost ~]# cat /boot/grub/menu.lst > # grub.conf generated by anaconda > # > # Note that you do not have to rerun grub after making changes to > this file > # NOTICE: You have a /boot partition. This means that > # all kernel and initrd paths are relative to /boot/, eg. > # root (hd0,0) > # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00 > # initrd /initrd-version.img > #boot=/dev/hda > default=2 > timeout=5 > splashimage=(hd0,0)/grub/splash.xpm.gz > hiddenmenu > title Fedora Core (2.6.16-1.2080_FC5xenU) > root (hd0,0) > kernel /vmlinuz-2.6.16-1.2080_FC5xenU ro root=/dev/ > VolGroup00/LogVol00 rhgb quiet > initrd /initrd-2.6.16-1.2080_FC5xenU.img > title Fedora Core (2.6.16-1.2080_FC5xen0) > root (hd0,0) > kernel /xen.gz-2.6.16-1.2080_FC5 > module /vmlinuz-2.6.16-1.2080_FC5xen0 ro root=/dev/ > VolGroup00/LogVol00 rhgb quiet > module /initrd-2.6.16-1.2080_FC5xen0.img > title Fedora Core (2.6.16-1.2080_FC5) > root (hd0,0) > kernel /vmlinuz-2.6.16-1.2080_FC5 ro root=/dev/VolGroup00/ > LogVol00 rhgb quiet > initrd /initrd-2.6.16-1.2080_FC5.img > title Fedora Core (2.6.15-1.2054_FC5) > root (hd0,0) > kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup00/ > LogVol00 rhgb quiet > initrd /initrd-2.6.15-1.2054_FC5.img > [root@localhost ~]# cat /proc/partitions > major minor #blocks name > > 3 0 8388608 hda > 3 1 104391 hda1 > 3 2 8281507 hda2 > 253 0 7831552 dm-0 > 253 1 393216 dm-1 > [root@localhost ~]# xm dmesg > __ __ _____ ___ ___ > \ \/ /___ _ __ |___ / / _ \ / _ \ > \ // _ \ ''_ \ |_ \| | | | | | | > / \ __/ | | | ___) | |_| | |_| | > /_/\_\___|_| |_| |____(_)___(_)___/ > > http://www.cl.cam.ac.uk/netos/xen > University of Cambridge Computer Laboratory > > Xen version 3.0.0 (bhcompile@build.redhat.com) (gcc version 4.1.0 > 20060304 (Red Hat 4.1.0-3)) Tue > Mar 28 03:35:03 EST 2006 > Latest ChangeSet: unavailable > > (XEN) Physical RAM map: > (XEN) 0000000000000000 - 000000000009f800 (usable) > (XEN) 000000000009f800 - 00000000000a0000 (reserved) > (XEN) 00000000000dc000 - 0000000000100000 (reserved) > (XEN) 0000000000100000 - 000000000bef0000 (usable) > (XEN) 000000000bef0000 - 000000000befc000 (ACPI data) > (XEN) 000000000befc000 - 000000000bf00000 (ACPI NVS) > (XEN) 000000000bf00000 - 000000000c000000 (usable) > (XEN) 00000000fec00000 - 00000000fec10000 (reserved) > (XEN) 00000000fee00000 - 00000000fee01000 (reserved) > (XEN) 00000000fffe0000 - 0000000100000000 (reserved) > (XEN) System RAM: 191MB (196156kB) > (XEN) Xen heap: 10MB (10344kB) > (XEN) Using scheduler: Simple EDF Scheduler (sedf) > (XEN) PAE disabled. > (XEN) found SMP MP-table at 000f6ce0 > (XEN) DMI present. > (XEN) Using APIC driver default > (XEN) ACPI: RSDP (v000 PTLTD ) @ > 0x000f6c70 > (XEN) ACPI: RSDT (v001 PTLTD RSDT 0x06040000 LTP 0x00000000) > @ 0x0bef7c02 > (XEN) ACPI: FADT (v001 INTEL 440BX 0x06040000 PTL 0x000f4240) > @ 0x0befbf14 > (XEN) ACPI: MADT (v001 PTLTD APIC 0x06040000 LTP 0x00000000) > @ 0x0befbf88 > (XEN) ACPI: BOOT (v001 PTLTD $SBFTBL$ 0x06040000 LTP 0x00000001) > @ 0x0befbfd8 > (XEN) ACPI: DSDT (v001 PTLTD Custom 0x06040000 MSFT 0x0100000d) > @ 0x00000000 > (XEN) ACPI: Local APIC address 0xfee00000 > (XEN) ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled) > (XEN) Processor #0 15:12 APIC version 17 > (XEN) ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1]) > (XEN) ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0]) > (XEN) IOAPIC[0]: apic_id 1, version 17, address 0xfec00000, GSI 0-23 > (XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 high edge) > (XEN) ACPI: IRQ0 used by override. > (XEN) ACPI: IRQ2 used by override. > (XEN) Enabling APIC mode: Flat. Using 1 I/O APICs > (XEN) Using ACPI (MADT) for SMP configuration information > (XEN) Initializing CPU#0 > (XEN) Detected 1599.572 MHz processor. > (XEN) CPU0: AMD Flush Filter disabled > (XEN) CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/ > line) > (XEN) CPU: L2 Cache: 128K (64 bytes/line) > (XEN) Intel machine check architecture supported. > (XEN) Intel machine check reporting enabled on CPU#0. > (XEN) CPU0: AMD Sempron(tm) Processor 2600+ stepping 02 > (XEN) Total of 1 processors activated. > (XEN) ENABLING IO-APIC IRQs > (XEN) ..TIMER: vector=0x31 apic1=0 pin1=2 apic2=-1 pin2=-1 > (XEN) Platform timer is 1.193MHz PIT > (XEN) Brought up 1 CPUs > (XEN) Machine check exception polling timer started. > (XEN) *** LOADING DOMAIN 0 *** > (XEN) Domain 0 kernel supports features = { 0000001f }. > (XEN) Domain 0 kernel requires features = { 00000000 }. > (XEN) PHYSICAL MEMORY ARRANGEMENT: > (XEN) Dom0 alloc.: 0a000000->0b000000 (37859 pages to be allocated) > (XEN) VIRTUAL MEMORY ARRANGEMENT: > (XEN) Loaded kernel: c0100000->c0455b7c > (XEN) Init. ramdisk: c0456000->c07e2200 > (XEN) Phys-Mach map: c07e3000->c080bf8c > (XEN) Start info: c080c000->c080d000 > (XEN) Page tables: c080d000->c0811000 > (XEN) Boot stack: c0811000->c0812000 > (XEN) TOTAL: c0000000->c0c00000 > (XEN) ENTRY ADDRESS: c0100000 > (XEN) Dom0 has maximum 1 VCPUs > (XEN) Initrd len 0x38c200, start at 0xc0456000 > (XEN) Scrubbing Free RAM: ..done. > (XEN) Xen trace buffers: disabled > (XEN) *** Serial input -> DOM0 (type ''CTRL-a'' three times to switch > input to Xen). > > [root@localhost ~]# cat /etc/redhat-release > Fedora Core release 5 (Bordeaux) > [root@localhost ~]# > > -- > Fedora-xen mailing list > Fedora-xen@redhat.com > https://www.redhat.com/mailman/listinfo/fedora-xen
>I believe the error "Error: Error creating domain: The privileged >domain did not balloon!" happens when you don''t have enough available >memory for the domU to boot. The xenguest-install.py script tells >you to restart the domain by running "xm create -c xxxx'', but I think >the error message is just a generic one that is printed if the script >crashes out, and it it is the wrong thing to do in this case. > >When I had the same problem, I had to allocate less memory to dom0 >and re-run the xenguest-install script. I see you have about 196MB >of RAM. Since the FC5 script needs 256MB of RAM, I don''t think >you''ll be able to install it unless you increase the amount of RAM >you have. But since the machine is a virtual one in VMWare, this >shouldn''t be too difficult. >Thank you for replying. Unfortunately, I tried same stuff with 512MB mem but failed. What I suspect now is, a disk image would have to be formatted. xenguest-install.py just makes plain empty sparse file, but is this enough? I suspect it should be formatted and partitioned and so on. You succeeded to do an install on FC5? How you did it? Check the code of pygrub. See this: 116 fs = None 117 for fstype in grub.fsys.fstypes.values(): 118 if fstype.sniff_magic(fn, offset): 119 fs = fstype.open_fs(fn, offset) 120 break 121 122 if fs is not None: (snip) 138 else: 139 raise RuntimeError, "Unable to read filesystem" What happened here is, in short, like this: # Check diskimage formatted as described in grub config 117 for fstype in grub.fsys.fstypes.values(): 118 if fstype.sniff_magic(fn, offset): # If not formatted properly, raise error. 138 else: 139 raise RuntimeError, "Unable to read filesystem" --- Okajima, Jun. Tokyo, Japan. ------------- [root@localhost ~]# cat -n /usr/bin/pygrub 1 #!/usr/bin/python 2 # 3 # pygrub - simple python-based bootloader for Xen 4 # 5 # Copyright 2005 Red Hat, Inc. 6 # Jeremy Katz <katzj@redhat.com> 7 # 8 # This software may be freely redistributed under the terms of the GNU 9 # general public license. 10 # 11 # You should have received a copy of the GNU General Public License 12 # along with this program; if not, write to the Free Software 13 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 14 # 15 16 import os, sys, string, struct, tempfile 17 import logging 18 19 import curses, _curses, curses.wrapper 20 import getopt 21 22 sys.path = [ ''/usr/lib/python'' ] + sys.path 23 24 import grub.GrubConf 25 import grub.fsys 26 27 PYGRUB_VER = 0.3 28 29 30 def draw_window(): 31 stdscr = curses.initscr() 32 if hasattr(curses, ''use_default_colors''): 33 curses.use_default_colors() 34 try: 35 curses.curs_set(0) 36 except _curses.error: 37 pass 38 39 stdscr.addstr(1, 4, "pyGRUB version %s" %(PYGRUB_VER,)) 40 41 win = curses.newwin(10, 74, 2, 1) 42 win.box() 43 win.refresh() 44 45 stdscr.addstr(12, 5, "Use the U and D keys to select which entry is highlighted.") 46 stdscr.addstr(13, 5, "Press enter to boot the selected OS. ''e'' to edit the") 47 stdscr.addstr(14, 5, "commands before booting, ''a'' to modify the kernel arguments ") 48 stdscr.addstr(15, 5, "before booting, or ''c'' for a command line.") 49 stdscr.addch(12, 13, curses.ACS_UARROW) 50 stdscr.addch(12, 19, curses.ACS_DARROW) 51 (y, x) = stdscr.getmaxyx() 52 stdscr.move(y - 1, x - 1) 53 54 stdscr.refresh() 55 return (stdscr, win) 56 57 def fill_entries(win, cfg, selected): 58 y = 0 59 60 for i in cfg.images: 61 if (0, y) > win.getmaxyx(): 62 break 63 if y == selected: 64 attr = curses.A_REVERSE 65 else: 66 attr = 0 67 win.addstr(y + 1, 2, i.title.ljust(70), attr) 68 y += 1 69 win.refresh() 70 71 def select(win, line): 72 win.attron(curses.A_REVERSE) 73 win.redrawln(line + 1, 1) 74 win.refresh() 75 76 def is_disk_image(file): 77 fd = os.open(file, os.O_RDONLY) 78 buf = os.read(fd, 512) 79 os.close(fd) 80 81 if len(buf) >= 512 and struct.unpack("H", buf[0x1fe: 0x200]) == (0xaa55,): 82 return True 83 return False 84 85 SECTOR_SIZE=512 86 def get_active_offset(file): 87 """Find the offset for the start of the first active partition in the 88 disk image file.""" 89 fd = os.open(file, os.O_RDONLY) 90 buf = os.read(fd, 512) 91 for poff in (446, 462, 478, 494): # partition offsets 92 # active partition has 0x80 as the first byte 93 if struct.unpack("<c", buf[poff:poff+1]) == (''\x80'',): 94 return struct.unpack("<L", buf[poff+8:poff+12])[0] * SECTOR_SIZE 95 return -1 96 97 def get_config(fn, isconfig = False): 98 if not os.access(fn, os.R_OK): 99 raise RuntimeError, "Unable to access %s" %(fn,) 100 101 cf = grub.GrubConf.GrubConfigFile() 102 103 if isconfig: 104 # set the config file and parse it 105 cf.filename = fn 106 cf.parse() 107 return cf 108 109 offset = 0 110 if is_disk_image(fn): 111 offset = get_active_offset(fn) 112 if offset == -1: 113 raise RuntimeError, "Unable to find active partition on disk" 114 115 # open the image and read the grub config 116 fs = None 117 for fstype in grub.fsys.fstypes.values(): 118 if fstype.sniff_magic(fn, offset): 119 fs = fstype.open_fs(fn, offset) 120 break 121 122 if fs is not None: 123 grubfile = None 124 for f in ("/boot/grub/menu.lst", "/boot/grub/grub.conf", 125 "/grub/menu.lst", "/grub/grub.conf"): 126 if fs.file_exist(f): 127 grubfile = f 128 break 129 if grubfile is None: 130 raise RuntimeError, "we couldn''t find /boot/grub{menu.lst,grub.conf} " + \ 131 "in the image provided. halt!" 132 f = fs.open_file(grubfile) 133 buf = f.read() 134 f.close() 135 fs.close() 136 # then parse the grub config 137 cf.parse(buf) 138 else: 139 raise RuntimeError, "Unable to read filesystem" 140 141 return cf 142 143 def get_entry_idx(cf, entry): 144 # first, see if the given entry is numeric 145 try: 146 idx = string.atoi(entry) 147 return idx 148 except ValueError: 149 pass 150 151 # it''s not, now check the labels for a match 152 for i in range(len(cf.images)): 153 if entry == cf.images[i].title: 154 return i 155 156 return None 157 158 def main(cf = None): 159 mytime = 0 160 timeout = int(cf.timeout) 161 162 (stdscr, win) = draw_window() 163 stdscr.timeout(1000) 164 selected = cf.default 165 166 while (timeout == -1 or mytime < int(timeout)): 167 if timeout != -1 and mytime != -1: 168 stdscr.addstr(20, 5, "Will boot selected entry in %2d seconds" 169 %(int(timeout) - mytime)) 170 else: 171 stdscr.addstr(20, 5, " " * 80) 172 173 fill_entries(win, cf, selected) 174 c = stdscr.getch() 175 if mytime != -1: 176 mytime += 1 177 # if c == ord(''q''): 178 # selected = -1 179 # break 180 if c == ord(''c''): 181 # FIXME: needs to go to command line mode 182 continue 183 elif c == ord(''a''): 184 # FIXME: needs to go to append mode 185 continue 186 elif c == ord(''e''): 187 # FIXME: needs to go to edit mode 188 continue 189 elif c in (curses.KEY_ENTER, ord(''\n''), ord(''\r'')): 190 break 191 elif c == curses.KEY_UP: 192 mytime = -1 193 selected -= 1 194 elif c == curses.KEY_DOWN: 195 mytime = -1 196 selected += 1 197 else: 198 pass 199 200 # bound at the top and bottom 201 if selected < 0: 202 selected = 0 203 elif selected >= len(cf.images): 204 selected = len(cf.images) - 1 205 206 if selected >= 0: 207 return selected 208 209 if __name__ == "__main__": 210 sel = None 211 212 def run_main(scr, *args): 213 global sel 214 sel = main(cf) 215 216 def usage(): 217 print >> sys.stderr, "Usage: %s [-q|--quiet] [--output=] [--entry=] <image>" % (sys.argv[0],) 218 219 try: 220 opts, args = getopt.gnu_getopt(sys.argv[1:], ''qh::'', 221 ["quiet", "help", "output=", "entry=", 222 "isconfig"]) 223 except getopt.GetoptError: 224 usage() 225 sys.exit(1) 226 227 if len(args) < 1: 228 usage() 229 sys.exit(1) 230 file = args[0] 231 232 output = None 233 entry = None 234 interactive = True 235 isconfig = False 236 for o, a in opts: 237 if o in ("-q", "--quiet"): 238 interactive = False 239 elif o in ("-h", "--help"): 240 usage() 241 sys.exit() 242 elif o in ("--output",): 243 output = a 244 elif o in ("--entry",): 245 entry = a 246 # specifying the entry to boot implies non-interactive 247 interactive = False 248 elif o in ("--isconfig",): 249 isconfig = True 250 251 if output is None or output == "-": 252 fd = sys.stdout.fileno() 253 else: 254 fd = os.open(output, os.O_WRONLY) 255 256 cf = get_config(file, isconfig) 257 if interactive: 258 curses.wrapper(run_main) 259 else: 260 sel = cf.default 261 262 # set the entry to boot as requested 263 if entry is not None: 264 idx = get_entry_idx(cf, entry) 265 if idx is not None and idx > 0 and idx < len(cf.images): 266 sel = idx 267 268 img = cf.images[sel] 269 print "Going to boot %s" %(img.title) 270 print " kernel: %s" %(img.kernel[1],) 271 if img.initrd: 272 print " initrd: %s" %(img.initrd[1],) 273 274 offset = 0 275 if is_disk_image(file): 276 offset = get_active_offset(file) 277 if offset == -1: 278 raise RuntimeError, "Unable to find active partition on disk" 279 280 # read the kernel and initrd onto the hostfs 281 fs = None 282 for fstype in grub.fsys.fstypes.values(): 283 if fstype.sniff_magic(file, offset): 284 fs = fstype.open_fs(file, offset) 285 break 286 287 if fs is None: 288 raise RuntimeError, "Unable to open filesystem" 289 290 kernel = fs.open_file(img.kernel[1],).read() 291 (tfd, fn) = tempfile.mkstemp(prefix="vmlinuz.", dir="/var/lib/xen") 292 os.write(tfd, kernel) 293 os.close(tfd) 294 sxp = "linux (kernel %s)" %(fn,) 295 296 if img.initrd: 297 initrd = fs.open_file(img.initrd[1],).read() 298 (tfd, fn) = tempfile.mkstemp(prefix="initrd.", dir="/var/lib/xen") 299 os.write(tfd, initrd) 300 os.close(tfd) 301 sxp += "(ramdisk %s)" %(fn,) 302 else: 303 initrd = None 304 sxp += "(args ''%s'')" %(img.args,) 305 306 sys.stdout.flush() 307 os.write(fd, sxp) 308 [root@localhost ~]#
On Po, dub 03, 2006 at 01:40:01 +0900, Jun OKAJIMA wrote:> Unfortunately, I tried same stuff with 512MB mem but failed. > What I suspect now is, a disk image would have to be formatted. > xenguest-install.py just makes plain empty sparse file, but is this > enough? I suspect it should be formatted and partitioned and so on.No. The empty file is enough, because xenguest-install.py doesn''t use pygrub for domU installation boot. You need prepare your virtual disk by anaconda which is started by xenguest-install.py. The pygrub script is possible use for already __successfully__ installed domU only. Karel -- Karel Zak <kzak@redhat.com>
The installer will create the disk image and partition it. If you do not successfully run to the installer, "xm create -c xxxx" will not work. The script gives bad instructions when an error occurs. The Xen hypervisor takes 32MB of RAM (I think), so you have to make sure that your dom0 gets less than 224MB. I gave mine 192MB, with the following in grub.conf: kernel /xen.gz-2.6.15-1.2054_FC5 dom0_mem=196608 In my opinion, the xenguest-install.py method isn''t very good at this point. - The installer gives poor feedback when something goes wrong, like when memory is too low. - pygrub crashes if your terminal emulation is a little weird - It creates a whole disk image instead of importing partitions. This makes it difficult to access domU filesystems from dom0, but this is often necessary for management. - It doesn''t provide an option for creating images on LVM volumes. An easier solution might be to use the FC5 image from jailtime.org. If you use the images from their site, keep in mind that you have to use a kernel from outside of the image; the kernel would have to be readable from your dom0. If you use the stock FC5-xenU kernel, it does not have the xennet driver compiled in. You would have to install the kernel-xenU package onto the domU disk image to provide the necessary driver (assuming the disk image is mounted at /mnt/tmp): yum --installroot=/mnt/tmp install kernel-xenU And add the following to the domU''s /etc/modprobe.conf: alias eth0 xennet Or you could use a kernel from xensource that has the xennet driver compiled into the kernel. I don''t know why the developers decided to take the driver out of the kernel. Pretty much everyone would want networking on their domU machines, and adding it in this way is just more complicated. --Winston On Apr 2, 2006, at 12:40 PM, Jun OKAJIMA wrote:> >> I believe the error "Error: Error creating domain: The privileged >> domain did not balloon!" happens when you don''t have enough available >> memory for the domU to boot. The xenguest-install.py script tells >> you to restart the domain by running "xm create -c xxxx'', but I think >> the error message is just a generic one that is printed if the script >> crashes out, and it it is the wrong thing to do in this case. >> >> When I had the same problem, I had to allocate less memory to dom0 >> and re-run the xenguest-install script. I see you have about 196MB >> of RAM. Since the FC5 script needs 256MB of RAM, I don''t think >> you''ll be able to install it unless you increase the amount of RAM >> you have. But since the machine is a virtual one in VMWare, this >> shouldn''t be too difficult. >> > > > Thank you for replying. > Unfortunately, I tried same stuff with 512MB mem but failed. > What I suspect now is, a disk image would have to be formatted. > xenguest-install.py just makes plain empty sparse file, but is this > enough? I suspect it should be formatted and partitioned and so on. > You succeeded to do an install on FC5? How you did it? > > Check the code of pygrub. > See this: > 116 fs = None > 117 for fstype in grub.fsys.fstypes.values(): > 118 if fstype.sniff_magic(fn, offset): > 119 fs = fstype.open_fs(fn, offset) > 120 break > 121 > 122 if fs is not None: > (snip) > 138 else: > 139 raise RuntimeError, "Unable to read filesystem" > > What happened here is, in short, like this: > > # Check diskimage formatted as described in grub config > 117 for fstype in grub.fsys.fstypes.values(): > 118 if fstype.sniff_magic(fn, offset): > # If not formatted properly, raise error. > 138 else: > 139 raise RuntimeError, "Unable to read filesystem" > > --- Okajima, Jun. Tokyo, Japan. > > > ------------- > [root@localhost ~]# cat -n /usr/bin/pygrub > 1 #!/usr/bin/python > 2 # > 3 # pygrub - simple python-based bootloader for Xen > 4 # > 5 # Copyright 2005 Red Hat, Inc. > 6 # Jeremy Katz <katzj@redhat.com> > 7 # > 8 # This software may be freely redistributed under the terms > of the GNU > 9 # general public license. > 10 # > 11 # You should have received a copy of the GNU General Public > License > 12 # along with this program; if not, write to the Free Software > 13 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > 14 # > 15 > 16 import os, sys, string, struct, tempfile > 17 import logging > 18 > 19 import curses, _curses, curses.wrapper > 20 import getopt > 21 > 22 sys.path = [ ''/usr/lib/python'' ] + sys.path > 23 > 24 import grub.GrubConf > 25 import grub.fsys > 26 > 27 PYGRUB_VER = 0.3 > 28 > 29 > 30 def draw_window(): > 31 stdscr = curses.initscr() > 32 if hasattr(curses, ''use_default_colors''): > 33 curses.use_default_colors() > 34 try: > 35 curses.curs_set(0) > 36 except _curses.error: > 37 pass > 38 > 39 stdscr.addstr(1, 4, "pyGRUB version %s" %(PYGRUB_VER,)) > 40 > 41 win = curses.newwin(10, 74, 2, 1) > 42 win.box() > 43 win.refresh() > 44 > 45 stdscr.addstr(12, 5, "Use the U and D keys to select > which entry is highlighted.") > 46 stdscr.addstr(13, 5, "Press enter to boot the selected > OS. ''e'' to edit the") > 47 stdscr.addstr(14, 5, "commands before booting, ''a'' to > modify the kernel arguments ") > 48 stdscr.addstr(15, 5, "before booting, or ''c'' for a > command line.") > 49 stdscr.addch(12, 13, curses.ACS_UARROW) > 50 stdscr.addch(12, 19, curses.ACS_DARROW) > 51 (y, x) = stdscr.getmaxyx() > 52 stdscr.move(y - 1, x - 1) > 53 > 54 stdscr.refresh() > 55 return (stdscr, win) > 56 > 57 def fill_entries(win, cfg, selected): > 58 y = 0 > 59 > 60 for i in cfg.images: > 61 if (0, y) > win.getmaxyx(): > 62 break > 63 if y == selected: > 64 attr = curses.A_REVERSE > 65 else: > 66 attr = 0 > 67 win.addstr(y + 1, 2, i.title.ljust(70), attr) > 68 y += 1 > 69 win.refresh() > 70 > 71 def select(win, line): > 72 win.attron(curses.A_REVERSE) > 73 win.redrawln(line + 1, 1) > 74 win.refresh() > 75 > 76 def is_disk_image(file): > 77 fd = os.open(file, os.O_RDONLY) > 78 buf = os.read(fd, 512) > 79 os.close(fd) > 80 > 81 if len(buf) >= 512 and struct.unpack("H", buf[0x1fe: > 0x200]) == (0xaa55,): > 82 return True > 83 return False > 84 > 85 SECTOR_SIZE=512 > 86 def get_active_offset(file): > 87 """Find the offset for the start of the first active > partition in the > 88 disk image file.""" > 89 fd = os.open(file, os.O_RDONLY) > 90 buf = os.read(fd, 512) > 91 for poff in (446, 462, 478, 494): # partition offsets > 92 # active partition has 0x80 as the first byte > 93 if struct.unpack("<c", buf[poff:poff+1]) == (''\x80'',): > 94 return struct.unpack("<L", buf[poff+8:poff+12]) > [0] * SECTOR_SIZE > 95 return -1 > 96 > 97 def get_config(fn, isconfig = False): > 98 if not os.access(fn, os.R_OK): > 99 raise RuntimeError, "Unable to access %s" %(fn,) > 100 > 101 cf = grub.GrubConf.GrubConfigFile() > 102 > 103 if isconfig: > 104 # set the config file and parse it > 105 cf.filename = fn > 106 cf.parse() > 107 return cf > 108 > 109 offset = 0 > 110 if is_disk_image(fn): > 111 offset = get_active_offset(fn) > 112 if offset == -1: > 113 raise RuntimeError, "Unable to find active > partition on disk" > 114 > 115 # open the image and read the grub config > 116 fs = None > 117 for fstype in grub.fsys.fstypes.values(): > 118 if fstype.sniff_magic(fn, offset): > 119 fs = fstype.open_fs(fn, offset) > 120 break > 121 > 122 if fs is not None: > 123 grubfile = None > 124 for f in ("/boot/grub/menu.lst", "/boot/grub/ > grub.conf", > 125 "/grub/menu.lst", "/grub/grub.conf"): > 126 if fs.file_exist(f): > 127 grubfile = f > 128 break > 129 if grubfile is None: > 130 raise RuntimeError, "we couldn''t find /boot/grub > {menu.lst,grub.conf} " + \ > 131 "in the image provided. halt!" > 132 f = fs.open_file(grubfile) > 133 buf = f.read() > 134 f.close() > 135 fs.close() > 136 # then parse the grub config > 137 cf.parse(buf) > 138 else: > 139 raise RuntimeError, "Unable to read filesystem" > 140 > 141 return cf > 142 > 143 def get_entry_idx(cf, entry): > 144 # first, see if the given entry is numeric > 145 try: > 146 idx = string.atoi(entry) > 147 return idx > 148 except ValueError: > 149 pass > 150 > 151 # it''s not, now check the labels for a match > 152 for i in range(len(cf.images)): > 153 if entry == cf.images[i].title: > 154 return i > 155 > 156 return None > 157 > 158 def main(cf = None): > 159 mytime = 0 > 160 timeout = int(cf.timeout) > 161 > 162 (stdscr, win) = draw_window() > 163 stdscr.timeout(1000) > 164 selected = cf.default > 165 > 166 while (timeout == -1 or mytime < int(timeout)): > 167 if timeout != -1 and mytime != -1: > 168 stdscr.addstr(20, 5, "Will boot selected entry > in %2d seconds" > 169 %(int(timeout) - mytime)) > 170 else: > 171 stdscr.addstr(20, 5, " " * 80) > 172 > 173 fill_entries(win, cf, selected) > 174 c = stdscr.getch() > 175 if mytime != -1: > 176 mytime += 1 > 177 # if c == ord(''q''): > 178 # selected = -1 > 179 # break > 180 if c == ord(''c''): > 181 # FIXME: needs to go to command line mode > 182 continue > 183 elif c == ord(''a''): > 184 # FIXME: needs to go to append mode > 185 continue > 186 elif c == ord(''e''): > 187 # FIXME: needs to go to edit mode > 188 continue > 189 elif c in (curses.KEY_ENTER, ord(''\n''), ord(''\r'')): > 190 break > 191 elif c == curses.KEY_UP: > 192 mytime = -1 > 193 selected -= 1 > 194 elif c == curses.KEY_DOWN: > 195 mytime = -1 > 196 selected += 1 > 197 else: > 198 pass > 199 > 200 # bound at the top and bottom > 201 if selected < 0: > 202 selected = 0 > 203 elif selected >= len(cf.images): > 204 selected = len(cf.images) - 1 > 205 > 206 if selected >= 0: > 207 return selected > 208 > 209 if __name__ == "__main__": > 210 sel = None > 211 > 212 def run_main(scr, *args): > 213 global sel > 214 sel = main(cf) > 215 > 216 def usage(): > 217 print >> sys.stderr, "Usage: %s [-q|--quiet] [-- > output=] [--entry=] <image>" % > (sys.argv[0],) > 218 > 219 try: > 220 opts, args = getopt.gnu_getopt(sys.argv[1:], ''qh::'', > 221 ["quiet", "help", > "output=", "entry=", > 222 "isconfig"]) > 223 except getopt.GetoptError: > 224 usage() > 225 sys.exit(1) > 226 > 227 if len(args) < 1: > 228 usage() > 229 sys.exit(1) > 230 file = args[0] > 231 > 232 output = None > 233 entry = None > 234 interactive = True > 235 isconfig = False > 236 for o, a in opts: > 237 if o in ("-q", "--quiet"): > 238 interactive = False > 239 elif o in ("-h", "--help"): > 240 usage() > 241 sys.exit() > 242 elif o in ("--output",): > 243 output = a > 244 elif o in ("--entry",): > 245 entry = a > 246 # specifying the entry to boot implies non- > interactive > 247 interactive = False > 248 elif o in ("--isconfig",): > 249 isconfig = True > 250 > 251 if output is None or output == "-": > 252 fd = sys.stdout.fileno() > 253 else: > 254 fd = os.open(output, os.O_WRONLY) > 255 > 256 cf = get_config(file, isconfig) > 257 if interactive: > 258 curses.wrapper(run_main) > 259 else: > 260 sel = cf.default > 261 > 262 # set the entry to boot as requested > 263 if entry is not None: > 264 idx = get_entry_idx(cf, entry) > 265 if idx is not None and idx > 0 and idx < len > (cf.images): > 266 sel = idx > 267 > 268 img = cf.images[sel] > 269 print "Going to boot %s" %(img.title) > 270 print " kernel: %s" %(img.kernel[1],) > 271 if img.initrd: > 272 print " initrd: %s" %(img.initrd[1],) > 273 > 274 offset = 0 > 275 if is_disk_image(file): > 276 offset = get_active_offset(file) > 277 if offset == -1: > 278 raise RuntimeError, "Unable to find active > partition on disk" > 279 > 280 # read the kernel and initrd onto the hostfs > 281 fs = None > 282 for fstype in grub.fsys.fstypes.values(): > 283 if fstype.sniff_magic(file, offset): > 284 fs = fstype.open_fs(file, offset) > 285 break > 286 > 287 if fs is None: > 288 raise RuntimeError, "Unable to open filesystem" > 289 > 290 kernel = fs.open_file(img.kernel[1],).read() > 291 (tfd, fn) = tempfile.mkstemp(prefix="vmlinuz.", dir="/ > var/lib/xen") > 292 os.write(tfd, kernel) > 293 os.close(tfd) > 294 sxp = "linux (kernel %s)" %(fn,) > 295 > 296 if img.initrd: > 297 initrd = fs.open_file(img.initrd[1],).read() > 298 (tfd, fn) = tempfile.mkstemp(prefix="initrd.", > dir="/var/lib/xen") > 299 os.write(tfd, initrd) > 300 os.close(tfd) > 301 sxp += "(ramdisk %s)" %(fn,) > 302 else: > 303 initrd = None > 304 sxp += "(args ''%s'')" %(img.args,) > 305 > 306 sys.stdout.flush() > 307 os.write(fd, sxp) > 308 > [root@localhost ~]#
>> Unfortunately, I tried same stuff with 512MB mem but failed. >> What I suspect now is, a disk image would have to be formatted. >> xenguest-install.py just makes plain empty sparse file, but is this >> enough? I suspect it should be formatted and partitioned and so on. > > No. The empty file is enough, because xenguest-install.py doesn''t use > pygrub for domU installation boot. You need prepare your virtual disk > by anaconda which is started by xenguest-install.py. The pygrub > script is possible use for already __successfully__ installed domU > only. >Ummm... You mean I have to start anaconda/XenU stuff first, but I dont have felt that I have succeeded to do so, although I dont have understanded what xenguest-install.py does yet. --- Okajima, Jun. Tokyo, Japan.
Jun OKAJIMA
2006-Apr-03 11:24 UTC
jailtime.org failed also (was:Re: [Fedora-xen] pygrub failed)
>The installer will create the disk image and partition it. If you do >not successfully run to the installer, "xm create -c xxxx" will not >work. The script gives bad instructions when an error occurs. > >The Xen hypervisor takes 32MB of RAM (I think), so you have to make >sure that your dom0 gets less than 224MB. I gave mine 192MB, with >the following in grub.conf: > kernel /xen.gz-2.6.15-1.2054_FC5 dom0_mem=196608 > > >In my opinion, the xenguest-install.py method isn''t very good at this >point. >- The installer gives poor feedback when something goes wrong, like >when memory is too low. >- pygrub crashes if your terminal emulation is a little weird >- It creates a whole disk image instead of importing partitions. >This makes it difficult to access domU filesystems from dom0, but >this is often necessary for management. >- It doesn''t provide an option for creating images on LVM volumes. > > > >An easier solution might be to use the FC5 image from jailtime.org. >If you use the images from their site, keep in mind that you have to >use a kernel from outside of the image; the kernel would have to be >readable from your dom0. > >If you use the stock FC5-xenU kernel, it does not have the xennet >driver compiled in. You would have to install the kernel-xenU >package onto the domU disk image to provide the necessary driver >(assuming the disk image is mounted at /mnt/tmp): > yum --installroot=/mnt/tmp install kernel-xenU >And add the following to the domU''s /etc/modprobe.conf: > alias eth0 xennet > >Or you could use a kernel from xensource that has the xennet driver >compiled into the kernel. I don''t know why the developers decided to >take the driver out of the kernel. Pretty much everyone would want >networking on their domU machines, and adding it in this way is just >more complicated. > > >Thank you for suggestive advise. but, I have been still working on the issue. I tried to use a ready made image from jailtime.org, but still it does not work. Why os.path.isfile(self.kernel) fails? --- Okajima, Jun. Tokyo, Japan. ------------- [root@localhost okajima]# xm create -c fedora.fc5.xen.cfg Using config file "fedora.fc5.xen.cfg". Warning: The nics option is deprecated. Please use an empty vif entry instead: vif = [ '''' ] Error: Error creating domain: Kernel image does not exist: /boot/vmlinuz-2.6.16-1.2080_FC5xenU [root@localhost okajima]# ls -la /boot/vmlinuz-2.6.16-1.2080_FC5xenU -rw-r--r-- 1 root root 1232494 Mar 28 18:38 /boot/vmlinuz-2.6.16-1.2080_FC5xenU [root@localhost okajima]# md5sum /boot/vmlinuz-2.6.16-1.2080_FC5xenU 242c2a1cfeb924481ba57e983cbe801e /boot/vmlinuz-2.6.16-1.2080_FC5xenU [root@localhost okajima]# ls -l /usr/lib/xen/boot/ total 160 -rwxr-xr-x 1 root root 153797 Mar 9 14:20 hvmloader [root@localhost okajima]# md5sum /usr/lib/xen/boot/hvmloader 2bbd4cf936aa8bde3ab6b6fe31362ff0 /usr/lib/xen/boot/hvmloader [root@localhost okajima]# cat fedora.fc5.xen.cfg kernel = "/boot/vmlinuz-2.6.16-1.2080_FC5xenU" #kernel = "/boot/vmlinuz-2.6-xenU" memory = 128 name = "fedora.fc5" nics = 1 dhcp = "dhcp" disk = [''file:/home/okajima/fedora.fc5.img,sda1,w'', ''file:/home/okajima/fedora.swap,sda2,w''] root = "/dev/sda1 ro" [root@localhost okajima]# grep -3 -ir "Kernel image does not exist" /usr/lib/python2.4/site-packages/ * Binary file /usr/lib/python2.4/site-packages/xen/xend/image.pyo matches -- /usr/lib/python2.4/site-packages/xen/xend/image.py- # Set params and call buildDomain(). /usr/lib/python2.4/site-packages/xen/xend/image.py- /usr/lib/python2.4/site-packages/xen/xend/image.py- if not os.path.isfile(self.kernel): /usr/lib/python2.4/site-packages/xen/xend/image.py: raise VmError(''Kernel image does not exist: %s'' % self.kernel) /usr/lib/python2.4/site-packages/xen/xend/image.py- if self.ramdisk and not os.path.isfile (self.ramdisk): /usr/lib/python2.4/site-packages/xen/xend/image.py- raise VmError(''Kernel ramdisk does not exist: %s'' % self.ramdisk) /usr/lib/python2.4/site-packages/xen/xend/image.py- if len(self.cmdline) >= MAX_GUEST_CMDLINE: Binary file /usr/lib/python2.4/site-packages/xen/xend/image.pyc matches [root@localhost okajima]#
On Mon, 3 Apr 2006, Jun OKAJIMA wrote:> What happened here is, in short, like this: > > # Check diskimage formatted as described in grub config > 117 for fstype in grub.fsys.fstypes.values(): > 118 if fstype.sniff_magic(fn, offset): > # If not formatted properly, raise error. > 138 else: > 139 raise RuntimeError, "Unable to read filesystem"I''m also seeing an error raised here, after a successful anaconda over vnc install, without any memory issues. I''ve since mounted the partition from the image and it seems ok. Perhaps something not quite right in the fs image detection code? - James -- James Morris <jmorris@redhat.com>
Hi, On Mon, 2006-04-03 at 20:16 +0900, Jun OKAJIMA wrote:> > No. The empty file is enough, because xenguest-install.py doesn''t use > > pygrub for domU installation boot. You need prepare your virtual disk > > by anaconda which is started by xenguest-install.py. The pygrub > > script is possible use for already __successfully__ installed domU > > only.> Ummm... You mean I have to start anaconda/XenU stuff first,Yes, but...> but I dont have felt that I have succeeded to do so, although > I dont have understanded what xenguest-install.py does yet.You don''t have to start it yourself: xenguest-install.py will do it for you automatically. --Stephen
Hi, On Sun, 2006-04-02 at 22:09 -0400, Winston Chang wrote:> The installer will create the disk image and partition it. If you do > not successfully run to the installer, "xm create -c xxxx" will not > work. The script gives bad instructions when an error occurs. > > The Xen hypervisor takes 32MB of RAM (I think), so you have to make > sure that your dom0 gets less than 224MB. I gave mine 192MB, with > the following in grub.conf: > kernel /xen.gz-2.6.15-1.2054_FC5 dom0_mem=196608Actually, you should be able to do that manually with xm mem-set 0 192 to balloon the dom0 down to 192MB. It won''t balloon automatically below 256MB, but can do so if explicitly told to.> In my opinion, the xenguest-install.py method isn''t very good at this > point. > - The installer gives poor feedback when something goes wrong, like > when memory is too low.Agreed, it could well be improved.> - pygrub crashes if your terminal emulation is a little weird > - It creates a whole disk image instead of importing partitions. > This makes it difficult to access domU filesystems from dom0, but > this is often necessary for management.That''s just part of the goal of making the domU environment as similar as possible to the dom0. Having a single disk image passed in means you can keep boot info, root fs and swap all in the same place in the host OS.> - It doesn''t provide an option for creating images on LVM volumes.If you already have an LVM volume, you can simply specify that and it just works (most of my test xen installs are to LVM.)> Or you could use a kernel from xensource that has the xennet driver > compiled into the kernel. I don''t know why the developers decided to > take the driver out of the kernel.The default networking with Xen uses netfront/back and bridging, so that''s what we compile in. Is there really a strong need for xennet too?> Pretty much everyone would want > networking on their domU machines, and adding it in this way is just > more complicated.With FC-5 default networking, things just work (though it definitely can interact badly with more complex networking setups); what exactly is complicated and needs fixed? --Stephen
Hi, On Mon, 2006-04-03 at 12:18 -0400, James Morris wrote:> On Mon, 3 Apr 2006, Jun OKAJIMA wrote: > > > What happened here is, in short, like this: > > > > # Check diskimage formatted as described in grub config > > 117 for fstype in grub.fsys.fstypes.values(): > > 118 if fstype.sniff_magic(fn, offset): > > # If not formatted properly, raise error. > > 138 else: > > 139 raise RuntimeError, "Unable to read filesystem" > > I''m also seeing an error raised here, after a successful anaconda over vnc > install, without any memory issues. I''ve since mounted the partition from > the image and it seems ok. > > Perhaps something not quite right in the fs image detection code?Hmm --- did you create a manual partition layout, or did you just use the default one provided by the installer? If it''s a manual layout, then the problem may be that you (or the installer) didn''t set the "active" flag on the partition containing the kernel images. pygrub looks for that to know which partition to try booting from. --Stephen
On Mon, 3 Apr 2006, Stephen C. Tweedie wrote:> Hmm --- did you create a manual partition layout, or did you just use > the default one provided by the installer?It was a standard layout, although I did select minimal packages (shouldn''t affect it, I hope).> If it''s a manual layout, then the problem may be that you (or the > installer) didn''t set the "active" flag on the partition containing the > kernel images. pygrub looks for that to know which partition to try > booting from.# fdisk -l xt4-disk last_lba(): I don''t know how to handle files with mode 81ed You must set cylinders. You can do this from the extra functions menu. Disk xt4-disk: 0 MB, 0 bytes 255 heads, 63 sectors/track, 0 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System xt4-disk1 * 1 13 104391 83 Linux xt4-disk2 14 261 1992060 8e Linux LVM # losetup -o 32256 /dev/loop0 xt4-disk # fsck.ext3 -v /dev/loop0 e2fsck 1.38 (30-Jun-2005) /boot: clean, 32/26104 files, 12598/104388 blocks Look ok? - James -- James Morris <jmorris@redhat.com>
Hi, On Mon, 2006-04-03 at 15:57 -0400, James Morris wrote:> # fdisk -l xt4-disk > last_lba(): I don''t know how to handle files with mode 81ed > You must set cylinders. > You can do this from the extra functions menu. > > Disk xt4-disk: 0 MB, 0 bytes > 255 heads, 63 sectors/track, 0 cylinders > Units = cylinders of 16065 * 512 = 8225280 bytesThat''s all normal;> > Device Boot Start End Blocks Id System > xt4-disk1 * 1 13 104391 83 Linux > xt4-disk2 14 261 1992060 8e Linux LVMlooks fine. Hmm.> # losetup -o 32256 /dev/loop0 xt4-disk > # fsck.ext3 -v /dev/loop0 > e2fsck 1.38 (30-Jun-2005) > /boot: clean, 32/26104 files, 12598/104388 blocksDoes it seem to contain the correct boot files? --Stephen
On Mon, 3 Apr 2006, Stephen C. Tweedie wrote:> > # losetup -o 32256 /dev/loop0 xt4-disk > > # fsck.ext3 -v /dev/loop0 > > e2fsck 1.38 (30-Jun-2005) > > /boot: clean, 32/26104 files, 12598/104388 blocks > > Does it seem to contain the correct boot files?Yes, as far as I can tell: # ls -l total 3456 -rw-r--r-- 1 root root 28213 Mar 14 16:58 config-2.6.15-1.2054_FC5xenU drwxr-xr-x 2 root root 1024 Mar 30 19:32 grub -rw-r--r-- 1 root root 1601303 Mar 30 19:31 initrd-2.6.15-1.2054_FC5xenU.img drwx------ 2 root root 12288 Mar 30 19:26 lost+found -rw-r--r-- 1 root root 637784 Mar 14 16:58 System.map-2.6.15-1.2054_FC5xenU -rw-r--r-- 1 root root 1232540 Mar 14 16:58 vmlinuz-2.6.15-1.2054_FC5xenU # ls -l grub total 203 -rw-r--r-- 1 root root 64 Mar 30 19:32 device.map -rw-r--r-- 1 root root 7424 Mar 30 19:32 e2fs_stage1_5 -rw-r--r-- 1 root root 7328 Mar 30 19:32 fat_stage1_5 -rw-r--r-- 1 root root 6592 Mar 30 19:32 ffs_stage1_5 -rw------- 1 root root 621 Mar 30 19:32 grub.conf -rw-r--r-- 1 root root 6592 Mar 30 19:32 iso9660_stage1_5 -rw-r--r-- 1 root root 8032 Mar 30 19:32 jfs_stage1_5 lrwxrwxrwx 1 root root 11 Mar 30 19:32 menu.lst -> ./grub.conf -rw-r--r-- 1 root root 6752 Mar 30 19:32 minix_stage1_5 -rw-r--r-- 1 root root 9056 Mar 30 19:32 reiserfs_stage1_5 -rw-r--r-- 1 root root 7028 Feb 28 23:41 splash.xpm.gz -rw-r--r-- 1 root root 512 Mar 30 19:32 stage1 -rw-r--r-- 1 root root 102332 Mar 30 19:32 stage2 -rw-r--r-- 1 root root 6944 Mar 30 19:32 ufs2_stage1_5 -rw-r--r-- 1 root root 6144 Mar 30 19:32 vstafs_stage1_5 -rw-r--r-- 1 root root 8768 Mar 30 19:32 xfs_stage1_5 -- James Morris <jmorris@redhat.com>
>> - It creates a whole disk image instead of importing partitions. >> This makes it difficult to access domU filesystems from dom0, but >> this is often necessary for management. > > That''s just part of the goal of making the domU environment as similar > as possible to the dom0. Having a single disk image passed in > means you > can keep boot info, root fs and swap all in the same place in the host > OS.I understand the motivation here, but it does make it much harder to manipulate the domU filesystem from dom0. I personally couldn''t figure out how to mount a domU partition when using the whole-disk method. I imagine that it''s even more complicated when the domU has its own LVM volumes. This issue aside, I do like the idea of having a single disk image for each domU, though, since it keeps things simple. It''s nice to have the kernel, swap partition, and main partition (and whatever else) all in one place. But it seems very inelegant to use the ancient DOS partitioning scheme and then put LVM on top of it. Things would be simpler if a domU could start out with LVM right on top of the disk image, like if you ran ''pvcreate /dev/sda'' in the domU. Then you wouldn''t need a separate /boot partition; it could be just another LVM volume. I know that this is problematic for "real" installations of Linux, because of the BIOS <1024 cylinder limitation (is that still an issue?), and because grub doesn''t understand LVM. But the first limitation simply doesn''t exist with a domU under Xen (I hope), and the second can be worked around -- I imagine that making pygrub understand LVM would be easier than making grub understand LVM, since there aren''t the same memory/space limitations. In short, why emulate all crufty old mechanics of booting and partitioning a PC when Xen provides a way to (finally) avoid it? You would lose the ability to image a domU disk image right onto a real disk and then boot a real machine with that disk, but I think that''s the only thing, and it''s pretty minor.>> - It doesn''t provide an option for creating images on LVM volumes. > > If you already have an LVM volume, you can simply specify that and it > just works (most of my test xen installs are to LVM.)That''s good to know... The script doesn''t make it clear that it has that capability. If I remember right, I tried that, and the config file said file:/dev/VolGroup00/fc5_root, or something like that instead of phy:.., which seems like an error. (I was still having other Xen problems so I never got it working this way.) The LVM volume already has a size, so what happens when you specify a disk image size to the installer script?>> Or you could use a kernel from xensource that has the xennet driver >> compiled into the kernel. I don''t know why the developers decided to >> take the driver out of the kernel. > > The default networking with Xen uses netfront/back and bridging, so > that''s what we compile in. Is there really a strong need for xennet > too?I''m not an expert on Xen network drivers... All I know is that when I booted the jailtime.org FC5 image (and a Centos 4.2 image that I created myself) using the stock FC5 xenU kernel, that it would say there was no eth0 on boot. I managed to get eth0 to show up by loading the xennet kernel module, as recommended by someone on the xensource xen-users list. If there''s way to get a domU''s eth0 to show up using the stock XenU kernel and without loading a module, that would be great. How would I do this? --Winston