Package com.vmware.bdd.placement.entity

Examples of com.vmware.bdd.placement.entity.AbstractDatacenter$AbstractHost


      logger.info(json);

      ObjectMapper mapper = new ObjectMapper();

      try {
         AbstractDatacenter dc = mapper.readValue(json, AbstractDatacenter.class);

         // replace the abstract datastore objects in cluster/host with the ones
         // in dc.datastores
         for (AbstractCluster cluster : dc.getClusters()) {
            // replace datastores in cluster level
            List<AbstractDatastore> dsList = new ArrayList<AbstractDatastore>();
            for (AbstractDatastore datastore : cluster.getDatastores()) {
               AbstractDatastore ds =
                     dc.findAbstractDatastore(datastore.getName());
               AuAssert.check(ds != null);
               dsList.add(ds);
            }
            cluster.setDatastores(dsList);

            // replace datastores in host level
            for (AbstractHost host : cluster.getHosts()) {
               List<AbstractDatastore> datastores =
                     new ArrayList<AbstractDatastore>();
               for (AbstractDatastore datastore : host.getDatastores()) {
                  AbstractDatastore ds =
                        dc.findAbstractDatastore(datastore.getName());
                  AuAssert.check(ds != null);
                  datastores.add(ds);
               }
               host.setDatastores(datastores);
               host.setParent(cluster);
            }
         }
         Assert.assertTrue(dc.findAbstractCluster("cluster-ws") != null,
               "cluster-ws is missing, datacenter spec is not correctly resolved");
         return dc;
      } catch (Exception e) {
         logger.error(e.getMessage());
         throw e;
View Full Code Here


   @Test
   public void testDefaultCluster() throws Exception {
      ClusterCreate spec =
            TestPlacementUtil
                  .getSimpleClusterSpec(TestPlacementUtil.SIMPLE_CLUSTER_SPEC);
      AbstractDatacenter dc =
            TestPlacementUtil
                  .getAbstractDatacenter(TestPlacementUtil.DATACENTER_SPEC);

      Container container = new Container(dc);
      container.SetTemplateNode(TestPlacementUtil.getTemplateNode());
View Full Code Here

   @Test
   public void testClusterWithStrictAssociation() throws Exception {
      ClusterCreate spec =
            TestPlacementUtil
                  .getSimpleClusterSpec(TestPlacementUtil.DC_SPLIT_CLUSTER_SPEC);
      AbstractDatacenter dc =
            TestPlacementUtil
                  .getAbstractDatacenter(TestPlacementUtil.DATACENTER_SPEC);

      Container container = new Container(dc);
      container.SetTemplateNode(TestPlacementUtil.getTemplateNode());
View Full Code Here

   @Test
   public void testResumeClusterWithStrictAssociation() throws Exception {
      ClusterCreate cluster =
            TestPlacementUtil
                  .getSimpleClusterSpec(TestPlacementUtil.DC_SPLIT_CLUSTER_SPEC);
      AbstractDatacenter dc =
            TestPlacementUtil
                  .getAbstractDatacenter(TestPlacementUtil.DATACENTER_SPEC);

      Container container = new Container(dc);
      container.SetTemplateNode(TestPlacementUtil.getTemplateNode());
View Full Code Here

      // increase data group's instance number by 1
      cluster.getNodeGroup("data").setInstanceNum(
            cluster.getNodeGroup("data").getInstanceNum() + 1);

      AbstractDatacenter dc =
            TestPlacementUtil
                  .getAbstractDatacenter(TestPlacementUtil.RESIZE_DATACENTER_SPEC);

      Container container = new Container(dc);
      container.SetTemplateNode(TestPlacementUtil.getTemplateNode());
View Full Code Here

   @Test
   public void testRRRackPolicy() throws Exception {
      ClusterCreate cluster =
            TestPlacementUtil
                  .getSimpleClusterSpec(TestPlacementUtil.WITH_RACK_CLUSTER_SPEC);
      AbstractDatacenter dc =
            TestPlacementUtil
                  .getAbstractDatacenter(TestPlacementUtil.RESIZE_DATACENTER_SPEC);

      Container container = new Container(dc);
      container.SetTemplateNode(TestPlacementUtil.getTemplateNode());
View Full Code Here

   @Test
   public void testSameRackPolicy() throws Exception {
      ClusterCreate cluster =
            TestPlacementUtil
                  .getSimpleClusterSpec(TestPlacementUtil.WITH_SAME_RACK_CLUSTER_SPEC);
      AbstractDatacenter dc =
            TestPlacementUtil
                  .getAbstractDatacenter(TestPlacementUtil.RESIZE_DATACENTER_SPEC);

      Container container = new Container(dc);
      container.SetTemplateNode(TestPlacementUtil.getTemplateNode());
View Full Code Here

   @Test
   public void testFilteredHosts() throws Exception {
      ClusterCreate spec =
            TestPlacementUtil
                  .getSimpleClusterSpec(TestPlacementUtil.SIMPLE_CLUSTER_SPEC);
      AbstractDatacenter dc =
            TestPlacementUtil
                  .getAbstractDatacenter(TestPlacementUtil.DATACENTER_SPEC);

      Container container = new Container(dc);
      container.SetTemplateNode(TestPlacementUtil.getTemplateNode());
View Full Code Here

   @Test
   public void testRRRackPolicyFailure() throws Exception {
      ClusterCreate cluster =
            TestPlacementUtil
                  .getSimpleClusterSpec(TestPlacementUtil.RACK_FAILURE_CLUSTER_SPEC);
      AbstractDatacenter dc =
            TestPlacementUtil
                  .getAbstractDatacenter(TestPlacementUtil.RACK_FAILURE_DATACENTER_SPEC);

      Container container = new Container(dc);
      container.SetTemplateNode(TestPlacementUtil.getTemplateNode());
View Full Code Here

   private AbstractDatacenter dc;
   private BaseNode templateNode;
   private Map<String, String> hostToRackMap;

   public Container() {
      this.dc = new AbstractDatacenter("abstractDC");
   }
View Full Code Here

TOP

Related Classes of com.vmware.bdd.placement.entity.AbstractDatacenter$AbstractHost

Copyright © 2018 www.massapicom. 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.