qemu

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2017 License: Apache-2.0 Imports: 18 Imported by: 0

README

Docker machine qemu driver

I needed a non-libvirt qemu driver, so this is it.

Its initial use is going to be for running the Rancher OS tests, but maybe you'll find a use for it too.

from @fventuri

QEMU

Create machines locally using QEMU. This driver requires QEMU to be installed on your host.

$ docker-machine create --driver=qemu qemu-test

Options:

  • --qemu-boot2docker-url: The URL of the boot2docker image. Defaults to the latest available version.
  • --qemu-disk-size: Size of disk for the host in MB. Default: 20000
  • --qemu-memory: Size of memory for the host in MB. Default: 1024
  • --qemu-network-bridge: Name of the virtual bridge to be used for networking. Default: virbr0

The --qemu-boot2docker-url flag takes a few different forms. By default, if no value is specified for this flag, Machine will check locally for a boot2docker ISO. If one is found, that will be used as the ISO for the created machine. If one is not found, the latest ISO release available on boot2docker/boot2docker will be downloaded and stored locally for future use. Note that this means you must run docker-machine upgrade deliberately on a machine if you wish to update the "cached" boot2docker ISO.

This is the default behavior (when --qemu-boot2docker-url=""), but the option also supports specifying ISOs by the http:// and file:// protocols. file:// will look at the path specified locally to locate the ISO: for instance, you could specify --qemu-boot2docker-url file://$HOME/Downloads/rc.iso to test out a release candidate ISO that you have downloaded already. You could also just get an ISO straight from the Internet using the http:// form.

Environment variables:

Here comes the list of the supported variables with the corresponding options. If both environment variable and CLI option are provided the CLI option takes the precedence.

Environment variable CLI option
QEMU_BOOT2DOCKER_URL --qemu-boot2docker-url

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDriver

func NewDriver(hostName, storePath string) drivers.Driver

func WaitForTCPWithDelay

func WaitForTCPWithDelay(addr string, duration time.Duration) error

Types

type Driver

type Driver struct {
	*drivers.BaseDriver

	Memory         int
	DiskSize       int
	CPU            int
	Network        string
	PrivateNetwork string
	Boot2DockerURL string
	NetworkBridge  string
	CaCertPath     string
	PrivateKeyPath string
	DiskPath       string
	CacheMode      string
	IOMode         string

	UserDataFile    string
	CloudConfigRoot string
	// contains filtered or unexported fields
}

func (*Driver) Create

func (d *Driver) Create() error

func (*Driver) DriverName

func (d *Driver) DriverName() string

func (*Driver) GetCreateFlags

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

func (*Driver) GetDockerConfigDir

func (d *Driver) GetDockerConfigDir() string

func (*Driver) GetIP

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

func (*Driver) GetMachineName

func (d *Driver) GetMachineName() string

func (*Driver) GetSSHHostname

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

func (*Driver) GetSSHKeyPath

func (d *Driver) GetSSHKeyPath() string

func (*Driver) GetSSHPort

func (d *Driver) GetSSHPort() (int, 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) Kill

func (d *Driver) Kill() error

func (*Driver) PreCreateCheck

func (d *Driver) PreCreateCheck() error

func (*Driver) Remove

func (d *Driver) Remove() error

func (*Driver) Restart

func (d *Driver) Restart() error

func (*Driver) RunQMPCommand

func (d *Driver) RunQMPCommand(command string) (map[string]interface{}, error)

func (*Driver) SetConfigFromFlags

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

func (*Driver) Start

func (d *Driver) Start() error

func (*Driver) StartDocker

func (d *Driver) StartDocker() error

func (*Driver) Stop

func (d *Driver) Stop() error

func (*Driver) StopDocker

func (d *Driver) StopDocker() error

func (*Driver) Upgrade

func (d *Driver) Upgrade() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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