Documentation ¶
Index ¶
- func Launch() error
- func NewProvisioner(ctx context.Context) (provision.Provisioner, error)
- type Arch
- type Controller
- func (c *Controller) CommandsCh() <-chan VMCommand
- func (c *Controller) ForcePXEBoot() bool
- func (c *Controller) PXEBootOnce() error
- func (c *Controller) PowerOff() error
- func (c *Controller) PowerOn() error
- func (c *Controller) PowerState() PowerState
- func (c *Controller) Reboot() error
- func (c *Controller) Status() vm.Status
- type LaunchConfig
- type PFlash
- type PowerState
- type VMCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Launch ¶
func Launch() error
Launch a control process around qemu VM manager.
This function is invoked from 'talosctl qemu-launch' hidden command and wraps starting, controlling 'qemu' VM process.
Launch restarts VM forever until control process is stopped itself with a signal.
Process is expected to receive configuration on stdin. Current working directory should be cluster state directory, process output should be redirected to the logfile in state directory.
When signals SIGINT, SIGTERM are received, control process stops qemu and exits.
nolint: gocyclo
func NewProvisioner ¶
func NewProvisioner(ctx context.Context) (provision.Provisioner, error)
NewProvisioner initializes qemu provisioner.
Types ¶
type Arch ¶
type Arch string
Arch abstracts away differences between different architectures.
func (Arch) Console ¶
Console defines proper argument for the kernel to send logs to serial console.
func (Arch) QemuMachine ¶
QemuMachine defines the machine type for qemu.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller supports IPMI-like machine control.
func NewController ¶
func NewController() *Controller
NewController initializes controller in "powered on" state.
func (*Controller) CommandsCh ¶
func (c *Controller) CommandsCh() <-chan VMCommand
CommandsCh returns channel with commands.
func (*Controller) ForcePXEBoot ¶
func (c *Controller) ForcePXEBoot() bool
ForcePXEBoot returns whether next boot should be PXE boot.
func (*Controller) PXEBootOnce ¶
func (c *Controller) PXEBootOnce() error
PXEBootOnce implements vm.Controller interface.
func (*Controller) PowerOff ¶
func (c *Controller) PowerOff() error
PowerOff implements vm.Controller interface.
func (*Controller) PowerOn ¶
func (c *Controller) PowerOn() error
PowerOn implements vm.Controller interface.
func (*Controller) PowerState ¶
func (c *Controller) PowerState() PowerState
PowerState returns current power state.
func (*Controller) Reboot ¶
func (c *Controller) Reboot() error
Reboot implements vm.Controller interface.
func (*Controller) Status ¶
func (c *Controller) Status() vm.Status
Status implements vm.Controller interface.
type LaunchConfig ¶
type LaunchConfig struct { StatePath string // VM options DiskPath string VCPUCount int64 MemSize int64 QemuExecutable string KernelImagePath string InitrdPath string PFlashImages []string KernelArgs string MachineType string EnableKVM bool BootloaderEnabled bool NodeUUID uuid.UUID // Talos config Config string // Network NetworkConfig *libcni.NetworkConfigList CNI provision.CNIConfig IP net.IP CIDR net.IPNet Hostname string GatewayAddr net.IP MTU int Nameservers []net.IP // PXE TFTPServer string BootFilename string IPXEBootFileName string // API APIPort int // contains filtered or unexported fields }
LaunchConfig is passed in to the Launch function over stdin.
type PowerState ¶
type PowerState string
PowerState is current VM power state.
const ( PoweredOn PowerState = "on" PoweredOff PowerState = "off" )
Virtual machine power state.