Bug 433451

Summary: Can't start second guest via virt-manager while using shared block devices
Product: Red Hat Enterprise Linux 5 Reporter: Adam Stokes <astokes>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 5.2CC: tao, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0291 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-21 16:48:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Adam Stokes 2008-02-19 12:59:48 UTC
Description of problem:

If I share a block device to use with multiple guests using w!, starting the
second guest via virt-manager throws trace back error and fails. Starting the
second guest via "xm create <guest2>" works fine without any problems.

Version of packages:

xen-3.0.3-41.el5
kernel-xen-2.6.18-53.1.4.el5
xen-libs-3.0.3-41.el5
xen-libs-3.0.3-41.el5
python-virtinst-0.103.0-3.el5_1.1
libvirt-0.2.3-9.el5
virt-manager-0.4.0-3.el5

How reproducible:

Always.

Steps to Reproduce:

- Create two para virtualized guests. I have not yet tested this with full virt.

- Create a block device. Either a logical volume or block device (sdax or hdax
etc..)

- Add the block device to both guests and add w! to make it shared.

Configuration file from both guests.

name = "guest1"
uuid = "de7b25c7-6f4c-26e0-af31-c2e07b05e3ed"
maxmem = 500
memory = 500
vcpus = 1
bootloader = "/usr/bin/pygrub"
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
vfb = [ "type=vnc,vncunused=1,keymap=en-us" ]
disk = [ "tap:aio:/vm/guest1.img,xvda,w", "phy:/dev/sda9,xvdb,w!"]
vif = [ "mac=00:16:3e:47:aa:a4,bridge=xenbr0" ]


name = "guest2"
uuid = "8493c330-f15d-4b33-9909-16a210b83fd9"
maxmem = 500
memory = 500
vcpus = 1
bootloader = "/usr/bin/pygrub"
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
vfb = [ "type=vnc,vncunused=1,keymap=en-us" ]
disk = [ "tap:aio:/vm/guest2.img,xvda,w", "phy:/dev/sda9,xvdb,w!" ]
vif = [ "mac=00:16:3e:47:aa:a5,bridge=xenbr0" ]

- Start the guest1 from virt-manager. It would start successfully.

- Then start the second guest from virt-manager. You would see the below error
message.

libvir: Xen Daemon error : POST operation failed: (xend.err 'Device 51728 (vbd)
could not be connected.nDevice /dev/sda9 is mounted in a guest domain,nand so
cannot be mounted now.')
Traceback (most recent call last):
 File "/usr/share/virt-manager/virtManager/manager.py", line 693, in start_vm
   vm.startup()
 File "/usr/share/virt-manager/virtManager/domain.py", line 375, in startup
   self.vm.create()
 File "/usr/lib64/python2.4/site-packages/libvirt.py", line 217, in create
   if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirt.libvirtError: virDomainCreate() failed POST operation failed: (xend.err
'Device 51728 (vbd) could not be connected.nDevice /dev/sda9 is mounted in a
guest domain,nand so cannot be mounted now.')

Actual results:

Second guest start up fails through virt-manager.

Expected results:

Second guest start up should be successful via-virt manager.

Additional info:

If we start the second guest via "xm create guest2" it starts successfully and
attaches the shared block device without any problems to the second guest.

[root@dhcp6-7 xen]# xm create guest2
Using config file "./guest2".
Started domain guest2


- If you use a file backed image and share them between two guests using w!
flag, we can stat both guests from virt-manager without any prorblems. Problem
seems to be only while sharing block device.

--

Please note this is fixed in libvirt 0.3.3.5.el5

Comment 1 RHEL Program Management 2008-02-19 13:07:26 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 2 Daniel Veillard 2008-02-29 14:43:47 UTC
This was fixed upstream in November I think:

Wed Nov 21 17:29:42 CET 2007 Daniel Veillard <veillard>

        * src/xm_internal.c: fix the parsing of predefined domains on
          xen prior to 3.1 to take into accound the fact that disk can
          be shareable.

That patch is included in the rebase for RHEL-5.2 as patch
libvirt-0.3.3-disk-shareable.patch

So yes the fix for 5.2 is in libvirt-0.3.3.5.el5 (as well as many other
fixes). So this will go in update 2.

Daniel

Comment 3 Bill Burns 2008-02-29 15:44:08 UTC
Set dev ack as a rebase of libvirt in RHEL 5.2 has fixed this issue.
 

Comment 6 errata-xmlrpc 2008-05-21 16:48:05 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0291.html