common

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: MPL-2.0 Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Code generated by "mapstructure-to-hcl2 -type LocationConfig"; DO NOT EDIT.

Code generated by "mapstructure-to-hcl2 -type OutputConfig"; DO NOT EDIT.

Code generated by "mapstructure-to-hcl2 -type ConfigParamsConfig"; DO NOT EDIT.

Code generated by "mapstructure-to-hcl2 -type ConnectConfig"; DO NOT EDIT.

Code generated by "mapstructure-to-hcl2 -type ExportConfig"; DO NOT EDIT.

Code generated by "mapstructure-to-hcl2 -type HardwareConfig"; DO NOT EDIT.

Code generated by "mapstructure-to-hcl2 -type RunConfig"; DO NOT EDIT.

Code generated by "mapstructure-to-hcl2 -type ShutdownConfig"; DO NOT EDIT.

Code generated by "mapstructure-to-hcl2 -type WaitIpConfig"; DO NOT EDIT.

Index

Constants

View Source
const BuilderId = "jetbrains.vsphere"

Variables

This section is empty.

Functions

func CommHost

func CommHost(host string) func(multistep.StateBag) (string, error)

Types

type Artifact

type Artifact struct {
	Name string
	VM   *driver.VirtualMachine

	// StateData should store data such as GeneratedData
	// to be shared with post-processors
	StateData map[string]interface{}
}

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

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

func (*Artifact) String

func (a *Artifact) String() string

type ConfigParamsConfig

type ConfigParamsConfig struct {
	// Custom parameters.
	ConfigParams map[string]string `mapstructure:"configuration_parameters"`
}

func (*ConfigParamsConfig) FlatMapstructure

