-
Notifications
You must be signed in to change notification settings - Fork 897
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 check_quota(:active_provisions) for Service MiqRequest invalid service_template. #16769
Fix check_quota(:active_provisions) for Service MiqRequest invalid service_template. #16769
Conversation
@miq_bot add_label bug, provisioning, services, gaprindashvili/yes |
Checked commit tinaafitz@0d6e974 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@miq-bot assign @gmcculloug |
@tinaafitz In the description It makes more sense to focus on the call to Also, some more background on the error condition (Service MiqRequest with an invalid service_template) would be useful for someone viewing this PR in the future. By which I mean, we determined that tasks were queued to a zone but never dispatched, it appears the Zone or automate role for the zone was disabled. This made the requests look like they were active, but were not being processed. Then the service_template for which the request was created was deleted causing the request to have an invalid service_template relationship. |
@gmcculloug Thank you for the feedback. I've updated the PR description with more detail. Please let me know if there's anything else you'd like me change. |
|
||
it "invalid service_template does not raise error" do | ||
requests = load_queue | ||
requests.first.update_attributes(:service_template => nil) |
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.
Does load_queue
only queue ServiceTemplateProvisionRequest
instances? In other words, are you sure this first request will by a ServiceTemplateProvisionRequest and therefore expect to have a service_template
relationship?
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.
@gmcculloug Yes, I am sure the first request will be a ServiceTemplateProvisionRequest since load_queue only queues ServiceTemplateProvisionRequest instances.
…_fix Fix check_quota(:active_provisions) for Service MiqRequest invalid service_template. (cherry picked from commit 8aa881f) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1533217
Gaprindashvili backport details:
|
…_fix Fix check_quota(:active_provisions) for Service MiqRequest invalid service_template. (cherry picked from commit 8aa881f) https://bugzilla.redhat.com/show_bug.cgi?id=1534589
Fine backport details:
|
…template_fix Fix check_quota(:active_provisions) for Service MiqRequest invalid service_template. (cherry picked from commit 8aa881f) https://bugzilla.redhat.com/show_bug.cgi?id=1534589
Prevent error in check_quota(:active_provisions) for Service MiqRequests with invalid service_templates.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1531914
We recently changed the active_provision code to calculate quota values for Service requests by looking at the request service_template.service_resource information.
The customer supplied data showed Service requests miq_tasks queued to a zone but never dispatched, it appears the Zone or automate role for the zone was disabled. This made the Service requests look like they were active, but were not being processed. Then the service_template for which the Service request was created was deleted causing the Service request to have an invalid service_template relationship.
Although the issue impacts any calls to the check_quota(:active_provisions) method, the customer encountered it in the request.check_quota(:active_provisions) call here:
RedHat Automate domain method:
/Infrastructure/VM/Provisioning/Placement/vmware_best_fit_with_scope
Since the vmware_best_fit_with_scope method is used during VM Provisioning, all provisions would fail if the active_quota calculations encountered a single Service MiqRequest with an invalid service_template, even if Quota is not being used.