Oracle EBS Home Lab on OCI – Part 2: Private Compute, SSH Troubleshooting and Linux Memory Optimization

Alhamdulillah, in Part 1 I built the OCI networking foundation and public bastion, and encountered compute capacity constraints. In Part 2 I deploy a private Oracle Linux instance, investigate SSH banner timeouts and memory pressure, and validate the fixes after reboot without resizing the instance. This is an infrastructure lab, not an EBS installation.

Key Results

RAM: 498 → 945 MiB (+89.8%). Swap: 497 → 2545 MiB. Failed services: 2 → 0.

DNF completed in 10 minutes 55 seconds. SSH was responsive before remediation and again after reboot. Recorded OCI cost for December 1–5: SGD 0.00.

1. Lab architecture

Windows workstation
| SSH TCP 22 (source-restricted)
v
OCI VCN 10.20.0.0/16 — Hyderabad
Public subnet 10.20.1.0/24
EBS-BASTION-01 (10.20.1.99)
| SSH TCP 22 (private)
v
Private subnet 10.20.2.0/24
EBS-APP-LAB-01 (10.20.2.198)
No public IP

2. Private compute provisioning

ResourceConfiguration
Region / ADHyderabad AD-1
CompartmentEBS-OCI-LAB
ShapeVM.Standard.E2.1.Micro
OSOracle Linux 9.8 x86_64
Private subnetEBS-APP-PRIVATE
NSGEBS-APP-NSG
Public IPNone
StorageDefault boot volume; no additional volume

The provisioning work request succeeded on December 5 at 19:16:31 UTC. I generated a separate SSH key pair for the private instance.

AMD Micro compute shape selection
AMD Micro compute shape selection
Private network configuration
Private network configuration
Public IP disabled for the application instance
Public IP disabled for the application instance
Successful compute instance provisioning
Successful compute instance provisioning
Private application instance shape details
Private application instance shape details
Private VNIC configuration
Private VNIC configuration

3. SSH connectivity troubleshooting

The initial connection through the bastion timed out during banner exchange. From Windows PowerShell I used separate keys (paths and public IP anonymized):

$BastionKey = "<path-to-bastion-key>"
$AppKey = "<path-to-app-key>"
ssh -i "$AppKey" -o IdentitiesOnly=yes -o ConnectTimeout=60 -o "ProxyCommand=ssh -i $BastionKey -o IdentitiesOnly=yes -W %h:%p opc@<BASTION_PUBLIC_IP>" opc@10.20.2.198

Verify the server host key through a trusted channel before accepting it. From the bastion, TCP port 22 was reachable, but the server banner was absent. A successful TCP handshake does not establish SSH protocol health.

timeout 10 bash -c 'echo > /dev/tcp/10.20.2.198/22'
timeout 30 bash -c 'exec 3<>/dev/tcp/10.20.2.198/22; head -n 1 <&3'

SSH recovered by approximately 21:31 UTC, roughly two hours and fifteen minutes after provisioning. The precise outage duration was not measured. No network or OS changes preceded recovery. Later kernel evidence suggests DNF memory pressure during the first hours likely impaired SSH responsiveness; this is an inference, not proof of every timeout.

4. Console history, IAM and Run Command

Console history showed a completed boot and a login prompt. The Cloud Shell serial console was accessible, but I had no password for opc. The Run Command plugin was running, yet the initial command stayed Accepted until I configured instance-agent IAM access.

Accessing OCI console history
Accessing OCI console history
Saved OCI console history
Saved OCI console history

I created EBS-APP-LAB-DG in the Default identity domain and EBS-APP-LAB-RUNCOMMAND-POLICY in the lab compartment.

Matching rule:
instance.id = '<APPLICATION_INSTANCE_OCID>'
Policy statement:
Allow dynamic-group EBS-APP-LAB-DG to use instance-agent-command-execution-family in compartment EBS-OCI-LAB where request.instance.id=target.instance.id

The operator also needs permission to create commands. Oracle documents the following example; it is a reference policy, not an additional policy I created in this lab.

Allow group RunCommandUsers to manage instance-agent-command-family in compartment EBS-OCI-LAB

See Oracle IAM policy guidance for instances. I did not create a separate operator policy; the existing permissions allowed me to submit the command. The command succeeded about ten minutes after the agent policy was created.

The diagnostic script included these commands (section labels omitted):

hostname
free -m
swapon --show
cat /proc/cmdline
cat /sys/kernel/kexec_crash_size
systemctl status sshd --no-pager
systemctl status kdump --no-pager
journalctl -k --no-pager | grep -iE 'oom|out of memory|killed process'
systemctl --failed --no-pager
ps -eo pid,user,%mem,%cpu,comm --sort=-%mem | head -15

The response was truncated, but confirmed 498 MiB RAM, 497 MiB swap and a 469762048-byte crash kernel reservation (448 MiB). Oracle documents the plain-text output limit and agent privilege requirements in its Run Command guide.

5. OOM investigation and memory optimization

Kernel logs, read after SSH recovery, showed the following events on December 5 at 21:18 UTC:

sshd-session invoked oom-killer
Out of memory: Killed process 9787 (dnf)

The two failed services were dnf-makecache.service (OOM kill) and mcelog.service (unsupported AMD processor). DNF, not sshd-session, was the process killed in this event. SSH was confirmed responsive by approximately 21:31 UTC, about 13 minutes after the OOM kill. This timing supports the memory-pressure hypothesis but does not establish causation.

I repeated the GRUB backup, default-kernel crashkernel removal and swap procedure documented in Part 1, section 6. On this host the original crashkernel reservation was 448 MiB and the original swap was only 497 MiB. I preserved alternate and rescue boot entries, verified the backup, disabled kdump and removed crashkernel from the default UEK entry and GRUB defaults before rebooting.

