Skip to content

Commit a51a04e

Browse files
authored
[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
1 parent eeb4d55 commit a51a04e

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,8 @@ private UserVm importVirtualMachineInternal(final UnmanagedInstanceTO unmanagedI
11881188
allDetails.put(VmDetailConstants.KVM_VNC_PASSWORD, unmanagedInstance.getVncPassword());
11891189
}
11901190

1191+
addImportingVMBootTypeAndModeDetails(unmanagedInstance.getBootType(), unmanagedInstance.getBootMode(), allDetails);
1192+
11911193
VirtualMachine.PowerState powerState = VirtualMachine.PowerState.PowerOff;
11921194
if (unmanagedInstance.getPowerState().equals(UnmanagedInstanceTO.PowerState.PowerOn)) {
11931195
powerState = VirtualMachine.PowerState.PowerOn;
@@ -1259,6 +1261,12 @@ private UserVm importVirtualMachineInternal(final UnmanagedInstanceTO unmanagedI
12591261
return userVm;
12601262
}
12611263

1264+
private void addImportingVMBootTypeAndModeDetails(String bootType, String bootMode, Map<String, String> allDetails) {
1265+
if (StringUtils.isNotBlank(bootType) && bootType.equalsIgnoreCase("uefi") && StringUtils.isNotBlank(bootMode)) {
1266+
allDetails.put("UEFI", bootMode);
1267+
}
1268+
}
1269+
12621270
private HashMap<String, UnmanagedInstanceTO> getUnmanagedInstancesForHost(HostVO host, String instanceName, List<String> managedVms) {
12631271
HashMap<String, UnmanagedInstanceTO> unmanagedInstances = new HashMap<>();
12641272
if (host.isInMaintenanceStates()) {

ui/src/components/view/InfoCard.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,18 @@
732732
<span v-else>{{ resource.webhookname || resource.webhookid }}</span>
733733
</div>
734734
</div>
735+
<div class="resource-detail-item" v-if="resource.boottype">
736+
<div class="resource-detail-item__label">{{ $t('label.boottype') }}</div>
737+
<div class="resource-detail-item__details">
738+
<span>{{ resource.boottype }}</span>
739+
</div>
740+
</div>
741+
<div class="resource-detail-item" v-if="resource.bootmode">
742+
<div class="resource-detail-item__label">{{ $t('label.bootmode') }}</div>
743+
<div class="resource-detail-item__details">
744+
<span>{{ resource.bootmode }}</span>
745+
</div>
746+
</div>
735747
<div class="resource-detail-item" v-if="resource.managementserverid">
736748
<div class="resource-detail-item__label">{{ $t('label.management.servers') }}</div>
737749
<div class="resource-detail-item__details">

0 commit comments

Comments
 (0)