DaanHoogland commented on a change in pull request #3638: UEFI Support on 
CloudStack
URL: https://github.com/apache/cloudstack/pull/3638#discussion_r391691862
 
 

 ##########
 File path: 
server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
 ##########
 @@ -271,13 +273,22 @@ public DeployDestination 
planDeployment(VirtualMachineProfile vmProfile, Deploym
         }
 
         String haVmTag = 
(String)vmProfile.getParameter(VirtualMachineProfile.Param.HaTag);
+        String uefiFlag = 
(String)vmProfile.getParameter(VirtualMachineProfile.Param.UefiFlag);
 
         if (plan.getHostId() != null && haVmTag == null) {
             Long hostIdSpecified = plan.getHostId();
             if (s_logger.isDebugEnabled()) {
                 s_logger.debug("DeploymentPlan has host_id specified, choosing 
this host and making no checks on this host: " + hostIdSpecified);
             }
             HostVO host = _hostDao.findById(hostIdSpecified);
+            if (host != null && StringUtils.isNotBlank(uefiFlag) && 
"yes".equalsIgnoreCase(uefiFlag)) {
+                _hostDao.loadDetails(host);
+                if (MapUtils.isNotEmpty(host.getDetails()) && 
host.getDetails().containsKey(Host.HOST_UEFI_ENABLE) && 
"false".equalsIgnoreCase(host.getDetails().get(Host.HOST_UEFI_ENABLE))) {
+                    s_logger.debug("Cannot deploy to specified host as host 
does n't support uefi vm deployment, returning.");
+                    return null;
+
+                }
+            }
 
 Review comment:
   please extract, see above

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

Reply via email to