Bug 1417976 - "hammer host stop --force" power cycles virtual machine
Summary: "hammer host stop --force" power cycles virtual machine
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.2.7
Hardware: All
OS: Linux
medium
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Ondřej Pražák
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-31 14:20 UTC by Stefan Meyer
Modified: 2019-08-12 16:24 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Satellite 6.2.7
Last Closed: 2018-02-21 16:51:07 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 18319 0 None None None 2017-01-31 14:21:05 UTC

Description Stefan Meyer 2017-01-31 14:20:34 UTC
Description of problem:
Using "hammer host stop --force --id <some guest>" is power cycling the virtual machine instead of powering it off immediately.


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

How reproducible:
Using the command "hammer host stop --force --id <some guest>" on virtual machines
running on VMware, RHV4 or libvirt

Actual results:
The virtual machine is power cycled.

Expected results:
The virtual machine is powered off immediatly.

Additional info:

Messages from production log:
2017-01-31 12:59:32 [app] [I] Started GET "/api/hosts?search=name+%3D+%22HOSTNAMEREMOVED%22" for ::1 at 2017-01-31 12:59:32 +0100
2017-01-31 12:59:32 [app] [I] Processing by Api::V2::HostsController#index as JSON
2017-01-31 12:59:32 [app] [I] Parameters: {"search"=>"name = \"HOSTNAMEREMOVED\"", "apiv"=>"v2", :host=>{}}
2017-01-31 12:59:32 [app] [I] Authorized user admin(Admin User)
2017-01-31 12:59:32 [app] [I] Rendered api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout (308.6ms)
2017-01-31 12:59:32 [app] [I] Completed 200 OK in 510ms (Views: 268.4ms | ActiveRecord: 71.6ms)
2017-01-31 12:59:32 [app] [I] Started PUT "/api/hosts/274/power" for ::1 at 2017-01-31 12:59:32 +0100
2017-01-31 12:59:32 [app] [I] Processing by Api::V2::HostsController#power as JSON
2017-01-31 12:59:32 [app] [I] Parameters: {"power_action"=>"cycle", "apiv"=>"v2", "id"=>"274", :host=>{}}
2017-01-31 12:59:32 [app] [I] Authorized user admin(Admin User)
2017-01-31 12:59:34 [app] [I] Completed 200 OK in 1682ms (Views: 0.4ms | ActiveRecord: 5.7ms)

The bug seems to be in https://github.com/theforeman/hammer-cli-foreman/blob/master/lib/hammer_cli_foreman/host.rb#L324
It cycles when it should power off.

To test it I replaced :cycle with :poweroff and it works fine with vmware and libvirt. 
On RHV4, however, the virtual machine does a normal shutdown.

Comment 2 pm-sat@redhat.com 2017-02-12 09:05:40 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18319 has been resolved.

Comment 4 Ondřej Pražák 2017-08-09 12:12:12 UTC
Verified.

Sat-6.3.0 snap 10

Comment 5 pm-sat@redhat.com 2018-02-21 16:51:07 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-2018:0336


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