-
Notifications
You must be signed in to change notification settings - Fork 36
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
Override quota calculation methods #469
Override quota calculation methods #469
Conversation
f50c21b
to
28c5bfe
Compare
@@ -59,6 +59,15 @@ def raw_delete_image | |||
_log.error("image=[#{name}], error: #{e}") | |||
end | |||
|
|||
def number_of_cpus_for_request(request) | |||
flavor_obj = Flavor.find_by(:name => request.options[:sys_type][1]) |
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 you want request.get_option(:sys_type)
here. Also we'll need to include the EMS ID so we don't find a flavor from another EMS
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 you want
request.get_option(:sys_type)
here.
That wasn't working for me, because we're not using the flavors
table index as the index for this form.
(byebug) request.options[:sys_type]
[1, "s922"]
(byebug) Flavor.find(request.get_option(:sys_type)).name
Flavor Load (93.2ms) SELECT "flavors".* FROM "flavors" WHERE "flavors"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
Flavor Inst Including Associations (0.2ms - 1rows)
"e980"
(byebug) Flavor.find_by(:ems_id => ems_id, :name => "s922").name
PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 2, in use: 2, waiting_in_queue: 0
Flavor Load (42.8ms) SELECT "flavors".* FROM "flavors" WHERE "flavors"."ems_id" = $1 AND "flavors"."name" = $2 LIMIT $3 [["ems_id", 3], ["name", "s922"], ["LIMIT", 1]]
PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 3, in use: 3, waiting_in_queue: 0
Flavor Inst Including Associations (0.3ms - 1rows)
TRANSACTION (20.1ms) BEGIN
"s922"
(byebug) Flavor.find_by(:ems_id => ems_id, :name => "s922").id
TRANSACTION (5508.8ms) BEGIN
Flavor Load (13.9ms) SELECT "flavors".* FROM "flavors" WHERE "flavors"."ems_id" = $1 AND "flavors"."name" = $2 LIMIT $3 [["ems_id", 3], ["name", "s922"], ["LIMIT", 1]]
Flavor Inst Including Associations (0.6ms - 1rows)
2
This list is generated here, where it looks like the index is just an enumeration instead of mapping to the Flavor ID.
Also we'll need to include the EMS ID so we don't find a flavor from another EMS
Nice catch, I'll fix this
28c5bfe
to
12e019e
Compare
e61272b
to
448f3a6
Compare
448f3a6
to
66c9348
Compare
93c7aaa
to
25fd85a
Compare
25fd85a
to
09e6a9a
Compare
PowerVS uses the more typical Flavor style of cpu allocation for SAP profiles. For non SAP profiles, the Flavor only sets the host type and the user is allowed to request any number of cpus using the entitled_processors form option.
PowerVS uses the more typical Flavor style of memory allocation for SAP profiles. For non SAP profiles, the Flavor only sets the host type and the user is allowed to request any amount of memory.
09e6a9a
to
62de0a0
Compare
Checked commits jaywcarman/manageiq-providers-ibm_cloud@9846926~...62de0a0 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint |
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
3 similar comments
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
Depends on:
ManageIQ/manageiq#22680
PowerVS uses the more typical Flavor style of cpu allocation for SAP
profiles. For non SAP profiles, the Flavor only set the host type and
the user is allowed to request any number of cpus using the
entitled_processors form option.