vm

package
v0.4.7-rc6 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FCSockDir where vm firecracker sockets are kept
	FCSockDir = "/var/run/firecracker"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Boot

type Boot struct {
	Kernel string `json:"kernel_image_path"`
	Initrd string `json:"initrd_path,omitempty"`
	Args   string `json:"boot_args"`
}

Boot config struct

type Config

type Config struct {
	CPU       uint8 `json:"vcpu_count"`
	Mem       int64 `json:"mem_size_mib"`
	HTEnabled bool  `json:"ht_enabled"`
}

Config struct

type Drive

type Drive struct {
	ID         string `json:"drive_id"`
	Path       string `json:"path_on_host"`
	RootDevice bool   `json:"is_root_device"`
	ReadOnly   bool   `json:"is_read_only"`
}

Drive struct

type Interface

type Interface struct {
	ID  string `json:"iface_id"`
	Tap string `json:"host_dev_name"`
	Mac string `json:"guest_mac,omitempty"`
}

Interface nic struct

type Jailed added in v0.4.9

type Jailed struct {
	Machine
	Root string `json:"-"`
}

Jailed represents a jailed machine.

func JailedFromPath added in v0.4.9

func JailedFromPath(root string) (*Jailed, error)

JailedFromPath loads a jailed machine from given path. the root points to directory which has `config.json` from a previous Save() call

func (*Jailed) Log added in v0.4.9

func (j *Jailed) Log(base string) string

Log returns machine log file path

func (*Jailed) Save added in v0.4.9

func (j *Jailed) Save() error

Save configuration

func (*Jailed) Start added in v0.4.9

func (j *Jailed) Start(ctx context.Context) error

Start starts the machine.

type Machine

type Machine struct {
	ID         string      `json:"-"`
	Boot       Boot        `json:"boot-source"`
	Drives     []Drive     `json:"drives"`
	Interfaces []Interface `json:"network-interfaces"`
	Config     Config      `json:"machine-config"`
}

Machine struct

func (*Machine) Jail added in v0.4.9

func (m *Machine) Jail(base string) (*Jailed, error)

Jail will move files to module base and returned a jailed machine.

type Module added in v0.4.9

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

Module implements the VMModule interface

func NewVMModule

func NewVMModule(cl zbus.Client, root string) (*Module, error)

NewVMModule creates a new instance of vm manager

func (*Module) Delete added in v0.4.9

func (m *Module) Delete(name string) error

Delete deletes a machine by name (id)

func (*Module) Exists added in v0.4.9

func (m *Module) Exists(id string) bool

Exists checks if firecracker process running for this machine

func (*Module) Inspect added in v0.4.9

func (m *Module) Inspect(name string) (pkg.VMInfo, error)

Inspect a machine by name

func (*Module) Monitor added in v0.4.9

func (m *Module) Monitor(ctx context.Context)

Monitor start vms monitoring

func (*Module) Run added in v0.4.9

func (m *Module) Run(vm pkg.VM) error

Run vm

Jump to

Keyboard shortcuts

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