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-19100: Allow install to the existing root filesystem #7197

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

carbonin
Copy link
Member

In order to allow for new CAPI install methods this PR enables the installer to write to a new stateroot on the existing root filesystem as opposed to installing to an entire device using coreos-installer.

This PR creates an environment variable (INSTALL_TO_EXISTING_ROOT) which when set will fetch the coreos image content from the selected release and provide it to the installer. This (along with the changes in openshift/assisted-installer#1003) will trigger the installer to write the image to a new stateroot on the existing disk rather than installing to a target device.

This functionality is disabled by default and should only be used when the host is not running in the live-iso environment.

In order to enable (and succeed when using) the new install flow the following must be done:

  1. Set INSTALL_TO_EXISTING_ROOT to true in the assisted-service deployment
  2. Boot a host using a disk image and provide the discovery ignition to that host using a platform metadata service
  3. Proceed with installation as normal

In the future (https://issues.redhat.com/browse/MGMT-19102) we will detect if the host is booted using a live-iso or not and use the corresponding install strategy, but this PR is just a first pass to get CAPI integration work unstuck.

This PR can be merged now, but the full functionality also depends on the following PRs:

List all the issues related to this PR

https://issues.redhat.com/browse/MGMT-19100

  • 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?

Manually deployed to a dev-scripts environment and succeeded in an install using a disk image rather than the live-iso.

  • 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) - Will follow up with docs
  • 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?

Use INSTALL_TO_EXISTING_ROOT to determine if we should check disk performance.
Running this check breaks the disk and fails the install when installing
to the booted disk.
@carbonin carbonin requested review from tsorya and rccrdpccl January 16, 2025 21:12
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 16, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 16, 2025

@carbonin: This pull request references MGMT-19100 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.19.0" version, but no target version was set.

In response to this:

In order to allow for new CAPI install methods this PR enables the installer to write to a new stateroot on the existing root filesystem as opposed to installing to an entire device using coreos-installer.

This PR creates an environment variable (INSTALL_TO_EXISTING_ROOT) which when set will fetch the coreos image content from the selected release and provide it to the installer. This (along with the changes in openshift/assisted-installer#1003) will trigger the installer to write the image to a new stateroot on the existing disk rather than installing to a target device.

This functionality is disabled by default and should only be used when the host is not running in the live-iso environment.

In order to enable (and succeed when using) the new install flow the following must be done:

  1. Set INSTALL_TO_EXISTING_ROOT to true in the assisted-service deployment
  2. Boot a host using a disk image and provide the discovery ignition to that host using a platform metadata service
  3. Proceed with installation as normal

In the future (https://issues.redhat.com/browse/MGMT-19102) we will detect if the host is booted using a live-iso or not and use the corresponding install strategy, but this PR is just a first pass to get CAPI integration work unstuck.

This PR can be merged now, but the full functionality also depends on the following PRs:

List all the issues related to this PR

https://issues.redhat.com/browse/MGMT-19100

  • 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?

Manually deployed to a dev-scripts environment and succeeded in an install using a disk image rather than the live-iso.

  • 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) - Will follow up with docs
  • 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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 16, 2025
@openshift-ci openshift-ci bot requested review from eliorerz and javipolo January 16, 2025 21:13
@openshift-ci openshift-ci bot added the api-review Categorizes an issue or PR as actively needing an API review. label Jan 16, 2025
Copy link

openshift-ci bot commented Jan 16, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: carbonin

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 Jan 16, 2025
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 89.74359% with 4 lines in your changes missing coverage. Please review.

Project coverage is 67.71%. Comparing base (8699842) to head (5dbaa6c).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
internal/host/hostcommands/install_cmd.go 87.50% 1 Missing and 1 partial ⚠️
internal/oc/release.go 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7197      +/-   ##
==========================================
- Coverage   67.73%   67.71%   -0.03%     
==========================================
  Files         296      296              
  Lines       40290    40473     +183     
==========================================
+ Hits        27290    27405     +115     
- Misses      10544    10608      +64     
- Partials     2456     2460       +4     
Files with missing lines Coverage Δ
internal/host/conditions.go 100.00% <100.00%> (ø)
internal/host/config.go 100.00% <ø> (ø)
internal/host/host.go 72.75% <100.00%> (ø)
internal/host/hostcommands/disk_performance_cmd.go 71.05% <100.00%> (+2.48%) ⬆️
internal/host/hostcommands/instruction_manager.go 96.10% <100.00%> (ø)
internal/host/refresh_status_preprocessor.go 94.49% <100.00%> (+0.02%) ⬆️
internal/host/validator.go 82.73% <ø> (+0.17%) ⬆️
internal/host/hostcommands/install_cmd.go 85.86% <87.50%> (-0.42%) ⬇️
internal/oc/release.go 73.38% <0.00%> (-0.40%) ⬇️

... and 11 files with indirect coverage changes

@rccrdpccl
Copy link
Contributor

This PR creates an environment variable (INSTALL_TO_EXISTING_ROOT) which when set will fetch the coreos image content from the selected release and provide it to the installer. This (along with the changes in openshift/assisted-installer#1003) will trigger the installer to write the image to a new stateroot on the existing disk rather than installing to a target device.

Would you see any value in making this parameter "per cluster" rather than per AI instance? This way we could run both types of install flow with the same AI instance. Of course in such case in order for it to be useful we'd need to advertise the userdata address, so maybe could be a later iteration?

@carbonin
Copy link
Member Author

@rccrdpccl I address this later in the description and with a separate task.
This PR is just a first pass to get yall unstuck.

In the future (https://issues.redhat.com/browse/MGMT-19102) we will detect if the host is booted using a live-iso or not and use the corresponding install strategy, but this PR is just a first pass to get CAPI integration work unstuck.

@rccrdpccl
Copy link
Contributor

@rccrdpccl I address this later in the description and with a separate task. This PR is just a first pass to get yall unstuck.

In the future (https://issues.redhat.com/browse/MGMT-19102) we will detect if the host is booted using a live-iso or not and use the corresponding install strategy, but this PR is just a first pass to get CAPI integration work unstuck.

Great, I didn't realize the automatic flow detection was effectively the same (or even better) of what I proposed. In any case totally agree to tackle it separately

@carbonin
Copy link
Member Author

/retest

Copy link

openshift-ci bot commented Jan 17, 2025

@carbonin: The following test 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/edge-e2e-ai-operator-disconnected-capi 5dbaa6c link false /test edge-e2e-ai-operator-disconnected-capi

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-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
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. 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.

3 participants