Skip to content

Commit 7603ce0

Browse files
Locharla, SandeepRajiv Jain
authored andcommitted
Create & Delete, Enable & Disable, Enter & Cancel maintenance of Primary StoragePool with ONTAP storage
Co-authored-by: Sandeep Locharla <Sandeep.Locharla@netapp.com> Co-authored-by: Rajiv Jain <Rajiv.Jain@netapp.com> Co-authored-by: Piyush Srivastava piyush5@netapp.com Co-authored-by: Surya Gupta suryag@netapp.com
1 parent c361409 commit 7603ce0

File tree

20 files changed

+3470
-0
lines changed

20 files changed

+3470
-0
lines changed
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
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+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
<artifactId>cloud-plugin-storage-volume-ontap</artifactId>
23+
<name>Apache CloudStack Plugin - Storage Volume ONTAP Provider</name>
24+
<parent>
25+
<groupId>org.apache.cloudstack</groupId>
26+
<artifactId>cloudstack-plugins</artifactId>
27+
<version>4.23.0.0-SNAPSHOT</version>
28+
<relativePath>../../../pom.xml</relativePath>
29+
</parent>
30+
<properties>
31+
<spring-cloud.version>2021.0.7</spring-cloud.version>
32+
<openfeign.version>11.0</openfeign.version>
33+
<httpclient.version>4.5.14</httpclient.version>
34+
<swagger-annotations.version>1.6.2</swagger-annotations.version>
35+
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
36+
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
37+
<jackson-databind.version>2.13.4</jackson-databind.version>
38+
<assertj.version>3.24.2</assertj.version>
39+
<junit-jupiter.version>5.8.1</junit-jupiter.version>
40+
<mockito.version>3.12.4</mockito.version>
41+
<mockito-junit-jupiter.version>5.2.0</mockito-junit-jupiter.version>
42+
</properties>
43+
<dependencyManagement>
44+
<dependencies>
45+
<dependency>
46+
<groupId>org.springframework.cloud</groupId>
47+
<artifactId>spring-cloud-dependencies</artifactId>
48+
<version>${spring-cloud.version}</version>
49+
<type>pom</type>
50+
<scope>import</scope>
51+
</dependency>
52+
</dependencies>
53+
</dependencyManagement>
54+
<dependencies>
55+
<dependency>
56+
<groupId>org.apache.cloudstack</groupId>
57+
<artifactId>cloud-plugin-storage-volume-default</artifactId>
58+
<version>${project.version}</version>
59+
</dependency>
60+
<dependency>
61+
<groupId>io.github.openfeign</groupId>
62+
<artifactId>feign-core</artifactId>
63+
<version>${openfeign.version}</version>
64+
</dependency>
65+
<dependency>
66+
<groupId>io.github.openfeign</groupId>
67+
<artifactId>feign-httpclient</artifactId>
68+
<version>${openfeign.version}</version>
69+
</dependency>
70+
<dependency>
71+
<groupId>io.github.openfeign</groupId>
72+
<artifactId>feign-jackson</artifactId>
73+
<version>${openfeign.version}</version>
74+
</dependency>
75+
<dependency>
76+
<groupId>com.fasterxml.jackson.core</groupId>
77+
<artifactId>jackson-databind</artifactId>
78+
<version>${jackson-databind.version}</version>
79+
</dependency>
80+
<dependency>
81+
<groupId>org.apache.httpcomponents</groupId>
82+
<artifactId>httpclient</artifactId>
83+
<version>${httpclient.version}</version>
84+
</dependency>
85+
<dependency>
86+
<groupId>org.apache.cloudstack</groupId>
87+
<artifactId>cloud-engine-storage-volume</artifactId>
88+
<version>${project.version}</version>
89+
</dependency>
90+
<dependency>
91+
<groupId>io.swagger</groupId>
92+
<artifactId>swagger-annotations</artifactId>
93+
<version>${swagger-annotations.version}</version>
94+
</dependency>
95+
<!-- JUnit 5 -->
96+
<dependency>
97+
<groupId>org.junit.jupiter</groupId>
98+
<artifactId>junit-jupiter-engine</artifactId>
99+
<version>${junit-jupiter.version}</version>
100+
<scope>test</scope>
101+
</dependency>
102+
103+
<!-- Mockito -->
104+
<dependency>
105+
<groupId>org.mockito</groupId>
106+
<artifactId>mockito-core</artifactId>
107+
<version>${mockito.version}</version>
108+
<scope>test</scope>
109+
</dependency>
110+
<dependency>
111+
<groupId>org.mockito</groupId>
112+
<artifactId>mockito-junit-jupiter</artifactId>
113+
<version>${mockito-junit-jupiter.version}</version>
114+
<scope>test</scope>
115+
</dependency>
116+
117+
<!-- Mockito Inline (for static method mocking) -->
118+
<dependency>
119+
<groupId>org.mockito</groupId>
120+
<artifactId>mockito-inline</artifactId>
121+
<version>${mockito.version}</version>
122+
<scope>test</scope>
123+
</dependency>
124+
<dependency>
125+
<groupId>org.assertj</groupId>
126+
<artifactId>assertj-core</artifactId>
127+
<version>${assertj.version}</version>
128+
<scope>test</scope>
129+
</dependency>
130+
</dependencies>
131+
<repositories>
132+
<repository>
133+
<id>central</id>
134+
<name>Maven Central</name>
135+
<url>https://repo.maven.apache.org/maven2</url>
136+
</repository>
137+
</repositories>
138+
<build>
139+
<plugins>
140+
<plugin>
141+
<groupId>org.apache.maven.plugins</groupId>
142+
<artifactId>maven-compiler-plugin</artifactId>
143+
<version>${maven-compiler-plugin.version}</version>
144+
<configuration>
145+
<source>11</source>
146+
<target>11</target>
147+
</configuration>
148+
</plugin>
149+
<plugin>
150+
<artifactId>maven-surefire-plugin</artifactId>
151+
<version>${maven-surefire-plugin.version}</version>
152+
<configuration>
153+
<skipTests>false</skipTests>
154+
<includes>
155+
<include>**/*Test.java</include>
156+
</includes>
157+
</configuration>
158+
<executions>
159+
<execution>
160+
<phase>integration-test</phase>
161+
<goals>
162+
<goal>test</goal>
163+
</goals>
164+
</execution>
165+
</executions>
166+
</plugin>
167+
</plugins>
168+
</build>
169+
</project>
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
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+
package org.apache.cloudstack.storage.driver;
20+
21+
import com.cloud.agent.api.to.DataStoreTO;
22+
import com.cloud.agent.api.to.DataTO;
23+
import com.cloud.host.Host;
24+
import com.cloud.storage.Storage;
25+
import com.cloud.storage.StoragePool;
26+
import com.cloud.storage.Volume;
27+
import com.cloud.utils.Pair;
28+
import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo;
29+
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
30+
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
31+
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
32+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
33+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreCapabilities;
34+
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver;
35+
import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
36+
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
37+
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
38+
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
39+
import org.apache.cloudstack.storage.command.CommandResult;
40+
import org.apache.logging.log4j.LogManager;
41+
import org.apache.logging.log4j.Logger;
42+
43+
import java.util.HashMap;
44+
import java.util.Map;
45+
46+
public class OntapPrimaryDatastoreDriver implements PrimaryDataStoreDriver {
47+
48+
private static final Logger s_logger = LogManager.getLogger(OntapPrimaryDatastoreDriver.class);
49+
50+
@Override
51+
public Map<String, String> getCapabilities() {
52+
s_logger.trace("OntapPrimaryDatastoreDriver: getCapabilities: Called");
53+
Map<String, String> mapCapabilities = new HashMap<>();
54+
mapCapabilities.put(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString(), Boolean.FALSE.toString());
55+
mapCapabilities.put(DataStoreCapabilities.CAN_CREATE_VOLUME_FROM_SNAPSHOT.toString(), Boolean.FALSE.toString());
56+
57+
return mapCapabilities;
58+
}
59+
60+
@Override
61+
public DataTO getTO(DataObject data) {
62+
return null;
63+
}
64+
65+
@Override
66+
public DataStoreTO getStoreTO(DataStore store) { return null; }
67+
68+
@Override
69+
public void createAsync(DataStore dataStore, DataObject dataObject, AsyncCompletionCallback<CreateCmdResult> callback) {}
70+
71+
@Override
72+
public void deleteAsync(DataStore store, DataObject data, AsyncCompletionCallback<CommandResult> callback) {}
73+
74+
@Override
75+
public void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback) {}
76+
77+
@Override
78+
public void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback<CopyCommandResult> callback) {}
79+
80+
@Override
81+
public boolean canCopy(DataObject srcData, DataObject destData) {
82+
return false;
83+
}
84+
85+
@Override
86+
public void resize(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) {}
87+
88+
@Override
89+
public ChapInfo getChapInfo(DataObject dataObject) {
90+
return null;
91+
}
92+
93+
@Override
94+
public boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore) {
95+
return false;
96+
}
97+
98+
@Override
99+
public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) {}
100+
101+
@Override
102+
public long getDataObjectSizeIncludingHypervisorSnapshotReserve(DataObject dataObject, StoragePool storagePool) {
103+
return 0;
104+
}
105+
106+
@Override
107+
public long getBytesRequiredForTemplate(TemplateInfo templateInfo, StoragePool storagePool) {
108+
return 0;
109+
}
110+
111+
@Override
112+
public long getUsedBytes(StoragePool storagePool) {
113+
return 0;
114+
}
115+
116+
@Override
117+
public long getUsedIops(StoragePool storagePool) {
118+
return 0;
119+
}
120+
121+
@Override
122+
public void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CreateCmdResult> callback) {}
123+
124+
@Override
125+
public void revertSnapshot(SnapshotInfo snapshotOnImageStore, SnapshotInfo snapshotOnPrimaryStore, AsyncCompletionCallback<CommandResult> callback) {}
126+
127+
@Override
128+
public void handleQualityOfServiceForVolumeMigration(VolumeInfo volumeInfo, QualityOfServiceState qualityOfServiceState) {}
129+
130+
@Override
131+
public boolean canProvideStorageStats() {
132+
return false;
133+
}
134+
135+
@Override
136+
public Pair<Long, Long> getStorageStats(StoragePool storagePool) {
137+
return null;
138+
}
139+
140+
@Override
141+
public boolean canProvideVolumeStats() {
142+
return true;
143+
}
144+
145+
@Override
146+
public Pair<Long, Long> getVolumeStats(StoragePool storagePool, String volumeId) {
147+
return null;
148+
}
149+
150+
@Override
151+
public boolean canHostAccessStoragePool(Host host, StoragePool pool) {
152+
return true;
153+
}
154+
155+
@Override
156+
public boolean isVmInfoNeeded() {
157+
return true;
158+
}
159+
160+
@Override
161+
public void provideVmInfo(long vmId, long volumeId) {}
162+
163+
@Override
164+
public boolean isVmTagsNeeded(String tagKey) {
165+
return true;
166+
}
167+
168+
@Override
169+
public void provideVmTags(long vmId, long volumeId, String tagValue) {}
170+
171+
@Override
172+
public boolean isStorageSupportHA(Storage.StoragePoolType type) {
173+
return true;
174+
}
175+
176+
@Override
177+
public void detachVolumeFromAllStorageNodes(Volume volume) {}
178+
}

0 commit comments

Comments
 (0)