Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 455255 - Block device can not be atached to 2 xen guest simultaneously.
Summary: Block device can not be atached to 2 xen guest simultaneously.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: xen
Version: 5.2
Hardware: ia64
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Xen Maintainance List
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-07-14 14:03 UTC by Habarov
Modified: 2009-12-14 21:26 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-07-14 14:19:59 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Habarov 2008-07-14 14:03:23 UTC
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 14:19:59 UTC
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 14:42:00 UTC
(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 09:29:37 UTC
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.