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 00f705195bb..8b7932652c0 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 @@ -3486,17 +3486,12 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv return DiskDef.DiskBus.IDE; } else if (platformEmulator.startsWith("Other PV Virtio-SCSI")) { return DiskDef.DiskBus.SCSI; - } else if (isUefiEnabled && platformEmulator.startsWith("Windows")) { - return DiskDef.DiskBus.SATA; } else if (platformEmulator.contains("Ubuntu") || - platformEmulator.startsWith("Fedora") || - platformEmulator.startsWith("CentOS") || - platformEmulator.startsWith("Red Hat Enterprise Linux") || - platformEmulator.startsWith("Debian GNU/Linux") || - platformEmulator.startsWith("FreeBSD") || - platformEmulator.startsWith("Oracle") || - platformEmulator.startsWith("Other PV")) { + org.apache.commons.lang3.StringUtils.startsWithAny(platformEmulator, + "Fedora", "CentOS", "Red Hat Enterprise Linux", "Debian GNU/Linux", "FreeBSD", "Oracle", "Other PV")) { return DiskDef.DiskBus.VIRTIO; + } else if (isUefiEnabled && org.apache.commons.lang3.StringUtils.startsWithAny(platformEmulator, "Windows", "Other")) { + return DiskDef.DiskBus.SATA; } else { return DiskDef.DiskBus.IDE; } diff --git a/server/src/main/java/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java b/server/src/main/java/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java index 55faa391df0..5e2959d5235 100644 --- a/server/src/main/java/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java +++ b/server/src/main/java/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java @@ -45,6 +45,13 @@ public class ServiceOfferingJoinDaoImpl extends GenericDaoBase sofIdSearch; + /** + * Constant used to convert GB into Bytes (or the other way around). + * GB * MB * KB = Bytes // + * 1024 * 1024 * 1024 = 1073741824 + */ + private static final long GB_TO_BYTES = 1073741824; + protected ServiceOfferingJoinDaoImpl() { sofIdSearch = createSearchBuilder(); @@ -124,7 +131,8 @@ public class ServiceOfferingJoinDaoImpl extends GenericDaoBase
- {{ parseFloat( resource.rootdisksize / (1024.0 * 1024.0 * 1024.0)).toFixed(1) }} GB + {{ resource.rootdisksize }} GB
diff --git a/ui/src/views/compute/wizard/ComputeOfferingSelection.vue b/ui/src/views/compute/wizard/ComputeOfferingSelection.vue index 117a7c062cd..f1a6128872e 100644 --- a/ui/src/views/compute/wizard/ComputeOfferingSelection.vue +++ b/ui/src/views/compute/wizard/ComputeOfferingSelection.vue @@ -21,8 +21,7 @@ style="width: 25vw;float: right;margin-bottom: 10px; z-index: 8" :placeholder="$t('label.search')" v-model="filter" - @search="handleSearch" - autoFocus /> + @search="handleSearch" /> +