Skip to content

Commit

Permalink
Implementation for ocp-power-automation#200
Browse files Browse the repository at this point in the history
This is a suggestion for the implementation of ocp-power-automation#200

I already implemented exactly this code at a customer. It introduces two new variables to var.tfvars to control how many logical ports shall be used for VNIC failover and also to define the capacity of the logical ports.

Signed-off-by: Torsten Wendland <twendlan@de.ibm.com>
  • Loading branch information
torwen1 committed Jul 1, 2021
1 parent f3d0ba6 commit 9dcef24
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 3 deletions.
12 changes: 12 additions & 0 deletions docs/var.tfvars-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ The following variable is used to set the network adapter type for the VMs. By d
network_type = "SRIOV"
```

The following variable is used to define the amount of SR-IOV Logical Ports used for VNIC failover of the 1st network adapter for the VMs. By default the VMs will use 1, which defines `no VNIC failover`. Any setting higher then 1 creates additional LPs and configures them in a VNIC failover setup. `Be aware of the fact, that RHCOS and some Linux releases might not handle VNIC failover with more then 2 SR-IOV Logical Ports properly. The recommended value is 2 for VNIC failover.`
Valid options are: Any number supported for VNIC failover adapters
```
sriov_vnic_failover_adapter = 2
```

The following variable is used to define the capacity of SR-IOV Logical Ports of the 1st network adapter for the VMs. By default the VMs will use 2%.
Valid options are: Any number which can be devided by 2 and results in an integer. 100% = 1.0; 80% = 0.80; 60% = 0.60; etc
```
sriov_capacity = 0.02
```

The following variable is used to specify the PowerVC [Storage Connectivity Group](https://www.ibm.com/support/knowledgecenter/SSVSPA_1.4.4/com.ibm.powervc.cloud.help.doc/powervc_storage_connectivity_groups_cloud.html) (SCG). Empty value will use the default SCG
```
scg_id = ""
Expand Down
4 changes: 2 additions & 2 deletions modules/2_network/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ locals {
sriov = <<EOF
{
"delete_with_instance": 1,
"vnic_required_vfs": 1,
"capacity": 0.02,
"vnic_required_vfs": ${var.sriov_vnic_failover_adapter},
"capacity": ${var.sriov_capacity},
"vlan_type": "allowed"
}
EOF
Expand Down
2 changes: 2 additions & 0 deletions modules/2_network/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ variable "master" {}
variable "worker" {}

variable "network_type" {}
variable "sriov_vnic_failover_adapter" {}
variable "sriov_capacity" {}
2 changes: 2 additions & 0 deletions ocp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ module "network" {
master = var.master
worker = var.worker
network_type = var.network_type
sriov_vnic_failover_adapter = var.sriov_vnic_failover_adapter
sriov_capacity = var.sriov_capacity
}

module "helpernode" {
Expand Down
3 changes: 2 additions & 1 deletion var.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ cluster_id = "" # It will use random generated id with

#network_type = "SRIOV"
#scg_id = "df21cec9-c244-4d3d-b927-df1518672e87"

#sriov_vnic_failover_adapter = 2
#sriov_capacity = 0.20

#enable_local_registry = false #Set to true to enable usage of local registry for restricted network install.
#local_registry_image = "docker.io/ibmcom/registry-ppc64le:2.6.2.5"
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,18 @@ variable "network_type" {
description = "Specify the name of the network adapter type to use for creating hosts"
}

variable "sriov_vnic_failover_adapter" {
# Eg: 1 = VNIC without failover; 2 = VNIC failover with 2 SR-IOV LPs
default = 1
description = "Specifies the amount of VNIC failover adapters"
}

variable "sriov_capacity" {
# Eg: 0.02 = 2%; 0.20 = 20%; 1.00 = 100%
default = 0.02
description = "Specifies the SR-IOV LP capacity"
}

variable "scg_id" {
description = "The id of PowerVC Storage Connectivity Group to use for all nodes"
default = ""
Expand Down

0 comments on commit 9dcef24

Please sign in to comment.