ovf

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder implements packer.Builder and builds the actual VirtualBox images.

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)

Run executes a Packer build and returns a packer.Artifact representing a VirtualBox appliance.

type Config

type Config struct {
	common.PackerConfig             `mapstructure:",squash"`
	common.HTTPConfig               `mapstructure:",squash"`
	common.FloppyConfig             `mapstructure:",squash"`
	bootcommand.BootConfig          `mapstructure:",squash"`
	vboxcommon.ExportConfig         `mapstructure:",squash"`
	vboxcommon.OutputConfig         `mapstructure:",squash"`
	vboxcommon.RunConfig            `mapstructure:",squash"`
	vboxcommon.SSHConfig            `mapstructure:",squash"`
	vboxcommon.ShutdownConfig       `mapstructure:",squash"`
	vboxcommon.VBoxManageConfig     `mapstructure:",squash"`
	vboxcommon.VBoxVersionConfig    `mapstructure:",squash"`
	vboxcommon.GuestAdditionsConfig `mapstructure:",squash"`
	// The checksum for the source_path file. The
	// algorithm to use when computing the checksum can be optionally specified
	// with checksum_type. When checksum_type is not set packer will guess the
	// checksumming type based on checksum length. checksum can be also be a
	// file or an URL, in which case checksum_type must be set to file; the
	// go-getter will download it and use the first hash found.
	Checksum string `mapstructure:"checksum" required:"true"`
	// The type of the checksum specified in checksum.
	// Valid values are none, md5, sha1, sha256, or sha512. Although the
	// checksum will not be verified when checksum_type is set to "none", this is
	// not recommended since OVA files can be very large and corruption does happen
	// from time to time.
	ChecksumType string `mapstructure:"checksum_type" required:"false"`
	// The method by which guest additions are
	// made available to the guest for installation. Valid options are upload,
	// attach, or disable. If the mode is attach the guest additions ISO will
	// be attached as a CD device to the virtual machine. If the mode is upload
	// the guest additions ISO will be uploaded to the path specified by
	// guest_additions_path. The default value is upload. If disable is used,
	// guest additions won't be downloaded, either.
	GuestAdditionsMode string `mapstructure:"guest_additions_mode" required:"false"`
	// The path on the guest virtual machine
	// where the VirtualBox guest additions ISO will be uploaded. By default this
	// is VBoxGuestAdditions.iso which should upload into the login directory of
	// the user. This is a configuration
	// template where the Version
	// variable is replaced with the VirtualBox version.
	GuestAdditionsPath string `mapstructure:"guest_additions_path" required:"false"`
	// The interface type to use to mount
	// guest additions when guest_additions_mode is set to attach. Will
	// default to the value set in iso_interface, if iso_interface is set.
	// Will default to "ide", if iso_interface is not set. Options are "ide" and
	// "sata".
	GuestAdditionsInterface string `mapstructure:"guest_additions_interface" required:"false"`
	// The SHA256 checksum of the guest
	// additions ISO that will be uploaded to the guest VM. By default the
	// checksums will be downloaded from the VirtualBox website, so this only needs
	// to be set if you want to be explicit about the checksum.
	GuestAdditionsSHA256 string `mapstructure:"guest_additions_sha256" required:"false"`
	// The URL to the guest additions ISO
	// to upload. This can also be a file URL if the ISO is at a local path. By
	// default, the VirtualBox builder will attempt to find the guest additions ISO
	// on the local file system. If it is not available locally, the builder will
	// download the proper guest additions ISO from the internet.
	GuestAdditionsURL string `mapstructure:"guest_additions_url" required:"false"`
	// Additional flags to pass to
	// VBoxManage import. This can be used to add additional command-line flags
	// such as --eula-accept to accept a EULA in the OVF.
	ImportFlags []string `mapstructure:"import_flags" required:"false"`
	// Additional options to pass to the
	// VBoxManage import. This can be useful for passing keepallmacs or
	// keepnatmacs options for existing ovf images.
	ImportOpts string `mapstructure:"import_opts" required:"false"`
	// The path to an OVF or OVA file that acts as the
	// source of this build. This currently must be a local file.
	SourcePath string `mapstructure:"source_path" required:"true"`
	// The path where the OVA should be saved
	// after download. By default, it will go in the packer cache, with a hash of
	// the original filename as its name.
	TargetPath string `mapstructure:"target_path" required:"false"`
	// This is the name of the OVF 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"`
	// Set this to true if you would like to keep
	// the VM registered with virtualbox. Defaults to false.
	KeepRegistered bool `mapstructure:"keep_registered" required:"false"`
	// Defaults to false. When enabled, Packer will
	// not export the VM. Useful if the build output is not the resultant image,
	// but created inside the VM.
	SkipExport bool `mapstructure:"skip_export" required:"false"`
	// contains filtered or unexported fields
}

Config is the configuration structure for the builder.

func NewConfig

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

type StepImport

type StepImport struct {
	Name        string
	ImportFlags []string
	// contains filtered or unexported fields
}

This step imports an OVF VM into VirtualBox.

func (*StepImport) Cleanup

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

func (*StepImport) Run

Jump to

Keyboard shortcuts

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