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
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.
@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?
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.