mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
kvm: Fix of some UEFI related issues (#5072)
* Fix of some UEFI related issues 1 - fix of attach/detach ISO of VM with UEFI boot type 2 - if OS type of an ISO is categorized as "Other" the bus type of the disk will be set to "sata" * Simplify the validation of OS types
This commit is contained in:
parent
1afcd823e0
commit
b0f2112dc2
@ -3448,17 +3448,12 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
return DiskDef.DiskBus.IDE;
|
||||
} else if (platformEmulator.startsWith("Other PV Virtio-SCSI")) {
|
||||
return DiskDef.DiskBus.SCSI;
|
||||
} else if (isUefiEnabled && platformEmulator.startsWith("Windows")) {
|
||||
return DiskDef.DiskBus.SATA;
|
||||
} else if (platformEmulator.contains("Ubuntu") ||
|
||||
platformEmulator.startsWith("Fedora") ||
|
||||
platformEmulator.startsWith("CentOS") ||
|
||||
platformEmulator.startsWith("Red Hat Enterprise Linux") ||
|
||||
platformEmulator.startsWith("Debian GNU/Linux") ||
|
||||
platformEmulator.startsWith("FreeBSD") ||
|
||||
platformEmulator.startsWith("Oracle") ||
|
||||
platformEmulator.startsWith("Other PV")) {
|
||||
org.apache.commons.lang3.StringUtils.startsWithAny(platformEmulator,
|
||||
"Fedora", "CentOS", "Red Hat Enterprise Linux", "Debian GNU/Linux", "FreeBSD", "Oracle", "Other PV")) {
|
||||
return DiskDef.DiskBus.VIRTIO;
|
||||
} else if (isUefiEnabled && org.apache.commons.lang3.StringUtils.startsWithAny(platformEmulator, "Windows", "Other")) {
|
||||
return DiskDef.DiskBus.SATA;
|
||||
} else {
|
||||
return DiskDef.DiskBus.IDE;
|
||||
}
|
||||
|
||||
@ -1302,10 +1302,10 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
|
||||
|
||||
Command cmd = null;
|
||||
if (attach) {
|
||||
cmd = new AttachCommand(disk, vmName);
|
||||
cmd = new AttachCommand(disk, vmName, vmTO.getDetails());
|
||||
((AttachCommand)cmd).setForced(forced);
|
||||
} else {
|
||||
cmd = new DettachCommand(disk, vmName);
|
||||
cmd = new DettachCommand(disk, vmName, vmTO.getDetails());
|
||||
((DettachCommand)cmd).setForced(forced);
|
||||
}
|
||||
Answer a = _agentMgr.easySend(vm.getHostId(), cmd);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user