Sometimes after a Jenkins restart the plugin won't be able to spawn more agents.
The plugin will just loop on this:
If I go to the EC2 console and terminate the instance manually the plugin will spawn a new one and use it.
It seems like there is some mismatch in the plugin logic. The part responsible for calculating the number of instances and checking the cap sees the EC2 instance. However the part responsible for picking up running EC2 instances doesn't seem to be able to find it.
We use a single subnet, security group and vpc (I've seen some reports about this causing problems).
We use instanceCap = 1 setting as we are testing the plugin, this might make this problem more visible than with a higher cap.