hitrov/oci-arm-host-capacity

PHP Fatal error: Uncaught Hitrov\Exception\CurlException: curl error occurred: Could not resolve host: iaas.eu-amsterdam-1-AD-1.oraclecloud.com

MitchellHofwijks opened this issue · 2 comments

Hey Guys,

Can anyone help me out with this error message?

ubuntu@instance-***********-***~/.local/bin/oci-arm-host-capacity$ sudo php index.php
PHP Fatal error:  Uncaught Hitrov\Exception\CurlException: curl error occurred: Could not resolve host: iaas.eu-amsterdam-1-AD-1.oraclecloud.com, response:  in /home/ubuntu/.local/bin/oci-arm-host-capacity/src/HttpClient.php:31
Stack trace:
#0 /home/ubuntu/.local/bin/oci-arm-host-capacity/src/OciApi.php(257): Hitrov\HttpClient::getResponse()
#1 /home/ubuntu/.local/bin/oci-arm-host-capacity/src/OciApi.php(132): Hitrov\OciApi->call()
#2 /home/ubuntu/.local/bin/oci-arm-host-capacity/index.php(74): Hitrov\OciApi->getInstances()
#3 {main}
thrown in /home/ubuntu/.local/bin/oci-arm-host-capacity/src/HttpClient.php on line 31

"iaas.eu-amsterdam-1-AD-1.oraclecloud.com" cannot be resolved?

Any pointers are much apreciated.

Cheers,

Mitch

hitrov commented

I believe the proper region name must be eu-amsterdam-1. and if for example there's only one availability domain within this region, you can completely skip setting OCI_AVAILABILITY_DOMAIN

I believe the proper region name must be eu-amsterdam-1. and if for example there's only one availability domain within this region, you can completely skip setting OCI_AVAILABILITY_DOMAIN

Good morning Hitrov,
Thanks for your reply.

I believe the proper region name must be "eu-amsterdam-1".
yes I got that from the OCI portal:
OCI_REGION=eu-amsterdam-1-AD-1

and if for example there's only one availability domain within this region, you can completely skip setting "OCI_AVAILABILITY_DOMAIN"
Yes again there is only1 availability domain and i skipped it but there are 3 "Fault domains" is that an issue?

image

This is my redacted .env:
###########################################################################################
OCI_REGION=eu-amsterdam-1-AD-1
OCI_USER_ID=ocid1.user.oc1..aaaaaaaa***********************
OCI_TENANCY_ID=ocid1.tenancy.oc1..aaaaaaaa*************
OCI_KEY_FINGERPRINT=*************************************

absolute path (including directories) or direct public accessible URL

OCI_PRIVATE_KEY_FILENAME="/.pem"
OCI_SUBNET_ID=ocid1.subnet.oc1.eu-amsterdam-1.aaaaaaaaq2****************
OCI_IMAGE_ID=ocid1.image.oc1.eu-amsterdam-1.aaaaaaaa
******

Always free ARM: 1,2,3,4. Always free AMD x64: 1

OCI_OCPUS=4

Always free ARM: 6,12,18,24. NB! Oracle Linux Cloud Developer Image requires minimum 8. Always free AMD x64: 1

OCI_MEMORY_IN_GBS=24

Or "VM.Standard.E2.1.Micro" for Always free AMD x64

OCI_SHAPE=VM.Standard.A1.Flex
OCI_MAX_INSTANCES=1

Your public key ~/.ssh/id_rsa.pub contents

NB! No new lines / line endings allowed! Put inside double quotes

OCI_SSH_PUBLIC_KEY="ssh-rsa *************************************"

Is now optional for ARM since Always Free ARMs can be created in any AD.

ListAvailabilityDomains API call will be used for retrieval https://docs.oracle.com/en-us/iaas/api/#/en/identity/20>

NB! Always free AMD x64 instances should be created only in "main" (Always Free Eligible) AD,

you must set it manually in this case!

If you wanna specify more than one, set as a PHP array in OciConfig constructor (inside index.php file)

OCI_AVAILABILITY_DOMAIN=

CACHE_AVAILABILITY_DOMAINS=1

Optional. If not set, default value depends on OCI_IMAGE_ID will be used.

Minimum is 47 for AMD x64 or 50 for ARM, maximum is 200 for Always Free accounts

OCI_BOOT_VOLUME_SIZE_IN_GBS=200

Optional. If set, will be used instead OCI_IMAGE_ID. Cannot be used together with OCI_BOOT_VOLUME_SIZE_IN_GBS.

Open https://cloud.oracle.com/block-storage/boot-volumes, click non-used and copy it's OCID

NB! You must specify OCI_AVAILABILITY_DOMAIN also as they should be located in the same one

OCI_BOOT_VOLUME_ID=

TOO_MANY_REQUESTS_TIME_WAIT=600
###########################################################################################