Virtualization
Virtualization is the process of creating a software-based, or "virtual" version of a computer, with dedicated amounts of CPU, memory, and storage that are "borrowed" from a physical host computer—such as your personal computer— and/or a remote server—such as a server in a cloud provider's datacenter.
Virtual Machine
A virtual machine is a computer file, typically called an image, that behaves like an actual computer. It can run in a window as a separate computing environment, often to run a different operating system—or even to function as the user's entire computer experience—as is common on many people's work computers. The virtual machine is partitioned from the rest of the system, meaning that the software inside a VM can't interfere with the host computer's primary operating system.
Benefits of using VMs:
Because of their flexibility and portability, virtual machines provide many benefits, such as:
Cost savings—running multiple virtual environments from one piece of infrastructure means that you can drastically reduce your physical infrastructure footprint. This boosts your bottom line—decreasing the need to maintain nearly as many servers and saving on maintenance costs and electricity.
Agility and speed—Spinning up a VM is relatively easy and quick and is much simpler than provisioning an entire new environment for your developers. Virtualization makes the process of running dev-test scenarios a lot quicker.
Lowered downtime—VMs are so portable and easy to move from one hypervisor to another on a different machine—this means that they are a great solution for backup, in the event the host goes down unexpectedly.
Scalability—VMs allow you to more easily scale your apps by adding more physical or virtual servers to distribute the workload across multiple VMs. As a result you can increase the availability and performance of your apps.
Security benefits— Because virtual machines run in multiple operating systems, using a guest operating system on a VM allows you to run apps of questionable security and protects your host operating system.
Prerequisite to Deploy a VM in Azure
Well, its obvious that you need an Azure subscription and enough administrator permissions to deploy resource groups, virtual networks, and virtual machines.
Steps to Deploy VM
Navigate to https://portal.azure.com. On the portal homepage, click Create a resource, select Compute, then Virtual machine.
In the Basics tab , fill the following information
Select the Subscription to charge the cost of resources against
Select an existing resource group or create a new one
Name the virtual machine
Select a region to host the virtual machine and its resources
For availability options, this is just a demo virtual machine, so no redundancy is required
For the image, I'm selecting Ubuntu Server 20.04, but you can choose any operating system you need.
For the size, I am choosing the smallest as possible to limit the cost of VM.
Now it's time to set up the account. enter the username and password. (you can also use SSH, but I am using password for now)
In the Disks tab. We need to select the Disk and it's type. I'll change the OS Disk Type to Standard SSD just to save cost of the Resource.
In the Networking tab. For now, I don't have any existing virtual networks. I'm going to keep this all at the defaults, including a public IP address so I can access my virtual machine directly over the Internet.
In the Management tab. I disabled boot diagnostics. as I don't want to capture serial console output and take screenshots of the virtual machine to help diagnose startup issues.
Finally, in the Advanced tab, there is nothing to configure here for now. The same goes for the Tags tab.
Skip over to the Review + create tab and verify it passes validation. If it does, select Create at the bottom.
Once the deployment is complete, you will see the different resources that are created on your resouces.
Virtual network that currently has a single subnet configured
The virtual machine compute resource
Public IP address for the virtual machine
Network security group that currently allows port 22 for SSH
A separate network interface that attaches to the virtual network
Operating system disk
Selecting the virtual machine, in the top overview section there you can see the current public IP address so I can connect to the virtual machine directly. Here my public IP is 52.172.51.114:
You can connect to your virtual Machine (VM), by either the terminal or by using connect button. Here I am connecting to my VM using my Terminal.
ssh <username>@<IP address>
As you can see, we are successfully deployed an Linux VM on Azure. To avoid excess charges, I would suggest deleting the virtual machine when not in use.