Project

General

Profile

Bug #18319

"hammer host stop --force" power cycles virtual machine

Added by Stefan Meyer over 3 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Hammer core
Difficulty:
trivial
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Problem Description:
Using "hammer host stop --force --id <some guest>" is power cycling the virtual machine instead of powering it off immediately.

Troubleshooting:
I was able to reproduce this on Satellite 6.2.7 and
- vSphere Version 6.0.0 Build 2997665
- RHV 4
- libvirt

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 powerdown.

To test it i replaced :cycle with :poweroff and it works fine with vmware and libvirt. On RHV4 the system does a normal shutdown.

I will create a PR for this.

Associated revisions

Revision a6b419c9 (diff)
Added by Stefan Meyer over 3 years ago

Fixes #18319 - poweroff hosts when using --force option

History

#1 Updated by The Foreman Bot over 3 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli-foreman/pull/280 added

#2 Updated by Tomáš Strachota over 3 years ago

  • Bugzilla link set to 1417976

#3 Updated by Tomáš Strachota over 3 years ago

  • Target version set to 1.11.2

#4 Updated by Stefan Meyer over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Tomáš Strachota over 3 years ago

  • Legacy Backlogs Release (now unused) set to 234

Also available in: Atom PDF