diff --git a/.web-docs/components/builder/vsphere-clone/README.md b/.web-docs/components/builder/vsphere-clone/README.md index 093e3bd9..7d370291 100644 --- a/.web-docs/components/builder/vsphere-clone/README.md +++ b/.web-docs/components/builder/vsphere-clone/README.md @@ -1344,7 +1344,7 @@ boot time. **NOTE**: Guests using Windows with Win32-OpenSSH v9.1.0.0p1-Beta, scp (the default protocol for copying data) returns a a non-zero error code since the MOTW cannot be set, which cause any file transfer to fail. As a workaround you can override the transfer protocol - with SFTP instead `ssh_file_transfer_method = "sftp"`. + with SFTP instead `ssh_file_transfer_protocol = "sftp"`. - `ssh_proxy_host` (string) - A SOCKS proxy host to use for SSH connection diff --git a/.web-docs/components/builder/vsphere-iso/README.md b/.web-docs/components/builder/vsphere-iso/README.md index 0380f40c..c5506f32 100644 --- a/.web-docs/components/builder/vsphere-iso/README.md +++ b/.web-docs/components/builder/vsphere-iso/README.md @@ -1528,7 +1528,7 @@ JSON Example: **NOTE**: Guests using Windows with Win32-OpenSSH v9.1.0.0p1-Beta, scp (the default protocol for copying data) returns a a non-zero error code since the MOTW cannot be set, which cause any file transfer to fail. As a workaround you can override the transfer protocol - with SFTP instead `ssh_file_transfer_method = "sftp"`. + with SFTP instead `ssh_file_transfer_protocol = "sftp"`. - `ssh_proxy_host` (string) - A SOCKS proxy host to use for SSH connection diff --git a/.web-docs/components/builder/vsphere-supervisor/README.md b/.web-docs/components/builder/vsphere-supervisor/README.md index 0611211d..bb5669d8 100644 --- a/.web-docs/components/builder/vsphere-supervisor/README.md +++ b/.web-docs/components/builder/vsphere-supervisor/README.md @@ -171,7 +171,7 @@ items are listed below as well as the _optional_ configurations. - `image_name` (string) - Name of the source virtual machine (VM) image. If it is specified, the image with the name will be used for the source VM, otherwise the image name from imported image will be used. -- `source_name` (string) - Name of the source VM. Defaults to `packer-vsphere-supervisor-`. +- `source_name` (string) - Name of the source VM. Limited to 15 characters. Defaults to `source-`. - `network_type` (string) - Name of the network type to attach to the source VM's network interface. Defaults to empty. @@ -296,7 +296,7 @@ items are listed below as well as the _optional_ configurations. **NOTE**: Guests using Windows with Win32-OpenSSH v9.1.0.0p1-Beta, scp (the default protocol for copying data) returns a a non-zero error code since the MOTW cannot be set, which cause any file transfer to fail. As a workaround you can override the transfer protocol - with SFTP instead `ssh_file_transfer_method = "sftp"`. + with SFTP instead `ssh_file_transfer_protocol = "sftp"`. - `ssh_proxy_host` (string) - A SOCKS proxy host to use for SSH connection diff --git a/builder/vsphere/supervisor/step_create_source.go b/builder/vsphere/supervisor/step_create_source.go index 5bb483e1..4e559849 100644 --- a/builder/vsphere/supervisor/step_create_source.go +++ b/builder/vsphere/supervisor/step_create_source.go @@ -23,7 +23,7 @@ import ( ) const ( - DefaultSourceNamePrefix = "packer-vsphere-supervisor" + DefaultSourceNamePrefix = "source" VMSelectorLabelKey = DefaultSourceNamePrefix + "-selector" StateKeySourceName = "source_name" @@ -42,11 +42,10 @@ type CreateSourceConfig struct { ClassName string `mapstructure:"class_name" required:"true"` // Name of the storage class that configures storage-related attributes. StorageClass string `mapstructure:"storage_class" required:"true"` - // Name of the source virtual machine (VM) image. If it is specified, the image with the name will be used for the // source VM, otherwise the image name from imported image will be used. ImageName string `mapstructure:"image_name"` - // Name of the source VM. Defaults to `packer-vsphere-supervisor-`. + // Name of the source VM. Limited to 15 characters. Defaults to `source-`. SourceName string `mapstructure:"source_name"` // Name of the network type to attach to the source VM's network interface. Defaults to empty. NetworkType string `mapstructure:"network_type"` @@ -86,6 +85,10 @@ func (c *CreateSourceConfig) Prepare() []error { c.SourceName = fmt.Sprintf("%s-%s", DefaultSourceNamePrefix, rand.String(5)) } + if len(c.SourceName) > 15 { + errs = append(errs, fmt.Errorf("'source_name' must not exceed 15 characters (length: %d): %s", len(c.SourceName), c.SourceName)) + } + return errs } diff --git a/docs-partials/builder/vsphere/supervisor/CreateSourceConfig-not-required.mdx b/docs-partials/builder/vsphere/supervisor/CreateSourceConfig-not-required.mdx index 04e18bfc..4846d7a0 100644 --- a/docs-partials/builder/vsphere/supervisor/CreateSourceConfig-not-required.mdx +++ b/docs-partials/builder/vsphere/supervisor/CreateSourceConfig-not-required.mdx @@ -3,7 +3,7 @@ - `image_name` (string) - Name of the source virtual machine (VM) image. If it is specified, the image with the name will be used for the source VM, otherwise the image name from imported image will be used. -- `source_name` (string) - Name of the source VM. Defaults to `packer-vsphere-supervisor-`. +- `source_name` (string) - Name of the source VM. Limited to 15 characters. Defaults to `source-`. - `network_type` (string) - Name of the network type to attach to the source VM's network interface. Defaults to empty.