vm

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: AGPL-3.0 Imports: 22 Imported by: ? 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

Index

Constants

View Source
const VMDriverID common.NodeDriverID = "vm"

Variables

This section is empty.

Functions

func NewVMDriverFromConfig

func NewVMDriverFromConfig(ctx common.NodeContext, c *any) (common.NodeDriver, error)

Types

type OverlayImage

type OverlayImage struct {
	ID       uuid.UUID
	FilePath string
}

func CreateOverlay

func CreateOverlay(nodeName, imagePath string) (*OverlayImage, error)

func (*OverlayImage) Cleanup

func (o *OverlayImage) Cleanup()

type VMBios added in v0.2.7

type VMBios struct {
	Loader        string `json:"loader,omitempty"`
	NVRam         string `json:"nvram,omitempty"`
	NVRamTemplate string `json:"nvram_template,omitempty"`
	Secure        bool   `json:"secure,omitempty"`
}

type VMConfig

type VMConfig struct {
	Machine       string      `json:"machine,omitempty"`
	Accel         []string    `json:"accel,omitempty"`
	CPU           string      `json:"cpu,omitempty"`
	Memory        int         `json:"memory,omitempty"`
	SMP           string      `json:"smp,omitempty"`
	Serial        string      `json:"serial,omitempty"`
	Bios          *VMBios     `json:"bios,omitempty"`
	TPM           *VMTPM      `json:"tpm,omitempty"`
	Graphics      *VMGraphics `json:"graphics,omitempty"`
	Drives        []VMDrive   `json:"drives,omitempty"`
	Netdev        []VMNetdev  `json:"netdev,omitempty"`
	Params        []string    `json:"params,omitempty"`
	LibVirtSocket *string     `json:"libvirt_socket,omitempty"`
}

type VMDrive

type VMDrive struct {
	File   string `json:"file,omitempty"`
	Format string `json:"format,omitempty"`
	If     string `json:"if,omitempty"`
	Media  string `json:"media,omitempty"`
	Index  string `json:"index,omitempty"`
	Resize string `json:"resize,omitempty"`
}

type VMDriver

type VMDriver struct {
	// contains filtered or unexported fields
}

func (*VMDriver) Config

func (q *VMDriver) Config() common.NodeDriverConfig

func (*VMDriver) ID

func (q *VMDriver) ID() common.NodeDriverID

func (*VMDriver) Info

func (q *VMDriver) Info() (common.NodeDriverInfo, error)

func (*VMDriver) PowerOff

func (q *VMDriver) PowerOff() error

func (*VMDriver) PowerOn

func (q *VMDriver) PowerOn(cloudInit *cloudinit.CloudInit) error

func (*VMDriver) Restart

func (q *VMDriver) Restart(_ string, _ uint32) error

func (*VMDriver) Shutdown

func (q *VMDriver) Shutdown(_ string, _ uint32) error

func (*VMDriver) State

func (q *VMDriver) State() (common.NodeState, error)

func (*VMDriver) UpdateStatus added in v0.2.7

func (q *VMDriver) UpdateStatus() (common.NodeStatus, error)

type VMGraphics added in v0.2.7

type VMGraphics struct {
	Type   string `json:"type,omitempty"`
	Listen string `json:"listen,omitempty"`
	Port   int    `json:"port,omitempty"`
	Video  string `json:"video,omitempty"`
}

type VMNetdev

type VMNetdev struct {
	Type       string   `json:"type,omitempty"`
	ID         string   `json:"id,omitempty"`
	Ifname     string   `json:"ifname,omitempty"`
	Script     string   `json:"script,omitempty"`
	Downscript string   `json:"downscript,omitempty"`
	BR         string   `json:"br,omitempty"`
	Helper     string   `json:"helper,omitempty"`
	Net        string   `json:"net,omitempty"`
	DHCPStart  string   `json:"dhcpstart,omitempty"`
	Hostfwd    []string `json:"hostfwd,omitempty"`
	Mac        string   `json:"mac,omitempty"`
}

type VMNodeMetadata

type VMNodeMetadata struct {
	Drives map[int]OverlayImage `json:"overlay_drives"`
}

VMNodeMetadata is persisted in the nodes repository and used to rehydrate the libvirt domain XML across agent restarts.

type VMTPM added in v0.2.7

type VMTPM struct {
	Model   string `json:"model,omitempty"`
	Version string `json:"version,omitempty"`
}

Jump to

Keyboard shortcuts

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