sureshanaparti commented on a change in pull request #4428:
URL: https://github.com/apache/cloudstack/pull/4428#discussion_r523973486
##########
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());
+ }
+ }
} else if (scope.getScopeType() == ScopeType.ZONE) {
sbuilder.append(" and h.data_center_id = ");
sbuilder.append(scope.getScopeId());
+ DedicatedResourceVO dedicatedHost =
dedicatedResourceDao.findByZoneId(scope.getScopeId());
+ if (dedicatedHost != null){
+ List<HostVO> zoneHosts =
hostDao.findByClusterId(scope.getScopeId());
Review comment:
@Spaceman1984 scope id in this case is zone id, and the hosts are found
using cluster id method, please check.
----------------------------------------------------------------
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]