Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MGMT-16273: Allow installing on iSCSI disks on OCI #5728

Merged
merged 1 commit into from Nov 28, 2023

Conversation

avishayt
Copy link
Contributor

@avishayt avishayt commented Nov 22, 2023

Allow booting from iSCSI for x86_64 OpenShift versions at least 4.15.0 on the OCI platform.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 22, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 22, 2023

@avishayt: This pull request references MGMT-16273 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

In response to this:

Assisted Service should allow booting from iSCSI for x86_64 OpenShift versions at least 4.15.0.
Multipath is not supported at this time.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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/test-infra repository.

@avishayt
Copy link
Contributor Author

/hold WIP

@openshift-ci openshift-ci bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 22, 2023
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 22, 2023
Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Merging #5728 (200b930) into master (86e56d9) will increase coverage by 0.09%.
Report is 3 commits behind head on master.
The diff coverage is 91.30%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5728      +/-   ##
==========================================
+ Coverage   67.93%   68.02%   +0.09%     
==========================================
  Files         233      233              
  Lines       34391    34338      -53     
==========================================
- Hits        23362    23357       -5     
+ Misses       8954     8915      -39     
+ Partials     2075     2066       -9     
Files Coverage Δ
internal/host/hostcommands/install_cmd.go 83.91% <100.00%> (+0.21%) ⬆️
internal/host/validator.go 81.95% <100.00%> (ø)
internal/hardware/validator.go 76.73% <88.23%> (+0.23%) ⬆️

... and 17 files with indirect coverage changes

@openshift-ci openshift-ci bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 23, 2023
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 23, 2023
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 23, 2023
if disk.DriveType == models.DriveTypeMultipath {
installerArgs = append(installerArgs, "--append-karg", "root=/dev/disk/by-label/dm-mpath-root", "--append-karg", "rw", "--append-karg", "rd.multipath=default")
} else if disk.DriveType == models.DriveTypeISCSI {
installerArgs = append(installerArgs, "--append-karg", "rd.iscsi.firmware=1")
Copy link
Member

Choose a reason for hiding this comment

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

Since this PR looks like it's adding generic support for iSCSI on bare metal, I will mention here that auto-configuration via iBFT (used by rd.iscsi.firmware) is not always a given. The other way iSCSI configuration is provided is via netroot=iscsi:... (see dracut.cmdline(7)).

If we want to provide a nice UX for it, we could provide separate fields for e.g. server name, target name, initiator name, etc... and assemble the netroot karg ourselves. This is similar to what blivet (Anaconda storage backend) does: https://github.com/storaged-project/blivet/blob/57f1382f19a1390dd2176e4f4772bab89380cfdf/blivet/devices/disk.py#L379-L394.

Alternatively, if the UX allows users to provide custom kargs, then we could skip this for now and users can always directly provide the netroot karg themselves as an escape hatch (and having rd.iscsi.firmware=1 still hardcoded shouldn't hurt, though this code could also auto-detect if one of the custom kargs is netroot and skip it I guess).

Copy link
Contributor

Choose a reason for hiding this comment

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

Users can provides custom kargs to the installer though the API (https://github.com/openshift/assisted-service/blob/master/docs/user-guide/install-customization.md#set-the-installer-params). Maybe we can add a word about customizing iSCSI settings in our doc in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is a good point about generic support. I'll make this PR focused on OCI. We can explore generic support in the future if there is demand for it.

@adriengentil
Copy link
Contributor

/test edge-e2e-oci-assisted
The issue should be fixed by now

@adriengentil
Copy link
Contributor

/test edge-e2e-metal-assisted edge-e2e-oci-assisted

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 25, 2023
@openshift-ci openshift-ci bot removed lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 26, 2023
@avishayt avishayt changed the title MGMT-16273: Allow installing on iSCSI disks MGMT-16273: Allow installing on iSCSI disks on OCI Nov 26, 2023
@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 26, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 26, 2023

@avishayt: This pull request references MGMT-16273 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

In response to this:

Allow booting from iSCSI for x86_64 OpenShift versions at least 4.15.0 on the OCI platform.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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/test-infra repository.

@openshift-ci openshift-ci bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 26, 2023
Allow booting from iSCSI for x86_64 OpenShift versions at least 4.15.0
on the OCI platform.
Copy link
Contributor

@adriengentil adriengentil left a comment

Choose a reason for hiding this comment

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

Just one nit, otherwise it looks good

@@ -147,8 +157,8 @@ func (v *validator) DiskIsEligible(ctx context.Context, disk *models.Disk, infra
return notEligibleReasons, nil
}

func (v *validator) IsValidStorageDeviceType(disk *models.Disk, hostArchitecture string) bool {
return funk.ContainsString(v.getValidDeviceStorageTypes(hostArchitecture), string(disk.DriveType))
func (v *validator) IsValidStorageDeviceType(disk *models.Disk, hostArchitecture string, openshiftVersion string, ociPlatformType bool) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
func (v *validator) IsValidStorageDeviceType(disk *models.Disk, hostArchitecture string, openshiftVersion string, ociPlatformType bool) bool {
func (v *validator) IsValidStorageDeviceType(disk *models.Disk, hostArchitecture string, openshiftVersion string, isISCSIEnabled bool) bool {

nit: Even though this change is specific to oci, I would prefer to make the intention of this parameter clearer for this function and in getValidDeviceStorageTypes. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's OK for now. The next big change to this code will probably be when iSCSI support will be generic, and this parameter will be removed.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 27, 2023
Copy link

openshift-ci bot commented Nov 27, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adriengentil, avishayt

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [adriengentil,avishayt]

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

@avishayt
Copy link
Contributor Author

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 27, 2023
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 25d0ae7 and 2 for PR HEAD 200b930 in total

@avishayt
Copy link
Contributor Author

/test edge-e2e-metal-assisted

1 similar comment
@avishayt
Copy link
Contributor Author

/test edge-e2e-metal-assisted

Copy link

openshift-ci bot commented Nov 28, 2023

@avishayt: all tests passed!

Full PR test history. Your PR dashboard.

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/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit c6ba398 into openshift:master Nov 28, 2023
14 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-agent-installer-api-server-container-v4.15.0-202311280949.p0.gc6ba398.assembly.stream for distgit ose-agent-installer-api-server.
All builds following this will include this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants