Skip to content

Instantly share code, notes, and snippets.

@adarobin
Created February 13, 2020 21:20
Show Gist options
  • Save adarobin/075f64ef60ba421ddf28bcdd4dfb7d26 to your computer and use it in GitHub Desktop.
Save adarobin/075f64ef60ba421ddf28bcdd4dfb7d26 to your computer and use it in GitHub Desktop.
variable "native_network_uri" {
type = "string"
description = "The native network of the uplink ports"
default = ""
}
variable "network_uris" {
type = "list"
description = "The networks trunked to the uplink ports"
default = []
}
variable "uplink_port_nums" {
type = "list"
description = "The port numbers of the uplinks on the Logical Interconnect"
}
variable "lig_name_prefix" {
type = "string"
description = "A prefix to the name of the Logical Interconnect Group"
}
variable "logical_interconnect_type" {
type = "string"
description = "The model of Interconnect to be configured"
}
variable "fabric_side_map" {
type = "map"
description = "The A and B side of the LIG pair mapped to interconnect bays on the chassis"
default = {
A = 1
B = 2
}
}
variable "snmp_community_string" {
type = "string"
description = "The SNMP Community string the Logical Interconnect should use"
default = "public"
}
resource "oneview_logical_interconnect_group" "ligA" {
name = "${var.lig_name_prefix}_Eth_LIG_A"
type = "logical-interconnect-groupV7"
enclosure_indexes = [1]
interconnect_map_entry_template {
interconnect_type_name = "${var.logical_interconnect_type}"
enclosure_index = 1
bay_number = "${var.fabric_side_map["A"]}"
}
interconnect_settings {
type = "EthernetInterconnectSettingsV6"
fast_mac_cache_failover = true
igmp_snooping = false
network_loop_protection = true
pause_flood_protection = true
igmp_timeout_interval = 260
mac_refresh_interval = 5
}
telemetry_configuration {
type = "CanonicalTelemetryConfiguration"
enabled = true
sample_count = 12
sample_interval = 300
}
uplink_set {
name = "UplinkSet_A"
network_uris = ["${var.network_uris}"]
native_network_uri = "${var.native_network_uri}"
network_type = "Ethernet"
mode = "Auto"
lacp_timer = "Short"
logical_port_config {
desired_speed = "Auto"
enclosure_num = 1
bay_num = "${var.fabric_side_map["A"]}"
port_num = "${var.uplink_port_nums}"
}
}
snmp_configuration {
enabled = true
read_community = "${var.snmp_community_string}"
}
}
resource "oneview_logical_interconnect_group" "ligB" {
name = "${var.lig_name_prefix}_Eth_LIG_B"
type = "logical-interconnect-groupV7"
enclosure_indexes = [1]
interconnect_map_entry_template {
interconnect_type_name = "${var.logical_interconnect_type}"
enclosure_index = 1
bay_number = "${var.fabric_side_map["B"]}"
}
interconnect_settings {
type = "EthernetInterconnectSettingsV6"
fast_mac_cache_failover = true
igmp_snooping = false
network_loop_protection = true
pause_flood_protection = true
igmp_timeout_interval = 260
mac_refresh_interval = 5
}
telemetry_configuration {
type = "CanonicalTelemetryConfiguration"
enabled = true
sample_count = 12
sample_interval = 300
}
uplink_set {
name = "UplinkSet_B"
network_uris = ["${var.network_uris}"]
native_network_uri = "${var.native_network_uri}"
network_type = "Ethernet"
mode = "Auto"
lacp_timer = "Short"
logical_port_config {
desired_speed = "Auto"
enclosure_num = 1
bay_num = "${var.fabric_side_map["B"]}"
port_num = "${var.uplink_port_nums}"
}
}
snmp_configuration {
enabled = true
read_community = "${var.snmp_community_string}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment