Problem Statement
Oracle Cloud free tier users often reach instance limits (E2: 2/2 instances, A1: 4/4 OCPUs) and need manual intervention to free capacity for new deployments. This creates operational overhead and reduces automation effectiveness.
Proposed Solution
Implement optional automated instance lifecycle management with intelligent rotation capabilities, building upon Issue #64's limit-aware automation.
Key Features
1. Automated Instance Rotation
- Configurable via environment variable:
AUTO_ROTATE_INSTANCES=true/false
- Age-based rotation: Terminate oldest instances when limits reached
- Safety checks: Verify instance health and uptime before termination
- Configurable minimum age: Prevent rotation of recently created instances
2. Instance Lifecycle Management
- Health monitoring: Check instance status and resource utilization
- Smart selection: Choose optimal instances for termination based on criteria:
- Instance age (oldest first)
- Resource utilization (lowest utilization first)
- Instance type priority (configurable preferences)
- Graceful shutdown: Proper instance termination with cleanup
3. Enhanced Configuration Options
# Instance Lifecycle Management
AUTO_ROTATE_INSTANCES=true # Enable automatic rotation
INSTANCE_MIN_AGE_HOURS=24 # Minimum age before rotation eligible
ROTATION_STRATEGY="oldest_first" # "oldest_first", "least_utilized"
HEALTH_CHECK_ENABLED=true # Verify instance health before rotation
Implementation Approach
Phase 1: Core Lifecycle Management
Phase 2: Smart Selection Algorithms
Phase 3: Advanced Features
Benefits
- Reduced manual intervention: Automatic capacity management
- Improved automation reliability: Continuous operation without user input
- Resource optimization: Intelligent instance selection for rotation
- Operational visibility: Detailed logging and notification of lifecycle events
- Safety-first approach: Multiple verification steps before any destructive operations
Safety Considerations
- Opt-in only: Feature disabled by default, requires explicit enablement
- Comprehensive logging: All rotation decisions and actions logged
- Rollback capabilities: Ability to recover from rotation issues
- User notifications: Telegram alerts for all lifecycle management actions
- Minimum age protection: Prevent accidental rotation of recently created instances
Files to Create/Modify
- New:
scripts/instance-lifecycle.sh - Core lifecycle management functionality
- Modify:
scripts/launch-parallel.sh - Integration with rotation logic
- Modify:
scripts/utils.sh - Additional helper functions for instance management
- Modify:
scripts/notify.sh - Lifecycle management notifications
Success Metrics
- Automated capacity recovery when limits reached
- Zero manual intervention required for standard operations
- Proper instance selection based on configured strategy
- 100% safety record with no unintended terminations
- Clear operational visibility through logs and notifications
This enhancement transforms the Oracle Instance Creator from intelligent limit detection to full autonomous lifecycle management, providing a complete hands-off experience for Oracle free tier automation.
Related Issues
Problem Statement
Oracle Cloud free tier users often reach instance limits (E2: 2/2 instances, A1: 4/4 OCPUs) and need manual intervention to free capacity for new deployments. This creates operational overhead and reduces automation effectiveness.
Proposed Solution
Implement optional automated instance lifecycle management with intelligent rotation capabilities, building upon Issue #64's limit-aware automation.
Key Features
1. Automated Instance Rotation
AUTO_ROTATE_INSTANCES=true/false2. Instance Lifecycle Management
3. Enhanced Configuration Options
Implementation Approach
Phase 1: Core Lifecycle Management
scripts/instance-lifecycle.shwith basic rotation logicPhase 2: Smart Selection Algorithms
Phase 3: Advanced Features
Benefits
Safety Considerations
Files to Create/Modify
scripts/instance-lifecycle.sh- Core lifecycle management functionalityscripts/launch-parallel.sh- Integration with rotation logicscripts/utils.sh- Additional helper functions for instance managementscripts/notify.sh- Lifecycle management notificationsSuccess Metrics
This enhancement transforms the Oracle Instance Creator from intelligent limit detection to full autonomous lifecycle management, providing a complete hands-off experience for Oracle free tier automation.
Related Issues