Skip to content

Commit

Permalink
Release v3.6.0 (#42)
Browse files Browse the repository at this point in the history
# New Features

- **All Inventory Resource**: Added `tags` argument.  
- **Server Resource**: Added `role` argument.  
- **Link Resource**: Added `underlay` argument.  
- **Inventory Profile Resource**: Added `optimisebgpoverlayhypervisor` option.  
- **VNet Resource**: Added `interfacetag` block.
  • Loading branch information
pogossian authored Dec 19, 2024
1 parent 9e21ece commit b329417
Show file tree
Hide file tree
Showing 23 changed files with 257 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ HOSTNAME=registry.terraform.io
NAMESPACE=netrisai
NAME=netris
BINARY=terraform-provider-${NAME}
VERSION=3.5.4
VERSION=3.6.0
OS_ARCH=darwin_arm64
WORKDIRECTORY=examples

Expand Down
1 change: 1 addition & 0 deletions docs/resources/inventory_profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Optional:
Optional:

- **optimisebgpoverlay** (Boolean) Optimize BGP Overlay for leaf-spine topology. When checked, overlay BGP updates will be optimized for large scale. Each leaf switch (based on name) will form its overlay BGP sessions only with two spine switches (with the lowest IDs). Otherwise, Overlay BGP sessions will be configured on p2p links alongside underlay. Default value is `false`.
- **optimisebgpoverlayhypervisor** (Boolean) Required for BGP/EVPN VXLAN integration with compute hypervisor networking. This optimization makes sure that a large number of hypervisor virtual networking EVPN prefixes do not overflow switch TCAM. Default value is `false`.
- **unnumberedbgpunderlay** (Boolean) When checked, BGP underlay sessions will be configured using p2p IPv4 addresses configured on link objects in the Netris controller. Otherwise, BGP unnumbered method is used and p2p ipv6 link-local addresses are used for BGP sessions. Default value is `false`.
- **automaticlinkaggregation** (Boolean) Automatically configure non-backbone switch ports under a single legged link aggregation (agg) interface. This allows for active/standby multihoming if LACP is enabled on the server side. Active/Active multihoming with EVPN-MH will be automatically configured on Nvidia Spectrum-2 and higher switch models. Default value is `false`.
- **mclag** (Boolean) Enabling MC-LAG functionality will disable any EVPN-MH functionality. Two multihoming methods are not supported simultaneously on the same switches. Default value is `false`.
Expand Down
2 changes: 2 additions & 0 deletions docs/resources/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ resource "netris_link" "sg_to_sw" {

- **mclag** (Block List) Block of MC-LAG. When specified, the link is marked for MC-LAG peer link. Multiple MC-LAG peer links between the same pair of switches must have the same MC-LAG IPv4 and MAC addresses. (see [below for nested schema](#nestedblock--mclag))

- **underlay** (String) Inform the system that the current link should use EVPN/BGP underlay for VXLAN transport. Valid values are `enabled` or `disabled`. The default value is `enabled`.

<a id="nestedblock--mclag"></a>
### Nested Schema for `mclag`

Expand Down
4 changes: 3 additions & 1 deletion docs/resources/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ resource "netris_server" "my-server-2" {
portcount = 3
asnumber = "auto"
customdata = "sh -c 'echo $(date) | sudo tee -a /root/runcmd.log'"
# tags = ["foo", "bar"]
}
```
Expand All @@ -69,4 +70,5 @@ resource "netris_server" "my-server-2" {
- **description** (String) Server description.
- **asnumber** (String) Server AS numbers. Valid value is ASN (example `420000002`) or `auto`.
- **customdata** (String) You may paste any custom data that can be assosiated with the object.

- **tags** (List of String) List of tags. Example `["foo", "bar"]`
- **role** (String) Server's role. Valid values are `generic` or `hyperv_cs`. The default value is `generic`.
2 changes: 2 additions & 0 deletions docs/resources/softgate.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ resource "netris_softgate" "my-softgate" {
profileid = data.netris_inventory_profile.my-profile.id
mainip = "auto"
mgmtip = "192.0.2.11"
# tags = ["foo", "bar"]
# flavor = "sg-hs"
# role = "snat"
depends_on = [
Expand Down Expand Up @@ -68,3 +69,4 @@ resource "netris_softgate" "my-softgate" {
- **profileid** (Number) An inventory profile ID to define global configuration (NTP, DNS, timezone, etc...)
- **flavor** (String) Softgate's flavor. Valid values are `sg`, `sg-pro` or `sg-hs`. The default value is `sg`.
- **role** (String) Softgate's role. Only when flavor == `sg-hs` Valid values are `general` or `snat`. The default value is `general`.
- **tags** (List of String) List of tags. Example `["foo", "bar"]`
5 changes: 3 additions & 2 deletions docs/resources/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ resource "netris_switch" "my-switch" {
mainip = "auto"
mgmtip = "auto"
portcount = 16
# tags = ["foo", "bar"]
depends_on = [
netris_subnet.my-subnet-mgmt,
netris_subnet.my-subnet-loopback,
Expand All @@ -53,7 +54,7 @@ resource "netris_switch" "my-switch" {
- **mainip** (String) A unique IP address which will be used as a loopback address of this unit. Valid value is ip address (example `198.51.100.21`) or `auto`. If set `auto` the controller will assign an ip address automatically from subnets with relevant purpose.
- **mgmtip** (String) A unique IP address to be used on out of band management interface. Valid value is ip address (example `192.0.2.21`) or `auto`. If set `auto` the controller will assign an ip address automatically from subnets with relevant purpose.
- **name** (String) User assigned name of switch.
- **nos** (String) Switch OS. Possible values: `cumulus_linux`, `cumulus_nvue`, `sonic`, `ubuntu_switch_dev`
- **nos** (String) Switch OS. Possible values: `arista_eos`, `cumulus_nvue`, `dell_sonic`, `ec_sonic`
- **portcount** (Number) Preliminary port count is used for definition of topology. Possible values: `16`, `32`, `48`, `54`, `56`, `64`
- **siteid** (Number) The site ID where this switch belongs.
- **tenantid** (Number) ID of tenant. Users of this tenant will be permitted to edit this unit.
Expand All @@ -63,4 +64,4 @@ resource "netris_switch" "my-switch" {
- **description** (String) Switch description.
- **profileid** (Number) An inventory profile ID to define global configuration (NTP, DNS, timezone, etc...)
- **breakout** (String) Initial Break Out applies to all switch ports of this switch. Possible values: `off`, `disabled`, `4x10`, `4x25`, `2x50`, `4x50`, `2x100`, `4x100`, `2x200`, `4x200`, `2x400`

- **tags** (List of String) List of tags. Example `["foo", "bar"]`
14 changes: 14 additions & 0 deletions docs/resources/vnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ resource "netris_vnet" "my-vnet" {
interface {
id = netris_lag.lag1-switch-01.id
}
interfacetag {
tag = "foo"
accessmode = true
}
}
depends_on = [
netris_switch.my-sw01,
Expand Down Expand Up @@ -86,6 +90,7 @@ Optional:

- **gateways** (Block List) Block of gateways (see [below for nested schema](#nestedblock--sites--gateways))
- **interface** (Block List) Block for network interface (see [below for nested schema](#nestedblock--sites--interface))
- **interfacetag** (Block List) Block for Network Interface Tags. Network Interface Tags help referencing one or more network interface objects to one or more V-Net objects. Network interfaces with matching tags will appear in a given V-Net. (see [below for nested schema](#nestedblock--sites--interfacetag))

<a id="nestedblock--sites--gateways"></a>
### Nested Schema for `sites.gateways`
Expand All @@ -112,3 +117,12 @@ Optional:
- **name** (String) Network interface name. Example: `swp5@my-sw01`. Can't be used together `id`.
- **vlanid** (String) VLAN tag for the current interface. Cannot be used together with global `vlanid`. If the main `vlanid` is also not set - means untagged. (Only for Netris Switch Fabric)
- **untagged** (String) This option is applicable only when a global `vlanid` is set. In such cases, the default value is `yes`. The valid value is `yes` or `no`. (Applicable exclusively to Netris Switch Fabric)


<a id="nestedblock--sites--interfacetag"></a>
### Nested Schema for `sites.interfacetag`

Optional:

- **tag** (String) Any tag. Example `"foo"`.
- **accessmode** (Boolean) The default value is `false`. Valid value are `false` or `true`. When enabled the frames will be sent toward ports without a VLAN tag.
1 change: 1 addition & 0 deletions examples/inventory_profile_example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ resource "netris_inventory_profile" "my-profile" {
}
fabricsettings {
# optimisebgpoverlay = true
# optimisebgpoverlayhypervisor = true
# unnumberedbgpunderlay = false
# automaticlinkaggregation = false
mclag = true
Expand Down
1 change: 1 addition & 0 deletions examples/link_example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ resource "netris_link" "sw1_to_sw2" {
"swp15@my-switch01",
"swp15@my-switch02"
]
underlay = "disabled"
depends_on = [netris_switch.my-switch01, netris_switch.my-switch02]
}

Expand Down
4 changes: 4 additions & 0 deletions examples/server_example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ resource "netris_server" "my-server01" {
portcount = 2
# asnumber = "auto"
# customdata = "custom data"
# tags = ["foo", "bar"]
# role = "generic"
depends_on = [netris_subnet.my-subnet-mgmt, netris_subnet.my-subnet-loopback]
}

Expand All @@ -21,5 +23,7 @@ resource "netris_server" "my-server02" {
portcount = 2
# asnumber = "auto"
# customdata = "custom data"
tags = ["foo", "bar"]
role = "hyperv_cs"
depends_on = [netris_subnet.my-subnet-mgmt, netris_subnet.my-subnet-loopback]
}
2 changes: 1 addition & 1 deletion examples/servercluster_example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ resource "netris_servercluster" "my-servercluster1" {
tags = ["boo", "foo"]
servers = [
netris_server.my-server01.id,
# netris_server.my-server02.id,
netris_server.my-server02.id,
]
}
2 changes: 2 additions & 0 deletions examples/softgate_example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ resource "netris_softgate" "my-softgate02" {
profileid = netris_inventory_profile.my-profile.id
mainip = "auto"
mgmtip = "auto"
# tags = ["foo", "bar"]
depends_on = [
netris_subnet.my-subnet-mgmt,
netris_subnet.my-subnet-loopback,
Expand All @@ -39,6 +40,7 @@ resource "netris_softgate" "my-softgate03" {
mainip = "auto"
mgmtip = "auto"
flavor = "sg-hs"
tags = ["foo", "bar"]
# role = "snat"
depends_on = [
netris_subnet.my-subnet-mgmt,
Expand Down
5 changes: 3 additions & 2 deletions examples/switch_example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ resource "netris_switch" "my-switch01" {
tenantid = data.netris_tenant.admin.id
siteid = netris_site.santa-clara.id
description = "Switch 01"
nos = "cumulus_linux"
nos = "cumulus_nvue"
asnumber = "auto"
profileid = netris_inventory_profile.my-profile.id
mainip = "auto"
mgmtip = "auto"
portcount = 16
tags = ["foo", "bar"]
depends_on = [
netris_subnet.my-subnet-mgmt,
netris_subnet.my-subnet-loopback,
Expand All @@ -20,7 +21,7 @@ resource "netris_switch" "my-switch02" {
tenantid = data.netris_tenant.admin.id
siteid = netris_site.santa-clara.id
description = "Switch 02"
nos = "ubuntu_switch_dev"
nos = "dell_sonic"
asnumber = "auto"
profileid = netris_inventory_profile.my-profile.id
mainip = "auto"
Expand Down
2 changes: 1 addition & 1 deletion examples/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
netris = {
source = "netrisai/netris"
version = ">= 2.1.0"
version = ">= 3.6.0"
}
}
required_version = ">= 0.13"
Expand Down
14 changes: 11 additions & 3 deletions examples/vnet_example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resource "netris_vnet" "my-vnet" {
tenantid = data.netris_tenant.admin.id
state = "active"
# tags = ["foo", "bar"]
vlanid = "auto"
sites {
id = netris_site.santa-clara.id
gateways {
Expand All @@ -13,15 +14,22 @@ resource "netris_vnet" "my-vnet" {
prefix = "2001:db8:acad::fffe/64"
}
interface {
name = "swp8@my-switch01"
vlanid = 1050
name = "swp8@my-switch01"
}
interface {
name = "swp8@my-switch02"
}
interface {
id = netris_lag.lag2-mc.id
}
interfacetag {
tag = "foo"
accessmode = true
}
interfacetag {
tag = "bar"
# accessmode = true
}
}
depends_on = [
netris_switch.my-switch01,
Expand All @@ -36,7 +44,7 @@ resource "netris_vnet" "my-vnet-in-my-vpc" {
tenantid = data.netris_tenant.admin.id
state = "active"
# tags = ["foo", "bar"]
vpcid = netris_vpc.my-vpc.id
vpcid = netris_vpc.my-vpc.id
vxlanid = 456
sites {
id = netris_site.santa-clara.id
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.20

require (
github.com/hashicorp/terraform-plugin-sdk v1.17.2
github.com/netrisai/netriswebapi v0.0.0-20241024153234-15244ba023d1
github.com/netrisai/netriswebapi v0.0.0-20241219035551-963815f78a95

)

Expand Down
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,16 @@ github.com/netrisai/netriswebapi v0.0.0-20240913184109-c0bcbba3f0e7 h1:9NX6gU384
github.com/netrisai/netriswebapi v0.0.0-20240913184109-c0bcbba3f0e7/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20241024153234-15244ba023d1 h1:U0AqqJ7je8rQ/Oryhw+j9ieTI9RgHURYjwOe7D6Wgmc=
github.com/netrisai/netriswebapi v0.0.0-20241024153234-15244ba023d1/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20241219003006-1ec77da034ee h1:BJgdy6briEQanTedPq6rFT/QZfUdpSzymRQAPxT5oIs=
github.com/netrisai/netriswebapi v0.0.0-20241219003006-1ec77da034ee/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20241219011623-949eb58d0719 h1:jyv2YCfkVUlxYWJtnuZXxafHki4teA8vVenaQ2t72qA=
github.com/netrisai/netriswebapi v0.0.0-20241219011623-949eb58d0719/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20241219013601-51c3769e9e3c h1:Kt0GuvHRV+19+bsrvoeMel8K3giuOzSYmcUjXQL9Dnc=
github.com/netrisai/netriswebapi v0.0.0-20241219013601-51c3769e9e3c/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20241219014037-82fecf2b045b h1:TqR/pQZXrIzChD+H6pbwp2ZsdG2vP/Xxe+BNh1Sc3Kw=
github.com/netrisai/netriswebapi v0.0.0-20241219014037-82fecf2b045b/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/netrisai/netriswebapi v0.0.0-20241219035551-963815f78a95 h1:A2xvtWdK6tjgfEhXEsstcDFFrCtwg/69QvV62tCeAz4=
github.com/netrisai/netriswebapi v0.0.0-20241219035551-963815f78a95/go.mod h1:GLLz33Jc07/hIPwEYZDWEtNtHjX/QZjVzf9xLnfSiqs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
Expand Down
24 changes: 16 additions & 8 deletions netris/inventoryprofile/inventoryprofile.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ func Resource() *schema.Resource {
Optional: true,
Description: "Optimize BGP Overlay for leaf-spine topology. When checked, overlay BGP updates will be optimized for large scale. Each leaf switch (based on name) will form its overlay BGP sessions only with two spine switches (with the lowest IDs). Otherwise, Overlay BGP sessions will be configured on p2p links alongside underlay.",
},
"optimisebgpoverlayhypervisor": {
Type: schema.TypeBool,
Optional: true,
Description: "Required for BGP/EVPN VXLAN integration with compute hypervisor networking. This optimization makes sure that a large number of hypervisor virtual networking EVPN prefixes do not overflow switch TCAM.",
},
"unnumberedbgpunderlay": {
Type: schema.TypeBool,
Optional: true,
Expand Down Expand Up @@ -274,10 +279,11 @@ func resourceCreate(d *schema.ResourceData, m interface{}) error {
}

fabricsettings := inventoryprofile.FabricProps{
OptimiseBgpOverlay: getBool("optimisebgpoverlay", fabricsettingstmp, false),
UnnumberedBgpUnderlay: getBool("unnumberedbgpunderlay", fabricsettingstmp, false),
AutomaticLinkAggregation: getBool("automaticlinkaggregation", fabricsettingstmp, false),
MCLag: getBool("mclag", fabricsettingstmp, false),
OptimiseBgpOverlay: getBool("optimisebgpoverlay", fabricsettingstmp, false),
OptimiseBgpOverlayHypervisor: getBool("optimisebgpoverlayhypervisor", fabricsettingstmp, false),
UnnumberedBgpUnderlay: getBool("unnumberedbgpunderlay", fabricsettingstmp, false),
AutomaticLinkAggregation: getBool("automaticlinkaggregation", fabricsettingstmp, false),
MCLag: getBool("mclag", fabricsettingstmp, false),
}

gpuclustersettingsList := d.Get("gpuclustersettings").(*schema.Set).List()
Expand Down Expand Up @@ -408,6 +414,7 @@ func resourceRead(d *schema.ResourceData, m interface{}) error {
var fabricsettingsList []map[string]interface{}
fabricsettings := make(map[string]interface{})
fabricsettings["optimisebgpoverlay"] = profile.FabricProps.OptimiseBgpOverlay
fabricsettings["optimisebgpoverlayhypervisor"] = profile.FabricProps.OptimiseBgpOverlayHypervisor
fabricsettings["unnumberedbgpunderlay"] = profile.FabricProps.UnnumberedBgpUnderlay
fabricsettings["automaticlinkaggregation"] = profile.FabricProps.AutomaticLinkAggregation
fabricsettings["mclag"] = profile.FabricProps.MCLag
Expand Down Expand Up @@ -511,10 +518,11 @@ func resourceUpdate(d *schema.ResourceData, m interface{}) error {
}

fabricsettings := inventoryprofile.FabricProps{
OptimiseBgpOverlay: getBool("optimisebgpoverlay", fabricsettingstmp, false),
UnnumberedBgpUnderlay: getBool("unnumberedbgpunderlay", fabricsettingstmp, false),
AutomaticLinkAggregation: getBool("automaticlinkaggregation", fabricsettingstmp, false),
MCLag: getBool("mclag", fabricsettingstmp, false),
OptimiseBgpOverlay: getBool("optimisebgpoverlay", fabricsettingstmp, false),
OptimiseBgpOverlayHypervisor: getBool("optimisebgpoverlayhypervisor", fabricsettingstmp, false),
UnnumberedBgpUnderlay: getBool("unnumberedbgpunderlay", fabricsettingstmp, false),
AutomaticLinkAggregation: getBool("automaticlinkaggregation", fabricsettingstmp, false),
MCLag: getBool("mclag", fabricsettingstmp, false),
}

gpuclustersettingsList := d.Get("gpuclustersettings").(*schema.Set).List()
Expand Down
25 changes: 23 additions & 2 deletions netris/link/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ func Resource() *schema.Resource {
},
Description: "List of two IPv6 addresses",
},
"underlay": {
ForceNew: true,
Optional: true,
Default: "enabled",
Type: schema.TypeString,
ValidateFunc: validateUnderlay,
Description: "Inform the system that the current link should use EVPN/BGP underlay for VXLAN transport.",
},
"mclag": {
ForceNew: true,
Optional: true,
Expand Down Expand Up @@ -131,8 +139,9 @@ func resourceCreate(d *schema.ResourceData, m interface{}) error {
mcLagList := d.Get("mclag").(*schema.Set).List()

linkAdd := &link.Linkw{
Local: link.LinkIDName{Name: local, Ipv4: localIpv4, Ipv6: localIpv6},
Remote: link.LinkIDName{Name: remote, Ipv4: remoteIpv4, Ipv6: remoteIpv6},
Local: link.LinkIDName{Name: local, Ipv4: localIpv4, Ipv6: localIpv6},
Remote: link.LinkIDName{Name: remote, Ipv4: remoteIpv4, Ipv6: remoteIpv6},
Underlay: d.Get("underlay").(string),
}

if len(mcLagList) > 0 {
Expand Down Expand Up @@ -220,6 +229,10 @@ func resourceRead(d *schema.ResourceData, m interface{}) error {
if err != nil {
return err
}
err = d.Set("underlay", nlink.Underlay)
if err != nil {
return err
}
if nlink.MCLagPeerLink != nil {
mclink := []map[string]interface{}{}
mcLag := make(map[string]interface{})
Expand Down Expand Up @@ -308,3 +321,11 @@ func validateMAC(val interface{}, key string) (warns []string, errs []error) {
}
return warns, errs
}

func validateUnderlay(val interface{}, key string) (warns []string, errs []error) {
v := val.(string)
if !(v == "enabled" || v == "disabled") {
errs = append(errs, fmt.Errorf("'%s' must be 'enabled' or 'disabled', got: %s", key, v))
}
return warns, errs
}
Loading

0 comments on commit b329417

Please sign in to comment.