Bug 958510
Summary: | virStorageVolCreateXML requires <capacity> even when <backingStore> is specified | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Ian McLeod <imcleod> |
Component: | libvirt | Assignee: | Ján Tomko <jtomko> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.0 | CC: | cwei, dyuan, gsun, honzhang, mzhan, rbalakri, shyu, xuzhang, yanyang, zpeng |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.2.14-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-11-19 05:43:10 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
Ian McLeod
2013-05-01 17:21:42 UTC
This bug was not selected to be addressed in Red Hat Enterprise Linux 6. We will look at it again within the Red Hat Enterprise Linux 7 product. Upstream patches: https://www.redhat.com/archives/libvir-list/2015-February/msg00697.html 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 Verified on libvirt-1.2.15-2.el7.x86_64 Steps 1. test vol-create # cat BZ958510 <volume> <name>demo</name> <source> </source> <target> <format type='qcow2'/> </target> <backingStore> <path>/var/lib/libvirt/images/vm1.raw</path> </backingStore> </volume> # virsh vol-create default BZ958510 Vol demo created from BZ958510 # virsh vol-info demo default Name: demo Type: file Capacity: 5.00 GiB Allocation: 196.00 KiB # virsh vol-dumpxml demo default <volume type='file'> <name>demo</name> <key>/var/lib/libvirt/images/demo</key> <source> </source> <capacity unit='bytes'>5368709120</capacity> <allocation unit='bytes'>200704</allocation> <target> <path>/var/lib/libvirt/images/demo</path> <format type='qcow2'/> <permissions> <mode>0600</mode> <owner>0</owner> <group>0</group> <label>system_u:object_r:virt_image_t:s0</label> </permissions> <timestamps> <atime>1432804118.667607029</atime> <mtime>1432804118.616607010</mtime> <ctime>1432804118.666607029</ctime> </timestamps> </target> <backingStore> <path>/var/lib/libvirt/images/vm1.raw</path> <format type='raw'/> <permissions> <mode>0644</mode> <owner>107</owner> <group>107</group> <label>system_u:object_r:svirt_image_t:s0:c469,c778</label> </permissions> <timestamps> <atime>1432804118.667607029</atime> <mtime>1432520901.532815217</mtime> <ctime>1432520901.532815217</ctime> </timestamps> </backingStore> </volume> start a vm with demo, it works well <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/demo'/> <backingStore type='file' index='1'> <format type='raw'/> <source file='/var/lib/libvirt/images/vm1.raw'/> <backingStore/> </backingStore> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </disk> # virsh vol-delete demo default Vol demo deleted 2. test vol-create-from # cat BZ958510 <volume> <name>demo</name> <source> </source> <target> <format type='qcow2'/> </target> </volume> # qemu-img info /var/lib/libvirt/images/vm1.raw image: /var/lib/libvirt/images/vm1.raw file format: raw virtual size: 5.0G (5368709120 bytes) disk size: 1.3G # virsh vol-create-from default BZ958510 --inputpool default vm1.raw Vol demo created from input vol vm1.raw # virsh vol-info demo default Name: demo Type: file Capacity: 5.00 GiB Allocation: 2.00 GiB # qemu-img info /var/lib/libvirt/images/demo image: /var/lib/libvirt/images/demo file format: qcow2 virtual size: 5.0G (5368709120 bytes) disk size: 2.0G cluster_size: 65536 Format specific information: compat: 0.10 start a vm with demo, it works well <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/demo'/> <backingStore/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </disk> 3. negative test: dir type vol with backing file # cat BZ958510 <volume type='dir'> <name>demo</name> <source> </source> <target> <format type='dir'/> </target> <backingStore> <path>/var/lib/libvirt/images/vm1.raw</path> </backingStore> </volume> # virsh vol-create default BZ958510 error: Failed to create vol from BZ958510 error: this function is not supported by the connection driver: backing storage not supported for directories volumes 4. negative test: raw type vol with backing file # cat BZ958510 <volume type='file'> <name>demo</name> <source> </source> <target> <format type='raw'/> </target> <backingStore> <path>/var/lib/libvirt/images/vm1.raw</path> </backingStore> </volume> # virsh vol-create default BZ958510 error: Failed to create vol from BZ958510 error: this function is not supported by the connection driver: backing storage not supported for raw volumes 5. negative test: lack of capacity in rbd pool # cat BZ958510-RBD <volume type='network'> <name>demo</name> <source> </source> </volume> # virsh vol-create rbd BZ958510-RBD error: Failed to create vol from BZ958510-RBD error: XML error: missing capacity element 6. negative test: vol with backing file in rbd pool. The issue is tracked in bz1223177 # cat BZ958510-RBD <volume type='network'> <name>demo</name> <source> </source> <backingStore> <path>/var/lib/libvirt/images/vm1.raw</path> </backingStore> </volume> # virsh vol-create rbd BZ958510-RBD error: Failed to create vol from BZ958510-RBD error: failed to remove volume 'libvirt-pool/demo': No such file or directory # virsh vol-list rbd | grep demo demo libvirt-pool/demo # virsh vol-delete demo rbd error: Failed to delete vol demo error: failed to remove volume 'libvirt-pool/demo': No such file or directory 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-2202.html |