Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -294,7 +294,7 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) {
}
}

details.put(VmDetailConstants.BOOT_MODE, to.getBootType());
details.put(VmDetailConstants.BOOT_MODE, to.getBootMode());
String diskDeviceType = details.get(VmDetailConstants.ROOT_DISK_CONTROLLER);
if (userVm) {
if (diskDeviceType == null) {
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -1724,7 +1724,7 @@ protected StartAnswer execute(StartCommand cmd) {
String dataDiskController = vmSpec.getDetails().get(VmDetailConstants.DATA_DISK_CONTROLLER);
String rootDiskController = vmSpec.getDetails().get(VmDetailConstants.ROOT_DISK_CONTROLLER);
DiskTO rootDiskTO = null;
String bootMode = ApiConstants.BootType.BIOS.toString();
String bootMode = "bios";
if (vmSpec.getDetails().containsKey(VmDetailConstants.BOOT_MODE)) {
bootMode = vmSpec.getDetails().get(VmDetailConstants.BOOT_MODE);
}
Expand DownExpand Up@@ -2286,7 +2286,7 @@ protected StartAnswer execute(StartCommand cmd) {
}
}

if (!bootMode.equalsIgnoreCase(ApiConstants.BootType.BIOS.toString())) {
if (StringUtils.isNotBlank(bootMode) && !bootMode.equalsIgnoreCase("bios")) {
vmConfigSpec.setFirmware("efi");
if (vmSpec.getDetails().containsKey(ApiConstants.BootType.UEFI.toString()) && "secure".equalsIgnoreCase(vmSpec.getDetails().get(ApiConstants.BootType.UEFI.toString()))) {
VirtualMachineBootOptions bootOptions = new VirtualMachineBootOptions();
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,6 +26,7 @@
import org.apache.cloudstack.backup.Backup;
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.log4j.Logger;

import com.cloud.agent.api.Command;
Expand DownExpand Up@@ -172,9 +173,19 @@ protected VirtualMachineTO toVirtualMachineTO(VirtualMachineProfile vmProfile) {
offering.getRamSize() * 1024l * 1024l, null, null, vm.isHaEnabled(), vm.limitCpuUse(), vm.getVncPassword());
to.setBootArgs(vmProfile.getBootArgs());

String bootType = (String)vmProfile.getParameter(new VirtualMachineProfile.Param("BootType"));
if (StringUtils.isNotBlank(bootType)) {
to.setBootType(bootType);
Map<VirtualMachineProfile.Param, Object> map = vmProfile.getParameters();
if (MapUtils.isNotEmpty(map)) {
if (map.containsKey(VirtualMachineProfile.Param.BootMode)) {
if (StringUtils.isNotBlank((String) map.get(VirtualMachineProfile.Param.BootMode))) {
to.setBootMode((String) map.get(VirtualMachineProfile.Param.BootMode));
}
}

if (map.containsKey(VirtualMachineProfile.Param.BootType)) {
if (StringUtils.isNotBlank((String) map.get(VirtualMachineProfile.Param.BootType))) {
to.setBootType((String) map.get(VirtualMachineProfile.Param.BootType));
}
}
}

List<NicProfile> nicProfiles = vmProfile.getNics();
Expand Down