You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ade305b
Browse filesBrowse the repository at this point in the historyBrowse files
CLOUDSTACK-7909: Change the capacity_state in op_host_Capacity table only on explicit enabling/disabling of the host and remove the logic for changing it when cluster/pod/zone is enabled/disabled. Also add the logic in capacity checker thread so that previous changes finally get consistent with this new model and also its good to have it for sanity reasons.
@@ -679,6 +679,12 @@ public void updateCapacityForHost(final Host host) {
679
679
cpuCap.setTotalCapacity(hostTotalCpu);
680
680
681
681
}
682
+
// Set the capacity state as per the host allocation state.
683
+
if(capacityState != cpuCap.getCapacityState()){
684
+
s_logger.debug("Calibrate cpu capacity state for host: " + host.getId() + " old capacity state:" + cpuCap.getTotalCapacity() + " new capacity state:" + hostTotalCpu);
685
+
cpuCap.setCapacityState(capacityState);
686
+
}
687
+
memCap.setCapacityState(capacityState);
682
688
683
689
if (cpuCap.getUsedCapacity() == usedCpu && cpuCap.getReservedCapacity() == reservedCpu) {
684
690
s_logger.debug("No need to calibrate cpu capacity, host:" + host.getId() + " usedCpu: " + cpuCap.getUsedCapacity() + " reservedCpu: " +
@@ -701,6 +707,11 @@ public void updateCapacityForHost(final Host host) {
701
707
memCap.setTotalCapacity(host.getTotalMemory());
702
708
703
709
}
710
+
// Set the capacity state as per the host allocation state.
711
+
if(capacityState != memCap.getCapacityState()){
712
+
s_logger.debug("Calibrate memory capacity state for host: " + host.getId() + " old capacity state:" + cpuCap.getTotalCapacity() + " new capacity state:" + hostTotalCpu);
713
+
memCap.setCapacityState(capacityState);
714
+
}
704
715
705
716
if (memCap.getUsedCapacity() == usedMemory && memCap.getReservedCapacity() == reservedMemory) {
706
717
s_logger.debug("No need to calibrate memory capacity, host:" + host.getId() + " usedMem: " + memCap.getUsedCapacity() + " reservedMem: " +
@@ -740,14 +751,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
0 commit comments