vmrun

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2016 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VMRunPath = "/usr/bin/vmrun"

VMRunPath is a hardcoded path to fall back to when vmrun is not in the $PATH.

Functions

This section is empty.

Types

type Backing

type Backing int

Backing is the network card backing type for VMware virtual machines.

const (
	Nat     Backing = iota // Nat network card. Addressable from guest os
	Bridged                // Connected to the outside network. Also addressable from the guest AND outside hosts.
	Unsupported
)

Backing information for Fusion network cards

type Config

type Config struct {
	NICs []NIC
}

Config is a config struct that can be passed in to change the configuration of the vm being provisioned.

type NIC

type NIC struct {
	Idx           int     // Which network card to change on the vm. Starts at 1
	Backing       Backing // What type of backing should the card have (Bridged vs NAT)
	BackingDevice string  // BSD string for the network card (en0, en1)
}

NIC is represents a network card on a VMware vm

type Runner

type Runner interface {
	Run(args ...string) (string, string, error)
	RunCombinedError(args ...string) (string, error)
}

Runner is an encapsulation around the vmrun utility.

type VM

type VM struct {
	Name        string
	Src         string
	Dst         string
	VmxFilePath string

	Credentials libssh.Credentials
	Config      Config
	// contains filtered or unexported fields
}

VM represents a single VMware VM and all the operations for provisioning that type

func (*VM) Destroy

func (vm *VM) Destroy() (err error)

Destroy powers off the VM and deletes its files from disk.

func (*VM) GetIPs

func (vm *VM) GetIPs() ([]net.IP, error)

GetIPs returns a list of ip addresses associated with the vm through VMware tools

func (*VM) GetName

func (vm *VM) GetName() string

GetName returns the name of the virtual machine

func (*VM) GetSSH

func (vm *VM) GetSSH(options libssh.Options) (libssh.Client, error)

GetSSH returns an ssh client for the the vm.

func (*VM) GetState

func (vm *VM) GetState() (string, error)

GetState gets the power state of the VM through VMware tools.

func (*VM) Halt

func (vm *VM) Halt() error

Halt powers off the VM without destroying it

func (*VM) Provision

func (vm *VM) Provision() error

Provision clones this VM and powers it on, while waiting for it to get an IP address. FIXME (Preet): Should make the wait for IP part optional.

func (*VM) Resume

func (vm *VM) Resume() error

Resume suspends the active state of the VM.

func (*VM) Start

func (vm *VM) Start() error

Start powers on the VM

func (*VM) Suspend

func (vm *VM) Suspend() error

Suspend suspends the active state of the VM.

Jump to

Keyboard shortcuts

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