Custom provider : How to taint a resource from the provider side?

I have a resource, which creates some servers. Sometimes servers fail to start depending on the availability, so we are thinking to send an error but server is already created.

So the next solution we have thought is to make the resource tainted, so that the user knows that there is something wrong with the resource and they would do the needful from their side depending on their requirement.

Please suggest an ideal way to achieve this ?