Skip to content

OCPBUGS-78935: Fix bootstrap VM on non-x86 platforms#10419

Open
zaneb wants to merge 1 commit intoopenshift:mainfrom
zaneb:bootstrap-vm-cdrom-bus
Open

OCPBUGS-78935: Fix bootstrap VM on non-x86 platforms#10419
zaneb wants to merge 1 commit intoopenshift:mainfrom
zaneb:bootstrap-vm-cdrom-bus

Conversation

@zaneb
Copy link
Member

@zaneb zaneb commented Mar 22, 2026

On x86 the bus type for cdrom devices must be explicitly set to sata, because the default ide is outdated (and not even supported on q35 machines). However, on other platforms, this is not supported and we must use scsi as the bus type.

This is consistent with the settings for cdrom devices used by virt-manager and OpenStack Nova.

On x86 the bus type for cdrom devices must be explicitly set to 'sata',
because the default 'ide' is outdated (and not even supported on q35
machines). However, on other platforms, this is not supported and we
must use 'scsi' as the bus type.

This is consistent with the settings for cdrom devices used by
virt-manager and OpenStack Nova.
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 22, 2026
@openshift-ci-robot
Copy link
Contributor

@zaneb: This pull request references Jira Issue OCPBUGS-78935, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

On x86 the bus type for cdrom devices must be explicitly set to sata, because the default ide is outdated (and not even supported on q35 machines). However, on other platforms, this is not supported and we must use scsi as the bus type.

This is consistent with the settings for cdrom devices used by virt-manager and OpenStack Nova.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link

coderabbitai bot commented Mar 22, 2026

Walkthrough

Modified libvirt domain bootstrap configuration to add a SCSI controller and adjust device bus assignments based on CPU architecture, defaulting live CD-ROM disks to SCSI except on x86_64 systems where SATA is retained.

Changes

Cohort / File(s) Summary
Libvirt Bootstrap Configuration
pkg/infrastructure/baremetal/bootstrap.go
Added SCSI controller (virtio-scsi model) to domain devices; changed live CD-ROM disk bus default from "sata" to "scsi"; introduced architecture-specific override to restore "sata" bus for x86_64 systems.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.3)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.

Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present.

@openshift-ci openshift-ci bot requested review from honza and iurygregory March 22, 2026 23:39
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 22, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign honza for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zaneb
Copy link
Member Author

zaneb commented Mar 22, 2026

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 22, 2026
@openshift-ci-robot
Copy link
Contributor

@zaneb: This pull request references Jira Issue OCPBUGS-78935, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
pkg/infrastructure/baremetal/bootstrap.go (1)

51-56: Scope the SCSI controller to the non-x86 path.

The x86_64 branch below keeps the CD-ROM on sata, so adding virtio-scsi here still changes the x86 device topology for no functional gain. Appending this controller only when the selected CD-ROM bus is scsi keeps the x86 XML closer to today’s behavior and avoids the controller/bus selection drifting apart later.

Possible cleanup
 func newDomain(name string) libvirtxml.Domain {
 	domainDef := libvirtxml.Domain{
 		...
 		Devices: &libvirtxml.DomainDeviceList{
 			...
-			Controllers: []libvirtxml.DomainController{
-				{
-					Type:  "scsi",
-					Model: "virtio-scsi",
-				},
-			},
 		},
 		...
 	}
 	if arch == "x86_64" {
 		// x86 traditionally uses IDE or SATA (only the latter is supported
 		// with the q35 machine type) for cdrom devices
 		liveCD.Target.Bus = "sata"
+	} else {
+		bootstrapDom.Devices.Controllers = append(bootstrapDom.Devices.Controllers, libvirtxml.DomainController{
+			Type:  "scsi",
+			Model: "virtio-scsi",
+		})
 	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/infrastructure/baremetal/bootstrap.go` around lines 51 - 56, The code
unconditionally appends a libvirtxml.DomainController with Type "scsi" / Model
"virtio-scsi" in the Controllers slice, which alters x86_64 guest topology;
change this so the controller is only added when the chosen CD-ROM bus is "scsi"
(i.e., scope the append to the non‑x86 path or to the path where cdromBus ==
"scsi"). Locate where Controllers is populated (the Controllers:
[]libvirtxml.DomainController {...} block) and wrap or gate the append/entry so
it only runs when the CD-ROM bus selection equals "scsi" (or when arch !=
"x86_64" if your code uses that branch), ensuring x86 XML remains unchanged
otherwise.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/infrastructure/baremetal/bootstrap.go`:
- Around line 51-56: The code unconditionally appends a
libvirtxml.DomainController with Type "scsi" / Model "virtio-scsi" in the
Controllers slice, which alters x86_64 guest topology; change this so the
controller is only added when the chosen CD-ROM bus is "scsi" (i.e., scope the
append to the non‑x86 path or to the path where cdromBus == "scsi"). Locate
where Controllers is populated (the Controllers: []libvirtxml.DomainController
{...} block) and wrap or gate the append/entry so it only runs when the CD-ROM
bus selection equals "scsi" (or when arch != "x86_64" if your code uses that
branch), ensuring x86 XML remains unchanged otherwise.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: af0e20fc-666a-4f7f-998d-e6d445631a9d

📥 Commits

Reviewing files that changed from the base of the PR and between f60f85a and 45dc970.

📒 Files selected for processing (1)
  • pkg/infrastructure/baremetal/bootstrap.go

@sgoveas
Copy link

sgoveas commented Mar 23, 2026

/retest
/verified later @sgoveas

@openshift-ci-robot openshift-ci-robot added verified-later verified Signifies that the PR passed pre-merge verification criteria labels Mar 23, 2026
@openshift-ci-robot
Copy link
Contributor

@sgoveas: This PR has been marked to be verified later by @sgoveas.

Details

In response to this:

/retest
/verified later @sgoveas

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 23, 2026

@zaneb: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-metal-ovn-two-node-fencing 45dc970 link false /test e2e-metal-ovn-two-node-fencing
ci/prow/e2e-metal-ipi-ovn-dualstack 45dc970 link false /test e2e-metal-ipi-ovn-dualstack

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. verified Signifies that the PR passed pre-merge verification criteria verified-later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants