Difference between revisions of "Manual:CHR GCE"

From MikroTik Wiki
Jump to: navigation, search
(Created page with "RouterOS CHR supports Google Compute Engine since introduction of VirtIO-SCSI driver in version 6.42RC38. Launching your RouterOS in Google Compute Cloud requires a few modif...")
 
m
Line 10: Line 10:
  
 
Expand the image size to 1GB
 
Expand the image size to 1GB
  truncate --size=1G chr-6.37.2.img
+
  truncate --size=1G chr-6.42rc30.img
  
 
Create the image archive for Google GCE
 
Create the image archive for Google GCE
  mv chr-6.37.2.img disk.raw
+
  mv chr-6.42rc30.img disk.raw
  tar -Sczf chr-6.37.2-image.tar.gz disk.raw
+
  tar -Sczf chr-6.42rc30-image.tar.gz disk.raw
  
 
Create a bucket to store image archives
 
Create a bucket to store image archives
Line 20: Line 20:
  
 
Copy the new image to the bucket
 
Copy the new image to the bucket
  gsutil cp chr-6.37.2-image.tar.gz gs://cloud-hosted-router-images
+
  gsutil cp chr-6.42rc30-image.tar.gz gs://cloud-hosted-router-images
  
 
Create an image for GCE from the archive
 
Create an image for GCE from the archive
  gcloud compute images create "chr-6-37-2" \
+
  gcloud compute images create "routeros" \
 
  --family=cloud-hosted-router \
 
  --family=cloud-hosted-router \
 
  --description "Mikrotik Cloud Hosted Router (CHR) is a RouterOS version intended for running as a virtual machine." \
 
  --description "Mikrotik Cloud Hosted Router (CHR) is a RouterOS version intended for running as a virtual machine." \
  --source-uri "https://storage.googleapis.com/cloud-ho ... age.tar.gz"
+
  --source-uri "https://storage.googleapis.com/cloud-hosted-router-images/chr-6.42rc30-image.tar.gz"
  
 
Create an instance
 
Create an instance

Revision as of 12:30, 22 February 2018

RouterOS CHR supports Google Compute Engine since introduction of VirtIO-SCSI driver in version 6.42RC38. Launching your RouterOS in Google Compute Cloud requires a few modifications to the default RAW Disk image, because Google only allows disk images in 1GB size increments. The following instructions assume you have installed Google Cloud Console CLI tools, but you can do the exact steps from the Google Cloud Console in your web browser, via the GUI, if you don't like to install the CLI tools.

Download the raw disk image archive from Mikrotik

wget https://download2.mikrotik.com/routeros/6.42rc30/chr-6.42rc30.img.zip

Unzip the archive

unzip chr-6.42rc30.img

Expand the image size to 1GB

truncate --size=1G chr-6.42rc30.img

Create the image archive for Google GCE

mv chr-6.42rc30.img disk.raw
tar -Sczf chr-6.42rc30-image.tar.gz disk.raw

Create a bucket to store image archives

gsutil mb gs://cloud-hosted-router-images

Copy the new image to the bucket

gsutil cp chr-6.42rc30-image.tar.gz gs://cloud-hosted-router-images

Create an image for GCE from the archive

gcloud compute images create "routeros" \
--family=cloud-hosted-router \
--description "Mikrotik Cloud Hosted Router (CHR) is a RouterOS version intended for running as a virtual machine." \
--source-uri "https://storage.googleapis.com/cloud-hosted-router-images/chr-6.42rc30-image.tar.gz"

Create an instance

gcloud compute instances create "chr-1" \
--zone "us-central1-c" \
--machine-type "f1-micro" \
--image-family=cloud-hosted-router

macOS specifics

Please note, that when using macOS, you will need to install gnu-tar and truncate via Homebrew. See above as to when the respective commands must be used.

For truncate:

brew install truncate
truncate -s 1G chr-6.42rc30.img

For gnu-tar:

brew install gnu-tar
gtar -Sczf chr-6.42rc30.tar.gz disk.raw