Self-Configuration of Distributed Applications in the Cloud