driver

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Known ports
	SSHPort    = 22
	DockerPort = 2376

	// VM states
	Poweroff = MachineState("poweroff")
	Running  = MachineState("running")
	Paused   = MachineState("paused")
	Saved    = MachineState("saved")
	Aborted  = MachineState("aborted")
)
View Source
const (
	NICNetAbsent       = NICNetwork("none")
	NICNetDisconnected = NICNetwork("null")
	NICNetNAT          = NICNetwork("nat")
	NICNetBridged      = NICNetwork("bridged")
	NICNetInternal     = NICNetwork("intnet")
	NICNetHostonly     = NICNetwork("hostonly")
	NICNetGeneric      = NICNetwork("generic")
)
View Source
const (
	AMDPCNetPCIII         = NICHardware("Am79C970A")
	AMDPCNetFASTIII       = NICHardware("Am79C973")
	IntelPro1000MTDesktop = NICHardware("82540EM")
	IntelPro1000TServer   = NICHardware("82543GC")
	IntelPro1000MTServer  = NICHardware("82545EM")
	VirtIO                = NICHardware("virtio")
)
View Source
const (
	PFTCP = PFProto("tcp")
	PFUDP = PFProto("udp")
)
View Source
const (
	SysBusIDE    = SystemBus("ide")
	SysBusSATA   = SystemBus("sata")
	SysBusSCSI   = SystemBus("scsi")
	SysBusFloppy = SystemBus("floppy")
)
View Source
const (
	CtrlLSILogic    = StorageControllerChipset("LSILogic")
	CtrlLSILogicSAS = StorageControllerChipset("LSILogicSAS")
	CtrlBusLogic    = StorageControllerChipset("BusLogic")
	CtrlIntelAHCI   = StorageControllerChipset("IntelAHCI")
	CtrlPIIX3       = StorageControllerChipset("PIIX3")
	CtrlPIIX4       = StorageControllerChipset("PIIX4")
	CtrlICH6        = StorageControllerChipset("ICH6")
	CtrlI82078      = StorageControllerChipset("I82078")
)
View Source
const (
	DriveDVD = DriveType("dvddrive")
	DriveHDD = DriveType("hdd")
	DriveFDD = DriveType("fdd")
)

Variables

View Source
var (
	ErrNotSupported    = errors.New("driver not supported")
	ErrMachineNotExist = errors.New("machine does not exist (Did you run `boot2docker init`?)")
	ErrMachineExist    = errors.New("machine already exists")
	ErrPrerequisites   = errors.New("prerequisites for machine not satisfied (hypervisor installed?)")
)

Functions

func ConfigFlags

func ConfigFlags(B2D *MachineConfig, flags *flag.FlagSet) error

func Register

func Register(driver string, initFunc InitFunc) error

func RegisterConfig

func RegisterConfig(driver string, configFunc ConfigFunc) error

optional - allows a driver to add its own commandline parameters

Types

type ConfigFunc

type ConfigFunc func(B2D *MachineConfig, flags *flag.FlagSet) error

type DHCP

type DHCP struct {
	NetworkName string
	IPv4        net.IPNet
	LowerIP     net.IP
	UpperIP     net.IP
	Enabled     bool
}

DHCP server info.

type DriveType

type DriveType string

DriveType represents the hardware type of a drive.

type InitFunc

type InitFunc func(i *MachineConfig) (Machine, error)

type Machine

type Machine interface {
	Start() error
	Save() error
	Pause() error
	Stop() error
	Refresh() error
	Poweroff() error
	Restart() error
	Reset() error
	Delete() error
	Modify() error
	AddNATPF(n int, name string, rule PFRule) error
	DelNATPF(n int, name string) error
	SetNIC(n int, nic NIC) error
	AddStorageCtl(name string, ctl StorageController) error
	DelStorageCtl(name string) error
	AttachStorage(ctlName string, medium StorageMedium) error
	GetState() MachineState
	GetName() string
	GetSerialFile() string
	GetDockerPort() uint
	GetSSHPort() uint
}

Machine represents a virtual machine instance

func GetMachine

func GetMachine(mc *MachineConfig) (Machine, error)

type MachineConfig

type MachineConfig struct {
	// Gereral flags.
	Init    bool
	Verbose bool
	Driver  string

	// basic config
	Clobber              bool
	ForceUpgradeDownload bool
	SSH                  string // SSH client executable
	SSHGen               string // SSH keygen executable
	SSHKey               string // SSH key to send to the vm
	VM                   string // virtual machine name
	Dir                  string // boot2docker directory
	ISOURL               string // Source URL to retrieve the ISO from
	ISO                  string // boot2docker ISO image path
	DiskSize             uint   // VM disk image size (MB)
	Memory               uint   // VM memory size (MB)
	CPUs                 uint   // Number of CPUs

	// NAT network: port forwarding
	SSHPort    uint16 // host SSH port (forward to port 22 in VM)
	DockerPort uint16 // host Docker port (forward to port 2376 in VM)

	// host-only network
	HostIP      net.IP
	DHCPIP      net.IP
	NetMask     net.IPMask
	LowerIP     net.IP
	UpperIP     net.IP
	DHCPEnabled bool

	// Serial console pipe/socket
	Serial     bool
	SerialFile string

	// boot2docker init retry settings
	Waittime int
	Retries  int

	DriverCfg map[string]interface{}
}

Machine config.

type MachineState

type MachineState string

type NIC

type NIC struct {
	Network         NICNetwork
	Hardware        NICHardware
	HostonlyAdapter string
}

NIC represents a virtualized network interface card.

type NICHardware

type NICHardware string

NICHardware represents the type of NIC hardware.

type NICNetwork

type NICNetwork string

NICNetwork represents the type of NIC networks.

type PFProto

type PFProto string

PFProto represents the protocol of a port forwarding rule.

type PFRule

type PFRule struct {
	Proto     PFProto
	HostIP    net.IP // can be nil to match any host interface
	HostPort  uint16
	GuestIP   net.IP // can be nil if guest IP is leased from built-in DHCP
	GuestPort uint16
}

PFRule represents a port forwarding rule.

func (PFRule) Format

func (r PFRule) Format() string

Format returns the string needed as a command-line argument to VBoxManage.

func (PFRule) String

func (r PFRule) String() string

String returns a human-friendly representation of the port forwarding rule.

type StorageController

type StorageController struct {
	SysBus      SystemBus
	Ports       uint // SATA port count 1--30
	Chipset     StorageControllerChipset
	HostIOCache bool
	Bootable    bool
}

StorageController represents a virtualized storage controller.

type StorageControllerChipset

type StorageControllerChipset string

StorageControllerChipset represents the hardware of a storage controller.

type StorageMedium

type StorageMedium struct {
	Port      uint
	Device    uint
	DriveType DriveType
	Medium    string // none|emptydrive|<uuid>|<filename|host:<drive>|iscsi
}

StorageMedium represents the storage medium attached to a storage controller.

type SystemBus

type SystemBus string

SystemBus represents the system bus of a storage controller.

Jump to

Keyboard shortcuts

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