(upbeat music)
- Hello, I am Karan, a Cloud Support Engineer here
at the AWS office in Cape Town.
Today I'm going to show you how to use AWS VM import/export
to create an EC2 instance based on your on-premises server.
To import your VM, you'll export your VM as an image
from your current environment.
You'll also need an S3 bucket, an IM service role,
and the AWS CLI.
So let's get started.
After logging to the AWS management console,
navigate to the S3 console.
Choose create bucket.
Enter a name for your bucket, and then select
the desired region.
Choose next.
And create bucket.
Now the demoimportedvms bucket is created.
Now let's create the IM server role.
Create a file on your computer named trust-policy.json.
With the following policies.
This allows the VM import to assume the role.
Create another file on your computer named role-policy.json.
Which defines (murmurs) using the following policy.
Be sure that you provide your bucket name.
Here's the bucket name.
Now that we have saved the policies,
let's create the role and then attach the policies
to the role.
In the AWS CLI, create the role name vmimport.
Specify the location of the saved
cross hyphen policy.json file.
Now we use the put-role-policy command
to attach the policy to the role.
So, we have created the S3 bucket, and the required IM role.
Now you can upload your VM image file to your bucket
using the upload tool of your choice.
Now we are at S3 console.
After the file is uploaded to S3,
we'll create one more json file to be saved
on your computer.
We'll call this container.json.
This file will reference your image format
and your S3 bucket name.
This is VM image file which we have uploaded.
After the file has uploaded to S3,
we'll create one more json file
to be saved on your computer.
We'll call this containers.json.
This file will reference your image format
and your S3 bucket name.
This is the S3 bucket, and this is the S3 key.
Now we initiate the import and reference
the containers.json file using the EC2 import-image command.
Take a note of the import task ID as you need this
to monitor the progress of your import.
To monitor the progress, we'll use
the describe-import-image-task command as follows.
This is the import ID, which was coded
from the import image command.
The status message will be shown as active
and the status message is showing converting.
The import task may take some time, depending on the size
of your image.
When the import is complete,
you'll see the Amazon machine image EMI
in your EC2 console, which can then be used
to launch EC2 instances.
Thanks for watching, and happy cloud computing
from all of us here at AWS.
(upbeat music)