Skip to content
Draft
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 @@ -3028,8 +3028,10 @@ public void createVifs(final VirtualMachineTO vmSpec, final LibvirtVMDef vm) thr
final NicTO[] nics = vmSpec.getNics();
final Map <String, String> params = vmSpec.getDetails();
String nicAdapter = "";
if (params != null && params.get("nicAdapter") != null && !params.get("nicAdapter").isEmpty()) {
nicAdapter = params.get("nicAdapter");
if (params != null && params.get(VmDetailConstants.NIC_ADAPTER) != null && !params.get(VmDetailConstants.NIC_ADAPTER).isEmpty()) {
nicAdapter = params.get(VmDetailConstants.NIC_ADAPTER);
} else if (MapUtils.isNotEmpty(params) && params.containsKey(GuestDef.BootType.UEFI.toString())) {
nicAdapter = "e1000";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason of this change ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to address the issue mentioned in #11212, along with volumes addition of networks is also failing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @harikrishna-patnala

"e1000" has low performance, which user should avoid

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay @weizhouapache do you think "rtl813" is fine ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on the other hand, I'm also thinking if we have to just document these for UEFI VMs instead of setting them during the VM deployment !

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harikrishna-patnala
yeah, documentation may be good. user can choose nic adaptor when deploy a vm.
optionally, we could add the option in the vm deployment wizard on UI, which is not available now.

image

I do no know if "rtl813" is fine.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay @weizhouapache, thanks. how about the root disk controller changes, shall I also document it instead of fixing it here ?

}
Map<String, String> extraConfig = vmSpec.getExtraConfig();
for (int i = 0; i < nics.length; i++) {
Expand Down Expand Up @@ -4383,22 +4385,42 @@ public DiskDef.DiskBus getDataDiskModelFromVMDetail(final VirtualMachineTO vmTO)
private DiskDef.DiskBus getGuestDiskModel(final String platformEmulator, boolean isUefiEnabled) {
if (platformEmulator == null) {
return DiskDef.DiskBus.IDE;
} else if (platformEmulator.startsWith("Other PV Virtio-SCSI")) {
return DiskDef.DiskBus.SCSI;
} else if (platformEmulator.contains("Ubuntu") ||
}

final boolean isLinuxLike = platformEmulator.contains("Ubuntu") ||
StringUtils.startsWithAny(platformEmulator,
"Fedora", "CentOS", "Red Hat Enterprise Linux", "Debian GNU/Linux", "FreeBSD", "Oracle",
"Rocky Linux", "AlmaLinux", "Other PV")) {
return DiskDef.DiskBus.VIRTIO;
} else if (isUefiEnabled && StringUtils.startsWithAny(platformEmulator, "Windows", "Other")) {
return DiskDef.DiskBus.SATA;
} else if (guestCpuArch != null && guestCpuArch.equals("aarch64")) {
"Fedora", "CentOS", "Red Hat Enterprise Linux",
"Debian GNU/Linux", "FreeBSD", "Oracle",
"Rocky Linux", "AlmaLinux", "Other PV");

// Explicit Virtio-SCSI preference
if (platformEmulator.startsWith("Other PV Virtio-SCSI")) {
return DiskDef.DiskBus.SCSI;
}

// Architecture-specific handling
if (guestCpuArch != null && guestCpuArch.equals("aarch64")) {
return DiskDef.DiskBus.SCSI;
} else {
return DiskDef.DiskBus.IDE;
}

// Use SCSI for Linux-based UEFI guests
if (isUefiEnabled && isLinuxLike) {
return DiskDef.DiskBus.SCSI;
}

// Windows/Other and UEFI behavior
if (isUefiEnabled && StringUtils.startsWithAny(platformEmulator, "Windows", "Other")) {
return DiskDef.DiskBus.SATA;
}

// non-UEFI Linux guests
if (isLinuxLike) {
return DiskDef.DiskBus.VIRTIO;
}

return DiskDef.DiskBus.IDE;
}

private void cleanupVMNetworks(final Connect conn, final List<InterfaceDef> nics) {
if (nics != null) {
for (final InterfaceDef nic : nics) {
Expand Down
Loading