DEV Community

Cover image for How to manage virtual machine in Azure.
EMMANUEL
EMMANUEL

Posted on • Edited on

How to manage virtual machine in Azure.

A Virtual Machine (VM) is a software-based computer that runs an operating system (OS) and applications, just like a physical computer. The key difference is that a VM is hosted on a physical server and managed through a virtualization layer called a hypervisor. In simple term, A virtual machine is a computer inside a computer.

To manage the virtual machine, With the network settings updated to support segmenting the Linux virtual machine, you’re ready to manage the virtual machine itself. The first thing the Azure admin asks you to complete is moving the virtual machine to the new subnet you created in when updating the virtual network. Then secondly to vertically scale the virtual machine. Next is to attach data disks to the virtual machine and finally configure automatic shutdown on a virtual machine.

Move the virtual machine network to the new subnet
To move the virtual machine to the new subnet, follow these steps:

1.Login to Microsoft Azure at https://portal.azure.com

Login azure portal

2.From the Azure portal home page, in the search box, enter virtual machines

Virtual machine

3.Select virtual machines under services. Select the guided-project-vm virtual machine

Guidedprojectvm

4.If the virtual machine is running, select Stop.

Stop the virtual machine

5.Wait for the Status field to update and show Stopped (deallocated)

Deallocation

6.Within the Networking subsection of the menu, select Network settings

Networking

7.Select the Network interface / IP configuration hyperlink for the VM

Network interface

8.On the IP Configurations page, update the Subnet to ftpSubnet

IP configuration

9.Select Apply

Apply

Vertically scale the virtual machine
To vertically scale the virtual machine, follow these steps:

1.From the Azure portal home page, in the search box, enter virtual machines

Virtual machine search

2.Select virtual machines under services. Select the **guided-project-vm **virtual machine

Guided project vm

3.Locate the Availability + scale submenu and select Size

Availability + scale

4.Select a new VM size D2s_v3 for example. (Note: If you don’t see the same size as shown in this exercise, select something similar.

D2s_v3

5.Select Resize

Resize

successful resizing

7.Select Home to return to the Azure portal home page

Home

With the VM scaled up to a more robust processor, it can handle the new role it’s being assigned. However, now the Azure admin realizes that if the VM is going to server as an FTP server, it needs more storage. The Azure admin asked you to attach a new data disk to the VM.

Attach data disks to a virtual machine

1.From the Azure portal home page, in the search box, enter virtual machines

Virtual machine search portal

2.Select virtual machines under services. Select the guided-project-vm virtual machine

Guided project vm

3.Locate the settings **submenu and select **Disks

Disks

4.Select Create and attach a new disk

Create and attach a new disk

5.Leave LUN as default. Enter ftp-data-disk for the Disk name. Leave the Storage type as default. Enter 20 for the Size.

Create and attach hard disk

6.Select Apply to create the new storage disk and attach the disk to the machine.

Apply

7.Select Home to return to the Azure portal home page.

Home

Now the VM has enough storage to handle some uploads. The final thing the Azure admin is concerned about is the cost of running the computer 24 hours a day. The first thing they’ll do every morning is start up the FTP server. However, they’d like you to configure it to automatically shutdown every day at 7 PM Coordinated Universal Time (UTC).

Configure automatic shutdown on a virtual machine
To configure automatic shutdown on a virtual machine, you follow these steps;

1.From the Azure portal home page, in the search box, enter virtual machines

Search portal for virtual machine

2.Select virtual machines under services. Select the guided-project-vm virtual machine

Guided project machine

3.Under the Operations submenu, select Auto-shutdown

Auto shutdown

4.In order to let late uploads finish, set the Scheduled shutdown to 7:15:00 PM. Select Save

Autoshudom time

Succesfully saved changes

Top comments (2)

Collapse
 
stevsharp profile image
Spyros Ponaris

Are there any real benefits to using Azure Virtual Machines instead of Docker containers or Azure Container Apps? Since Microsoft is pushing everything toward containers, is there still a good reason to choose VMs for new projects?

Collapse
 
realcloudprojects profile image
SKILL.SCH

sharp!