Skip to content

Commit d003750

Browse files
committed
WIP 2009-1
1 parent 1063fd7 commit d003750

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

articles/azure-monitor/autoscale/autoscale-multiprofile.md

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Autoscale with multiple profiles
3-
description: "Using multiple profiles in autoscale"
2+
title: Autoscale with different profiles
3+
description: "Using different profiles in autoscale"
44
author: EdB-MSFT
55
ms.author: edbaynash
66
ms.service: azure-monitor
@@ -13,7 +13,11 @@ ms.reviewer: akkumari
1313
# Customer intent: As a user or dev ops administrator, I want to understand how set up autoscale with more than one profile so I can scale my resources with more flexibility.
1414
---
1515

16-
# Autoscale with multiple profiles
16+
# Autoscale with different profiles
17+
18+
Scaling your resources for a particular day of the week, or a specific date and time can reduce costs while still providing the capacity you need when you need it.
19+
20+
Use multiple profiles in autoscale to scale in different ways at different times. If for example, your business isn't active on the weekend, create a recurring profile to scale back your resources on Saturdays and Sundays.
1721

1822
This article explains the different profiles in autoscale and how to use them.
1923

@@ -23,7 +27,7 @@ There are three types of profile:
2327

2428
* Recurring profiles. A recurring profile is valid for a specific time range and repeats for selected days of the week.
2529
* Fixed date and time profiles. A profile that is valid for a time range on a specific date.
26-
* The default profile. The default profile is created automatically and isn't dependent on a schedule. The default profile can't be deleted.
30+
* The default profile. The default profile is created automatically and isn't dependent on a schedule. The default profile can't be deleted. The default profile is used when there are no other profiles that match the current date and time.
2731

2832
Each time the autoscale service runs, the profiles are evaluated in the following order:
2933

@@ -33,14 +37,14 @@ Each time the autoscale service runs, the profiles are evaluated in the followin
3337

3438
If a profile's date and time conditions match the current time, autoscale will apply that profile's limits and rules. Only the first applicable profile is used.
3539

36-
The example below shows an autoscale setting with a default profile and recurring profile as follows.
40+
The example below shows an autoscale setting with a default profile and recurring profile.
3741

3842
:::image type="content" source="./media/autoscale-multiple-profiles/autoscale-default-recurring-profiles.png" alt-text="A screenshot showing an autoscale setting with default and recurring profile or scale condition":::
3943

4044
On Monday after 6 AM, the recurring profile will be used. If the instance count is two, autoscale scales to the new minimum of three. Autoscale continues to use this profile and scales based on CPU% until Monday at 6 PM.
4145

4246
At all other times scaling will be done according to the default profile, based on the number of requests.
43-
After 6 PM on Monday, autoscale switches to the default profile. If, for example the number of instances at the time is 12, autoscale scales in to 10, which the maximum allowed for the default profile.
47+
After 6 PM on Monday, autoscale switches to the default profile. If for example, the number of instances at the time is 12, autoscale scales in to 10, which the maximum allowed for the default profile.
4448

4549
## Multiple profiles using templates and CLI
4650

@@ -51,14 +55,17 @@ When creating multiple profiles using templates and the CLI, follow the guidelin
5155
Follow the rules below when using ARM templates to create autoscale settings with multiple profiles:
5256

5357
* Create a default profile for each recurring profile. If you have two recurring profiles, create two matching default profiles.
54-
* The default profile must contain a `recurrence` section that is the same as the recurring profile, with the `hours` and `minutes` elements set for the end time of the recurring profile. If you do not specify a recurrence with a start time for the default profile, the last recurrence rule will remain in effect.
55-
These rules do not apply for a non-recurring scheduled profile.
56-
* The `name` element for the default profile is an object with the following format: `"name": "{\"name\":\"Auto created default scale condition\",\"for\":\"Recurring profile name\"}"` where the recurring profile name is the value of the `name` element for the recurring profile. If this is not specified correctly, the default profile will appear as another recurring profile.
58+
* The default profile must contain a `recurrence` section that is the same as the recurring profile, with the `hours` and `minutes` elements set for the end time of the recurring profile. If you don't specify a recurrence with a start time for the default profile, the last recurrence rule will remain in effect.
59+
These rules don't apply for a non-recurring scheduled profile.
60+
* The `name` element for the default profile is an object with the following format: `"name": "{\"name\":\"Auto created default scale condition\",\"for\":\"Recurring profile name\"}"` where the recurring profile name is the value of the `name` element for the recurring profile. If the name isn't specified correctly, the default profile will appear as another recurring profile.
5761

58-
The example below shows the JSON for two recurring profiles. One for weekends between 06:00 and 19:00, Saturday and Sunday, and a second for Mondays between 04:00 and 15:00. Note the tow default profiles, one for each recurring profile.
62+
## Add a recurring profile using AIM templates
5963

60-
This autoscale setting was created with the follwoing command:
64+
The example below shows how to create two recurring profiles. One profile for weekends between 06:00 and 19:00, Saturday and Sunday, and a second for Mondays between 04:00 and 15:00. Note the two default profiles, one for each recurring profile.
65+
66+
Use the following command to deploy the template:
6167
` az deployment group create --name VMSS1-Autoscale-607 --resource-group rg-vmss1 --template-file VMSS1-autoscale.json`
68+
where `VMSS1-autoscale.json` is the the file containing the JSON object below.
6269

6370
``` JSON
6471
{
@@ -318,12 +325,14 @@ This autoscale setting was created with the follwoing command:
318325

319326
The CLI can be used to create addition profiles in your autoscale settings.
320327

321-
To create a recurring profile
328+
The following steps show how to create an autoscale profile using the CLI.
322329
1. Create the profile using `az monitor autoscale profile create`. Specify the `--start` and `--end` time and the `--recurrence`
323-
1. Create a scale out rule using `az monitor autoscale rule create` using ``--scale out`
324-
1. Create a scale in rule using `az monitor autoscale rule create` using ``--scale in`
330+
1. Create a scale-out rule using `az monitor autoscale rule create` using `--scale out`
331+
1. Create a scale in rule using `az monitor autoscale rule create` using `--scale in`
332+
333+
## Add a recurring profile using CLI
325334

326-
The example below shows the addition of a recurring profile, recurring on Thursdays between 06:00 and 22:50.
335+
The example below shows how to add a recurring autoscale profile, recurring on Thursdays between 06:00 and 22:50.
327336

328337
``` azurecli
329338
@@ -340,7 +349,9 @@ az monitor autoscale rule create -g rg-vmss1 --autoscale-name VMSS1-Autoscale-60
340349
> The default profile also has a recurrence clause added to it that starts at the end time specified for the new recurring profile.
341350
> A new default profile is created for each recurring profile.
342351
343-
After adding recurring profiles, your default profile is renamed. If you have multiple recurring profiles and want to update your default profile the update mast be made to each default profile that corresponds to a recurring profile.
352+
## Updating the default profile when you have recurring profiles
353+
354+
After you add recurring profiles, your default profile is renamed. If you have multiple recurring profiles and want to update your default profile, the update must be made to each default profile corresponding to a recurring profile.
344355

345356
For example, if you have two recurring profiles called *Wednesdays* and *Thursdays*, you need two commands to add a rule to the default profile.
346357

@@ -350,5 +361,10 @@ az monitor autoscale rule create -g rg-vmss1--autoscale-name VMSS1-Autoscale-607
350361
az monitor autoscale rule create -g rg-vmss1--autoscale-name VMSS1-Autoscale-607 --scale out 8 --condition "Percentage CPU > 52 avg 5m" --profile-name "{\"name\": \"Auto created default scale condition\", \"for\": \"Thursdays\"}"
351362
```
352363

353-
354364
---
365+
366+
## Next steps
367+
* [Autoscale CLI reference](cli/azure/monitor/autoscale?view=azure-cli-latest).
368+
* [ARM template resource definition](/azure/templates/microsoft.insights/autoscalesettings)
369+
* [REST API reference. Autoscale Settings](rest/api/monitor/autoscale-settings).
370+
* [Advanced autoscale configuration using Resource Manager templates for virtual machine scale sets](autoscale-virtual-machine-scale-sets.md) for different resources in Azure.

0 commit comments

Comments
 (0)