Page 1 of 1

CHR on Azure

Posted: Mon Nov 04, 2019 2:27 am
by jeremyf
I've noted there isn't a lot of up-to-date "CHR on Azure" documentation so I am attempting to create some here.

Maybe someone can copy to: https://wiki.mikrotik.com/wiki/Manual:CHR

It would be optimal for Mikrotik to create an azure marketplace CHR image. That would make this post mostly redundant.

step 1: download CHR vhdx and convert to vhd
example powershell:
Convert-VHD -Path C:\chr-6.45.6.vhdx -DestinationPath C:\chr-6.45.6.vhd -vhdtype fixed

step 2: upload vhd to a blob container:
Upload the VHD file using the Azure Portal.
In the Azure Portal, select Storage Accounts.
  • Select the storage account where the CHR VHD file will be uploaded to.
    Under BLOB SERVICE, select Containers.
    Select a container to upload the CHR VHD file to.
If you do not have a storage container, click Add Container to create one.
Click Upload and select the CHR VHD file to upload.
Ensure that the Blob type is set to Page Blob.
uploadblob.PNG
step 3: 2. Create an image using the Azure Portal.
In the Azure Portal, select "Images". (note this is different than "virtual machines")
Click Add to create a new image.
Give the image a name. Remember that this image is a template that will later be deployed to a virtual machine with a different name.
Ensure that the location is the same as the location of your storage account.
iIn the OS disk section:
Select Linux and the OS type.
Click Browse on the Storage Blob field. A new panel will list your storage accounts. Using this panel, navigate through the storage account and container to locate the CHR VHD that was uploaded.
(os type linux)
(vm generation 1)

Click Create to begin the image creation process. This process typically takes minutes to complete.
When the process has completed, return to the Images panel and verify that the new image was created.

step 4: create the vm
In the Azure Portal, select "virtual machines".
Click Add to create a new VM.
Under image, click "browse all public and private images", and in the "my items tab" you should see the CHR vhd image you created in step 3.
I used the smallest size B1ls.

Note: you will need to set the "enable ip forwarding" parameter in the resulting azure vm network interface.

Note: the azure serial console feature works.

step 5: (optional) create a S2S vpn
note: profiles must have "nat traversal" enabled.
note: you will have to create a route table to direct vnet traffic over the vpn tunnel.

Re: CHR on Azure

Posted: Thu Dec 31, 2020 12:41 am
by webor
Tnx for this guidance! Complete success following it. Only one thing that you are mentioning I can not find: "Note: you will need to set the "enable ip forwarding" parameter in the resulting azure vm network interface."

Re: CHR on Azure

Posted: Fri Feb 19, 2021 9:25 pm
by YourWordIsTruth
Thanks for the step by step, it worked.

Out of curiosity, does anyone know :

1) Why does it take so long to build the image?
2) Does anyone know why Mikrotik has not built an Microsoft Azure Marketplace version of their CHR, I can say there is a demand for it on my end for it?

If they are building on and they need a tester I volunteer :-)