DrainGuard Setup

Set up Atlas DrainGuard to safely delete idle VMs during off-hours, with maintenance-mode safeguards, a preview of what would be deleted, and more.

Before you begin

  • A Atlas AVD plan: DrainGuard is plan-gated and the server enforces it
  • The pool-management permission to view and change the settings (Administrator, Operator)
  • The policy-push permission or an Administrator account to run Drain & Reclaim

Where to configure it

In the sidebar, open Atlas Operations → Compass → DrainGuard (it is also a tab in the Optimization hub). The settings on this page are tenant-wide defaults. Summary cards show VMs deleted, idle VMs right now, VMs in maintenance, and estimated monthly savings, and History opens the full activity log.

To turn DrainGuard on or off for a single pool, open the pool and go to Settings → Compute & Deployment → Deployment Defaults. In the Atlas Intelligence group, the DrainGuard switch shows Inherited until you override it.

Turning DrainGuard on

Use the Disabled/Enabled switch in the status banner, then save with Save & Enable DrainGuard. Once enabled, the banner reads Active – Cleaning inside the cleanup window and Active – Monitoring outside it, and warns Misconfigured – No Days Selected if no days are chosen (drain will not run).

Choosing a cleanup mode

Cleanup Mode sets how long a VM must be idle before it can be deleted: Cost Focused (15 minutes), Balanced (30 minutes, recommended), or Availability Focused (60 minutes). You can also type your own value into Minimum Idle Time Before Deletion (5 to 480 minutes).

Setting the cleanup window

In Cleanup Schedule, set the Cleanup Window Start and End, the timezone, and the Allowed Cleanup Days. Atlas only deletes idle VMs inside this window, and the card shows whether you are inside it right now and when the window ends.

Overnight windows that cross midnight (for example 22:00–06:00) are supported. Around daylight-saving changes a window may skip once in spring and run twice in fall; this is by design.

Safeguards and preview

Require Maintenance Mode is on by default, so DrainGuard only deletes VMs that are already in maintenance mode (not accepting new sessions). It is the main guardrail against deleting a host someone might connect to. Turn Delete Idle VMs off to run in monitoring-only mode: conditions are evaluated but nothing is deleted. The If DrainGuard Ran Right Now... card previews which VMs would be deleted, the projected savings, and any hosts with active sessions that would be affected.

Enabling DrainGuard, turning off Require Maintenance Mode, turning on Delete Idle VMs, or cutting the idle threshold by more than half are flagged as destructive changes. Atlas lists them, including how many idle VMs would newly qualify for deletion, and asks you to confirm before saving.

Running an on-demand Drain & Reclaim

To reclaim specific hosts now, select them in the pool's Session Hosts table and click Drain & Reclaim in the selection bar. The confirmation shows how many idle hosts will be deleted now and how many have active sessions. All selected hosts go into maintenance mode; idle ones are deleted immediately, and busy ones are deleted once their users log off.

Drain & Reclaim requires elevated permissions, and deletions are permanent: deleted VMs cannot be recovered.

The tenant-wide switch

Whether a pool drains is resolved in a fixed order. The tenant-wide switch on the DrainGuard page comes first: when it is off, no pool drains, whatever the per-pool settings say. With it on, a pool's own override wins, and pools without one follow the tenant default. That makes the switch a fast way to halt automatic deletions during an incident.

Next steps