Bug 593951 - Defining the same name storage pool with different target path or type
Summary: Defining the same name storage pool with different target path or type
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Daniel Berrangé
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2010-05-20 06:24 UTC by Alex Jia
Modified: 2010-11-11 14:48 UTC (History)
6 users (show)

Fixed In Version: libvirt-0_8_1-11_el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-11-11 14:48:26 UTC
Target Upstream Version:

Attachments (Terms of Use)
the detail (7.35 KB, text/plain)
2010-05-20 06:26 UTC, Alex Jia
no flags Details

Description Alex Jia 2010-05-20 06:24:51 UTC
Description of problem:
There are two problems for defining the same name pool with different target path or type:
1.the first pool is inactive

Libvirt uses name to identify a storage pool/volume (domain, network etc),if you define two storage pools with the same name and different target path(mount point) or storage type, libvirt will only reserve last defined one,I think libvirt should give a friendly prompt information at least, because users may define lots of storage pools, but he forgot pool name, so he may define a pool with the same name and different type, this will directly cover previous defined pool without any warning, it isn't friendly for user.

2.the first pool is active

in addition, if I active the storage pool, then defining a pool with the same name and diffrent type, the pool can be defined successfully. libvirt will use last defined pool xml if I set the pool autostart, when I reboot host or libvirtd service, it will also directly cover previous defined pool without any warning, that is more terrible.  

Note that, It may influnce defining domain, network, nodedivce etc if this is a problem. 

Version-Release number of selected component (if applicable):
[root@dhcp-66-70-62 libvirt-test-API]# uname -a
Linux dhcp-66-70-62.nay.redhat.com 2.6.32-25.el6.x86_64 #1 SMP Mon May 10 17:30:22 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

[root@dhcp-66-70-62 libvirt-test-API]# cat /etc/redhat-release 
Red Hat Enterprise Linux release 6.0 Beta (Santiago)

[root@dhcp-66-70-62 libvirt-test-API]# rpm -qa|grep kvm

[root@dhcp-66-70-62 libvirt-test-API]# rpm -qa|grep libvirt

How reproducible:

Steps to Reproduce:
1.to define a 'HostVG' pool with 'logical' type
2.to build the pool 
3.to define a 'HostVG' pool with 'netfs' type
3.to active 'HostVG' pool
4.repeat 1
5.to set 'HostVG' autostart
6.to reboot host or libvirtd service 
Actual results:
previous defined pool will be directly covered.

Expected results:
fix it

Additional info:
please see attachment.

Comment 1 Alex Jia 2010-05-20 06:26:19 UTC
Created attachment 415318 [details]
the detail

Comment 3 Daniel Berrangé 2010-05-28 08:44:07 UTC
This patch addresses name+UUID uniqueness


Comment 4 RHEL Program Management 2010-06-07 15:53:24 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for

Comment 6 Dave Allan 2010-06-29 02:57:28 UTC
libvirt-0_8_1-11_el6 has been built in RHEL-6-candidate with the fix.


Comment 8 Alex Jia 2010-07-02 08:59:55 UTC
The bug has been fixed on RHEL6-beta with libvirt-0.8.1-13.el6.x86_64.

The following error information will be raised when I define the same name storage pool with different target path or type, it is a expectant result:

# virsh pool-define nfspool.xml
error: Failed to define pool from nfspool.xml
error: operation failed: pool 'HostVG' already exists with uuid 05a70c74-084b-1993-1448-d588cd0d9bd5

# uname -a
Linux dhcp-66-70-62.nay.redhat.com 2.6.32-37.el6.x86_64 #1 SMP Sun Jun 20 19:29:35 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
# rpm -q libvirt
# rpm -q qemu-kvm

Comment 9 releng-rhel@redhat.com 2010-11-11 14:48:26 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

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