Documentation
¶
Overview ¶
These functions are compatible with WS 9 and 10 on *NIX
These functions are compatible with WS 9 and 10 on *NIX
Index ¶
- Constants
- Variables
- func CommHost(config *SSHConfig) func(multistep.StateBag) (string, error)
- func EncodeVMX(contents map[string]string) string
- func GetOVFTool() string
- func MockInterface() net.Interface
- func NetworkingParserByCommand(command string) *func([]string) (*networkingCommandEntry, error)
- func NewArtifact(remoteType string, format string, exportOutputPath string, vmName string, ...) (packer.Artifact, error)
- func ParseVMX(contents string) map[string]string
- func ReadVMX(path string) (map[string]string, error)
- func VNCPassword(skipPassword bool) string
- func WriteVMX(path string, data map[string]string) (err error)
- type DhcpConfiguration
- type Driver
- type DriverConfig
- type DriverMock
- func (d *DriverMock) Clone(dst string, src string, linked bool) error
- func (d *DriverMock) CommHost(state multistep.StateBag) (string, error)
- func (d *DriverMock) CompactDisk(path string) error
- func (d *DriverMock) CreateDisk(output string, size string, adapterType string, typeId string) error
- func (d *DriverMock) DhcpConfPath(device string) string
- func (d *DriverMock) DhcpLeasesPath(device string) string
- func (d *DriverMock) GetVmwareDriver() VmwareDriver
- func (d *DriverMock) GuestAddress(state multistep.StateBag) (string, error)
- func (d *DriverMock) GuestIP(state multistep.StateBag) (string, error)
- func (d *DriverMock) HostAddress(state multistep.StateBag) (string, error)
- func (d *DriverMock) HostIP(state multistep.StateBag) (string, error)
- func (d *DriverMock) IsRunning(path string) (bool, error)
- func (d *DriverMock) NetmapConfPath() string
- func (d *DriverMock) Start(path string, headless bool) error
- func (d *DriverMock) Stop(path string) error
- func (d *DriverMock) SuppressMessages(path string) error
- func (d *DriverMock) ToolsInstall() error
- func (d *DriverMock) ToolsIsoPath(flavor string) string
- func (d *DriverMock) Verify() error
- func (d *DriverMock) VmnetnatConfPath(device string) string
- type ESX5Driver
- func (d *ESX5Driver) CachePath(path string) string
- func (d *ESX5Driver) Clone(dst, src string, linked bool) error
- func (d *ESX5Driver) CommHost(state multistep.StateBag) (string, error)
- func (d *ESX5Driver) CompactDisk(diskPathLocal string) error
- func (d *ESX5Driver) CreateDisk(diskPathLocal string, size string, adapter_type string, typeId string) error
- func (d *ESX5Driver) Destroy() error
- func (d *ESX5Driver) DirExists() (bool, error)
- func (d *ESX5Driver) Download(src, dst string) error
- func (d *ESX5Driver) GetVmwareDriver() VmwareDriver
- func (d *ESX5Driver) GuestAddress(multistep.StateBag) (string, error)
- func (d *ESX5Driver) GuestIP(multistep.StateBag) (string, error)
- func (d *ESX5Driver) HostAddress(multistep.StateBag) (string, error)
- func (d *ESX5Driver) HostIP(multistep.StateBag) (string, error)
- func (d *ESX5Driver) IsDestroyed() (bool, error)
- func (d *ESX5Driver) IsRunning(string) (bool, error)
- func (d *ESX5Driver) ListFiles() ([]string, error)
- func (d *ESX5Driver) MkdirAll() error
- func (d *ESX5Driver) Register(vmxPathLocal string) error
- func (d *ESX5Driver) ReloadVM() error
- func (d *ESX5Driver) Remove(path string) error
- func (d *ESX5Driver) RemoveAll() error
- func (d *ESX5Driver) RemoveCache(localPath 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) String() string
- func (d *ESX5Driver) SuppressMessages(vmxPath string) error
- func (d *ESX5Driver) ToolsInstall() error
- func (d *ESX5Driver) ToolsIsoPath(string) string
- func (d *ESX5Driver) Unregister(vmxPathLocal string) error
- func (ESX5Driver) UpdateVMX(_, password string, port int, data map[string]string)
- func (d *ESX5Driver) UploadISO(localPath string, checksum string, checksumType string) (string, error)
- func (d *ESX5Driver) VNCAddress(ctx context.Context, _ string, portMin, portMax int) (string, int, error)
- func (d *ESX5Driver) Verify() error
- func (d *ESX5Driver) VerifyChecksum(ctype string, hash string, file string) bool
- type ExportConfig
- type Fusion5Driver
- func (d *Fusion5Driver) Clone(dst, src string, linked bool) error
- func (d *Fusion5Driver) CommHost(state multistep.StateBag) (string, error)
- func (d *Fusion5Driver) CompactDisk(diskPath string) error
- func (d *Fusion5Driver) CreateDisk(output string, size string, adapter_type string, type_id string) error
- func (d *Fusion5Driver) GetVmwareDriver() VmwareDriver
- func (d *Fusion5Driver) IsRunning(vmxPath string) (bool, 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) ToolsInstall() error
- func (d *Fusion5Driver) ToolsIsoPath(k string) string
- func (d *Fusion5Driver) Verify() error
- type Fusion6Driver
- type HWConfig
- type IfconfigIPFinder
- type LocalOutputDir
- func (d *LocalOutputDir) DirExists() (bool, error)
- func (d *LocalOutputDir) ListFiles() ([]string, error)
- func (d *LocalOutputDir) MkdirAll() error
- func (d *LocalOutputDir) Remove(path string) error
- func (d *LocalOutputDir) RemoveAll() error
- func (d *LocalOutputDir) SetOutputDir(path string)
- func (d *LocalOutputDir) String() string
- type NetworkMap
- type NetworkMapperMock
- type NetworkNameMapper
- type NetworkingConfig
- type NetworkingType
- type OutputConfig
- type OutputDir
- type ParallelPortAuto
- type ParallelPortDevice
- type ParallelPortFile
- type ParallelUnion
- type Player5Driver
- func (d *Player5Driver) Clone(dst, src string, linked bool) error
- func (d *Player5Driver) CommHost(state multistep.StateBag) (string, error)
- func (d *Player5Driver) CompactDisk(diskPath string) error
- func (d *Player5Driver) CreateDisk(output string, size string, adapter_type string, type_id string) error
- func (d *Player5Driver) GetVmwareDriver() VmwareDriver
- func (d *Player5Driver) IsRunning(vmxPath string) (bool, error)
- func (d *Player5Driver) Start(vmxPath string, headless bool) error
- func (d *Player5Driver) Stop(vmxPath string) error
- func (d *Player5Driver) SuppressMessages(vmxPath string) error
- func (d *Player5Driver) ToolsInstall() error
- func (d *Player5Driver) ToolsIsoPath(flavor string) string
- func (d *Player5Driver) Verify() error
- type Player6Driver
- type RemoteDriver
- type RemoteDriverMock
- func (d *RemoteDriverMock) Destroy() error
- func (d *RemoteDriverMock) Download(src, dst string) error
- func (d *RemoteDriverMock) IsDestroyed() (bool, error)
- func (d *RemoteDriverMock) Register(path string) error
- func (d *RemoteDriverMock) ReloadVM() error
- func (d *RemoteDriverMock) RemoveCache(localPath string) error
- func (d *RemoteDriverMock) Unregister(path string) error
- func (d *RemoteDriverMock) UploadISO(path string, checksum string, checksumType string) (string, error)
- type RunConfig
- type SSHConfig
- type SerialConfigAuto
- type SerialConfigDevice
- type SerialConfigFile
- type SerialConfigPipe
- type SerialUnion
- type ShutdownConfig
- type StepCleanFiles
- type StepCleanVMX
- type StepCompactDisk
- type StepConfigureVMX
- type StepConfigureVNC
- func (s *StepConfigureVNC) Cleanup(multistep.StateBag)
- func (s *StepConfigureVNC) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
- func (*StepConfigureVNC) UpdateVMX(address, password string, port int, data map[string]string)
- func (s *StepConfigureVNC) VNCAddress(ctx context.Context, vncBindAddress string, portMin, portMax int) (string, int, error)
- type StepExport
- type StepOutputDir
- type StepPrepareTools
- type StepRegister
- type StepRun
- type StepShutdown
- type StepSuppressMessages
- type StepTypeBootCommand
- type StepUploadTools
- type StepUploadVMX
- type ToolsConfig
- type VMXConfig
- type VNCAddressFinder
- type VmwareDriver
- type Workstation10Driver
- type Workstation9Driver
- func (d *Workstation9Driver) Clone(dst, src string, linked bool) error
- func (d *Workstation9Driver) CommHost(state multistep.StateBag) (string, error)
- func (d *Workstation9Driver) CompactDisk(diskPath string) error
- func (d *Workstation9Driver) CreateDisk(output string, size string, adapter_type string, type_id string) error
- func (d *Workstation9Driver) GetVmwareDriver() VmwareDriver
- func (d *Workstation9Driver) IsRunning(vmxPath string) (bool, 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) ToolsInstall() error
- func (d *Workstation9Driver) ToolsIsoPath(flavor string) string
- func (d *Workstation9Driver) Verify() error
Constants ¶
const ( // BuilderId for the local artifacts BuilderId = "mitchellh.vmware" BuilderIdESX = "mitchellh.vmware-esx" ArtifactConfFormat = "artifact.conf.format" ArtifactConfKeepRegistered = "artifact.conf.keep_registered" ArtifactConfSkipExport = "artifact.conf.skip_export" )
const ( ALLOW grant = iota IGNORE grant = iota DENY grant = iota )
const ( NetworkingType_HOSTONLY = iota + 1 NetworkingType_NAT NetworkingType_BRIDGED )
const NetworkingInterfacePrefix = "vmnet"
const VMWARE_FUSION_VERSION = "6"
const VMWARE_PLAYER_VERSION = "6"
const VMWARE_WS_VERSION = "10"
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.
var NetworkingCommandParsers = []networkingCommandParser{ {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, }
Functions ¶
func GetOVFTool ¶ added in v1.3.3
func GetOVFTool() string
func MockInterface ¶ added in v1.2.0
func NetworkingParserByCommand ¶ added in v1.2.0
func NewArtifact ¶ added in v1.3.3
func VNCPassword ¶ added in v0.11.0
Types ¶
type DhcpConfiguration ¶ added in v1.2.0
type DhcpConfiguration []configDeclaration
** Dhcp Configuration
func ReadDhcpConfig ¶ added in v1.2.0
func ReadDhcpConfig(path string) (DhcpConfiguration, error)
read the dhcp configuration out of the specified path
func ReadDhcpConfiguration ¶ added in v1.2.0
func ReadDhcpConfiguration(fd *os.File) (DhcpConfiguration, error)
func (*DhcpConfiguration) Global ¶ added in v1.2.0
func (e *DhcpConfiguration) Global() configDeclaration
func (*DhcpConfiguration) HostByName ¶ added in v1.2.0
func (e *DhcpConfiguration) HostByName(host string) (configDeclaration, error)
func (*DhcpConfiguration) SubnetByAddress ¶ added in v1.2.0
func (e *DhcpConfiguration) SubnetByAddress(address net.IP) (configDeclaration, error)
type Driver ¶
type Driver interface { // Clone clones the VMX and the disk to the destination path. The // destination is a path to the VMX file. The disk will be copied // to that same directory. Clone(dst string, src string, cloneType bool) error // CompactDisk compacts a virtual disk. CompactDisk(string) error // CreateDisk creates a virtual disk with the given size. CreateDisk(string, string, 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 // 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 // Attach the VMware tools ISO ToolsInstall() error // 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. Each vmware // driver should assign the VmwareMachine callback functions for locating // paths within this function. Verify() error /// This is to establish a connection to the guest CommHost(multistep.StateBag) (string, error) /// These methods are generally implemented by the VmwareDriver /// structure within this file. A driver implementation can /// reimplement these, though, if it wants. GetVmwareDriver() VmwareDriver // Get the guest hw address for the vm GuestAddress(multistep.StateBag) (string, error) // Get the guest ip address for the vm GuestIP(multistep.StateBag) (string, error) // Get the host hw address for the vm HostAddress(multistep.StateBag) (string, error) // Get the host ip address for the vm HostIP(multistep.StateBag) (string, error) }
A driver is able to talk to VMware, control virtual machines, etc.
type DriverConfig ¶
type DriverConfig struct { FusionAppPath string `mapstructure:"fusion_app_path"` RemoteType string `mapstructure:"remote_type"` RemoteDatastore string `mapstructure:"remote_datastore"` RemoteCacheDatastore string `mapstructure:"remote_cache_datastore"` RemoteCacheDirectory string `mapstructure:"remote_cache_directory"` RemoteHost string `mapstructure:"remote_host"` RemotePort int `mapstructure:"remote_port"` RemoteUser string `mapstructure:"remote_username"` RemotePassword string `mapstructure:"remote_password"` RemotePrivateKey string `mapstructure:"remote_private_key_file"` SkipValidateCredentials bool `mapstructure:"skip_validate_credentials"` }
func (*DriverConfig) Prepare ¶
func (c *DriverConfig) Prepare(ctx *interpolate.Context) []error
func (*DriverConfig) Validate ¶ added in v1.3.3
func (c *DriverConfig) Validate(SkipExport bool) error
type DriverMock ¶
type DriverMock struct { sync.Mutex CloneCalled bool CloneDst string CloneSrc string Linked bool CloneErr error CompactDiskCalled bool CompactDiskPath string CompactDiskErr error CreateDiskCalled bool CreateDiskOutput string CreateDiskSize string CreateDiskAdapterType string CreateDiskTypeId string CreateDiskErr error IsRunningCalled bool IsRunningPath string IsRunningResult bool IsRunningErr error CommHostCalled bool CommHostState multistep.StateBag CommHostResult string CommHostErr error HostAddressCalled bool HostAddressState multistep.StateBag HostAddressResult string HostAddressErr error HostIPCalled bool HostIPState multistep.StateBag HostIPResult string HostIPErr error GuestAddressCalled bool GuestAddressState multistep.StateBag GuestAddressResult string GuestAddressErr error GuestIPCalled bool GuestIPState multistep.StateBag GuestIPResult string GuestIPErr error StartCalled bool StartPath string StartHeadless bool StartErr error StopCalled bool StopPath string StopErr error SuppressMessagesCalled bool SuppressMessagesPath string SuppressMessagesErr error ToolsIsoPathCalled bool ToolsIsoPathFlavor string ToolsIsoPathResult string ToolsInstallCalled bool ToolsInstallErr error DhcpLeasesPathCalled bool DhcpLeasesPathDevice string DhcpLeasesPathResult string DhcpConfPathCalled bool DhcpConfPathResult string VmnetnatConfPathCalled bool VmnetnatConfPathResult string NetmapConfPathCalled bool NetmapConfPathResult string VerifyCalled bool VerifyErr error }
func (*DriverMock) CommHost ¶ added in v0.8.0
func (d *DriverMock) CommHost(state multistep.StateBag) (string, error)
func (*DriverMock) CompactDisk ¶
func (d *DriverMock) CompactDisk(path string) error
func (*DriverMock) CreateDisk ¶
func (*DriverMock) DhcpConfPath ¶ added in v1.2.0
func (d *DriverMock) DhcpConfPath(device string) string
func (*DriverMock) DhcpLeasesPath ¶
func (d *DriverMock) DhcpLeasesPath(device string) string
func (*DriverMock) GetVmwareDriver ¶ added in v1.2.0
func (d *DriverMock) GetVmwareDriver() VmwareDriver
func (*DriverMock) GuestAddress ¶ added in v1.2.0
func (d *DriverMock) GuestAddress(state multistep.StateBag) (string, error)
func (*DriverMock) GuestIP ¶ added in v1.2.0
func (d *DriverMock) GuestIP(state multistep.StateBag) (string, error)
func (*DriverMock) HostAddress ¶ added in v1.2.0
func (d *DriverMock) HostAddress(state multistep.StateBag) (string, error)
func (*DriverMock) HostIP ¶ added in v1.2.0
func (d *DriverMock) HostIP(state multistep.StateBag) (string, error)
func (*DriverMock) NetmapConfPath ¶ added in v1.2.0
func (d *DriverMock) NetmapConfPath() string
func (*DriverMock) Stop ¶
func (d *DriverMock) Stop(path string) error
func (*DriverMock) SuppressMessages ¶
func (d *DriverMock) SuppressMessages(path string) error
func (*DriverMock) ToolsInstall ¶ added in v0.6.0
func (d *DriverMock) ToolsInstall() error
func (*DriverMock) ToolsIsoPath ¶
func (d *DriverMock) ToolsIsoPath(flavor string) string
func (*DriverMock) Verify ¶
func (d *DriverMock) Verify() error
func (*DriverMock) VmnetnatConfPath ¶ added in v1.2.0
func (d *DriverMock) VmnetnatConfPath(device string) string
type ESX5Driver ¶ added in v1.3.3
type ESX5Driver struct { Host string Port int Username string Password string PrivateKeyFile string Datastore string CacheDatastore string CacheDirectory string VMName string CommConfig communicator.Config // 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) CachePath ¶ added in v1.3.3
func (d *ESX5Driver) CachePath(path string) string
func (*ESX5Driver) Clone ¶ added in v1.3.3
func (d *ESX5Driver) Clone(dst, src string, linked bool) error
func (*ESX5Driver) CommHost ¶ added in v1.3.3
func (d *ESX5Driver) CommHost(state multistep.StateBag) (string, error)
func (*ESX5Driver) CompactDisk ¶ added in v1.3.3
func (d *ESX5Driver) CompactDisk(diskPathLocal string) error
func (*ESX5Driver) CreateDisk ¶ added in v1.3.3
func (*ESX5Driver) Destroy ¶ added in v1.3.3
func (d *ESX5Driver) Destroy() error
func (*ESX5Driver) DirExists ¶ added in v1.3.3
func (d *ESX5Driver) DirExists() (bool, error)
func (*ESX5Driver) Download ¶ added in v1.3.3
func (d *ESX5Driver) Download(src, dst string) error
func (*ESX5Driver) GetVmwareDriver ¶ added in v1.3.3
func (d *ESX5Driver) GetVmwareDriver() VmwareDriver
func (*ESX5Driver) GuestAddress ¶ added in v1.3.3
func (d *ESX5Driver) GuestAddress(multistep.StateBag) (string, error)
func (*ESX5Driver) GuestIP ¶ added in v1.3.3
func (d *ESX5Driver) GuestIP(multistep.StateBag) (string, error)
func (*ESX5Driver) HostAddress ¶ added in v1.3.3
func (d *ESX5Driver) HostAddress(multistep.StateBag) (string, error)
func (*ESX5Driver) HostIP ¶ added in v1.3.3
func (d *ESX5Driver) HostIP(multistep.StateBag) (string, error)
func (*ESX5Driver) IsDestroyed ¶ added in v1.3.3
func (d *ESX5Driver) IsDestroyed() (bool, error)
func (*ESX5Driver) ListFiles ¶ added in v1.3.3
func (d *ESX5Driver) ListFiles() ([]string, error)
func (*ESX5Driver) MkdirAll ¶ added in v1.3.3
func (d *ESX5Driver) MkdirAll() error
func (*ESX5Driver) Register ¶ added in v1.3.3
func (d *ESX5Driver) Register(vmxPathLocal string) error
func (*ESX5Driver) ReloadVM ¶ added in v1.3.3
func (d *ESX5Driver) ReloadVM() error
func (*ESX5Driver) Remove ¶ added in v1.3.3
func (d *ESX5Driver) Remove(path string) error
func (*ESX5Driver) RemoveAll ¶ added in v1.3.3
func (d *ESX5Driver) RemoveAll() error
func (*ESX5Driver) RemoveCache ¶ added in v1.3.3
func (d *ESX5Driver) RemoveCache(localPath string) error
func (*ESX5Driver) SetOutputDir ¶ added in v1.3.3
func (d *ESX5Driver) SetOutputDir(path string)
func (*ESX5Driver) Start ¶ added in v1.3.3
func (d *ESX5Driver) Start(vmxPathLocal string, headless bool) error
func (*ESX5Driver) Stop ¶ added in v1.3.3
func (d *ESX5Driver) Stop(vmxPathLocal string) error
func (*ESX5Driver) String ¶ added in v1.3.3
func (d *ESX5Driver) String() string
func (*ESX5Driver) SuppressMessages ¶ added in v1.3.3
func (d *ESX5Driver) SuppressMessages(vmxPath string) error
func (*ESX5Driver) ToolsInstall ¶ added in v1.3.3
func (d *ESX5Driver) ToolsInstall() error
func (*ESX5Driver) ToolsIsoPath ¶ added in v1.3.3
func (d *ESX5Driver) ToolsIsoPath(string) string
func (*ESX5Driver) Unregister ¶ added in v1.3.3
func (d *ESX5Driver) Unregister(vmxPathLocal string) error
func (ESX5Driver) UpdateVMX ¶ added in v1.3.3
func (ESX5Driver) UpdateVMX(_, password string, port int, data map[string]string)
UpdateVMX, adds the VNC port to the VMX data.
func (*ESX5Driver) VNCAddress ¶ added in v1.3.3
func (*ESX5Driver) Verify ¶ added in v1.3.3
func (d *ESX5Driver) Verify() error
func (*ESX5Driver) VerifyChecksum ¶ added in v1.3.3
func (d *ESX5Driver) VerifyChecksum(ctype string, hash string, file string) bool
type ExportConfig ¶ added in v1.3.3
type ExportConfig struct { Format string `mapstructure:"format"` OVFToolOptions []string `mapstructure:"ovftool_options"` SkipExport bool `mapstructure:"skip_export"` KeepRegistered bool `mapstructure:"keep_registered"` SkipCompaction bool `mapstructure:"skip_compaction"` }
func (*ExportConfig) Prepare ¶ added in v1.3.3
func (c *ExportConfig) Prepare(ctx *interpolate.Context) []error
type Fusion5Driver ¶
type Fusion5Driver struct { VmwareDriver // This is the path to the "VMware Fusion.app" AppPath string // SSHConfig are the SSH settings for the Fusion VM SSHConfig *SSHConfig }
Fusion5Driver is a driver that can run VMware Fusion 5.
func (*Fusion5Driver) CommHost ¶ added in v0.8.0
func (d *Fusion5Driver) CommHost(state multistep.StateBag) (string, error)
func (*Fusion5Driver) CompactDisk ¶
func (d *Fusion5Driver) CompactDisk(diskPath string) error
func (*Fusion5Driver) CreateDisk ¶
func (*Fusion5Driver) GetVmwareDriver ¶ added in v1.2.0
func (d *Fusion5Driver) GetVmwareDriver() VmwareDriver
func (*Fusion5Driver) Stop ¶
func (d *Fusion5Driver) Stop(vmxPath string) error
func (*Fusion5Driver) SuppressMessages ¶
func (d *Fusion5Driver) SuppressMessages(vmxPath string) error
func (*Fusion5Driver) ToolsInstall ¶ added in v0.6.0
func (d *Fusion5Driver) ToolsInstall() error
func (*Fusion5Driver) ToolsIsoPath ¶
func (d *Fusion5Driver) ToolsIsoPath(k string) string
func (*Fusion5Driver) Verify ¶
func (d *Fusion5Driver) Verify() error
type Fusion6Driver ¶
type Fusion6Driver struct {
Fusion5Driver
}
Fusion6Driver is a driver that can run VMware Fusion 6.
func (*Fusion6Driver) GetVmwareDriver ¶ added in v1.2.0
func (d *Fusion6Driver) GetVmwareDriver() VmwareDriver
func (*Fusion6Driver) Verify ¶
func (d *Fusion6Driver) Verify() error
type HWConfig ¶ added in v1.3.3
type HWConfig struct { // cpu information CpuCount int `mapstructure:"cpus"` MemorySize int `mapstructure:"memory"` CoreCount int `mapstructure:"cores"` // network type and adapter Network string `mapstructure:"network"` NetworkAdapterType string `mapstructure:"network_adapter_type"` // device presence Sound bool `mapstructure:"sound"` USB bool `mapstructure:"usb"` // communication ports Serial string `mapstructure:"serial"` Parallel string `mapstructure:"parallel"` }
func (*HWConfig) HasParallel ¶ added in v1.3.3
func (*HWConfig) Prepare ¶ added in v1.3.3
func (c *HWConfig) Prepare(ctx *interpolate.Context) []error
func (*HWConfig) ReadParallel ¶ added in v1.3.3
func (c *HWConfig) ReadParallel() (*ParallelUnion, error)
func (*HWConfig) ReadSerial ¶ added in v1.3.3
func (c *HWConfig) ReadSerial() (*SerialUnion, error)
type IfconfigIPFinder ¶ added in v0.7.0
type IfconfigIPFinder struct {
Device string
}
IfconfigIPFinder finds the host IP based on the output of `ip address` or `ifconfig`.
func (*IfconfigIPFinder) HostIP ¶ added in v0.7.0
func (f *IfconfigIPFinder) HostIP() (string, error)
type LocalOutputDir ¶
type LocalOutputDir struct {
// contains filtered or unexported fields
}
LocalOutputDir is an OutputDir implementation where the directory is on the local machine.
func (*LocalOutputDir) DirExists ¶
func (d *LocalOutputDir) DirExists() (bool, error)
func (*LocalOutputDir) ListFiles ¶
func (d *LocalOutputDir) ListFiles() ([]string, error)
func (*LocalOutputDir) MkdirAll ¶
func (d *LocalOutputDir) MkdirAll() error
func (*LocalOutputDir) Remove ¶
func (d *LocalOutputDir) Remove(path string) error
func (*LocalOutputDir) RemoveAll ¶
func (d *LocalOutputDir) RemoveAll() error
func (*LocalOutputDir) SetOutputDir ¶
func (d *LocalOutputDir) SetOutputDir(path string)
func (*LocalOutputDir) String ¶
func (d *LocalOutputDir) String() string
type NetworkMap ¶ added in v1.2.0
** Network Map
func ReadNetmapConfig ¶ added in v1.2.0
func ReadNetmapConfig(path string) (NetworkMap, error)
/ helper functions that read configuration information from a file read the network<->device configuration out of the specified path
func ReadNetworkMap ¶ added in v1.2.0
func ReadNetworkMap(fd *os.File) (NetworkMap, error)
func (NetworkMap) DeviceIntoName ¶ added in v1.2.0
func (e NetworkMap) DeviceIntoName(device string) (string, error)
func (NetworkMap) NameIntoDevices ¶ added in v1.2.2
func (e NetworkMap) NameIntoDevices(name string) ([]string, error)
type NetworkMapperMock ¶ added in v1.2.0
func (NetworkMapperMock) DeviceIntoName ¶ added in v1.2.0
func (m NetworkMapperMock) DeviceIntoName(device string) (string, error)
func (NetworkMapperMock) NameIntoDevices ¶ added in v1.2.2
func (m NetworkMapperMock) NameIntoDevices(name string) ([]string, error)
type NetworkNameMapper ¶ added in v1.2.0
type NetworkingConfig ¶ added in v1.2.0
type NetworkingConfig struct {
// contains filtered or unexported fields
}
func ReadNetworkingConfig ¶ added in v1.2.0
func ReadNetworkingConfig(fd *os.File) (NetworkingConfig, error)
Constructor for networking file
func (NetworkingConfig) DeviceIntoName ¶ added in v1.2.0
func (e NetworkingConfig) DeviceIntoName(device string) (string, error)
func (NetworkingConfig) NameIntoDevices ¶ added in v1.2.2
func (e NetworkingConfig) NameIntoDevices(name string) ([]string, error)
type OutputConfig ¶
type OutputConfig struct {
OutputDir string `mapstructure:"output_directory"`
}
func (*OutputConfig) Prepare ¶
func (c *OutputConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) []error
type OutputDir ¶
type OutputDir interface { DirExists() (bool, error) ListFiles() ([]string, error) MkdirAll() error Remove(string) error RemoveAll() error SetOutputDir(string) String() 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. For remote builds, OutputDir interface is satisfied by the ESX5Driver.
type ParallelPortAuto ¶ added in v1.3.3
type ParallelPortAuto struct {
Bidirectional string
}
type ParallelPortDevice ¶ added in v1.3.3
type ParallelPortFile ¶ added in v1.3.3
type ParallelPortFile struct {
Filename string
}
type ParallelUnion ¶ added in v1.3.3
type ParallelUnion struct { Union interface{} File *ParallelPortFile Device *ParallelPortDevice Auto *ParallelPortAuto }
parallel port
type Player5Driver ¶ added in v0.7.0
type Player5Driver struct { VmwareDriver AppPath string VdiskManagerPath string QemuImgPath string VmrunPath string // SSHConfig are the SSH settings for the Fusion VM SSHConfig *SSHConfig }
Player5Driver is a driver that can run VMware Player 5 on Linux.
func (*Player5Driver) Clone ¶ added in v0.7.0
func (d *Player5Driver) Clone(dst, src string, linked bool) error
func (*Player5Driver) CommHost ¶ added in v0.8.0
func (d *Player5Driver) CommHost(state multistep.StateBag) (string, error)
func (*Player5Driver) CompactDisk ¶ added in v0.7.0
func (d *Player5Driver) CompactDisk(diskPath string) error
func (*Player5Driver) CreateDisk ¶ added in v0.7.0
func (*Player5Driver) GetVmwareDriver ¶ added in v1.2.0
func (d *Player5Driver) GetVmwareDriver() VmwareDriver
func (*Player5Driver) IsRunning ¶ added in v0.7.0
func (d *Player5Driver) IsRunning(vmxPath string) (bool, error)
func (*Player5Driver) Start ¶ added in v0.7.0
func (d *Player5Driver) Start(vmxPath string, headless bool) error
func (*Player5Driver) Stop ¶ added in v0.7.0
func (d *Player5Driver) Stop(vmxPath string) error
func (*Player5Driver) SuppressMessages ¶ added in v0.7.0
func (d *Player5Driver) SuppressMessages(vmxPath string) error
func (*Player5Driver) ToolsInstall ¶ added in v0.7.0
func (d *Player5Driver) ToolsInstall() error
func (*Player5Driver) ToolsIsoPath ¶ added in v0.7.0
func (d *Player5Driver) ToolsIsoPath(flavor string) string
func (*Player5Driver) Verify ¶ added in v0.7.0
func (d *Player5Driver) Verify() error
type Player6Driver ¶ added in v0.7.0
type Player6Driver struct {
Player5Driver
}
func (*Player6Driver) Clone ¶ added in v0.7.0
func (d *Player6Driver) Clone(dst, src string, linked bool) error
func (*Player6Driver) GetVmwareDriver ¶ added in v1.2.0
func (d *Player6Driver) GetVmwareDriver() VmwareDriver
func (*Player6Driver) Verify ¶ added in v0.7.0
func (d *Player6Driver) Verify() error
type RemoteDriver ¶ added in v1.3.3
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, string) (string, error) // RemoveCache deletes localPath from the remote cache. RemoveCache(localPath 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 // Destroys a VM Destroy() error // Checks if the VM is destroyed. IsDestroyed() (bool, error) // Download a remote file to a local file. Download(src, dst string) error // Reload VM on remote side. ReloadVM() error // contains filtered or unexported methods }
type RemoteDriverMock ¶ added in v1.3.3
type RemoteDriverMock struct { DriverMock UploadISOCalled bool UploadISOPath string UploadISOResult string UploadISOErr error RegisterCalled bool RegisterPath string RegisterErr error UnregisterCalled bool UnregisterPath string UnregisterErr error DestroyCalled bool DestroyErr error IsDestroyedCalled bool IsDestroyedResult bool IsDestroyedErr error UploadErr error DownloadErr error ReloadVMErr error }
func (*RemoteDriverMock) Destroy ¶ added in v1.3.3
func (d *RemoteDriverMock) Destroy() error
func (*RemoteDriverMock) Download ¶ added in v1.3.3
func (d *RemoteDriverMock) Download(src, dst string) error
func (*RemoteDriverMock) IsDestroyed ¶ added in v1.3.3
func (d *RemoteDriverMock) IsDestroyed() (bool, error)
func (*RemoteDriverMock) Register ¶ added in v1.3.3
func (d *RemoteDriverMock) Register(path string) error
func (*RemoteDriverMock) ReloadVM ¶ added in v1.3.3
func (d *RemoteDriverMock) ReloadVM() error
func (*RemoteDriverMock) RemoveCache ¶ added in v1.3.3
func (d *RemoteDriverMock) RemoveCache(localPath string) error
func (*RemoteDriverMock) Unregister ¶ added in v1.3.3
func (d *RemoteDriverMock) Unregister(path string) error
type RunConfig ¶
type SSHConfig ¶
type SSHConfig struct { Comm communicator.Config `mapstructure:",squash"` // These are deprecated, but we keep them around for BC // TODO(@mitchellh): remove SSHSkipRequestPty bool `mapstructure:"ssh_skip_request_pty"` SSHWaitTimeout time.Duration `mapstructure:"ssh_wait_timeout"` }
type SerialConfigAuto ¶ added in v1.3.3
type SerialConfigDevice ¶ added in v1.3.3
type SerialConfigFile ¶ added in v1.3.3
type SerialConfigPipe ¶ added in v1.3.3
serial conversions
type SerialUnion ¶ added in v1.3.3
type SerialUnion struct { Union interface{} Pipe *SerialConfigPipe File *SerialConfigFile Device *SerialConfigDevice Auto *SerialConfigAuto }
type ShutdownConfig ¶
type ShutdownConfig struct { ShutdownCommand string `mapstructure:"shutdown_command"` RawShutdownTimeout string `mapstructure:"shutdown_timeout"` ShutdownTimeout time.Duration `` }
func (*ShutdownConfig) Prepare ¶
func (c *ShutdownConfig) Prepare(ctx *interpolate.Context) []error
type StepCleanFiles ¶
type StepCleanFiles struct{}
This step removes unnecessary files from the final result.
Uses:
dir OutputDir ui packer.Ui
Produces:
<nothing>
func (StepCleanFiles) Cleanup ¶
func (StepCleanFiles) Cleanup(multistep.StateBag)
func (StepCleanFiles) Run ¶
func (StepCleanFiles) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepCleanVMX ¶
This step cleans up the VMX by removing or changing this prior to being ready for use.
Uses:
ui packer.Ui vmx_path string
Produces:
<nothing>
func (StepCleanVMX) Cleanup ¶
func (StepCleanVMX) Cleanup(multistep.StateBag)
func (StepCleanVMX) Run ¶
func (s StepCleanVMX) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepCompactDisk ¶
type StepCompactDisk struct {
Skip bool
}
This step compacts the virtual disk for the VM unless the "skip_compaction" boolean is true.
Uses:
driver Driver disk_full_paths ([]string) - The full paths to all created disks ui packer.Ui
Produces:
<nothing>
func (StepCompactDisk) Cleanup ¶
func (StepCompactDisk) Cleanup(multistep.StateBag)
func (StepCompactDisk) Run ¶
func (s StepCompactDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepConfigureVMX ¶
type StepConfigureVMX struct { CustomData map[string]string DisplayName string SkipFloppy bool VMName string }
This step configures a VMX by setting some default settings as well as taking in custom data to set, attaching a floppy if it exists, etc.
Uses:
vmx_path string
Produces:
display_name string - Value of the displayName key set in the VMX file
func (*StepConfigureVMX) Cleanup ¶
func (s *StepConfigureVMX) Cleanup(state multistep.StateBag)
func (*StepConfigureVMX) Run ¶
func (s *StepConfigureVMX) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepConfigureVNC ¶ added in v0.7.0
type StepConfigureVNC struct { Enabled bool VNCBindAddress string VNCPortMin int VNCPortMax int VNCDisablePassword bool // contains filtered or unexported fields }
This step configures the VM to enable the VNC server.
Uses:
ui packer.Ui vmx_path string
Produces:
vnc_port int - The port that VNC is configured to listen on.
func (*StepConfigureVNC) Cleanup ¶ added in v0.7.0
func (s *StepConfigureVNC) Cleanup(multistep.StateBag)
func (*StepConfigureVNC) Run ¶ added in v0.7.0
func (s *StepConfigureVNC) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
func (*StepConfigureVNC) UpdateVMX ¶ added in v0.11.0
func (*StepConfigureVNC) UpdateVMX(address, password string, port int, data map[string]string)
func (*StepConfigureVNC) VNCAddress ¶ added in v0.7.0
type StepExport ¶ added in v1.3.3
type StepExport struct { Format string SkipExport bool VMName string OVFToolOptions []string OutputDir string }
This step exports a VM built on ESXi using ovftool
Uses:
display_name string
func (*StepExport) Cleanup ¶ added in v1.3.3
func (s *StepExport) Cleanup(state multistep.StateBag)
func (*StepExport) Run ¶ added in v1.3.3
func (s *StepExport) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepOutputDir ¶
type StepOutputDir struct { Force bool // contains filtered or unexported fields }
StepOutputDir sets up the output directory by creating it if it does not exist, deleting it if it does exist and we're forcing, and cleaning it up when we're done with it.
func (*StepOutputDir) Cleanup ¶
func (s *StepOutputDir) Cleanup(state multistep.StateBag)
func (*StepOutputDir) Run ¶
func (s *StepOutputDir) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepPrepareTools ¶ added in v0.6.1
func (*StepPrepareTools) Cleanup ¶ added in v0.6.1
func (c *StepPrepareTools) Cleanup(multistep.StateBag)
func (*StepPrepareTools) Run ¶ added in v0.6.1
func (c *StepPrepareTools) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepRegister ¶ added in v1.3.3
type StepRegister struct { Format string KeepRegistered bool SkipExport bool // contains filtered or unexported fields }
func (*StepRegister) Cleanup ¶ added in v1.3.3
func (s *StepRegister) Cleanup(state multistep.StateBag)
func (*StepRegister) Run ¶ added in v1.3.3
func (s *StepRegister) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepRun ¶
type StepRun struct { DurationBeforeStop time.Duration Headless bool // contains filtered or unexported fields }
This step runs the created virtual machine.
Uses:
driver Driver ui packer.Ui vmx_path string
Produces:
<nothing>
type StepShutdown ¶
type StepShutdown struct { Command string Timeout time.Duration // Set this to true if we're testing Testing bool }
This step shuts down the machine. It first attempts to do so gracefully, but ultimately forcefully shuts it down if that fails.
Uses:
communicator packer.Communicator dir OutputDir driver Driver ui packer.Ui vmx_path string
Produces:
<nothing>
func (*StepShutdown) Cleanup ¶
func (s *StepShutdown) Cleanup(state multistep.StateBag)
func (*StepShutdown) Run ¶
func (s *StepShutdown) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepSuppressMessages ¶
type StepSuppressMessages struct{}
This step suppresses any messages that VMware product might show.
func (*StepSuppressMessages) Cleanup ¶
func (s *StepSuppressMessages) Cleanup(state multistep.StateBag)
func (*StepSuppressMessages) Run ¶
func (s *StepSuppressMessages) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepTypeBootCommand ¶ added in v0.7.0
type StepTypeBootCommand struct { BootCommand string VNCEnabled bool BootWait time.Duration VMName string Ctx interpolate.Context KeyInterval time.Duration }
This step "types" the boot command into the VM over VNC.
Uses:
http_port int ui packer.Ui vnc_port int
Produces:
<nothing>
func (*StepTypeBootCommand) Cleanup ¶ added in v0.7.0
func (*StepTypeBootCommand) Cleanup(multistep.StateBag)
func (*StepTypeBootCommand) Run ¶ added in v0.7.0
func (s *StepTypeBootCommand) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepUploadTools ¶ added in v0.6.1
type StepUploadTools struct { RemoteType string ToolsUploadFlavor string ToolsUploadPath string Ctx interpolate.Context }
func (*StepUploadTools) Cleanup ¶ added in v0.6.1
func (c *StepUploadTools) Cleanup(multistep.StateBag)
func (*StepUploadTools) Run ¶ added in v0.6.1
func (c *StepUploadTools) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepUploadVMX ¶ added in v1.3.3
type StepUploadVMX struct {
RemoteType string
}
This step upload the VMX to the remote host
Uses:
driver Driver ui packer.Ui vmx_path string
Produces:
<nothing>
func (StepUploadVMX) Cleanup ¶ added in v1.3.3
func (StepUploadVMX) Cleanup(multistep.StateBag)
func (*StepUploadVMX) Run ¶ added in v1.3.3
func (c *StepUploadVMX) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type ToolsConfig ¶ added in v0.6.1
type ToolsConfig struct { ToolsUploadFlavor string `mapstructure:"tools_upload_flavor"` ToolsUploadPath string `mapstructure:"tools_upload_path"` }
func (*ToolsConfig) Prepare ¶ added in v0.6.1
func (c *ToolsConfig) Prepare(ctx *interpolate.Context) []error
type VMXConfig ¶
type VNCAddressFinder ¶ added in v0.7.0
type VmwareDriver ¶ added in v1.2.0
type VmwareDriver struct { /// These methods define paths that are utilized by the driver /// A driver must overload these in order to point to the correct /// files so that the address detection (ip and ethernet) machinery /// works. DhcpLeasesPath func(string) string DhcpConfPath func(string) string VmnetnatConfPath func(string) string /// This method returns an object with the NetworkNameMapper interface /// that maps network to device and vice-versa. NetworkMapper func() (NetworkNameMapper, error) }
This VmwareDriver is a base class that contains default methods that a Driver can use or implement themselves.
func (*VmwareDriver) GuestAddress ¶ added in v1.2.0
func (d *VmwareDriver) GuestAddress(state multistep.StateBag) (string, error)
func (*VmwareDriver) GuestIP ¶ added in v1.2.0
func (d *VmwareDriver) GuestIP(state multistep.StateBag) (string, error)
func (*VmwareDriver) HostAddress ¶ added in v1.2.0
func (d *VmwareDriver) HostAddress(state multistep.StateBag) (string, error)
type Workstation10Driver ¶ added in v0.6.0
type Workstation10Driver struct {
Workstation9Driver
}
func (*Workstation10Driver) Clone ¶ added in v0.6.0
func (d *Workstation10Driver) Clone(dst, src string, linked bool) error
func (*Workstation10Driver) GetVmwareDriver ¶ added in v1.2.0
func (d *Workstation10Driver) GetVmwareDriver() VmwareDriver
func (*Workstation10Driver) Verify ¶ added in v0.6.0
func (d *Workstation10Driver) Verify() error
type Workstation9Driver ¶
type Workstation9Driver struct { VmwareDriver AppPath string VdiskManagerPath string VmrunPath string // SSHConfig are the SSH settings for the Fusion VM SSHConfig *SSHConfig }
Workstation9Driver is a driver that can run VMware Workstation 9
func (*Workstation9Driver) Clone ¶
func (d *Workstation9Driver) Clone(dst, src string, linked bool) error
func (*Workstation9Driver) CommHost ¶ added in v0.8.0
func (d *Workstation9Driver) CommHost(state multistep.StateBag) (string, error)
func (*Workstation9Driver) CompactDisk ¶
func (d *Workstation9Driver) CompactDisk(diskPath string) error
func (*Workstation9Driver) CreateDisk ¶
func (*Workstation9Driver) GetVmwareDriver ¶ added in v1.2.0
func (d *Workstation9Driver) GetVmwareDriver() VmwareDriver
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) SuppressMessages ¶
func (d *Workstation9Driver) SuppressMessages(vmxPath string) error
func (*Workstation9Driver) ToolsInstall ¶ added in v0.6.0
func (d *Workstation9Driver) ToolsInstall() error
func (*Workstation9Driver) ToolsIsoPath ¶
func (d *Workstation9Driver) ToolsIsoPath(flavor string) string
func (*Workstation9Driver) Verify ¶
func (d *Workstation9Driver) Verify() error
Source Files
¶
- artifact.go
- driver.go
- driver_config.go
- driver_esx5.go
- driver_fusion5.go
- driver_fusion6.go
- driver_mock.go
- driver_parser.go
- driver_player5.go
- driver_player6.go
- driver_player_unix.go
- driver_workstation10.go
- driver_workstation9.go
- driver_workstation_unix.go
- export_config.go
- host_ip_ifconfig.go
- hw_config.go
- output_config.go
- output_dir.go
- output_dir_local.go
- remote_driver.go
- remote_driver_mock.go
- run_config.go
- shutdown_config.go
- ssh.go
- ssh_config.go
- step_clean_files.go
- step_clean_vmx.go
- step_compact_disk.go
- step_configure_vmx.go
- step_configure_vnc.go
- step_export.go
- step_output_dir.go
- step_prepare_tools.go
- step_register.go
- step_run.go
- step_shutdown.go
- step_suppress_messages.go
- step_type_boot_command.go
- step_upload_tools.go
- step_upload_vmx.go
- tools_config.go
- vmx.go
- vmx_config.go