andsens/build-debian-cloud — pull request #85 by soult (2013-08-07 12:07:33+00:00)
Title: ec2/11-attach-volume: Wait for volume to be available

When creating a new volume on EC2, the volume starts out in state "creating"
before becoming "available". euca-attach-volume will not attach the volume if
the state is not available, resulting in the following output:

Run task: 10-create-volume
The EBS volume id is vol-deadbeef
Run task: 11-attach-volume
IncorrectState: vol-deadbeef is not 'available'.

The script then hangs forever waiting for the volume to be attached, which will never happen.

Waiting until the volume is available before trying to attach it solved this problem (see attached commit).