hashicorp / hashicorp/packer-plugin-amazon

Parallel build of AMIs fails consistently

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

Description

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

---

#### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

#### Overview of the Issue

When building multiple amazon AMIs, one of them always fails with `ResourceNotReady: exceeded wait attempts`.
Adding `aws_polling` block doesn't help, I tried up to a combined wait of up to 3 hours.
Running the same packer config with parallel builds disabled (`-parallel-builds=1`) succeeds without even `aws_polling` block.

#### Reproduction Steps

Steps to reproduce this issue
1. Save the file below as `aws-ubuntu.pkr.hcl` in an arbitrary new folder.
2. Run `packer build .` in the same folder

Notes:
* I tried adding a `plugin` block to update the amazon plugin but the result was the same.
* I have also tried using the docker image `hashicorp/packer` instead of the locally installed packer but the result was the same.

### Packer version

Packer v1.8.3

### Simplified Packer Template

```
source "amazon-ebs" "ubuntu" {
ami_name = "learn-packer-linux-aws"
region = "us-east-1"
ssh_username = "ubuntu"

# Remove previous image before making the new one.
force_deregister = true
force_delete_snapshot = true
}

build {
source "amazon-ebs.ubuntu" {
name = "test-packer-x86"
instance_type = "t2.micro"

source_ami_filter {
filters = {
name = "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["099720109477"]
}
}

source "amazon-ebs.ubuntu" {
name = "test-packer-aarch64"
instance_type = "c6g.large"

source_ami_filter {
filters = {
name = "ubuntu/images/*ubuntu-xenial-16.04-arm64-server-*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["099720109477"]
}
}
}
```
### Operating system and Environment details

Fedora 35, x86_64

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.