Adding, detaching, and expanding disks
When working with infrastructure in Azure, you rarely make a one-time setup. Some resources, including Azure Virtual Machines with disks, require constant maintenance and monitoring of utilized compute and storage. It’s important to know how to perform basic maintenance operations daily so that you can then automate them if possible.
To get started with some exercises, let’s deploy a single virtual machine using the following command:
az group create -l <location> -n <resource-group-name> az vm create -g <resource-group-name> -n <vm-name> --image Ubuntu2204 --admin-username <username> --admin-password <password>
Once the virtual machine has been created, it’ll have no data disk and a single OS disk with default parameters. Let’s try to add new data disks to it.
Adding a disk to a virtual machine
To attach a new disk to a virtual machine, we can use two paths:
-
...