Location Aware Scaling Rules
I would like to introduce the "locationAware" service recipe flag which enhances the behavior of machine failover and scaling rules:
1. When a machine fails, and "locationAware" is enabled, Cloudify starts the machine in the same location of the failed machine.
2. Scaling rules are separately enforced on each location. Effectively, Cloudify starts a new machine in the location that triggered the scale-out rule.
In the example below, we assume we have 2 Tomcat web servers deployed on each location (a total of 4 web servers):
https://gist.github.com/4000673
Notice that each Web Server CPU load is 40%:
https://gist.github.com/4001155
One scenario is network disconnection between the load balancer and the Tomcat Servers in "Location 1". We assume the Load Balancer directs all traffic to "Location 2". The result is that 2 Web Servers are handling all of the traffic which results with an increase of the CPU load up to 80%.
https://gist.github.com/4000676
The high CPU load triggers a scaling rule which starts another web server virtual machine. Since the recipe is location-aware, the virtual machine is started at "Location 2" (and not Location 1 which is now disconnected from the load balancer). Notice how the CPU load is then down to normal values:
https://gist.github.com/4000947
When the Location 1 network failure is fixed, we have one server too many.
https://gist.github.com/4001033
The scaling rules detect that since the CPU usage is too low (meaning we can handle this load with less machines), the extra machine is then removed.
https://gist.github.com/4000673