[GitHub] [cloudstack] pavanaravapalli commented on a change in pull request #3638: UEFI Support on CloudStack
pavanaravapalli commented on a change in pull request #3638: UEFI Support on CloudStack URL: https://github.com/apache/cloudstack/pull/3638#discussion_r395248492 ## File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java ## @@ -2125,11 +2167,44 @@ public LibvirtVMDef createVMFromSpec(final VirtualMachineTO vmTO) { } guest.setGuestArch(_guestCpuArch != null ? _guestCpuArch : vmTO.getArch()); guest.setMachineType(_guestCpuArch != null && _guestCpuArch.equals("aarch64") ? "virt" : "pc"); +guest.setBootType(GuestDef.BootType.BIOS); +if (MapUtils.isNotEmpty(customParams) && customParams.containsKey(GuestDef.BootType.UEFI.toString())) { +guest.setBootType(GuestDef.BootType.UEFI); +guest.setBootMode(GuestDef.BootMode.LEGACY); +if (StringUtils.isNotBlank(customParams.get(GuestDef.BootType.UEFI.toString())) && "secure".equalsIgnoreCase(customParams.get(GuestDef.BootType.UEFI.toString( { +guest.setMachineType("q35"); Review comment: @rhtyd UEFI Secure boot does not work with default libvirt xml changes and "**pc**" as machine type. There are few other mandatory changes to be handled in case of secure boot guest xml, the same have been captured in the design doc. please have a look in the wiki doc shared with this PR description. 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [cloudstack] pavanaravapalli commented on a change in pull request #3638: UEFI Support on CloudStack
pavanaravapalli commented on a change in pull request #3638: UEFI Support on CloudStack URL: https://github.com/apache/cloudstack/pull/3638#discussion_r395248492 ## File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java ## @@ -2125,11 +2167,44 @@ public LibvirtVMDef createVMFromSpec(final VirtualMachineTO vmTO) { } guest.setGuestArch(_guestCpuArch != null ? _guestCpuArch : vmTO.getArch()); guest.setMachineType(_guestCpuArch != null && _guestCpuArch.equals("aarch64") ? "virt" : "pc"); +guest.setBootType(GuestDef.BootType.BIOS); +if (MapUtils.isNotEmpty(customParams) && customParams.containsKey(GuestDef.BootType.UEFI.toString())) { +guest.setBootType(GuestDef.BootType.UEFI); +guest.setBootMode(GuestDef.BootMode.LEGACY); +if (StringUtils.isNotBlank(customParams.get(GuestDef.BootType.UEFI.toString())) && "secure".equalsIgnoreCase(customParams.get(GuestDef.BootType.UEFI.toString( { +guest.setMachineType("q35"); Review comment: @rhtyd UEFI Secure boot does not work with default libvirt xml changes and "**pc**" as machine type. It's confirmed by doing a POC and verified the same. There are few other mandatory changes to be handled in case of secure boot guest xml, the same have been captured in the design doc. please have a look in the wiki doc shared with this PR description. 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [cloudstack] pavanaravapalli commented on a change in pull request #3638: UEFI Support on CloudStack
pavanaravapalli commented on a change in pull request #3638: UEFI Support on CloudStack URL: https://github.com/apache/cloudstack/pull/3638#discussion_r358830755 ## File path: server/src/main/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java ## @@ -112,6 +117,16 @@ VMTemplateVO template = (VMTemplateVO)vmProfile.getTemplate(); Account account = vmProfile.getOwner(); +boolean isVMDeployedWithUefi = false; +UserVmDetailVO userVmDetailVO = _userVmDetailsDao.findDetail(vmProfile.getId(), "UEFI"); +if(userVmDetailVO != null){ +if ("secure".equalsIgnoreCase(userVmDetailVO.getValue()) || "legacy".equalsIgnoreCase(userVmDetailVO.getValue())) { Review comment: changes done as suggested 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [cloudstack] pavanaravapalli commented on a change in pull request #3638: UEFI Support on CloudStack
pavanaravapalli commented on a change in pull request #3638: UEFI Support on CloudStack URL: https://github.com/apache/cloudstack/pull/3638#discussion_r357669111 ## File path: api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java ## @@ -257,12 +263,30 @@ public Long getDomainId() { } } } +if(getBootType() != null){ // export to get +if(getBootType().equalsIgnoreCase("UEFI")) { +customparameterMap.put("UEFI", getBootMode()); +} +} + if (rootdisksize != null && !customparameterMap.containsKey("rootdisksize")) { customparameterMap.put("rootdisksize", rootdisksize.toString()); } return customparameterMap; } +public String getBootType() { +if (bootType != null && !("bios".equalsIgnoreCase(bootType) || "uefi".equalsIgnoreCase(bootType))) { Review comment: Changes done as suggested. 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [cloudstack] pavanaravapalli commented on a change in pull request #3638: UEFI Support on CloudStack
pavanaravapalli commented on a change in pull request #3638: UEFI Support on CloudStack URL: https://github.com/apache/cloudstack/pull/3638#discussion_r357050017 ## File path: engine/orchestration/src/main/java/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java ## @@ -269,4 +270,23 @@ public void disconnectFrom(NetworkEntity netowrk, short nicId) { } +@Override +public void setParamsToEntity(Map map) { +if (this.vmEntityVO != null) { +Map details = this.vmEntityVO.getDetails(); + +if (details == null) { Review comment: Changes done as suggested 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: us...@infra.apache.org With regards, Apache Git Services