Writing

Automating Oracle Cloud ARM Provisioning: Building the OcC Fix

Moses Man · · First published on LinkedIn

Oracle Cloud's Always Free tier is genuinely generous — up to 4 Ampere A1 cores and 24GB of ARM RAM for nothing. There's one catch anyone who's tried it knows: in popular regions you basically can't provision one. The console just says "Out of capacity for VM.Standard.A1.Flex" and sends you home.

That error isn't a quota problem. Your account has the quota — the physical hosts in that availability domain are full, and the only move is waiting for a slot to open. People sit there clicking "Create" in the console for days. So I automated the click.

What the tool does

OCI-OcC-Fix is a single-purpose Python utility that wraps the OCI SDK's launch_instance call in a patient retry loop. You point it at your instance spec — shape, subnet, image, ssh key — and it polls until capacity appears, then completes the launch.

The retry logic is the whole point:

# jittered exponential backoff — don't hammer the API, don't sync with other retryers
delay = min(BASE * (2 ** attempt), MAX_DELAY) + random.uniform(0, 30)
try:
    client.launch_instance(details)
    break  # capacity opened — instance is live
except ServiceError as e:
    if e.code == 'OutOfCapacity' or e.status == 500:
        sleep(delay); attempt += 1
    else:
        raise  # auth errors, bad config — fail loudly, don't retry

Two details matter: the jitter keeps thousands of people running the same trick from thundering-herding the API at the same intervals, and the error filter means a misconfigured request fails immediately instead of looping forever.

Why not the console

  • The console retry button has no backoff strategy and no persistence — you are the scheduler.
  • A scripted loop runs for days on a $0 VPS or your laptop, logging each attempt.
  • Once capacity opens — usually off-peak — the launch fires in seconds, not whenever you next happen to check.

The tool is deliberately minimal: one file, one config, no daemon, no dashboard. It does the boring part of homelab economics — persistence — so you don't have to.

Out of capacity is really out of patience. This fixes the patience part.

All writing