Importing the OVA for AMI conversion

Last Updated : Aug 25, 2025 |
Prolog information
Before you begin
  • Create an access key. For more information, see Creating an access key.
  • Obtain the user id. For more information, see Obtaining the virtual server instance user id.
  • Convert the *.pem file to the *.ppk format and configure PuTTY to establish an SSH connection. For more information, see Configuring PuTTY.
  1. Open an SSH session.
  2. In Host Name (or IP address), type the IP Address of the virtual server instance, and click Open.
  3. Log in to the Linux server, and run the following command: aws.
  4. To configure the AWS details, run the following command: aws configure, and do the following:
    1. In AWS Access Key ID, type the AWS access key ID.
    2. In AWS Secret Access Key, type the AWS secret access key ID.
    3. In Default region name, type the region name.
      ADDITIONAL INFORMATION:
      For example: us-west-2.
    4. In Default output format, type text or json.
  5. To check whether the EC2 instance is ready to use, run the following command: aws s3 ls.
    STEP RESULT:
    The system displays the S3 bucket that you created.
  6. To view the content of the S3 bucket, run the following command: aws s3 ls s3://<nameofbucket>.
    ADDITIONAL INFORMATION:
    Note:
    The aws s3 ls s3://<nameofbucket> command fails if the Virtual Private Cloud (VPC) has DNS resolution disabled.
  7. To enable importing files into the EC2 instance, create a vmimport role and attach policies as mentioned in the following sub-steps:
    1. Create a file named trust-policy.json with the following policy:
      ADDITIONAL INFORMATION: { "Version":"2012-10-17", "Statement":[ { "Sid":"", "Effect":"Allow", 
      "Principal":{ "Service":"vmie.amazonaws.com" }, "Action":"sts:AssumeRole", 
      "Condition":{ "StringEquals":{ "sts:ExternalId":"vmimport" } } } ] }
    2. Use the create-role command to create a role named vmimport and give VM Import/Export access to it.
      ADDITIONAL INFORMATION:
      Ensure that you specify the full path to the location of the trust-policy.json file, and prefix file:// to it:
      aws iam create-role --role-name vmimport --assume-role-policy-document file://trust-policy.json
    3. Create a file named role-policy.json with the following policy:
      ADDITIONAL INFORMATION:
      Where <your_bucket_name> is the bucket that includes the OVA:
      {
      "Version":"2012-10-17",
      "Statement":[
      {
      "Effect":"Allow",
      "Action":[
      "s3:ListBucket",
      "s3:GetBucketLocation"
      ],
      "Resource":[
      "arn:aws:s3:::<your_bucket_name>"
      ]
      },
      {
      "Effect":"Allow",
      "Action":[
      "s3:GetObject"
      ],
      "Resource":[
      "arn:aws:s3:::<your_bucket_name>/*"
      ]
      },
      {
      "Effect":"Allow",
      "Action":[
      "ec2:ModifySnapshotAttribute",
      "ec2:CopySnapshot",
      "ec2:RegisterImage",
      "ec2:Describe*"
      ],
      "Resource":"*"
      }
      ]
      }
    4. Use the following put-role-policy command to attach the policy to the role created in the preceding step.
      ADDITIONAL INFORMATION:
      Ensure that you specify the full path to the location of the role-policy.json file.
      aws iam put-role-policy --role-name vmimport --policy-name vmimport --policy-document file://role-policy.json
  8. To import the OVA for conversion, type the following command: aws ec2 import-image --cli-input-json "{ \"Description\": \"<Server OVA>\", \"DiskContainers\": [ { \"Description\": \"<text description of task>\", \"UserBucket\": { \"S3Bucket\": \"<your_bucket_name>\", \"S3Key\" : \"<server.ova>\" } } ]}"
    ADDITIONAL INFORMATION:
    Ensure to replace appropriate values wherever brackets <> are present in preceding command.
    The system displays the Status and the ImportTaskId parameters.
  9. To check the status of the import image, run the following command: aws ec2 describe-import-image-tasks --cli-input-json "{ \"ImportTaskIds\": [\"<Your_ImportTaskId>\"], \"NextToken\": \"abc\", \"MaxResults\": 10 } "
    ADDITIONAL INFORMATION:
    Where, ImportTaskId is the one from the output of Step 8. For example, import-ami-ffmanv5x.
    The conversion process takes up to 30 minutes. You can run the preceding command repeatedly. When the AMI conversion is successful, the system displays the Status as completed and ImageId.
    In the following example, the process is at the update stage and is 30% complete.
    [ec2-user@ip-10-143-10-81 ~]$ aws ec2 describe-import-image-tasks --cli-input-json "{ \"ImportTaskIds\": [\"import-ami-ffgji45r\"], \"NextToken\": \"abc\", \"MaxResults\": 10 } " IMPORTIMAGETASKS <Avaya application>-07.1.0.0.xxx-aws-001.ova import-ami-ffgji45r 30 active updating
    In the following example, the process is preparing the AMI and is 76% complete.
    IMPORTIMAGETASKS x86_64 <Avaya application>-07.1.0.0.xxx-aws-001.ova import-ami-ffgji45r BYOL Linux 76 active preparing ami
    The output format varies depending on the selection of the
  10. format on the aws CLI configuration.
For more information, see AWS Import your VM as an image on the AWS website at http://docs.aws.amazon.com/vm-import/latest/userguide/import-vm-image.html.
  • Sign in to the Amazon Web Services Management console.
  • Under AWS services, navigate to All servicesComputeEC2.
    STEP RESULT:
    The system displays the EC2 Management Console page.
  • In the left navigation pane, click IMAGESAMIs.
    ADDITIONAL INFORMATION:
    You can search the converted AMI with ImageId. The system displays the newly converted AMI ImageId in the AMI ID column.
    You can give an appropriate name for the AMI ImageId.