How to Manage Virtual Machines in Microsoft Azure

How to Manage Virtual Machines in Microsoft Azure

posted Originally published at dev.to 3 min read

Virtual Machines (VMs) serve as the backbone of cloud computing in Microsoft Azure, offering unparalleled flexibility for deploying and managing workloads. Whether you're optimizing resources for cost efficiency, scaling to meet demand, or enhancing security configurations, effective VM management is crucial for any cloud environment.
This step-by-step guide walks you through four essential VM operations in Azure: migrating to a new subnet, vertical scaling, disk management, and configuring auto-shutdown - complete with visual references to ensure you can follow along seamlessly in the Azure portal.

Step 1 Move the virtual machine network to the new subnet

Image description

  • From the Azure portal home page, in the search box, enter virtual machines.
  • Select virtual machines under services.

Image description

  • Select the guided-project-vm virtual machine.

Image description

  • If the virtual machine is running, select Stop.

Image description

Note: In order to make some configuration changes, such as changing the subnet, the VM will need to be restarted. You can request the change without stopping the VM, but Azure will force a restart before completing the change.

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

Image description

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

Image description

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

Image description

  • On the IP Configurations page, update the Subnet to ftpSubnet.
  • Select Apply.

Image description

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

Step 2 Vertically scale the virtual machine

  • From the Azure portal home page, in the search box, enter virtual machines.
  • Select virtual machines under services.

Image description

  • Select the guided-project-vm virtual machine.

Image description

  • Locate the Availability + scale submenu and select Size.

Image description

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

Image description

Step 3 Attach data disks to a virtual machine

  • From the Azure portal home page, in the search box, enter virtual machines.
  • Select virtual machines under services.

Image description

  • Select the guided-project-vm virtual machine.
  • Locate the settings submenu and select Disks.

Image description

  • Select Create and attach a new disk.

Image description

  • Leave LUN as default.
  • Enter ftp-data-disk for the Disk name.
  • Leave the Storage type as default.
  • Enter 20 for the Size.
  • Select Apply to create the new storage disk and attach the disk to the machine.

Image description

Step 4 Configure automatic shutdown on a virtual machine

  • From the Azure portal home page, in the search box, enter virtual machines.
  • Select virtual machines under services.

Image description

  • Select the guided-project-vm virtual machine.

Image description

  • Under the Operations submenu, select Auto-shutdown.

Image description

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

Image description

Conclusion

By mastering these fundamental VM management techniques - subnet migration, vertical scaling, disk attachment, and auto-shutdown configuration - you've taken important steps toward optimizing both performance and costs in your Azure environment. Remember that proper VM management is an ongoing process that balances resource allocation, security requirements, and operational efficiency. As you continue working with Azure VMs, consider exploring additional optimization strategies like horizontal scaling, availability sets, and advanced monitoring to further enhance your cloud infrastructure. These foundational skills will serve you well as you build more complex solutions in Microsoft's cloud platform.

0 votes

More Posts

How to update a virtual Network in Microsoft Azure

NURUDEEN ADEWALE - Jul 28

How to create a Virtual Machine in Microsoft Azure.

NURUDEEN ADEWALE - Jul 27

How to Manage tags and locks on VMs in Azure

NURUDEEN ADEWALE - Jul 29

How to Control Storage Access in Microsoft Azure.

NURUDEEN ADEWALE - Jul 29

How To Create A Shared File Storage For Offices In Azure

Andrew Arigu Ayuba - Mar 17
chevron_left