RHEL 8.6+ subscription-manager falsely detecting azure on install or register command (Unable to register VM)

Posted on

Hello.

I am trying to register RHEL 8.6 and 9 in a local hyper-v environment.

Network is testing fine, curl test to subscription URLs pass, but I believe I am encountering the azure false detection bug as in https://bugzilla.redhat.com/show_bug.cgi?id=2057053

Command line gives:

root@server: subscription-manager facts

Making request: GET http://169.254.169.254/metadata/instance?api-version=2021-02-01 {User-Agent: cloud-what/1.0, Accept-Encoding: gzip, deflate, Accept: /, Connection: keep-alive, Metadata: true}
Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information.

Logs show:

urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='169.254.169.254', port=80): Read timed out. (read timeout=10.0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 547, in main
return_code = self._do_command()
File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 2783, in _do_command
facts_dict = facts.get_facts()
File "/usr/lib64/python3.6/site-packages/subscription_manager/facts.py", line 78, in get_facts
facts = collector.get_all()
File "/usr/lib64/python3.6/site-packages/rhsmlib/facts/all.py", line 39, in get_all
fact_collector = fact_collector_cls(collected_hw_info=results)
File "/usr/lib64/python3.6/site-packages/rhsmlib/facts/cloud_facts.py", line 46, in init
self.cloud_provider = get_cloud_provider(self._collected_hw_info)
File "/usr/lib64/python3.6/site-packages/cloud_what/provider.py", line 156, in get_cloud_provider
metadata = cloud_provider.get_metadata()
File "/usr/lib64/python3.6/site-packages/cloud_what/providers/azure.py", line 236, in get_metadata
return super(AzureCloudProvider, self).get_metadata()
File "/usr/lib64/python3.6/site-packages/cloud_what/_base_provider.py", line 470, in get_metadata
return self._get_metadata_from_server()
File "/usr/lib64/python3.6/site-packages/cloud_what/providers/azure.py", line 196, in _get_metadata_from_server
metadata = super(AzureCloudProvider, self)._get_metadata_from_server()
File "/usr/lib64/python3.6/site-packages/cloud_what/_base_provider.py", line 401, in _get_metadata_from_server
headers=headers
File "/usr/lib64/python3.6/site-packages/cloud_what/providers/azure.py", line 189, in _get_data_from_server
return super(AzureCloudProvider, self)._get_data_from_server(data_type, url, headers)
File "/usr/lib64/python3.6/site-packages/cloud_what/_base_provider.py", line 384, in _get_data_from_server
response = self._session.send(prepared_http_req, timeout=self.TIMEOUT)
File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 529, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='169.254.169.254', port=80): Read timed out. (read timeout=10.0)

Anyone have a solution or workaround that could help?

Thanks

Responses