Search code examples
amazon-web-servicesamazon-s3amazon-ec2amazon-ami

aws ec2 import-image error "ClientError: GRUB doesn't exist in /etc/default


I am following the instructions from http://docs.aws.amazon.com/vm-import/latest/userguide/import-vm-image.html to import an OVA. Here are the summarized steps I followed.

Step 1: Upload an OVA to S3 bucket.

Step 2: Create trust policy

Step 3: Create role policy

Step 4: Create containers.json with bucket name and ova filename.

Step 5: Run command for import-image

Command: aws ec2 import-image --description "My Unique OVA" --disk-containers file://containers.json

Step 6: Get the "ImportTaskId": "import-ami-fgi2cyyd" (in my case)

Step 7: Check status of import task

Error: C:\Users\joe>aws ec2 describe-import-image-tasks --import-task-ids import-ami-fgi2cyyd

{
    "ImportImageTasks": [
        {
            "Status": "deleted",
            "SnapshotDetails": [
                {
                    "UserBucket": {
                        "S3Bucket": "my_unique_bucket",
                        "S3Key": "my_unique_ova.ova"
                    },
                    "DiskImageSize": 2871726592.0,
                    "Format": "VMDK"
                }
            ],
            "Description": "My Unique OVA",
            "StatusMessage": "ClientError: GRUB doesn't exist in /etc/default directory.",
            "ImportTaskId": "import-ami-fgi2cyyd"
        }
    ]
}

What am I doing wrong? I am on free-tier trying things out.

Contents of containers.json:

[
  {
    "Description": "My Unique OVA",
    "Format": "ova",
    "UserBucket": {
        "S3Bucket": "my_unique_bucket",
        "S3Key": "my_unique_ova.ova"
    }
}]

Solution

  • The ova file was corrupted in my case. Tried it with a smaller ova and it worked fine.