I am working with packer in OCI government regions (us-luke-1 and us-langley-1). However even if my CLI profile is set to a government region, packer calls the commercial endpoints.
2020/03/04 14:48:07 ui error: ==> oracle-oci: Problem creating instance: Post https://iaas.us-langley-1.oraclecloud.com/20160918/instances: dial tcp: lookup iaas.us-langley-1.oraclecloud.com: getaddrinfow: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.
2020/03/04 14:48:07 [INFO] (telemetry) ending oracle-oci
2020/03/04 14:48:07 ui error: Build āoracle-ociā errored: Problem creating instance: Post https://iaas.us-langley-1.oraclecloud.com/20160918/instances: dial tcp: lookup iaas.us-langley-1.oraclecloud.com: getaddrinfow: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.
2020/03/04 14:48:07 machine readable: error-count string{ā1ā}
2020/03/04 14:48:07 ui error:
==> Some builds didnāt complete successfully and had errors:
2020/03/04 14:48:07 machine readable: oracle-oci,error string{āProblem creating instance: Post https://iaas.us-langley-1.oraclecloud.com/20160918/instances: dial tcp: lookup iaas.us-langley-1.oraclecloud.com: getaddrinfow: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.ā}
2020/03/04 14:48:07 ui error: --> oracle-oci: Problem creating instance: Post https://iaas.us-langley-1.oraclecloud.com/20160918/instances: dial tcp: lookup iaas.us-langley-1.oraclecloud.com: getaddrinfow: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.
It needs to point to https://iaas.us-langley-1.oraclegovcloud.com instead. Has anyone else found a way to override this or does it just need to be a new release of the OCI packer builder? Btw this is filed under hashicorp/packer #8842
sorry for the late reply, I just joined the forums here⦠is this topic still relevant to you, or did you find a solution in the meantime? If you still struggle, let me know and I will look into your problem.
I am still interested. I am building them in commercial and moving then exporting into government regions. However, I think this could be easily expanded into oracleās other regions like government (and DoD). I think it is just a fix for the endpoint that if the region is one of the government regions (Luke and Langley) it goes to oraclegovcloud.com instead of oraclecloud.com. I can lend my knowledge of OCI, I just donāt know how packer is build
I just delved into the source code and had a look.
Assuming your builder configuration in the JSON template is correct, I agree it has to be an issue regarding the endpoint. As you might have noticed, the endpoints are not a configuration parameter (you only specify the region). The endpoints are not a part of Packer⦠they are constructed in the OCI go SDK which is, like the oci-builder itself, written by Oracle.
ā 8< ā
[ā¦]
//RegionUSLangley1 region for langley
RegionUSLangley1 Region = āus-langley-1ā
//RegionUSLuke1 region for luke
RegionUSLuke1 Region = āus-luke-1ā
[ā¦]
var realm = map[string]string{
āoc1ā: āoraclecloud.comā,
āoc2ā: āoraclegovcloud.comā,
āoc3ā: āoraclegovcloud.comā,
āoc4ā: āoraclegovcloud.ukā,
}
[ā¦]
So my best guess at the moment is that you might use a deprecated version of the oci builder because the current version of the SDK should cover this and construct the endpoint URLs correctly.
Can you give it a try? If it doesnāt work, we should ask Oracle.
Same error. Now may I didnāt upgrade the builder except I donāt know how. I did make sure i was on the latest version of packer v1.5.5.
How do I check the version of the OCI builder?
Right that has always been the problem. But I dont know how to āupgradeā the builder to force it to reach out to there. You found in the code where it should pick up the region of Luke or Langley and point to oraclegovcloud.com, but I itās not going there when I run packer build.
yes, I could reproduce this behaviour now and I had a look into the source code again.
Packer 1.5.5 (and most likely all previous versions as well) was build against the very first version of the OCI Go SDK back in 2018, when only the initial four OCI regions existed after OCI got launched in November 2017. And back then, only āoraclecloud.comā existed.
Sadly, the OCI Go SDK is not pulled in freshly from Github when compiling Packer, but statically included as part of the packer source tree (subdirectory vendor/github.com/oracle(oci-go-sdk).
Since I am not a programmer, I didnāt fix it (I canāt even manage to build packer using the official documentation). Instead, I opened a bug ticket and I really hope someone takes care of it.
Until then, I am afraid you need to build your images in the original us-ashburn-1 region, export them to Object Storage and then import them in the Langley and Luke regions. This can be done manually using the web console or oci-cli, let me know if you need assistance here.
It works on most new commercial regions, because they are deployed within the oraclecloud.com TLD. But thatās plain luck. Government clouds donāt work.
Hello there, I opened #9104 to update the sdk, I donāt have an OCI access here, can you please tell me if that makes it better for you ? Binaries can be found here: artifacts. Thanks !