Bug 1970482

Summary: Discovery plugin ignores IPv6 when doing reboot/kexec/fetch facts
Product: Red Hat Satellite Reporter: Markus Schibli <mschibli>
Component: Discovery ImageAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Griffin Sullivan <gsulliva>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: gsulliva, lzap, mhulan, pcreech, rabajaj, zhunting
Target Milestone: 6.11.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: foreman-2.5.2.6-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-05 14:28:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.

Comment 19 Griffin Sullivan 2022-03-25 17:11:56 UTC
Verified in 7.0 snap 14

Patches for core and foreman_discovery are in 7.0.

Steps to Reproduce:
1. Locate changes in files

Expected Results:
Changes are there.

Actual Results:
Changes are there.


NOTE: At this time, QE's environment doesn't support IPv6 so we are unable to test this properly.

Comment 22 errata-xmlrpc 2022-07-05 14:28:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498