[libvirt] virsh create Guest Crashing

An image that comes up successfully is crash when be created with virsh: This is libvirt create config file: <domain type='xen' > <name>ken-30</name> <os> <type>linux</type> <kernel>/data/images/boot/vmlinuz-2.6.21.7-3.fc8xen</kernel> <initrd>/data/images/boot/2.6.21.7-3.fc8xen-fedora.fc8.img</initrd> </os> <memory>131072</memory> <vcpu>1</vcpu> <devices> <disk type='file'> <source file='/data/images/nagin/c1/ken-30/fedora.fc8.img.sd'/> <target dev='sda1'/> </disk> <disk type='file'> <source file='/data/images/nagin/c1/ken-30/fedora.swap'/>. <target dev='sda2'/> </disk> <interface type='bridge'> <source bridge='virbr0'/> <script path='/etc/xen/scripts/vif-bridge'/> </interface> </devices> </domain> This the original xen configuration file: kernel = "/data/images/boot/vmlinuz-2.6.21.7-3.fc8xen" ramdisk = "/data/images/boot/2.6.21.7-3.fc8xen-fedora.fc8.img">. memory = 128 name = "ken-30" vif = [ 'bridge=virbr0' ] disk = ['tap:aio:/data/images/nagin/c1/ken-30/fedora.fc8.img,xvda1,w','tap:aio:/data/images/nagin/c1/ken-30/fedora.swap,xvda2,w'] root = "/dev/xvda1 ro" vfb = [ "type=vnc, vncdisplay=30" ] It crashes shortly after creation. This is the snapshot of the xen log: [2008-05-19 12:00:56 4937] DEBUG (XendDomainInfo:1040) XendDomainInfo.handleShutdownWatch [2008-05-19 12:00:56 4937] DEBUG (DevController:150) Waiting for devices vif. [2008-05-19 12:00:56 4937] DEBUG (DevController:155) Waiting for 0. [2008-05-19 12:00:56 4937] DEBUG (DevController:594) hotplugStatusCallback /local/domain/0/backend/vif/59/0/hotplug-status. [2008-05-19 12:00:56 4937] DEBUG (DevController:608) hotplugStatusCallback 1. [2008-05-19 12:00:56 4937] DEBUG (DevController:150) Waiting for devices usb. [2008-05-19 12:00:56 4937] DEBUG (DevController:150) Waiting for devices vbd. [2008-05-19 12:00:56 4937] DEBUG (DevController:150) Waiting for devices irq. [2008-05-19 12:00:56 4937] DEBUG (DevController:150) Waiting for devices vkbd. [2008-05-19 12:00:56 4937] DEBUG (DevController:150) Waiting for devices vfb.. [2008-05-19 12:00:56 4937] DEBUG (DevController:150) Waiting for devices console. [2008-05-19 12:00:56 4937] DEBUG (DevController:155) Waiting for 0. [2008-05-19 12:00:56 4937] DEBUG (DevController:150) Waiting for devices pci. [2008-05-19 12:00:56 4937] DEBUG (DevController:150) Waiting for devices ioports. [2008-05-19 12:00:56 4937] DEBUG (DevController:150) Waiting for devices tap. [2008-05-19 12:00:56 4937] DEBUG (DevController:155) Waiting for 51713. [2008-05-19 12:00:56 4937] DEBUG (DevController:594) hotplugStatusCallback /local/domain/0/backend/tap/59/51713/hotplug-status. [2008-05-19 12:00:56 4937] DEBUG (DevController:608) hotplugStatusCallback 1. [2008-05-19 12:00:56 4937] DEBUG (DevController:155) Waiting for 51714. [2008-05-19 12:00:56 4937] DEBUG (DevController:594) hotplugStatusCallback /local/domain/0/backend/tap/59/51714/hotplug-status. [2008-05-19 12:00:56 4937] DEBUG (DevController:608) hotplugStatusCallback 1. [2008-05-19 12:00:56 4937] DEBUG (DevController:150) Waiting for devices vtpm. [2008-05-19 12:00:56 4937] INFO (XendDomain:1130) Domain ken-30 (59) unpaused. [2008-05-19 12:01:00 4937] WARNING (XendDomainInfo:1203) Domain has crashed: name=ken-30 id=59. [2008-05-19 12:01:00 4937] DEBUG (XendDomainInfo:1821) XendDomainInfo.destroyDomain(59) I've changed the XML configuration many different ways but nothing seems to help. Any suggestions? --Kenneth Nagin

