cloudunit

package
v0.0.0-...-2fe3bde Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2015 License: AGPL-3.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnableToGenerateRandomIP = errors.New("unable to generate random IP")
	ErrMustEnableVTX            = errors.New("This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory")
	ErrNetworkAddrCidr          = errors.New("host-only cidr must be specified with a host address, not a network address")
)
View Source
var (
	ErrMachineNotExist = errors.New("machine does not exist")
	ErrVBMNotFound     = errors.New("VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path")
)

Functions

This section is empty.

Types

type Driver

type Driver struct {
	VBoxManager
	*drivers.BaseDriver
	CPU                 int
	Memory              int
	DiskSize            int
	Boot2DockerURL      string
	Boot2DockerImportVM string
	HostOnlyCIDR        string
	HostOnlyNicType     string
	HostOnlyPromiscMode string
	NoShare             bool
}

func NewDriver

func NewDriver(hostName, storePath string) *Driver

NewDriver creates a new VirtualBox driver with default settings.

func (*Driver) Create

func (d *Driver) Create() error

func (*Driver) DriverName

func (d *Driver) DriverName() string

DriverName returns the name of the driver

func (*Driver) GetCreateFlags

func (d *Driver) GetCreateFlags() []mcnflag.Flag

GetCreateFlags registers the flags this driver adds to "docker hosts create"

func (*Driver) GetIP

func (d *Driver) GetIP() (string, error)

func (*Driver) GetSSHHostname

func (d *Driver) GetSSHHostname() (string, error)

func (*Driver) GetSSHUsername

func (d *Driver) GetSSHUsername() string

func (*Driver) GetState

func (d *Driver) GetState() (state.State, error)

func (*Driver) GetURL

func (d *Driver) GetURL() (string, error)

func (*Driver) IsVTXDisabled

func (d *Driver) IsVTXDisabled() bool

IsVTXDisabled checks if VT-X is disabled in the BIOS. If it is, the vm will fail to start. If we can't be sure it is disabled, we carry on and will check the vm logs after it's started.

func (*Driver) IsVTXDisabledInTheVM

func (d *Driver) IsVTXDisabledInTheVM() (bool, error)

IsVTXDisabledInTheVM checks if VT-X is disabled in the started vm.

func (*Driver) Kill

func (d *Driver) Kill() error

func (*Driver) PreCreateCheck

func (d *Driver) PreCreateCheck() error

PreCreateCheck checks that VBoxManage exists and works

func (*Driver) Remove

func (d *Driver) Remove() error

func (*Driver) Restart

func (d *Driver) Restart() error

func (*Driver) SetConfigFromFlags

func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error

func (*Driver) Start

func (d *Driver) Start() error

func (*Driver) Stop

func (d *Driver) Stop() error

type VBoxCmdManager

type VBoxCmdManager struct{}

VBoxCmdManager communicates with VirtualBox through the commandline using `VBoxManage`.

type VBoxManager

type VBoxManager interface {
	// contains filtered or unexported methods
}

VBoxManager defines the interface to communicate to VirtualBox.

type VM

type VM struct {
	CPUs   int
	Memory int
}

type VirtualDisk

type VirtualDisk struct {
	UUID string
	Path string
}

Jump to

Keyboard shortcuts

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