Bug 455255 - Block device can not be atached to 2 xen guest simultaneously.
Block device can not be atached to 2 xen guest simultaneously.
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: xen (Show other bugs)
5.2
ia64 Linux
low Severity medium
: rc
: ---
Assigned To: Xen Maintainance List
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-14 10:03 EDT by Habarov
Modified: 2009-12-14 16:26 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-14 10:19:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Habarov 2008-07-14 10:03:23 EDT
Hi! 

Working on project faced with a strange thing on Itanium Xen.

Description of problem:
When I try to export block device from Dom0 to Dom1 and Dom2 simultaneously
(using GFS ofcource) a get this out put:
[root@seneca2-p1 ~]# xm block-attach virt1 tap:aio:/tmp/sampleimg xvdb w
[root@seneca2-p1 ~]# xm block-attach virt2 tap:aio:/tmp/sampleimg xvdb w
Error: Device 51728 (tap) could not be connected.
/tmp/sampleimg already in use by other domain 

At the /var/log/xen/xend.log I can see this:


[2008-07-14 17:30:56 xend 4464] DEBUG (blkif:24) exception looking up device
number for xvdb: [Errno 2] No such file or directory: '/dev/xvdb'
[2008-07-14 17:30:56 xend 4464] DEBUG (DevController:110) DevController: writing
{'virtual-device': '51728', 'device-type': 'disk', 'protocol': 'ia64-abi',
'backend-id': '0', 'state': '1', 'backend':
'/local/domain/0/backend/tap/20/51728'} to /local/domain/20/device/vbd/51728.
[2008-07-14 17:30:56 xend 4464] DEBUG (DevController:112) DevController: writing
{'domain': 'virt1', 'frontend': '/local/domain/20/device/vbd/51728', 'format':
'raw', 'dev': 'xvdb', 'state': '1', 'params': 'aio:/tmp/sampleimg', 'mode': 'w',
'online': '1', 'frontend-id': '20', 'type': 'tap'} to
/local/domain/0/backend/tap/20/51728.
[2008-07-14 17:30:56 xend 4464] DEBUG (DevController:149) Waiting for 51728.
[2008-07-14 17:30:56 xend 4464] DEBUG (DevController:476) hotplugStatusCallback
/local/domain/0/backend/tap/20/51728/hotplug-status.
[2008-07-14 17:30:57 xend 4464] DEBUG (DevController:476) hotplugStatusCallback
/local/domain/0/backend/tap/20/51728/hotplug-status.
[2008-07-14 17:30:57 xend 4464] DEBUG (DevController:490) hotplugStatusCallback 1.
[2008-07-14 17:31:10 xend 4464] DEBUG (blkif:24) exception looking up device
number for xvdb: [Errno 2] No such file or directory: '/dev/xvdb'
[2008-07-14 17:31:10 xend 4464] DEBUG (DevController:110) DevController: writing
{'virtual-device': '51728', 'device-type': 'disk', 'protocol': 'ia64-abi',
'backend-id': '0', 'state': '1', 'backend':
'/local/domain/0/backend/tap/22/51728'} to /local/domain/22/device/vbd/51728.
[2008-07-14 17:31:10 xend 4464] DEBUG (DevController:112) DevController: writing
{'domain': 'virt2', 'frontend': '/local/domain/22/device/vbd/51728', 'format':
'raw', 'dev': 'xvdb', 'state': '1', 'params': 'aio:/tmp/sampleimg', 'mode': 'w',
'online': '1', 'frontend-id': '22', 'type': 'tap'} to
/local/domain/0/backend/tap/22/51728.
[2008-07-14 17:31:10 xend 4464] DEBUG (DevController:149) Waiting for 51728.
[2008-07-14 17:31:10 xend 4464] DEBUG (DevController:476) hotplugStatusCallback
/local/domain/0/backend/tap/22/51728/hotplug-status.
[2008-07-14 17:31:10 xend 4464] DEBUG (DevController:476) hotplugStatusCallback
/local/domain/0/backend/tap/22/51728/hotplug-status.
[2008-07-14 17:31:10 xend 4464] DEBUG (DevController:490) hotplugStatusCallback 5. 



How reproducible:
Server with Itanium2 proccesor + RHEL5.2 with xen kernel

Steps to Reproduce:
1. Install 2 xen guests
2. Try to attach one block device (physical device or image)
3. Get the error message
  
Actual results:
Error

Expected results:
Device should be attached to both VMs

Additional info:
This can not reproduced on x86_64 arch
Comment 1 Daniel Berrange 2008-07-14 10:19:59 EDT
This is intentional behaviour - you requested mode 'w' when attaching the device
which requests exclusive access.

If you want to share a device between two guests, you need to use mode '!' for
shared access.
Comment 2 Habarov 2008-07-14 10:42:00 EDT
(In reply to comment #1)
> This is intentional behaviour - you requested mode 'w' when attaching the device
> which requests exclusive access.
> 
> If you want to share a device between two guests, you need to use mode '!' for
> shared access.
> 
Thia does not work... Invalid mode

Konst
Comment 3 Daniel Berrange 2008-07-21 05:29:37 EDT
Try using 'w!' then - it should be equivalent to a plain '!'

Note You need to log in before you can comment on or make changes to this bug.