On Mon, May 19, 2008 at 12:07:59PM +0300, Kenneth Nagin wrote:
An image that comes up successfully is crash when be created with virsh:
[...]
It crashes shortly after creation. This is the snapshot of the xen log: [...] [2008-05-19 12:00:56 4937] DEBUG (DevController:150) Waiting for devices vtpm. [2008-05-19 12:00:56 4937] INFO (XendDomain:1130) Domain ken-30 (59) unpaused. [2008-05-19 12:01:00 4937] WARNING (XendDomainInfo:1203) Domain has crashed: name=ken-30 id=59. [2008-05-19 12:01:00 4937] DEBUG (XendDomainInfo:1821) XendDomainInfo.destroyDomain(59)
I've changed the XML configuration many different ways but nothing seems to help. Any suggestions?
All the devices seems to be successfully started up. There is something else going on. I suggest to check in /var/log/xen/xend.log for the two S-Expressions given to xend between the xm launch and the virsh launch. There must be a difference given which leads to some emulation breakage. Guessing what a priori is not very efficient, the difference has to be found in the logs output between both creations. Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

You didn't tell us how it crashed, but... Kenneth Nagin wrote:
<devices> <disk type='file'> <source file='/data/images/nagin/c1/ken-30/fedora.fc8.img.sd'/> <target dev='sda1'/> </disk> <disk type='file'> <source file='/data/images/nagin/c1/ken-30/fedora.swap'/>. <target dev='sda2'/> </disk>
The two devices above seem to be wrong, when compared to the Xen configuration file below. It looks like you want something like: <devices> <disk type='file'> <source file='/data/images/nagin/c1/ken-30/fedora.fc8.img'/> <target dev='xvda1'/> </disk> <disk type='file'> <source file='/data/images/nagin/c1/ken-30/fedora.swap'/>. <target dev='xvda2'/> </disk> If that doesn't help, please tell us how it crashes, exactly, and give the console output from the guest (if it gets that far). Chris Lalancette

