You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/02/12 11:23:54 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #3881: Deploy VM add host gpu device available check

DaanHoogland commented on a change in pull request #3881: Deploy VM add host gpu device available check
URL: https://github.com/apache/cloudstack/pull/3881#discussion_r378190661
 
 

 ##########
 File path: server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
 ##########
 @@ -282,7 +283,12 @@ public DeployDestination planDeployment(VirtualMachineProfile vmProfile, Deploym
                 s_logger.debug("The specified host cannot be found");
             } else if (avoids.shouldAvoid(host)) {
                 s_logger.debug("The specified host is in avoid set");
-            } else {
+            } else if ((offeringDetails  = _serviceOfferingDetailsDao.findDetail(offering.getId(), GPU.Keys.vgpuType.toString())) != null) {
+                ServiceOfferingDetailsVO groupName = _serviceOfferingDetailsDao.findDetail(offering.getId(), GPU.Keys.pciDevice.toString());
+                if(!_resourceMgr.isGPUDeviceAvailable(host.getId(), groupName.getValue(), offeringDetails.getValue())){
+                    s_logger.debug("The last host of this VM does not have required GPU devices available");
+                }
 
 Review comment:
   could you please factor this code out into it's own method. This is already a huge bit of code and it somewhat guarantees the testability and isolation of the new bit. 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:
users@infra.apache.org


With regards,
Apache Git Services