Skip to content

Decommission an Organization

Decommissioning tears down an organization and all its resources, and closes its billing. The portal does the teardown, and Odoo closes the sale order automatically once it is safe to do so.

Trigger the decommission

In the Servala Portal staff section:

  1. Open the organization to decommission in the staff section.
  2. Click the Start decommission button.
  3. Review the confirmation page. It lists every service instance that will be deleted and every control plane where a namespace will be deleted.
  4. Confirm to run the decommission.

What the portal does

On confirmation, the portal performs the teardown automatically, in order:

  1. Deletes all service instances of the organization (removing their Kubernetes resources).
  2. Deletes the organization's namespace on every control plane.
  3. Archives the organization (sets archived_at). An archived organization can no longer create instances.
  4. Sets the decommission_date on the organization's linked Odoo sale order.

The steps are guarded: if deleting an instance or a namespace fails, the decommission aborts before the organization is archived, the error is shown to staff and recorded in the audit log, and the action can be retried once the cause is fixed.

Setting decommission_date on Odoo is best-effort: if it fails, the organization is still archived and the date can be reconciled later by the Odoo sync.

What Odoo does

Once the portal has set decommission_date, a daily Odoo job closes the sale order automatically, but only when it is safe:

  • decommission_date is set, and
  • the order is still open (in sale state), and
  • there is nothing left to invoice, and
  • no event-based instance is still running (every event-based line that has a start time also has an end time).

When all of these hold, the job locks the order (marks it done), posts a note on the order documenting the auto-close, and archives it. Setting decommission_date does not affect billing: any remaining usage is still invoiced before the order closes.

If an order is still being invoiced or still has a running instance, the job leaves it open and re-checks on the next run. So an order may take a day or more after decommissioning to close.

Verify and follow up

  • Confirm the organization shows as archived in the portal.
  • Confirm the Odoo sale order eventually closes (locked and archived). If it stays open longer than expected, check the guards above: usage still to invoice, or an instance that was not fully torn down.
  • If the decommission was requested through a Helpdesk ticket (for example an Exoscale offboarding ticket), ask for feedback there and close it.