losetup fails when using the 'file:/', preventing the DomU from being created

Bug #211726 reported by Henri Cook
24
Affects Status Importance Assigned to Milestone
xen-3.2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I was trying to use file:/ for a VM configuration when debugging another error, I know it's deprecated in favour of tap:aio: but should still work and is a compatibility issue with old configs.

This issue occurs whenever i try to 'xm create' - in this example 'beastie' is a new machine that i'd like to get the freebsd installer running on (config attached) - i've also attached qemu-dm log and the xen-hotplug.log

xm create beastie.cfg
Using config file "/etc/xen/beastie.cfg".
Error: Device 5632 (vbd) could not be connected. losetup -r /dev/loop11 /home/xen/domains/beastie/freebsd7bootonly.iso failed

Revision history for this message
Henri Cook (henricook) wrote :
Revision history for this message
Henri Cook (henricook) wrote :

Qemu Log

Revision history for this message
Henri Cook (henricook) wrote :

Hotplug

Revision history for this message
Henri Cook (henricook) wrote :

Bizarelly, losetup fails - but the devices are there, e.g.:

root@mintaka:~# losetup -a
/dev/loop0: [0807]:26738701 (/home/xen/domains/beastie/disk.img)
/dev/loop1: [0807]:26738703 (/home/xen/domains/beastie/freebsd7bootonly.iso)

niere_ in #xen on Freenode recommended manually running losetup and then using phy:/dev/loop/xxxx in my xen config

I did this for both the iso and empty disk image with the following results:

It works! I'm testing with a freeBSD install which borks all over the place, but that's an installer problem

I have successfully started a windows install by manually doing the losetup's and using phy:/ - this isn't a solution just a very temporary work around!

Henri

Revision history for this message
Elie De Brauwer (elie) wrote :

I simply wanted to confirm this error, I did an minimal install from the ubuntu 8.04 server edition beta iso (without any fancy extras except openssh and xen).

and replaching
disk = ['file:/images/win2k3disk.img,ioemu:hda,w',
'file:/images/win2k3iso.img,ioemu:hdc:cdrom,r']

by

disk = ['phy:/dev/loop0,ioemu:hda,w',
'phy:/dev/loop1,ioemu:hdc:cdrom,r']

does the trick as well for me after the loopback devices are created offcourse.

Revision history for this message
Andrew Shugg (ashugg) wrote :

It's annoying and poorly documented but it now seems necessary to use "tap:aio" instead of "file".

i.e. for your example:

disk = [ 'tap:aio:/images/win2k3disk.img,ioemu:hda,w',
'tap:aio:/images/win2k3iso.img,ioemu:hdc:cdrom,r']

This should work.

Revision history for this message
Andrew Shugg (ashugg) wrote :

I beg your pardon, I didn't read the first line of your bug report!

But yes I can confirm the same problems with losetup ... or rather with the xen block daemon, which called losetup and then broke.

Revision history for this message
MikeB (mike-mikebrancato) wrote :

In Hardy using tap:aio: fixed this issue for PVM guests but with HVM guests I get these errors.

I always get this in xen-hotplug.log:
xenstore-read: couldn't read path /local/domain/1/vm
xenstore-read: couldn't read path /local/domain/1/vm

for HVM guests i have to manually setup the loopbacks and use phy: disk type that point to /dev/loop*. Once I setup the loopback manually and change to phy: the domain will boot correctly and the hotplug errors are gone.

Changed in xen-3.2:
status: New → Confirmed
Revision history for this message
Elie De Brauwer (elie) wrote :

For me using tap:aio: fixed it for both my PVM'ed centos and my HVM'ed win2k3.

Revision history for this message
Tom De Clercq (g-launchpad-tomsworld-be) wrote :

Elie, when you use tap:aio: the mount of the iso for installing the os was working well ?

Because I didn't work and I had to use the workaround of mounting them in de Dom0 and passing it with phy:/dev/loop*

Revision history for this message
Elie De Brauwer (elie) wrote :

For the installation itself i'm not sure, by the time I discovered I had to use tap:aio: I had already installed the OS using the /dev/loop trick.

Revision history for this message
Damien Churchill (damoxc) wrote :

xen-tools needs to be patched to use tap:aio: instead of file:

it's not a massive changed, 1 line in xen-create-image,
file

Revision history for this message
Andreas Schiller (as-aschiller) wrote :

Confirming: booting HVM from cdrom-iso as tap:aio: does not work! (As mentioned before, losetup and phy: did the trick...)

Revision history for this message
Joseph Smith (joe-uwcreations) wrote :

Anyone out there familiar with this issue and capable of troubleshooting it? Its a real showstopper for any kind of automation.

Revision history for this message
Boyan (boyann) wrote :

Not yet,

As it seems the bug still persists and the only available solution is the phy /dev/loop trick...

Hope it will be soon fixed, couse it is making the everyday hvm testing work such a pain...

Revision history for this message
Rakotomandimby Mihamina (tech-infogerance) wrote :

So.... Could we please clarify a couple of things:
- Is the current Xen3.2 (the one in the repos) patched and working with the "tap:aio" tip?
- Is there a working Xen3.2 on Ubuntu Hardy? (somewhere in a private repo)?
- What of thos patches should be OK, which of them should be applied,... any documentation?

The goal is to have XP or Vista running in one or more domUs. More generally, using HVM.

Is that comment reliable? :
http://www.nabble.com/vbd-could-not-be-connected-td16661943.html

Revision history for this message
Patrick Domack (patrickdk) wrote :

The issue is very simple:

in the /etc/xen/scripts/block script it creates the loopback device twice

First it does it with losetup /dev/loopx /some-image
Then if you want read-only it does
losetup -r /dev/loopx /some-image
and this second one fails cause the first one already mounted it read/write.

Revision history for this message
Todd Deshane (deshantm) wrote :

@Patrick

I was looking into your theory about the losetup twice.

I am trying to compare vs. the current block file in xen-unstable:
http://xenbits.xensource.com/xen-unstable.hg?file/78a29cf8476b/tools/examples/block

I am not so sure that that is the problem. Can you take a closer look?

Would it be possible for you to produce a working and tested patch that we could try?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.