You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Koushik Das <ko...@citrix.com> on 2014/03/11 07:29:15 UTC

Review Request 19022: List VM enhancement to support querying with multiple VM IDs

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/19022/
-----------------------------------------------------------

Review request for cloudstack, daan Hoogland and Min Chen.


Bugs: CLOUDSTACK-6052
    https://issues.apache.org/jira/browse/CLOUDSTACK-6052


Repository: cloudstack-git


Description
-------

Currently list VM can only be called using a single VM ID. So if there is a need to query a set of VMs using ID then either multiple list VM calls need to be made or all VMs needs to be fetched and then do a client side filtering. Both approaches are sub-optimal - the former results in multiple queries to database and the latter will be an overkill if you need a small subset from a very large number of VMs. 

The proposal is to have an additional parameter to specify a list of VM IDs for which the data needs to be fetched. Using this the required VMs can be queried in an efficient manner. With the new parameter the syntax would look like 
http://localhost:8096/api?command=listVirtualMachines&listAll=true&ids=eddac053-9b12-4d2e-acb7-233de2e98112,009966fc-4d7b-4f84-8609-254979ba0134 

The new 'ids' parameter will be mutually exclusive with the existing 'id' parameter.


Diffs
-----

  api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java 1a564f6 
  server/src/com/cloud/api/query/QueryManagerImpl.java 4200799 
  test/integration/smoke/test_deploy_vm.py 425aeb7 

Diff: https://reviews.apache.org/r/19022/diff/


Testing
-------

Added integration test, also verified manually.


Thanks,

Koushik Das


Re: Review Request 19022: List VM enhancement to support querying with multiple VM IDs

Posted by daan Hoogland <da...@gmail.com>.

> On March 11, 2014, 7:41 a.m., daan Hoogland wrote:
> > server/src/com/cloud/api/query/QueryManagerImpl.java, line 731
> > <https://reviews.apache.org/r/19022/diff/1/?file=516059#file516059line731>
> >
> >     Why not be lenient and consider the id as part of ids?
> >     You are being strict on something that isn't hurtful but an empty ids when no id is given is not checked!
> 
> Koushik Das wrote:
>     I haven't removed 'id' due to back-compat. As I have mentioned 'id' and 'ids' are mutually exclusive. Also it is a valid scenario to not pass any of id or ids.

ok, I don't see why id and ids should be mutually exclusive, but i don't mind either. If passing no id at all is a valid scenario then it is allright to not check but I would still initialize the list and addAll to it. Not an issue thought!


- daan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/19022/#review36764
-----------------------------------------------------------


On March 11, 2014, 6:29 a.m., Koushik Das wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/19022/
> -----------------------------------------------------------
> 
> (Updated March 11, 2014, 6:29 a.m.)
> 
> 
> Review request for cloudstack, daan Hoogland and Min Chen.
> 
> 
> Bugs: CLOUDSTACK-6052
>     https://issues.apache.org/jira/browse/CLOUDSTACK-6052
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> Currently list VM can only be called using a single VM ID. So if there is a need to query a set of VMs using ID then either multiple list VM calls need to be made or all VMs needs to be fetched and then do a client side filtering. Both approaches are sub-optimal - the former results in multiple queries to database and the latter will be an overkill if you need a small subset from a very large number of VMs. 
> 
> The proposal is to have an additional parameter to specify a list of VM IDs for which the data needs to be fetched. Using this the required VMs can be queried in an efficient manner. With the new parameter the syntax would look like 
> http://localhost:8096/api?command=listVirtualMachines&listAll=true&ids=eddac053-9b12-4d2e-acb7-233de2e98112,009966fc-4d7b-4f84-8609-254979ba0134 
> 
> The new 'ids' parameter will be mutually exclusive with the existing 'id' parameter.
> 
> 
> Diffs
> -----
> 
>   api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java 1a564f6 
>   server/src/com/cloud/api/query/QueryManagerImpl.java 4200799 
>   test/integration/smoke/test_deploy_vm.py 425aeb7 
> 
> Diff: https://reviews.apache.org/r/19022/diff/
> 
> 
> Testing
> -------
> 
> Added integration test, also verified manually.
> 
> 
> Thanks,
> 
> Koushik Das
> 
>