Key finding: The 448 MiB crashkernel reservation represented about 44% of the nominal 1 GiB memory capacity. Removing it recovered 447 MiB of OS-visible RAM without resizing the instance. Disabling kdump sacrifices crash dump collection. This was a lab-specific decision, not a general production recommendation.

After reboot, OS-visible RAM was 945 MiB. I added 2 GiB swap on the existing XFS root filesystem, using dd instead of fallocate to avoid potential swap-file allocation issues on XFS. I backed up fstab before adding the entry.

sudo dd if=/dev/zero of=/swapfile2 bs=1M count=2048 status=progress conv=excl
sudo chmod 600 /swapfile2
sudo mkswap /swapfile2
sudo swapon /swapfile2
sudo cp -p /etc/fstab /etc/fstab.bak_$(date +%Y%m%d_%H%M%S)
grep -qE '^/swapfile2[[:space:]]' /etc/fstab || echo '/swapfile2 none swap sw 0 0' | sudo tee -a /etc/fstab
sudo systemctl daemon-reload
sudo findmnt --verify --verbose

6. DNF validation and AMD mcelog

The DNF metadata cache test ran from 21:50:15 to 22:01:10 UTC (10 minutes 55 seconds). During the test, swap usage exceeded 2 GiB and sampled I/O wait reached 56%. I compared process I/O counters to establish that work continued despite temporary D-state waits.

sudo systemctl start --no-block dnf-makecache.service
sudo systemctl status dnf-makecache.service --no-pager -l
vmstat 5 6
PID=$(systemctl show dnf-makecache.service -p MainPID --value)
# While the service is running and PID is nonzero:
sudo cat /proc/$PID/io
sleep 30
sudo cat /proc/$PID/io
Metadata cache created.
status=0/SUCCESS
726.3M memory peak

No new OOM messages were detected. Separately, mcelog rejected AMD EPYC 7551 family 23 and suggested edac_mce_amd. Oracle documents this behavior in its Oracle Linux 8.10 release notes. The notes concern OL8.10, not OL9. The edac_mce_amd module existed on my OL9 guest but was not loaded. I disabled the failing daemon; replacement hardware error monitoring was not configured or validated.

sudo systemctl disable --now mcelog.service
sudo systemctl reset-failed mcelog.service

7. Reboot validation and results

sudo sync
sudo reboot

After reconnecting through the bastion, I ran:

uptime
free -m
swapon --show
df -hT /
systemctl --failed --no-pager
systemctl is-active sshd
systemctl is-enabled kdump
systemctl is-enabled mcelog
sudo cat /sys/kernel/kexec_crash_size
grep -E 'swap' /etc/fstab
systemctl list-timers dnf-makecache.timer --no-pager
sudo journalctl -k -b --no-pager | grep -iE 'oom|out of memory|killed process'

Selected values from the final post-reboot checks at 22:17 UTC (abridged output):

free -m
total used free available
Mem: 945 505 199 440
Swap: 2545 0 2545
swapon --show
NAME SIZE USED PRIO
/.swapfile 498M 0B -2
/swapfile2 2G 0B -3
MetricBeforeAfter
OS-visible RAM498 MiB945 MiB (+89.8%)
Swap497 MiB2545 MiB
Crash reservation448 MiB0
Failed services2 (DNF, mcelog)0
DNFOOM killedSuccessful test
SSHInitially unresponsiveRecovered before changes; responsive after reboot

Both swap files activated automatically, root filesystem usage was 29%, and the DNF timer remained scheduled. Long-term stability is not yet established.

8. Free Tier costs and lessons learned

ResourceLimitUsedAvailable
E2 Micro quota220
Regional free storage200 GB94 GB106 GB

Cost Analysis for December 1–5, 2026 UTC recorded SGD 0.00 across Compute, Block Storage, Database, Telemetry and Virtual Cloud Networking. Reporting delays remain possible.

E2 Micro quota: 2 of 2 used
E2 Micro quota: 2 of 2 used
Regional Free Tier storage: 94 of 200 GB used
Regional Free Tier storage: 94 of 200 GB used
Cost Analysis: SGD 0.00 recorded
Cost Analysis: SGD 0.00 recorded
Daily service-wise cost details: SGD 0.00
Daily service-wise cost details: SGD 0.00

The two Micro slots are now occupied. A1 capacity was unavailable during Part 1; neither quota nor free eligibility guarantees host capacity. Oracle also warns that idle Always Free compute may be reclaimed; see Always Free Resources. If an idle instance is reclaimed, its configuration may be lost; retain independent backups.

Conclusion

Alhamdulillah, the private instance is accessible and the changes survived reboot. The key lessons were that TCP reachability does not guarantee SSH responsiveness, Run Command depends on agent IAM authorization, and a 448 MiB crash reservation is significant on a 1 GB host. The successful DNF test required substantial swap and I/O, illustrating why Micro instances are suitable for infrastructure experiments rather than EBS workloads. For the next installment I plan to explore local x86 EBS installation readiness without provisioning additional paid OCI resources.

Disclaimer: This is a personal home-lab project for learning and knowledge sharing. Hostnames and private IP addresses are lab values. Public IP addresses and instance identifiers in commands are anonymized. The configuration changes are specific to this lab and are not production recommendations.


Discover more from Syed Anwar Ahmed – Oracle DBA Blog

Subscribe to get the latest posts sent to your email.

Comments

Leave a Reply

Discover more from Syed Anwar Ahmed – Oracle DBA Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading