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
This commit is contained in:
Nicolas Vazquez 2024-01-05 04:27:13 -03:00 committed by GitHub
parent 746bae740e
commit 3f9dd4dc07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -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);

View File

@ -111,7 +111,7 @@
</a-select-option>
</a-select>
</a-form-item>
<a-form-item name="templateid" ref="templateid" v-if="cluster.hypervisortype === 'KVM' && !selectedVmwareVcenter && !isDiskImport && !isExternalImport">
<a-form-item name="templateid" ref="templateid" v-if="cluster.hypervisortype === 'VMware' || (cluster.hypervisortype === 'KVM' && !selectedVmwareVcenter && !isDiskImport && !isExternalImport)">
<template #label>
<tooltip-label :title="$t('label.templatename')" :tooltip="apiParams.templateid.description + '. ' + $t('message.template.import.vm.temporary')"/>
</template>
@ -120,7 +120,7 @@
:value="templateType"
@change="changeTemplateType">
<a-row :gutter="12">
<a-col :md="24" :lg="12" v-if="this.cluster.hypervisortype === 'VMWare'">
<a-col :md="24" :lg="12" v-if="this.cluster.hypervisortype === 'VMware'">
<a-radio value="auto">
{{ $t('label.template.temporary.import') }}
</a-radio>
@ -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'