GabrielBrascher commented on a change in pull request #3600:
URL: https://github.com/apache/cloudstack/pull/3600#discussion_r521316685



##########
File path: 
server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
##########
@@ -574,6 +580,86 @@ private boolean 
getDisplayStorageFromVmProfile(VirtualMachineProfile vmProfile)
         return vmProfile == null || vmProfile.getTemplate() == null || 
!vmProfile.getTemplate().isDeployAsIs();
     }
 
+        /**
+         * Adds disabled resources (Data centers, Pods, Clusters, and hosts) 
to exclude list (avoid) in case of disabled state.
+         */
+        public void avoidDisabledResources(VirtualMachineProfile vmProfile, 
DataCenter dc, ExcludeList avoids) {
+            if (vmProfile.getType().isUsedBySystem() && 
isRouterDeployableInDisabledResources()) {
+                return;
+            }
+
+            VMInstanceVO vm = _vmInstanceDao.findById(vmProfile.getId());
+            AccountVO owner = accountDao.findById(vm.getAccountId());
+            boolean isOwnerRoleIdAdmin = false;
+
+            if (owner != null && owner.getRoleId() != null && 
owner.getRoleId() == ADMIN_ACCOUNT_ROLE_ID) {

Review comment:
       @DaanHoogland I fixed the issue raised on tests regarding VMs deployed 
on a project.
   
   Manual tests are looking good now; thanks :-)




----------------------------------------------------------------
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]


Reply via email to