-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
amazon_import post-processor fails: architecture=arm64 has an invalid format #11970
Comments
Hrmmm, |
Hmmm, my bad, probably should report this in https://github.com/hashicorp/packer-plugin-amazon... |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.
Overview of the Issue
Importing a Fedora 37 arm64 (aarch64) image fails with an error message from AWS indicating the architecture value is invalid. Googling for the error suggests:
ImportImage
call (presumably this is what is being used) - in the cli this would be equivalent toaws ec2 import-image --architecture arm64
.ImportSnapshot
call - in the cli this would be likeaws ec2 import-snapshot --disk-container Format=VHD,UserBucket="{S3Bucket=YOUR-BUCKET,S3Key=S3_OBJECT_NAME}"
RegisterImage
call - the cli equivalent ofaws ec2 register-image --cli-input-json "$(<register-image.json)"
(with an appropriate JSON input file specifying the snapshot ID returned by the import-snapshot output)Ref: NixOS/nixpkgs#52779 (comment)
Reproduction Steps
I'm using a packer (JSON) template with a
null
builder,shell-local
provisioner (download + verify +qemu-img convert
the image), and a post-processor similar to what's posted in the template item below. Simply running packer build with this template, will fail a few minutes after the upload completes with:`
==> fedora-aws-arm64: Running post-processor: artifice
==> fedora-aws-arm64 (artifice): Using these artifact files: /tmp/fedora-aws-arm64.vhdx
==> fedora-aws-arm64: Running post-processor: amazon-import
fedora-aws-arm64 (amazon-import): Uploading /tmp/fedora-aws-arm64.vhdx to s3://IMPORT-BUCKET-NAME/packer-import-1662046985.vhdx
fedora-aws-arm64 (amazon-import): Completed upload of /tmp/fedora-aws-arm64.vhdx to s3://IMPORT-BUCKET-NAME/packer-import-1662046985.vhdx
Build 'fedora-aws-arm64' errored after 3 minutes 11 seconds: 1 error(s) occurred:
status code: 400, request id: c781da9e-39d2-4df8-ba61-8d176a5cae85
==> Wait completed after 3 minutes 11 seconds
==> Some builds didn't complete successfully and had errors:
--> fedora-aws-arm64: 1 error(s) occurred:
status code: 400, request id: c781da9e-39d2-4df8-ba61-8d176a5cae85
==> Builds finished but no artifacts were created.
`
However, passing the (already uploaded) S3 object into the aws CLI results in (eventual)
aws ec2 describe-import-snapshot-tasks
success:aws ec2 import-snapshot --disk-container Format=VHDX,UserBucket="{S3Bucket=IMPORT-BUCKET-NAME,S3Key=packer-import-1662046985.vhdx}"
Following that with a
aws ec2 register-image --cli-input-json "$(<register-image.json)"
reports success with a"ImageId": "ami-BLAHBLAH"
Packer version
1.8.0
and1.8.3
Simplified Packer Template
Operating system and Environment details
CentOS Stream8 container, credentials specified via
AWS_SHARED_CREDENTIALS_FILE
env. var.Log Fragments and crash.log files
Eleven-billion lines like:
2022/09/01 16:44:03 packer-post-processor-amazon-import plugin: status code: 400, request id: 8a9f1460-cf21-4d69-a2f6-87eebf913b43 2022/09/01 16:44:29 packer-post-processor-amazon-import plugin: Retryable error: InvalidParameter: Parameter architecture = arm64 has an invalid format.
The text was updated successfully, but these errors were encountered: