cmd

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: AGPL-3.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const HammerBanner = `` /* 212-byte string literal not displayed */

HammerBanner our mighty logo.

Variables

This section is empty.

Functions

func Run

func Run(spec *Specification, hal hal.InBand) (*event.EventEmitter, error)

Run orchestrates the whole register/wipe/format/burn and reboot process

func StartSSHD

func StartSSHD(ip string) error

StartSSHD will start sshd to be able to diagnose problems on the pxe bootet machine.

Types

type GrpcClient added in v0.7.2

type GrpcClient struct {
	*event.EventEmitter
	// contains filtered or unexported fields
}

func NewGrpcClient added in v0.7.2

func NewGrpcClient(certsClient certs.ClientService, emitter *event.EventEmitter) (*GrpcClient, error)

NewGrpcClient fetches the address and certificates from metal-core needed to communicate with metal-api via grpc, and returns a new grpc client that can be used to invoke all provided grpc endpoints.

func (*GrpcClient) NewWaitClient added in v0.7.2

func (c *GrpcClient) NewWaitClient() (v1.WaitClient, io.Closer, error)

func (*GrpcClient) WaitForAllocation added in v0.7.2

func (c *GrpcClient) WaitForAllocation(machineID string) error

type Hammer

type Hammer struct {
	Spec         *Specification
	Hal          hal.InBand
	Client       machine.ClientService
	GrpcClient   *GrpcClient
	EventEmitter *event.EventEmitter
	Disk         storage.Disk
	LLDPClient   *network.LLDPClient
	// IPAddress is the ip of the eth0 interface during installation
	IPAddress          string
	Started            time.Time
	ChrootPrefix       string
	OsImageDestination string
}

Hammer is the machine which forms a bare metal to a working server

func (*Hammer) ConfigureBIOS added in v0.5.3

func (h *Hammer) ConfigureBIOS() error

ConfigureBIOS ensures that UEFI boot is enabled and CSM-support is disabled. It then reboots the machine.

func (*Hammer) EnsureBootOrder

func (h *Hammer) EnsureBootOrder(bootloaderID string) error

EnsureBootOrder ensures that the BIOS boot order is properly set, i.e. first boot from OS image and then PXE boot

func (*Hammer) Install

Install a given image to the disk by using genuinetools/img

type InstallerConfig

type InstallerConfig struct {
	// Hostname of the machine
	Hostname string `yaml:"hostname"`
	// Networks all networks connected to this machine
	Networks []*models.ModelsV1MachineNetwork `yaml:"networks"`
	// MachineUUID is the unique UUID for this machine, usually the board serial.
	MachineUUID string `yaml:"machineuuid"`
	// SSHPublicKey of the user
	SSHPublicKey string `yaml:"sshpublickey"`
	// Password is the password for the metal user.
	Password string `yaml:"password"`
	// Devmode passes mode of installation.
	Devmode bool `yaml:"devmode"`
	// Console specifies where the kernel should connect its console to.
	Console string `yaml:"console"`
	// Timestamp is the the timestamp of installer config creation.
	Timestamp string `yaml:"timestamp"`
	// Nics are the network interfaces of this machine including their neighbors.
	Nics []*models.ModelsV1MachineNicExtended `yaml:"nics"`
}

InstallerConfig contains configuration items which are consumed by the install.sh of the individual target OS.

type Specification

type Specification struct {
	// Debug turn on debug log
	Debug bool
	// MetalCoreURL is the endpoint URL where the metalcore reside
	MetalCoreURL string
	// ImageURL if given grabs a fixed OS image to install, only suitable in DevMode
	ImageURL string
	// ImageID if given defines the image.ID which normally comes from a allocation
	// can be something like ubuntu-18.04, alpine-3.9 or "default"
	// only suitable in DevMode
	ImageID string
	// SizeID if given defines the size.ID which normally comes from a allocation
	// can be something like v1-small-x86
	// only suitable in DevMode
	SizeID string
	// DevMode turn on devmode which prevents failing in some situations
	DevMode bool
	// BGPEnabled if set to true real bgp configuration is configured, otherwise dhcp will be used
	BGPEnabled bool
	// Cidr of BGP interface in DEV Mode
	Cidr string
	// ConsolePassword of the metal user valid for one day.
	ConsolePassword string
	// MachineUUID is the unique identifier of this machine
	MachineUUID string
	// IP of this instance
	IP string
}

Specification defines configuration items of the application

func NewSpec

func NewSpec() *Specification

NewSpec fills Specification with configuration made by kernel commandline

func (*Specification) Log

func (s *Specification) Log()

Log print configuration options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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