Comments (7)
Hi @jeremymcgee73 thanks for reaching out. Just a heads up this issue moved to its new home hashicorp/packer-plugin-amazon as the Amazon components are now being maintained in their own repository. With that said it is is possible that this is an eventual consistency issue.
Does the resource eventually get created and is reachable on S3?
If it is a timing issue you can workaround this by setting a very high value for AWS_MAX_ATTEMPTS and AWS_POLL_DELAY_SECONDS. If after a long wait time you still run into issues I would double check that you are able to create and read from the respective S3 resources.
from packer-plugin-amazon.
Thanks for the reply! I am trying that now, and will let you know what I find out. That does make sense! I thought about that, but didnt think about setting those to be high.
If that is the problem, would it be worth adding a pause and retry for this?
from packer-plugin-amazon.
I'm not 100% sure yet. But, I am pretty certain this has solved my problem. Usually 1 out of 5 failed.
Thanks!
from packer-plugin-amazon.
Thanks for the quick turn around on testing @jeremymcgee73. If that is working then I would say that the retry logic in place already is working its just that the default values are not high enough, at least for your use case. If this is an issue for other's then it might mean we need to reevaluate the defaults. Keeping this open for now.
To better assist with this issue I would recommend adding the the aws_polling configuration option to your templates to avoid having to set ENV variables each time. This was added to override defaults for Amazon services that were not longer enough for some users. Information on the configuration option can be found at https://www.packer.io/docs/builders/amazon/ebs#polling-configuration
from packer-plugin-amazon.
I actually don't think that solved my problem. The OVA is getting copied to S3, because it remains after the run. The problem is very intermittent, maybe only happens every 10 runs. Let me know how else I can help.
Thanks!
Post-processor failed: Import task import-ami-0f0769d3d5ba527d6 failed with status message: ClientError: The specified S3 resource does not exist. Reason 404 Not Found, error: ResourceNotReady: failed waiting for successful resource state
The settings I'm passing in as ENV vars:
AWS_POLL_DELAY_SECONDS=600
AWS_MAX_ATTEMPTS=100
from packer-plugin-amazon.
I took another look at this, I don't believe the AWS poll intervals will help. I believe this is failing on the initial import step, not on the checks to see if its done. I think maybe this particular error could be caught, and tried again?
I believe it may be the size of the images, that creates the race condition. Maybe if you add a step to your tests that copy a big file to the image(get the total up to 5/6GB), before the post-processor is ran.
from packer-plugin-amazon.
I would recommend adding the the aws_polling configuration option to your templates
Hi @nywilken 👋🏼
Just wondering how to set the aws_polling
configuration option on a build that is using the amazon-import
post-processor?
We're using the hyperv-iso builder so we have something like the following defined:
source "hyperv-iso" "build" {
communicator = "winrm"
...
}
...
build {
description = "Windows 10"
...
provisioner "windows-restart" {
restart_timeout = "15m"
}
...
post-processor "amazon-import" {
aws_polling = {
delay_seconds = 30
max_attempts = 600
}
}
}
The documentation for the post-processor only mentions environment variables. In other builds where we are using the amazon-ebs
builder we can set the aws_polling
configuration on the builder itself, but adding this configuration to the post-processor generates an error message:
Error: Failed preparing post-processor-block "amazon-import" ""
Unsupported argument; An argument named
"aws_polling" is not expected here. Did you mean to define a block of type "aws_polling"?
Update: it seems I had the configuration wrong, as per the error message which I should have read properly. The aws_polling
configuration should be defined as a block, i.e. without the equals sign:
post-processor "amazon-import" {
aws_polling {
delay_seconds = 30
max_attempts = 600
}
}
Perhaps it would be useful if the documentation for the post-processor mentioned the aws_polling
block can be specified on this post-processor too?
from packer-plugin-amazon.
Related Issues (20)
- Unable to set volume size on amazon-ebs
- Build.Password is not set when using SSH on windows HOT 1
- Enabling fast_launch on Windows AMI does not work HOT 15
- Please document/log that StepStopEBSBackedInstance is silently skipped when building with a spot instance HOT 1
- packer execution time has increased by two/four times after updating the version from 1.1.4 to any higher version HOT 6
- Disk validation failed [Unsupported OVA format] HOT 4
- adding imds_support to amazon-import post-processor
- [documentation] virtual_name for Block Device Mapping HOT 2
- Instance profile unable to locate credentials
- Amazon import post-process option to update snapshot volume type from gp2 to gp3
- Allow Amazon-Import to only import to S3
- Add support for fast snapshot restore HOT 2
- Add support for boot_mode option for Amazon EBS builder HOT 6
- amazon-chroot instance id error HOT 1
- Unable to copy images to non-default regions with AssumeRole HOT 3
- Amazon EBS Volume builder should support setting EBS Volume Snapshot Description HOT 3
- imds_support unset (legacy) not working on source image with ImdsSupport: v2.0 HOT 1
- Error Encountered When Building AMI with capacity_reservation_id HOT 2
- amazon-ebsvolume documentation references the incorrect builder name HOT 1
- ebssurrogate builder missing `deprecate_at` argument HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packer-plugin-amazon.