You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2012/12/08 03:23:20 UTC

[2/2] git commit: add datastore configurator, for each hypervisor and each protocol, needs to have its own configurator

add datastore configurator, for each hypervisor and each protocol, needs to have its own configurator


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

Branch: refs/heads/javelin
Commit: 7652a44be731fdfda220d206971933b7525cd024
Parents: ae59bf6
Author: Edison Su <su...@gmail.com>
Authored: Fri Dec 7 18:22:54 2012 -0800
Committer: Edison Su <su...@gmail.com>
Committed: Fri Dec 7 18:23:08 2012 -0800

----------------------------------------------------------------------
 .../api/storage/PrimaryDataStoreLifeCycle.java     |    5 +
 .../storage/datastore/DefaultPrimaryDataStore.java |    2 +
 .../configurator/PrimaryDataStoreConfigurator.java |   32 +++++++
 .../configurator/kvm/AbstractKvmConfigurator.java  |   64 ++++++++++++++
 .../configurator/kvm/KvmCLVMConfigurator.java      |   46 ++++++++++
 .../configurator/kvm/KvmNfsConfigurator.java       |   41 +++++++++
 .../configurator/kvm/KvmRBDConfigurator.java       |   41 +++++++++
 .../configurator/validator/CLVMValidator.java      |   38 ++++++++
 .../validator/FileSystemValidator.java             |   38 ++++++++
 .../configurator/validator/ISCSIValiator.java      |   38 ++++++++
 .../configurator/validator/NfsValidator.java       |   38 ++++++++
 .../configurator/validator/ProtocolValidator.java  |   27 ++++++
 .../configurator/validator/RBDValidator.java       |   38 ++++++++
 .../configurator/validator/VMFSValidator.java      |   38 ++++++++
 .../vmware/AbstractVmwareConfigurator.java         |   66 +++++++++++++++
 .../vmware/VmwareIsciConfigurator.java             |   41 +++++++++
 .../configurator/vmware/VmwareNfsConfigurator.java |   37 ++++++++
 .../vmware/VmwareVMFSConfigurator.java             |   37 ++++++++
 .../configurator/xen/XenIscsiConfigurator.java     |   46 ++++++++++
 .../configurator/xen/XenNfsConfigurator.java       |   46 ++++++++++
 .../datastore/db/PrimaryDataStoreDaoImpl.java      |    1 +
 .../driver/DefaultPrimaryDataStoreDriverImpl.java  |    9 ++
 .../datastore/driver/PrimaryDataStoreDriver.java   |    3 +-
 .../DefaultKvmPrimaryDataStoreLifeCycle.java       |   34 ++++++++
 .../DefaultPrimaryDataStoreLifeCycleImpl.java      |    6 +-
 .../DefaultVmwarePrimaryDataStoreLifeCycle.java    |   39 +++++++++
 .../DefaultXenPrimaryDataStoreLifeCycle.java       |   35 ++++++++
 .../storage/volume/test/ConfiguratorTest.java      |   45 ++++++++++
 .../storage/volume/test/TestConfiguration.java     |   33 +++++++
 .../storage/volume/test/resource/testContext.xml   |   24 +++++
 .../driver/SolidfirePrimaryDataStoreDriver.java    |    7 ++
 31 files changed, 993 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreLifeCycle.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreLifeCycle.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreLifeCycle.java
