Examples of VcCluster


Examples of com.vmware.aurora.vc.VcCluster

            } else if (rp.getName().contains("rp%5")) {
               System.out.println("got special char");
               rp.updateConfig("rp\\5", null, null);
            }
            System.out.println(rp);
            VcCluster c = rp.getVcCluster();
            AuAssert.check(c.getId().equals(cluster.getId()));
         }
      }
   }
View Full Code Here

Examples of com.vmware.aurora.vc.VcCluster

   @Test
   public void testVcObjectId() throws Exception {
      for (VcCluster cluster : VcInventory.getClusters()) {
         String id = cluster.getId();
         VcCluster newCluster = VcCache.get(id);
         System.out.println(cluster + ", id=" + newCluster.getId());
         AuAssert.check(cluster.getId().equals(newCluster.getId()));

         for (VcResourcePool rp : cluster.getQualifiedRPs()) {
            VcResourcePool newRp = VcCache.get(rp.getId());
            System.out.println(newRp + ", id=" + newRp.getId());
            AuAssert.check(newRp.getId().equals(rp.getId()));
View Full Code Here

Examples of com.vmware.aurora.vc.VcCluster

      VcResourcePoolEntity rpEntity = node.getVcRp();
      String vcRPName = "";

      try {
         VcCluster cluster =
               VcResourceUtils.findVcCluster(rpEntity.getVcCluster());
         if (!cluster.getConfig().getDRSEnabled()) {
            logger.debug("DRS disabled for cluster " + rpEntity.getVcCluster()
                  + ", put VM under cluster directly.");
            return cluster.getRootRP();
         }
         if (CommonUtil.isBlank(rpEntity.getVcResourcePool())) {
            vcRPName = clusterRpName + "/" + groupName;
         } else {
            vcRPName =
View Full Code Here

Examples of com.vmware.aurora.vc.VcCluster

         throw ClusteringServiceException.ENABLE_FT_FAILED(e, vm.getName());
      }
   }

   public static void disableHa(final VcVirtualMachine vm) throws Exception {
      VcCluster cluster = vm.getResourcePool().getVcCluster();
      boolean clusterHa = cluster.getConfig().getHAEnabled();
      if (!clusterHa) {
         // cluster is not ha enabled, don't need to disable ha again
         return;
      }
      try {
View Full Code Here

Examples of com.vmware.bdd.spectypes.VcCluster

         if (!clusterMap.containsKey(vcCluster.getName())) {
            clusterMap.put(vcCluster.getName(), vcCluster);
            continue;
         }
         List<String> rps = vcCluster.getVcRps();
         VcCluster storedCluster = clusterMap.get(vcCluster.getName());
         if (rps == null)
            continue;
         for (String rp : rps) {
            if (storedCluster.getVcRps().contains(rp)) {
               continue;
            }
            storedCluster.addVCResourcePool(rp);
         }
      }
   }
View Full Code Here

Examples of com.vmware.bdd.spectypes.VcCluster

   private List<VcCluster> convertToVcCluster(List<VcResourcePoolEntity> rps) {
      if (rps == null || rps.isEmpty()) {
         return null;
      }
      List<VcCluster> vcClusters = new ArrayList<VcCluster>();
      VcCluster prevCluster = null;
      for (VcResourcePoolEntity rp : rps) {
         if (prevCluster == null) {
            prevCluster =
                  new VcCluster(rp.getVcCluster(), new ArrayList<String>());
            vcClusters.add(prevCluster);
         }

         if (rp.getVcCluster().equals(prevCluster.getName())) {
            prevCluster.addVCResourcePool(rp.getVcResourcePool());
         } else {
            prevCluster =
                  new VcCluster(rp.getVcCluster(), new ArrayList<String>());
            vcClusters.add(prevCluster);
            prevCluster.addVCResourcePool(rp.getVcResourcePool());
         }
      }
      return vcClusters;
   }
View Full Code Here

Examples of com.vmware.bdd.spectypes.VcCluster

      rpSvc.setRpDao(rpDao);
      rpSvc.setResService(resService);
      List<String> rps = new ArrayList<String>();
      rps.add("rp1");
      rps.add("rp2");
      VcCluster cluster1 = Mockito.mock(VcCluster.class);
      Mockito.when(cluster1.getName()).thenReturn("cluster1");
      Mockito.when(cluster1.getVcRps()).thenReturn(rps);

      List<VcCluster> clusters = new ArrayList<VcCluster>();
      clusters.add(cluster1);

      rpSvc.addAutoResourcePools(clusters, false);
View Full Code Here

Examples of com.vmware.bdd.spectypes.VcCluster

      }

      List<VcCluster> availableVcClusters =
            node.getNodeGroup().getVcClusters(this.cluster);

      VcCluster targetVcCluster = null;

      for (VcCluster vcCluster : availableVcClusters) {
         if (vcCluster.getName().equals(abstractCluster.getName())) {
            targetVcCluster = vcCluster;
            break;
         }
      }

      AuAssert.check(targetVcCluster != null);

      String targetRp =
            getLeastUsed(targetVcCluster.getName(), targetVcCluster.getVcRps());

      Pair<String, String> rpPair =
            new Pair<String, String>(targetVcCluster.getName(), targetRp);
      // update rp usage map
      rpUsage.put(rpPair, rpUsage.get(rpPair) + 1);

      // update cluster->rp by group map
      if (!rpMapByGroup.containsKey(nodeGroupName)) {
         rpMapByGroup.put(nodeGroupName, new HashMap<String, String>());
      }
      Map<String, String> clusterRpMap = rpMapByGroup.get(nodeGroupName);
      clusterRpMap.put(targetVcCluster.getName(), targetRp);

      return rpPair;
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.