Bug 691305

Summary: Create a volume failed with error: "command 'vol-create' requires <file> option"
Product: Red Hat Enterprise Linux 6 Reporter: wangyimiao <yimwang>
Component: libvirtAssignee: Eric Blake <eblake>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 6.1CC: eblake, jyang, yoyzhang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-25 20:07:40 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:

Description wangyimiao 2011-03-28 06:40:17 UTC
Description of problem:
Use command 'vol-create' with the Vol XML to create a volume,but it will failed with error: "command 'vol-create' requires <file> option"

Version-Release number of selected component (if applicable):
libvirt-0.8.7-14.el6.x86_64
qemu-img-0.12.1.2-2.152.el6.x86_64
qemu-kvm-0.12.1.2-2.152.el6.x86_64
kernel-2.6.32-125.el6.x86_64

How reproducible:
5/5

Steps to Reproduce:
1.Setup a pool of directory type with that xml.
<pool type='dir'>
  <name>dir_pool</name>
  <uuid>70a7eb15-6c34-ee9c-bf57-69e8e5ff3fb2</uuid>
  <capacity>0</capacity>
  <allocation>0</allocation>
  <available>0</available>
  <source>
  </source>
  <target>
    <path>/var/lib/libvirt/images</path>
    <permissions>
      <mode>0700</mode>
      <owner>0</owner>
      <group>0</group>
      <label>some_label_t</label>
    </permissions>
  </target>
</pool>

# virsh pool-define dir_pool.xml

# virsh pool-start dir_pool
Pool dir_pool started

2. Create a raw vol

#cat raw.xml
<volume>
  <name>raw.img</name>
  <source>
 </source>
  <capacity>22300000</capacity>
  <allocation>22300000</allocation>
  <target>
    <path>/var/lib/libvirt/images/raw.img</path>
<format type='raw'/>
  </target>
</volume>

# virsh vol-create --pool dir_pool raw.xml 
error: command 'vol-create' requires <file> option

  
Actual results:
Use command 'vol-create' with the Vol XML to create a volume,but it will failed with error: "command 'vol-create' requires <file> option"

Expected results:
Volume should be created successfully

Additional info:

1.If add option "--file" vol created will be successful.

# virsh vol-create --pool dir_pool --file col.xml 
Vol raw.img created from col.xml

2.Or if delete option "--pool" vol created will be successful.

# virsh vol-create  dir_pool col.xml 
Vol raw.img created from col.xml

Comment 2 RHEL Program Management 2011-04-04 02:10:18 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 3 Osier Yang 2011-04-05 12:39:55 UTC
patch posted to upstream:

http://www.redhat.com/archives/libvir-list/2011-April/msg00235.html

Comment 5 Eric Blake 2011-04-12 21:40:00 UTC
see bug 693963 for an alternate upstream patch

Comment 6 Eric Blake 2011-04-25 20:07:40 UTC
Fixed in RHEL 6.1 as a nice side-effect of 693963.  Love it when that happens :)

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