This is an old revision of the document!


What is Azure?

Azure is Microsoft's cloud service. The main objective is to make it possible for any company building services on the Internet to develop their business and scale without making a huge initial investment. While Microsoft offers their own technologies, a big part of the world doesn't so they have full interest in supporting the alternative unix-ish technologies that make up the Internet today. Not unlike other cloud providers, from the point of view of a FreeBSD user, Azure is a “virtual” hardware provider: they have huge clusters around the world and without you worrying about disk failures or temperatures you make use of them for a fee.

Azure constantly evolving and and while you still find references to the “Classic” VMs, most services have been migrated to the Portal.

How is FreeBSD supported?

Microsoft has invested in porting their virtualization support (Hyper-V) for FreeBSD. Starting with FreeBSD-10 support for Hyper-V is included in the main tree. Starting with 10.3, Microsoft offers FreeBSD directly as a Virtual Machine option so you do not have to go through the process of building your own Virtual Machine.

What can I do with it?

There are many uses for a cloud machine. Initially you should keep in mind that you don't really get a superuser “root” account, but you rather end up administering the machine through sudo. This environment is ideal for using jails and delivering personalized services. Setting up a proxy with squid and privoxy in one jais and a webserver or a database in other jail works fine and saves resources hugely in a cheap VM.

What do I need?

* You need to have an account with the Microsoft Azure service: generally there are free trial accounts and if you are a MSDN subscriber you may already have access.

* You may want to use the Azure CLI. This is JavaScript (node.js) application so it is possible to do this from FreeBSD. Unless you want to automate things, most things are much easier to do through the portal though.

* Once you are in the portal look for the “Virtual Machines” blade and select the Add (+) button. tyhis will bring you to “Create a virtual machine”.

* For a FreeBSD image go to INSTANCE DETAILS and select “Browse all images and disks”. This will take you to a new page where you can search for FreeBSD by name. Select the most recent version you can find.

* Select carefully the size of the VM: while all sizes are likely to work well with FreeBSD, and the size depends on both the type of service and the your budget you wnat to be clever to get the most from your money. As a rule of thumb you want to use SMP, so at least choose two VCPUs with sufficient memeory for your purposes.

* In INBOUND RULES select “Allow selected ports”, this will allow you to use SSH to connect to the machine and configure services.

* Microsoft is rather conservative when updating VM images so it is likely you will not find the latest and greatest version of FreeBSD readily available you will have to do and initial update with FreeBSD-update(8). At least a simple, minor, update to the latest patchlevel is highly recommended for security. After rebooting, a pkg-upgrade(8) is also really a good idea.

* Once a minor update is done you will likely want to do a major update to the latest FreeBSD release. I highly recommend backing up your latest working configuration. Also, installing the tmux package and configuring your favorite text editor as a default are good ideas. If things go very wrong you may lose SSH access: in such cases the “Reset Remote Access” Option in the Virtual Machine home may be your saver.

This section is kept for reference: creating your VM through the Marketplace is the preferred option

Using an image from the VM depot used to be the best option before 10.3: Microsoft's Ross Gardler did an excellent tutorial [2].

If you still need this for some reason, some tricks to have in mind:

- Before transferring the image. You are likely to have to create a *classic* storage resource in your region. This is most easily done through the portal.

- You may have to go into the classic Azure-SwitchMode: azure config mode asm.

- Once up and running: freebsd-update(8) and pkg(8) upgrade are your friends.

Building your own image has the advantage of letting you do some initial customization with a virtualization engine. VirtualBox works fine with VHD images. The obvious disadvantage is that it will take some time to upload big images if you are in a slow network.

If you follow the tutorials from Microsoft employees keep some tricks in mind:

- You can build the image with a virtualization tool different that Microsoft's Hyper-V but you still will need the Azure CLI.

- There is actually no need to use wget on FreeBSD: You can use fetch(1) or even better, you will notice the python agent required by Azure is already in the ports tree so you can install it with pkg(8).

- Try to keep you images small so that uploading them won't take too long. Once uploaded, the networking is fast enough that you can use pkg(8).

References:

[1]Running FreeBSD in Azure

[2]Deploy and Customize a FreeBSD Virtual Machine Image on Microsoft Azure

[3]MS-OpenTech VM Depot

[4]How to install the Azure CLI

[5]Use and Commands available in the Azure CLI

[6]Creation and upload of a VHD with a Linux-based OS


CategoryVirtualization

  • microsoftazure.1544716975.txt.gz
  • Last modified: 2018/12/13 16:02
  • by PedroGiffuni