Microsoft Azure: How To Create Virtual Machine
Virtual machines are operating systems that emulate the physical operating system. Almost all parts, virtual machines are the same as their physical counterpart, with some exceptions. There is a number of platforms to host your virtual machines on. For example, Microsoft Hyper-V and VMWare are the two major players in the space. Virtual machines can also be hosted on the cloud service, such as Microsoft Azure or Amazon Web Services.
What is Virtual Machine
Virtual machines, aka the guest operating systems, sit on the physical server called the host system, and the piece of software called the hypervisor manages the virtual machines.
To make the concept of virtual machines much easier to understand, let’s go ahead and build out a model. First, we start with our single server, which is our host system.
In our example here, we’re using Ubuntu Server 2018. This server will be been provisioned with the right resources to support the hosted VMs.
The next step is to add in our guest operating systems; these guests may be the same or different operating systems than a host.
Why use Virtual Machine in Cloud Computing
There is a number of benefits to using virtual machines instead of the physical server for each workload. On average, a server that hosts the multiple VMs can reach 50 to 80% utilization, compared to the typical application server that only reaches five to 10% utilization. What this means is that fewer physical servers are required, which reduces purchasing, energy, and maintenance costs.
Virtual machines can also scale according to a workload. If the virtual machine requires more resources, then these resources can either be manually allocated or automatically allocated, depending on the resource in the VM management tools.
The advantages of using virtual machines on the public cloud are numerous. To start, you only pay for the virtual machine while it is running. It can be substantial cost savings if you turn off the virtual machines when they’re not in use. I see this in test and dev scenarios all the time.
VMs are fast and straightforward to set up, even better, when an environment is built, you can template and then rebuild it, or duplicate that environment with the few mouse clicks and Azure virtual machines are highly scalable.
How to create Virtual Machine in Microsoft Azure
Azure virtual machines can be created through an Azure portal. This method provides the browser-based user interface to create Virtual machines and their associated resources. This tutorial shows you how to use the Azure portal to deploy a Ubuntu Server 18.04 in Azure.
If you don’t have the Azure subscription, create a free account before you begin.
Step 1: Log in to the portal and search for a virtual machine.
Type virtual machines in the search. Under Services, select Virtual machines.
Step 2: Add a new virtual machine
Virtual machines page, select Add. You will see the following screen.
Step 3: Fill out all the necessary details.
In the Basics tab, under the Project details, make sure the correct subscription is selected. In my case, it is a Free Trial and then I am choosing already existing Resource group or new Group.
Under Instance details, type azvmmachine for the Virtual machine name and choose (US) Central US for your Region, and then choose Ubuntu Server 18.04 for the Image. Leave the other defaults.
Then choose the size of Standard B1ls (1 vcpu, 0.5 GiB memory (₹301.08/month)). For this demo, it should be enough.
Step 4: Configure Administrator account
I have chosen to authenticate type Password, but you can use SSH as well.
So, write your username and password or username or SSH key.
Step 5: Inbound Port rules
Select which virtual machine network ports are accessible from the public internet. You can specify more limited or granular network access on the Networking tab.
Select Inbound Ports: SSH(22)(It is for testing purpose only)
Step 6: Go to Disks section
Azure VMs have one operating system disk and a temporary disk for short-term storage. You can attach additional data disks. The size of the VM determines the type of storage you can use and the number of data disks allowed.
In Disk Options, select Standard HDD.
Step 7: Go to a Network interface
Define network connectivity for your virtual machine by configuring network interface card (NIC) settings. You can control ports, inbound and outbound connectivity with security group rules, or place behind an existing load balancing solution.
See the following screenshot.
Here, when creating a virtual machine, a network interface will be created for you.
I have already created Virtual Network, and if you do not know how to do it, then check out How to create Virtual Network in Azure guide.
Leave subnet, public ip, NIC security group, public inbound ports, Select inbound ports as it is.
Step 8: Go to Management section
Go to the next Management section. You will see the following screen.
Leave all options as it is and go to the Advanced section.
Step 9: Advanced config for Virtual Machine
In an advanced section, you can add additional configuration, agents, scripts, or applications via virtual machine extensions or cloud-init.
Cloud-init is the widely used approach to customize the Linux VM as it boots for the first time. You can use the cloud-init to install packages and write files or to configure users and security.
Leave all the options as it is.
Inside the tags section, you can create a key-value pair tag.
Finally, click on the Review + Create button.
After reviewing the whole process, click on the Create button.
It will take some time to complete the deployment. So please patiently wait to be completed.
Now, go to the resource group, and you will see something like this.
So, it has created the following 5 things.
- Virtual Machine
- Public IP Address
- Network Security Group
- Network Interface
Now, go to azvmmachine. You will see the following information.
So, we have created our Microsoft Azure Virtual Machine.
One of the main functions of cloud computing services like Microsoft Azure is the creation, deployment, and management of the virtual machines. With the right cloud computing tools in hand, an enterprise can create dozens, hundreds, even thousands of virtual machines at will, and then decommission them in an instant when they are no longer useful.
In this tutorial, we have seen how to create a virtual machine in Azure, how to create network interface, disk management, admin account creation, etc.
Finally, Microsoft Azure: Create Virtual Machine tutorial is over.