use of com.amazonaws.services.ec2.model.DiskInfo 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);
}
}
}
Aggregations