[
https://issues.apache.org/jira/browse/CLOUDSTACK-4882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13818874#comment-13818874
]
manasaveloori commented on CLOUDSTACK-4882:
-------------------------------------------
http://10.147.38.152:8096/client/api?command=listCapacity&clusterid=9b6bf7ca-bf25-41c7-a0d4-949c1cd1cc10
<listcapacityresponse
cloud-stack-version="4.2.1-SNAPSHOT"><count>4</count><capacity><type>0</type><zoneid>1f02e2d7-49c0-4635-89a0-62b58582f1ef</zoneid><zonename>zonexen</zonename><podid>5749f302-1c31-42b9-bc26-9802413464a7</podid><podname>podxen</podname><clusterid>9b6bf7ca-bf25-41c7-a0d4-949c1cd1cc10</clusterid><clustername>clusterxen</clustername><capacityused>6308233216</capacityused><capacitytotal>32380314624</capacitytotal><percentused>19.48</percentused></capacity><capacity><type>1</type><zoneid>1f02e2d7-49c0-4635-89a0-62b58582f1ef</zoneid><zonename>zonexen</zonename><podid>5749f302-1c31-42b9-bc26-9802413464a7</podid><podname>podxen</podname><clusterid>9b6bf7ca-bf25-41c7-a0d4-949c1cd1cc10</clusterid><clustername>clusterxen</clustername><capacityused>4000</capacityused><capacitytotal>19152</capacitytotal><percentused>20.89</percentused></capacity>
mysql> select * from op_host_capacity where capacity_type=1;
+----+---------+----------------+--------+------------+---------------+-------------------+----------------+---------------+----------------+---------------------+---------------------+
| id | host_id | data_center_id | pod_id | cluster_id | used_capacity |
reserved_capacity | total_capacity | capacity_type | capacity_state |
update_time | created |
+----+---------+----------------+--------+------------+---------------+-------------------+----------------+---------------+----------------+---------------------+---------------------+
| 2 | 1 | 1 | 1 | 1 | 1000 |
500 | 9576 | 1 | Enabled | 2013-11-11
16:24:01 | 2013-11-11 14:47:45 |
| 9 | 4 | 1 | 1 | 1 | 500 |
2000 | 9576 | 1 | Enabled | 2013-11-11
16:23:58 | 2013-11-11 14:56:19 |
+----+---------+----------------+--------+------------+---------------+-------------------+----------------+---------------+----------------+---------------------+---------------------+
2 rows in set (0.00 sec)
In the API response:
For type1: for example:
capacityused=4000 which is used+reserved
Totalcapacity=19152
so %used= 4000/19152 which is working fine .
But API is not displaying the reserved capacity separately . "used" itself is
used+reserved.
> listClusters/pods/zones and listCapacity(dashboard view) API not accounting
> for reserved in the used capacity percentage.
> -------------------------------------------------------------------------------------------------------------------------
>
> Key: CLOUDSTACK-4882
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-4882
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Affects Versions: 4.2.0
> Reporter: Nitin Mehta
> Assignee: Nitin Mehta
> Fix For: 4.2.1
>
>
> I looked at the code and logs and it seems like there is a bug in the
> listClusters API where we are just showing the used / total percentage
> instead of (used + reserved) / total ratio.
> But the allocator logic is working perfectly fine. As an alternative to
> listClusters api the admin can use listCapacity api with clusterid and that
> is working fine right now.
--
This message was sent by Atlassian JIRA
(v6.1#6144)