Content

Import a Hyper-V VM into AWS

Added by Khaja Mohammed ago

Upload VM Disk to S3 -

Create Required Import Role -

Create a file on your local machine with below content, for example, c:\trust-policy.json -

{
"Version": "2012-10-17",
"Statement": [ {
"Effect": "Allow",
"Principal": { "Service": "vmie.amazonaws.com" },
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals":{
"sts:Externalid": "vmimport"
}
}
}
]
}

Create role -

aws iam create-role --role-name vmimport --assume-role-policy-document "file://c:\trust-policy.json"

Create Import Task -

Create a json file with VM import information, for example, on c:\vm1.json

[ {
"Description": "My Server",
"Format": "vhdx",
"UserBucket": {
"S3Bucket": "s3-bucket-name",
"S3Key": "vmdiskfilename.vhdx"
}
}]

aws ec2 import-image --description "My Server" --disk-containers "file://c:\vm1.json"


Comments