Skip to content
Closed
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 number Diff line number Diff line change
Expand Up @@ -281,10 +281,8 @@ public Map<String, String> getDetails() {
}
}
}
if(getBootType() != null){ // export to get
if(getBootType() == ApiConstants.BootType.UEFI) {
customparameterMap.put(getBootType().toString(), getBootMode().toString());
}
if (ApiConstants.BootType.UEFI.equals(getBootType())) {
customparameterMap.put(getBootType().toString(), getBootMode().toString());
}

if (rootdisksize != null && !customparameterMap.containsKey("rootdisksize")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,14 +503,13 @@ public void setDetails(Map details) {
detailsCopy.remove("username");
detailsCopy.remove("password");

if(detailsCopy.containsKey(Host.HOST_UEFI_ENABLE)) {
if (detailsCopy.containsKey(Host.HOST_UEFI_ENABLE)) {
this.setUefiCapabilty(Boolean.parseBoolean((String) detailsCopy.get(Host.HOST_UEFI_ENABLE)));
detailsCopy.remove(Host.HOST_UEFI_ENABLE);
} else {
this.setUefiCapabilty(new Boolean(false)); // in case of existing host which is not scanned for UEFI capability
}


this.details = detailsCopy;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1064,10 +1064,7 @@ public void orchestrateStart(final String vmUuid, final Map<VirtualMachineProfil
}

final VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm, template, offering, owner, params);
s_logger.info(" Uefi params " + "UefiFlag: " + params.get(VirtualMachineProfile.Param.UefiFlag)
+ " Boot Type: " + params.get(VirtualMachineProfile.Param.BootType)
+ " Boot Mode: " + params.get(VirtualMachineProfile.Param.BootMode)
);
logUefiParameters(params);
DeployDestination dest = null;
try {
dest = _dpMgr.planDeployment(vmProfile, plan, avoids, planner);
Expand Down Expand Up @@ -1315,6 +1312,29 @@ public void orchestrateStart(final String vmUuid, final Map<VirtualMachineProfil
}
}

private void logUefiParameters(Map<VirtualMachineProfile.Param, Object> params) {
if (params == null) {
return;
}
StringBuffer msgBuf = new StringBuffer("Uefi params ");
boolean log = false;
if (params.get(VirtualMachineProfile.Param.UefiFlag) != null) {
msgBuf.append(String.format("UefiFlag: %s ", params.get(VirtualMachineProfile.Param.UefiFlag)));
log = true;
}
if (params.get(VirtualMachineProfile.Param.BootType) != null) {
msgBuf.append(String.format("Boot Type: %s ", params.get(VirtualMachineProfile.Param.BootType)));
log = true;
}
if (params.get(VirtualMachineProfile.Param.BootMode) != null) {
msgBuf.append(String.format("Boot Mode: %s ", params.get(VirtualMachineProfile.Param.BootMode)));
log = true;
}
if (log) {
s_logger.info(msgBuf.toString());
}
}

// Add extra config data to the vmTO as a Map
private void addExtraConfig(VirtualMachineTO vmTO) {
Map<String, String> details = vmTO.getDetails();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) {
}
}

details.put(VmDetailConstants.BOOT_MODE, to.getBootType());
details.put(VmDetailConstants.BOOT_MODE, to.getBootMode());
// there should also be
// details.put(VmDetailConstants.BOOT_TYPE, to.getBootType());
String diskDeviceType = details.get(VmDetailConstants.ROOT_DISK_CONTROLLER);
if (userVm) {
if (diskDeviceType == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1724,10 +1724,13 @@ 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 = null;
if (vmSpec.getDetails().containsKey(VmDetailConstants.BOOT_MODE)) {
bootMode = vmSpec.getDetails().get(VmDetailConstants.BOOT_MODE);
}
if(null == bootMode) {
bootMode = ApiConstants.BootType.BIOS.toString();
}

// If root disk controller is scsi, then data disk controller would also be scsi instead of using 'osdefault'
// This helps avoid mix of different scsi subtype controllers in instance.
Expand Down