vm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Creator

type Creator interface {
	Create(
		apiv1.AgentID,
		bstem.Stemcell,
		apiv1.VMCloudProps,
		apiv1.Networks,
		apiv1.VMEnv,
	) (VM, error)
}

type Factory

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

func NewFactory

func NewFactory(
	opts FactoryOpts,
	uuidGen boshuuid.Generator,
	driver driver.Driver,
	runner driver.Runner,
	diskFactory bdisk.Factory,
	agentOptions apiv1.AgentOptions,
	stemcellAPIVersion apiv1.StemcellAPIVersion,
	logger boshlog.Logger,
) Factory

func (Factory) Create

func (f Factory) Create(
	agentID apiv1.AgentID,
	stemcell bstem.Stemcell,
	props apiv1.VMCloudProps,
	networks apiv1.Networks,
	env apiv1.VMEnv,
) (VM, error)

func (Factory) Find

func (f Factory) Find(cid apiv1.VMCID) (VM, error)

type FactoryOpts added in v0.0.6

type FactoryOpts struct {
	DirPath            string
	StorageController  string
	AutoEnableNetworks bool
}

type Finder

type Finder interface {
	Find(apiv1.VMCID) (VM, error)
}

type Host added in v0.0.7

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

func (Host) EnableNetworks added in v0.0.7

func (h Host) EnableNetworks(nets Networks) error

func (Host) FindNetwork added in v0.0.9

func (h Host) FindNetwork(net Network) (bnet.Network, error)

type ISO9660

type ISO9660 struct {
	FileName string
	Contents []byte
}

More or less vendored from https://github.com/johto/iso9660wrap/blob/master/iso9660wrap.go

func (ISO9660) Bytes

func (i ISO9660) Bytes() ([]byte, error)

type NICs

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

func (NICs) Configure

func (n NICs) Configure(nets Networks, host Host) error

type Network

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

func NewNetwork added in v0.0.10

func NewNetwork(net apiv1.Network) (Network, error)

func (Network) CloudPropertyName

func (n Network) CloudPropertyName() string

func (Network) CloudPropertyType

func (n Network) CloudPropertyType() string

func (Network) Gateway

func (n Network) Gateway() string

func (Network) IP

func (n Network) IP() string

func (Network) Netmask

func (n Network) Netmask() string

func (Network) SetMAC added in v0.0.10

func (n Network) SetMAC(mac string)

type NetworkCloudProps added in v0.0.10

type NetworkCloudProps struct {
	Name string
	Type string
}

type Networks

type Networks map[string]Network

func NewNetworks added in v0.0.10

func NewNetworks(nets apiv1.Networks) (Networks, error)

func (Networks) AsNetworks added in v0.0.10

func (ns Networks) AsNetworks() apiv1.Networks

type SharedFolder added in v0.0.10

type SharedFolder struct {
	HostPath string `json:"host_path"`
}

type Store

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

func NewStore

func NewStore(path string, runner driver.Runner) Store

func (Store) Delete

func (m Store) Delete() error

func (Store) DeleteOne

func (m Store) DeleteOne(key string) error

func (Store) Get

func (m Store) Get(key string) ([]byte, error)

func (Store) List

func (m Store) List() ([]string, error)

func (Store) Path

func (m Store) Path(key string) string

func (Store) Put

func (m Store) Put(key string, contents []byte) error

type VM

type VM interface {
	ID() apiv1.VMCID
	SetMetadata(apiv1.VMMeta) error

	Reboot() error
	Exists() (bool, error)
	Delete() error

	DiskIDs() ([]apiv1.DiskCID, error)
	AttachDisk(bdisk.Disk) (apiv1.DiskHint, error)
	AttachEphemeralDisk(bdisk.Disk) error
	DetachDisk(bdisk.Disk) error
}

type VMImpl

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

func NewVMImpl

func NewVMImpl(
	cid apiv1.VMCID,
	portDevices bpds.PortDevices,
	store Store,
	stemcellAPIVersion apiv1.StemcellAPIVersion,
	driver driver.Driver,
	logger boshlog.Logger,
) VMImpl

func (VMImpl) AttachDisk

func (vm VMImpl) AttachDisk(disk bdisk.Disk) (apiv1.DiskHint, error)

func (VMImpl) AttachEphemeralDisk

func (vm VMImpl) AttachEphemeralDisk(disk bdisk.Disk) error

func (VMImpl) ConfigureAgent

func (vm VMImpl) ConfigureAgent(agentEnv apiv1.AgentEnv) error

func (VMImpl) ConfigureNICs

func (vm VMImpl) ConfigureNICs(nets Networks, host Host) error

func (VMImpl) Delete

func (vm VMImpl) Delete() error

func (VMImpl) DetachDisk

func (vm VMImpl) DetachDisk(disk bdisk.Disk) error

func (VMImpl) DiskIDs

func (vm VMImpl) DiskIDs() ([]apiv1.DiskCID, error)

func (VMImpl) Exists

func (vm VMImpl) Exists() (bool, error)

func (VMImpl) HaltIfRunning

func (vm VMImpl) HaltIfRunning() error

func (VMImpl) ID

func (vm VMImpl) ID() apiv1.VMCID

func (VMImpl) IsRunning

func (vm VMImpl) IsRunning() (bool, error)

func (VMImpl) Reboot

func (vm VMImpl) Reboot() error

func (VMImpl) SetMetadata

func (vm VMImpl) SetMetadata(meta apiv1.VMMeta) error

func (VMImpl) SetProps

func (vm VMImpl) SetProps(props VMProps) error

func (VMImpl) Start

func (vm VMImpl) Start(gui bool) error

func (VMImpl) State

func (vm VMImpl) State() (string, error)

type VMProps

type VMProps struct {
	Memory        int
	CPUs          int
	EphemeralDisk int    `json:"ephemeral_disk"`
	Audio         string `json:"audio"`

	GUI              bool
	ParavirtProvider string `json:"paravirtprovider"`

	SharedFolders []SharedFolder `json:"shared_folders"`
}

func NewVMProps added in v0.0.10

func NewVMProps(props apiv1.VMCloudProps) (VMProps, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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