switched glesys to prefer openvz

This commit is contained in:
Adrian Cole 2012-02-15 11:57:10 +01:00
parent 03c9dd9915
commit 27a94fc490
3 changed files with 5 additions and 4 deletions

View File

@ -169,7 +169,8 @@ public class GleSYSComputeServiceAdapter implements ComputeServiceAdapter<Server
for (int memorySizeMB : platformToArgs.getValue().getMemorySizesInMB()) {
ImmutableSet.Builder<String> templatesSupportedBuilder = ImmutableSet.<String> 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<String> templatesSupported = templatesSupportedBuilder.build();

View File

@ -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")

View File

@ -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