Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 15394

Virtualization • While we wait for a stable AWS CHR for t3 instances

$
0
0
If you build your own AMI on AWS there are no issues upgrading / downgrading the CHR.

The current documentation (https://help.mikrotik.com/docs/display/ ... HR+7.6+AMI) assumes you know how to create trust policies and roles on AWS. I think that can be quite intimidating for most users.

Below is a step by step including the JSON files required to spin up a CHR with a custom AMI that does not suffer from the current issues on T3 instances.

-------
Download the json files attached to this post (awsFiles.zip).

Create S3 bucket called "chr-tester", given that bucket name is now taken you will need to rename that bucket in these files:

mikrotik-routeros-chr-7142-raw-containers.json
role-policy.json

##Next Download the raw image (if other version change files):
https://cdn.mikrotik.com/routeros/7.14. ... .2.img.zip

##unzip and upload to the bucket:
chr-7.14.2.img

##Open a cloud shell (access EC2 and click the cloud shell icon top right)
##Upload by clicking "Actions-> Upload File" in the cloudshell window. upload:

mikrotik-routeros-chr-7142-raw-containers.json
aws-import-snapshot-mikrotik-chr-7142.sh

##dont change the version, its not your version but an amazon thing. upload:
trust-policy.json
role-policy.json

##Run as command in the cloud shell:
aws iam create-role --role-name vmimport --assume-role-policy-document file:///home/cloudshell-user/trust-policy.json

##Run as command in the cloud shell:
aws iam put-role-policy --role-name vmimport --policy-name vmimport --policy-document file:///home/cloudshell-user/role-policy.json

##Then, run as command in the cloud shell:
bash /home/cloudshell-user/aws-import-snapshot-mikrotik-chr-7142.sh import-snapshot

##Get ImportTaskId from the import job, e.g.:
"ImportTaskId": "import-snap-65467756756765"

##Monitor the job, replace "import-snap-65467756756765" with your job ID:
bash /home/cloudshell-user/aws-import-snapshot-mikrotik-chr-7142.sh monitor-import import-snap-65467756756765

##wait for "StatusMessage": "snapshot completed"
##Then Ctrl + C to exit

##Get SnapshotId:
"SnapshotId": "snap-54654756878568"

##Run as command in the cloud shell, replace "snap-54654756878568" with your job ID:
bash /home/cloudshell-user/aws-import-snapshot-mikrotik-chr-7142.sh register-image snap-54654756878568

##Get the AMI image ID:
ImageId": "ami-36547567578657"

To launch a new CHR instance, access EC2->images->amis (replace ami-36547567578657 with your ami image id)
Select "ami-0aa83a70a47ce011b"

Statistics: Posted by merlinthemagic7 — Mon Apr 01, 2024 1:15 pm



Viewing all articles
Browse latest Browse all 15394

Trending Articles