What's new
Install the app
How to install the app on iOS

Follow along with the video below to see how to install our site as a web app on your home screen.

Note: This feature may not be available in some browsers.

Welcome to My Sharing Site

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Tutorial How to Import/Export Virtual Machine Images on AWS

Tutorial How to Import/Export Virtual Machine Images on AWS
RazRav Offline

RazRav

Living life @ 25 FPS

Staff member
VIP Member
Moderator
Moderator
Apr 13, 2020
615
6,447
93
India
First thing may all know this but only intended to Beginners


Some times you might need to use a pre-configured image in cloud environment as well as on-premise servers with virtualization. Amazon Web Services support importing VM to Amazon Machine Images and Exporting Imported instances. Please note AWS only officially support for exporting previously imported instances. That means you will not be able to export a regular ec2 instance to Virtual Machine Image.

In this guide we will create a Virtual Machine image in Ova format in our local server and import it to AWS. There are few things that I have tried and failed.

I tried to use the official Virtual Image provided by Canonical and importing it in to AWS. But did not work. Then I tried to download it (the VM image) to my local machine and to create a VM using virtual box. It did work either

Requirements:-


  1. aws cli configured in your local computer
  2. VirtualBox
Create a virtual machine in your local computer
This is a pretty simple step. You just have to download iso image from ubuntu official repo and create a virtual machine with VirtualBox. Then in VirtualBox menu go to File->Export Appliance and Export the VM to ovf format. I have exported my vm as ubuntu_vmi.ova

Upload Ova Image to S3
Once the export is completed. Create a s3 bucket in AWS S3. I have created a bucket named ubuntuvirtualmachineimages. Then copy local ubuntu_vmi.ova to that bucket using aws cli.

Code:
Please, Log in or Register to view codes content!

This would take some time to upload

Creating Amazon Machine Image from Ova Image
1.Create trust-policy.json
Code:
Please, Log in or Register to view codes content!
You can do the same visually with IAM AWS Console, in Roles tab
2.Create role-policy.json. You have to replace <YOUR_S3_BUCKET_NAME> with your bucket name.
Code:
Please, Log in or Register to view codes content!
4.Attache policy to role
Code:
Please, Log in or Register to view codes content!
5.Create containers.json
Code:
Please, Log in or Register to view codes content!
Import the Image
Code:
Please, Log in or Register to view codes content!
Check Status of the task
Code:
Please, Log in or Register to view codes content!

 
Relate Threads

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Top Posters of the Month

Online statistics

Members online
119
Guests online
651
Total visitors
770
Top