Enable Management Agents on Compute Instances
When using a compute instance, you can use the Oracle Cloud Agent capabilities to enable the Management Agent plug-in.
Before proceeding, confirm you have completed the prerequisites. For details, see Perform Prerequisites for Deploying Management Agents on Compute Instances.
Enable Management Agents
The Management Agent plugin on compute instances runs on the Java virtual machine (JVM). Starting March 2023, the Management Agent plugin is deployed with a Java runtime (JRE).
The Java runtime is always kept up-to-date as part of the Management Agent upgrade process in order to address newly discovered security vulnerabilities. After enabling the Management Agent plugin, it's important to run the latest version of the Management Agent plugin software by enabling automatic upgrades or manually invoking the upgrade operation periodically. For details, see Upgrade Management Agents on Compute Instances.
Enable Management Agents Using the Console
- Open the navigation menu and click Compute. Under Compute, click Instances.
- Click the instance that you're interested in.
- Click the Oracle Cloud Agent tab.
The list of plugins displays.
- Toggle the Enabled switch for the Management Agent plugin.
For more information, see Managing Plugins Using the Console.
Enable Management Agents Using Compute API
For information about using the API, see REST APIs.
For information about SDKs, see Software Development Kits and Command Line Interface.
-
LaunchInstance - enables or disables plugins, or stops all plugins, when you create an instance.
-
UpdateInstance - enables or disables individual plugins, and stops or starts all plugins, for an existing instance.
LaunchInstance
or UpdateInstance
API
operations which allows the user to enable Management Agent during Launch or Update
of the compute instance respectively:
...
.agentConfig(LaunchInstanceAgentConfigDetails.builder()
.isMonitoringDisabled(false)
.isManagementDisabled(true)
.areAllPluginsDisabled(false)
.pluginsConfig(new ArrayList<>(Arrays.asList(InstanceAgentPluginConfigDetails.builder()
.name("Management Agent")
.desiredState(InstanceAgentPluginConfigDetails.DesiredState.Enabled).build()))).build())
...
Where .name("Management Agent")
indicates it's for
Management Agent plugin and
.desiredState(InstanceAgentPluginConfigDetails.DesiredState.Enabled).build()))).build())
indicates to enable the Management Agent.
For more information, see Managing Plugins Using the API.
To configure Management Gateway for a Management Agent that's enabled on a Oracle Cloud Compute instance:
- Update
emd.properties
file.- Go to the
emd.properties
file, typically at the following location:/var/lib/oracle-cloud-agent/plugins/oci-managementagent/polaris/agent_inst/config/emd.properties
- At the end of the file, add the following 3
entries:
GatewayServerHost=<gateway host> GatewayServerPort=<gateway port> GatewayServerCredentialTimeout=30s
- Go to the
- Next, if the Management Gateway is configured with a proxy user
name and password then you must seed the Management Gateway Credentials to
the Management Agent.
- Use the following command to view the contents of
/tmp/cred.json
file.cat /tmp/cred.json |sudo -u oracle-cloud-agent /var/lib/oracle-cloud-agent/plugins/oci-managementagent/polaris/agent_inst/bin/credential_mgmt.sh -o upsertCredentials -s Agent
- In the
/tmp/cred.json
file, replace the following values with the actual Management Agent credentials for your environment:- OCID using the following format:
agent.ocid1.managementagent.oc1.phx.unique-id
- example-username
- example-password
{"source":"agent.ocid1.managementagent.oc1.phx.unique-id", "name":"ManagementAgent-Proxy", "type":"ProxyCreds", "description":"Proxy Credentials", "properties":[ {"name":"ProxyUser","value":"example-username"}, {"name":"ProxyPassword","value":"example-password"}]}
- OCID using the following format:
- Use the following command to view the contents of
- Enter the following command to restart the Oracle Cloud
Agent:
systemctl restart oracle-cloud-agent