diff --git a/pkg/azurefile/controllerserver.go b/pkg/azurefile/controllerserver.go index edceb6ece6..7ae7c86fda 100644 --- a/pkg/azurefile/controllerserver.go +++ b/pkg/azurefile/controllerserver.go @@ -1004,7 +1004,14 @@ func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequ itemSnapshotQuota = pointer.Int32Deref(snapshotShare.ShareQuota, 0) } - klog.V(2).Infof("Created share snapshot: %s", itemSnapshot) + klog.V(2).Infof("created share snapshot: %s, time: %v, quota: %dGiB", itemSnapshot, itemSnapshotTime, itemSnapshotQuota) + if itemSnapshotQuota == 0 { + fileshare, err := d.cloud.FileClient.WithSubscriptionID(subsID).GetFileShare(ctx, rgName, accountName, fileShareName, "") + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get file share(%s) quota: %v", fileShareName, err) + } + itemSnapshotQuota = pointer.Int32Deref(fileshare.ShareQuota, defaultAzureFileQuota) + } createResp := &csi.CreateSnapshotResponse{ Snapshot: &csi.Snapshot{ SizeBytes: volumehelper.GiBToBytes(int64(itemSnapshotQuota)),