automation

Having a VM that constantly hits high CPU tends to underperform, in the Cloud world of Azure, you can easily Scale up and Down VM’s to meet these requirements, saving total Compute costs instead of having an Expensive VM consistently running.

Once configured, with Azure Automation you can easily Scale up and Down Virtual Machines automatically without ever logging into the portal or even turning on your laptop.

Before we start, here is my VM before anything gets configured or set up (Standard D1 v2 VM)

before-sacale
Within your Automation Resource, click “Runbooks”

automation-account

Click “Browse gallery” and search for “Vertically” , select which Runbook you wish to deploy, then click “Import”

vertically

Go over to your VM in the portal, in the side pane scroll down to “Monitoring”, and click “Add metric Alert”

add-metric-0

Give your alert a name, and a description, making sure the ‘Metric’ is set to ‘Percentage CPU’

add-metric-1
Set the Condition too ‘Greater than’ and set a threshold (for testing purposes) to 1% over a period of 5 minutes

add-metric-2

Add your own email address in there to be notified when the Alert is triggered and Successful, select the Runbook you imported, and click OK

add-metric-3

I got my first email Alert to say that the Alert Metric was activated

email-alert

And you’ll see in the ARM Portal, the Alert now says “Active”

add-metric-4

Then 5 minutes later, another email Alert to say that the Alert Metric Resolved

email-alert-2

Now here is the VM after (Standard D2 v2 VM)

after-scal

How easy was that?

Simple, effective & cost saving

Credit to “Kay Singh” for writing the PS Runbook

Advertisements