mirror of https://github.com/apache/cloudstack.git
Changes: - When a host connects, we check if it has a CPU and RAM entry in capacity table. If the entry is found, the values are updated if possible. If the entry is not found a new one is inserted. - The searchCriteria used to check if CPU entry is present was wrong. We were passing in a criteria which did not specify capacityType. So for hostId >= 200, the serach would return capacity entries of storage pools also since poolIDs start from 200 onwards. - Since an entry was found (although the wrong one), we tried to update it. But update does not happen since the capacity ranges dont match. And a new insert for CPU also does not happen since an entry is found. - So as a result CPU entries are never inserted in the table for hostIds >=200 - As a fix, corrected the search criteria. - During VM deployment, when the entry is not found, we get a NPE. Added a null check to avoid that. |
||
|---|---|---|
| .. | ||
| dao | ||
| CapacityManager.java | ||
| CapacityManagerImpl.java | ||