qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] Kernel panic when booting from SCSI disk


From: Mike Lovell
Subject: Re: [Qemu-discuss] Kernel panic when booting from SCSI disk
Date: Fri, 27 Jul 2012 15:50:30 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0

On 07/24/2012 11:15 PM, Thomas Oberhammer wrote:
The short version:

I'm trying to run a VMware image on qemu. Therefore I need to be able to attach 
the disks via SCSI interface in qemu.
Is there a possibility to do so?

Some background information:

The VMware image consists of 2 disks and has been successfully converted, so 
that I can boot it with qemu. I can attach the disks via IDE, but this causes 
that the image is not fully functional.

The problem comes from the fact, that the image originally was designed for 
VMware, and some part of its code relies on the condition as they are on 
VMware, e.g. that the disks are attached via SCSI interface and can therefore 
be found on /sys/class/scsi_device.
Or differently speaking, when I run the image, the disks are named hda & hdb, but 
the image requires them to be sda & sdb to provide the full functionality.

The image is linux based, the kernel version is 2.6.9. I am aware that the 
problem would vanish if this could be upgraded to 2.6.20 (since then both SCSI 
and IDE devices are named sda/sdb/...), but this is not possible.

The problem:

If I attach my disk with

kvm --enable-kvm -m 1024 \
-drive file=disk1_converted-flat.vmdk,if=scsi,index=0,format=raw,boot=on \
-drive file=disk2_converted-flat.vmdk,if=scsi,index=1,format=raw \

I can initiate the boot process, but at some point I end up with the message

Kernel panic - not syncing: Attempted to kill init!


But if I use

kvm --enable-kvm -m 1024 \
-boot c \
-drive file=image-disk1_converted-flat.vmdk,if=ide,index=0,format=raw \
-drive file=image-disk2_converted-flat.vmdk,if=ide,index=1,format=raw \

it works fine (at least concerning booting).

At the point when the first (i.e. SCSI) version crashes, the second (i.e. IDE) 
shows the following output:

EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
EXT3 FS on hda5, internal journal
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.

-> it seems that the SCSI version crashes when it tries to mount the disks.

Does anyone have an idea, how this problem can be solved?

Please not that...
- the image cannot be modified
- the image has no virtio drivers installed

I am using QEMU Version 0.12.3, but I also tried 1.0.1 and it showed the same 
behaviour.

ummm. how did you do the conversion from vmware? cause it sounds like the guest image is in a different state than when it was running in vmware.

the kernel panic when using the SCSI interface is most likely due to the kernel trying to mount the root file system from a disk it can't find or use. the fact that it boots when using the IDE interface also points to this. it sounds like the boot loader in the virtual machine is configured to use hda (or similar) instead of sda. if the image came from a place that was using sda for the root filesystem, then the image got modified somewhere along the line and i would guess that the tool you used for the conversion is at fault.

if this is the case, you're going to need to modify the guest image at least some to change the boot loader parameters. you can test this by booting the guest with the SCSI interface and interrupting the boot loader and modifying its command line options for the guest. there should be a root=/dev/hda or similar option that you can change to /dev/sda or similar.

another thing you could try is just booting a copy of the original vmdk in qemu without any conversion. if you are using a recent version of qemu, it should be able to use most vmdk images just fine. i have seen a few issues of qemu not able to use a vmdk from an esxi 5 server though. i would definitely recommend using a copy of the vmdk though and not the original.

mike




reply via email to

[Prev in Thread] Current Thread [Next in Thread]