Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions pages/platform/delete-locks.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Delete Locks
navigation_icon: lock
---

Delete locks prevent accidental deletion of instances and volumes.
When you set a delete lock on a resource, any attempt to delete it returns an error until you remove it.

Delete locks apply to:
- Instances
- Instance templates
- Volumes
- Volume templates

## Enabling a delete lock

Set a delete lock on an instance via the `PATCH` endpoint:

```bash title=""
kraft cloud instance update <instance-name> --delete-lock
```

Set a delete lock on a volume:

```bash title=""
kraft cloud volume update <volume-name> --delete-lock
```

## Removing a delete lock

Remove the delete lock before deleting:

```bash title=""
kraft cloud instance update <instance-name> --no-delete-lock
kraft cloud volume update <volume-name> --no-delete-lock
```

## Checking the delete lock status

The instance and volume status responses include a `delete_lock` field:

```bash title=""
kraft cloud instance get <instance-name>
kraft cloud volume get <volume-name>
```

## Behaviour

- **Deletion blocked**: Any `DELETE` request on a locked resource returns an error.
- **Autokill skipped**: The autokill subsystem skips instances and service groups that have a delete lock set.
The autokill timer doesn't fire while the lock is active.
- **Templates**: Delete locks are independently configurable on instance templates and volume templates via their respective `PATCH` endpoints.

## Learn more

* Unikraft Cloud's [REST API reference](/api/platform/v1), in particular the sections on [instances](/api/platform/v1/instances) and [volumes](/api/platform/v1/volumes)
Loading