Skip to content

SSH timeout on public IP in VPC/net #159

@wibru

Description

@wibru

Overview of the Issue

Hi,
Packer can't reach a temporary VM created in a VPC on it's public IP. Timeout at step "Waiting for SSH to become available...".
My guess is that it's broken since the SDK update, and could be related to that patch not being applicable anymore: https://github.com/hashicorp/packer/pull/8077/files

Reproduction Steps

I have written a simple test environment with terraform. Change the region variable as you convenience, the eu-west-2 API is currently unstable so I made it on cloudgouv-eu-west-1.

export AWS_ACCESS_KEY_ID=XXXXXXXXXX
export AWS_SECRET_ACCESS_KEY=YYYYYYYYYYYYYYYYYY
wget https://gist.githubusercontent.com/wibru/d95c61515108881db6487f20987b1a74/raw/ced3948c1c1fb2c7a29e042a7dc29dc81e9d48b8/osc-packer-eip-bug.tf
wget https://gist.githubusercontent.com/wibru/d95c61515108881db6487f20987b1a74/raw/ced3948c1c1fb2c7a29e042a7dc29dc81e9d48b8/osc-packer-eip-bug.pkr.hcl
terraform init
terraform apply
packer init osc-packer-eip-bug.pkr.hcl
PACKER_LOG=1 packer build -debug -var-file test.pkvars.json osc-packer-eip-bug.pkr.hcl

Plugin and Packer version

$ packer -version
1.9.1

OK with plugin 1.0.5
KO since plugin 1.0.6 to 1.1.2 included.

Simplified Packer Buildfile

URLs above

Operating system and Environment details

Debian 11 client

Log Fragments and crash.log files

#### without ssh_interface = "public_ip":

   outscale-bsu.default: Private IP: 192.168.100.156
==> outscale-bsu.default: Pausing after run of step 'StepRunSourceVm'. Press enter to continue.
2023/09/29 12:43:57 packer-plugin-outscale_v1.1.2_x5.0_linux_amd64 plugin: 2023/09/29 12:43:57 [INFO] Not using winrm communicator, skipping get password...
==> outscale-bsu.default: Pausing after run of step 'StepGetPassword'. Press enter to continue.
==> outscale-bsu.default: Using SSH communicator to connect: 192.168.100.156
2023/09/29 12:44:00 packer-plugin-outscale_v1.1.2_x5.0_linux_amd64 plugin: 2023/09/29 12:44:00 [INFO] Waiting for SSH, up to timeout: 5m0s
==> outscale-bsu.default: Waiting for SSH to become available...
2023/09/29 12:44:00 packer-plugin-outscale_v1.1.2_x5.0_linux_amd64 plugin: 2023/09/29 12:44:00 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 192.168.100.156:22: connect: no route to host

Packer try to reach the VM on private IP.

#### with ssh_interface = "public_ip":

[DEBUG] Error getting SSH address: couldn't determine address for vm

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions