My previous “Overview” article covered Networks and the services available in Azure regarding networking. This article is going to cover Virtual Machines, the main resource in Azures “Compute” offering. As with networks, Virtual machines are a huge part of Azure and are consistently one of the top 5 most used Azure resources.
This article will not cover how to create VMs in Azure, instead it will discuss what is possible with VMs, the settings, the creation options along with any other information I feel is important regarding Virtual machines with some helpful tips along the way.
Azure Virtual machines allow you to create flexible virtualized machines without the need to purchase and maintain physical hardware. VMs in Azure can be used for many reasons such as development servers, production app servers or even servers user to extend your current on-premises environment into the cloud.
Before creating a VM, you need to decide what Operating system it will be running. Azure offers multiple images for the more common operating systems used in production. The Azure marketplace offers Windows Server, Ubuntu, and Linux Red Hat, CentOS, SQL Server, Windows 10 and many other operating system options. The full list of available images can be found here.
Instead of using a pre-created image from the Azure marketplace, you can instead create a VHD image of your own and upload it to Azure to be used for VMs.
Cloudy Tip: Only the 64-bit versions of an Operating system is supported in Azure.
When provisioning On-premises servers, hardware requirements are based on the workload and performance needs of the server. Azure VMs are no different, depending on the workload you wish to run on VMs you will need to decide what memory, processing power and storage capacity a VM is configured with. In Azure this is commonly known as a VM size and Azure offers many sizes to support various workloads.
Sizes are split into types such as: General purpose, Optimized, Memory optimized, Storage optimized, GPU or High performance compute. Each size type have different series within them.
General Purpose sizes are the sizes used for basic function servers, a Standard_B1s (B Series) VM will be configured with 1 GB memory and 1 vCPU. Whereas other size options such as the H series allow up to 224GB memory and 16 vCPUs.
Each Series offer different specs for Memory, vCPUs and IOPS so it all depends on what exactly you want the VM to do as with any server hardware provisioning. To view all the sizes please check here.
Cloudy Tip: Azure charges an hourly price based on the VM’s size and operating system. For partial hours, Azure charges only for the minutes used. Storage is priced and charged separately.
Azure VMs have one OS disk and a temporary disk for short-term storage. If needed, you can attach additional data disks. The type of storage and the number of disks allowed is set by the size of the VM.
You can set the OS disk type to either Premium SSD, Standard SSD or Standard HDD. This will depend on what you are using the VM for and the performance targets you have.
Once an OS disk has been set, you can then add additional data disks as needed, you can use the same types as the OS disk but you also have the options to specify disk name, Size in GiB and source type which can be empty, snapshot or storage blob.
Without networking, a VM cannot do much at all. In order for a VM to operate correctly and be managed effectively, it will need to have connections. Sometimes these connections may be to other servers, appliances, Azure resources or out to the internet.
When you create a VM, Azure will create and attach a Network Interface Card (NIC) for you. The attached NIC allows you to connect the VM to a specific VNet or subnet along with any Public IP addresses the VM needs.
Other Azure networking services can be used with VMs such as load balancers, traffic managers and remote gateways depending on your architectural requirements.
Cloudy Tip: Ensure you design and create any Network or subnets before you start creating VMs otherwise when you create a VM it will be more difficult.
By default, Access to VM is restricted to sources in the same VNet. When creating a VM you can choose specific ports to open when creating the VM. The ports you can open are: HTTP (80), HTTPS (443), SSH (22) and RDP (3389).
These port settings are useful as most admins may want to manage their VMs via SSH or RDP depending on the OS. Therefore you will need to relevant ports open. Ports can be opened or closed at any time once a VM has been created.
Cloudy Tip: IF you want to ensure certain servers are as secure as possible, such a SQL servers. Remember to leave the ports closed. Only open p[orts if they are needed otherwise the attack surface area of the machine is much larger.
Management / Connectivity
Once a VM is created and in production, as an admin you will need the ability to manage the server. A lot of management tasks can be done from within Azure, however if you need to manage the OS itself then you will need to access the machine.
The easiest method of accessing the machine is remotely, once a Windows server has been created you can select the option to “Connect” in Azure and it will download a RDP file allowing you to login with the credentials you set at creation. SSH can be used for connecting to Linux machines.
Another way you can manage a VM in Azure is via the new Windows Admin Centre launched with Server 2019. That allows you to add Azure servers and manage them as well as traditional on-premises servers.
Using extensions, you can add additional VM configuration, agents, scripts or applications.
You could use some of the built in extensions from Azure for installing anti-virus, installing monitoring agents and automation agents. It is also possible to create your own scripts and use them for the VM.
Using extensions correctly can greatly improve the provision time of a VM, by using custom scripts you can automatically install roles and setup apps using a script that runs on creation. Allowing admins more time for other tasks. Extensions also ensure that multiple VMs and the exact same configuration.
The cost of running an Azure VM depends on a number of factors. The largest cost usually comes from the license for the OS, However if you already own OS license, you can use them in Azure and it can amount to a very large discount.
VM Size and Disk Type (SSD/HHD) are also taken into account when creating VMs.
Cloudy Tip: If you use the portal to create a VM, on the final “Review + Create” tab it will display the cost of the VM per Hour.
Provisioning and managing servers have never been so easy thanks to Azure. Regardless of your job role, if you work with Azure you will more than likely work with VMs. This article is not a full detailed overview but it does cover the main sections and settings of a VM. With the knowledge above you should be able to at least create a VM and understand each setting.
In a later post I will cover more advanced Azure Virtual machine options such as Availability sets and Virtual machine scale sets.
For further reading I would recommend this Official Microsoft Article.