docs: def check_servers(session, machines, extra_prefix="",
                    force_deploy=False, key_name=None, image_id=None,
                    flavors='m1.medium', network=None, ext_net=None,
                    scheduler_hints=None):
      """Checks the servers status for the deployment.
  
      If needed, it creates new servers and add a floating ip to one of them.
      This server can be used as a gateway to the others.
      """
  
      scheduler_hints = scheduler_hints or []
      nclient = nova.Client(NOVA_VERSION, session=session,
                            region_name=os.environ['OS_REGION_NAME'])
      servers = nclient.servers.list(
          search_opts={'name': '-'.join([DEFAULT_PREFIX, extra_prefix])})
      wanted = _get_total_wanted_machines(machines)
      if force_deploy:
          for server in servers:
              server.delete()
          servers = []
  
      if len(servers) == wanted:
          logger.info("[nova]: Reusing existing servers : %s", servers)
          return servers
      elif len(servers) > 0 and len(servers) < wanted:
          raise Exception("Only %s/%s servers found" % (servers, wanted))
  
      # starting the servers
      total = 0
      for machine in machines:
          number = machine.number
          roles = machine.roles
          logger.info("[nova]: Starting %s servers" % number)
          logger.info("[nova]: for roles %s" % roles)
          logger.info("[nova]: with extra hints %s" % scheduler_hints)
          for _ in range(number):
              flavor = machine.flavour
              if isinstance(flavors, str):
                  flavor = flavors
              else:
                  flavor_to_id, _ = flavors
                  flavor = flavor_to_id[flavor]
  
              if scheduler_hints:
                  _scheduler_hints = \
                      scheduler_hints[total % len(scheduler_hints)]
              else:
                  _scheduler_hints = []
  
              server = nclient.servers.create(
                  name='-'.join([DEFAULT_PREFIX, extra_prefix, str(total)]),
                  image=image_id,
                  flavor=flavor,
                  nics=[{'net-id': network['id']}],
                  key_name=key_name,
                  security_groups=[SECGROUP_NAME],
                  scheduler_hints=_scheduler_hints)
              servers.append(server)
              total = total + 1
      return servers