Bug 1348657

Summary: Power Control does not appear to work
Product: Red Hat Satellite Reporter: Thom Carlin <tcarlin>
Component: Power & BMCAssignee: Lukas Zapletal <lzap>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, cwelton, jmatthew, lzap, tcarlin
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-08 07:24:28 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:

Description Thom Carlin 2016-06-21 16:44:52 UTC
Description of problem:

Attempting to power control a system 

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

6.2 beta

How reproducible:

100% for me

Steps to Reproduce:
1. Install QCI 1.2 (Sat 6.2) on bare metal
2. Log in to run launch-fusor-installer (a.k.a. Sat 6.2)
3. Power on host(s)
4. Verify host(s) are discovered
5. Deploy RHEV (a.k.a. Hosts > All Hosts, select host(s)
6. Select Action, Change Power State

Actual results:

Power states do not appear to change

Expected results:

Power states to change as requested
Some method of showing errors/power state

Additional info:

BMC controls through vendor-supplied utility or IPMITOOL work

Comment 1 Thom Carlin 2016-06-21 17:27:37 UTC
I see in production.log 
2016-06-21 12:31:46 [app] [I] Completed 200 OK in 100ms (Views: 95.7ms | ActiveRecord: 1.4ms)
2016-06-21 12:31:51 [app] [I] Started POST "/hosts/update_multiple_power_state?host_ids%5B%5D=2" for <ip_address> at 2016-06-21 12:31:51 -0400
2016-06-21 12:31:51 [app] [I] Processing by HostsController#update_multiple_power_state as HTML
2016-06-21 12:31:51 [app] [I]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"<token>", "power"=>{"action"=>"poweroff"}, "host_ids"=>["2"]}
2016-06-21 12:31:51 [app] [I] Redirected to https://hp-dl320e-03.cfme.lab.eng.rdu2.redhat.com/hosts
2016-06-21 12:31:51 [app] [I] Completed 302 Found in 10ms (ActiveRecord: 2.2ms)

and 
2016-06-21 12:28:55 [app] [I] Started GET "/hosts" for <same_ip> at 2016-06-21 12:28:55 -0400

In proxy.log:
ERROR -- : Attempt to remove nonexistent client certificate for <hostname>

Comment 4 Lukas Zapletal 2016-06-25 08:25:39 UTC
Bare metal BMC is not configured by default in Satellite 6, you need to enable the plugin on Capsule and then integrate it with your hosts. I don't think this is even documented in our docs.

https://theforeman.org/manuals/1.11/index.html#4.3.3BMC

If you are using PXE provisioning for virtualized hosts (and not using Compute Resource), the Foreman does not know these hosts are virtualized and power capability is not even turned on for them.

There is a RFE to detect virtual platforms and enable power capabilities, but that's a different story.

Note BMC and Power are two different capabilities. I am not sure which one you expect to work, none of them will work by default, the other one will only work when using Compute Resources.

Please confirm, I think this is NOTABUG.

Comment 6 Lukas Zapletal 2016-07-08 07:24:28 UTC
BMC power buttons are only available when you have at least one BMC NIC with username and password set:

  def bmc_available?
    ipmi = bmc_nic
    return false if ipmi.nil?
    ipmi.password.present? && ipmi.username.present? && ipmi.provider == 'IPMI'
  end

Compute resource power buttons are only available if you manage a virtual host.

I am closing this, if you want to improve something, please report upstream only feature and we will triage it. Thanks!