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

Please add support hsrp for SVI interfaces #174

Open
hani010 opened this issue Sep 7, 2023 · 2 comments
Open

Please add support hsrp for SVI interfaces #174

hani010 opened this issue Sep 7, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@hani010
Copy link

hani010 commented Sep 7, 2023

Hi,
it is possible to add hsrp to provider "nxos_svi_interface" ?
We need this SVI interface configuration:

interface Vlan3812
  no shutdown
  vrf member ccsew
  no ip redirects
  ip address 172.25.51.234/29
  no ipv6 redirects
  hsrp bfd
  hsrp version 2
  hsrp 3812 
    preempt delay minimum 60 
    priority 200
    ip 172.25.51.233
@danischm danischm added the enhancement New feature or request label Sep 10, 2023
@jgomezve
Copy link
Collaborator

jgomezve commented Feb 13, 2024

Hi @hani010

As of now, the provider has a 1:1 mapping between TF resources and objects in the DME Data Model. Therefore it won't be possible to configure HSRP using the nxos_svi_interface because the HSRP configuration requires the creation of multiple additional objects.

I can create dedicated TF resources for the HSRP configuration but I wanted to let you know that you could use the nxos_rest resource to configure those objects that are not covered by the provider. In fact, you could configure everything on the NXOS switch just using the nxos_rest resource. Here an example of the HSRP configuration:

resource "nxos_feature_hsrp" "hsrp" {
  admin_state = "enabled"
}


resource "nxos_rest" "hsrpEntity" {
  dn         = "sys/hsrp"
  class_name = "hsrpEntity"
  content = {
    adminSt = "enabled"
  }
  depends_on = [nxos_feature_hsrp.hsrp]
}

resource "nxos_rest" "hsrpInst" {
  dn         = "${nxos_rest.hsrpEntity.dn}/inst"
  class_name = "hsrpInst"
  content = {
    adminSt = "enabled"
  }
}

resource "nxos_rest" "hsrpIf" {
  dn         = "${nxos_rest.hsrpInst.dn}/if-[vlan3812]"
  class_name = "hsrpIf"
  content = {
    bfd     = "enabled"
    id      = "vlan3812"
    version = "v2"
  }
}

resource "nxos_rest" "hsrpGroup" {
  dn         = "${nxos_rest.hsrpIf.dn}/grp-[3812]-[ipv4]"
  class_name = "hsrpGroup"
  content = {
    af              = "ipv4"
    ctrl            = "preempt"
    fwdLwrThrld     = 0
    fwdUprThrld     = 200
    id              = 3812
    ip              = "172.25.51.233"
    ipObtainMode    = "admin"
    preemptDelayMin = 60
    prio            = 200
  }
}

You can figure out the required objects using the NX-API Sandbox. Information about the dn can be found in the DME Documentation

@hani010
Copy link
Author

hani010 commented Feb 13, 2024

Hi Jorge,
thank you very much for the information and the solution via Rest Resource.
I will try it out in my lab. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants