persistent mapping payload not passed to the vm

Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/7de61356
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/7de61356
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/7de61356

Branch: refs/heads/master
Commit: 7de6135623cf9d23934c0e20effb1282dc5f3fbe
Parents: 344a43a
Author: Udara Liyanage <[email protected]>
Authored: Mon Jun 2 14:25:37 2014 +0530
Committer: Udara Liyanage <[email protected]>
Committed: Wed Jun 4 23:33:40 2014 +0530

----------------------------------------------------------------------
 .../impl/CloudControllerServiceImpl.java        | 36 ++++++++++----------
 1 file changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/7de61356/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
 
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
index 74e45e9..c721d2b 100644
--- 
a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
+++ 
b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/impl/CloudControllerServiceImpl.java
@@ -301,8 +301,6 @@ public class CloudControllerServiceImpl implements 
CloudControllerService {
             if (log.isDebugEnabled()) {
                 log.debug("Payload: " + payload.toString());
             }
-            // reloading the payload with memberID
-            iaasProvider.setPayload(payload.toString().getBytes());
             
             if (iaas == null) {
                 if(log.isDebugEnabled()) {
@@ -318,8 +316,25 @@ public class CloudControllerServiceImpl implements 
CloudControllerService {
                 }
                 
             }
-            
+
+            if(ctxt.isVolumeRequired()) {
+                if (ctxt.getVolumes() != null) {
+                    for (Volume volume : ctxt.getVolumes()) {
+
+                        if (volume.getId() == null) {
+                            // create a new volume
+                            createVolumeAndSetInClusterContext(volume, 
iaasProvider);
+                        }
+                    }
+                }
+            }
+
+            if(ctxt.isVolumeRequired()){
+                addToPayload(payload, "PERSISTENCE_MAPPING", 
getPersistencePayload(ctxt, iaas).toString());
+            }
+            iaasProvider.setPayload(payload.toString().getBytes());
             iaas.setDynamicPayload();
+
             // get the pre built ComputeService from provider or region or 
zone or host
             computeService = iaasProvider.getComputeService();
             template = iaasProvider.getTemplate();
@@ -339,22 +354,7 @@ public class CloudControllerServiceImpl implements 
CloudControllerService {
             // Should have a length between 3-15
             String str = clusterId.length() > 10 ? clusterId.substring(0, 10) 
: clusterId.substring(0, clusterId.length());
             String group = str.replaceAll("[^a-z0-9-]", "");
-            
-            if(ctxt.isVolumeRequired()) {
-               if (ctxt.getVolumes() != null) {
-                       for (Volume volume : ctxt.getVolumes()) {
 
-                               if (volume.getId() == null) {
-                                       // create a new volume
-                                       
createVolumeAndSetInClusterContext(volume, iaasProvider);
-                               }
-                                       }
-               }
-            }
-
-            if(ctxt.isVolumeRequired()){
-                addToPayload(payload, "PERSISTENCE_MAPPING", 
getPersistencePayload(ctxt, iaas).toString());
-            }
             NodeMetadata node;
 
 //            create and start a node

Reply via email to