Smart proxy idea: hard power control by networked PDUs

My site uses networked PDUs (power distribution unit) to control power to
our machines. We use these whenever a BMC gets wedged badly enough to
require a cold power cycle. It would be neat if the Smart proxy supported
our PDUs and held information in the Host entry about which PDU sockets a
host was connected to (will be several sockets if there's a redundant power
supply of course). Many PDUs also provide environmental monitoring, which
would be pretty awesome to chart in Foreman (another day for that).

Is anybody else interested in this? How / where might I structure this in
Foreman? My initial thought is to structure it like Interfaces, so: a Host
can have many Powersupplies. A Powersupply has a socket number, an IP,
username, password, and type (e.g. manufacturer). But really I'm going to
install a few big PDUs, would want to enter their info once. Each host is
just a socket on the PDU. So I'd normalize it a bit:

Pdu:
IP, username, password, type
How do I know which proxy to talk to? Subnet of the PDU's IP?

Host :has_many Pdu_socket
pdu_id, socket number

Does this look like a sane start?

Cheers,
Aaron

> My site uses networked PDUs (power distribution unit) to control power to
> our machines. We use these whenever a BMC gets wedged badly enough to
> require a cold power cycle. It would be neat if the Smart proxy supported
> our PDUs and held information in the Host entry about which PDU sockets a
> host was connected to (will be several sockets if there's a redundant power
> supply of course). Many PDUs also provide environmental monitoring, which
> would be pretty awesome to chart in Foreman (another day for that).
>
+1

>
> Is anybody else interested in this? How / where might I structure this in
> Foreman? My initial thought is to structure it like Interfaces, so: a Host
> can have many Powersupplies. A Powersupply has a socket number, an IP,
> username, password, and type (e.g. manufacturer). But really I'm going to
> install a few big PDUs, would want to enter their info once. Each host is
> just a socket on the PDU. So I'd normalize it a bit:
>
> Pdu:
> IP, username, password, type
> How do I know which proxy to talk to? Subnet of the PDU's IP?
>

We already have something very similar for the BMC functionality, and I'm
wondering if its not another provider for BMC.

The assumption is that the proxy has no state, and as such, it doesn't
really matter which one you use, the relevant code in foreman tries to find
the best proxy to use at [1]

>
>

> Host :has_many Pdu_socket
> pdu_id, socket number
>
> Does this look like a sane start?
>

Indeed… sounds like a useful plugin!

Thanks!
Ohad

[1]

··· On Sun, Oct 27, 2013 at 4:48 AM, Aaron Stone wrote:

I think that is a great idea. I would approach this as a library like I
did with rubyipmi. You would need to create a generic interface that works
with multiple PDU vendors and then add to smart proxy. There may already
be a gem library that handles this. I know the fence library has support
for APC devices and other PDUs.

https://access.redhat.com/site/articles/28603

Luckily you only have a few tasks to automate. You could use the curb or
restclient gem if its via a rest interface. I used to use APC which had a
telnet and Web interface. Utilizing the fence API maybe an easy way out
though so I would look there first.

Corey

··· On Saturday, October 26, 2013 7:48:21 PM UTC-7, Aaron Stone wrote: > > My site uses networked PDUs (power distribution unit) to control power to > our machines. We use these whenever a BMC gets wedged badly enough to > require a cold power cycle. It would be neat if the Smart proxy supported > our PDUs and held information in the Host entry about which PDU sockets a > host was connected to (will be several sockets if there's a redundant power > supply of course). Many PDUs also provide environmental monitoring, which > would be pretty awesome to chart in Foreman (another day for that). > > Is anybody else interested in this? How / where might I structure this in > Foreman? My initial thought is to structure it like Interfaces, so: a Host > can have many Powersupplies. A Powersupply has a socket number, an IP, > username, password, and type (e.g. manufacturer). But really I'm going to > install a few big PDUs, would want to enter their info once. Each host is > just a socket on the PDU. So I'd normalize it a bit: > > Pdu: > IP, username, password, type > How do I know which proxy to talk to? Subnet of the PDU's IP? > > Host :has_many Pdu_socket > pdu_id, socket number > > Does this look like a sane start? > > Cheers, > Aaron >