Bug 2149288

Summary: A failed "Actions::Katello::Host::Hypervisors" task lacks identifying information
Product: Red Hat Satellite Reporter: momran
Component: Hosts - ContentAssignee: Chris Roberts <chrobert>
Status: CLOSED ERRATA QA Contact: Sam Bible <sbible>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.9.0CC: ahumbe, aruzicka, chrobert, ehelms, jlenz, rlavi, sbible, thadzhie
Target Milestone: 6.15.0Keywords: Patch, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
URL: https://projects.theforeman.org/issues/36599
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-04-23 17:12:54 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 momran 2022-11-29 13:00:50 UTC
Description of problem:

When a "Actions::Katello::Host::Hypervisors" task ends with error/warnings, it does not indicate any detail about what hypervisor caused the issue. With the patch attached to this RFE, the erro message displays also the ID and hostname of the affected hypervisor. The customer finds this addition really useful to identify the root cause of the problem, and requests to implement it in future Red Hat Satellite releases.

https://access.redhat.com/support/cases/#/case/03335948/discussion?attachmentId=a096R00002vrWUlQAM

Can it be added to the official Satellite code?


Actual results:

original error message:
~~~
hypervisors warning: "Validation failed: Name must not include periods, Name must not include periods"
~~~


Expected results:

patched error message:
~~~
hypervisors warning: "Validation failed: Name must not include periods, Name must not include periods 99999: myhost"
~~~


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

Red Hat Satellite 6.9

Comment 5 Bryan Kearney 2023-07-24 20:02:29 UTC
Upstream bug assigned to chrobert

Comment 6 Bryan Kearney 2023-07-24 20:02:32 UTC
Upstream bug assigned to chrobert

Comment 7 Chris Roberts 2023-10-09 19:17:38 UTC
What are the testing steps for this pull request?
Check out PR
Install virt-who with dnf
Create a virt-who config file in /etc/virt-who.d/ I called mine fake.conf Here is what mine looks like:
[fakevirt]
type=fake
file=/tmp/fake.json
is_hypervisor=True
owner=Default_Organization
hypervisor_id=$&
Now in /tmp create a fake.json that looks like this
{
        "hypervisors": [{
                "uuid": "$&",
                "guests": [{
                                "guestId": "a8f73be7-c6a9-4c2a-8590-0ec2457c975d",
                                "state": 1
                        },
                        {
                                "guestId": "3e62be70-2365-4b53-8d2c-84c89cc1373a",
                                "state": 1
                        },
                        {
                                "guestId": "a746244b-125a-4f09-80bd-c043413a9153",
                                "state": 1
                        },
                        {       "guestId": "b5e07903-f5d8-44e6-b2dd-922743c402e2",
                                "state": 1
                        },
                        {       "guestId": "be263884-7c5c-4d02-a268-0cfadef3c6b4",
                                "state": 1
                        },
                        {       "guestId": "da172ae4-1b82-4900-975b-17ed24553f09",
                                "state": 1
                        },
                        {       "guestId": "ecf50029-a084-4c0e-813b-51f6b977f2f1",
                                "state": 1
                        }
                ]
        }]
}
Register your system running virt-who to your devel box ( I just used my own devel box to register to itself)
Start up virt-who
systemctl start virt-who
Check in the production log to make sure you see the new error InvalidVirtWhoHost with the hostname virt-who-xxx like so
ESC[32m2023-07-12T20:51:33ESC[0m [ESC[31mEESC[0m|ESC[36mbacESC[0m|7f084d2d] The hostname virt-who-$&-1 can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123 (Katello::Errors::InvalidVirtWhoHost)

Comment 9 Sam Bible 2024-01-22 23:03:45 UTC
Verified on 6.15 - Snap 5

Steps to Verify:
1. Following Chris' steps above, install virt-who, create a fake config, and a fake json
2. Register Satellite as a host on itself.
3. Start up virt-who with systemctl start virt-who

Expected Results:
In the production log, you see the InvalidVirtWhoHost error correctly displaying the hostname as shown above.

Actual Results:
In the production log, you see the InvalidVirtWhoHost error correctly displaying the hostname as shown above.

Comment 12 errata-xmlrpc 2024-04-23 17:12:54 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 (Important: Satellite 6.15.0 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-2024:2010