func (*ConfigParamsConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatConfigParamsConfig. FlatConfigParamsConfig is an auto-generated flat version of ConfigParamsConfig. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type ConnectConfig

type ConnectConfig struct {
	// vCenter server hostname.
	VCenterServer string `mapstructure:"vcenter_server"`
	// vSphere username.
	Username string `mapstructure:"username"`
	// vSphere password.
	Password string `mapstructure:"password"`
	// Do not validate vCenter server's TLS certificate. Defaults to `false`.
	InsecureConnection bool `mapstructure:"insecure_connection"`
	// VMware datacenter name. Required if there is more than one datacenter in vCenter.
	Datacenter string `mapstructure:"datacenter"`
}

func (*ConnectConfig) FlatMapstructure

func (*ConnectConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatConnectConfig. FlatConnectConfig is an auto-generated flat version of ConnectConfig. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

func (*ConnectConfig) Prepare

func (c *ConnectConfig) Prepare() []error

type ExportConfig added in v1.5.5

type ExportConfig struct {
	// name of the ovf. defaults to the name of the VM
	Name string `mapstructure:"name"`
	// overwrite ovf if it exists
	Force bool `mapstructure:"force"`
	// include iso and img image files that are attached to the VM
	Images bool `mapstructure:"images"`
	// generate manifest using sha1, sha256, sha512. Defaults to 'sha256'. Use 'none' for no manifest.
	Manifest  string       `mapstructure:"manifest"`
	OutputDir OutputConfig `mapstructure:",squash"`
	// Advanced ovf export options. Options can include:
	// * mac - MAC address is exported for all ethernet devices
	// * uuid - UUID is exported for all virtual machines
	// * extraconfig - all extra configuration options are exported for a virtual machine
	// * nodevicesubtypes - resource subtypes for CD/DVD drives, floppy drives, and serial and parallel ports are not exported
	//
	// For example, adding the following export config option would output the mac addresses for all Ethernet devices in the ovf file:
	//
	// “`json
	// ...
	//   "export": {
	//     "options": ["mac"]
	//   },
	// “`
	Options []string `mapstructure:"options"`
}

You may optionally export an ovf from VSphere to the instance running Packer.

Example usage:

```json ...

"vm_name": "example-ubuntu",

...

"export": {
  "force": true,
  "output_directory": "./output_vsphere"
},

``` The above configuration would create the following files:

``` ./output_vsphere/example-ubuntu-disk-0.vmdk ./output_vsphere/example-ubuntu.mf ./output_vsphere/example-ubuntu.ovf ```

func (*ExportConfig) FlatMapstructure added in v1.5.5

func (*ExportConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatExportConfig. FlatExportConfig is an auto-generated flat version of ExportConfig. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

func (*ExportConfig) Prepare added in v1.5.5

type FlatConfigParamsConfig

type FlatConfigParamsConfig struct {
	ConfigParams map[string]string `mapstructure:"configuration_parameters" cty:"configuration_parameters"`
}

FlatConfigParamsConfig is an auto-generated flat version of ConfigParamsConfig. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatConfigParamsConfig) HCL2Spec

func (*FlatConfigParamsConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a ConfigParamsConfig. This spec is used by HCL to read the fields of ConfigParamsConfig. The decoded values from this spec will then be applied to a FlatConfigParamsConfig.

type FlatConnectConfig

type FlatConnectConfig struct {
	VCenterServer      *string `mapstructure:"vcenter_server" cty:"vcenter_server"`
	Username           *string `mapstructure:"username" cty:"username"`
	Password           *string `mapstructure:"password" cty:"password"`
	InsecureConnection *bool   `mapstructure:"insecure_connection" cty:"insecure_connection"`
	Datacenter         *string `mapstructure:"datacenter" cty:"datacenter"`
}

FlatConnectConfig is an auto-generated flat version of ConnectConfig. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatConnectConfig) HCL2Spec

func (*FlatConnectConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a ConnectConfig. This spec is used by HCL to read the fields of ConnectConfig. The decoded values from this spec will then be applied to a FlatConnectConfig.

type FlatExportConfig added in v1.5.5

type FlatExportConfig struct {
	Name      *string  `mapstructure:"name" cty:"name"`
	Force     *bool    `mapstructure:"force" cty:"force"`
	Images    *bool    `mapstructure:"images" cty:"images"`
	Manifest  *string  `mapstructure:"manifest" cty:"manifest"`
	OutputDir *string  `mapstructure:"output_directory" required:"false" cty:"output_directory"`
	Options   []string `mapstructure:"options" cty:"options"`
}

FlatExportConfig is an auto-generated flat version of ExportConfig. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatExportConfig) HCL2Spec added in v1.5.5

func (*FlatExportConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a ExportConfig. This spec is used by HCL to read the fields of ExportConfig. The decoded values from this spec will then be applied to a FlatExportConfig.

type FlatHardwareConfig

type FlatHardwareConfig struct {
	CPUs                *int32 `mapstructure:"CPUs" cty:"CPUs"`
	CpuCores            *int32 `mapstructure:"cpu_cores" cty:"cpu_cores"`
	CPUReservation      *int64 `mapstructure:"CPU_reservation" cty:"CPU_reservation"`
	CPULimit            *int64 `mapstructure:"CPU_limit" cty:"CPU_limit"`
	CpuHotAddEnabled    *bool  `mapstructure:"CPU_hot_plug" cty:"CPU_hot_plug"`
	RAM                 *int64 `mapstructure:"RAM" cty:"RAM"`
	RAMReservation      *int64 `mapstructure:"RAM_reservation" cty:"RAM_reservation"`
	RAMReserveAll       *bool  `mapstructure:"RAM_reserve_all" cty:"RAM_reserve_all"`
	MemoryHotAddEnabled *bool  `mapstructure:"RAM_hot_plug" cty:"RAM_hot_plug"`
	VideoRAM            *int64 `mapstructure:"video_ram" cty:"video_ram"`
	NestedHV            *bool  `mapstructure:"NestedHV" cty:"NestedHV"`
}

FlatHardwareConfig is an auto-generated flat version of HardwareConfig. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatHardwareConfig) HCL2Spec

func (*FlatHardwareConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a HardwareConfig. This spec is used by HCL to read the fields of HardwareConfig. The decoded values from this spec will then be applied to a FlatHardwareConfig.

type FlatLocationConfig

type FlatLocationConfig struct {
	VMName       *string `mapstructure:"vm_name" cty:"vm_name"`
	Folder       *string `mapstructure:"folder" cty:"folder"`
	Cluster      *string `mapstructure:"cluster" cty:"cluster"`
	Host         *string `mapstructure:"host" cty:"host"`
	ResourcePool *string `mapstructure:"resource_pool" cty:"resource_pool"`
	Datastore    *string `mapstructure:"datastore" cty:"datastore"`
}

FlatLocationConfig is an auto-generated flat version of LocationConfig. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatLocationConfig) HCL2Spec

func (*FlatLocationConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a LocationConfig. This spec is used by HCL to read the fields of LocationConfig. The decoded values from this spec will then be applied to a FlatLocationConfig.

type FlatOutputConfig added in v1.5.5

type FlatOutputConfig struct {
	OutputDir *string `mapstructure:"output_directory" required:"false" cty:"output_directory"`
}

FlatOutputConfig is an auto-generated flat version of OutputConfig. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatOutputConfig) HCL2Spec added in v1.5.5

func (*FlatOutputConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a OutputConfig. This spec is used by HCL to read the fields of OutputConfig. The decoded values from this spec will then be applied to a FlatOutputConfig.

type FlatRunConfig

type FlatRunConfig struct {
	BootOrder *string `mapstructure:"boot_order" cty:"boot_order"`
}

FlatRunConfig is an auto-generated flat version of RunConfig. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatRunConfig) HCL2Spec

func (*FlatRunConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a RunConfig. This spec is used by HCL to read the fields of RunConfig. The decoded values from this spec will then be applied to a FlatRunConfig.

type FlatShutdownConfig

type FlatShutdownConfig struct {
	Command *string `mapstructure:"shutdown_command" cty:"shutdown_command"`
	Timeout *string `mapstructure:"shutdown_timeout" cty:"shutdown_timeout"`
}

FlatShutdownConfig is an auto-generated flat version of ShutdownConfig. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatShutdownConfig) HCL2Spec

func (*FlatShutdownConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a ShutdownConfig. This spec is used by HCL to read the fields of ShutdownConfig. The decoded values from this spec will then be applied to a FlatShutdownConfig.

type FlatWaitIpConfig

type FlatWaitIpConfig struct {
	WaitTimeout   *string `mapstructure:"ip_wait_timeout" cty:"ip_wait_timeout"`
	SettleTimeout *string `mapstructure:"ip_settle_timeout" cty:"ip_settle_timeout"`
}

FlatWaitIpConfig is an auto-generated flat version of WaitIpConfig. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatWaitIpConfig) HCL2Spec

func (*FlatWaitIpConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a WaitIpConfig. This spec is used by HCL to read the fields of WaitIpConfig. The decoded values from this spec will then be applied to a FlatWaitIpConfig.

type HardwareConfig

type HardwareConfig struct {
	// Number of CPU sockets.
	CPUs int32 `mapstructure:"CPUs"`
	// Number of CPU cores per socket.
	CpuCores int32 `mapstructure:"cpu_cores"`
	// Amount of reserved CPU resources in MHz.
	CPUReservation int64 `mapstructure:"CPU_reservation"`
	// Upper limit of available CPU resources in MHz.
	CPULimit int64 `mapstructure:"CPU_limit"`
	// Enable CPU hot plug setting for virtual machine. Defaults to `false`.
	CpuHotAddEnabled bool `mapstructure:"CPU_hot_plug"`
	// Amount of RAM in MB.
	RAM int64 `mapstructure:"RAM"`
	// Amount of reserved RAM in MB.
	RAMReservation int64 `mapstructure:"RAM_reservation"`
	// Reserve all available RAM. Defaults to `false`. Cannot be used together
	// with `RAM_reservation`.
	RAMReserveAll bool `mapstructure:"RAM_reserve_all"`
	// Enable RAM hot plug setting for virtual machine. Defaults to `false`.
	MemoryHotAddEnabled bool `mapstructure:"RAM_hot_plug"`
	// Amount of video memory in MB.
	VideoRAM int64 `mapstructure:"video_ram"`
	// Enable nested hardware virtualization for VM. Defaults to `false`.
	NestedHV bool `mapstructure:"NestedHV"`
}

func (*HardwareConfig) FlatMapstructure

func (*HardwareConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatHardwareConfig. FlatHardwareConfig is an auto-generated flat version of HardwareConfig. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

func (*HardwareConfig) Prepare

func (c *HardwareConfig) Prepare() []error

type LocationConfig

type LocationConfig struct {
	// Name of the new VM to create.
	VMName string `mapstructure:"vm_name"`
	// VM folder to create the VM in.
	Folder string `mapstructure:"folder"`
	// ESXi cluster where target VM is created. See
	// [Working with Clusters](#working-with-clusters).
	Cluster string `mapstructure:"cluster"`
	// ESXi host where target VM is created. A full path must be specified if
	// the host is in a folder. For example `folder/host`. See the
	// `Specifying Clusters and Hosts` section above for more details.
	Host string `mapstructure:"host"`
	// VMWare resource pool. Defaults to the root resource pool of the
	// `host` or `cluster`.
	ResourcePool string `mapstructure:"resource_pool"`
	// VMWare datastore. Required if `host` is a cluster, or if `host` has
	// multiple datastores.
	Datastore string `mapstructure:"datastore"`
}

func (*LocationConfig) FlatMapstructure

func (*LocationConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatLocationConfig. FlatLocationConfig is an auto-generated flat version of LocationConfig. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

func (*LocationConfig) Prepare

func (c *LocationConfig) Prepare() []error

type OutputConfig added in v1.5.5

type OutputConfig struct {
	// This setting specifies the directory that
	// artifacts from the build, such as the virtual machine files and disks,
	// will be output to. The path to the directory may be relative or
	// absolute. If relative, the path is relative to the working directory
	// packer is executed from. This directory must not exist or, if
	// created, must be empty prior to running the builder. By default this is
	// "output-BUILDNAME" where "BUILDNAME" is the name of the build.
	OutputDir string `mapstructure:"output_directory" required:"false"`
}

func (*OutputConfig) FlatMapstructure added in v1.5.5

func (*OutputConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatOutputConfig. FlatOutputConfig is an auto-generated flat version of OutputConfig. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

func (*OutputConfig) Prepare added in v1.5.5

func (c *OutputConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) []error

type RunConfig

type RunConfig struct {
	// Priority of boot devices. Defaults to `disk,cdrom`
	BootOrder string `mapstructure:"boot_order"` // example: "floppy,cdrom,ethernet,disk"
}

func (*RunConfig) FlatMapstructure

func (*RunConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatRunConfig. FlatRunConfig is an auto-generated flat version of RunConfig. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type ShutdownConfig

type ShutdownConfig struct {
	// Specify a VM guest shutdown command. VMware guest tools are used by
	// default.
	Command string `mapstructure:"shutdown_command"`
	// Amount of time to wait for graceful VM shutdown. Examples 45s and 10m.
	// Defaults to 5m(5 minutes).
	Timeout time.Duration `mapstructure:"shutdown_timeout"`
}

func (*ShutdownConfig) FlatMapstructure

func (*ShutdownConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatShutdownConfig. FlatShutdownConfig is an auto-generated flat version of ShutdownConfig. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

func (*ShutdownConfig) Prepare

func (c *ShutdownConfig) Prepare() []error

type StepConfigParams

type StepConfigParams struct {
	Config *ConfigParamsConfig
}

func (*StepConfigParams) Cleanup

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

func (*StepConfigParams) Run

type StepConfigureHardware

type StepConfigureHardware struct {
	Config *HardwareConfig
}

func (*StepConfigureHardware) Cleanup

func (*StepConfigureHardware) Run

type StepConnect

type StepConnect struct {
	Config *ConnectConfig
}

func (*StepConnect) Cleanup

func (s *StepConnect) Cleanup(multistep.StateBag)

func (*StepConnect) Run

type StepConvertToTemplate

type StepConvertToTemplate struct {
	ConvertToTemplate bool
}

func (*StepConvertToTemplate) Cleanup

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

func (*StepConvertToTemplate) Run

type StepCreateSnapshot

type StepCreateSnapshot struct {
	CreateSnapshot bool
}

func (*StepCreateSnapshot) Cleanup

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

func (*StepCreateSnapshot) Run

type StepExport added in v1.5.5

type StepExport struct {
	Name      string
	Force     bool
	Images    bool
	Manifest  string
	OutputDir string
	Options   []string
	// contains filtered or unexported fields
}

func (*StepExport) Cleanup added in v1.5.5

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

func (*StepExport) Download added in v1.5.5

func (s *StepExport) Download(ctx context.Context, lease *nfc.Lease, item nfc.FileItem) error

func (*StepExport) Run added in v1.5.5

type StepRun

type StepRun struct {
	Config   *RunConfig
	SetOrder bool
}

func (*StepRun) Cleanup

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

func (*StepRun) Run

type StepShutdown

type StepShutdown struct {
	Config *ShutdownConfig
}

func (*StepShutdown) Cleanup

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

func (*StepShutdown) Run

type StepWaitForIp

type StepWaitForIp struct {
	Config *WaitIpConfig
}

func (*StepWaitForIp) Cleanup

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

func (*StepWaitForIp) Run

type WaitIpConfig

type WaitIpConfig struct {
	// Amount of time to wait for VM's IP, similar to 'ssh_timeout'.
	// Defaults to 30m (30 minutes). See the Goang
	// [ParseDuration](https://golang.org/pkg/time/#ParseDuration) documentation
	// for full details.
	WaitTimeout time.Duration `mapstructure:"ip_wait_timeout"`
	// Amount of time to wait for VM's IP to settle down, sometimes VM may
	// report incorrect IP initially, then its recommended to set that
	// parameter to apx. 2 minutes. Examples 45s and 10m. Defaults to
	// 5s(5 seconds). See the Golang
	// [ParseDuration](https://golang.org/pkg/time/#ParseDuration) documentation
	//  for full details.
	SettleTimeout time.Duration `mapstructure:"ip_settle_timeout"`
}

func (*WaitIpConfig) FlatMapstructure

func (*WaitIpConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatWaitIpConfig. FlatWaitIpConfig is an auto-generated flat version of WaitIpConfig. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

func (*WaitIpConfig) Prepare

func (c *WaitIpConfig) Prepare() []error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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