Quick way to migrate vm to AWS

综合技术 UX Techno (源链)

In my earlier post we have seen how to create free server on AWS . What if you want to migrate your on premises vm to AWS. This article will quickly guide you about how to migrate vm to AWS.

How to migrate vm to AWS

There are couple of steps you need to follow to migrate vm to AWS. However I will suggest you to go through these pre-requisites before you migrate vm to AWS.

Step 1: Install AWS Command line interface. Please follow thisarticleto perform the installation.

Step 2: Create user in AWS with programmatic access. For this login to AWS console and go to IAM under “ Security, Identity & Compliance ” service. Click on User on the left pane. Then click on Add user button to create AWS user. In the next window use suitable user name and select “ Programmatic access ” option. Click on Next:Permissions button. Then select “ Attach existing policies directly ” options and select “ AdministratorAccess ” policy under policies options. Click on “ Next:Review ” button to review the setup. At the end select “ Create user ” option to create AWS user. In the next window you will see “ Access key ID ” and “ Secret access key ” which are required for configuration. You can also download it as CSV file.

Step 3: Configure AWS user in command line inter face. Follow below commands to configure AWS CLI.

aws configure

System will ask you about Access Key ID and your Secret Access Key. Also it will ask you about default region. Kindly input the keys captured in previous step.

To confirm the configuration, create sample security group using below command:

aws ec2 create-security-group --group-name uxtechno -- description "UxTechno group"

If you got new security group created then, you have successfully configured aws cli with user created.

Now you are good to go with further configuration.

Take vm backup using ovf method and upload to S3

Step 4: Take the ovf backup of the vm. That’s pretty straightforward. After backup is complete you will get one OVF file and vmdk file.

Step 5: In the next step you need to create S3 bucket in AWS and upload this vmdk file inside this bucket. Kindly follow below articles to perform the same:

Please note that, we have uploaded vcf file “rhel-disk1.vmdk” inside the bucket called “aws-import-dir” same has been used during the step 7.

Step 6: Create IAM role with name vmimport which will have access to this bucket.

aws iam create-role --role-name vmimport --assume-role-policy-document file://trust-policy.json

Make sure create following “trust-policy.json” file for this under same directory for this role creation.

  • trust-policy.json file contents:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": { "Service":"vmie.amazonaws.com"},
             "Action": "sts:AssumeRole",
            "Condition":{
 "StringEquals":{
 "sts:Externalid":"vmimport"
 }
            }
        }
    ]
}

If everything is Ok system responds with below message:

Actual step to migrate vm to AWS

Step 7: In this command we will import this vmdk file on aws using below command:

aws ec2 import-image --cli-input-json "{ "Description": "my linux image","DiskContainers": [ {"Description": "my linux image","User Bucket":{ "S3Bucket":"aws-import-dir" ,"S3Key" :"rhel-disk1.vmdk"}}]}"

You get output similar to below if all things are Ok.

Please make sure you note down the import id which is “ import-ami-fgmcdnjz ” in this case. This import can be used to check the status of import activity and can be checked with below command:

aws ec2 describe-import-image-tasks --import-task-ids "import-ami-fgmcdnjz"

After this you can able to snapshot backup in AWS console within few seconds as below:

Then after few minutes you can able to check the AMI image successfully created in console as below:

您可能感兴趣的

The Dawn of a New Networking Era Preface: I recently attended a Tech Field Day event (Tech Field Day Extra – Cisco Live 2017) and while the event is put on my Gestalt IT, I was not p...
当安全团队在寻求解决方案的时候,他们在寻找什么?... 虽然我们很难准确地指出信息安全市场的确切规模,但可以肯定的是,即其规模日渐增长。无论是对人力、过程,还是技术方面的投资,在未来的几年都将继续增长。但是,对于所有这些投资,如果你问一些安全购买者在找什么样的方案或产品,其中的多数可能会说还没有找到正在找的东西。 信息安全市场由大量的厂商以及子...
S3 Storage Classes in AWS S3 Standard– this class offers: Durability of 99.999999999% across multiple AZs – three minimum Low latency Resilient in the eve...
Celebrating Three Years of PIE on Pi Day Paragon Initiative Enterprises got its name on March 14, 2015. How have things changed in three years? Why PIE? We started our company in part bec...
A Week of Data Breaches: Millions of records leake... Welcome to The Dashlane Tech Check for September 8, 2017! I’ll help you catch up on Dashlane news and the biggest headlines in the tech and inform...
UX Techno责编内容来自:UX Techno (源链) | 更多关于

阅读提示:酷辣虫无法对本内容的真实性提供任何保证,请自行验证并承担相关的风险与后果!
本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » Quick way to migrate vm to AWS



专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录