protected void buildVmNetworkCluster() {
   // set Display network
   List<NetworkCluster> all =
       DbFacade.getInstance().getNetworkClusterDao().getAllForCluster(vm.getVdsGroupId());
   NetworkCluster networkCluster = null;
   for (NetworkCluster tempNetworkCluster : all) {
     if (tempNetworkCluster.isDisplay()) {
       networkCluster = tempNetworkCluster;
       break;
     }
   }
   if (networkCluster != null) {
     Network net = null;
     List<Network> allNetworks = DbFacade.getInstance().getNetworkDao().getAll();
     for (Network tempNetwork : allNetworks) {
       if (tempNetwork.getId().equals(networkCluster.getNetworkId())) {
         net = tempNetwork;
         break;
       }
     }
     if (net != null) {
       createInfo.put(VdsProperties.DISPLAY_NETWORK, net.getName());
     }
   }
 }
Exemple #2
0
 /**
  * returns whether the network has a role in the cluster
  *
  * @param networkCluster
  * @return whether the network has a role (display, migration or gluster) in the cluster
  */
 public static boolean isRoleNetwork(NetworkCluster networkCluster) {
   return networkCluster.isDisplay() || networkCluster.isMigration() || networkCluster.isGluster();
 }