Closed jgomezve closed 3 months ago
The current provider code waits for the Switch to be in Normal
mode before assigning the user-defined role. Unfortunately in my current setup (NDFC 12.1.2e + HW N9K) the switches goes first Normal
for 10 seconds, Migration
for 2 Minutes and finally back to Normal
. These state changes produce the Go code to change the device role while the device is still in Migration
mode.
According to Engineering this is a exepcted behaviour. Have the current version of the TF provider been tested against the latest NDFC versions (12.x) ?
I am experiencing a similar issue, the previous reply is not correct, this is not a brownfield scenario, it is greenfield, as the preserve_config is false.
Community Note
Terraform Version
V 1.3.8
DCNM version
V 12.1.2e
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
The switches listed in the resources should be added to the Fabric
Actual Behavior
Terraform deploy shows
dcnm_inventory.fabric: Still creating...
Steps to Reproduce
terraform apply
Important Factoids
After setting
TF_LOG=DEBUG
it is clear that an API Call to the URLGET /appcenter/cisco/ndfc/api/v1/lan-fabricrest/control/fabrics/SIMPL-BROWNFIELD/config-preview HTTP/1.1
failed ( 500 Config Preview is already in progress for the fabric SIMPL-BROWNFIELD. Please try Config Preview later). This produces the following cascading events:prepareSwitchesRoutine
finishes without decrementing the WaiterGroup counter https://github.com/CiscoDevNet/terraform-provider-dcnm/blob/d0ff6c3b92fbe1dfbe1e55e4928a56edf2916879/dcnm/resource_dcnm_inventory.go#L1069resourceDCNMInventoryCreate
is stuck waiting for the WaitGroup counter to be 0 https://github.com/CiscoDevNet/terraform-provider-dcnm/blob/d0ff6c3b92fbe1dfbe1e55e4928a56edf2916879/dcnm/resource_dcnm_inventory.go#L352Not sure why this did not happen in a previous version of NDFC/DCNM, since the code tries that call in parallel for all the added devices
I guess a workaround would be to retry the API call if the content message states
Please try config Preview Later
at this line code https://github.com/CiscoDevNet/terraform-provider-dcnm/blob/d0ff6c3b92fbe1dfbe1e55e4928a56edf2916879/dcnm/resource_dcnm_inventory.go#L854