Documentation
¶
Overview ¶
Package ipmi drives the FreeIPMI and ipmitool backends that talk to service processors over the management network.
The tools run on the host that has a route into that network, usually the management gateway, and clusterctl reaches them over ssh. The password never appears in an argument vector: it is streamed over stdin into a file the backend reads and that is removed again, because ps on a shared gateway shows every argument to every user.
Index ¶
Constants ¶
const ( ActionStatus = "status" ActionOn = "on" ActionOff = "off" ActionCycle = "cycle" ActionReset = "reset" // ActionSoft asks the operating system to shut down, which ipmitool // calls soft and FreeIPMI calls soft-shutdown. ActionSoft = "soft" )
The power actions the backends understand.
const ( BackendIpmipower = "ipmipower" BackendIpmitool = "ipmitool" )
Backends names the supported backends.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
// Runner executes the command, usually over ssh.
Runner transport.Runner
// Target is the host the tool runs on.
Target transport.Target
// Spec is the IPMI configuration of the site.
Spec v1alpha1.IPMISpec
// Username and Password authenticate with the service processors.
Username string
Password string
}
Backend runs an IPMI tool on a host that can reach the service network.
func (*Backend) Power ¶
func (b *Backend) Power(ctx context.Context, action string, bmcs *nodeset.NodeSet) ([]Status, error)
Power runs a power action against a set of service processors.
The whole set is handed to the backend in one call, because both tools take a host list and contacting a thousand processors one ssh connection at a time is what made the shell version unusable at scale.
type Status ¶
type Status struct {
// BMC is the service processor that was asked.
BMC string `json:"bmc" yaml:"bmc"`
// State is the power state it reported, or the outcome of the action.
State string `json:"state" yaml:"state"`
// Err is set when the tool reported a problem for this host.
Err string `json:"error,omitempty" yaml:"error,omitempty"`
}
Status is what one service processor answered.