@@ -460,6 +460,7 @@ import MultiNetworkSelection from '@views/compute/wizard/MultiNetworkSelection'
460460import OsLogo from ' @/components/widgets/OsLogo'
461461import ResourceIcon from ' @/components/view/ResourceIcon'
462462import CheckBoxSelectPair from ' @/components/CheckBoxSelectPair'
463+ import { formatKvmConversionHostName } from ' @/utils/vmware'
463464
464465export default {
465466 name: ' ImportUnmanagedInstances' ,
@@ -1111,47 +1112,13 @@ export default {
11111112 this .kvmHostsForConversion = this .kvmHostsForConversion .filter (host => [' Enabled' , ' Disabled' ].includes (host .resourcestate ))
11121113 // Check if any host has VDDK support
11131114 let hasVddkSupport = false
1114- this .kvmHostsForConversion .map (host => {
1115- host .name = host .name + ' [Pod=' + host .podname + ' ] [Cluster=' + host .clustername + ' ]'
1116- if (host .instanceconversionsupported !== null && host .instanceconversionsupported !== undefined && host .instanceconversionsupported ) {
1117- host .name = host .name + ' (' + this .$t (' label.supported' ) + ' )'
1118- } else {
1119- host .name = host .name + ' (' + this .$t (' label.not.supported' ) + ' )'
1120- }
1121- if (host .details [' host.virtv2v.version' ]) {
1122- host .name = host .name + ' (virt-v2v=' + host .details [' host.virtv2v.version' ] + ' )'
1123- }
1124- if (host .details [' host.ovftool.version' ]) {
1125- host .name = host .name + ' (ovftool=' + host .details [' host.ovftool.version' ] + ' )'
1126- }
1115+ this .kvmHostsForConversion .forEach (host => {
1116+ const details = host .details || {}
11271117 // Check for VDDK support
1128- if (host . details [' host.vddk.support' ] === ' true' || host . details [' host.vddk.support' ] === true ) {
1118+ if (details[' host.vddk.support' ] === ' true' || details[' host.vddk.support' ] === true ) {
11291119 hasVddkSupport = true
11301120 }
1131-
1132- if (this .form .usevddk ) {
1133- if (host .details [' host.vddk.support' ] === ' true' || host .details [' host.vddk.support' ] === true ) {
1134- host .name = host .name + ' (VDDK=' + this .$t (' label.supported' ) + ' )'
1135- } else {
1136- host .name = host .name + ' (VDDK=' + this .$t (' label.not.supported' ) + ' )'
1137- }
1138- if (host .details [' host.vddk.version' ]) {
1139- host .name = host .name + ' (vddk=' + host .details [' host.vddk.version' ] + ' )'
1140- }
1141- }
1142- if (this .form .vmwaremigrationmode === ' cbt' ) {
1143- if (host .details [' host.vddk.blockcopy.support' ] === ' true' || host .details [' host.vddk.blockcopy.support' ] === true ) {
1144- host .name = host .name + ' (' + this .$t (' label.host.vmware.cbt.data.copy.support' ) + ' =' + this .$t (' label.supported' ) + ' )'
1145- } else {
1146- host .name = host .name + ' (' + this .$t (' label.host.vmware.cbt.data.copy.support' ) + ' =' + this .$t (' label.not.supported' ) + ' )'
1147- }
1148- if (host .details [' host.qemu.img.version' ]) {
1149- host .name = host .name + ' (qemu-img=' + host .details [' host.qemu.img.version' ] + ' )'
1150- }
1151- if (host .details [' host.qemu.nbd.version' ]) {
1152- host .name = host .name + ' (qemu-nbd=' + host .details [' host.qemu.nbd.version' ] + ' )'
1153- }
1154- }
1121+ host .name = this .formatKvmConversionHostName (host)
11551122 })
11561123
11571124 // Enable usevddk by default if at least one host has VDDK support
@@ -1161,6 +1128,13 @@ export default {
11611128 }
11621129 })
11631130 },
1131+ formatKvmConversionHostName (host ) {
1132+ return formatKvmConversionHostName (
1133+ host,
1134+ this .form .vmwaremigrationmode ,
1135+ this .$t (' label.yes' ),
1136+ this .$t (' label.no' ))
1137+ },
11641138 fetchKvmHostsForImporting () {
11651139 getAPI (' listHosts' , {
11661140 clusterid: this .cluster .id ,
0 commit comments