Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 950129

Summary: [RFE] ovirt-engine-restapi: Add the option to retrieve the top X disks in a storage domain ( disk space wise )
Product: Red Hat Enterprise Virtualization Manager Reporter: Oded Ramraz <oramraz>
Component: ovirt-engine-restapiAssignee: Ravi Nori <rnori>
Status: CLOSED WONTFIX QA Contact: Aharon Canan <acanan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: acanan, amureini, bazulay, bsettle, derez, iheim, juan.hernandez, oliel, oramraz, rbalakri, Rhev-m-bugs, scohen
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-01-27 22:04:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Oded Ramraz 2013-04-09 17:46:24 UTC
Description of problem:

Please  add the option to retrieve the top X consuming VM's in a storage domain ( disk space wise ) 
We have the same feature in UI: under data storage domain there are sub tabs for VM's / Templates with highest disk space . 




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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Oded Ramraz 2013-04-09 17:50:01 UTC
see also  https://bugzilla.redhat.com/show_bug.cgi?id=949546#c8

Comment 2 Itamar Heim 2013-04-14 06:35:53 UTC
dup of bug 675830?

Comment 3 Ayal Baron 2013-05-08 11:49:57 UTC
Daniel, don't we already support this query in the API?

Comment 8 Ori Liel 2013-11-18 14:47:54 UTC
(What I'm about to write is about VMs but applies to templates as well):

The feature requested in this bugzilla is to enable ordering, by disk space consumption, of VMs on a data domain. 

But in the API we do not support displaying VMs on data domains in the first place. The reason for this is, that a VM's disks may be scattered across several data domains, and thus a VM does not 'belong' to any single data domain. The only case where a VM can be thought of as contained in a storage-domain, is in the case export domains. 

Thus, the API command: 

  GET .../api/storagedomains/xxx/vms

is meant only for export domains. If 'xxx', above, is the ID of a data domain - no VMs are returned. 

What we *do* show in the context of a data domain, is disks. Here an order-by would be possible. We could add a URI-header, which, if supplied, means that the user would like the disks of this domain to be returned ordered by data consumption.

Comment 9 Juan Hernández 2014-01-18 17:06:05 UTC
I think that the user can achieve the same result combining the already existing "max" matrix parameter and the "search" query parameter, like this:

  https://rhel.example.com/api/disks;max=10?search=storage=Data%20sortby%20actual_size%20desc

Is this enough? If so I would suggest to close the bug as NOTABUG.

Comment 10 Ayal Baron 2014-01-27 12:52:26 UTC
(In reply to Juan Hernández from comment #9)
> I think that the user can achieve the same result combining the already
> existing "max" matrix parameter and the "search" query parameter, like this:
> 
>  
> https://rhel.example.com/api/disks;
> max=10?search=storage=Data%20sortby%20actual_size%20desc
> 
> Is this enough? If so I would suggest to close the bug as NOTABUG.

Daniel?

Comment 11 Daniel Erez 2014-01-27 13:32:35 UTC
(In reply to Ayal Baron from comment #10)
> (In reply to Juan Hernández from comment #9)
> > I think that the user can achieve the same result combining the already
> > existing "max" matrix parameter and the "search" query parameter, like this:
> > 
> >  
> > https://rhel.example.com/api/disks;
> > max=10?search=storage=Data%20sortby%20actual_size%20desc
> > 
> > Is this enough? If so I would suggest to close the bug as NOTABUG.
> 
> Daniel?

IIUC, the functionality requested by this RFE should resembles VMs sub-tab under Storage main-tab in the webadmin. The sub-tab displays VMs with disks located on the selected storage domain. For overcoming performance issues, the sub-tab displayed only top 10 VMs with largest disks - this limitation has been removed in 3.3. Question is whether we're interested to retrieve VMs or disks from the rest-api. If we only need the disks then the solution suggested by Juan is indeed enough. Otherwise, we need to find a means to get also the VMs from the api.

Comment 12 Ayal Baron 2014-01-27 13:38:40 UTC
(In reply to Daniel Erez from comment #11)
> (In reply to Ayal Baron from comment #10)
> > (In reply to Juan Hernández from comment #9)
> > > I think that the user can achieve the same result combining the already
> > > existing "max" matrix parameter and the "search" query parameter, like this:
> > > 
> > >  
> > > https://rhel.example.com/api/disks;
> > > max=10?search=storage=Data%20sortby%20actual_size%20desc
> > > 
> > > Is this enough? If so I would suggest to close the bug as NOTABUG.
> > 
> > Daniel?
> 
> IIUC, the functionality requested by this RFE should resembles VMs sub-tab
> under Storage main-tab in the webadmin. The sub-tab displays VMs with disks
> located on the selected storage domain. For overcoming performance issues,
> the sub-tab displayed only top 10 VMs with largest disks - this limitation
> has been removed in 3.3. Question is whether we're interested to retrieve
> VMs or disks from the rest-api. If we only need the disks then the solution
> suggested by Juan is indeed enough. Otherwise, we need to find a means to
> get also the VMs from the api.

You can programmatically get to the VMs from the disks, no?
Ravi also posted a patch for fetching the *disks*, does that ease the user experience?

Comment 13 Daniel Erez 2014-01-27 13:49:45 UTC
(In reply to Ayal Baron from comment #12)
> (In reply to Daniel Erez from comment #11)
> > (In reply to Ayal Baron from comment #10)
> > > (In reply to Juan Hernández from comment #9)
> > > > I think that the user can achieve the same result combining the already
> > > > existing "max" matrix parameter and the "search" query parameter, like this:
> > > > 
> > > >  
> > > > https://rhel.example.com/api/disks;
> > > > max=10?search=storage=Data%20sortby%20actual_size%20desc
> > > > 
> > > > Is this enough? If so I would suggest to close the bug as NOTABUG.
> > > 
> > > Daniel?
> > 
> > IIUC, the functionality requested by this RFE should resembles VMs sub-tab
> > under Storage main-tab in the webadmin. The sub-tab displays VMs with disks
> > located on the selected storage domain. For overcoming performance issues,
> > the sub-tab displayed only top 10 VMs with largest disks - this limitation
> > has been removed in 3.3. Question is whether we're interested to retrieve
> > VMs or disks from the rest-api. If we only need the disks then the solution
> > suggested by Juan is indeed enough. Otherwise, we need to find a means to
> > get also the VMs from the api.
> 
> You can programmatically get to the VMs from the disks, no?

It would be simpler to use GetVmsByStorageDomainQuery as the UI does. The issue is representing it in the API (see comment #8).

> Ravi also posted a patch for fetching the *disks*, does that ease the user
> experience?

It can already be achieved using a search query as Juan suggested in comment #9.

Comment 14 Ayal Baron 2014-01-27 14:11:54 UTC
(In reply to Daniel Erez from comment #13)
> (In reply to Ayal Baron from comment #12)
> > (In reply to Daniel Erez from comment #11)
> > > (In reply to Ayal Baron from comment #10)
> > > > (In reply to Juan Hernández from comment #9)
> > > > > I think that the user can achieve the same result combining the already
> > > > > existing "max" matrix parameter and the "search" query parameter, like this:
> > > > > 
> > > > >  
> > > > > https://rhel.example.com/api/disks;
> > > > > max=10?search=storage=Data%20sortby%20actual_size%20desc
> > > > > 
> > > > > Is this enough? If so I would suggest to close the bug as NOTABUG.
> > > > 
> > > > Daniel?
> > > 
> > > IIUC, the functionality requested by this RFE should resembles VMs sub-tab
> > > under Storage main-tab in the webadmin. The sub-tab displays VMs with disks
> > > located on the selected storage domain. For overcoming performance issues,
> > > the sub-tab displayed only top 10 VMs with largest disks - this limitation
> > > has been removed in 3.3. Question is whether we're interested to retrieve
> > > VMs or disks from the rest-api. If we only need the disks then the solution
> > > suggested by Juan is indeed enough. Otherwise, we need to find a means to
> > > get also the VMs from the api.
> > 
> > You can programmatically get to the VMs from the disks, no?
> 
> It would be simpler to use GetVmsByStorageDomainQuery as the UI does. The
> issue is representing it in the API (see comment #8).

So let's keep this open to allow for that.

> 
> > Ravi also posted a patch for fetching the *disks*, does that ease the user
> > experience?
> 
> It can already be achieved using a search query as Juan suggested in comment
> #9.

Comment 15 Allon Mureinik 2015-01-27 22:04:18 UTC
According to the comments above, this doesn't seem as though it's really required.

If it is, please provide a clear explanation why and reopen.