Started my Project on Energy-Efficient DevOps: Auto-Suspending Idle AWS Resources using ML

Week 1 – Setup Phase (Problems & Progress)
Objective
Set up EC2 instances with basic monitoring tools to simulate DevOps workloads and start collecting usage data for ML-based auto-suspension.
Problem 1: SSH to EC2 Failing on Windows
Error Message:
ssh -i "yourinstancekey" ubuntu@<your-public-ip>
ssh: connect to host <your-public-ip> port 22: Connection timed out
Cause:
Security Group was too restrictive — it allowed SSH (port 22) only from a previous IP.
Fix:
Navigated to EC2 > Security Groups
Edited the Inbound Rules
Changed port 22 to allow from
My IP
(current one)Connection successful via PowerShell
Problem 2: Installing awscli
failed on Ubuntu 24.04
Command used:
pip3 install awscli --upgrade --user
Error:
error: externally-managed-environment
This environment is externally managed.
Why it happened:
Ubuntu 24.04 follows PEP 668, which prevents system-wide pip
installs without a virtual environment.
Fix:
Created a virtual environment:
python3 -m venv myenv source myenv/bin/activate pip install awscli
Or use:
sudo apt install awscli
Screenshot:
What’s Working So Far:
EC2 instance (Ubuntu 24.04 LTS)
SSH access from Windows (PowerShell)
Installed base packages:
htop
,stress
,cron
,python3-pip
,awscli
AWS CLI inside virtual environment
Tools Used
AWS EC2 (Free Tier)
Ubuntu 24.04
PowerShell SSH
Python 3.12
AWS CLI (inside venv)
Stress, Cron
Want to Follow Along?
I’ll be sharing weekly progress — issues, logs, architecture, and ML models.
If you've solved similar problems (like automated cloud optimization), I’d love to hear your insight.
Subscribe to my newsletter
Read articles from Sahil Gada directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
