Importing .ova to EC2 fails with "ClientError: Unknown OS / Missing OS files."

0

Hi all,

I'm trying to convert VMware virtual machines to EC2 instances, but the import always fails with "ClientError: Unknown OS / Missing OS files."

Here's my process:

  1. I start with a CentOS 7.9 VM on ESXi (supported according to https://docs.aws.amazon.com/vm-import/latest/userguide/vmie_prereqs.html#vmimport-operating-systems). The VM is bootable, has only one volume (MBR, ext4) and otherwise nothing special.

  2. I use ovftools to export the VM from ESXi to .ova:

/usr/lib/vmware-ovftool/ovftool --X:logFile=mytestvm-log.txt --X:logLevel=warning --noSSLVerify --powerOffSource vi://$user:$pass@vmhost/mytestvm /volumes/vmexport/mytestvm.ova
Opening VI source: vi://$user@vmhost:443/mytestvm
Opening OVA target: /volumes/vmexport/mytestvm.ova
Writing OVA package: /volumes/vmexport/mytestvm.ova
Transfer Completed                    
Completed successfully

I tried this as well as exporting to OVF and then manually creating a tar file from it - same result. There's nothing in the log that indicates any problem. I can re-import the ova file and run it on ESXi, so it doesn't seem to be broken in any way.

  1. Upload the .ova to S3:
aws s3 cp --sse --acl private /vm/mytestvm.ova s3://mv-ova-test

  1. Create a presigned URL for the file:
aws s3  presign s3://mv-ova-test/mytestvm.ova --expires-in 86400
  1. Make a .json to describe the import:
[
  {
    "Description": "ova-import-test",
    "Format": "ova",
    "Url": "https://mv-ova-test.s3.eu-central-1.amazonaws.com/mytestvm.ova?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential={the rest of the URL}"
  }
]

  1. Start the import:
aws ec2 import-image --description "ova import test" --disk-containers "file://mytestvm.json"

{
    "Description": "test ova import",
    "ImportTaskId": "import-ami-06c5fc120d02749d7",
    "Progress": "1",
    "SnapshotDetails": [
        {
            "Description": "mytestvm",
            "DiskImageSize": 0.0,
            "Format": "OVA",
            "Url": "https://mv-ova-test.s3.eu-central-1.amazonaws.com/mytestvm.ova?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential={the rest of the URL}",
            "UserBucket": {}
        }
    ],
    "Status": "active",
    "StatusMessage": "pending"
}

  1. Check the import task:
{
    "ImportImageTasks": [
       
            "Description": "test ova import",
            "ImportTaskId": "import-ami-06c5fc120d02749d7",
            "Progress": "19",
            "SnapshotDetails": [
                {
                    "DiskImageSize": 7062419968.0,
                    "Format": "VMDK",
                    "Status": "active",
                    "Url": "https://mv-ova-test.s3.eu-central-1.amazonaws.com/mytestvm.ova?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential={the rest of the URL}",
                    "UserBucket": {}
                }
            ],
            "Status": "active",
            "StatusMessage": "converting",
            "Tags": []
        }
    ]
}

  1. And in the end I get:
{
    "ImportImageTasks": [
        {
            "Description": "test ova import",
            "ImportTaskId": "import-ami-06c5fc120d02749d7",
            "SnapshotDetails": [
                {
                    "DeviceName": "/dev/sde",
                    "DiskImageSize": 7062419968.0,
                    "Format": "VMDK",
                    "Status": "completed",
                    "Url": "https://mv-ova-test.s3.eu-central-1.amazonaws.com/mytestvm.ova?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential={the rest of the URL}",
                    "UserBucket": {}
                }
            ],
            "Status": "deleted",
            "StatusMessage": "ClientError: Unknown OS / Missing OS files.",
            "Tags": []
        }
    ]
}
  1. Trying to import the vmdk alone makes no difference:
{
    "ImportImageTasks": [
        {
            "Description": "test vmdk import",
            "ImportTaskId": "import-ami-0e1dc2522176e0cdf",
            "SnapshotDetails": [
                {
                    "Description": "test-vm",
                    "DeviceName": "/dev/sde",
                    "DiskImageSize": 7062419968.0,
                    "Format": "VMDK",
                    "Status": "completed",
                    "Url": "https://mv-ova-test.s3.eu-central-1.amazonaws.com/mytestvm.ova?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential={the rest of the URL}",
                    "UserBucket": {}
                }
            ],
            "Status": "deleted",
            "StatusMessage": "ClientError: Unknown OS / Missing OS files.",
            "Tags": []
        }
    ]
}

So. What could be the cause for "ClientError: Unknown OS / Missing OS files" if I use a supported OS and the .ova seems to be intact? Would I have the same issue if I tried using MGN for this?

Thanks,

Marc

Marc
질문됨 2년 전2611회 조회
3개 답변
1

At least one thing to check is whether or not you have encryption enabled. I was doing something similar recently and although the the ovftool did not produce an error, the resulting ova file was not usable.

MGN is a separate migration method through the use of an agent installed on the VM and then block-level replication into AWS. There are a number of network requirements for MGN. https://docs.aws.amazon.com/mgn/latest/ug/Network-Settings-Video.html.

profile pictureAWS
전문가
답변함 2년 전
  • Thanks for your reply. The only step that involves encryption is the SSE for S3, the disk itself is unencrypted and ESXi doesn't even support encryption at the HV level as far as I know. MGN looks a bit like overkill for the one or two machines I wanted to migrate.

0

i have same issue for an centos 8, still investigating (was thinking i have missed install cloud-init). Marc have u solved the problem?

wmz
답변함 2년 전
  • No, I haven't yet.

  • Just to make sure, it was working. I had a CentOS8 VM running under VMware Fusion

    ./ovftool /Virtual\ Machines.localized/CentOS8-VM.vmwarevm/CentOS8-VM.vmx /Work/CentOS8-VM.ova

    I split the file up into multi-parts to get it into S3, but then ran the VM import task on it.

    { "ImportImageTasks": [ { "Architecture": "x86_64", "ImageId": "ami-xxxx", "ImportTaskId": "import-ami-xxxxx", "LicenseType": "BYOL", "Platform": "Linux", "SnapshotDetails": [ { "DeviceName": "/dev/sda1", "DiskImageSize": 4243619840.0, "Format": "VMDK", "SnapshotId": "snap-xxxxx", "Status": "completed", "UserBucket": { "S3Bucket": "sbx-s3-xxxxx", "S3Key": "CentOS8-VM.ova" } } ], "Status": "completed", "Tags": [], "BootMode": "legacy_bios" } ] }

    It completed without error.

0

Hi Marc, have you solved the problem?

alieZ
답변함 일 년 전
  • Hi Alie, no I have not - it might have been a problem with CentOS 7 only, see answer from Michael above who had success with CentOS 8.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