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
- func CommHost(host string) func(multistep.StateBag) (string, error)
- type Artifact
- type ConfigParamsConfig
- type ConnectConfig
- type ExportConfig
- type FlatConfigParamsConfig
- type FlatConnectConfig
- type FlatExportConfig
- type FlatHardwareConfig
- type FlatLocationConfig
- type FlatOutputConfig
- type FlatRunConfig
- type FlatShutdownConfig
- type FlatWaitIpConfig
- type HardwareConfig
- type LocationConfig
- type OutputConfig
- type RunConfig
- type ShutdownConfig
- type StepConfigParams
- type StepConfigureHardware
- type StepConnect
- type StepConvertToTemplate
- type StepCreateSnapshot
- type StepExport
- type StepRun
- type StepShutdown
- type StepWaitForIp
- type WaitIpConfig
Constants ¶
const BuilderId = "jetbrains.vsphere"
Variables ¶
This section is empty.
Functions ¶
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{}
}
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
func (c *ExportConfig) Prepare(ctx *interpolate.Context, lc *LocationConfig, pc *common.PackerConfig) []error
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.
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.
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.
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.
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.
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.
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.
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.
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 ¶
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 ¶
func (s *StepConfigParams) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepConfigureHardware ¶
type StepConfigureHardware struct {
Config *HardwareConfig
}
func (*StepConfigureHardware) Cleanup ¶
func (s *StepConfigureHardware) Cleanup(multistep.StateBag)
func (*StepConfigureHardware) Run ¶
func (s *StepConfigureHardware) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepConnect ¶
type StepConnect struct {
Config *ConnectConfig
}
func (*StepConnect) Cleanup ¶
func (s *StepConnect) Cleanup(multistep.StateBag)
func (*StepConnect) Run ¶
func (s *StepConnect) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepConvertToTemplate ¶
type StepConvertToTemplate struct {
ConvertToTemplate bool
}
func (*StepConvertToTemplate) Cleanup ¶
func (s *StepConvertToTemplate) Cleanup(state multistep.StateBag)
func (*StepConvertToTemplate) Run ¶
func (s *StepConvertToTemplate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
type StepCreateSnapshot ¶
type StepCreateSnapshot struct {
CreateSnapshot bool
}
func (*StepCreateSnapshot) Cleanup ¶
func (s *StepCreateSnapshot) Cleanup(state multistep.StateBag)
func (*StepCreateSnapshot) Run ¶
func (s *StepCreateSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction
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) Run ¶ added in v1.5.5
func (s *StepExport) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
type StepShutdown ¶
type StepShutdown struct {
Config *ShutdownConfig
}
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 StepWaitForIp ¶
type StepWaitForIp struct {
Config *WaitIpConfig
}
func (*StepWaitForIp) Cleanup ¶
func (s *StepWaitForIp) Cleanup(state multistep.StateBag)
func (*StepWaitForIp) Run ¶
func (s *StepWaitForIp) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction
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
Source Files
¶
- artifact.go
- config_location.go
- config_location.hcl2spec.go
- config_ssh.go
- output_config.go
- output_config.hcl2spec.go
- step_config_params.go
- step_config_params.hcl2spec.go
- step_connect.go
- step_connect.hcl2spec.go
- step_export.go
- step_export.hcl2spec.go
- step_hardware.go
- step_hardware.hcl2spec.go
- step_run.go
- step_run.hcl2spec.go
- step_shutdown.go
- step_shutdown.hcl2spec.go
- step_snapshot.go
- step_template.go
- step_wait_for_ip.go
- step_wait_for_ip.hcl2spec.go