You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2014/11/03 16:52:06 UTC

[22/29] git commit: really clear the old install dir and label, so we really copy in the new version

really clear the old install dir and label, so we really copy in the new version

fixes inconsistencies in EntityConfigMap configBag and maps, and exposes hooks to get driver and to clear cached install-related values in the driver


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/d768efab
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/d768efab
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/d768efab

Branch: refs/heads/master
Commit: d768efab312ed3f7bb8aeb532fb6f7509702553d
Parents: 724ee57
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Thu Oct 30 20:34:52 2014 -0500
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Fri Oct 31 09:39:51 2014 -0500

----------------------------------------------------------------------
 .../entity/drivers/DriverDependentEntity.java   |  5 ++
 .../brooklyn/entity/basic/EntityConfigMap.java  | 16 ++++--
 .../brooklyn/event/feed/ConfigToAttributes.java |  7 +--
 .../ReflectiveEntityDriverFactoryTest.java      |  5 ++
 .../basic/AbstractSoftwareProcessSshDriver.java | 51 +++++++++-----------
 .../entity/basic/SoftwareProcessImpl.java       |  3 +-
 .../entity/brooklynnode/BrooklynNodeDriver.java |  2 +
 .../brooklynnode/BrooklynNodeSshDriver.java     |  7 +++
 .../BrooklynNodeUpgradeEffectorBody.java        | 14 +++---
 .../brooklyn-node-persisting-to-tmp.yaml        |  5 +-
 10 files changed, 72 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d768efab/api/src/main/java/brooklyn/entity/drivers/DriverDependentEntity.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/brooklyn/entity/drivers/DriverDependentEntity.java b/api/src/main/java/brooklyn/entity/drivers/DriverDependentEntity.java
index b225439..93cb889 100644
--- a/api/src/main/java/brooklyn/entity/drivers/DriverDependentEntity.java
+++ b/api/src/main/java/brooklyn/entity/drivers/DriverDependentEntity.java
@@ -18,6 +18,8 @@
  */
 package brooklyn.entity.drivers;
 
+import javax.annotation.Nullable;
+
 import brooklyn.entity.Entity;
 
 /**
@@ -28,4 +30,7 @@ import brooklyn.entity.Entity;
 public interface DriverDependentEntity<D extends EntityDriver> extends Entity {
 
     Class<D> getDriverInterface();
+    
+    @Nullable D getDriver();
+    
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d768efab/core/src/main/java/brooklyn/entity/basic/EntityConfigMap.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/EntityConfigMap.java b/core/src/main/java/brooklyn/entity/basic/EntityConfigMap.java
index 4b9654b..27131e2 100644
--- a/core/src/main/java/brooklyn/entity/basic/EntityConfigMap.java
+++ b/core/src/main/java/brooklyn/entity/basic/EntityConfigMap.java
@@ -65,6 +65,8 @@ public class EntityConfigMap implements ConfigMap {
      */
     private final Map<ConfigKey<?>,Object> ownConfig;
     private final Map<ConfigKey<?>,Object> inheritedConfig = Collections.synchronizedMap(new LinkedHashMap<ConfigKey<?>, Object>());
+    // TODO do we really want to have *both* bags and maps for these?  danger that they get out of synch.
+    // have added some logic (Oct 2014) so that the same changes are applied to both, in most places at least
     private final ConfigBag localConfigBag;
     private final ConfigBag inheritedConfigBag;
 
@@ -153,7 +155,7 @@ public class EntityConfigMap implements ConfigMap {
         return Maybe.absent();
     }
     
