Deploying OEM agents to Oracle Cloud Infrastructure (Gen2) for DBaaS

Challenge: 
 - OCI-Gen2 security policies prevent the oracle user from logging in directly (pam rules)
 - We could override those rules, but no telling if/when they get overwritten
 - A standalone installation of the Oracle OEM agent is the best option


On the OEM OMS server:

[opc@oprdoemap01 ~]$ sudo su - oracle
Last login: Thu Jun 18 13:56:24 GMT 2020

[oracle@oprdoemap01 ~]$ emcli login -username=sysman
Enter password :
Login successful

[oracle@oprdoemap01 ~]$ emcli sync
Synchronized successfully

[oracle@oprdoemap01 ~]$ emcli get_supported_platforms
-----------------------------------------------
Version = 13.4.0.0.0
 Platform = Linux x86-64
-----------------------------------------------
Platforms list displayed successfully.

[oracle@oprdoemap01 ~]$ emcli get_agentimage -destination=/tmp/agentinstaller -platform="Linux x86-64" -version="13.4.0.0.0"
 === Partition Detail ===
Space free : 32 GB
Space required : 1 GB
Check the logs at /u01/app/oracle/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/get_agentimage_2020-06-18_15-49-20-PM.log
Downloading /tmp/agentinstaller/13.4.0.0.0_AgentCore_226.zip
File saved as /tmp/agentinstaller/13.4.0.0.0_AgentCore_226.zip
Downloading /tmp/agentinstaller/13.4.0.0.0_Plugins_226.zip
File saved as /tmp/agentinstaller/13.4.0.0.0_Plugins_226.zip
Downloading /tmp/agentinstaller/unzip
File saved as /tmp/agentinstaller/unzip
Executing command: /tmp/agentinstaller/unzip /tmp/agentinstaller/13.4.0.0.0_Plugins_226.zip -d /tmp/agentinstaller
Exit status is:0
Agent Image Download completed successfully.

[oracle@oprdoemap01 ~]$ ls /tmp/agentinstaller/
13.4.0.0.0_AgentCore_226.zip

