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%.
Created attachment 1541986 [details] VMs with Volume Free Space <= 20% report
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
https://github.com/ManageIQ/manageiq/pull/18623
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/0daf0d2a4c940e43079a81263ea91c097898df6a commit 0daf0d2a4c940e43079a81263ea91c097898df6a Author: Keenan Brock <keenan> AuthorDate: Wed Apr 3 14:57:12 2019 -0400 Commit: Keenan Brock <keenan> 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(-)
FIXED. Verified on 5.11.0.2.20190430174828_0e34dea.