Skip to content

vsphere-iso: IPv6 ip_wait_address breaks "Waiting for SSH to become available" due to "too many colons in address". #333

@pinjic

Description

@pinjic

Overview of the Issue

Whilst creating IPv6-only packer images, we ran into the following problems:

  • Packer was still waiting/polling for an assigned IP address to the VM, although it had already received an IPv6 address.

    This was solved by assigning an IPv6 range (e.g. 2001:db8:dead:beef::/64) to the ip_wait_address variable inside the source "vsphere-iso" "[name]" stanza. This was necessary due to the vSphere ISO builder defaulting to IPv4: https://developer.hashicorp.com/packer/integrations/hashicorp/vsphere/latest/components/builder/vsphere-iso#wait-configuration

  • Packer was still waiting/polling for SSH to become available, even after passing the IP check.

    Still unresolved. The SSH wait seems to continue using the detected IP address of the VM, but doesn't work around the implications of the address being an IPv6 address:

    2023/11/29 08:44:32 packer-plugin-vsphere_v1.2.2_x5.0_linux_amd64 plugin: 2023/11/29 08:44:32 VM IP seems stable enough: 2001:db8:dead:beef::1
    ==> vsphere-iso.adis-tester: IP address: 2001:db8:dead:beef::1
    2023/11/29 08:44:32 packer-plugin-vsphere_v1.2.2_x5.0_linux_amd64 plugin: 2023/11/29 08:44:32 [INFO] Waiting for SSH, up to timeout: 30m0s
    2023/11/29 08:44:32 packer-plugin-vsphere_v1.2.2_x5.0_linux_amd64 plugin: 2023/11/29 08:44:32 [DEBUG] TCP connection to SSH ip/port failed: dial tcp: address 2001:db8:dead:beef::1:22: too many colons in address
    ==> vsphere-iso.adis-tester: Using SSH communicator to connect: 2001:db8:dead:beef::1
    ==> vsphere-iso.adis-tester: Waiting for SSH to become available...
    2023/11/29 08:44:37 packer-plugin-vsphere_v1.2.2_x5.0_linux_amd64 plugin: 2023/11/29 08:44:37 [DEBUG] TCP connection to SSH ip/port failed: dial tcp: address 2001:db8:dead:beef::1:22: too many colons in address
    2023/11/29 08:44:42 packer-plugin-vsphere_v1.2.2_x5.0_linux_amd64 plugin: 2023/11/29 08:44:42 [DEBUG] TCP connection to SSH ip/port failed: dial tcp: address 2001:db8:dead:beef::1:22: too many colons in address
    

Might be the same problem as described in hashicorp/packer#9360.

Reproduction Steps

Packer Version

Packer v1.9.4

Plugin Version and Builders

Plugin: packer-plugin-vsphere_v1.2.2_x5.0_linux_amd64

Builder: vsphere-iso

VMware vSphere Version

7.0.3

Guest Operating System

Both tested with Ubuntu 22.04 LTS and Ubuntu 20.04 LTS.

Simplified Packer Buildfile

Operating System and Environment Details

Packer was run from my Ubuntu 22.04 LTS desktop.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions