# AWS 測試 Hyper-V BYOL 2012 Windows R2 - 參考文檔:https://docs.aws.amazon.com/zh_tw/vm-import/latest/userguide/vmimport-image-import.html#example-4 - 使用Hyper-V - 須注意,因使用Windows 所以在local虛擬機image匯出後若無做一般化會導致create出來的image會跟上台一模一樣,其中包含它的路由及密碼等等配置。 使用hyper v 1. 將ISO檔匯入hyper v 後轉成vhdx 檔 ![](https://hackmd.io/_uploads/r13LAFMla.png) 完成後按右鍵匯出(要記得先關機) ![](https://hackmd.io/_uploads/rkajCtfe6.png) ![](https://hackmd.io/_uploads/S1slk9zep.png) - AWS Migration Hub 文檔: https://docs.aws.amazon.com/zh_tw/migrationhub-orchestrator/latest/userguide/import-vm-images.html ![](https://hackmd.io/_uploads/Skdn5d91T.png) 3. 使用 aws cli 以單一磁碟匯入映像 - aws cli 示例(參考文檔:https://docs.aws.amazon.com/cli/latest/reference/ec2/import-image.html) aws ec2 import-image --license-type BYOL --disk-containers Format=VHDX,Url=s3://hs7/migrationhub-orchestrator-vmie-folder-name/WindowsServer2012.VHDX (需更改上方 url後檔案存放位置) ![](https://hackmd.io/_uploads/HkOp0d9kp.png) 確認status為 active時即可使用以下指令確認步驟: aws ec2 describe-import-image-tasks --import-task-ids import-ami-xxxxxxxxx (需更改最後ImportTask Id) ![](https://hackmd.io/_uploads/HJe7kFqyT.png) 最後等待轉換AMI完成 匯入映像工作完成後,輸出會包含 AMI 的識別碼。下列為包括AMI Id ![](https://hackmd.io/_uploads/BkppJF516.png) 4. 完成 AMI匯入後,即可至機器上使用該AMI ![](https://hackmd.io/_uploads/B1-JBqzgp.png)