stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From im...@apache.org
Subject [1/4] stratos git commit: Introducing a mock iaas for cloud controller
Date Mon, 08 Dec 2014 07:33:25 GMT
Repository: stratos
Updated Branches:
  refs/heads/master d830fab50 -> 49eadd6ef


http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockMemberEventPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockMemberEventPublisher.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockMemberEventPublisher.java
new file mode 100644
index 0000000..6d06c85
--- /dev/null
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockMemberEventPublisher.java
@@ -0,0 +1,122 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.cloud.controller.iaases.mock;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.messaging.broker.publish.EventPublisher;
+import org.apache.stratos.messaging.broker.publish.EventPublisherPool;
+import org.apache.stratos.messaging.event.instance.status.InstanceActivatedEvent;
+import org.apache.stratos.messaging.event.instance.status.InstanceMaintenanceModeEvent;
+import org.apache.stratos.messaging.event.instance.status.InstanceReadyToShutdownEvent;
+import org.apache.stratos.messaging.event.instance.status.InstanceStartedEvent;
+import org.apache.stratos.messaging.util.Util;
+
+/**
+ * Mock member event publisher.
+ */
+public class MockMemberEventPublisher {
+
+    private static final Log log = LogFactory.getLog(MockMemberEventPublisher.class);
+
+    public static void publishInstanceStartedEvent(MockMemberContext mockMemberContext) {
+        if (log.isInfoEnabled()) {
+            log.info("Publishing instance started event");
+        }
+        InstanceStartedEvent event = new InstanceStartedEvent(
+                mockMemberContext.getServiceName(),
+                mockMemberContext.getClusterId(),
+                mockMemberContext.getNetworkPartitionId(),
+                mockMemberContext.getPartitionId(),
+                mockMemberContext.getMemberId(),
+                mockMemberContext.getInstanceId());
+        String topic = Util.getMessageTopicName(event);
+        EventPublisher eventPublisher = EventPublisherPool
+                .getPublisher(topic);
+        eventPublisher.publish(event);
+        if (log.isInfoEnabled()) {
+            log.info("Instance started event published");
+        }
+    }
+
+    public static void publishInstanceActivatedEvent(MockMemberContext mockMemberContext) {
+        if (log.isInfoEnabled()) {
+            log.info("Publishing instance activated event");
+        }
+        InstanceActivatedEvent event = new InstanceActivatedEvent(
+                mockMemberContext.getServiceName(),
+                mockMemberContext.getClusterId(),
+                mockMemberContext.getNetworkPartitionId(),
+                mockMemberContext.getPartitionId(),
+                mockMemberContext.getMemberId(),
+                mockMemberContext.getInstanceId());
+
+        // Event publisher connection will
+        String topic = Util.getMessageTopicName(event);
+        EventPublisher eventPublisher = EventPublisherPool
+                .getPublisher(topic);
+        eventPublisher.publish(event);
+        if (log.isInfoEnabled()) {
+            log.info("Instance activated event published");
+        }
+    }
+
+    public static void publishInstanceReadyToShutdownEvent(MockMemberContext mockMemberContext) {
+        if (log.isInfoEnabled()) {
+            log.info("Publishing instance activated event");
+        }
+        InstanceReadyToShutdownEvent event = new InstanceReadyToShutdownEvent(
+                mockMemberContext.getServiceName(),
+                mockMemberContext.getClusterId(),
+                mockMemberContext.getNetworkPartitionId(),
+                mockMemberContext.getPartitionId(),
+                mockMemberContext.getMemberId(),
+                mockMemberContext.getInstanceId());
+        String topic = Util.getMessageTopicName(event);
+        EventPublisher eventPublisher = EventPublisherPool
+                .getPublisher(topic);
+        eventPublisher.publish(event);
+        if (log.isInfoEnabled()) {
+            log.info("Instance ReadyToShutDown event published");
+        }
+
+    }
+
+    public static void publishMaintenanceModeEvent(MockMemberContext mockMemberContext) {
+        if (log.isInfoEnabled()) {
+            log.info("Publishing instance maintenance mode event");
+        }
+        InstanceMaintenanceModeEvent event = new InstanceMaintenanceModeEvent(
+                mockMemberContext.getServiceName(),
+                mockMemberContext.getClusterId(),
+                mockMemberContext.getNetworkPartitionId(),
+                mockMemberContext.getPartitionId(),
+                mockMemberContext.getMemberId(),
+                mockMemberContext.getInstanceId());
+        String topic = Util.getMessageTopicName(event);
+        EventPublisher eventPublisher = EventPublisherPool
+                .getPublisher(topic);
+        eventPublisher.publish(event);
+        if (log.isInfoEnabled()) {
+            log.info("Instance Maintenance mode event published");
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockNodeMetadata.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockNodeMetadata.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockNodeMetadata.java
new file mode 100644
index 0000000..34b3fe9
--- /dev/null
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockNodeMetadata.java
@@ -0,0 +1,143 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.cloud.controller.iaases.mock;
+
+import org.jclouds.compute.domain.ComputeType;
+import org.jclouds.compute.domain.Hardware;
+import org.jclouds.compute.domain.NodeMetadata;
+import org.jclouds.compute.domain.OperatingSystem;
+import org.jclouds.domain.Location;
+import org.jclouds.domain.LoginCredentials;
+import org.jclouds.domain.ResourceMetadata;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Created by imesh on 12/6/14.
+ */
+public class MockNodeMetadata implements NodeMetadata {
+    private String id;
+
+    @Override
+    public String getHostname() {
+        return null;
+    }
+
+    @Override
+    public String getGroup() {
+        return null;
+    }
+
+    @Override
+    public Hardware getHardware() {
+        return null;
+    }
+
+    @Override
+    public String getImageId() {
+        return null;
+    }
+
+    @Override
+    public OperatingSystem getOperatingSystem() {
+        return null;
+    }
+
+    @Override
+    public int getLoginPort() {
+        return 0;
+    }
+
+    @Override
+    public LoginCredentials getCredentials() {
+        return null;
+    }
+
+    @Override
+    public Set<String> getPublicAddresses() {
+        return null;
+    }
+
+    @Override
+    public Set<String> getPrivateAddresses() {
+        return null;
+    }
+
+    @Override
+    public Status getStatus() {
+        return null;
+    }
+
+    @Override
+    public String getBackendStatus() {
+        return null;
+    }
+
+    @Override
+    public ComputeType getType() {
+        return null;
+    }
+
+    @Override
+    public String getProviderId() {
+        return null;
+    }
+
+    @Override
+    public String getName() {
+        return null;
+    }
+
+    @Override
+    public Location getLocation() {
+        return null;
+    }
+
+    @Override
+    public URI getUri() {
+        return null;
+    }
+
+    @Override
+    public Map<String, String> getUserMetadata() {
+        return null;
+    }
+
+    @Override
+    public String getId() {
+        return id;
+    }
+
+    @Override
+    public Set<String> getTags() {
+        return null;
+    }
+
+    @Override
+    public int compareTo(ResourceMetadata<ComputeType> computeTypeResourceMetadata) {
+        return 0;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockPartitionValidator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockPartitionValidator.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockPartitionValidator.java
new file mode 100644
index 0000000..ef7ae94
--- /dev/null
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/MockPartitionValidator.java
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.cloud.controller.iaases.mock;
+
+import org.apache.stratos.cloud.controller.domain.IaasProvider;
+import org.apache.stratos.cloud.controller.exception.InvalidPartitionException;
+import org.apache.stratos.cloud.controller.iaases.validators.PartitionValidator;
+
+import java.util.Properties;
+
+/**
+ * Mock partition validator.
+ */
+public class MockPartitionValidator implements PartitionValidator {
+
+    private IaasProvider iaasProvider;
+
+    @Override
+    public void setIaasProvider(IaasProvider iaasProvider) {
+        this.iaasProvider = iaasProvider;
+    }
+
+    @Override
+    public IaasProvider validate(String partitionId, Properties properties) throws InvalidPartitionException {
+        return iaasProvider;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/statistics/MockHealthStatisticsNotifier.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/statistics/MockHealthStatisticsNotifier.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/statistics/MockHealthStatisticsNotifier.java
new file mode 100644
index 0000000..882696d
--- /dev/null
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/statistics/MockHealthStatisticsNotifier.java
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.cloud.controller.iaases.mock.statistics;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.cloud.controller.iaases.mock.MockMemberContext;
+
+/**
+ * Health statistics notifier thread for publishing statistics periodically to CEP.
+ */
+public class MockHealthStatisticsNotifier implements Runnable {
+    private static final Log log = LogFactory.getLog(MockHealthStatisticsNotifier.class);
+
+    public static final String MEMORY_CONSUMPTION = "memory_consumption";
+    public static final String LOAD_AVERAGE = "load_average";
+
+    private final MockMemberContext mockMemberContext;
+    private final MockHealthStatisticsPublisher statsPublisher;
+    private final double memoryConsumption = 20.0;
+    private final double loadAvereage = 40.0;
+
+    public MockHealthStatisticsNotifier(MockMemberContext mockMemberContext) {
+        this.mockMemberContext = mockMemberContext;
+        this.statsPublisher = new MockHealthStatisticsPublisher();
+        this.statsPublisher.setEnabled(true);
+    }
+
+    @Override
+    public void run() {
+        try {
+            if (statsPublisher.isEnabled()) {
+                if (log.isDebugEnabled()) {
+                    log.debug(String.format("Publishing memory consumption: %f", memoryConsumption));
+                }
+                statsPublisher.publish(
+                        mockMemberContext.getClusterId(),
+                        mockMemberContext.getNetworkPartitionId(),
+                        mockMemberContext.getMemberId(),
+                        mockMemberContext.getPartitionId(),
+                        MEMORY_CONSUMPTION,
+                        memoryConsumption
+                );
+
+                if (log.isDebugEnabled()) {
+                    log.debug(String.format("Publishing load average: %f", loadAvereage));
+                }
+                statsPublisher.publish(
+                        mockMemberContext.getClusterId(),
+                        mockMemberContext.getNetworkPartitionId(),
+                        mockMemberContext.getMemberId(),
+                        mockMemberContext.getPartitionId(),
+                        LOAD_AVERAGE,
+                        loadAvereage
+                );
+            } else if (log.isWarnEnabled()) {
+                log.warn("Statistics publisher is disabled");
+            }
+        } catch (Exception e) {
+            if (log.isErrorEnabled()) {
+                log.error("Could not publish health statistics", e);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/statistics/MockHealthStatisticsPublisher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/statistics/MockHealthStatisticsPublisher.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/statistics/MockHealthStatisticsPublisher.java
new file mode 100644
index 0000000..e4a525a
--- /dev/null
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/mock/statistics/MockHealthStatisticsPublisher.java
@@ -0,0 +1,89 @@
+/*
+ * 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.
+ */
+
+package org.apache.stratos.cloud.controller.iaases.mock.statistics;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.statistics.publisher.WSO2CEPStatisticsPublisher;
+import org.wso2.carbon.databridge.commons.Attribute;
+import org.wso2.carbon.databridge.commons.AttributeType;
+import org.wso2.carbon.databridge.commons.StreamDefinition;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Health statistics publisher for publishing statistics to CEP.
+ */
+public class MockHealthStatisticsPublisher extends WSO2CEPStatisticsPublisher {
+    private static final Log log = LogFactory.getLog(MockHealthStatisticsPublisher.class);
+
+    private static final String DATA_STREAM_NAME = "cartridge_agent_health_stats";
+    private static final String VERSION = "1.0.0";
+
+    private static StreamDefinition createStreamDefinition() {
+        try {
+            StreamDefinition streamDefinition = new StreamDefinition(DATA_STREAM_NAME, VERSION);
+            streamDefinition.setNickName("agent health stats");
+            streamDefinition.setDescription("agent health stats");
+            // Payload definition
+            List<Attribute> payloadData = new ArrayList<Attribute>();
+            payloadData.add(new Attribute("cluster_id", AttributeType.STRING));
+            payloadData.add(new Attribute("network_partition_id", AttributeType.STRING));
+            payloadData.add(new Attribute("member_id", AttributeType.STRING));
+            payloadData.add(new Attribute("partition_id", AttributeType.STRING));
+            payloadData.add(new Attribute("health_description", AttributeType.STRING));
+            payloadData.add(new Attribute("value", AttributeType.DOUBLE));
+            streamDefinition.setPayloadData(payloadData);
+            return streamDefinition;
+        } catch (Exception e) {
+            throw new RuntimeException("Could not create stream definition", e);
+        }
+    }
+
+    public MockHealthStatisticsPublisher() {
+        super(createStreamDefinition());
+    }
+
+    /**
+     * Publish health statistics to cep.
+     * @param clusterId
+     * @param networkPartitionId
+     * @param memberId
+     * @param partitionId
+     * @param health
+     * @param value
+     */
+    public void publish(String clusterId, String networkPartitionId, String memberId, String partitionId, String health, double value) {
+        if(log.isDebugEnabled()) {
+            log.debug(String.format("Publishing health statistics: [cluster] %s [network-partition] %s [partition] %s [member] %s [health] %s [value] %f",
+                    clusterId, networkPartitionId, partitionId, memberId, health, value));
+        }
+        List<Object> payload = new ArrayList<Object>();
+        // Payload values
+        payload.add(clusterId);
+        payload.add(networkPartitionId);
+        payload.add(memberId);
+        payload.add(partitionId);
+        payload.add(health);
+        payload.add(value);
+        super.publish(payload.toArray());
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/AWSEC2PartitionValidator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/AWSEC2PartitionValidator.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/AWSEC2PartitionValidator.java
index 17e31ac..649eca2 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/AWSEC2PartitionValidator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/AWSEC2PartitionValidator.java
@@ -24,8 +24,8 @@ import org.apache.stratos.cloud.controller.exception.InvalidIaasProviderExceptio
 import org.apache.stratos.cloud.controller.exception.InvalidPartitionException;
 import org.apache.stratos.cloud.controller.iaases.Iaas;
 import org.apache.stratos.cloud.controller.domain.IaasProvider;
+import org.apache.stratos.cloud.controller.services.impl.CloudControllerServiceUtil;
 import org.apache.stratos.cloud.controller.util.CloudControllerConstants;
-import org.apache.stratos.cloud.controller.util.CloudControllerUtil;
 import org.apache.stratos.messaging.domain.topology.Scope;
 
 import java.util.Properties;
@@ -62,14 +62,14 @@ public class AWSEC2PartitionValidator extends IaasBasedPartitionValidator {
                 
                 IaasProvider updatedIaasProvider = new IaasProvider(iaasProvider);
                 
-                Iaas updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
+                Iaas updatedIaas = CloudControllerServiceUtil.buildIaas(updatedIaasProvider);
                 updatedIaas.setIaasProvider(updatedIaasProvider);
                 
                 if (properties.containsKey(Scope.zone.toString())) {
                     String zone = properties.getProperty(Scope.zone.toString());
                     iaas.isValidZone(region, zone);
                     updatedIaasProvider.setProperty(CloudControllerConstants.AVAILABILITY_ZONE, zone);
-                    updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
+                    updatedIaas = CloudControllerServiceUtil.buildIaas(updatedIaasProvider);
                     updatedIaas.setIaasProvider(updatedIaasProvider);
                 } 
                 
@@ -93,7 +93,7 @@ public class AWSEC2PartitionValidator extends IaasBasedPartitionValidator {
 			Properties properties) {
     	Iaas updatedIaas;
 		try {
-			updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
+			updatedIaas = CloudControllerServiceUtil.buildIaas(updatedIaasProvider);
 
 			for (Object property : properties.keySet()) {
 				if (property instanceof String) {
@@ -106,7 +106,7 @@ public class AWSEC2PartitionValidator extends IaasBasedPartitionValidator {
 					}
 				}
 			}
-			updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
+			updatedIaas = CloudControllerServiceUtil.buildIaas(updatedIaasProvider);
 			updatedIaas.setIaasProvider(updatedIaasProvider);
 		} catch (InvalidIaasProviderException ignore) {
 		}

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/CloudstackPartitionValidator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/CloudstackPartitionValidator.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/CloudstackPartitionValidator.java
index 4a818a8..2038a8c 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/CloudstackPartitionValidator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/CloudstackPartitionValidator.java
@@ -5,8 +5,8 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.stratos.cloud.controller.exception.InvalidPartitionException;
 import org.apache.stratos.cloud.controller.iaases.Iaas;
 import org.apache.stratos.cloud.controller.domain.IaasProvider;
+import org.apache.stratos.cloud.controller.services.impl.CloudControllerServiceUtil;
 import org.apache.stratos.cloud.controller.util.CloudControllerConstants;
-import org.apache.stratos.cloud.controller.util.CloudControllerUtil;
 import org.apache.stratos.messaging.domain.topology.Scope;
 
 import java.util.Properties;
@@ -31,14 +31,14 @@ public class CloudstackPartitionValidator extends IaasBasedPartitionValidator {
 
         try {
             IaasProvider updatedIaasProvider = new IaasProvider(iaasProvider);
-            Iaas updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
+            Iaas updatedIaas = CloudControllerServiceUtil.buildIaas(updatedIaasProvider);
             updatedIaas.setIaasProvider(updatedIaasProvider);
 
             if (properties.containsKey(Scope.zone.toString())) {
                 String zone = properties.getProperty(Scope.zone.toString());
                 iaas.isValidZone(null, zone);
                 updatedIaasProvider.setProperty(CloudControllerConstants.AVAILABILITY_ZONE, zone);
-                updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
+                updatedIaas = CloudControllerServiceUtil.buildIaas(updatedIaasProvider);
                 updatedIaas.setIaasProvider(updatedIaasProvider);
             }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/DockerPartitionValidator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/DockerPartitionValidator.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/DockerPartitionValidator.java
index 73a4e78..6fce78f 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/DockerPartitionValidator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/DockerPartitionValidator.java
@@ -34,7 +34,7 @@ import java.util.Properties;
  * Docker partition validator definition.
  */
 public class DockerPartitionValidator extends IaasBasedPartitionValidator {
-    private static final Log log = LogFactory.getLog(AWSEC2Iaas.class);
+    private static final Log log = LogFactory.getLog(DockerPartitionValidator.class);
 
     private IaasProvider iaasProvider;
 
@@ -56,7 +56,7 @@ public class DockerPartitionValidator extends IaasBasedPartitionValidator {
 			Properties properties) {
     	Iaas updatedIaas;
 		try {
-			updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
+			updatedIaas = CloudControllerServiceUtil.buildIaas(updatedIaasProvider);
 
 			for (Object property : properties.keySet()) {
 				if (property instanceof String) {
@@ -69,7 +69,7 @@ public class DockerPartitionValidator extends IaasBasedPartitionValidator {
 					}
 				}
 			}
-			updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
+			updatedIaas = CloudControllerServiceUtil.buildIaas(updatedIaasProvider);
 			updatedIaas.setIaasProvider(updatedIaasProvider);
 		} catch (InvalidIaasProviderException ignore) {
 		}

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/OpenstackNovaPartitionValidator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/OpenstackNovaPartitionValidator.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/OpenstackNovaPartitionValidator.java
index a385062..bb8358c 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/OpenstackNovaPartitionValidator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/iaases/validators/OpenstackNovaPartitionValidator.java
@@ -24,8 +24,8 @@ import org.apache.stratos.cloud.controller.exception.InvalidIaasProviderExceptio
 import org.apache.stratos.cloud.controller.exception.InvalidPartitionException;
 import org.apache.stratos.cloud.controller.iaases.Iaas;
 import org.apache.stratos.cloud.controller.domain.IaasProvider;
+import org.apache.stratos.cloud.controller.services.impl.CloudControllerServiceUtil;
 import org.apache.stratos.cloud.controller.util.CloudControllerConstants;
-import org.apache.stratos.cloud.controller.util.CloudControllerUtil;
 import org.apache.stratos.messaging.domain.topology.Scope;
 
 import java.util.Properties;
@@ -61,7 +61,7 @@ public class OpenstackNovaPartitionValidator extends IaasBasedPartitionValidator
                 iaas.isValidRegion(region);
                 
                 IaasProvider updatedIaasProvider = new IaasProvider(iaasProvider);
-                Iaas updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
+                Iaas updatedIaas = CloudControllerServiceUtil.buildIaas(updatedIaasProvider);
                 updatedIaas.setIaasProvider(updatedIaasProvider);
                 
                 if (properties.containsKey(Scope.zone.toString())) {
@@ -69,7 +69,7 @@ public class OpenstackNovaPartitionValidator extends IaasBasedPartitionValidator
                     iaas.isValidZone(region, zone);
                     
                     updatedIaasProvider.setProperty(CloudControllerConstants.AVAILABILITY_ZONE, zone);
-                    updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
+                    updatedIaas = CloudControllerServiceUtil.buildIaas(updatedIaasProvider);
                     updatedIaas.setIaasProvider(updatedIaasProvider);
                 } 
                 
@@ -92,7 +92,7 @@ public class OpenstackNovaPartitionValidator extends IaasBasedPartitionValidator
 			Properties properties) {
     	Iaas updatedIaas;
 		try {
-			updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
+			updatedIaas = CloudControllerServiceUtil.buildIaas(updatedIaasProvider);
 
 			for (Object property : properties.keySet()) {
 				if (property instanceof String) {
@@ -105,7 +105,7 @@ public class OpenstackNovaPartitionValidator extends IaasBasedPartitionValidator
 					}
 				}
 			}
-			updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
+			updatedIaas = CloudControllerServiceUtil.buildIaas(updatedIaasProvider);
 			updatedIaas.setIaasProvider(updatedIaasProvider);
 		} catch (InvalidIaasProviderException ignore) {
 		}

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
index 1679e3f..f2a2e7b 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceImpl.java
@@ -114,7 +114,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
             }
 
             for (IaasProvider iaasProvider : iaasProviders) {
-                CloudControllerUtil.getIaas(iaasProvider);
+                CloudControllerServiceUtil.buildIaas(iaasProvider);
             }
         }
 
@@ -416,7 +416,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
                     log.debug("Iaas is null of Iaas Provider: " + type + ". Trying to build IaaS...");
                 }
                 try {
-                    iaas = CloudControllerUtil.getIaas(iaasProvider);
+                    iaas = CloudControllerServiceUtil.buildIaas(iaasProvider);
                 } catch (InvalidIaasProviderException e) {
                     String msg = "Instance start up failed. " + memberContext.toString() +
                             "Unable to build Iaas of this IaasProvider [Provider] : " + type + ". Cause: " + e.getMessage();
@@ -442,16 +442,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
                 addToPayload(payload, "PERSISTENCE_MAPPING", getPersistencePayload(ctxt, iaas).toString());
             }
             iaasProvider.setPayload(payload.toString().getBytes());
-            iaas.setDynamicPayload();
-
-            if (iaasProvider.getTemplate() == null) {
-                String msg =
-                        "Failed to start an instance. " +
-                                memberContext.toString() +
-                                ". Reason : Jclouds Template is null for iaas provider [type]: " + iaasProvider.getType();
-                log.error(msg);
-                throw new InvalidIaasProviderException(msg);
-            }
+            iaas.setDynamicPayload(iaasProvider.getPayload());
 
             //Start instance start up in a new thread
             ThreadExecutor exec = ThreadExecutor.getInstance();
@@ -536,25 +527,25 @@ public class CloudControllerServiceImpl implements CloudControllerService {
 
         handleNullObject(memberId, "Termination failed. Null member id.");
 
-        MemberContext ctxt = CloudControllerContext.getInstance().getMemberContextOfMemberId(memberId);
+        MemberContext memberContext = CloudControllerContext.getInstance().getMemberContextOfMemberId(memberId);
 
-        if (ctxt == null) {
+        if (memberContext == null) {
             String msg = "Termination failed. Invalid Member Id: " + memberId;
             log.error(msg);
             throw new InvalidMemberException(msg);
         }
 
-        if (ctxt.getNodeId() == null && ctxt.getInstanceId() == null) {
+        if (memberContext.getNodeId() == null && memberContext.getInstanceId() == null) {
             // sending member terminated since this instance isn't reachable.
             if (log.isInfoEnabled()){
                 log.info(String.format(
                         "Member cannot be terminated because it is not reachable. [member] %s [nodeId] %s [instanceId] %s. Removing member from topology.",
-                        ctxt.getMemberId(),
-                        ctxt.getNodeId(),
-                        ctxt.getInstanceId()));
+                        memberContext.getMemberId(),
+                        memberContext.getNodeId(),
+                        memberContext.getInstanceId()));
             }
 
-            CloudControllerServiceUtil.logTermination(ctxt);
+            CloudControllerServiceUtil.logTermination(memberContext);
         }
 
         // check if status == active, if true, then this is a termination on member faulty
@@ -566,10 +557,10 @@ public class CloudControllerServiceImpl implements CloudControllerService {
             TopologyManager.releaseReadLock();
         }
 
-        org.apache.stratos.messaging.domain.topology.Service service = topology.getService(ctxt.getCartridgeType());
+        org.apache.stratos.messaging.domain.topology.Service service = topology.getService(memberContext.getCartridgeType());
 
         if (service != null) {
-            Cluster cluster = service.getCluster(ctxt.getClusterId());
+            Cluster cluster = service.getCluster(memberContext.getClusterId());
 
             if (cluster != null) {
                 Member member = cluster.getMember(memberId);
@@ -578,19 +569,19 @@ public class CloudControllerServiceImpl implements CloudControllerService {
                     // change member status if termination on a faulty member
                     if(fixMemberStatus(member, topology)){
                         // set the time this member was added to ReadyToShutdown status
-                        ctxt.setObsoleteInitTime(System.currentTimeMillis());
+                        memberContext.setObsoleteInitTime(System.currentTimeMillis());
                     }
 
                     // check if ready to shutdown member is expired and send
                     // member terminated if it is.
-                    if (isMemberExpired(member, ctxt.getObsoleteInitTime(), ctxt.getObsoleteExpiryTime())) {
+                    if (isMemberExpired(member, memberContext.getObsoleteInitTime(), memberContext.getObsoleteExpiryTime())) {
                         if (log.isInfoEnabled()) {
                             log.info(String.format(
                                     "Member pending termination in ReadyToShutdown state exceeded expiry time. This member has to be manually deleted: %s",
-                                    ctxt.getMemberId()));
+                                    memberContext.getMemberId()));
                         }
 
-                        CloudControllerServiceUtil.logTermination(ctxt);
+                        CloudControllerServiceUtil.logTermination(memberContext);
                         return;
                     }
                 }
@@ -598,7 +589,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
         }
 
         ThreadExecutor exec = ThreadExecutor.getInstance();
-        exec.execute(new InstanceTerminator(ctxt));
+        exec.execute(new InstanceTerminator(memberContext));
 
     }
 
@@ -893,7 +884,7 @@ public class CloudControllerServiceImpl implements CloudControllerService {
                                 for (Volume volume : ctxt.getVolumes()) {
                                     if (volume.getId() != null) {
                                         String iaasType = volume.getIaasType();
-                                        //Iaas iaas = CloudControllerContext.getInstance().getIaasProvider(iaasType).getIaas();
+                                        //Iaas iaas = CloudControllerContext.getInstance().getIaasProvider(iaasType).buildComputeServiceAndTemplate();
                                         Iaas iaas = cartridge.getIaasProvider(iaasType).getIaas();
                                         if (iaas != null) {
                                             try {

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java
index b992643..4dafc2c 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/CloudControllerServiceUtil.java
@@ -42,9 +42,13 @@ import org.apache.stratos.cloud.controller.messaging.publisher.CartridgeInstance
 import org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder;
 import org.apache.stratos.cloud.controller.util.CloudControllerConstants;
 import org.apache.stratos.cloud.controller.util.CloudControllerUtil;
+import org.apache.stratos.cloud.controller.util.ComputeServiceBuilderUtil;
 import org.apache.stratos.messaging.domain.topology.MemberStatus;
+import org.jclouds.compute.ComputeService;
 import org.jclouds.rest.ResourceNotFoundException;
 
+import java.lang.reflect.Constructor;
+
 /**
  * Cloud controller service utility methods.
  */
@@ -52,6 +56,12 @@ public class CloudControllerServiceUtil {
 
     private static final Log log = LogFactory.getLog(CloudControllerServiceUtil.class);
 
+    public static Iaas buildIaas(IaasProvider iaasProvider) throws InvalidIaasProviderException {
+        Iaas iaas = iaasProvider.getIaas();
+        iaas.initialize();
+        return iaas;
+    }
+
     /**
      * A helper method to terminate an instance.
      *
@@ -66,7 +76,7 @@ public class CloudControllerServiceUtil {
         if (iaas == null) {
 
             try {
-                iaas = CloudControllerUtil.getIaas(iaasProvider);
+                iaas = buildIaas(iaasProvider);
             } catch (InvalidIaasProviderException e) {
                 String msg =
                         "Instance termination failed. " + ctxt.toString() +

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/InstanceCreator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/InstanceCreator.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/InstanceCreator.java
index 033dc6f..a1f38a9 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/InstanceCreator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/InstanceCreator.java
@@ -26,6 +26,7 @@ import org.apache.stratos.cloud.controller.context.CloudControllerContext;
 import org.apache.stratos.cloud.controller.domain.*;
 import org.apache.stratos.cloud.controller.exception.CloudControllerException;
 import org.apache.stratos.cloud.controller.iaases.Iaas;
+import org.apache.stratos.cloud.controller.iaases.JcloudsIaas;
 import org.apache.stratos.cloud.controller.messaging.publisher.CartridgeInstanceDataPublisher;
 import org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder;
 import org.apache.stratos.cloud.controller.util.CloudControllerConstants;
@@ -64,225 +65,80 @@ public class InstanceCreator implements Runnable {
 
             String clusterId = memberContext.getClusterId();
             Partition partition = memberContext.getPartition();
-            ClusterContext ctxt = CloudControllerContext.getInstance().getClusterContext(clusterId);
+            ClusterContext clusterContext = CloudControllerContext.getInstance().getClusterContext(clusterId);
             Iaas iaas = iaasProvider.getIaas();
-            String publicIp = null;
 
-            NodeMetadata node = null;
-            // generate the group id from domain name and sub domain name.
-            // Should have lower-case ASCII letters, numbers, or dashes.
-            // Should have a length between 3-15
-            String str = clusterId.length() > 10 ? clusterId.substring(0, 10) : clusterId.substring(0, clusterId.length());
-            String group = str.replaceAll("[^a-z0-9-]", "");
+            // Create instance
+            NodeMetadata node = createInstance(iaas, clusterContext, memberContext);
 
-            try {
-                ComputeService computeService = iaasProvider.getComputeService();
-                Template template = iaasProvider.getTemplate();
+            // Attach volumes
+            attachVolumes(iaas, clusterContext, memberContext);
 
-                if (log.isDebugEnabled()) {
-                    log.debug("Cloud Controller is delegating request to start an instance for "
-                            + memberContext + " to Jclouds layer.");
-                }
-                // create and start a node
-                Set<? extends NodeMetadata> nodes = computeService
-                        .createNodesInGroup(group, 1, template);
-                node = nodes.iterator().next();
-                if (log.isDebugEnabled()) {
-                    log.debug("Cloud Controller received a response for the request to start "
-                            + memberContext + " from Jclouds layer.");
-                }
-
-                if (node == null) {
-                    String msg = "Null response received for instance start-up request to Jclouds.\n"
-                            + memberContext.toString();
-                    log.error(msg);
-                    throw new IllegalStateException(msg);
-                }
-
-                // node id
-                String nodeId = node.getId();
-                if (nodeId == null) {
-                    String msg = "Node id of the starting instance is null.\n"
-                            + memberContext.toString();
-                    log.fatal(msg);
-                    throw new IllegalStateException(msg);
-                }
+            // Allocate IP address
+            iaas.allocateIpAddress(clusterId, memberContext, partition, cartridgeType, node);
 
-                memberContext.setNodeId(nodeId);
-                if (log.isDebugEnabled()) {
-                    log.debug("Node id was set. " + memberContext.toString());
-                }
 
-                // attach volumes
-                if (ctxt.isVolumeRequired()) {
-                    // remove region prefix
-                    String instanceId = nodeId.indexOf('/') != -1 ? nodeId
-                            .substring(nodeId.indexOf('/') + 1, nodeId.length())
-                            : nodeId;
-                    memberContext.setInstanceId(instanceId);
-                    if (ctxt.getVolumes() != null) {
-                        for (Volume volume : ctxt.getVolumes()) {
-                            try {
-                                iaas.attachVolume(instanceId, volume.getId(),
-                                        volume.getDevice());
-                            } catch (Exception e) {
-                                // continue without throwing an exception, since
-                                // there is an instance already running
-                                log.error("Attaching Volume to Instance [ "
-                                        + instanceId + " ] failed!", e);
-                            }
-                        }
-                    }
-                }
+            // Update topology
+            TopologyBuilder.handleMemberSpawned(cartridgeType, clusterId,
+                    partition.getId(), memberContext.getPrivateIpAddress(), memberContext.getPublicIpAddress(),
+                    memberContext);
 
-            } catch (Exception e) {
-                String msg = "Failed to start an instance. " + memberContext.toString() + " Cause: " + e.getMessage();
-                log.error(msg, e);
-                throw new IllegalStateException(msg, e);
+            // Publish instance creation statistics to BAM
+            CartridgeInstanceDataPublisher.publish(memberContext.getMemberId(),
+                    memberContext.getPartition().getId(),
+                    memberContext.getNetworkPartitionId(),
+                    memberContext.getClusterId(),
+                    cartridgeType,
+                    MemberStatus.Created.toString(),
+                    node);
+        } finally {
+            if(lock != null) {
+                CloudControllerContext.getInstance().releaseWriteLock(lock);
             }
+        }
+    }
 
-            try {
-                if (log.isDebugEnabled()) {
-                    log.debug("IP allocation process started for " + memberContext);
-                }
-                String autoAssignIpProp =
-                        iaasProvider.getProperty(CloudControllerConstants.AUTO_ASSIGN_IP_PROPERTY);
-
-                String pre_defined_ip =
-                        iaasProvider.getProperty(CloudControllerConstants.FLOATING_IP_PROPERTY);
-
-                // reset ip
-                String ip = "";
-
-                // default behavior is autoIpAssign=false
-                if (autoAssignIpProp == null ||
-                        (autoAssignIpProp != null && autoAssignIpProp.equals("false"))) {
-
-                    // check if floating ip is well defined in cartridge definition
-                    if (pre_defined_ip != null) {
-                        if (CloudControllerServiceUtil.isValidIpAddress(pre_defined_ip)) {
-                            if (log.isDebugEnabled()) {
-                                log.debug("CloudControllerServiceImpl:IpAllocator:pre_defined_ip: invoking associatePredefinedAddress" + pre_defined_ip);
-                            }
-                            ip = iaas.associatePredefinedAddress(node, pre_defined_ip);
-
-                            if (ip == null || "".equals(ip) || !pre_defined_ip.equals(ip)) {
-                                // throw exception and stop instance creation
-                                String msg = "Error occurred while allocating predefined floating ip address: " + pre_defined_ip +
-                                        " / allocated ip:" + ip +
-                                        " - terminating node:" + memberContext.toString();
-                                log.error(msg);
-                                // terminate instance
-                                CloudControllerServiceUtil.terminate(iaasProvider,
-                                        node.getId(), memberContext);
-                                throw new CloudControllerException(msg);
-                            }
-                        } else {
-                            String msg = "Invalid floating ip address configured: " + pre_defined_ip +
-                                    " - terminating node:" + memberContext.toString();
-                            log.error(msg);
-                            // terminate instance
-                            CloudControllerServiceUtil.terminate(iaasProvider,
-                                    node.getId(), memberContext);
-                            throw new CloudControllerException(msg);
-                        }
-
-                    } else {
-                        if (log.isDebugEnabled()) {
-                            log.debug("CloudControllerServiceImpl:IpAllocator:no (valid) predefined floating ip configured, "
-                                    + "selecting available one from pool");
-                        }
-                        // allocate an IP address - manual IP assigning mode
-                        ip = iaas.associateAddress(node);
-
-                        if (ip != null) {
-                            memberContext.setAllocatedIpAddress(ip);
-                            if (log.isDebugEnabled()) {
-                                log.debug("Allocated an ip address: "
-                                        + memberContext.toString());
-                            } else if (log.isInfoEnabled()) {
-                                log.info("Allocated ip address [ " + memberContext.getAllocatedIpAddress() +
-                                        " ] to member with id: " + memberContext.getMemberId());
-                            }
-                        }
-                    }
-
-                    if (ip == null) {
-                        String msg = "No IP address found. IP allocation failed for " + memberContext;
-                        log.error(msg);
-                        throw new CloudControllerException(msg);
-                    }
+    private NodeMetadata createInstance(Iaas iaas, ClusterContext clusterContext, MemberContext memberContext) {
+        NodeMetadata node = iaas.createInstance(clusterContext, memberContext);
 
-                    // build the node with the new ip
-                    node = NodeMetadataBuilder.fromNodeMetadata(node)
-                            .publicAddresses(ImmutableSet.of(ip)).build();
-                }
+        // node id
+        String nodeId = node.getId();
+        if (nodeId == null) {
+            String msg = "Node id of the starting instance is null\n" + memberContext.toString();
+            log.error(msg);
+            throw new IllegalStateException(msg);
+        }
 
+        memberContext.setNodeId(nodeId);
+        CloudControllerContext.getInstance().updateMemberContext(memberContext);
+        CloudControllerContext.getInstance().persist();
 
-                // public ip
-                if (node.getPublicAddresses() != null &&
-                        node.getPublicAddresses().iterator().hasNext()) {
-                    ip = node.getPublicAddresses().iterator().next();
-                    publicIp = ip;
-                    memberContext.setPublicIpAddress(ip);
-                    if (log.isDebugEnabled()) {
-                        log.debug("Retrieving Public IP Address : " + memberContext.toString());
-                    } else if (log.isInfoEnabled()) {
-                        log.info("Retrieving Public IP Address: " + memberContext.getPublicIpAddress() +
-                                ", member id: " + memberContext.getMemberId());
-                    }
-                }
+        if (log.isDebugEnabled()) {
+            log.debug("Instance created: [node-metadata] " + node.toString());
+        }
+        return node;
+    }
 
-                // private IP
-                if (node.getPrivateAddresses() != null &&
-                        node.getPrivateAddresses().iterator().hasNext()) {
-                    ip = node.getPrivateAddresses().iterator().next();
-                    memberContext.setPrivateIpAddress(ip);
-                    if (log.isDebugEnabled()) {
-                        log.debug("Retrieving Private IP Address. " + memberContext.toString());
-                    } else if (log.isInfoEnabled()) {
-                        log.info("Retrieving Private IP Address: " + memberContext.getPrivateIpAddress() +
-                                ", member id: " + memberContext.getMemberId());
+    public void attachVolumes(Iaas iaas, ClusterContext clusterContext, MemberContext memberContext) {
+        // attach volumes
+        if (clusterContext.isVolumeRequired()) {
+            // remove region prefix
+            String nodeId = memberContext.getNodeId();
+            String instanceId = nodeId.indexOf('/') != -1 ? nodeId
+                    .substring(nodeId.indexOf('/') + 1, nodeId.length())
+                    : nodeId;
+            memberContext.setInstanceId(instanceId);
+            if (clusterContext.getVolumes() != null) {
+                for (Volume volume : clusterContext.getVolumes()) {
+                    try {
+                        iaas.attachVolume(instanceId, volume.getId(), volume.getDevice());
+                    } catch (Exception e) {
+                        // continue without throwing an exception, since
+                        // there is an instance already running
+                        log.error("Attaching volume to instance [ "
+                                + instanceId + " ] failed!", e);
                     }
                 }
-
-                CloudControllerContext.getInstance().addMemberContext(memberContext);
-
-                // persist in registry
-                CloudControllerContext.getInstance().persist();
-
-
-                // trigger topology
-                TopologyBuilder.handleMemberSpawned(cartridgeType, clusterId,
-                        partition.getId(), ip, publicIp, memberContext);
-
-                String memberID = memberContext.getMemberId();
-
-                // update the topology with the newly spawned member
-                // publish data
-                CartridgeInstanceDataPublisher.publish(memberID,
-                        memberContext.getPartition().getId(),
-                        memberContext.getNetworkPartitionId(),
-                        memberContext.getClusterId(),
-                        cartridgeType,
-                        MemberStatus.Created.toString(),
-                        node);
-                if (log.isDebugEnabled()) {
-                    log.debug("Node details: " + node.toString());
-                }
-
-                if (log.isDebugEnabled()) {
-                    log.debug("IP allocation process ended for " + memberContext);
-                }
-
-            } catch (Exception e) {
-                String msg = "Error occurred while allocating an ip address. " + memberContext.toString();
-                log.error(msg, e);
-                throw new CloudControllerException(msg, e);
-            }
-        } finally {
-            if(lock != null) {
-                CloudControllerContext.getInstance().releaseWriteLock(lock);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/InstanceTerminator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/InstanceTerminator.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/InstanceTerminator.java
index 374537d..34c07e3 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/InstanceTerminator.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/services/impl/InstanceTerminator.java
@@ -21,13 +21,12 @@ package org.apache.stratos.cloud.controller.services.impl;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.cloud.controller.config.CloudControllerConfig;
 import org.apache.stratos.cloud.controller.context.CloudControllerContext;
-import org.apache.stratos.cloud.controller.domain.Cartridge;
 import org.apache.stratos.cloud.controller.domain.IaasProvider;
 import org.apache.stratos.cloud.controller.domain.MemberContext;
 import org.apache.stratos.cloud.controller.exception.CloudControllerException;
-import org.apache.stratos.cloud.controller.exception.InvalidCartridgeTypeException;
-import org.apache.stratos.cloud.controller.exception.InvalidMemberException;
+import org.apache.stratos.cloud.controller.iaases.Iaas;
 
 import java.util.concurrent.locks.Lock;
 
@@ -38,56 +37,24 @@ public class InstanceTerminator implements Runnable {
 
     private static final Log log = LogFactory.getLog(InstanceTerminator.class);
 
-    private MemberContext ctxt;
+    private Iaas iaas;
+    private MemberContext memberContext;
 
-    public InstanceTerminator(MemberContext ctxt) {
-        this.ctxt = ctxt;
+    public InstanceTerminator(MemberContext memberContext) {
+        String provider = memberContext.getPartition().getProvider();
+        IaasProvider iaasProvider = CloudControllerConfig.getInstance().getIaasProvider(provider);
+        this.iaas = iaasProvider.getIaas();
+        this.memberContext = memberContext;
     }
 
     @Override
     public void run() {
-        String memberId = ctxt.getMemberId();
-        String clusterId = ctxt.getClusterId();
-        String partitionId = ctxt.getPartition().getId();
-        String cartridgeType = ctxt.getCartridgeType();
-        String nodeId = ctxt.getNodeId();
-
         Lock lock = null;
         try {
-            CloudControllerContext.getInstance().acquireMemberContextWriteLock();
-
-            Cartridge cartridge = CloudControllerContext.getInstance().getCartridge(cartridgeType);
-            log.info("Starting to terminate an instance with member id : " + memberId +
-                    " in partition id: " + partitionId + " of cluster id: " + clusterId +
-                    " and of cartridge type: " + cartridgeType);
-
-            if (cartridge == null) {
-                String msg = "Termination of Member Id: " + memberId + " failed. " +
-                        "Cannot find a matching Cartridge for type: " +
-                        cartridgeType;
-                log.error(msg);
-                throw new InvalidCartridgeTypeException(msg);
-            }
-
-            // if no matching node id can be found.
-            if (nodeId == null) {
-                String msg = "Termination failed. Cannot find a node id for Member Id: " + memberId;
-
-                // log information
-                CloudControllerServiceUtil.logTermination(ctxt);
-                log.error(msg);
-                throw new InvalidMemberException(msg);
-            }
-
-            IaasProvider iaasProvider = cartridge.getIaasProviderOfPartition(partitionId);
-
-            // terminate it!
-            CloudControllerServiceUtil.terminate(iaasProvider, nodeId, ctxt);
-
-            // log information
-            CloudControllerServiceUtil.logTermination(ctxt);
+            lock = CloudControllerContext.getInstance().acquireMemberContextWriteLock();
+            iaas.terminateInstance(memberContext);
         } catch (Exception e) {
-            String msg = "Instance termination failed. " + ctxt.toString();
+            String msg = "Instance termination failed! " + memberContext.toString();
             log.error(msg, e);
             throw new CloudControllerException(msg, e);
         } finally {

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java
index 82baef8..07aa77d 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java
@@ -223,72 +223,8 @@ public class CloudControllerUtil {
 
 		return carInfo;
 	}
-    
-    public static Iaas setIaas(IaasProvider iaasProvider) throws InvalidIaasProviderException {
-
-    	Iaas iaas = loadIaas(iaasProvider);
-
-		try {
-			iaas.buildComputeServiceAndTemplate();
-			iaasProvider.setIaas(iaas);
-			return iaas;
-		} catch (Exception e) {
-			String msg = "Unable to build the jclouds object for iaas "
-					+ "of type: " + iaasProvider.getType();
-			log.error(msg, e);
-			throw new InvalidIaasProviderException(msg, e);
-		}
-	}
-    
-    public static Iaas getIaas(IaasProvider iaasProvider) throws InvalidIaasProviderException {
-    	if(iaasProvider.getImage() != null) {
-    		return setIaas(iaasProvider);
-    	} else {
-    		return setDefaultIaas(iaasProvider);
-    	}
-    }
-    
-    public static Iaas setDefaultIaas(IaasProvider iaasProvider) throws InvalidIaasProviderException {
-
-		Iaas iaas = loadIaas(iaasProvider);
-
-		try {
-			ComputeServiceBuilderUtil.buildDefaultComputeService(iaasProvider);
-			iaasProvider.setIaas(iaas);
-			return iaas;
-		} catch (Exception e) {
-			String msg = "Unable to build the jclouds object for iaas "
-					+ "of type: " + iaasProvider.getType();
-			log.error(msg, e);
-			throw new InvalidIaasProviderException(msg, e);
-		}
-	}
 
-	private static Iaas loadIaas(IaasProvider iaasProvider)
-			throws InvalidIaasProviderException {
-		try {
-			
-			if(iaasProvider.getClassName() == null) {
-				String msg = "You have not specified a class which represents the iaas of type: ["
-						+ iaasProvider.getType() + "].";
-				log.error(msg);
-				throw new InvalidIaasProviderException(msg);
-			}
-			
-			Constructor<?> c = Class.forName(iaasProvider.getClassName())
-					.getConstructor(IaasProvider.class);
-			Iaas iaas = (Iaas) c.newInstance(iaasProvider);
-			return iaas;
-		} catch (Exception e) {
-			String msg = "Class [" + iaasProvider.getClassName()
-					+ "] which represents the iaas of type: ["
-					+ iaasProvider.getType() + "] has failed to instantiate.";
-			log.error(msg, e);
-			throw new InvalidIaasProviderException(msg, e);
-		}
-	}
-	
-	public static void sleep(long time){
+    public static void sleep(long time){
     	try {
     		Thread.sleep(time);
     	} catch (InterruptedException ignore) {}

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java
index 0da7025..2cffcfb 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java
@@ -26,6 +26,7 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.stratos.cloud.controller.exception.CloudControllerException;
 import org.apache.stratos.cloud.controller.domain.IaasProvider;
 import org.jclouds.ContextBuilder;
+import org.jclouds.compute.ComputeService;
 import org.jclouds.compute.ComputeServiceContext;
 import org.jclouds.enterprise.config.EnterpriseConfigurationModule;
 import org.jclouds.logging.slf4j.config.SLF4JLoggingModule;
@@ -64,12 +65,12 @@ public class ComputeServiceBuilderUtil {
     }
 
     
-    public static void buildDefaultComputeService(IaasProvider iaas) {
+    public static ComputeService buildDefaultComputeService(IaasProvider iaasProvider) {
 
         Properties properties = new Properties();
 
         // load properties
-        for (Map.Entry<String, String> entry : iaas.getProperties().entrySet()) {
+        for (Map.Entry<String, String> entry : iaasProvider.getProperties().entrySet()) {
             properties.put(entry.getKey(), entry.getValue());
         }
 
@@ -80,12 +81,11 @@ public class ComputeServiceBuilderUtil {
 
         // build context
         ContextBuilder builder =
-            ContextBuilder.newBuilder(iaas.getProvider())
-                          .credentials(iaas.getIdentity(), iaas.getCredential()).modules(modules)
+            ContextBuilder.newBuilder(iaasProvider.getProvider())
+                          .credentials(iaasProvider.getIdentity(), iaasProvider.getCredential()).modules(modules)
                           .overrides(properties);
 
-        // set the compute service object
-        iaas.setComputeService(builder.buildView(ComputeServiceContext.class).getComputeService());
+        return builder.buildView(ComputeServiceContext.class).getComputeService();
     }
     
     public static String extractRegion(IaasProvider iaas) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/features/cloud-controller/org.apache.stratos.cloud.controller.feature/src/main/resources/conf/cloud-controller.xml
----------------------------------------------------------------------
diff --git a/features/cloud-controller/org.apache.stratos.cloud.controller.feature/src/main/resources/conf/cloud-controller.xml b/features/cloud-controller/org.apache.stratos.cloud.controller.feature/src/main/resources/conf/cloud-controller.xml
index 7d9424c..8b6f405 100644
--- a/features/cloud-controller/org.apache.stratos.cloud.controller.feature/src/main/resources/conf/cloud-controller.xml
+++ b/features/cloud-controller/org.apache.stratos.cloud.controller.feature/src/main/resources/conf/cloud-controller.xml
@@ -49,8 +49,8 @@
 		is not necessary [0..1]. But you can use this section to avoid specifying 
 		same property over and over again. -->
 	<iaasProviders>
-		<iaasProvider type="openstack" name="openstack specific details">
-            		<className>org.apache.stratos.cloud.controller.iaases.OpenstackNovaIaas</className>
+		<!-- iaasProvider type="openstack" name="openstack specific details">
+            		<className>org.apache.stratos.cloud.controller.iaases.JcloudsOpenstackIaas</className>
 			<provider>openstack-nova</provider>
 			<identity svns:secretAlias="cloud.controller.openstack.identity">demo:demo</identity>
 			<credential svns:secretAlias="cloud.controller.openstack.credential">openstack</credential>
@@ -60,6 +60,18 @@
 			<property name="openstack.networking.provider" value="nova" />
 			<property name="X" value="x" />
 			<property name="Y" value="y" />
-		</iaasProvider>
+		</iaasProvider -->
+        <iaasProvider type="docker" name="Docker">
+            <className>org.apache.stratos.cloud.controller.iaases.JcloudsDockerIaas</className>
+            <provider>docker</provider>
+            <identity svns:secretAlias="cloud.controller.docker.identity">identity</identity>
+            <credential svns:secretAlias="cloud.controller.docker.credential">credential</credential>
+        </iaasProvider>
+        <iaasProvider type="mock" name="Mock">
+            <className>org.apache.stratos.cloud.controller.iaases.mock.MockIaas</className>
+            <provider>mock</provider>
+            <identity svns:secretAlias="cloud.controller.docker.identity">identity</identity>
+            <credential svns:secretAlias="cloud.controller.docker.credential">credential</credential>
+        </iaasProvider>
 	</iaasProviders>
 </cloudController>

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/products/stratos/modules/distribution/src/bin/stratos.sh
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/bin/stratos.sh b/products/stratos/modules/distribution/src/bin/stratos.sh
index a289a87..64ed7b6 100755
--- a/products/stratos/modules/distribution/src/bin/stratos.sh
+++ b/products/stratos/modules/distribution/src/bin/stratos.sh
@@ -300,6 +300,8 @@ do
     -Dfile.encoding=UTF8 \
     -Ddisable.cassandra.server.startup=true \
     -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
+    -Dthrift.receiver.ip=localhost \
+    -Dthrift.receiver.port=7611 \
     -DMETADATA_CLIENT_CONFIG_FILE="$CARBON_HOME/repository/conf/metadataservice.xml" \
     org.wso2.carbon.bootstrap.Bootstrap $*
     status=$?

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/tools/stratos-installer/config/all/repository/conf/cloud-controller.xml
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/config/all/repository/conf/cloud-controller.xml b/tools/stratos-installer/config/all/repository/conf/cloud-controller.xml
index ee8ffe8..fe52a22 100644
--- a/tools/stratos-installer/config/all/repository/conf/cloud-controller.xml
+++ b/tools/stratos-installer/config/all/repository/conf/cloud-controller.xml
@@ -50,7 +50,7 @@
                 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>
+                	<className>org.apache.stratos.cloud.controller.iaases.JcloudsEC2Iaas</className>
                         <provider>aws-ec2</provider>
                         <identity svns:secretAlias="cloud.controller.ec2.identity">EC2_IDENTITY</identity>
                         <credential svns:secretAlias="cloud.controller.ec2.credential">EC2_CREDENTIAL</credential>
@@ -61,7 +61,7 @@
                         <property name="keyPair" value="EC2_KEYPAIR"/>
                 </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.JcloudsOpenstackIaas</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>
@@ -75,7 +75,7 @@
                         <property name="keyPair" value="OPENSTACK_KEYPAIR"/>
         	</iaasProviderOPENSTACK_PROVIDER_END>
                 <VCLOUD_PROVIDER_STARTiaasProvider type="vcloud" name="VMware vCloud specific details">
-                        <className>org.apache.stratos.cloud.controller.iaases.VCloudIaas</className>
+                        <className>org.apache.stratos.cloud.controller.iaases.JcloudsVCloudIaas</className>
                         <provider>vcloud</provider>
                         <identity svns:secretAlias="cloud.controller.vcloud.identity">VCLOUD_IDENTITY</identity>
                         <credential svns:secretAlias="cloud.controller.vcloud.credential">VCLOUD_CREDENTIAL</credential>
@@ -87,7 +87,7 @@
                         <property name="Y" value="y" />
                 </iaasProviderVCLOUD_PROVIDER_END>
                 <GCE_PROVIDER_STARTiaasProvider type="gce" name="GCE specific details">
-                        <className>org.apache.stratos.cloud.controller.iaas.GCEIaas</className>
+                        <className>org.apache.stratos.cloud.controller.iaases.JcloudsGCEIaas</className>
                         <provider>google-compute-engine</provider>
                         <identity svns:secretAlias="cloud.controller.gce.identity">GCE_IDENTITY</identity>
                         <credential svns:secretAlias="cloud.controller.gce.credential">GCE_CREDENTIAL</credential>

http://git-wip-us.apache.org/repos/asf/stratos/blob/49eadd6e/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 73369f1..b512eeb 100644
--- a/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml
+++ b/tools/stratos-installer/config/cc/repository/conf/cloud-controller.xml
@@ -51,7 +51,7 @@
                 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>
+                	<className>org.apache.stratos.cloud.controller.iaases.JcloudsEC2Iaas</className>
                         <provider>aws-ec2</provider>
                         <identity svns:secretAlias="cloud.controller.ec2.identity">EC2_IDENTITY</identity>
                         <credential svns:secretAlias="cloud.controller.ec2.credential">EC2_CREDENTIAL</credential>
@@ -62,7 +62,7 @@
                         <property name="keyPair" value="EC2_KEYPAIR"/>
                 </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.JcloudsOpenstackIaas</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>
@@ -76,7 +76,7 @@
                         <property name="keyPair" value="OPENSTACK_KEYPAIR"/>
         	</iaasProviderOPENSTACK_PROVIDER_END>
                 <VCLOUD_PROVIDER_STARTiaasProvider type="vcloud" name="VMware vCloud specific details">
-                        <className>org.apache.stratos.cloud.controller.iaases.VCloudIaas</className>
+                        <className>org.apache.stratos.cloud.controller.iaases.JcloudsVCloudIaas</className>
                         <provider>vcloud</provider>
                         <identity svns:secretAlias="cloud.controller.vcloud.identity">VCLOUD_IDENTITY</identity>
                         <credential svns:secretAlias="cloud.controller.vcloud.credential">VCLOUD_CREDENTIAL</credential>


Mime
View raw message