2

I need to import a Gen2 Hyper-V machine to AWS and I'm following the document here: https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html

All works fine until I use this command to upload the image:

aws ec2 import-image --description "XYZVM" --license-type AWS --disk-containers file://containers.json

containers.json file is like this:

[
  {
    "Description": "First disk",
    "Format": "vhdx",
    "UserBucket": {
        "S3Bucket": "xyzvmimport",
        "S3Key": "xyWin10.vhdx"
        }
  },          
  {
    "Description": "Second disk",
    "Format": "vhdx",
    "UserBucket": {
        "S3Bucket": "xyzvmimport",
        "S3Key": "xyWin11.vhdx"
    }
  }
]

vhdx files & container.json are on the same folder. I run the command from within the folder as an administrator but I get this error:

An error occurred (InvalidParameter) when calling the ImportImage operation: S3 key does not exist: xyWin10.vhdx

I also made sure that the files have full access to "everyone" to make sure it's not a permission issue.

What's happening here? Why is this tool not working?

user2629636
  • 752
  • 5
  • 19
  • 38
  • The S3 key seems to be referencing a file. Have you triple checked your syntax is correct and that file exists? – Tim Aug 03 '18 at 18:46
  • @Tim I quadruple checked it. They're there – user2629636 Aug 03 '18 at 18:58
  • When you say 'vhdx files & container.json are on the same folder', you mean on the folder on your local machine? because the vhdx files need to be uploaded to the S3 bucket. – Alex Moore Aug 09 '18 at 08:39
  • If you will not fix the import, you may use as alternative starwind v2v to migrate VM from Hyper-V to AWS - https://www.starwindsoftware.com/starwind-v2v-converter – batistuta09 Feb 06 '21 at 21:25

1 Answers1

1

As Alex Moore suggested in the comment to the original question.

When you say 'vhdx files & container.json are on the same folder', you mean on the folder on your local machine? because the vhdx files need to be uploaded to the S3 bucket

I was also assuming the ova was from my workstation. Once I uploaded the ova to the bucket and ran the import-image command it worked.

bustedware
  • 21
  • 3