From fbf577a1ac0fadaa596493152e36d372a50cd17d Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Tue, 19 May 2020 15:37:25 +0530 Subject: [PATCH 1/2] Revert "NPE fix for System VM's start Command (#3985)" This reverts commit 08699aa69076b6479bf9544f1375917e51be6a36. --- .../com/cloud/hypervisor/guru/VMwareGuru.java | 2 +- .../vmware/resource/VmwareResource.java | 4 ++-- .../cloud/hypervisor/HypervisorGuruBase.java | 17 +++-------------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java index 59b27bd2410e..4e8acad251b1 100644 --- a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java +++ b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java @@ -294,7 +294,7 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) { } } - details.put(VmDetailConstants.BOOT_MODE, to.getBootMode()); + details.put(VmDetailConstants.BOOT_MODE, to.getBootType()); String diskDeviceType = details.get(VmDetailConstants.ROOT_DISK_CONTROLLER); if (userVm) { if (diskDeviceType == null) { diff --git a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java index fab6f0ad938e..566f11db4ea9 100644 --- a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -1723,7 +1723,7 @@ protected StartAnswer execute(StartCommand cmd) { String dataDiskController = vmSpec.getDetails().get(VmDetailConstants.DATA_DISK_CONTROLLER); String rootDiskController = vmSpec.getDetails().get(VmDetailConstants.ROOT_DISK_CONTROLLER); DiskTO rootDiskTO = null; - String bootMode = "bios"; + String bootMode = ApiConstants.BootType.BIOS.toString(); if (vmSpec.getDetails().containsKey(VmDetailConstants.BOOT_MODE)) { bootMode = vmSpec.getDetails().get(VmDetailConstants.BOOT_MODE); } @@ -2285,7 +2285,7 @@ protected StartAnswer execute(StartCommand cmd) { } } - if (StringUtils.isNotBlank(bootMode) && !bootMode.equalsIgnoreCase("bios")) { + if (!bootMode.equalsIgnoreCase(ApiConstants.BootType.BIOS.toString())) { vmConfigSpec.setFirmware("efi"); if (vmSpec.getDetails().containsKey(ApiConstants.BootType.UEFI.toString()) && "secure".equalsIgnoreCase(vmSpec.getDetails().get(ApiConstants.BootType.UEFI.toString()))) { VirtualMachineBootOptions bootOptions = new VirtualMachineBootOptions(); diff --git a/server/src/main/java/com/cloud/hypervisor/HypervisorGuruBase.java b/server/src/main/java/com/cloud/hypervisor/HypervisorGuruBase.java index 2ae35fc08ad7..0c3263a0a8f4 100644 --- a/server/src/main/java/com/cloud/hypervisor/HypervisorGuruBase.java +++ b/server/src/main/java/com/cloud/hypervisor/HypervisorGuruBase.java @@ -26,7 +26,6 @@ import org.apache.cloudstack.backup.Backup; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; import org.apache.log4j.Logger; import com.cloud.agent.api.Command; @@ -173,19 +172,9 @@ protected VirtualMachineTO toVirtualMachineTO(VirtualMachineProfile vmProfile) { offering.getRamSize() * 1024l * 1024l, null, null, vm.isHaEnabled(), vm.limitCpuUse(), vm.getVncPassword()); to.setBootArgs(vmProfile.getBootArgs()); - Map map = vmProfile.getParameters(); - if (MapUtils.isNotEmpty(map)) { - if (map.containsKey(VirtualMachineProfile.Param.BootMode)) { - if (StringUtils.isNotBlank((String) map.get(VirtualMachineProfile.Param.BootMode))) { - to.setBootMode((String) map.get(VirtualMachineProfile.Param.BootMode)); - } - } - - if (map.containsKey(VirtualMachineProfile.Param.BootType)) { - if (StringUtils.isNotBlank((String) map.get(VirtualMachineProfile.Param.BootType))) { - to.setBootType((String) map.get(VirtualMachineProfile.Param.BootType)); - } - } + String bootType = (String)vmProfile.getParameter(new VirtualMachineProfile.Param("BootType")); + if (StringUtils.isNotBlank(bootType)) { + to.setBootType(bootType); } List nicProfiles = vmProfile.getNics(); From 797eb8fb90b22e4626c90175ac26872a367c16e6 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Tue, 19 May 2020 15:38:52 +0530 Subject: [PATCH 2/2] Revert "UEFI Implementation: Enabled UEFI Support for Guest VM's on Hypervisor KVM,VMware. enabled boot modes [Legacy,Secure] support for UEFI boot with known caveats. (#3638)" This reverts commit d4b537efa7ed27ef88b735a22493808b61529186. Signed-off-by: Rohit Yadav --- .../cloud/agent/api/to/VirtualMachineTO.java | 13 -- api/src/main/java/com/cloud/host/Host.java | 1 - .../com/cloud/vm/VirtualMachineProfile.java | 3 - .../java/com/cloud/vm/VmDetailConstants.java | 1 - .../apache/cloudstack/api/ApiConstants.java | 21 --- .../api/command/user/vm/DeployVMCmd.java | 48 ------- .../cloudstack/api/response/HostResponse.java | 16 --- .../api/response/UserVmResponse.java | 17 --- .../entity/api/VirtualMachineEntity.java | 6 - .../cloud/vm/VirtualMachineManagerImpl.java | 4 - .../cloud/entity/api/VMEntityManagerImpl.java | 10 -- .../entity/api/VirtualMachineEntityImpl.java | 20 --- .../main/java/com/cloud/host/dao/HostDao.java | 2 - .../java/com/cloud/host/dao/HostDaoImpl.java | 34 ----- .../implicitplanner/ImplicitPlannerTest.java | 5 - .../resource/LibvirtComputingResource.java | 113 +-------------- .../hypervisor/kvm/resource/LibvirtVMDef.java | 129 +----------------- .../com/cloud/hypervisor/guru/VMwareGuru.java | 1 - .../vmware/VmwareServerDiscoverer.java | 5 - .../vmware/resource/VmwareResource.java | 19 --- .../allocator/impl/FirstFitAllocator.java | 28 ---- .../api/query/dao/UserVmJoinDaoImpl.java | 9 -- .../deploy/DeploymentPlanningManagerImpl.java | 11 -- .../com/cloud/deploy/FirstFitPlanner.java | 29 +--- .../cloud/hypervisor/HypervisorGuruBase.java | 10 +- .../discoverer/LibvirtServerDiscoverer.java | 7 - .../cloud/server/ManagementServerImpl.java | 14 -- .../java/com/cloud/vm/UserVmManagerImpl.java | 16 +-- .../vm/DeploymentPlanningManagerImplTest.java | 7 - .../com/cloud/vm/FirstFitPlannerTest.java | 6 - ui/index.html | 25 ---- ui/l10n/en.js | 3 - ui/scripts/instanceWizard.js | 12 -- ui/scripts/instances.js | 6 - ui/scripts/system.js | 4 - ui/scripts/ui-custom/instanceWizard.js | 44 ------ .../cloud/hypervisor/vmware/mo/HostMO.java | 13 -- .../hypervisor/vmware/util/VmwareHelper.java | 1 - 38 files changed, 13 insertions(+), 700 deletions(-) diff --git a/api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java b/api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java index 40f30df1895b..d25ffe3aa30e 100644 --- a/api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java +++ b/api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java @@ -63,8 +63,6 @@ public class VirtualMachineTO { String vncAddr; Map params; String uuid; - String bootType; - String bootMode; DiskTO[] disks; NicTO[] nics; @@ -382,15 +380,4 @@ public Pair> getOvfProperties() { public void setOvfProperties(Pair> ovfProperties) { this.ovfProperties = ovfProperties; } - public String getBootType() { - return bootType; - } - - public void setBootType(String bootType) { - this.bootType = bootType; - } - - public String getBootMode() { return bootMode; } - - public void setBootMode(String bootMode) { this.bootMode = bootMode; } } diff --git a/api/src/main/java/com/cloud/host/Host.java b/api/src/main/java/com/cloud/host/Host.java index e5a3889ff18c..1ecd48d74ce9 100644 --- a/api/src/main/java/com/cloud/host/Host.java +++ b/api/src/main/java/com/cloud/host/Host.java @@ -52,7 +52,6 @@ public static String[] toStrings(Host.Type... types) { return strs; } } - public static final String HOST_UEFI_ENABLE = "host.uefi.enable"; /** * @return name of the machine. diff --git a/api/src/main/java/com/cloud/vm/VirtualMachineProfile.java b/api/src/main/java/com/cloud/vm/VirtualMachineProfile.java index 1abc76440a2d..977e27eb14f2 100644 --- a/api/src/main/java/com/cloud/vm/VirtualMachineProfile.java +++ b/api/src/main/java/com/cloud/vm/VirtualMachineProfile.java @@ -60,9 +60,6 @@ public static class Param { public static final Param PxeSeverType = new Param("PxeSeverType"); public static final Param HaTag = new Param("HaTag"); public static final Param HaOperation = new Param("HaOperation"); - public static final Param UefiFlag = new Param("UefiFlag"); - public static final Param BootMode = new Param("BootMode"); - public static final Param BootType = new Param("BootType"); private String name; diff --git a/api/src/main/java/com/cloud/vm/VmDetailConstants.java b/api/src/main/java/com/cloud/vm/VmDetailConstants.java index 3812aa211445..7c40a7ba421c 100644 --- a/api/src/main/java/com/cloud/vm/VmDetailConstants.java +++ b/api/src/main/java/com/cloud/vm/VmDetailConstants.java @@ -20,7 +20,6 @@ public interface VmDetailConstants { String KEYBOARD = "keyboard"; String CPU_CORE_PER_SOCKET = "cpu.corespersocket"; String ROOT_DISK_SIZE = "rootdisksize"; - String BOOT_MODE = "boot.mode"; // VMware specific String NIC_ADAPTER = "nicAdapter"; diff --git a/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java b/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java index 2a201dba196a..048236442400 100644 --- a/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java @@ -804,27 +804,6 @@ public class ApiConstants { public static final String NODE_ROOT_DISK_SIZE = "noderootdisksize"; public static final String SUPPORTS_HA = "supportsha"; - public static final String BOOT_TYPE ="boottype"; - public static final String BOOT_MODE ="bootmode"; - - public enum BootType { - UEFI, BIOS; - - @Override - public String toString() { - return this.name(); - } - } - - public enum BootMode { - LEGACY, SECURE; - - @Override - public String toString() { - return this.name(); - } - } - public enum HostDetails { all, capacity, events, stats, min; } diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java index db315cca92e1..60b9f312a8ef 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java @@ -17,7 +17,6 @@ package org.apache.cloudstack.api.command.user.vm; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; @@ -27,8 +26,6 @@ import javax.annotation.Nonnull; -import com.cloud.utils.StringUtils; - import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.affinity.AffinityGroupResponse; import org.apache.cloudstack.api.ACL; @@ -113,12 +110,6 @@ public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd implements SecurityG @Parameter(name = ApiConstants.NETWORK_IDS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = NetworkResponse.class, description = "list of network ids used by virtual machine. Can't be specified with ipToNetworkList parameter") private List networkIds; - @Parameter(name = ApiConstants.BOOT_TYPE, type = CommandType.STRING, required = false, description = "Guest VM Boot option either custom[UEFI] or default boot [BIOS]") - private String bootType; - - @Parameter(name = ApiConstants.BOOT_MODE, type = CommandType.STRING, required = false, description = "Boot Mode [Legacy] or [Secure] Applicable when Boot Type Selected is UEFI, otherwise Legacy By default for BIOS") - private String bootMode; - //DataDisk information @ACL @Parameter(name = ApiConstants.DISK_OFFERING_ID, type = CommandType.UUID, entityType = DiskOfferingResponse.class, description = "the ID of the disk offering for the virtual machine. If the template is of ISO format," @@ -253,22 +244,6 @@ public Long getDomainId() { return domainId; } - private ApiConstants.BootType getBootType() { - - if (StringUtils.isNotBlank(bootType)) { - try { - String type = bootType.trim().toUpperCase(); - return ApiConstants.BootType.valueOf(type); - } catch (IllegalArgumentException e) { - String errMesg = "Invalid bootType " + bootType + "Specified for vm " + getName() - + " Valid values are: " + Arrays.toString(ApiConstants.BootType.values()); - s_logger.warn(errMesg); - throw new InvalidParameterValueException(errMesg); - } - } - return null; - } - public Map getDetails() { Map customparameterMap = new HashMap(); if (details != null && details.size() != 0) { @@ -281,35 +256,12 @@ public Map getDetails() { } } } - if(getBootType() != null){ // export to get - if(getBootType() == ApiConstants.BootType.UEFI) { - customparameterMap.put(getBootType().toString(), getBootMode().toString()); - } - } - if (rootdisksize != null && !customparameterMap.containsKey("rootdisksize")) { customparameterMap.put("rootdisksize", rootdisksize.toString()); } return customparameterMap; } - - public ApiConstants.BootMode getBootMode() { - if (StringUtils.isNotBlank(bootMode)) { - try { - String mode = bootMode.trim().toUpperCase(); - return ApiConstants.BootMode.valueOf(mode); - } catch (IllegalArgumentException e) { - String errMesg = "Invalid bootMode " + bootMode + "Specified for vm " + getName() - + " Valid values are: "+ Arrays.toString(ApiConstants.BootMode.values()); - s_logger.warn(errMesg); - throw new InvalidParameterValueException(errMesg); - } - } - return null; - } - - public Map getVmOVFProperties() { Map map = new HashMap<>(); if (MapUtils.isNotEmpty(vmOvfProperties)) { diff --git a/api/src/main/java/org/apache/cloudstack/api/response/HostResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/HostResponse.java index 7b47f8a28caa..cd70af1773a7 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/HostResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/HostResponse.java @@ -244,10 +244,6 @@ public class HostResponse extends BaseResponse { @Param(description = "the admin that annotated this host", since = "4.11") private String username; - @SerializedName("ueficapability") - @Param(description = "true if the host has capability to support UEFI boot") - private Boolean uefiCapabilty; - @Override public String getObjectId() { return this.getId(); @@ -503,14 +499,6 @@ public void setDetails(Map details) { detailsCopy.remove("username"); detailsCopy.remove("password"); - if(detailsCopy.containsKey(Host.HOST_UEFI_ENABLE)) { - this.setUefiCapabilty(Boolean.parseBoolean((String) detailsCopy.get(Host.HOST_UEFI_ENABLE))); - detailsCopy.remove(Host.HOST_UEFI_ENABLE); - } else { - this.setUefiCapabilty(new Boolean(false)); // in case of existing host which is not scanned for UEFI capability - } - - this.details = detailsCopy; } @@ -680,8 +668,4 @@ public String getHypervisorVersion() { public Boolean getHaHost() { return haHost; } - - public void setUefiCapabilty(Boolean hostCapability) { - this.uefiCapabilty = hostCapability; - } } diff --git a/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java index b8b0189602bd..ca3ca872943d 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java @@ -298,14 +298,6 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co @Param(description = "OS type id of the vm", since = "4.4") private String osTypeId; - @SerializedName(ApiConstants.BOOT_MODE) - @Param(description = "Guest vm Boot Mode") - private String bootMode; - - @SerializedName(ApiConstants.BOOT_TYPE) - @Param(description = "Guest vm Boot Type") - private String bootType; - public UserVmResponse() { securityGroupList = new LinkedHashSet(); nics = new LinkedHashSet(); @@ -881,13 +873,4 @@ public void setDynamicallyScalable(Boolean dynamicallyScalable) { public String getOsTypeId() { return osTypeId; } - - public String getBootType() { return bootType; } - - public void setBootType(String bootType) { this.bootType = bootType; } - - public String getBootMode() { return bootMode; } - - public void setBootMode(String bootMode) { this.bootMode = bootMode; } - } diff --git a/engine/api/src/main/java/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntity.java b/engine/api/src/main/java/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntity.java index 7b34077676c3..c004514d084e 100644 --- a/engine/api/src/main/java/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntity.java +++ b/engine/api/src/main/java/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntity.java @@ -171,10 +171,4 @@ void deploy(String reservationId, String caller, Map params); - } diff --git a/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java index 8817efbeaedc..7765611744fd 100755 --- a/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java @@ -1064,10 +1064,6 @@ public void orchestrateStart(final String vmUuid, final Map details = vmEntityVO.getDetails(); - vmProfile.getParameters().put(VirtualMachineProfile.Param.BootType, details.get(VirtualMachineProfile.Param.BootType.getName())); - vmProfile.getParameters().put(VirtualMachineProfile.Param.BootMode, details.get(VirtualMachineProfile.Param.BootMode.getName())); - vmProfile.getParameters().put(VirtualMachineProfile.Param.UefiFlag, details.get(VirtualMachineProfile.Param.UefiFlag.getName())); - } DataCenterDeployment plan = new DataCenterDeployment(vm.getDataCenterId(), vm.getPodIdToDeployIn(), null, null, null, null); if (planToDeploy != null && planToDeploy.getDataCenterId() != 0) { plan = diff --git a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java index 3e5f910fa8a1..598e61989d17 100644 --- a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java +++ b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java @@ -20,11 +20,9 @@ import java.util.Date; import java.util.List; import java.util.Map; -import java.util.HashMap; import javax.inject.Inject; -import org.apache.commons.collections.MapUtils; import org.springframework.stereotype.Component; import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO; @@ -271,22 +269,4 @@ public void disconnectFrom(NetworkEntity netowrk, short nicId) { } - @Override - public void setParamsToEntity(Map map) { - if (MapUtils.isNotEmpty(map)) { - if (this.vmEntityVO != null) { - Map details = this.vmEntityVO.getDetails(); - if (details == null) { - details = new HashMap(); - } - for (Map.Entry entry : map.entrySet()) { - if (null != entry && null != entry.getValue() && null != entry.getKey()) { - details.put(entry.getKey().getName(), entry.getValue().toString()); - } - } - this.vmEntityVO.setDetails(details); - } - } - - } } diff --git a/engine/schema/src/main/java/com/cloud/host/dao/HostDao.java b/engine/schema/src/main/java/com/cloud/host/dao/HostDao.java index ced19cecf79b..34b89634edc7 100644 --- a/engine/schema/src/main/java/com/cloud/host/dao/HostDao.java +++ b/engine/schema/src/main/java/com/cloud/host/dao/HostDao.java @@ -112,7 +112,5 @@ public interface HostDao extends GenericDao, StateDao listAllHostsUpByZoneAndHypervisor(long zoneId, HypervisorType hypervisorType); - List listByHostCapability(Host.Type type, Long clusterId, Long podId, long dcId, String hostCapabilty); - List listByClusterAndHypervisorType(long clusterId, HypervisorType hypervisorType); } diff --git a/engine/schema/src/main/java/com/cloud/host/dao/HostDaoImpl.java b/engine/schema/src/main/java/com/cloud/host/dao/HostDaoImpl.java index ec4573faf226..20d817cbf456 100644 --- a/engine/schema/src/main/java/com/cloud/host/dao/HostDaoImpl.java +++ b/engine/schema/src/main/java/com/cloud/host/dao/HostDaoImpl.java @@ -43,7 +43,6 @@ import com.cloud.gpu.dao.HostGpuGroupsDao; import com.cloud.gpu.dao.VGPUTypesDao; import com.cloud.host.Host; -import com.cloud.host.DetailVO; import com.cloud.host.Host.Type; import com.cloud.host.HostTagVO; import com.cloud.host.HostVO; @@ -1223,39 +1222,6 @@ public List listAllHostsUpByZoneAndHypervisor(long zoneId, HypervisorTyp } @Override - public List listByHostCapability(Type type, Long clusterId, Long podId, long dcId, String hostCapabilty) { - SearchBuilder hostCapabilitySearch = _detailsDao.createSearchBuilder(); - DetailVO tagEntity = hostCapabilitySearch.entity(); - hostCapabilitySearch.and("capability", tagEntity.getName(), SearchCriteria.Op.EQ); - hostCapabilitySearch.and("value", tagEntity.getValue(), SearchCriteria.Op.EQ); - - SearchBuilder hostSearch = createSearchBuilder(); - HostVO entity = hostSearch.entity(); - hostSearch.and("type", entity.getType(), SearchCriteria.Op.EQ); - hostSearch.and("pod", entity.getPodId(), SearchCriteria.Op.EQ); - hostSearch.and("dc", entity.getDataCenterId(), SearchCriteria.Op.EQ); - hostSearch.and("cluster", entity.getClusterId(), SearchCriteria.Op.EQ); - hostSearch.and("status", entity.getStatus(), SearchCriteria.Op.EQ); - hostSearch.and("resourceState", entity.getResourceState(), SearchCriteria.Op.EQ); - hostSearch.join("hostCapabilitySearch", hostCapabilitySearch, entity.getId(), tagEntity.getHostId(), JoinBuilder.JoinType.INNER); - - SearchCriteria sc = hostSearch.create(); - sc.setJoinParameters("hostCapabilitySearch", "value", Boolean.toString(true)); - sc.setJoinParameters("hostCapabilitySearch", "capability", hostCapabilty); - sc.setParameters("type", type.toString()); - if (podId != null) { - sc.setParameters("pod", podId); - } - if (clusterId != null) { - sc.setParameters("cluster", clusterId); - } - sc.setParameters("dc", dcId); - sc.setParameters("status", Status.Up.toString()); - sc.setParameters("resourceState", ResourceState.Enabled.toString()); - - return listBy(sc); - } - public List listByClusterAndHypervisorType(long clusterId, HypervisorType hypervisorType) { SearchCriteria sc = ClusterHypervisorSearch.create(); sc.setParameters("clusterId", clusterId); diff --git a/plugins/deployment-planners/implicit-dedication/src/test/java/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java b/plugins/deployment-planners/implicit-dedication/src/test/java/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java index 1a3aed0ab611..79cb1b4596d8 100644 --- a/plugins/deployment-planners/implicit-dedication/src/test/java/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java +++ b/plugins/deployment-planners/implicit-dedication/src/test/java/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java @@ -73,7 +73,6 @@ import com.cloud.gpu.dao.HostGpuGroupsDao; import com.cloud.host.HostVO; import com.cloud.host.dao.HostDao; -import com.cloud.host.dao.HostDetailsDao; import com.cloud.host.dao.HostTagsDao; import com.cloud.resource.ResourceManager; import com.cloud.service.ServiceOfferingVO; @@ -574,10 +573,6 @@ public DataStoreManager dataStoreManager() { return Mockito.mock(DataStoreManager.class); } - @Bean - public HostDetailsDao hostDetailsDao() { return Mockito.mock(HostDetailsDao.class); } - - @Bean public ClusterDetailsDao clusterDetailsDao() { return Mockito.mock(ClusterDetailsDao.class); diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 79958ef8ea43..46ac467fccff 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -224,7 +224,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv private String _dcId; private String _pod; private String _clusterId; - private final Properties _uefiProperties = new Properties(); private long _hvVersion; private Duration _timeout; @@ -522,6 +521,7 @@ public String getResizeVolumePath() { public StorageSubsystemCommandHandler getStorageHandler() { return storageHandler; } + private static final class KeyValueInterpreter extends OutputInterpreter { private final Map map = new HashMap(); @@ -652,11 +652,6 @@ public boolean configure(final String name, final Map params) th if (!success) { return false; } - try { - loadUefiProperties(); - } catch (FileNotFoundException e) { - s_logger.error("uefi properties file not found due to: " + e.getLocalizedMessage()); - } _storage = new JavaStorageLayer(); _storage.configure("StorageLayer", params); @@ -1225,31 +1220,6 @@ private void configureAgentHooks(final Map params) { s_logger.debug("agent.hooks.libvirt_vm_on_stop.method is " + _agentHooksVmOnStopMethod); } - private void loadUefiProperties() throws FileNotFoundException { - - if (_uefiProperties != null && _uefiProperties.getProperty("guest.loader.legacy") != null) { - return; - } - final File file = PropertiesUtil.findConfigFile("uefi.properties"); - if (file == null) { - throw new FileNotFoundException("Unable to find file uefi.properties."); - } - - s_logger.info("uefi.properties file found at " + file.getAbsolutePath()); - try { - PropertiesUtil.loadFromFile(_uefiProperties, file); - s_logger.info("guest.nvram.template.legacy = " + _uefiProperties.getProperty("guest.nvram.template.legacy")); - s_logger.info("guest.loader.legacy = " + _uefiProperties.getProperty("guest.loader.legacy")); - s_logger.info("guest.nvram.template.secure = " + _uefiProperties.getProperty("guest.nvram.template.secure")); - s_logger.info("guest.loader.secure =" + _uefiProperties.getProperty("guest.loader.secure")); - s_logger.info("guest.nvram.path = " + _uefiProperties.getProperty("guest.nvram.path")); - } catch (final FileNotFoundException ex) { - throw new CloudRuntimeException("Cannot find the file: " + file.getAbsolutePath(), ex); - } catch (final IOException ex) { - throw new CloudRuntimeException("IOException in reading " + file.getAbsolutePath(), ex); - } - } - protected void configureDiskActivityChecks(final Map params) { _diskActivityCheckEnabled = Boolean.parseBoolean((String)params.get("vm.diskactivity.checkenabled")); if (_diskActivityCheckEnabled) { @@ -2206,18 +2176,6 @@ public LibvirtVMDef createVMFromSpec(final VirtualMachineTO vmTO) { vm.setDomDescription(vmTO.getOs()); vm.setPlatformEmulator(vmTO.getPlatformEmulator()); - Map customParams = vmTO.getDetails(); - boolean isUefiEnabled = false; - boolean isSecureBoot = false; - String bootMode =null; - if (MapUtils.isNotEmpty(customParams) && customParams.containsKey(GuestDef.BootType.UEFI.toString())) { - isUefiEnabled = true; - bootMode = customParams.get(GuestDef.BootType.UEFI.toString()); - if (StringUtils.isNotBlank(bootMode) && "secure".equalsIgnoreCase(bootMode)) { - isSecureBoot = true; - } - } - Map extraConfig = vmTO.getExtraConfig(); if (dpdkSupport && (!extraConfig.containsKey(DpdkHelper.DPDK_NUMA) || !extraConfig.containsKey(DpdkHelper.DPDK_HUGE_PAGES))) { s_logger.info("DPDK is enabled but it needs extra configurations for CPU NUMA and Huge Pages for VM deployment"); @@ -2237,44 +2195,11 @@ 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"); - guest.setBootMode(GuestDef.BootMode.SECURE); // setting to secure mode - } - } guest.setUuid(uuid); guest.setBootOrder(GuestDef.BootOrder.CDROM); guest.setBootOrder(GuestDef.BootOrder.HARDISK); - if (isUefiEnabled) { - if (_uefiProperties.getProperty(GuestDef.GUEST_LOADER_SECURE) != null && "secure".equalsIgnoreCase(bootMode)) { - guest.setLoader(_uefiProperties.getProperty(GuestDef.GUEST_LOADER_SECURE)); - } - - if (_uefiProperties.getProperty(GuestDef.GUEST_LOADER_LEGACY) != null && "legacy".equalsIgnoreCase(bootMode)) { - guest.setLoader(_uefiProperties.getProperty(GuestDef.GUEST_LOADER_LEGACY)); - } - - if (_uefiProperties.getProperty(GuestDef.GUEST_NVRAM_PATH) != null) { - guest.setNvram(_uefiProperties.getProperty(GuestDef.GUEST_NVRAM_PATH)); - } - - if (isSecureBoot) { - if (_uefiProperties.getProperty(GuestDef.GUEST_NVRAM_TEMPLATE_SECURE) != null && "secure".equalsIgnoreCase(bootMode)) { - guest.setNvramTemplate(_uefiProperties.getProperty(GuestDef.GUEST_NVRAM_TEMPLATE_SECURE)); - } - } else { - if (_uefiProperties.getProperty(GuestDef.GUEST_NVRAM_TEMPLATE_LEGACY) != null) { - guest.setNvramTemplate(_uefiProperties.getProperty(GuestDef.GUEST_NVRAM_TEMPLATE_LEGACY)); - } - } - } - - vm.addComp(guest); + vm.addComp(guest); final GuestResourceDef grd = new GuestResourceDef(); @@ -2334,9 +2259,6 @@ So if getMinSpeed() returns null we fall back to getSpeed(). features.addFeatures("pae"); features.addFeatures("apic"); features.addFeatures("acpi"); - if (isUefiEnabled && isSecureMode(customParams.get(GuestDef.BootType.UEFI.toString()))) { - features.addFeatures("smm"); - } //KVM hyperv enlightenment features based on OS Type enlightenWindowsVm(vmTO, features); @@ -2477,10 +2399,7 @@ public String getVolumePath(final Connect conn, final DiskTO volume) throws Libv } public void createVbd(final Connect conn, final VirtualMachineTO vmSpec, final String vmName, final LibvirtVMDef vm) throws InternalErrorException, LibvirtException, URISyntaxException { - final Map details = vmSpec.getDetails(); final List disks = Arrays.asList(vmSpec.getDisks()); - boolean isSecureBoot = false; - boolean isWindowsTemplate = false; Collections.sort(disks, new Comparator() { @Override public int compare(final DiskTO arg0, final DiskTO arg1) { @@ -2488,12 +2407,6 @@ public int compare(final DiskTO arg0, final DiskTO arg1) { } }); - if (MapUtils.isNotEmpty(details) && details.containsKey(GuestDef.BootType.UEFI.toString())) { - isSecureBoot = isSecureMode(details.get(GuestDef.BootType.UEFI.toString())); - } - if (vmSpec.getOs().toLowerCase().contains("window")) { - isWindowsTemplate =true; - } for (final DiskTO volume : disks) { KVMPhysicalDisk physicalDisk = null; KVMStoragePool pool = null; @@ -2554,12 +2467,8 @@ public int compare(final DiskTO arg0, final DiskTO arg1) { int devId = volume.getDiskSeq().intValue(); if (volume.getType() == Volume.Type.ISO) { if (volPath == null) { - if (isSecureBoot) { - disk.defISODisk(null, devId,isSecureBoot,isWindowsTemplate); - } else { - /* Add iso as placeholder */ - disk.defISODisk(null, devId); - } + /* Add iso as placeholder */ + disk.defISODisk(null, devId); } else { disk.defISODisk(volPath, devId); } @@ -2597,11 +2506,7 @@ public int compare(final DiskTO arg0, final DiskTO arg1) { if (volume.getType() == Volume.Type.DATADISK) { disk.defFileBasedDisk(physicalDisk.getPath(), devId, diskBusTypeData, DiskDef.DiskFmtType.QCOW2); } else { - if (isSecureBoot) { - disk.defFileBasedDisk(physicalDisk.getPath(), devId, DiskDef.DiskFmtType.QCOW2, isWindowsTemplate); - } else { - disk.defFileBasedDisk(physicalDisk.getPath(), devId, diskBusType, DiskDef.DiskFmtType.QCOW2); - } + disk.defFileBasedDisk(physicalDisk.getPath(), devId, diskBusType, DiskDef.DiskFmtType.QCOW2); } } @@ -4217,12 +4122,4 @@ public boolean isHostSecured() { } return true; } - - public boolean isSecureMode(String bootMode) { - if (StringUtils.isNotBlank(bootMode) && "secure".equalsIgnoreCase(bootMode)) { - return true; - } - - return false; - } } diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java index e2d506ce09fb..bfbb4d5d1bc4 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java @@ -57,39 +57,7 @@ public String toString() { } } - enum BootType { - UEFI("UEFI"), BIOS("BIOS"); - - String _type; - - BootType(String type) { - _type = type; - } - - @Override - public String toString() { - return _type; - } - } - - enum BootMode { - LEGACY("LEGACY"), SECURE("SECURE"); - - String _mode; - - BootMode(String mode) { - _mode = mode; - } - - @Override - public String toString() { - return _mode; - } - } - private GuestType _type; - private BootType _boottype; - private BootMode _bootmode; private String _arch; private String _loader; private String _kernel; @@ -99,14 +67,6 @@ public String toString() { private String _uuid; private final List _bootdevs = new ArrayList(); private String _machine; - private String _nvram; - private String _nvramTemplate; - - public static final String GUEST_LOADER_SECURE = "guest.loader.secure"; - public static final String GUEST_LOADER_LEGACY = "guest.loader.legacy"; - public static final String GUEST_NVRAM_PATH = "guest.nvram.path"; - public static final String GUEST_NVRAM_TEMPLATE_SECURE = "guest.nvram.template.secure"; - public static final String GUEST_NVRAM_TEMPLATE_LEGACY = "guest.nvram.template.legacy"; public void setGuestType(GuestType type) { _type = type; @@ -116,10 +76,6 @@ public GuestType getGuestType() { return _type; } - public void setNvram(String nvram) { _nvram = nvram; } - - public void setNvramTemplate(String nvramTemplate) { _nvramTemplate = nvramTemplate; } - public void setGuestArch(String arch) { _arch = arch; } @@ -147,22 +103,6 @@ public void setUuid(String uuid) { _uuid = uuid; } - public BootType getBootType() { - return _boottype; - } - - public void setBootType(BootType boottype) { - this._boottype = boottype; - } - - public BootMode getBootMode() { - return _bootmode; - } - - public void setBootMode(BootMode bootmode) { - this._bootmode = bootmode; - } - @Override public String toString() { if (_type == GuestType.KVM) { @@ -188,24 +128,6 @@ public String toString() { if (_arch != null && _arch.equals("aarch64")) { guestDef.append("/usr/share/AAVMF/AAVMF_CODE.fd\n"); } - if (_loader != null) { - if (_bootmode == BootMode.LEGACY) { - guestDef.append("" + _loader + "\n"); - } else if (_bootmode == BootMode.SECURE) { - guestDef.append("" + _loader + "\n"); - } - } - if (_nvram != null) { - guestDef.append(""); - } else { - guestDef.append(">"); - } - - guestDef.append(_nvram); - guestDef.append(_uuid + ".fd"); - } if (!_bootdevs.isEmpty()) { for (BootOrder bo : _bootdevs) { guestDef.append("\n"); @@ -354,11 +276,7 @@ public String toString() { StringBuilder feaBuilder = new StringBuilder(); feaBuilder.append("\n"); for (String feature : _features) { - if (feature.equalsIgnoreCase("smm")) { - feaBuilder.append("<" + feature + " state=\'on\' " + "/>\n"); - } else { - feaBuilder.append("<" + feature + "/>\n"); - } + feaBuilder.append("<" + feature + "/>\n"); } if (hyperVEnlightenmentFeatureDef != null) { String hpervF = hyperVEnlightenmentFeatureDef.toString(); @@ -590,7 +508,7 @@ public String toString() { } public enum DiskBus { - IDE("ide"), SCSI("scsi"), VIRTIO("virtio"), XEN("xen"), USB("usb"), UML("uml"), FDC("fdc"), SATA("sata"); + IDE("ide"), SCSI("scsi"), VIRTIO("virtio"), XEN("xen"), USB("usb"), UML("uml"), FDC("fdc"); String _bus; DiskBus(String bus) { @@ -715,17 +633,13 @@ private String getDevLabel(int devId, DiskBus bus, boolean forIso) { return "sd" + getDevLabelSuffix(devId); } else if (bus == DiskBus.VIRTIO) { return "vd" + getDevLabelSuffix(devId); - } else if (bus == DiskBus.SATA){ - if (!forIso) { - return "sda"; - } } if (forIso) { devId --; } else if(devId >= 2) { devId += 2; } - return (DiskBus.SATA == bus) ? "sdb" : "hd" + getDevLabelSuffix(devId); + return "hd" + getDevLabelSuffix(devId); } @@ -757,23 +671,6 @@ public void defFileBasedDisk(String filePath, int devId, DiskBus bus, DiskFmtTyp } - public void defFileBasedDisk(String filePath, int devId, DiskFmtType diskFmtType,boolean isWindowsOS) { - - _diskType = DiskType.FILE; - _deviceType = DeviceType.DISK; - _diskCacheMode = DiskCacheMode.NONE; - _sourcePath = filePath; - _diskFmtType = diskFmtType; - - if (isWindowsOS) { - _diskLabel = getDevLabel(devId, DiskBus.SATA, false); // Windows Secure VM - _bus = DiskBus.SATA; - } else { - _diskLabel = getDevLabel(devId, DiskBus.VIRTIO, false); // Linux Secure VM - _bus = DiskBus.VIRTIO; - } - } - public void defISODisk(String volPath) { _diskType = DiskType.FILE; _deviceType = DeviceType.CDROM; @@ -798,26 +695,6 @@ public void defISODisk(String volPath, Integer devId) { } } - public void defISODisk(String volPath, Integer devId,boolean isSecure, boolean isWindowOs) { - if (!isSecure) { - defISODisk(volPath, devId); - } else { - _diskType = DiskType.FILE; - _deviceType = DeviceType.CDROM; - _sourcePath = volPath; - if (isWindowOs) { - _diskLabel = getDevLabel(devId, DiskBus.SATA, true); - _bus = DiskBus.SATA; - } else { - _diskLabel = getDevLabel(devId, DiskBus.SCSI, true); - _bus = DiskBus.SCSI; - } - _diskFmtType = DiskFmtType.RAW; - _diskCacheMode = DiskCacheMode.NONE; - - } - } - public void defBlockBasedDisk(String diskName, int devId, DiskBus bus) { _diskType = DiskType.BLOCK; _deviceType = DeviceType.DISK; diff --git a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java index 4e8acad251b1..39c1e66e64de 100644 --- a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java +++ b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java @@ -294,7 +294,6 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) { } } - details.put(VmDetailConstants.BOOT_MODE, to.getBootType()); String diskDeviceType = details.get(VmDetailConstants.ROOT_DISK_CONTROLLER); if (userVm) { if (diskDeviceType == null) { diff --git a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java index 1102f9d1ce87..4b2f830a3ee7 100644 --- a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java +++ b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java @@ -45,7 +45,6 @@ import com.cloud.exception.DiscoveryException; import com.cloud.exception.InvalidParameterValueException; import com.cloud.exception.ResourceInUseException; -import com.cloud.host.Host; import com.cloud.host.HostVO; import com.cloud.hypervisor.Hypervisor; import com.cloud.hypervisor.Hypervisor.HypervisorType; @@ -368,10 +367,6 @@ public VmwareServerDiscoverer() { details.put("url", hostMo.getHostName()); details.put("username", username); details.put("password", password); - boolean uefiLegacySupported = hostMo.isUefiLegacySupported(); - if (uefiLegacySupported) { - details.put(Host.HOST_UEFI_ENABLE, "true"); - } String guid = morHost.getType() + ":" + morHost.getValue() + "@" + url.getHost(); details.put("guid", guid); diff --git a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java index 566f11db4ea9..ea27d3617b0c 100644 --- a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -317,7 +317,6 @@ import com.vmware.vim25.VirtualEthernetCardOpaqueNetworkBackingInfo; import com.vmware.vim25.VirtualIDEController; import com.vmware.vim25.VirtualMachineConfigSpec; -import com.vmware.vim25.VirtualMachineBootOptions; import com.vmware.vim25.VirtualMachineFileInfo; import com.vmware.vim25.VirtualMachineFileLayoutEx; import com.vmware.vim25.VirtualMachineFileLayoutExFileInfo; @@ -1723,11 +1722,6 @@ protected StartAnswer execute(StartCommand cmd) { String dataDiskController = vmSpec.getDetails().get(VmDetailConstants.DATA_DISK_CONTROLLER); String rootDiskController = vmSpec.getDetails().get(VmDetailConstants.ROOT_DISK_CONTROLLER); DiskTO rootDiskTO = null; - String bootMode = ApiConstants.BootType.BIOS.toString(); - if (vmSpec.getDetails().containsKey(VmDetailConstants.BOOT_MODE)) { - bootMode = vmSpec.getDetails().get(VmDetailConstants.BOOT_MODE); - } - // If root disk controller is scsi, then data disk controller would also be scsi instead of using 'osdefault' // This helps avoid mix of different scsi subtype controllers in instance. if (DiskControllerType.osdefault == DiskControllerType.getType(dataDiskController) && DiskControllerType.lsilogic == DiskControllerType.getType(rootDiskController)) { @@ -2285,16 +2279,6 @@ protected StartAnswer execute(StartCommand cmd) { } } - if (!bootMode.equalsIgnoreCase(ApiConstants.BootType.BIOS.toString())) { - vmConfigSpec.setFirmware("efi"); - if (vmSpec.getDetails().containsKey(ApiConstants.BootType.UEFI.toString()) && "secure".equalsIgnoreCase(vmSpec.getDetails().get(ApiConstants.BootType.UEFI.toString()))) { - VirtualMachineBootOptions bootOptions = new VirtualMachineBootOptions(); - bootOptions.setEfiSecureBootEnabled(true); - vmConfigSpec.setBootOptions(bootOptions); - } - } - - // // Configure VM // @@ -2787,9 +2771,6 @@ private static void configNvpExtraOption(List extraOptions, Virtual private static void configCustomExtraOption(List extraOptions, VirtualMachineTO vmSpec) { // we no longer to validation anymore for (Map.Entry entry : vmSpec.getDetails().entrySet()) { - if (entry.getKey().equalsIgnoreCase(VmDetailConstants.BOOT_MODE)) { - continue; - } OptionValue newVal = new OptionValue(); newVal.setKey(entry.getKey()); newVal.setValue(entry.getValue()); diff --git a/server/src/main/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java b/server/src/main/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java index 698d6d73904b..7c226be25121 100644 --- a/server/src/main/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java +++ b/server/src/main/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java @@ -61,9 +61,6 @@ import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineProfile; import com.cloud.vm.dao.VMInstanceDao; -import com.cloud.vm.UserVmDetailVO; -import com.cloud.vm.dao.UserVmDetailsDao; - /** * An allocator that tries to find a fit on a computing host. This allocator does not care whether or not the host supports routing. @@ -95,8 +92,6 @@ public class FirstFitAllocator extends AdapterBase implements HostAllocator { CapacityManager _capacityMgr; @Inject CapacityDao _capacityDao; - @Inject - UserVmDetailsDao _userVmDetailsDao; boolean _checkHvm = true; protected String _allocationAlgorithm = "random"; @@ -117,16 +112,6 @@ public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan pla 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())) { - isVMDeployedWithUefi = true; - } - } - s_logger.info(" Guest VM is requested with Cusotm[UEFI] Boot Type "+ isVMDeployedWithUefi); - - if (type == Host.Type.Storage) { // FirstFitAllocator should be used for user VMs only since it won't care whether the host is capable of routing or not return new ArrayList(); @@ -138,20 +123,11 @@ public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan pla String hostTagOnOffering = offering.getHostTag(); String hostTagOnTemplate = template.getTemplateTag(); - String hostTagUefi = "UEFI"; boolean hasSvcOfferingTag = hostTagOnOffering != null ? true : false; boolean hasTemplateTag = hostTagOnTemplate != null ? true : false; List clusterHosts = new ArrayList(); - List hostsMatchingUefiTag = new ArrayList(); - if(isVMDeployedWithUefi){ - hostsMatchingUefiTag = _hostDao.listByHostCapability(type, clusterId, podId, dcId, Host.HOST_UEFI_ENABLE); - if (s_logger.isDebugEnabled()) { - s_logger.debug("Hosts with tag '" + hostTagUefi + "' are:" + hostsMatchingUefiTag); - } - } - String haVmTag = (String)vmProfile.getParameter(VirtualMachineProfile.Param.HaTag); if (haVmTag != null) { @@ -199,10 +175,6 @@ public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan pla } } - if (isVMDeployedWithUefi) { - clusterHosts.retainAll(hostsMatchingUefiTag); - } - // add all hosts that we are not considering to the avoid list List allhostsInCluster = _hostDao.listAllUpAndEnabledNonHAHosts(type, clusterId, podId, dcId, null); allhostsInCluster.removeAll(clusterHosts); diff --git a/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java b/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java index 21c6786f305e..a612829507e1 100644 --- a/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java +++ b/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java @@ -321,15 +321,6 @@ public UserVmResponse newUserVmResponse(ResponseView view, String objectName, Us (UserVmManager.DisplayVMOVFProperties.value() && userVmDetailVO.getName().startsWith(ApiConstants.OVF_PROPERTIES))) { resourceDetails.put(userVmDetailVO.getName(), userVmDetailVO.getValue()); } - if ((ApiConstants.BootType.UEFI.toString()).equalsIgnoreCase(userVmDetailVO.getName())) { - userVmResponse.setBootType("Uefi"); - userVmResponse.setBootMode(userVmDetailVO.getValue().toLowerCase()); - - } - } - if (vmDetails.size() == 0) { - userVmResponse.setBootType("Bios"); - userVmResponse.setBootMode("legacy"); } // Remove blacklisted settings if user is not admin if (caller.getType() != Account.ACCOUNT_TYPE_ADMIN) { diff --git a/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java index 0c1aab3c9323..1315cdfd070e 100644 --- a/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java +++ b/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java @@ -30,12 +30,10 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; -import com.cloud.utils.StringUtils; import com.cloud.utils.db.Filter; import com.cloud.utils.fsm.StateMachine2; import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.MapUtils; import org.apache.log4j.Logger; import org.apache.cloudstack.affinity.AffinityGroupProcessor; import org.apache.cloudstack.affinity.AffinityGroupService; @@ -273,7 +271,6 @@ 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(); @@ -281,14 +278,6 @@ public DeployDestination planDeployment(VirtualMachineProfile vmProfile, Deploym 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; - - } - } if (host == null) { s_logger.debug("The specified host cannot be found"); } else if (avoids.shouldAvoid(host)) { diff --git a/server/src/main/java/com/cloud/deploy/FirstFitPlanner.java b/server/src/main/java/com/cloud/deploy/FirstFitPlanner.java index 88f6b95e8e3d..5760e24ce4d3 100644 --- a/server/src/main/java/com/cloud/deploy/FirstFitPlanner.java +++ b/server/src/main/java/com/cloud/deploy/FirstFitPlanner.java @@ -68,15 +68,12 @@ import com.cloud.vm.dao.UserVmDao; import com.cloud.vm.dao.UserVmDetailsDao; import com.cloud.vm.dao.VMInstanceDao; -import com.cloud.host.dao.HostDetailsDao; public class FirstFitPlanner extends AdapterBase implements DeploymentClusterPlanner, Configurable, DeploymentPlanner { private static final Logger s_logger = Logger.getLogger(FirstFitPlanner.class); @Inject protected HostDao hostDao; @Inject - protected HostDetailsDao hostDetailsDao; - @Inject protected DataCenterDao dcDao; @Inject protected HostPodDao podDao; @@ -190,16 +187,8 @@ public List orderClusters(VirtualMachineProfile vmProfile, DeploymentPlan if (clusterList != null && !clusterList.isEmpty()) { ServiceOffering offering = vmProfile.getServiceOffering(); - boolean nonUefiVMDeploy =false; - if (vmProfile.getParameters().containsKey(VirtualMachineProfile.Param.BootType)) { - if (vmProfile.getParameters().get(VirtualMachineProfile.Param.BootType).toString().equalsIgnoreCase("BIOS")) { - nonUefiVMDeploy = true; - - } - - } // In case of non-GPU VMs, protect GPU enabled Hosts and prefer VM deployment on non-GPU Hosts. - if (((serviceOfferingDetailsDao.findDetail(offering.getId(), GPU.Keys.vgpuType.toString()) == null) && !(hostGpuGroupsDao.listHostIds().isEmpty())) || nonUefiVMDeploy) { + if ((serviceOfferingDetailsDao.findDetail(offering.getId(), GPU.Keys.vgpuType.toString()) == null) && !(hostGpuGroupsDao.listHostIds().isEmpty())) { int requiredCpu = offering.getCpu() * offering.getSpeed(); long requiredRam = offering.getRamSize() * 1024L * 1024L; reorderClustersBasedOnImplicitTags(clusterList, requiredCpu, requiredRam); @@ -216,8 +205,7 @@ private void reorderClustersBasedOnImplicitTags(List clusterList, int requ List hostList = capacityDao.listHostsWithEnoughCapacity(requiredCpu, requiredRam, clusterId, Host.Type.Routing.toString()); if (!hostList.isEmpty() && implicitHostTags.length > 0) { uniqueTags = new Long(hostTagsDao.getDistinctImplicitHostTags(hostList, implicitHostTags).size()); - uniqueTags = uniqueTags + getHostsByCapability(hostList, Host.HOST_UEFI_ENABLE); - } + } UniqueTagsInClusterMap.put(clusterId, uniqueTags); } Collections.sort(clusterList, new Comparator() { @@ -230,19 +218,6 @@ public int compare(Long o1, Long o2) { }); } - private Long getHostsByCapability(List hostList, String hostCapability) { - for (Long host : hostList) { //TODO: Fix this in single query instead of polling request for each Host - Map details = hostDetailsDao.findDetails(host); - if (details.containsKey(Host.HOST_UEFI_ENABLE)) { - if (details.get(Host.HOST_UEFI_ENABLE).equalsIgnoreCase("Yes")) { - return new Long(1); - } - - } - } - return new Long(0); - } - private List scanPodsForDestination(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid) { ServiceOffering offering = vmProfile.getServiceOffering(); diff --git a/server/src/main/java/com/cloud/hypervisor/HypervisorGuruBase.java b/server/src/main/java/com/cloud/hypervisor/HypervisorGuruBase.java index 0c3263a0a8f4..9e5550614680 100644 --- a/server/src/main/java/com/cloud/hypervisor/HypervisorGuruBase.java +++ b/server/src/main/java/com/cloud/hypervisor/HypervisorGuruBase.java @@ -22,6 +22,8 @@ import javax.inject.Inject; +import com.cloud.network.dao.NetworkDetailVO; +import com.cloud.network.dao.NetworkDetailsDao; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.backup.Backup; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; @@ -35,8 +37,6 @@ import com.cloud.gpu.GPU; import com.cloud.network.Networks.BroadcastDomainType; import com.cloud.network.dao.NetworkDao; -import com.cloud.network.dao.NetworkDetailVO; -import com.cloud.network.dao.NetworkDetailsDao; import com.cloud.network.dao.NetworkVO; import com.cloud.offering.NetworkOffering; import com.cloud.offering.ServiceOffering; @@ -47,7 +47,6 @@ import com.cloud.service.dao.ServiceOfferingDetailsDao; import com.cloud.storage.StoragePool; import com.cloud.utils.Pair; -import com.cloud.utils.StringUtils; import com.cloud.utils.component.AdapterBase; import com.cloud.vm.NicProfile; import com.cloud.vm.NicVO; @@ -172,11 +171,6 @@ protected VirtualMachineTO toVirtualMachineTO(VirtualMachineProfile vmProfile) { offering.getRamSize() * 1024l * 1024l, null, null, vm.isHaEnabled(), vm.limitCpuUse(), vm.getVncPassword()); to.setBootArgs(vmProfile.getBootArgs()); - String bootType = (String)vmProfile.getParameter(new VirtualMachineProfile.Param("BootType")); - if (StringUtils.isNotBlank(bootType)) { - to.setBootType(bootType); - } - List nicProfiles = vmProfile.getNics(); NicTO[] nics = new NicTO[nicProfiles.size()]; int i = 0; diff --git a/server/src/main/java/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java b/server/src/main/java/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java index 904a488c1245..e232d6a64152 100644 --- a/server/src/main/java/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java +++ b/server/src/main/java/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java @@ -202,7 +202,6 @@ private void setupAgentSecurity(final Connection sshConnection, final String age @Override public Map> find(long dcId, Long podId, Long clusterId, URI uri, String username, String password, List hostTags) throws DiscoveryException { - boolean isUefiSupported = false; ClusterVO cluster = _clusterDao.findById(clusterId); if (cluster == null || cluster.getHypervisorType() != getHypervisorType()) { @@ -257,11 +256,6 @@ private void setupAgentSecurity(final Connection sshConnection, final String age return null; } - if (SSHCmdHelper.sshExecuteCmd(sshConnection, "rpm -qa | grep -i ovmf", 3)) { - s_logger.debug("It's UEFI enabled KVM machine"); - isUefiSupported = true; - } - List netInfos = _networkMgr.getPhysicalNetworkInfo(dcId, getHypervisorType()); String kvmPrivateNic = null; String kvmPublicNic = null; @@ -344,7 +338,6 @@ private void setupAgentSecurity(final Connection sshConnection, final String age Map hostDetails = connectedHost.getDetails(); hostDetails.put("password", password); hostDetails.put("username", username); - hostDetails.put(Host.HOST_UEFI_ENABLE, isUefiSupported == true ? Boolean.toString(true) : Boolean.toString(false)); _hostDao.saveDetails(connectedHost); return resources; } catch (DiscoveredWithErrorException e) { diff --git a/server/src/main/java/com/cloud/server/ManagementServerImpl.java b/server/src/main/java/com/cloud/server/ManagementServerImpl.java index 1ef96f225bf1..a18dd23d5e38 100644 --- a/server/src/main/java/com/cloud/server/ManagementServerImpl.java +++ b/server/src/main/java/com/cloud/server/ManagementServerImpl.java @@ -709,8 +709,6 @@ import com.cloud.vm.dao.SecondaryStorageVmDao; import com.cloud.vm.dao.UserVmDao; import com.cloud.vm.dao.VMInstanceDao; -import com.cloud.vm.UserVmDetailVO; -import com.cloud.vm.dao.UserVmDetailsDao; public class ManagementServerImpl extends ManagerBase implements ManagementServer, Configurable { public static final Logger s_logger = Logger.getLogger(ManagementServerImpl.class.getName()); @@ -730,8 +728,6 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe @Inject private ClusterDao _clusterDao; @Inject - private UserVmDetailsDao _UserVmDetailsDao; - @Inject private SecondaryStorageVmDao _secStorageVmDao; @Inject public EventDao _eventDao; @@ -1195,16 +1191,6 @@ public Ternary, Integer>, List, Map, Integer>, List, Map>(new Pair, - Integer>(new ArrayList(), new Integer(0)), new ArrayList(), new HashMap()); - } - } - if (_serviceOfferingDetailsDao.findDetail(vm.getServiceOfferingId(), GPU.Keys.pciDevice.toString()) != null) { s_logger.info(" Live Migration of GPU enabled VM : " + vm.getInstanceName() + " is not supported"); // Return empty list. diff --git a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java index 28636f347a21..aac099af1fd2 100644 --- a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java @@ -3964,11 +3964,6 @@ public UserVmVO doInTransaction(TransactionStatus status) throws InsufficientCap } else { vm.setDetail(key, customParameters.get(key)); } - - if (key.equalsIgnoreCase(ApiConstants.BootType.UEFI.toString())) { - vm.setDetail(key, customParameters.get(key)); - continue; - } } vm.setDetail(VmDetailConstants.DEPLOY_VM, "true"); @@ -4288,21 +4283,13 @@ public UserVm startVirtualMachine(DeployVMCmd cmd) throws ResourceUnavailableExc Long podId = null; Long clusterId = null; Long hostId = cmd.getHostId(); - Map additonalParams = null; Map diskOfferingMap = cmd.getDataDiskTemplateToDiskOfferingMap(); if (cmd instanceof DeployVMCmdByAdmin) { DeployVMCmdByAdmin adminCmd = (DeployVMCmdByAdmin)cmd; podId = adminCmd.getPodId(); clusterId = adminCmd.getClusterId(); } - if (MapUtils.isNotEmpty(cmd.getDetails()) && cmd.getDetails().containsKey(ApiConstants.BootType.UEFI.toString())) { - additonalParams = new HashMap(); - Map map = cmd.getDetails(); - additonalParams.put(VirtualMachineProfile.Param.UefiFlag, "Yes"); - additonalParams.put(VirtualMachineProfile.Param.BootType, ApiConstants.BootType.UEFI.toString()); - additonalParams.put(VirtualMachineProfile.Param.BootMode, map.get(ApiConstants.BootType.UEFI.toString())); - } - return startVirtualMachine(vmId, podId, clusterId, hostId, diskOfferingMap, additonalParams, cmd.getDeploymentPlanner()); + return startVirtualMachine(vmId, podId, clusterId, hostId, diskOfferingMap, null, cmd.getDeploymentPlanner()); } private UserVm startVirtualMachine(long vmId, Long podId, Long clusterId, Long hostId, Map diskOfferingMap, Map additonalParams, String deploymentPlannerToUse) @@ -4761,7 +4748,6 @@ public Pair> startVirtualMach throw new InvalidParameterValueException("Can't find a planner by name " + deploymentPlannerToUse); } } - vmEntity.setParamsToEntity(additionalParams); String reservationId = vmEntity.reserve(planner, plan, new ExcludeList(), Long.toString(callerUser.getId())); vmEntity.deploy(reservationId, Long.toString(callerUser.getId()), params, deployOnGivenHost); diff --git a/server/src/test/java/com/cloud/vm/DeploymentPlanningManagerImplTest.java b/server/src/test/java/com/cloud/vm/DeploymentPlanningManagerImplTest.java index e73c0c6bd7dc..1d1ab89d8355 100644 --- a/server/src/test/java/com/cloud/vm/DeploymentPlanningManagerImplTest.java +++ b/server/src/test/java/com/cloud/vm/DeploymentPlanningManagerImplTest.java @@ -102,7 +102,6 @@ import com.cloud.vm.dao.UserVmDao; import com.cloud.vm.dao.UserVmDetailsDao; import com.cloud.vm.dao.VMInstanceDao; -import com.cloud.host.dao.HostDetailsDao; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(loader = AnnotationConfigContextLoader.class) @@ -285,12 +284,6 @@ public HostTagsDao hostTagsDao() { return Mockito.mock(HostTagsDao.class); } - @Bean - public HostDetailsDao hostDetailsDao() { - return Mockito.mock(HostDetailsDao.class); - } - - @Bean public ClusterDetailsDao clusterDetailsDao() { return Mockito.mock(ClusterDetailsDao.class); diff --git a/server/src/test/java/com/cloud/vm/FirstFitPlannerTest.java b/server/src/test/java/com/cloud/vm/FirstFitPlannerTest.java index 41deea2823f4..85463de8c8bf 100644 --- a/server/src/test/java/com/cloud/vm/FirstFitPlannerTest.java +++ b/server/src/test/java/com/cloud/vm/FirstFitPlannerTest.java @@ -95,7 +95,6 @@ import com.cloud.vm.dao.UserVmDao; import com.cloud.vm.dao.UserVmDetailsDao; import com.cloud.vm.dao.VMInstanceDao; -import com.cloud.host.dao.HostDetailsDao; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(loader = AnnotationConfigContextLoader.class) @@ -110,8 +109,6 @@ public class FirstFitPlannerTest { @Inject UserVmDao vmDao; @Inject - HostDetailsDao hostDetailsDao; - @Inject UserVmDetailsDao vmDetailsDao; @Inject ConfigurationDao configDao; @@ -358,9 +355,6 @@ public HostTagsDao hostTagsDao() { return Mockito.mock(HostTagsDao.class); } - @Bean - public HostDetailsDao hostDetailsDao() { return Mockito.mock(HostDetailsDao.class); } - @Bean public HostGpuGroupsDao hostGpuGroupsDao() { return Mockito.mock(HostGpuGroupsDao.class); diff --git a/ui/index.html b/ui/index.html index ef7a461c3e94..7d24838d40b6 100644 --- a/ui/index.html +++ b/ui/index.html @@ -480,31 +480,6 @@

- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
diff --git a/ui/l10n/en.js b/ui/l10n/en.js index cb967beca671..d01b622ce25b 100644 --- a/ui/l10n/en.js +++ b/ui/l10n/en.js @@ -893,7 +893,6 @@ var dictionary = { "label.host.name":"Host Name", "label.host.tag":"Host Tag", "label.host.tags":"Host Tags", -"label.host.ueficapability":"UEFI Supported", "label.hosts":"Hosts", "label.hourly":"Hourly", "label.hvm":"HVM", @@ -991,8 +990,6 @@ var dictionary = { "label.keep.colon":"Keep:", "label.key":"Key", "label.keyboard.language":"Keyboard language", -"label.vm.boottype":"Boot Type", -"label.vm.bootmode":"Boot Mode", "label.keyboard.type":"Keyboard type", "label.kubernetes.cluster":"Kubernetes cluster", "label.kubernetes.cluster.details":"Kubernetes cluster details", diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js index dc7708de1ad9..e5aefff4e3f9 100644 --- a/ui/scripts/instanceWizard.js +++ b/ui/scripts/instanceWizard.js @@ -1401,18 +1401,6 @@ keyboard : keyboard }); } - var boottype = args.data.customboot; - if (boottype != null && boottype.length > 0) { - $.extend(deployVmData, { - boottype : boottype - }); - } - var bootmode = args.data.bootmode; - if (bootmode != null && bootmode.length > 0) { - $.extend(deployVmData, { - bootmode : bootmode - }); - } if (g_hostid != null) { $.extend(deployVmData, { diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index 58cb86c33814..bb32d3a64df4 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -3322,12 +3322,6 @@ }, id: { label: 'label.id' - }, - boottype: { - label: 'label.vm.boottype' - }, - bootmode: { - label: 'label.vm.bootmode' } }], diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 29f428a4f02b..1e29500e16d1 100755 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -18024,10 +18024,6 @@ }); } }, - ueficapability: { - label:'label.host.ueficapability', - converter: cloudStack.converters.toBooleanText - }, hahost: { label: 'label.ha.enabled', converter: cloudStack.converters.toBooleanText diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js index 4aefa97b335b..2450ed1b4a88 100644 --- a/ui/scripts/ui-custom/instanceWizard.js +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -1392,50 +1392,6 @@ $(this).closest('div.select').hide(); } } - - var uefi = function(bootType){ - var $bootmode = $step.find('select[name=bootmode]'); - - if(bootType.toLowerCase() == 'uefi' ){ - $bootmode.html(''); - var $option = $('