I use Apache Brooklyn in combination with jCloud EC2 to create ec2 instances on AWS.
ec2 instance setting:
- region: eu-central-1 (Frankfurt)
- imageId: ami-10d1367f
- Name: amzn-ami-minimal-hvm-2016.03.0.x86_64-s3
- RootDeviceType: instance-store
- VirtualizationType: hvm
- hardwareId: d2x_large
- vCPU: 4
- Memory: 30,5 GB
- Storage: 3x2000 GB
Everytime when I create a ec2 instance the root partition has only 10GB disc space. I found the problem in the jCloud [ECHardwareBuilder]:(https://github.com/jclouds/jclouds/blob/master/apis/ec2/src/main/java/org/jclouds/ec2/compute/domain/EC2HardwareBuilder.java#L731)
/**
* @see InstanceType#D2_XLARGE
*/
public static EC2HardwareBuilder d2_xlarge() {
return new EC2HardwareBuilder(InstanceType.D2_XLARGE).d2()
.ram(31232)`enter code here`
.processors(ImmutableList.of(new Processor(4.0, 3.5)))
.volumes(ImmutableList.<Volume>of(
new VolumeBuilder().type(LOCAL).size(10.0f).device("/dev/sda1").bootDevice(true).durable(false).build(),
new VolumeBuilder().type(LOCAL).size(2000.0f).device("/dev/sdb").bootDevice(false).durable(false).build(),
new VolumeBuilder().type(LOCAL).size(2000.0f).device("/dev/sdc").bootDevice(false).durable(false).build(),
new VolumeBuilder().type(LOCAL).size(2000.0f).device("/dev/sdd").bootDevice(false).durable(false).build()))
.is64Bit(true);
}
My questions are:
- Is it possible to create my own class which extends EC2HardwareBuilder, so that I can change the root volume size to 2000?
- How can inject this class to brooklyn, so that it will be used instead of the old EC2HardwareBuilder class?