Lately while doing some kind of homework for my master's degree I wanted to try something which I haven't done in a long time. So I bough a virtual machine on Microsoft Azure using their pay-as-you-go billing scheme.
I forgot how easy it was and useful is to do this, so I decided to write this simple tutorial. If you just want an extra machine to use from time to time with a bit of power this is the way to go. People that do 3D graphics and stuff can benefit a LOT from this. Imagine having a 16 core powerhouse at your disposal. Actually the people at Azure made some dedicated cloud services just for rendering. Currently only Maya and 3D Max are supported. You can find more information about the service here: https://rendering.azure.com/
Their pay-as-you-go billing scheme is brilliant. You just pay the time the virtual machine is online. When you don't need it anymore you just can stop it and you won't be billed anymore.If you don't use it that often it is actually pretty cheap per hour, something like 0.2 euros for a quad core machine. If you don't want to use it anymore, you just stop it and that's it. If you need it again you just start it again. If you make any changes to the operating system on the virtual machine like installing some new programs, they will be saved when stopping and starting the virtual machine.
One thing to remember is the fact that a virtual machine must be stopped and deallocated in order not to bill you. A virtual machine can be stopped without being deallocated and it will still bill you. Also I am not too sure that you won't be billed a small fee even if the machine is deallocated. There are still some resources like disk space, network IP and so on which are still used.
So how do you create your own virtual machine in Microsoft Azure? It is very simple actually. Just login into the Azure portal at the address: https://portal.azure.com/
Once logged in the portal, click on the hamburger menu on the top left corner and a list of possible actions will expand on the left like in the screenshot bellow:
In my example I already have 2 machines created that you can see in the list. To add a new machine just click on the Add button above the virtual machines list.
A new list with supported operating systems will appear. I recommend using either a Linux distribution or a Windows Client machine because they are a bit cheaper and do pretty much around 95% of what you really need.
Once you click an operating system a new form will appear on the right side to select a version of the operating system like bellow. In my case I used Windows Client
Once you click on the operating system version you will be prompted with a license agreement that you have to agree with which I won't be posting here.
After that a new page will appear which has some steps about how to configure the virtual machine. The first step is just about the name of the machine, if it has a SSD or HDD (I recommend a HDD to save some money, don't need SSD for this). One important detail here is the region which I recommend of course to be as close to you as possible.
After you click OK on the bottom you will move to the next step.
At step 2 you need to select how powerful you want your virtual machine to be. This list initially contains just one machine type like bellow. You need to click on the View All button too see all the possible machine types:
I recommend getting a slower machine in the beginning.
Once you made up your mind, just click on the machine type you want and the select button bellow will become available. Click it to move to the next step.
At step 3 you can configure some basic things about the machine. I recommend here selecting a public static IP address like in the screenshot bellow:
Click on the Public IP Address setting. A new frame will appear on the right from which you can select an existing public IP address or create a new one. Click on Create New to add a new one. I recommend to use a static IP address instead of dynamic IP address. When you restart a virtual machine it will get a new address if you haven't selected a static IP address at this step.
If for example you actually want to run some background workers on this machine from an external environment other than Azure you might need to update the IP address each time if it's not static. For example you can host some web services and the consumer of the services might crash because the address of the services has changed.
Or you can event host a website on a virtual machine. If you have a static IP address you can register a domain name and enter that IP address. On the virtual machine you just need to set up your website and it will work with the registered domain name. Of course you might need more than this like a database and various other services. Actually a website hosted on Azure is just this, a virtual machine with a public static IP set up for you and a preconfigured web server.
Back on track. Once you click OK bellow the settings pane you will move to the final step which is pretty much just a summary of the virtual machine options you selected like in the pictures bellow:
Once you click OK your machine will start to be created also known as provisioning.
It will take a while for it to be created. You will be moved back to the list of virtual machines that you have but this time it won't be empty. You can see the status of the virtual machine will be creating.
After a while, around 20 minutes the virtual machine will become available. This is kind of an disadvantage but it happens just the first time you do this.
Once the machine is allocated and it has the status Running you can log remotely on to it. This is only the case if you use a Windows Client. I actually don't know how the Linux based virtual machines work.
To connect just click on the 3 dots to the right of the virtual machine entry in the list of virtual machines. A new menu will appear with some options like bellow:
Once you click connect, a new file will be downloaded immediately which will be opened with the Remote Desktop Connection Client.
After you open it a new window will appear requesting your password that you configured in the configuration pane at step 1.
When the remote desktop connection is established you can see on the connection bar the actual public IP of your cloud machine.
And that's about it. You have now a new PC on the cloud on Azure with which you can do whatever you want. Remember, you need to have pay-as-you-go subscription enabled on your account.
This is just a manually create and allocated machine for when you need it. You can actually dynamically create new machines as you need them or as your website or service needs them. I think they are hidden behind a load balancer. So the public IP will be that of the load balanced. You can configure to trigger the creation of new machines behind the load balancer once the existing machine reach a given usage. I am not too sure about this though. I am just saying what I heard and understood from other people. But I am 100% sure you can have a load balancer and configure it with a number of virtual machines.
I forgot how easy it was and useful is to do this, so I decided to write this simple tutorial. If you just want an extra machine to use from time to time with a bit of power this is the way to go. People that do 3D graphics and stuff can benefit a LOT from this. Imagine having a 16 core powerhouse at your disposal. Actually the people at Azure made some dedicated cloud services just for rendering. Currently only Maya and 3D Max are supported. You can find more information about the service here: https://rendering.azure.com/
Their pay-as-you-go billing scheme is brilliant. You just pay the time the virtual machine is online. When you don't need it anymore you just can stop it and you won't be billed anymore.If you don't use it that often it is actually pretty cheap per hour, something like 0.2 euros for a quad core machine. If you don't want to use it anymore, you just stop it and that's it. If you need it again you just start it again. If you make any changes to the operating system on the virtual machine like installing some new programs, they will be saved when stopping and starting the virtual machine.
One thing to remember is the fact that a virtual machine must be stopped and deallocated in order not to bill you. A virtual machine can be stopped without being deallocated and it will still bill you. Also I am not too sure that you won't be billed a small fee even if the machine is deallocated. There are still some resources like disk space, network IP and so on which are still used.
So how do you create your own virtual machine in Microsoft Azure? It is very simple actually. Just login into the Azure portal at the address: https://portal.azure.com/
Once logged in the portal, click on the hamburger menu on the top left corner and a list of possible actions will expand on the left like in the screenshot bellow:
In my example I already have 2 machines created that you can see in the list. To add a new machine just click on the Add button above the virtual machines list.
A new list with supported operating systems will appear. I recommend using either a Linux distribution or a Windows Client machine because they are a bit cheaper and do pretty much around 95% of what you really need.
Once you click an operating system a new form will appear on the right side to select a version of the operating system like bellow. In my case I used Windows Client
Once you click on the operating system version you will be prompted with a license agreement that you have to agree with which I won't be posting here.
After that a new page will appear which has some steps about how to configure the virtual machine. The first step is just about the name of the machine, if it has a SSD or HDD (I recommend a HDD to save some money, don't need SSD for this). One important detail here is the region which I recommend of course to be as close to you as possible.
After you click OK on the bottom you will move to the next step.
At step 2 you need to select how powerful you want your virtual machine to be. This list initially contains just one machine type like bellow. You need to click on the View All button too see all the possible machine types:
Once you made up your mind, just click on the machine type you want and the select button bellow will become available. Click it to move to the next step.
At step 3 you can configure some basic things about the machine. I recommend here selecting a public static IP address like in the screenshot bellow:
Click on the Public IP Address setting. A new frame will appear on the right from which you can select an existing public IP address or create a new one. Click on Create New to add a new one. I recommend to use a static IP address instead of dynamic IP address. When you restart a virtual machine it will get a new address if you haven't selected a static IP address at this step.
If for example you actually want to run some background workers on this machine from an external environment other than Azure you might need to update the IP address each time if it's not static. For example you can host some web services and the consumer of the services might crash because the address of the services has changed.
Or you can event host a website on a virtual machine. If you have a static IP address you can register a domain name and enter that IP address. On the virtual machine you just need to set up your website and it will work with the registered domain name. Of course you might need more than this like a database and various other services. Actually a website hosted on Azure is just this, a virtual machine with a public static IP set up for you and a preconfigured web server.
Back on track. Once you click OK bellow the settings pane you will move to the final step which is pretty much just a summary of the virtual machine options you selected like in the pictures bellow:
Once you click OK your machine will start to be created also known as provisioning.
It will take a while for it to be created. You will be moved back to the list of virtual machines that you have but this time it won't be empty. You can see the status of the virtual machine will be creating.
After a while, around 20 minutes the virtual machine will become available. This is kind of an disadvantage but it happens just the first time you do this.
Once the machine is allocated and it has the status Running you can log remotely on to it. This is only the case if you use a Windows Client. I actually don't know how the Linux based virtual machines work.
To connect just click on the 3 dots to the right of the virtual machine entry in the list of virtual machines. A new menu will appear with some options like bellow:
Once you click connect, a new file will be downloaded immediately which will be opened with the Remote Desktop Connection Client.
After you open it a new window will appear requesting your password that you configured in the configuration pane at step 1.
When the remote desktop connection is established you can see on the connection bar the actual public IP of your cloud machine.
And that's about it. You have now a new PC on the cloud on Azure with which you can do whatever you want. Remember, you need to have pay-as-you-go subscription enabled on your account.
This is just a manually create and allocated machine for when you need it. You can actually dynamically create new machines as you need them or as your website or service needs them. I think they are hidden behind a load balancer. So the public IP will be that of the load balanced. You can configure to trigger the creation of new machines behind the load balancer once the existing machine reach a given usage. I am not too sure about this though. I am just saying what I heard and understood from other people. But I am 100% sure you can have a load balancer and configure it with a number of virtual machines.
Comments
Post a Comment