Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
User is unable to fetch a power state of a VM using REST API `"power_action": "status"` ; PUT /api/hosts/:id/power.
Version-Release number of selected component (if applicable):
Upstream foreman 1.7.4-1
Downstream Sat 6.0.8
How reproducible:
-
Steps to Reproduce:
1. Setup a compute resource
2. Create a host on that compute resource
3. Run power state check using the rest api against the virtualized host:
[jkrocil@lysandros ~]$ curl --insecure -X PUT -d '{"power_action": "status"}' -u admin -H "Content-Type:application/json" -H "Accept:application/json" https://my-foreman.domain.com/api/v2/hosts/my-vm.nested.lan/power
Actual results:
{
"error": {"message":"undefined method `status' for #<PowerManager::Virt:0x007f8e196e0268>"}
}
Expected results:
Valid response with power state info.
Additional info:
Running `"power_action": "state"` instead of "status" works.
The issue is here:
https://github.com/theforeman/foreman/blob/develop/app/services/power_manager/virt.rb#L24
"state" and "status" is being removed from the SUPPORTED_ACTIONS.
There are methods being created dynamically for each power state except the 2.
For "state" though, there is a method defined at L18.
For "status", there is nothing.
Thanks to stbenjam for help.
Comment 1RHEL Program Management
2015-04-13 19:33:05 UTC
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.
Moving to POST since upstream bug http://projects.theforeman.org/issues/13430 has been closed
-------------
Anonymous
Applied in changeset commit:1bf5ff536572e0209095532d7f5c7dd986d2aa19.
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:1501
Description of problem: User is unable to fetch a power state of a VM using REST API `"power_action": "status"` ; PUT /api/hosts/:id/power. Version-Release number of selected component (if applicable): Upstream foreman 1.7.4-1 Downstream Sat 6.0.8 How reproducible: - Steps to Reproduce: 1. Setup a compute resource 2. Create a host on that compute resource 3. Run power state check using the rest api against the virtualized host: [jkrocil@lysandros ~]$ curl --insecure -X PUT -d '{"power_action": "status"}' -u admin -H "Content-Type:application/json" -H "Accept:application/json" https://my-foreman.domain.com/api/v2/hosts/my-vm.nested.lan/power Actual results: { "error": {"message":"undefined method `status' for #<PowerManager::Virt:0x007f8e196e0268>"} } Expected results: Valid response with power state info. Additional info: Running `"power_action": "state"` instead of "status" works. The issue is here: https://github.com/theforeman/foreman/blob/develop/app/services/power_manager/virt.rb#L24 "state" and "status" is being removed from the SUPPORTED_ACTIONS. There are methods being created dynamically for each power state except the 2. For "state" though, there is a method defined at L18. For "status", there is nothing. Thanks to stbenjam for help.