Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1686281 - The "VMs with Volume Free Space <= 20%" report showing VMs which has volume free space more than 20% also.
Summary: The "VMs with Volume Free Space <= 20%" report showing VMs which has volume f...
Keywords:
Status: POST
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Reporting
Version: 5.10.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.11.0
Assignee: Keenan Brock
QA Contact: Parthvi Vala
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks: 1692488 1696420
TreeView+ depends on / blocked
 
Reported: 2019-03-07 07:36 UTC by Nikhil Gupta
Modified: 2019-04-04 19:57 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1696420 (view as bug list)
Environment:
Last Closed:
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:


Attachments (Terms of Use)
VMs with Volume Free Space <= 20% report (deleted)
2019-03-07 23:10 UTC, Nikhil Gupta
no flags Details

Description Nikhil Gupta 2019-03-07 07:36:22 UTC
Description of problem:
When we create a report from "VMs with Volume Free Space <= 20%" default report to get all VMs details which has volume free space less than or equal to 20%. However, it is reporting some Vms which has volume free space more than 20%.


Version-Release number of selected component (if applicable):
cfme-5.10

How reproducible:
Always

Steps to Reproduce:
1. Go to Cloud Intel -> Reports -> All Reports -> Configuration Management -> Virtual Machines
2. Click on "VMs with Volume Free Space <= 20%" default report.
3. Queue it.

Actual results:
It is reporting VMs which has volume free space more than 20%.

Expected results:
It should report only those VMs which has volume free space less than or equal to 20%.

Comment 2 Nikhil Gupta 2019-03-07 23:10:01 UTC
Created attachment 1541986 [details]
VMs with Volume Free Space <= 20% report

Comment 4 Keenan Brock 2019-04-03 18:33:51 UTC
It looks like the miq expression is getting confused when there is no disk usage number for a volume.

I put together a few disk volumes to test:

NO:  v1
     vol_v1: 7516192768 (70.0%)  of 10737418240
RPT: v2
     vol_v2: 8589934592 (80.0%)  of 10737418240
RPT: v3
     vol_v3: 9663676416 (90.0%)  of 10737418240
RPT: v4 (will hide this)
     vol_v4: NIL (NIL%)  of NIL
RPT: v5 (will hide this)
     vol_v5: NIL (NIL%)  of 0
RPT: v6 (will hide this)
     vol_v6: 0 (NIL%)  of NIL
RPT: v7
     vol_v7: 0 (0.0%)  of 10737418240
     vol_v7_1: 9663676416 (90.0%)  of 10737418240
RPT: v8 (will hide this)
     vol_v8: 0 (0.0%)  of 10737418240
     vol_v8_1: 5368709120 (50.0%)  of 10737418240
     vol_v8_2: NIL (NIL%)  of 10737418240
NO:  v9
     vol_v9: 0 (0.0%)  of 10737418240
     vol_v9_1: 5368709120 (50.0%)  of 10737418240
     vol_v9_2: 0 (0.0%)  of 10737418240


vm #8 has plenty of disk space, but the "swap" volume, with the nil disk usage, is showing up as 0% free, and causing the vm to show up in the report.

I will changing the procedure to say used_space_percent >= 80% - this will not show vms that have volumes with unknown disk space

Comment 6 CFME Bot 2019-04-03 19:35:55 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/0daf0d2a4c940e43079a81263ea91c097898df6a
commit 0daf0d2a4c940e43079a81263ea91c097898df6a
Author:     Keenan Brock <keenan@thebrocks.net>
AuthorDate: Wed Apr  3 14:57:12 2019 -0400
Commit:     Keenan Brock <keenan@thebrocks.net>
CommitDate: Wed Apr  3 14:57:12 2019 -0400

    fix: swap makes vms out of disk space report false positive

    MiqExpressions convert nil to a floating point number (which is 0)

    nil <= 20 == true
    nil.to_f ==> 0
    0 <= 20 == true

    Swap partitions have a nil free_space / free_space_percentage.

    so free_space_percentage <= 20 shows true for swap

    So any vm with a swap partition will say it is low on disk space.

    Fix is to ask if used space is over 80%

    nil >= 80 == false
    nil.to_f ==> 0
    0 >= 80 == false

    https://bugzilla.redhat.com/show_bug.cgi?id=1686281
 product/reports/100_Configuration Management - Virtual Machines/028_VMs with Volume Free Space -= 20%.yaml | 6 +-
 1 file changed, 3 insertions(+), 3 deletions(-)


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