Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ndctl create-namespace should support percentages #199

Open
sscargal opened this issue Mar 24, 2022 · 1 comment · May be fixed by #209
Open

ndctl create-namespace should support percentages #199

sscargal opened this issue Mar 24, 2022 · 1 comment · May be fixed by #209

Comments

@sscargal
Copy link

It would be very useful to support namespace creation using a percentage value of the total region capacity in addition to the current method that supports size as bytes. It saves the user having to perform calculations that can be complex when determining alignment, interleave width, etc. ndctl already performs input argument validation checks when creating namespaces, so we could use the existing functionality and expose it to the user.

Examples:

  • ndctl create-namespace –size 50% --region 0 // Create a single namespace in region 0 using 50% of the total capacity
  • ndctl create-namespace –size 50% --continue // Keep creating namespaces of size 50% until we run out of space in all regions (2 namespaces per region)
  • ndctl create-namespace –size 25%,50%,20%,5% --region 0 // Create 4 namespaces in region 0 using the percentages provided

A new --pct option could be implemented instead of reusing --size

@tanabarr
Copy link

This feature would be very useful for DAOS as we will be supporting multiple SCM namespaces (and I/O engines) per NUMA node in the future.

vliaskov added a commit to vliaskov/ndctl that referenced this issue Jun 21, 2022
The size option of the create-namespace command can now take a percentage of
the total region size as the desired size. E.g. :

ndctl create-namespace  -s 50%

will create a namespace using half of the total region size, assuming
there is enough available capacity in the region for the request.

Only whole percentages are correctly parsed at the moment e.g. 12%, but
not 12.5%.

Sizes that result in a misaligned size with regards to region alignment
(default 16MB) are rounded down, unless the rounded-up size would result
in using the full remaining region capacity available.

Fixes: pmem#199
Signed-off-by: Vasilis Liaskovitis <[email protected]>
@vliaskov vliaskov linked a pull request Jun 21, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants