adding volumeiD to the persistent payload

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

Branch: refs/heads/master
Commit: 546fea613a1da037d9a390535386fb8b6d7278a1
Parents: 43b19c1
Author: Udara Liyanage <[email protected]>
Authored: Mon May 26 22:33:22 2014 +0530
Committer: Udara Liyanage <[email protected]>
Committed: Wed Jun 4 23:28:41 2014 +0530

----------------------------------------------------------------------
 .../controller/impl/CloudControllerServiceImpl.java     | 12 ++++++++----
 .../distribution/src/main/extensions/mount_volumes.sh   |  7 +++----
 2 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/546fea61/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 c1e65b6..74e45e9 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
@@ -297,9 +297,6 @@ public class CloudControllerServiceImpl implements 
CloudControllerService {
             addToPayload(payload, "PARTITION_ID", partitionId);
 
             Iaas iaas = iaasProvider.getIaas();
-            if(ctxt.isVolumeRequired()){
-                addToPayload(payload, "PERSISTENCE_MAPPING", 
getPersistencePayload(ctxt, iaas).toString());
-            }
             
             if (log.isDebugEnabled()) {
                 log.debug("Payload: " + payload.toString());
@@ -354,7 +351,10 @@ public class CloudControllerServiceImpl implements 
CloudControllerService {
                                        }
                }
             }
-            
+
+            if(ctxt.isVolumeRequired()){
+                addToPayload(payload, "PERSISTENCE_MAPPING", 
getPersistencePayload(ctxt, iaas).toString());
+            }
             NodeMetadata node;
 
 //            create and start a node
@@ -446,14 +446,18 @@ public class CloudControllerServiceImpl implements 
CloudControllerService {
                 if(persistencePayload.length() != 0) {
                    persistencePayload.append("|");
                 }
+                
                                
persistencePayload.append(iaas.getIaasDevice(volume.getDevice()));
                                persistencePayload.append("|");
+                persistencePayload.append(volume.getId());
+                persistencePayload.append("|");
                 persistencePayload.append(volume.getMappingPath());
                        }
                }
         if(log.isDebugEnabled()){
             log.debug("Persistence payload is" + 
persistencePayload.toString());
         }
+        System.out.println("****** " + persistencePayload);
                return persistencePayload;
        }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/546fea61/products/cartridge-agent/modules/distribution/src/main/extensions/mount_volumes.sh
----------------------------------------------------------------------
diff --git 
a/products/cartridge-agent/modules/distribution/src/main/extensions/mount_volumes.sh
 
b/products/cartridge-agent/modules/distribution/src/main/extensions/mount_volumes.sh
index 48f3ceb..af9360f 100755
--- 
a/products/cartridge-agent/modules/distribution/src/main/extensions/mount_volumes.sh
+++ 
b/products/cartridge-agent/modules/distribution/src/main/extensions/mount_volumes.sh
@@ -76,11 +76,10 @@ IFS='|' read -ra ADDR <<< "${PERSISTENCE_MAPPING}"
 echo "${ADDR[@]}" | tee -a $log
 
 for i in "${!ADDR[@]}"; do
-        # expected PERSISTANCE_MAPPING format is 
device1|mountPoint1|device2|mountpoint2...
-        # so that even indexes are devices and odd indexes are mount points..
-        if (( $i  % 2 == 0 ))
+        # expected PERSISTANCE_MAPPING format is 
device1|volumeID1|mountPoint1|device2|volumeID2|mountpoint2...
+        if (( $i  % 3 == 0 ))
         then
-           mount_volume ${ADDR[$i]} ${ADDR[$i + 1]}
+           mount_volume ${ADDR[$i1]} ${ADDR[$i + 2]}
         fi
 done
 

Reply via email to