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 bcd0d851fae..3f457c9c28a 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); } 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 f5e7349f6c4..c063c5d6ae2 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; } 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 00000000000..e857165e12a --- /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(); +} 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 00000000000..8fc28325a0f --- /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; + } +} 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 00000000000..ca8f10a961c --- /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(); + } + + +} 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 00000000000..25abe803421 --- /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(); + } +} 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 00000000000..34821620956 --- /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(); + } +} 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 00000000000..e26394de530 --- /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 params) { + // TODO Auto-generated method stub + return false; + } + + @Override + public List getInputParamNames() { + // TODO Auto-generated method stub + return null; + } + +} 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 00000000000..60532dcb8bb --- /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 params) { + // TODO Auto-generated method stub + return false; + } + + @Override + public List getInputParamNames() { + // TODO Auto-generated method stub + return null; + } + +} 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 00000000000..89ecc310193 --- /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 params) { + // TODO Auto-generated method stub + return false; + } + + @Override + public List getInputParamNames() { + // TODO Auto-generated method stub + return null; + } + +} 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 00000000000..97d4761f413 --- /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 params) { + // TODO Auto-generated method stub + return false; + } + + @Override + public List getInputParamNames() { + // TODO Auto-generated method stub + return null; + } + +} 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 00000000000..2b1948b8b9c --- /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 params); + public List getInputParamNames(); +} 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 00000000000..fbcf4510870 --- /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 params) { + // TODO Auto-generated method stub + return false; + } + + @Override + public List getInputParamNames() { + // TODO Auto-generated method stub + return null; + } + +} 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 00000000000..439e047c2fd --- /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 params) { + // TODO Auto-generated method stub + return false; + } + + @Override + public List getInputParamNames() { + // TODO Auto-generated method stub + return null; + } + +} 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 00000000000..ece2e81903d --- /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; + } + +} 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 00000000000..f42ac93feda --- /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(); + } +} 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 00000000000..8517c8eeef5 --- /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(); + } +} 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 00000000000..de3c2565d9b --- /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(); + } +} 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 00000000000..c817a5e8e95 --- /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; + } + +} 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 00000000000..5ee1b91a38f --- /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; + } + +} 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 49dad27d872..247cdeec682 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 implements PrimaryDataStoreDao { protected final SearchBuilder AllFieldSearch; protected final SearchBuilder DcPodSearch; 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 db5f7e8d05f..7c109e7688d 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 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 a42ec16af1b..685bb691184 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 params); boolean grantAccess(EndPoint ep); boolean revokeAccess(EndPoint ep); - + void setDataStore(PrimaryDataStore dataStore); } 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 00000000000..5407b37c765 --- /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 + } + +} 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 3d611ccfddb..897c65e40ca 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; } 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 00000000000..dcb0c77c0ef --- /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); + } + +} 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 00000000000..27bb347505c --- /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 + } + +} 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 00000000000..c70de8cdc47 --- /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 configurators; + + @Test + public void testLoadConfigurator() { + for (PrimaryDataStoreConfigurator configurator : configurators) { + System.out.println(configurator.getClass().getName()); + } + } +} 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 00000000000..960d1f678b9 --- /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 diff --git a/engine/storage/volume/test/resource/testContext.xml b/engine/storage/volume/test/resource/testContext.xml new file mode 100644 index 00000000000..c8290eb93a1 --- /dev/null +++ b/engine/storage/volume/test/resource/testContext.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + \ No newline at end of file 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 8d96711c756..50765787fb0 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 + + } + }