Skip to content

Commit 90e6d56

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
testing fix 3
1 parent d5e0728 commit 90e6d56

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import org.apache.cloudstack.storage.datastore.lifecycle.BasePrimaryDataStoreLifeCycleImpl;
4646
import org.apache.cloudstack.storage.feign.model.ExportPolicy;
4747
import org.apache.cloudstack.storage.feign.model.OntapStorage;
48+
import org.apache.cloudstack.storage.feign.model.Volume;
4849
import org.apache.cloudstack.storage.provider.StorageProviderFactory;
4950
import org.apache.cloudstack.storage.service.StorageStrategy;
5051
import org.apache.cloudstack.storage.service.model.AccessGroup;
@@ -220,6 +221,21 @@ public DataStore initialize(Map<String, Object> dsInfos) {
220221
}
221222
s_logger.info("Using Data LIF for storage access: " + dataLIF);
222223
details.put(Constants.DATA_LIF, dataLIF);
224+
s_logger.info("Creating ONTAP volume '" + storagePoolName + "' with size: " + volumeSize + " bytes (" +
225+
(volumeSize / (1024 * 1024 * 1024)) + " GB)");
226+
try {
227+
Volume volume = storageStrategy.createStorageVolume(storagePoolName, volumeSize);
228+
if (volume == null) {
229+
s_logger.error("createStorageVolume returned null for volume: " + storagePoolName);
230+
throw new CloudRuntimeException("Failed to create ONTAP volume: " + storagePoolName);
231+
}
232+
s_logger.info("Volume object retrieved successfully. UUID: " + volume.getUuid() + ", Name: " + volume.getName());
233+
details.putIfAbsent(Constants.VOLUME_UUID, volume.getUuid());
234+
details.putIfAbsent(Constants.VOLUME_NAME, volume.getName());
235+
} catch (Exception e) {
236+
s_logger.error("Exception occurred while creating ONTAP volume: " + storagePoolName, e);
237+
throw new CloudRuntimeException("Failed to create ONTAP volume: " + storagePoolName + ". Error: " + e.getMessage(), e);
238+
}
223239
} else {
224240
throw new CloudRuntimeException("ONTAP details validation failed, cannot create primary storage");
225241
}

0 commit comments

Comments
 (0)