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 2021/09/20 09:04:30 UTC

[GitHub] [cloudstack] shwstppr commented on a change in pull request #5469: server: add vm boot details for start vm api

shwstppr commented on a change in pull request #5469:
URL: https://github.com/apache/cloudstack/pull/5469#discussion_r711991356



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -3005,15 +3004,30 @@ protected boolean applyUserData(HypervisorType hyperVisorType, UserVm vm, Nic ni
     public UserVm startVirtualMachine(StartVMCmd cmd) throws ExecutionException, ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException, ResourceAllocationException {
         Map<VirtualMachineProfile.Param, Object> additonalParams = null;
         if (cmd.getBootIntoSetup() != null) {
-            if (additonalParams == null) {
-                additonalParams = new HashMap<>();
-            }
+            additonalParams = new HashMap<>();
             if (s_logger.isTraceEnabled()) {
                 s_logger.trace(String.format("Adding %s into the param map", VirtualMachineProfile.Param.BootIntoSetup.getName()));
             }
 
             additonalParams.put(VirtualMachineProfile.Param.BootIntoSetup, cmd.getBootIntoSetup());
         }
+        UserVmDetailVO uefiDetail = userVmDetailsDao.findDetail(cmd.getId(), ApiConstants.BootType.UEFI.toString());
+        if (uefiDetail != null) {
+            if (additonalParams == null) {
+                additonalParams = new HashMap<>();
+            }
+            if (s_logger.isTraceEnabled()) {
+                s_logger.trace(String.format("Adding boot options (%s, %s, %s) into the param map for VM start as UEFI detail(%s=%s) found for the VM",
+                        VirtualMachineProfile.Param.UefiFlag.getName(),
+                        VirtualMachineProfile.Param.BootType.getName(),
+                        VirtualMachineProfile.Param.BootMode.getName(),
+                        uefiDetail.getName(),
+                        uefiDetail.getValue()));
+            }
+            additonalParams.put(VirtualMachineProfile.Param.UefiFlag, "Yes");
+            additonalParams.put(VirtualMachineProfile.Param.BootType, uefiDetail.getName());
+            additonalParams.put(VirtualMachineProfile.Param.BootMode, uefiDetail.getValue());

Review comment:
       Similar to startvm method call during `deployVirtualMachine` https://github.com/apache/cloudstack/blob/main/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java#L4599-L4601




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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org