index bcd0d85..3f457c9 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreLifeCycle.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreLifeCycle.java
@@ -34,4 +34,9 @@ public interface PrimaryDataStoreLifeCycle {
     public boolean cancelMaintain();
 
     public boolean deleteDataStore();
+
+    /**
+     * @param dataStore
+     */
+    void setDataStore(PrimaryDataStoreInfo dataStore);
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/DefaultPrimaryDataStore.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/DefaultPrimaryDataStore.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/DefaultPrimaryDataStore.java
index f5e7349..c063c5d 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/DefaultPrimaryDataStore.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/DefaultPrimaryDataStore.java
@@ -49,10 +49,12 @@ public class DefaultPrimaryDataStore implements PrimaryDataStore {
     }
     
     public void setDriver(PrimaryDataStoreDriver driver) {
+        driver.setDataStore(this);
         this.driver = driver;
     }
     
     public void setLifeCycle(PrimaryDataStoreLifeCycle lifeCycle) {
+        lifeCycle.setDataStore(this);
         this.lifeCycle = lifeCycle;
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/PrimaryDataStoreConfigurator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/PrimaryDataStoreConfigurator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/PrimaryDataStoreConfigurator.java
new file mode 100644
index 0000000..e857165
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/PrimaryDataStoreConfigurator.java
@@ -0,0 +1,32 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator;
+
+import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
+import org.apache.cloudstack.storage.datastore.configurator.validator.ProtocolValidator;
+
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.storage.Storage.StoragePoolType;
+
+public interface PrimaryDataStoreConfigurator {
+    public HypervisorType getSupportedHypervisor();
+    public StoragePoolType getSupportedDataStoreType();
+    public PrimaryDataStore getDataStore(long dataStoreId);
+    public ProtocolValidator getValidator();
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/AbstractKvmConfigurator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/AbstractKvmConfigurator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/AbstractKvmConfigurator.java
new file mode 100644
index 0000000..8fc2832
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/AbstractKvmConfigurator.java
@@ -0,0 +1,64 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.kvm;
+
+import javax.inject.Inject;
+
+import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreLifeCycle;
+import org.apache.cloudstack.storage.datastore.DefaultPrimaryDataStore;
+import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
+import org.apache.cloudstack.storage.datastore.configurator.PrimaryDataStoreConfigurator;
+import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
+import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreVO;
+import org.apache.cloudstack.storage.datastore.driver.DefaultPrimaryDataStoreDriverImpl;
+import org.apache.cloudstack.storage.datastore.driver.PrimaryDataStoreDriver;
+import org.apache.cloudstack.storage.datastore.lifecycle.DefaultKvmPrimaryDataStoreLifeCycle;
+
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.utils.exception.CloudRuntimeException;
+
+public abstract class AbstractKvmConfigurator implements PrimaryDataStoreConfigurator {
+    @Inject
+    PrimaryDataStoreDao dataStoreDao;
+    @Override
+    public HypervisorType getSupportedHypervisor() {
+        return HypervisorType.KVM;
+    }
+    
+    protected PrimaryDataStoreLifeCycle getLifeCycle() {
+        return new DefaultKvmPrimaryDataStoreLifeCycle(dataStoreDao);
+    }
+    
+    protected PrimaryDataStoreDriver getDriver() {
+        return new DefaultPrimaryDataStoreDriverImpl();
+    }
+
+    @Override
+    public PrimaryDataStore getDataStore(long dataStoreId) {
+        PrimaryDataStoreVO dataStoreVO = dataStoreDao.findById(dataStoreId);
+        if (dataStoreVO == null) {
+            throw new CloudRuntimeException("Can't find primary data store: " + dataStoreId);
+        }
+        
+        DefaultPrimaryDataStore dataStore = DefaultPrimaryDataStore.createDataStore(dataStoreVO);
+        dataStore.setDriver(this.getDriver());
+        dataStore.setLifeCycle(getLifeCycle());
+        return dataStore;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/KvmCLVMConfigurator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/KvmCLVMConfigurator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/KvmCLVMConfigurator.java
new file mode 100644
index 0000000..ca8f10a
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/KvmCLVMConfigurator.java
@@ -0,0 +1,46 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.kvm;
+
+import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
+import org.apache.cloudstack.storage.datastore.configurator.PrimaryDataStoreConfigurator;
+import org.apache.cloudstack.storage.datastore.configurator.validator.CLVMValidator;
+import org.apache.cloudstack.storage.datastore.configurator.validator.ProtocolValidator;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.storage.Storage.StoragePoolType;
+
+@Component
+@Qualifier("defaultProvider")
+public class KvmCLVMConfigurator extends AbstractKvmConfigurator {
+
+    @Override
+    public StoragePoolType getSupportedDataStoreType() {
+        return StoragePoolType.CLVM;
+    }
+
+    @Override
+    public ProtocolValidator getValidator() {
+        return new CLVMValidator();
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/KvmNfsConfigurator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/KvmNfsConfigurator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/KvmNfsConfigurator.java
new file mode 100644
index 0000000..25abe80
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/KvmNfsConfigurator.java
@@ -0,0 +1,41 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.kvm;
+
+import org.apache.cloudstack.storage.datastore.configurator.validator.NfsValidator;
+import org.apache.cloudstack.storage.datastore.configurator.validator.ProtocolValidator;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import com.cloud.storage.Storage.StoragePoolType;
+
+@Component
+@Qualifier("defaultProvider")
+public class KvmNfsConfigurator extends AbstractKvmConfigurator {
+
+    @Override
+    public StoragePoolType getSupportedDataStoreType() {
+        return StoragePoolType.NetworkFilesystem;
+    }
+
+    @Override
+    public ProtocolValidator getValidator() {
+        return new NfsValidator();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/KvmRBDConfigurator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/KvmRBDConfigurator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/KvmRBDConfigurator.java
new file mode 100644
index 0000000..3482162
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/kvm/KvmRBDConfigurator.java
@@ -0,0 +1,41 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.kvm;
+
+import org.apache.cloudstack.storage.datastore.configurator.validator.ProtocolValidator;
+import org.apache.cloudstack.storage.datastore.configurator.validator.RBDValidator;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import com.cloud.storage.Storage.StoragePoolType;
+
+@Component
+@Qualifier("defaultProvider")
+public class KvmRBDConfigurator extends AbstractKvmConfigurator {
+
+    @Override
+    public StoragePoolType getSupportedDataStoreType() {
+        return StoragePoolType.RBD;
+    }
+
+    @Override
+    public ProtocolValidator getValidator() {
+        return new RBDValidator();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/CLVMValidator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/CLVMValidator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/CLVMValidator.java
new file mode 100644
index 0000000..e26394d
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/CLVMValidator.java
@@ -0,0 +1,38 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.validator;
+
+import java.util.List;
+import java.util.Map;
+
+public class CLVMValidator implements ProtocolValidator {
+
+    @Override
+    public boolean validate(Map<String, String> params) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public List<String> getInputParamNames() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/FileSystemValidator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/FileSystemValidator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/FileSystemValidator.java
new file mode 100644
index 0000000..60532dc
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/FileSystemValidator.java
@@ -0,0 +1,38 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.validator;
+
+import java.util.List;
+import java.util.Map;
+
+public class FileSystemValidator implements ProtocolValidator {
+
+    @Override
+    public boolean validate(Map<String, String> params) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public List<String> getInputParamNames() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/ISCSIValiator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/ISCSIValiator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/ISCSIValiator.java
new file mode 100644
index 0000000..89ecc31
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/ISCSIValiator.java
@@ -0,0 +1,38 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.validator;
+
+import java.util.List;
+import java.util.Map;
+
+public class ISCSIValiator implements ProtocolValidator {
+
+    @Override
+    public boolean validate(Map<String, String> params) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public List<String> getInputParamNames() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/NfsValidator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/NfsValidator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/NfsValidator.java
new file mode 100644
index 0000000..97d4761
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/NfsValidator.java
@@ -0,0 +1,38 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.validator;
+
+import java.util.List;
+import java.util.Map;
+
+public class NfsValidator implements ProtocolValidator {
+
+    @Override
+    public boolean validate(Map<String, String> params) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public List<String> getInputParamNames() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/ProtocolValidator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/ProtocolValidator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/ProtocolValidator.java
new file mode 100644
index 0000000..2b1948b
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/ProtocolValidator.java
@@ -0,0 +1,27 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.validator;
+
+import java.util.List;
+import java.util.Map;
+
+public interface ProtocolValidator {
+    public boolean validate(Map<String, String> params);
+    public List<String> getInputParamNames();
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/RBDValidator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/RBDValidator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/RBDValidator.java
new file mode 100644
index 0000000..fbcf451
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/RBDValidator.java
@@ -0,0 +1,38 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.validator;
+
+import java.util.List;
+import java.util.Map;
+
+public class RBDValidator implements ProtocolValidator {
+
+    @Override
+    public boolean validate(Map<String, String> params) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public List<String> getInputParamNames() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/VMFSValidator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/VMFSValidator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/VMFSValidator.java
new file mode 100644
index 0000000..439e047
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/validator/VMFSValidator.java
@@ -0,0 +1,38 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.validator;
+
+import java.util.List;
+import java.util.Map;
+
+public class VMFSValidator implements ProtocolValidator {
+
+    @Override
+    public boolean validate(Map<String, String> params) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public List<String> getInputParamNames() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/AbstractVmwareConfigurator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/AbstractVmwareConfigurator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/AbstractVmwareConfigurator.java
new file mode 100644
index 0000000..ece2e81
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/AbstractVmwareConfigurator.java
@@ -0,0 +1,66 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.vmware;
+
+import javax.inject.Inject;
+
+import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreLifeCycle;
+import org.apache.cloudstack.storage.datastore.DefaultPrimaryDataStore;
+import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
+import org.apache.cloudstack.storage.datastore.configurator.PrimaryDataStoreConfigurator;
+import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
+import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreVO;
+import org.apache.cloudstack.storage.datastore.driver.DefaultPrimaryDataStoreDriverImpl;
+import org.apache.cloudstack.storage.datastore.driver.PrimaryDataStoreDriver;
+import org.apache.cloudstack.storage.datastore.lifecycle.DefaultVmwarePrimaryDataStoreLifeCycle;
+
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.utils.exception.CloudRuntimeException;
+
+public abstract class AbstractVmwareConfigurator implements PrimaryDataStoreConfigurator {
+
+    @Inject
+    PrimaryDataStoreDao dataStoreDao;
+    @Override
+    public HypervisorType getSupportedHypervisor() {
+        return HypervisorType.VMware;
+    }
+    
+    protected PrimaryDataStoreLifeCycle getLifeCycle() {
+        return new DefaultVmwarePrimaryDataStoreLifeCycle();
+    }
+    
+    protected PrimaryDataStoreDriver getDriver() {
+        return new DefaultPrimaryDataStoreDriverImpl();
+    }
+
+    @Override
+    public PrimaryDataStore getDataStore(long dataStoreId) {
+        PrimaryDataStoreVO dataStoreVO = dataStoreDao.findById(dataStoreId);
+        if (dataStoreVO == null) {
+            throw new CloudRuntimeException("Can't find primary data store: " + dataStoreId);
+        }
+        
+        DefaultPrimaryDataStore dataStore = DefaultPrimaryDataStore.createDataStore(dataStoreVO);
+        dataStore.setDriver(this.getDriver());
+        dataStore.setLifeCycle(getLifeCycle());
+        return dataStore;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/VmwareIsciConfigurator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/VmwareIsciConfigurator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/VmwareIsciConfigurator.java
new file mode 100644
index 0000000..f42ac93
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/VmwareIsciConfigurator.java
@@ -0,0 +1,41 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.vmware;
+
+import org.apache.cloudstack.storage.datastore.configurator.validator.ISCSIValiator;
+import org.apache.cloudstack.storage.datastore.configurator.validator.ProtocolValidator;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import com.cloud.storage.Storage.StoragePoolType;
+
+@Component
+@Qualifier("defaultProvider")
+public class VmwareIsciConfigurator extends AbstractVmwareConfigurator {
+
+    @Override
+    public StoragePoolType getSupportedDataStoreType() {
+        return StoragePoolType.Iscsi;
+    }
+
+    @Override
+    public ProtocolValidator getValidator() {
+        return new ISCSIValiator();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/VmwareNfsConfigurator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/VmwareNfsConfigurator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/VmwareNfsConfigurator.java
new file mode 100644
index 0000000..8517c8e
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/VmwareNfsConfigurator.java
@@ -0,0 +1,37 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.vmware;
+
+import org.apache.cloudstack.storage.datastore.configurator.validator.NfsValidator;
+import org.apache.cloudstack.storage.datastore.configurator.validator.ProtocolValidator;
+
+import com.cloud.storage.Storage.StoragePoolType;
+
+public class VmwareNfsConfigurator extends AbstractVmwareConfigurator {
+
+    @Override
+    public StoragePoolType getSupportedDataStoreType() {
+        return StoragePoolType.NetworkFilesystem;
+    }
+
+    @Override
+    public ProtocolValidator getValidator() {
+        return new NfsValidator();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/VmwareVMFSConfigurator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/VmwareVMFSConfigurator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/VmwareVMFSConfigurator.java
new file mode 100644
index 0000000..de3c256
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/vmware/VmwareVMFSConfigurator.java
@@ -0,0 +1,37 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.vmware;
+
+import org.apache.cloudstack.storage.datastore.configurator.validator.ProtocolValidator;
+import org.apache.cloudstack.storage.datastore.configurator.validator.VMFSValidator;
+
+import com.cloud.storage.Storage.StoragePoolType;
+
+public class VmwareVMFSConfigurator extends AbstractVmwareConfigurator {
+
+    @Override
+    public StoragePoolType getSupportedDataStoreType() {
+        return StoragePoolType.VMFS;
+    }
+
+    @Override
+    public ProtocolValidator getValidator() {
+        return new VMFSValidator();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/xen/XenIscsiConfigurator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/xen/XenIscsiConfigurator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/xen/XenIscsiConfigurator.java
new file mode 100644
index 0000000..c817a5e
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/xen/XenIscsiConfigurator.java
@@ -0,0 +1,46 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.xen;
+
+import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
+import org.apache.cloudstack.storage.datastore.configurator.PrimaryDataStoreConfigurator;
+
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+
+public class XenIscsiConfigurator implements PrimaryDataStoreConfigurator {
+
+    @Override
+    public HypervisorType getSupportedHypervisor() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public String getSupportedDataStoreType() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public PrimaryDataStore getDataStore() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/xen/XenNfsConfigurator.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/xen/XenNfsConfigurator.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/xen/XenNfsConfigurator.java
new file mode 100644
index 0000000..5ee1b91
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/configurator/xen/XenNfsConfigurator.java
@@ -0,0 +1,46 @@
+/*
+ * 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.cloudstack.storage.datastore.configurator.xen;
+
+import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
+import org.apache.cloudstack.storage.datastore.configurator.PrimaryDataStoreConfigurator;
+
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+
+public class XenNfsConfigurator implements PrimaryDataStoreConfigurator {
+
+    @Override
+    public HypervisorType getSupportedHypervisor() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public String getSupportedDataStoreType() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public PrimaryDataStore getDataStore() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
index 49dad27..247cdee 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
@@ -46,6 +46,7 @@ import com.cloud.utils.db.SearchCriteria.Func;
 import com.cloud.utils.db.SearchCriteria.Op;
 import com.cloud.utils.exception.CloudRuntimeException;
 
+@Component
 public class PrimaryDataStoreDaoImpl extends GenericDaoBase<PrimaryDataStoreVO, Long> implements PrimaryDataStoreDao {
     protected final SearchBuilder<PrimaryDataStoreVO> AllFieldSearch;
     protected final SearchBuilder<PrimaryDataStoreVO> DcPodSearch;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/DefaultPrimaryDataStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/DefaultPrimaryDataStoreDriverImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/DefaultPrimaryDataStoreDriverImpl.java
index db5f7e8..7c109e7 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/DefaultPrimaryDataStoreDriverImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/DefaultPrimaryDataStoreDriverImpl.java
@@ -28,6 +28,15 @@ public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
         this.dataStore = dataStore;
     }
     
+    public DefaultPrimaryDataStoreDriverImpl() {
+        
+    }
+    
+    @Override
+    public void setDataStore(PrimaryDataStore dataStore) {
+        this.dataStore = dataStore;
+    }
+    
     @Override
     public boolean createVolume(VolumeObject vol) {
         // The default driver will send createvolume command to one of hosts

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/PrimaryDataStoreDriver.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/PrimaryDataStoreDriver.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/PrimaryDataStoreDriver.java
index a42ec16..685bb69 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/PrimaryDataStoreDriver.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/driver/PrimaryDataStoreDriver.java
@@ -3,6 +3,7 @@ package org.apache.cloudstack.storage.datastore.driver;
 import java.util.Map;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
+import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
 import org.apache.cloudstack.storage.volume.TemplateOnPrimaryDataStoreInfo;
 import org.apache.cloudstack.storage.volume.VolumeObject;
 
@@ -26,5 +27,5 @@ public interface PrimaryDataStoreDriver {
     boolean initialize(Map<String, String> params);
     boolean grantAccess(EndPoint ep);
     boolean revokeAccess(EndPoint ep);
-    
+    void setDataStore(PrimaryDataStore dataStore);
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultKvmPrimaryDataStoreLifeCycle.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultKvmPrimaryDataStoreLifeCycle.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultKvmPrimaryDataStoreLifeCycle.java
new file mode 100644
index 0000000..5407b37
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultKvmPrimaryDataStoreLifeCycle.java
@@ -0,0 +1,34 @@
+/*
+ * 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.cloudstack.storage.datastore.lifecycle;
+
+import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
+
+public class DefaultKvmPrimaryDataStoreLifeCycle extends DefaultPrimaryDataStoreLifeCycleImpl {
+
+    /**
+     * @param dataStoreDao
+     * @param dataStore
+     */
+    public DefaultKvmPrimaryDataStoreLifeCycle(PrimaryDataStoreDao dataStoreDao) {
+        super(dataStoreDao);
+        // TODO Auto-generated constructor stub
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultPrimaryDataStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultPrimaryDataStoreLifeCycleImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultPrimaryDataStoreLifeCycleImpl.java
index 3d611cc..897c65e 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultPrimaryDataStoreLifeCycleImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultPrimaryDataStoreLifeCycleImpl.java
@@ -39,8 +39,12 @@ import org.springframework.stereotype.Component;
 public class DefaultPrimaryDataStoreLifeCycleImpl implements PrimaryDataStoreLifeCycle {
     protected PrimaryDataStoreInfo dataStore;
     protected PrimaryDataStoreDao dataStoreDao;
-    public DefaultPrimaryDataStoreLifeCycleImpl(PrimaryDataStoreDao dataStoreDao, PrimaryDataStore dataStore) {
+    public DefaultPrimaryDataStoreLifeCycleImpl(PrimaryDataStoreDao dataStoreDao) {
         this.dataStoreDao = dataStoreDao;
+    }
+    
+    @Override
+    public void setDataStore(PrimaryDataStoreInfo dataStore) {
         this.dataStore = dataStore;
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultVmwarePrimaryDataStoreLifeCycle.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultVmwarePrimaryDataStoreLifeCycle.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultVmwarePrimaryDataStoreLifeCycle.java
new file mode 100644
index 0000000..dcb0c77
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultVmwarePrimaryDataStoreLifeCycle.java
@@ -0,0 +1,39 @@
+/*
+ * 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.cloudstack.storage.datastore.lifecycle;
+
+import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
+import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
+
+public class DefaultVmwarePrimaryDataStoreLifeCycle extends DefaultPrimaryDataStoreLifeCycleImpl {
+
+    /**
+     * @param dataStoreDao
+     * @param dataStore
+     */
+    public DefaultVmwarePrimaryDataStoreLifeCycle(PrimaryDataStoreDao dataStoreDao, PrimaryDataStore dataStore) {
+        super(dataStoreDao, dataStore);
+        // TODO Auto-generated constructor stub
+    }
+    
+    public DefaultVmwarePrimaryDataStoreLifeCycle() {
+        super(null, null);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultXenPrimaryDataStoreLifeCycle.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultXenPrimaryDataStoreLifeCycle.java b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultXenPrimaryDataStoreLifeCycle.java
new file mode 100644
index 0000000..27bb347
--- /dev/null
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultXenPrimaryDataStoreLifeCycle.java
@@ -0,0 +1,35 @@
+/*
+ * 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.cloudstack.storage.datastore.lifecycle;
+
+import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
+import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
+
+public class DefaultXenPrimaryDataStoreLifeCycle extends DefaultPrimaryDataStoreLifeCycleImpl {
+
+    /**
+     * @param dataStoreDao
+     * @param dataStore
+     */
+    public DefaultXenPrimaryDataStoreLifeCycle(PrimaryDataStoreDao dataStoreDao, PrimaryDataStore dataStore) {
+        super(dataStoreDao, dataStore);
+        // TODO Auto-generated constructor stub
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/test/org/apache/cloudstack/storage/volume/test/ConfiguratorTest.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/test/org/apache/cloudstack/storage/volume/test/ConfiguratorTest.java b/engine/storage/volume/test/org/apache/cloudstack/storage/volume/test/ConfiguratorTest.java
new file mode 100644
index 0000000..c70de8c
--- /dev/null
+++ b/engine/storage/volume/test/org/apache/cloudstack/storage/volume/test/ConfiguratorTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.cloudstack.storage.volume.test;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.apache.cloudstack.storage.datastore.configurator.PrimaryDataStoreConfigurator;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(locations="classpath:/resource/testContext.xml")
+public class ConfiguratorTest {
+    @Inject
+    @Qualifier("defaultProvider")
+    List<PrimaryDataStoreConfigurator> configurators;
+    
+    @Test
+    public void testLoadConfigurator() {
+        for (PrimaryDataStoreConfigurator configurator : configurators) {
+            System.out.println(configurator.getClass().getName());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/test/org/apache/cloudstack/storage/volume/test/TestConfiguration.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/test/org/apache/cloudstack/storage/volume/test/TestConfiguration.java b/engine/storage/volume/test/org/apache/cloudstack/storage/volume/test/TestConfiguration.java
new file mode 100644
index 0000000..960d1f6
--- /dev/null
+++ b/engine/storage/volume/test/org/apache/cloudstack/storage/volume/test/TestConfiguration.java
@@ -0,0 +1,33 @@
+/*
+ * 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.cloudstack.storage.volume.test;
+
+import org.apache.cloudstack.storage.image.motion.ImageMotionService;
+import org.mockito.Mockito;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+
+@Configuration
+public class TestConfiguration {
+    @Bean
+    public ImageMotionService imageMotion() {
+        return Mockito.mock(ImageMotionService.class);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/engine/storage/volume/test/resource/testContext.xml
----------------------------------------------------------------------
diff --git a/engine/storage/volume/test/resource/testContext.xml b/engine/storage/volume/test/resource/testContext.xml
new file mode 100644
index 0000000..c8290eb
--- /dev/null
+++ b/engine/storage/volume/test/resource/testContext.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+  xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+                        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                         http://www.springframework.org/schema/tx 
+       http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
+       http://www.springframework.org/schema/aop
+       http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                                 http://www.springframework.org/schema/context
+                                          http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+  <context:annotation-config />
+  <context:component-scan base-package="org.apache.cloudstack.storage" />
+  <context:component-scan base-package="org.apache.cloudstack.engine.subsystem.api.storage" />
+  <context:component-scan base-package="com.cloud.utils.db" />
+  <context:component-scan base-package="com.cloud.utils.component" />
+  <context:component-scan base-package="com.cloud.host.dao" />
+  <context:component-scan base-package="com.cloud.dc.dao" />
+ 
+   <context:component-scan base-package=" com.cloud.upgrade.dao" />
+   <tx:annotation-driven transaction-manager="transactionManager" />
+  <bean class="org.cloudstack.storage.volume.test.TestConfiguration" />
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7652a44b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
index 8d96711..5076578 100644
--- a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
+++ b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java
@@ -3,6 +3,7 @@ package org.apache.cloudstack.storage.datastore.driver;
 import java.util.Map;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
+import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
 import org.apache.cloudstack.storage.volume.TemplateOnPrimaryDataStoreInfo;
 import org.apache.cloudstack.storage.volume.VolumeObject;
 
@@ -69,4 +70,10 @@ public class SolidfirePrimaryDataStoreDriver implements PrimaryDataStoreDriver {
         return false;
     }
 
+    @Override
+    public void setDataStore(PrimaryDataStore dataStore) {
+        // TODO Auto-generated method stub
+        
+    }
+
 }