You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ma...@apache.org on 2013/09/05 08:53:44 UTC

[1/2] Updated stratos-installer to support Amazon EC2

Updated Branches:
  refs/heads/master 858799f6b -> cdb160e56


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/setup.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/setup.sh b/tools/stratos-installer/setup.sh
index a6b8914..be3a579 100755
--- a/tools/stratos-installer/setup.sh
+++ b/tools/stratos-installer/setup.sh
@@ -36,41 +36,31 @@ elb="false"
 agent="false"
 sc="false"
 #bam="false"
-demo="openstack"
 product_list="cc;elb;agent;sc"
 enable_internal_git=false
 
 function help {
     echo ""
-    echo "demo means you will setup a demo server of stratos in a single physical machine."
-    echo "This demo server include all stratos products."
-    echo "usage:"
-    echo "setup.sh -u<host username> -d<demo> -p\"<product list>\""
-    echo "eg."
-    echo "sudo JAVA_HOME=<java-home> ./setup.sh -dopenstack -p\"cc elb\""
-    echo "sudo JAVA_HOME=<java-home> ./setup.sh -dopenstack -p\"all\""
+    echo "Usage:"
+    echo "setup.sh -u<host username> -p\"<product list>\""
+    echo "Example:"
+    echo "sudo ./setup.sh -p \"cc elb\""
+    echo "sudo ./setup.sh -p \"all\""
     echo ""
-    echo "-d: <demo name> whether you need to run demo for ec2 or openstack. The value is one of ec2|openstack. By default no demo is setup"
-    echo "-p: <product list> Give one or more of the servers to be setup in this machine. The available servers are"
-    echo "    cc, elb, agent, sc or all. 'all' means you need to setup all servers in this machine. Default is all"
+    echo "-p: <product list> Apache Stratos products to be installed on this node. Provide one or more names of the servers."
+    echo "    The available servers are cc, elb, agent, sc or all. 'all' means you need to setup all servers in this machine. Default is all"
     echo "-g: <enable_internal_git true|false> Whether enable internal git repo for Stratos2. Default is false"
     echo ""
 }
 
-while getopts p:d:g: opts
+while getopts p:g: opts
 do
   case $opts in
     p)
         product_list=${OPTARG}
-        echo $product_list
-        ;;
-    d)
-        demo=${OPTARG}
-        echo $demo
         ;;
     g)
         enable_internal_git=${OPTARG}
-        echo $enable_internal_git
         ;;
     *)
         help
@@ -79,6 +69,7 @@ do
   esac
 done
 
+
 arr=$(echo $product_list | tr " " "\n")
 
 for x in $arr
@@ -137,124 +128,120 @@ export $enable_internal_git
 export $host_user
 export hostname=`hostname -f`
 
-function setup_validate {
-    
-
-if [[ -z $hostname ]]; then
-    echo "Set up the hostname of the node"
-    exit 1
-fi
-
-if [[ -z $userstore_db_hostname ]]; then
-    userstore_db_hostname=""
-fi
-if [[ -z $sc_hostname ]]; then
-    sc_hostname=$hostname
-fi
-if [[ -z $stratos_foundation_db_hostname ]]; then
-    stratos_foundation_db_hostname=$hostname
-fi
-if [[ -z $agent_hostname ]]; then
-    agent_hostname=$hostname
-fi
-if [[ -z $cc_hostname ]]; then
-    cc_hostname=$hostname
-fi
-if [[ -z $git_hostname ]]; then
-    git_hostname=$hostname
-fi
-if [[ -z $nova_controller_hostname ]]; then
-    nova_controller_hostname=$hostname
-fi
-if [[ -z $bam_hostname ]]; then
-    bam_hostname=$hostname
-fi
-if [[ -z $elb_hostname ]]; then
-   elb_hostname=$hostname
-fi
+function setup_validate {    
+    if [[ -z $hostname ]]; then
+        echo "Set up the hostname of the node"
+        exit 1
+    fi
 
+    if [[ -z $userstore_db_hostname ]]; then
+        userstore_db_hostname=""
+    fi
+    if [[ -z $sc_hostname ]]; then
+        sc_hostname=$hostname
+    fi
+    if [[ -z $stratos_foundation_db_hostname ]]; then
+        stratos_foundation_db_hostname=$hostname
+    fi
+    if [[ -z $agent_hostname ]]; then
+        agent_hostname=$hostname
+    fi
+    if [[ -z $cc_hostname ]]; then
+        cc_hostname=$hostname
+    fi
+    if [[ -z $git_hostname ]]; then
+        git_hostname=$hostname
+    fi
+    if [[ -z $nova_controller_hostname ]]; then
+        nova_controller_hostname=$hostname
+    fi
+    if [[ -z $bam_hostname ]]; then
+        bam_hostname=$hostname
+    fi
+    if [[ -z $elb_hostname ]]; then
+        elb_hostname=$hostname
+    fi
 
-if [[ ( -z $hostip ) ]]; then
-    hostip=$(ifconfig eth0| sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
     if [[ ( -z $hostip ) ]]; then
-        helpsetup
-        exit 1
+        hostip=$(ifconfig eth0| sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
+        if [[ ( -z $hostip ) ]]; then
+            helpsetup
+            exit 1
+        fi
     fi
-fi
 
-if [[ -z $git_ip ]]; then
-    git_ip=$hostip
-fi
+    if [[ -z $git_ip ]]; then
+        git_ip=$hostip
+    fi
 
-if [[ $sc = "true" ]]; then
+    if [[ $sc = "true" ]]; then
+        if [[ $enable_internal_git = "true" ]]; then
+            if [[ -z $git_user ]]; then
+                echo "Please specify the git user, because it will be needed to create an internal git repo"
+            fi
+            if [[ -z $axis2c_path ]]; then
+                echo "Please specify the path to Axis2/C binary, because it will be needed to create an internal git repo"
+            fi
 
-    if [[ $enable_internal_git = "true" ]]; then
-        if [[ -z $git_user ]]; then
-            echo "Please specify the git user, because it will be needed to create an internal git repo"
+            echo "$hostip    git.$stratos_domain" >> /etc/hosts
         fi
-        if [[ -z $axis2c_path ]]; then
-            echo "Please specify the path to Axis2/C binary, because it will be needed to create an internal git repo"
+        if [[ ( -z $email|| -z $stratos_foundation_db_user || -z $stratos_foundation_db_pass || -z $hostname
+            || -z $sc_path ) ]]; then
+            helpsetup
+            exit 1
         fi
+    fi
 
-        echo "$hostip    git.$stratos2_domain" >> /etc/hosts
-
+    if [[ $cc = "true" ]]; then
+        if [[ ( -z $hostname || -z $cc_path ) ]]; then
+            helpsetup
+            exit 1
+        fi
     fi
 
-    if [[ ( -z $email|| -z $stratos_foundation_db_user || -z $stratos_foundation_db_pass || -z $hostname
-        || -z $sc_path ) ]]; then
-        helpsetup
-        exit 1
+    if [[ $elb = "true" ]]; then
+        if [[ ( -z $hostname || -z $elb_path ) ]]; then
+            helpsetup
+            exit 1
+        fi
     fi
-fi
 
-if [[ $cc = "true" ]]; then
-    if [[ ( -z $hostname || -z $cc_path ) ]]; then
-        helpsetup
-        exit 1
+    if [[ $agent = "true" ]]; then
+        if [[ ( -z $hostname || -z $agent_path ) ]]; then
+            helpsetup
+            exit 1
+        fi
     fi
-fi
 
-if [[ $elb = "true" ]]; then
-    if [[ ( -z $hostname || -z $elb_path ) ]]; then
-        helpsetup
+    if [[ ! -f $mysql_connector_jar ]]; then
+        echo "Please copy the mysql connector jar into the same folder as this command(stratos2 release pack folder) and update conf/setup.conf file"
         exit 1
     fi
-fi
 
-if [[ $agent = "true" ]]; then
-    if [[ ( -z $hostname || -z $agent_path ) ]]; then
-        helpsetup
+    if [[ ! -d $JAVA_HOME ]]; then
+        echo "Please set the JAVA_HOME environment variable for the running user"
         exit 1
     fi
-fi
-
-if [[ ! -f $mysql_connector_jar ]]; then
-    echo "Please copy the mysql connector jar into the same folder as this command(stratos2 release pack folder) and update conf/setup.conf file"
-    exit 1
-fi
-
-if [[ ! -d $JAVA_HOME ]]; then
-    echo "Please set the JAVA_HOME environment variable for the running user"
-    exit 1
-fi
-export JAVA_HOME=$JAVA_HOME
+    export JAVA_HOME=$JAVA_HOME
 
-
-if [[ $openstack_provider_enable = "true" ]]; then
-    if [[ ( -z $openstack_identity || -z $openstack_credential || -z $openstack_jclouds_endpoint ) ]]; then
-        helpsetup
+    if [[ $ec2_provider_enabled = "false" && $openstack_provider_enabled = "false" ]]; then
+        echo "Please enable at least one of the IaaS providers in conf/setup.conf file"
         exit 1
     fi
 
-fi
-
-if [[ $ec2_provider_enable = "true" ]]; then
-    if [[ ( -z $ec2_identity || -z $ec2_credential || -z $ec2_keypair ) ]]; then
-        helpsetup
-        exit 1
+    if [[ $openstack_provider_enabled = "true" ]]; then
+        if [[ ( -z $openstack_identity || -z $openstack_credential || -z $openstack_jclouds_endpoint ) ]]; then
+            echo "Please set openstack configuration information in conf/setup.conf file"
+            exit 1
+        fi
     fi
-fi
 
+    if [[ $ec2_provider_enabled = "true" ]]; then
+        if [[ ( -z $ec2_identity || -z $ec2_credential || -z $ec2_keypair_name ) ]]; then
+            echo "Please set ec2 configuration information in conf/setup.conf file"
+            exit 1
+        fi
+    fi
 }
 
 setup_validate
@@ -348,7 +335,7 @@ if [[ $sc = "true" ]]; then
     cat repository/conf/cartridge-config.properties.orig | sed -e "s@AGENT_HOSTNAME:AGENT_PORT@$agent_ip:$agent_https_port@g" > repository/conf/cartridge-config.properties
 
     cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
-    cat repository/conf/cartridge-config.properties.orig | sed -e "s@STRATOS_DOMAIN@$stratos2_domain@g" > repository/conf/cartridge-config.properties
+    cat repository/conf/cartridge-config.properties.orig | sed -e "s@STRATOS_DOMAIN@$stratos_domain@g" > repository/conf/cartridge-config.properties
 
     if [[ $enable_internal_git = "true" ]]; then
         cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
@@ -458,14 +445,14 @@ if [[ $sc = "true" ]]; then
     echo "bind Namespaces" >> $LOG
     #apt-get install bind9 zip
     #Copy the /db.stratos.com file into /etc/bind. Edit it as necessary
-    #cp -f ./resources/db.stratos.com $resource_path/db.$stratos2_domain
+    #cp -f ./resources/db.stratos.com $resource_path/db.$stratos_domain
     #echo "Set ELb Hostname in /etc/bind/db.stratos.com" >> $LOG
-    #cat $resource_path/db.$stratos2_domain | sed -e "s@SC_HOSTNAME@$sc_hostname@g" | sed -e "s@ELB_IP@$elb_ip@g" | sed -e "s@STRATOS_DOMAIN@$stratos2_domain@g" > /etc/bind/db.$stratos2_domain
+    #cat $resource_path/db.$stratos_domain | sed -e "s@SC_HOSTNAME@$sc_hostname@g" | sed -e "s@ELB_IP@$elb_ip@g" | sed -e "s@STRATOS_DOMAIN@$stratos_domain@g" > /etc/bind/db.$stratos_domain
 
     #echo "Add the following content to /etc/bind/named.conf.local" >> $LOG
-    #echo "zone \"$stratos2_domain\" {" >> /etc/bind/named.conf.local
+    #echo "zone \"$stratos_domain\" {" >> /etc/bind/named.conf.local
     #echo "      type master;" >> /etc/bind/named.conf.local
-    #echo "      file \"/etc/bind/db.$stratos2_domain\";" >> /etc/bind/named.conf.local
+    #echo "      file \"/etc/bind/db.$stratos_domain\";" >> /etc/bind/named.conf.local
     #echo "};" >> /etc/bind/named.conf.local
 
     #Copy https://svn.wso2.org/repos/wso2/scratch/hosting/build/tropos/resources/append_zone_file.sh into /opt/scripts folder
@@ -499,119 +486,50 @@ if [[ $cc = "true" ]]; then
     #cp -f ./config/cc/repository/conf/carbon.xml $cc_path/repository/conf/
     #End MB specific file copying
 
-    pushd $cc_path
 
-# Setup IaaS providers
-# ------------------------------------------------
-#        <iaasProviders>
-#        <!--iaasProvider type="ec2" name="ec2 specific details">
-#            <className>org.wso2.carbon.stratos.cloud.controller.iaases.AWSEC2Iaas</className>
-#                        <provider>aws-ec2</provider>
-#                        <identity svns:secretAlias="elastic.scaler.openstack.identity">dhsaghfdal</identity>
-#                        <credential svns:secretAlias="elastic.scaler.openstack.credential">jdkjaskd</credential>
-#                        <scaleUpOrder>1</scaleUpOrder>
-#                        <scaleDownOrder>2</scaleDownOrder>
-#                        <property name="jclouds.ec2.ami-query" value="owner-id=XX-XX-XX;state=available;image-type=machine"/>
-#            <property name="availabilityZone" value="us-east-1c"/>
-#                        <property name="securityGroups" value="manager,cep,mb,default"/>
-#            <property name="instanceType" value="m1.large"/>
-#            <property name="keyPair" value="nirmal-key"/>
-#                        <imageId>us-east-1/ami-52409a3b</imageId>
-#                </iaasProvider-->
-#                <iaasProvider type="openstack" name="openstack specific details">
-#            <className>org.wso2.carbon.stratos.cloud.controller.iaases.OpenstackNovaIaas</className>
-#                        <provider>openstack-nova</provider>
-#                        <identity svns:secretAlias="cloud.controller.openstack.identity">demo:demo</identity>
-#                        <credential svns:secretAlias="cloud.controller.openstack.credential">openstack</credential>
-#                        <property name="jclouds.endpoint" value="http://192.168.16.20:5000/" />
-#            <property name="jclouds.openstack-nova.auto-create-floating-ips" value="false"/>
-#                        <property name="jclouds.api-version" value="2.0/" />
-#                        <scaleUpOrder>2</scaleUpOrder>
-#                        <scaleDownOrder>3</scaleDownOrder>
-#                        <property name="X" value="x" />
-#                        <property name="Y" value="y" />
-#                        <imageId>nova/dab37f0e-cf6f-4812-86fc-733acf22d5e6</imageId>
-#                </iaasProvider>
-#        </iaasProviders>
-
-
-   if [[ $ec2_provider_enable = "true" ]]; then
-       echo "Set EC2 provider specific info in repository/conf/cloud-controller.xml" >> $LOG
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_START@@g" > repository/conf/cloud-controller.xml
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_IDENTITY@$ec2_identity@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_CREDENTIAL@$ec2_credential@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_SCALEUP_ORDER@$ec2_scaleup_order@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_SCALEDOWN_ORDER@$ec2_scaledown_order@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_AVAILABILITY@$ec2_availability_zone@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_SECURITY_GROUPS@$ec2_security_groups@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_INSTANCE_TYPE@$ec2_instance_type@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_KEYPAIR@$ec2_keypair@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_IMAGE_ID@$ec2_image_id@g" > repository/conf/cloud-controller.xml
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_END@@g" > repository/conf/cloud-controller.xml
-   
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml
-   fi
-
-   if [[ $openstack_provider_enable = "true" ]]; then
-       echo "Set OpenStack provider specific info in repository/conf/cloud-controller.xml" >> $LOG
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_START@@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_IDENTITY@$openstack_identity@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_CREDENTIAL@$openstack_credential@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_ENDPOINT@$openstack_jclouds_endpoint@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_SCALEUP_ORDER@$openstack_scaleup_order@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_SCALEDOWN_ORDER@$openstack_scaledown_order@g" > repository/conf/cloud-controller.xml
-       
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_IMAGE_ID@$openstack_image_id@g" > repository/conf/cloud-controller.xml
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_END@@g" > repository/conf/cloud-controller.xml
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml
-
-       cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
-       cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml
-   fi
+    # Setup IaaS providers
+    # ------------------------------------------------
+    # <iaasProviders>
+    # <!--iaasProvider type="ec2" name="ec2 specific details">
+    #      <className>org.wso2.carbon.stratos.cloud.controller.iaases.AWSEC2Iaas</className>
+    #      <provider>aws-ec2</provider>
+    #      <identity svns:secretAlias="elastic.scaler.openstack.identity">dhsaghfdal</identity>
+    #      <credential svns:secretAlias="elastic.scaler.openstack.credential">jdkjaskd</credential>
+    #      <scaleUpOrder>1</scaleUpOrder>
+    #      <scaleDownOrder>2</scaleDownOrder>
+    #      <property name="jclouds.ec2.ami-query" value="owner-id=XX-XX-XX;state=available;image-type=machine"/>
+    #      <property name="availabilityZone" value="us-east-1c"/>
+    #      <property name="securityGroups" value="manager,cep,mb,default"/>
+    #      <property name="instanceType" value="m1.large"/>
+    #      <property name="keyPair" value="nirmal-key"/>
+    #      <imageId>us-east-1/ami-52409a3b</imageId>
+    # </iaasProvider-->
+    #      
+    # <iaasProvider type="openstack" name="openstack specific details">
+    #      <className>org.wso2.carbon.stratos.cloud.controller.iaases.OpenstackNovaIaas</className>
+    #      <provider>openstack-nova</provider>
+    #      <identity svns:secretAlias="cloud.controller.openstack.identity">demo:demo</identity>
+    #      <credential svns:secretAlias="cloud.controller.openstack.credential">openstack</credential>
+    #      <property name="jclouds.endpoint" value="http://192.168.16.20:5000/" />
+    #      <property name="jclouds.openstack-nova.auto-create-floating-ips" value="false"/>
+    #      <property name="jclouds.api-version" value="2.0/" />
+    #      <scaleUpOrder>2</scaleUpOrder>
+    #      <scaleDownOrder>3</scaleDownOrder>
+    #      <property name="X" value="x" />
+    #      <property name="Y" value="y" />
+    #      <imageId>nova/dab37f0e-cf6f-4812-86fc-733acf22d5e6</imageId>
+    # </iaasProvider>
+    # </iaasProviders>
+
+    if [[ $ec2_provider_enabled = true ]]; then
+        ./ec2.sh
+    fi
+    if [[ $openstack_provider_enabled = true ]]; then
+        ./openstack.sh
+    fi
 
+    pushd $cc_path
+    
     cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
     cat repository/conf/cloud-controller.xml.orig | sed -e "s@MB_HOSTNAME:MB_LISTEN_PORT@$mb_hostname:$mb_listen_port@g" > repository/conf/cloud-controller.xml
 
@@ -782,14 +700,14 @@ if [[ $bam = "true" ]]; then
  popd #bam_path
 fi
 
+
 # Configure cartridges
 # ---------------------------------------------------------
-if [[ $demo = "openstack" ]]; then
-   ./openstack-cartridge-setup.sh
+if [[ "$openstack_provider_enabled" = "true" ]]; then
+    ./openstack-cartridge.sh
 fi
-
-if [[ $demo = "ec2" ]]; then
-    ./ec2-cartridge-setup.sh
+if [[ "$ec2_provider_enabled" = "true" ]]; then
+    ./ec2-cartridge.sh
 fi
 
 echo 'Changing owner of '$stratos_path' to '$host_user:$host_user
@@ -802,6 +720,7 @@ if [[ $answer != y ]] ; then
     exit 1
 fi
 
+
 # Starting the servers
 # ---------------------------------------------------------
 echo "Starting the servers" >> $LOG

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/start-servers.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/start-servers.sh b/tools/stratos-installer/start-servers.sh
index 6151335..287f327 100755
--- a/tools/stratos-installer/start-servers.sh
+++ b/tools/stratos-installer/start-servers.sh
@@ -78,7 +78,7 @@ do
         elb="true"
         agent="true"
         sc="true"
-#        bam="true"
+        bam="true"
     fi
     if [[ $x = "demo" ]]; then
         demo="true"
@@ -86,7 +86,7 @@ do
         elb="true"
         agent="true"
         sc="true"
-#	bam="true"
+	bam="true"
     fi
 done
 product_list=`echo $product_list | sed 's/^ *//g' | sed 's/ *$//g'`
@@ -96,14 +96,14 @@ if [[ -z $product_list || $product_list = "" ]]; then
 fi
 
 #if [[ $bam = "true" ]]; then
-
+#
 #    echo ${bam_path}
-
+#
 #    echo "Starting BAM server ..." >> $LOG
 #    nohup ${bam_path}/bin/stratos.sh -DportOffset=$bam_port_offset &
 #    echo "BAM server started" >> $LOG
 #    sleep $SLEEP
-
+#
 #fi
 
 if [[ $cc = "true" ]]; then


[2/2] git commit: Updated stratos-installer to support Amazon EC2

Posted by ma...@apache.org.
Updated stratos-installer to support Amazon EC2

Signed-off-by: Manula Thantriwatte <ma...@wso2.com>


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

Branch: refs/heads/master
Commit: cdb160e56fd94dcb7b79613c3a69bdd6d56969eb
Parents: 858799f
Author: Imesh Gunaratne <im...@wso2.com>
Authored: Thu Sep 5 12:11:06 2013 +0530
Committer: Manula Thantriwatte <ma...@wso2.com>
Committed: Thu Sep 5 12:22:36 2013 +0530

----------------------------------------------------------------------
 .../cartridges/ec2/ec2_mysql.xml                |  36 ++
 .../cartridges/ec2/ec2_php.xml                  |  35 ++
 .../cartridges/ec2/ec2_tomcat.xml               |  35 ++
 tools/stratos-installer/cartridges/mysql.xml    |  68 ----
 .../cartridges/openstack/openstack_mysql.xml    |  36 ++
 .../cartridges/openstack/openstack_php.xml      |  35 ++
 .../cartridges/openstack/openstack_tomcat.xml   |  36 ++
 tools/stratos-installer/cartridges/php.xml      |  67 ----
 tools/stratos-installer/cartridges/tomcat.xml   |  67 ----
 tools/stratos-installer/conf/setup.conf         |  39 +-
 .../cc/repository/conf/cloud-controller.xml     |  22 +-
 .../cc/repository/deployment/server/mysql.xml   |  68 ----
 .../cc/repository/deployment/server/php.xml     |  67 ----
 .../cc/repository/deployment/server/tomcat.xml  |  67 ----
 tools/stratos-installer/ec2-cartridge-setup.sh  |  39 --
 tools/stratos-installer/ec2-cartridge.sh        | 132 +++++++
 tools/stratos-installer/ec2.sh                  |  82 ++++
 .../openstack-cartridge-setup.sh                | 147 -------
 tools/stratos-installer/openstack-cartridge.sh  | 131 +++++++
 tools/stratos-installer/openstack.sh            |  72 ++++
 tools/stratos-installer/setup.sh                | 379 ++++++++-----------
 tools/stratos-installer/start-servers.sh        |  10 +-
 22 files changed, 816 insertions(+), 854 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/cartridges/ec2/ec2_mysql.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/cartridges/ec2/ec2_mysql.xml b/tools/stratos-installer/cartridges/ec2/ec2_mysql.xml
new file mode 100644
index 0000000..f13f384
--- /dev/null
+++ b/tools/stratos-installer/cartridges/ec2/ec2_mysql.xml
@@ -0,0 +1,36 @@
+<!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
+    <cartridges>
+        <!-- You can have 1..n cartridge elements. -->
+        <cartridge type="mysql" host="mysql.STRATOS_DOMAIN" provider="data" version="5.5" multiTenant="false">
+            <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
+                 specified under iaasProvider child elements of cartridge element. -->
+
+            <displayName>EC2 MySQL</displayName>
+            <description>EC2 MySQL Cartridge</description>
+            <!-- A cartridge element should add a reference to an existing IaaS provider (specified
+                 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
+                 Provider (which should have a unique "type" attribute. -->
+            <iaasProvider type="ec2" >
+                <imageId>region/imageid</imageId>           
+                <property name="keyPair" value="key-pair"/>
+                <property name="instanceType" value="instance-type"/>
+                <property name="securityGroups" value="security-groups"/>
+            </iaasProvider>
+            <deployment baseDir="/var/www">
+                <dir>public=copy#app#files#here</dir>
+                <dir>simplesamlphp=copy#saml#libraries#here</dir>
+            </deployment>
+	   <portMapping>
+               <http port="80" proxyPort="8280"/>
+               <https port="443" proxyPort="8243"/>
+           </portMapping>
+           <property name="sshPort" value="22"/>
+           <property name="dataPort" value="3306"/>
+            <!--<appTypes>
+                <property name="axis2services" isBothmapping="false"/>
+                <property name="webapps" isBothmapping="true"/>
+                <property name="jaxwebapps" isBothmapping="true"/>
+                <property name="jaggeryapps" isBothmapping="true"/>
+            </appTypes>-->
+        </cartridge>
+    </cartridges>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/cartridges/ec2/ec2_php.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/cartridges/ec2/ec2_php.xml b/tools/stratos-installer/cartridges/ec2/ec2_php.xml
new file mode 100644
index 0000000..698afbd
--- /dev/null
+++ b/tools/stratos-installer/cartridges/ec2/ec2_php.xml
@@ -0,0 +1,35 @@
+<!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
+    <cartridges>
+        <!-- You can have 1..n cartridge elements. -->
+        <cartridge type="php" host="php.STRATOS_DOMAIN" provider="zend-provider" version="5.5" multiTenant="false">
+            <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
+                 specified under iaasProvider child elements of cartridge element. -->
+
+            <displayName>EC2 PHP</displayName>
+            <description>EC2 PHP Cartridge</description>
+            <!-- A cartridge element should add a reference to an existing IaaS provider (specified
+                 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
+                 Provider (which should have a unique "type" attribute. -->
+            <iaasProvider type="ec2" >
+                <imageId>region/image-id</imageId>           
+                <property name="keyPair" value="key-pair"/>
+                <property name="instanceType" value="instance-type"/>
+                <property name="securityGroups" value="security-groups"/>
+            </iaasProvider>
+            <deployment baseDir="/var/www">
+                <dir>www=copy#app#files#here</dir>
+                <dir>simplesamlphp=copy#saml#libraries#here</dir>
+		<dir>sql=copy#saml#libraries#here</dir>
+            </deployment>
+	   <portMapping>
+               <http port="80" proxyPort="8280"/>
+               <https port="443" proxyPort="8243"/>
+           </portMapping>
+            <!--<appTypes>
+                <property name="axis2services" isBothmapping="false"/>
+                <property name="webapps" isBothmapping="true"/>
+                <property name="jaxwebapps" isBothmapping="true"/>
+                <property name="jaggeryapps" isBothmapping="true"/>
+            </appTypes>-->
+        </cartridge>
+    </cartridges>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/cartridges/ec2/ec2_tomcat.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/cartridges/ec2/ec2_tomcat.xml b/tools/stratos-installer/cartridges/ec2/ec2_tomcat.xml
new file mode 100644
index 0000000..b2c0db0
--- /dev/null
+++ b/tools/stratos-installer/cartridges/ec2/ec2_tomcat.xml
@@ -0,0 +1,35 @@
+<!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
+    <cartridges>
+        <!-- You can have 1..n cartridge elements. -->
+        <cartridge type="tomcat" host="tomcat.stratos.apache.org" provider="apache" version="7" multiTenant="false">
+            <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
+                 specified under iaasProvider child elements of cartridge element. -->
+
+            <displayName>EC2 Tomcat</displayName>
+            <description>EC2 Tomcat Cartridge</description>
+            <!-- A cartridge element should add a reference to an existing IaaS provider (specified
+                 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
+                 Provider (which should have a unique "type" attribute. -->
+            <iaasProvider type="ec2" >
+                <imageId>region/image-id</imageId>           
+                <property name="keyPair" value="key-pair"/>
+                <property name="securityGroups" value="security-groups"/>
+                <property name="instanceType" value="instance-type"/>
+            </iaasProvider>
+            <deployment baseDir="/var/lib/tomcat7/webapps">
+                <dir>www=copy#app#files#here</dir>
+                <dir>simplesamlphp=copy#saml#libraries#here</dir>
+		<dir>sql=copy#saml#libraries#here</dir>
+            </deployment>
+	   <portMapping>
+               <http port="8080" proxyPort="8280"/>
+               <https port="8443" proxyPort="8243"/>
+           </portMapping>
+            <!--<appTypes>
+                <property name="axis2services" isBothmapping="false"/>
+                <property name="webapps" isBothmapping="true"/>
+                <property name="jaxwebapps" isBothmapping="true"/>
+                <property name="jaggeryapps" isBothmapping="true"/>
+            </appTypes>-->
+        </cartridge>
+    </cartridges>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/cartridges/mysql.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/cartridges/mysql.xml b/tools/stratos-installer/cartridges/mysql.xml
deleted file mode 100644
index c8862ac..0000000
--- a/tools/stratos-installer/cartridges/mysql.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version='1.0'?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-<!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
-    <cartridges>
-
-        <!-- You can have 1..n cartridge elements. -->
-        <cartridge type="mysql" host="mysql.STRATOS_DOMAIN" provider="data" version="5.5" multiTenant="false">
-            <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
-                 specified under iaasProvider child elements of cartridge element. -->
-
-            <displayName>MySQL Database</displayName>
-            <description>MySQL - The world's most popular open source database</description>
-            <!-- A cartridge element should add a reference to an existing IaaS provider (specified
-                 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
-                 Provider (which should have a unique "type" attribute. -->
-            <iaasProvider type="openstack" >
-                <imageId>nova/d6e5dbe9-f781-460d-b554-23a133a887cd</imageId>
-                <property name="keyPair" value="stratos-demo"/>
-                <property name="instanceType" value="nova/1"/>
-                <property name="securityGroups" value="default"/>
-                <!--<property name="payload" value="resources/as.txt"/>-->
-            </iaasProvider>
-            <!--<iaasProvider type="ec2" >
-                <imageId>us-east-1/ami-ef49e786</imageId>           
-                <property name="keyPair" value="aa"/>
-                <property name="securityGroups" value="default"/>
-                <property name="instanceType" value="m1.large"/>
-                <property name="payload" value="resources/as-ec2.txt"/>
-            </iaasProvider>-->
-            <deployment baseDir="/var/www">
-                <dir>public=copy#app#files#here</dir>
-                <dir>simplesamlphp=copy#saml#libraries#here</dir>
-            </deployment>
-	   <portMapping>
-               <http port="80" proxyPort="8280"/>
-               <https port="443" proxyPort="8243"/>
-           </portMapping>
-           <property name="sshPort" value="22"/>
-           <property name="dataPort" value="3306"/>
-            <!--<appTypes>
-                <property name="axis2services" isBothmapping="false"/>
-                <property name="webapps" isBothmapping="true"/>
-                <property name="jaxwebapps" isBothmapping="true"/>
-                <property name="jaggeryapps" isBothmapping="true"/>
-            </appTypes>-->
-        </cartridge>
-
-    </cartridges>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/cartridges/openstack/openstack_mysql.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/cartridges/openstack/openstack_mysql.xml b/tools/stratos-installer/cartridges/openstack/openstack_mysql.xml
new file mode 100644
index 0000000..57257a7
--- /dev/null
+++ b/tools/stratos-installer/cartridges/openstack/openstack_mysql.xml
@@ -0,0 +1,36 @@
+<!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
+    <cartridges>
+        <!-- You can have 1..n cartridge elements. -->
+        <cartridge type="mysql" host="mysql.STRATOS_DOMAIN" provider="data" version="5.5" multiTenant="false">
+            <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
+                 specified under iaasProvider child elements of cartridge element. -->
+
+            <displayName>Openstack MySQL</displayName>
+            <description>Openstack MySQL Cartridge</description>
+            <!-- A cartridge element should add a reference to an existing IaaS provider (specified
+                 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
+                 Provider (which should have a unique "type" attribute. -->
+            <iaasProvider type="openstack" >
+                <imageId>region/image-id</imageId>
+                <property name="keyPair" value="key-pair"/>
+                <property name="instanceType" value="instance-type"/>
+                <property name="securityGroups" value="security-groups"/>
+            </iaasProvider>
+            <deployment baseDir="/var/www">
+                <dir>public=copy#app#files#here</dir>
+                <dir>simplesamlphp=copy#saml#libraries#here</dir>
+            </deployment>
+	    <portMapping>
+               <http port="80" proxyPort="8280"/>
+               <https port="443" proxyPort="8243"/>
+            </portMapping>
+            <property name="sshPort" value="22"/>
+            <property name="dataPort" value="3306"/>
+            <!--<appTypes>
+                <property name="axis2services" isBothmapping="false"/>
+                <property name="webapps" isBothmapping="true"/>
+                <property name="jaxwebapps" isBothmapping="true"/>
+                <property name="jaggeryapps" isBothmapping="true"/>
+            </appTypes>-->
+        </cartridge>
+    </cartridges>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/cartridges/openstack/openstack_php.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/cartridges/openstack/openstack_php.xml b/tools/stratos-installer/cartridges/openstack/openstack_php.xml
new file mode 100644
index 0000000..7ae8780
--- /dev/null
+++ b/tools/stratos-installer/cartridges/openstack/openstack_php.xml
@@ -0,0 +1,35 @@
+<!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
+    <cartridges>
+        <!-- You can have 1..n cartridge elements. -->
+        <cartridge type="php" host="php.STRATOS_DOMAIN" provider="zend-provider" version="5.5" multiTenant="false">
+            <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
+                 specified under iaasProvider child elements of cartridge element. -->
+
+            <displayName>Openstack PHP</displayName>
+            <description>Openstack PHP Cartridge</description>
+            <!-- A cartridge element should add a reference to an existing IaaS provider (specified
+                 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
+                 Provider (which should have a unique "type" attribute. -->
+            <iaasProvider type="openstack" >
+                <imageId>region/image-id</imageId>
+                <property name="keyPair" value="key-pair"/>
+                <property name="instanceType" value="instance-type"/>
+                <property name="securityGroups" value="security-groups"/>
+            </iaasProvider>
+            <deployment baseDir="/var/www">
+                <dir>www=copy#app#files#here</dir>
+                <dir>simplesamlphp=copy#saml#libraries#here</dir>
+		<dir>sql=copy#saml#libraries#here</dir>
+            </deployment>
+  	    <portMapping>
+               <http port="80" proxyPort="8280"/>
+               <https port="443" proxyPort="8243"/>
+            </portMapping>
+            <!--<appTypes>
+                <property name="axis2services" isBothmapping="false"/>
+                <property name="webapps" isBothmapping="true"/>
+                <property name="jaxwebapps" isBothmapping="true"/>
+                <property name="jaggeryapps" isBothmapping="true"/>
+            </appTypes>-->
+        </cartridge>
+    </cartridges>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/cartridges/openstack/openstack_tomcat.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/cartridges/openstack/openstack_tomcat.xml b/tools/stratos-installer/cartridges/openstack/openstack_tomcat.xml
new file mode 100644
index 0000000..ec576ed
--- /dev/null
+++ b/tools/stratos-installer/cartridges/openstack/openstack_tomcat.xml
@@ -0,0 +1,36 @@
+<!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
+    <cartridges>
+        <!-- You can have 1..n cartridge elements. -->
+        <cartridge type="tomcat" host="tomcat.stratos.apache.org" provider="apache" version="7" multiTenant="false">
+            <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
+                 specified under iaasProvider child elements of cartridge element. -->
+
+            <displayName>Openstack Tomcat</displayName>
+            <description>Openstack Tomcat Cartridge</description>
+            <!-- A cartridge element should add a reference to an existing IaaS provider (specified
+                 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
+                 Provider (which should have a unique "type" attribute. -->
+            <iaasProvider type="openstack" >
+                <imageId>region/image-id</imageId>
+                <property name="keyPair" value="key-pait"/>
+                <property name="instanceType" value="instance-type"/>
+                <property name="securityGroups" value="security-groups"/>
+                <!--<property name="payload" value="payload-file-path"/>-->
+            </iaasProvider>
+            <deployment baseDir="/var/lib/tomcat7/webapps">
+                <dir>www=copy#app#files#here</dir>
+                <dir>simplesamlphp=copy#saml#libraries#here</dir>
+		<dir>sql=copy#saml#libraries#here</dir>
+            </deployment>
+            <portMapping>
+               <http port="8080" proxyPort="8280"/>
+               <https port="8443" proxyPort="8243"/>
+            </portMapping>
+            <!--<appTypes>
+                <property name="axis2services" isBothmapping="false"/>
+                <property name="webapps" isBothmapping="true"/>
+                <property name="jaxwebapps" isBothmapping="true"/>
+                <property name="jaggeryapps" isBothmapping="true"/>
+            </appTypes>-->
+        </cartridge>
+    </cartridges>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/cartridges/php.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/cartridges/php.xml b/tools/stratos-installer/cartridges/php.xml
deleted file mode 100644
index 5cb486d..0000000
--- a/tools/stratos-installer/cartridges/php.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version='1.0'?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-<!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
-    <cartridges>
-
-        <!-- You can have 1..n cartridge elements. -->
-        <cartridge type="php" host="php.STRATOS_DOMAIN" provider="zend-provider" version="5.5" multiTenant="false">
-            <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
-                 specified under iaasProvider child elements of cartridge element. -->
-
-            <displayName>PHP</displayName>
-            <description>PHP Cartridge</description>
-            <!-- A cartridge element should add a reference to an existing IaaS provider (specified
-                 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
-                 Provider (which should have a unique "type" attribute. -->
-            <iaasProvider type="openstack" >
-                <imageId>nova/3a4000c8-0973-421a-94f8-dbfe8b7b5250</imageId>
-                <property name="keyPair" value="stratos-demo"/>
-                <property name="instanceType" value="nova/1"/>
-                <property name="securityGroups" value="default"/>
-                <!--<property name="payload" value="resources/as.txt"/>-->
-            </iaasProvider>
-            <!--<iaasProvider type="ec2" >
-                <imageId>us-east-1/ami-ef49e786</imageId>           
-                <property name="keyPair" value="aa"/>
-                <property name="securityGroups" value="default"/>
-                <property name="instanceType" value="m1.large"/>
-                <property name="payload" value="resources/as-ec2.txt"/>
-            </iaasProvider>-->
-            <deployment baseDir="/var/www">
-                <dir>www=copy#app#files#here</dir>
-                <dir>simplesamlphp=copy#saml#libraries#here</dir>
-		<dir>sql=copy#saml#libraries#here</dir>
-            </deployment>
-	   <portMapping>
-               <http port="80" proxyPort="8280"/>
-               <https port="443" proxyPort="8243"/>
-           </portMapping>
-            <!--<appTypes>
-                <property name="axis2services" isBothmapping="false"/>
-                <property name="webapps" isBothmapping="true"/>
-                <property name="jaxwebapps" isBothmapping="true"/>
-                <property name="jaggeryapps" isBothmapping="true"/>
-            </appTypes>-->
-        </cartridge>
-
-    </cartridges>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/cartridges/tomcat.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/cartridges/tomcat.xml b/tools/stratos-installer/cartridges/tomcat.xml
deleted file mode 100644
index df5936e..0000000
--- a/tools/stratos-installer/cartridges/tomcat.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version='1.0'?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-<!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
-    <cartridges>
-
-        <!-- You can have 1..n cartridge elements. -->
-        <cartridge type="tomcat" host="tomcat.STRATOS_DOMAIN" provider="apache" version="7" multiTenant="false">
-            <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
-                 specified under iaasProvider child elements of cartridge element. -->
-
-            <displayName>TOMCAT</displayName>
-            <description>TOMCAT Cartridge</description>
-            <!-- A cartridge element should add a reference to an existing IaaS provider (specified
-                 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
-                 Provider (which should have a unique "type" attribute. -->
-            <iaasProvider type="openstack" >
-                <imageId>nova/3a4000c8-0973-421a-94f8-dbfe8b7b5250</imageId>
-                <property name="keyPair" value="stratos-demo"/>
-                <property name="instanceType" value="nova/1"/>
-                <property name="securityGroups" value="default"/>
-                <!--<property name="payload" value="resources/as.txt"/>-->
-            </iaasProvider>
-            <!--<iaasProvider type="ec2" >
-                <imageId>us-east-1/ami-ef49e786</imageId>           
-                <property name="keyPair" value="aa"/>
-                <property name="securityGroups" value="default"/>
-                <property name="instanceType" value="m1.large"/>
-                <property name="payload" value="resources/as-ec2.txt"/>
-            </iaasProvider>-->
-            <deployment baseDir="/var/lib/tomcat7/webapps">
-                <dir>www=copy#app#files#here</dir>
-                <dir>simplesamlphp=copy#saml#libraries#here</dir>
-		<dir>sql=copy#saml#libraries#here</dir>
-            </deployment>
-	   <portMapping>
-               <http port="8080" proxyPort="8280"/>
-               <https port="8443" proxyPort="8243"/>
-           </portMapping>
-            <!--<appTypes>
-                <property name="axis2services" isBothmapping="false"/>
-                <property name="webapps" isBothmapping="true"/>
-                <property name="jaxwebapps" isBothmapping="true"/>
-                <property name="jaggeryapps" isBothmapping="true"/>
-            </appTypes>-->
-        </cartridge>
-
-    </cartridges>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/conf/setup.conf
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/conf/setup.conf b/tools/stratos-installer/conf/setup.conf
index 4de8b06..0552e85 100644
--- a/tools/stratos-installer/conf/setup.conf
+++ b/tools/stratos-installer/conf/setup.conf
@@ -57,7 +57,7 @@ export mb_listen_port="5677"
 export sc_path=$stratos_path/"apache-stratos-sc-3.0.0-SNAPSHOT"
 export sc_pack=$stratos_pack_path/"apache-stratos-sc-3.0.0-SNAPSHOT.zip"
 
-export stratos2_domain="stratos.apache.org"
+export stratos_domain="stratos.apache.org"
 
 export userstore_db_hostname="stratos.apache.org"
 export userstore_db_schema="userstore"
@@ -152,19 +152,23 @@ export agent_port_offset=4
 # IaaS Providers
 # ----------------------------------------------------------------------------
 # EC2
-#export ec2_provider_enable=false
-#export ec2_identity=""
-#export ec2_credential=""
-#export ec2_keypair=""
-#export ec2_scaleup_order=1
-#export ec2_scaledown_order=2
-#export ec2_availability_zone="us-east-1c"
-#export ec2_security_groups="manager,cep,mb,default"
-#export ec2_instance_type="m1.large"
-#export ec2_image_id=""
+export ec2_provider_enabled=false
+export ec2_identity=""
+export ec2_credential=""
+export ec2_keypair_name=""
+export ec2_scaleup_order=1
+export ec2_scaledown_order=2
+export ec2_region="ap-southeast-1"
+export ec2_availability_zone="ap-southeast-1a"
+export ec2_security_groups="default"
+export ec2_instance_type="m1.large"
+export ec2_image_id=""
+export ec2_php_cartridge_image_id="ami-8a733bd8" 
+export ec2_mysql_cartridge_image_id="ami-3e753d6c"
+export ec2_tomcat_cartridge_image_id="ami-6484cc36"
 
 # Openstack
-export openstack_provider_enable=true
+export openstack_provider_enabled=true
 export openstack_identity="stratos:stratos" # Openstack project name:Openstack login user
 export openstack_credential="password" # Openstack login password
 export openstack_tenant="stratos" # openstack project name
@@ -173,17 +177,16 @@ export openstack_jclouds_endpoint="http://hostname:5000/v2.0"
 export openstack_scaleup_order=2
 export openstack_scaledown_order=3
 
-export openstack_keypair_name="key-pair-name" #Name of the openstack key pair. The name should match
-#<property name="keyPair" value="key-pair-name"/> under Openstack provider in cartridge xml files
+export openstack_keypair_name="key-pair-name"
 
 export openstack_image_id="RegionOne/" #No need to change this as of now
 export nova_region="RegionOne"
 export openstack_instance_type_tiny="RegionOne\/1"
 export openstack_instance_type_small="RegionOne\/2"
-export openstack_security_group="security-group-name"
-export php_cartridge_image_id=""
-export mysql_cartridge_image_id=""
-export tomcat_cartridge_image_id=""
+export openstack_security_groups="security-groups"
+export openstack_php_cartridge_image_id=""
+export openstack_mysql_cartridge_image_id=""
+export openstack_tomcat_cartridge_image_id=""
 
 
 # Cassandra configuration

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml b/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml
index bab51ce..d0ce5c9 100644
--- a/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml
+++ b/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml
@@ -50,29 +50,30 @@
         <!-- Specify the properties that are common to an IaaS here. This element 
                 is not necessary [0..1]. But you can use this section to avoid specifying 
                 same property over and over again. -->
-        <iaasProviders>
-            <EC2_PROVIDER_STARTiaasProvider type="ec2" name="ec2 specific details">
-            <className>org.apache.stratos.cloud.controller.iaases.AWSEC2Iaas</className>
+	<iaasProviders>
+        	<EC2_PROVIDER_STARTiaasProvider type="ec2" name="ec2 specific details">
+                	<className>org.apache.stratos.cloud.controller.iaases.AWSEC2Iaas</className>
                         <provider>aws-ec2</provider>
                         <identity svns:secretAlias="elastic.scaler.openstack.identity">EC2_IDENTITY</identity>
                         <credential svns:secretAlias="elastic.scaler.openstack.credential">EC2_CREDENTIAL</credential>
                         <scaleUpOrder>EC2_SCALEUP_ORDER</scaleUpOrder>
                         <scaleDownOrder>EC2_SCALEDOWN_ORDER</scaleDownOrder>
                         <property name="jclouds.ec2.ami-query" value="owner-id=XX-XX-XX;state=available;image-type=machine"/>
-            <property name="availabilityZone" value="EC2_AVAILABILITY_ZONE"/>
+                        <property name="availabilityZone" value="EC2_AVAILABILITY_ZONE"/>
                         <property name="securityGroups" value="EC2_SECURITY_GROUPS"/>
-            <property name="instanceType" value="EC2_INSTANCE_TYPE"/>
-            <property name="keyPair" value="EC2_KEYPAIR"/>
+                        <property name="instanceType" value="EC2_INSTANCE_TYPE"/>
+                        <property name="autoAssignIp" value="true" />
+                        <property name="keyPair" value="EC2_KEYPAIR"/>
+                        <maxInstanceLimit>30</maxInstanceLimit>
                         <imageId>EC2_IMAGE_ID</imageId>
-                    </iaasProviderEC2_PROVIDER_END>
+                </iaasProviderEC2_PROVIDER_END>
                 <OPENSTACK_PROVIDER_STARTiaasProvider type="openstack" name="openstack specific details">
-            <className>org.apache.stratos.cloud.controller.iaases.OpenstackNovaIaas</className>
+            		<className>org.apache.stratos.cloud.controller.iaases.OpenstackNovaIaas</className>
                         <provider>openstack-nova</provider>
                         <identity svns:secretAlias="cloud.controller.openstack.identity">OPENSTACK_IDENTITY</identity>
                         <credential svns:secretAlias="cloud.controller.openstack.credential">OPENSTACK_CREDENTIAL</credential>
                         <property name="jclouds.endpoint" value="OPENSTACK_ENDPOINT" />
             		<property name="jclouds.openstack-nova.auto-create-floating-ips" value="false"/>
- 			<!--property name="autoAssignIp" value="true" /-->
                         <property name="jclouds.api-version" value="2.0/" />
                         <scaleUpOrder>OPENSTACK_SCALEUP_ORDER</scaleUpOrder>
                         <scaleDownOrder>OPENSTACK_SCALEDOWN_ORDER</scaleDownOrder>
@@ -80,7 +81,6 @@
                         <property name="Y" value="y" />
 			<maxInstanceLimit>30</maxInstanceLimit>
                         <imageId>OPENSTACK_IMAGE_ID</imageId>
-                    </iaasProviderOPENSTACK_PROVIDER_END>
+        	</iaasProviderOPENSTACK_PROVIDER_END>
         </iaasProviders>
-
 </cloudController>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/config/cc/repository/deployment/server/mysql.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/config/cc/repository/deployment/server/mysql.xml b/tools/stratos-installer/config/cc/repository/deployment/server/mysql.xml
deleted file mode 100644
index af7cd22..0000000
--- a/tools/stratos-installer/config/cc/repository/deployment/server/mysql.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version='1.0'?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-<!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
-    <cartridges>
-
-        <!-- You can have 1..n cartridge elements. -->
-        <cartridge type="mysql" host="mysql.STRATOS_DOMAIN" provider="data" version="5.5" multiTenant="false">
-            <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
-                 specified under iaasProvider child elements of cartridge element. -->
-
-            <displayName>MySQL Database</displayName>
-            <description>MySQL - The world's most popular open source database</description>
-            <!-- A cartridge element should add a reference to an existing IaaS provider (specified
-                 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
-                 Provider (which should have a unique "type" attribute. -->
-            <iaasProvider type="openstack" >
-                <imageId>nova/96cf2b9d-b7be-4a4a-add3-c8f34c34d5b4</imageId>
-                <property name="keyPair" value="stratos-demo"/>
-                <property name="instanceType" value="nova/1"/>
-                <property name="securityGroups" value="default"/>
-                <!--<property name="payload" value="resources/as.txt"/>-->
-            </iaasProvider>
-            <!--<iaasProvider type="ec2" >
-                <imageId>us-east-1/ami-ef49e786</imageId>           
-                <property name="keyPair" value="aa"/>
-                <property name="securityGroups" value="default"/>
-                <property name="instanceType" value="m1.large"/>
-                <property name="payload" value="resources/as-ec2.txt"/>
-            </iaasProvider>-->
-            <deployment baseDir="/var/www">
-                <dir>public=copy#app#files#here</dir>
-                <dir>simplesamlphp=copy#saml#libraries#here</dir>
-            </deployment>
-	   <portMapping>
-               <http port="80" proxyPort="8280"/>
-               <https port="443" proxyPort="8243"/>
-           </portMapping>
-           <property name="sshPort" value="22"/>
-           <property name="dataPort" value="3306"/>
-            <!--<appTypes>
-                <property name="axis2services" isBothmapping="false"/>
-                <property name="webapps" isBothmapping="true"/>
-                <property name="jaxwebapps" isBothmapping="true"/>
-                <property name="jaggeryapps" isBothmapping="true"/>
-            </appTypes>-->
-        </cartridge>
-
-    </cartridges>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/config/cc/repository/deployment/server/php.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/config/cc/repository/deployment/server/php.xml b/tools/stratos-installer/config/cc/repository/deployment/server/php.xml
deleted file mode 100644
index 2e94c0a..0000000
--- a/tools/stratos-installer/config/cc/repository/deployment/server/php.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version='1.0'?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-<!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
-    <cartridges>
-
-        <!-- You can have 1..n cartridge elements. -->
-        <cartridge type="php" host="php.STRATOS_DOMAIN" provider="zend-provider" version="5.5" multiTenant="false">
-            <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
-                 specified under iaasProvider child elements of cartridge element. -->
-
-            <displayName>PHP</displayName>
-            <description>PHP Cartridge</description>
-            <!-- A cartridge element should add a reference to an existing IaaS provider (specified
-                 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
-                 Provider (which should have a unique "type" attribute. -->
-            <iaasProvider type="openstack" >
-                <imageId>nova/0687ca81-b778-47c4-929b-1edd63469419</imageId>
-                <property name="keyPair" value="stratos-demo"/>
-                <property name="instanceType" value="nova/1"/>
-                <property name="securityGroups" value="default"/>
-                <!--<property name="payload" value="resources/as.txt"/>-->
-            </iaasProvider>
-            <!--<iaasProvider type="ec2" >
-                <imageId>us-east-1/ami-ef49e786</imageId>           
-                <property name="keyPair" value="aa"/>
-                <property name="securityGroups" value="default"/>
-                <property name="instanceType" value="m1.large"/>
-                <property name="payload" value="resources/as-ec2.txt"/>
-            </iaasProvider>-->
-            <deployment baseDir="/var/www">
-                <dir>www=copy#app#files#here</dir>
-                <dir>simplesamlphp=copy#saml#libraries#here</dir>
-		<dir>sql=copy#saml#libraries#here</dir>
-            </deployment>
-	   <portMapping>
-               <http port="80" proxyPort="8280"/>
-               <https port="443" proxyPort="8243"/>
-           </portMapping>
-            <!--<appTypes>
-                <property name="axis2services" isBothmapping="false"/>
-                <property name="webapps" isBothmapping="true"/>
-                <property name="jaxwebapps" isBothmapping="true"/>
-                <property name="jaggeryapps" isBothmapping="true"/>
-            </appTypes>-->
-        </cartridge>
-
-    </cartridges>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/config/cc/repository/deployment/server/tomcat.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/config/cc/repository/deployment/server/tomcat.xml b/tools/stratos-installer/config/cc/repository/deployment/server/tomcat.xml
deleted file mode 100644
index df5936e..0000000
--- a/tools/stratos-installer/config/cc/repository/deployment/server/tomcat.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version='1.0'?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-<!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
-    <cartridges>
-
-        <!-- You can have 1..n cartridge elements. -->
-        <cartridge type="tomcat" host="tomcat.STRATOS_DOMAIN" provider="apache" version="7" multiTenant="false">
-            <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
-                 specified under iaasProvider child elements of cartridge element. -->
-
-            <displayName>TOMCAT</displayName>
-            <description>TOMCAT Cartridge</description>
-            <!-- A cartridge element should add a reference to an existing IaaS provider (specified
-                 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
-                 Provider (which should have a unique "type" attribute. -->
-            <iaasProvider type="openstack" >
-                <imageId>nova/3a4000c8-0973-421a-94f8-dbfe8b7b5250</imageId>
-                <property name="keyPair" value="stratos-demo"/>
-                <property name="instanceType" value="nova/1"/>
-                <property name="securityGroups" value="default"/>
-                <!--<property name="payload" value="resources/as.txt"/>-->
-            </iaasProvider>
-            <!--<iaasProvider type="ec2" >
-                <imageId>us-east-1/ami-ef49e786</imageId>           
-                <property name="keyPair" value="aa"/>
-                <property name="securityGroups" value="default"/>
-                <property name="instanceType" value="m1.large"/>
-                <property name="payload" value="resources/as-ec2.txt"/>
-            </iaasProvider>-->
-            <deployment baseDir="/var/lib/tomcat7/webapps">
-                <dir>www=copy#app#files#here</dir>
-                <dir>simplesamlphp=copy#saml#libraries#here</dir>
-		<dir>sql=copy#saml#libraries#here</dir>
-            </deployment>
-	   <portMapping>
-               <http port="8080" proxyPort="8280"/>
-               <https port="8443" proxyPort="8243"/>
-           </portMapping>
-            <!--<appTypes>
-                <property name="axis2services" isBothmapping="false"/>
-                <property name="webapps" isBothmapping="true"/>
-                <property name="jaxwebapps" isBothmapping="true"/>
-                <property name="jaggeryapps" isBothmapping="true"/>
-            </appTypes>-->
-        </cartridge>
-
-    </cartridges>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/ec2-cartridge-setup.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/ec2-cartridge-setup.sh b/tools/stratos-installer/ec2-cartridge-setup.sh
deleted file mode 100644
index c2482f2..0000000
--- a/tools/stratos-installer/ec2-cartridge-setup.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-# ----------------------------------------------------------------------------
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-# ----------------------------------------------------------------------------
-#
-#  This script is invoked by setup.sh for setting up Apache Stratos Cartridges for EC2.
-# ----------------------------------------------------------------------------
-
-# Die on any error:
-set -e
-
-SLEEP=60
-export LOG=$log_path/stratos-ec2-cartridge-setup.log
-
-source "./conf/setup.conf"
-
-
-if [[ ! -d $log_path ]]; then
-    mkdir -p $log_path
-fi
-   
-echo 'TODO: To be written'

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/ec2-cartridge.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/ec2-cartridge.sh b/tools/stratos-installer/ec2-cartridge.sh
new file mode 100755
index 0000000..31aef96
--- /dev/null
+++ b/tools/stratos-installer/ec2-cartridge.sh
@@ -0,0 +1,132 @@
+#!/bin/bash
+# ----------------------------------------------------------------------------
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+# ----------------------------------------------------------------------------
+#
+#  This script is invoked by setup.sh for configuring cartridges for Amazon EC2.
+# ----------------------------------------------------------------------------
+
+# Die on any error:
+set -e
+
+SLEEP=60
+export LOG=$log_path/stratos-ec2-cartridge.log
+
+source "./conf/setup.conf"
+
+if [[ ! -d $log_path ]]; then
+    mkdir -p $log_path
+fi
+   
+
+echo "Creating payload directory ... " | tee $LOG
+if [[ ! -d $cc_path/repository/resources/payload ]]; then
+   mkdir -p $cc_path/repository/resources/payload
+fi
+
+echo "Creating cartridges directory ... " | tee $LOG
+if [[ ! -d $cc_path/repository/deployment/server/cartridges/ ]]; then
+   mkdir -p $cc_path/repository/deployment/server/cartridges/
+fi
+
+
+# Copy cartridge configuration files to CC
+if [ "$(find ./cartridges/ec2/ -type f)" ]; then
+    cp -f ./cartridges/ec2/*.xml $cc_path/repository/deployment/server/cartridges/
+fi
+
+
+pushd $cc_path
+echo "Updating repository/deployment/server/cartridges/ec2_mysql.xml" | tee $LOG
+# <iaasProvider type="openstack" >
+#    <imageId>nova/d6e5dbe9-f781-460d-b554-23a133a887cd</imageId>
+#    <property name="keyPair" value="stratos-demo"/>
+#    <property name="instanceType" value="nova/1"/>
+#    <property name="securityGroups" value="default"/>
+#    <!--<property name="payload" value="resources/as.txt"/>-->
+# </iaasProvider>
+ 
+
+cp -f repository/deployment/server/cartridges/ec2_mysql.xml repository/deployment/server/cartridges/ec2_mysql.xml.orig
+cat repository/deployment/server/cartridges/ec2_mysql.xml.orig | sed -e "s@<property name=\"keyPair\" value=\"*.*\"/>@<property name=\"keyPair\" value=\"$ec2_keypair_name\"/>@g" > repository/deployment/server/cartridges/ec2_mysql.xml
+
+cp -f repository/deployment/server/cartridges/ec2_mysql.xml repository/deployment/server/cartridges/ec2_mysql.xml.orig
+cat repository/deployment/server/cartridges/ec2_mysql.xml.orig | sed -e "s@<property name=\"instanceType\" value=\"*.*\"/>@<property name=\"instanceType\" value=\"$ec2_instance_type\"/>@g" > repository/deployment/server/cartridges/ec2_mysql.xml
+
+cp -f repository/deployment/server/cartridges/ec2_mysql.xml repository/deployment/server/cartridges/ec2_mysql.xml.orig
+cat repository/deployment/server/cartridges/ec2_mysql.xml.orig | sed -e "s@<property name=\"securityGroups\" value=\"*.*\"/>@<property name=\"securityGroups\" value=\"$ec2_security_groups\"/>@g" > repository/deployment/server/cartridges/ec2_mysql.xml
+
+cp -f repository/deployment/server/cartridges/ec2_mysql.xml repository/deployment/server/cartridges/ec2_mysql.xml.orig
+cat repository/deployment/server/cartridges/ec2_mysql.xml.orig | sed -e "s@<imageId>*.*</imageId>@<imageId>$ec2_region/$ec2_mysql_cartridge_image_id</imageId>@g" > repository/deployment/server/cartridges/ec2_mysql.xml
+
+cp -f repository/deployment/server/cartridges/ec2_mysql.xml repository/deployment/server/cartridges/ec2_mysql.xml.orig
+cat repository/deployment/server/cartridges/ec2_mysql.xml.orig | sed -e "s@STRATOS_DOMAIN@$stratos_domain@g" > repository/deployment/server/cartridges/ec2_mysql.xml
+
+
+echo "Updating repository/deployment/server/cartridges/ec2_php.xml" | tee $LOG
+# <iaasProvider type="openstack" >
+#     <imageId>nova/250cd0bb-96a3-4ce8-bec8-7f9c1efea1e6</imageId>
+#     <property name="keyPair" value="stratos-demo"/>
+#     <property name="instanceType" value="nova/1"/>
+#     <property name="securityGroups" value="default"/>
+#     <!--<property name="payload" value="resources/as.txt"/>-->
+# </iaasProvider>
+
+cp -f repository/deployment/server/cartridges/ec2_php.xml repository/deployment/server/cartridges/ec2_php.xml.orig
+cat repository/deployment/server/cartridges/ec2_php.xml.orig | sed -e "s@<property name=\"keyPair\" value=\"*.*\"/>@<property name=\"keyPair\" value=\"$ec2_keypair_name\"/>@g" > repository/deployment/server/cartridges/ec2_php.xml
+
+cp -f repository/deployment/server/cartridges/ec2_php.xml repository/deployment/server/cartridges/ec2_php.xml.orig
+cat repository/deployment/server/cartridges/ec2_php.xml.orig | sed -e "s@<property name=\"instanceType\" value=\"*.*\"/>@<property name=\"instanceType\" value=\"$ec2_instance_type\"/>@g" > repository/deployment/server/cartridges/ec2_php.xml
+
+cp -f repository/deployment/server/cartridges/ec2_php.xml repository/deployment/server/cartridges/ec2_php.xml.orig
+cat repository/deployment/server/cartridges/ec2_php.xml.orig | sed -e "s@<property name=\"securityGroups\" value=\"*.*\"/>@<property name=\"securityGroups\" value=\"$ec2_security_groups\"/>@g" > repository/deployment/server/cartridges/ec2_php.xml
+
+cp -f repository/deployment/server/cartridges/ec2_php.xml repository/deployment/server/cartridges/ec2_php.xml.orig
+cat repository/deployment/server/cartridges/ec2_php.xml.orig | sed -e "s@<imageId>*.*</imageId>@<imageId>$ec2_region/$ec2_php_cartridge_image_id</imageId>@g" > repository/deployment/server/cartridges/ec2_php.xml
+
+cp -f repository/deployment/server/cartridges/ec2_php.xml repository/deployment/server/cartridges/ec2_php.xml.orig
+cat repository/deployment/server/cartridges/ec2_php.xml.orig | sed -e "s@STRATOS_DOMAIN@$stratos_domain@g" > repository/deployment/server/cartridges/ec2_php.xml
+
+
+echo "Updating repository/deployment/server/cartridges/ec2_tomcat.xml" | tee $LOG
+# <iaasProvider type="openstack" >
+#    <imageId>RegionOne/9701eb18-d7e1-4a53-a2bf-a519899d451c</imageId>
+#    <property name="keyPair" value="manula_openstack"/>
+#    <property name="instanceType" value="RegionOne/2"/>
+#    <property name="securityGroups" value="im-security-group1"/>
+#    <!--<property name="payload" value="resources/as.txt"/>-->
+# </iaasProvider>
+
+cp -f repository/deployment/server/cartridges/ec2_tomcat.xml repository/deployment/server/cartridges/ec2_tomcat.xml.orig
+cat repository/deployment/server/cartridges/ec2_tomcat.xml.orig | sed -e "s@<property name=\"keyPair\" value=\"*.*\"/>@<property name=\"keyPair\" value=\"$ec2_keypair_name\"/>@g" > repository/deployment/server/cartridges/ec2_tomcat.xml
+
+cp -f repository/deployment/server/cartridges/ec2_tomcat.xml repository/deployment/server/cartridges/ec2_tomcat.xml.orig
+cat repository/deployment/server/cartridges/ec2_tomcat.xml.orig | sed -e "s@<property name=\"instanceType\" value=\"*.*\"/>@<property name=\"instanceType\" value=\"$ec2_instance_type\"/>@g" > repository/deployment/server/cartridges/ec2_tomcat.xml
+
+cp -f repository/deployment/server/cartridges/ec2_tomcat.xml repository/deployment/server/cartridges/ec2_tomcat.xml.orig
+cat repository/deployment/server/cartridges/ec2_tomcat.xml.orig | sed -e "s@<property name=\"securityGroups\" value=\"*.*\"/>@<property name=\"securityGroups\" value=\"$ec2_security_groups\"/>@g" > repository/deployment/server/cartridges/ec2_tomcat.xml
+
+cp -f repository/deployment/server/cartridges/ec2_tomcat.xml repository/deployment/server/cartridges/ec2_tomcat.xml.orig
+cat repository/deployment/server/cartridges/ec2_tomcat.xml.orig | sed -e "s@<imageId>*.*</imageId>@<imageId>$ec2_region/$ec2_tomcat_cartridge_image_id</imageId>@g" > repository/deployment/server/cartridges/ec2_tomcat.xml
+
+cp -f repository/deployment/server/cartridges/ec2_tomcat.xml repository/deployment/server/cartridges/ec2_tomcat.xml.orig
+cat repository/deployment/server/cartridges/ec2_tomcat.xml.orig | sed -e "s@STRATOS_DOMAIN@$stratos_domain@g" > repository/deployment/server/cartridges/ec2_tomcat.xml
+
+popd # cc_path 

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/ec2.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/ec2.sh b/tools/stratos-installer/ec2.sh
new file mode 100755
index 0000000..884557e
--- /dev/null
+++ b/tools/stratos-installer/ec2.sh
@@ -0,0 +1,82 @@
+#!/bin/bash
+# ----------------------------------------------------------------------------
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+# ----------------------------------------------------------------------------
+#
+#  This script is invoked by setup.sh for configuring Amazon EC2 IaaS information.
+# ----------------------------------------------------------------------------
+
+# Die on any error:
+set -e
+
+SLEEP=60
+export LOG=$log_path/stratos-ec2.log
+
+source "./conf/setup.conf"
+
+if [[ ! -d $log_path ]]; then
+    mkdir -p $log_path
+fi
+
+pushd $cc_path
+
+echo "Set EC2 provider specific info in repository/conf/cloud-controller.xml" >> $LOG
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_START@@g" > repository/conf/cloud-controller.xml
+ 
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_IDENTITY@$ec2_identity@g" > repository/conf/cloud-controller.xml
+       
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_CREDENTIAL@$ec2_credential@g" > repository/conf/cloud-controller.xml
+       
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_SCALEUP_ORDER@$ec2_scaleup_order@g" > repository/conf/cloud-controller.xml
+       
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_SCALEDOWN_ORDER@$ec2_scaledown_order@g" > repository/conf/cloud-controller.xml
+       
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_AVAILABILITY_ZONE@$ec2_availability_zone@g" > repository/conf/cloud-controller.xml
+       
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_SECURITY_GROUPS@$ec2_security_groups@g" > repository/conf/cloud-controller.xml
+       
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_INSTANCE_TYPE@$ec2_instance_type@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_KEYPAIR@$ec2_keypair_name@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_IMAGE_ID@$ec2_image_id@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_END@@g" > repository/conf/cloud-controller.xml
+   
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml
+    
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml
+
+popd
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/openstack-cartridge-setup.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/openstack-cartridge-setup.sh b/tools/stratos-installer/openstack-cartridge-setup.sh
deleted file mode 100755
index 5ed9d02..0000000
--- a/tools/stratos-installer/openstack-cartridge-setup.sh
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/bin/bash
-# ----------------------------------------------------------------------------
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-# ----------------------------------------------------------------------------
-#
-#  This script is invoked by setup.sh for setting up Apache Stratos Cartridges for OpenStack.
-# ----------------------------------------------------------------------------
-
-# Die on any error:
-set -e
-
-SLEEP=60
-export LOG=$log_path/stratos-openstack-cartridge-setup.log
-
-source "./conf/setup.conf"
-
-if [[ ! -d $log_path ]]; then
-    mkdir -p $log_path
-fi
-   
-#mkdir -p /var/www/notify
-#cp -f ./resources/notify.php /var/www/notify/index.php
-#echo "apache2 will be restarted and if start successfull you configuration upto this point is OK." >> $LOG
-#echo "apache2 will be restarted and if start successfull you configuration upto this point is OK."
-#apachectl stop
-#sleep 5
-#apachectl start
-
-echo "Creating payload directory ... " | tee $LOG
-if [[ ! -d $cc_path/repository/resources/payload ]]; then
-   mkdir -p $cc_path/repository/resources/payload
-fi
-
-echo "Creating cartridges directory ... " | tee $LOG
-if [[ ! -d $cc_path/repository/deployment/server/cartridges/ ]]; then
-   mkdir -p $cc_path/repository/deployment/server/cartridges/
-fi
-
-
-# Copy the cartridge specific configuration files into the CC
-if [ "$(find ./cartridges/ -type f)" ]; then
-    cp -f ./cartridges/*.xml $cc_path/repository/deployment/server/cartridges/
-fi
-if [ "$(find ./cartridges/payload/ -type f)" ]; then
-    cp -f ./cartridges/payload/*.txt $cc_path/repository/resources/payload/
-fi
-if [ "$(find ./cartridges/services/ -type f)" ]; then
-    cp -f ./cartridges/services/*.xml $cc_path/repository/deployment/server/services/
-fi
-
-pushd $cc_path
-echo "Updating repository/deployment/server/cartridges/mysql.xml" | tee $LOG
-# <iaasProvider type="openstack" >
-#    <imageId>nova/d6e5dbe9-f781-460d-b554-23a133a887cd</imageId>
-#    <property name="keyPair" value="stratos-demo"/>
-#    <property name="instanceType" value="nova/1"/>
-#    <property name="securityGroups" value="default"/>
-#    <!--<property name="payload" value="resources/as.txt"/>-->
-# </iaasProvider>
- 
-
-cp -f repository/deployment/server/cartridges/mysql.xml repository/deployment/server/cartridges/mysql.xml.orig
-cat repository/deployment/server/cartridges/mysql.xml.orig | sed -e "s@<property name=\"keyPair\" value=\"*.*\"/>@<property name=\"keyPair\" value=\"$openstack_keypair_name\"/>@g" > repository/deployment/server/cartridges/mysql.xml
-
-cp -f repository/deployment/server/cartridges/mysql.xml repository/deployment/server/cartridges/mysql.xml.orig
-cat repository/deployment/server/cartridges/mysql.xml.orig | sed -e "s@<property name=\"instanceType\" value=\"*.*\"/>@<property name=\"instanceType\" value=\"$openstack_instance_type_small\"/>@g" > repository/deployment/server/cartridges/mysql.xml
-
-cp -f repository/deployment/server/cartridges/mysql.xml repository/deployment/server/cartridges/mysql.xml.orig
-cat repository/deployment/server/cartridges/mysql.xml.orig | sed -e "s@<property name=\"securityGroups\" value=\"*.*\"/>@<property name=\"securityGroups\" value=\"$openstack_security_group\"/>@g" > repository/deployment/server/cartridges/mysql.xml
-
-cp -f repository/deployment/server/cartridges/mysql.xml repository/deployment/server/cartridges/mysql.xml.orig
-cat repository/deployment/server/cartridges/mysql.xml.orig | sed -e "s@<imageId>*.*</imageId>@<imageId>$nova_region/$mysql_cartridge_image_id</imageId>@g" > repository/deployment/server/cartridges/mysql.xml
-
-cp -f repository/deployment/server/cartridges/mysql.xml repository/deployment/server/cartridges/mysql.xml.orig
-cat repository/deployment/server/cartridges/mysql.xml.orig | sed -e "s@STRATOS_DOMAIN@$stratos2_domain@g" > repository/deployment/server/cartridges/mysql.xml
-
-
-
-echo "Updating repository/deployment/server/cartridges/php.xml" | tee $LOG
-# <iaasProvider type="openstack" >
-#     <imageId>nova/250cd0bb-96a3-4ce8-bec8-7f9c1efea1e6</imageId>
-#     <property name="keyPair" value="stratos-demo"/>
-#     <property name="instanceType" value="nova/1"/>
-#     <property name="securityGroups" value="default"/>
-#     <!--<property name="payload" value="resources/as.txt"/>-->
-# </iaasProvider>
-
-cp -f repository/deployment/server/cartridges/php.xml repository/deployment/server/cartridges/php.xml.orig
-cat repository/deployment/server/cartridges/php.xml.orig | sed -e "s@<property name=\"keyPair\" value=\"*.*\"/>@<property name=\"keyPair\" value=\"$openstack_keypair_name\"/>@g" > repository/deployment/server/cartridges/php.xml
-
-cp -f repository/deployment/server/cartridges/php.xml repository/deployment/server/cartridges/php.xml.orig
-cat repository/deployment/server/cartridges/php.xml.orig | sed -e "s@<property name=\"instanceType\" value=\"*.*\"/>@<property name=\"instanceType\" value=\"$openstack_instance_type_small\"/>@g" > repository/deployment/server/cartridges/php.xml
-
-cp -f repository/deployment/server/cartridges/php.xml repository/deployment/server/cartridges/php.xml.orig
-cat repository/deployment/server/cartridges/php.xml.orig | sed -e "s@<property name=\"securityGroups\" value=\"*.*\"/>@<property name=\"securityGroups\" value=\"$openstack_security_group\"/>@g" > repository/deployment/server/cartridges/php.xml
-
-#cp -f repository/deployment/server/cartridges/php.xml repository/deployment/server/cartridges/php.xml.orig
-#cat repository/deployment/server/cartridges/php.xml.orig | sed -e "s@<imageId>*.*</imageId>@<imageId>$nova_region/$php_cartridge_image_id</imageId>@g" > repository/deployment/server/cartridges/php.xml
-
-cp -f repository/deployment/server/cartridges/php.xml repository/deployment/server/cartridges/php.xml.orig
-cat repository/deployment/server/cartridges/php.xml.orig | sed -e "s@<imageId>*.*</imageId>@<imageId>$nova_region/$php_cartridge_image_id</imageId>@g" > repository/deployment/server/cartridges/php.xml
-
-cp -f repository/deployment/server/cartridges/php.xml repository/deployment/server/cartridges/php.xml.orig
-cat repository/deployment/server/cartridges/php.xml.orig | sed -e "s@STRATOS_DOMAIN@$stratos2_domain@g" > repository/deployment/server/cartridges/php.xml
-
-echo "Updating repository/deployment/server/cartridges/tomcat.xml" | tee $LOG
-# <iaasProvider type="openstack" >
-#    <imageId>RegionOne/9701eb18-d7e1-4a53-a2bf-a519899d451c</imageId>
-#    <property name="keyPair" value="manula_openstack"/>
-#    <property name="instanceType" value="RegionOne/2"/>
-#    <property name="securityGroups" value="im-security-group1"/>
-#    <!--<property name="payload" value="resources/as.txt"/>-->
-# </iaasProvider>
-
-cp -f repository/deployment/server/cartridges/tomcat.xml repository/deployment/server/cartridges/tomcat.xml.orig
-cat repository/deployment/server/cartridges/tomcat.xml.orig | sed -e "s@<property name=\"keyPair\" value=\"*.*\"/>@<property name=\"keyPair\" value=\"$openstack_keypair_name\"/>@g" > repository/deployment/server/cartridges/tomcat.xml
-
-cp -f repository/deployment/server/cartridges/tomcat.xml repository/deployment/server/cartridges/tomcat.xml.orig
-cat repository/deployment/server/cartridges/tomcat.xml.orig | sed -e "s@<property name=\"instanceType\" value=\"*.*\"/>@<property name=\"instanceType\" value=\"$openstack_instance_type_small\"/>@g" > repository/deployment/server/cartridges/tomcat.xml
-
-cp -f repository/deployment/server/cartridges/tomcat.xml repository/deployment/server/cartridges/tomcat.xml.orig
-cat repository/deployment/server/cartridges/tomcat.xml.orig | sed -e "s@<property name=\"securityGroups\" value=\"*.*\"/>@<property name=\"securityGroups\" value=\"$openstack_security_group\"/>@g" > repository/deployment/server/cartridges/tomcat.xml
-
-cp -f repository/deployment/server/cartridges/tomcat.xml repository/deployment/server/cartridges/tomcat.xml.orig
-cat repository/deployment/server/cartridges/tomcat.xml.orig | sed -e "s@<imageId>*.*</imageId>@<imageId>$nova_region/$tomcat_cartridge_image_id</imageId>@g" > repository/deployment/server/cartridges/tomcat.xml
-
-cp -f repository/deployment/server/cartridges/tomcat.xml repository/deployment/server/cartridges/tomcat.xml.orig
-cat repository/deployment/server/cartridges/tomcat.xml.orig | sed -e "s@STRATOS_DOMAIN@$stratos2_domain@g" > repository/deployment/server/cartridges/tomcat.xml
-
-popd # cc_path

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/openstack-cartridge.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/openstack-cartridge.sh b/tools/stratos-installer/openstack-cartridge.sh
new file mode 100755
index 0000000..8d5be93
--- /dev/null
+++ b/tools/stratos-installer/openstack-cartridge.sh
@@ -0,0 +1,131 @@
+#!/bin/bash
+# ----------------------------------------------------------------------------
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+# ----------------------------------------------------------------------------
+#
+#  This script is invoked by setup.sh for configuring cartridges for OpenStack.
+# ----------------------------------------------------------------------------
+
+# Die on any error:
+set -e
+
+SLEEP=60
+export LOG=$log_path/stratos-openstack-cartridge.log
+
+source "./conf/setup.conf"
+
+if [[ ! -d $log_path ]]; then
+    mkdir -p $log_path
+fi
+   
+
+echo "Creating payload directory ... " | tee $LOG
+if [[ ! -d $cc_path/repository/resources/payload ]]; then
+   mkdir -p $cc_path/repository/resources/payload
+fi
+
+echo "Creating cartridges directory ... " | tee $LOG
+if [[ ! -d $cc_path/repository/deployment/server/cartridges/ ]]; then
+   mkdir -p $cc_path/repository/deployment/server/cartridges/
+fi
+
+
+# Copy the cartridge specific configuration files into the CC
+if [ "$(find ./cartridges/openstack/ -type f)" ]; then
+    cp -f ./cartridges/openstack/*.xml $cc_path/repository/deployment/server/cartridges/
+fi
+
+pushd $cc_path
+echo "Updating repository/deployment/server/cartridges/openstack-mysql.xml" | tee $LOG
+# <iaasProvider type="openstack" >
+#    <imageId>nova/d6e5dbe9-f781-460d-b554-23a133a887cd</imageId>
+#    <property name="keyPair" value="stratos-demo"/>
+#    <property name="instanceType" value="nova/1"/>
+#    <property name="securityGroups" value="default"/>
+#    <!--<property name="payload" value="resources/as.txt"/>-->
+# </iaasProvider>
+ 
+
+cp -f repository/deployment/server/cartridges/openstack-mysql.xml repository/deployment/server/cartridges/openstack-mysql.xml.orig
+cat repository/deployment/server/cartridges/openstack-mysql.xml.orig | sed -e "s@<property name=\"keyPair\" value=\"*.*\"/>@<property name=\"keyPair\" value=\"$openstack_keypair_name\"/>@g" > repository/deployment/server/cartridges/openstack-mysql.xml
+
+cp -f repository/deployment/server/cartridges/openstack-mysql.xml repository/deployment/server/cartridges/openstack-mysql.xml.orig
+cat repository/deployment/server/cartridges/openstack-mysql.xml.orig | sed -e "s@<property name=\"instanceType\" value=\"*.*\"/>@<property name=\"instanceType\" value=\"$openstack_instance_type_tiny\"/>@g" > repository/deployment/server/cartridges/openstack-mysql.xml
+
+cp -f repository/deployment/server/cartridges/openstack-mysql.xml repository/deployment/server/cartridges/openstack-mysql.xml.orig
+cat repository/deployment/server/cartridges/openstack-mysql.xml.orig | sed -e "s@<property name=\"securityGroups\" value=\"*.*\"/>@<property name=\"securityGroups\" value=\"$openstack_security_groups\"/>@g" > repository/deployment/server/cartridges/openstack-mysql.xml
+
+cp -f repository/deployment/server/cartridges/openstack-mysql.xml repository/deployment/server/cartridges/openstack-mysql.xml.orig
+cat repository/deployment/server/cartridges/openstack-mysql.xml.orig | sed -e "s@<imageId>*.*</imageId>@<imageId>$nova_region/$openstack_mysql_cartridge_image_id</imageId>@g" > repository/deployment/server/cartridges/openstack-mysql.xml
+
+cp -f repository/deployment/server/cartridges/openstack-mysql.xml repository/deployment/server/cartridges/openstack-mysql.xml.orig
+cat repository/deployment/server/cartridges/openstack-mysql.xml.orig | sed -e "s@STRATOS_DOMAIN@$stratos_domain@g" > repository/deployment/server/cartridges/openstack-mysql.xml
+
+
+echo "Updating repository/deployment/server/cartridges/openstack-php.xml" | tee $LOG
+# <iaasProvider type="openstack" >
+#     <imageId>nova/250cd0bb-96a3-4ce8-bec8-7f9c1efea1e6</imageId>
+#     <property name="keyPair" value="stratos-demo"/>
+#     <property name="instanceType" value="nova/1"/>
+#     <property name="securityGroups" value="default"/>
+#     <!--<property name="payload" value="resources/as.txt"/>-->
+# </iaasProvider>
+
+cp -f repository/deployment/server/cartridges/openstack-php.xml repository/deployment/server/cartridges/openstack-php.xml.orig
+cat repository/deployment/server/cartridges/openstack-php.xml.orig | sed -e "s@<property name=\"keyPair\" value=\"*.*\"/>@<property name=\"keyPair\" value=\"$openstack_keypair_name\"/>@g" > repository/deployment/server/cartridges/openstack-php.xml
+
+cp -f repository/deployment/server/cartridges/openstack-php.xml repository/deployment/server/cartridges/openstack-php.xml.orig
+cat repository/deployment/server/cartridges/openstack-php.xml.orig | sed -e "s@<property name=\"instanceType\" value=\"*.*\"/>@<property name=\"instanceType\" value=\"$openstack_instance_type_tiny\"/>@g" > repository/deployment/server/cartridges/openstack-php.xml
+
+cp -f repository/deployment/server/cartridges/openstack-php.xml repository/deployment/server/cartridges/openstack-php.xml.orig
+cat repository/deployment/server/cartridges/openstack-php.xml.orig | sed -e "s@<property name=\"securityGroups\" value=\"*.*\"/>@<property name=\"securityGroups\" value=\"$openstack_security_groups\"/>@g" > repository/deployment/server/cartridges/openstack-php.xml
+
+cp -f repository/deployment/server/cartridges/openstack-php.xml repository/deployment/server/cartridges/openstack-php.xml.orig
+cat repository/deployment/server/cartridges/openstack-php.xml.orig | sed -e "s@<imageId>*.*</imageId>@<imageId>$nova_region/$openstack_php_cartridge_image_id</imageId>@g" > repository/deployment/server/cartridges/openstack-php.xml
+
+cp -f repository/deployment/server/cartridges/openstack-php.xml repository/deployment/server/cartridges/openstack-php.xml.orig
+cat repository/deployment/server/cartridges/openstack-php.xml.orig | sed -e "s@STRATOS_DOMAIN@$stratos_domain@g" > repository/deployment/server/cartridges/openstack-php.xml
+
+
+echo "Updating repository/deployment/server/cartridges/openstack-tomcat.xml" | tee $LOG
+# <iaasProvider type="openstack" >
+#    <imageId>RegionOne/9701eb18-d7e1-4a53-a2bf-a519899d451c</imageId>
+#    <property name="keyPair" value="manula_openstack"/>
+#    <property name="instanceType" value="RegionOne/2"/>
+#    <property name="securityGroups" value="im-security-group1"/>
+#    <!--<property name="payload" value="resources/as.txt"/>-->
+# </iaasProvider>
+
+cp -f repository/deployment/server/cartridges/openstack-tomcat.xml repository/deployment/server/cartridges/openstack-tomcat.xml.orig
+cat repository/deployment/server/cartridges/openstack-tomcat.xml.orig | sed -e "s@<property name=\"keyPair\" value=\"*.*\"/>@<property name=\"keyPair\" value=\"$openstack_keypair_name\"/>@g" > repository/deployment/server/cartridges/openstack-tomcat.xml
+
+cp -f repository/deployment/server/cartridges/openstack-tomcat.xml repository/deployment/server/cartridges/openstack-tomcat.xml.orig
+cat repository/deployment/server/cartridges/openstack-tomcat.xml.orig | sed -e "s@<property name=\"instanceType\" value=\"*.*\"/>@<property name=\"instanceType\" value=\"$openstack_instance_type_tiny\"/>@g" > repository/deployment/server/cartridges/openstack-tomcat.xml
+
+cp -f repository/deployment/server/cartridges/openstack-tomcat.xml repository/deployment/server/cartridges/openstack-tomcat.xml.orig
+cat repository/deployment/server/cartridges/openstack-tomcat.xml.orig | sed -e "s@<property name=\"securityGroups\" value=\"*.*\"/>@<property name=\"securityGroups\" value=\"$openstack_security_groups\"/>@g" > repository/deployment/server/cartridges/openstack-tomcat.xml
+
+cp -f repository/deployment/server/cartridges/openstack-tomcat.xml repository/deployment/server/cartridges/openstack-tomcat.xml.orig
+cat repository/deployment/server/cartridges/openstack-tomcat.xml.orig | sed -e "s@<imageId>*.*</imageId>@<imageId>$nova_region/$openstack_tomcat_cartridge_image_id</imageId>@g" > repository/deployment/server/cartridges/openstack-tomcat.xml
+
+cp -f repository/deployment/server/cartridges/openstack-tomcat.xml repository/deployment/server/cartridges/openstack-tomcat.xml.orig
+cat repository/deployment/server/cartridges/openstack-tomcat.xml.orig | sed -e "s@STRATOS_DOMAIN@$stratos_domain@g" > repository/deployment/server/cartridges/openstack-tomcat.xml
+
+popd # cc_path

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/cdb160e5/tools/stratos-installer/openstack.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/openstack.sh b/tools/stratos-installer/openstack.sh
new file mode 100755
index 0000000..96ae760
--- /dev/null
+++ b/tools/stratos-installer/openstack.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+# ----------------------------------------------------------------------------
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+# ----------------------------------------------------------------------------
+#
+#  This script is invoked by setup.sh for configuring OpenStack IaaS information.
+# ----------------------------------------------------------------------------
+
+# Die on any error:
+set -e
+
+SLEEP=60
+export LOG=$log_path/stratos-openstack.log
+
+source "./conf/setup.conf"
+
+if [[ ! -d $log_path ]]; then
+    mkdir -p $log_path
+fi
+
+pushd $cc_path
+
+echo "Set OpenStack provider specific info in repository/conf/cloud-controller.xml" >> $LOG
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_START@@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_IDENTITY@$openstack_identity@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_CREDENTIAL@$openstack_credential@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_ENDPOINT@$openstack_jclouds_endpoint@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_SCALEUP_ORDER@$openstack_scaleup_order@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_SCALEDOWN_ORDER@$openstack_scaledown_order@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_IMAGE_ID@$openstack_image_id@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_END@@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml
+
+popd