Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The dcnm_inventory resource does not support Brownfield Fabrics #122

Open
jgomezve opened this issue Feb 10, 2023 · 0 comments
Open

The dcnm_inventory resource does not support Brownfield Fabrics #122

jgomezve opened this issue Feb 10, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@jgomezve
Copy link

jgomezve commented Feb 10, 2023

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?

@dsx1123 dsx1123 added the bug Something isn't working label Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants