cloudfoundry/cloud_controller_ng — pull request #122 by liurui-1 (2013-11-08 10:12:18+00:00)
Title: Add HA enhancement with simple availability zone algorism

Cloud Controller currently does not consider high availability when deploying and scaling applications, which may lead to availability issues even the user has multiple instances of the application. For example, when all of the application instances are located in one server rack, and this server rack crashed, the whole application system will be unavailable.

The commit improves the algorism of DEA picking by taking account of "availability zones" defined in "placement_properties". It simply tries to distribute application instances into different "availability zones" to achieve maximum availability. If there is no information of "availability zones" or all DEAs are located in the same "availability zone", it will make no difference from the old behavior.

This commit relies on additional DEA properties named "placement_properties" having been added to the advertisement (see https://github.com/cloudfoundry/dea_ng/pull/78). However if the "placement_properties" is not there, it will revert to the old behavior, so there's no need to bump both modules at the same time.