Wednesday, May 13, 2015

Importing Image into AWS as an AMI using AWS CLI. (84/285 technotes for 2015)

Importing an external image into AWS requires the steps below.

aws ec2 help

  • Download the VM image from its current environment as an OVA file (or VMDK, VHD, or RAW).
  • Upload the VM image to S3 using the web console. Goto S3 –> choose / create a bucket and upload the VM file.
image
image


  • Once the VM image is uploaded, import your VM using the ec2 import-image command.

aws ec2 import-image –cli-input-json “
{  "Description": "Datapower OVA",
    "DiskContainers": [
          { "Description": "First CLI task",
            "UserBucket": 

             { "S3Bucket": "datapower-bucket", 

               "S3Key" : "rel_agoradco_nonpd_xen.vhd" 

           }
        } ]
}”

  • Use the ec2 describe-import-image-tasks command to monitor the import progress.

aws ec2 describe-import-image-tasks –import-task-ids import-ami-fgifmh5x

  • Once your import task is completed, you can use the ec2 run-instances command to create an Amazon EC2 instance from the AMI generated during the import process.

References:

No comments: