Packer hangs/stalls on building amazon-instance image

349 views
Skip to first unread message

Eric Robinson

unread,
Oct 5, 2016, 12:22:21 PM10/5/16
to Packer
HI,

I am attempting to build an AWS AMI using amazon-instance type builder. I'm running packer in debug option so I can ssh into the instance and monitor what's going on. 

$ packer build -debug my_packer_config.json

Here's a portion of my output:

==> amazon-instance: Pausing after run of step 'StepProvision'. Press enter to continue.   
==> amazon-instance: Uploading X509 Certificate...
==> amazon-instance: Pausing after run of step 'StepUploadX509Cert'. Press enter to continue. 
==> amazon-instance: Bundling the volume...
==> amazon-instance: Running: sudo -i -n ec2-bundle-vol -k /tmp/key.pem -u 593404624303 -c /tmp/cert.pem -r x86_64 -e /tmp/* -d /tmp -p image-1475601786 --batch --no-filter
    amazon-instance: Setting partition type to bundle "/" with...
    amazon-instance: Auto-detecting partition type for "/"
    amazon-instance: Partition label detected using parted: "loop"
    amazon-instance: Using partition type "none"
    amazon-instance: Copying / into the image file /tmp/image-1475601786...
    amazon-instance: Excluding:
    amazon-instance: /proc
    amazon-instance: /sys
    amazon-instance: /dev
    amazon-instance: /dev/pts
    amazon-instance: /proc/sys/fs/binfmt_misc
    amazon-instance: /dev
    amazon-instance: /media
    amazon-instance: /mnt
    amazon-instance: /proc
    amazon-instance: /sys
    amazon-instance: /tmp/analysis-icu9204855453150632888.zip.md5
    amazon-instance: /tmp/image-1475601786
    amazon-instance: /mnt/img-mnt
    amazon-instance: Image file created: /tmp/image-1475601786
    amazon-instance: Volume cloning done.
    amazon-instance: Bundling image file...


The ec2-bundle-vol command finishes and I have a 10G image file along with 107 "part" files in /tmp. But Packer never moves to the next step and nothing is copied to my S3 bucket.

The image file is large and the bundle step took several hours. 

Any ideas what might be going on?

thanks

Matthew Hooker

unread,
Oct 5, 2016, 1:44:30 PM10/5/16
to Packer
Hi Eric,

Unfortunately it's hard to say what's going on without a full debug log and a packer.json file that can reproduce this.

My only thought is that perhaps this is related to this issue https://github.com/mitchellh/packer/issues/3920

If you're up for it, you might try running packer with the patch mentioned in this comment https://github.com/mitchellh/packer/issues/3920#issuecomment-250964145

Otherwise, feel free to open an issue on github with additional debugging info.

Thanks,
--Matt

Eric Robinson

unread,
Oct 6, 2016, 4:48:20 PM10/6/16
to Packer
I turned on debugging, but get no output after "Bundling image file...". The image "part" files exist is /tmp. 

I'll open a ticket on github. 
Message has been deleted

Eric Robinson

unread,
Oct 6, 2016, 6:25:08 PM10/6/16
to Packer
I removed  the long-running  install steps (downloading and installing custom software from S3 bucket), and everything works as it should. Add it back it and the problem appears.

Without the extra install, I end up with 37 "part" files (~370 MB). With the extra install, I end up with 107 "part" files (a little over 1GB). I suspect the extra time to compress and part the files results in an SSH problem, but I can't be sure.

Reply all
Reply to author
Forward
0 new messages