Re: Review Request 19022: List VM enhancement to support querying with multiple VM IDs

Posted by Koushik Das <ko...@citrix.com>.

> On March 11, 2014, 7:41 a.m., daan Hoogland wrote:
> > server/src/com/cloud/api/query/QueryManagerImpl.java, line 731
> > <https://reviews.apache.org/r/19022/diff/1/?file=516059#file516059line731>
> >
> >     Why not be lenient and consider the id as part of ids?
> >     You are being strict on something that isn't hurtful but an empty ids when no id is given is not checked!

I haven't removed 'id' due to back-compat. As I have mentioned 'id' and 'ids' are mutually exclusive. Also it is a valid scenario to not pass any of id or ids.


- Koushik


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/19022/#review36764
-----------------------------------------------------------


On March 11, 2014, 6:29 a.m., Koushik Das wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/19022/
> -----------------------------------------------------------
> 
> (Updated March 11, 2014, 6:29 a.m.)
> 
> 
> Review request for cloudstack, daan Hoogland and Min Chen.
> 
> 
> Bugs: CLOUDSTACK-6052
>     https://issues.apache.org/jira/browse/CLOUDSTACK-6052
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> Currently list VM can only be called using a single VM ID. So if there is a need to query a set of VMs using ID then either multiple list VM calls need to be made or all VMs needs to be fetched and then do a client side filtering. Both approaches are sub-optimal - the former results in multiple queries to database and the latter will be an overkill if you need a small subset from a very large number of VMs. 
> 
> The proposal is to have an additional parameter to specify a list of VM IDs for which the data needs to be fetched. Using this the required VMs can be queried in an efficient manner. With the new parameter the syntax would look like 
> http://localhost:8096/api?command=listVirtualMachines&listAll=true&ids=eddac053-9b12-4d2e-acb7-233de2e98112,009966fc-4d7b-4f84-8609-254979ba0134 
> 
> The new 'ids' parameter will be mutually exclusive with the existing 'id' parameter.
> 
> 
> Diffs
> -----
> 
>   api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java 1a564f6 
>   server/src/com/cloud/api/query/QueryManagerImpl.java 4200799 
>   test/integration/smoke/test_deploy_vm.py 425aeb7 
> 
> Diff: https://reviews.apache.org/r/19022/diff/
> 
> 
> Testing
> -------
> 
> Added integration test, also verified manually.
> 
> 
> Thanks,
> 
> Koushik Das
> 
>


Re: Review Request 19022: List VM enhancement to support querying with multiple VM IDs

Posted by Daan Hoogland <da...@gmail.com>.
On Wed, Mar 12, 2014 at 1:13 PM, Koushik Das <ko...@citrix.com> wrote:
> [Koushik] Yes.
>


then ship

-- 
Daan

Re: Review Request 19022: List VM enhancement to support querying with multiple VM IDs

Posted by Koushik Das <ko...@citrix.com>.
On 11-Mar-2014, at 7:24 PM, Daan Hoogland <da...@gmail.com> wrote:

> You are saying it must be null and not empty?

[Koushik] Yes.


