Skip to content

Commit ce47faa

Browse files
Merge branch 'main' into feature/CSTACKEX-18_1
2 parents 9c3c8fd + 7466d6d commit ce47faa

18 files changed

Lines changed: 1013 additions & 5 deletions

File tree

client/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@
131131
<artifactId>cloud-plugin-storage-volume-solidfire</artifactId>
132132
<version>${project.version}</version>
133133
</dependency>
134+
<dependency>
135+
<groupId>org.apache.cloudstack</groupId>
136+
<artifactId>cloud-plugin-storage-volume-netapp</artifactId>
137+
<version>${project.version}</version>
138+
</dependency>
139+
<dependency>
140+
<groupId>org.apache.cloudstack</groupId>
141+
<artifactId>cloud-plugin-storage-image-netapp</artifactId>
142+
<version>${project.version}</version>
143+
</dependency>
134144
<dependency>
135145
<groupId>org.apache.cloudstack</groupId>
136146
<artifactId>cloud-plugin-storage-volume-cloudbyte</artifactId>

plugins/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,11 @@
124124
<module>storage/image/s3</module>
125125
<module>storage/image/sample</module>
126126
<module>storage/image/swift</module>
127+
<module>storage/image/netapp</module>
127128
<module>storage/volume/cloudbyte</module>
128129
<module>storage/volume/datera</module>
129130
<module>storage/volume/default</module>
131+
<module>storage/volume/netapp</module>
130132
<module>storage/volume/nexenta</module>
131133
<module>storage/volume/sample</module>
132134
<module>storage/volume/ontap</module>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<artifactId>cloud-plugin-storage-image-netapp</artifactId>
6+
<name>Apache CloudStack Plugin - Storage Image NetApp Provider</name>
7+
<parent>
8+
<groupId>org.apache.cloudstack</groupId>
9+
<artifactId>cloudstack-plugins</artifactId>
10+
<version>4.21.0.0-SNAPSHOT</version>
11+
<relativePath>../../../pom.xml</relativePath>
12+
</parent>
13+
<dependencies>
14+
<dependency>
15+
<groupId>org.apache.cloudstack</groupId>
16+
<artifactId>cloud-plugin-storage-image-default</artifactId>
17+
<version>${project.version}</version>
18+
</dependency>
19+
<dependency>
20+
<groupId>org.apache.cloudstack</groupId>
21+
<artifactId>cloud-engine-storage-image</artifactId>
22+
<version>${project.version}</version>
23+
</dependency>
24+
</dependencies>
25+
<build>
26+
<plugins>
27+
<plugin>
28+
<artifactId>maven-surefire-plugin</artifactId>
29+
<configuration>
30+
<skipTests>true</skipTests>
31+
</configuration>
32+
<executions>
33+
<execution>
34+
<phase>integration-test</phase>
35+
<goals>
36+
<goal>test</goal>
37+
</goals>
38+
</execution>
39+
</executions>
40+
</plugin>
41+
</plugins>
42+
</build>
43+
</project>
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
package org.apache.cloudstack.storage.driver;
2+
3+
4+
import com.cloud.agent.api.to.DataStoreTO;
5+
import com.cloud.agent.api.to.DataTO;
6+
import com.cloud.agent.api.to.DatadiskTO;
7+
import com.cloud.host.Host;
8+
import com.cloud.storage.Storage;
9+
import com.cloud.storage.Upload;
10+
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
11+
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
12+
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
13+
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
14+
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
15+
import org.apache.cloudstack.storage.command.CommandResult;
16+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
17+
import org.apache.cloudstack.storage.image.ImageStoreDriver;
18+
import org.springframework.stereotype.Component;
19+
20+
import java.util.List;
21+
import java.util.Map;
22+
23+
@Component
24+
public class NetAppSecondaryDatastoreDriver implements ImageStoreDriver {
25+
26+
@Override
27+
public Map<String, String> getCapabilities() {
28+
return null;
29+
}
30+
31+
@Override
32+
public DataTO getTO(DataObject data) {
33+
return null;
34+
}
35+
36+
@Override
37+
public DataStoreTO getStoreTO(DataStore store) {
38+
return null;
39+
}
40+
41+
@Override
42+
public void createAsync(DataStore store, DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) {
43+
44+
}
45+
46+
@Override
47+
public void deleteAsync(DataStore store, DataObject data, AsyncCompletionCallback<CommandResult> callback) {
48+
49+
}
50+
51+
@Override
52+
public void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback) {
53+
54+
}
55+
56+
@Override
57+
public void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback<CopyCommandResult> callback) {
58+
59+
}
60+
61+
62+
@Override
63+
public boolean canCopy(DataObject srcData, DataObject destData) {
64+
return false;
65+
}
66+
67+
@Override
68+
public void resize(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) {
69+
70+
}
71+
72+
@Override
73+
public String createEntityExtractUrl(DataStore store, String installPath, Storage.ImageFormat format, DataObject dataObject) {
74+
return null;
75+
}
76+
77+
@Override
78+
public void deleteEntityExtractUrl(DataStore store, String installPath, String url, Upload.Type entityType) {
79+
80+
}
81+
82+
@Override
83+
public List<DatadiskTO> getDataDiskTemplates(DataObject obj, String configurationId) {
84+
return null;
85+
}
86+
87+
@Override
88+
public Void createDataDiskTemplateAsync(TemplateInfo dataDiskTemplate, String path, String diskId, boolean bootable, long fileSize, AsyncCompletionCallback<CreateCmdResult> callback) {
89+
return null;
90+
}
91+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package org.apache.cloudstack.storage.lifecycle;
2+
3+
4+
import com.cloud.agent.api.StoragePoolInfo;
5+
import com.cloud.hypervisor.Hypervisor;
6+
import org.apache.cloudstack.engine.subsystem.api.storage.ClusterScope;
7+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
8+
import org.apache.cloudstack.engine.subsystem.api.storage.HostScope;
9+
import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
10+
import org.apache.cloudstack.storage.image.store.lifecycle.ImageStoreLifeCycle;
11+
12+
import java.util.Map;
13+
14+
public class NetAppSecondaryDatastoreLifecycle implements ImageStoreLifeCycle {
15+
16+
/**
17+
* Creates secondary storage on NetApp storage
18+
* @param dsInfos
19+
* @return
20+
*/
21+
@Override
22+
public DataStore initialize(Map<String, Object> dsInfos) {
23+
return null;
24+
}
25+
26+
@Override
27+
public boolean attachCluster(DataStore store, ClusterScope scope) {
28+
return false;
29+
}
30+
31+
@Override
32+
public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo) {
33+
return false;
34+
}
35+
36+
@Override
37+
public boolean attachZone(DataStore dataStore, ZoneScope scope, Hypervisor.HypervisorType hypervisorType) {
38+
return true;
39+
}
40+
41+
@Override
42+
public boolean maintain(DataStore store) {
43+
return true;
44+
}
45+
46+
@Override
47+
public boolean cancelMaintain(DataStore store) {
48+
return true;
49+
}
50+
51+
@Override
52+
public boolean deleteDataStore(DataStore store) {
53+
return true;
54+
}
55+
56+
@Override
57+
public boolean migrateToObjectStore(DataStore store) {
58+
return true;
59+
}
60+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package org.apache.cloudstack.storage.provider;
2+
3+
import com.cloud.storage.ScopeType;
4+
import com.cloud.utils.component.ComponentContext;
5+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
6+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreLifeCycle;
7+
import org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener;
8+
import org.apache.cloudstack.engine.subsystem.api.storage.ImageStoreProvider;
9+
import org.apache.cloudstack.storage.driver.NetAppSecondaryDatastoreDriver;
10+
import org.apache.cloudstack.storage.image.datastore.ImageStoreProviderManager;
11+
import org.apache.cloudstack.storage.lifecycle.NetAppSecondaryDatastoreLifecycle;
12+
import org.apache.logging.log4j.LogManager;
13+
import org.apache.logging.log4j.Logger;
14+
import org.springframework.stereotype.Component;
15+
16+
import javax.inject.Inject;
17+
import java.util.HashSet;
18+
import java.util.Map;
19+
import java.util.Set;
20+
21+
@Component
22+
public class NetAppSecondaryDatastoreProvider implements ImageStoreProvider {
23+
24+
private static final Logger s_logger = (Logger)LogManager.getLogger(NetAppSecondaryDatastoreProvider.class);
25+
@Inject
26+
ImageStoreProviderManager storeMgr;
27+
private NetAppSecondaryDatastoreDriver secondaryDatastoreDriver;
28+
private NetAppSecondaryDatastoreLifecycle secondaryDatastoreLifecycle;
29+
30+
public NetAppSecondaryDatastoreProvider() {
31+
s_logger.info("NetAppSecondaryDatastoreProvider initialized");
32+
}
33+
@Override
34+
public DataStoreLifeCycle getDataStoreLifeCycle() {
35+
return secondaryDatastoreLifecycle;
36+
}
37+
38+
@Override
39+
public DataStoreDriver getDataStoreDriver() {
40+
return secondaryDatastoreDriver;
41+
}
42+
43+
@Override
44+
public HypervisorHostListener getHostListener() {
45+
return null;
46+
}
47+
48+
@Override
49+
public String getName() {
50+
return "NetApp";
51+
}
52+
53+
@Override
54+
public boolean configure(Map<String, Object> params) {
55+
secondaryDatastoreLifecycle = ComponentContext.inject(NetAppSecondaryDatastoreLifecycle.class);
56+
secondaryDatastoreDriver = ComponentContext.inject(NetAppSecondaryDatastoreDriver.class);
57+
storeMgr.registerDriver(this.getName(), secondaryDatastoreDriver);
58+
return true;
59+
}
60+
61+
@Override
62+
public Set<DataStoreProviderType> getTypes() {
63+
Set<DataStoreProviderType> types = new HashSet<DataStoreProviderType>();
64+
types.add(DataStoreProviderType.IMAGE);
65+
return types;
66+
}
67+
68+
@Override
69+
public boolean isScopeSupported(ScopeType scope) {
70+
if (scope == ScopeType.REGION)
71+
return true;
72+
return false;
73+
}
74+
75+
@Override
76+
public boolean needDownloadSysTemplate() {
77+
return true;
78+
}
79+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
name=storage-image-netapp
18+
parent=storage
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
<beans xmlns="http://www.springframework.org/schema/beans"
20+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xmlns:context="http://www.springframework.org/schema/context"
22+
xmlns:aop="http://www.springframework.org/schema/aop"
23+
xsi:schemaLocation="http://www.springframework.org/schema/beans
24+
http://www.springframework.org/schema/beans/spring-beans.xsd
25+
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
26+
http://www.springframework.org/schema/context
27+
http://www.springframework.org/schema/context/spring-context.xsd"
28+
>
29+
30+
<bean id="netappSecondaryDataStoreProvider"
31+
class="org.apache.cloudstack.storage.provider.NetAppSecondaryDatastoreProvider" />
32+
33+
</beans>

0 commit comments

Comments
 (0)