mohankumarpaluru / oracle-freetier-instance-creation

A script to create free instance
MIT License
177 stars 34 forks source link

Add support for VM.Standard.E2.1.Micro free shape #12

Closed leewc closed 6 months ago

leewc commented 6 months ago

Add support for VM.Standard.E2.1.Micro free shape and set executable bit for setup_init.sh


Thanks for sharing this script! I used the OG PHP one: https://github.com/hitrov/oci-arm-host-capacity previously but also prefer a native Python option.

I attempted to use this script to secure a free instance of the already free x86 instance. It seems to be doing it's job but I haven't had any luck for the past 2 weeks. (Attempted to create an instance in Singapore region for an account that the trial has expired and is now only 'always free').

I also noticed the script would die after 24-48 hours, but that was before I rebased with the bad gateway fix commit recently introduced. Will try it again when I need it.

ref to set executable bit:

mohankumarpaluru commented 6 months ago

Hey @leewc, thank you for the PR.

While reviewing, I observed that this commit does not include handling the scenario where a user attempts to create a second Micro instance while an existing one is already running. Since the ARM limit is set to 1, we are skipping the creation if an instance is already present. I will add this functionality after some more testing but in the meantime, I will merge the current changes.

Thanks also for the tip on setting files as executable in Git - that's helpful for other projects too.

Regarding the script dying after 24-48 hours, if this happens again, could you catch the error and raise an issue so we can improve our error handling?

leewc commented 6 months ago

Thanks @mohankumarpaluru ! Makes sense, I did not consider that scenario as I stumbled on this script to mainly get one myself. I'll catch and raise the issue if I run into it again! It might just be a system restart and ps shows it died after awhile. (I did not setup a cron job).