Package com.vmware.bdd.placement.entity.AbstractDatacenter

Examples of com.vmware.bdd.placement.entity.AbstractDatacenter.AbstractDatastore


      int index = 0;
      int remain = separable.getSize();
      List<DiskSpec> disks = new ArrayList<DiskSpec>();

      for (; i < datastores.size(); i++) {
         AbstractDatastore ds = datastores.get(i);
         if (ds.getFreeSpace() == 0)
            continue;

         int size = remain;
         if (remain > ds.getFreeSpace()) {
            size = ds.getFreeSpace();
         }
         remain -= size;

         DiskSpec subDisk = new DiskSpec(separable);
         subDisk.setSize(size);
         subDisk.setSeparable(false);
         subDisk.setTargetDs(ds.getName());
         // new name with index as suffix, e.g., DATA1.vmdk
         subDisk.setName(separable.getName().split("\\.")[0] + index + ".vmdk");

         disks.add(subDisk);
         ds.allocate(size);
         index++;
         if (remain == 0)
            break;
      }
      // not enough space to place this disk
View Full Code Here

TOP

Related Classes of com.vmware.bdd.placement.entity.AbstractDatacenter.AbstractDatastore

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.