Bug 952973

Summary: create a invalid logical pool via pool-create-as with wrong --target device
Product: Red Hat Enterprise Linux 7 Reporter: Huang Wenlong <whuang>
Component: libvirtAssignee: Martin Kletzander <mkletzan>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, chhu, cwei, dallan, dyuan, mkletzan, mzhan, shyu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.1.1-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 952972 Environment:
Last Closed: 2014-06-13 09:21:05 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:

Description Huang Wenlong 2013-04-17 05:18:25 UTC
+++ This bug was initially created as a clone of Bug #952972 +++

Description of problem:
create a invalid logical pool via pool-create-as with wrong --target device
vg should be new which has not lv in it .

Version-Release number of selected component (if applicable):
libvirt-0.10.2-18.el6_4.4.x86_64
libvirt-1.0.4-1.el7.x86_64

How reproducible:
100

Steps to Reproduce:
1. create a logical pool or define then start
create a invalid logical pool via pool-create-as with wrong --target
device which vg has not lv in it.
# virsh pool-create-as sd3 --type logical --target /dev
Pool sd3 created

2.try to create vol via vol-create
# virsh vol-create-as sd3 v1 100M
error: Failed to create vol v1
error: cannot stat file '/dev/v1': No such file or directory

3.create vol via lvm cmd
# lvcreate sd3 --name v1 -L 100M
Logical volume "v1" created
[root@6-217 tmp]# lvs
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
v1 sd3 -wi-a---- 100.00m
[root@6-217 tmp]# ll /dev/sd3/v1
lrwxrwxrwx. 1 root root 7 Apr 16 03:14 /dev/sd3/v1 -> ../dm-0

4.the vol created by lvm cmd will disappear after run vol-create-as
# virsh vol-create-as sd3 v1 100M
error: Failed to create vol v1
error: internal error Child process (/sbin/lvcreate --name v1 -L 102400K
sd3) unexpected exit status 5: Logical volume "v1" already exists in
volume group "sd3"

# lvs
# ll /dev/sd3/v1
ls: cannot access /dev/sd3/v1: No such file or directory

Actual results:
as steps

Expected results:
check target if wrong report error
step4 should not affect vol already created .

Additional info:

Comment 2 Martin Kletzander 2013-06-03 15:06:05 UTC
Patch proposed upstream:

http://www.redhat.com/archives/libvir-list/2013-June/msg00056.html

Comment 3 Martin Kletzander 2013-07-10 17:11:55 UTC
Second proposed version:

http://www.redhat.com/archives/libvir-list/2013-June/msg01177.html

Comment 4 Martin Kletzander 2013-07-15 09:15:45 UTC
v3 proposed:

http://www.redhat.com/archives/libvir-list/2013-July/msg00875.html

Comment 5 Martin Kletzander 2013-07-16 10:26:31 UTC
Moving to POST with commit v1.1.0-198-gefab27a:

commit efab27afbf02743a3a2582e9a111eb1b7d985b26
Author: Martin Kletzander <mkletzan>
Date:   Tue Apr 30 13:48:46 2013 +0200

    Make logical pools independent on target path

Comment 12 Ludek Smid 2014-06-13 09:21:05 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.