Registration Failed for Instance or Management Station
An instance or management station can fail to register with OS Management Hub if an invalid profile is used, the OS time isn't set correctly, the dynamic group rules are missing, or the instance was previously unregistered.
See also Known Issue: Older platform images or Bring Your Own Images will not register.
Invalid profile was used
The following conditions might indicate that an instance tried to register with an invalid profile:
- The status of the instance in the OS Management Hub is
Registration failed
. - The
osmh-agent.log
file displays a message similar to:Message: Invalid Managed Instance osFamily ORACLE_LINUX_8 does not match Profile osFamily: ORACLE_LINUX_9
which indicates the profile has the wrong OS version.Message: Managed Instance location ON_PREMISE is not compatible with a Profile registration type of: OCI_LINUX
which indicates the profile has the wrong instance type.
Check the osmh-agent.log
file and identify the correct profile
To resolve the issue for OCI instances
- Under List scope, select the compartment that contains the instance.
- Click the name of the instance.
- Click Set profile.
- Select the compartment and correct profile to use for registration.
- Click Set.
To resolve the issue for non-OCI instances:
- View the profile details.
-
Copy the
/etc/osmh-profile
content. - Log in to the instance as a user with sudo privileges.
-
Replace the
/etc/osmh-profile
with the corrected profile. The instance will register the next time the OS Management Hub plugin checks in with the service.
OS not set to current time
Timeout errors at registration can occur when the time on the instance is different from the time used in the OS Management Hub service. A clock skew of more than 5 minutes can cause these types of errors.
/opt/oracle/mgmt_agent/agent_inst/bin/setup.sh
script:Starting plugin deployment for: [osmh]
Deploying service plugin(s)..............................Timed out.
Agent is unable to check if it deployed requested service plugin(s) successfully or not. Please check back later on the console.
Missing dynamic group rule
If the osmh-agent.log
contains the following error, it could indicate that the dynamic group rule isn't set correctly.
ERROR: failed to update managed instance: Error returned by Service. Http Status Code: 404.
Error Code: NotAuthorizedOrNotFound. Opc request id: <requestID>. Message: Authorization failed or requested resource not found.
...
Request Endpoint: PUT https://osmh.<region>.oci.oraclecloud.com/20220901/agent/managedInstances/ocid1.managementagent.oc1.iad.<ocid>
Instance was previously unregistered
If you've previously unregistered an instance from OS Management Hub, there are additional steps to re-register it with the service. The process depends on the instance location.
OCI instances
Re-registering an OCI instance that was unregistered will fail until you remove the unregistration file on the instance. This file prevents the instance from registering with the service. When you try to register an instance that contains this file, the agent plugin displays the following error: started oci-osmh under unregistered mode
.
Remove the following file before registering the instance:
-
Oracle Linux
/var/lib/oracle-cloud-agent/plugins/oci-osmh/osmh-agent-unregister
-
Windows 2019 and 2022
C:\Windows\ServiceProfiles\OCAOSMH\AppData\Local\OracleCloudAgent\plugins\oci-osmh\osmh-agent-unregister
-
Windows 2016
C:\Users\OCAOSMH\AppData\Local\OracleCloudAgent\plugins\oci-osmh\osmh-agent-unregister
On-premises or third-party cloud instances
Re-registering a non-OCI instance that was previously registered might require installation of the Management Agent or manual deployment of the OS Management Hub agent plugin.
To re-register the instance:
- Log in to the instance as a user with sudo privileges.
-
Check the status of the Management Agent.
sudo systemctl status mgmt_agent
- If the
mgmt_agent
isn't found, register the instance as if it were new. See Registering a Non-OCI Instance. Skip the remaining steps in this procedure. - If the
mgmt_agent
is present, start the agent and create the/etc/osmh-profile
file:-
Start the
mgmt_agent
:sudo systemctl start mgmt_agent
-
Create the
/etc/osmh-profile
file using a text editor. Ensure the filename has no file extension.sudo vi /etc/osmh-profile
-
-
In the Console, deploy the OS Management Hub agent plugin to the instance.
- In the Console, navigate to Observability & Management. Under Management Agent, click Agents.
- Under Scope, select your compartment.
- Locate the correct agent by finding the hostname in the Name column. Click the name of the agent in the list.
- Click Deploy plug-ins.
- Select OS Management Hub and then click Update.
- Wait a few minutes and then verify the instance has registered.