[opc@oprdoemap01 ~]$ scp -i .ssh/opc_key /tmp/agentinstaller/* opc@10.226.192.194:/tmp/
13.4.0.0.0_AgentCore_226.zip                                                                                                                           100%  900MB 142.3MB/s   00:06



[opc@oprdoemap01 ~]$ ssh -i .ssh/opc_key opc@10.226.192.194
Last login: Thu Jun 18 15:39:22 2020 from 10.226.204.9

[opc@oqas01odb ~]$ chmod 777 /tmp/13.4.0.0.0_AgentCore_226.zip

[opc@oqas01odb ~]$ sudo su - oracle
Last login: Thu Jun 18 15:44:17 UTC 2020

[oracle@oqas01odb ~]$ mkdir installer
[oracle@oqas01odb ~]$ cd installer
[oracle@oqas01odb installer]$ unzip /tmp/13.4.0.0.0_AgentCore_226.zip
Archive:  /tmp/13.4.0.0.0_AgentCore_226.zip
replace agentcore.bin? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: agentcore.bin
  inflating: agent.rsp
  inflating: agentDeploy.sh
  inflating: agentimage.properties
  inflating: unzip
  inflating: zip
   creating: plugins/
  inflating: plugins/oracle.sysman.emfa.discovery.plugin-13.4.1.0.0.farb
  inflating: plugins/oracle.sysman.emas.discovery.plugin-13.4.1.0.0.farb
  inflating: plugins/oracle.sysman.empa.discovery.plugin-13.4.1.0.0.farb
  inflating: plugins/oracle.sysman.si.discovery.plugin-13.4.1.0.0.farb
  inflating: plugins/oracle.sysman.vt.discovery.plugin-13.4.1.0.0.farb
  inflating: plugins/oracle.sysman.bda.discovery.plugin-13.4.1.0.0.farb
  inflating: plugins/oracle.sysman.db.discovery.plugin-13.4.1.0.0.farb
  inflating: plugins/oracle.sysman.xa.discovery.plugin-13.4.1.0.0.farb
  inflating: plugins/oracle.sysman.vi.discovery.plugin-13.4.1.0.0.farb
  inflating: plugins/oracle.sysman.am.discovery.plugin-13.4.1.0.0.farb
  inflating: plugins/oracle.em.savf.discovery.plugin-13.4.1.0.0.farb
  inflating: plugins/oracle.sysman.oh.discovery.plugin-13.4.0.0.0.farb
  inflating: plugins/oracle.sysman.oh.agent.plugin-13.4.0.0.0.farb
  inflating: plugins.txt
[oracle@oqas01odb ~]$ cd
[oracle@oqas01odb ~]$ mkdir tmp
[oracle@oqas01odb ~]$ cd installer/

[oracle@oqas01odb installer]$ ls
agent.rsp  agentDeploy.sh  agentcore.bin  agentimage.properties  plugins  plugins.txt  unzip  zip


[oracle@oqas01odb installer]$ ./agentDeploy.sh AGENT_BASE_DIR=/u01/app/oracle/agent \
> -force \
> -ignorePrereqs \
> -invPtrLoc /etc/oraInst.loc  \
> AGENT_PORT=3872 \
> EM_UPLOAD_PORT=4903 \
> OMS_HOST=oprdoemap01.foo.foo.oraclevcn.com \
> ORACLE_HOSTNAME=oqas01odb.foo.foo.oraclevcn.com \
> AGENT_INSTANCE_HOME=/u01/app/oracle/agent/agent_inst \
> AGENT_REGISTRATION_PASSWORD=foo \
> SCRATCHPATH=/home/oracle/tmp
The space available is ....  159132 MB

 Validating the OMS_HOST & EM_UPLOAD_PORT
Executing command : /u01/app/oracle/agent/agent_13.4.0.0.0/jdk/jre/bin/java -classpath /u01/app/oracle/agent/agent_13.4.0.0.0/jlib/agentInstaller.jar:/u01/app/oracle/agent/agent_13.4.0.0.0/oui/modules/OraInstaller.jar     oracle.sysman.agent.installer.AgentInstaller /u01/app/oracle/agent/agent_13.4.0.0.0 /home/oracle/installer /u01/app/oracle/agent $args -prereq
AGENT_ins home is:AGENT_BASE_DIR=/u01/app/oracle/agentoraclehome is:/u01/app/oracle/agent/agent_13.4.0.0.0
log loction is setlog
The oraclehome /u01/app/oracle/agent/agent_13.4.0.0.0

Validating oms host & port with url: https://oprdoemap01.foo.foo.oraclevcn.com:4903/empbs/genwallet
Validating oms host & port with url: http://oprdoemap01.foo.foo.oraclevcn.com:4903/empbs/genwallet
Return status:0-oms http port is passed
Validating the OMS Host and Port completed.
-force
-ignorePrereqs
-invPtrLoc
Inventory location is writable

 Starting Install Phase .....
Installation Summary
Disk Space : Required 1,435 MB, Available 158,880 MB
Feature Sets to Install:
        Oracle JDK 12.2.1.3.1
        Perl 5.28.1.0.0 5.28.1.0.0
        Next Generation Install Core 13.9.4.0.0
        OPatch 13.9.4.2.2
        Oracle HTTP Client 12.2.1.3.0
        Oracle XDK 12.2.1.3.0
        DMS Full 12.2.1.3.0
        Wallet Functionality 12.2.1.3.0
        Remote Diagnostic Assistant 8.09.0.1.0
Session log file is /home/oracle/tmp/OraInstall2020-06-18_04-37-51PM/install2020-06-18_04-37-51PM.log

Loading products list. Please wait.
 99%
Updating Libraries
Starting Installations
 1%
...
 98%
Install pending
Installation in progress
Install successful
Post feature install pending
Post Feature installing
Post feature install complete
String substitutions pending
String substituting
String substitutions complete
Link pending
Linking in progress
Link successful
Setup pending
Setup in progress
Setup successful
Save inventory pending
Saving inventory
 99%
Saving inventory complete
 100%
Configuration complete
The install operation completed successfully.
Logs successfully copied to /u01/app/oraInventory/logs.
 Agent Software install completed
Executing command to check/apply patches if exist in agenthome.....
patches exist in /u01/app/oracle/agent/agent_13.4.0.0.0
Applying opatch for the oneoffs 29812738 ...
Patch 29812738 successfully applied.
Log file location: /u01/app/oracle/agent/agent_13.4.0.0.0/cfgtoollogs/opatch/opatch2020-06-18_16-39-28PM_1.log
OPatch succeeded.
Finished post install
** Agent Port Check completed successfully.**
Validated the agent port :- ----3872
shared agent value is :false
chain install is :false
Agent Configuration completed successfully
The following configuration scripts need to be executed as the "root" user. Root script to run : /u01/app/oracle/agent/agent_13.4.0.0.0/root.sh
Waiting for agent targets to get promoted...
Successfully Promoted agent and its related targets to Management Agent


[oracle@oqas01odb bin]$ ./emctl secure agent
Oracle Enterprise Manager Cloud Control 13c Release 4
Copyright (c) 1996, 2020 Oracle Corporation.  All rights reserved.
Agent successfully stopped...   Done.
Securing agent...   Started.
Enter Agent Registration Password :
Agent successfully restarted...   Done.
Securing agent...   Successful.

[oracle@oqas01odb bin]$ ./emctl status agent
Oracle Enterprise Manager Cloud Control 13c Release 4
Copyright (c) 1996, 2020 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 13.4.0.0.0
OMS Version            : 13.4.0.0.0
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/app/oracle/agent/agent_inst
Agent Log Directory    : /u01/app/oracle/agent/agent_inst/sysman/log
Agent Binaries         : /u01/app/oracle/agent/agent_13.4.0.0.0
Core JAR Location      : /u01/app/oracle/agent/agent_13.4.0.0.0/jlib
Agent Process ID       : 43398
Parent Process ID      : 43295
Agent URL              : https://oqas01odb.foo.foo.oraclevcn.com:3872/emd/main/
Local Agent URL in NAT : https://oqas01odb.foo.foo.oraclevcn.com:3872/emd/main/
Repository URL         : https://oprdoemap01.foo.foo.oraclevcn.com:4903/empbs/upload
Started at             : 2020-06-18 16:44:50
Started by user        : oracle
Operating System       : Linux version 4.1.12-124.38.1.el7uek.x86_64 (amd64)
Number of Targets      : 4
Last Reload            : (none)
Last successful upload                       : 2020-06-18 16:45:13
Last attempted upload                        : 2020-06-18 16:45:13
Total Megabytes of XML files uploaded so far : 0.01
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 83.35%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2020-06-18 16:44:59
Last successful heartbeat to OMS             : 2020-06-18 16:44:59
Next scheduled heartbeat to OMS              : 2020-06-18 16:46:00
---------------------------------------------------------------
Agent is Running and Ready

[oracle@oqas01odb bin]$ ./emctl upload agent
Oracle Enterprise Manager Cloud Control 13c Release 4
Copyright (c) 1996, 2020 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD upload completed successfully

[oracle@oqas01odb bin]$ ./emctl config agent listtargets
Oracle Enterprise Manager Cloud Control 13c Release 4
Copyright (c) 1996, 2020 Oracle Corporation.  All rights reserved.
[oqas01odb.foo.foo.oraclevcn.com, host]
[oqas01odb.foo.foo.oraclevcn.com:3872, oracle_emd]
[agent13c1_3_oqas01odb.foo.foo.oraclevcn.com_9629, oracle_home]
[odev01app.iadsnrappd.ovcniadinv01.oraclevcn.com:3872_proxy, oracle_emd_proxy]

[oracle@oqas01odb bin]$ ./emctl config agent addinternaltargets
Oracle Enterprise Manager Cloud Control 13c Release 4
Copyright (c) 1996, 2020 Oracle Corporation.  All rights reserved.

[oracle@oqas01odb bin]$ ./emctl upload agent
Oracle Enterprise Manager Cloud Control 13c Release 4
Copyright (c) 1996, 2020 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD upload completed successfully

[oracle@oqas01odb bin]$ ./emctl pingOMS
Oracle Enterprise Manager Cloud Control 13c Release 4
Copyright (c) 1996, 2020 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD pingOMS completed successfully

One thought on “Deploying OEM agents to Oracle Cloud Infrastructure (Gen2) for DBaaS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s