title: Paramiko - NoValidConnectionsError - periodically unable to connect to aws instance
body: <p>Infrequently upon creating an instance in aws and then trying to connect I receive the following error from paramiko:</p>
  
  <pre><code>NoValidConnectionsError: [Errno None] Unable to connect to port 22 on 192.168.1.155, fe80::18f3:2388:9bf3:e2d%4 or fe80::49f2:7e18:c58d:aac5%5
  </code></pre>
  
  <p>The code to connect to aws via <code>ssh_client_for_instance</code> is:</p>
  
  <pre><code>def wait_instance_available(self):
      err_flag = True
      while err_flag:
          print 'waiting for ssh on ',self.instance
          try:
              self.ssh_client = sshclient_from_instance(self.instance,
                                                   'windows-west-keypair.pem',
                                                   user_name='my-ec2-user')
  
              err_flag = False
          except:
              traceback.print_exc()
              time.sleep(5)
  </code></pre>
  
  <p>Now, I would assume to code just doesn't work but it does connect to <em>some</em> instances I create, just not all.</p>
  
  <p>Anyone have any experience with this?</p>
  
  <p>All instances are created via:</p>
  
  <pre><code>new_instances = ec2_res.create_instances(
      ImageId='ami-********',
      MinCount=15,
      MaxCount=50,
      InstanceType='t2.micro',
      KeyName='windows-west-keypair',
      SecurityGroups=[
          'launch-wizard-2']
      )
  </code></pre>