diff --git a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/VirtualBoxPropertiesBuilder.java b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/VirtualBoxPropertiesBuilder.java index f28e279b13..2ac68ed108 100644 --- a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/VirtualBoxPropertiesBuilder.java +++ b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/VirtualBoxPropertiesBuilder.java @@ -78,7 +78,7 @@ public class VirtualBoxPropertiesBuilder extends PropertiesBuilder { properties.put(VIRTUALBOX_IMAGES_DESCRIPTOR, yamlDescriptor); - properties.put(VIRTUALBOX_PRECONFIGURATION_URL, "http://10.0.2.2:8080/src/test/resources/preseed.cfg"); + properties.put(VIRTUALBOX_PRECONFIGURATION_URL, "http://10.0.2.2:23232/src/test/resources/preseed.cfg"); return properties; } diff --git a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/config/VirtualBoxComputeServiceContextModule.java b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/config/VirtualBoxComputeServiceContextModule.java index bc3e206501..e00cc5ace4 100644 --- a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/config/VirtualBoxComputeServiceContextModule.java +++ b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/config/VirtualBoxComputeServiceContextModule.java @@ -70,7 +70,7 @@ import org.jclouds.virtualbox.functions.IMachineToHardware; import org.jclouds.virtualbox.functions.IMachineToImage; import org.jclouds.virtualbox.functions.IMachineToNodeMetadata; import org.jclouds.virtualbox.functions.IMachineToSshClient; -import org.jclouds.virtualbox.functions.MastersCache; +import org.jclouds.virtualbox.functions.MastersLoadingCache; import org.jclouds.virtualbox.functions.NodeCreator; import org.jclouds.virtualbox.functions.YamlImagesFromFileConfig; import org.jclouds.virtualbox.functions.admin.FileDownloadFromURI; @@ -141,7 +141,7 @@ public class VirtualBoxComputeServiceContextModule extends }).to((Class) YamlImagesFromFileConfig.class); // the master machines cache bind(new TypeLiteral>() { - }).to((Class) MastersCache.class); + }).to((Class) MastersLoadingCache.class); // the master creating function bind(new TypeLiteral>() { }).to((Class) CreateAndInstallVm.class); diff --git a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/CreateAndInstallVm.java b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/CreateAndInstallVm.java index 66b4936bce..316157a226 100644 --- a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/CreateAndInstallVm.java +++ b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/CreateAndInstallVm.java @@ -18,7 +18,6 @@ */ package org.jclouds.virtualbox.functions; -import static org.jclouds.scriptbuilder.domain.Statements.call; import static com.google.common.base.Preconditions.checkState; import static com.google.common.collect.Iterables.transform; @@ -29,9 +28,6 @@ import javax.annotation.Resource; import javax.inject.Named; import javax.inject.Singleton; -import org.jclouds.compute.domain.ExecResponse; -import org.jclouds.compute.domain.NodeMetadata; -import org.jclouds.compute.options.RunScriptOptions; import org.jclouds.compute.reference.ComputeServiceConstants; import org.jclouds.logging.Logger; import org.jclouds.ssh.SshClient; @@ -51,8 +47,6 @@ import com.google.common.base.Predicate; import com.google.common.base.Splitter; import com.google.common.base.Supplier; import com.google.common.cache.LoadingCache; -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; import com.google.inject.Inject; @Singleton @@ -113,6 +107,7 @@ public class CreateAndInstallVm implements Function { configureOsInstallationWithKeyboardSequence(vmName, installationKeySequence); + SshClient client = sshClientForIMachine.apply(vm); logger.debug(">> awaiting installation to finish node(%s)", vmName); diff --git a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/MastersCache.java b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/MastersLoadingCache.java similarity index 98% rename from labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/MastersCache.java rename to labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/MastersLoadingCache.java index 57dbd6a4cb..801f1840fb 100644 --- a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/MastersCache.java +++ b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/MastersLoadingCache.java @@ -74,7 +74,7 @@ import com.google.common.collect.Maps; * */ @Singleton -public class MastersCache extends AbstractLoadingCache { +public class MastersLoadingCache extends AbstractLoadingCache { // TODO parameterize public static final int MASTER_PORT = 2222; @@ -94,7 +94,7 @@ public class MastersCache extends AbstractLoadingCache { private String version; @Inject - public MastersCache(@Named(Constants.PROPERTY_BUILD_VERSION) String version, + public MastersLoadingCache(@Named(Constants.PROPERTY_BUILD_VERSION) String version, @Named(VIRTUALBOX_INSTALLATION_KEY_SEQUENCE) String installationKeySequence, @Named(VIRTUALBOX_WORKINGDIR) String workingDir, Function masterLoader, Supplier> yamlMapper, Supplier manager, diff --git a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/NodeCreator.java b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/NodeCreator.java index 9e60b907d3..3c71c7b700 100644 --- a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/NodeCreator.java +++ b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/NodeCreator.java @@ -95,7 +95,7 @@ public class NodeCreator implements Function apply(NodeSpec nodeSpec) { + public synchronized NodeAndInitialCredentials apply(NodeSpec nodeSpec) { checkNotNull(nodeSpec, "NodeSpec"); diff --git a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/TakeSnapshotIfNotAlreadyAttached.java b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/TakeSnapshotIfNotAlreadyAttached.java index 03311963ab..c644880e59 100644 --- a/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/TakeSnapshotIfNotAlreadyAttached.java +++ b/labs/virtualbox/src/main/java/org/jclouds/virtualbox/functions/TakeSnapshotIfNotAlreadyAttached.java @@ -71,7 +71,9 @@ public class TakeSnapshotIfNotAlreadyAttached implements Function nodes = context.getComputeService().createNodesInGroup(clusterName, numNodes, TemplateOptions.Builder.runScript(AdminAccess.standard()));