Skip to content

Commit 0ceb7ed

Browse files
Gupta, SuryaGupta, Surya
authored andcommitted
[CSTACKEX-129] NFS3 Primary storage-pool is not failing even if NFS3 protocol is not enabled at the storage VM
1 parent 2f5908f commit 0ceb7ed

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

  • plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,31 +109,31 @@ public boolean connect() {
109109
logger.info("Fetching the SVM details...");
110110
Map<String, Object> queryParams = Map.of(OntapStorageConstants.NAME, svmName, OntapStorageConstants.FIELDS, OntapStorageConstants.AGGREGATES +
111111
OntapStorageConstants.COMMA + OntapStorageConstants.STATE +
112-
OntapStorageConstants.COMMA + OntapStorageConstants.NFS + OntapStorageConstants.COMMA + OntapStorageConstants.ISCSI);
112+
OntapStorageConstants.COMMA + OntapStorageConstants.NFS_ENABLED + OntapStorageConstants.COMMA + OntapStorageConstants.ISCSI_ENABLED);
113113
OntapResponse<Svm> svms = svmFeignClient.getSvmResponse(queryParams, authHeader);
114114
if (svms != null && svms.getRecords() != null && !svms.getRecords().isEmpty()) {
115115
svm = svms.getRecords().get(0);
116116
} else {
117117
logger.error("No SVM found on the ONTAP cluster by the name" + svmName + ".");
118-
return false;
118+
throw new CloudRuntimeException("No SVM found on the ONTAP cluster by the name" + svmName + ".");
119119
}
120120

121121
logger.info("Validating SVM state and protocol settings...");
122122
if (!Objects.equals(svm.getState(), OntapStorageConstants.RUNNING)) {
123123
logger.error("SVM " + svmName + " is not in running state.");
124-
return false;
124+
throw new CloudRuntimeException("SVM " + svmName + " is not in running state.");
125125
}
126126
if (Objects.equals(storage.getProtocol(), ProtocolType.NFS3) && !svm.getNfsEnabled()) {
127127
logger.error("NFS protocol is not enabled on SVM " + svmName);
128-
return false;
128+
throw new CloudRuntimeException("NFS protocol is not enabled on SVM " + svmName);
129129
} else if (Objects.equals(storage.getProtocol(), ProtocolType.ISCSI) && !svm.getIscsiEnabled()) {
130130
logger.error("iSCSI protocol is not enabled on SVM " + svmName);
131-
return false;
131+
throw new CloudRuntimeException("iSCSI protocol is not enabled on SVM " + svmName);
132132
}
133133
List<Aggregate> aggrs = svm.getAggregates();
134134
if (aggrs == null || aggrs.isEmpty()) {
135135
logger.error("No aggregates are assigned to SVM " + svmName);
136-
return false;
136+
throw new CloudRuntimeException("No aggregates are assigned to SVM " + svmName);
137137
}
138138
for (Aggregate aggr : aggrs) {
139139
logger.debug("Found aggregate: " + aggr.getName() + " with UUID: " + aggr.getUuid());

0 commit comments

Comments
 (0)