Пример #1
0
 private int checkAvailability(String vmTypeName, List<Cluster> authorizedClusters)
     throws NotEnoughResourcesException {
   int available = 0;
   for (Cluster authorizedCluster : authorizedClusters) {
     VmTypeAvailability vmAvailability =
         authorizedCluster.getNodeState().getAvailability(vmTypeName);
     available += vmAvailability.getAvailable();
     LOG.info(
         "Availability: "
             + authorizedCluster.getName()
             + " -> "
             + vmAvailability.getAvailable());
   }
   return available;
 }
Пример #2
0
    private int checkZoneAvailability(
        String vmTypeName, Partition partition, List<Cluster> authorizedClusters)
        throws NotEnoughResourcesException {
      int available = 0;
      for (Cluster authorizedCluster : authorizedClusters) {
        if (!authorizedCluster.getConfiguration().lookupPartition().equals(partition)) continue;

        VmTypeAvailability vmAvailability =
            authorizedCluster.getNodeState().getAvailability(vmTypeName);
        available += vmAvailability.getAvailable();
        LOG.info(
            "Availability: "
                + authorizedCluster.getName()
                + " -> "
                + vmAvailability.getAvailable());
      }
      return available;
    }