microvm

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: 26 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 MicroVMDriverID common.LoadDriverID = "microvm"

Variables

This section is empty.

Functions

func NewMicroVMDriver

func NewMicroVMDriver(c any) (common.LoadDriver, error)

Types

type BootPlan

type BootPlan struct {
	KernelPath string
	InitrdPath string
	BootArgs   string
	Drives     map[int]OverlayImage
}

type FCBalloon

type FCBalloon struct {
	AmountMiB             int  `json:"amount_mib,omitempty"`
	DeflateOnOOM          bool `json:"deflate_on_oom,omitempty"`
	StatsPollingIntervalS int  `json:"stats_polling_interval_s,omitempty"`
}

type FCConfig

type FCConfig struct {
	Binary    string     `json:"binary,omitempty"`
	Kernel    string     `json:"kernel,omitempty"`
	Initrd    string     `json:"initrd,omitempty"`
	BootArgs  string     `json:"boot_args,omitempty"`
	Memory    int        `json:"memory,omitempty"`
	VCPUs     int        `json:"vcpus,omitempty"`
	SMT       bool       `json:"smt,omitempty"`
	Drives    []FCDrive  `json:"drives,omitempty"`
	Netdev    []FCNetdev `json:"netdev,omitempty"`
	Vsock     *FCVsock   `json:"vsock,omitempty"`
	Balloon   *FCBalloon `json:"balloon,omitempty"`
	APISocket string     `json:"api_socket,omitempty"`
}

type FCDrive

type FCDrive struct {
	File     string `json:"file,omitempty"`
	ID       string `json:"id,omitempty"`
	Root     bool   `json:"root,omitempty"`
	ReadOnly bool   `json:"read_only,omitempty"`
	Resize   string `json:"resize,omitempty"`
}

type FCNetdev

type FCNetdev struct {
	ID  string `json:"id,omitempty"`
	Tap string `json:"tap,omitempty"`
	BR  string `json:"br,omitempty"`
	Mac string `json:"mac,omitempty"`
}

type FCNodeMetadata

type FCNodeMetadata struct {
	PID        int                  `json:"pid"`
	APISocket  string               `json:"api_socket"`
	KernelPath string               `json:"kernel_path"`
	InitrdPath string               `json:"initrd_path,omitempty"`
	BootPlan   BootPlan             `json:"boot_plan"`
	Drives     map[int]OverlayImage `json:"overlay_drives"`
}

type FCVsock

type FCVsock struct {
	CID uint32 `json:"cid,omitempty"`
	UDS string `json:"uds,omitempty"`
}

type MicroVMConfig

type MicroVMConfig struct {
	Binary   string     `json:"binary,omitempty"`
	Kernel   string     `json:"kernel,omitempty"`
	Initrd   string     `json:"initrd,omitempty"`
	BootArgs string     `json:"boot_args,omitempty"`
	Memory   int        `json:"memory,omitempty"`
	VCPUs    int        `json:"vcpus,omitempty"`
	SMT      bool       `json:"smt,omitempty"`
	Drives   []FCDrive  `json:"drives,omitempty"`
	Netdev   []FCNetdev `json:"netdev,omitempty"`
	Balloon  *FCBalloon `json:"balloon,omitempty"`
}

type MicroVMDriver

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

func (*MicroVMDriver) Config

func (*MicroVMDriver) Deprovision

func (m *MicroVMDriver) Deprovision(repository common.DeploymentsRepository, deployment common.Deployment) error

func (*MicroVMDriver) ID

func (*MicroVMDriver) Info

func (*MicroVMDriver) Kill

func (m *MicroVMDriver) Kill(repository common.DeploymentsRepository, deployment common.Deployment) error

func (*MicroVMDriver) Provision

func (m *MicroVMDriver) Provision(nodeDriver common.NodeDriver, repository common.DeploymentsRepository, loadName string) (common.DeploymentID, error)

func (*MicroVMDriver) ReadStderr

func (m *MicroVMDriver) ReadStderr(repository common.DeploymentsRepository, deployment common.Deployment, offset int64) ([]byte, int64, error)

func (*MicroVMDriver) ReadStdout

func (m *MicroVMDriver) ReadStdout(repository common.DeploymentsRepository, deployment common.Deployment, offset int64) ([]byte, int64, error)

func (*MicroVMDriver) Start

func (m *MicroVMDriver) Start(repository common.DeploymentsRepository, deployment common.Deployment) error

func (*MicroVMDriver) Stop

func (m *MicroVMDriver) Stop(repository common.DeploymentsRepository, deployment common.Deployment) error

func (*MicroVMDriver) StreamStderr

func (m *MicroVMDriver) StreamStderr(repository common.DeploymentsRepository, deployment common.Deployment, w io.Writer) error

func (*MicroVMDriver) StreamStdout

func (m *MicroVMDriver) StreamStdout(repository common.DeploymentsRepository, deployment common.Deployment, w io.Writer) error

func (*MicroVMDriver) UpdateStatus

type MicroVMEntryMetadata

type MicroVMEntryMetadata struct {
	VMName     string               `json:"vm_name"`
	PID        int                  `json:"pid"`
	APISocket  string               `json:"api_socket"`
	KernelPath string               `json:"kernel_path"`
	InitrdPath string               `json:"initrd_path,omitempty"`
	BootPlan   BootPlan             `json:"boot_plan"`
	Drives     map[int]OverlayImage `json:"overlay_drives"`
	StdoutPath string               `json:"stdout_path,omitempty"`
	StderrPath string               `json:"stderr_path,omitempty"`
}

type OverlayImage

type OverlayImage struct {
	ID       uuid.UUID
	FilePath string
}

OverlayImage is a per-load writable copy of a base image, so a cached base image is never mutated by a running microVM.

func CreateOverlay

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

func (*OverlayImage) Cleanup

func (o *OverlayImage) Cleanup()

Jump to

Keyboard shortcuts

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