Giter Club home page Giter Club logo

aws-ec2-migrate-onpre-to-aws's Introduction

aws-ec2-migrate-onpre-to-aws ๐Ÿ’ฃ๐Ÿ’ฃ๐Ÿ’ฃ๏ผ๏ผ๏ผ

Stars Issues Forks Report an issue

detail

  1. reference

    youtube

  2. s3

    • create bucket name=n-backup
    • create object name=VM-Import s3
  3. on premis (Oracle VirtualBox)

    • check info & poweroff before migrate onpre
    • click export will output xxx.vmdk export
  4. s3

    • upload xxx.vmdk into n-backup/VM-Import/ upload
  5. IAM role

    • create filename=trust-policy.json
    • create rolename=vmimport
    aws iam create-role --role-name vmimport --assume-role-policy-document "file://trust-policy.json"
    • create filename=role-policy.json
    • attach policyname: vmimport to IAM Role: vmimport
    aws iam put-role-policy --role-name vmimport \
                            --policy-name vmimport \
                            --policy-document "file://role-policy.json"
    • check role: vmimport in AWS:
    1. trusted entities=vmie.amazonaws.com
    2. policyname: vmimport has JSON as role-policy.json policy
  6. migrate

    • create filename=containers.json
    • migrate:
    bucket_name="n-backup"
    # Add the appropriate S3 Prefix to the VM Image
    vm_image_name="VM-Import/xxx.vmdk"
    aws ec2 import-image --description "centosv7" --disk-containers "file://containers.json"
    • will have result with "ImportTaskId": "import-ami-0d6db3a35d431e4e3"
    • check status of VM import jobs, will see result "Status": "completed"
    aws ec2 describe-import-image-tasks --import-task-ids "import-ami-0d6db3a35d431e4e3"
    ->
    {
        "ImportImageTasks": [
            {
                "Architecture": "x86_64",
                "Description": "centosv7",
                "ImageId": "ami-0da97e2296167b5ca",
                "ImportTaskId": "import-ami-0d6db3a35d431e4e3",
                "LicenseType": "BYOL",
                "Platform": "Linux",
                "SnapshotDetails": [
                    {
                        "Description": "centosv7",
                        "DeviceName": "/dev/sda1",
                        "DiskImageSize": 931182592.0,
                        "Format": "VMDK",
                        "SnapshotId": "snap-0dc6d32a5924b22c7",
                        "Status": "completed",
                        "UserBucket": {
                            "S3Bucket": "n-backup",
                            "S3Key": "VM-Import/xxx.vmdk"
                        }
                    }
                ],
                "Status": "completed"
            }
        ]
    }
  7. AMI

    • launch import-ami-xxx ami
    • will have a result migrated EC2 ec2
  • ssh to EC2, check info is the same with before migrated end

aws-ec2-migrate-onpre-to-aws's People

Contributors

tquangdo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.