Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeVMX(contents map[string]string) string
- func ParseVMX(contents string) map[string]string
- func WriteVMX(path string, data map[string]string) (err error)
- type Artifact
- type Builder
- type DHCPLeaseGuestLookup
- type Driver
- type ESX5Driver
- func (d *ESX5Driver) CompactDisk(diskPathLocal string) error
- func (d *ESX5Driver) CreateDisk(diskPathLocal string, size string, typeId string) error
- func (d *ESX5Driver) DhcpLeasesPath(string) string
- func (d *ESX5Driver) DirExists() (bool, error)
- func (d *ESX5Driver) HostIP() (string, error)
- func (d *ESX5Driver) IsRunning(vmxPathLocal string) (bool, error)
- func (d *ESX5Driver) ListFiles() ([]string, error)
- func (d *ESX5Driver) MkdirAll() error
- func (d *ESX5Driver) Register(vmxPathLocal string) error
- func (d *ESX5Driver) Remove(path string) error
- func (d *ESX5Driver) RemoveAll() error
- func (d *ESX5Driver) SSHAddress(state multistep.StateBag) (string, error)
- func (d *ESX5Driver) SetOutputDir(path string)
- func (d *ESX5Driver) Start(vmxPathLocal string, headless bool) error
- func (d *ESX5Driver) Stop(vmxPathLocal string) error
- func (d *ESX5Driver) SuppressMessages(vmxPath string) error
- func (d *ESX5Driver) ToolsIsoPath(string) string
- func (d *ESX5Driver) Unregister(vmxPathLocal string) error
- func (d *ESX5Driver) UploadISO(localPath string) (string, error)
- func (d *ESX5Driver) VNCAddress(portMin, portMax uint) (string, uint)
- func (d *ESX5Driver) Verify() error
- type Fusion5Driver
- func (d *Fusion5Driver) CompactDisk(diskPath string) error
- func (d *Fusion5Driver) CreateDisk(output string, size string, type_id string) error
- func (d *Fusion5Driver) DhcpLeasesPath(device string) string
- func (d *Fusion5Driver) IsRunning(vmxPath string) (bool, error)
- func (d *Fusion5Driver) SSHAddress(state multistep.StateBag) (string, error)
- func (d *Fusion5Driver) Start(vmxPath string, headless bool) error
- func (d *Fusion5Driver) Stop(vmxPath string) error
- func (d *Fusion5Driver) SuppressMessages(vmxPath string) error
- func (d *Fusion5Driver) ToolsIsoPath(k string) string
- func (d *Fusion5Driver) Verify() error
- type GuestIPFinder
- type HostIPFinder
- type IfconfigIPFinder
- type OutputDir
- type Player5LinuxDriver
- func (d *Player5LinuxDriver) CompactDisk(diskPath string) error
- func (d *Player5LinuxDriver) CreateDisk(output string, size string, type_id string) error
- func (d *Player5LinuxDriver) DhcpLeasesPath(device string) string
- func (d *Player5LinuxDriver) IsRunning(vmxPath string) (bool, error)
- func (d *Player5LinuxDriver) SSHAddress(state multistep.StateBag) (string, error)
- func (d *Player5LinuxDriver) Start(vmxPath string, headless bool) error
- func (d *Player5LinuxDriver) Stop(vmxPath string) error
- func (d *Player5LinuxDriver) SuppressMessages(vmxPath string) error
- func (d *Player5LinuxDriver) ToolsIsoPath(flavor string) string
- func (d *Player5LinuxDriver) Verify() error
- type RemoteDriver
- type VMnetNatConfIPFinder
- type VNCAddressFinder
- type Workstation9Driver
- func (d *Workstation9Driver) CompactDisk(diskPath string) error
- func (d *Workstation9Driver) CreateDisk(output string, size string, type_id string) error
- func (d *Workstation9Driver) DhcpLeasesPath(device string) string
- func (d *Workstation9Driver) IsRunning(vmxPath string) (bool, error)
- func (d *Workstation9Driver) SSHAddress(state multistep.StateBag) (string, error)
- func (d *Workstation9Driver) Start(vmxPath string, headless bool) error
- func (d *Workstation9Driver) Stop(vmxPath string) error
- func (d *Workstation9Driver) SuppressMessages(vmxPath string) error
- func (d *Workstation9Driver) ToolsIsoPath(flavor string) string
- func (d *Workstation9Driver) Verify() error
- func (d *Workstation9Driver) VmnetnatConfPath() string
Constants ¶
const BuilderId = "mitchellh.vmware"
const BuilderIdESX = "mitchellh.vmware-esx"
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.
const KeyLeftShift uint32 = 0xFFE1
Variables ¶
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 ¶
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.
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, string) error // Checks if the VMX file at the given path is running. IsRunning(string) (bool, error) // SSHAddress returns the SSH address for the VM that is being // managed by this driver. SSHAddress(multistep.StateBag) (string, 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 // SuppressMessages modifies the VMX or surrounding directory so that // VMware doesn't show any annoying messages. SuppressMessages(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.
type ESX5Driver ¶ added in v0.4.0
type ESX5Driver struct { Host string Port uint Username string Password string Datastore string // contains filtered or unexported fields }
ESX5 driver talks to an ESXi5 hypervisor remotely over SSH to build virtual machines. This driver can only manage one machine at a time.
func (*ESX5Driver) CompactDisk ¶ added in v0.4.0
func (d *ESX5Driver) CompactDisk(diskPathLocal string) error
func (*ESX5Driver) CreateDisk ¶ added in v0.4.0
func (d *ESX5Driver) CreateDisk(diskPathLocal string, size string, typeId string) error
func (*ESX5Driver) DhcpLeasesPath ¶ added in v0.4.0
func (d *ESX5Driver) DhcpLeasesPath(string) string
func (*ESX5Driver) DirExists ¶ added in v0.4.0
func (d *ESX5Driver) DirExists() (bool, error)
func (*ESX5Driver) HostIP ¶ added in v0.4.0
func (d *ESX5Driver) HostIP() (string, error)
func (*ESX5Driver) IsRunning ¶ added in v0.4.0
func (d *ESX5Driver) IsRunning(vmxPathLocal string) (bool, error)
func (*ESX5Driver) ListFiles ¶ added in v0.4.0
func (d *ESX5Driver) ListFiles() ([]string, error)
func (*ESX5Driver) MkdirAll ¶ added in v0.4.0
func (d *ESX5Driver) MkdirAll() error
func (*ESX5Driver) Register ¶ added in v0.4.0
func (d *ESX5Driver) Register(vmxPathLocal string) error
func (*ESX5Driver) Remove ¶ added in v0.4.0
func (d *ESX5Driver) Remove(path string) error
func (*ESX5Driver) RemoveAll ¶ added in v0.4.0
func (d *ESX5Driver) RemoveAll() error
func (*ESX5Driver) SSHAddress ¶ added in v0.4.0
func (d *ESX5Driver) SSHAddress(state multistep.StateBag) (string, error)
func (*ESX5Driver) SetOutputDir ¶ added in v0.4.0
func (d *ESX5Driver) SetOutputDir(path string)
func (*ESX5Driver) Start ¶ added in v0.4.0
func (d *ESX5Driver) Start(vmxPathLocal string, headless bool) error
func (*ESX5Driver) Stop ¶ added in v0.4.0
func (d *ESX5Driver) Stop(vmxPathLocal string) error
func (*ESX5Driver) SuppressMessages ¶ added in v0.4.0
func (d *ESX5Driver) SuppressMessages(vmxPath string) error
func (*ESX5Driver) ToolsIsoPath ¶ added in v0.4.0
func (d *ESX5Driver) ToolsIsoPath(string) string
func (*ESX5Driver) Unregister ¶ added in v0.4.0
func (d *ESX5Driver) Unregister(vmxPathLocal string) error
func (*ESX5Driver) UploadISO ¶ added in v0.4.0
func (d *ESX5Driver) UploadISO(localPath string) (string, error)
func (*ESX5Driver) VNCAddress ¶ added in v0.4.0
func (d *ESX5Driver) VNCAddress(portMin, portMax uint) (string, uint)
func (*ESX5Driver) Verify ¶ added in v0.4.0
func (d *ESX5Driver) Verify() error
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 ¶ added in v0.1.4
func (d *Fusion5Driver) CompactDisk(diskPath string) error
func (*Fusion5Driver) CreateDisk ¶
func (d *Fusion5Driver) CreateDisk(output string, size string, type_id string) error
func (*Fusion5Driver) DhcpLeasesPath ¶ added in v0.2.1
func (d *Fusion5Driver) DhcpLeasesPath(device string) string
func (*Fusion5Driver) SSHAddress ¶ added in v0.4.0
func (d *Fusion5Driver) SSHAddress(state multistep.StateBag) (string, error)
func (*Fusion5Driver) Stop ¶
func (d *Fusion5Driver) Stop(vmxPath string) error
func (*Fusion5Driver) SuppressMessages ¶ added in v0.4.0
func (d *Fusion5Driver) SuppressMessages(vmxPath string) error
func (*Fusion5Driver) ToolsIsoPath ¶ added in v0.1.3
func (d *Fusion5Driver) ToolsIsoPath(k string) string
func (*Fusion5Driver) Verify ¶
func (d *Fusion5Driver) Verify() error
type GuestIPFinder ¶
Interface to help find the IP address of a running virtual machine.
type HostIPFinder ¶
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 OutputDir ¶ added in v0.4.0
type OutputDir interface { DirExists() (bool, error) ListFiles() ([]string, error) MkdirAll() error Remove(string) error RemoveAll() error SetOutputDir(string) }
OutputDir is an interface type that abstracts the creation and handling of the output directory for VMware-based products. The abstraction is made so that the output directory can be properly made on remote (ESXi) based VMware products as well as local.
type Player5LinuxDriver ¶ added in v0.2.2
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 ¶ added in v0.2.2
func (d *Player5LinuxDriver) CompactDisk(diskPath string) error
func (*Player5LinuxDriver) CreateDisk ¶ added in v0.2.2
func (d *Player5LinuxDriver) CreateDisk(output string, size string, type_id string) error
func (*Player5LinuxDriver) DhcpLeasesPath ¶ added in v0.2.2
func (d *Player5LinuxDriver) DhcpLeasesPath(device string) string
func (*Player5LinuxDriver) IsRunning ¶ added in v0.2.2
func (d *Player5LinuxDriver) IsRunning(vmxPath string) (bool, error)
func (*Player5LinuxDriver) SSHAddress ¶ added in v0.4.0
func (d *Player5LinuxDriver) SSHAddress(state multistep.StateBag) (string, error)
func (*Player5LinuxDriver) Start ¶ added in v0.2.2
func (d *Player5LinuxDriver) Start(vmxPath string, headless bool) error
func (*Player5LinuxDriver) Stop ¶ added in v0.2.2
func (d *Player5LinuxDriver) Stop(vmxPath string) error
func (*Player5LinuxDriver) SuppressMessages ¶ added in v0.4.0
func (d *Player5LinuxDriver) SuppressMessages(vmxPath string) error
func (*Player5LinuxDriver) ToolsIsoPath ¶ added in v0.2.2
func (d *Player5LinuxDriver) ToolsIsoPath(flavor string) string
func (*Player5LinuxDriver) Verify ¶ added in v0.2.2
func (d *Player5LinuxDriver) Verify() error
type RemoteDriver ¶ added in v0.4.0
type RemoteDriver interface { Driver // UploadISO uploads a local ISO to the remote side and returns the // new path that should be used in the VMX along with an error if it // exists. UploadISO(string) (string, error) // Adds a VM to inventory specified by the path to the VMX given. Register(string) error // Removes a VM from inventory specified by the path to the VMX given. Unregister(string) error }
type VMnetNatConfIPFinder ¶ added in v0.2.2
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 ¶ added in v0.2.2
func (*VMnetNatConfIPFinder) HostIP() (string, error)
type VNCAddressFinder ¶ added in v0.4.0
type Workstation9Driver ¶ added in v0.2.2
Workstation9Driver is a driver that can run VMware Workstation 9 on non-Windows platforms.
func (*Workstation9Driver) CompactDisk ¶ added in v0.2.2
func (d *Workstation9Driver) CompactDisk(diskPath string) error
func (*Workstation9Driver) CreateDisk ¶ added in v0.2.2
func (d *Workstation9Driver) CreateDisk(output string, size string, type_id string) error
func (*Workstation9Driver) DhcpLeasesPath ¶ added in v0.2.2
func (d *Workstation9Driver) DhcpLeasesPath(device string) string
func (*Workstation9Driver) IsRunning ¶ added in v0.2.2
func (d *Workstation9Driver) IsRunning(vmxPath string) (bool, error)
func (*Workstation9Driver) SSHAddress ¶ added in v0.4.0
func (d *Workstation9Driver) SSHAddress(state multistep.StateBag) (string, error)
func (*Workstation9Driver) Start ¶ added in v0.2.2
func (d *Workstation9Driver) Start(vmxPath string, headless bool) error
func (*Workstation9Driver) Stop ¶ added in v0.2.2
func (d *Workstation9Driver) Stop(vmxPath string) error
func (*Workstation9Driver) SuppressMessages ¶ added in v0.4.0
func (d *Workstation9Driver) SuppressMessages(vmxPath string) error
func (*Workstation9Driver) ToolsIsoPath ¶ added in v0.2.2
func (d *Workstation9Driver) ToolsIsoPath(flavor string) string
func (*Workstation9Driver) Verify ¶ added in v0.2.2
func (d *Workstation9Driver) Verify() error
func (*Workstation9Driver) VmnetnatConfPath ¶ added in v0.3.0
func (d *Workstation9Driver) VmnetnatConfPath() string
Source Files ¶
- artifact.go
- builder.go
- driver.go
- driver_esx5.go
- driver_fusion5.go
- driver_player5.go
- driver_workstation9.go
- driver_workstation9_unix.go
- guest_ip.go
- host_ip.go
- host_ip_ifconfig.go
- host_ip_vmnetnatconf.go
- output_dir.go
- remote_driver.go
- ssh.go
- step_clean_files.go
- step_clean_vmx.go
- step_compact_disk.go
- step_configure_vnc.go
- step_create_disk.go
- step_create_vmx.go
- step_http_server.go
- step_prepare_output_dir.go
- step_prepare_tools.go
- step_remote_upload.go
- step_run.go
- step_shutdown.go
- step_suppress_messages.go
- step_type_boot_command.go
- step_upload_tools.go
- vmx.go