Merge pull request #583 from richardcloudsoft/ec2-windows

AWS EC2: add owner ID of the Amazon Windows images to the default set
This commit is contained in:
Adrian Cole 2012-04-25 11:07:59 -07:00
commit 302df25fab
2 changed files with 19 additions and 13 deletions

View File

@ -65,9 +65,9 @@ public class AWSEC2ProviderMetadata extends BaseProviderMetadata {
// from stopping->stopped state on an ec2 micro // from stopping->stopped state on an ec2 micro
properties.setProperty(TIMEOUT_NODE_SUSPENDED, 120 * 1000 + ""); properties.setProperty(TIMEOUT_NODE_SUSPENDED, 120 * 1000 + "");
properties.putAll(Region.regionProperties()); properties.putAll(Region.regionProperties());
// amazon, alestic, canonical, and rightscale // Amazon Linux, Amazon Windows, alestic, canonical, and rightscale
properties.setProperty(PROPERTY_EC2_AMI_QUERY, properties.setProperty(PROPERTY_EC2_AMI_QUERY,
"owner-id=137112412989,063491364108,099720109477,411009282317;state=available;image-type=machine"); "owner-id=137112412989,801119661308,063491364108,099720109477,411009282317;state=available;image-type=machine");
// amis that work with the cluster instances // amis that work with the cluster instances
properties.setProperty(PROPERTY_EC2_CC_REGIONS, Region.US_EAST_1); properties.setProperty(PROPERTY_EC2_CC_REGIONS, Region.US_EAST_1);
properties properties

View File

@ -16,18 +16,21 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.jclouds.ec2.services; package org.jclouds.aws.ec2.services;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties; import java.util.Properties;
import java.util.Set; import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import com.google.inject.Module;
import org.jclouds.compute.ComputeService; import org.jclouds.compute.ComputeService;
import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.domain.NodeMetadata;
import org.jclouds.compute.domain.OsFamily; import org.jclouds.compute.domain.OsFamily;
@ -41,6 +44,8 @@ import org.jclouds.ec2.compute.functions.WindowsLoginCredentialsFromEncryptedDat
import org.jclouds.ec2.domain.InstanceType; import org.jclouds.ec2.domain.InstanceType;
import org.jclouds.ec2.domain.PasswordData; import org.jclouds.ec2.domain.PasswordData;
import org.jclouds.ec2.reference.EC2Constants; import org.jclouds.ec2.reference.EC2Constants;
import org.jclouds.ec2.services.WindowsClient;
import org.jclouds.encryption.bouncycastle.config.BouncyCastleCryptoModule;
import org.jclouds.predicates.RetryablePredicate; import org.jclouds.predicates.RetryablePredicate;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -57,7 +62,7 @@ import com.google.common.collect.Iterables;
@Test(groups = "live", singleThreaded = true, testName = "WindowsClientLiveTest") @Test(groups = "live", singleThreaded = true, testName = "WindowsClientLiveTest")
public class WindowsClientLiveTest extends BaseComputeServiceContextLiveTest { public class WindowsClientLiveTest extends BaseComputeServiceContextLiveTest {
public WindowsClientLiveTest() { public WindowsClientLiveTest() {
provider = "ec2"; provider = "aws-ec2";
} }
private ComputeService computeService; private ComputeService computeService;
@ -65,13 +70,6 @@ public class WindowsClientLiveTest extends BaseComputeServiceContextLiveTest {
private static final String DEFAULT_INSTANCE = "i-TODO"; private static final String DEFAULT_INSTANCE = "i-TODO";
private static final String DEFAULT_BUCKET = "TODO"; private static final String DEFAULT_BUCKET = "TODO";
@Override
protected Properties setupProperties() {
Properties overrides = super.setupProperties();
overrides.put(EC2Constants.PROPERTY_EC2_AMI_OWNERS, "206029621532"); /* Amazon Owner ID */
return overrides;
}
@Override @Override
@BeforeClass(groups = { "integration", "live" }) @BeforeClass(groups = { "integration", "live" })
public void setupContext() { public void setupContext() {
@ -80,6 +78,14 @@ public class WindowsClientLiveTest extends BaseComputeServiceContextLiveTest {
computeService = view.getComputeService(); computeService = view.getComputeService();
} }
@Override
protected Iterable<Module> setupModules() {
Iterable<Module> superModules = super.setupModules();
List<Module> modules = new ArrayList<Module>();
Iterables.addAll(modules, superModules);
modules.add(new BouncyCastleCryptoModule());
return modules;
}
@Test(enabled = false) @Test(enabled = false)
// TODO get instance // TODO get instance
@ -112,7 +118,7 @@ public class WindowsClientLiveTest extends BaseComputeServiceContextLiveTest {
Template template = computeService.templateBuilder() Template template = computeService.templateBuilder()
.osFamily(OsFamily.WINDOWS) .osFamily(OsFamily.WINDOWS)
.os64Bit(true) .os64Bit(true)
.imageNameMatches("Windows-2008R2-SP1-English-Base-") .imageNameMatches("Windows_Server-2008-R2_SP1-English-64Bit-Base-")
.hardwareId(InstanceType.M1_LARGE) .hardwareId(InstanceType.M1_LARGE)
.options(TemplateOptions.Builder.inboundPorts(3389)) .options(TemplateOptions.Builder.inboundPorts(3389))
.build(); .build();