guardian/deploy — pull request #191 by philmcmahon (2014-10-13 15:25:46+00:00)
Title: Cull instances in order based on availability zone

When using riffraff to deploy elasticsearch it failed at the stage CullElasticSearchInstancesWithTerminationTag:

https://riffraff.gutools.co.uk/deployment/view/335e0ce7-09d9-446a-9a31-b570919970ae

The failure occurs as riffraff currently does not kill the old instances in any particular order, so the availability zones become unbalanced and so new instances are created to correct the imbalance:

![screen shot 2014-10-13 at 16 20 34](https://cloud.githubusercontent.com/assets/3606555/4615684/57b0b5a4-52ec-11e4-95b0-1f1df35c3c40.png)

This change seeks to fix this issue by stopping one instance from each availability zone until all the instances marked for termination have been stopped. This happens in the method cullInOrder, which takes as parameter a list of lists, with each list representing the lists to kill from one availability zone.