-
Notifications
You must be signed in to change notification settings - Fork 898
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
Delegate vm ram_size to hardware #12938
Conversation
20971dc
to
b4d971f
Compare
b4d971f
to
9e1a481
Compare
Checked commits kbrock/manageiq@7b089db~...9e1a481 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
|
||
def ram_size_in_bytes(check_state = false) | ||
ram_size(check_state).to_i * 1.megabyte | ||
state == 'on' ? ram_size : 0 |
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.
note: this is defining ram_size_by_state
not ram_size_in_bytes
display in github is confusing
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.
Looks good 👍
Fixes bug introduced in ManageIQ#12938
@kbrock I'm seeing a
while trying to open a summary of a (openstack) template. I'm thinking this could be related to 9e1a481 (the bit in |
When (if) backporting to euwe, please do together with #13125 |
Delegate vm ram_size to hardware
Backported to Euwe via #14167 |
High level:
All
aggressive_vcpus_recommended_change_pct
useram_size
orcpu_total_cores
(see #12911) for calculations.This sets us up to have 2 of the 3 parameters sql friendly.
Low level:
ram_size
(also calledmemory_mb
andmem_cpu
) is delegated fromvms
tohardware
.Currently this delegate is implemented in ruby, this change exposes it to use a delegator and to implement the arel.
Also, for
ram_size
there is a secondary parameter to look atvm#state
. I could only ever find this method call from within theVm
class itself. Separating these methods apart allows us to simplify the calculation and use pure sql forram_size
.related to #12733 and #12911
https://bugzilla.redhat.com/show_bug.cgi?id=1395743