CiscoDevNet / terraform-provider-dcnm

Cisco DCNM Provider
https://registry.terraform.io/providers/CiscoDevNet/dcnm/latest/docs
Mozilla Public License 2.0
8 stars 16 forks source link

Unable to both create and deploy VRFs with dcnm_vrf #129

Open richwats opened 1 year ago

richwats commented 1 year ago

Community Note

Terraform Version

Terraform v1.6.1-dev on linux_amd64

Your version of Terraform is out of date! The latest version is 1.6.1. You can update by downloading from https://www.terraform.io/downloads.html

NDFC version

Affected Resource(s)

Terraform Configuration Files

See the following repo: https://github.com/cisco-apjc-cloud-se/ndfc-automation-lab-v2/tree/main/terraform

Debug Output

Plan: 0 to add, 2 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

dcnm_vrf.vrf-2: Modifying... [id=TERRAFORM-VRF2]
dcnm_vrf.vrf-1: Modifying... [id=TERRAFORM-VRF1]
β•·
β”‚ Error: VRF record is created but not deployed yet. Error while attachment : SUCCESS Peer attach Response -  SUCCESS
β”‚ 
β”‚   with dcnm_vrf.vrf-1,
β”‚   on 2-vrfs.tf line 2, in resource "dcnm_vrf" "vrf-1":
β”‚    2: resource "dcnm_vrf" "vrf-1" {
β”‚ 
β•΅
β•·
β”‚ Error: VRF record is created but not deployed yet. Error while attachment : SUCCESS Peer attach Response -  SUCCESS
β”‚ 
β”‚   with dcnm_vrf.vrf-2,
β”‚   on 2-vrfs.tf line 114, in resource "dcnm_vrf" "vrf-2":
β”‚  114: resource "dcnm_vrf" "vrf-2" {
β”‚ 
β•΅

Expected Behavior

A dcnm_vrf resource with both attachments blocks (with attachments.attach = true) and deploy = true should both create the VRF, create VRF attachments and deploy the VRFs to the selected switches.

Actual Behavior

When deploy = true is set, the error "Error: VRF record is created but not deployed yet. Error while attachment : SUCCESS Peer attach Response - SUCCESS" is generated. In NDFC, the configuration of both the VRF and VRF attachments is shown as "out-of-sync". No configuration is actually deployed from NDFC.

image

image

Triggering deploy from NDFC will show the pending configuration and will deploy successfully.

image

After manually deploying, running terraform plan or terraform apply show no changes to the infrastructure.

Steps to Reproduce

  1. terraform apply

NOTE: the .2-vrfs.tf file is hidden in the directory and needs to be unhidden (i.e. renamed to remove the . prefix)

Important Factoids

This code was previously working with earlier versions of NDFC (12.0) and Terraform (~1.3?)

richwats commented 1 year ago

Same issue with dcnm_network

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

dcnm_network.vrf2-net1: Creating...
dcnm_network.vrf1-net1: Creating...
dcnm_network.vrf1-net2: Creating...
β•·
β”‚ Error: Network record is created but not deployed yet. Error while attachment : SUCCESS Peer attach Response -  SUCCESS
β”‚ 
β”‚   with dcnm_network.vrf1-net1,
β”‚   on 3-networks.tf line 2, in resource "dcnm_network" "vrf1-net1":
β”‚    2: resource "dcnm_network" "vrf1-net1" {
β”‚ 
β•΅
β•·
β”‚ Error: Network record is created but not deployed yet. Error while attachment : SUCCESS Peer attach Response -  SUCCESS
β”‚ 
β”‚   with dcnm_network.vrf1-net2,
β”‚   on 3-networks.tf line 94, in resource "dcnm_network" "vrf1-net2":
β”‚   94: resource "dcnm_network" "vrf1-net2" {
β”‚ 
β•΅
β•·
β”‚ Error: Network record is created but not deployed yet. Error while attachment : SUCCESS Peer attach Response -  SUCCESS
β”‚ 
β”‚   with dcnm_network.vrf2-net1,
β”‚   on 3-networks.tf line 168, in resource "dcnm_network" "vrf2-net1":
β”‚  168: resource "dcnm_network" "vrf2-net1" {
β”‚ 
β•΅
richwats commented 1 year ago

Also confirmed this code no longer works with Terraform 1.4.5 either

Terraform v1.4.5
on darwin_arm64
+ provider registry.terraform.io/ciscodevnet/dcnm v1.2.7

Your version of Terraform is out of date! The latest version
is 1.6.2. You can update by downloading from https://www.terraform.io/downloads.html
enricobiella commented 1 week ago

Hi, I'm also affected by this bug. Is there any solution for terraform 1.9?