Documentation
¶
Index ¶
- Constants
- type Artifact
- type Config
- type FlatConfig
- type PostProcessor
- func (p *PostProcessor) BuildArgs(source, ovftool_uri string) ([]string, error)
- func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec
- func (p *PostProcessor) Configure(raws ...interface{}) error
- func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error)
- func (p *PostProcessor) ValidateOvfTool(args []string, ofvtool string) error
Constants ¶
View Source
const BuilderId = "packer.post-processor.vsphere"
View Source
const DefaultDiskMode = "thick"
View Source
const DefaultMaxRetries = 5
View Source
const OvftoolWindows = "ovftool.exe"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct {
// contains filtered or unexported fields
}
func NewArtifact ¶
type Config ¶
type Config struct {
common.PackerConfig `mapstructure:",squash"`
// Specifies the vSphere cluster or ESXi host to upload the virtual machine.
// This can be either the name of the vSphere cluster or the fully qualified domain name (FQDN)
// or IP address of the ESXi host.
Cluster string `mapstructure:"cluster" required:"true"`
// Specifies the name of the vSphere datacenter object to place the virtual machine.
// This is _not required_ if `resource_pool` is specified.
Datacenter string `mapstructure:"datacenter" required:"true"`
// Specifies the name of the vSphere datastore to place the virtual machine.
Datastore string `mapstructure:"datastore" required:"true"`
// Specifies the disk format of the target virtual machine. One of `thin`, `thick`,
DiskMode string `mapstructure:"disk_mode"`
// Specifies the fully qualified domain name or IP address of the vCenter Server or ESXi host.
Host string `mapstructure:"host" required:"true"`
// Specifies the fully qualified domain name or IP address of the ESXi host to upload the
// virtual machine. This is _not required_ if `host` is a vCenter Server.
ESXiHost string `mapstructure:"esxi_host"`
// Specifies whether to skip the verification of the server certificate. Defaults to `false`.
Insecure bool `mapstructure:"insecure"`
// Specifies custom options to add in `ovftool`.
// Use `ovftool --help` to list all the options available.
Options []string `mapstructure:"options"`
// Specifies whether to overwrite the existing files.
// If `true`, forces existing files to to be overwritten. Defaults to `false`.
Overwrite bool `mapstructure:"overwrite"`
// Specifies the password to use to authenticate to the vSphere endpoint.
Password string `mapstructure:"password" required:"true"`
// Specifies the name of the resource pool to place the virtual machine.
ResourcePool string `mapstructure:"resource_pool"`
// Specifies the username to use to authenticate to the vSphere endpoint.
Username string `mapstructure:"username" required:"true"`
// Specifies the name of the virtual machine folder path where the virtual machine will be
// placed.
VMFolder string `mapstructure:"vm_folder"`
// Specifies the name of the virtual machine to be created on the vSphere endpoint.
VMName string `mapstructure:"vm_name"`
// Specifies the name of the network in which to place the virtual machine.
VMNetwork string `mapstructure:"vm_network"`
// Specifies the maximum virtual hardware version for the deployed virtual machine.
//
// It does not upgrade the virtual hardware version of the source VM. Instead, it limits the
// virtual hardware version of the deployed virtual machine to the specified version.
// If the source virtual machine's hardware version is higher than the specified version, the
// deployed virtual machine's hardware version will be downgraded to the specified version.
//
// If the source virtual machine's hardware version is lower than or equal to the specified
// version, the deployed virtual machine's hardware version will be the same as the source
// virtual machine's.
//
// This option is useful when deploying to vCenter Server instance ot an ESXi host whose
// version is different than the one used to create the artifact.
//
// See [VMware KB 1003746](https://kb.vmware.com/s/article/1003746) for more information on the
// virtual hardware versions supported.
HardwareVersion string `mapstructure:"hardware_version"`
// Specifies the maximum number of times to retry the upload operation if it fails.
// Defaults to `5`.
MaxRetries int `mapstructure:"max_retries"`
// contains filtered or unexported fields
}
type FlatConfig ¶
type FlatConfig struct {
PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"`
PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"`
PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"`
PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"`
PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"`
PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"`
PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"`
PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"`
Cluster *string `mapstructure:"cluster" required:"true" cty:"cluster" hcl:"cluster"`
Datacenter *string `mapstructure:"datacenter" required:"true" cty:"datacenter" hcl:"datacenter"`
Datastore *string `mapstructure:"datastore" required:"true" cty:"datastore" hcl:"datastore"`
DiskMode *string `mapstructure:"disk_mode" cty:"disk_mode" hcl:"disk_mode"`
Host *string `mapstructure:"host" required:"true" cty:"host" hcl:"host"`
ESXiHost *string `mapstructure:"esxi_host" cty:"esxi_host" hcl:"esxi_host"`
Insecure *bool `mapstructure:"insecure" cty:"insecure" hcl:"insecure"`
Options []string `mapstructure:"options" cty:"options" hcl:"options"`
Overwrite *bool `mapstructure:"overwrite" cty:"overwrite" hcl:"overwrite"`
Password *string `mapstructure:"password" required:"true" cty:"password" hcl:"password"`
ResourcePool *string `mapstructure:"resource_pool" cty:"resource_pool" hcl:"resource_pool"`
Username *string `mapstructure:"username" required:"true" cty:"username" hcl:"username"`
VMFolder *string `mapstructure:"vm_folder" cty:"vm_folder" hcl:"vm_folder"`
VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"`
VMNetwork *string `mapstructure:"vm_network" cty:"vm_network" hcl:"vm_network"`
HardwareVersion *string `mapstructure:"hardware_version" cty:"hardware_version" hcl:"hardware_version"`
MaxRetries *int `mapstructure:"max_retries" cty:"max_retries" hcl:"max_retries"`
}
FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type PostProcessor ¶
type PostProcessor struct {
// contains filtered or unexported fields
}
func (*PostProcessor) BuildArgs ¶
func (p *PostProcessor) BuildArgs(source, ovftool_uri string) ([]string, error)
func (*PostProcessor) ConfigSpec ¶
func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec
func (*PostProcessor) Configure ¶
func (p *PostProcessor) Configure(raws ...interface{}) error
func (*PostProcessor) PostProcess ¶
func (*PostProcessor) ValidateOvfTool ¶
func (p *PostProcessor) ValidateOvfTool(args []string, ofvtool string) error
Click to show internal directories.
Click to hide internal directories.