-
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
Support memory limit #61
Conversation
@@ -108,4 +108,19 @@ def filter_allowed_hosts(all_hosts) | |||
ovirt_services = ManageIQ::Providers::Redhat::InfraManager::OvirtServices::Builder.new(ems).build(:use_highest_supported_version => true).new(:ems => ems) | |||
ovirt_services.filter_allowed_hosts(self, all_hosts) | |||
end | |||
|
|||
def validate_memory_limit(_field, values, dlg, fld, _value) |
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.
usually, generic validation methods are defined in a higher parent-class, however, since this method contains a specific RHV logic, I defined it in this file.
f737bfa
to
f99581a
Compare
limited = get_value(values[:memory_limit]) | ||
return nil unless limited | ||
|
||
ems_version = source_ems.api_version[/\d+\.\d+/x] |
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 think this and the next line should be in a method, like "supported_in_version?" or something like that.
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.
done
return if vm_memory.zero? && memory_limit.zero? | ||
|
||
limit_message = ", total: <#{memory_limit}>" unless memory_limit.zero? | ||
_log.info "Setting memory to:<#{vm_memory.inspect}>#{limit_message}" |
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.
rubocop wanted parentheses.
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.
done.
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.
Great, just acouple of small things.
0bd0c0b
to
70577b9
Compare
70577b9
to
075d848
Compare
@borod108 while this patch is verified to work with use_ovirt_engine_sdk = true, the total memory will be ignored if using v3 (use_ovirt_engine_sdk = false). Do you think we should block this action in such case ? Or just ignore the provided parameter ? |
@masayag I think it should be either blocked, or at least a warning should be shown or it should be mentioned in the description of this field. But the best option, I think, is to block it... |
@@ -146,4 +146,9 @@ def unsupported_migration_options | |||
def supports_migrate_for_all?(vms) | |||
vms.map(&:ems_cluster).uniq.compact.size == 1 | |||
end | |||
|
|||
def version_higher_than?(version) |
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.
@matobet perhaps this can be useful for 'import vm' version checks
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.
Exactly! CC @smelamud
075d848
to
f79043a
Compare
@borod108 so i added the following to this patch:
|
Memory limit feature was introduced in RHV 4.1. It is already supported by manageiq as part of the vm provision process. The patch adds support for total memory for providers of version 4.1 and above. https://bugzilla.redhat.com/show_bug.cgi?id=1461560
f79043a
to
51d4cd3
Compare
Checked commit masayag@51d4cd3 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/models/manageiq/providers/redhat/infra_manager/ovirt_services/strategies/v3.rb
app/models/manageiq/providers/redhat/infra_manager/provision_workflow.rb
|
@miq-bot add_label fine/yes |
Backported to Fine via ManageIQ/manageiq#17608 |
Memory limit feature was introduced in RHV 4.1.
It is already supported by manageiq as part of the vm provision process.
The patch adds support for total memory for providers of version 4.1 and
above, both for VM provision and for the VM refresh process.
https://bugzilla.redhat.com/show_bug.cgi?id=1461560