hashicorp / hashicorp/packer-plugin-amazon

amazon-ebssurrogate instance "successful" build, but Bad exit status: -1

Open
#124 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Go
Stars
91
Forks
141
Avg merge
2d 18h
Merged PRs (30d)
3

Description

_This issue was originally opened by @tymac753 in https://github.com/hashicorp/packer/issues/11201 and has been migrated to this repository. The original issue description is below._

---
#### Overview of the Issue

Simple builds all seem to end with a successful build but the ec2 instance never fully boots and ends up in a stopped state. The only clue I have is one error in the build output: "==> amazon-ebssurrogate: Bad exit status: -1" PACKER_LOG=1 does not add any more insight or output to this error.

### Simplified Packer Buildfile

{
"variables": {
"aws_access_key_id": "",
"aws_secret_access_key": "",
"region": "us-east-1",
"buildtime": "{{ isotime \"2006-01-02-1504\" }}"
},
"builders": [{
"type": "amazon-ebssurrogate",
"access_key": "{{ user `aws_access_key_id` }}",
"secret_key": "{{ user `aws_secret_access_key` }}",
"region": "{{ user `region` }}",
"spot_price_auto_product": "Linux/UNIX (Amazon VPC)",
"ssh_pty": true,
"instance_type": "m4.large",
"associate_public_ip_address": false,
"ssh_timeout": "5m",
"ssh_username": "ubuntu",
"ssh_interface": "session_manager",
"communicator": "ssh",
"iam_instance_profile": "packer_inst_mgmt",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "*ubuntu-bionic-18.04-amd64-server-*",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"launch_block_device_mappings": [
{
"device_name": "/dev/xvdf",
"delete_on_termination": true,
"volume_size": 8,
"volume_type": "gp2"
}
],
"run_tags": {
"Name": "Packer Builder - Ubuntu 18.04",
"Project": "Test"
},
"run_volume_tags": {
"Name": "Packer Builder - Ubuntu 18.04",
"Project": "Test"
},

"ami_name": "ubuntu-bionic-18.04-amd64-server-{{ user `buildtime` }}",
"ami_description": "Ubuntu bionic 18.04",
"ami_virtualization_type": "hvm",
"ami_regions": ["us-east-1"],
"ami_root_device": {
"source_device_name": "/dev/xvdf",
"device_name": "/dev/xvda",
"delete_on_termination": true,
"volume_size": 8,
"volume_type": "gp2"
},
"tags": {
"Name": "Ubuntu bionic 1804",
"BuildTime": "{{ user `buildtime` }}"
}
}]
}

### Log Fragments and crash.log files

==> amazon-ebssurrogate: Creating AMI tags
amazon-ebssurrogate: Adding tag: "BuildTime": "2021-08-11-1947"
amazon-ebssurrogate: Adding tag: "Name": "Ubuntu bionic 206040) with ZFS Root Filesystem"
==> amazon-ebssurrogate: Creating snapshot tags
==> amazon-ebssurrogate: Terminating the source AWS instance...
==> amazon-ebssurrogate: Bad exit status: -1
==> amazon-ebssurrogate: Cleaning up any extra volumes...
==> amazon-ebssurrogate: No volumes to clean up, skipping
==> amazon-ebssurrogate: Deleting temporary security group...
==> amazon-ebssurrogate: Deleting temporary keypair...
Build 'amazon-ebssurrogate' finished after 3 minutes 32 seconds.

==> Wait completed after 3 minutes 32 seconds

==> Builds finished. The artifacts of successful builds are:
--> amazon-ebssurrogate: AMIs were created:
us-east-1: ami-06ba21a6273b2cb32

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.