Bug 1656955 - hammer host stop results in unknown parent permission
Summary: hammer host stop results in unknown parent permission
Status: POST
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hosts   
(Show other bugs)
Version: 6.4.0
Hardware: x86_64
OS: Linux
medium vote
Target Milestone: Unspecified
Assignee: Marek Hulan
QA Contact: Jan Hutař
Keywords: Triaged
Depends On:
TreeView+ depends on / blocked
Reported: 2018-12-06 18:03 UTC by Ryan Kimbrell
Modified: 2019-01-01 16:15 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 25745 None None None 2018-12-20 15:14 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 pm-sat@redhat.com 2018-12-20 17:03:15 UTC
Upstream bug assigned to mhulan@redhat.com

Comment 6 pm-sat@redhat.com 2018-12-20 17:03:17 UTC
Upstream bug assigned to mhulan@redhat.com

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 pm-sat@redhat.com 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.

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