Quick Start: BlueLock vCloud Service
Please note that the support for BlueLock vCloud Director is not complete
- Sign up for BlueLock vCloud
- Ensure you are using a recent JDK 6
- Setup your project to include bluelock-vcdirector
a. Get the dependency
org.jclouds.provider/bluelock-vcdirectorusing jclouds Installation. - Start coding.
ComputeServiceContext context =
new ComputeServiceContextFactory().createContext("bluelock-vcdirector",
"username@orgname",
password,
ImmutableSet.<Module> of(new JschSshClientModule()));
// create a customization script to run when the machine starts up
String script = "cat > /root/foo.txt<<EOF\nI love candy\nEOF\n";
TemplateOptions options = client.templateOptions();
options.as(VCloudTemplateOptions.class).customizationScript(script);
// run a couple nodes accessible via group
nodes = context.getComputeService().createNodesInGroup("webserver", 2, options);
// get a synchronous object to use for manipulating vcloud objects in BlueLock
VCloudClient client =
VCloudClient.class.cast(context.getProviderSpecificContext().getApi());
// look at all the thumbnails of my vApps
VApp app = client.getVApp(vApp.getHref());
for (Vm vm : app.getChildren()) {
assert client.getThumbnailOfVm(vm.getHref()) != null;
}
// release resources
context.close();
- Validate on the BlueLock