Skip to content

Commit 3f9dd4d

Browse files
authored
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
1 parent 746bae7 commit 3f9dd4d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,9 @@ private UserVm importVirtualMachineInternal(final UnmanagedInstanceTO unmanagedI
11111111
}
11121112
}
11131113
allDetails.put(VmDetailConstants.ROOT_DISK_CONTROLLER, rootDisk.getController());
1114-
allDetails.put(VmDetailConstants.ROOT_DISK_SIZE, String.valueOf(rootDisk.getCapacity() / Resource.ResourceType.bytesToGiB));
1114+
if (cluster.getHypervisorType() != Hypervisor.HypervisorType.VMware) {
1115+
allDetails.put(VmDetailConstants.ROOT_DISK_SIZE, String.valueOf(rootDisk.getCapacity() / Resource.ResourceType.bytesToGiB));
1116+
}
11151117

11161118
try {
11171119
checkUnmanagedDiskAndOfferingForImport(unmanagedInstance.getName(), rootDisk, null, validatedServiceOffering, owner, zone, cluster, migrateAllowed);

ui/src/views/tools/ImportUnmanagedInstance.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
</a-select-option>
112112
</a-select>
113113
</a-form-item>
114-
<a-form-item name="templateid" ref="templateid" v-if="cluster.hypervisortype === 'KVM' && !selectedVmwareVcenter && !isDiskImport && !isExternalImport">
114+
<a-form-item name="templateid" ref="templateid" v-if="cluster.hypervisortype === 'VMware' || (cluster.hypervisortype === 'KVM' && !selectedVmwareVcenter && !isDiskImport && !isExternalImport)">
115115
<template #label>
116116
<tooltip-label :title="$t('label.templatename')" :tooltip="apiParams.templateid.description + '. ' + $t('message.template.import.vm.temporary')"/>
117117
</template>
@@ -120,7 +120,7 @@
120120
:value="templateType"
121121
@change="changeTemplateType">
122122
<a-row :gutter="12">
123-
<a-col :md="24" :lg="12" v-if="this.cluster.hypervisortype === 'VMWare'">
123+
<a-col :md="24" :lg="12" v-if="this.cluster.hypervisortype === 'VMware'">
124124
<a-radio value="auto">
125125
{{ $t('label.template.temporary.import') }}
126126
</a-radio>
@@ -667,7 +667,7 @@ export default {
667667
nic.broadcasturi = 'pvlan://' + nic.vlanid + '-i' + nic.isolatedpvlan
668668
}
669669
}
670-
if (this.cluster.hypervisortype === 'VMWare') {
670+
if (this.cluster.hypervisortype === 'VMware') {
671671
nic.meta = this.getMeta(nic, { macaddress: 'mac', vlanid: 'vlan', networkname: 'network' })
672672
} else {
673673
nic.meta = this.getMeta(nic, { macaddress: 'mac', vlanid: 'vlan' })
@@ -849,7 +849,7 @@ export default {
849849
this.nicsNetworksMapping = data
850850
},
851851
defaultTemplateType () {
852-
if (this.cluster.hypervisortype === 'VMWare') {
852+
if (this.cluster.hypervisortype === 'VMware') {
853853
return 'auto'
854854
}
855855
return 'custom'

0 commit comments

Comments
 (0)