Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builds may fail when using iso_url and other iso_* variables remain defined #343

Closed
1 task done
PabloRapidScale opened this issue Nov 9, 2022 · 8 comments 路 Fixed by #435
Closed
1 task done

Builds may fail when using iso_url and other iso_* variables remain defined #343

PabloRapidScale opened this issue Nov 9, 2022 · 8 comments 路 Fixed by #435
Assignees
Labels
Milestone

Comments

@PabloRapidScale
Copy link

PabloRapidScale commented Nov 9, 2022

Code of Conduct

Community Note

  • Vote on this issue by adding a 馃憤 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Project Version

main

VMware vSphere

7.0.3d

HashiCorp Packer

1.8.4

HashiCorp Packer Plugin for VMware vSphere

1.1.0

Guest Operating System

Debian 11.5, Windows 2022, Windows 2019, Windows 10

Environment Details

No response

Description

Builds may fail if using iso_url while leaving the iso_path and iso_file options filled in.

Expected Behavior

Per Readme "The iso_url variable takes presedence over any other iso_* variables." i.e. when adding a URL location it should ignore the rest of the iso_* entries. However, if you add a value to the iso_url variable it will do what it normally would do like download the iso, put it in the cache, upload it, etc. but it will also mount the iso_file as an additional disk object causing different OS versions to have to account for an additional unexpected disc.

Actual Behavior

You will end up with an extra disc device and an iso attached to the specified iso_path and iso_file location regardless if the actual iso file or path exists. Depending on the OS you're deploying they may act differently in each of the scenarios below.

  • Scenario 1: iso_url is not null, OS is Windows based, doesn't seem to matter if iso_path and iso_file exist or not
    • Packer will mount an extra device as defined by iso_path and iso_file
    • Windows deployment will fail on waiting for IP step as drive letter assignments will be offset by 1 letter. i.e. E becomes F, F becomes G, etc.
    • pvscsi drivers won't install due to drive E:\ no longer containing the vmware tools iso (Server 2019)
    • SynchronousCommand in the autounnatend.xml fails to launch F:\windows-vmtools.ps1 and F:\windows-init.ps1 (Server 2022)
  • Scenario 2: iso_url is not null, iso_path and iso_file exist, OS is linux based
    • Packer will mount an extra device with the a valid linux iso
    • Linux deployment (tested on debian) will fail on waiting for IP step due to the VM booting to the secondary disc device after the initial boot and configuration from the primary disc device and timing out waiting for user input on installation instructions.
    • Shouldn't fail on any linux installation media that proceeds to booting from disk if no user input is provided within a specified amount of time.
  • Scenario 3: iso_url is not null, iso_path and iso_file don't exist, OS is linux based
    • Packer will mount an extra device to the non-existant file defined by iso_path and iso_file but should succeed as the second boot simply finds that the device is not a valid boot target and should boot from the disk.

Steps to Reproduce

Windows 2019

// Removable Media Settings
iso_url            = "https://software-download.microsoft.com/download/pr/17763.737.190906-2324.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us_1.iso"
iso_path           = "iso/windows/server"
iso_file           = "en-us_windows_server_2019_updated_aug_2021_x64_dvd_a6431a28.iso"
iso_checksum_type  = "sha1"
iso_checksum_value = "3022424f777b66a698047ba1c37812026b9714c5"

Windows 2022

// Removable Media Settings
iso_url            = "https://software-static.download.prss.microsoft.com/sg/download/888969d5-f34g-4e03-ac9d-1f9786c66749/SERVER_EVAL_x64FRE_en-us.iso"
iso_path           = "iso/windows/server"
iso_file           = "en-us_windows_server_2022_updated_sep_2022_x64_dvd_44ee9450.iso"
iso_checksum_type  = "sha256"
iso_checksum_value = "3E4FA6D8507B554856FC9CA6079CC402DF11A8B79344871669F0251535255325"

Debian 11.5

// Removable Media Settings
iso_url            = "http://cdimage.debian.org/cdimage/release/11.5.0/amd64/iso-cd/debian-11.5.0-amd64-netinst.iso"
iso_path           = "iso/linux/debian"
iso_file           = "debian-11.5.0-amd64-netinst.iso"
iso_checksum_type  = "sha512"
iso_checksum_value = "6a6607a05d57b7c62558e9c462fe5c6c04b9cfad2ce160c3e9140aa4617ab73aff7f5f745dfe51bbbe7b33c9b0e219a022ad682d6c327de0e53e40f079abf66a"

Log Fragments and Files

