From ae67a0f25d8c4fa2a2257d92f586a54828471ee6 Mon Sep 17 00:00:00 2001 From: "Jain, Rajiv" Date: Tue, 30 Jun 2026 18:44:35 +0530 Subject: [PATCH] CSTACKEX-209: addressing copilot comments --- plugins/storage/volume/ontap/pom.xml | 1 - .../lifecycle/OntapPrimaryDatastoreLifecycle.java | 12 +----------- .../storage/service/UnifiedNASStrategy.java | 2 -- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/plugins/storage/volume/ontap/pom.xml b/plugins/storage/volume/ontap/pom.xml index 12035f01d7f9..ce9b8683ebaf 100644 --- a/plugins/storage/volume/ontap/pom.xml +++ b/plugins/storage/volume/ontap/pom.xml @@ -164,7 +164,6 @@ ${maven-surefire-plugin.version} false - -javaagent:${settings.localRepository}/net/bytebuddy/byte-buddy-agent/${byte-buddy-agent.version}/byte-buddy-agent-${byte-buddy-agent.version}.jar **/*Test.java diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java index d7b89de25461..53e505b2fa74 100755 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java @@ -235,16 +235,6 @@ private long validateInitializeInputs(Long capacityBytes, Long podId, Long clust throw new CloudRuntimeException("Provider name is null or empty, cannot create primary storage"); } - PrimaryDataStoreParameters parameters = new PrimaryDataStoreParameters(); - if (clusterId != null) { - ClusterVO clusterVO = _clusterDao.findById(clusterId); - Preconditions.checkNotNull(clusterVO, "Unable to locate the specified cluster"); - if (clusterVO.getHypervisorType() != Hypervisor.HypervisorType.KVM) { - throw new CloudRuntimeException("ONTAP primary storage is supported only for KVM hypervisor"); - } - parameters.setHypervisorType(clusterVO.getHypervisorType()); - } - logger.debug("ONTAP primary storage will be created as " + (managed ? "managed" : "unmanaged")); if (!managed) { throw new CloudRuntimeException("ONTAP primary storage must be managed"); @@ -402,8 +392,8 @@ private boolean validateProtocolSupportAndFetchHostsIdentifier(List host } else { ip = ip.isEmpty() ? host.getPrivateIpAddress().trim() : ip; } + hostIdentifiers.add(ip); } - hostIdentifiers.add(ip); } break; default: diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java index 477e92630387..198957ca5db8 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java @@ -127,8 +127,6 @@ public CloudStackVolume getCloudStackVolume(Map cloudStackVolume cloudStackVolume = new CloudStackVolume(); cloudStackVolume.setFlexVolumeUuid(cloudStackVolumeMap.get(OntapStorageConstants.VOLUME_UUID)); cloudStackVolume.setFile(fileInfo); - } else { - logger.warn("getCloudStackVolume: File not found for volume UUID: {} and file path: {}", cloudStackVolumeMap.get(OntapStorageConstants.VOLUME_UUID), cloudStackVolumeMap.get(OntapStorageConstants.FILE_PATH)); } return cloudStackVolume;