Skip to content
markdudovPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

🚀 Oracle Cloud Always Free VM Auto-Claimer (24/7 Provisioning Bot)

License: MIT Python 3.10+ OCI SDK

Automated toolkit designed to reliably secure Oracle Cloud Infrastructure (OCI) Always Free Instances (VM.Standard.A1.Flex ARM with 2 OCPUs and 12 GB RAM or VM.Standard.E2.1.Micro).

Because Oracle Cloud's Always Free ARM resources are in extreme demand, attempts to create instances via the web console almost always fail with:

Error: Out of host capacity or 500 Internal Server Error

This repository provides a lightweight, zero-configuration script that continuously rotates across all Availability Domains (ADs) 24/7 until capacity becomes available and your VM is provisioned.


Requires only 2 GitHub Secrets with zero manual OCID hunting!


✨ Features

  • 🔄 24/7 Continuous Auto-Retry: Rotates across all Availability Domains (AD-1, AD-2, AD-3) automatically.
  • ☁️ GitHub Actions Autonomous Cloud Loop: Run 100% free in the cloud without keeping your local computer powered on. Uses a self-dispatching loop with backup cron scheduling.
  • 🛡️ Always Free Compliant Defaults: Pre-configured strictly to 2 OCPUs and 12 GB RAM in compliance with Oracle's updated 1,500 OCPU hours / 9,000 GB-hours monthly limits.
  • 🧠 Zero-Friction Full Automation:
    • Auto-Config Parser: Paste the raw Oracle Cloud configuration preview text directly into OCI_CONFIG — no JSON formatting needed!
    • Auto-Detect Image: Automatically resolves the latest Canonical Ubuntu ARM/AMD image in your region.
    • Auto-Detect / Auto-Create Subnet: Automatically detects your public VCN subnet (or provisions a default VCN + Subnet if your account is brand new).
    • Auto-Generate SSH Keys: Generates an Ed25519 keypair if you don't provide one, with the private key downloadable directly from GitHub Action Artifacts.
  • 🛡️ Duplicate Instance Prevention: Checks if your instance is already active or provisioning before making requests, avoiding duplicate resource creation.
  • 🔔 Instant Multi-Channel Alerts: Sends immediate alerts via Telegram and Discord Webhooks the second your instance is provisioned.
  • ⚙️ Configurable Specs: Supports custom OCPUs (1–2 for Free Tier, up to 4 for PAYG), RAM (6–12 GB for Free Tier, up to 24 for PAYG), boot disk size (50–200 GB), and SSH keys.

📁 Repository Structure

├── INSTRUCTIONS.md             # Complete step-by-step 3-minute setup guide
├── main.py                     # Main 24/7 auto-provisioning script
├── helper_setup.py             # Setup helper to discover ADs, Subnet and Image OCIDs
├── config.example.json         # Configuration template
├── requirements.txt            # Python dependencies (oci, requests, python-dotenv)
├── .gitignore                  # Ignores private keys, config.json, logs, and venv
├── .github/
│   └── workflows/
│       └── oracle_retry.yml    # Unstoppable GitHub Actions 24/7 claiming workflow
└── README.md                   # Overview and documentation

🛠️ Quick Local Setup

If you prefer to run the script locally or on an existing server instead of GitHub Actions:

git clone https://github.com/markdudov/oracle.git
cd oracle

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

cp config.example.json config.json
# Fill in your credentials, or let the script auto-detect your subnets and images

python main.py

To run continuously in the background using tmux or nohup:

nohup python3 main.py > oracle_claimer.log 2>&1 &

❓ Frequently Asked Questions (FAQ)

1. How long does it usually take to get an ARM instance?

Oracle Cloud capacity frees up whenever other users terminate instances or when Oracle provisions new server racks in the data center. Depending on your region, it can take anywhere from a few hours to several days. The script runs silently 24/7 until a slot opens.

2. Can I get banned for running this script?

No. The script queries the official Oracle Cloud Infrastructure API using documented rate-compliant intervals with proper backoff, fully respecting OCI API service policies.

3. What happens once the machine is created?

The script prints the new Instance ID, writes a success marker (/tmp/vm_created), sends you a Telegram/Discord notification, and terminates cleanly. You can then immediately SSH into your new server using your public key and the public IP assigned by Oracle.


📄 License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages