-
Notifications
You must be signed in to change notification settings - Fork 100
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
feat(provisioning): extra format options (mkfs
) added
#335
base: develop
Are you sure you want to change the base?
Conversation
e931f2c
to
de805a6
Compare
6a46aef
to
6fc3b35
Compare
2cf836e
to
3c59634
Compare
How is the new formatOptions going to be set by user? via storageclass? There is no mkfsOptions unlike mountOptions as provided by storageclass. |
I think |
Hi
So, It will work if you add it to storageclass |
Also there is no test for the mounter itself |
|
You can run this manually and document here the steps to set formatOptions. |
It's my first time that I'm contributing to this project so I just looked for where mountOptions is handled to handle formatOptions too |
Hello again I'm using NixOS, and I can't run |
I checked out more and I saw that we have to put this on where we are mounting volume for the first time, So there is no need to add this into |
3c59634
to
a699854
Compare
a699854
to
72528d1
Compare
@mhkarimi1383 |
golint-ci returns error
I think to update to |
Would you like to do that as part of this PR? or instead try using a |
I can do both, whatever is Ok :) |
Thanks, I'd say then try using a compatible |
Ok, I will revert my changes to go.mod, etc. And will change the package again |
I have fixed package versions and switched to a correct version of mount utils And I was able to build project successfully and tests passed |
Signed-off-by: Muhammed Hussein Karimi <[email protected]>
Signed-off-by: Muhammed Hussein Karimi <[email protected]>
Signed-off-by: Muhammed Hussein Karimi <[email protected]>
Signed-off-by: Muhammed Hussein Karimi <[email protected]>
12087cf
to
a9e61cb
Compare
Signed-off-by: Muhammed Hussein Karimi <[email protected]>
Hello again, and I have added new parameter to the correct locations (I think) apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-lvmpv
parameters:
storage: "lvm"
volgroup: "lvmvg"
formatoptions: '-N "4000000000"'
provisioner: local.csi.openebs.io
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: csi-lvmpv
spec:
storageClassName: openebs-lvmpv
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 4Gi
---
apiVersion: v1
kind: Pod
metadata:
name: fio
spec:
restartPolicy: Never
containers:
- name: perfrunner
image: openebs/tests-fio
command: ["/bin/bash"]
args: ["-c", "tail -f /dev/null"]
volumeMounts:
- mountPath: /datadir
name: fio-vol
tty: true
volumes:
- name: fio-vol
persistentVolumeClaim:
claimName: csi-lvmpv Trying to figure out the problem |
Should be |
Parameters are converting to lowercase (in UPDATE: tested and not worked :/ |
Could this be because the volume crd need a version bump? |
I have checked that new field is applied in the CRD |
@mhkarimi1383 Are you still on with testing your changes? Please let us know how we should proceed with this. |
I'm in the phase of debugging this, getting no error and options are not getting reflected into the created LVM Volume object in K8s Trying to debug that deeply to see what's the problem |
Signed-off-by: Muhammed Hussein karimi <[email protected]>
Problem Solved, In logs I found that spec.formatOptions is unknown, I found that What I have to do to regenerate helm chart CRDs? I'm so happy that I got this error :)
|
Also a document update is required :) |
Sounds good. Could you also add some unit tests for this. e.g. one positive(set format option and validate setting) and one negative case(set formatoption and expect failure like you did for inodecount above)
|
I should only test that if that everything successfully works, or I have to verify that options are propagated? Since checking this part is a bit complex |
I have to add some new tests to volumeCreationTest |
If checking the set formatOption values turns out to be tricky you may try verifying functionally. For example - set a very low limit with |
Will try to do that :) |
Test is failing I looks like due to
See: https://github.com/openebs/lvm-localpv/actions/runs/13956138799/job/39067688864?pr=335#step:9:565 Since Helm CRDs are not updated yet My Locally emulated test for provided options: λ truncate -s 5G /tmp/disk.img
λ sudo losetup -f /tmp/disk.img --show
/dev/loop1
λ tune2fs -l /dev/loop1 | grep "Inode count"
Inode count: 1000320
λ sudo mkfs.ext4 /dev/loop1 -b 4096 -N 5000000
mke2fs 1.47.2 (1-Jan-2025)
/dev/loop1 contains a ext4 file system
created on Wed Mar 19 23:39:49 2025
Proceed anyway? (y,N) y
Discarding device blocks: done
Creating filesystem with 1310720 4k blocks and 5001264 inodes
Filesystem UUID: c0e8f2a6-0bac-442e-966a-cab10de1a0f4
Superblock backups stored on blocks:
8608, 25824, 43040, 60256, 77472, 215200, 232416, 421792, 697248,
1076000
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done |
Also I think a cluster dump is needed after tests... Sometimes tests pods logs are also needed |
96753f5
to
4f26b1a
Compare
Signed-off-by: Muhammed Hussein Karimi <[email protected]>
4f26b1a
to
8973c7b
Compare
Pull Request template
Please, go through these steps before you submit a PR.
Why is this PR required? What issue does it fix?:
adding extra format (
mkfs
) options to newly created Volumesalso switched from deprecated
utils/monut
tomount-utils
to be able to add this feature and moving from an old package to a maintained oneWhat this PR does?:
Refactor to new mount utils package and change format and mount function
Does this PR require any upgrade changes?:
No, But requires document updates for StorageClasses
If the changes in this PR are manually verified, list down the scenarios covered::
Any additional information for your reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs
Checklist:
<type>(<scope>): <subject>