From fde6da7315e6b8b5dc038cfcb480dea8448f4c4b Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 15 Feb 2012 11:57:10 +0100 Subject: [PATCH] switched glesys to prefer openvz --- .../jclouds/glesys/compute/GleSYSComputeServiceAdapter.java | 3 ++- .../compute/config/GleSYSComputeServiceContextModule.java | 2 +- .../jclouds/glesys/compute/GleSYSTemplateBuilderLiveTest.java | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/labs/glesys/src/main/java/org/jclouds/glesys/compute/GleSYSComputeServiceAdapter.java b/labs/glesys/src/main/java/org/jclouds/glesys/compute/GleSYSComputeServiceAdapter.java index 3dad6cfb97..d2e2feb677 100644 --- a/labs/glesys/src/main/java/org/jclouds/glesys/compute/GleSYSComputeServiceAdapter.java +++ b/labs/glesys/src/main/java/org/jclouds/glesys/compute/GleSYSComputeServiceAdapter.java @@ -169,7 +169,8 @@ public class GleSYSComputeServiceAdapter implements ComputeServiceAdapter templatesSupportedBuilder = ImmutableSet. builder(); for (OSTemplate template : images) { - if (diskSizeGB >= template.getMinDiskSize() && memorySizeMB >= template.getMinMemSize()) + if (template.getPlatform().equals(platformToArgs.getKey()) + && diskSizeGB >= template.getMinDiskSize() && memorySizeMB >= template.getMinMemSize()) templatesSupportedBuilder.add(template.getName()); } ImmutableSet templatesSupported = templatesSupportedBuilder.build(); diff --git a/labs/glesys/src/main/java/org/jclouds/glesys/compute/config/GleSYSComputeServiceContextModule.java b/labs/glesys/src/main/java/org/jclouds/glesys/compute/config/GleSYSComputeServiceContextModule.java index 7c6339eb9b..7affeedb3f 100644 --- a/labs/glesys/src/main/java/org/jclouds/glesys/compute/config/GleSYSComputeServiceContextModule.java +++ b/labs/glesys/src/main/java/org/jclouds/glesys/compute/config/GleSYSComputeServiceContextModule.java @@ -88,7 +88,7 @@ public class GleSYSComputeServiceContextModule // 128MB is perhaps too little ram @Override protected TemplateBuilder provideTemplate(Injector injector, TemplateBuilder template) { - return template.minRam(512).osFamily(OsFamily.UBUNTU).osVersionMatches("1[10].[10][04]").os64Bit(true); + return template.minRam(512).osFamily(OsFamily.UBUNTU).hypervisorMatches("OpenVZ").osVersionMatches("1[10].[10][04]").os64Bit(true); } @Named("PASSWORD") diff --git a/labs/glesys/src/test/java/org/jclouds/glesys/compute/GleSYSTemplateBuilderLiveTest.java b/labs/glesys/src/test/java/org/jclouds/glesys/compute/GleSYSTemplateBuilderLiveTest.java index fe644358f2..7e5edad7b2 100644 --- a/labs/glesys/src/test/java/org/jclouds/glesys/compute/GleSYSTemplateBuilderLiveTest.java +++ b/labs/glesys/src/test/java/org/jclouds/glesys/compute/GleSYSTemplateBuilderLiveTest.java @@ -82,13 +82,13 @@ public class GleSYSTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { @Test public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = context.getComputeService().templateBuilder().build(); - assertEquals(defaultTemplate.getImage().getId(), "Ubuntu 11.04 x64"); + assertEquals(defaultTemplate.getImage().getId(), "Ubuntu 11.04 64-bit"); assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "11.04"); assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); assertEquals(getCores(defaultTemplate.getHardware()), 1.0d); assertEquals(defaultTemplate.getHardware().getRam(), 512); - assertEquals(defaultTemplate.getHardware().getHypervisor(), "Xen"); + assertEquals(defaultTemplate.getHardware().getHypervisor(), "OpenVZ"); assertEquals(getSpace(defaultTemplate.getHardware()), 5.0d); assertEquals(defaultTemplate.getHardware().getVolumes().get(0).getType(), Volume.Type.LOCAL); // test that we bound the correct templateoptions in guice