Packer Amazon-EBS builder demo build fails: Timeout waiting for SSH

241 views
Skip to first unread message

gigit1000

unread,
Mar 8, 2019, 4:54:56 PM3/8/19
to Packer

Hello,

I’m new to Packer and I'm trying to run the Packer amazon-ebs builder demo. I modified the template to include vpc, subnet, and security group:

{

  "variables": {

    "aws_access_key": "",

    "aws_secret_key": ""

  },

  "builders": [{

    "vpc_id": "vpc-0d082b1de108c6a62",

    "subnet_id": "subnet-07212687cf82e3342",

    "security_group_id": "sg-03fde06f0b030638b",

    "type": "amazon-ebs",

    "access_key": "{{user `aws_access_key`}}",

    "secret_key": "{{user `aws_secret_key`}}",

    "region": "us-west-2",

    "source_ami": "ami-095cd038eef3e5074",    

    "instance_type": "t2.micro",

    "ssh_username": "ec2-user",

    "ami_name": "pack-lin-noprovisioning {{timestamp}}"

  }]

}


I’m running packer from an instance in the same subnet as the temporary instance that Packer is creating for the ami and all traffic between the two is allowed so I don’t think this is a networking or security issue. The ami is amazon linux.

I can see that the temporary instance fully initializes and stays that way for some time, but the running template just stays stuck at: “Waiting for SSH to become available”... until it finally times out.  I’m currently looking for a Packer log file or a way to force Packer to use a specific Key Pair, in the meantime I was hoping that someone here may have run into this and could offer some help?

Thank You

gigit1000

unread,
Mar 8, 2019, 5:35:23 PM3/8/19
to Packer

If I run my build server in a public subnet AND if the Packer template uses the Public IP of my build server this works - However this is not a setup I can use.

Ideally I would like both my build instance and the temporary instance to be in private subnets. At the least I need my build server to remain in a private subnet - which means that the Packer template is going to need to use the private IP of my build server to communicate with the temporary instance. I hope there is a way to specify this.

gigit1000

unread,
Mar 8, 2019, 9:39:30 PM3/8/19
to Packer
I was able to get this working after running the build in debug mode: I was able to see the IP's that Packer was using and adjust the security groups accordingly 
Reply all
Reply to author
Forward
0 new messages