iso

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2018 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArtifactConfFormat         = "artifact.conf.format"
	ArtifactConfKeepRegistered = "artifact.conf.keep_registered"
	ArtifactConfSkipExport     = "artifact.conf.skip_export"
)
View Source
const BuilderIdESX = "mitchellh.vmware-esx"
View Source
const DefaultAdditionalDiskTemplate = `` /* 151-byte string literal not displayed */
View Source
const DefaultVMXTemplate = `` /* 3279-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.

Variables

This section is empty.

Functions

func NewDriver

func NewDriver(config *Config) (vmwcommon.Driver, error)

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

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 (a *Artifact) BuilderId() string

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

func (*Artifact) Files

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

func (*Artifact) Id

func (a *Artifact) Id() string

func (*Artifact) State added in v0.7.2

func (a *Artifact) State(name string) interface{}

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{}) ([]string, error)

func (*Builder) Run

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

type Config added in v0.8.0

type Config struct {
	common.PackerConfig      `mapstructure:",squash"`
	common.HTTPConfig        `mapstructure:",squash"`
	common.ISOConfig         `mapstructure:",squash"`
	common.FloppyConfig      `mapstructure:",squash"`
	bootcommand.VNCConfig    `mapstructure:",squash"`
	vmwcommon.DriverConfig   `mapstructure:",squash"`
	vmwcommon.OutputConfig   `mapstructure:",squash"`
	vmwcommon.RunConfig      `mapstructure:",squash"`
	vmwcommon.ShutdownConfig `mapstructure:",squash"`
	vmwcommon.SSHConfig      `mapstructure:",squash"`
	vmwcommon.ToolsConfig    `mapstructure:",squash"`
	vmwcommon.VMXConfig      `mapstructure:",squash"`

	// disk drives
	AdditionalDiskSize []uint `mapstructure:"disk_additional_size"`
	DiskAdapterType    string `mapstructure:"disk_adapter_type"`
	DiskName           string `mapstructure:"vmdk_name"`
	DiskSize           uint   `mapstructure:"disk_size"`
	DiskTypeId         string `mapstructure:"disk_type_id"`
	Format             string `mapstructure:"format"`

	// cdrom drive
	CdromAdapterType string `mapstructure:"cdrom_adapter_type"`

	// platform information
	GuestOSType string `mapstructure:"guest_os_type"`
	Version     string `mapstructure:"version"`
	VMName      string `mapstructure:"vm_name"`

	// Network adapter and type
	NetworkAdapterType string `mapstructure:"network_adapter_type"`
	Network            string `mapstructure:"network"`

	// device presence
	Sound bool `mapstructure:"sound"`
	USB   bool `mapstructure:"usb"`

	// communication ports
	Serial   string `mapstructure:"serial"`
	Parallel string `mapstructure:"parallel"`

	// booting a guest
	KeepRegistered      bool     `mapstructure:"keep_registered"`
	OVFToolOptions      []string `mapstructure:"ovftool_options"`
	SkipCompaction      bool     `mapstructure:"skip_compaction"`
	SkipExport          bool     `mapstructure:"skip_export"`
	VMXDiskTemplatePath string   `mapstructure:"vmx_disk_template_path"`
	VMXTemplatePath     string   `mapstructure:"vmx_template_path"`

	// remote vsphere
	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           uint   `mapstructure:"remote_port"`
	RemoteUser           string `mapstructure:"remote_username"`
	RemotePassword       string `mapstructure:"remote_password"`
	RemotePrivateKey     string `mapstructure:"remote_private_key_file"`

	CommConfig communicator.Config `mapstructure:",squash"`
	// contains filtered or unexported fields
}

type ESX5Driver

type ESX5Driver struct {
	Host           string
	Port           uint
	Username       string
	Password       string
	PrivateKeyFile string
	Datastore      string
	CacheDatastore string
	CacheDirectory 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) Clone

func (d *ESX5Driver) Clone(dst, src string, linked bool) error

func (*ESX5Driver) CommHost added in v0.8.0

func (d *ESX5Driver) CommHost(state multistep.StateBag) (string, error)

func (*ESX5Driver) CompactDisk

func (d *ESX5Driver) CompactDisk(diskPathLocal string) error

func (*ESX5Driver) CreateDisk

func (d *ESX5Driver) CreateDisk(diskPathLocal string, size string, adapter_type string, typeId string) error

func (*ESX5Driver) Destroy added in v0.9.0

func (d *ESX5Driver) Destroy() error

func (*ESX5Driver) DirExists

func (d *ESX5Driver) DirExists() (bool, error)

func (*ESX5Driver) GetVmwareDriver added in v1.2.0

func (d *ESX5Driver) GetVmwareDriver() vmwcommon.VmwareDriver

func (*ESX5Driver) GuestAddress added in v1.2.0

func (d *ESX5Driver) GuestAddress(multistep.StateBag) (string, error)

func (*ESX5Driver) GuestIP added in v1.2.0

func (d *ESX5Driver) GuestIP(multistep.StateBag) (string, error)

func (*ESX5Driver) HostAddress added in v1.2.0

func (d *ESX5Driver) HostAddress(multistep.StateBag) (string, error)

func (*ESX5Driver) HostIP

func (d *ESX5Driver) HostIP(multistep.StateBag) (string, error)

func (*ESX5Driver) IsDestroyed added in v0.9.0

func (d *ESX5Driver) IsDestroyed() (bool, error)

func (*ESX5Driver) IsRunning

func (d *ESX5Driver) IsRunning(string) (bool, error)

func (*ESX5Driver) ListFiles

func (d *ESX5Driver) ListFiles() ([]string, error)

func (*ESX5Driver) MkdirAll

func (d *ESX5Driver) MkdirAll() error

func (*ESX5Driver) Register

func (d *ESX5Driver) Register(vmxPathLocal string) error

func (*ESX5Driver) ReloadVM added in v0.7.5

func (d *ESX5Driver) ReloadVM() error

func (*ESX5Driver) Remove

func (d *ESX5Driver) Remove(path string) error

func (*ESX5Driver) RemoveAll

func (d *ESX5Driver) RemoveAll() error

func (*ESX5Driver) RemoveCache added in v1.2.4

func (d *ESX5Driver) RemoveCache(localPath string) error

func (*ESX5Driver) SetOutputDir

func (d *ESX5Driver) SetOutputDir(path string)

func (*ESX5Driver) Start

func (d *ESX5Driver) Start(vmxPathLocal string, headless bool) error

func (*ESX5Driver) Stop

func (d *ESX5Driver) Stop(vmxPathLocal string) error

func (*ESX5Driver) String added in v0.5.1

func (d *ESX5Driver) String() string

func (*ESX5Driver) SuppressMessages

func (d *ESX5Driver) SuppressMessages(vmxPath string) error

func (*ESX5Driver) ToolsInstall added in v0.6.0

func (d *ESX5Driver) ToolsInstall() error

func (*ESX5Driver) ToolsIsoPath

func (d *ESX5Driver) ToolsIsoPath(string) string

func (*ESX5Driver) Unregister

func (d *ESX5Driver) Unregister(vmxPathLocal string) error

func (ESX5Driver) UpdateVMX added in v0.11.0

func (ESX5Driver) UpdateVMX(_, password string, port uint, data map[string]string)

UpdateVMX, adds the VNC port to the VMX data.

func (*ESX5Driver) UploadISO

func (d *ESX5Driver) UploadISO(localPath string, checksum string, checksumType string) (string, error)

func (*ESX5Driver) VNCAddress

func (d *ESX5Driver) VNCAddress(_ string, portMin, portMax uint) (string, uint, error)

func (*ESX5Driver) Verify

func (d *ESX5Driver) Verify() error

type OutputDir

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 RemoteDriver

type RemoteDriver interface {
	vmwcommon.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)

	// Reload VM on remote side.
	ReloadVM() error
	// contains filtered or unexported methods
}

type RemoteDriverMock

type RemoteDriverMock struct {
	vmwcommon.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

	ReloadVMErr error
	// contains filtered or unexported fields
}

func (*RemoteDriverMock) Destroy added in v0.9.0

func (d *RemoteDriverMock) Destroy() error

func (*RemoteDriverMock) IsDestroyed added in v0.9.0

func (d *RemoteDriverMock) IsDestroyed() (bool, error)

func (*RemoteDriverMock) Register

func (d *RemoteDriverMock) Register(path string) error

func (*RemoteDriverMock) ReloadVM added in v0.7.5

func (d *RemoteDriverMock) ReloadVM() error

func (*RemoteDriverMock) RemoveCache added in v1.2.4

func (d *RemoteDriverMock) RemoveCache(localPath string) error

func (*RemoteDriverMock) Unregister

func (d *RemoteDriverMock) Unregister(path string) error

func (*RemoteDriverMock) UploadISO

func (d *RemoteDriverMock) UploadISO(path string, checksum string, checksumType string) (string, error)

type StepExport added in v0.9.0

type StepExport struct {
	Format     string
	SkipExport bool
	OutputDir  string
}

This step exports a VM built on ESXi using ovftool

Uses:

display_name string

func (*StepExport) Cleanup added in v0.9.0

func (s *StepExport) Cleanup(state multistep.StateBag)

func (*StepExport) Run added in v0.9.0

type StepRegister

type StepRegister struct {
	Format string
	// contains filtered or unexported fields
}

func (*StepRegister) Cleanup

func (s *StepRegister) Cleanup(state multistep.StateBag)

func (*StepRegister) Run

type StepUploadVMX added in v0.7.5

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 v0.7.5

func (StepUploadVMX) Cleanup(multistep.StateBag)

func (*StepUploadVMX) Run added in v0.7.5

Jump to

Keyboard shortcuts

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