You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to apply with assign_public_ip=true and instance_count=2, the errors are thrown
(edit: same error with instance_count=1 actually)
Error: work request did not succeed, workId: ocid1.coreservicesworkrequest.oc1.eu-frankfurt-1.abtheljtvz65owfd5dbokd5zqsgq63ur4nj72nklwhvt2eexuvp3j345qhxq, entity: instance, action: CREATED. Message: A problem occurred while preparing the instance's VNIC. (Parameter 'availabilityDomain' does not match. VNIC has 'eu-frankfurt-1-ad-3' while the subnet has 'eu-frankfurt-1-ad-1')
on ..\..\main.tf line 58, in resource "oci_core_instance" "this":
58: resource "oci_core_instance" "this" {
Error: work request did not succeed, workId: ocid1.coreservicesworkrequest.oc1.eu-frankfurt-1.abtheljtcnunlsdl3iwdu7sfv3kpz23z5nmvwk7u32vussh2bznma3q7ov4a, entity: instance, action: CREATED. Message: A problem occurred while preparing the instance's VNIC. (Parameter 'availabilityDomain' does not match. VNIC has 'eu-frankfurt-1-ad-3' while the subnet has 'eu-frankfurt-1-ad-1')
on ..\..\main.tf line 58, in resource "oci_core_instance" "this":
58: resource "oci_core_instance" "this" {
It seems the issue is related to PR #46
Additional tests required to identify the exact conditions to reproduce the problem.
My current tests successfully provision instances with count 1 to 6 all with public IPs, on regional subnets.
Probably additional checks needed with ad-specific subnets.
With the current instance_count implementation, the recommentations are the following:
use regional subnets whenever it is possible
when using ad-specific subnets and var.instance_count together, try to always declare as many subnets as the region have Availability Domains. In this situation, instances will always get affected a valid subnet ocid related to the ad they are affected.
If you cannot provision one ad-specific subnet per ad region, you cannot provision instances count greater than the number of ad specific subnets in the same module.
Long term plan
Plan is to probably deprecate var.instance_count in a future release or go through a major refactoring.
There is better ways to handle multiple instances creation at once today than it was possible two years ago, using either Terraform new capabilities or OCI API new capabilities.
Some options:
implementing for_each inside the module on oci_core_instance
using oci_core_instance_configuration and oci_core_instance_pool as they now support attaching and detaching instances
Let me know if if works for you.
kral2
changed the title
Instance creation fails with using count and assing_public_ip
Instance creation fails when using count and ad-specific subnets
Mar 18, 2021
It seems the issue is related to PR #46
Additional tests required to identify the exact conditions to reproduce the problem.
My current tests successfully provision instances with count 1 to 6 all with public IPs, on regional subnets.
Probably additional checks needed with ad-specific subnets.
Originally posted by @kral2 in #49 (comment)
The text was updated successfully, but these errors were encountered: