-
Notifications
You must be signed in to change notification settings - Fork 243
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
Add persistent volume size option to config #3820
Conversation
So PVC size comes out of the disk size, right? I.e. 0GiB <= pvc size <= disk size - 15GiB? I'm assuming that the last inequality is actually strict to leave space for other things. What would be the maximum possible pvc size for a fixed disk size? |
pkg/crc/machine/start.go
Outdated
// vgFree space as part of the bundle is default to ~15.02G (16127098880 byte) | ||
vgFree := 16127098880 | ||
// 1GB = 1073741824 bytes | ||
vgFree := persistentVolumeSize * 1073741824 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GB := 107374... // bytes
vgFree := persistentVolumeSize * GB
which makes things s stand out more clearly than the comment
pkg/crc/config/settings.go
Outdated
@@ -91,6 +92,8 @@ func RegisterSettings(cfg *Config) { | |||
"Enable experimental features (true/false, default: false)") | |||
cfg.AddSetting(EmergencyLogin, false, ValidateBool, SuccessfullyApplied, | |||
"Enable emergency login for 'core' user. Password is randomly generated. (true/false, default: false)") | |||
cfg.AddSetting(PersistentVolumeSize, constants.DefaultPersistentVolumeSize, validatePersistentDiskSize, SuccessfullyApplied, | |||
fmt.Sprintf("Total size in GiB of the persistent volume (must be greater than or equal to '%d')", constants.DefaultPersistentVolumeSize)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used for what?
it misses explanation as containers arent stored here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to use https://github.com/openshift/microshift/blob/main/docs/contributor/rhel4edge_iso.md#disk-partitioning same explanation Unallocated disk space of 9GB size remains in the rhel volume group to be used by the CSI driver.
@jsliacan I had the same question just now pop up. also, what is the usage as that isnt explained to the user. ephemeral and persistent have clear usecases,... |
@jsliacan As of now maximum pvc size user can allocate |
943c6aa
to
f43c6e7
Compare
f43c6e7
to
0e332e6
Compare
This pr enable user to specify the size which is used by persistent volume in case of microshift preset. As of now we just extend the disk size to root mounted partition and free space (which used for pvc) is only 15GiB. Some users want to have more free space to consume it for pvc as per the workload and with this option now it is possible. ``` $ crc config set disk-size 50 $ crc config set persistent-volume-size 20 $ crc start [...] <crc_vm> $ sudo vgdisplay --- Volume group --- VG Name rhel System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 5 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 1 Act PV 1 VG Size <49.02 GiB PE Size 4.00 MiB Total PE 12549 Alloc PE / Size 7429 / <29.02 GiB Free PE / Size 5120 / 20.00 GiB VG UUID O7d5v9-F8HE-E0Dj-e9sE-1qgv-F74d-CZz34d ```
0e332e6
to
306fbb6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -91,6 +92,8 @@ func RegisterSettings(cfg *Config) { | |||
"Enable experimental features (true/false, default: false)") | |||
cfg.AddSetting(EmergencyLogin, false, ValidateBool, SuccessfullyApplied, | |||
"Enable emergency login for 'core' user. Password is randomly generated. (true/false, default: false)") | |||
cfg.AddSetting(PersistentVolumeSize, constants.DefaultPersistentVolumeSize, validatePersistentVolumeSize, SuccessfullyApplied, | |||
fmt.Sprintf("Total size in GiB of the persistent volume used by the CSI driver for %s preset (must be greater than or equal to '%d')", preset.Microshift, constants.DefaultPersistentVolumeSize)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh, sorry i forgot to mention this earlier, maybe we should use preset.Microshift.ForDisplay()
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anjannath since preset have string method %s
should able to get preset and Display is for end user display I think here they should know the preset
value instead of Display?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: anjannath The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@praveenkumar: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
This pr enable user to specify the size which is used by persistent volume in case of microshift preset. As of now we just extend the disk size to root mounted partition and free space (which used for pvc) is only 15GiB. Some users want to have more free space to consume it for pvc as per the workload and with this option now it is possible.
Fixes: Issue #3747