# Minimize technical debt with orchestration actions

> Clean up the dependencies a server leaves behind, and remove servers whose provisioning failed

---

Site [llms.txt](/llms.txt)

---

## Why technical debt accumulates

Technical debt is the trail of digital breadcrumbs left behind as infrastructure is decommissioned. When a server reaches the end of its lifecycle, it is deleted. But the other dependencies that supported it, most commonly firewall rules, often remain. Cloud Management Platform (CMP) provides orchestration actions to clean them up.

## Prerequisites

- Access to and understanding of [orchestration actions](/docs/cmp/use/orchestration/actions/orchestration-actions/).
- Understanding of the provisioning job.

## Use the delete trigger points

For every provision action, there is a delete counterpart. While provisioning, CMP stores data from provisioning actions that later trigger the counterpart action, removing technical debt.

### Add an action at a delete trigger point

1. Go to **Admin** > **Orchestration Actions**.
1. In the tree on the left, expand **Delete Server**.
1. Select a trigger point. **Post-Delete** is the one used most often, because it runs after the server record has been deleted from CMP.
1. Select **Add Post-Delete Action**, or select an existing action and set it to **Enabled**.

## Free up a firewall rule automatically

When a user deletes a server, CMP should automatically free up the firewall rule that served it.

To address this use case, add a [plugin](/docs/cmp/use/orchestration/plugins/) at the **Post-Delete** trigger point that calls the firewall's API and removes the server's rule.

## Automatically clean up failed servers

When a provision job fails, the server it was building can be left orphaned. CMP ships with a sample action, **Automatically decom server when provisioning fails**, that deletes the server from the resource technology when its provision job ends in FAILURE or CANCELED.

1. Go to **Admin** > **Orchestration Actions**.
1. In the tree on the left, expand **Provision Server** and select **Post-Provision**.
1. Set **Automatically decom server when provisioning fails** to **Enabled**.

<div class="alert alert-info" role="alert">


The default delete script does not touch the firewall or clean up related configuration, so pair this with an action at the **Post-Delete** trigger point.
</div>


## Related

- [Plugins](/docs/cmp/use/orchestration/plugins/)
- [Network address translation](/docs/cmp/use/orchestration/actions/orchestration-actions/network-address-translation/)
