Bug 1970482 - Discovery plugin ignores IPv6 when doing reboot/kexec/fetch facts
Summary: Discovery plugin ignores IPv6 when doing reboot/kexec/fetch facts
Keywords:
Status: MODIFIED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Discovery Image
Version: 6.9.0
Hardware: x86_64
OS: Linux
unspecified
medium vote
Target Milestone: Unspecified
Assignee: Lukas Zapletal
QA Contact: Roman Plevka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-10 14:36 UTC by Markus Schibli
Modified: 2021-11-23 10:01 UTC (History)
5 users (show)

Fixed In Version: foreman-2.5.2.6-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 32812 0 Normal Closed Discovery plugin ignores IPv6 when doing reboot/kexec/fetch facts 2021-11-19 06:58:00 UTC
Foreman Issue Tracker 32837 0 Normal Closed Drop unwanted URI parsing from NetHttpExtension 2021-11-19 06:58:04 UTC

Description Markus Schibli 2021-06-10 14:36:02 UTC
Description of problem:
The Satellite settings for auto reboot in discovery is set to true and we expect the host to reboot automatically. This does not happen. When rebooting manually, the system will start to download anaconda with kickstart.
When we deactivate the provisioning rule to keep the host in the discovered host list and trigger just a reboot, the reboot also fails.


Version-Release number of selected component (if applicable):
satellite-6.9.2-1

How reproducible:
yes

Additional info:
When we check the production.log, we see the following messages:
2021-06-08T09:06:16 [I|app|0df730df] Started PUT "/discovered_hosts/mac00a01001cf31/reboot" for 10.183.96.17 at 2021-06-08 09:06:16 +0000

2021-06-08T09:06:16 [I|app|0df730df] Processing by DiscoveredHostsController#reboot as HTML

2021-06-08T09:06:16 [I|app|0df730df]   Parameters: {"authenticity_token"=>"NPT28NfI+auVOQ6c6i8RyoIrrycP0ttCNFQFuBIJbmoxQsn2fagefLE7ZJBHOYzQh5HuWUSBhqGGFAqf6HjC5A==", "id"=>"mac00a01001cf31"}

2021-06-08T09:06:16 [W|app|0df730df] ERF50-5094 [Foreman::WrappedException]: Failed to reboot host mac00a01001cf31 with error ERF42-4036 [Foreman::Exception]: Unable to perform reboot on  ([Foreman::Exception]: ERF42-4036 [Foreman::Exception]: Unable to perform reboot on )

2021-06-08T09:06:16 [I|app|0df730df] Backtrace for 'ERF50-5094 [Foreman::WrappedException]: Failed to reboot host mac00a01001cf31 with error ERF42-4036 [Foreman::Exception]: Unable to perform reboot on  ([Foreman::Exception]: ERF42-4036 [Foreman::Exception]: Unable to perform reboot on )' error (Foreman::Exception): ERF42-4036 [Foreman::Exception]: Unable to perform reboot on 

/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.3.1/app/models/host/discovered.rb:165:in `reboot'

/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.3.1/app/controllers/discovered_hosts_controller.rb:112:in `reboot'

It seems that not all information are available like on IPv4. Like in the overview of the discovered host, the IP address and subnet field are empty. Which then would make sense of the "incomplete" log message "Unable to perform reboot on".

Comment 3 Lukas Zapletal 2021-06-15 12:18:10 UTC
Please use this patch to workaround the problem:

https://github.com/theforeman/foreman_discovery/pull/541/files

Can you get back to me if this resolved the reboot/kexec call on IPv6 network?

Comment 4 Markus Schibli 2021-06-22 12:56:15 UTC
(In reply to Lukas Zapletal from comment #3)
> Please use this patch to workaround the problem:
> 
> https://github.com/theforeman/foreman_discovery/pull/541/files
> 
> Can you get back to me if this resolved the reboot/kexec call on IPv6
> network?

Hi Lukas,

according to customer did the latest version of your patch fix the reboot/kexec call on IPv6. Customer is asking if it would be possible to have this fix released in a z-stream of 6.9? 

Thanks and regards
Markus

Comment 5 Lukas Zapletal 2021-06-23 07:08:00 UTC
Hello,

absolutely, we have been working with Rares on this one. Two patches are required:

Foreman core: https://projects.theforeman.org/issues/32837
Foreman discovery: https://projects.theforeman.org/issues/32812

Comment 10 Lukas Zapletal 2021-08-12 08:45:07 UTC
Sorry about that, still working on: https://github.com/theforeman/foreman/pull/8606

Comment 11 Bryan Kearney 2021-09-07 20:04:58 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32812 has been resolved.

Comment 14 Lukas Zapletal 2021-10-01 07:41:46 UTC
Release engineering:

There was an incorrect MR associated with this BZ. Please cherry pick the CORE PR and I have backported the discovery plugin 17.0.4 so rebase to that version. I am not setting fixed-in-version to avoid missing the core patch. It is small one, but very much needed. Thanks.


Markus:

There were two patches merged for this:

- core patch went into Foreman 3.0: https://github.com/theforeman/foreman/pull/8606
- discovery patch in 18.0: https://github.com/theforeman/foreman_discovery/pull/541

This is all set to land in Satellite 7.0 and this BZ convers 6.10 backport. Since SBB is the only customer who currently wants this, I would not suggest to backport this into 6.9. However, I am here to assist you hotfixing this on their curreent version. If you confirm, I can prepare GNU diffs against Ruby files that will be 6.9 compatible. I suggest you to wait until this is covered by QA tho, should happen soon as 6.10 GA is closing quite quickly with the beta out.


Note You need to log in before you can comment on or make changes to this bug.