<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mudassir Mazhar</title>
    <description>The latest articles on DEV Community by Mudassir Mazhar (@mudassir-42).</description>
    <link>https://dev.to/mudassir-42</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4259967%2F786f3203-0d09-4f70-87a8-840ac36f2da9.jpg</url>
      <title>DEV Community: Mudassir Mazhar</title>
      <link>https://dev.to/mudassir-42</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mudassir-42"/>
    <language>en</language>
    <item>
      <title>I Built a Python CLI to Tackle Oracle Cloud's "Out of Host Capacity" Problem</title>
      <dc:creator>Mudassir Mazhar</dc:creator>
      <pubDate>Mon, 23 Nov 2026 07:49:23 +0000</pubDate>
      <link>https://dev.to/mudassir-42/i-built-a-python-cli-to-tackle-oracle-clouds-out-of-host-capacity-problem-4g8k</link>
      <guid>https://dev.to/mudassir-42/i-built-a-python-cli-to-tackle-oracle-clouds-out-of-host-capacity-problem-4g8k</guid>
      <description>&lt;p&gt;I Built a Python CLI to Tackle Oracle Cloud Ampere A1's "Out of Host Capacity" Problem&lt;/p&gt;

&lt;p&gt;Getting an Oracle Cloud Ampere A1 instance can be frustrating.&lt;/p&gt;

&lt;p&gt;You may have your OCI account configured, your network ready, your quotas checked, and your VM configuration prepared — but capacity availability can still get in the way.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F59yr1h1kllsfwvivmu47.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F59yr1h1kllsfwvivmu47.png" alt=" " width="739" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I wanted a simpler way to handle this workflow.&lt;/p&gt;

&lt;p&gt;So I started building a Python automation tool for Oracle Cloud Infrastructure (OCI). What began as a personal automation script gradually evolved into a cross-platform CLI with interactive configuration, installation scripts, monitoring capabilities, safety checks, and support for AI coding agents.&lt;/p&gt;

&lt;p&gt;!OCI Always Free A1 VM Automation&lt;/p&gt;

&lt;p&gt;Today, I'm sharing it with the developer community.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/mudassir-93/OCI-Always-Free-VM" rel="noopener noreferrer"&gt;https://github.com/mudassir-93/OCI-Always-Free-VM&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Problem I Wanted to Solve&lt;/p&gt;

&lt;p&gt;Working with OCI A1 instances involves more than just clicking the Create Instance button.&lt;/p&gt;

&lt;p&gt;Before attempting to launch an instance, there are several things worth checking:&lt;/p&gt;

&lt;p&gt;Is A1 capacity currently available in my region and availability domain?&lt;br&gt;
Are my OCPU and memory quotas sufficient?&lt;br&gt;
Is my existing VCN and subnet configuration valid?&lt;br&gt;
Is the selected image appropriate?&lt;br&gt;
Am I staying within my intended compute and storage budget?&lt;br&gt;
How can I monitor capacity without repeatedly doing the same manual checks?&lt;/p&gt;

&lt;p&gt;I didn't want to build another cloud dashboard or a complicated infrastructure platform.&lt;/p&gt;

&lt;p&gt;I wanted a lightweight tool that could automate repetitive checks and provide a manageable workflow from the terminal.&lt;/p&gt;

&lt;p&gt;What I Built&lt;br&gt;
OCI Always Free A1 VM Automation&lt;/p&gt;

&lt;p&gt;A Python-based CLI designed to help OCI users inspect their environment, check A1 capacity, validate configuration, and optionally request one VM through an explicitly guarded workflow.&lt;/p&gt;

&lt;p&gt;The project supports Windows and Linux.&lt;/p&gt;

&lt;p&gt;What It Can Do&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A1 Capacity Monitoring&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Check OCI A1 availability and monitor capacity using configurable retry and backoff behavior.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Quota and Configuration Checks&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Validate important settings such as:&lt;/p&gt;

&lt;p&gt;Home region and availability domain.&lt;br&gt;
Existing VCN and public subnet.&lt;br&gt;
Compute and storage limits.&lt;br&gt;
A1 instance configuration.&lt;br&gt;
Image and SSH public-key settings.&lt;br&gt;
Existing instances and resource usage.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Interactive Terminal Interface&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Instead of remembering every command, users can open the application and navigate through an interactive terminal menu.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Guided Configuration&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The configuration editor allows users to work through settings in organized groups, validate values, review changes, and save safely.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Windows and Linux Installers&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The project includes PowerShell and shell installers that create an isolated Python environment and initialize a safe starter configuration.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AI Coding-Agent Support&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The repository includes instructions and project memory for tools such as:&lt;/p&gt;

