Skip to content

Latest commit

 

History

History
176 lines (152 loc) · 5.07 KB

README.md

File metadata and controls

176 lines (152 loc) · 5.07 KB

Oracle Cloud Infrastructure Out of Capacity Error

Fix for Oracle Cloud Infrastructure Out of Capacity error. Oracle Cloud Infrastructure Currently GitHub release dependency - Python

Made by Moses

If you appreciate what I do please ko-fi

Skip to Section

Installation Configuration How to use In Use Show your support❤️

Installation

One Command Install

git clone https://github.com/mosesman831/OCI-OcC-Fix.git && cd OCI-OcC-Fix && pip install -r requirements.txt

Pro Tip Use the One Command Install to setup quickly

Using Git

Step 1

Run Git Clone.

git clone https://github.com/mosesman831/OCI-OcC-Fix.git

Step 2

Enter the folder.

cd OCI-OcC-Fix

Step 3

Install requirements and dependicies

pip install -r requirements.txt

Using Releases

Open Releases and download latest

Install required dependicies

pip install -r requirements.txt

wget

Install unzip if not already installed.

sudo apt-get install unzip

wget

wget https://github.com/mosesman831/OCI-OcC-Fix/archive/refs/heads/main.zip && unzip main.zip && mv OCI-OcC-Fix-main OCI-OcC-Fix && rm main.zip

Install required dependicies

pip install -r requirements.txt

Configuration

Getting Oracle Cloud API

Step 1

Open Oracle Cloud and log in.

Step 2

Click profile icon and then "My Profile / User Settings"

Step 3

Find API keys, click "Add API Key" button

Step 4

Click "Download Private Key" and then "Add". Save the file as oci_private_key.pem

Step 5

Copy the contents from the Text Box and save it to file config.

Pro Tip You could use nano to edit the files easier.

Getting Telegram Bot ID

Step 1

Open Telegram and message @BotFather

Step 2

Send /newbot

Step 3

Enter name and username

Step 4

Get Bot ID

Step 5

Message @Rose-Bot

Step 6

Send /id

Step 7

Get userid

Getting Oracle Cloud cURL

Step 1

Create an instance from from the OCI Console in the browser (Menu -> Compute -> Instances -> Create Instance)

Step 2

Change image and shape.

Step 3

Adjust Networking section, set "Do not assign a public IPv4 address" checkbox. If you don't have existing VNIC/subnet, please create VM.Standard.E2.1.Micro instance before doing everything.

Step 4

Download and save the public and private SSH key.

Step 5

Click Ctrl + Shift + I or F12 to open browser's dev tools -> network tab

Step 6

Click Create and see if you get the Out of capacity error. Now find /instances API call (red).

Step 7

Right click on it -> copy as curl (bash/cmd). Paste the clipboard contents in any text editor.

Step 8

Open bot.py in a a text editor.

Step 9

Find the variables and replace the xxxx fields respectively.

availabilityDomains = ["xxxx"]
#e.g. availabilityDomains = ["KHsT:UK-MANCHESTER-1-AD-1","KHsT:UK-MANCHESTER-1-AD-2"]
displayName = 'xxxx'
#e.g. displayName = 'VPS1'
compartmentId = 'xxxx'
#e.g. compartmentId = 'ocid1.tenancy.oc1..aaaaaaaa...'
subnetId = 'xxxx'
#e.g. subnetId = 'ocid1.subnet.oc1.uk-manchester-1.aaaaaaa...'
ssh_authorized_keys = "xxxx"
#e.g. ssh_authorized_keys = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABKDNBgQDf... ssh-key-2024-03-15"
boot_volume_size_in_gbs="xxxx"
#Leave blank for default
#e.g. boot_volume_size_in_gbs="47"
boot_volume_id="xxxx"
#e.g. boot_volume_id="ocid1.bootvolume.oc1.uk-manchester-1.aaaaaaa..."

How to use?

Run bot.py by double-clicking or running

python bot.py
python3 bot.py

Run on SSH

One Command SSH

tmux new && python3 bot.py

Tmux

Use tmux to keep window running even after logout.

tmux new

In Use

Success

Success Picture in Console

Prerelease Prototype v0.1--prototype Success Picture

Show your support ❤️

If you appreciate what I do please

Star this project

or

Support me on Ko-fi!

ko-fi

Thanks for supporting!