[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-4746?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

manasaveloori closed CLOUDSTACK-4746.
-------------------------------------


steps:

1. Deployed CS with 1 cluster having 2 hosts of same configuration.
2. Deployed some VMs using HA enabled service offering.
3. Set the GS cluster.cpu.allocated.capacity.disablethreshold=0.30 and 
capacity.skipcounting.hours=3600sec and recreate.systemvm.enabled=true

http://10.147.38.243:8096/client/api?command=listCapacity&clusterid=33022899-f0db-4647-8634-7b0eccb91097
 

Shows cluster usedcapacity as "28.71"
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 |          4500 |         
        0 |           9580 |             1 | Enabled        | 2013-11-14 
11:43:25 | 2013-11-13 16:48:45 |
|  9 |       4 |              1 |      1 |          1 |             0 |         
     5500 |           9576 |             1 | Enabled        | 2013-11-14 
11:43:27 | 2013-11-13 16:58:23 |
+----+---------+----------------+--------+------------+---------------+-------------------+----------------+---------------+----------------+---------------------+---------------------+

4. Now trigger HA.
All the VMs got migrated.
 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 |          5000 |         
        0 |           9580 |             1 | Enabled        | 2013-11-14 
11:44:16 | 2013-11-13 16:48:45 |
|  9 |       4 |              1 |      1 |          1 |             0 |         
      500 |           9576 |             1 | Enabled        | 2013-11-14 
11:43:48 | 2013-11-13 16:58:23 |
+----+---------+----------------+--------+------------+---------------+-------------------+----------------+---------------+----------------+---------------------+---------------------+
2 rows in set (0.00 sec).

5.set capacity.skipcounting.hours=30sec.
6.Now triggered HA.All the VMs got migrated and 
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             |
+----+---------+----------------+--------+------------+---------------+-------------------+----------------+---------------+----------------+---------------------+---------------------+
|  9 |       4 |              1 |      1 |          1 |          5500 |         
        0 |           9576 |             1 | Enabled        | 2013-11-14 
11:54:23 | 2013-11-13 16:58:23 |
| 11 |       1 |              1 |      1 |          1 |             0 |         
        0 |           9580 |             1 | Enabled        | 2013-11-14 
11:55:39 | 2013-11-14 11:55:39 |
+----+---------+----------------+--------+------------+---------------+-------------------+----------------+---------------+----------------+---------------------+---------------------+

Working fine.Closing the issue.

> Allocation capacity of a cluster during HA
> ------------------------------------------
>
>                 Key: CLOUDSTACK-4746
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-4746
>             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
>            Priority: Critical
>             Fix For: 4.2.1
>
>
> When the host goes down. Cloudstack will stop the VM's for which HA is not 
> enabled. Once cloudstack marks these VM's as stopped then the capacity of 
> these VM's is moved into the reserved capacity.
> If the VM's are HA enabled then cloudstack will stop and start the VM's on 
> another host. During this time the capacity of the VM's will be moved to 
> reserved capacity once the VM's are stopped, But when the Vm's are being 
> started cloudstack will try to calculate what will be total allocated 
> capacity if the VM is started again ( even though the CPU for the VM is 
> already reserved). This is a bug in cloudstack where the CPU required for the 
> VM is considered twice when calculating the allocated capacity.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to