Skip to main content
Version: 9.0.10 (latest)

Phase Lifecycle Reference

Kasten executes operations as ordered sequences of internal phases. Blueprint actions fire at specific points within these sequences. This page shows where blueprint actions fire relative to Kasten's internal phases.

Descriptions prefixed with Blueprint: indicate where Kasten calls blueprint actions. Rows marked Internal summarize one or more Kasten-managed phases that blueprint authors do not interact with.

For details on each action name and its timeout, see Reserved Action Names and Timeouts.


Backup Lifecycle​

Kasten processes backups at two levels. Action hooks configured on a policy fire at the namespace level, wrapping the entire operation. Resource-bound blueprint actions bound through an annotation or BlueprintBinding fire per resource within the snapshot phase.

Namespace-Level Backup Phases​

Step Phase Description
1 Internal Locks the target namespace
2 Action hook preHook Blueprint: Runs the action hook defined on the policy.
3 Internal Discovers resources (including PVCs) and backs up manifests. Kasten discovers PVCs created during step 2 here.
4 Snapshot data Processes each resource. See Per-Resource Backup Processing.
5 Internal Backs up container images and finalizes the snapshot
6 Action hook onSuccess or onFailure Blueprint: Runs onSuccess if all earlier phases succeeded. Runs onFailure instead when an earlier phase failed and Kasten has exhausted retries. Only one runs.
7 Internal Cleans up orphaned snapshots on failure

Per-Resource Backup Processing​

For each resource with a blueprint (within step 4 above), Kasten executes the following sequence:

Step Action Condition
4a backupPrehook Blueprint: Runs if the blueprint defines this action.
4b PVC volume snapshots or backup Runs PVC volume snapshots by default.

Blueprint: Runs the backup action instead if the blueprint defines it. See Logical Blueprints.
4c backupPosthook Blueprint: Runs if the blueprint defines this action. Always runs, even if step 4b failed.
warning

PVC discovery runs during step 3, before step 4. Kasten discovers PVCs before backupPrehook executes. A PVC created during backupPrehook is not included in the restore point.

To create a PVC that Kasten snapshots, use a preHook action hook (step 2). Action hooks run before PVC discovery.

Backup Defer Phase Timing​

Each action in steps 4a, 4b, and 4c can define its own deferPhase. The defer phase for a given action runs after that action's phases complete. For example, a deferPhase on backupPrehook runs after step 4a completes but before step 4b begins.


Restore Lifecycle​

Restore also operates at two levels. Action hooks configured on a policy fire at the namespace level. Resource-bound blueprint actions fire per resource.

Namespace-Level Restore Phases​

Step Phase Description
1 Internal Creates the target namespace, acquires holds and locks
2 Action hook preHook Blueprint: Runs the action hook defined on the policy.
3 Internal Validates the restore point and resolves scope, filters, and workload replica counts
4 restorePrehook Blueprint: For each matched resource that exists in the target namespace, runs restorePrehook if the blueprint defines it. Runs before any Kasten phase modifies the target. See Per-Resource Restore Processing.
5 Internal Restores resource configurations, PVC data, workloads, and custom resources
6 restore / restorePosthook Blueprint: For each matched resource, runs restore and then restorePosthook if the blueprint saved in the restore point defines them. Runs after Kasten restores all custom resources. See Per-Resource Restore Processing.
7 Action hook onSuccess or onFailure Blueprint: Runs onSuccess if all earlier phases succeeded. Runs onFailure instead when an earlier phase failed and Kasten has exhausted retries. Only one runs.
8 Internal Releases holds and cleans up

Per-Resource Restore Processing​

Unlike backup, restore has blueprint hook points at two separate steps in the pipeline.

At step 4, Kasten runs restorePrehook before it modifies anything in the target namespace. Use this hook to quiesce an operator or remove a conflicting resource before Kasten replaces PVC data and rebuilds workloads. Kasten runs the hook only for matched resources that already exist in the target namespace. See restorePrehook Caveats.

At step 6, after Kasten restores all custom resources, it runs the following sequence for each matched resource:

Step Action Condition
6a restore Blueprint: Runs if the blueprint saved in the restore point defines this action. See Logical Blueprints.
6b restorePosthook Blueprint: Runs if the blueprint saved in the restore point defines this action.
info

The late-hook actions reflect how the blueprint handles data:

  • Logical blueprints define backup and restore actions. The blueprint manages data movement. Kasten restores PVC manifests but does not seed the volumes — the restore action is responsible for data.
  • Snapshot-based blueprints let Kasten manage PVC data through its snapshot pipeline. Define restorePosthook to run custom steps after Kasten restores volumes and workloads.

restorePrehook applies to both blueprint types.


Export Lifecycle​

Export transfers restore point data to the location profile configured on the policy. Resource-bound blueprints do not participate in the export lifecycle. Only action hooks fire during export.

Step Phase Description
1 Internal Acquires a hold on the restore point
2 Action hook preHook Blueprint: Runs the export pre-hook.
3 Internal Initializes data mover, exports data, and cleans up
4 Action hook onSuccess or onFailure Blueprint: Runs onSuccess if all earlier phases succeeded. Runs onFailure instead when an earlier phase failed and Kasten has exhausted retries. Only one runs.
5 Internal Releases the hold on the restore point

Retire (Delete) Lifecycle​

Retire runs when Kasten deletes a restore point, either through retention policy or manual deletion. Action hooks do not participate in the retire lifecycle. Only resource-bound blueprints that define a delete action fire during retirement.

Step Phase Description
1 Internal Acquires locks and updates retention statistics
2 delete Blueprint: Runs the delete action for each resource-bound blueprint that defines it. Logical blueprints use this action to clean up external backups.
3 Internal Removes artifact records and performs final cleanup

The delete action does not run during export collection retirement (when Kasten removes exported data from a location profile).

For details on the delete action's execution context, see Delete Action Context.