Bug 372871

Summary: [EMC 5.2 bug] virt-manager adds duplicate entries while adding disk
Product: Red Hat Enterprise Linux 5 Reporter: Sadique Puthen <sputhenp>
Component: virt-managerAssignee: Daniel Berrangé <berrange>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 5.1CC: andriusb, berthiaume_wayne, bjohnson, emcnabb, ogren_chris, pan_haifeng, xen-maint
Target Milestone: ---Keywords: OtherQA
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-01-03 17:19:56 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:
Bug Depends On:    
Bug Blocks: 217106    

Description Sadique Puthen 2007-11-09 15:24:09 UTC
Description of problem:

When adding a disk via Guest -> Right Click Details -> Hardware -> Add ->
Storage Device, virt-manager adds duplicate entries for the disk in
/etc/xen/guest which causes subsequent reboot of the guest to fail.

Eg, If I add /vm/sadique/rhel5-disk2 as the second disk, I should have the below
entries in /etc/xen/rhel5.

disk = [ "tap:aio:/vm/sadique/rhel5,xvda,w",
"tap:aio:/vm/sadique/rhel5-disk2,xvdb,w", "tap:aio:/vm/sadique/rhel5-disk2,xvdb,w"]


Version-Release number of selected component (if applicable):

RHEL-5.1

python-virtinst-0.103.0-3.el5
libvirt-0.2.3-9.el5
virt-manager-0.4.0-3.el5
xen-3.0.3-41.el5

How reproducible:

Always.

Steps to Reproduce:

As above.
1.
2.
3.
  
Actual results:

virt-manager adds multiple entries fro disk and subsequent reboot of the guest
fails with message

[root@dhcp6-7 xen]# xm create rhel5
Using config file "./rhel5".
Error: Device xvdb (51728, tap) is already connected.

Expected results:

Disk shouldn't be defined two times.

Additional info:

Searched the bugzilla, but didn't see it already reported.

Comment 1 Chris Ogren 2007-11-14 16:16:02 UTC
We have seen this same behavior whereby subsequent guest domain reboots failed
with an error that the virtual block device is already connected.  The
additional virtual block devices were added after the initial domU creation
using the virt manager. 

I manually edited the config file fo rthe guest OS in /etc/xen and was able to
restart the domU.

Does this also occur if the CLI `xm block-attach` method is used?  Or is it
strictly manifeted when using virt manager to add block devices?

Will this bug be fixed in a patch to RHEL 5.1?

Comment 2 RHEL Program Management 2007-11-16 18:24:34 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 3 Sadique Puthen 2007-12-12 13:17:46 UTC
Further Info:

When I did a bit deeper investigation I found that this only happens if someone
adds the disk to the guest via virt-manager while the guest is in a running
state. If we add the disk while the guest is inactive, it adds the entries
correctly.

If I add a file based storage while the guest is running,

old disk = section is,

disk = [ "tap:aio:/vm/sadique/rhel5,xvda,w"]

New disk section entry,

disk = [ "tap:aio:/vm/sadique/rhel5,xvda,w", "tap:aio:/vm/sadique/disk2,xvdb,w",
"tap:aio:/vm/sadique/disk2,xvdb,w"] 

If I add a block device it would be as below.

disk = [ "phy:/dev/sda9,xvdb,w", "tap:aio:/vm/sadique/rhel5,xvda,w",
"phy:/dev/sda9,xvdb,w"]

Note the order of duplication! If it's block device one entry is added in the
beginning  and one entry in the last. If it's file backed, both entries are
adding in the last.



Comment 4 Bill Burns 2007-12-21 18:50:55 UTC
Setting Dev ACK for Dan.

Comment 5 Cole Robinson 2008-01-03 17:19:56 UTC

*** This bug has been marked as a duplicate of 353901 ***