Citrix Virtual Apps and Desktops

Get started with Autoscale

Autoscale is a feature that provides a consistent, high-performance power management solution to proactively scale delivery groups based on a configured schedule or load demands.

Autoscale applies to all types of delivery groups:

  • Single-session static OS
  • Single-session random OS
  • Multi-session random OS

This article describes basic Autoscale-related concepts and provides guidance on how to enable and configure Autoscale for a delivery group.

Basic concepts

Before you start, learn about the following basic concepts in Autoscale:

Capacity and machine registration

Autoscale includes only machines that are registered with the site when determining the capacity. Powered-on machines that are unregistered can’t accept session requests. As a result, they aren’t included in the overall capacity of the delivery group.

Scale across multiple machine catalogs

In some sites, multiple machine catalogs might be associated with a single delivery group. Autoscale randomly powers on machines from each catalog to meet schedule or session demand requirements.

For example, a delivery group has two machine catalogs: Catalog A has three machines powered on and Catalog B has one machine powered on. If Autoscale needs to power on an extra machine, it might power on a machine from either Catalog A or Catalog B.

Machine provisioning and session demand

The machine catalog associated with the delivery group must have enough machines to power on and off as demand increases and decreases. If session demand exceeds the total number of registered machines in the delivery group, Autoscale ensures that all registered machines are powered on. However, Autoscale does not provision additional machines.

Note:

If a Delivery Group has 63 machines and a buffer capacity of 10% is set for off-business hours, then as per the Autoscale calculation, 6.3 machines must be turned on during off-business hours. To handle the decimal value, following are the rules:

  • Round to nearest: For example, if the value is 6.4, then 6 machines are turned on. If the value is 6.7, then 7 machines are turned on.
  • Round to 1 for any non-zero value less than 1. For example, if the value is 0.2 or 0.9, then 1 machine is turned on.

Instance size considerations

You can optimize your costs if you appropriately size your instances in public clouds. We recommend that you provision smaller instances as long as they match your workload performance and capacity requirements.

Smaller instances host fewer user sessions than larger instances. Therefore, Autoscale puts machines into drain state faster because it takes less time for the last user session to be logged off. As a result, Autoscale powers off smaller instances sooner that reducing costs.

Schedules

Autoscale powers on and off machines in a delivery group based on a schedule that you set.

A schedule includes the number of active machines for each time slot, with peak and off-peak times defined.

Schedule settings vary with the type of delivery group. For more information, see:

Peak and off-peak times

Peak and off-peak times are used to indicate which of the capacity buffer values to use for specific periods of the day. You can define the peak times, leaving the remaining undefined times as off-peak times.

Power-Off delay

Power-off delay is the minimum number of minutes that must elapse after a machine is powered on before Autoscale can power off that machine. This keeps machines from flip-flopping on and off during volatile session demands. By default, the power-off delay is 30 minutes. You can set it in a range of 0-60 minutes.

Pool size

Pool size is the number of machines that must be kept powered-on for a particular period of a day.

Capacity buffer

Capacity buffer is used to add spare capacity to the current demand to account for dynamic load increases. There are two scenarios to be aware of:

  • For multi-session OS delivery groups, the capacity buffer is defined as a percentage of the total capacity of the delivery group in terms of load index.
  • For single-session OS delivery groups, the capacity buffer is defined as a percentage of the total number of machines in the delivery group.

The capacity buffer is a rolling buffer, given that it is calculated and applied based on the current usage rather than calculated and applied on top of the configured pool size.

For example, given a delivery group with 10 machines, a pool size of 1 machine for the current period and a capacity buffer of 10%. An additional machine is powered on when the 1 powered-on machine, as defined by the schedule, is loaded to the point where the 10% capacity buffer is no longer satisfied. If the load is reduced after powering on the second machine and there is more than enough free load capacity to satisfy the 10% capacity buffer, Autoscale prepares 1 machine for power off.

Load index

IMPORTANT:

The load index applies only to multi-session delivery groups.

The load index metric determines how likely a machine is to receive user logon requests. It’s calculated using the Citrix Load Management policy settings configured for concurrent logon, session, CPU, disk, and memory use.

The load index ranges from 0 to 10,000. By default, a machine is considered at full load when it’s hosting 250 sessions:

  • The digit “0” indicates an unloaded machine. A machine with a load index value of 0 is at a baseline load.

  • The digit “10,000” indicates a fully loaded machine that can’t run any more sessions.

Autoscale and maintenance mode

Machines in maintenance mode, regardless of their availability status, are considered as part of the calculation of the overall pool size. Therefore, it’s possible for all machines within the pool to be in maintenance mode. However, these machines are excluded from the capacity buffer calculations, ensuring their immediate availability. To guarantee a specific percentage of machines are accessible for user connections, adjust the pool size and buffer values accordingly.

Machine cost

Machine instance cost per hour is the cost per hour, in US$, of the computing capacity being used. This setting is used to calculate the cost savings of the Autoscale settings. To view the savings, go to Monitor > Trends > Machine usage.

Scale up a delivery group

Autoscale powers on additional machines in an Autoscale-enabled delivery group when:

  1. The Autoscale schedule for the delivery group indicates that more machines must be powered on for the current time period.
  2. The current load on the delivery group has exceeded the capacity buffer.

Conditions for powering on machines:

  1. Not in maintenance mode.
  2. Hypervisor is not in maintenance mode.
  3. Powered off and unregistered.
  4. Belongs to the delivery group that requires scaling up
  5. No pending power actions.

Scale down a delivery group

Autoscale powers off machines in an Autoscale-enabled delivery group when:

  1. The Autoscale schedule specifies that machines must be powered off to meet the configured number of machines for the current time period.
  2. The current load of the delivery group has decreased, resulting in more powered-on machines than required to meet the pool size and capacity buffer.

Autoscale scales down a delivery group by powering off the excess machines exceeding the number needed to meet the pool size and capacity buffer.

The scale-down process involves two steps:

  1. Place the required number of machines into the drain state.
  2. Select all drained machines for power off.

Machines eligible for power off must meet the following criteria:

  1. Not in maintenance mode
  2. Hypervisor not in maintenance mode
  3. Currently powered-on
  4. Registered as available or is waiting to register after starting up
  5. Drained and has no active sessions
  6. No pending power actions
  7. Satisfies the power-off delay

Drain state

Autoscale attempts to scale down the number of powered-on machines in the delivery group to the configured pool size and capacity buffer.

To achieve this goal, Autoscale puts the excess machines with the fewest sessions into “drain state” and powers them off when all sessions are logged off. This behavior occurs when session demand lessens and the schedule requires fewer machines than are powered on.

Conditions for the machines to drain:

  1. Powered-on
  2. Not be in maintenance mode
  3. Hypervisor not in maintenance mode
  4. Belongs to the delivery group that requires scaling down
  5. Least number of current active sessions

Note:

  • Machines that have been on for at least the time specified by the Power-Off delay are preferred for drain.
  • Machines in drain state no longer host new session launches and waits for the existing sessions to be logged off. A machine is shut down only when all sessions are logged off. However, if there are no machines immediately available for session launches, Autoscale prefers directing the session launches to a machine in drain state over powering on a machine.

Autoscale puts excess machines into “drain state” one by one:

  • If two or more machines have the same number of active sessions, Autoscale drains the machine that has been powered on for the specified power-off delay.

    Doing so avoids putting recently powered-on machines into drain state because those machines are more likely to have the fewest sessions.

  • If two or more machines have been powered on for the specified power-off delay, Autoscale drains those machines one by one at random.

Machines in drain state no longer host new session launches and are waiting for the existing sessions to be logged off. A machine becomes a candidate for shutdown only when all sessions are logged off. However, if there are no machines immediately available for session launches, Autoscale prefers directing the session launches to a machine in drain state over powering on a machine.

A machine is taken out of drain state when one of the following conditions is met:

  • The machine is powered off.
  • Autoscale is disabled for the delivery group to which the machine belongs.
  • Autoscale uses the machine to meet schedule or load demand requirements. This case occurs when the schedule (schedule-based scaling) or the current demand (load-based scaling) requires more machines than the number of machines that are currently powered on.

Important:

If no machines are immediately available for session launches, Autoscale prefers directing session launches to a machine in a drain state over powering on a machine. A machine in a drain state that hosts a session launch remains in drain state.

To find out which machines are in drain state, use the Get-BrokerMachine PowerShell command. For example: Get-BrokerMachine -DrainingUntilShutdown $true. Alternatively, you can use Studio. See Display machines in drain state.

Display machines in drain state

Note:

This feature applies only to multi-session machines.

In Studio, you can display machines that are in drain state, letting you know which machines are about to shut down. Complete the following steps:

  1. Navigate to the Search node and then click Columns to Display.
  2. In the Columns to Display window, select the checkbox next to Drain State.
  3. Click Save to exit the Columns to Display window.

The Drain State column can display the following information:

  • Draining until shutdown. Appears when machines are in drain state until they’re shut down.
  • Not draining. Appears when machines aren’t yet in a drain state.

Drain state

Enable Autoscale for a delivery group

Autoscale is disabled by default when you create a delivery group. To enable and configure Autoscale for a delivery group using Web Studio, follow these steps:

You can also use PowerShell commands to enable and configure Autoscale for a delivery group. For more information, see Broker PowerShell SDK commands.

  1. Select Delivery Groups in the left pane.

  2. Select the delivery group that you want to manage and then click Manage Autoscale.

    Cloud UI

  3. On the Manage Autoscale page, select the Enable Autoscale check box to enable Autoscale. After you enable Autoscale, the options on the page are enabled.

    Cloud UI

  4. To change the default settings based on your organization’s needs, complete the following settings:

To disable Autoscale, clear the Autoscale check box. The options on the page turn gray to indicate that Autoscale is disabled for the selected delivery group.

Important:

  • If you disable Autoscale, all machines managed by Autoscale remain in their states at the time of disabling.
  • After you disable Autoscale, the machines in drain state are taken out of drain state. For more information about drain state, see Drain state.

Monitor metrics

After you enable Autoscale for a delivery group, you can monitor the following metrics of Autoscale-managed machines from Director.

  • Machine usage

  • Estimated savings

  • Alert notifications for machines and sessions

  • Machine status

  • Load evaluation trends

Note:

When you initially enable Autoscale for a delivery group, it might take a few minutes to display monitoring data for that delivery group. Monitoring data remains available if Autoscale is enabled and then disabled for the delivery group. Autoscale collects monitoring data at 5-minute intervals.

For more information about the metrics, see Monitor Autoscale-managed machines.

More information

For more information on Autoscale, see Citrix Autoscale in Tech Zone.

Get started with Autoscale