Intermediatereporting
OCI Stopped Instances Detective
Professional Python script that discovers and analyzes stopped compute instances across Oracle Cloud Infrastructure like a detective chef tracking forgotten ingredients. Fast parallel processing with comprehensive CSV + HTML reporting.
⏱️ Prep Time:Perfect stir-fry timing
🧩 Difficulty:Intermediate
🔍 What It Does
- ⚡ High-performance parallel processing across regions and compartments with configurable worker threads
- 🌍 Automatic region discovery or targeted regional analysis for focused resource management
- 🏢 Smart compartment discovery with intelligent caching and specific compartment targeting
- 👤 Comprehensive owner detection through freeform and defined tag analysis patterns
- 📅 Intelligent age calculation with timezone handling and configurable day-based filtering
- 📊 Dual report formats: structured CSV for analysis and rich HTML for executive presentation
- 🛡️ Robust error handling with retry logic, timeout management, and graceful failure recovery
- 📈 Real-time performance tracking with API call monitoring and processing speed metrics
⚙️ Requirements Checklist
- ✅ Python 3.6+ with concurrent.futures and asyncio support
- ✅ OCI Python SDK installed (pip install oci) with proper configuration
- ✅ Valid OCI config file (~/.oci/config) with appropriate authentication setup
- ✅ IAM permissions for read access to compute instances and compartments
- ✅ Network connectivity to OCI API endpoints with configurable timeout settings
📌 Talk Nerdy Tip:
Start with a complete tenancy scan to get baseline visibility, then use age-based filtering (30+ days) for focused cleanup analysis. Like taking inventory of your entire kitchen before deciding what to keep. 👨🍳
oci-instancesoracle-cloudstopped-instancesresource-discoverypythoncsv-exporthtml-reportsparallel-processingowner-detectionlifecycle-management