Achieving self-managed deployment in a distributed environment via utility functions