Package com.vmware.bdd.spectypes

Examples of com.vmware.bdd.spectypes.DiskSpec


                  "Cannot find a datastore with enough space to place disk "
                        + disk.getName() + " of size " + disk.getSize()
                        + " GB");
         }

         DiskSpec replacement = new DiskSpec(disk);
         replacement.setTargetDs(ads.getName());
         replacement.setVmdkPath(null);
         replacements.add(replacement);

         // deduct space
         ads.allocate(requiredSize);
         // increase reference by 1
View Full Code Here


   private void convertTemplateVm() {
      templateNode = new BaseNode(templateVm.getName());
      List<DiskSpec> diskSpecs = new ArrayList<DiskSpec>();
      for (DeviceId slot : templateVm.getVirtualDiskIds()) {
         VirtualDisk vmdk = (VirtualDisk) templateVm.getVirtualDevice(slot);
         DiskSpec spec = new DiskSpec();
         spec.setSize((int) (vmdk.getCapacityInKB() / (1024 * 1024)));
         spec.setDiskType(DiskType.SYSTEM_DISK);
         spec.setController(DiskScsiControllerType.LSI_CONTROLLER);
         diskSpecs.add(spec);
      }
      templateNode.setDisks(diskSpecs);
   }
View Full Code Here

   public static BaseNode getTemplateNode() {
      BaseNode template = new BaseNode("template-node");

      List<DiskSpec> disks = new ArrayList<DiskSpec>();

      DiskSpec systemDisk = new DiskSpec();
      systemDisk.setName("OS.vmdk");
      systemDisk.setSeparable(false);
      systemDisk.setDiskType(DiskType.SYSTEM_DISK);
      systemDisk.setSize(SYSTEM_DISK_SIZE);

      disks.add(systemDisk);
      template.setDisks(disks);
      return template;
   }
View Full Code Here

   @Test
   public void testPlaceUnSeparableDisks() throws Exception {
      PlacementPlanner placementPlanner = new PlacementPlanner();

      List<DiskSpec> diskSpecs = new ArrayList<DiskSpec>();
      DiskSpec diskSpec = new DiskSpec();
      diskSpec.setName("diskSpec");
      diskSpec.setSize(40);
      diskSpecs.add(diskSpec);

      //5 Datastores with 5G, 10G, 20G, 30G, 50G free space
      List<AbstractDatastore> datastores = new ArrayList<AbstractDatastore>();
      AbstractDatastore datastore = new AbstractDatastore("datastore1", 5);
View Full Code Here

   @Test
   public void testEvenSpliter() throws Exception {
      PlacementPlanner placementPlanner = new PlacementPlanner();

      DiskSpec diskSpec = new DiskSpec();
      diskSpec.setName("diskSpec");
      diskSpec.setSize(50);

      //5 Datastores with 5G, 10G, 20G, 30G, 50G free space
      List<AbstractDatastore> datastores = new ArrayList<AbstractDatastore>();
      AbstractDatastore datastore = new AbstractDatastore("datastore1", 5);
      datastores.add(datastore);
View Full Code Here

   @Test
   public void testAggregateSpliter() throws Exception {
      PlacementPlanner placementPlanner = new PlacementPlanner();

      DiskSpec diskSpec = new DiskSpec();
      diskSpec.setName("diskSpec");
      diskSpec.setSize(70);

      //5 Datastores with 5G, 10G, 20G, 30G, 50G free space
      List<AbstractDatastore> datastores = new ArrayList<AbstractDatastore>();
      AbstractDatastore datastore = new AbstractDatastore("datastore1", 5);
      datastores.add(datastore);
View Full Code Here

   @Test
   public void testEvenSpliterWithMinimumSpace() throws Exception {
      PlacementPlanner placementPlanner = new PlacementPlanner();

      DiskSpec diskSpec = new DiskSpec();
      diskSpec.setName("diskSpec");
      diskSpec.setSize(10);

      //5 Datastores with 5G, 10G, 20G, 30G, 50G free space
      List<AbstractDatastore> datastores = new ArrayList<AbstractDatastore>();
      AbstractDatastore datastore = new AbstractDatastore("datastore1", 10);
      datastores.add(datastore);
View Full Code Here

      return disk;
   }

   public DiskSpec toDiskSpec() {
      DiskSpec spec = new DiskSpec();
      spec.setName(this.name);
      spec.setAllocType(this.allocType);
      spec.setDiskMode(this.diskMode);
      spec.setDiskType(DiskType.getDiskType(this.diskType));
      spec.setExternalAddress(this.externalAddress);
      spec.setSize(this.sizeInMB / 1024);
      spec.setSeparable(false);
      spec.setTargetDs(this.getDatastoreName());
      spec.setVmdkPath(this.vmdkPath);

      return spec;
   }
View Full Code Here

      boolean result = VcVmUtil.runSPOnSingleVM(node, callable);
      Assert.assertTrue(result, "Should get true, but got " + result);
   }

   private List<DiskSpec> getDiskSpec() {
      DiskSpec disk = new DiskSpec();
      disk.setName("OS");
      disk.setDiskType(DiskType.SYSTEM_DISK);
      disk.setSize(20);
      disk.setAllocType("THIN");
      disk.setVmdkPath("[ds]");
      disk.setDiskMode(DiskMode.nonpersistent.name());
      List<DiskSpec> diskSet = new ArrayList<DiskSpec>();
      diskSet.add(disk);
      return diskSet;
   }
View Full Code Here

      BaseNode node = new BaseNode(vmName, nodeGroup, cluster);

      // initialize disks
      List<DiskSpec> disks = new ArrayList<DiskSpec>();

      DiskSpec systemDisk = new DiskSpec(templateNode.getDisks().get(0));
      /*
       * TRICK: here we count the size of vswp file into the system disk size, as the
       * vswp file will be put together with system disk.
       */
      Integer memCapa = nodeGroup.getMemCapacityMB();
      memCapa = (memCapa == null) ? 0 : memCapa;
      systemDisk.setSize(systemDisk.getSize() + (memCapa + 1023) / 1024);

      systemDisk.setDiskType(DiskType.SYSTEM_DISK);
      systemDisk.setSeparable(false);
      disks.add(systemDisk);
      AllocationType diskAllocType = null;
      if (nodeGroup.getStorage().getAllocType() != null) {
         diskAllocType =
               AllocationType.valueOf(nodeGroup.getStorage().getAllocType());
      } else {
         // THICK as by default
         diskAllocType = AllocationType.THICK;
      }
      // swap disk
      int swapDisk =
            (((int) Math.ceil(nodeGroup.getMemCapacityMB()
                  * nodeGroup.getSwapRatio()) + 1023) / 1024);
      disks.add(new DiskSpec(DiskType.SWAP_DISK.getDiskName(), swapDisk, node
            .getVmName(), false, DiskType.SWAP_DISK,
            DiskScsiControllerType.LSI_CONTROLLER, null, diskAllocType
                  .toString(), null, null, null));

      // data disks
      if (!DatastoreType.TEMPFS.name().equalsIgnoreCase(
            nodeGroup.getStorage().getType())) {
         // no need to add data disk for storage type tempfs
         disks.add(new DiskSpec(DiskType.DATA_DISK.getDiskName(), nodeGroup
               .getStorage().getSizeGB(), node.getVmName(), true,
               DiskType.DATA_DISK, nodeGroup.getStorage().getControllerType(),
               nodeGroup.getStorage().getSplitPolicy(), diskAllocType
                     .toString(), null, null, null));
      }
View Full Code Here

TOP

Related Classes of com.vmware.bdd.spectypes.DiskSpec

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.