Skip to content

Conversation

@carbonin
Copy link
Member

@carbonin carbonin commented Jan 16, 2025

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 rccrdpccl and tsorya 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.

Details

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
@openshift-ci
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

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

@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
@codecov
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 68.58%. Comparing base (8699842) to head (5dbaa6c).
Report is 15 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%   68.58%   +0.85%     
==========================================
  Files         296      298       +2     
  Lines       40290    42179    +1889     
==========================================
+ Hits        27290    28929    +1639     
- Misses      10544    10767     +223     
- Partials     2456     2483      +27     
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 87.20% <ø> (+4.64%) ⬆️
internal/host/hostcommands/install_cmd.go 85.86% <87.50%> (-0.42%) ⬇️
internal/oc/release.go 73.38% <0.00%> (-0.40%) ⬇️

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

@rccrdpccl
Copy link
Contributor

/retest
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 21, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 6bdc133 into openshift:master Jan 21, 2025
18 of 19 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-agent-installer-api-server
This PR has been included in build ose-agent-installer-api-server-container-v4.19.0-202501212142.p0.g6bdc133.assembly.stream.el9.
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

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

4 participants