Out of capacity for shape VM.Standard.A1.Flex

Im getting the following message when trying to create and instance. I did some googling but ended up always in some sketchy places with bypassing and needing to becarefull not to get you github account banned and so on.

Out of capacity for shape VM.Standard.A1.Flex in availability domain AD-1. Create the instance in a different availability domain or try again later. If you specified a fault domain, try creating the instance without specifying a fault domain, otherwise try creating the instance in a different availability domain. If that doesn’t work, please try again later. Learn more about host capacity.

I am wondering if there is a limit on often i need to try to click that create button. Is it ones an hour i should be tryining to create a server. Should I be trying it ones per day. Is it actually worth trying to create a server since some other said it is no use and will takes months. Or is the only option to go that scetchy way over some API stuff. Sry not too talented what computer and software is concered i mainly just to folow a instruction to set up a minecraft server for a friend and myself.

I used this code in the Chrome console. It is stupid but it worked. I got an instance created in Frankfurt in a few hours.It clicks the Create button every 30 secs.Just copy/pasta in the Chrome console. The F12 key opens the console.Make sure sandbox-… is selected in the dropdown and console output is filtered by “clicked” to see the script working.

https://imgur.com/a/2h8s5jl

setInterval(function() {
var v = document.querySelector(".oui-savant__Panel--Footer .oui-button.oui-button-primary");
if (v && v.textContent == "Create") {
    v.click();
    console.log("clicked");
} else
    console.log("no button");
}, 30000);

I created a script, using AutoIT, to run inside a virtual machine and do the clicking. I open two tabs of a browser, both showing OCI’s interface, and in one of them I fill what is necessary to create the instance, and let the “Create” (or whatever) button ready to be clicked. Then I start the script, that looks for that button and clicks it if it’s there and tries again every ten seconds. After some time, shorter than the expiration of the OCI session, the script clicks on the other tab, refreshes it (so the session doesn’t expire), than goes back to the first tab, with a pause between each action, and continues its job. If the instance is successfully created, or if some problem occurs, the script won’t recognize the “create” button anymore and will stop. It may take more that 24 hours, but worked in the few times I used it, and at the end of the day it’s a matter or luck from our points of view.

If I would have to do it a lot of times, I would create a script that wouldn’t use the web interface. I mean: I would look for such scripts on the web, and then verify all the code before I used it. My way is much easier, for my own needs.

as of late 2023, I edited the code and it worked for me within ~4 hours. I wanted to say thanks to everyone on this thread for providing awesome info, and I pretty much merged the coding done by u/pirke_bh, and u/VibesTech. Also use this in the chrome console with sandbox selected from the top dropdown menu (you can see what that looks like on pirke_bh’s post). When you run the code, it will open a new tab. Just switch back to the tab where you had the create instance button and let it run! Filter the console results to “!!!” to see how many times it has run/if there are errors. Every 70 seconds the program will reload the opened tab in the background (so you don’t have to sign in again), and click the create button for you. Be patient, and best of luck to anyone giving this a shot! :slight_smile:

// Open the home page in a new tab

win1 = window.open("https://cloud.oracle.com/");

var v = document.querySelector(".oui-savant__Panel--Footer .oui-button.oui-button-primary");

// At every 30 seconds, reload the home page and click "Create"

timer1 = setInterval(() => {

win1.location.reload();

console.log("Refreshed");

if (v && v.textContent == "Create") {

v.click();

console.log("!!! clicked");

} else

console.log("!!! no button");

}, 30000)

All these automated attempts will soon end up oracle introducing CAPTCHA before the create button

So basically there’s a whole subreddit of people creating bot scripts to abuse Oracle’s free tier to run Minecraft servers? What the hell man, you guys are basically hoarding the resources and preventing people who might want to use this service for productive tasks from accessing it.

ALL TO RUN MINECRAFT SERVERS?!?!

This is exactly why we can’t have good things anymore.

I was stupid enough to terminate my instance because I wanted to re-create with a smaller boot volume (yes, I know now that I should have just detached the existing and only terminated that).

Anyway, now I’m stuck in this “Out of host capacity” hell, but I have gone another way, a more OCI way you might say.

I started by going through the creation of a compute instance with the specifications I wanted, and saved that as a stack. Then using the Oracle Cloudshell I’ve created the following BASh script that simply continously tries to create apply the stack, until it succeeds.

In the Oracle Cloudshell, create a script and copy the following into it (or create it locally and upload it).

    #!/bin/bash
    COMPARTMENT_ID=$(oci iam compartment list --query 'data[0]."compartment-id"' --raw-output)
    echo "Using Compartment ID: '${COMPARTMENT_ID}'"
    
    STACK_ID=$(oci resource-manager stack list --compartment-id ${COMPARTMENT_ID} --query 'data[0].id' --raw-output)
    echo "Using Stack ID: ${STACK_ID}"
    echo
    
    function plan_job() {
        JOB_ID=$(oci resource-manager job create --stack-id ${STACK_ID} --operation PLAN --query "data.id" --raw-output)
        echo "Created 'PLAN' job with ID: '${JOB_ID}'"
        echo -n "Status for 'PLAN' job:"
        while true; do
            OSTATUS=${STATUS}
            JOB=$(oci resource-manager job get --job-id ${JOB_ID})
            #STATUS=$(oci resource-manager job get --job-id ${JOB_ID} --query 'data."lifecycle-state"' --raw-output)
            STATUS=$(echo ${JOB} | jq -r '.data."lifecycle-state"')
            WAIT=10
            for i in $(seq 1 ${WAIT}); do
                if [ "${STATUS}" == "${OSTATUS}" ]; then
                    echo -n "."
                else
                    echo -n " ${STATUS}"
                    break
                fi
                sleep 1
            done
            if [ "${STATUS}" == "SUCCEEDED" ]; then
                echo
                echo
                break
            elif [ "${STATUS}" == "FAILED" ]; then
                echo "The 'PLAN' job failed. Error message:"
                echo $(echo ${JOB} | jq -r '.data."failure-details".message')
                exit 1
            fi
            sleep 5
        done
    }
    
    function apply_job() {
        JOB_ID=$(oci resource-manager job create --stack-id ${STACK_ID} --operation APPLY --apply-job-plan-resolution "{\"isAutoApproved\":true}" --query "data.id" --raw-output)
        echo "Created 'APPLY' job with ID: '${JOB_ID}'"
        echo -n "Status for 'APPLY' job:"
        while true; do
            OSTATUS=${STATUS}
            JOB=$(oci resource-manager job get --job-id ${JOB_ID})
            #STATUS=$(oci resource-manager job get --job-id ${JOB_ID} --query 'data."lifecycle-state"' --raw-output)
            STATUS=$(echo ${JOB} | jq -r '.data."lifecycle-state"')
            WAIT=10
            for i in $(seq 1 ${WAIT}); do
                if [ "${STATUS}" == "${OSTATUS}" ]; then
                    echo -n "."
                else
                    echo -n " ${STATUS}"
                    break
                fi
                sleep 1
            done
            if [ "${STATUS}" == "SUCCEEDED" ]; then
                echo "The 'APPLY' job succeeded. Exiting."
                exit 0
            elif [ "${STATUS}" == "FAILED" ]; then
                echo
                echo "The 'APPLY' job failed. Error message:"
                echo $(echo ${JOB} | jq -r '.data."failure-details".message')
                echo
                echo "Logged error:"
                echo $(oci resource-manager job get-job-logs-content --job-id ${JOB_ID} --query 'data' --raw-output | grep "Error:")
                break
            fi
            sleep 5
        done
    }
    
    WAIT=35
    while true; do
        plan_job
        apply_job
        echo -n "Waiting for retry"
        for i in $(seq 1 ${WAIT}); do
            echo -n "."
            sleep 1
        done
        echo "Retrying"
        echo
    done

Here’s a sample of the script output:

    USERNAME@cloudshell:~ (eu-stockholm-1)$ ./stack.sh 
    Using Compartment ID: 'ocid1.tenancy.oc1..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    Using Stack ID: ocid1.ormstack.oc1.eu-stockholm-1.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
    Created 'PLAN' job with ID: 'ocid1.ormjob.oc1.eu-stockholm-1.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    Status for 'PLAN' job: ACCEPTED.......... IN_PROGRESS SUCCEEDED
    
    Created 'APPLY' job with ID: 'ocid1.ormjob.oc1.eu-stockholm-1.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    Status for 'APPLY' job: ACCEPTED.......... IN_PROGRESS FAILEDThe 'APPLY' job failed. Error message:
    The job failed due to an error in the Terraform configuration. To troubleshoot this issue, view the job log.
    
    Logged error:
    2024/07/20 19:41:01[TERRAFORM_CONSOLE] [INFO] Error: 500-InternalError, Out of host capacity.
    Waiting for retry..........Retrying

Enjoy

Using a script for all 3 AD’s in Frankfurt and has been a few days, unfortunately got nothing… I have been running the script a few hours a day, sometimes 6, sometimes up to 12. I might go for 24/7 to take all the chances…

