Skip to content

Deleting workspaces with no matching provisioner is convoluted #18080

@johnstcn

Description

@johnstcn

Problem

Let's say you had an external provisioner with a specific set of tags running at some point in the past, and you created a number of workspaces using that external provisioner (using coder_workspace_tags defined in the template).

Let's say that at some point, you decommission that external tagged provisioner and delete whatever compute resources it is running on.

In this situation, you will be unable to delete these workspaces (even with --orphan), as this creates a workspace build. The workspace tags will always be fetched from the template version, and the resulting provisioner job will fail to be acquired due to the tag mismatch.

Workarounds

  1. Temporarily run another tagged provisioner and delete the workspaces
  2. Update the template version to remove the tag requirement, update the workspaces, and delete the workspaces
  3. Manually remove the rows from the database

Suggested Solution

The --orphan option should not need to create a provisioner job at all -- based on my understanding of the word "orphan", this means that the expection is that resources may be left running that will be the responsibility of the user to clean up.

If it is clear that no provisioner will be able to delete the workspace, and --orphan is specified, we could simply skip creating a job entirely and just delete the rows from the database.

Metadata

Metadata

Assignees

Labels

customer-reportedBugs reported by enterprise customers. Only humans may set this.s2Broken use cases or features (with a workaround). Only humans may set this.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions