Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigFlags(B2D *MachineConfig, flags *flag.FlagSet) error
- func Register(driver string, initFunc InitFunc) error
- func RegisterConfig(driver string, configFunc ConfigFunc) error
- type ConfigFunc
- type DHCP
- type DriveType
- type InitFunc
- type Machine
- type MachineConfig
- type MachineState
- type NIC
- type NICHardware
- type NICNetwork
- type PFProto
- type PFRule
- type StorageController
- type StorageControllerChipset
- type StorageMedium
- type SystemBus
Constants ¶
View Source
const ( // Known ports SSHPort = 22 DockerPort = 2375 // 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 ¶
Functions ¶
func ConfigFlags ¶
func ConfigFlags(B2D *MachineConfig, flags *flag.FlagSet) 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 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 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 ISO string // boot2docker ISO image path DiskSize uint // VM disk image size (MB) Memory uint // VM memory size (MB) // NAT network: port forwarding SSHPort uint16 // host SSH port (forward to port 22 in VM) DockerPort uint16 // host Docker port (forward to port 2375 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 }
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 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.
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.
Click to show internal directories.
Click to hide internal directories.