docs: def wait_for_sshd(cls, vm_id):
          """Insist on having the vm booted and sshd
          listening"""
          cls.echo('Waiting for the vm to come online')
          version, ip_addr = cls.vm_ip(vm_id)
          give_up = time.time() + 300
          last_error = None
          while time.time() < give_up:
              try:
                  inet = socket.AF_INET
                  if version == 6:
                      inet = socket.AF_INET6
                  sd = socket.socket(inet, socket.SOCK_STREAM,
                                     socket.IPPROTO_TCP)
                  sd.settimeout(5)
                  sd.connect((ip_addr, 22))
                  sd.recv(1024)
                  return
              except socket.error as err:
                  if err.errno == errno.EHOSTUNREACH and version == 6:
                      cls.error('%s is not reachable, you may be missing '
                                'IPv6 connectivity' % ip_addr)
                  last_error = err
                  time.sleep(1)
              except Exception as err:
                  last_error = err
                  time.sleep(1)
          cls.error('VM did not spin up (last error: %s)' % last_error)