Examples of DriveInfo


Examples of org.jclouds.cloudsigma.domain.DriveInfo

   @Test
   public void testGetDrive() throws Exception {
      for (String driveUUID : client.listStandardDrives()) {
         assert !"".equals(driveUUID);
         DriveInfo drive = client.getDriveInfo(driveUUID);
         assertNotNull(drive);
         assert !drive.getType().equals(DriveType.UNRECOGNIZED) : drive;
         if (drive.getType() == DriveType.DISK && drive.getDriveType().contains("preinstalled"))
            System.out.println(drive.getName());
      }
   }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

   @Test
   public void testCreateDrive() throws Exception {
      drive = client.createDrive(new CreateDriveRequest.Builder().name(prefix).size(driveSize).build());
      checkCreatedDrive();

      DriveInfo newInfo = client.getDriveInfo(drive.getUuid());
      checkDriveMatchesGet(newInfo);

   }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

   }

   @Test(dependsOnMethods = "testCreateDrive")
   public void testSetDriveData() throws Exception {

      DriveInfo drive2 = client.setDriveData(
            drive.getUuid(),
            new DriveData.Builder().claimType(ClaimType.SHARED).name("rediculous")
                  .readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))
                  .use(ImmutableSet.of("networking", "security", "gateway")).build());

      assertNotNull(drive2.getUuid(), drive.getUuid());
      assertEquals(drive2.getName(), "rediculous");
      assertEquals(drive2.getClaimType(), ClaimType.SHARED);
      assertEquals(drive2.getReaders(), ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"));
      assertEquals(drive2.getUse(), ImmutableSet.of("networking", "security", "gateway"));
      drive = drive2;
   }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

      drive = client.cloneDrive(imageId, drive.getName(),
            new CloneDriveOptions().size(driveSize).tags("cat:mouse", "monkey:banana"));
      // Block until the async clone operation has completed.
      assert driveNotClaimed.apply(drive) : client.getDriveInfo(drive.getUuid());

      DriveInfo clonedDrive = client.getDriveInfo(drive.getUuid());
      System.err.println("after prepare" + clonedDrive);
      assertEquals(clonedDrive.getTags(), ImmutableSet.of("cat:mouse", "monkey:banana"));
   }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

         CloudSigmaTemplateOptions options = CloudSigmaTemplateOptions.class.cast(template.getOptions());
         affinityType = options.getDiskDriveAffinity();
      }
      logger.debug(">> imaging boot drive source(%s) bytes(%d) affinityType(%s)",
         template.getImage().getId(), bootSize, affinityType);
      DriveInfo drive = client.cloneDrive(template.getImage().getId(), template.getImage().getId(),
         new CloneDriveOptions().size(bootSize).affinity(affinityType));
      boolean success = driveNotClaimed.apply(drive);
      logger.debug("<< image(%s) complete(%s)", drive.getUuid(), success);
      if (!success) {
         client.destroyDrive(drive.getUuid());
         throw new IllegalStateException("could not image drive in time!");
      }

      Server toCreate = Servers.small(name, drive.getUuid(), defaultVncPassword).mem(template.getHardware().getRam())
            .cpu((int) (template.getHardware().getProcessors().get(0).getSpeed())).build();

      logger.debug(">> creating server");
      ServerInfo from = client.createServer(toCreate);
      logger.debug("<< created server(%s)", from.getUuid());
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

         // Note: I wanted to use node.getHardware().getVolumes() but there is no
         // way to go from a Volume to a DriveInfo

         ServerInfo serverInfo = api.getServerInfo(node.getId());
         Device rootDevice = get(serverInfo.getDevices().values(), 0);
         DriveInfo driveInfo = api.getDriveInfo(rootDevice.getDriveUuid());
         assertTrue(contains(driveInfo.getTags(), "affinity:ssd"));

      } finally {
         client.destroyNodesMatching(inGroup(group));
      }
   }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

         CloudSigmaTemplateOptions options = CloudSigmaTemplateOptions.class.cast(template.getOptions());
         affinityType = options.getDiskDriveAffinity();
      }
      logger.debug(">> imaging boot drive source(%s) bytes(%d) affinityType(%s)",
         template.getImage().getId(), bootSize, affinityType);
      DriveInfo drive = client.cloneDrive(template.getImage().getId(), template.getImage().getId(),
         new CloneDriveOptions().size(bootSize).affinity(affinityType));
      boolean success = driveNotClaimed.apply(drive);
      logger.debug("<< image(%s) complete(%s)", drive.getUuid(), success);
      if (!success) {
         client.destroyDrive(drive.getUuid());
         throw new IllegalStateException("could not image drive in time!");
      }

      Server toCreate = Servers.small(name, drive.getUuid(), defaultVncPassword).mem(template.getHardware().getRam())
            .cpu((int) (template.getHardware().getProcessors().get(0).getSpeed())).build();

      logger.debug(">> creating server");
      ServerInfo from = client.createServer(toCreate);
      logger.debug("<< created server(%s)", from.getUuid());
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

         String imageId = null;
         String bootDeviceId = Iterables.get(from.getBootDeviceIds(), 0);
         Device bootDevice = from.getDevices().get(bootDeviceId);
         if (bootDevice != null) {
            try {
               DriveInfo drive = cache.getUnchecked(bootDevice.getDriveUuid());
               imageId = drive.getName();
            } catch (NullPointerException e) {
               logger.debug("drive %s not found", bootDevice.getDriveUuid());
            } catch (UncheckedExecutionException e) {
               logger.warn(e, "error finding drive %s: %s", bootDevice.getDriveUuid(), e.getMessage());
            }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

      @Override
      public Volume apply(Device input) {
         VolumeBuilder builder = new VolumeBuilder();
         builder.id(input.getId());
         try {
            DriveInfo drive = cache.getUnchecked(input.getDriveUuid());
            builder.size((float) drive.getSize());
         } catch (NullPointerException e) {
            logger.debug("drive %s not found", input.getDriveUuid());
         } catch (UncheckedExecutionException e) {
            logger.warn(e, "error finding drive %s: %s", input.getDriveUuid(), e.getMessage());
         }
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.DriveInfo

         // Note: I wanted to use node.getHardware().getVolumes() but there is no
         // way to go from a Volume to a DriveInfo

         ServerInfo serverInfo = api.getServerInfo(node.getId());
         Device rootDevice = get(serverInfo.getDevices().values(), 0);
         DriveInfo driveInfo = api.getDriveInfo(rootDevice.getDriveUuid());
         assertTrue(contains(driveInfo.getTags(), "affinity:ssd"));

      } finally {
         client.destroyNodesMatching(inGroup(group));
      }
   }
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.