mohankumarpaluru / oracle-freetier-instance-creation

A script to create free instance
MIT License
164 stars 33 forks source link

Error 400, Limit Exceeded #36

Open aryanmcr opened 2 months ago

aryanmcr commented 2 months ago

Describe the bug Basically, about a week ago i set this up. Yesterday i got this message: image In the config i have not set anything about instance ocpu or ram, and its saying this. I'm unsure if this means 4ocpu is too much or something else. I am also running this script on oracle cloud VM.Standard.E2.1.Micro through ssh. I have checked the github and i cant find any way to customise size of instance. Yeah thats basically it, all i want is a minecraft server.

Expected behavior Create an instance, preferrable max size (or 3ocpu)

Instance Type (please complete the following information): OCI_COMPUTE_SHAPE=VM.Standard.A1.Flex SECOND_MICRO_INSTANCE=False REQUEST_WAIT_TIME_SECS=60 SSH_AUTHORIZED_KEYS_FILE=/home/ubuntu/oracle-freetier-instance-creation/id_rsa.pub

Environment (please complete the following information):

Screenshots image

Additional context Yeah, i'm really unsure what to do. Sorry if i made a dumb mistake, I'm not familiar with oracle cloud. Thanks image

aryanmcr commented 2 months ago

Hey, i just looked at the code and couldnt find any config for it, could i suggest some? I dont know how to start a pull request (sorry if i did it wrong i dont know much python):

main.py (around the start) and lines 410~:

...
OCI_COMPUTE_OCPUS = int(os.getenv("OCI_COMPUTE_OCPUS", "4").strip()) 
OCI_COMPUTE_MEMORY = int(os.getenv("OCI_COMPUTE_MEMORY", "24").strip()) 
...
    if OCI_COMPUTE_SHAPE == "VM.Standard.A1.Flex":
        shape_config = oci.core.models.LaunchInstanceShapeConfigDetails(ocpus=OCI_COMPUTE_OCPUS, memory_in_gbs=OCI_COMPUTE_MEMORY)

oci.env:

...
OCI_COMPUTE_OCPUS="4" 
OCI_COMPUTE_MEMORY="24"
...
mohankumarpaluru commented 2 months ago

Hey @aryanmcr, adding option to customize the size pretty straightforward, just as you described. I haven't included that because basically everyone's looking for an instance with maximum free capacity. I'll include it along with future changes. But I think your issue is a little bit different if I understood correctly.

Just to clarify, the free tier for ARM instances allows for up to 4 vCPUs and 24GB of RAM, while the Micro tier lets you have 2 instances with 1 vCPU each. If you haven't set up an ARM instance yet, you should be able to create one with those max limits.

Are you trying to create your first ARM resource, or is this for a second instance? Let me know, and we can debug the error together.

aryanmcr commented 2 months ago

Hey, I've never created an arm instant, only micros

mohankumarpaluru commented 2 months ago

ohh then you should be able to create a instance with 4vcpu , are you still getting same limit exceeded error ?

SOIMiMozO commented 2 months ago

I can confirm. Getting the same error. I have two micro instances but zero Standard.A1.Flex ones. I'm getting image

The only thing which comes to mind is boot volumes. I have checked, I do not have any old boot volumes, but I have two 50Gb ones for Micro instances. Maybe those are blocking it.

sMouaad commented 2 months ago

Same for me, except that I ran the script on local, and my oracle account has 0 ressources created aside from vcn Screenshot_20240903_004545_Gmail

mohankumarpaluru commented 2 months ago

We are allowed to create 200GB of total space in the free tier, if yours didn't exceed then it might probably be the case mentioned here and I currently don't have a way to handle this as I already implemented some increased wait time on limit exceeded error. Maybe I should see if there is a way to refresh the connection or something

SOIMiMozO commented 1 month ago

Also, the script does not proceed with retries after the error. Or at least it stops producing any logs.

alpxp commented 1 month ago

I've changed the line 410 to shape_config = oci.core.models.LaunchInstanceShapeConfigDetails(ocpus=3, memory_in_gbs=18) but have the same error. 3 times in a raw. Screenshot 2024-09-23 at 17 34 11