From 188dd74ffd425d89587384f78c81bca88b41d2cb Mon Sep 17 00:00:00 2001 From: shravani Date: Mon, 9 Jun 2025 15:45:21 +0530 Subject: [PATCH 01/15] Fix for issue 8820 --- driver/csiplugin/controllerserver.go | 58 +++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index 7043394a1..6c2cfb9bb 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -278,6 +278,18 @@ func (cs *ScaleControllerServer) setQuota(ctx context.Context, scVol *scaleVolum } } + // changing volsize here for pvc size in decimal units to align with scale block size + filesystemname := scVol.VolBackendFs + klog.Info("Filesystemname", filesystemname) + filesystemdetails, err := cs.Driver.connmap["primary"].GetFilesystemDetails(ctx, filesystemname) + if err != nil { + klog.Errorf("Unable to get the filesystemdetails") + } + klog.Info("filesystem details", filesystemdetails) + blockinfo := filesystemdetails.Block.BlockSize + roundedblock := uint64(math.Floor(float64(scVol.VolSize) / float64(blockinfo))) + scVol.VolSize = roundedblock * uint64(blockinfo) + if filesetQuotaBytes != scVol.VolSize { var hardLimit, softLimit string hardLimit = strconv.FormatUint(scVol.VolSize, 10) @@ -1095,8 +1107,9 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C return &csi.CreateVolumeResponse{ Volume: &csi.Volume{ - VolumeId: volID, - CapacityBytes: int64(scaleVol.VolSize), // #nosec G115 -- false positive + VolumeId: volID, + //CapacityBytes: int64(scaleVol.VolSize), // #nosec G115 -- false positive + CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), VolumeContext: req.GetParameters(), ContentSource: volSrc, }, @@ -1176,7 +1189,20 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C if capRange == nil { return nil, status.Error(codes.InvalidArgument, "volume range is not provided") } - capacity := uint64(capRange.GetRequiredBytes()) // #nosec G115 -- false positive + // #nosec G115 -- false positive + // changing capacity here for pvc size in decimal units to align with scale block size + capacity := uint64(capRange.GetRequiredBytes()) + filesystemname := scaleVol.VolBackendFs + filesystemDetails, err := scaleVol.Connector.GetFilesystemDetails(ctx, filesystemname) + if err != nil { + klog.Errorf("[%s] Create Volume - unable to get filesystem details ", err) + return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume - unable to get filesystem details for Filesystem", err)) + } + blockinfo := filesystemDetails.Block.BlockSize + roundedblock := uint64(math.Floor(float64(capacity) / float64(blockinfo))) + capacity = roundedblock * uint64(blockinfo) + klog.Info("new capacity", capacity) + targetPath, err = cs.createStaticBasedVol(ctx, scaleVol, filesetName, capacity) } else if scaleVol.IsFilesetBased { targetPath, err = cs.createFilesetBasedVol(ctx, scaleVol, isCGVolume, volFsInfo.Type, req.Secrets, afmTuningParams, gatewayNodeName) @@ -1230,8 +1256,9 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C return &csi.CreateVolumeResponse{ Volume: &csi.Volume{ - VolumeId: volID, - CapacityBytes: int64(scaleVol.VolSize), // #nosec G115 -- false positive + VolumeId: volID, + //CapacityBytes: int64(scaleVol.VolSize) // #nosec G115 -- false positive + CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), VolumeContext: req.GetParameters(), ContentSource: volSrc, }, @@ -1368,6 +1395,18 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr isCGVolume = true } scaleVol.VolName = volName + // changing capacity here for pvc size in decimal units to align with scale block size + //getting the filesystemname + filesystemname := scaleVol.VolBackendFs + klog.Info("Filesystemname", filesystemname) + filesystemdetails, err := cs.Driver.connmap["primary"].GetFilesystemDetails(ctx, filesystemname) + if err != nil { + klog.Errorf("Unable to get the filesystemdetails") + } + klog.Info("filesystem details", filesystemdetails) + blockinfo := filesystemdetails.Block.BlockSize + roundedblock := int64(math.Floor(float64(volSize) / float64(blockinfo))) + volSize = roundedblock * int64(blockinfo) // #nosec G115 -- false positive if uint64(volSize) > maximumPVSize { // larger than allowed pv size not allowed @@ -4019,6 +4058,15 @@ func (cs *ScaleControllerServer) ControllerExpandVolume(ctx context.Context, req klog.Errorf("[%s] ControllerExpandVolume - unable to get filesystem Name for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", loggerId, volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err) return nil, status.Error(codes.Internal, fmt.Sprintf("ControllerExpandVolume - unable to get filesystem Name for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err)) } + // changing capacity here for pvc size in decimal units to align with scale block size + filesystemdetails, err := conn.GetFilesystemDetails(ctx, filesystemName) + if err != nil { + klog.Errorf("[%s] ControllerExpandVolume - unable to get filesystem details for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", loggerId, volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err) + return nil, status.Error(codes.Internal, fmt.Sprintf("ControllerExpandVolume - unable to get filesystem details for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err)) + } + blockinfo := filesystemdetails.Block.BlockSize + roundedblock := uint64(math.Floor(float64(capacity) / float64(blockinfo))) + capacity = roundedblock * uint64(blockinfo) filesetName := volumeIDMembers.FsetName From 5178766686c59574e58f1fffe6b3d059d6f33bfa Mon Sep 17 00:00:00 2001 From: shravani Date: Mon, 9 Jun 2025 23:13:07 +0530 Subject: [PATCH 02/15] addressing the review comments Signed-off-by: shravani --- driver/csiplugin/controllerserver.go | 155 ++++++++++++++------------- 1 file changed, 80 insertions(+), 75 deletions(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index 6c2cfb9bb..8220efc02 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -73,9 +73,10 @@ type ScaleControllerServer struct { func (cs *ScaleControllerServer) IfSameVolReqInProcess(scVol *scaleVolume) (bool, error) { capacity, volpresent := cs.Driver.reqmap[scVol.VolName] + if volpresent { /* #nosec G115 -- false positive */ - if capacity == int64(scVol.VolSize) { + if int64(scVol.VolSize) == capacity { return true, nil } else { return false, status.Error(codes.Internal, fmt.Sprintf("Volume %v present in map but requested size %v does not match with size %v in map", scVol.VolName, scVol.VolSize, capacity)) @@ -269,6 +270,7 @@ func (cs *ScaleControllerServer) setQuota(ctx context.Context, scVol *scaleVolum } filesetQuotaBytes, err := ConvertToBytes(quota) + if err != nil { if strings.Contains(err.Error(), "invalid number specified") { // Invalid number specified means quota is not set @@ -279,16 +281,16 @@ func (cs *ScaleControllerServer) setQuota(ctx context.Context, scVol *scaleVolum } // changing volsize here for pvc size in decimal units to align with scale block size - filesystemname := scVol.VolBackendFs - klog.Info("Filesystemname", filesystemname) - filesystemdetails, err := cs.Driver.connmap["primary"].GetFilesystemDetails(ctx, filesystemname) - if err != nil { - klog.Errorf("Unable to get the filesystemdetails") - } - klog.Info("filesystem details", filesystemdetails) - blockinfo := filesystemdetails.Block.BlockSize - roundedblock := uint64(math.Floor(float64(scVol.VolSize) / float64(blockinfo))) - scVol.VolSize = roundedblock * uint64(blockinfo) + // filesystemName := scVol.VolBackendFs + // klog.Info("Filesystemname", filesystemName) + // filesystemDetails, err := scVol.Connector.GetFilesystemDetails(ctx, filesystemName) + // if err != nil { + // klog.Errorf("Unable to get the filesystemdetails") + // } + // klog.Info("filesystem details", filesystemDetails) + // blockInfo := filesystemDetails.Block.BlockSize + // roundedBlock := uint64(math.Floor(float64(scVol.VolSize) / float64(blockInfo))) + // scVol.VolSize = roundedBlock * uint64(blockInfo) if filesetQuotaBytes != scVol.VolSize { var hardLimit, softLimit string @@ -676,6 +678,8 @@ func (cs *ScaleControllerServer) createFilesetVol(ctx context.Context, scVol *sc } } targetBasePath := "" + // changing the quota + if !isCGIndependentFset { if scVol.VolSize != 0 { err = cs.setQuota(ctx, scVol, volName) @@ -738,7 +742,8 @@ func handleUpdateComment(ctx context.Context, scVol *scaleVolume, setAfmAttribut func (cs *ScaleControllerServer) getVolumeSizeInBytes(req *csi.CreateVolumeRequest) int64 { capacity := req.GetCapacityRange() - return capacity.GetRequiredBytes() + requiredBytes := capacity.GetRequiredBytes() + return requiredBytes } func updateComment(ctx context.Context, scVol *scaleVolume, setAfmAttributes bool, afmTuningParams map[string]interface{}) error { @@ -917,7 +922,6 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C /* Get volume size in bytes */ volSize := cs.getVolumeSizeInBytes(req) - reqCapabilities := req.GetVolumeCapabilities() if reqCapabilities == nil { return nil, status.Error(codes.InvalidArgument, "Volume Capabilities is a required field") @@ -1109,7 +1113,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C Volume: &csi.Volume{ VolumeId: volID, //CapacityBytes: int64(scaleVol.VolSize), // #nosec G115 -- false positive - CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), + CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), // #nosec G115 -- false positive VolumeContext: req.GetParameters(), ContentSource: volSrc, }, @@ -1189,19 +1193,19 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C if capRange == nil { return nil, status.Error(codes.InvalidArgument, "volume range is not provided") } - // #nosec G115 -- false positive + // changing capacity here for pvc size in decimal units to align with scale block size - capacity := uint64(capRange.GetRequiredBytes()) - filesystemname := scaleVol.VolBackendFs - filesystemDetails, err := scaleVol.Connector.GetFilesystemDetails(ctx, filesystemname) - if err != nil { - klog.Errorf("[%s] Create Volume - unable to get filesystem details ", err) - return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume - unable to get filesystem details for Filesystem", err)) - } - blockinfo := filesystemDetails.Block.BlockSize - roundedblock := uint64(math.Floor(float64(capacity) / float64(blockinfo))) - capacity = roundedblock * uint64(blockinfo) - klog.Info("new capacity", capacity) + capacity := uint64(capRange.GetRequiredBytes()) // #nosec G115 -- false positive + // filesystemName := scaleVol.VolBackendFs + // filesystemDetails, err := scaleVol.Connector.GetFilesystemDetails(ctx, filesystemName) + // if err != nil { + // klog.Errorf("[%s] Create Volume - unable to get filesystem details ", err) + // return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume - unable to get filesystem details for Filesystem", err)) + // } + // blockinfo := filesystemDetails.Block.BlockSize + // roundedblock := uint64(math.Floor(float64(capacity) / float64(blockinfo))) + // capacity = roundedblock * uint64(blockinfo) + // klog.Info("new capacity", capacity) targetPath, err = cs.createStaticBasedVol(ctx, scaleVol, filesetName, capacity) } else if scaleVol.IsFilesetBased { @@ -1258,7 +1262,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C Volume: &csi.Volume{ VolumeId: volID, //CapacityBytes: int64(scaleVol.VolSize) // #nosec G115 -- false positive - CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), + CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), // #nosec G115 -- false positive VolumeContext: req.GetParameters(), ContentSource: volSrc, }, @@ -1397,16 +1401,17 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr scaleVol.VolName = volName // changing capacity here for pvc size in decimal units to align with scale block size //getting the filesystemname - filesystemname := scaleVol.VolBackendFs - klog.Info("Filesystemname", filesystemname) - filesystemdetails, err := cs.Driver.connmap["primary"].GetFilesystemDetails(ctx, filesystemname) + filesystemName := scaleVol.VolBackendFs + klog.Info("Filesystemname", filesystemName) + filesystemDetails, err := scaleVol.Connector.GetFilesystemDetails(ctx, filesystemName) if err != nil { klog.Errorf("Unable to get the filesystemdetails") + return nil, false, "", status.Error(codes.Internal, fmt.Sprintf("unable to get filesystem details for Filesystem %s. Error: %v", filesystemName, err)) } - klog.Info("filesystem details", filesystemdetails) - blockinfo := filesystemdetails.Block.BlockSize - roundedblock := int64(math.Floor(float64(volSize) / float64(blockinfo))) - volSize = roundedblock * int64(blockinfo) + klog.V(4).Infof("[%s] filesystemDetails: %+v", utils.GetLoggerId(ctx), filesystemDetails) + blockInfo := filesystemDetails.Block.BlockSize + roundedBlock := int64(math.Floor(float64(volSize) / float64(blockInfo))) + volSize = roundedBlock * int64(blockInfo) // #nosec G115 -- false positive if uint64(volSize) > maximumPVSize { // larger than allowed pv size not allowed @@ -1418,6 +1423,7 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr scaleVol.VolSize = smallestVolSize } else { scaleVol.VolSize = uint64(volSize) // #nosec G115 -- false positive + } /* Get details for Primary Cluster */ @@ -2040,18 +2046,18 @@ func (cs *ScaleControllerServer) checkCacheVolumeSupport(assembledScaleversion s } /*func (cs *ScaleControllerServer) checkGuiHASupport(ctx context.Context, conn connectors.SpectrumScaleConnector) error { - // Verify IBM Storage Scale Version is not below 5.1.5-0 + // Verify IBM Storage Scale Version is not below 5.1.5-0 - versionCheck, err := cs.checkMinScaleVersion(ctx, conn, "5150") - if err != nil { - return err - } + versionCheck, err := cs.checkMinScaleVersion(ctx, conn, "5150") + if err != nil { + return err + } - if !versionCheck { - return status.Error(codes.FailedPrecondition, "the minimum required IBM Storage Scale version for GUI HA support with CSI is 5.1.5-0") - } - return nil - }*/ + if !versionCheck { + return status.Error(codes.FailedPrecondition, "the minimum required IBM Storage Scale version for GUI HA support with CSI is 5.1.5-0") + } + return nil + }*/ func (cs *ScaleControllerServer) validateSnapId(ctx context.Context, scaleVol *scaleVolume, sourcesnapshot *scaleSnapId, newvolume *scaleVolume, assembledScaleversion string) error { @@ -2112,12 +2118,12 @@ func (cs *ScaleControllerServer) validateSnapId(ctx context.Context, scaleVol *s filesetToCheck = sourcesnapshot.ConsistencyGroup } /*isFsetLinked, err := conn.IsFilesetLinked(ctx, sourcesnapshot.FsName, filesetToCheck) - if err != nil { - return status.Error(codes.Internal, fmt.Sprintf("unable to get fileset link information for [%v]", filesetToCheck)) - } - if !isFsetLinked { - return status.Error(codes.Internal, fmt.Sprintf("fileset [%v] of source snapshot is not linked", filesetToCheck)) - }*/ + if err != nil { + return status.Error(codes.Internal, fmt.Sprintf("unable to get fileset link information for [%v]", filesetToCheck)) + } + if !isFsetLinked { + return status.Error(codes.Internal, fmt.Sprintf("fileset [%v] of source snapshot is not linked", filesetToCheck)) + }*/ err = cs.checkFileSetLink(ctx, conn, scaleVol, sourcesnapshot.FsName, filesetToCheck, "source snapshot") if err != nil { @@ -2416,18 +2422,18 @@ func (cs *ScaleControllerServer) DeleteFilesetVol(ctx context.Context, Filesyste } /* err := conn.UnlinkFileset(ctx, FilesystemName, FilesetName, false) - if err != nil { - if strings.Contains(err.Error(), fsetNotFoundErrCode) || - strings.Contains(err.Error(), fsetNotFoundErrMsg) { // fileset is already deleted - klog.V(4).Infof("[%s] fileset seems already deleted - %v", loggerId, err) - return true, nil - } else if strings.Contains(err.Error(), fsetLinkNotFoundErrCode) || - strings.Contains(err.Error(), fsetLinkNotFoundErrMsg) { // fileset is already unlinked - klog.V(4).Infof("[%s] fileset seems already unlinked - %v", loggerId, err) - } else { - return false, status.Error(codes.Internal, fmt.Sprintf("unable to unlink Fileset [%v] for FS [%v] and clusterId [%v].Error : [%v]", FilesetName, FilesystemName, volumeIdMembers.ClusterId, err)) - } - }*/ + if err != nil { + if strings.Contains(err.Error(), fsetNotFoundErrCode) || + strings.Contains(err.Error(), fsetNotFoundErrMsg) { // fileset is already deleted + klog.V(4).Infof("[%s] fileset seems already deleted - %v", loggerId, err) + return true, nil + } else if strings.Contains(err.Error(), fsetLinkNotFoundErrCode) || + strings.Contains(err.Error(), fsetLinkNotFoundErrMsg) { // fileset is already unlinked + klog.V(4).Infof("[%s] fileset seems already unlinked - %v", loggerId, err) + } else { + return false, status.Error(codes.Internal, fmt.Sprintf("unable to unlink Fileset [%v] for FS [%v] and clusterId [%v].Error : [%v]", FilesetName, FilesystemName, volumeIdMembers.ClusterId, err)) + } + }*/ err := conn.DeleteFileset(ctx, FilesystemName, FilesetName) if err != nil { @@ -2653,14 +2659,14 @@ func (cs *ScaleControllerServer) DeleteVolume(newctx context.Context, req *csi.D pfsName := "" // getting the primary filesystem name from the path when primary fs is not provided in the cr and pvc is older /* if symlinkExists && ifPrimaryDisable { - parts := strings.Split(volumeIdMembers.Path, "/") - for i, part := range parts { - if part == ".volumes" && i >= 2 { - pfsName = parts[i-2] - klog.Infof("[%s] DeleteVolume :primary fs from path is [%v]", loggerId, pfsName) - } - } - }*/ + parts := strings.Split(volumeIdMembers.Path, "/") + for i, part := range parts { + if part == ".volumes" && i >= 2 { + pfsName = parts[i-2] + klog.Infof("[%s] DeleteVolume :primary fs from path is [%v]", loggerId, pfsName) + } + } + }*/ relPath := "" if volumeIdMembers.StorageClassType != STORAGECLASS_CLASSIC || volumeIdMembers.VolType == FILE_SHALLOWCOPY_VOLUME || !symlinkExists { @@ -4022,7 +4028,6 @@ func (cs *ScaleControllerServer) ControllerExpandVolume(ctx context.Context, req return nil, status.Error(codes.InvalidArgument, "capacity range not provided") } capacity := uint64(capRange.GetRequiredBytes()) // #nosec G115 -- false positive - volumeIDMembers, err := getVolIDMembers(volID) if err != nil { @@ -4059,14 +4064,14 @@ func (cs *ScaleControllerServer) ControllerExpandVolume(ctx context.Context, req return nil, status.Error(codes.Internal, fmt.Sprintf("ControllerExpandVolume - unable to get filesystem Name for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err)) } // changing capacity here for pvc size in decimal units to align with scale block size - filesystemdetails, err := conn.GetFilesystemDetails(ctx, filesystemName) + filesystemDetails, err := conn.GetFilesystemDetails(ctx, filesystemName) if err != nil { klog.Errorf("[%s] ControllerExpandVolume - unable to get filesystem details for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", loggerId, volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err) return nil, status.Error(codes.Internal, fmt.Sprintf("ControllerExpandVolume - unable to get filesystem details for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err)) } - blockinfo := filesystemdetails.Block.BlockSize - roundedblock := uint64(math.Floor(float64(capacity) / float64(blockinfo))) - capacity = roundedblock * uint64(blockinfo) + blockInfo := filesystemDetails.Block.BlockSize + roundedBlock := uint64(math.Floor(float64(capacity) / float64(blockInfo))) + capacity = roundedBlock * uint64(blockInfo) filesetName := volumeIDMembers.FsetName From aa3e1af09e67dc8de14c89374571375181a0b030 Mon Sep 17 00:00:00 2001 From: shravani Date: Tue, 10 Jun 2025 00:00:48 +0530 Subject: [PATCH 03/15] latest code as per reviwers comments Signed-off-by: shravani --- driver/csiplugin/controllerserver.go | 37 +++------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index 8220efc02..45971b40e 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -76,7 +76,7 @@ func (cs *ScaleControllerServer) IfSameVolReqInProcess(scVol *scaleVolume) (bool if volpresent { /* #nosec G115 -- false positive */ - if int64(scVol.VolSize) == capacity { + if capacity == int64(scVol.VolSize) { return true, nil } else { return false, status.Error(codes.Internal, fmt.Sprintf("Volume %v present in map but requested size %v does not match with size %v in map", scVol.VolName, scVol.VolSize, capacity)) @@ -270,7 +270,6 @@ func (cs *ScaleControllerServer) setQuota(ctx context.Context, scVol *scaleVolum } filesetQuotaBytes, err := ConvertToBytes(quota) - if err != nil { if strings.Contains(err.Error(), "invalid number specified") { // Invalid number specified means quota is not set @@ -280,18 +279,6 @@ func (cs *ScaleControllerServer) setQuota(ctx context.Context, scVol *scaleVolum } } - // changing volsize here for pvc size in decimal units to align with scale block size - // filesystemName := scVol.VolBackendFs - // klog.Info("Filesystemname", filesystemName) - // filesystemDetails, err := scVol.Connector.GetFilesystemDetails(ctx, filesystemName) - // if err != nil { - // klog.Errorf("Unable to get the filesystemdetails") - // } - // klog.Info("filesystem details", filesystemDetails) - // blockInfo := filesystemDetails.Block.BlockSize - // roundedBlock := uint64(math.Floor(float64(scVol.VolSize) / float64(blockInfo))) - // scVol.VolSize = roundedBlock * uint64(blockInfo) - if filesetQuotaBytes != scVol.VolSize { var hardLimit, softLimit string hardLimit = strconv.FormatUint(scVol.VolSize, 10) @@ -678,8 +665,6 @@ func (cs *ScaleControllerServer) createFilesetVol(ctx context.Context, scVol *sc } } targetBasePath := "" - // changing the quota - if !isCGIndependentFset { if scVol.VolSize != 0 { err = cs.setQuota(ctx, scVol, volName) @@ -742,8 +727,7 @@ func handleUpdateComment(ctx context.Context, scVol *scaleVolume, setAfmAttribut func (cs *ScaleControllerServer) getVolumeSizeInBytes(req *csi.CreateVolumeRequest) int64 { capacity := req.GetCapacityRange() - requiredBytes := capacity.GetRequiredBytes() - return requiredBytes + return capacity.GetRequiredBytes() } func updateComment(ctx context.Context, scVol *scaleVolume, setAfmAttributes bool, afmTuningParams map[string]interface{}) error { @@ -1111,8 +1095,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C return &csi.CreateVolumeResponse{ Volume: &csi.Volume{ - VolumeId: volID, - //CapacityBytes: int64(scaleVol.VolSize), // #nosec G115 -- false positive + VolumeId: volID, CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), // #nosec G115 -- false positive VolumeContext: req.GetParameters(), ContentSource: volSrc, @@ -1194,18 +1177,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C return nil, status.Error(codes.InvalidArgument, "volume range is not provided") } - // changing capacity here for pvc size in decimal units to align with scale block size capacity := uint64(capRange.GetRequiredBytes()) // #nosec G115 -- false positive - // filesystemName := scaleVol.VolBackendFs - // filesystemDetails, err := scaleVol.Connector.GetFilesystemDetails(ctx, filesystemName) - // if err != nil { - // klog.Errorf("[%s] Create Volume - unable to get filesystem details ", err) - // return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume - unable to get filesystem details for Filesystem", err)) - // } - // blockinfo := filesystemDetails.Block.BlockSize - // roundedblock := uint64(math.Floor(float64(capacity) / float64(blockinfo))) - // capacity = roundedblock * uint64(blockinfo) - // klog.Info("new capacity", capacity) targetPath, err = cs.createStaticBasedVol(ctx, scaleVol, filesetName, capacity) } else if scaleVol.IsFilesetBased { @@ -1260,8 +1232,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C return &csi.CreateVolumeResponse{ Volume: &csi.Volume{ - VolumeId: volID, - //CapacityBytes: int64(scaleVol.VolSize) // #nosec G115 -- false positive + VolumeId: volID, CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), // #nosec G115 -- false positive VolumeContext: req.GetParameters(), ContentSource: volSrc, From 7365f7f44be70702acd84e7bd78de1fdc2657df2 Mon Sep 17 00:00:00 2001 From: shravani Date: Tue, 10 Jun 2025 00:11:43 +0530 Subject: [PATCH 04/15] solving the formatting issues Signed-off-by: shravani --- driver/csiplugin/controllerserver.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index 45971b40e..d26f63c9a 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -73,7 +73,6 @@ type ScaleControllerServer struct { func (cs *ScaleControllerServer) IfSameVolReqInProcess(scVol *scaleVolume) (bool, error) { capacity, volpresent := cs.Driver.reqmap[scVol.VolName] - if volpresent { /* #nosec G115 -- false positive */ if capacity == int64(scVol.VolSize) { @@ -906,6 +905,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C /* Get volume size in bytes */ volSize := cs.getVolumeSizeInBytes(req) + reqCapabilities := req.GetVolumeCapabilities() if reqCapabilities == nil { return nil, status.Error(codes.InvalidArgument, "Volume Capabilities is a required field") @@ -1176,9 +1176,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C if capRange == nil { return nil, status.Error(codes.InvalidArgument, "volume range is not provided") } - capacity := uint64(capRange.GetRequiredBytes()) // #nosec G115 -- false positive - targetPath, err = cs.createStaticBasedVol(ctx, scaleVol, filesetName, capacity) } else if scaleVol.IsFilesetBased { targetPath, err = cs.createFilesetBasedVol(ctx, scaleVol, isCGVolume, volFsInfo.Type, req.Secrets, afmTuningParams, gatewayNodeName) @@ -1394,7 +1392,6 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr scaleVol.VolSize = smallestVolSize } else { scaleVol.VolSize = uint64(volSize) // #nosec G115 -- false positive - } /* Get details for Primary Cluster */ From c80a271c3a0d2fe01ec6c49963b017658fe8a794 Mon Sep 17 00:00:00 2001 From: shravani Date: Tue, 10 Jun 2025 01:08:05 +0530 Subject: [PATCH 05/15] changing the setScaleVolume() Signed-off-by: shravani --- driver/csiplugin/controllerserver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index d26f63c9a..e79b1d4e9 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -1372,7 +1372,7 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr //getting the filesystemname filesystemName := scaleVol.VolBackendFs klog.Info("Filesystemname", filesystemName) - filesystemDetails, err := scaleVol.Connector.GetFilesystemDetails(ctx, filesystemName) + filesystemDetails, err := cs.Driver.connmap["primary"].GetFilesystemDetails(ctx, filesystemName) if err != nil { klog.Errorf("Unable to get the filesystemdetails") return nil, false, "", status.Error(codes.Internal, fmt.Sprintf("unable to get filesystem details for Filesystem %s. Error: %v", filesystemName, err)) @@ -4035,7 +4035,7 @@ func (cs *ScaleControllerServer) ControllerExpandVolume(ctx context.Context, req filesystemDetails, err := conn.GetFilesystemDetails(ctx, filesystemName) if err != nil { klog.Errorf("[%s] ControllerExpandVolume - unable to get filesystem details for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", loggerId, volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err) - return nil, status.Error(codes.Internal, fmt.Sprintf("ControllerExpandVolume - unable to get filesystem details for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err)) + return nil, status.Error(codes.Internal, fmt.Sprintf("ControllerExpandVolume - unable to get filesystem details for Filesystem [%v] Error [%v]", filesystemName, err)) } blockInfo := filesystemDetails.Block.BlockSize roundedBlock := uint64(math.Floor(float64(capacity) / float64(blockInfo))) From dc29e00ecf0623d6d3ccff3eca882b8166f8963b Mon Sep 17 00:00:00 2001 From: shravani Date: Tue, 10 Jun 2025 15:32:26 +0530 Subject: [PATCH 06/15] cheking the git sign off flag Signed-off-by: shravani --- driver/csiplugin/controllerserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index e79b1d4e9..984424a0a 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -1368,7 +1368,7 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr isCGVolume = true } scaleVol.VolName = volName - // changing capacity here for pvc size in decimal units to align with scale block size + // changing capacity here for pvc size in decimal units to align with scale block size of filesystem //getting the filesystemname filesystemName := scaleVol.VolBackendFs klog.Info("Filesystemname", filesystemName) From 3f178f5a7717787ba5fefdb433441bf8cc3cecc9 Mon Sep 17 00:00:00 2001 From: shravani Date: Tue, 10 Jun 2025 16:46:00 +0530 Subject: [PATCH 07/15] returning logger id for filesystem details Signed-off-by: shravani --- driver/csiplugin/controllerserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index 984424a0a..428b27c80 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -1374,7 +1374,7 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr klog.Info("Filesystemname", filesystemName) filesystemDetails, err := cs.Driver.connmap["primary"].GetFilesystemDetails(ctx, filesystemName) if err != nil { - klog.Errorf("Unable to get the filesystemdetails") + klog.Errorf("%s Unable to get the filesystemdetails for Filesystem %s. Error: %v", utils.GetLoggerId(ctx), filesystemName, err) return nil, false, "", status.Error(codes.Internal, fmt.Sprintf("unable to get filesystem details for Filesystem %s. Error: %v", filesystemName, err)) } klog.V(4).Infof("[%s] filesystemDetails: %+v", utils.GetLoggerId(ctx), filesystemDetails) From 3c94619ad05d73b9d5fa938fec53761ef70f540a Mon Sep 17 00:00:00 2001 From: shravani Date: Mon, 9 Jun 2025 15:45:21 +0530 Subject: [PATCH 08/15] Fix for issue 8820 --- driver/csiplugin/controllerserver.go | 58 +++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index ab8c201ee..cedd354bc 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -278,6 +278,18 @@ func (cs *ScaleControllerServer) setQuota(ctx context.Context, scVol *scaleVolum } } + // changing volsize here for pvc size in decimal units to align with scale block size + filesystemname := scVol.VolBackendFs + klog.Info("Filesystemname", filesystemname) + filesystemdetails, err := cs.Driver.connmap["primary"].GetFilesystemDetails(ctx, filesystemname) + if err != nil { + klog.Errorf("Unable to get the filesystemdetails") + } + klog.Info("filesystem details", filesystemdetails) + blockinfo := filesystemdetails.Block.BlockSize + roundedblock := uint64(math.Floor(float64(scVol.VolSize) / float64(blockinfo))) + scVol.VolSize = roundedblock * uint64(blockinfo) + if filesetQuotaBytes != scVol.VolSize { var hardLimit, softLimit string hardLimit = strconv.FormatUint(scVol.VolSize, 10) @@ -1095,8 +1107,9 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C return &csi.CreateVolumeResponse{ Volume: &csi.Volume{ - VolumeId: volID, - CapacityBytes: int64(scaleVol.VolSize), // #nosec G115 -- false positive + VolumeId: volID, + //CapacityBytes: int64(scaleVol.VolSize), // #nosec G115 -- false positive + CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), VolumeContext: req.GetParameters(), ContentSource: volSrc, }, @@ -1176,7 +1189,20 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C if capRange == nil { return nil, status.Error(codes.InvalidArgument, "volume range is not provided") } - capacity := uint64(capRange.GetRequiredBytes()) // #nosec G115 -- false positive + // #nosec G115 -- false positive + // changing capacity here for pvc size in decimal units to align with scale block size + capacity := uint64(capRange.GetRequiredBytes()) + filesystemname := scaleVol.VolBackendFs + filesystemDetails, err := scaleVol.Connector.GetFilesystemDetails(ctx, filesystemname) + if err != nil { + klog.Errorf("[%s] Create Volume - unable to get filesystem details ", err) + return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume - unable to get filesystem details for Filesystem", err)) + } + blockinfo := filesystemDetails.Block.BlockSize + roundedblock := uint64(math.Floor(float64(capacity) / float64(blockinfo))) + capacity = roundedblock * uint64(blockinfo) + klog.Info("new capacity", capacity) + targetPath, err = cs.createStaticBasedVol(ctx, scaleVol, filesetName, capacity) } else if scaleVol.IsFilesetBased { targetPath, err = cs.createFilesetBasedVol(ctx, scaleVol, isCGVolume, volFsInfo.Type, req.Secrets, afmTuningParams, gatewayNodeName) @@ -1230,8 +1256,9 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C return &csi.CreateVolumeResponse{ Volume: &csi.Volume{ - VolumeId: volID, - CapacityBytes: int64(scaleVol.VolSize), // #nosec G115 -- false positive + VolumeId: volID, + //CapacityBytes: int64(scaleVol.VolSize) // #nosec G115 -- false positive + CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), VolumeContext: req.GetParameters(), ContentSource: volSrc, }, @@ -1368,6 +1395,18 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr isCGVolume = true } scaleVol.VolName = volName + // changing capacity here for pvc size in decimal units to align with scale block size + //getting the filesystemname + filesystemname := scaleVol.VolBackendFs + klog.Info("Filesystemname", filesystemname) + filesystemdetails, err := cs.Driver.connmap["primary"].GetFilesystemDetails(ctx, filesystemname) + if err != nil { + klog.Errorf("Unable to get the filesystemdetails") + } + klog.Info("filesystem details", filesystemdetails) + blockinfo := filesystemdetails.Block.BlockSize + roundedblock := int64(math.Floor(float64(volSize) / float64(blockinfo))) + volSize = roundedblock * int64(blockinfo) // #nosec G115 -- false positive if uint64(volSize) > maximumPVSize { // larger than allowed pv size not allowed @@ -3923,6 +3962,15 @@ func (cs *ScaleControllerServer) ControllerExpandVolume(ctx context.Context, req klog.Errorf("[%s] ControllerExpandVolume - unable to get filesystem Name for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", loggerId, volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err) return nil, status.Error(codes.Internal, fmt.Sprintf("ControllerExpandVolume - unable to get filesystem Name for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err)) } + // changing capacity here for pvc size in decimal units to align with scale block size + filesystemdetails, err := conn.GetFilesystemDetails(ctx, filesystemName) + if err != nil { + klog.Errorf("[%s] ControllerExpandVolume - unable to get filesystem details for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", loggerId, volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err) + return nil, status.Error(codes.Internal, fmt.Sprintf("ControllerExpandVolume - unable to get filesystem details for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err)) + } + blockinfo := filesystemdetails.Block.BlockSize + roundedblock := uint64(math.Floor(float64(capacity) / float64(blockinfo))) + capacity = roundedblock * uint64(blockinfo) filesetName := volumeIDMembers.FsetName From 035fd308106f3c95e91e3fe2ed1dea88c0f72320 Mon Sep 17 00:00:00 2001 From: shravani Date: Mon, 9 Jun 2025 23:13:07 +0530 Subject: [PATCH 09/15] addressing the review comments Signed-off-by: shravani --- driver/csiplugin/controllerserver.go | 155 ++++++++++++++------------- 1 file changed, 80 insertions(+), 75 deletions(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index cedd354bc..4c442a4fb 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -73,9 +73,10 @@ type ScaleControllerServer struct { func (cs *ScaleControllerServer) IfSameVolReqInProcess(scVol *scaleVolume) (bool, error) { capacity, volpresent := cs.Driver.reqmap[scVol.VolName] + if volpresent { /* #nosec G115 -- false positive */ - if capacity == int64(scVol.VolSize) { + if int64(scVol.VolSize) == capacity { return true, nil } else { return false, status.Error(codes.Internal, fmt.Sprintf("Volume %v present in map but requested size %v does not match with size %v in map", scVol.VolName, scVol.VolSize, capacity)) @@ -269,6 +270,7 @@ func (cs *ScaleControllerServer) setQuota(ctx context.Context, scVol *scaleVolum } filesetQuotaBytes, err := ConvertToBytes(quota) + if err != nil { if strings.Contains(err.Error(), "invalid number specified") { // Invalid number specified means quota is not set @@ -279,16 +281,16 @@ func (cs *ScaleControllerServer) setQuota(ctx context.Context, scVol *scaleVolum } // changing volsize here for pvc size in decimal units to align with scale block size - filesystemname := scVol.VolBackendFs - klog.Info("Filesystemname", filesystemname) - filesystemdetails, err := cs.Driver.connmap["primary"].GetFilesystemDetails(ctx, filesystemname) - if err != nil { - klog.Errorf("Unable to get the filesystemdetails") - } - klog.Info("filesystem details", filesystemdetails) - blockinfo := filesystemdetails.Block.BlockSize - roundedblock := uint64(math.Floor(float64(scVol.VolSize) / float64(blockinfo))) - scVol.VolSize = roundedblock * uint64(blockinfo) + // filesystemName := scVol.VolBackendFs + // klog.Info("Filesystemname", filesystemName) + // filesystemDetails, err := scVol.Connector.GetFilesystemDetails(ctx, filesystemName) + // if err != nil { + // klog.Errorf("Unable to get the filesystemdetails") + // } + // klog.Info("filesystem details", filesystemDetails) + // blockInfo := filesystemDetails.Block.BlockSize + // roundedBlock := uint64(math.Floor(float64(scVol.VolSize) / float64(blockInfo))) + // scVol.VolSize = roundedBlock * uint64(blockInfo) if filesetQuotaBytes != scVol.VolSize { var hardLimit, softLimit string @@ -676,6 +678,8 @@ func (cs *ScaleControllerServer) createFilesetVol(ctx context.Context, scVol *sc } } targetBasePath := "" + // changing the quota + if !isCGIndependentFset { if scVol.VolSize != 0 { err = cs.setQuota(ctx, scVol, volName) @@ -738,7 +742,8 @@ func handleUpdateComment(ctx context.Context, scVol *scaleVolume, setAfmAttribut func (cs *ScaleControllerServer) getVolumeSizeInBytes(req *csi.CreateVolumeRequest) int64 { capacity := req.GetCapacityRange() - return capacity.GetRequiredBytes() + requiredBytes := capacity.GetRequiredBytes() + return requiredBytes } func updateComment(ctx context.Context, scVol *scaleVolume, setAfmAttributes bool, afmTuningParams map[string]interface{}) error { @@ -917,7 +922,6 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C /* Get volume size in bytes */ volSize := cs.getVolumeSizeInBytes(req) - reqCapabilities := req.GetVolumeCapabilities() if reqCapabilities == nil { return nil, status.Error(codes.InvalidArgument, "Volume Capabilities is a required field") @@ -1109,7 +1113,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C Volume: &csi.Volume{ VolumeId: volID, //CapacityBytes: int64(scaleVol.VolSize), // #nosec G115 -- false positive - CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), + CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), // #nosec G115 -- false positive VolumeContext: req.GetParameters(), ContentSource: volSrc, }, @@ -1189,19 +1193,19 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C if capRange == nil { return nil, status.Error(codes.InvalidArgument, "volume range is not provided") } - // #nosec G115 -- false positive + // changing capacity here for pvc size in decimal units to align with scale block size - capacity := uint64(capRange.GetRequiredBytes()) - filesystemname := scaleVol.VolBackendFs - filesystemDetails, err := scaleVol.Connector.GetFilesystemDetails(ctx, filesystemname) - if err != nil { - klog.Errorf("[%s] Create Volume - unable to get filesystem details ", err) - return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume - unable to get filesystem details for Filesystem", err)) - } - blockinfo := filesystemDetails.Block.BlockSize - roundedblock := uint64(math.Floor(float64(capacity) / float64(blockinfo))) - capacity = roundedblock * uint64(blockinfo) - klog.Info("new capacity", capacity) + capacity := uint64(capRange.GetRequiredBytes()) // #nosec G115 -- false positive + // filesystemName := scaleVol.VolBackendFs + // filesystemDetails, err := scaleVol.Connector.GetFilesystemDetails(ctx, filesystemName) + // if err != nil { + // klog.Errorf("[%s] Create Volume - unable to get filesystem details ", err) + // return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume - unable to get filesystem details for Filesystem", err)) + // } + // blockinfo := filesystemDetails.Block.BlockSize + // roundedblock := uint64(math.Floor(float64(capacity) / float64(blockinfo))) + // capacity = roundedblock * uint64(blockinfo) + // klog.Info("new capacity", capacity) targetPath, err = cs.createStaticBasedVol(ctx, scaleVol, filesetName, capacity) } else if scaleVol.IsFilesetBased { @@ -1258,7 +1262,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C Volume: &csi.Volume{ VolumeId: volID, //CapacityBytes: int64(scaleVol.VolSize) // #nosec G115 -- false positive - CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), + CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), // #nosec G115 -- false positive VolumeContext: req.GetParameters(), ContentSource: volSrc, }, @@ -1397,16 +1401,17 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr scaleVol.VolName = volName // changing capacity here for pvc size in decimal units to align with scale block size //getting the filesystemname - filesystemname := scaleVol.VolBackendFs - klog.Info("Filesystemname", filesystemname) - filesystemdetails, err := cs.Driver.connmap["primary"].GetFilesystemDetails(ctx, filesystemname) + filesystemName := scaleVol.VolBackendFs + klog.Info("Filesystemname", filesystemName) + filesystemDetails, err := scaleVol.Connector.GetFilesystemDetails(ctx, filesystemName) if err != nil { klog.Errorf("Unable to get the filesystemdetails") + return nil, false, "", status.Error(codes.Internal, fmt.Sprintf("unable to get filesystem details for Filesystem %s. Error: %v", filesystemName, err)) } - klog.Info("filesystem details", filesystemdetails) - blockinfo := filesystemdetails.Block.BlockSize - roundedblock := int64(math.Floor(float64(volSize) / float64(blockinfo))) - volSize = roundedblock * int64(blockinfo) + klog.V(4).Infof("[%s] filesystemDetails: %+v", utils.GetLoggerId(ctx), filesystemDetails) + blockInfo := filesystemDetails.Block.BlockSize + roundedBlock := int64(math.Floor(float64(volSize) / float64(blockInfo))) + volSize = roundedBlock * int64(blockInfo) // #nosec G115 -- false positive if uint64(volSize) > maximumPVSize { // larger than allowed pv size not allowed @@ -1418,6 +1423,7 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr scaleVol.VolSize = smallestVolSize } else { scaleVol.VolSize = uint64(volSize) // #nosec G115 -- false positive + } /* Get details for Primary Cluster */ @@ -2040,18 +2046,18 @@ func (cs *ScaleControllerServer) checkCacheVolumeSupport(assembledScaleversion s } /*func (cs *ScaleControllerServer) checkGuiHASupport(ctx context.Context, conn connectors.SpectrumScaleConnector) error { - // Verify IBM Storage Scale Version is not below 5.1.5-0 + // Verify IBM Storage Scale Version is not below 5.1.5-0 - versionCheck, err := cs.checkMinScaleVersion(ctx, conn, "5150") - if err != nil { - return err - } + versionCheck, err := cs.checkMinScaleVersion(ctx, conn, "5150") + if err != nil { + return err + } - if !versionCheck { - return status.Error(codes.FailedPrecondition, "the minimum required IBM Storage Scale version for GUI HA support with CSI is 5.1.5-0") - } - return nil - }*/ + if !versionCheck { + return status.Error(codes.FailedPrecondition, "the minimum required IBM Storage Scale version for GUI HA support with CSI is 5.1.5-0") + } + return nil + }*/ func (cs *ScaleControllerServer) validateSnapId(ctx context.Context, scaleVol *scaleVolume, sourcesnapshot *scaleSnapId, newvolume *scaleVolume, assembledScaleversion string) error { @@ -2112,12 +2118,12 @@ func (cs *ScaleControllerServer) validateSnapId(ctx context.Context, scaleVol *s filesetToCheck = sourcesnapshot.ConsistencyGroup } /*isFsetLinked, err := conn.IsFilesetLinked(ctx, sourcesnapshot.FsName, filesetToCheck) - if err != nil { - return status.Error(codes.Internal, fmt.Sprintf("unable to get fileset link information for [%v]", filesetToCheck)) - } - if !isFsetLinked { - return status.Error(codes.Internal, fmt.Sprintf("fileset [%v] of source snapshot is not linked", filesetToCheck)) - }*/ + if err != nil { + return status.Error(codes.Internal, fmt.Sprintf("unable to get fileset link information for [%v]", filesetToCheck)) + } + if !isFsetLinked { + return status.Error(codes.Internal, fmt.Sprintf("fileset [%v] of source snapshot is not linked", filesetToCheck)) + }*/ err = cs.checkFileSetLink(ctx, conn, scaleVol, sourcesnapshot.FsName, filesetToCheck, "source snapshot") if err != nil { @@ -2416,18 +2422,18 @@ func (cs *ScaleControllerServer) DeleteFilesetVol(ctx context.Context, Filesyste } /* err := conn.UnlinkFileset(ctx, FilesystemName, FilesetName, false) - if err != nil { - if strings.Contains(err.Error(), fsetNotFoundErrCode) || - strings.Contains(err.Error(), fsetNotFoundErrMsg) { // fileset is already deleted - klog.V(4).Infof("[%s] fileset seems already deleted - %v", loggerId, err) - return true, nil - } else if strings.Contains(err.Error(), fsetLinkNotFoundErrCode) || - strings.Contains(err.Error(), fsetLinkNotFoundErrMsg) { // fileset is already unlinked - klog.V(4).Infof("[%s] fileset seems already unlinked - %v", loggerId, err) - } else { - return false, status.Error(codes.Internal, fmt.Sprintf("unable to unlink Fileset [%v] for FS [%v] and clusterId [%v].Error : [%v]", FilesetName, FilesystemName, volumeIdMembers.ClusterId, err)) - } - }*/ + if err != nil { + if strings.Contains(err.Error(), fsetNotFoundErrCode) || + strings.Contains(err.Error(), fsetNotFoundErrMsg) { // fileset is already deleted + klog.V(4).Infof("[%s] fileset seems already deleted - %v", loggerId, err) + return true, nil + } else if strings.Contains(err.Error(), fsetLinkNotFoundErrCode) || + strings.Contains(err.Error(), fsetLinkNotFoundErrMsg) { // fileset is already unlinked + klog.V(4).Infof("[%s] fileset seems already unlinked - %v", loggerId, err) + } else { + return false, status.Error(codes.Internal, fmt.Sprintf("unable to unlink Fileset [%v] for FS [%v] and clusterId [%v].Error : [%v]", FilesetName, FilesystemName, volumeIdMembers.ClusterId, err)) + } + }*/ err := conn.DeleteFileset(ctx, FilesystemName, FilesetName) if err != nil { @@ -2653,14 +2659,14 @@ func (cs *ScaleControllerServer) DeleteVolume(newctx context.Context, req *csi.D pfsName := "" // getting the primary filesystem name from the path when primary fs is not provided in the cr and pvc is older /* if symlinkExists && ifPrimaryDisable { - parts := strings.Split(volumeIdMembers.Path, "/") - for i, part := range parts { - if part == ".volumes" && i >= 2 { - pfsName = parts[i-2] - klog.Infof("[%s] DeleteVolume :primary fs from path is [%v]", loggerId, pfsName) - } - } - }*/ + parts := strings.Split(volumeIdMembers.Path, "/") + for i, part := range parts { + if part == ".volumes" && i >= 2 { + pfsName = parts[i-2] + klog.Infof("[%s] DeleteVolume :primary fs from path is [%v]", loggerId, pfsName) + } + } + }*/ relPath := "" if volumeIdMembers.StorageClassType != STORAGECLASS_CLASSIC || volumeIdMembers.VolType == FILE_SHALLOWCOPY_VOLUME || !symlinkExists { @@ -3926,7 +3932,6 @@ func (cs *ScaleControllerServer) ControllerExpandVolume(ctx context.Context, req return nil, status.Error(codes.InvalidArgument, "capacity range not provided") } capacity := uint64(capRange.GetRequiredBytes()) // #nosec G115 -- false positive - volumeIDMembers, err := getVolIDMembers(volID) if err != nil { @@ -3963,14 +3968,14 @@ func (cs *ScaleControllerServer) ControllerExpandVolume(ctx context.Context, req return nil, status.Error(codes.Internal, fmt.Sprintf("ControllerExpandVolume - unable to get filesystem Name for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err)) } // changing capacity here for pvc size in decimal units to align with scale block size - filesystemdetails, err := conn.GetFilesystemDetails(ctx, filesystemName) + filesystemDetails, err := conn.GetFilesystemDetails(ctx, filesystemName) if err != nil { klog.Errorf("[%s] ControllerExpandVolume - unable to get filesystem details for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", loggerId, volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err) return nil, status.Error(codes.Internal, fmt.Sprintf("ControllerExpandVolume - unable to get filesystem details for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err)) } - blockinfo := filesystemdetails.Block.BlockSize - roundedblock := uint64(math.Floor(float64(capacity) / float64(blockinfo))) - capacity = roundedblock * uint64(blockinfo) + blockInfo := filesystemDetails.Block.BlockSize + roundedBlock := uint64(math.Floor(float64(capacity) / float64(blockInfo))) + capacity = roundedBlock * uint64(blockInfo) filesetName := volumeIDMembers.FsetName From 61d1b26a0eb1ac8c67ed5666e9515d5a59e06c31 Mon Sep 17 00:00:00 2001 From: shravani Date: Tue, 10 Jun 2025 00:00:48 +0530 Subject: [PATCH 10/15] latest code as per reviwers comments Signed-off-by: shravani --- driver/csiplugin/controllerserver.go | 37 +++------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index 4c442a4fb..146578be9 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -76,7 +76,7 @@ func (cs *ScaleControllerServer) IfSameVolReqInProcess(scVol *scaleVolume) (bool if volpresent { /* #nosec G115 -- false positive */ - if int64(scVol.VolSize) == capacity { + if capacity == int64(scVol.VolSize) { return true, nil } else { return false, status.Error(codes.Internal, fmt.Sprintf("Volume %v present in map but requested size %v does not match with size %v in map", scVol.VolName, scVol.VolSize, capacity)) @@ -270,7 +270,6 @@ func (cs *ScaleControllerServer) setQuota(ctx context.Context, scVol *scaleVolum } filesetQuotaBytes, err := ConvertToBytes(quota) - if err != nil { if strings.Contains(err.Error(), "invalid number specified") { // Invalid number specified means quota is not set @@ -280,18 +279,6 @@ func (cs *ScaleControllerServer) setQuota(ctx context.Context, scVol *scaleVolum } } - // changing volsize here for pvc size in decimal units to align with scale block size - // filesystemName := scVol.VolBackendFs - // klog.Info("Filesystemname", filesystemName) - // filesystemDetails, err := scVol.Connector.GetFilesystemDetails(ctx, filesystemName) - // if err != nil { - // klog.Errorf("Unable to get the filesystemdetails") - // } - // klog.Info("filesystem details", filesystemDetails) - // blockInfo := filesystemDetails.Block.BlockSize - // roundedBlock := uint64(math.Floor(float64(scVol.VolSize) / float64(blockInfo))) - // scVol.VolSize = roundedBlock * uint64(blockInfo) - if filesetQuotaBytes != scVol.VolSize { var hardLimit, softLimit string hardLimit = strconv.FormatUint(scVol.VolSize, 10) @@ -678,8 +665,6 @@ func (cs *ScaleControllerServer) createFilesetVol(ctx context.Context, scVol *sc } } targetBasePath := "" - // changing the quota - if !isCGIndependentFset { if scVol.VolSize != 0 { err = cs.setQuota(ctx, scVol, volName) @@ -742,8 +727,7 @@ func handleUpdateComment(ctx context.Context, scVol *scaleVolume, setAfmAttribut func (cs *ScaleControllerServer) getVolumeSizeInBytes(req *csi.CreateVolumeRequest) int64 { capacity := req.GetCapacityRange() - requiredBytes := capacity.GetRequiredBytes() - return requiredBytes + return capacity.GetRequiredBytes() } func updateComment(ctx context.Context, scVol *scaleVolume, setAfmAttributes bool, afmTuningParams map[string]interface{}) error { @@ -1111,8 +1095,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C return &csi.CreateVolumeResponse{ Volume: &csi.Volume{ - VolumeId: volID, - //CapacityBytes: int64(scaleVol.VolSize), // #nosec G115 -- false positive + VolumeId: volID, CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), // #nosec G115 -- false positive VolumeContext: req.GetParameters(), ContentSource: volSrc, @@ -1194,18 +1177,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C return nil, status.Error(codes.InvalidArgument, "volume range is not provided") } - // changing capacity here for pvc size in decimal units to align with scale block size capacity := uint64(capRange.GetRequiredBytes()) // #nosec G115 -- false positive - // filesystemName := scaleVol.VolBackendFs - // filesystemDetails, err := scaleVol.Connector.GetFilesystemDetails(ctx, filesystemName) - // if err != nil { - // klog.Errorf("[%s] Create Volume - unable to get filesystem details ", err) - // return nil, status.Error(codes.Internal, fmt.Sprintf("CreateVolume - unable to get filesystem details for Filesystem", err)) - // } - // blockinfo := filesystemDetails.Block.BlockSize - // roundedblock := uint64(math.Floor(float64(capacity) / float64(blockinfo))) - // capacity = roundedblock * uint64(blockinfo) - // klog.Info("new capacity", capacity) targetPath, err = cs.createStaticBasedVol(ctx, scaleVol, filesetName, capacity) } else if scaleVol.IsFilesetBased { @@ -1260,8 +1232,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C return &csi.CreateVolumeResponse{ Volume: &csi.Volume{ - VolumeId: volID, - //CapacityBytes: int64(scaleVol.VolSize) // #nosec G115 -- false positive + VolumeId: volID, CapacityBytes: req.GetCapacityRange().GetRequiredBytes(), // #nosec G115 -- false positive VolumeContext: req.GetParameters(), ContentSource: volSrc, From 504f125e38f6665d9f3eed2d03444155c9819914 Mon Sep 17 00:00:00 2001 From: shravani Date: Tue, 10 Jun 2025 00:11:43 +0530 Subject: [PATCH 11/15] solving the formatting issues Signed-off-by: shravani --- driver/csiplugin/controllerserver.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index 146578be9..4c7b07b18 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -73,7 +73,6 @@ type ScaleControllerServer struct { func (cs *ScaleControllerServer) IfSameVolReqInProcess(scVol *scaleVolume) (bool, error) { capacity, volpresent := cs.Driver.reqmap[scVol.VolName] - if volpresent { /* #nosec G115 -- false positive */ if capacity == int64(scVol.VolSize) { @@ -906,6 +905,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C /* Get volume size in bytes */ volSize := cs.getVolumeSizeInBytes(req) + reqCapabilities := req.GetVolumeCapabilities() if reqCapabilities == nil { return nil, status.Error(codes.InvalidArgument, "Volume Capabilities is a required field") @@ -1176,9 +1176,7 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C if capRange == nil { return nil, status.Error(codes.InvalidArgument, "volume range is not provided") } - capacity := uint64(capRange.GetRequiredBytes()) // #nosec G115 -- false positive - targetPath, err = cs.createStaticBasedVol(ctx, scaleVol, filesetName, capacity) } else if scaleVol.IsFilesetBased { targetPath, err = cs.createFilesetBasedVol(ctx, scaleVol, isCGVolume, volFsInfo.Type, req.Secrets, afmTuningParams, gatewayNodeName) @@ -1394,7 +1392,6 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr scaleVol.VolSize = smallestVolSize } else { scaleVol.VolSize = uint64(volSize) // #nosec G115 -- false positive - } /* Get details for Primary Cluster */ From 697040618f1a9840fe2014c4f209190ab615ee63 Mon Sep 17 00:00:00 2001 From: shravani Date: Tue, 10 Jun 2025 01:08:05 +0530 Subject: [PATCH 12/15] changing the setScaleVolume() Signed-off-by: shravani --- driver/csiplugin/controllerserver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index 4c7b07b18..29c30fbbc 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -1372,7 +1372,7 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr //getting the filesystemname filesystemName := scaleVol.VolBackendFs klog.Info("Filesystemname", filesystemName) - filesystemDetails, err := scaleVol.Connector.GetFilesystemDetails(ctx, filesystemName) + filesystemDetails, err := cs.Driver.connmap["primary"].GetFilesystemDetails(ctx, filesystemName) if err != nil { klog.Errorf("Unable to get the filesystemdetails") return nil, false, "", status.Error(codes.Internal, fmt.Sprintf("unable to get filesystem details for Filesystem %s. Error: %v", filesystemName, err)) @@ -3939,7 +3939,7 @@ func (cs *ScaleControllerServer) ControllerExpandVolume(ctx context.Context, req filesystemDetails, err := conn.GetFilesystemDetails(ctx, filesystemName) if err != nil { klog.Errorf("[%s] ControllerExpandVolume - unable to get filesystem details for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", loggerId, volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err) - return nil, status.Error(codes.Internal, fmt.Sprintf("ControllerExpandVolume - unable to get filesystem details for Filesystem Uid [%v] and clusterId [%v]. Error [%v]", volumeIDMembers.FsUUID, volumeIDMembers.ClusterId, err)) + return nil, status.Error(codes.Internal, fmt.Sprintf("ControllerExpandVolume - unable to get filesystem details for Filesystem [%v] Error [%v]", filesystemName, err)) } blockInfo := filesystemDetails.Block.BlockSize roundedBlock := uint64(math.Floor(float64(capacity) / float64(blockInfo))) From 4248a384c138aef20df4c737c944e08aa65c2fb5 Mon Sep 17 00:00:00 2001 From: shravani Date: Tue, 10 Jun 2025 15:32:26 +0530 Subject: [PATCH 13/15] cheking the git sign off flag Signed-off-by: shravani --- driver/csiplugin/controllerserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index 29c30fbbc..33be43f34 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -1368,7 +1368,7 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr isCGVolume = true } scaleVol.VolName = volName - // changing capacity here for pvc size in decimal units to align with scale block size + // changing capacity here for pvc size in decimal units to align with scale block size of filesystem //getting the filesystemname filesystemName := scaleVol.VolBackendFs klog.Info("Filesystemname", filesystemName) From 663f65edeed35f861e3543ff529e47086d8a7aea Mon Sep 17 00:00:00 2001 From: shravani Date: Tue, 10 Jun 2025 16:46:00 +0530 Subject: [PATCH 14/15] returning logger id for filesystem details Signed-off-by: shravani --- driver/csiplugin/controllerserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index 33be43f34..6ce4bf1e1 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -1374,7 +1374,7 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr klog.Info("Filesystemname", filesystemName) filesystemDetails, err := cs.Driver.connmap["primary"].GetFilesystemDetails(ctx, filesystemName) if err != nil { - klog.Errorf("Unable to get the filesystemdetails") + klog.Errorf("%s Unable to get the filesystemdetails for Filesystem %s. Error: %v", utils.GetLoggerId(ctx), filesystemName, err) return nil, false, "", status.Error(codes.Internal, fmt.Sprintf("unable to get filesystem details for Filesystem %s. Error: %v", filesystemName, err)) } klog.V(4).Infof("[%s] filesystemDetails: %+v", utils.GetLoggerId(ctx), filesystemDetails) From 90d779722866f033bd23466fbc1da1aae9a6cba8 Mon Sep 17 00:00:00 2001 From: shravani Date: Mon, 16 Jun 2025 15:48:06 +0530 Subject: [PATCH 15/15] final Signed-off-by: shravani --- driver/csiplugin/controllerserver.go | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/driver/csiplugin/controllerserver.go b/driver/csiplugin/controllerserver.go index 6ce4bf1e1..4039e75b3 100644 --- a/driver/csiplugin/controllerserver.go +++ b/driver/csiplugin/controllerserver.go @@ -71,11 +71,11 @@ type ScaleControllerServer struct { csi.UnimplementedControllerServer } -func (cs *ScaleControllerServer) IfSameVolReqInProcess(scVol *scaleVolume) (bool, error) { +func (cs *ScaleControllerServer) IfSameVolReqInProcess(scVol *scaleVolume, requestedSize int64) (bool, error) { capacity, volpresent := cs.Driver.reqmap[scVol.VolName] if volpresent { /* #nosec G115 -- false positive */ - if capacity == int64(scVol.VolSize) { + if capacity == requestedSize { return true, nil } else { return false, status.Error(codes.Internal, fmt.Sprintf("Volume %v present in map but requested size %v does not match with size %v in map", scVol.VolName, scVol.VolSize, capacity)) @@ -1117,8 +1117,20 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C } } - - volReqInProcess, err := cs.IfSameVolReqInProcess(scaleVol) + filesystemName := scaleVol.VolBackendFs + klog.Info("Filesystemname", filesystemName) + filesystemDetails, err := cs.Driver.connmap["primary"].GetFilesystemDetails(ctx, filesystemName) + if err != nil { + klog.Errorf("%s Unable to get the filesystemdetails for Filesystem %s. Error: %v", utils.GetLoggerId(ctx), filesystemName, err) + return nil, status.Error(codes.Internal, fmt.Sprintf("unable to get filesystem details for Filesystem %s. Error: %v", filesystemName, err)) + } + klog.V(4).Infof("[%s] filesystemDetails: %+v", utils.GetLoggerId(ctx), filesystemDetails) + blockInfo := filesystemDetails.Block.BlockSize + if blockInfo == 0 { + klog.Errorf("[%s] volume:[%v] - unable to get block size for filesystem %s", loggerId, scaleVol.VolName, filesystemName) + return nil, status.Error(codes.Internal, fmt.Sprintf("unable to get block size for filesystem %s", filesystemName)) + } + volReqInProcess, err := cs.IfSameVolReqInProcess(scaleVol, int64(blockInfo)) if err != nil { return nil, err } @@ -1127,6 +1139,9 @@ func (cs *ScaleControllerServer) CreateVolume(newctx context.Context, req *csi.C klog.Errorf("[%s] volume:[%v] - volume creation already in process ", loggerId, scaleVol.VolName) return nil, status.Error(codes.Aborted, fmt.Sprintf("volume creation already in process : %v", scaleVol.VolName)) } + // Add sleep time after the IfSameVolReqInProcess function call + klog.Infof("[%s] Sleeping for 4 minutes after checking IfSameVolReqInProcess", loggerId) + time.Sleep(4 * time.Minute) volResponse, err := cs.getCopyJobStatus(ctx, req, volSrc, scaleVol, isVolSource, isSnapSource, snapIdMembers) if err != nil { @@ -1379,6 +1394,10 @@ func (cs *ScaleControllerServer) setScaleVolume(ctx context.Context, req *csi.Cr } klog.V(4).Infof("[%s] filesystemDetails: %+v", utils.GetLoggerId(ctx), filesystemDetails) blockInfo := filesystemDetails.Block.BlockSize + if blockInfo == 0 { + klog.Errorf("[%s] volume:[%v] - unable to get block size for filesystem %s", utils.GetLoggerId(ctx), scaleVol.VolName, filesystemName) + return nil, false, "", status.Error(codes.Internal, fmt.Sprintf("unable to get block size for filesystem %s", filesystemName)) + } roundedBlock := int64(math.Floor(float64(volSize) / float64(blockInfo))) volSize = roundedBlock * int64(blockInfo) @@ -3946,7 +3965,6 @@ func (cs *ScaleControllerServer) ControllerExpandVolume(ctx context.Context, req capacity = roundedBlock * uint64(blockInfo) filesetName := volumeIDMembers.FsetName - // Check if fileset exists fsetExist, err := conn.CheckIfFilesetExist(ctx, filesystemName, filesetName) if err != nil {