Skip to content

Commit 6b5c359

Browse files
nvazquezdhslove
authored andcommitted
[Vmware to KVM Migration] Preserve boot type and boot mode of instances to be migrated (apache#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 6909fb0 commit 6b5c359

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
@@ -1201,6 +1201,8 @@ private UserVm importVirtualMachineInternal(final UnmanagedInstanceTO unmanagedI
12011201
allDetails.put(VmDetailConstants.KVM_VNC_PASSWORD, unmanagedInstance.getVncPassword());
12021202
}
12031203

1204+
addImportingVMBootTypeAndModeDetails(unmanagedInstance.getBootType(), unmanagedInstance.getBootMode(), allDetails);
1205+
12041206
VirtualMachine.PowerState powerState = VirtualMachine.PowerState.PowerOff;
12051207
if (unmanagedInstance.getPowerState().equals(UnmanagedInstanceTO.PowerState.PowerOn)) {
12061208
powerState = VirtualMachine.PowerState.PowerOn;
@@ -1272,6 +1274,12 @@ private UserVm importVirtualMachineInternal(final UnmanagedInstanceTO unmanagedI
12721274
return userVm;
12731275
}
12741276

1277+
private void addImportingVMBootTypeAndModeDetails(String bootType, String bootMode, Map<String, String> allDetails) {
1278+
if (StringUtils.isNotBlank(bootType) && bootType.equalsIgnoreCase("uefi") && StringUtils.isNotBlank(bootMode)) {
1279+
allDetails.put("UEFI", bootMode);
1280+
}
1281+
}
1282+
12751283
private HashMap<String, UnmanagedInstanceTO> getUnmanagedInstancesForHost(HostVO host, String instanceName, List<String> managedVms) {
12761284
HashMap<String, UnmanagedInstanceTO> unmanagedInstances = new HashMap<>();
12771285
if (host.isInMaintenanceStates()) {

ui/src/components/view/InfoCard.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,18 @@
895895
<span v-else>{{ resource.webhookname || resource.webhookid }}</span>
896896
</div>
897897
</div>
898+
<div class="resource-detail-item" v-if="resource.boottype">
899+
<div class="resource-detail-item__label">{{ $t('label.boottype') }}</div>
900+
<div class="resource-detail-item__details">
901+
<span>{{ resource.boottype }}</span>
902+
</div>
903+
</div>
904+
<div class="resource-detail-item" v-if="resource.bootmode">
905+
<div class="resource-detail-item__label">{{ $t('label.bootmode') }}</div>
906+
<div class="resource-detail-item__details">
907+
<span>{{ resource.bootmode }}</span>
908+
</div>
909+
</div>
898910
<div class="resource-detail-item" v-if="resource.managementserverid">
899911
<div class="resource-detail-item__label">{{ $t('label.management.servers') }}</div>
900912
<div class="resource-detail-item__details">

0 commit comments

Comments
 (0)