-    /** returns the config visible at this entity, local and inherited (preferring local) */
+    /** an immutable copy of the config visible at this entity, local and inherited (preferring local) */
     public Map<ConfigKey<?>,Object> getAllConfig() {
         Map<ConfigKey<?>,Object> result = new LinkedHashMap<ConfigKey<?>,Object>(inheritedConfig.size()+ownConfig.size());
         result.putAll(inheritedConfig);
@@ -161,14 +163,14 @@ public class EntityConfigMap implements ConfigMap {
         return Collections.unmodifiableMap(result);
     }
 
-    /** returns the config defined at this entity, ie not inherited */
+    /** an immutable copy of the config defined at this entity, ie not inherited */
     public Map<ConfigKey<?>,Object> getLocalConfig() {
         Map<ConfigKey<?>,Object> result = new LinkedHashMap<ConfigKey<?>,Object>(ownConfig.size());
         result.putAll(ownConfig);
         return Collections.unmodifiableMap(result);
     }
     
-    /** returns the config visible at this entity, local and inherited (preferring local), including those that did not match config keys */
+    /** Creates an immutable copy of the config visible at this entity, local and inherited (preferring local), including those that did not match config keys */
     public ConfigBag getAllConfigBag() {
         return ConfigBag.newInstanceCopying(localConfigBag)
                 .putAll(ownConfig)
@@ -177,13 +179,14 @@ public class EntityConfigMap implements ConfigMap {
                 .seal();
     }
 
-    /** returns the config defined at this entity, ie not inherited, including those that did not match config keys */
+    /** Creates an immutable copy of the config defined at this entity, ie not inherited, including those that did not match config keys */
     public ConfigBag getLocalConfigBag() {
         return ConfigBag.newInstanceCopying(localConfigBag)
                 .putAll(ownConfig)
                 .seal();
     }
 
+    @SuppressWarnings("unchecked")
     public Object setConfig(ConfigKey<?> key, Object v) {
         Object val;
         if ((v instanceof Future) || (v instanceof DeferredSupplier)) {
@@ -205,13 +208,16 @@ public class EntityConfigMap implements ConfigMap {
         } else {
             oldVal = ownConfig.put(key, val);
         }
+        localConfigBag.put((ConfigKey<Object>)key, v);
         entity.refreshInheritedConfigOfChildren();
         return oldVal;
     }
     
     public void setLocalConfig(Map<ConfigKey<?>, ? extends Object> vals) {
         ownConfig.clear();
+        localConfigBag.clear();
         ownConfig.putAll(vals);
+        localConfigBag.putAll(vals);
     }
     
     public void setInheritedConfig(Map<ConfigKey<?>, ? extends Object> vals, ConfigBag configBagVals) {
@@ -258,6 +264,8 @@ public class EntityConfigMap implements ConfigMap {
     
     public void addToLocalBag(Map<String,?> vals) {
         localConfigBag.putAll(vals);
+        // quick fix for problem that ownConfig can get out of synch
+        ownConfig.putAll(localConfigBag.getAllConfigAsConfigKeyMap());
     }
 
     public void clearInheritedConfig() {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d768efab/core/src/main/java/brooklyn/event/feed/ConfigToAttributes.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/event/feed/ConfigToAttributes.java b/core/src/main/java/brooklyn/event/feed/ConfigToAttributes.java
index 0dcaf49..c35e59b 100644
--- a/core/src/main/java/brooklyn/event/feed/ConfigToAttributes.java
+++ b/core/src/main/java/brooklyn/event/feed/ConfigToAttributes.java
@@ -25,7 +25,7 @@ import brooklyn.event.basic.TemplatedStringAttributeSensorAndConfigKey;
 import brooklyn.management.ManagementContext;
 
 
-/** simple config adapter for setting config-attributes from config values */ 
+/** Simple config adapter for setting {@link AttributeSensorAndConfigKey} sensor values from the config value or config default */ 
 public class ConfigToAttributes {
 
     //normally just applied once, statically, not registered...
@@ -38,7 +38,8 @@ public class ConfigToAttributes {
     }
 
     /**
-     * for selectively applying once (e.g. sub-classes of DynamicWebAppCluster that don't want to set HTTP_PORT etc!)
+     * Convenience for ensuring an individual sensor is set from its config key
+     * (e.g. sub-classes of DynamicWebAppCluster that don't want to set HTTP_PORT etc!)
      */
     public static <T> T apply(EntityLocal entity, AttributeSensorAndConfigKey<?,T> key) {
         T v = entity.getAttribute(key);
@@ -49,7 +50,7 @@ public class ConfigToAttributes {
     }
 
     /**
-     * For transforming a config value (e.g. processing a {@link TemplatedStringAttributeSensorAndConfigKey}),
+     * Convenience for transforming a config value (e.g. processing a {@link TemplatedStringAttributeSensorAndConfigKey}),
      * outside of the context of an entity.
      */
     public static <T> T transform(ManagementContext managementContext, AttributeSensorAndConfigKey<?,T> key) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d768efab/core/src/test/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactoryTest.java b/core/src/test/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactoryTest.java
index 96f5c38..1eb97ab 100644
--- a/core/src/test/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactoryTest.java
+++ b/core/src/test/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactoryTest.java
@@ -65,6 +65,11 @@ public class ReflectiveEntityDriverFactoryTest {
         public Class<D> getDriverInterface() {
             return clazz;
         }
+        
+        @Override
+        public D getDriver() {
+            throw new UnsupportedOperationException();
+        }
     }
     
     public static interface MyDriver extends EntityDriver {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d768efab/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java b/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
index 8eed782..ffab96b 100644
--- a/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
+++ b/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
@@ -20,7 +20,6 @@ package brooklyn.entity.basic;
 
 import static brooklyn.util.JavaGroovyEquivalents.elvis;
 import static brooklyn.util.JavaGroovyEquivalents.groovyTruth;
-import static com.google.common.base.Preconditions.checkNotNull;
 
 import java.io.ByteArrayOutputStream;
 import java.io.File;
@@ -80,10 +79,11 @@ public abstract class AbstractSoftwareProcessSshDriver extends AbstractSoftwareP
     public static final Logger log = LoggerFactory.getLogger(AbstractSoftwareProcessSshDriver.class);
     public static final Logger logSsh = LoggerFactory.getLogger(BrooklynLogging.SSH_IO);
 
-    // we cache these in case the entity becomes unmanaged
+    // we cache these for efficiency and in case the entity becomes unmanaged
     private volatile String installDir;
     private volatile String runDir;
     private volatile String expandedInstallDir;
+    private final Object installDirSetupMutex = new Object();
 
     protected volatile DownloadResolver resolver;
     
@@ -160,33 +160,31 @@ public abstract class AbstractSoftwareProcessSshDriver extends AbstractSoftwareP
     public String getInstallDir() {
         if (installDir != null) return installDir;
 
-        String existingVal = getEntity().getAttribute(SoftwareProcess.INSTALL_DIR);
-        if (Strings.isNonBlank(existingVal)) { // e.g. on rebind
-            installDir = existingVal;
-            return installDir;
-        }
-        
-        setInstallLabel();
-        
-        // deprecated in 0.7.0
-        Maybe<Object> minstallDir = getEntity().getConfigRaw(SoftwareProcess.INSTALL_DIR, true);
-        if (!minstallDir.isPresent() || minstallDir.get()==null) {
-            String installBasedir = ((EntityInternal)entity).getManagementContext().getConfig().getFirst("brooklyn.dirs.install");
-            if (installBasedir != null) {
-                log.warn("Using legacy 'brooklyn.dirs.install' setting for "+entity+"; may be removed in future versions.");
-                installDir = Os.mergePathsUnix(installBasedir, getEntityVersionLabel()+"_"+entity.getId());
-                installDir = Os.tidyPath(installDir);
-                getEntity().setAttribute(SoftwareProcess.INSTALL_DIR, installDir);
-                return installDir;
+        synchronized (installDirSetupMutex) {
+            // previously we looked at sensor value, but we shouldn't as it might have been converted from the config key value
+            // *before* we computed the install label, or that label may have changed since previous install; now force a recompute
+            setInstallLabel();
+
+            // deprecated in 0.7.0 - "brooklyn.dirs.install" is no longer supported
+            Maybe<Object> minstallDir = getEntity().getConfigRaw(SoftwareProcess.INSTALL_DIR, false);
+            if (!minstallDir.isPresent() || minstallDir.get()==null) {
+                String installBasedir = ((EntityInternal)entity).getManagementContext().getConfig().getFirst("brooklyn.dirs.install");
+                if (installBasedir != null) {
+                    log.warn("Using legacy 'brooklyn.dirs.install' setting for "+entity+"; may be removed in future versions.");
+                    setInstallDir(Os.tidyPath(Os.mergePathsUnix(installBasedir, getEntityVersionLabel()+"_"+entity.getId())));
+                    return installDir;
+                }
             }
-        }
 
-        setInstallDir(Os.tidyPath(ConfigToAttributes.apply(getEntity(), SoftwareProcess.INSTALL_DIR)));
-        return installDir;
+            // set it null first so that we force a recompute
+            setInstallDir(null);
+            setInstallDir(Os.tidyPath(ConfigToAttributes.apply(getEntity(), SoftwareProcess.INSTALL_DIR)));
+            return installDir;
+        }
     }
     
     protected void setInstallLabel() {
-        if (getEntity().getConfigRaw(SoftwareProcess.INSTALL_UNIQUE_LABEL, true).isPresentAndNonNull()) return; 
+        if (getEntity().getConfigRaw(SoftwareProcess.INSTALL_UNIQUE_LABEL, false).isPresentAndNonNull()) return; 
         getEntity().setConfig(SoftwareProcess.INSTALL_UNIQUE_LABEL, 
             getEntity().getEntityType().getSimpleName()+
             (Strings.isNonBlank(getVersion()) ? "_"+getVersion() : "")+
@@ -236,12 +234,12 @@ public abstract class AbstractSoftwareProcessSshDriver extends AbstractSoftwareP
     }
 
     public void setExpandedInstallDir(String val) {
-        checkNotNull(val, "expandedInstallDir");
         String oldVal = getEntity().getAttribute(SoftwareProcess.EXPANDED_INSTALL_DIR);
         if (Strings.isNonBlank(oldVal) && !oldVal.equals(val)) {
             log.info("Resetting expandedInstallDir (to "+val+" from "+oldVal+") for "+getEntity());
         }
         
+        expandedInstallDir = val;
         getEntity().setAttribute(SoftwareProcess.EXPANDED_INSTALL_DIR, val);
     }
     
@@ -250,8 +248,7 @@ public abstract class AbstractSoftwareProcessSshDriver extends AbstractSoftwareP
         
         String untidiedVal = ConfigToAttributes.apply(getEntity(), SoftwareProcess.EXPANDED_INSTALL_DIR);
         if (Strings.isNonBlank(untidiedVal)) {
-            expandedInstallDir = Os.tidyPath(untidiedVal);
-            entity.setAttribute(SoftwareProcess.INSTALL_DIR, expandedInstallDir);
+            setExpandedInstallDir(Os.tidyPath(untidiedVal));
             return expandedInstallDir;
         } else {
             throw new IllegalStateException("expandedInstallDir is null; most likely install was not called for "+getEntity());

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d768efab/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessImpl.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessImpl.java b/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessImpl.java
index 9080121..aad9fa5 100644
--- a/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessImpl.java
+++ b/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessImpl.java
@@ -105,11 +105,12 @@ public abstract class SoftwareProcessImpl extends AbstractEntity implements Soft
         return getAttribute(PROVISIONING_LOCATION);
     }
     
+    @Override
     public SoftwareProcessDriver getDriver() {
         return driver;
     }
 
-      protected SoftwareProcessDriver newDriver(MachineLocation loc){
+    protected SoftwareProcessDriver newDriver(MachineLocation loc){
         EntityDriverManager entityDriverManager = getManagementContext().getEntityDriverManager();
         return (SoftwareProcessDriver)entityDriverManager.build(this, loc);
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d768efab/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeDriver.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeDriver.java b/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeDriver.java
index d87cbf2..df27e1f 100644
--- a/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeDriver.java
+++ b/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeDriver.java
@@ -22,4 +22,6 @@ import brooklyn.entity.java.JavaSoftwareProcessDriver;
 
 public interface BrooklynNodeDriver extends JavaSoftwareProcessDriver {
 
+    void clearInstallDir();
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d768efab/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeSshDriver.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeSshDriver.java b/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeSshDriver.java
index 1fbf694..bd33b88 100644
--- a/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeSshDriver.java
+++ b/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynNodeSshDriver.java
@@ -88,6 +88,12 @@ public class BrooklynNodeSshDriver extends JavaSoftwareProcessSshDriver implemen
     }
 
     @Override
+    public void clearInstallDir() {
+        super.setInstallDir(null);
+        super.setExpandedInstallDir(null);
+    }
+    
+    @Override
     public void install() {
         String uploadUrl = entity.getConfig(BrooklynNode.DISTRO_UPLOAD_URL);
         
@@ -231,6 +237,7 @@ public class BrooklynNodeSshDriver extends JavaSoftwareProcessSshDriver implemen
         }
     }
 
+    @SuppressWarnings("deprecation")
     @Override
     public void launch() {
         String app = getEntity().getAttribute(BrooklynNode.APP);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d768efab/software/base/src/main/java/brooklyn/entity/brooklynnode/effector/BrooklynNodeUpgradeEffectorBody.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/brooklynnode/effector/BrooklynNodeUpgradeEffectorBody.java b/software/base/src/main/java/brooklyn/entity/brooklynnode/effector/BrooklynNodeUpgradeEffectorBody.java
index 22afa15..37ded07 100644
--- a/software/base/src/main/java/brooklyn/entity/brooklynnode/effector/BrooklynNodeUpgradeEffectorBody.java
+++ b/software/base/src/main/java/brooklyn/entity/brooklynnode/effector/BrooklynNodeUpgradeEffectorBody.java
@@ -32,6 +32,8 @@ import brooklyn.entity.basic.EntityTasks;
 import brooklyn.entity.basic.SoftwareProcess;
 import brooklyn.entity.brooklynnode.BrooklynCluster;
 import brooklyn.entity.brooklynnode.BrooklynNode;
+import brooklyn.entity.brooklynnode.BrooklynNodeDriver;
+import brooklyn.entity.drivers.DriverDependentEntity;
 import brooklyn.entity.effector.EffectorBody;
 import brooklyn.entity.effector.Effectors;
 import brooklyn.entity.proxying.EntitySpec;
@@ -43,7 +45,6 @@ import brooklyn.util.config.ConfigBag;
 import brooklyn.util.net.Urls;
 import brooklyn.util.task.DynamicTasks;
 import brooklyn.util.task.Tasks;
-import brooklyn.util.text.Identifiers;
 import brooklyn.util.text.Strings;
 import brooklyn.util.time.Duration;
 
@@ -106,11 +107,9 @@ public class BrooklynNodeUpgradeEffectorBody extends EffectorBody<Void> {
         // TODO could support 'dry_run_only' parameter, with optional resumption tasks (eg new dynamic effector)
 
         // 1 add new brooklyn version entity as child (so uses same machine), with same config apart from things in parameters
-        final BrooklynNode dryRunChild = entity().addChild(EntitySpec.create(BrooklynNode.class).configure(parameters.getAllConfig())
+        final BrooklynNode dryRunChild = entity().addChild(EntitySpec.create(BrooklynNode.class)
             .displayName("Upgraded Version Dry-Run Node")
-            // force dir and label back to their defaults (do not piggy back on what may have already been installed)
-            .configure(BrooklynNode.INSTALL_DIR, BrooklynNode.INSTALL_DIR.getConfigKey().getDefaultValue())
-            .configure(BrooklynNode.INSTALL_UNIQUE_LABEL, "upgrade-tmp-"+Identifiers.makeRandomId(8))
+            // install dir and label are recomputed because they are not inherited, and download_url will normally be different
             .configure(parameters.getAllConfig()));
 
         //force this to start as hot-standby
@@ -155,8 +154,11 @@ public class BrooklynNodeUpgradeEffectorBody extends EffectorBody<Void> {
                     ).summary("move files"));
             }
         }).build());
-
+        
+        DynamicTasks.waitForLast();
+        entity().setConfig(SoftwareProcess.INSTALL_UNIQUE_LABEL, null);
         entity().getConfigMap().addToLocalBag(parameters.getAllConfig());
+        ((BrooklynNodeDriver)((DriverDependentEntity<?>)entity()).getDriver()).clearInstallDir();
 
         // 6 start this entity, running the new version
         DynamicTasks.queue(Effectors.invocation(entity(), BrooklynNode.START, ConfigBag.EMPTY));

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d768efab/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-node-persisting-to-tmp.yaml
----------------------------------------------------------------------
diff --git a/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-node-persisting-to-tmp.yaml b/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-node-persisting-to-tmp.yaml
index a932e4e..afb53e7 100644
--- a/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-node-persisting-to-tmp.yaml
+++ b/software/base/src/main/resources/brooklyn/entity/brooklynnode/brooklyn-node-persisting-to-tmp.yaml
@@ -21,6 +21,7 @@ name: Example Persisting Brooklyn Node
 
 services:
 - type: classpath://brooklyn/entity/brooklynnode/brooklyn-node.yaml
-  launchParameters: --persist auto --persistenceDir /tmp/brooklyn-persistence-example/
+  brooklyn.config:
+    brooklynnode.launch.parameters.extra: --persist auto --persistenceDir /tmp/brooklyn-persistence-example/
 
-# location: localhost
+location: localhost