CiscoDevNet / terraform-provider-dcnm

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

adding a new inventory to an empty fabric #71

Closed YazhRajesh closed 2 years ago

YazhRajesh commented 2 years ago

Hi,

I was trying to add new switches to an empty fabric The configuration I'm trying to push is as below:

terraform {
  required_providers {
    dcnm = {
      source = "CiscoDevNet/dcnm"
    }
  }
}

provider "dcnm" {
  # Cisco DCNM/NDFC user name
  username = var.user.username
  # Cisco DCNM/NDFC password
  password = var.user.password
  # Cisco DCNM/NDFC url
  url      = var.user.url
  insecure = true
  # Used to select DCNM or NDFC for authentication purposes
  platform = "nd"
}

resource "dcnm_inventory" "add_new_switch" {
  fabric_name     = "fabric3"
  username        = "admin"
  password        = "ins3965!"
  preserve_config = "false"
  max_hops = 0
  config_timeout  = 30      
  switch_config {
    ip   = "172.31.217.102"
    role = "leaf"
  }
  switch_config {
    ip   = "172.31.217.122"
    role = "leaf"
  }
  switch_config {
    ip   = "172.31.219.123"
    role = "leaf"
  }
  switch_config {
    ip   = "172.31.217.9"
    role = "leaf"
  }
  switch_config {
    ip   = "172.31.186.154"
    role = "spine"
  }
  switch_config {
    ip   = "172.31.186.153"
    role = "spine"
  }

}

It doesn't detect all the switches mentioned in the module. Adds only 3-4 switches from above.

Screen Shot 2022-03-22 at 2 45 14 PM

But the terraform output shows the following:

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Can you please have a look at this?

YazhRajesh commented 2 years ago

Hi,

Checked both on NDFC and DCNM:

On DCNM: All switches are still not getting added properly. Out of 7, only 4 got added. Also they remain in unavailable state Overall time to add switches: 22 minutes

image

On NDFC: All switches are getting added but not getting added properly. Remains in Unreachable state. Overall time to add switches: 10 to 20 mins

Connecting to the switch: I can directly connect to the switch through SSH after adding on both ndfc and dcnm and it is working normally.

YazhRajesh commented 2 years ago

This is also working now. Please merge this change.