2022/11/09 00:10:09 ui: ==> vsphere-iso.windows-server-standard-core: Mounting ISO images...
2022/11/09 00:10:09 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:09 Check if ISO path is a Content Library path
2022/11/09 00:10:10 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:10 ISO path not identified as a Content Library path
2022/11/09 00:10:10 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:10 Using [Datastore] packer_cache//61381f58cd37c3a9800f232e47a7438fa3e98b62.iso as the datastore path
2022/11/09 00:10:10 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:10 Creating CD-ROM on controller '&{{{} 15000 0xc0003a11c0 <nil> <nil> <nil> 100 0xc000b5d7fc} 0 []}' with iso '[Datastore] packer_cache//61381f58cd37c3a9800f232e47a7438fa3e98b62.iso'
2022/11/09 00:10:10 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:10 Check if ISO path is a Content Library path
2022/11/09 00:10:10 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:10 ISO path not identified as a Content Library path
2022/11/09 00:10:10 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:10 Using [Datastore] iso/windows/server/en-us_windows_server_2019_updated_aug_2021_x64_dvd_a6431a28.iso as the datastore path
2022/11/09 00:10:10 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:10 Creating CD-ROM on controller '&{{{} 15000 0xc0009cc0c0 <nil> <nil> <nil> 100 0xc0007e5d0c} 0 [16000]}' with iso '[Datastore] iso/windows/server/en-us_windows_server_2019_updated_aug_2021_x64_dvd_a6431a28.iso'
2022/11/09 00:10:11 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:11 Check if ISO path is a Content Library path
2022/11/09 00:10:12 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:12 ISO path not identified as a Content Library path
2022/11/09 00:10:12 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:12 Using [] /vmimages/tools-isoimages/windows.iso as the datastore path
2022/11/09 00:10:12 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:12 Creating CD-ROM on controller '&{{{} 15000 0xc000a2a200 <nil> <nil> <nil> 100 0xc00095688c} 0 [16000 16001]}' with iso '[] /vmimages/tools-isoimages/windows.iso'
2022/11/09 00:10:12 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:12 Check if ISO path is a Content Library path
2022/11/09 00:10:12 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:12 ISO path not identified as a Content Library path
2022/11/09 00:10:12 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:12 Using [Datastore] packer_cache//packer1599107003.iso as the datastore path
2022/11/09 00:10:12 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:12 Creating CD-ROM on controller '&{{{} 15000 0xc000c26620 <nil> <nil> <nil> 100 0xc000c1f05c} 0 [16000 16001 16002]}' with iso '[Datastore] packer_cache//packer1599107003.iso'
2022/11/09 00:10:12 ui: ==> vsphere-iso.windows-server-standard-core: Adding configuration parameters...
2022/11/09 00:10:13 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:13 No floppy files specified. Floppy disk will not be made.
2022/11/09 00:10:13 ui: ==> vsphere-iso.windows-server-standard-core: Set boot order...
2022/11/09 00:10:13 ui: ==> vsphere-iso.windows-server-standard-core: Power on VM...
2022/11/09 00:10:13 ui: ==> vsphere-iso.windows-server-standard-core: Waiting 2s for boot...
2022/11/09 00:10:15 ui: ==> vsphere-iso.windows-server-standard-core: Typing boot command...
2022/11/09 00:10:15 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:15 Special code '<spacebar>' found, replacing with: CodeSpacebar
2022/11/09 00:10:15 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:10:15 [INFO] Waiting for IP, up to total timeout: 20m0s, settle timeout: 5s
2022/11/09 00:10:15 ui: ==> vsphere-iso.windows-server-standard-core: Waiting for IP...
2022/11/09 00:30:15 ui error: ==> vsphere-iso.windows-server-standard-core: Timeout waiting for IP.
2022/11/09 00:30:15 ui: ==> vsphere-iso.windows-server-standard-core: Power off VM...
2022/11/09 00:30:16 ui: ==> vsphere-iso.windows-server-standard-core: Destroying VM...
2022/11/09 00:30:16 ui: ==> vsphere-iso.windows-server-standard-core: Deleting cd_files image from remote datastore ...
2022/11/09 00:30:17 packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64 plugin: 2022/11/09 00:30:17 Deleting CD disk: /tmp/packer1599107003.iso
2022/11/09 00:30:17 [INFO] (telemetry) ending vsphere-iso.windows-server-standard-core
2022/11/09 00:30:17 ui error: Build 'vsphere-iso.windows-server-standard-core' errored after 20 minutes 10 seconds: Timeout waiting for IP.
2022/11/09 00:30:17 ui: 
==> Wait completed after 20 minutes 10 seconds
2022/11/09 00:30:17 machine readable: error-count []string{"1"}
2022/11/09 00:30:17 ui error: 
==> Some builds didn't complete successfully and had errors:
2022/11/09 00:30:17 machine readable: vsphere-iso.windows-server-standard-core,error []string{"Timeout waiting for IP."}
2022/11/09 00:30:17 ui error: --> vsphere-iso.windows-server-standard-core: Timeout waiting for IP.
2022/11/09 00:30:17 ui: 
==> Builds finished but no artifacts were created.
2022/11/09 00:30:17 [INFO] (telemetry) Finalizing.
2022/11/09 00:30:17 waiting for all plugin processes to complete...
2022/11/09 00:30:17 /usr/bin/packer: plugin process exited
2022/11/09 00:30:17 /usr/bin/packer: plugin process exited
2022/11/09 00:30:17 /usr/bin/packer: plugin process exited
2022/11/09 00:30:17 /home/pablo/.config/packer/plugins/github.com/hashicorp/vsphere/packer-plugin-vsphere_v1.1.0_x5.0_linux_amd64: plugin process exited
2022/11/09 00:30:17 /home/pablo/.config/packer/plugins/github.com/rgl/windows-update/packer-plugin-windows-update_v0.14.1_x5.0_linux_amd64: plugin process exited

