Add snapshot import to post-processor #554
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This revives the previously closed PR #104 from @Itxaka, which adds the possibility of importing an image to Amazon EC2 by using the ImportSnapshot/RegisterImage API, which has lower requirements than the ImportImage API and does not try to modify the imported image. It's motivated by the fact I can't successfully import a Fedora Cloud 42 image using the current version of the post-processor (the OS is not recognised/supported by EC2 ImportImage), but I have been able to successfully import a Fedora Cloud image built/customised using the QEMU builder with this branch of the plugin, using
import_type="snapshot".It reuses the current post-process method but diverges once we need to import the image. The artifact upload to S3 is the same, but instead of calling ImportImage, we call ImportSnapshot to create an EBS snapshot from the S3 artifact, then call RegisterImage to register the snapshot as a new AMI. The steps after registering the AMI are identical to the previous image import process. Existing uses of the post-processor without any
import_typespecified will continue to use ImportImage as before.I have tried to address all the outstanding comments from Sylvia on PR #104 and rebased the changes on the latest
mainbranch, including adding support for ARM architectures which was added tomainin the years since #104 was closed. ARM architecture snapshot import requires specifying the virtualization type ashvm, which is required anyway for all recent EC2 image types, hence the addition of that parameter. All the available ARM instance types also seem to require an image with ENA support, so I have added that as a parameter too.Resolved Issues
Closes #3
Closes #103