You can use feauture in android studio to boot up a android emulator(make sure to download one with play store option. Then simply download op auto clicker and log in on oraclecloud on chrome on that device. In op autoclicker use option to click multiple spots and wait for the continue session button to appear and align the buttons on that.

I tried the script. I waited 10 days and nothing happened :frowning:

I transferred my account to a paid tariff (48 hours there decided something) and created everything on the first try (2 x E2.1.Micro and 1 x A1. Flex )

The main thing is that the volume of boot volumes does not exceed 200 GB

Hi! This is old, but I wanted to post for visibility.

The button is now inside an iframe, and the querySelectors specified in the comments no longer work.

This querySelector works for the button:

document.querySelector("iframe#sandbox-compute-container").contentWindow.document.querySelector("div.oui-savant__Panel--Footer button.oui-button.oui-button-primary");

Code working for me on chrome as of 25th of October 2024

// Open the home page in a new tab

win1 = window.open(“https://cloud.oracle.com/”);

var parent =document.querySelector(“.oui-savant__Panel–Footer”);

var v = parent.querySelector(“.oui-button.oui-button-primary”);

// At every 30 seconds, reload the home page and check the button

timer1 = setInterval(() => {

win1.location.reload();

console.log(“Refreshed”);

if (v) {

console.log(“!!! Exists”);

if (v.textContent == “Create”) {

v.click();

console.log(“!!! Button clicked”);

} else {

console.log(“!!! Wrong text” + v.textContent);

}

} else {

console.log(“!!! no exist”);

}

}, 30000);

var win1 = window.open("https://cloud.oracle.com/");
var clickCount = 0;

var reloadTimer = setInterval(() => {
    win1.location.reload();
    console.log("!!! PAGE RELOADED");
}, 120000); // 120000 ms = 120 secconds

var clickTimer = setInterval(() => {
    var button = document.querySelector("iframe#sandbox-compute-container").contentWindow.document.querySelector("div.oui-savant__Panel--Footer button.oui-button.oui-button-primary");

    if (button) {
        clickCount++;
        console.log(`!!! CLICKED (${clickCount})`);
        button.click(); 
    } else {
        console.log("!!! NO BUTTON");
    }
}, 30000); // 30000 ms = 30 secconds

Works 07/11/2024 :slight_smile:

try using this guys’ code : https://github.com/gardinbe/oracle-compute-instance-creation-script?tab=readme-ov-file

For those still having trouble creating an instance, try selecting availability domain 3. I used the scripts that other commentors put below on AD 1 and AD 2 with no success. Frustrated, I randomly decided to try AD 3 and it worked immediately. Hope you get your server!

if you are just trying to run a minecraft server then you can simply select a different AD when creating the VM

is it still working ??

So here is a script that I used for creating a free instance. I used the sign up bonus to run a machine that hosts my code and executes it every 10 seconds to a different availability domain.

You need to get your config file from your account in Oracle cloud: Just create a new pair of keys and oracle will generate a config file for you that should look like this

\[DEFAULT\]

user=ocid1.user.oc1.....

fingerprint=bd:ef:bf:8

tenancy=ocid1.tenancy.oc1.....

region=eu-frankfurt-1

key\_file=<PATH>

here is the python script. I used Frankfurt servers, which is why I used a counter, because we have three availability domains

import oci
import time

# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file(file_location="./config")

# Create a service client
compute = oci.core.ComputeClient(config)
counter = 0
# Create instance in a loop until successful
while True:
    counter += 1
    i =  counter % 3 + 1
    availability_domain = "abMm:EU-FRANKFURT-1-AD-" + str(i)
    print("try number", counter, "to instance", availability_domain)
    try:
        # Create instance
        response = compute.launch_instance(
            launch_instance_details=oci.core.models.LaunchInstanceDetails(
                availability_domain=availability_domain,
                compartment_id="ocid1.tenancy.oc1..etc",
                shape="VM.Standard.A1.Flex",
                subnet_id="ocid1.subnet.oc1.eu-frankfurt-1.etc",
                metadata={
                    "ssh_authorized_keys": "ssh-rsa key"
                },
                create_vnic_details=oci.core.models.CreateVnicDetails(
                    assign_public_ip=True,
                    assign_private_dns_record=True,
                    subnet_id="ocid1.subnet.oc1.eu-frankfurt-1.etc"),
                shape_config=oci.core.models.LaunchInstanceShapeConfigDetails(
                    ocpus=4,
                    memory_in_gbs=24),
                source_details=oci.core.models.InstanceSourceViaImageDetails(
                    source_type="image",
                    image_id="ocid1.image.oc1.eu-frankfurt-1.aaaaaaaa73bqv3ul5s4oicfyd65abbezcpuzpdw4t4fdfcjup2zzw2kvjnha"),
                display_name="PythonInstance"
            )
        )
        instance_id = response.data.id

        # Verify instance is available
        while True:
            instance = compute.get_instance(instance_id).data
            if instance.lifecycle_state == "RUNNING":
                print(f"Instance {instance_id} is running!")
                break

            print(instance)
            time.sleep(10)  # wait before checking again

        break  # exit the while loop when the instance is successfully created and running
    except Exception as e:
        print(f"An error occurred: {str(e)}")
        time.sleep(10)  # wait before trying again

Running mine now. Wish me success

Currently I’m using script from this tutorial: https://www.youtube.com/watch?v=i04qE0HFdq0 . But instead of deploying code to third party sites like heroku, I created amd free tier instace and ran script on it. These vm’s are almost always ready to set up and don’t give out of capacity error.