Created
October 10, 2012 00:50
-
-
Save etoews/3862480 to your computer and use it in GitHub Desktop.
jclouds workshop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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