diff --git a/.web-docs/components/builder/vsphere-clone/README.md b/.web-docs/components/builder/vsphere-clone/README.md index 145157349..96cbbe90d 100644 --- a/.web-docs/components/builder/vsphere-clone/README.md +++ b/.web-docs/components/builder/vsphere-clone/README.md @@ -911,14 +911,23 @@ boot time. - `cdrom_type` (string) - Which controller to use. Example: `sata`. Defaults to `ide`. -- `iso_paths` ([]string) - List of Datastore or Content Library paths to ISO files that will be mounted to the VM. - Here's an HCL2 example: +- `iso_paths` ([]string) - A list of paths to ISO files in either a datastore or a content library that will be mounted to the VM. + + Usage example (HCL): + ```hcl iso_paths = [ - "[datastore1] ISO/ubuntu.iso", - "Packer Library Test/ubuntu-16.04.6-server-amd64/ubuntu-16.04.6-server-amd64.iso" + "[nfs] iso/ubuntu-server-amd64.iso", + "Packer/ubuntu-server-amd64/ubuntu-server-amd64.iso" ] ``` + + Two ISOs are referenced: + 1. An ISO in the "_iso_" folder of the "_nfs_" datastore with the file name of "_ubuntu-server-amd64.iso_". + 2. An ISO in the "_Packer_" content library with the item name of "_ubuntu-server-amd64_". + + -> **Note:** All files in a content library have an associated item name. + To determine the file name, view the datastore backing the content library or use the `govc` vSphere CLI. diff --git a/.web-docs/components/builder/vsphere-iso/README.md b/.web-docs/components/builder/vsphere-iso/README.md index f73ceecea..7585476f8 100644 --- a/.web-docs/components/builder/vsphere-iso/README.md +++ b/.web-docs/components/builder/vsphere-iso/README.md @@ -667,14 +667,23 @@ iso_paths = [ - `cdrom_type` (string) - Which controller to use. Example: `sata`. Defaults to `ide`. -- `iso_paths` ([]string) - List of Datastore or Content Library paths to ISO files that will be mounted to the VM. - Here's an HCL2 example: +- `iso_paths` ([]string) - A list of paths to ISO files in either a datastore or a content library that will be mounted to the VM. + + Usage example (HCL): + ```hcl iso_paths = [ - "[datastore1] ISO/ubuntu.iso", - "Packer Library Test/ubuntu-16.04.6-server-amd64/ubuntu-16.04.6-server-amd64.iso" + "[nfs] iso/ubuntu-server-amd64.iso", + "Packer/ubuntu-server-amd64/ubuntu-server-amd64.iso" ] ``` + + Two ISOs are referenced: + 1. An ISO in the "_iso_" folder of the "_nfs_" datastore with the file name of "_ubuntu-server-amd64.iso_". + 2. An ISO in the "_Packer_" content library with the item name of "_ubuntu-server-amd64_". + + -> **Note:** All files in a content library have an associated item name. + To determine the file name, view the datastore backing the content library or use the `govc` vSphere CLI. diff --git a/builder/vsphere/common/step_add_cdrom.go b/builder/vsphere/common/step_add_cdrom.go index cbfb894fb..935099e5e 100644 --- a/builder/vsphere/common/step_add_cdrom.go +++ b/builder/vsphere/common/step_add_cdrom.go @@ -18,14 +18,23 @@ import ( type CDRomConfig struct { // Which controller to use. Example: `sata`. Defaults to `ide`. CdromType string `mapstructure:"cdrom_type"` - // List of Datastore or Content Library paths to ISO files that will be mounted to the VM. - // Here's an HCL2 example: + // A list of paths to ISO files in either a datastore or a content library that will be mounted to the VM. + // + // Usage example (HCL): + // // ```hcl // iso_paths = [ - // "[datastore1] ISO/ubuntu.iso", - // "Packer Library Test/ubuntu-16.04.6-server-amd64/ubuntu-16.04.6-server-amd64.iso" + // "[nfs] iso/ubuntu-server-amd64.iso", + // "Packer/ubuntu-server-amd64/ubuntu-server-amd64.iso" // ] // ``` + // + // Two ISOs are referenced: + // 1. An ISO in the "_iso_" folder of the "_nfs_" datastore with the file name of "_ubuntu-server-amd64.iso_". + // 2. An ISO in the "_Packer_" content library with the item name of "_ubuntu-server-amd64_". + // + // -> **Note:** All files in a content library have an associated item name. + // To determine the file name, view the datastore backing the content library or use the `govc` vSphere CLI. ISOPaths []string `mapstructure:"iso_paths"` } diff --git a/docs-partials/builder/vsphere/common/CDRomConfig-not-required.mdx b/docs-partials/builder/vsphere/common/CDRomConfig-not-required.mdx index f25d5e2ce..39d1c6b30 100644 --- a/docs-partials/builder/vsphere/common/CDRomConfig-not-required.mdx +++ b/docs-partials/builder/vsphere/common/CDRomConfig-not-required.mdx @@ -2,13 +2,22 @@ - `cdrom_type` (string) - Which controller to use. Example: `sata`. Defaults to `ide`. -- `iso_paths` ([]string) - List of Datastore or Content Library paths to ISO files that will be mounted to the VM. - Here's an HCL2 example: +- `iso_paths` ([]string) - A list of paths to ISO files in either a datastore or a content library that will be mounted to the VM. + + Usage example (HCL): + ```hcl iso_paths = [ - "[datastore1] ISO/ubuntu.iso", - "Packer Library Test/ubuntu-16.04.6-server-amd64/ubuntu-16.04.6-server-amd64.iso" + "[nfs] iso/ubuntu-server-amd64.iso", + "Packer/ubuntu-server-amd64/ubuntu-server-amd64.iso" ] ``` + + Two ISOs are referenced: + 1. An ISO in the "_iso_" folder of the "_nfs_" datastore with the file name of "_ubuntu-server-amd64.iso_". + 2. An ISO in the "_Packer_" content library with the item name of "_ubuntu-server-amd64_". + + -> **Note:** All files in a content library have an associated item name. + To determine the file name, view the datastore backing the content library or use the `govc` vSphere CLI.