You didn't tell us how it crashed, but...
Kenneth Nagin wrote:
<devices> <disk type='file'> <source file='/data/images/nagin/c1/ken-30/fedora.fc8.img.sd'/> <target dev='sda1'/> </disk> <disk type='file'> <source file='/data/images/nagin/c1/ken-30/fedora.swap'/>. <target dev='sda2'/> </disk>
The two devices above seem to be wrong, when compared to the Xen configuration file below. It looks like you want something like:
<devices> <disk type='file'> <source file='/data/images/nagin/c1/ken-30/fedora.fc8.img'/> <target dev='xvda1'/> </disk> <disk type='file'> <source file='/data/images/nagin/c1/ken-30/fedora.swap'/>. <target dev='xvda2'/> </disk>
If that doesn't help, please tell us how it crashes, exactly, and give
console output from the guest (if it gets that far).
Chris Lalancette Sorry I must have copied the wrong XML configuration file. The one I
Chris Lalancette <clalance@redhat.com> wrote on 19/05/2008 13:05:50: the pasted in was an experiment to see if the problem was related to using tap:aio. It didn't make any difference. Here is the right configuration file: <domain type='xen' > <name>ken-30</name> <os> <type>linux</type> <kernel>/data/images/boot/vmlinuz-2.6.21.7-3.fc8xen</kernel>: <initrd>/data/images/boot/2.6.21.7-3.fc8xen-fedora.fc8.img</initrd> </os> <memory>128</memory> <vcpu>1</vcpu> <devices> <disk type='file'> <driver name='tap' type='aio'/> <source file='/data/images/nagin/c1/ken-30/fedora.fc8.img'/> <target dev='xvda1'/> </disk> <disk type='file'> <driver name='tap' type='aio'/> <source file='/data/images/nagin/c1/ken-30/fedora.swap'/> <target dev='xvda2'/> </disk> <interface type='bridge'> <source bridge='virbr0'/> <mac address='aa:00:00:00:00:11'/> <script path='/etc/xen/scripts/vif-bridge'/> </interface> </devices> </domain> Here is some console output: Initializing XFRM netlink socket NET: Registered protocol family 1 NET: Registered protocol family 17 XENBUS: Device with no driver: device/vbd/51713 XENBUS: Device with no driver: device/vbd/51714 XENBUS: Device with no driver: device/vif/0 XENBUS: Device with no driver: device/console/0 drivers/rtc/hctosys.c: unable to open rtc device (rtc0). Freeing unused kernel memory: 200k freed Write protecting the kernel read-only data: 981k Red Hat nash version 6.0.19 starting Mounting proc filesystem. Mounting sysfs filesystem Creating /dev Creating initial device nodes Setting up hotplug. Creating block device nodes. Loading xenblk.ko module xen-vbd: registered block device major 202: Loading ehci-hcd.ko module Loading ohci-hcd.ko module Loading uhci-hcd.ko module USB Universal Host Controller Interface driver v3.0 Loading mbcache.ko module Loading jbd.ko module Loading ext3.ko module Loading scsi_mod.ko module SCSI subsystem initialized Loading sd_mod.ko module Loading aacraid.ko module Adaptec aacraid driver (1.1-5[2423]-mh3) Loading shpchp.ko module shpchp: Standard Hot Plug PCI Controller Driver version: 0.4 Loading libata.ko module Loading ata_piix.ko module Waiting for driver initialization. Loading xennet.ko module netfront: Initialising virtual ethernet driver. netfront: device eth0 has copying receive path. Creating root device. Mounting root filesystem. mount: could not find filesystem '/dev/root' Setting up other filesystems. Setting up new root fs setuproot: moving /dev failed: No such file or directory no fstab.sys, mounting internal defaults setuproot: error mounting /proc: No such file or directory. setuproot: error mounting /sys: No such file or directory Switching to new root and running init. unmounting old /dev unmounting old /proc unmounting old /sys switchroot: mount failed: No such file or directory Booting has failed. Kernel panic - not syncing: Attempted to kill init! I see two possible sources to the problem: XENBUS: Device with no driver ... and setuproot: moving /dev failed: No such file or directory ... switchroot: mount failed: No such file or directory Is there libvirt xml equivalent to the XEN configuration file's root = "/dev/xvda1 ro"?

Kenneth Nagin wrote:
Setting up new root fs setuproot: moving /dev failed: No such file or directory no fstab.sys, mounting internal defaults setuproot: error mounting /proc: No such file or directory. setuproot: error mounting /sys: No such file or directory Switching to new root and running init. unmounting old /dev unmounting old /proc unmounting old /sys switchroot: mount failed: No such file or directory Booting has failed. Kernel panic - not syncing: Attempted to kill init!
I see two possible sources to the problem: XENBUS: Device with no driver ... and setuproot: moving /dev failed: No such file or directory ... switchroot: mount failed: No such file or directory
Is there libvirt xml equivalent to the XEN configuration file's root = "/dev/xvda1 ro"?
OK, yeah. The XENBUS: Device with no driver can be ignored, I'm pretty sure. The problem is probably what you think, that you don't have a root=/dev/xvda1 line in there. Other people will have to comment on whether there is a libvirt XML equivalent, since I'm just not sure. Chris Lalancette

Chris Lalancette schreef:
Kenneth Nagin wrote:
Setting up new root fs setuproot: moving /dev failed: No such file or directory no fstab.sys, mounting internal defaults setuproot: error mounting /proc: No such file or directory. setuproot: error mounting /sys: No such file or directory Switching to new root and running init. unmounting old /dev unmounting old /proc unmounting old /sys switchroot: mount failed: No such file or directory Booting has failed. Kernel panic - not syncing: Attempted to kill init!
I see two possible sources to the problem: XENBUS: Device with no driver ... and setuproot: moving /dev failed: No such file or directory ... switchroot: mount failed: No such file or directory
Is there libvirt xml equivalent to the XEN configuration file's root = "/dev/xvda1 ro"?
OK, yeah. The XENBUS: Device with no driver can be ignored, I'm pretty sure. The problem is probably what you think, that you don't have a root=/dev/xvda1 line in there. Other people will have to comment on whether there is a libvirt XML equivalent, since I'm just not sure.
<domain type='xen' > <name>Gentoo</name> <os> <type>linux</type> <kernel>/usr/lib/xen/boot/linux-2.6.20-xen-r6</kernel> <cmdline> root=/dev/xvda ro ip=85.17.131.4:1.2.3.4:85.17.131.253:255.255.255.0::eth0:off</cmdline> </os> <memory>131072</memory> <vcpu>1</vcpu> <devices> <disk type='pool'> <source pool='netapp' volume='lun-3' /> <target dev='xvda'/> </disk> <interface type='bridge'> <source bridge='xenbr0'/> <mac address='aa:00:00:00:00:11'/> <script path='/etc/xen/scripts/vif-bridge'/> </interface> </devices> </domain> I think the target dev here can just be appended with an one? Stefan

Stefan de Konink <skinkie@xs4all.nl> wrote on 19/05/2008 18:18:25:
Kenneth Nagin wrote:
Setting up new root fs setuproot: moving /dev failed: No such file or directory no fstab.sys, mounting internal defaults setuproot: error mounting /proc: No such file or directory. setuproot: error mounting /sys: No such file or directory Switching to new root and running init. unmounting old /dev unmounting old /proc unmounting old /sys switchroot: mount failed: No such file or directory Booting has failed. Kernel panic - not syncing: Attempted to kill init!
I see two possible sources to the problem: XENBUS: Device with no driver ... and setuproot: moving /dev failed: No such file or directory ... switchroot: mount failed: No such file or directory
Is there libvirt xml equivalent to the XEN configuration file's root = "/dev/xvda1 ro"?
OK, yeah. The XENBUS: Device with no driver can be ignored, I'm
Chris Lalancette schreef: pretty sure.
The problem is probably what you think, that you don't have a root=/dev/xvda1 line in there. Other people will have to comment on whether there is a libvirt XML equivalent, since I'm just not sure.
<domain type='xen' > <name>Gentoo</name> <os> <type>linux</type> <kernel>/usr/lib/xen/boot/linux-2.6.20-xen-r6</kernel> <cmdline> root=/dev/xvda ro ip=85.17.131.4:1.2.3.4:85.17.131.253:255.255.255.0::eth0:off</cmdline> </os> <memory>131072</memory> <vcpu>1</vcpu> <devices> <disk type='pool'> <source pool='netapp' volume='lun-3' /> <target dev='xvda'/> </disk> <interface type='bridge'> <source bridge='xenbr0'/> <mac address='aa:00:00:00:00:11'/> <script path='/etc/xen/scripts/vif-bridge'/> </interface> </devices> </domain>
I think the target dev here can just be appended with an one?
Stefan I used virsh xmldump to create an xml file. I comment out the bootloader element since XEN create fails with an error when the bootloader element is empty. Also I commented out the target dev vif directive because it is ignored by create. The domain id directive is also ignored. This is a commented copy of the working xml:
<domain type='xen' id='78'> <!-- create seems to ignore id directive --> <name>ken-30</name> <uuid>c309cbc4-7e95-545f-0b16-2bf9e1e050dd</uuid> <!--<bootloader/> create error xen doesn't accept empty bootloader -->> <os> <type>linux</type> <kernel>/data/images/boot/vmlinuz-2.6.21.7-3.fc8xen</kernel> <initrd>/data/images/boot/2.6.21.7-3.fc8xen-fedora.fc8.img</initrd>> <cmdline>root=/dev/xvda1 ro </cmdline> </os> <memory>131072</memory> <vcpu>1</vcpu> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices>> <interface type='bridge'>> <source bridge='virbr0'/>> <!-- <target dev='vif78.0'/> create seems to ignore vif directive --> <mac address='00:16:3e:3b:46:d5'/> <script path='vif-bridge'/> </interface> <input type='mouse' bus='xen'/> <graphics type='vnc' port='5930'/> <disk type='file' device='disk'> <driver name='tap' type='aio'/>> <source file='/data/images/nagin/c1/ken-30/fedora.fc8.img'/> <target dev='xvda1'/> </disk> <disk type='file' device='disk'> <driver name='tap' type='aio'/> <source file='/data/images/nagin/c1/ken-30/fedora.swap'/> <target dev='xvda2'/> </disk> <console tty='/dev/pts/8'/> </devices> </domain> Thanks for the help.
participants (4)
-
Chris Lalancette
-
Daniel Veillard
-
Kenneth Nagin
-
Stefan de Konink