Virtual Machine Planning – Azure Virtual Machines

The following decisions or aspects of the VM should be evaluated during the virtual machine planning:

  • Virtual network
  • Name
  • Location and pricing
  • Size
  • Storage
  • Operating system

Let’s take a deep dive into each of the aforementioned factors and understand their relevance in the planning.

Virtual Network

As you read in Chapter 3, “Virtual Networking,” before deploying a virtual machine, you should plan a virtual network from which the VM gets the private IP address. In other words, a virtual network facilitates private connectivity between your virtual machines and other Azure services.

You should be planning the virtual network and subnets based on the number of hosts required. Changing the virtual network configuration at a later point is a management overhead. Therefore, always plan your virtual networks and subnets before deploying the virtual machine.

Name

Some organizations don’t pay much attention when it comes to the naming of the VM, or in fact any resource in Azure. The VM name will be used as the computer name or host name for the VM you are creating. For a Windows VM, it can be up to 15 characters, and Linux VMs can support up to 64 characters.

The reason you need to pay attention to the naming is because this can’t be changed once the VM is deployed. A workaround is to redeploy the VM with the desired name. To avoid the redeployment, you will define the name of the VM wisely. It’s a good convention to add the following details to your VM name:

  • Environment: This is used to identify the environment the resource belongs to. Examples are dev, qa, uat, prod, etc.
  • Location: Including the location in the name helps you understand the VM location by looking at the name. For example, eus is for East US, wus is for West US, ci is for Central India, etc.
  • Role: You can add the role of the VM. For example, use db, web, messaging, etc.
  • Application: If you have an application name, add the name of the application. Examples include payroll, website, registration, etc.
  • Instance: If you have multiple instances created to improve the high availability, then start numbering them as 01, 02, etc.

Combining these details, if you use the VM name payroll-prod-eus-db-01, you can clearly understand that the VM is running the database for the payroll application that is deployed in the East US production environment, and this is instance 1. Also, when you are exporting the usage details of your subscription, you will be easily able to identify the cost by using the VM names.