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:
[email protected]
With regards,
Apache Git Services