Bug 823362 - vol-create-as should fail when allocate a malformed size image
vol-create-as should fail when allocate a malformed size image
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Osier Yang
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-20 22:52 EDT by zhpeng
Modified: 2013-09-08 20:03 EDT (History)
10 users (show)

See Also:
Fixed In Version: libvirt-0.9.13-3.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:14:56 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description zhpeng 2012-05-20 22:52:15 EDT
Description of problem:
vol-create-as should fail when allocate a malformed size image

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-0.12.1.2-2.292.el6.x86_64
libvirt-0.9.10-20.el6.x86_64
kernel-2.6.32-270.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1, define and start a nfs pool
virsh # pool-info nfs
Name:           nfs
UUID:           9401f015-e2cb-2cb2-2c05-83ba92c8cb4b
State:          running
Persistent:     yes
Autostart:      yes
Capacity:       98.43 GB       ----------> pool capacity
Allocation:     58.37 GB
Available:      40.06 GB

2,create a malformed size image

virsh # vol-create-as nfs big 10000000000000000000000000000000000000G
error: Malformed size 10000000000000000000000000000000000000G
error: Failed to create vol big
error: cannot extend file '/nfs/big': File too large

virsh # vol-create-as nfs big 100000000000G
error: Malformed size 100000000000G
Vol big created             -------------> This takes a long time and should fail

virsh # vol-info /nfs/big --pool nfs
Name:           big
Type:           file
Capacity:       93.13 GB          ------> wrong size. and this image should not exist
Allocation:     373.63 MB

3, create a over commit image in the pool
virsh # vol-create-as nfs big6 100G
Vol big6 created                     ------------> a long time

virsh # vol-info --pool nfs big6
Name:           big6
Type:           file
Capacity:       100.00 GB           -------> expect
Allocation:     401.18 MB



Actual results:
As Steps

Expected results:
1,virsh command should fail when create a malformed size image.
2,create a normal image in nfs pool with vol-create-as should be faster

Additional info:
Comment 1 Osier Yang 2012-06-05 03:35:22 EDT
(In reply to comment #0)
> Description of problem:
> vol-create-as should fail when allocate a malformed size image
> 
> Version-Release number of selected component (if applicable):
> qemu-kvm-rhev-0.12.1.2-2.292.el6.x86_64
> libvirt-0.9.10-20.el6.x86_64
> kernel-2.6.32-270.el6.x86_64
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1, define and start a nfs pool
> virsh # pool-info nfs
> Name:           nfs
> UUID:           9401f015-e2cb-2cb2-2c05-83ba92c8cb4b
> State:          running
> Persistent:     yes
> Autostart:      yes
> Capacity:       98.43 GB       ----------> pool capacity
> Allocation:     58.37 GB
> Available:      40.06 GB
> 
> 2,create a malformed size image
> 
> virsh # vol-create-as nfs big 10000000000000000000000000000000000000G
> error: Malformed size 10000000000000000000000000000000000000G
> error: Failed to create vol big
> error: cannot extend file '/nfs/big': File too large
> 
> virsh # vol-create-as nfs big 100000000000G
> error: Malformed size 100000000000G
> Vol big created             -------------> This takes a long time and should
> fail
> 
> virsh # vol-info /nfs/big --pool nfs
> Name:           big
> Type:           file
> Capacity:       93.13 GB          ------> wrong size. and this image should
> not exist
> Allocation:     373.63 MB
> 
> 3, create a over commit image in the pool
> virsh # vol-create-as nfs big6 100G
> Vol big6 created                     ------------> a long time
> 
> virsh # vol-info --pool nfs big6
> Name:           big6
> Type:           file
> Capacity:       100.00 GB           -------> expect
> Allocation:     401.18 MB
> 
> 
> 
> Actual results:
> As Steps
> 
> Expected results:
> 1,virsh command should fail when create a malformed size image.

This is right requirement.

> 2,create a normal image in nfs pool with vol-create-as should be faster
> 

And this is not, as it's filesystem related, you can't expect libvirt to drive
the filesystem more faster.
Comment 2 Osier Yang 2012-06-05 03:36:14 EDT
commit ee58b581c4b275f06904253285b7ad562dc09745
Author: Osier Yang <jyang@redhat.com>
Date:   Mon Jun 4 17:08:34 2012 +0800

    virsh: Back out if the argument for vol-create-as is malformed

Commit in upstream, move to POST.
Comment 5 Huang Wenlong 2012-07-24 01:30:55 EDT
Verify this bug with 
libvirt-0.9.13-3.el6.x86_64


# virsh vol-create-as netfs big 10000000000000G
error: Malformed size 10000000000000G

[root@intel-q9400-4-2 virsh-rail]# virsh pool-info netfs
Name:           netfs
UUID:           302df04c-6927-e9cd-2719-c7a3a7ed436b
State:          running
Persistent:     no
Autostart:      no
Capacity:       141.89 GiB
Allocation:     99.83 GiB
Available:      42.06 GiB
Comment 6 errata-xmlrpc 2013-02-21 02:14:56 EST
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.

http://rhn.redhat.com/errata/RHSA-2013-0276.html

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