Your company’s finance department explains that the cost of Azure virtual machines (VMs) is over budget. You must find an easy solution to decrease the cost of Azure VMs in your subscription. Using only PowerShell, how do you identify the VMs with low CPU utilization and change their size?
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Start Cloud Shell
- Click the Cloud Shell icon (
>_
) in the upper right. - Select PowerShell.
- Click Show advanced settings.
- Set the cloud shell region to the same location as the resource group
- For Storage account, select Create new and give it a globally unique name (e.g., "cloudshell" with a series of numbers at the end).
- For File share, select Create new and give it a name of "fileshare".
- Click Create storage.
- Click the Cloud Shell icon (
- Get the VM Size and CPU Metrics
Find the current size of the VMs.
Get the VM subscription name.
Check VM CPU metrics.
- Resize VMs in Availability Set
Check which VMs are available to resize within the VM hardware cluster.
- Perform the PowerShell commands to resize the VM(s).