Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@
<artifactId>cloud-plugin-storage-volume-solidfire</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-storage-volume-netapp</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-storage-image-netapp</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-storage-volume-cloudbyte</artifactId>
Expand Down
2 changes: 2 additions & 0 deletions plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@
<module>storage/image/s3</module>
<module>storage/image/sample</module>
<module>storage/image/swift</module>
<module>storage/image/netapp</module>
<module>storage/volume/cloudbyte</module>
<module>storage/volume/datera</module>
<module>storage/volume/default</module>
<module>storage/volume/netapp</module>
<module>storage/volume/nexenta</module>
<module>storage/volume/sample</module>
<module>storage/volume/ontap</module>
Expand Down
43 changes: 43 additions & 0 deletions plugins/storage/image/netapp/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cloud-plugin-storage-image-netapp</artifactId>
<name>Apache CloudStack Plugin - Storage Image NetApp Provider</name>
<parent>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloudstack-plugins</artifactId>
<version>4.21.0.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-storage-image-default</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-engine-storage-image</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package org.apache.cloudstack.storage.driver;


import com.cloud.agent.api.to.DataStoreTO;
import com.cloud.agent.api.to.DataTO;
import com.cloud.agent.api.to.DatadiskTO;
import com.cloud.host.Host;
import com.cloud.storage.Storage;
import com.cloud.storage.Upload;
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
import org.apache.cloudstack.storage.command.CommandResult;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.storage.image.ImageStoreDriver;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public class NetAppSecondaryDatastoreDriver implements ImageStoreDriver {

@Override
public Map<String, String> getCapabilities() {
return null;
}

@Override
public DataTO getTO(DataObject data) {
return null;
}

@Override
public DataStoreTO getStoreTO(DataStore store) {
return null;
}

@Override
public void createAsync(DataStore store, DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) {

}

@Override
public void deleteAsync(DataStore store, DataObject data, AsyncCompletionCallback<CommandResult> callback) {

}

@Override
public void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback) {

}

@Override
public void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback<CopyCommandResult> callback) {

}


@Override
public boolean canCopy(DataObject srcData, DataObject destData) {
return false;
}

@Override
public void resize(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) {

}

@Override
public String createEntityExtractUrl(DataStore store, String installPath, Storage.ImageFormat format, DataObject dataObject) {
return null;
}

@Override
public void deleteEntityExtractUrl(DataStore store, String installPath, String url, Upload.Type entityType) {

}

@Override
public List<DatadiskTO> getDataDiskTemplates(DataObject obj, String configurationId) {
return null;
}

@Override
public Void createDataDiskTemplateAsync(TemplateInfo dataDiskTemplate, String path, String diskId, boolean bootable, long fileSize, AsyncCompletionCallback<CreateCmdResult> callback) {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package org.apache.cloudstack.storage.lifecycle;


import com.cloud.agent.api.StoragePoolInfo;
import com.cloud.hypervisor.Hypervisor;
import org.apache.cloudstack.engine.subsystem.api.storage.ClusterScope;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.HostScope;
import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
import org.apache.cloudstack.storage.image.store.lifecycle.ImageStoreLifeCycle;

import java.util.Map;

public class NetAppSecondaryDatastoreLifecycle implements ImageStoreLifeCycle {

/**
* Creates secondary storage on NetApp storage
* @param dsInfos
* @return
*/
@Override
public DataStore initialize(Map<String, Object> dsInfos) {
return null;
}

@Override
public boolean attachCluster(DataStore store, ClusterScope scope) {
return false;
}

@Override
public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo) {
return false;
}

@Override
public boolean attachZone(DataStore dataStore, ZoneScope scope, Hypervisor.HypervisorType hypervisorType) {
return true;
}

@Override
public boolean maintain(DataStore store) {
return true;
}

@Override
public boolean cancelMaintain(DataStore store) {
return true;
}

@Override
public boolean deleteDataStore(DataStore store) {
return true;
}

@Override
public boolean migrateToObjectStore(DataStore store) {
return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package org.apache.cloudstack.storage.provider;

import com.cloud.storage.ScopeType;
import com.cloud.utils.component.ComponentContext;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreLifeCycle;
import org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener;
import org.apache.cloudstack.engine.subsystem.api.storage.ImageStoreProvider;
import org.apache.cloudstack.storage.driver.NetAppSecondaryDatastoreDriver;
import org.apache.cloudstack.storage.image.datastore.ImageStoreProviderManager;
import org.apache.cloudstack.storage.lifecycle.NetAppSecondaryDatastoreLifecycle;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;

import javax.inject.Inject;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

@Component
public class NetAppSecondaryDatastoreProvider implements ImageStoreProvider {

private static final Logger s_logger = (Logger)LogManager.getLogger(NetAppSecondaryDatastoreProvider.class);
@Inject
ImageStoreProviderManager storeMgr;
private NetAppSecondaryDatastoreDriver secondaryDatastoreDriver;
private NetAppSecondaryDatastoreLifecycle secondaryDatastoreLifecycle;

public NetAppSecondaryDatastoreProvider() {
s_logger.info("NetAppSecondaryDatastoreProvider initialized");
}
@Override
public DataStoreLifeCycle getDataStoreLifeCycle() {
return secondaryDatastoreLifecycle;
}

@Override
public DataStoreDriver getDataStoreDriver() {
return secondaryDatastoreDriver;
}

@Override
public HypervisorHostListener getHostListener() {
return null;
}

@Override
public String getName() {
return "NetApp";
}

@Override
public boolean configure(Map<String, Object> params) {
secondaryDatastoreLifecycle = ComponentContext.inject(NetAppSecondaryDatastoreLifecycle.class);
secondaryDatastoreDriver = ComponentContext.inject(NetAppSecondaryDatastoreDriver.class);
storeMgr.registerDriver(this.getName(), secondaryDatastoreDriver);
return true;
}

@Override
public Set<DataStoreProviderType> getTypes() {
Set<DataStoreProviderType> types = new HashSet<DataStoreProviderType>();
types.add(DataStoreProviderType.IMAGE);
return types;
}

@Override
public boolean isScopeSupported(ScopeType scope) {
if (scope == ScopeType.REGION)
return true;
return false;
}

@Override
public boolean needDownloadSysTemplate() {
return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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.
name=storage-image-netapp
parent=storage
Original file line number Diff line number Diff line change
@@ -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.
-->
<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:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd"
>

<bean id="netappSecondaryDataStoreProvider"
class="org.apache.cloudstack.storage.provider.NetAppSecondaryDatastoreProvider" />

</beans>
Loading
Loading