Examples of DiskOffering


Examples of com.cloud.offering.DiskOffering

                    } else {
                        if (assignedPool.getId() != vol.getPoolId()) {
                            if (s_logger.isDebugEnabled()) {
                                s_logger.debug("Mismatch in storage pool " + assignedPool + " assigned by deploymentPlanner and the one associated with volume " + vol);
                            }
                            DiskOffering diskOffering = _entityMgr.findById(DiskOffering.class, vol.getDiskOfferingId());
                            if (diskOffering.getUseLocalStorage()) {
                                // Currently migration of local volume is not supported so bail out
                                if (s_logger.isDebugEnabled()) {
                                    s_logger.debug("Local volume " + vol + " cannot be recreated on storagepool " + assignedPool + " assigned by deploymentPlanner");
                                }
                                throw new CloudRuntimeException("Local volume " + vol + " cannot be recreated on storagepool " + assignedPool + " assigned by deploymentPlanner");
View Full Code Here

Examples of com.cloud.offering.DiskOffering

        Long templateId = newVol.getTemplateId();
        for (int i = 0; i < 2; i++) {
            // retry one more time in case of template reload is required for Vmware case
            AsyncCallFuture<VolumeApiResult> future = null;
            if (templateId == null) {
                DiskOffering diskOffering = _entityMgr.findById(DiskOffering.class, volume.getDiskOfferingId());
                HypervisorType hyperType = vm.getVirtualMachine().getHypervisorType();

                // update the volume's hypervisor_ss_reserve from its disk offering (used for managed storage)
                updateHypervisorSnapshotReserveForVolume(diskOffering, volume, hyperType);
View Full Code Here

Examples of org.jclouds.cloudstack.domain.DiskOffering

   }

   /** Test requires a custom disk offering to be available */
   public void testCreateVolumeFromCustomDiskOffering() {
      final int size = 1;
      DiskOffering offering = null;
      for (DiskOffering candidate : client.getOfferingClient().listDiskOfferings()) {
         if (candidate.isCustomized()) {
            offering = candidate;
            break;
         }
      }
     
      assertNotNull("No custom disk offering found!", offering);
     
      AsyncCreateResponse job = client.getVolumeClient().createVolumeFromCustomDiskOfferingInZone(
                prefix + "-jclouds-volume", offering.getId(), zoneId, size);
      assertTrue(jobComplete.apply(job.getJobId()));
      logger.info("created volume "+job.getId());
     
      Volume volume = findVolumeWithId(job.getId());
      try {
View Full Code Here

Examples of org.jclouds.cloudstack.domain.DiskOffering

      assert null != response;
      long offeringCount = response.size();
      assertTrue(offeringCount >= 0);
      for (DiskOffering offering : response) {
         try {
           DiskOffering newDetails = Iterables.getOnlyElement(client.getOfferingClient().listDiskOfferings(
               ListDiskOfferingsOptions.Builder.id(offering.getId())));
           assertEquals(offering, newDetails);
           assertEquals(offering, client.getOfferingClient().getDiskOffering(offering.getId()));
           assert offering.getId() != null : offering;
           assert offering.getName() != null : offering;
View Full Code Here

Examples of org.jclouds.cloudstack.domain.DiskOffering

   public void testCreateDiskOffering() throws Exception {
      skipIfNotGlobalAdmin();

      String name = prefix + "-test-create-disk-offering";
      String displayText = name + "-display";
      DiskOffering offering = null;
      try {
         offering = globalAdminClient.getOfferingClient().
            createDiskOffering(name, displayText,
               diskSizeInGB(100).customized(true).tags(ImmutableSet.<String>of("dummy-tag")));

         assertEquals(offering.getName(), name);
         assertEquals(offering.getDisplayText(), displayText);
         checkDiskOffering(offering);

         offering = globalAdminClient.getOfferingClient().
            updateDiskOffering(offering.getId(),
               UpdateDiskOfferingOptions.Builder.name(name + "-2").displayText(displayText + "-2"));

         assertEquals(offering.getName(), name + "-2");
         assertEquals(offering.getDisplayText(), displayText + "-2");
         checkDiskOffering(offering);

      } finally {
         if (offering != null) {
            globalAdminClient.getOfferingClient().deleteDiskOffering(offering.getId());
         }
      }
   }
View Full Code Here

Examples of org.jclouds.cloudstack.domain.DiskOffering

   }

   /** Test requires a custom disk offering to be available */
   public void testCreateVolumeFromCustomDiskOffering() {
      final int size = 1;
      DiskOffering offering = null;
      for (DiskOffering candidate : client.getOfferingApi().listDiskOfferings()) {
         if (candidate.isCustomized()) {
            offering = candidate;
            break;
         }
      }
     
      assertNotNull("No custom disk offering found!", offering);
     
      AsyncCreateResponse job = client.getVolumeApi().createVolumeFromCustomDiskOfferingInZone(
                prefix + "-jclouds-volume", offering.getId(), zoneId, size);
      assertTrue(jobComplete.apply(job.getJobId()));
      logger.info("created volume "+job.getId());
     
      Volume volume = findVolumeWithId(job.getId());
      try {
View Full Code Here

Examples of org.jclouds.cloudstack.domain.DiskOffering

   public void testCreateDiskOffering() throws Exception {
      skipIfNotGlobalAdmin();

      String name = prefix + "-test-create-disk-offering";
      String displayText = name + "-display";
      DiskOffering offering = null;
      try {
         offering = globalAdminClient.getOfferingApi().
            createDiskOffering(name, displayText,
               diskSizeInGB(100).customized(true).tags(ImmutableSet.<String>of("dummy-tag")));

         assertEquals(offering.getName(), name);
         assertEquals(offering.getDisplayText(), displayText);
         checkDiskOffering(offering);

         offering = globalAdminClient.getOfferingApi().
            updateDiskOffering(offering.getId(),
               UpdateDiskOfferingOptions.Builder.name(name + "-2").displayText(displayText + "-2"));

         assertEquals(offering.getName(), name + "-2");
         assertEquals(offering.getDisplayText(), displayText + "-2");
         checkDiskOffering(offering);

      } finally {
         if (offering != null) {
            globalAdminClient.getOfferingApi().deleteDiskOffering(offering.getId());
         }
      }
   }
View Full Code Here

Examples of org.jclouds.cloudstack.domain.DiskOffering

      assert null != response;
      long offeringCount = response.size();
      assertTrue(offeringCount >= 0);
      for (DiskOffering offering : response) {
         try {
           DiskOffering newDetails = Iterables.getOnlyElement(client.getOfferingApi().listDiskOfferings(
               ListDiskOfferingsOptions.Builder.id(offering.getId())));
           assertEquals(offering, newDetails);
           assertEquals(offering, client.getOfferingApi().getDiskOffering(offering.getId()));
           assert offering.getId() != null : offering;
           assert offering.getName() != null : offering;
View Full Code Here

Examples of org.jclouds.cloudstack.domain.DiskOffering

   public void testCreateDiskOffering() throws Exception {
      skipIfNotGlobalAdmin();

      String name = prefix + "-test-create-disk-offering";
      String displayText = name + "-display";
      DiskOffering offering = null;
      try {
         offering = globalAdminClient.getOfferingClient().
            createDiskOffering(name, displayText,
               diskSizeInGB(100).customized(true).tags(ImmutableSet.<String>of("dummy-tag")));

         assertEquals(offering.getName(), name);
         assertEquals(offering.getDisplayText(), displayText);
         checkDiskOffering(offering);

         offering = globalAdminClient.getOfferingClient().
            updateDiskOffering(offering.getId(),
               UpdateDiskOfferingOptions.Builder.name(name + "-2").displayText(displayText + "-2"));

         assertEquals(offering.getName(), name + "-2");
         assertEquals(offering.getDisplayText(), displayText + "-2");
         checkDiskOffering(offering);

      } finally {
         if (offering != null) {
            globalAdminClient.getOfferingClient().deleteDiskOffering(offering.getId());
         }
      }
   }
View Full Code Here

Examples of org.jclouds.cloudstack.domain.DiskOffering

      assert null != response;
      long offeringCount = response.size();
      assertTrue(offeringCount >= 0);
      for (DiskOffering offering : response) {
         try {
           DiskOffering newDetails = Iterables.getOnlyElement(client.getOfferingClient().listDiskOfferings(
               ListDiskOfferingsOptions.Builder.id(offering.getId())));
           assertEquals(offering, newDetails);
           assertEquals(offering, client.getOfferingClient().getDiskOffering(offering.getId()));
           assert offering.getId() != null : offering;
           assert offering.getName() != null : offering;
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.