-
Notifications
You must be signed in to change notification settings - Fork 62
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
Provide max memory on VM reconfigure #224
Conversation
Since ManageIQ doesn't support max memory, there is a need to provider a value for it when modifying the vm memory limit. The max memory will be calculated as follow: 1. Fetch actual VM from RHV to get current max memory 2. If new actual memory is higher than existing max memory, the max memory will be updated as well: a. If actual memory is lesser than 1 TB, then set max memory to 4 * actual memory b. If actual memory equals or greater than 1TB, set max memory the same value as actual memory Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1534520
Checked commit masayag@42bfd8a with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 app/models/manageiq/providers/redhat/infra_manager/ovirt_services/strategies/v4.rb
|
:guaranteed => guaranteed | ||
} | ||
:guaranteed => guaranteed, | ||
:max => (max if supports_max) |
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.
With this code if supports_max
is false
the value here will be nil
. Should we not set it at all 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.
the .compact
at the end of the hash will remove it from the map if the value is null.
The alternative is extracting it into a local variable and add 'max' conditionally which will add complexity to this method.
:guaranteed => guaranteed | ||
} | ||
:guaranteed => guaranteed, | ||
:max => (max if supports_max) |
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.
Same as above
@miq-bot add_labels bug, gaprindashvili/yes |
@masayag The BZ has 5.8.z flag, can/should this go to Fine branch too? |
Provide max memory on VM reconfigure (cherry picked from commit a3c14af) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1553384
Gaprindashvili backport details:
|
Yes, please backport also to 5.8 Satoe. Thanks |
I think it is ok. And I think we have enough specs to feel somewhat
comfortable.
…On Tue, Apr 10, 2018, 11:33 AM Moti Asayag ***@***.***> wrote:
@borod108 <https://github.com/borod108> Do you see any issue with
backporting #22
<#22> to FINE
branch ? It looks safe to me to backport it, but I'd like to be certain
about it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#224 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADH369TsInoRJwfCMJIGM6p4V5FP_1uJks5tnEszgaJpZM4SidDl>
.
|
Fine backport (to manageiq repo) details:
|
Since ManageIQ doesn't support max memory, there is a need to provider a
value for it when modifying the vm memory limit.
The max memory will be calculated as follow:
be updated as well:
a. If actual memory is lesser than 1 TB, then set max memory to 4 * actual memory
b. If actual memory equals or greater than 1TB, set max memory the same value as
actual memory
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1534520