Skip to content
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 - improvement #3

Open
ghost opened this issue Mar 29, 2021 · 1 comment
Open

amazon-import - improvement #3

ghost opened this issue Mar 29, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 29, 2021

This issue was originally opened by @Roxyrob as hashicorp/packer#9582. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Feature Description

amazon-import supporting "import-snapshot" (ami import passing through snapshot.).

Use Case(s)

I know support from vendor is important, this case can be an exception. AWS is not declaring support for kernel version present in many new OS (CentOS 8, Fedora 31, ...) and stop vmimport task on ami import stage with error: " Unable to determine kernel version" (see hashicorp/packer#8302 from where we start to search for a solution/workaround).

AWS does not stop however import task as snapshot (instead ami directly). We succesfully reach a working CentOS8 custom AMI manually starting from an virtualbox ova e.g created with packer virtualbox-iso

  • extracting VMDK inside ova (tar -xvf packer-centos8min-x86_64.ova)
  • uploading vmdk (aws s3 cp ...)
  • importing VMDK to aws as "snapshot" (aws ec2 import-snapshot...)
  • Creating AMI from snapshot (aws ec2 register-image...)

ova was made using packer provisioned to set right iniramfs with needed modules to allow root device discovery on boot stages for xen-base es2 instances (xen-blkfront), nitro-based ec2 instances (nvme, ena).

It would be nice if amazon-import can support import-snapshot (using VMDK in ova) automating all image creation steps useful to make custom image of new OS release (when kernel version is not yet supported by AWS as often it is a long time lack).

@tomalok
Copy link

tomalok commented Aug 27, 2021

I'm attempting to build a slew of slightly different Amazon Linux images locally with qemu, and then trying to import them with amazon-import, and similar to what's mentioned here, it's complaining with...

==> Some builds didn't complete successfully and had errors:
--> alpine.qemu.edge-aarch64-uefi-tiny-aws: 1 error(s) occurred:

* Post-processor failed: Import task import-ami-01c8ff48cc465f998 failed with status message: ClientError: Unsupported kernel version virt, error: ResourceNotReady: failed waiting for successful resource state
--> alpine.qemu.edge-x86_64-bios-tiny-aws: 1 error(s) occurred:

* Post-processor failed: Import task import-ami-0116dd9338d501277 failed with status message: ClientError: Unknown OS / Missing OS files., error: ResourceNotReady: failed waiting for successful resource state

==> Builds finished but no artifacts were created.

The local disk images are raw format. Difference between the first and second builds above is that aarch64 partitions the disk (GPT/FAT32 for EFI, ext4 for root, using GRUB EFI), and x86_64 formats the whole disk as ext4 instead of partitioning, and uses extlinux as the bootloader.

I've yet to try the above s3 -> import-snapshot -> register-ami process manually, but having this officially supported by a Packer post processor would be very handy...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant