You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ha...@apache.org on 2021/02/03 05:37:00 UTC
[cloudstack] 05/06: Filter service offerings based on dynamic
scalable flag while listing offerings for scaling VM
This is an automated email from the ASF dual-hosted git repository.
harikrishna pushed a commit to branch VMDynamicScalabilityGranularity
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit 60ddbadfcf87799f9149836807a34a676f3895d1
Author: Harikrishna Patnala <ha...@gmail.com>
AuthorDate: Wed Feb 3 10:47:13 2021 +0530
Filter service offerings based on dynamic scalable flag while listing offerings for scaling VM
---
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
index cf01b8d..0c3486a 100644
--- a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
@@ -2962,11 +2962,12 @@ public class QueryManagerImpl extends MutualExclusiveIdsManagerBase implements Q
// 1. Only return offerings with the same storage type
sc.addAnd("useLocalStorage", SearchCriteria.Op.EQ, currentVmOffering.isUseLocalStorage());
- // 2.In case vm is running return only offerings greater than equal to current offering compute.
+ // 2.In case vm is running return only offerings greater than equal to current offering compute and offering's dynamic scalability should match
if (vmInstance.getState() == VirtualMachine.State.Running) {
sc.addAnd("cpu", Op.GTEQ, currentVmOffering.getCpu());
sc.addAnd("speed", Op.GTEQ, currentVmOffering.getSpeed());
sc.addAnd("ramSize", Op.GTEQ, currentVmOffering.getRamSize());
+ sc.addAnd("dynamicallyScalable", Op.EQ, currentVmOffering.isDynamicallyScalable());
}
}