Skip to content

The dcnm_inventory resource does not support Brownfield Fabrics #122

@jgomezve

Description

@jgomezve

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

  • V 1.3.8

DCNM version

  • V 12.1.2e

Affected Resource(s)

  • dcnm_inventory

Terraform Configuration Files

resource "dcnm_inventory" "fabric" {
  fabric_name   = "SIMPL-BROWNFIELD"
  username      = "admin"
  password      = "cisco.123"
  max_hops      = 0
  preserve_config = "true"
  auth_protocol = 0
  config_timeout = 15
  switch_config {
    ip   = "1.2.3.4"
    role = "leaf"
  }
}

Expected Behavior

Switches should be added to the fabric with the field Mode set to "Migration"

Actual Behavior

Switches should baree added to the fabric with the field Mode set to "Normal"

Steps to Reproduce

  1. terraform apply

Important Factoids

The terraform resource exposes the preserve_config flag, which is meant for brownfield migrations but the Go code sends an incorrect payload to the NDFC API. Here an example

{
    "cdpSecondTimeout": 0,
    "maxHops": 0,
    "password": "cisco.123",
    "preserveConfig": "true",
    "seedIP": "1.2.3.4",
    "snmpV3AuthProtocol": 0,
    "switches": [
        {
            "auth": "true",
            "deviceIndex": "LF101(FDO2139044J)",
            "hopCount": 0,
            "ipaddr": "1.2.3.4",
            "known": "false",
            "lastChange": "null",
            "platform": "N9K-C93180YC-EX",
            "reachable": "true",
            "selectable": "true",
            "statusReason": "manageable",
            "sysName": "LF101",
            "valid": "true",
            "version": "9.3(2)"
        }
    ],
    "username": "admin"
}

The field preserveConfig must be a true boolean. The field serialNumber is missing inside the switches. Without those two conditions the switch is added to the fabric with mode "Normal"

Furthermore, the Go code seems "not to like" the mode "Migration"

if models.G(cont, "mode") != "Migration" {
. Was this provider developed to not support Brownfield migration?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions