Documentation ¶
Index ¶
Constants ¶
const HammerBanner = `` /* 212-byte string literal not displayed */
HammerBanner our mighty logo.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(spec *Specification) (*event.EventEmitter, error)
Run orchestrates the whole register/wipe/format/burn and reboot process
Types ¶
type Hammer ¶
type Hammer struct { Client *machine.Client Spec *Specification Disk storage.Disk LLDPClient *network.LLDPClient // IPAddress is the ip of the eth0 interface during installation IPAddress string Started time.Time EventEmitter *event.EventEmitter ChrootPrefix string OsImageDestination string }
Hammer is the machine which forms a bare metal to a working server
func (*Hammer) EnsureBootOrder ¶
EnsureBootOrder ensures that the BIOS boot order is properly set, i.e. first boot from OS image and then PXE boot. Will be skipped in dev mode.
func (*Hammer) EnsureUEFI ¶
EnsureUEFI ensures that UEFI boot is enabled and reboots the machine if required and not in dev mode.
func (*Hammer) Install ¶
func (h *Hammer) Install(machine *models.ModelsV1MachineResponse, nics []*models.ModelsV1MachineNicExtended) (*kernel.Bootinfo, error)
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(ip string) *Specification
NewSpec fills Specification with configuration made by kernel commandline