Package com.vmware.bdd.apitypes

Examples of com.vmware.bdd.apitypes.InstanceType


   private static final Logger logger = Logger.getLogger(CommonClusterExpandPolicy.class);

   public static void expandGroupInstanceType(NodeGroupEntity ngEntity, NodeGroupCreate group,
         Set<String> sharedPattern, Set<String> localPattern, SoftwareManager softwareManager) {
      logger.debug("Expand instance type config for group " + ngEntity.getName());
      InstanceType instanceType = ngEntity.getNodeType();
      int memory = ngEntity.getMemorySize();
      int cpu = ngEntity.getCpuNum();
      if (instanceType == null && (cpu == 0 || memory == 0)) {
         throw ClusterConfigException.INSTANCE_SIZE_NOT_SET(group.getName());
      }
      if (instanceType == null) {
         logger.debug("instance type is not set.");
         if (softwareManager.hasMgmtRole(group.getRoles())) {
            instanceType = InstanceType.MEDIUM;
         } else {
            instanceType = InstanceType.SMALL;
         }
         ngEntity.setNodeType(instanceType);
      } else {
         logger.debug("instance type is " + instanceType.toString());
      }
      if (group.getStorage().getSizeGB() <= 0) {
         GroupType groupType = null;
         if (softwareManager.hasMgmtRole(group.getRoles())) {
            groupType = GroupType.MANAGEMENTGROUP;
         } else {
            groupType = GroupType.WORKGROUP;
         }
         ngEntity.setStorageSize(ExpandUtils.getStorage(instanceType, groupType));
         logger.debug("CommonClusterExpandPolicy::expandGroupInstanceType:storage size is setting to default value: "
               + ngEntity.getStorageSize());
      } else {
         ngEntity.setStorageSize(group.getStorage().getSizeGB());
      }
      if (memory == 0) {
         ngEntity.setMemorySize(instanceType.getMemoryMB());
      }
      if (cpu == 0) {
         ngEntity.setCpuNum(instanceType.getCpuNum());
      }

      // storage
      logger.debug("storage size is set to : " + ngEntity.getStorageSize());
      if (ngEntity.getStorageType() == null) {
View Full Code Here

TOP

Related Classes of com.vmware.bdd.apitypes.InstanceType

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.