Test case ID

Test case description

Steps

Expected Result

Priority

Status

Comments

1.

List top capacity usage with respect to Zone/POD/Cluster

1. To list top consumption use  listCapacity API
2. Add flag "sortBy" and set it to "usage"
3. Give pagesize value for example 10
4. URL should look as follows :

[http://10.102.125.220:8096/client/api?command=listCapacity&fetchlatest&sortby=Usage&page=0&pagesize=10
]
[http://10.102.125.220:8096/client/api?command=listCapacity&fetchlatest&sortby=Usage&zoneid=1&page=0&pagesize=10
]
[http://10.102.125.220:8096/client/api?command=listCapacity&fetchlatest&sortby=Usage&podid=1&page=0&pagesize=10
]
http://10.102.125.220:8096/client/api?command=listCapacity&fetchlatest&sortby=Usage&clusterid=1&page=0&pagesize=10

Top 10 Capacites with respect to consumption are listed with decending order

All top consumed Zone level Capacites should be listed for specific Zone

All top consumed Pod level Capacites should be listed for specific Pod

All top consumed Pod level Capacites should be listed for specific cluster

P1

fail

https://issues.apache.org/jira/browse/CLOUDSTACK-207

2.

List top Capacities usage after Disabling Zone

1. Add Zone
2. Disable the Zone
3. Try listing top capacities usage using following API

[http://10.102.125.220:8096/client/api?command=listCapacity&fetchlatest&sortby=Usage&zoneid=1
]
4. Check the op_host_capacity table in cloud DB

API response should not contain any Capacity with respect to Zone

UI should not show any Capacity with respect of Zone

Capacity_State should be set to "Disabled" in the DB for Zone capacities

P1

pass

 

3.

List top consumed capacities by type

1. While listing top Capacities add parameter "type" as follows

[http://10.102.125.220:8096/client/api?command=listCapacity&fetchlatest&sortby=Usage&type=0
]
2. Try for all types 0-9.

Top capacities only of same type are listed in response

P1

pass

 

4.

Compare query output of query for Listing top capacities grouped by Zones with ListCapacity(using sortby=usage paramerter) response

1. To check Zone level capacities are shown correctly or not. Fire following SQL query:
 SELECT (sum(capacity.used_capacity) + sum(capacity.reserved_capacity)), (case capacity_type when 1 then (sum(total_capacity) * (select value from `cloud`.`configuration` where name like 'cpu.overprovisioning.factor')) else sum(total_capacity) end), ((sum(capacity.used_capacity) + sum(capacity.reserved_capacity)) / (case capacity_type when 1 then (sum(total_capacity) * (select value from `cloud`.`configuration` where name like 'cpu.overprovisioning.factor')) else sum(total_capacity) end)) percent,  capacity.capacity_type, capacity.data_center_id FROM `cloud`.`op_host_capacity` capacity WHERE total_capacity > 0 AND data_center_id is not null AND capacity_state='Enabled' GROUP BY data_center_id, capacity_type order by percent desc limit 0,10.

2. check  listCapacity API response

[http://10.102.125.220:8096/client/api?command=listCapacity&fetchlatest&sortby=Usage&zoneid=1&page=0&pagesize=10
]
3. Compared the values returned in step1 and step 2.

SQL query Response should show all the Zone level allocated capacities and there usage percentage

ListCapacity response should be returned

Zone level Capacities returned from step1 and step2 should be matched

P1

pass

 

5.

Compare query output of query for Listing top capacities grouped by POD with ListCapacity(using sortby=usage paramerter) response

1. To check POD level capacities are shown correctly or not. Fire following SQL query:
  SELECT (sum(capacity.used_capacity) + sum(capacity.reserved_capacity)), (case capacity_type when 1 then (sum(total_capacity) * (select value from `cloud`.`configuration` where name like 'cpu.overprovisioning.factor')) else sum(total_capacity) end), ((sum(capacity.used_capacity) + sum(capacity.reserved_capacity)) / (case capacity_type when 1 then (sum(total_capacity) * (select value from `cloud`.`configuration` where name like 'cpu.overprovisioning.factor')) else sum(total_capacity) end)) percent, capacity.capacity_type, capacity.data_center_id, pod_id FROM `cloud`.`op_host_capacity` capacity WHERE  total_capacity > 0 AND pod_id is not null AND capacity_state='Enabled' GROUP BY pod_id, capacity_type order by percent desc limit 0,10;

2. check  listCapacity API response

[http://10.102.125.220:8096/client/api?command=listCapacity&fetchlatest&sortby=Usage&zoneid=1&page=0&pagesize=10
]
3. Compared the values returned in step1 and step 2

SQL query Response should show all the POD level allocated capacities and there usage percentage

ListCapacity response should be returned

POD level Capacities returned from step1 and step2 should be matched

P1

pass

 

6.

Compare query output of query for Listing top capacities grouped by Cluster with ListCapacity(using sortby=usage paramerter) response

1. To check Cluster level capacities are shown correctly or not. Fire following SQL query:
 SELECT (sum(capacity.used_capacity) + sum(capacity.reserved_capacity)), (case capacity_type when 1 then (sum(total_capacity) * (select value from `cloud`.`configuration` where name like 'cpu.overprovisioning.factor')) else sum(total_capacity) end), ((sum(capacity.used_capacity) + sum(capacity.reserved_capacity)) / (case capacity_type when 1 then (sum(total_capacity) * (select value from `cloud`.`configuration` where name like 'cpu.overprovisioning.factor')) else sum(total_capacity) end)) percent, capacity.capacity_type, capacity.data_center_id, pod_id, cluster_id  FROM `cloud`.`op_host_capacity` capacity  WHERE  total_capacity > 0 AND cluster_id is not null AND capacity_state='Enabled' GROUP BY cluster_id, capacity_type order by percent desc limit 0,10;

2. check  listCapacity API response

[http://10.102.125.220:8096/client/api?command=listCapacity&fetchlatest&sortby=Usage&zoneid=1&page=0&pagesize=10
]
3. Compared the values returned in step1 and step 2

SQL query Response should show all the Cluster level allocated capacities and there usage percentage

ListCapacity response should be returned

 Cluster level Capacities returned from step1 and step2 should be matched

P1

pass

 

7.

listCapacity response after Change in service offering

1. Change service offering to new service offering (with delta of 500 Mhz CPU, 524 MB RAM, and 20 GB HDD)
2. check  listCapacity API response

response should show increase in allocated resources by same amount.

P1

pass

 

8.

Create an user account and launch VMs for the user account

1. Create an User account.
2. check  listCapacity API response

reponse should show increase in allocated resources.
This increase in resources should also include router VM capacity too.

P1

pass

 

9.

Skip-Counting Hours

1. From Global Config, set Skip Config hours to 60 Minutes.
2. Restart the Management server.
3. Stop the VM
4. Check in op_host_capacity table whether the capacities are still reserved if VM is stopped less than 1 hour
5. Check in op_host_capacity table whether the capacities are released after 1 hour for stopped VM

The capacities related to stopped VM should be in reserve state under reserved_capacity column

The Capacities related to Stopped VM should be released

P1

pass

 

10.

Restart Management Server

1.  Restart the Management Server
2. Call listCapacity API

All Capacities listed should be exactly same as capacities before restart

P1

pass

 

11.

Launch a VM

1. Call listCapacity API and set fetchlatest flag to true

It should immediately reflect increase in Capacity

P1

pass

 

12.

Stop VM

1. Stop Running VM
2. Call listCapacity API and set fetchlatest flag to true

It shouldn’t show any decrease in capacity because of skip counting hours. Also Check in op_host_capacity table that the capacity with respect to stopped VM falles under reserved_Capacity column

P1

pass

 

13.

Destroy VM

1. Destroy running VM.
2. Call listCapacity API and set fetchlatest flag to true

It should immediately reflect that resources are being released.

P1

pass

 

14.

Restore VM

1. Restore a VM
2. Call listCapacity API and set fetchlatest flag to true

It should immediately reflect increase in Capacity

P1

pass

 

15.

ListClusters with showcapacities flag

1. Call listClusters with showcapacities flag is "true"

[http://10.102.125.220:8096/client/api?command=listClusters&showcapacities=true
]

1. All cluster level capacities should be listed.

P1

pass

 

16.

ListPods with showcapacities flag

1. Call listPods with showcapacities flag is "true"

1. All POD level capacities should be listed.

P1

pass

 

17.

ListZones with showcapacities flag

1. Call listZones with showcapacities flag is "true"

1. All Zone level capacities should be listed.

P1

pass

 

18.

Configure Capacity checker thread interval and verify its run

1. Go to Global configuration.
2. Modify setting "capacity.check.period"
3. Restart Management Server

After restarting Management server check the Management Server logs and verify
 that the capacity checker thread runs after configured "capacity.check.period" interval

P2

pass

 

19.

Check list Capacity response on expunging VM

1. Expunge a VM
2. Call listCapacity API and set fetchlatest flag to true as follows.

All the capacities with respect to expunged VM are released

P2

pass

 

20.

Check listStorage response after adding primary storage

1. Add Primary storage.
2. call listStorage

[http://10.102.125.220:8096/client/api?command=listStoragePools&showcapacities=true
]

listStorage response should show all the details with respect to
primary storage like IP address of storage server, path,  diskSize, disksizeAllocated,
DiskSizeUsed and status

P1

pass