Project

General

Profile

Bug #6518

foreman sometimes picks the wrong bmc smart proxy

Added by Brian Witt about 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
BMC
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

We have a setup with several smart proxies. Sometimes when loading a host page and clicking on the 'BMC' tab, we'll see
Failure: ERF12-1772 [ProxyAPI::ProxyException]: Unable to perform power BMC operation ([RestClient::BadRequest]: 400 Bad Request) for proxy <wrong smart proxy>

Somehow it's picking the wrong smart proxy, even though all the settings are correct. (subnet for the bmc interface is correct, ip address, mac is correct)

AND it seems to work 4/5 of the time, only picking the wrong one 1 out of 5.

Associated revisions

Revision 57a32e98 (diff)
Added by Daniel Lobato Garcia almost 5 years ago

Fixes #6518 - look up the BMC proxy via any subnet proxies, if present

Revision fe102b16 (diff)
Added by Aaron Stone about 4 years ago

Refs #6518 - Use #find instead of #select #first to choose a BMC proxy for the subnet

Enumerable#find more idiomatic in Ruby, and since it stops at the first match it
may be marginally faster.

History

#2 Updated by Dominic Cleal about 5 years ago

  • Category set to BMC
  • Status changed from New to Ready For Testing
  • Assignee set to Brian Witt
  • Target version set to 1.8.0

#3 Updated by Brian Witt about 5 years ago

I forgot to mention, that in those lines in app/models/nic/bmc.rb:28-29

SmartProxy.with_features("BMC").joins(:subnets).where(['dhcp_id = ? or tftp_id = ?', subnet_id, subnet_id]).first if subnet_id
proxy ||= SmartProxy.with_features("BMC").first

seems to always fail (i.e. it always picks the 'first' one), even when foreman picks the right proxy (or at least I see the status appear on the bmc tab). So I'm not sure what's going on there.

#4 Updated by Brian Witt about 5 years ago

The 'first' one is not reachable by foreman normally, so when it fails I see a connection error to that first smart proxy. The other times when it works I presume it's actually talking to the right smart proxy, even though the 'proxy' var in the code is set to the 'first' (unreachable) one.

#5 Updated by The Foreman Bot almost 5 years ago

  • Pull request https://github.com/theforeman/foreman/pull/1608 added

#6 Updated by Dominic Cleal almost 5 years ago

  • Legacy Backlogs Release (now unused) set to 10

#7 Updated by Daniel Lobato Garcia almost 5 years ago

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

Also available in: Atom PDF