AWS: error while creating AMI from Ubuntu - error initramfs/initrd
Asked Answered
P

1

8

I've created a simple VM in VirtualBox and installed Ubuntu, however, I am unable to import this to AWS and generate an AMI from it.
Operating system: Ubuntu 20.04.4 LTS Kernel: Linux 5.4.0-104-generic

I've followed the steps provided according to the docs and setup role-policy.json & trust-policy.json:
https://docs.aws.amazon.com/vm-import/latest/userguide/vmie_prereqs.html#vmimport-role

https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html

I keep running into the error:

{
    "ImportImageTasks": [
        {
            "Description": "My server VM",
            "ImportTaskId": "import-ami-xxx",
            "SnapshotDetails": [
                {
                    "DeviceName": "/dev/sde",
                    "DiskImageSize": 2362320896.0,
                    "Format": "VMDK",
                    "Status": "completed",
                    "Url": "s3://xxxx/simple-vm.ova",
                    "UserBucket": {
                        "S3Bucket": "xxx",
                        "S3Key": "simple-vm.ova"
                    }
                }
            ],
            "Status": "deleted",
            "StatusMessage": "ClientError: We were unable to read your import's initramfs/initrd to determine what drivers your import requires to run in EC2.",
            "Tags": []
        }
    ]
}

I've tried changing disk to and from .vdi and .vmdk

I've tried disabling floppy drive and update initramfs

Pounds answered 21/3, 2022 at 21:9 Comment(3)
I am not sure whether you're using Vagrant in combination with VirtualBox, I assume not since you didn't mention Vagrant. I was able to work around this issue by using Vagrant and instead of using the ubuntu/focal64, I used the geerlingguy/ubuntu2004 image and it imported perfectly without any issues. Just remember to remove the default vagrant credentials of vagrant/vagrant.Buckinghamshire
any fix for this?Hyderabad
I didn't want to re-ask this question so I offered a bounty, wondering if you got around it or noticed that you used "VMDK" as the Format to import an OVA (OVA is a valid format name). I'm trying the same thing with a RAW disk image created with QEMU.Pickerelweed
P
0

I ran into this error and was able to get around it by using import-snapshot instead of import-image. Then I could deploy the snapshot using the ordinary means of creating an image from the snapshot.

Pickerelweed answered 21/9, 2022 at 12:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.