Skip to content

Commit be44bb8

Browse files
Fixed merge conflicts and addressed comments
1 parent 86f252a commit be44bb8

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,6 @@ public DataStore initialize(Map<String, Object> dsInfos) {
140140
StorageStrategy storageStrategy = StorageProviderFactory.getStrategy(ontapStorage);
141141
boolean isValid = storageStrategy.connect();
142142
if (isValid) {
143-
// Get the DataLIF for data access
144-
String dataLIF = storageStrategy.getNetworkInterface();
145-
if (dataLIF == null || dataLIF.isEmpty()) {
146-
throw new CloudRuntimeException("Failed to retrieve Data LIF from ONTAP, cannot create primary storage");
147-
}
148-
logger.info("Using Data LIF for storage access: " + dataLIF);
149-
details.put(OntapStorageConstants.DATA_LIF, dataLIF);
150143
if (storageStrategy.getResolvedSvmUuid() != null && !storageStrategy.getResolvedSvmUuid().isEmpty()) {
151144
details.put(OntapStorageConstants.SVM_UUID, storageStrategy.getResolvedSvmUuid());
152145
}

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ private void validateAndSelectAggregatesForVolumeCreation(String authHeader, Str
232232
public Volume createStorageVolume(String volumeName, Long size) {
233233
logger.info("Creating volume: " + volumeName + " of size: " + size + " bytes");
234234

235+
this.chosenAggregateNode = null;
236+
235237
String svmName = storage.getSvmName();
236238
if (aggregates == null || aggregates.isEmpty()) {
237239
logger.error("No aggregates available to create volume on SVM " + svmName);
@@ -299,9 +301,7 @@ public Volume createStorageVolume(String volumeName, Long size) {
299301
}
300302
logger.info("Selected aggregate: " + aggrChosen.getName() + " for volume operations.");
301303

302-
if (aggrChosen.getNode() != null) {
303-
this.chosenAggregateNode = aggrChosen.getNode().getName();
304-
}
304+
this.chosenAggregateNode = aggrChosen.getNode() != null ? aggrChosen.getNode().getName() : null;
305305

306306
Aggregate aggr = new Aggregate();
307307
aggr.setName(aggrChosen.getName());
@@ -532,11 +532,14 @@ public Pair<String, String> getNetworkInterface() {
532532
continue;
533533
}
534534
if (chosenAggregateNode != null) {
535+
// LIF is homed on the aggregate's node
535536
String homeNode = iface.getLocation() != null && iface.getLocation().getHomeNode() != null
536537
? iface.getLocation().getHomeNode().getName() : null;
537538
if (chosenAggregateNode.equals(homeNode)) {
538539
return new Pair<>(iface.getIp().getAddress(), null);
539540
}
541+
// LIF has failed over and is currently running on the aggregate's node
542+
// (home_node differs). Keep as a candidate; returned with a warning if no match is found earlier.
540543
if (currentNodeInterface == null) {
541544
String currentNode = iface.getLocation() != null && iface.getLocation().getNode() != null
542545
? iface.getLocation().getNode().getName() : null;

0 commit comments

Comments
 (0)