Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 57 additions & 1 deletion .web-docs/components/builder/vsphere-clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ references, which are necessary for a build to succeed and can be found further

- `template` (string) - The name of the source virtual machine to clone.

- `remote_source` (\*RemoteSourceConfig) - Configuration for cloning from a remote OVF/OVA source.
Cannot be used together with `template`.

For more information, refer to the [Remote Source Configuration](/packer/integrations/hashicorp/vmware/latest/components/builder/vsphere-clone#remote-source-configuration)
section.

- `disk_size` (int64) - The size of the primary disk in MiB. Cannot be used with `linked_clone`.
-> **Note:** Only the primary disk size can be specified. Additional
disks are not supported.
Expand Down Expand Up @@ -114,6 +120,49 @@ references, which are necessary for a build to succeed and can be found further
<!-- End of code generated from the comments of the StorageConfig struct in builder/vsphere/common/storage_config.go; -->


### Remote Source Configuration

**Optional:**

<!-- Code generated from the comments of the RemoteSourceConfig struct in builder/vsphere/clone/step_clone.go; DO NOT EDIT MANUALLY -->

- `url` (string) - The URL of the remote OVF/OVA file. Supports HTTP and HTTPS protocols.

- `username` (string) - The username for basic authentication when accessing the remote OVF/OVA file.
Must be used together with `password`.

- `password` (string) - The password for basic authentication when accessing the remote OVF/OVA file.
Must be used together with `username`.

- `skip_tls_verify` (bool) - Do not validate the certificate when accessing HTTPS URLs.
Defaults to `false`.

-> **Note:** This option is beneficial in scenarios where the certificate
is self-signed or does not meet standard validation criteria.

HCL Example:

```hcl
remote_source = {
url = "https://packages.example.com/artifacts/example.ovf"
username = "remote_source_username"
password = "remote_source_password"
skip_tls_verify = false
}
```

JSON Example:
```json
"remote_source": {
"url": "https://packages.example.com/artifacts/example.ovf",
"username": "remote_source_username",
"password": "remote_source_password",
"skip_tls_verify": false
}

<!-- End of code generated from the comments of the RemoteSourceConfig struct in builder/vsphere/clone/step_clone.go; -->


### Storage Configuration

When cloning a virtual machine, the storage configuration can be used to add additional storage and
Expand Down Expand Up @@ -255,12 +304,14 @@ JSON Example:
property keys that do not exist.

HCL Example:

```hcl
vapp {
properties = {
hostname = var.hostname
user-data = base64encode(var.user_data)
}
deployment_option = "small"
}
```

Expand All @@ -271,7 +322,8 @@ JSON Example:
"properties": {
"hostname": "{{ user `hostname`}}",
"user-data": "{{ env `USERDATA`}}"
}
},
"deployment_option": "small"
}
```

Expand All @@ -282,6 +334,10 @@ JSON Example:
export USERDATA=$(gzip -c9 <userdata.yaml | { base64 -w0 2>/dev/null || base64; })
```

- `deployment_option` (string) - The deployment configuration to use when deploying from an OVF/OVA file.
This corresponds to deployment configurations defined in an OVF descriptor.
-> **Note:** Only applicable when using remote OVF/OVA sources.

<!-- End of code generated from the comments of the vAppConfig struct in builder/vsphere/clone/step_clone.go; -->


Expand Down
4 changes: 2 additions & 2 deletions builder/vsphere/clone/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: MPL-2.0

//go:generate packer-sdc struct-markdown
//go:generate packer-sdc mapstructure-to-hcl2 -type Config
//go:generate packer-sdc mapstructure-to-hcl2 -type Config,RemoteSourceConfig

package clone

Expand Down Expand Up @@ -67,7 +67,7 @@ type Config struct {
ctx interpolate.Context
}

func (c *Config) Prepare(raws ...interface{}) ([]string, error) {
func (c *Config) Prepare(raws ...any) ([]string, error) {
err := config.Decode(c, &config.DecodeOpts{
PluginType: common.BuilderId,
Interpolate: true,
Expand Down
31 changes: 31 additions & 0 deletions builder/vsphere/clone/config.hcl2spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading