From de3db2103dc46dfbfb011273f7de77480429acd4 Mon Sep 17 00:00:00 2001 From: vijaykiran Date: Tue, 24 Jul 2012 23:56:06 +0200 Subject: [PATCH] issue-1026 Support for aws-ec2 hi1.4x instance --- .../ec2/compute/domain/EC2HardwareBuilder.java | 8 ++++++++ .../java/org/jclouds/ec2/domain/InstanceType.java | 13 +++++++++++++ .../compute/suppliers/AWSEC2HardwareSupplier.java | 3 ++- .../ec2/services/PlacementGroupClientLiveTest.java | 4 +++- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/apis/ec2/src/main/java/org/jclouds/ec2/compute/domain/EC2HardwareBuilder.java b/apis/ec2/src/main/java/org/jclouds/ec2/compute/domain/EC2HardwareBuilder.java index 7a7a3587c5..a26f555e5e 100644 --- a/apis/ec2/src/main/java/org/jclouds/ec2/compute/domain/EC2HardwareBuilder.java +++ b/apis/ec2/src/main/java/org/jclouds/ec2/compute/domain/EC2HardwareBuilder.java @@ -352,6 +352,14 @@ public class EC2HardwareBuilder extends HardwareBuilder { .virtualizationType(VirtualizationType.HVM); } + public static EC2HardwareBuilder hi1_4xlarge() { + return new EC2HardwareBuilder(InstanceType.HI1_4XLARGE) + .ram(60 * 1024 + 512) + .processors(ImmutableList.of(new Processor(8.0, 5.5), new Processor(8.0, 5.5))) + .volumes(ImmutableList. of(new VolumeImpl(1024.0f, "/dev/sda1", true, false), + new VolumeImpl(1024.0f, "/dev/sdb", false, false))); + } + @SuppressWarnings("unchecked") @Override public Hardware build() { diff --git a/apis/ec2/src/main/java/org/jclouds/ec2/domain/InstanceType.java b/apis/ec2/src/main/java/org/jclouds/ec2/domain/InstanceType.java index 4d56268ed1..bb7dec550b 100644 --- a/apis/ec2/src/main/java/org/jclouds/ec2/domain/InstanceType.java +++ b/apis/ec2/src/main/java/org/jclouds/ec2/domain/InstanceType.java @@ -186,4 +186,17 @@ public class InstanceType { */ public static final String CC2_8XLARGE = "cc2.8xlarge"; + /** + * High I/O Quadruple Extra Large specifications + * + */ + public static final String HI1_4XLARGE = "hi1.4xlarge"; + } diff --git a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2HardwareSupplier.java b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2HardwareSupplier.java index ac6beb452c..a20f3d32ab 100644 --- a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2HardwareSupplier.java +++ b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/suppliers/AWSEC2HardwareSupplier.java @@ -23,6 +23,7 @@ import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.c1_xlarge; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.cc1_4xlarge; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.cc2_8xlarge; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.cg1_4xlarge; +import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.hi1_4xlarge; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m1_large; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m1_medium; import static org.jclouds.ec2.compute.domain.EC2HardwareBuilder.m1_small; @@ -66,7 +67,7 @@ public class AWSEC2HardwareSupplier extends EC2HardwareSupplier { sizes.add(cc2_8xlarge().supportsImageIds(ccAmis).build()); sizes.addAll(ImmutableSet. of(t1_micro().build(), c1_medium().build(), c1_xlarge().build(), m1_large() .build(), m1_small().build(), m1_medium().build(), m1_xlarge().build(), m2_xlarge().build(), - m2_2xlarge().build(), m2_4xlarge().build())); + m2_2xlarge().build(), m2_4xlarge().build(), hi1_4xlarge().build())); return sizes.build(); } } diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/PlacementGroupClientLiveTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/PlacementGroupClientLiveTest.java index 63939d1231..0cbc279bd6 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/PlacementGroupClientLiveTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/PlacementGroupClientLiveTest.java @@ -36,11 +36,13 @@ import org.jclouds.aws.ec2.domain.PlacementGroup.State; import org.jclouds.aws.ec2.predicates.PlacementGroupAvailable; import org.jclouds.aws.ec2.predicates.PlacementGroupDeleted; import org.jclouds.compute.RunNodesException; +import org.jclouds.compute.domain.HardwareBuilder; import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.domain.OsFamily; import org.jclouds.compute.domain.Template; import org.jclouds.compute.internal.BaseComputeServiceContextLiveTest; import org.jclouds.compute.predicates.NodePredicates; +import org.jclouds.ec2.compute.domain.EC2HardwareBuilder; import org.jclouds.ec2.domain.InstanceType; import org.jclouds.predicates.RetryablePredicate; import org.jclouds.scriptbuilder.domain.Statements; @@ -131,7 +133,7 @@ public class PlacementGroupClientLiveTest extends BaseComputeServiceContextLiveT public void testStartCCInstance() throws Exception { - Template template = view.getComputeService().templateBuilder().fastest().osFamily(OsFamily.AMZN_LINUX).build(); + Template template = view.getComputeService().templateBuilder().fromHardware(EC2HardwareBuilder.cc2_8xlarge().build()).osFamily(OsFamily.AMZN_LINUX).build(); assert template != null : "The returned template was null, but it should have a value."; assertEquals(template.getHardware().getProviderId(), InstanceType.CC2_8XLARGE); assertEquals(template.getImage().getUserMetadata().get("rootDeviceType"), "ebs");