From 1afcd823e004a744b8a613b99a2cf26051decb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Beims=20Br=C3=A4scher?= Date: Wed, 9 Jun 2021 02:44:18 -0300 Subject: [PATCH 1/5] server: Root disk size should be listed in GB at listServiceOffering (#5085) * Root disk size should be listed in GB at listServiceOffering * Update UI to handle rootdisk size in GB instead of Bytes --- .../api/query/dao/ServiceOfferingJoinDaoImpl.java | 10 +++++++++- ui/src/components/view/DetailsTab.vue | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) 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 87b03748dbc..9950b90a2f2 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(); @@ -123,7 +130,8 @@ public class ServiceOfferingJoinDaoImpl extends GenericDaoBase
- {{ parseFloat( resource.rootdisksize / (1024.0 * 1024.0 * 1024.0)).toFixed(1) }} GB + {{ resource.rootdisksize }} GB
From b0f2112dc2b0d1ced917924f60900d3c17574ca2 Mon Sep 17 00:00:00 2001 From: slavkap <51903378+slavkap@users.noreply.github.com> Date: Wed, 9 Jun 2021 08:45:07 +0300 Subject: [PATCH 2/5] kvm: Fix of some UEFI related issues (#5072) * Fix of some UEFI related issues 1 - fix of attach/detach ISO of VM with UEFI boot type 2 - if OS type of an ISO is categorized as "Other" the bus type of the disk will be set to "sata" * Simplify the validation of OS types --- .../kvm/resource/LibvirtComputingResource.java | 13 ++++--------- .../com/cloud/template/TemplateManagerImpl.java | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) 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 82dd51f5963..a7d5ee35ac1 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 @@ -3448,17 +3448,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/template/TemplateManagerImpl.java b/server/src/main/java/com/cloud/template/TemplateManagerImpl.java index 956c456c2ff..3ca0807e622 100755 --- a/server/src/main/java/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/main/java/com/cloud/template/TemplateManagerImpl.java @@ -1302,10 +1302,10 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager, Command cmd = null; if (attach) { - cmd = new AttachCommand(disk, vmName); + cmd = new AttachCommand(disk, vmName, vmTO.getDetails()); ((AttachCommand)cmd).setForced(forced); } else { - cmd = new DettachCommand(disk, vmName); + cmd = new DettachCommand(disk, vmName, vmTO.getDetails()); ((DettachCommand)cmd).setForced(forced); } Answer a = _agentMgr.easySend(vm.getHostId(), cmd); From da382993c37019852390fe7b51c36df7492a76ca Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Wed, 9 Jun 2021 12:10:01 +0530 Subject: [PATCH 3/5] ui: fix focus in deployvm form (#5089) Fixes #5087 Signed-off-by: Abhishek Kumar --- ui/src/views/compute/wizard/ComputeOfferingSelection.vue | 3 +-- ui/src/views/compute/wizard/NetworkConfiguration.vue | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) 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" /> +