mirror of https://github.com/apache/jclouds.git
switched glesys to prefer openvz
This commit is contained in:
parent
6c8ff2a9fd
commit
fde6da7315
|
@ -169,7 +169,8 @@ public class GleSYSComputeServiceAdapter implements ComputeServiceAdapter<Server
|
||||||
for (int memorySizeMB : platformToArgs.getValue().getMemorySizesInMB()) {
|
for (int memorySizeMB : platformToArgs.getValue().getMemorySizesInMB()) {
|
||||||
ImmutableSet.Builder<String> templatesSupportedBuilder = ImmutableSet.<String> builder();
|
ImmutableSet.Builder<String> templatesSupportedBuilder = ImmutableSet.<String> builder();
|
||||||
for (OSTemplate template : images) {
|
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());
|
templatesSupportedBuilder.add(template.getName());
|
||||||
}
|
}
|
||||||
ImmutableSet<String> templatesSupported = templatesSupportedBuilder.build();
|
ImmutableSet<String> templatesSupported = templatesSupportedBuilder.build();
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class GleSYSComputeServiceContextModule
|
||||||
// 128MB is perhaps too little ram
|
// 128MB is perhaps too little ram
|
||||||
@Override
|
@Override
|
||||||
protected TemplateBuilder provideTemplate(Injector injector, TemplateBuilder template) {
|
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")
|
@Named("PASSWORD")
|
||||||
|
|
|
@ -82,13 +82,13 @@ public class GleSYSTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest {
|
||||||
@Test
|
@Test
|
||||||
public void testDefaultTemplateBuilder() throws IOException {
|
public void testDefaultTemplateBuilder() throws IOException {
|
||||||
Template defaultTemplate = context.getComputeService().templateBuilder().build();
|
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().getVersion(), "11.04");
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
|
||||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
||||||
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
|
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
|
||||||
assertEquals(defaultTemplate.getHardware().getRam(), 512);
|
assertEquals(defaultTemplate.getHardware().getRam(), 512);
|
||||||
assertEquals(defaultTemplate.getHardware().getHypervisor(), "Xen");
|
assertEquals(defaultTemplate.getHardware().getHypervisor(), "OpenVZ");
|
||||||
assertEquals(getSpace(defaultTemplate.getHardware()), 5.0d);
|
assertEquals(getSpace(defaultTemplate.getHardware()), 5.0d);
|
||||||
assertEquals(defaultTemplate.getHardware().getVolumes().get(0).getType(), Volume.Type.LOCAL);
|
assertEquals(defaultTemplate.getHardware().getVolumes().get(0).getType(), Volume.Type.LOCAL);
|
||||||
// test that we bound the correct templateoptions in guice
|
// test that we bound the correct templateoptions in guice
|
||||||
|
|
Loading…
Reference in New Issue