[Vmware to KVM Migration] Preserve boot type and boot mode of instances to be migrated (#10975)

* [Vmware to KVM Migration] Preserve boot type and boot mode of instances to be migrated

* Restore end of line

* Extract lines to new method

* Address review comments
This commit is contained in:
Nicolas Vazquez 2025-07-25 04:00:42 -03:00 committed by GitHub
parent eeb4d55e89
commit a51a04efc2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 0 deletions

View File

@ -1188,6 +1188,8 @@ public class UnmanagedVMsManagerImpl implements UnmanagedVMsManager {
allDetails.put(VmDetailConstants.KVM_VNC_PASSWORD, unmanagedInstance.getVncPassword());
}
addImportingVMBootTypeAndModeDetails(unmanagedInstance.getBootType(), unmanagedInstance.getBootMode(), allDetails);
VirtualMachine.PowerState powerState = VirtualMachine.PowerState.PowerOff;
if (unmanagedInstance.getPowerState().equals(UnmanagedInstanceTO.PowerState.PowerOn)) {
powerState = VirtualMachine.PowerState.PowerOn;
@ -1259,6 +1261,12 @@ public class UnmanagedVMsManagerImpl implements UnmanagedVMsManager {
return userVm;
}
private void addImportingVMBootTypeAndModeDetails(String bootType, String bootMode, Map<String, String> allDetails) {
if (StringUtils.isNotBlank(bootType) && bootType.equalsIgnoreCase("uefi") && StringUtils.isNotBlank(bootMode)) {
allDetails.put("UEFI", bootMode);
}
}
private HashMap<String, UnmanagedInstanceTO> getUnmanagedInstancesForHost(HostVO host, String instanceName, List<String> managedVms) {
HashMap<String, UnmanagedInstanceTO> unmanagedInstances = new HashMap<>();
if (host.isInMaintenanceStates()) {

View File

@ -732,6 +732,18 @@
<span v-else>{{ resource.webhookname || resource.webhookid }}</span>
</div>
</div>
<div class="resource-detail-item" v-if="resource.boottype">
<div class="resource-detail-item__label">{{ $t('label.boottype') }}</div>
<div class="resource-detail-item__details">
<span>{{ resource.boottype }}</span>
</div>
</div>
<div class="resource-detail-item" v-if="resource.bootmode">
<div class="resource-detail-item__label">{{ $t('label.bootmode') }}</div>
<div class="resource-detail-item__details">
<span>{{ resource.bootmode }}</span>
</div>
</div>
<div class="resource-detail-item" v-if="resource.managementserverid">
<div class="resource-detail-item__label">{{ $t('label.management.servers') }}</div>
<div class="resource-detail-item__details">