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:
-
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.
-
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.
- Upload the .ova to S3:
aws s3 cp --sse --acl private /vm/mytestvm.ova s3://mv-ova-test
- Create a presigned URL for the file:
aws s3 presign s3://mv-ova-test/mytestvm.ova --expires-in 86400
- 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}"
}
]
- 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"
}
- 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": []
}
]
}
- 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": []
}
]
}
- 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
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.