sureshanaparti commented on a change in pull request #4428:
URL: https://github.com/apache/cloudstack/pull/4428#discussion_r523983948
##########
File path:
engine/storage/src/main/java/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
##########
@@ -115,22 +123,46 @@ protected EndPoint findEndPointInScope(Scope scope,
String sqlBase, Long poolId)
StringBuilder sbuilder = new StringBuilder();
sbuilder.append(sqlBase);
+ List<Long> dedicatedHosts = new ArrayList<Long>();
+
if (scope != null) {
if (scope.getScopeType() == ScopeType.HOST) {
sbuilder.append(" and h.id = ");
sbuilder.append(scope.getScopeId());
} else if (scope.getScopeType() == ScopeType.CLUSTER) {
sbuilder.append(" and h.cluster_id = ");
sbuilder.append(scope.getScopeId());
+ DedicatedResourceVO dedicatedHost =
dedicatedResourceDao.findByClusterId(scope.getScopeId());
+ if (dedicatedHost != null){
+ List<HostVO> clusterHosts =
hostDao.findByClusterId(scope.getScopeId());
+ for (HostVO hostVO: clusterHosts){
+ dedicatedHosts.add(hostVO.getId());
+ }
+ }
Review comment:
@Spaceman1984 what if cluster is not dedicated, but some hosts in that
cluster are dedicated?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]