From 3f9dd4dc07ff40a4e0216014715e4fe37fc46d28 Mon Sep 17 00:00:00 2001 From: Nicolas Vazquez Date: Fri, 5 Jan 2024 04:27:13 -0300 Subject: [PATCH] Fix VMware VM ingestion template selection and default template failure (#8429) This PR fixes the template selection regression for VMware Ingestion in the UI on 4.19.0 RC1 and adds back the default template selection for VMware Fixes: #8428 #8432 --- .../org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java | 4 +++- ui/src/views/tools/ImportUnmanagedInstance.vue | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java b/server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java index b7190f4ff21..789e0bf06aa 100644 --- a/server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java +++ b/server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java @@ -1111,7 +1111,9 @@ public class UnmanagedVMsManagerImpl implements UnmanagedVMsManager { } } allDetails.put(VmDetailConstants.ROOT_DISK_CONTROLLER, rootDisk.getController()); - allDetails.put(VmDetailConstants.ROOT_DISK_SIZE, String.valueOf(rootDisk.getCapacity() / Resource.ResourceType.bytesToGiB)); + if (cluster.getHypervisorType() != Hypervisor.HypervisorType.VMware) { + allDetails.put(VmDetailConstants.ROOT_DISK_SIZE, String.valueOf(rootDisk.getCapacity() / Resource.ResourceType.bytesToGiB)); + } try { checkUnmanagedDiskAndOfferingForImport(unmanagedInstance.getName(), rootDisk, null, validatedServiceOffering, owner, zone, cluster, migrateAllowed); diff --git a/ui/src/views/tools/ImportUnmanagedInstance.vue b/ui/src/views/tools/ImportUnmanagedInstance.vue index 6433e68da57..a03ef3866ec 100644 --- a/ui/src/views/tools/ImportUnmanagedInstance.vue +++ b/ui/src/views/tools/ImportUnmanagedInstance.vue @@ -111,7 +111,7 @@ - + @@ -120,7 +120,7 @@ :value="templateType" @change="changeTemplateType"> - + {{ $t('label.template.temporary.import') }} @@ -667,7 +667,7 @@ export default { nic.broadcasturi = 'pvlan://' + nic.vlanid + '-i' + nic.isolatedpvlan } } - if (this.cluster.hypervisortype === 'VMWare') { + if (this.cluster.hypervisortype === 'VMware') { nic.meta = this.getMeta(nic, { macaddress: 'mac', vlanid: 'vlan', networkname: 'network' }) } else { nic.meta = this.getMeta(nic, { macaddress: 'mac', vlanid: 'vlan' }) @@ -849,7 +849,7 @@ export default { this.nicsNetworksMapping = data }, defaultTemplateType () { - if (this.cluster.hypervisortype === 'VMWare') { + if (this.cluster.hypervisortype === 'VMware') { return 'auto' } return 'custom'