> 
> 
> On Tue, Mar 11, 2014 at 1:41 PM, Koushik Das <ko...@citrix.com> wrote:
> 
>>   This is an automatically generated e-mail. To reply, visit:
>> https://reviews.apache.org/r/19022/
>> 
>> On March 11th, 2014, 7:41 a.m. UTC, *daan Hoogland* wrote:
>> 
>>  server/src/com/cloud/api/query/QueryManagerImpl.java<https://reviews.apache.org/r/19022/diff/1/?file=516059#file516059line731> (Diff
>> revision 1)
>> 
>> public class QueryManagerImpl extends ManagerBase implements QueryService {
>> 
>>   731
>> 
>>        List<Long> ids = null;
>> 
>>  Why not be lenient and consider the id as part of ids?
>> You are being strict on something that isn't hurtful but an empty ids when no id is given is not checked!
>> 
>> On March 11th, 2014, 8:34 a.m. UTC, *Koushik Das* wrote:
>> 
>> I haven't removed 'id' due to back-compat. As I have mentioned 'id' and 'ids' are mutually exclusive. Also it is a valid scenario to not pass any of id or ids.
>> 
>> On March 11th, 2014, 10:56 a.m. UTC, *daan Hoogland* wrote:
>> 
>> ok, I don't see why id and ids should be mutually exclusive, but i don't mind either. If passing no id at all is a valid scenario then it is allright to not check but I would still initialize the list and addAll to it. Not an issue thought!
>> 
>> Thanks for the comment Daan.
>> 
>>>>> I would still initialize the list and addAll to it
>> I don't quite follow what do you mean by addAll to the list. The sql query that gets generated looks like "where id in (1, 2, 3)" if the list is non-null. If there is no id specified then the list is null and is not considered while building the query.
>> 
>> 
>> - Koushik
>> 
>> On March 11th, 2014, 6:29 a.m. UTC, Koushik Das wrote:
>>  Review request for cloudstack, daan Hoogland and Min Chen.
>> By Koushik Das.
>> 
>> *Updated March 11, 2014, 6:29 a.m.*
>> *Bugs: * CLOUDSTACK-6052<https://issues.apache.org/jira/browse/CLOUDSTACK-6052>
>> *Repository: * cloudstack-git
>> Description
>> 
>> Currently list VM can only be called using a single VM ID. So if there is a need to query a set of VMs using ID then either multiple list VM calls need to be made or all VMs needs to be fetched and then do a client side filtering. Both approaches are sub-optimal - the former results in multiple queries to database and the latter will be an overkill if you need a small subset from a very large number of VMs.
>> 
>> The proposal is to have an additional parameter to specify a list of VM IDs for which the data needs to be fetched. Using this the required VMs can be queried in an efficient manner. With the new parameter the syntax would look like http://localhost:8096/api?command=listVirtualMachines&listAll=true&ids=eddac053-9b12-4d2e-acb7-233de2e98112,009966fc-4d7b-4f84-8609-254979ba0134
>> 
>> The new 'ids' parameter will be mutually exclusive with the existing 'id' parameter.
>> 
>>  Testing
>> 
>> Added integration test, also verified manually.
>> 
>>  Diffs
>> 
>>   - api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java
>>   (1a564f6)
>>   - server/src/com/cloud/api/query/QueryManagerImpl.java (4200799)
>>   - test/integration/smoke/test_deploy_vm.py (425aeb7)
>> 
>> View Diff <https://reviews.apache.org/r/19022/diff/>
>> 
> 
> 
> 
> -- 
> Daan


Re: Review Request 19022: List VM enhancement to support querying with multiple VM IDs

Posted by Daan Hoogland <da...@gmail.com>.
You are saying it must be null and not empty?


On Tue, Mar 11, 2014 at 1:41 PM, Koushik Das <ko...@citrix.com> wrote:

>    This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/19022/
>
> On March 11th, 2014, 7:41 a.m. UTC, *daan Hoogland* wrote:
>
>   server/src/com/cloud/api/query/QueryManagerImpl.java<https://reviews.apache.org/r/19022/diff/1/?file=516059#file516059line731> (Diff
> revision 1)
>
> public class QueryManagerImpl extends ManagerBase implements QueryService {
>
>    731
>
>         List<Long> ids = null;
>
>   Why not be lenient and consider the id as part of ids?
> You are being strict on something that isn't hurtful but an empty ids when no id is given is not checked!
>
>  On March 11th, 2014, 8:34 a.m. UTC, *Koushik Das* wrote:
>
> I haven't removed 'id' due to back-compat. As I have mentioned 'id' and 'ids' are mutually exclusive. Also it is a valid scenario to not pass any of id or ids.
>
>  On March 11th, 2014, 10:56 a.m. UTC, *daan Hoogland* wrote:
>
> ok, I don't see why id and ids should be mutually exclusive, but i don't mind either. If passing no id at all is a valid scenario then it is allright to not check but I would still initialize the list and addAll to it. Not an issue thought!
>
>  Thanks for the comment Daan.
>
> >>> I would still initialize the list and addAll to it
> I don't quite follow what do you mean by addAll to the list. The sql query that gets generated looks like "where id in (1, 2, 3)" if the list is non-null. If there is no id specified then the list is null and is not considered while building the query.
>
>
> - Koushik
>
> On March 11th, 2014, 6:29 a.m. UTC, Koushik Das wrote:
>   Review request for cloudstack, daan Hoogland and Min Chen.
> By Koushik Das.
>
> *Updated March 11, 2014, 6:29 a.m.*
>  *Bugs: * CLOUDSTACK-6052<https://issues.apache.org/jira/browse/CLOUDSTACK-6052>
>  *Repository: * cloudstack-git
> Description
>
> Currently list VM can only be called using a single VM ID. So if there is a need to query a set of VMs using ID then either multiple list VM calls need to be made or all VMs needs to be fetched and then do a client side filtering. Both approaches are sub-optimal - the former results in multiple queries to database and the latter will be an overkill if you need a small subset from a very large number of VMs.
>
> The proposal is to have an additional parameter to specify a list of VM IDs for which the data needs to be fetched. Using this the required VMs can be queried in an efficient manner. With the new parameter the syntax would look like http://localhost:8096/api?command=listVirtualMachines&listAll=true&ids=eddac053-9b12-4d2e-acb7-233de2e98112,009966fc-4d7b-4f84-8609-254979ba0134
>
> The new 'ids' parameter will be mutually exclusive with the existing 'id' parameter.
>
>   Testing
>
> Added integration test, also verified manually.
>
>   Diffs
>
>    - api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java
>    (1a564f6)
>    - server/src/com/cloud/api/query/QueryManagerImpl.java (4200799)
>    - test/integration/smoke/test_deploy_vm.py (425aeb7)
>
> View Diff <https://reviews.apache.org/r/19022/diff/>
>



-- 
Daan

Re: Review Request 19022: List VM enhancement to support querying with multiple VM IDs

Posted by Koushik Das <ko...@citrix.com>.

> On March 11, 2014, 7:41 a.m., daan Hoogland wrote:
> > server/src/com/cloud/api/query/QueryManagerImpl.java, line 731
> > <https://reviews.apache.org/r/19022/diff/1/?file=516059#file516059line731>
> >
> >     Why not be lenient and consider the id as part of ids?
> >     You are being strict on something that isn't hurtful but an empty ids when no id is given is not checked!
> 
> Koushik Das wrote:
>     I haven't removed 'id' due to back-compat. As I have mentioned 'id' and 'ids' are mutually exclusive. Also it is a valid scenario to not pass any of id or ids.
> 
> daan Hoogland wrote:
>     ok, I don't see why id and ids should be mutually exclusive, but i don't mind either. If passing no id at all is a valid scenario then it is allright to not check but I would still initialize the list and addAll to it. Not an issue thought!

Thanks for the comment Daan.

>>> I would still initialize the list and addAll to it
I don't quite follow what do you mean by addAll to the list. The sql query that gets generated looks like "where id in (1, 2, 3)" if the list is non-null. If there is no id specified then the list is null and is not considered while building the query.


- Koushik


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/19022/#review36764
-----------------------------------------------------------


On March 11, 2014, 6:29 a.m., Koushik Das wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/19022/
> -----------------------------------------------------------
> 
> (Updated March 11, 2014, 6:29 a.m.)
> 
> 
> Review request for cloudstack, daan Hoogland and Min Chen.
> 
> 
> Bugs: CLOUDSTACK-6052
>     https://issues.apache.org/jira/browse/CLOUDSTACK-6052
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> Currently list VM can only be called using a single VM ID. So if there is a need to query a set of VMs using ID then either multiple list VM calls need to be made or all VMs needs to be fetched and then do a client side filtering. Both approaches are sub-optimal - the former results in multiple queries to database and the latter will be an overkill if you need a small subset from a very large number of VMs. 
> 
> The proposal is to have an additional parameter to specify a list of VM IDs for which the data needs to be fetched. Using this the required VMs can be queried in an efficient manner. With the new parameter the syntax would look like 
> http://localhost:8096/api?command=listVirtualMachines&listAll=true&ids=eddac053-9b12-4d2e-acb7-233de2e98112,009966fc-4d7b-4f84-8609-254979ba0134 
> 
> The new 'ids' parameter will be mutually exclusive with the existing 'id' parameter.
> 
> 
> Diffs
> -----
> 
>   api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java 1a564f6 
>   server/src/com/cloud/api/query/QueryManagerImpl.java 4200799 
>   test/integration/smoke/test_deploy_vm.py 425aeb7 
> 
> Diff: https://reviews.apache.org/r/19022/diff/
> 
> 
> Testing
> -------
> 
> Added integration test, also verified manually.
> 
> 
> Thanks,
> 
> Koushik Das
> 
>


Re: Review Request 19022: List VM enhancement to support querying with multiple VM IDs

Posted by daan Hoogland <da...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/19022/#review36764
-----------------------------------------------------------


I will give it a test spin. I cannot judge the test script you added. Good thing that you added it!


server/src/com/cloud/api/query/QueryManagerImpl.java
<https://reviews.apache.org/r/19022/#comment67974>

    Why not be lenient and consider the id as part of ids?
    You are being strict on something that isn't hurtful but an empty ids when no id is given is not checked!


- daan Hoogland


On March 11, 2014, 6:29 a.m., Koushik Das wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/19022/
> -----------------------------------------------------------
> 
> (Updated March 11, 2014, 6:29 a.m.)
> 
> 
> Review request for cloudstack, daan Hoogland and Min Chen.
> 
> 
> Bugs: CLOUDSTACK-6052
>     https://issues.apache.org/jira/browse/CLOUDSTACK-6052
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> Currently list VM can only be called using a single VM ID. So if there is a need to query a set of VMs using ID then either multiple list VM calls need to be made or all VMs needs to be fetched and then do a client side filtering. Both approaches are sub-optimal - the former results in multiple queries to database and the latter will be an overkill if you need a small subset from a very large number of VMs. 
> 
> The proposal is to have an additional parameter to specify a list of VM IDs for which the data needs to be fetched. Using this the required VMs can be queried in an efficient manner. With the new parameter the syntax would look like 
> http://localhost:8096/api?command=listVirtualMachines&listAll=true&ids=eddac053-9b12-4d2e-acb7-233de2e98112,009966fc-4d7b-4f84-8609-254979ba0134 
> 
> The new 'ids' parameter will be mutually exclusive with the existing 'id' parameter.
> 
> 
> Diffs
> -----
> 
>   api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java 1a564f6 
>   server/src/com/cloud/api/query/QueryManagerImpl.java 4200799 
>   test/integration/smoke/test_deploy_vm.py 425aeb7 
> 
> Diff: https://reviews.apache.org/r/19022/diff/
> 
> 
> Testing
> -------
> 
> Added integration test, also verified manually.
> 
> 
> Thanks,
> 
> Koushik Das
> 
>


Re: Review Request 19022: List VM enhancement to support querying with multiple VM IDs

Posted by Koushik Das <ko...@citrix.com>.

> On March 13, 2014, 12:19 p.m., Koushik Das wrote:
> > Ship It!

Commit 5779292e93fe52a7fb5ec0abffe1e3f6b9c10121 in cloudstack's branch refs/heads/master from [~koushikd]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=5779292 ]

CLOUDSTACK-6052: List VM enhancement to support querying with multiple VM IDs
New parameter 'ids' added to listVirtualMachine API. The syntax looks like
http://localhost:8096/api?command=listVirtualMachines&listAll=true&ids=eddac053-9b12-4d2e-acb7-233de2e98112,009966fc-4d7b-4f84-8609-254979ba0134
The new parameter will be mutually exclusive with the existing 'id' parameter.


- Koushik


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/19022/#review37045
-----------------------------------------------------------


On March 11, 2014, 6:29 a.m., Koushik Das wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/19022/
> -----------------------------------------------------------
> 
> (Updated March 11, 2014, 6:29 a.m.)
> 
> 
> Review request for cloudstack, daan Hoogland and Min Chen.
> 
> 
> Bugs: CLOUDSTACK-6052
>     https://issues.apache.org/jira/browse/CLOUDSTACK-6052
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> Currently list VM can only be called using a single VM ID. So if there is a need to query a set of VMs using ID then either multiple list VM calls need to be made or all VMs needs to be fetched and then do a client side filtering. Both approaches are sub-optimal - the former results in multiple queries to database and the latter will be an overkill if you need a small subset from a very large number of VMs. 
> 
> The proposal is to have an additional parameter to specify a list of VM IDs for which the data needs to be fetched. Using this the required VMs can be queried in an efficient manner. With the new parameter the syntax would look like 
> http://localhost:8096/api?command=listVirtualMachines&listAll=true&ids=eddac053-9b12-4d2e-acb7-233de2e98112,009966fc-4d7b-4f84-8609-254979ba0134 
> 
> The new 'ids' parameter will be mutually exclusive with the existing 'id' parameter.
> 
> 
> Diffs
> -----
> 
>   api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java 1a564f6 
>   server/src/com/cloud/api/query/QueryManagerImpl.java 4200799 
>   test/integration/smoke/test_deploy_vm.py 425aeb7 
> 
> Diff: https://reviews.apache.org/r/19022/diff/
> 
> 
> Testing
> -------
> 
> Added integration test, also verified manually.
> 
> 
> Thanks,
> 
> Koushik Das
> 
>


Re: Review Request 19022: List VM enhancement to support querying with multiple VM IDs

Posted by Koushik Das <ko...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/19022/#review37045
-----------------------------------------------------------

Ship it!


Ship It!

- Koushik Das


On March 11, 2014, 6:29 a.m., Koushik Das wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/19022/
> -----------------------------------------------------------
> 
> (Updated March 11, 2014, 6:29 a.m.)
> 
> 
> Review request for cloudstack, daan Hoogland and Min Chen.
> 
> 
> Bugs: CLOUDSTACK-6052
>     https://issues.apache.org/jira/browse/CLOUDSTACK-6052
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> Currently list VM can only be called using a single VM ID. So if there is a need to query a set of VMs using ID then either multiple list VM calls need to be made or all VMs needs to be fetched and then do a client side filtering. Both approaches are sub-optimal - the former results in multiple queries to database and the latter will be an overkill if you need a small subset from a very large number of VMs. 
> 
> The proposal is to have an additional parameter to specify a list of VM IDs for which the data needs to be fetched. Using this the required VMs can be queried in an efficient manner. With the new parameter the syntax would look like 
> http://localhost:8096/api?command=listVirtualMachines&listAll=true&ids=eddac053-9b12-4d2e-acb7-233de2e98112,009966fc-4d7b-4f84-8609-254979ba0134 
> 
> The new 'ids' parameter will be mutually exclusive with the existing 'id' parameter.
> 
> 
> Diffs
> -----
> 
>   api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java 1a564f6 
>   server/src/com/cloud/api/query/QueryManagerImpl.java 4200799 
>   test/integration/smoke/test_deploy_vm.py 425aeb7 
> 
> Diff: https://reviews.apache.org/r/19022/diff/
> 
> 
> Testing
> -------
> 
> Added integration test, also verified manually.
> 
> 
> Thanks,
> 
> Koushik Das
> 
>