Search in sources :

Example 1 with InstanceStorageInfo

use of com.amazonaws.services.ec2.model.InstanceStorageInfo in project cloudbreak by hortonworks.

the class AwsPlatformResources method getVmTypesWithAwsCall.

private void getVmTypesWithAwsCall(Set<VmType> awsInstances, DescribeInstanceTypesResult describeInstanceTypesResult) {
    for (InstanceTypeInfo instanceType : describeInstanceTypesResult.getInstanceTypes()) {
        if (!instanceType.isBareMetal()) {
            VmTypeMetaBuilder vmTypeMetaBuilder = VmTypeMetaBuilder.builder().withCpuAndMemory(instanceType.getVCpuInfo().getDefaultVCpus(), getMemory(instanceType)).withMagneticConfig(new VolumeParameterConfig(MAGNETIC, MINIMUM_MAGNETIC_SIZE, MAXIMUM_MAGNETIC_SIZE, ONE, TWENTY_FOUR)).withSsdConfig(new VolumeParameterConfig(SSD, MINIMUM_SSD_SIZE, MAXIMUM_SSD_SIZE, ONE, TWENTY_FOUR)).withSt1Config(new VolumeParameterConfig(ST1, MINIMUM_ST1_SIZE, MAXIMUM_ST1_SIZE, ONE, TWENTY_FOUR));
            if (instanceType.getInstanceStorageSupported()) {
                InstanceStorageInfo instanceStorageInfo = instanceType.getInstanceStorageInfo();
                DiskInfo diskInfo = instanceStorageInfo.getDisks().get(0);
                vmTypeMetaBuilder.withEphemeralConfig(new VolumeParameterConfig(EPHEMERAL, diskInfo.getSizeInGB().intValue(), diskInfo.getSizeInGB().intValue(), diskInfo.getCount(), diskInfo.getCount()));
            }
            if (getEncryptionSupported(instanceType)) {
                vmTypeMetaBuilder.withVolumeEncryptionSupport(true);
            }
            VmType vmType = vmTypeWithMeta(instanceType.getInstanceType(), vmTypeMetaBuilder.create(), true);
            awsInstances.add(vmType);
        }
    }
}
Also used : VmTypeMetaBuilder(com.sequenceiq.cloudbreak.cloud.model.VmTypeMeta.VmTypeMetaBuilder) DiskInfo(com.amazonaws.services.ec2.model.DiskInfo) VmType(com.sequenceiq.cloudbreak.cloud.model.VmType) InstanceStorageInfo(com.amazonaws.services.ec2.model.InstanceStorageInfo) InstanceTypeInfo(com.amazonaws.services.ec2.model.InstanceTypeInfo) VolumeParameterConfig(com.sequenceiq.cloudbreak.cloud.model.VolumeParameterConfig)

Aggregations

DiskInfo (com.amazonaws.services.ec2.model.DiskInfo)1 InstanceStorageInfo (com.amazonaws.services.ec2.model.InstanceStorageInfo)1 InstanceTypeInfo (com.amazonaws.services.ec2.model.InstanceTypeInfo)1 VmType (com.sequenceiq.cloudbreak.cloud.model.VmType)1 VmTypeMetaBuilder (com.sequenceiq.cloudbreak.cloud.model.VmTypeMeta.VmTypeMetaBuilder)1 VolumeParameterConfig (com.sequenceiq.cloudbreak.cloud.model.VolumeParameterConfig)1