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-15271: Add the boot command line to the host inventory #5649

Merged

Conversation

AmadeusPodvratnik
Copy link
Contributor

With the support of zVM in Assisted Installer, the necessary kernel arguments to boot a zVM nodes need to be considered. During the first boot of a zVM node a parm file will be provided to activate the necessary devices or specify a static IP w/o nmstate. This parm file looks like:

rd.neednet=1 console=ttysclp0 coreos.live.rootfs_url=http://172.23.236.156:8080/assisted-installer/rootfs.img ip=10.14.6.3::10.14.6.1:255.255.255.0:master-0.boea3e06.lnxero1.boe:encbdd0:none nameserver=10.14.6.1 ip=[fd00::3]::[fd00::1]:64::encbdd0:none nameserver=[fd00::1] zfcp.allow_lun_scan=0 rd.znet=qeth,0.0.bdd0,0.0.bdd1,0.0.bdd2,layer2=1 rd.dasd=0.0.5235 rd.dasd=0.0.5236 random.trust_cpu=on rd.luks.options=discard ignition.firstboot ignition.platform.id=metal console=tty1 console=ttyS1,115200n8

These arguments need to be passed to the coreos installer otherwise the first reboot will end in an emergency shell.
This PR is the first PR of at least three PRs to provide support of automatically discovering the kernel arguments and pass them to the coreos installer.
The RestAPI provide a possibility to set the necessary kernel arguments:

curl https://api.openshift.com/api/assisted-install/v2/infra-envs/${INFRA_ENV_ID}/hosts/$1/installer-args
-X PATCH
-H "Authorization: Bearer ${API_TOKEN}"
-H "Content-Type: application/json"
-d '
{
"args": [
"--append-karg", "rd.neednet=1",
"--append-karg", "ip=10.14.6.3::10.14.6.1:255.255.255.0:master-0.boea3e06.lnxero1.boe:encbdd0:none",
"--append-karg", "nameserver=10.14.6.1",
"--append-karg", "ip=[fd00::3]::[fd00::1]:64::encbdd0:none",
"--append-karg", "nameserver=[fd00::1]",
"--append-karg", "zfcp.allow_lun_scan=0",
"--append-karg", "rd.znet=qeth,0.0.bdd0,0.0.bdd1,0.0.bdd2,layer2=1",
"--append-karg", "rd.dasd=0.0.5235",
"--append-karg", "rd.dasd=0.0.5236"
]
}
' | jq

but this would break the WebUI flow (bad user experience if an additional step is needed to install a cluster).

List all the issues related to this PR

  • [x ] 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
  • [x ] 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 Oct 31, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 31, 2023

@AmadeusPodvratnik: This pull request references MGMT-15271 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 bug to target the "4.15.0" version, but no target version was set.

In response to this:

With the support of zVM in Assisted Installer, the necessary kernel arguments to boot a zVM nodes need to be considered. During the first boot of a zVM node a parm file will be provided to activate the necessary devices or specify a static IP w/o nmstate. This parm file looks like:

rd.neednet=1 console=ttysclp0 coreos.live.rootfs_url=http://172.23.236.156:8080/assisted-installer/rootfs.img ip=10.14.6.3::10.14.6.1:255.255.255.0:master-0.boea3e06.lnxero1.boe:encbdd0:none nameserver=10.14.6.1 ip=[fd00::3]::[fd00::1]:64::encbdd0:none nameserver=[fd00::1] zfcp.allow_lun_scan=0 rd.znet=qeth,0.0.bdd0,0.0.bdd1,0.0.bdd2,layer2=1 rd.dasd=0.0.5235 rd.dasd=0.0.5236 random.trust_cpu=on rd.luks.options=discard ignition.firstboot ignition.platform.id=metal console=tty1 console=ttyS1,115200n8

These arguments need to be passed to the coreos installer otherwise the first reboot will end in an emergency shell.
This PR is the first PR of at least three PRs to provide support of automatically discovering the kernel arguments and pass them to the coreos installer.
The RestAPI provide a possibility to set the necessary kernel arguments:

curl https://api.openshift.com/api/assisted-install/v2/infra-envs/${INFRA_ENV_ID}/hosts/$1/installer-args
-X PATCH
-H "Authorization: Bearer ${API_TOKEN}"
-H "Content-Type: application/json"
-d '
{
"args": [
"--append-karg", "rd.neednet=1",
"--append-karg", "ip=10.14.6.3::10.14.6.1:255.255.255.0:master-0.boea3e06.lnxero1.boe:encbdd0:none",
"--append-karg", "nameserver=10.14.6.1",
"--append-karg", "ip=[fd00::3]::[fd00::1]:64::encbdd0:none",
"--append-karg", "nameserver=[fd00::1]",
"--append-karg", "zfcp.allow_lun_scan=0",
"--append-karg", "rd.znet=qeth,0.0.bdd0,0.0.bdd1,0.0.bdd2,layer2=1",
"--append-karg", "rd.dasd=0.0.5235",
"--append-karg", "rd.dasd=0.0.5236"
]
}
' | jq

but this would break the WebUI flow (bad user experience if an additional step is needed to install a cluster).

List all the issues related to this PR

  • [x ] 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
  • [x ] 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 the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 31, 2023
@openshift-ci openshift-ci bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. api-review Categorizes an issue or PR as actively needing an API review. labels Oct 31, 2023
Copy link

openshift-ci bot commented Oct 31, 2023

Hi @AmadeusPodvratnik. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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

avishayt commented Nov 1, 2023

/ok-to-test
/lgtm
/approve

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. lgtm Indicates that a PR is ready to be merged. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 1, 2023
Copy link

openshift-ci bot commented Nov 1, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AmadeusPodvratnik, 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:

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 1, 2023
Copy link

codecov bot commented Nov 1, 2023

Codecov Report

Merging #5649 (ae1f045) into master (2f54c2c) will decrease coverage by 0.06%.
Report is 8 commits behind head on master.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5649      +/-   ##
==========================================
- Coverage   67.73%   67.68%   -0.06%     
==========================================
  Files         233      233              
  Lines       34211    34246      +35     
==========================================
+ Hits        23174    23179       +5     
- Misses       8977     9004      +27     
- Partials     2060     2063       +3     

see 5 files with indirect coverage changes

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD dcad840 and 2 for PR HEAD 161ee9a in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 8ccb7c8 and 1 for PR HEAD 161ee9a in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 1f75dfd and 0 for PR HEAD 161ee9a in total

@openshift-ci-robot
Copy link

/hold

Revision 161ee9a was retested 3 times: holding

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 2, 2023
Signed-off-by: Amadeus Podvratnik <apodvrat@redhat.com>
@avishayt
Copy link
Contributor

avishayt commented Nov 2, 2023

/unhold

@openshift-ci openshift-ci bot removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Nov 2, 2023
@avishayt
Copy link
Contributor

avishayt commented Nov 2, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 2, 2023
@openshift-ci openshift-ci bot merged commit 91b2f5e into openshift:master Nov 2, 2023
14 of 15 checks passed
@AmadeusPodvratnik AmadeusPodvratnik deleted the discover_cmdline_s390x branch November 3, 2023 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants