CiscoDevNet / terraform-provider-aci

Terraform Cisco ACI provider
https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs
Mozilla Public License 2.0
87 stars 100 forks source link

Enhanced LAG Policy for aci_epg_to_domain #543

Closed thjonson closed 2 years ago

thjonson commented 3 years ago

Community Note

Description

When associating a VMM domain to an EPG it doesn't look like there is a way to add an Enhanced Lag Policy

New or Affected Resource(s) + ACI Class(es):

fv:fvAEPgLagPolAtt

APIC version and APIC Platform

Enhanced LACP Policy was added in 3.2(7) on-prem

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References

nipil commented 3 years ago

I highly hope there will be progress on this enhancement

I tried using the "lag_policy_name" of "aci_epg_to_domain" but it does not seem to do the trick.

Just for information, we just started working on using terraform to setup our ACI workflow. We are using enhanced lag policy on all our ESXi. And so far, i have been setting it up manually in APIC, or using raw XML snippets. It works but it's a pain.

Now when using Terraform, i am kind of blocked, because i have to redo the "push EPG to VMM" operation manually, in order to select the enhanced lag policy of the VMM domain, so that the VM networking actually works.

Please add this "Enhanced Lag Policy" option to the api Thanks in advance

FrederikSuijs commented 2 years ago

As @nipil mentioned, using the API inspector or any other inspect tool, when using the gui, you can actually see multiple objects are created when creating the relation of a VMM domain bound to an EPG and the Enhanced Lag Policy. fvAEPgLagPolAtt + fvRsVmmVSwitchEnhancedLagPol

Currently we solve this by using aci_rest objects to create those.

resource "aci_application_epg" "epg" {
  for_each               = var.epg
  name                   = each.value.name
  application_profile_dn = aci_application_profile.ap.id
}

resource "aci_epg_to_domain" "domain_assignment" {
  for_each           = var.epg
  application_epg_dn = aci_application_epg.epg[each.key].id
  tdn                = aci_vmm_domain.fwaas_vmm_domain.id
}

resource "aci_rest" "rest_fvAEPgLagPolAtt" {
  for_each   = var.epg
  path       = "/api/mo/${aci_epg_to_domain.domain_assignment[each.key].id}/epglagpolatt.json"
  class_name = "fvAEPgLagPolAtt"
  content = {
    "annotation" : "orchestrator:terraform"
  }
}

resource "aci_rest" "rest_VmmVSwitchEnhancedLagPol" {
  for_each   = var.epg
  path       = "/api/mo/${aci_rest.rest_fvAEPgLagPolAtt[each.key].id}/rsvmmVSwitchEnhancedLagPol.json"
  class_name = "fvRsVmmVSwitchEnhancedLagPol"
  content = {
    "annotation" : "orchestrator:terraform",
    "tDn" : aci_rest.rest_lacpEnanced.id
  }
}

I'm unsure what the lag_policy_name field is actually used for. When checking the object store browser, I see that field is actually empty. Even after binding an enhanced lag policy.