Bug 1224018
Summary: | The disk pool alloc information are wrong after the new volume created | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Yang Yang <yanyang> |
Component: | libvirt | Assignee: | John Ferlan <jferlan> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.2 | CC: | dyuan, jferlan, mzhan, rbalakri, shyu, xuzhang, yisun |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.2.16-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-11-19 06:36:09 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
Yang Yang
2015-05-22 02:01:00 UTC
Posted a patch upstream to resolve this: http://www.redhat.com/archives/libvir-list/2015-May/msg00865.html Patch was pushed upstream: commit 6839b08ba1e5e6dfe58d43a933d740198518e49d Author: John Ferlan <jferlan> Date: Thu May 21 21:10:56 2015 -0400 storage: Fix problem with disk backend pool allocation calculation The disk pool recalculates the pool allocation, capacity, and available values each time through processing a newly created disk partition. This created an issue with the allocation setting since the code used is shared with the refresh path. Each path calls virStorageBackendDiskReadPartitions which initializes the pool values and then processes the partition table from the 'libvirt_parthelper' utility output with the only difference being create passes a specific volume to be processed while refresh pass a NULL indicating to process all volumes. That passed volume is check during the virStorageBackendDiskMakeVol call to see if the current partition described by the volume key already exists. If it exists, then no adjustments are made to the allocation and the next entry in the output is checked. For the create path this resulted in only the most recently created partition size would be accounted for in the 'allocation' setting. This patch thus checks whether the incoming volume is NULL before clearing the pool allocation value. git describe 6839b08ba1e5e6dfe58d43a933d740198518e49d v1.2.16-rc1-16-g6839b08 PASS Verified on libvirt-1.2.17-2.el7.x86_64 Please note, per bz 1206521 comment 8, extended disk won't take up pool's allocated space. Steps: 1. # cat disk.pool <pool type='disk'> <name>sdb</name> <source> <device path='/dev/sdb'> </device> <format type='dos'/> </source> <target> <path>/dev</path> <permissions> <mode>0700</mode> <owner>0</owner> <group>0</group> </permissions> </target> </pool> 2. #virsh pool-define disk.pool; virsh pool-build sdb; virsh pool-start sdb 3. # virsh pool-info sdb Name: sdb UUID: 0d5e0da6-db87-4a93-975e-4d3467a64d4a State: running Persistent: yes Autostart: no Capacity: 7.45 GiB Allocation: 0.00 B Available: 7.45 GiB 4. # virsh vol-create-as sdb sdb1 2G <=== create a primary partition Vol sdb1 created 5. # virsh pool-info sdb Name: sdb UUID: 0d5e0da6-db87-4a93-975e-4d3467a64d4a State: running Persistent: yes Autostart: no Capacity: 7.45 GiB Allocation: 2.00 GiB <=== expected Available: 5.45 GiB 6. # virsh vol-create-as sdb sdb2 2G <=== create another partition Vol sdb2 created 7. # virsh pool-info sdb Name: sdb UUID: 0d5e0da6-db87-4a93-975e-4d3467a64d4a State: running Persistent: yes Autostart: no Capacity: 7.45 GiB Allocation: 4.00 GiB <==== expected Available: 3.45 GiB 8. # virsh vol-create-as sdb sdb3 1G --format extended <=== create a extended partition Vol sdb3 created 9. # virsh pool-info sdb Name: sdb UUID: 0d5e0da6-db87-4a93-975e-4d3467a64d4a State: running Persistent: yes Autostart: no Capacity: 7.45 GiB Allocation: 4.00 GiB <==== extended partition won't take up allocation as expected Available: 3.45 GiB 10. # virsh vol-list --details sdb Name Path Type Capacity Allocation ---------------------------------------------- sdb1 /dev/sdb1 block 2.00 GiB 2.00 GiB sdb2 /dev/sdb2 block 2.00 GiB 2.00 GiB sdb3 /dev/sdb3 block 1.00 GiB 1.00 GiB <===== extended partition can be viewed here as expected. NB. there is a bug for prated bz 1245144 which may cause some error message during vol-create-as, but partitions could be successfully created. 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 |