cloudfoundry/bosh — pull request #585 by mrdavidlaing (2014-05-22 08:20:51+00:00)
Title: Fail fast(er) when AWS spot creation errors detected

The current spot creation process is pretty dumb when it comes to AWS errors - for the majority of the error cases it retries for 20 minutes before throwing an error.

This PR implements a set of changes that enable faster failing:

1. Only wait `total_spot_instance_request_wait_time()` == 5 minutes in total.
2. Fail immediately if `spot_request_status[:state] == 'failed'` (spot requests never recover from this state)
3. Fail immediately if `spot_request_status[:status][:code] == 'price-too-low'` (it's highly unlikely that spot requests will recover from this state)