Description of problem: Unable to collect performance data for Azure with below error [----] E, [2018-10-30T03:43:33.101275 #3838:e91114] ERROR -- : [Azure::Armrest::BadRequestException]: No registered resource provider found for location 'germanycentral' and API version '2014-04-01' for type 'virtualMachines'. The supported api-versions are '2015-05-01-preview, 2015-06-15, 2016-03-30, 2016-04-30-preview, 2016-08-30, 2017-03-30, 2017-12-01, 2018-04-01, 2018-06-01, 2018-10-01'. The supported locations are 'germanycentral, germanynortheast'. Method:[block in method_missing] Version-Release number of selected component (if applicable): 5.9.4.7 How reproducible: Everytime at Cu environment Steps to Reproduce: 1. Add Azure provider in germanycentral region 2. enable performance capture 3. Actual results: performance capture fails with ----] E, [2018-10-30T03:43:33.100881 #3838:e91114] ERROR -- : MIQ(ManageIQ::Providers::Azure::CloudManager::MetricsCapture#get_counters) Unhandled exception during counter collection: ocp04b01/ocp04-rg Expected results: Metrics capture should succeed Additional info:
Dan Can you verify this just requires a backport of: https://github.com/ManageIQ/manageiq-providers-azure/pull/98 thanks Bronagh
Bronagh, yep, that should do it.
Actually, it looks like we already support the Germany endpoint in 5.9. https://github.com/ManageIQ/manageiq-providers-azure/blob/gaprindashvili/app/models/manageiq/providers/azure/manager_mixin.rb#L59 The api-version should be set via config/settings.yml. I will continue to dig.
Hm, I noticed that this error is popping up from metrics. I wonder if insights registered, because it's not necessarily registered by default in some regions. Try running this command: az provider show -n Microsoft.Insights -o table If the ProviderState isn't "registered" then run this: az provider register -n Microsoft.Insights If it is registered, then it must be something else and I'll keep digging. Please let me know.
Seems that the provider is registered az provider show -n Microsoft.Insights -o table Namespace RegistrationState ------------------ ------------------- microsoft.insights Registered
It's looking to me like Azure changed the endpoint for listing metric definitions, which means metrics is broken everywhere now. I'll have to update the azure-armrest gem asap, and get it backported.
Ah, I forgot there's an "old" metrics listing (i.e. diagnostics, for those vm's that have it enabled) and a new one. The new one has a different endpoint, and is cross-platform, but doesn't collect the information we want. I think the short version is that the old version is simply not supported on that region, and using different api-version strings does not help, even if the insights provider is enabled. All we can do is add a catch for Azure::Armrest::BadRequestException and, if we hit that, assume that it's not supported for that region. I'll submit a PR soon.
https://github.com/ManageIQ/manageiq-providers-azure/pull/302
New commit detected on ManageIQ/manageiq-providers-azure/hammer: https://github.com/ManageIQ/manageiq-providers-azure/commit/3e5ba61abfd42d3a3b13d135b2aa2a04c98b4162 commit 3e5ba61abfd42d3a3b13d135b2aa2a04c98b4162 Author: Adam Grare <agrare> AuthorDate: Thu Nov 8 10:55:32 2018 -0500 Commit: Adam Grare <agrare> CommitDate: Thu Nov 8 10:55:32 2018 -0500 Merge pull request #302 from djberg96/metrics_unsupported Handle regions where metrics are unsupported (cherry picked from commit a94f2b03a21ac70f07e11ef327740e6af8d889ce) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1645117 app/models/manageiq/providers/azure/cloud_manager/metrics_capture.rb | 5 + spec/models/manageiq/providers/azure/cloud_manager/metrics_capture_spec.rb | 48 +- 2 files changed, 52 insertions(+), 1 deletion(-)
Verified in 5.10.0.29