Instance Scheduler
Start and stop non-production servers on a weekly schedule to stop paying for idle hours.
Instance Scheduler
Schalten Sie Nicht-Produktionsserver nachts und am Wochenende aus und morgens wieder ein, sodass Sie nicht mehr für Stunden zahlen müssen, in denen sie niemand nutzt.
- Das ist der einzige CostGlass-Funktion, die Ihre Cloud verändert. Es handelt sich um ein Opt-in-Verfahren, das nur Dinge starten und stoppen kann.
- A job that runs every 30 minutes compares every scheduled server with its schedule and starts or stops it to match.
- Works on virtual machines, scaling groups and managed databases on AWS, Azure, Google Cloud, Oracle Cloud and Alibaba Cloud (databases: AWS RDS, Azure PostgreSQL and MySQL Flexible Server, Google Cloud SQL).
- Eine Auto Scaling-Gruppe wird auf 0 und zurück skaliert, nicht gestoppt. Ein Server, der zu einer Gruppe gehört, muss über seine Gruppe geplant werden.
- Tag your dev and test resources and a tag policy schedules them for you. A schedule you make by hand always wins over a policy.
- Stopping a database ends its compute charge only. Storage and backups keep billing. Do not schedule anything that holds data only in memory unless a restart is safe.
Warum es verwenden
Entwicklungs-, Test- und Staging-Server werden häufig nur während der Arbeitszeit genutzt, sind jedoch alle 168 Stunden der Woche in Betrieb (und werden in Rechnung gestellt). Ein Server, der montags bis freitags von 8:00 bis 19:00 Uhr läuft, benötigt 55 dieser Stunden, sodass etwa zwei Drittel seiner Rechenkosten vermeidbar sind. Die Seite zeigt die Ersparnis für die eigenen Server und beruht nicht auf einer pauschalen Aussage.
Die eine Schreibberechtigung und wie man sie ausschaltet
| Wolke | Was gewährt wird | Wie |
|---|---|---|
| AWS | ec2:StartInstances and ec2:StopInstances on instances, rds:StartDBInstance and rds:StopDBInstance on RDS instances, and autoscaling:UpdateAutoScalingGroup on Auto Scaling groups. Sonst nichts. | Teil der CostGlass-Rolle, die durch die Onboarding-Vorlage erstellt wurde. It is controlled by the EnableInstanceScheduler Parameter, der standardmäßig auf ist WAHR. In the connection wizard it appears as the Instance Scheduler feature. |
| Azure | A custom role with virtualMachines read, start and deallocate actions, scale-set read and write, and read, start and stop on PostgreSQL and MySQL Flexible Servers. | Die Seite enthält die Rollendefinition in einem Einrichtungshandbuch, das Sie in das Azure-Portal kopieren. |
| Google Cloud | Permission to start and stop instances, resize managed instance groups, and change a Cloud SQL instance’s activation policy. Never create or delete. | Siehe die Einrichtungsanleitung auf der Seite. |
Schalten Sie es aus (AWS)
Redeploy your CostGlass stack with EnableInstanceScheduler eingestellt auf FALSCH (or untick Instance Scheduler in the connection wizard and deploy the new template). Die Rolle hat dann überhaupt keine Schreibberechtigung mehr und die Planung funktioniert nicht mehr. Es ist keine weitere Änderung erforderlich. Vorhandene Zeitpläne bleiben in CostGlass, können jedoch nicht ausgeführt werden.
Erstellen Sie einen Zeitplan
- Die für das Konto aktivierte Planerberechtigung (vorheriger Abschnitt).
- Ihre von CostGlass erkannten Server (siehe Cloud-Ressourcen). Wenn keine gefunden werden, wird dies auf der Seite angezeigt.
- Ein Nicht-Produktionsserver, auf dem ein Stopp sicher ist.
A schedule is a named set of hours, such as “Weekdays 08:00-19:00”. You make it once and apply it to any number of servers, directly or through a tag policy. Changing the schedule changes everything that follows it.
Switch a schedule off on its card to pause every server that follows it, and switch it on to resume. Servers are left running while it is paused. To stop scheduling one server, open it and choose Remove schedule; the server is left in whatever state it is in.
Was passiert als nächstes?
Ein Job wird ausgeführt every 30 minutes. Für jeden aktivierten Zeitplan ermittelt es anhand der Zeitzone, ob der Server gerade laufen oder gestoppt werden soll, vergleicht dies mit dem tatsächlichen Zustand und startet oder stoppt ihn, wenn sie abweichen. Because it checks the desired state every 30 minutes rather than firing at an exact minute, a missed run corrects itself on the next one. The practical effect: a start or stop happens within 30 minutes after the time you set.
Jetzt beginnen und jetzt aufhören
Im Editor wirken „Jetzt starten“ und „Jetzt stoppen“ sofort (einmal). For an Azure VM the stop button is Deallocate now; for an Auto Scaling group they are Scale up and Scale to 0. Eine kurze Nachricht informiert Sie über das Ergebnis. Befindet sich das Ziel bereits im angeforderten Zustand, wird die Aktion als übersprungen aufgezeichnet.
Durchsetzung jetzt ausführen
The play button at the top of the page runs a pass straight away instead of waiting for the next check. Eine Meldung meldet, wie viele gestartet und gestoppt wurden.
Verschiedene Arten von Zielen
| Ziel | Stop tut es | Start macht |
|---|---|---|
| EC2-Instanz | Stoppt die Instanz. | Startet die Instanz. |
| Auto Scaling-Gruppe | Remembers the group's minimum and desired capacity, then sets them to 0 (shown as Scaled to 0). Die konzerneigene Skalierung kann dem Zeitplan nichts entgegensetzen. | Restores the remembered values (shown as Scaled up). |
| an Azure-VM | Anrufe Freigabe aufheben, kein einfacher Stopp, daher wird die Berechnung der Computerabrechnung wirklich gestoppt. Eine einfach angehaltene Azure-VM bleibt zugewiesen und wird weiterhin abgerechnet. | Startet die VM. |
| Google Cloud-Instanz | Stoppt die Instanz. | Startet die Instanz. |
| Oracle Cloud instance | Soft stop. Standard and flexible VM shapes stop billing for compute; bare-metal, dense-I/O and GPU shapes keep their compute charge, so no saving is shown for them. | Startet die Instanz. |
| Alibaba ECS instance | Stops in economical mode (StopCharging), so a pay-as-you-go VPC instance stops billing for compute. Subscription (PrePaid) instances are not offered because they are billed either way. | Startet die Instanz. |
| AWS RDS database | Anrufe stop-db-instance. Compute stops billing; storage and backups do not. RDS starts a stopped database again after 7 days, so every check re-reads the live state and stops it again. | Calls start-db-instance. |
| Azure PostgreSQL or MySQL Flexible Server | Stops the server (compute billing stops; storage does not). Azure PostgreSQL also restarts after 7 days and is stopped again at the next check. | Starts the server. |
| Google Cloud SQL instance | Sets the activation policy to NEVER. The Google console may still show the instance as runnable; CostGlass reads the policy. | Sets the activation policy to ALWAYS. |
| Scaling group (Auto Scaling group, VM Scale Set, managed instance group, instance pool, Alibaba scaling group) | Remembers the size, holds the group’s own autoscaler off, and scales the group to 0. | Restores the size, then puts the autoscaler back as it was. |
Databases that are not offered
Some databases cannot be stopped by the provider, or are risky to stop, so they are listed with the reason and no schedule: Aurora and other cluster members, RDS read replicas and databases that have replicas, RDS for SQL Server in Multi-AZ, Azure servers with high availability or replication, and Cloud SQL read replicas. The saving shown for a database is its compute share only, and is blank where CostGlass has no list price for the size.
Servers that belong to a group
A server that belongs to an Auto Scaling group, VM Scale Set, managed instance group, instance pool or Alibaba scaling group cannot be scheduled on its own: the group would start a replacement for the one you stopped, so nothing would be saved. By default these are hidden. If you try to save a schedule for one, CostGlass refuses (a 409 conflict) and moves you to the group instead. Group members are hidden from the list; open the group to see its behaviour. Every check compares the live group with the schedule, so if something adds servers back during off hours they are removed again at the next check.
Nodes of managed Kubernetes clusters (AKS, GKE, OKE, ACK) are not offered either, because the cluster autoscaler replaces them. CostGlass recognises Azure and Google nodes from the labels those services set. For Oracle and Alibaba it relies on tags the services add to nodes, which is not a documented guarantee, so check the target list before scheduling a cluster account.
So lesen Sie die Seite
Cards
- Scheduled
- Targets with a schedule, out of everything schedulable, split into those scheduled through tags and those scheduled directly.
- Running now
- Targets running at this moment, with an estimate of what they cost per day at current usage.
- Projected saving
- Eine Schätzung: die On-Demand-Kosten der geplanten Server multipliziert mit dem Anteil der Woche, in der sie außer Betrieb sein werden. Es handelt sich um eine Prognose, nicht um eine Messung, und basiert auf der Listenpreisschätzung von CostGlass.
- Not scheduled
- Schedulable targets with no schedule that do not look like production.
Tabs
| Tab | Was es zeigt |
|---|---|
| Instances | Every discovered target with its cloud, state, tags, schedule, hourly cost and monthly saving. Search and filter by cloud, state and schedule. Click a row to set its schedule, stop dates or start and stop it now. Group members are hidden because the group is what you schedule. |
| Schedules | One card per schedule with its week grid, how many servers follow it, hours off per week and monthly saving, and a switch to pause it. The scheduler activity feed sits beside it. |
| Tag policies | The ordered list of rules that apply a schedule by tag. |
Buttons at the top
The bell opens Shutdown warnings, the play button runs a scheduler check now, and the information button opens this guide.
Scheduler activity
The feed lists what the scheduler did most recently: which server, started or stopped, by a schedule or by hand, and whether it failed. Hover an entry for the detail. A failure is usually a missing permission. Entries recorded as simuliert mean no real action was taken, which happens for demonstration accounts and for connections with no credentials.
Schedule by tag
A tag policy says “everything tagged env=dev follows Weekdays 08:00-19:00”. Open the Tag policies tab and choose New tag policy: name it, pick the tag key and whether the value must equal or start with your text (leave the value empty to match any value), choose the schedule and the clouds. The preview lists exactly what it would schedule and what it would skip, with the reason. Saving creates ordinary schedules for the matching resources, so they appear in the list marked with the policy name and behave like any other schedule.
| Tag on the resource | eingereicht haben? Bedeutung |
|---|---|
cg-schedule-timezone=Europe/London | Timezone of the schedule a policy creates for this resource. Without it the schedule’s own timezone applies. |
cg-stop-from=2026-12-12 Und cg-stop-to=2027-01-05 | Stays stopped from the first day to the last day, both included, then the weekly schedule resumes (or, with no weekly schedule, it simply runs again). Both tags are required, in YYYY-MM-DD form. These work with or without a policy. |
- Order matters. Policies are numbered; if several match a resource, the first one wins. Use the arrows to move a policy up or down.
- Tag keys and values are not case sensitive. A bad value (a date that is not a date, an unknown timezone, only one of the two date tags) is ignored and flagged on the page, so a typo never schedules the wrong thing.
- New and re-tagged resources are picked up on the next check after discovery. A resource that loses its tag is released, and started again first if the scheduler had stopped it.
- A schedule you made by hand on a resource always wins; a policy never changes it (a tag stop window is still added to it).
- Pausing a schedule pauses the policies that use it, and the policy shows Schedule paused. A schedule that a policy or server uses cannot be deleted.
- Resources that cannot be scheduled (group members, Kubernetes nodes, databases the provider cannot stop, connections without the scheduler permission) are skipped, and the preview says why.
- Exclude from policy on a resource stops the policy managing it. Deleting a policy removes its schedules and starts anything it had stopped.
- Saving a policy changes nothing in your cloud by itself. The next scheduler check does, and it stops anything outside the window at that moment.
Stop dates and public holidays
Besides its weekly schedule, a VM, scaling group or database can have any number of stop dates: whole days it stays stopped, such as a year-end shutdown or the public holidays of the office’s country. Open the resource, then Open calendarunder the schedule. Click the first and last day, add an optional label, and Add dates; Save stop dates stores them.
- The days are in the schedule’s timezone, first and last day included. On those days the target is stopped whatever the weekly schedule says; on every other day the weekly schedule applies.
- A target with no weekly schedule can have stop dates only: it runs outside them and is stopped inside them.
- The calendar suggests the public holidays of the country the timezone belongs to (for example Europe/London → United Kingdom, England). Change the country or region, tick the holidays you want, or add all the upcoming ones. A holiday that falls on a day the weekly schedule is already off changes nothing.
- Dates that come from
cg-stop-from/cg-stop-totags show as “from tags” and cannot be edited in the calendar; change the tag instead. - Stop dates that have passed are removed automatically. Holiday data comes from an open-source holiday library and can differ from your company’s own calendar, so check the list before saving.
- Stop dates stop the target at the first scheduler check on the first day (which may be a few minutes after midnight) and start it again at the check after the last day ends, if the weekly schedule says it should be running.
Resources that look like production
A resource whose name contains the word Produkt, prd, Produktion oder live (as a word, so “web-prd-01” counts but “product-catalog” does not), or whose env / Umfeld / stage tag says so, is marked PROD? in red in the list. Before you create or change a schedule or add stop dates for one, a red notice names it and you must tick a box accepting responsibility; the save is refused without it, and the audit log records that you accepted.
- A tag policy that would cover such resources shows the same notice with their names in the preview. Once you accept it, the policy includes production-looking resources; until then it skips them and says why.
- Pausing a policy or removing stop dates needs no acceptance.
- This is a name and tag check, not a guarantee. A production resource with an unrelated name is not flagged, so you stay responsible for what you schedule. Resources scheduled by
cg-stop-from/cg-stop-totags are not checked, because setting the tag in your cloud is the explicit action.
Shutdown warnings and delay links
The scheduler can warn you before it stops something. Under Shutdown warnings (the bell at the top of the Instance Scheduler page), switch warnings on, add one or more email, Slack or Microsoft Teams channels, and choose how far ahead to warn. Each warning names the resource, the stop time in its own timezone, the rule behind it and who created it, with buttons to delay the shutdown by 1 hour, 2 hours, 3 hours or for the rest of the day.
- A button opens a confirmation page and changes nothing until you press confirm there (mail scanners and chat apps open links automatically, so a click alone never applies a delay).
- A delay counts from the planned stop time; “for the day” runs to midnight in the schedule’s timezone. The normal schedule resumes afterwards, and you get another warning before the new stop.
- Warnings are checked each time the scheduler runs (every 30 minutes), so one arrives up to 30 minutes or more ahead, never later than the stop. Choose a longer lead time to be warned earlier.
- The person who created each schedule can also be emailed. For tag policies that is the person who created the policy.
- If many resources stop at once, the first ten get their own warning with delay links; the rest are listed in one summary that links to the page, where you can delay each of them.
- A delay is refused if the target has already stopped. Starting it again is done from the page after signing in.
- Links are signed and expire two hours after the stop time. Anyone who receives a warning can use its links, so every delay is recorded in the audit log as made through a notification link, with the new end time, rather than under a person’s name.
Who created a schedule (audit trail)
Every change is written to the audit log under Settings → Audit log with the person who made it: schedules created, changed, removed or excluded from a policy, stop dates added or removed, manual starts and stops, and tag policies created, edited, paused or deleted. Changes CostGlass makes by itself are recorded with the source System and say why (the tag policy, or the tags on the resource).
- The schedule editor shows how the schedule was set up, who created it and who last changed it.
- Each start or stop in the activity feed ends with the rule that caused it and who or what set that rule up, so a target that was stopped by mistake can be traced to a person, a policy or a tag.
- For schedules that come from
cg-tags CostGlass cannot see who set the tag in your cloud. Check your cloud’s own audit log (CloudTrail, Azure Activity Log, Cloud Audit Logs).
Risiken und bewährte Verfahren
- Databases: a stop ends the compute charge only, connections are dropped, and an application that cannot reconnect after the morning start will fail. Test on one non-critical database first.
- Überprüfen Sie, was beim Booten startet. Ein Server, der nach einem Neustart manuelle Schritte erfordert, wird morgens kaputt gehen.
- Öffentliche IP-Adressen können sich ändern, wenn eine EC2-Instanz gestoppt und gestartet wird, es sei denn, Sie verwenden eine elastische IP.
- Sagen Sie es dem Team. Fügen Sie den Zeitplan Ihrem Runbook hinzu, damit sich niemand wundert, warum ein Server ausgeschaltet ist.
- Lassen Sie Produktionsserver ungeplant, es sei denn, Sie haben einen bewussten Grund.
- Bevorzugen Sie Zeitpläne für Auto Scaling-Gruppen für Flotten, damit die eigene Skalierung der Gruppe nicht gestört wird.
- Reservierte Kapazität und Sparpläne werden unabhängig davon bezahlt, ob der Server läuft oder nicht. Durch das Stoppen eines abgedeckten Servers wird kein Geld für den abgedeckten Teil gespart (siehe Commitments (Sparverpflichtungen)).
Häufig gestellte Fragen
EnableInstanceScheduler to false on your AWS stack and do not grant the Azure or Google write roles.