Option to allow failed deployments to be auto deleted/cleaned up

Description:
When deploying new apps or instances in Morpheus sometimes they fail for various reasons during the pre or post configuration stages. It would be nice to have an option on the blueprint for example like a tick box to say “delete this instance if it fails to deploy”.

This would be useful because it means we don’t have half-deployed instances floating about that may be forgotten about if we don’t remember to delete them and if left for a while they will usually be un-managed and unpatched, meaning we have introduced a potentially vulnerable and unconfigured system to the network

Thanks

Hi. This would be better in the ideas section where people can vote and some of the suggestions make it to the product (remember to vote on your own idea).

In the meantime, you could script a task and run that on a schedule, which checks for failed provisions (using “status” I think) and deletes them. That might be a way to go.

API docs linked for reference: Get All Instances

Hi Ollie,

I agree, sorry I didn’t know how to make it into an idea - is it possible to move/change it?

Also that’s a great suggestion to use a scheduled script. I’ll do that for now, much appreciated!

1 Like

I can’t see a way to move it with my privileges @cbunge - can you assist?

1 Like

@Ollie_Phillips your suggestion was great except I’ve encountered a different use case where the Instance has deployed but the post-provision task fails - checking the status it’s “running” so is there any other way I can query the status of the post-configuration? I couldn’t see anything obvious when I get the instance details using the API unless I’m missing something?

Thanks again!

Workflow status can be queried via the History API endpoint collection. I think we have “running”, “complete” and “failed” as statuses. The responses contain the instance id they relate to.

You could look in here for failed statuses - and based on your criteria - grab the instance ids and use as a basis for deleting.

Link to the history endpoints: Retrieves Process History