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
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
5.to set 'HostVG' autostart
6.to reboot host or libvirtd service
previous defined pool will be directly covered.
please see attachment.
Created attachment 415318 [details]
This patch addresses name+UUID uniqueness
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
libvirt-0_8_1-11_el6 has been built in RHEL-6-candidate with the fix.
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
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.