Skip to content

Instantly share code, notes, and snippets.

@etoews
Created October 10, 2012 00:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etoews/3862480 to your computer and use it in GitHub Desktop.
Save etoews/3862480 to your computer and use it in GitHub Desktop.
jclouds workshop
private void createNodes() {
for (ComputeService computeService: computeServices) {
try {
TemplateOptions options = computeService.templateOptions()
.inboundPorts(22, 80);
Template template = computeService.templateBuilder()
.osDescriptionMatches(".*CentOS 6.2.*")
.minRam(1024)
.options(options)
.build();
Set<? extends NodeMetadata> nodesInGroup = computeService.createNodesInGroup("jclouds-workshop", 1, template);
NodeMetadata node = nodesInGroup.iterator().next();
nodes.put(computeService, node);
}
catch (Throwable e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment