Bug 1167998
| Summary: | virt-install fails to create guest using non-sparse logical volume | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Kha Do <kha.t.do> |
| Component: | python-virtinst | Assignee: | Giuseppe Scrivano <gscrivan> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.6 | CC: | dyuan, gscrivan, juzhou, mnavrati, mzhan, tlavigne, tzheng |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | python-virtinst-0.600.0-26.el6 | Doc Type: | Bug Fix |
| Doc Text: |
Prior to this update, input from the user was validated incorrectly by the virt-install utility. Consequently, a non-sparse LVM could not be created and an error message was displayed. This update fixes the input validation and virt-install can now create a non-sparse LVM as expected and an error no longer occurs.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-07-22 07:06:24 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: | |||
I can reproduce bug issue with following package: python-virtinst-0.600.0-24.el6.noarch steps: 1. Create a lvm pool: # virsh pool-info lvmpool Name: lvmpool UUID: 48078a48-ca27-2d50-d5b8-bdaed7d1733a State: running Persistent: yes Autostart: yes Capacity: 10.00 GiB Allocation: 0.00 Available: 10.00 GiB 2. Use virt-install to install a guest on logical volume # virt-install --name=test --disk=pool=lvmpool,size=10,sparse=false --cdrom=/iso/RHEL-6.6-20140926.0-Server-x86_64-dvd1.iso --ram=2048 ERROR Error with storage parameters: Sparse logical volumes are not supported, allocation must be equal to capacity Result: failed to install guest and showing above error. Then try to verify this bug with new build: python-virtinst-0.600.0-26.el6.noarch steps: # virt-install --name=test --disk=pool=lvmpool,size=10,sparse=false --cdrom=/iso/RHEL-6.6-20140926.0-Server-x86_64-dvd1.iso --ram=2048 Starting install... Allocating 'test.img' | 10 GB 00:00 Creating domain... | 0 B 00:01 ..... Result: virt-install create guest using non-sparse logical volume successfully. # virsh vol-info --pool lvmpool /dev/lvmpool/test.img Name: test.img Type: block Capacity: 10.00 GiB Allocation: 10.00 GiB so move this bug from ON_QA to VERIFIED. 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-1372.html |
Description of problem: An error is given when trying to install a guest to a non-sparse logical volume using virt-install: [root@localhost ~]# virt-install --name=test --disk=pool=guests,size=20,sparse=false --cdrom=/mnt/OS.iso --ram=2048 ERROR Error with storage parameters: Sparse logical volumes are not supported, allocation must be equal to capacity Version-Release number of selected component (if applicable): python-virtinst-0.600.0-24 How reproducible: Steps to Reproduce: 1. Create volume pool 2. Run the above command Actual results: ERROR Error with storage parameters: Sparse logical volumes are not supported, allocation must be equal to capacity Expected results: Guest is created Additional info: This appears to be a problem introduced with virtinst-LVM-Show-warning-when-allocation-0-and-allocation-ca.patch: @@ -1350,7 +1350,7 @@ class LogicalVolume(StorageVolume): def __init__(self, name, capacity, pool=None, pool_name=None, conn=None, allocation=None, perms=None): - if allocation and allocation != capacity: + if allocation is not None and allocation != capacity: raise ValueError(_("Sparse logical volumes are not supported, " "allocation must be equal to capacity")) StorageVolume.__init__(self, name=name, pool=pool, pool_name=pool_name, Allocation is hard-coded as 0 on line 1478 in cli.py, so this looks like it will always fail: volinst = vc(pool_name=pool, name=vname, conn=guest.conn, allocation=0, capacity=(size and size * 1024 * 1024 * 1024))