Skip to content

Commit 9e8fe3e

Browse files
Gupta, SuryaGupta, Surya
authored andcommitted
[CSTACKEX-279] Resolved Review Comments
1 parent 29669a4 commit 9e8fe3e

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,10 @@ public boolean canCopy(DataObject srcData, DataObject destData) {
721721
return false;
722722
}
723723

724+
/**
725+
* Applies IOPS/QoS on resize. Capacity (LUN/file size) is not updated here.
726+
* TODO: apply volume size change once size-resize support is merged.
727+
*/
724728
@Override
725729
public void resize(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) {
726730
String errMsg = null;

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,13 @@ public boolean isAff() {
242242
Map<String, Object> query = new HashMap<>();
243243
query.put(OntapStorageConstants.FIELDS, OntapStorageConstants.CLUSTER_NODE_ASUP_FIELDS);
244244
OntapResponse<ClusterNode> response = clusterFeignClient.getClusterNodes(getAuthHeader(), query);
245-
if (response == null || response.getRecords() == null || response.getRecords().isEmpty()) {
245+
if (response == null || response.getRecords() == null
246+
|| response.getRecords().stream().allMatch(node -> node == null)) {
246247
throw new CloudRuntimeException(
247248
"Unable to determine whether the ONTAP cluster is AFF or FAS");
248249
}
249250
for (ClusterNode node : response.getRecords()) {
250-
if (node == null || Boolean.FALSE.equals(node.getAllFlashOptimized())) {
251+
if (node != null && Boolean.FALSE.equals(node.getAllFlashOptimized())) {
251252
return false;
252253
}
253254
}
@@ -1007,6 +1008,10 @@ public void deleteVolumeQosPolicy(String policyUuid) {
10071008
return;
10081009
}
10091010
VolumeQosPolicy policy = getVolumeQosPolicyByUuid(policyUuid);
1011+
if (policy == null) {
1012+
logger.info("QoS policy [{}] not found on ONTAP; skipping delete", policyUuid);
1013+
return;
1014+
}
10101015
if (policy.getObjectCount() != null && policy.getObjectCount() > 0) {
10111016
logger.info("QoS policy [{}] still has object_count={}; skipping delete",
10121017
policyUuid, policy.getObjectCount());

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ public void resizeCloudStackVolume(CloudStackVolume cloudstackVolume, long sizeI
313313
lunSpace.setSize(sizeInBytes);
314314
Lun patch = new Lun();
315315
patch.setSpace(lunSpace);
316-
sanFeignClient.updateLun(authHeader, lunUuid, patch);
316+
JobResponse response = sanFeignClient.updateLun(authHeader, lunUuid, patch);
317+
pollJobIfPresent(response, "resize Lun [" + lunUuid + "]");
317318
logger.debug("resizeCloudStackVolume: Lun {} resized to {} bytes", lunUuid, sizeInBytes);
318319
} catch (FeignException e) {
319320
throw new CloudRuntimeException("Failed to resize Lun: " + e.getMessage(), e);

0 commit comments

Comments
 (0)