&lt;p&gt;Claude Code&lt;br&gt;
OpenAI Codex&lt;br&gt;
Gemini CLI&lt;br&gt;
GitHub Copilot&lt;br&gt;
Other agentic development environments&lt;/p&gt;

&lt;p&gt;The idea is to make it easier to understand, maintain, and extend the project with AI assistance.&lt;/p&gt;

&lt;p&gt;Some Implementation Decisions I Found Interesting&lt;/p&gt;

&lt;p&gt;This project was also a useful exercise in making an existing automation tool more reusable.&lt;/p&gt;

&lt;p&gt;A few decisions shaped the architecture.&lt;/p&gt;

&lt;p&gt;Keeping the Existing Engine&lt;/p&gt;

&lt;p&gt;Rather than rewriting the original automation logic, I introduced a new oci-platform CLI layer around the existing Python engine.&lt;/p&gt;

&lt;p&gt;This allowed me to preserve existing functionality while improving how users interact with it.&lt;/p&gt;

&lt;p&gt;Handling Windows and Linux Differences&lt;/p&gt;

&lt;p&gt;One portability issue came from using the POSIX-only fcntl module for process locking.&lt;/p&gt;

&lt;p&gt;That approach wasn't suitable for Windows.&lt;/p&gt;

&lt;p&gt;I replaced the unconditional platform-specific import with a cross-platform locking implementation.&lt;/p&gt;

&lt;p&gt;It was a good reminder that cross-platform support needs to be considered at the application level, not just in the installer.&lt;/p&gt;

&lt;p&gt;Making Configuration Safer&lt;/p&gt;

&lt;p&gt;I didn't want setup to accidentally arm VM creation or overwrite an existing installation.&lt;/p&gt;

&lt;p&gt;The installers refuse to overwrite an existing target directory, and the configuration workflow keeps VM creation disabled.&lt;/p&gt;

&lt;p&gt;These are deliberate design decisions, not just documentation warnings.&lt;/p&gt;

&lt;p&gt;Safety Is a Core Part of the Design&lt;/p&gt;

&lt;p&gt;Because this application interacts with cloud infrastructure, I wanted the default behavior to be read-only.&lt;/p&gt;

&lt;p&gt;VM creation requires three independent safeguards:&lt;/p&gt;

&lt;p&gt;mode.creation_enabled=true in the local configuration.&lt;br&gt;
The exact confirmation phrase LAUNCH_ONE_ALWAYS_FREE_INSTANCE.&lt;br&gt;
The CLI flag --enable-create.&lt;/p&gt;

&lt;p&gt;An actual launch also requires the operator's explicit authorization.&lt;/p&gt;

&lt;p&gt;The application is designed around an existing network rather than automatically creating or modifying networking resources.&lt;/p&gt;

&lt;p&gt;It does not upgrade OCI accounts, terminate existing instances, or promise guaranteed capacity or zero billing.&lt;/p&gt;

&lt;p&gt;A capacity check is not a reservation, and Always Free eligibility must always be verified against your own OCI account and current Oracle terms.&lt;/p&gt;

&lt;p&gt;Development and Testing&lt;/p&gt;

&lt;p&gt;I wanted to validate more than just whether the Python code worked on my own machine.&lt;/p&gt;

&lt;p&gt;The repository now has GitHub Actions workflows covering:&lt;/p&gt;

&lt;p&gt;Python 3.11 and 3.12.&lt;br&gt;
Windows and Ubuntu.&lt;br&gt;
Application compilation and unit tests.&lt;br&gt;
CLI startup and packaging.&lt;br&gt;
Installer safety checks.&lt;br&gt;
A fresh Linux installer integration test.&lt;/p&gt;

&lt;p&gt;The Linux integration test checks installation in a clean temporary directory, verifies the installed commit, confirms the starter configuration keeps creation disabled, and checks that existing directories are preserved.&lt;/p&gt;

&lt;p&gt;I also encountered an environment-related problem while trying to run a Linux installation test in an isolated Debian container: DNS resolution for raw.githubusercontent.com failed.&lt;/p&gt;

&lt;p&gt;Instead of marking that attempt as successful, I added hosted Ubuntu integration coverage to the CI workflow.&lt;/p&gt;

&lt;p&gt;The latest main commit passed all six CI jobs.&lt;/p&gt;

&lt;p&gt;I also tested a fresh Windows installation and the interactive CLI on a second PC; that result was reported by the operator.&lt;/p&gt;

&lt;p&gt;There is still work to do around live OCI validation, so I am not claiming that every real-world tenancy or capacity scenario has been verified.&lt;/p&gt;

&lt;p&gt;Getting Started&lt;/p&gt;

&lt;p&gt;You need:&lt;/p&gt;

&lt;p&gt;Git&lt;br&gt;
Python 3.11 or newer&lt;br&gt;
Windows (PowerShell)&lt;/p&gt;

&lt;p&gt;Download the installer:&lt;/p&gt;

&lt;p&gt;powershell&lt;br&gt;
Invoke-WebRequest "&lt;a href="https://raw.githubusercontent.com/mudassir-93/OCI-Always-Free-VM/main/install.ps1" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/mudassir-93/OCI-Always-Free-VM/main/install.ps1&lt;/a&gt;" -OutFile install.ps1&lt;/p&gt;

&lt;p&gt;Review the installer:&lt;/p&gt;

&lt;p&gt;powershell&lt;br&gt;
Get-Content .\install.ps1&lt;/p&gt;

&lt;p&gt;Run the installer:&lt;/p&gt;

&lt;p&gt;powershell&lt;br&gt;
.\install.ps1&lt;/p&gt;

&lt;p&gt;Linux&lt;/p&gt;

&lt;p&gt;Download the installer:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
curl -fsSLO &lt;a href="https://raw.githubusercontent.com/mudassir-93/OCI-Always-Free-VM/main/install.sh" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/mudassir-93/OCI-Always-Free-VM/main/install.sh&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Review the installer:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
less install.sh&lt;/p&gt;

&lt;p&gt;Run the installer:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
bash install.sh&lt;/p&gt;

&lt;p&gt;Launch the Interactive CLI&lt;/p&gt;

&lt;p&gt;Windows:&lt;/p&gt;

&lt;p&gt;powershell&lt;br&gt;
$cli = "$HOME\oci-automation-platform.venv\Scripts\oci-platform.exe"&lt;br&gt;
&amp;amp; $cli&lt;/p&gt;

&lt;p&gt;Linux:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
CLI="$HOME/oci-automation-platform/.venv/bin/oci-platform"&lt;br&gt;
"$CLI"&lt;/p&gt;

&lt;p&gt;Start with local configuration and diagnostics before connecting to your OCI environment.&lt;/p&gt;

&lt;p&gt;The installer creates a starter configuration with VM creation disabled. Follow the detailed instructions in the repository before running live OCI checks.&lt;/p&gt;

&lt;p&gt;What's Next?&lt;/p&gt;

&lt;p&gt;The initial V1 code-delivery milestone is complete, but I see this as the beginning of community testing rather than the end of development.&lt;/p&gt;

&lt;p&gt;Some areas I'd like to improve through feedback:&lt;/p&gt;

&lt;p&gt;More real-world OCI A1 edge-case testing.&lt;br&gt;
Better diagnostics and operator feedback.&lt;br&gt;
Additional installation and configuration testing across environments.&lt;br&gt;
Improvements to monitoring and retry behavior.&lt;br&gt;
More useful workflows for AI-assisted maintenance.&lt;/p&gt;

&lt;p&gt;I also want to keep the project lightweight rather than turn it into a large platform with unnecessary services.&lt;/p&gt;

&lt;p&gt;I'd Love Your Feedback&lt;/p&gt;

&lt;p&gt;I'm especially interested in hearing from developers who use Oracle Cloud, Python automation, or cross-platform CLI tools.&lt;/p&gt;

&lt;p&gt;A few questions:&lt;/p&gt;

&lt;p&gt;Would you find a tool like this useful for managing OCI A1 capacity?&lt;br&gt;
What edge cases should I test before a wider release?&lt;br&gt;
Is the interactive terminal experience a good approach, or would you prefer a different workflow?&lt;br&gt;
What would you improve in the current architecture?&lt;/p&gt;

&lt;p&gt;Feedback, bug reports, and contributions are welcome.&lt;/p&gt;

&lt;p&gt;Explore the Project&lt;/p&gt;

&lt;p&gt;GitHub Repository: &lt;a href="https://github.com/mudassir-93/OCI-Always-Free-VM" rel="noopener noreferrer"&gt;https://github.com/mudassir-93/OCI-Always-Free-VM&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading! &lt;/p&gt;

</description>
      <category>python</category>
      <category>opensource</category>
      <category>cloud</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
