Skip to content
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

Fix cloud provision quota memory and cpu counting #22517

Merged

Conversation

jaywcarman
Copy link
Member

Cloud providers are not required to use flavors to set VM memory and cpu allocation during provisioning (for example IbmCloud::PowerVirtualServers::CloudManager). These 'number_of_cpus' and 'memory' methods are expected to return int values. In the case where a 'cloud' type provision is associated with a flavor without 'memory' or 'cpus' values the non-cloud logic is better than returning nil. Depending on how the provider implements the provision request, the return value will be something useful or just 0, avoiding raising an exception.

This partially fixes the following provider issue. I also included information on how Flavor is used in PowerVS:

Cloud providers are not required to use flavors to set VM memory and cpu
allocation during provisioning (for example
IbmCloud::PowerVirtualServers::CloudManager). These 'number_of_cpus' and
'memory' methods are expected to return int values. In the case where a
'cloud' type provision is associated with a flavor without 'memory' or
'cpus' values the non-cloud logic is better than returning nil.
Depending on how the provider implements the provision request, the
return value will be something useful or just 0, avoiding raising an
exception.
@jaywcarman jaywcarman force-pushed the fix_cloud_provision_quota_cpu_mem_calcs branch from ac87c1f to 8c04616 Compare May 19, 2023 16:36
@miq-bot
Copy link
Member

miq-bot commented May 19, 2023

Checked commit jaywcarman@8c04616 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. 👍

@kbrock kbrock self-assigned this May 30, 2023
@kbrock kbrock merged commit 1919261 into ManageIQ:master May 30, 2023
@jaywcarman jaywcarman deleted the fix_cloud_provision_quota_cpu_mem_calcs branch June 6, 2023 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants