Chef Knife-EC2 Windows Timeouts

We found we were getting some issues with the Knife-EC2 command KNIFE EC2 SERVER CREATE timing out when creating Windows notes on EC2.

The error we were getting was this :-

Fog::Compute::AWS::Error: RequestLimitExceeded

It seems to be due to the┬ácheck_windows_password_available method having its “sleep” in the incorrect place. I’ve resolved this by editing the code for KNIFE-EC2 and moving the sleep to the top of the function.

def check_windows_password_available(server_id)
sleep 10
#Added this at the start of the loop as it doesn't fire if the return false is hit
response = connection.get_password_data(server_id)
if not response.body["passwordData"]
return false
end
response.body["passwordData"]
end

I recompiled the GEM and installed it, and it’s now working without issues. Have posted this as a bug but not sure anyone believes me.