Skip to content

vsphere-iso waiting for ipv6 SSH - need to force ipv4 #9360

@eableson

Description

@eableson

When building VMs on vSphere, the API reports an array of IP addresses which come in random order including both ipv4 and ipv6 addresses in the same array. Packer only picks one which may be the ipv6 address in environments that have no ipv6 connectivity.

packer build -var-file ../lab-vars.json ubu-20.json
vsphere-iso: output will be in this color.

==> vsphere-iso: Creating VM...
==> vsphere-iso: Customizing hardware...
==> vsphere-iso: Mounting ISO images...
==> vsphere-iso: Starting HTTP server on port 8941
==> vsphere-iso: Set boot order temporary...
==> vsphere-iso: Power on VM...
==> vsphere-iso: Waiting 3s for boot...
==> vsphere-iso: HTTP server is working at http://10.0.1.5:8941/
==> vsphere-iso: Typing boot command...
==> vsphere-iso: Waiting for IP...
==> vsphere-iso: IP address: fe80::250:56ff:fe96:9552
==> vsphere-iso: Using ssh communicator to connect: fe80::250:56ff:fe96:9552
==> vsphere-iso: Waiting for SSH to become available...
==> vsphere-iso: Timeout waiting for SSH.
==> vsphere-iso: Clear boot order...
==> vsphere-iso: Power off VM...
==> vsphere-iso: Destroying VM...
Build 'vsphere-iso' errored: Timeout waiting for SSH.

During the time that packer is waiting, I can connect via SSH over ipv4 without any issues. The same problem has already been handled in the Openstack builder:

ssh_ip_version (string) - The IP version to use for SSH connections, valid values are 4 and 6. Useful on dual stacked instances where the default behavior is to connect via whichever IP address is returned first from the OpenStack API.

If this option could be ported over to the sphere-iso builder that should solve this problem.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions