Fix for Oracle Cloud Infrastructure Out of Capacity error.
Installation Configuration How to use In Use Show your support❤️ Contributors
git clone https://github.com/mosesman831/OCI-OcC-Fix.git && cd OCI-OcC-Fix && pip install -r requirements.txt
Tip
Use the One Command Install to setup quickly
Run Git Clone.
git clone https://github.com/mosesman831/OCI-OcC-Fix.git
Enter the folder.
cd OCI-OcC-Fix
Install requirements and dependencies
pip install -r requirements.txt
Open Releases and download latest
Install required dependencies
pip install -r requirements.txt
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 dependencies
pip install -r requirements.txt
Build the Docker Container
sudo docker compose build
Start Docker Containers
sudo docker compose up -d
View Container Logs
sudo docker logs -f <cotainer>
Not yet added.
Open Oracle Cloud and log in.
Click profile icon and then "My Profile / User Settings"
Find API keys, click "Add API Key" button
Click "Download Private Key" and then "Add". Save the file as oci_private_key.pem
Copy the contents from the Text Box and save it to file config
.
Tip
You could use nano
to edit the files easier.
Open Telegram and message @BotFather
Send /newbot
Enter name and username
Message @Rose-Bot to get User ID ("uid")
Send /id
Get userid
Create an instance from the OCI Console in the browser (Menu -> Compute -> Instances -> Create Instance)
Change image and shape.
Adjust the Networking section, and set the "Do not assign a public IPv4 address" checkbox. If you don't have an existing VNIC/subnet, please create a VM.Standard.E2.1.Micro instance before doing everything.
Download and save the public and private SSH keys.
Click Ctrl + Shift + I
or F12
to open browser's dev tools -> network tab
Click Create and see if you get the Out of capacity error. Now find /instances API call (red).
Right-click on it -> copy as curl (bash/cmd). Paste the clipboard contents in any text editor.
Open bot.py in a text editor.
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..."
Run bot.py
by double-clicking or running
python bot.py
python3 bot.py
tmux new && python3 bot.py
Use tmux
to keep window running even after logout.
tmux new
Peter Eisenschmidt 💻 |
aldacco 💻 📖 |
Joery Zegers 💻 |