Examples of addPool()


Examples of com.cloud.deploy.DeploymentPlanner.ExcludeList.addPool()

  @Override
  public List<StoragePool> allocateToPool(DiskProfile dskCh, VirtualMachineProfile<? extends VirtualMachine> vmProfile, long dcId, long podId, Long clusterId, Long hostId, Set<? extends StoragePool> avoids, int returnUpTo) {
     
      ExcludeList avoid = new ExcludeList();
      for(StoragePool pool : avoids){
        avoid.addPool(pool.getId());
      }
     
      DataCenterDeployment plan = new DataCenterDeployment(dcId, podId, clusterId, hostId, null, null);
      return allocateToPool(dskCh, vmProfile, plan, avoid, returnUpTo);
  }
View Full Code Here

Examples of com.cloud.deploy.DeploymentPlanner.ExcludeList.addPool()

            }
        } else {
            List<StoragePool> availablePool;
            while (!(availablePool = super.allocateToPool(dskCh, vmProfile, plan, myAvoids, 1)).isEmpty()) {
                StoragePool pool = availablePool.get(0);
                myAvoids.addPool(pool.getId());
                List<StoragePoolHostVO> hostsInSPool = _poolHostDao.listByPoolId(pool.getId());
                assert (hostsInSPool.size() == 1) : "Local storage pool should be one host per pool";

                s_logger.debug("Found suitable local storage pool " + pool.getId() + ", adding to list");
                suitablePools.add(pool);
View Full Code Here

Examples of com.cloud.deploy.DeploymentPlanner.ExcludeList.addPool()

        }

        // Get all the suitable pools.
        // Exclude the current pool from the list of pools to which the volume can be migrated.
        ExcludeList avoid = new ExcludeList();
        avoid.addPool(srcVolumePool.getId());

        // Volume stays in the same cluster after migration.
        DataCenterDeployment plan = new DataCenterDeployment(volume.getDataCenterId(), srcVolumePool.getPodId(),
                srcVolumePool.getClusterId(), null, null, null);
        VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm);
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

    }

    @Test
    public void testDoesntAllowMismatchedConsumerTypePools() {
        ActivationKey key = new ActivationKey();
        key.addPool(genPoolForType("system"), 1L);

        Pool pool = genPoolForType("hypervisor");

        ValidationResult result = actKeyRules.runPreActKey(key, pool, new Long(1));
        assertTrue(result.getWarnings().isEmpty());
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

    }

    @Test
    public void testDoesAllowSameConsumerTypePools() {
        ActivationKey key = new ActivationKey();
        key.addPool(genPoolForType("system"), 1L);

        Pool pool = genPoolForType("system");
        ValidationResult result = actKeyRules.runPreActKey(key, pool, new Long(1));
        assertTrue(result.getWarnings().isEmpty());
        assertTrue(result.getErrors().isEmpty());
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

    }

    @Test
    public void testDoesntAllowMismatchedHostRequires() {
        ActivationKey key = new ActivationKey();
        key.addPool(genHostRestricted("host1"), 1L);

        Pool pool = genHostRestricted("host2");

        ValidationResult result = actKeyRules.runPreActKey(key, pool, new Long(1));
        assertTrue(result.getWarnings().isEmpty());
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

    }

    @Test
    public void testDoesAllowSameHostRequires() {
        ActivationKey key = new ActivationKey();
        key.addPool(genHostRestricted("host1"), 1L);

        Pool pool = genHostRestricted("host1");
        ValidationResult result = actKeyRules.runPreActKey(key, pool, new Long(1));
        assertTrue(result.getWarnings().isEmpty());
        assertTrue(result.getErrors().isEmpty());
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

    @Test
    public void testNonMultientOneTwice() {
        ActivationKey key = new ActivationKey();
        Pool pool = genNonMultiEnt();
        key.addPool(pool, 1L);

        ValidationResult result = actKeyRules.runPreActKey(key, pool, new Long(1));
        assertTrue(result.getWarnings().isEmpty());
        assertEquals(1, result.getErrors().size());
        String expected = "rulefailed.already.exists";
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

    }

    @Test
    public void testNullQuantityInstanceAndPhysicalOnly() {
        ActivationKey key = new ActivationKey();
        key.addPool(genInstanceBased(), null);

        ValidationResult result = actKeyRules.runPreActKey(key, genPhysOnlyPool(), new Long(1));
        assertTrue(result.getWarnings().isEmpty());
        assertTrue(result.getErrors().isEmpty());
    }
View Full Code Here

Examples of org.candlepin.model.activationkeys.ActivationKey.addPool()

        poolIds.add(pool.getId());

        List<ActivationKey> keys = new ArrayList<ActivationKey>();
        ActivationKey key1 = new ActivationKey("key1", owner);
        keys.add(key1);
        key1.addPool(pool, 0L);
        key1.setAutoAttach(true);

        Consumer consumer = new Consumer("sys.example.com", null, null, system);
        Set<ConsumerInstalledProduct> cips = new HashSet<ConsumerInstalledProduct>();
        ConsumerInstalledProduct cip = new ConsumerInstalledProduct(prod.getId(), prod.getName());
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.