Screenshots

2022-11-08 16_33_09-vSphere - windows-server-2019-standard-core-v22 11 - Summary
2022-11-08 16_33_50-vSphere - windows-server-2019-standard-core-v22 11 - Summary
2022-11-08 16_54_58-windows-server-2019-standard-core-v22 11 - VMware Remote Console

Additional Context

No response

@github-actions
Copy link

github-actions bot commented Nov 9, 2022

Hello, PabloRapidScale! 馃枑

Thank you for your submitting an issue for the project. We will respond soon.

If you want to contribute to this project, please review the contributing guidelines.

@tenthirtyam tenthirtyam added status/awaitng-response Awaiting Response and removed status/needs-triage Needs Triage labels Nov 9, 2022
@tenthirtyam tenthirtyam added this to the Backlog milestone Nov 9, 2022
@tenthirtyam tenthirtyam self-assigned this Nov 9, 2022
@tenthirtyam tenthirtyam changed the title Builds might fail when using iso_url Builds might fail when using iso_url and other iso variable remain defined Nov 9, 2022
@tenthirtyam tenthirtyam changed the title Builds might fail when using iso_url and other iso variable remain defined Builds might fail when using iso_url and other iso variables remain defined Nov 9, 2022
@tenthirtyam
Copy link
Contributor

Please note that I have properly formatted the Markdown for the variable and log content of the issue description.

@tenthirtyam tenthirtyam changed the title Builds might fail when using iso_url and other iso variables remain defined Builds may fail when using iso_url and other iso_* variables remain defined Nov 9, 2022
@tenthirtyam tenthirtyam added the type/docs Documentation label Nov 9, 2022
@tenthirtyam
Copy link
Contributor

Try the following and let me know the results:

Debian Example:

// Removable Media Settings
iso_url            = "http://cdimage.debian.org/cdimage/release/11.5.0/amd64/iso-cd/debian-11.5.0-amd64-netinst.iso"
iso_path           = ""
iso_file           = ""
iso_checksum_type  = "sha512"
iso_checksum_value = "6a6607a05d57b7c62558e9c462fe5c6c04b9cfad2ce160c3e9140aa4617ab73aff7f5f745dfe51bbbe7b33c9b0e219a022ad682d6c327de0e53e40f079abf66a"

However, it will likely still attach a CD-ROM to a datastore with no attached media.

@tenthirtyam
Copy link
Contributor

To work around this issue, the project will likely need to incorporate some logic in the HCL config to support one or the other methods, or remove support for iso_url method.

@PabloRapidScale
Copy link
Author

Try the following and let me know the results:

Debian Example:

// Removable Media Settings
iso_url            = "http://cdimage.debian.org/cdimage/release/11.5.0/amd64/iso-cd/debian-11.5.0-amd64-netinst.iso"
iso_path           = ""
iso_file           = ""
iso_checksum_type  = "sha512"
iso_checksum_value = "6a6607a05d57b7c62558e9c462fe5c6c04b9cfad2ce160c3e9140aa4617ab73aff7f5f745dfe51bbbe7b33c9b0e219a022ad682d6c327de0e53e40f079abf66a"

However, it will likely still attach a CD-ROM to a datastore with no attached media.

This worked, it just makes it fall into scenario 3 I mentioned in my original post. As you noted It still mounts an additional CD with no attached media. I imagine this would still fail with Windows as it will still throw the drive letters out of order causing the autounattend.xml to not be accurate anymore.

@tenthirtyam
Copy link
Contributor

I've placed this on the backlog and will review this option at a later time to see if there is a more elegant method to toggle this feature. For now, the projects defaults works as intended.

If you think of a method, contributions are welcome following the CONTRIBUTING.md.

@tenthirtyam tenthirtyam added priority/low Low Priority type/refactor Refactor status/deferred Deferred and removed status/awaitng-response Awaiting Response type/docs Documentation labels Nov 9, 2022
@tenthirtyam
Copy link
Contributor

Based on further review and testing of options, I will be reverting pull request #249 for enhancement #235 and this project will remove support for iso_url.

tenthirtyam added a commit that referenced this issue Dec 22, 2022
BREAKING CHANGE:  Reverts pull request #249 based on issue #343 to remove support for the use of `iso_url`.

Signed-off-by: Ryan Johnson <johnsonryan@vmware.com>
tenthirtyam added a commit that referenced this issue Dec 22, 2022
BREAKING CHANGE:  Reverts pull request #249 based on issue #343 to remove support for the use of `iso_url`.

Signed-off-by: Ryan Johnson <johnsonryan@vmware.com>
@tenthirtyam tenthirtyam removed type/refactor Refactor priority/low Low Priority status/deferred Deferred labels Dec 22, 2022
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants