--- title: "Set a scheduled policy" description: "Make an E2E scale group scale up and down to set node counts at times you choose with cron expressions, and change the schedule later." content_type: "how-to" product: "auto-scaling" platform: "MyAccount" url: "/myaccount/auto-scaling/how-to/set-a-scheduled-policy/" topic: ["scaling-policies"] relationships: {"requires":["/myaccount/auto-scaling/how-to/create-a-scale-group/"]} --- # Set a scheduled policy A scheduled policy sets the number of nodes in a scale group at times you choose: one time to scale up, and one to scale down. Choose it when you know your busy hours, such as weekday mornings. To also scale on load, choose **Elastic and Scheduled Policy**; both policies then work within the same **Minimum Node** and **Maximum Node**. For the elastic part, see [Set an elastic policy](/myaccount/auto-scaling/how-to/set-an-elastic-policy/). ## Before you begin - For a new scale group, you have chosen **Scheduled Policy** or **Elastic and Scheduled Policy** under **Select Policy** while creating it, and your role in the current project has the create permission for Auto Scaling. See [Create a scale group](/myaccount/auto-scaling/how-to/create-a-scale-group/#choose-a-policy). - If you are changing an existing scale group, it reads **Running**, and your role has the update permission for Auto Scaling. - You have set **Maximum Node** to at least the upscale **Cardinality** you plan, and **Minimum Node** to at most the downscale one. To change them on a running scale group, see [Change the minimum, maximum, or desired nodes](/myaccount/auto-scaling/how-to/resize-stop-or-start-a-scale-group/#change-the-minimum-maximum-or-desired-nodes). ## Write the cron expressions Each recurrence is a cron expression, read in India Standard Time (IST). A cron expression has five fields, separated by spaces: minute, hour, day of the month, month, and day of the week. Enter the minute as a plain whole number, such as `0` or `15`. If you use a step, list, or range in the minute, such as `*/15 9 * * *`, the field says **Must start with a digit.** Make the rest of the expression valid cron, or the field says **Invalid Cron.** For example, to run 10 nodes from 09:00 IST and three nodes from 20:00 IST, Monday to Friday: ```text Upscale Recurrence: 0 9 * * 1-5 Cardinality: 10 Downscale Recurrence: 0 20 * * 1-5 Cardinality: 3 ``` For these values, set **Minimum Node** to 3 or fewer, and **Maximum Node** to 10 or more. IST is five and a half hours ahead of UTC, so to scale at 09:00 UTC, which is 14:30 IST, enter `30 14 * * *`. The field also says **This field is required.** when it is empty, and **Recurrences should be different.** when both expressions are the same. See [Troubleshooting Auto Scaling](/myaccount/auto-scaling/troubleshooting/auto-scaling/#must-start-with-a-digit-invalid-cron-or-recurrences-should-be-different). ## Set the upscale and downscale times A scheduled policy has exactly one **Upscale Recurrence** and one **Downscale Recurrence**. Each pairs a cron expression with a **Cardinality**, the total number of nodes the scale group runs once that recurrence fires. The scale group starts scaling within about 20 seconds of each recurrence's IST time. 1. Under **Upscale Recurrence**, enter a cron expression as [Write the cron expressions](#write-the-cron-expressions) describes, or pick one of the expressions the field suggests. Once the expression is valid, the page shows its schedule in words. 2. Set the upscale **Cardinality**, the number of nodes for your busy hours, between the downscale **Cardinality** and **Maximum Node**. It starts at 4. 3. Under **Downscale Recurrence**, enter the expression for when the busy hours end. Make it different from the upscale expression. 4. Set the downscale **Cardinality**, the number of nodes for your quiet hours, between **Minimum Node** and the upscale **Cardinality**. It starts at 2. Before you create or update the scale group, check the times the page shows in words under each expression. ## Change the schedule of a running scale group 1. In MyAccount, under **Compute**, click **Auto Scaling**, click your scale group, and open its **Scale Group Details** tab. There you can edit its settings, one at a time. 2. Click the edit button beside **Scale group policy**. **Select Policy** opens with the policy's values ready to change. 3. Change the recurrences and their **Cardinality** values, or switch between **Elastic Policy**, **Scheduled Policy**, and **Elastic and Scheduled Policy**. 4. Click **Update** to save, or **Cancel** to drop the changes. After you save, you will see this message, with your scale group's name in place of ``: ```text The scaling service - - has been successfully updated. ``` ## Check the schedule The **Schedule Policy** panel on **Scale Group Details** shows **Upscale Recurrence** and **Downscale Recurrence** in words, with **Upscale Desired Nodes** and **Downscale Desired Nodes**. When a recurrence fires, the scale group's **Audit Logs** tab records the scaling; see [Read the audit logs](/myaccount/auto-scaling/how-to/monitor-a-scale-group/#read-the-audit-logs). Your scale group now scales on its schedule. To change its minimum and maximum, see [Resize, stop, or start a scale group](/myaccount/auto-scaling/how-to/resize-stop-or-start-a-scale-group/#change-the-minimum-maximum-or-desired-nodes). If the schedule is refused, see [Troubleshooting Auto Scaling](/myaccount/auto-scaling/troubleshooting/auto-scaling/).