Bug 1465795

Summary: Top utilized Resources (Storage) - VMs should be sorted by actual use, not over-allocation percentage
Product: [oVirt] ovirt-engine-dashboard Reporter: Yaniv Kaul <ykaul>
Component: CoreAssignee: Scott Dickerson <sdickers>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: high Docs Contact:
Priority: medium    
Version: unspecifiedCC: awels, bugs, pmatyas, sdickers, sradco, tjelinek, ykaul
Target Milestone: ovirt-4.2.2Flags: rule-engine: ovirt-4.2+
sdickers: devel_ack+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-29 10:58:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: UX RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
screen: Top Utilized Resources (Storage) - still ordered by allocation ratio none

Description Yaniv Kaul 2017-06-28 08:32:59 UTC
Description of problem:
Currently there ordering is by over-allocation percentage. That provides very little value to the customer. The real interesting question is how much space is actually, on disk, occupied by VM or template disk(s).

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

Comment 2 Yaniv Kaul 2017-07-03 11:38:20 UTC
Shirly, please check which query is used and should we use a different one, etc.

Comment 6 Pavel Novotny 2017-12-18 21:06:35 UTC
FailedQA in
ovirt-engine-4.2.0.2-0.1.el7.noarch
ovirt-engine-dashboard-1.2.0-1.el7ev.noarch

The top 10 VM storage utilization is still ordered by the disk allocation ratio and not by the actually used disk space.
See the attached screenshot, the sorting it evident there.

Comment 7 Pavel Novotny 2017-12-18 21:08:46 UTC
Created attachment 1369688 [details]
screen: Top Utilized Resources (Storage) - still ordered by allocation ratio

Comment 8 Oved Ourfali 2017-12-19 06:49:50 UTC
Scott - can you please take a look?

Comment 9 Oved Ourfali 2017-12-19 06:50:25 UTC
Oops... Shirly?

Comment 10 Tomas Jelinek 2018-01-10 09:49:05 UTC
Shirly, any news?

Comment 11 Alexander Wels 2018-01-22 14:22:43 UTC
Scott, I noticed we are sorting on

  const sortedData = data.slice().sort((a, b) => {
    return (b.used / b.total) - (a.used / a.total)
  })

In ObjectUtilizationList.jsx while the backend already sorts in the query. The query is sorting on USED instead of used percentage. Shirly has fixed the query per this bug, but the UI is resorting it to percentage used again. Could you either remove the sorting altogether or sort by used?

Comment 12 Yaniv Kaul 2018-01-31 13:25:27 UTC
Any news?

Comment 13 Scott Dickerson 2018-01-31 16:59:28 UTC
I know this BZ specifically references the Top Utilized Resources (Storage) 
Virtual Machines utilization list.  What about the other 5 utilization lists?  
How should they sort on the UI?  They are:
  - Top Utilized Resources (CPU), Hosts
  - Top Utilized Resources (CPU), Virtual Machines
  - Top Utilized Resources (Memory), Hosts
  - Top Utilized Resources (Memory), Virtual Machines
  - Top Utilized Resources (Storage), Storage Domains

If they can display as sorted by the data service and SQL queries, I can remove the UI sort completely.

Right now, I'll patch dashboard to remove the sort on the "Top Utilized Resources (Storage), Virtual Machines" utilization list and leave the other sorts in place.

For reference, the SQL query key ultimately used by each list is:
  Top Utilized Resources (CPU), Hosts 
    -> HostDwhDAO.properties, host.cpu_host_utilization

  Top Utilized Resources (CPU), Virtual Machines
    -> VmDwhDAO.properties, vm.cpu_utilization

  Top Utilized Resources (Memory), Hosts
    -> HostDwhDAO.properties, host.mem_host_utilization

  Top Utilized Resources (Memory), Virtual Machines
    -> VmDwhDAO.properties, vm.mem_utilization

  Top Utilized Resources (Storage), Storage Domains
    -> StorageDomainDwhDAO.properties, storage.utilization

  Top Utilized Resources (Storage), Virtual Machines
    -> StorageDomainDwhDAO.properties, storage.vm_utilization

Comment 14 Yaniv Kaul 2018-01-31 17:46:53 UTC
(In reply to Scott Dickerson from comment #13)
> I know this BZ specifically references the Top Utilized Resources (Storage) 
> Virtual Machines utilization list.  What about the other 5 utilization
> lists?  
> How should they sort on the UI?  They are:
>   - Top Utilized Resources (CPU), Hosts
>   - Top Utilized Resources (CPU), Virtual Machines
>   - Top Utilized Resources (Memory), Hosts
>   - Top Utilized Resources (Memory), Virtual Machines
>   - Top Utilized Resources (Storage), Storage Domains
> 
> If they can display as sorted by the data service and SQL queries, I can
> remove the UI sort completely.
> 
> Right now, I'll patch dashboard to remove the sort on the "Top Utilized
> Resources (Storage), Virtual Machines" utilization list and leave the other
> sorts in place.
> 
> For reference, the SQL query key ultimately used by each list is:
>   Top Utilized Resources (CPU), Hosts 
>     -> HostDwhDAO.properties, host.cpu_host_utilization

+1. 

> 
>   Top Utilized Resources (CPU), Virtual Machines
>     -> VmDwhDAO.properties, vm.cpu_utilization

This is probably meaningless (you can't compare CPU utilization between different topologies... But I don't see anything better we could do.

> 
>   Top Utilized Resources (Memory), Hosts
>     -> HostDwhDAO.properties, host.mem_host_utilization

Again - is it in percentage, or absolute numbers? Neither is great. Not sure, but it's not as bad as storage was.

> 
>   Top Utilized Resources (Memory), Virtual Machines
>     -> VmDwhDAO.properties, vm.mem_utilization
> 
>   Top Utilized Resources (Storage), Storage Domains
>     -> StorageDomainDwhDAO.properties, storage.utilization

Is this in absolute or percentage? In this case, I think absolute free or used is better?

> 
>   Top Utilized Resources (Storage), Virtual Machines
>     -> StorageDomainDwhDAO.properties, storage.vm_utilization

What is the value here? Isn't it what I've asked to fix?

Comment 15 Scott Dickerson 2018-02-01 23:16:21 UTC
(In reply to Yaniv Kaul from comment #14)

I left the JavaScript sorting in place for all of the lists except for the VMs in Storage.  The JavaScript sorting resorts based on percent used.  I'd have to dig through the SQL a bit to see what the queries are ordering by - working out sorting across multiple joins isn't my strength.

> > 
> > For reference, the SQL query key ultimately used by each list is:
> >   Top Utilized Resources (CPU), Hosts 
> >     -> HostDwhDAO.properties, host.cpu_host_utilization
> 
> +1. 
> 
> > 
> >   Top Utilized Resources (CPU), Virtual Machines
> >     -> VmDwhDAO.properties, vm.cpu_utilization
> 
> This is probably meaningless (you can't compare CPU utilization between
> different topologies... But I don't see anything better we could do.

It's sorted by percent used.  Maybe percentages are better then actual in this case.

> 
> > 
> >   Top Utilized Resources (Memory), Hosts
> >     -> HostDwhDAO.properties, host.mem_host_utilization
> 
> Again - is it in percentage, or absolute numbers? Neither is great. Not
> sure, but it's not as bad as storage was.
> 
> > 
> >   Top Utilized Resources (Memory), Virtual Machines
> >     -> VmDwhDAO.properties, vm.mem_utilization
> > 
> >   Top Utilized Resources (Storage), Storage Domains
> >     -> StorageDomainDwhDAO.properties, storage.utilization
> 
> Is this in absolute or percentage? In this case, I think absolute free or
> used is better?
> 
> > 
> >   Top Utilized Resources (Storage), Virtual Machines
> >     -> StorageDomainDwhDAO.properties, storage.vm_utilization
> 
> What is the value here? Isn't it what I've asked to fix?

The sort value here is now dependent on the SQL order by, so actual storage used.  Shirly's SQL change and dropping the JavaScript sort made that happen.

I think the specific issue for this BZ is solved.  Might be worth having a re-look at the SQL for the other lists and determining if those sorts should just pass through to the UI.

Comment 16 Yaniv Kaul 2018-02-22 13:36:20 UTC
Should it move to ON_QA for 4.2.2?

Comment 17 Scott Dickerson 2018-02-22 16:28:14 UTC
I missed the backport req for dashboard.  Fixing that shortly.  It'll be in the next 4.2.2 dashboard build.

Comment 18 Petr Matyáš 2018-03-07 14:48:29 UTC
Verified on ovirt-engine-4.2.2.2-0.1.el7.noarch

Comment 19 Sandro Bonazzola 2018-03-29 10:58:50 UTC
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.2 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.