During build the ISO is downloaded and copied to the datastore, VM created, hardware customized. However, during mounting of the ISO an error thrown:
2020/09/04 23:39:39 machine readable: vsphere-iso,error []string{"error mounting an image '[QXS4-DS-01] packer_cache//a9e6afb56387f189d0c6f6665708a1d53e2d8fd6.iso': [QXS4-DS-01] packer_cache//a9e6afb56387f189d0c6f6665708a1d53e2d8fd6.iso is not a valid iso path"}
I checked the file is indeed exist at path: [QXS4-DS-01] packer_cache/a9e6afb56387f189d0c6f6665708a1d53e2d8fd6.iso. I even was able to mount by adding cdrom and copying path into "CD/DVD Media".
Dual slash results in an error in the GUI. It will refuse to accept it.
Changed to the single slash allows to mount the ISO.
P.S. When using double slash clicking on something else and then on CD/DVD Media path (few times), will result in vCenter eventually accepting the double slash and allow click okay. But when I went back to edit it again, it shows as a single slash.
Simply running packer build on VMware 6.5
1.6.2
Packer running on Ubuntu 18.04.4 LTS connecting to vCenter (vSphere Client version 6.5.0.32000)
#PACKER_LOG=1 packer build -var-file variables.json ubuntu18-4.json
2020/09/04 23:39:10 [INFO] Packer version: 1.6.2 [go1.13.15 linux amd64]
2020/09/04 23:39:10 Checking 'PACKER_CONFIG' for a config file path
2020/09/04 23:39:10 'PACKER_CONFIG' not set; checking the default config file path
2020/09/04 23:39:10 Attempting to open config file: /home/admish/.packerconfig
2020/09/04 23:39:10 [WARN] Config file doesn't exist: /home/admish/.packerconfig
2020/09/04 23:39:10 Setting cache directory: /home/admish/packer/packer_cache
2020/09/04 23:39:10 Creating plugin client for path: /usr/bin/packer
2020/09/04 23:39:10 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "plugin", "packer-builder-vsphere-iso"}
2020/09/04 23:39:10 Waiting for RPC address for: /usr/bin/packer
2020/09/04 23:39:10 packer-builder-vsphere-iso plugin: [INFO] Packer version: 1.6.2 [go1.13.15 linux amd64]
2020/09/04 23:39:10 packer-builder-vsphere-iso plugin: Checking 'PACKER_CONFIG' for a config file path
2020/09/04 23:39:10 packer-builder-vsphere-iso plugin: 'PACKER_CONFIG' not set; checking the default config file path
2020/09/04 23:39:10 packer-builder-vsphere-iso plugin: Attempting to open config file: /home/admish/.packerconfig
2020/09/04 23:39:10 packer-builder-vsphere-iso plugin: [WARN] Config file doesn't exist: /home/admish/.packerconfig
2020/09/04 23:39:10 packer-builder-vsphere-iso plugin: Setting cache directory: /home/admish/packer/packer_cache
2020/09/04 23:39:10 packer-builder-vsphere-iso plugin: args: []string{"packer-builder-vsphere-iso"}
2020/09/04 23:39:10 packer-builder-vsphere-iso plugin: Plugin address: unix /tmp/packer-plugin430982826
2020/09/04 23:39:10 packer-builder-vsphere-iso plugin: Waiting for connection...
2020/09/04 23:39:10 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin430982826
2020/09/04 23:39:10 packer-builder-vsphere-iso plugin: Serving a plugin connection...
2020/09/04 23:39:10 Creating plugin client for path: /usr/bin/packer
2020/09/04 23:39:10 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "plugin", "packer-provisioner-shell"}
2020/09/04 23:39:10 Waiting for RPC address for: /usr/bin/packer
2020/09/04 23:39:10 packer-provisioner-shell plugin: [INFO] Packer version: 1.6.2 [go1.13.15 linux amd64]
2020/09/04 23:39:10 packer-provisioner-shell plugin: Checking 'PACKER_CONFIG' for a config file path
2020/09/04 23:39:10 packer-provisioner-shell plugin: 'PACKER_CONFIG' not set; checking the default config file path
2020/09/04 23:39:10 packer-provisioner-shell plugin: Attempting to open config file: /home/admish/.packerconfig
2020/09/04 23:39:10 packer-provisioner-shell plugin: [WARN] Config file doesn't exist: /home/admish/.packerconfig
2020/09/04 23:39:10 packer-provisioner-shell plugin: Setting cache directory: /home/admish/packer/packer_cache
2020/09/04 23:39:10 packer-provisioner-shell plugin: args: []string{"packer-provisioner-shell"}
2020/09/04 23:39:10 packer-provisioner-shell plugin: Plugin address: unix /tmp/packer-plugin176186821
2020/09/04 23:39:10 packer-provisioner-shell plugin: Waiting for connection...
2020/09/04 23:39:10 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin176186821
2020/09/04 23:39:10 packer-provisioner-shell plugin: Serving a plugin connection...
2020/09/04 23:39:10 Preparing build: vsphere-iso
2020/09/04 23:39:10 Build debug mode: false
vsphere-iso: output will be in this color.
2020/09/04 23:39:10 Force build: false
2020/09/04 23:39:10 On error:
2020/09/04 23:39:10 Waiting on builds to complete...
2020/09/04 23:39:10 Starting build run: vsphere-iso
2020/09/04 23:39:10 Running builder: vsphere-iso
2020/09/04 23:39:10 [INFO] (telemetry) Starting builder vsphere-iso
==> vsphere-iso: Retrieving ISO
==> vsphere-iso: Trying https://mirrors.mit.edu/ubuntu-releases/releases/18.04.5/ubuntu-18.04.5-desktop-amd64.iso
2020/09/04 23:39:10 packer-builder-vsphere-iso plugin: Acquiring lock for: https://mirrors.mit.edu/ubuntu-releases/releases/18.04.5/ubuntu-18.04.5-desktop-amd64.iso?checksum=sha256%3Af295570badb09a606d97ddfc3421d7bf210b4a81c07ba81e9c040eda6ddea6a0 (/home/admish/packer/packer_cache/a9e6afb56387f189d0c6f6665708a1d53e2d8fd6.iso.lock)
==> vsphere-iso: Trying https://mirrors.mit.edu/ubuntu-releases/releases/18.04.5/ubuntu-18.04.5-desktop-amd64.iso?checksum=sha256%3Af295570badb09a606d97ddfc3421d7bf210b4a81c07ba81e9c040eda6ddea6a0
2020/09/04 23:39:18 packer-builder-vsphere-iso plugin: Leaving retrieve loop for ISO
==> vsphere-iso: https://mirrors.mit.edu/ubuntu-releases/releases/18.04.5/ubuntu-18.04.5-desktop-amd64.iso?checksum=sha256%3Af295570badb09a606d97ddfc3421d7bf210b4a81c07ba81e9c040eda6ddea6a0 => /home/admish/packer/packer_cache/a9e6afb56387f189d0c6f6665708a1d53e2d8fd6.iso
==> vsphere-iso: Uploading a9e6afb56387f189d0c6f6665708a1d53e2d8fd6.iso to packer_cache/a9e6afb56387f189d0c6f6665708a1d53e2d8fd6.iso
==> vsphere-iso: File already uploaded; continuing
==> vsphere-iso: Creating VM...
==> vsphere-iso: Customizing hardware...
==> vsphere-iso: Mounting ISO images...
==> vsphere-iso: Destroying VM...
2020/09/04 23:39:39 [INFO] (telemetry) ending vsphere-iso
==> Wait completed after 29 seconds 152 milliseconds
2020/09/04 23:39:39 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2020/09/04 23:39:39 machine readable: vsphere-iso,error []string{"error mounting an image '[QXS4-DS-01] packer_cache//a9e6afb56387f189d0c6f6665708a1d53e2d8fd6.iso': [QXS4-DS-01] packer_cache//a9e6afb56387f189d0c6f6665708a1d53e2d8fd6.iso is not a valid iso path"}
==> Builds finished but no artifacts were created.
2020/09/04 23:39:39 [INFO] (telemetry) Finalizing.
Build 'vsphere-iso' errored after 29 seconds 151 milliseconds: error mounting an image '[QXS4-DS-01] packer_cache//a9e6afb56387f189d0c6f6665708a1d53e2d8fd6.iso': [QXS4-DS-01] packer_cache//a9e6afb56387f189d0c6f6665708a1d53e2d8fd6.iso is not a valid iso path
==> Wait completed after 29 seconds 152 milliseconds
==> Some builds didn't complete successfully and had errors:
--> vsphere-iso: error mounting an image '[QXS4-DS-01] packer_cache//a9e6afb56387f189d0c6f6665708a1d53e2d8fd6.iso': [QXS4-DS-01] packer_cache//a9e6afb56387f189d0c6f6665708a1d53e2d8fd6.iso is not a valid iso path
==> Builds finished but no artifacts were created.
2020/09/04 23:39:39 waiting for all plugin processes to complete...
2020/09/04 23:39:39 /usr/bin/packer: plugin process exited
2020/09/04 23:39:39 /usr/bin/packer: plugin process exited
Could you please assist in figuring out what is causing this error? Let me know if other information needed.
I've also tried to use "iso_paths" and received the same error. I downloaded the ISO onto the datastore, ran sha256sum on them to validate their integrity. Then I added "iso_paths" to the builders file.
"iso_paths": [
"[QXS-DS-03] ISO/Ubuntu/ubuntu-20.04.1-live-server-amd64.iso"
],
Full file that I tried to run:
ubuntu20.04.txt
Here is the log:
$PACKER_LOG=1 packer build -var-file variables.json ubuntu20.04.json
2020/09/05 22:51:21 [INFO] Packer version: 1.6.2 [go1.13.15 linux amd64]
2020/09/05 22:51:21 Checking 'PACKER_CONFIG' for a config file path
2020/09/05 22:51:21 'PACKER_CONFIG' not set; checking the default config file path
2020/09/05 22:51:21 Attempting to open config file: /home/admish/.packerconfig
2020/09/05 22:51:21 [WARN] Config file doesn't exist: /home/admish/.packerconfig
2020/09/05 22:51:21 Setting cache directory: /home/admish/packer/packer_cache
2020/09/05 22:51:21 Creating plugin client for path: /usr/bin/packer
2020/09/05 22:51:21 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "plugin", "packer-builder-vsphere-iso"}
2020/09/05 22:51:21 Waiting for RPC address for: /usr/bin/packer
2020/09/05 22:51:22 packer-builder-vsphere-iso plugin: [INFO] Packer version: 1.6.2 [go1.13.15 linux amd64]
2020/09/05 22:51:22 packer-builder-vsphere-iso plugin: Checking 'PACKER_CONFIG' for a config file path
2020/09/05 22:51:22 packer-builder-vsphere-iso plugin: 'PACKER_CONFIG' not set; checking the default config file path
2020/09/05 22:51:22 packer-builder-vsphere-iso plugin: Attempting to open config file: /home/admish/.packerconfig
2020/09/05 22:51:22 packer-builder-vsphere-iso plugin: [WARN] Config file doesn't exist: /home/admish/.packerconfig
2020/09/05 22:51:22 packer-builder-vsphere-iso plugin: Setting cache directory: /home/admish/packer/packer_cache
2020/09/05 22:51:22 packer-builder-vsphere-iso plugin: args: []string{"packer-builder-vsphere-iso"}
2020/09/05 22:51:22 packer-builder-vsphere-iso plugin: Plugin address: unix /tmp/packer-plugin854787470
2020/09/05 22:51:22 packer-builder-vsphere-iso plugin: Waiting for connection...
2020/09/05 22:51:22 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin854787470
2020/09/05 22:51:22 packer-builder-vsphere-iso plugin: Serving a plugin connection...
2020/09/05 22:51:22 Creating plugin client for path: /usr/bin/packer
2020/09/05 22:51:22 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "plugin", "packer-provisioner-shell"}
2020/09/05 22:51:22 Waiting for RPC address for: /usr/bin/packer
2020/09/05 22:51:22 packer-provisioner-shell plugin: [INFO] Packer version: 1.6.2 [go1.13.15 linux amd64]
2020/09/05 22:51:22 packer-provisioner-shell plugin: Checking 'PACKER_CONFIG' for a config file path
2020/09/05 22:51:22 packer-provisioner-shell plugin: 'PACKER_CONFIG' not set; checking the default config file path
2020/09/05 22:51:22 packer-provisioner-shell plugin: Attempting to open config file: /home/admish/.packerconfig
2020/09/05 22:51:22 packer-provisioner-shell plugin: [WARN] Config file doesn't exist: /home/admish/.packerconfig
2020/09/05 22:51:22 packer-provisioner-shell plugin: Setting cache directory: /home/admish/packer/packer_cache
2020/09/05 22:51:22 packer-provisioner-shell plugin: args: []string{"packer-provisioner-shell"}
2020/09/05 22:51:22 packer-provisioner-shell plugin: Plugin address: unix /tmp/packer-plugin269030418
2020/09/05 22:51:22 packer-provisioner-shell plugin: Waiting for connection...
2020/09/05 22:51:22 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin269030418
2020/09/05 22:51:22 packer-provisioner-shell plugin: Serving a plugin connection...
2020/09/05 22:51:22 Preparing build: vsphere-iso
2020/09/05 22:51:22 Build debug mode: false
2020/09/05 22:51:22 Force build: false
vsphere-iso: output will be in this color.
2020/09/05 22:51:22 On error:
2020/09/05 22:51:22 Waiting on builds to complete...
2020/09/05 22:51:22 Starting build run: vsphere-iso
2020/09/05 22:51:22 Running builder: vsphere-iso
2020/09/05 22:51:22 [INFO] (telemetry) Starting builder vsphere-iso
==> vsphere-iso: Creating VM...
==> vsphere-iso: Customizing hardware...
==> vsphere-iso: Mounting ISO images...
==> vsphere-iso: Destroying VM...
2020/09/05 22:51:48 [INFO] (telemetry) ending vsphere-iso
==> Wait completed after 26 seconds 114 milliseconds
2020/09/05 22:51:48 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2020/09/05 22:51:48 machine readable: vsphere-iso,error []string{"error mounting an image '[QXS-DS-03] ISO/Ubuntu/ubuntu-20.04.1-live-server-amd64.iso': [QXS-DS-03] ISO/Ubuntu/ubuntu-20.04.1-live-server-amd64.iso is not a valid iso path"}
==> Builds finished but no artifacts were created.
2020/09/05 22:51:48 [INFO] (telemetry) Finalizing.
Build 'vsphere-iso' errored after 26 seconds 114 milliseconds: error mounting an image '[QXS-DS-03] ISO/Ubuntu/ubuntu-20.04.1-live-server-amd64.iso': [QXS-DS-03] ISO/Ubuntu/ubuntu-20.04.1-live-server-amd64.iso is not a valid iso path
==> Wait completed after 26 seconds 114 milliseconds
==> Some builds didn't complete successfully and had errors:
--> vsphere-iso: error mounting an image '[QXS-DS-03] ISO/Ubuntu/ubuntu-20.04.1-live-server-amd64.iso': [QXS-DS-03] ISO/Ubuntu/ubuntu-20.04.1-live-server-amd64.iso is not a valid iso path
==> Builds finished but no artifacts were created.
2020/09/05 22:51:48 waiting for all plugin processes to complete...
2020/09/05 22:51:48 /usr/bin/packer: plugin process exited
2020/09/05 22:51:48 /usr/bin/packer: plugin process exited
I tried Packer Version 1.6.1 and it works. Both using:
"iso_urls": "{{user `iso-url-dsk1804`}}",
"iso_checksum": "{{user `iso-checksum-type`}}:{{user `iso-checksum-dsk1804`}}",
and
"iso_paths": [
"[QXS-DS-03] ISO/Ubuntu/ubuntu-20.04.1-live-server-amd64.iso"
],
==> vsphere-iso: Mounting ISO images...
2020/09/06 16:35:54 packer1.6.1 plugin: Creating CD-ROM on controller '&{{{} 200 0xc0005acfa0 <nil> <nil> <nil> 0 <nil>} 0 []}' with iso '[QXS4-DS-01] packer_cache//a9e6afb56387f189d0c6f6665708a1d53e2d8fd6.iso'
==> vsphere-iso: Creating floppy disk...
and
==> vsphere-iso: Mounting ISO images...
2020/09/06 16:45:05 packer1.6.1 plugin: Creating CD-ROM on controller '&{{{} 200 0xc000da5be0 <nil> <nil> <nil> 0 <nil>} 0 []}' with iso '[QXS-DS-03] ISO/Ubuntu/ubuntu-20.04.1-live-server-amd64.iso'
2020/09/06 16:45:07 packer1.6.1 plugin: Floppy path: /tmp/packer120356155
==> vsphere-iso: Creating floppy disk...
Hey there, thanks for reaching out! This was reported before here https://github.com/hashicorp/packer/issues/9846 and fixed by https://github.com/hashicorp/packer/pull/9855 and the fix will be in the next release.
Until then, you can use the artifacts from the PR to run the build. Here they are: https://app.circleci.com/pipelines/github/hashicorp/packer/6945/workflows/2ebe6433-53dd-40e8-b8fe-0b7cf84e2cf2/jobs/78129/artifacts
Let me know is there's anything wrong with your build. I'm closing this issue for now.
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
Hey there, thanks for reaching out! This was reported before here https://github.com/hashicorp/packer/issues/9846 and fixed by https://github.com/hashicorp/packer/pull/9855 and the fix will be in the next release.
Until then, you can use the artifacts from the PR to run the build. Here they are: https://app.circleci.com/pipelines/github/hashicorp/packer/6945/workflows/2ebe6433-53dd-40e8-b8fe-0b7cf84e2cf2/jobs/78129/artifacts
Let me know is there's anything wrong with your build. I'm closing this issue for now.