DescriptionFederico Simoncelli
2014-06-04 20:43:53 UTC
Description of problem:
The capacity element should be optional when creating a volume with a backing file (by default it should be the same of the base):
# virsh vol-create default /dev/stdin <<EOF
<volume>
<name>test-base.qcow2</name>
<capacity unit='bytes'>21474836480</capacity>
<target>
<format type='qcow2'/>
</target>
</volume>
EOF
# virsh vol-create default /dev/stdin <<EOF
<volume>
<name>test-snapshot1.qcow2</name>
<target>
<format type='qcow2'/>
<permissions>
<mode>0600</mode>
<owner>0</owner>
<group>0</group>
<label>system_u:object_r:virt_content_t:s0</label>
</permissions>
</target>
<backingStore>
<path>test-base.qcow2</path>
<format type='qcow2'/>
</backingStore>
</volume>
EOF
error: Failed to create vol from /dev/stdin
error: XML error: missing capacity element
Comment 1Federico Simoncelli
2014-09-22 09:36:10 UTC
Fixed upstream as of
commit 155ca616eb231181f6978efc9e3a1eb0eb60af8a
Author: Ján Tomko <jtomko>
CommitDate: 2015-03-02 08:07:11 +0100
Allow creating volumes with a backing store but no capacity
The tool creating the image can get the capacity from the backing
storage. Just refresh the volume afterwards.
https://bugzilla.redhat.com/show_bug.cgi?id=958510
git describe: v1.2.13-17-g155ca61
Description of problem: The capacity element should be optional when creating a volume with a backing file (by default it should be the same of the base): # virsh vol-create default /dev/stdin <<EOF <volume> <name>test-base.qcow2</name> <capacity unit='bytes'>21474836480</capacity> <target> <format type='qcow2'/> </target> </volume> EOF # virsh vol-create default /dev/stdin <<EOF <volume> <name>test-snapshot1.qcow2</name> <target> <format type='qcow2'/> <permissions> <mode>0600</mode> <owner>0</owner> <group>0</group> <label>system_u:object_r:virt_content_t:s0</label> </permissions> </target> <backingStore> <path>test-base.qcow2</path> <format type='qcow2'/> </backingStore> </volume> EOF error: Failed to create vol from /dev/stdin error: XML error: missing capacity element