-
Notifications
You must be signed in to change notification settings - Fork 120
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
Calculate quota using service dialogs overrides. #203
Conversation
@miq-bot assign @gmcculloug |
@tinaafitz Please review |
e62c97e
to
b11a333
Compare
Changed requested method to use dialog overrides in quota calculations. Modified requested method to calculate quota based on dialog values for: number_of_sockets, cores_per_socket, number_of_cpus, vm_memory and storage. This can be tested by using service dialogs using these values. https://bugzilla.redhat.com/show_bug.cgi?id=1497912 Testing Create a service using service dialog overrides values for the above values. You can use one or more override values. Order the service, change some values and run. Note: We are honoring number_of_vms in a service dialog but not using number_of_vms in quota calculations. Doing quota calculations for number_of_vms in a service dialog will be in a followup PR. I am including screenshots of a dialog using some values.
b11a333
to
53f0acd
Compare
@billfitzgerald0120 Looks good. |
@mkanoor Please review. |
@mkanoor bump |
|
||
def recalculate_number_of_cpus(resource, override_number_of_sockets, override_cores_per_socket) | ||
$evm.log(:info, "Recalculating the number_of_cpus resource: #{resource} override_number_of_sockets: #{override_number_of_sockets} override_cores_per_socket: #{override_cores_per_socket}") | ||
if override_number_of_sockets.positive? && override_cores_per_socket.positive? |
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.
@billfitzgerald0120 Is the positive check because a user can enter a negative value or is it to protect from a user not entering any value and it stays nil?
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.
It is to protect from an user not entering a value
f69c6aa
to
7f37213
Compare
@tinaafitz Fixed rubocop warning, Please Review |
:memory => get_total_requested(options_hash, :vm_memory), | ||
:cpu => get_total_requested(options_hash, :number_of_cpus), | ||
:vms => get_total_requested(options_hash, :number_of_vms)} | ||
@total_vms = get_total_requested(options_hash, :number_of_vms) |
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.
@billfitzgerald0120
Can we just use a total_vms as a local variable and default it to 1 for reconfigure request if its missing.
…rastructure. If you specify number_of_vms in a dialog override, the changes will multiple this value by memory, storage and number_of_cpus for quota value. If you are requesting 1gb of memory, 1gb of storage and 1 cpu and override number_of_vms to 3, quota will now check for 3gb of memory, 3gb of storage, 3 cpus and 3 vms. Modified a test and added a new test. Fixed rubocop warning. Changed total_vms to a local variable.
7f37213
to
8585d8c
Compare
Checked commits billfitzgerald0120/manageiq-content@53f0acd~...8585d8c with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@mkanoor Changed total_vms to a local variable, please review. |
@billfitzgerald0120 https://bugzilla.redhat.com/show_bug.cgi?id=1497912 is already CLOSED/CURRENTRELEASE. Does this PR fix a different BZ? |
@miq-bot add_label gaprindashvili/yes |
Calculate quota using service dialogs overrides. (cherry picked from commit daf5f50) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1536677
Gaprindashvili backport details:
|
Calculate quota using service dialogs overrides. (cherry picked from commit daf5f50) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1489507
Fine backport details:
|
Changed requested method to use dialog overrides in quota calculations.
Modified requested method to calculate quota based on dialog values for:
number_of_sockets, cores_per_socket, number_of_cpus, vm_memory and storage.
This can be tested by using service dialogs using these values.
https://bugzilla.redhat.com/show_bug.cgi?id=1497912https://bugzilla.redhat.com/show_bug.cgi?id=1456819
Testing
Create a service using service dialog overrides values for the above values.
You can use one or more override values.
Order the service, change some values and run.
Note: Latest commit added quota calculations for number_of_vms in a service dialog for Infrastructure.
I am including screenshots of a dialog using some values.