private String getMissingOperationalClusterNetworks(VDS host, List<Network> clusterNetworks) {
    List<String> networkNames = new ArrayList<>();

    for (Network net : clusterNetworks) {
      if (net.getCluster().getStatus() == OPERATIONAL
          && net.getCluster().isRequired()
          && !host.getNetworkNames().contains(net.getName())) {
        networkNames.add(net.getName());
      }
    }
    return StringUtils.join(networkNames, ",");
  }
示例#2
0
  private String getMigrationNetworkIp() {

    if (!FeatureSupported.migrationNetwork(getVm().getVdsGroupCompatibilityVersion())) {
      return null;
    }

    Network migrationNetwork = null;

    // Find migrationNetworkCluster
    List<Network> allNetworksInCluster = getNetworkDao().getAllForCluster(getVm().getVdsGroupId());

    for (Network tempNetwork : allNetworksInCluster) {
      if (tempNetwork.getCluster().isMigration()) {
        migrationNetwork = tempNetwork;
        break;
      }
    }

    if (migrationNetwork != null) {

      // assure migration network is active on source host
      if (getMigrationNetworkAddress(getVds().getId(), migrationNetwork.getName()) == null) {
        return null;
      }

      // find migration IP address on destination host
      return getMigrationNetworkAddress(getDestinationVds().getId(), migrationNetwork.getName());
    }

    return null;
  }
示例#3
0
  /** Returns the cluster's display network */
  public static Network getDisplayNetwork(Collection<Network> clusterNetworks) {
    Network displayNetwork = null;

    for (Network network : clusterNetworks) {
      if (network.getCluster().isDisplay()) {
        displayNetwork = network;
        break;
      }
    }

    return displayNetwork;
  }
  private Network findDisplayNetwork(Guid clusterId, Collection<Network> networks) {
    Network managementNetwork = null;
    for (Network network : networks) {
      if (network.getCluster().isDisplay()) {
        return network;
      }
      if (managementNetworkUtil.isManagementNetwork(network.getId(), clusterId)) {
        managementNetwork = network;
      }
    }

    return managementNetwork;
  }