Skip to content

Commit c47dddf

Browse files
Gupta, SuryaGupta, Surya
authored andcommitted
[CSTACKEX-176] Bug Fixes
1 parent b988dd4 commit c47dddf

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public Volume createStorageVolume(String volumeName, Long size) {
263263
volumeRequest.setAggregates(List.of(aggr));
264264
volumeRequest.setSize(size);
265265
volumeRequest.setNas(nas);
266-
//volumeRequest.setGuarantee(new Volume.Guarantee(Volume.Guarantee.TypeEnum.NONE));
266+
volumeRequest.setGuarantee(new Volume.Guarantee(Volume.Guarantee.TypeEnum.NONE));
267267
try {
268268
JobResponse jobResponse = volumeFeignClient.createVolumeWithJob(authHeader, volumeRequest);
269269
if (jobResponse == null || jobResponse.getJob() == null) {

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/OntapStorageConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public class OntapStorageConstants {
9696
public static final String IGROUP_DOT_UUID = "igroup.uuid";
9797
public static final String UNDERSCORE = "_";
9898
public static final String CS = "cs";
99+
public static final int IGROUP_NAME_MAX_LENGTH = 96;
99100
public static final String SRC_CS_VOLUME_ID = "src_cs_volume_id";
100101
public static final String BASE_ONTAP_FV_ID = "base_ontap_fv_id";
101102
public static final String ONTAP_SNAP_ID = "ontap_snap_id";

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/OntapStorageUtils.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,12 @@ public static StorageStrategy getStrategyByStoragePoolDetails(Map<String, String
142142
public static String getIgroupName(String svmName, String hostUuid) {
143143
//Igroup name format: cs_svmName_hostUuid
144144
String sanitizedHostUuid = hostUuid.replaceAll("[^a-zA-Z0-9_-]", "_");
145-
return OntapStorageConstants.CS + OntapStorageConstants.UNDERSCORE + svmName + OntapStorageConstants.UNDERSCORE + sanitizedHostUuid;
145+
String igroupName = OntapStorageConstants.CS + OntapStorageConstants.UNDERSCORE + svmName + OntapStorageConstants.UNDERSCORE + sanitizedHostUuid;
146+
// ONTAP igroup names are limited to 96 characters; truncate if longer.
147+
if (igroupName.length() > OntapStorageConstants.IGROUP_NAME_MAX_LENGTH) {
148+
igroupName = igroupName.substring(0, OntapStorageConstants.IGROUP_NAME_MAX_LENGTH);
149+
}
150+
return igroupName;
146151
}
147152

148153
public static String generateExportPolicyName(String svmName, String volumeName){

0 commit comments

Comments
 (0)