foreman icon indicating copy to clipboard operation
foreman copied to clipboard

Fixes #36502 - iPXE Discovery Only Works On net0

Open jmott85 opened this issue 1 year ago • 12 comments

Adjusted BOOTIF=01-${mac} and added fdi.initnet=all which allows any network port to work with discovery.

To recreate: Boot a machine to fdi discovery image from iPXE using a network port that does not identify as net0.

Expected outcome: Discovery image updates Foreman server with machine information using the mac address of the port that established the connection.

Actual outcome: Discovery image fails while attempting to update Foreman server using the mac address of net0.

jmott85 avatar Jun 12 '23 19:06 jmott85

Can one of the admins verify this patch?

theforeman-bot avatar Jun 12 '23 19:06 theforeman-bot

Can one of the admins verify this patch?

theforeman-bot avatar Jun 12 '23 19:06 theforeman-bot

Can one of the admins verify this patch?

theforeman-bot avatar Jun 12 '23 19:06 theforeman-bot

Hi @jmott85, I don't think this should be enabled by default, what about cases where users don't want to initialize all interfaces?

I think this should be customized by the config parameter, with default value bootif.

Please see latest commit. I changed fdi.initnet to ${ifname} which uses the interface that iPXE booted from.

jmott85 avatar Jul 31 '23 18:07 jmott85

Hi, sorry for the late response, could you please rebase the commits over the latest develop, so it will trigger the CI over the latest changes?

stejskalleos avatar Sep 20 '23 06:09 stejskalleos

Hi, sorry for the late response, could you please rebase the commits over the latest develop, so it will trigger the CI over the latest changes?

Merged with base and I also changed fdi.initnet to bootif instead of using an iPXE variable. I found this option here: https://theforeman.org/plugins/foreman_discovery/18.0/index.html#3.1.5Discoveryimagekerneloptions

jmott85 avatar Oct 13 '23 18:10 jmott85

Thank you for your contribution! This PR has been inactive for 3 months, closing for now. Feel free to reopen when you return to it. This is an automated process.

github-actions[bot] avatar Jan 19 '24 01:01 github-actions[bot]

@jmott85 I'm reopening this because I think it's still a good change, but can you rebase on develop instead of merge? We'd like to see a single commit if possible.

ekohl avatar Jan 19 '24 11:01 ekohl

@jmott85 you still only merged in the changes, but we'd like to see all changes squashed into a single commit. https://medium.com/@slamflipstrom/a-beginners-guide-to-squashing-commits-with-git-rebase-8185cf6e62ec is one example I found, though I'd recommend doing something like

git fetch origin
git rebase -i origin/develop
# Now change it to squash all changes
git push --force

ekohl avatar Jan 23 '24 13:01 ekohl

@ekohl Thanks for the assistance and apologies for the mess of commits. I haven't tried squashing commits before and I still don't think I got it right. Maybe it would be better to just close this issue and I can open a new one.

jmott85 avatar Jan 24 '24 01:01 jmott85

@jmott85 given how small the changes actually are, I think that would also be fine.

If you want to reset the changes, you can use this (assuming origin is the upstream repository, see https://community.theforeman.org/t/git-remote-fetch-pull-and-rebase/29949

git fetch origin
git reset --hard origin/develop
# make your changes
git push --force

ekohl avatar Jan 29 '24 17:01 ekohl

@ekohl, I think that got it into one commit now. Please review.

jmott85 avatar Feb 04 '24 08:02 jmott85

@stejskalleos this breaks CI as the changes did not update the rendered snapshots :(

evgeni avatar Feb 26 '24 07:02 evgeni

https://github.com/theforeman/foreman/pull/10070

evgeni avatar Feb 26 '24 07:02 evgeni

Oh shoot, I thought it's failing due to the other problems. sorry, my bad

stejskalleos avatar Feb 26 '24 10:02 stejskalleos