Skip to content

use simplyblock v2 API to contact storage backend#292

Merged
boddumanohar merged 4 commits intomainfrom
use-simplyblock-v2-api
Nov 24, 2025
Merged

use simplyblock v2 API to contact storage backend#292
boddumanohar merged 4 commits intomainfrom
use-simplyblock-v2-api

Conversation

@boddumanohar
Copy link
Copy Markdown
Member

@boddumanohar boddumanohar commented Nov 20, 2025

At the moment, we contact Simplyblock storage API at 2 places:

  1. To update IOPS limits directly by contacting backend. Because Simplyblock CSI driver doesn't support MODIFY_VOLUME feature yet. This WIP in implement controller Modify Volume simplyblock-csi#243
  2. To get LVOL stats

As a part of this PR, I've extracted simplyblock related code to a common utils. and used it at both the above 2 places

The format of the response returned by IO Stats API is:

curl -X 'GET' \
  'http://192.168.10.146/api/v2/clusters/cdd0c140-5536-428f-bf4e-3cbf3efe1e9b/storage-pools/48f21f20-5d1d-4d6f-8ce3-9a4359f38bd8/volumes/c7bd1515-3594-4fd4-87c9-bca9bf14b75b/iostats' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer Z1rgRiHggESpKZICZAwJ'
[
  {
    "date": 1763755862,
    "read_bytes": 7094272,
    "read_bytes_ps": 1638,
    "read_io_ps": 0,
    "read_latency_ps": 1193979,
    "write_bytes": 68857856,
    "write_bytes_ps": 0,
    "write_io_ps": 0,
    "write_latency_ps": 0,
    "connected_clients": 0,
    "size_total": 1073741824,
    "size_prov": 0,
    "size_used": 201326592,
    "size_free": 872415232,
    "size_util": 18,
    "size_prov_util": 0,
    "read_latency_ticks": 7414907680,
    "record_duration": 2,
    "record_end_time": 0,
    "record_start_time": 0,
    "unmap_bytes": 1073745920,
    "unmap_bytes_ps": 0,
    "unmap_io": 2,
    "unmap_io_ps": 0,
    "unmap_latency_ps": 0,
    "unmap_latency_ticks": 106612,
    "write_latency_ticks": 159941744542
  }
]

@boddumanohar boddumanohar changed the title use simplyblock v2 API for communication use simplyblock v2 API to contact storage backend Nov 20, 2025
Copy link
Copy Markdown
Collaborator

@mxsrc mxsrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this, but ideally we make the API module more self-contained, s.t. we can more easily replace it with a generated one. I think a good way would be to export a class that offers the pool() and volume_iostats() functions.

@boddumanohar boddumanohar force-pushed the use-simplyblock-v2-api branch from 4ff4433 to 17a67e1 Compare November 20, 2025 20:23
@boddumanohar boddumanohar requested a review from mxsrc November 20, 2025 20:24
@boddumanohar boddumanohar force-pushed the use-simplyblock-v2-api branch from 17a67e1 to a2246e3 Compare November 21, 2025 19:54
@boddumanohar boddumanohar force-pushed the use-simplyblock-v2-api branch from ecf7e8d to a436cad Compare November 24, 2025 12:30
Copy link
Copy Markdown
Collaborator

@mxsrc mxsrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is much nicer already! I think we should make the SimplyblockApi class a bit more powerful, that would improve usage even more.

@boddumanohar
Copy link
Copy Markdown
Member Author

boddumanohar commented Nov 24, 2025

The linter failure (helm charts) seems un-related to the changes in the PR

@boddumanohar boddumanohar requested a review from mxsrc November 24, 2025 15:26
Copy link
Copy Markdown
Collaborator

@mxsrc mxsrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@boddumanohar boddumanohar merged commit 8163ed8 into main Nov 24, 2025
4 of 5 checks passed
@boddumanohar boddumanohar deleted the use-simplyblock-v2-api branch November 24, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants