Bug 1755412

Summary: Setting "oreg_url: registry.redhat.io" fails with error
Product: Red Hat Enterprise Virtualization Manager Reporter: Gajanan <gchakkar>
Component: ovirt-engine-metricsAssignee: Shirly Radco <sradco>
Status: CLOSED CURRENTRELEASE QA Contact: Guilherme Santos <gdeolive>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.3.5CC: lsvaty, mtessun, rdlugyhe, sradco
Target Milestone: ovirt-4.3.11Keywords: ZStream
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: rhv-4.4.0-29 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-16 13:53:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Metrics RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1827177    
Bug Blocks:    

Description Gajanan 2019-09-25 13:08:53 UTC
Description of problem:

In /etc/ovirt-engine-metrics/config.yml.d/metrics-store-config.yml on the RHV-M there is a below parameter, 

# URL of the container registry. Default is 'registry.redhat.io'
# oreg_url: registry.redhat.io

When I uncommented oreg_url and ran the playbook to install the metric store vm, it failed with error below:

 [this error is seen at Chapter 2.2 in the installation guide]

https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/html-single/metrics_store_installation_guide/index
 
~~~
Failure summary:
 
 
  1. Hosts:    master0.gsslab.pnq2.redhat.com
     Play:     OpenShift Health Checks
     Task:     Run health checks (install) - EL
 Message:  One or more checks failed
     Details:  check "docker_image_availability":
               An unhandled exception occurred while templating '{{ (l_host_is_master and l_host_is_etcd) | ternary([etcd_image], []) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ osm_etcd_image }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ l_default_osm_etcd_image }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ etcd_image_dict[openshift_deployment_type] | lib_utils_oo_oreg_image((oreg_url | default('None'))) }}'. Error was a <class 'ansible.errors.AnsibleFilterError'>, original message: oreg_url malformed: registry.redhat.io
               Traceback (most recent call last):
                 File "/usr/share/ansible/openshift-ansible/roles/openshift_health_checker/action_plugins/openshift_health_check.py", line 225, in run_check
                   result = check.run()
                 File "/usr/share/ansible/openshift-ansible/roles/openshift_health_checker/openshift_checks/docker_image_availability.py", line 108, in run
                   self.get_var('openshift_health_check_required_images'))
                 File "/usr/share/ansible/openshift-ansible/roles/openshift_health_checker/openshift_checks/__init__.py", line 103, in template_var
                   return self._templar.template(var_to_template)
                 File "/usr/lib/python2.7/site-packages/ansible/template/__init__.py", line 479, in template
                   disable_lookups=disable_lookups,
                 File "/usr/lib/python2.7/site-packages/ansible/template/__init__.py", line 722, in do_template
                   res = j2_concat(rf)
                 File "<template>", line 9, in root
                 File "/usr/lib/python2.7/site-packages/ansible/template/__init__.py", line 220, in resolve
                   val = super(AnsibleContext, self).resolve(key)
                 File "/usr/lib/python2.7/site-packages/jinja2/runtime.py", line 153, in resolve
                   return self.parent[key]
                 File "/usr/lib/python2.7/site-packages/ansible/template/vars.py", line 113, in __getitem__
                   "Error was a %s, original message: %s" % (to_native(variable), type(e), msg))
               AnsibleError: An unhandled exception occurred while templating '{{ (l_host_is_master and l_host_is_etcd) | ternary([etcd_image], []) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ osm_etcd_image }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ l_default_osm_etcd_image }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ etcd_image_dict[openshift_deployment_type] | lib_utils_oo_oreg_image((oreg_url | default('None'))) }}'. Error was a <class 'ansible.errors.AnsibleFilterError'>, original message: oreg_url malformed: registry.redhat.io
~~~

Workaround: 

To fix this, I added “oreg_url: registry.redhat.io/openshift3/ose-${component}:${version}” in “vars.yaml” on the metrics-store-installer vm. 

and installated successfully then.