Packer is able to connect fine via SSH when using our loaded key in Outscale however, this stopped working when switching the 'ssh_interface' to "private". We are using the 'outscale-bsusurrogate' builder for this.
ssh_interface = "public_ip"
ssh_username = "outscale"
communicator = "ssh"
ssh_private_key_file = "~/.ssh/outscale-private.rsa"
ssh_keypair_name = "loaded-key-in-outscale"
3.) Switch the 'ssh_interface' with all other parameters the same (this should fail to connect and timeout)
ssh_interface = "private_ip"
ssh_username = "outscale"
communicator = "ssh"
ssh_private_key_file = "~/.ssh/outscale-private.rsa"
ssh_keypair_name = "loaded-key-in-outscale"
# plugin config
packer {
required_plugins {
outscale = {
version = "1.1.3"
source = "github.com/outscale/outscale"
}
}
}
# packer version
Packer v1.9.1
For the build, extracted the SSH parameters and provided them below. Was able to confirm that by only switch the 'ssh_interface', packer was no longer able to connect via SSH.
source "outscale-bsusurrogate" "linux" {
...
ssh_interface = "public_ip"
ssh_username = "outscale"
communicator = "ssh"
ssh_private_key_file = "~/.ssh/outscale-infrastructure.rsa"
ssh_keypair_name = "outscale-infrastructure"
}
build {
sources = [
"source.outscale-bsusurrogate.linux"
]
}
source "outscale-bsusurrogate" "linux" {
...
ssh_interface = "private_ip"
ssh_username = "outscale"
communicator = "ssh"
ssh_private_key_file = "~/.ssh/outscale-infrastructure.rsa"
ssh_keypair_name = "outscale-infrastructure"
}
build {
sources = [
"source.outscale-bsusurrogate.linux"
]
}
Executing Packer on Windows Server 2019 hosted in Outscale.
{"ResponseContext":{"RequestId":"2d802836-cf2e-4797-b779-d39a7d94a12d"},"Vms":[{"VmType":"tinav5.c4r8p1","VmInitiatedShutdownBehavior":"stop","State":"running","StateReason":"","RootDeviceType":"ebs","RootDeviceName":"/dev/sda1","IsSourceDestChecked":true,"KeypairName":"outscale-infrastructure","PublicIp":"216.168.194.46","ImageId":"ami-66ff5bda","PublicDnsName":"ows-216-168-194-46.us-east-2.compute.outscale.com","DeletionProtection":false,"Architecture":"x86_64","NestedVirtualization":false,"BlockDeviceMappings":[{"DeviceName":"/dev/sda1","Bsu":{"VolumeId":"vol-2f714b45","State":"attached","LinkDate":"2024-02-02T16:08:18.132Z","DeleteOnVmDeletion":true}},{"DeviceName":"/dev/xvdf","Bsu":{"VolumeId":"vol-504e73d2","State":"attached","LinkDate":"2024-02-02T16:08:18.132Z","DeleteOnVmDeletion":true}}],"VmId":"i-219f55b1","ReservationId":"r-0f89df03","Hypervisor":"xen","Placement":{"Tenancy":"default","SubregionName":"us-east-2a"},"ProductCodes":["0001"],"CreationDate":"2024-02-02T16:08:18.132Z","UserData":"","PrivateIp":"10.17.8.113","SecurityGroups":[{"SecurityGroupName":"packer_osc_65bd136f-7d27-7000-ac93-6a2fc2e55883","SecurityGroupId":"sg-498f8efc"}],"BsuOptimized":false,"LaunchNumber":0,"Performance":"highest","Tags":[{"Value":"Packer Builder","Key":"Name"}],"PrivateDnsName":"ip-10-17-8-113.us-east-2.compute.internal"}]}
2024/02/02 16:08:33 ui: �[0;32m outscale-bsusurrogate.linux: Public DNS: ows-216-168-194-46.us-east-2.compute.outscale.com�[0m
2024/02/02 16:08:33 ui: �[0;32m outscale-bsusurrogate.linux: Public IP: 216.168.194.46�[0m
2024/02/02 16:08:33 ui: �[0;32m outscale-bsusurrogate.linux: Private IP: 10.17.8.113�[0m
2024/02/02 16:08:37 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:08:37 [INFO] Not using winrm communicator, skipping get password...
2024/02/02 16:08:39 ui: �[1;32m==> outscale-bsusurrogate.linux: Using SSH communicator to connect: 10.17.8.113�[0m
2024/02/02 16:08:39 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:08:39 [INFO] Waiting for SSH, up to timeout: 5m0s
2024/02/02 16:08:39 ui: �[1;32m==> outscale-bsusurrogate.linux: Waiting for SSH to become available...�[0m
2024/02/02 16:08:54 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:08:54 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:09:14 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:09:14 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:09:34 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:09:34 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:09:54 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:09:54 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:10:14 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:10:14 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:10:34 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:10:34 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:10:54 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:10:54 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:11:14 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:11:14 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:11:34 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:11:34 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:11:54 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:11:54 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:12:14 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:12:14 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:12:34 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:12:34 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:12:54 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:12:54 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:13:14 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:13:14 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:13:34 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:13:34 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 10.17.8.113:22: i/o timeout
2024/02/02 16:13:39 ui error: �[1;31m==> outscale-bsusurrogate.linux: Timeout waiting for SSH.�[0m
2024/02/02 16:13:39 packer-plugin-outscale_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/02/02 16:13:39 [DEBUG] SSH wait cancelled. Exiting loop.