Skip to content

Conversation

@camschaecisco
Copy link
Contributor

IP Multicast Multipath Support

Add Terraform mapping logic to translate schema's multicast multipath configurations into the Terraform provider's iosxe_multicast resource attributes.

Schema Mappings

Global Multicast Configuration:
multicast.multipath → multipath
multicast.multipath_s_g_hash → multipath_s_g_hash

VRF-Specific Multicast Configuration:
multicast.vrfs[].vrf → vrfs[].vrf
multicast.vrfs[].multipath → vrfs[].multipath
multicast.vrfs[].multipath_s_g_hash → vrfs[].multipath_s_g_hash

Changes

Add new multicast resource module iosxe_multicast.tf:

  • multipath (line 5) - Enable/disable multicast multipath globally
  • multipath_s_g_hash (line 6) - S-G hash algorithm selection (basic, next-hop-based)
  • vrfs (lines 8-12) - VRF-specific multicast multipath configuration
    • vrf (line 9) - VRF name
    • multipath (line 10) - Enable/disable multicast multipath in VRF
    • multipath_s_g_hash (line 11) - VRF-specific hash algorithm
  • depends_on (lines 14-16) - VRF dependency management
  • for_each (line 2) - Multi-device deployment support
  • Support for device-specific, default, and null configuration values
  • Three-tier fallback hierarchy: device config → global defaults → null
  • Pre-commit hooks passed: terraform fmt, tflint, terraform-docs

This Enables Declarative Configuration of:

  • IP multicast multipath load balancing across equal-cost paths (ECMP)
  • Per-device multicast multipath policies with global default fallback
  • Two s-g-hash algorithms (basic: source-based, next-hop-based: source+group+nexthop)
  • VRF-aware multicast multipath for multi-tenancy environments
  • Automatic VRF dependency management ensuring proper resource creation order
  • Multi-device deployments from centralized YAML data models
  • Network-wide multicast traffic distribution optimization
  • Consistent multicast forwarding behavior across hybrid campus and data center fabrics
  • GitOps workflows for multicast configuration management

Version Requirements

IOS-XE 17.12.1 and later:

  • multipath - Enable/disable multicast multipath
  • multipath_s_g_hash - S-G hash algorithm (basic, next-hop-based)
  • vrfs - VRF-specific multicast multipath configuration

Platform Notes:

  • Both Cat8k routers and Cat9k switches support all multicast multipath features
  • YANG model validation confirms feature availability from IOS-XE 17.12.1

Example Configuration

Global Multicast Multipath:

iosxe:
  devices:
    - name: Cat8k-Router
      configuration:
        multicast:
          multipath: true
          multipath_s_g_hash: next-hop-based

VRF-Specific Multicast Multipath:
iosxe:
  devices:
    - name: Cat8k-Router
      configuration:
        multicast:
          multipath: true
          multipath_s_g_hash: basic
          vrfs:
            - vrf: VRF1
              multipath: true
              multipath_s_g_hash: next-hop-based
            - vrf: VRF2
              multipath: true
              multipath_s_g_hash: basic

Global Defaults:
iosxe:
  defaults:
    configuration:
      multicast:
        multipath: true
        multipath_s_g_hash: basic

Testing

Multi-Platform Validation
- Catalyst 8000V (Router, IOS-XE 17.15): ✅ Global and VRF multicast multipath deployed successfully
- Catalyst 9200L (Switch, IOS-XE 17.15): ✅ Global and VRF multicast multipath deployed successfully

Terraform Operations Verified
- ✅ terraform plan - Correctly identifies multicast configuration changes
- ✅ terraform apply - Successfully creates multicast multipath configuration
- ✅ terraform destroy - Cleanly removes multicast configuration
- ✅ Device verification - All multicast multipath settings present in running-config
- ✅ State management - Proper resource state tracking across lifecycle

Pre-commit Quality Checks
Terraform fmt............................................................Passed
Terraform validate with tflint...........................................Passed
terraform-docs...........................................................Passed
terraform-docs...........................................................Passed
terraform-docs...........................................................Passed
terraform-docs...........................................................Passed

Add Terraform module support for IP multicast multipath configuration,
enabling automated deployment of multicast load balancing across
multiple devices with device-specific and global defaults.

Changes:
- iosxe_multicast.tf: Create new multicast resource module
  - Multi-device support with for_each pattern
  - Configuration hierarchy: device-specific → global defaults → null
  - Global multicast multipath configuration support
  - VRF-specific multicast settings with nested for loop
  - Dependency on iosxe_vrf.vrf resource

- README.md: Auto-generated documentation via terraform-docs
  - Added multicast resource to resources table
  - Alphabetically ordered between MSDP and NAT

Module Features:
- Supports multipath boolean flag
- Supports s-g-hash algorithm selection (basic, next-hop-based)
- Supports VRF-specific multipath configurations
- Follows try() hierarchy pattern for configuration fallback
- Handles empty VRF lists gracefully

This completes Phase 2 (Terraform Module Development) for the multicast
multipath feature.

Related implementations:
- Provider: terraform-provider-iosxe/iosxe_multicast
- Schema: nac-iosxe/schemas/schema.yaml (multicast section)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@camschaecisco camschaecisco marked this pull request as draft November 20, 2025 21:36
@camschaecisco camschaecisco marked this pull request as ready for review November 22, 2025 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants