Bug 1211613
| Summary: | Power action "status" REST API responses from compute resources are not masked to shared values | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Jan Krocil <jkrocil> |
| Component: | Power & BMC | Assignee: | Shimon Shtein <sshtein> |
| Status: | CLOSED ERRATA | QA Contact: | Kedar Bidarkar <kbidarka> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.0.8 | CC: | bkearney, cwelton, egolov, ehelms, kbidarka, lzap |
| Target Milestone: | Unspecified | Keywords: | Triaged |
| Target Release: | Unused | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | http://projects.theforeman.org/issues/10183 | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-07-27 09:31:23 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: | |||
| Bug Depends On: | 1341149 | ||
| Bug Blocks: | |||
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release. Created redmine issue http://projects.theforeman.org/issues/10183 from this bug Upstream bug component is Power & BMC Upstream bug assigned to sshtein Moving to POST since upstream bug http://projects.theforeman.org/issues/10183 has been closed ------------- Shimon Shtein Applied in changeset commit:1799cee842301e341494748ba4dfd1ecae7589f6. [root@xyz ~]# curl --insecure -X PUT -d '{"power_action": "state"}' -u admin:changeme -H "Content-Type:application/json" -H "Accept:application/json" https://abc.redhat.com/api/v2/hosts/abc1.redhat.com/power
{
"error": {"message":"ERF42-5531 [Foreman::Exception]: unknown permission for api/v2/hosts#power"}
}
[root@xyz ~]# curl --insecure -X PUT -d '{"power_action": "status"}' -u admin:changeme -H "Content-Type:application/json" -H "Accept:application/json" https://abc.redhat.com/api/v2/hosts/abc1.redhat.com/power
{
"error": {"message":"ERF42-5531 [Foreman::Exception]: unknown permission for api/v2/hosts#power"}
Currently we face this issue while trying to use the particular API.
TESTED with sat62-snap(GA)-13.1
It's a different bug, I have already opened it: https://bugzilla.redhat.com/show_bug.cgi?id=1341149 Tested the below stuff from a vmware sat6 provisioning a HOST on vcenter55
[abc@xyz ~]# curl --insecure -X PUT -d '{"power_action": "status"}' -u admin:changeme -H "Content-Type:application/json" -H "Accept:application/json" https://sat6-server.redhat.com/api/v2/hosts/sat6-client.redhat.com/power
{"power":"on"}
[abc@xyz ~]# curl --insecure -X PUT -d '{"power_action": "state"}' -u admin:changeme -H "Content-Type:application/json" -H "Accept:application/json" https://sat6-server.redhat.com/api/v2/hosts/sat6-client.redhat.com/power
{"power":"on"}
Now we need to check the power state from that of a baremetal box.
sorry we had to check the power-off status.
[abc@xyz ~]# curl --insecure -X PUT -d '{"power_action": "state"}' -u admin:changeme -H "Content-Type:application/json" -H "Accept:application/json" https://sat6-server.redhat.com/api/v2/hosts/sat6-client.redhat.com/power
{"power":"off"}
[abc@xyz ~]# curl --insecure -X PUT -d '{"power_action": "status"}' -u admin:changeme -H "Content-Type:application/json" -H "Accept:application/json" https://sat6-server.redhat.com/api/v2/hosts/sat6-client.redhat.com/power
{"power":"off"}
Tested the stuff from a vmware sat6 provisioning a HOST on vcenter55.
Now we need to check the power state from that of a baremetal box.
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/RHBA-2016:1502 |
Description of problem: Response to "power_action": "state" request towards a baremetal host {"power":"off"} Response to "power_action": "state" request towards a vmware VM host: {"power":"poweredOff"} ^ this is in case the hosts are turned off I'm not sure if this difference between responses happens with other power_action types as well - this requires further investigation. Version-Release number of selected component (if applicable): Upstream foreman 1.7.4-1 (+ most probably downstream satellite 6.0.8) How reproducible: Always Steps to Reproduce: 1. Setup a vmware vsphere compute resource (v5.5 in my case) 2. Provision a VM-based host on that compute resource 3. Provision a baremetal host 4. Run the following request against both hosts to see the difference: # curl --insecure -X PUT -d '{"power_action": "state"}' -u admin -H "Content-Type:application/json" -H "Accept:application/json" https://my-foreman.domain.com/api/v2/hosts/my-host.domain.com/power Actual results: {"power":"poweredOff"} for VMs, {"power":"off"} for baremetal or {"power":"poweredOn"} for VMs, {"power":"on"} for baremetal etc... Expected results: Shared, single type of values for all host types. Additional info: