Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1804117

Summary: [Docs] Document how to setup the RHV metrics store using Satellite
Product: Red Hat Enterprise Virtualization Manager Reporter: Shirly Radco <sradco>
Component: DocumentationAssignee: Eli Marcus <emarcus>
Status: CLOSED CURRENTRELEASE QA Contact: Guilherme Santos <gdeolive>
Severity: high Docs Contact:
Priority: high    
Version: 4.3.8CC: emarcus, gchakkar, gdeolive, lleistne, lsurette, mkalinin, pelauter, srevivo, tburke
Target Milestone: ovirt-4.3.9Keywords: Documentation
Target Release: ---Flags: emarcus: needinfo-
emarcus: needinfo-
emarcus: needinfo-
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Starting with this release, it is now possible to install Metrics Store on a disconnected system using Satellite.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 15:16:28 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: 1711873    
Bug Blocks:    

Description Shirly Radco 2020-02-18 09:13:56 UTC
Description of problem:
It is now possible to install the metrics store using Satellite.

The instructions for this installation is similar to the regular installation and is documented also in the role README-Satellite.md.



In order to run the installation using Satellite, follow the steps below.

##Prerequisites

Please see the following documentation for configuring the Satellite server:
https://developers.redhat.com/blog/2019/04/08/red-hat-openshift-3-11-disconnected-installation-using-satellite-docker-registry/

### Required Images
Please make sure you have the following Docker images synchronized in you Satellite server product:
openshift3/oauth-proxy
openshift3/ose-console
openshift3/ose-control-plane
openshift3/ose-deployer
openshift3/ose-docker-registry
openshift3/ose-haproxy-router
openshift3/ose-logging-auth-proxy
openshift3/ose-logging-curator5
openshift3/ose-logging-elasticsearch5
openshift3/ose-logging-fluentd
openshift3/ose-logging-kibana5
openshift3/ose-node
openshift3/ose-pod
openshift3/ose-web-console
openshift3/registry-console
rhel7/etcd

### Required qcow image

Please go to https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.6/x86_64/product-software
In the Product Software tab, Download the `Red Hat Enterprise Linux KVM Guest Image` to the engine machine.

## Running the role:

1. On the Manager machine, copy /etc/ovirt-engine-metrics/metrics-store-config-satellite.yml.example to metrics-store-config.yml:
```
# cp /etc/ovirt-engine-metrics/metrics-store-config-satellite.yml.example /etc/ovirt-engine-metrics/config.yml.d/metrics-store-config.yml
```
2. Update the values of /etc/ovirt-engine-metrics/metrics-store-config.yml to match the details of your specific environment:
```
# vi /etc/ovirt-engine-metrics/config.yml.d/metrics-store-config.yml
```

3. On the Manager machine, copy /etc/ovirt-engine-metrics/secure_vars_satellite.yaml.example to /etc/ovirt-engine-metrics/secure_vars.yaml:
```
# cp /etc/ovirt-engine-metrics/secure_vars_satellite.yaml.example /etc/ovirt-engine-metrics/secure_vars.yaml
```

4. Update the values of /etc/ovirt-engine-metrics/secure_vars.yaml to match the details of your specific environment:
```
# vi /etc/ovirt-engine-metrics/secure_vars.yaml
```

5. Encrypt secure_vars.yaml file
```
# ansible-vault encrypt /etc/ovirt-engine-metrics/secure_vars.yaml
```

6. Go to ovirt-engine-metrics repo:
```
# cd /usr/share/ovirt-engine-metrics
```

7. Run the metrics store installation playbook that creates the metrics store installer virtual machine
```
# ANSIBLE_JINJA2_EXTENSIONS="jinja2.ext.do" ./configure_ovirt_machines_for_metrics.sh \
  --playbook=ovirt-metrics-store-installation.yml --ask-vault-pass -vvv
```

8. Log into the admin portal and review the metrics store installer virtual machine creation.

9. Log into the metrics store installer virtual machine
```
# ssh root@<metrics-store-installer ip or fqdn>
```

10. Run the ansible playbook that deploys OpenShift on the created vms

```
# ANSIBLE_CONFIG="/usr/share/ansible/openshift-ansible/ansible.cfg" \
  ANSIBLE_ROLES_PATH="/usr/share/ansible/roles/:/usr/share/ansible/openshift-ansible/roles" \
  ansible-playbook -i integ.ini install_okd.yaml -e @vars.yaml -e @secure_vars.yaml --ask-vault-pass -vvv

Comment 1 Gajanan 2020-03-05 20:17:04 UTC
The github link talks about synchronizing the 16 docker images on the Satellite server, but there are no steps to how to achieve the same. 

I used RHN Satellite 6 for the first time, it took a lot of time for me to figure this out but a user who is already using the Satellite, it might be easy for him to figure this out. 

I] A precise steps for how to do this will help customer to do it quickly. 

Below are the steps I performed here: 

1) Create Product

Login to Satellite > Content > Product > Name: 'ocp311' > Save.

2) Now create Repositories in this Product : 'ocp311'

Content > Product > Slect ocp311 > New repository >

example:

Name: openshift3/oauth-proxy

Type: docker (select from the drop down)

Upstream URL: https://registry.access.redhat.com
Upstream Repository: openshift3/oauth-proxy
Upstream Username: <leave it empty>
Upstream Password: <leave it empty>

Did similar steps for all the remaining 15 docker images that need to be synchronized.

After this selected all the 16 Repositories and click on "Sync Now" to synchronize all.

Comment 2 Gajanan 2020-03-05 20:25:49 UTC
Also add the details of how to create an activation key and what repositories are need to be synchronized in it. 

To create activation key:

~~
login to Satellite UI > Content > Authorization keys> Create Activation key 
~~~

for example create with name ocp311 

Further, in the key, enable the Red Hat Virtualization Manager subscription and make sure to enabled and synchronize the below repos in it:

                "rhel-7-server-rpms", 
                "rhel-7-server-extras-rpms", 
                "rhel-7-server-optional-rpms", 
                "rhel-7-server-ansible-2.6-rpms", 
                "rhel-7-server-ose-3.11-rpms"
            
So how did i knew which repos are required here ? 

When i created the key, I just enabled the repos which are required by RHV-Manager, but this was not sufficient. 
When running the playbook I got the error that above repos are required, I missed to record the error.

Comment 3 Gajanan 2020-03-05 20:27:04 UTC
Steps to enable the required repos: 

Satellite UI > Content > Activation Keys > ocp311 > Repository Sets > Selected the above repos and then from "select action" dropdown performed "Overide to Enabled"