ipmi

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2026 License: GPL-3.0, LGPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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.

View Source
const (
	BackendIpmipower = "ipmipower"
	BackendIpmitool  = "ipmitool"
)

Backends names the supported backends.

Variables

This section is empty.

Functions

func Actions

func Actions() []string

Actions lists the power actions, for help text and completion.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL