iso

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAdditionalDiskTemplate = `` /* 151-byte string literal not displayed */
View Source
const DefaultVMXTemplate = `` /* 3413-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

This section is empty.

Types

type Builder

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

func (*Builder) Prepare

func (b *Builder) Prepare(raws ...interface{}) ([]string, error)

Prepare processes the build configuration parameters.

func (*Builder) Run

func (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (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.HWConfig             `mapstructure:",squash"`
	vmwcommon.OutputConfig         `mapstructure:",squash"`
	vmwcommon.RunConfig            `mapstructure:",squash"`
	shutdowncommand.ShutdownConfig `mapstructure:",squash"`
	vmwcommon.SSHConfig            `mapstructure:",squash"`
	vmwcommon.ToolsConfig          `mapstructure:",squash"`
	vmwcommon.VMXConfig            `mapstructure:",squash"`
	vmwcommon.ExportConfig         `mapstructure:",squash"`
	// The size(s) of any additional
	// hard disks for the VM in megabytes. If this is not specified then the VM
	// will only contain a primary hard disk. The builder uses expandable, not
	// fixed-size virtual hard disks, so the actual file representing the disk will
	// not use the full size unless it is full.
	AdditionalDiskSize []uint `mapstructure:"disk_additional_size" required:"false"`
	// The adapter type of the VMware virtual disk to create. This option is
	// for advanced usage, modify only if you know what you're doing. Some of
	// the options you can specify are `ide`, `sata`, `nvme` or `scsi` (which
	// uses the "lsilogic" scsi interface by default). If you specify another
	// option, Packer will assume that you're specifying a `scsi` interface of
	// that specified type. For more information, please consult [Virtual Disk
	// Manager User's Guide](http://www.vmware.com/pdf/VirtualDiskManager.pdf)
	// for desktop VMware clients. For ESXi, refer to the proper ESXi
	// documentation.
	DiskAdapterType string `mapstructure:"disk_adapter_type" required:"false"`
	// The filename of the virtual disk that'll be created,
	// without the extension. This defaults to packer.
	DiskName string `mapstructure:"vmdk_name" required:"false"`
	// The size of the hard disk for the VM in megabytes.
	// The builder uses expandable, not fixed-size virtual hard disks, so the
	// actual file representing the disk will not use the full size unless it
	// is full. By default this is set to 40000 (about 40 GB).
	DiskSize uint `mapstructure:"disk_size" required:"false"`
	// The type of VMware virtual disk to create. This
	// option is for advanced usage.
	//
	//   For desktop VMware clients:
	//
	//   Type ID | Description
	//   ------- | ---
	//   `0`     | Growable virtual disk contained in a single file (monolithic sparse).
	//   `1`     | Growable virtual disk split into 2GB files (split sparse).
	//   `2`     | Preallocated virtual disk contained in a single file (monolithic flat).
	//   `3`     | Preallocated virtual disk split into 2GB files (split flat).
	//   `4`     | Preallocated virtual disk compatible with ESX server (VMFS flat).
	//   `5`     | Compressed disk optimized for streaming.
	//
	//   The default is `1`.
	//
	//   For ESXi, this defaults to `zeroedthick`. The available options for ESXi
	//   are: `zeroedthick`, `eagerzeroedthick`, `thin`. `rdm:dev`, `rdmp:dev`,
	//   `2gbsparse` are not supported. Due to default disk compaction, when using
	//   `zeroedthick` or `eagerzeroedthick` set `skip_compaction` to `true`.
	//
	//   For more information, please consult the [Virtual Disk Manager User's
	//   Guide](https://www.vmware.com/pdf/VirtualDiskManager.pdf) for desktop
	//   VMware clients. For ESXi, refer to the proper ESXi documentation.
	DiskTypeId string `mapstructure:"disk_type_id" required:"false"`
	// Either "ovf", "ova" or "vmx", this specifies the output
	// format of the exported virtual machine. This defaults to "ovf".
	// Before using this option, you need to install ovftool. This option
	// currently only works when option remote_type is set to "esx5".
	// Since ovftool is only capable of password based authentication
	// remote_password must be set when exporting the VM.
	Format string `mapstructure:"format" required:"false"`
	// The adapter type (or bus) that will be used
	// by the cdrom device. This is chosen by default based on the disk adapter
	// type. VMware tends to lean towards ide for the cdrom device unless
	// sata is chosen for the disk adapter and so Packer attempts to mirror
	// this logic. This field can be specified as either ide, sata, or scsi.
	CdromAdapterType string `mapstructure:"cdrom_adapter_type" required:"false"`
	// The guest OS type being installed. This will be
	// set in the VMware VMX. By default this is other. By specifying a more
	// specific OS type, VMware may perform some optimizations or virtual hardware
	// changes to better support the operating system running in the
	// virtual machine.
	GuestOSType string `mapstructure:"guest_os_type" required:"false"`
	// The [vmx hardware
	// version](http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1003746)
	// for the new virtual machine. Only the default value has been tested, any
	// other value is experimental. Default value is `9`.
	Version string `mapstructure:"version" required:"false"`
	// This is the name of the VMX file for the new virtual
	// machine, without the file extension. By default this is packer-BUILDNAME,
	// where "BUILDNAME" is the name of the build.
	VMName string `mapstructure:"vm_name" required:"false"`

	VMXDiskTemplatePath string `mapstructure:"vmx_disk_template_path"`
	// Path to a [configuration template](/docs/templates/engine.html) that
	// defines the contents of the virtual machine VMX file for VMware. This is
	// for **advanced users only** as this can render the virtual machine
	// non-functional. See below for more information. For basic VMX
	// modifications, try `vmx_data` first.
	VMXTemplatePath string `mapstructure:"vmx_template_path" required:"false"`
	// contains filtered or unexported fields
}

func NewConfig added in v1.3.3

func NewConfig(raws ...interface{}) (*Config, []string, error)

Jump to

Keyboard shortcuts

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