Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
The virsh vol-resize command didn't work for rhel7
Version-Release number of selected component (if applicable):
qemu-kvm-1.3.0-6.el7.x86_64
kernel-3.7.0-0.36.el7.x86_64
libvirt-1.0.3-1.el7.x86_64
How reproducible:
100%
Steps
1. Prepare vol xml file
# cat vol-test.xml
<volume>
<name>vol-test</name>
<key>/var/lib/libvirt/images/vol-test</key>
<source>
</source>
<capacity>10737418240</capacity>
<allocation>3179753472</allocation>
<target>
<path>/var/lib/libvirt/images/vol-test</path>
<format type='raw'/>
<permissions>
<mode>0644</mode>
<owner>36</owner>
<group>36</group>
<label>system_u:object_r:nfs_t</label>
</permissions>
</target>
</volume>
2. Create a vol with the vol-test.xml
# virsh vol-create default vol-test.xml
3. Check the img info
# qemu-img info /var/lib/libvirt/images/vol-test
image: /var/lib/libvirt/images/vol-test
file format: raw
virtual size: 10G (10737418240 bytes)
disk size: 3.0G
# ll /var/lib/libvirt/images/vol-test
-rw-r--r--. 1 36 kvm 10737418240 Mar 15 17:07 /var/lib/libvirt/images/vol-test
4. Resize the exsited img
# virsh vol-resize /var/lib/libvirt/images/vol-test 20G
# echo $?
1
5. Recheck the img info ,the img was not resized
# qemu-img info /var/lib/libvirt/images/vol-test
image: /var/lib/libvirt/images/vol-test
file format: raw
virtual size: 10G (10737418240 bytes)
disk size: 3.0G
6. it works well on rhel6
Actual results:
can't resize the vol and the command was invalid
Expected results:
should resize the vol successfully
commit 2a3a725c33aba2046443d33eb473eb54517f61c8
Author: Osier Yang <jyang>
Date: Fri May 24 11:59:14 2013 +0800
virsh: Fix regression of vol-resize
Introduced by commit 1daa4ba33acf. vshCommandOptStringReq returns
0 on *success* or the option is not required && not present, both
are right result. Error out when returning 0 is not correct.
the caller, it doesn't have to check wether it
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.
Description of problem: The virsh vol-resize command didn't work for rhel7 Version-Release number of selected component (if applicable): qemu-kvm-1.3.0-6.el7.x86_64 kernel-3.7.0-0.36.el7.x86_64 libvirt-1.0.3-1.el7.x86_64 How reproducible: 100% Steps 1. Prepare vol xml file # cat vol-test.xml <volume> <name>vol-test</name> <key>/var/lib/libvirt/images/vol-test</key> <source> </source> <capacity>10737418240</capacity> <allocation>3179753472</allocation> <target> <path>/var/lib/libvirt/images/vol-test</path> <format type='raw'/> <permissions> <mode>0644</mode> <owner>36</owner> <group>36</group> <label>system_u:object_r:nfs_t</label> </permissions> </target> </volume> 2. Create a vol with the vol-test.xml # virsh vol-create default vol-test.xml 3. Check the img info # qemu-img info /var/lib/libvirt/images/vol-test image: /var/lib/libvirt/images/vol-test file format: raw virtual size: 10G (10737418240 bytes) disk size: 3.0G # ll /var/lib/libvirt/images/vol-test -rw-r--r--. 1 36 kvm 10737418240 Mar 15 17:07 /var/lib/libvirt/images/vol-test 4. Resize the exsited img # virsh vol-resize /var/lib/libvirt/images/vol-test 20G # echo $? 1 5. Recheck the img info ,the img was not resized # qemu-img info /var/lib/libvirt/images/vol-test image: /var/lib/libvirt/images/vol-test file format: raw virtual size: 10G (10737418240 bytes) disk size: 3.0G 6. it works well on rhel6 Actual results: can't resize the vol and the command was invalid Expected results: should resize the vol successfully