vmware

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2013 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const BuilderId = "mitchellh.vmware"
View Source
const DefaultVMXTemplate = `` /* 2131-byte string literal not displayed */

This is the default VMX template used if no other template is given. This is hardcoded here. If you wish to use a custom template please do so by specifying in the builder configuration.

View Source
const KeyLeftShift uint32 = 0xFFE1

Variables

View Source
var KeepFileExtensions = []string{".nvram", ".vmdk", ".vmsd", ".vmx", ".vmxf"}

These are the extensions of files that are important for the function of a VMware virtual machine. Any other file is discarded as part of the build.

Functions

func EncodeVMX

func EncodeVMX(contents map[string]string) string

EncodeVMX takes a map and turns it into valid VMX contents.

func ParseVMX

func ParseVMX(contents string) map[string]string

ParseVMX parses the keys and values from a VMX file and returns them as a Go map.

func WriteVMX

func WriteVMX(path string, data map[string]string) (err error)

WriteVMX takes a path to a VMX file and contents in the form of a map and writes it out.

Types

type Artifact

type Artifact struct {
	// contains filtered or unexported fields
}

Artifact is the result of running the VMware builder, namely a set of files associated with the resulting machine.

func (*Artifact) BuilderId

func (*Artifact) BuilderId() string

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

func (*Artifact) Files

func (a *Artifact) Files() []string

func (*Artifact) Id

func (*Artifact) Id() string

func (*Artifact) String

func (a *Artifact) String() string

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func (*Builder) Cancel

func (b *Builder) Cancel()

func (*Builder) Prepare

func (b *Builder) Prepare(raws ...interface{}) error

func (*Builder) Run

func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error)

type DHCPLeaseGuestLookup

type DHCPLeaseGuestLookup struct {
	// Driver that is being used (to find leases path)
	Driver Driver

	// Device that the guest is connected to.
	Device string

	// MAC address of the guest.
	MACAddress string
}

DHCPLeaseGuestLookup looks up the IP address of a guest using DHCP lease information from the VMware network devices.

func (*DHCPLeaseGuestLookup) GuestIP

func (f *DHCPLeaseGuestLookup) GuestIP() (string, error)

type Driver

type Driver interface {
	// CompactDisk compacts a virtual disk.
	CompactDisk(string) error

	// CreateDisk creates a virtual disk with the given size.
	CreateDisk(string, string) error

	// Checks if the VMX file at the given path is running.
	IsRunning(string) (bool, error)

	// Start starts a VM specified by the path to the VMX given.
	Start(string, bool) error

	// Stop stops a VM specified by the path to the VMX given.
	Stop(string) error

	// Get the path to the VMware ISO for the given flavor.
	ToolsIsoPath(string) string

	// Get the path to the DHCP leases file for the given device.
	DhcpLeasesPath(string) string

	// Verify checks to make sure that this driver should function
	// properly. This should check that all the files it will use
	// appear to exist and so on. If everything is okay, this doesn't
	// return an error. Otherwise, this returns an error.
	Verify() error
}

A driver is able to talk to VMware, control virtual machines, etc.

func NewDriver

func NewDriver() (Driver, error)

NewDriver returns a new driver implementation for this operating system, or an error if the driver couldn't be initialized.

type Fusion5Driver

type Fusion5Driver struct {
	// This is the path to the "VMware Fusion.app"
	AppPath string
}

Fusion5Driver is a driver that can run VMWare Fusion 5.

func (*Fusion5Driver) CompactDisk

func (d *Fusion5Driver) CompactDisk(diskPath string) error

func (*Fusion5Driver) CreateDisk

func (d *Fusion5Driver) CreateDisk(output string, size string) error

func (*Fusion5Driver) DhcpLeasesPath

func (d *Fusion5Driver) DhcpLeasesPath(device string) string

func (*Fusion5Driver) IsRunning

func (d *Fusion5Driver) IsRunning(vmxPath string) (bool, error)

func (*Fusion5Driver) Start

func (d *Fusion5Driver) Start(vmxPath string, headless bool) error

func (*Fusion5Driver) Stop

func (d *Fusion5Driver) Stop(vmxPath string) error

func (*Fusion5Driver) ToolsIsoPath

func (d *Fusion5Driver) ToolsIsoPath(k string) string

func (*Fusion5Driver) Verify

func (d *Fusion5Driver) Verify() error

type GuestIPFinder

type GuestIPFinder interface {
	GuestIP() (string, error)
}

Interface to help find the IP address of a running virtual machine.

type HostIPFinder

type HostIPFinder interface {
	HostIP() (string, error)
}

Interface to help find the host IP that is available from within the VMware virtual machines.

type IfconfigIPFinder

type IfconfigIPFinder struct {
	Device string
}

IfconfigIPFinder finds the host IP based on the output of `ifconfig`.

func (*IfconfigIPFinder) HostIP

func (f *IfconfigIPFinder) HostIP() (string, error)

type Player5LinuxDriver

type Player5LinuxDriver struct {
	AppPath          string
	VdiskManagerPath string
	QemuImgPath      string
	VmrunPath        string
}

Player5LinuxDriver is a driver that can run VMware Player 5 on Linux.

func (*Player5LinuxDriver) CompactDisk

func (d *Player5LinuxDriver) CompactDisk(diskPath string) error

func (*Player5LinuxDriver) CreateDisk

func (d *Player5LinuxDriver) CreateDisk(output string, size string) error

func (*Player5LinuxDriver) DhcpLeasesPath

func (d *Player5LinuxDriver) DhcpLeasesPath(device string) string

func (*Player5LinuxDriver) IsRunning

func (d *Player5LinuxDriver) IsRunning(vmxPath string) (bool, error)

func (*Player5LinuxDriver) Start

func (d *Player5LinuxDriver) Start(vmxPath string, headless bool) error

func (*Player5LinuxDriver) Stop

func (d *Player5LinuxDriver) Stop(vmxPath string) error

func (*Player5LinuxDriver) ToolsIsoPath

func (d *Player5LinuxDriver) ToolsIsoPath(flavor string) string

func (*Player5LinuxDriver) Verify

func (d *Player5LinuxDriver) Verify() error

type VMnetNatConfIPFinder

type VMnetNatConfIPFinder struct{}

VMnetNatConfIPFinder finds the IP address of the host machine by retrieving the IP from the vmnetnat.conf. This isn't a full proof technique but so far it has not failed.

func (*VMnetNatConfIPFinder) HostIP

func (*VMnetNatConfIPFinder) HostIP() (string, error)

type Workstation9Driver

type Workstation9Driver struct {
	AppPath          string
	VdiskManagerPath string
	VmrunPath        string
}

Workstation9Driver is a driver that can run VMware Workstation 9 on non-Windows platforms.

func (*Workstation9Driver) CompactDisk

func (d *Workstation9Driver) CompactDisk(diskPath string) error

func (*Workstation9Driver) CreateDisk

func (d *Workstation9Driver) CreateDisk(output string, size string) error

func (*Workstation9Driver) DhcpLeasesPath

func (d *Workstation9Driver) DhcpLeasesPath(device string) string

func (*Workstation9Driver) IsRunning

func (d *Workstation9Driver) IsRunning(vmxPath string) (bool, error)

func (*Workstation9Driver) Start

func (d *Workstation9Driver) Start(vmxPath string, headless bool) error

func (*Workstation9Driver) Stop

func (d *Workstation9Driver) Stop(vmxPath string) error

func (*Workstation9Driver) ToolsIsoPath

func (d *Workstation9Driver) ToolsIsoPath(flavor string) string

func (*Workstation9Driver) Verify

func (d *Workstation9Driver) Verify() error

func (*Workstation9Driver) VmnetnatConfPath

func (d *Workstation9Driver) VmnetnatConfPath() string

Jump to

Keyboard shortcuts

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