Bug 1138523

Summary: The name and format of volume in disk pool are changed after pool refreshed
Product: Red Hat Enterprise Linux 6 Reporter: Yang Yang <yanyang>
Component: libvirtAssignee: John Ferlan <jferlan>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: dyuan, jferlan, jherrman, rbalakri, shyu, tzheng, xuzhang, yanyang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.10.2-49.el6 Doc Type: Bug Fix
Doc Text:
Previously, using the "virsh pool-refresh" command, or restarting or refreshing the libvirtd service after renaming a virtual storage volume in some cases caused the "virsh vol-list" to display an incorrect name for the renamed storage volume. This update adds a check for the resulting name, which returns an error if the storage volume name is incorrect.
Story Points: ---
Clone Of: 1138516 Environment:
Last Closed: 2015-07-22 05:47:12 UTC Type: Bug
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: 1138516    
Bug Blocks:    

Comment 5 Yang Yang 2015-02-27 06:23:06 UTC
Hi John,
When the provided volume name doesn't match what parted generated as the
partition name, error out. HOWEVER, checking parted, partition was indeed created. Volume appears after pool was refreshed. 

Actual results on libvirt-0.10.2-49.el6.x86_64

1. define, build and start disk pool
# virsh pool-define disk-pool.xml 
Pool disk-pool defined from disk-pool.xml

[root@rhel6u6-test yy]# virsh pool-build disk-pool --overwrite
Pool disk-pool built

[root@rhel6u6-test yy]# virsh pool-start disk-pool
Pool disk-pool started

2. check /dev/sdb, make sure no partitions.
# parted /dev/sdb
GNU Parted 2.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: Alcor Flash Disk (scsi)
Disk /dev/sdb: 1048MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags

(parted)                  

3. create a volume specifying name as vol1
#virsh vol-create-as disk-pool vol1 100M
error: Failed to create vol vol1
error: invalid argument: invalid partition name 'vol1', expected 'sdb1'

4. check parted
[root@rhel6u6-test yy]# parted /dev/sdb
GNU Parted 2.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: Alcor Flash Disk (scsi)
Disk /dev/sdb: 1048MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size   Type     File system  Flags
 1      32.3kB  105MB  105MB  primary

(parted)     

[sdb1 was created.]

5. list volume
 # virsh vol-list disk-pool
Name                 Path                                    
-----------------------------------------

6. refresh pool and then list volume
# virsh pool-refresh disk-pool
Pool disk-pool refreshed

[root@rhel6u6-test yy]# virsh vol-list disk-pool
Name                 Path                                    
-----------------------------------------
sdb1                 /dev/sdb1

Comment 11 Yang Yang 2015-03-05 02:13:58 UTC
Okay. Creating a volume with the provided volume name doesn't match what parted generated as the partition name, return an error. After refresh pool, volume with a name match what parted generated appears. According to comment #5, change the status to verified.

Comment 13 errata-xmlrpc 2015-07-22 05:47:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1252.html