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

aci_fabric_node_member resource do not remove node from inventory (DCNE-152) #1214

Closed
edudppaz opened this issue May 13, 2024 · 2 comments · Fixed by #1266
Closed

aci_fabric_node_member resource do not remove node from inventory (DCNE-152) #1214

edudppaz opened this issue May 13, 2024 · 2 comments · Fixed by #1266
Assignees
Labels
bug jira-sync Sync this issue to Jira

Comments

@edudppaz
Copy link

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

v1.5.6

APIC version and APIC Platform

  • V 6.0(3e) on prem

Affected Resource(s)

  • aci_fabric_node_member

Terraform Configuration Files

resource "aci_fabric_node_member" "fabricNodes" {
  for_each = { for node in try(local.nodes, []) : node.id => node }
  name     = each.value.name
  serial   = each.value.serial_number
  node_id  = each.value.id
  pod_id   = each.value.pod
  role     = each.value.role
}

Debug Output

Panic Output

Expected Behavior

Upon destruction of the resource, the aci node should be removed from the fabric inventory.

Actual Behavior

A terraform apply reports the destruction of the resource, and the resource gets removed from the terraform state. However, the fabric node member is not removed from the fabric inventory.

2024-05-13T09:11:58.3126327Z �[0m�[1mmodule.tf-aci-setup[0].aci_fabric_node_member.fabricNodes["1136"]: Destruction complete after 0s�[0m

Steps to Reproduce

  1. terraform plan
  2. terraform apply

Important Factoids

The proper API call to remove the node from inventory is:
https://<IP>/api/node/mo/uni/fabric/outofsvc.json

With body (example):

{
 "fabricRsDecommissionNode": {
   "attributes": {
     "tDn": "topology/pod-1/node-1136",
     "status": "created,modified",
     "removeFromController": "true"
   }
 }
}

References

  • #0000
@shrsr
Copy link
Collaborator

shrsr commented May 13, 2024

@edudppaz Thank you for opening the issue. Our team will look into this and get back to you.

@bardahlm
Copy link

Just a comment regarding use of aci_fabric_node_member. When one switch needed to be replaced we got into trouble as Terraform wanted to remove the old switch, which did no longer exist. After this we changed to use serial number as key instead of hostname. The next time we had to replace a switch we had no problems, just imported the new switch into state after adding it to the fabric using the gui.

@anvitha-jain anvitha-jain self-assigned this Jul 12, 2024
@samiib samiib added the jira-sync Sync this issue to Jira label Aug 14, 2024
@github-actions github-actions bot changed the title aci_fabric_node_member resource do not remove node from inventory aci_fabric_node_member resource do not remove node from inventory (DCNE-152) Aug 14, 2024
@samiib samiib added the bug label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug jira-sync Sync this issue to Jira
Projects
None yet
5 participants