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.
Bug 924567 - The virsh vol-resize command didn't work for rhel7
Summary: The virsh vol-resize command didn't work for rhel7
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-22 05:27 UTC by zhenfeng wang
Modified: 2014-06-18 00:45 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.0.6-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 10:41:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description zhenfeng wang 2013-03-22 05:27:37 UTC
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

Comment 2 zhenfeng wang 2013-03-22 05:29:28 UTC
This bug just be for enlarge the vol size. For the shrink operation, still not support on both RHEL6/7 yet.
FYI:
https://bugzilla.redhat.com/show_bug.cgi?id=804516#c13

Comment 3 Osier Yang 2013-05-24 03:35:47 UTC
Regression introduced by commit 1daa4ba33acf

Comment 4 Osier Yang 2013-05-24 08:56:58 UTC
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

Comment 6 Jincheng Miao 2013-06-05 14:33:01 UTC
this bug fix is verified.

# rpm -q libvirt
libvirt-1.0.6-1.el7.x86_64

# virsh vol-create default vol-test.xml 
Vol vol-test created from vol-test.xml

# 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 Jun  5 22:24 /var/lib/libvirt/images/vol-test

# virsh vol-resize /var/lib/libvirt/images/vol-test 20G
Size of volume 'vol-test' successfully changed to 20G

# echo $?
0

# qemu-img info /var/lib/libvirt/images/vol-test 
image: /var/lib/libvirt/images/vol-test
file format: raw
virtual size: 20G (21474836480 bytes)
disk size: 3.0G

Comment 8 Ludek Smid 2014-06-13 10:41:35 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.


Note You need to log in before you can comment on or make changes to this bug.