Menu Close

Chapter 4. Installing the resource optimization service

Installing resource optimization involves installing packages, configuring settings and enabling local services. This can be done manually, or with an Ansible playbook provided by Red Hat.

Note

Pay as you go (PAYG) customers need to configure the insights-client to use basic authentication. Reference the Configuring Basic Authentication for Red Hat Insights documentation for more details. If your RHEL system is using a subscription, you may use basic authentication, but it is not required: the Insights client can use the already-existing RHSM data.

4.1. Using Ansible to enable resource optimization

This procedure will install the Ansible client, and run the Ansible Playbook on your system.

Cloud marketplace images on Amazon Web Services (AWS) are configured to use repositories hosted by the cloud provider. Currently, these repositories do not contain the Ansible client, so you must perform the following steps to enable the Ansible repository on your cloud marketplace - managed RHEL system.

4.1.1. Installing Ansible

The use of Ansible is recommended to expedite the installation process.

Procedure on RHEL 8

  1. Install Ansible:

    # yum install ansible -y

Procedure on RHEL 7

  1. Enable the Subscription-Manager repository and register the system

    # subscription-manager config --rhsm.manage_repos=1
    # subscription-manager register
  2. Optionally, attach your system to a subscription pool

    # subscription-manager attach --pool xxxxxxxx
  3. Enable the required Ansible repository.

    # subscription-manager repos --enable=rhel-7-server-ansible-2.9-rpms
  4. Install Ansible:

    # yum install ansible -y
  5. If you are using RHEL PAYG and want to use RHUI update servers only, disable the Subscription-Manager repository:

    # subscription-manager config --rhsm.manage_repos=0

4.1.2. Installing the resource optimization service

Once Ansible is installed, proceed to complete the installation of the resource optimization service.

Procedure

  1. Download the Ansible Playbook with the following command:

    $ curl -O https://raw.githubusercontent.com/RedHatInsights/ros-backend/v1.0/ansible-playbooks/ros_install_and_set_up.yml
  2. Set localhost in Ansible inventory by appending the line localhost to /etc/ansible/hosts.
  3. Run the Ansible Playbook:

    # ansible-playbook -c local ros_install_and_set_up.yml

The system will show in Insights immediately in a "Waiting for data" state, and data and suggestions will be available the day after registering.

Verification step

Data files with a timestamp will appear under /var/log/pcp/pmlogger/ros and after a few minutes, you can verify metrics are being collected:

$ ls -l /var/log/pcp/pmlogger/ros
$ pmlogsummary /var/log/pcp/pmlogger/ros/

4.2. Manually installing resource optimization service

Procedure

If you choose not to utilize Ansible for installation, use the following manual installation procedure:

  1. Ensure the latest version of insights-client is installed

    $ yum update insights-client
  2. Set core_collect=True in /etc/insights-client/insights-client.conf
  3. Install the Performance Co-Pilot (PCP) toolkit.

    $ sudo yum install pcp
  4. Create the PCP configuration file /var/lib/pcp/config/pmlogger/config.ros with this content:

    log mandatory on default {
      hinv.ncpu
      mem.physmem
      mem.util.available
      disk.dev.total
      kernel.all.cpu.idle
      kernel.all.pressure.cpu.some.avg
      kernel.all.pressure.io.full.avg
      kernel.all.pressure.io.some.avg
      kernel.all.pressure.memory.full.avg
      kernel.all.pressure.memory.some.avg
    }
    [access]
    disallow .* : all;
    disallow :* : all;
    allow local:* : enquire;
  5. To configure pmlogger to gather the metrics required by resource optimization, add this line to /etc/pcp/pmlogger/control.d/local:

    LOCALHOSTNAME	n   y	PCP_LOG_DIR/pmlogger/ros	-r -T24h10m -c config.ros -v 100Mb
  6. Start and enable the required PCP services.

    $ sudo systemctl enable pmcd pmlogger
    $ sudo systemctl start pmcd pmlogger
  7. Re-register insights-client and upload the archive. The system will show in Insights immediately in a "Waiting for data" state, and data and suggestions will be available the day after registering.

    $ sudo insights-client --register

Verification step

Data files with a timestamp will appear under /var/log/pcp/pmlogger/ros and after a few minutes, you can verify metrics are being collected:

$ ls -l /var/log/pcp/pmlogger/ros
$ pmlogsummary /var/log/pcp/pmlogger/ros/