Packer ssh server timeout

715 views
Skip to first unread message

ido....@toluna.com

unread,
Jan 19, 2017, 12:29:02 PM1/19/17
to Packer
Hi all,
Trying to use amazon-ebs builder with ansible provision
I'm behind a NAT and trying to do the bake on aws, but after 5 minutes the ssh connections is shutdown and the bake fails
any thoughts? thanks


this is my packer json:

{
    "builders": [
      {
        "type": "amazon-ebs",
        "access_key": "{{user `aws_access_key`}}",
        "secret_key": "{{user `aws_secret_key`}}",
        "region": "{{user `aws_region`}}",
        "iam_instance_profile": "{{user `iam_instance_profile`}}",
        "launch_block_device_mappings": [ {
            "device_name": "/dev/sda1",
            "volume_size": "{{user `volume`}}"
        } ],
        "source_ami": "{{user `source_ami_id`}}",
        "associate_public_ip_address": true,
        "force_deregister": true,
        "ssh_pty": false,
        "ssh_timeout": "600s",
        "ssh_keypair_name" : "{{user `ssh_keypair_name`}}",
        "ssh_private_key_file" : "{{user `ssh_private_key_file`}}",
        "ssh_username": "{{user `ssh_user`}}",
        "instance_type": "{{user `ami_instance_type`}}",
        "ami_name": "{{user `ami_name`}} {{isotime `2006-01-02 03_04_05`}}",
        "ami_regions": ["us-west-1","us-west-2","eu-west-1","eu-central-1"],
        "tags": {
          "Name": "{{user `ami_name`}}",
          "Version": "{{user `version`}}",
          "Packer": "true"
        },
        "ami_description": "{{user `ami_description`}}"
      }
    ],
    "provisioners": [
       {
          "type": "ansible",
          "ansible_env_vars": [ "ANSIBLE_HOST_KEY_CHECKING=False","ANSIBLE_CONFIG=/home/admin/ioto-edge/ansible.cfg"],
          "playbook_file": "{{user `playbook_file`}}",
          "host_alias":"{{user `ami_name`}}",
          "user":"{{user `ssh_user`}}",
          "extra_arguments": [ "--vault-password-file","{{user `vault_file`}}"]
       }
     ]
}

Rickard von Essen

unread,
Jan 19, 2017, 2:28:25 PM1/19/17
to packe...@googlegroups.com
It's not very useful when everything is a user variable. Can supply the values of those, say which distribution the source ami is and run with `PACKER_LOG=1 packer build template.json` and attach the full log. 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/5a462600-6d96-456a-967f-0d000db7e998%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ido....@toluna.com

unread,
Jan 19, 2017, 3:39:45 PM1/19/17
to Packer
Hi Rickard,
Sorry for that, the users variables are because we are using Spinnaker to pass them to the json as part of a pipeline.
We are trying to run m3.medium machine with this source ami-47a23a30.

The thing that happens is that every time after around 5 minutes packer gets stuck and this is how its log ends either without any indication: 

or like this:

Which means that by the error code the server closed the connection. 
No clue why it happens,

Any help would be appreciated 
Ido.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.

Rickard von Essen

unread,
Jan 19, 2017, 4:34:52 PM1/19/17
to packe...@googlegroups.com
Looks like ansible is failing on this:

2017/01/18 11:09:08 ui:     amazon-ebs: failed: [CrossenseEdge] (item=[u'pkg-config', u'libboost-all-dev', u'scons']) => {"failed": true, "item": ["pkg-config", "libboost-all-dev", "scons"], "module_stderr": "", "module_stdout": "", "msg": "MODULE FAILURE", "parsed": false}

To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/6b103280-f260-4352-8f35-9b433253a18d%40googlegroups.com.

ido....@toluna.com

unread,
Jan 19, 2017, 4:37:14 PM1/19/17
to Packer
I think it's a generic error message, Every time the connection is lost it shows "MODULE FAILURE" on the current task the ansible was running.
Reply all
Reply to author
Forward
0 new messages