Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1656955 - hammer host stop results in unknown parent permission
Summary: hammer host stop results in unknown parent permission
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: 6.4.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: 6.6.0
Assignee: Marek Hulan
QA Contact: tstrych
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-06 18:03 UTC by Ryan Kimbrell
Modified: 2019-10-22 19:48 UTC (History)
6 users (show)

Fixed In Version: foreman-1.21.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-22 19:48:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 25745 0 None None None 2018-12-20 15:14:57 UTC

Description Ryan Kimbrell 2018-12-06 18:03:20 UTC
Description of problem: Executing `hammer host stop --id <ID>` returns "ERF42-5227 [Foreman::Exception]: unknown parent permission for api/v2/hosts#power"


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


How reproducible: Always


Steps to Reproduce:
1. Use VMware ESXi 6.7 as a compute resource
2. Create a VM as a managed host.
3. Execute `hammer host stop --id <ID>`

Actual results: ERF42-5227 [Foreman::Exception]: unknown parent permission for api/v2/hosts#power and the VM remains powered on.


Expected results: The VM is powered off gracefully.


Additional info:

Comment 3 Marek Hulan 2018-12-20 15:14:56 UTC
Created redmine issue https://projects.theforeman.org/issues/25745 from this bug

Comment 4 Marek Hulan 2018-12-20 15:25:16 UTC
This happens for any compute resource. The reason is that hammer has default org set, so it uses /organization/x/host/y route and we don't have mapping between power action permission and parent resource permission. The fix is to add mapping to check "view_organizations" on org x for such call. Workaround is to use admin account or don't specify org id at all (remove hammer defaults)

Comment 5 Satellite Program 2018-12-20 17:03:15 UTC
Upstream bug assigned to mhulan

Comment 6 Satellite Program 2018-12-20 17:03:17 UTC
Upstream bug assigned to mhulan

Comment 7 Ryan Kimbrell 2018-12-20 17:17:17 UTC
I wanted to add that we are executing the hammer commands as the default Satellite admin, but we do have a default org set.

Comment 8 Satellite Program 2018-12-31 11:02:54 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25745 has been resolved.

Comment 9 Apurva 2019-06-27 17:13:54 UTC
Verified

Verified on: Satellite 6.6.0 snap 7

Steps:
1. Use VMware ESXi 6.7 as a compute resource
2. Create a VM as a managed host.
3. Execute `hammer host stop --id <ID>`

Observation:
Host Powered Off successfully

Terminal Output:
-bash-4.2# hammer host list
---|------------------------------------------|------------------|------------|-----------------|-------------------|---------------|--------------|----------------------
ID | NAME                                     | OPERATING SYSTEM | HOST GROUP | IP              | MAC               | GLOBAL STATUS | CONTENT VIEW | LIFECYCLE ENVIRONMENT
---|------------------------------------------|------------------|------------|-----------------|-------------------|---------------|--------------|----------------------
4  | cloud-qe-04.idmqe.lab.eng.bos.redhat.com | RedHat 7.5       |            | 10.19.34.31     | 34:40:b5:89:06:16 | Error         | RHEL 7 CV    | DEV                  
3  | demohost                                 | RHEL Server 7.6  |            |                 |                   | Error         | RHEL 7 CV    | DEV                  
1  | lenovo-st550-01.ml3.eng.bos.redhat.com   | RHEL Server 7.6  |            | 10.19.176.55    | f0:76:1c:9d:92:94 | OK            |              |                      
5  | otto-abedi.ml3.eng.bos.redhat.com        | RHEL Server 7.6  | test       | 192.168.100.185 | 00:50:56:be:e6:2c | OK            | RHEL 7 CV    | Library              
2  | test1.ml3.eng.bos.redhat.com             | RHEL Server 7.6  |            | 192.168.100.120 | f0:76:1c:9d:92:90 | Error         |              |                      
---|------------------------------------------|------------------|------------|-----------------|-------------------|---------------|--------------|----------------------
-bash-4.2# hammer host stop --id 5
Powering the host off

Comment 11 Bryan Kearney 2019-10-22 19:48:05 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, 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-2019:3172


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