Registering a Management Station

Register a management station with OS Management Hub by using the profile for the management station and installing the Management Agent.

Upon registration, OS Management Hub attaches the required software sources to the station instance (Oracle Linux 8 BaseOS and Oracle Linux 8 Appstream). This ensures OS Management Hub can provide updates to the instance acting as the station.

Before You Begin

To successfully register a management station with the OS Management Hub service, complete the following:

Install Required Packages

The management station runs as an Apache server application in its role as a network proxy and local yum mirror for the OS Management Hub service. You must install the required Apache web server and start and enable the httpd service.

If your management station is using SELinux, you must also install the policycoreutils-python-utils package, which provides the necessary utilities for managing SELinux.

  1. Log into the instance as a user with sudo privileges.
  2. Install the required Apache packages.
    sudo dnf install -y httpd mod_ssl openssl
  3. Start and enable the httpd service.
    sudo systemctl start httpd
    sudo systemctl enable httpd
  4. Install the required SELinux package and any dependencies.
    sudo dnf install -y policycoreutils-python-utils
    

Add the Management Station Profile to the Instance

Add the management station profile to the instance. The profile identifies the instance as a management station. The profile can be used to register only a single management station. You can't reuse management station profiles.
  1. In the Console, copy the contents of the management station profile.
    1. Open the navigation menu and click Observability & Management. Under OS Management Hub, click Management stations.
    2. Click the name of the management station whose profile you want to use.
    3. Click View Profile.
    4. Copy the contents of the profile.
  2. Log in to the instance as a user with sudo privileges
  3. Create the /etc/osmh-profile file (with no file extension on the filename) using a text editor. For example:
    sudo vi /etc/osmh-profile
  4. Paste the profile contents that you copied from the Console and save the file.

Install the Management Agent

Install the Management Agent software on the management station instance. OS Management Hub requires that a Management Agent be installed on the instance and provides a service plugin to the Management Agent service.
Note

For more detailed steps about installing the Management Agent software, see Installing Management Agents.
  1. Verify /etc/sudoers includes /etc/sudoers.d:
    sudo visudo

    Confirm the following lines are present. If not, add them and save the file.

    ## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
    #includedir /etc/sudoers.d
  2. Install required packages. This includes JDK8 or JRE8 (minimum 1.8u281 or a later 1.8 version).

    Java Development Kit (JDK) or Java Runtime Environment (JRE) must be installed on the instance before you install the Management Agent software. The Management Agent requires JDK8 only.

    sudo dnf install -y java-1.8.0-openjdk
  3. Set the JAVA_HOME environmental variable to use JDK8. Setting the variable ensures MACS uses the correct Java version when newer versions are on the system.
    JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk ; export JAVA_HOME
  4. Navigate to the directory that contains the downloaded Management Agent software RPM file and run the following command to install the RPM file:
    sudo --preserve-env=JAVA_HOME dnf install -y <rpm_file_name>.rpm

Set Up the Management Agent

Create the Management Agent response file on the management station instance and configure the response file to use the Management Agent with the OS Management Hub service plugin to register the instance with OS Management Hub service

Note

For more detailed steps about installing the Management Agent software, see Installing Management Agents.
  1. Configure the Management Agent plugin to run as root. The OS Management Hub plugin needs to run as root to patch the instance. For example:
    sudo tee /etc/sudoers.d/mgmt_agent <<EOF
    ## Allows Management Agent to change ownership of deployed External Plugin
    mgmt_agent ALL=(ALL) NOPASSWD:/opt/oracle/mgmt_agent/agent_inst/bin/chown_recursive_ep.sh
    ## Allows Management Agent to run External Plugin under root user
    mgmt_agent ALL=(root) NOPASSWD:SETENV: /opt/oracle/mgmt_agent/plugins/osmh/*/osmh
    EOF
  2. Set the permissions of the file to 440.
    sudo chmod 440 /etc/sudoers.d/mgmt_agent
  3. Ensure that you have created the Management Agent install key.
  4. In the Console, copy the Management Agent install key to use to register the instance.
    1. Open the navigation menu and click Observability & Management. Under Management Agent, click Downloads and Keys.
    2. Under Install keys, find the key that you want to use to register the instance.
    3. Click the Actions menu for the key and select Copy key to clipboard.
  5. Create a response (input.rsp) file manually with a text editor and replace <MACS_KEY> with the install key that you copied in the previous step.

    For example:

    cat >/tmp/input.rsp <<EOF
    ManagementAgentInstallKey = <MACS_KEY>
    Service.plugin.osmh.download = true
    EOF

    The input.rsp file requires the following mandatory parameters.

    • ManagementAgentInstallKey: Install key required to validate the identity of the domain and the authenticity of the installation.
    • Service.plugin.osmh.download = true: Deploys the OS Management Hub (osmh) plugin during the agent installation.
  6. Configure the Management Agent by running the setup.sh script using the response file.
    sudo /opt/oracle/mgmt_agent/agent_inst/bin/setup.sh opts=/tmp/input.rsp

    A successful setup returns the following message: Agent setup completed and the agent is running. The setup of the OS Management Hub plugin can take another few minutes in the background.

  7. Configure the firewall and SELinux settings to permit traffic and access.

    The management station uses the ports defined during setup for synchronizing the yum mirror and managing proxy traffic to OCI.

    You can manually update the firewall rules and SELinux settings or use the station-setup.sh script.

    The station-setup.sh script configures the firewall and SELinux settings to permit traffic on the ports that you have specified in the proxy configuration on the management station and the Apache HTTP web server to serve packages from the path in the mirror configuration. The script handles firewall and SELinux configuration for mirrors using the xfs, ext4, btrfs, or nfs file system.

    Important

    For your convenience, the station-setup.sh script is available to configure the firewall and SELinux settings. Before running the script in your production environment, be sure to review the script and understand the changes that the script makes to your firewall and SELinux settings.
    sudo /opt/oracle/mgmt_agent/plugins/osmh/stateDir/station-setup.sh
    Note

    If you receive a command not found or No such file error message, wait a few minutes for the setup of the OS Management Hub plugin to complete and the station-setup.sh script to become available. If the issue persists, the registration might have failed. See Registration Failed for Instance or Management Station.
  8. If you didn't run the station-setup.sh script, restart the Apache HTTP web server.
    sudo systemctl restart httpd

Verify Management Station Registration and Details

Verify that the management station is registered with OS Management Hub as an instance and is available to mirror and distribute content to instances in the data center.

  1. Open the navigation menu and click Observability & Management. Under OS Management Hub, click Management stations.
  2. Under List scope, select the compartment that contains the management station.
  3. Verify that the management station is listed in the table and that its status is Active.
    Tip

    To troubleshoot registration issues, see Registration Failed for Instance or Management Station.

  4. Click the name of the management station to view its details.
    Important

    The list of mirrored software sources will be empty until you create a profile that uses the station. See Which software sources does the management station mirror?