Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Multiple availability domains? #137

Open
mehapps opened this issue May 22, 2024 · 5 comments
Open

Multiple availability domains? #137

mehapps opened this issue May 22, 2024 · 5 comments

Comments

@mehapps
Copy link

mehapps commented May 22, 2024

How can I have it check multiple? I had OCI_AVAILABILITY_DOMAIN=['PoxX:US-ASHBURN-AD-1','PoxX:US-ASHBURN-AD-2','PoxX:US-ASHBURN-AD-3']
And I'm getting this error
{ "code": "CannotParseRequest", "message": "Incorrectly formatted request. Please refer to our documentation for help." }

@ethanseverson
Copy link

I got mine to work by setting OCI_AVAILABILITY_DOMAIN with this array format in the .env
OCI_AVAILABILITY_DOMAIN='["IiXX:US-CHICAGO-1-AD-1", "IiXX:US-CHICAGO-1-AD-2", "IiXX:US-CHICAGO-1-AD-3"]'

then i modified this in index.php

//add this above the constructor
$ociAvailabilityDomain = getenv('OCI_AVAILABILITY_DOMAIN') ? json_decode(getenv('OCI_AVAILABILITY_DOMAIN'), true) : null;

$config = new OciConfig(
    getenv('OCI_REGION'),
    getenv('OCI_USER_ID'),
    getenv('OCI_TENANCY_ID'),
    getenv('OCI_KEY_FINGERPRINT'),
    getenv('OCI_PRIVATE_KEY_FILENAME'),
    $ociAvailabilityDomain, // change this line
    getenv('OCI_SUBNET_ID'),
    getenv('OCI_IMAGE_ID'),
    (int) getenv('OCI_OCPUS'),
    (int) getenv('OCI_MEMORY_IN_GBS')
);

After these changes, the script will check each availability domain

@mehapps
Copy link
Author

mehapps commented May 24, 2024

Do you get PHP Warning: Undefined variable $ociAvailabilityDomains in /Users/mehapps/Downloads/oci-arm-host-capacity/index.php on line 31 with this? I've been getting it for ashburn

@ethanseverson
Copy link

ethanseverson commented May 24, 2024

I did and it works fine, but i added this above the constructor and now it is working as expected with no warning

//add this above the constructor
$ociAvailabilityDomain = getenv('OCI_AVAILABILITY_DOMAIN') ? json_decode(getenv('OCI_AVAILABILITY_DOMAIN'), true) : null;

Output:

=== Thu May 23 22:14:01 CDT 2024 ===
{
    "code": "InternalError",
    "message": "Out of host capacity."
}
{
    "code": "InternalError",
    "message": "Out of host capacity."
}
{
    "code": "InternalError",
    "message": "Out of host capacity."
}

@mehapps
Copy link
Author

mehapps commented May 24, 2024

I think my script is setup weird - it tries each domain once and then sends me back to terminal

@mehapps
Copy link
Author

mehapps commented May 24, 2024

Also that constructor seems the same, getting the error still

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants