aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Alexy <tomas.alexy@pantheon.tech>2021-03-16 12:25:09 +0100
committerPeter Mikus <pmikus@cisco.com>2021-03-29 06:33:18 +0000
commit31f82bd3fcbd6299e2e411734767e29b7adb5982 (patch)
tree851c4f3f277cabeb18cdad4207ee26d528a4b4d0
parent493684d9a6d22dc86f8260fe8cc4244ba71b5e9e (diff)
Infra: AWS deployment improvements
- Add checks where missing - Serialize instance deployment to prevent race conditions Deploy tg -> sut1 (-> sut2) then start ansible provisioning on all instances - Bump AWS provisioner version to 3.32 Signed-off-by: Tomas Alexy <tomas.alexy@pantheon.tech> Change-Id: I9a53b1de96574674f3608f19a8f5ac297eb1bd86
-rw-r--r--fdio.infra.terraform/2n_aws_c5n/deploy/main.tf18
-rw-r--r--fdio.infra.terraform/2n_aws_c5n/deploy/versions.tf2
-rw-r--r--fdio.infra.terraform/3n_aws_c5n/deploy/main.tf55
-rw-r--r--fdio.infra.terraform/3n_aws_c5n/deploy/versions.tf2
4 files changed, 58 insertions, 19 deletions
diff --git a/fdio.infra.terraform/2n_aws_c5n/deploy/main.tf b/fdio.infra.terraform/2n_aws_c5n/deploy/main.tf
index f97d974b38..b9d6f188bb 100644
--- a/fdio.infra.terraform/2n_aws_c5n/deploy/main.tf
+++ b/fdio.infra.terraform/2n_aws_c5n/deploy/main.tf
@@ -134,7 +134,7 @@ resource "aws_network_interface" "dut1_if1" {
private_ip = var.dut1_if1_ip
private_ips = [var.dut1_if1_ip]
security_groups = [aws_security_group.CSITSG.id]
- depends_on = [aws_vpc.CSITVPC, aws_subnet.b]
+ depends_on = [aws_vpc.CSITVPC, aws_subnet.b, aws_instance.dut1]
attachment {
instance = aws_instance.dut1.id
@@ -152,7 +152,7 @@ resource "aws_network_interface" "dut1_if2" {
private_ip = var.dut1_if2_ip
private_ips = [var.dut1_if2_ip]
security_groups = [aws_security_group.CSITSG.id]
- depends_on = [aws_vpc.CSITVPC]
+ depends_on = [aws_vpc.CSITVPC, aws_subnet.d, aws_instance.dut1]
attachment {
instance = aws_instance.dut1.id
@@ -170,7 +170,7 @@ resource "aws_network_interface" "tg_if1" {
private_ip = var.tg_if1_ip
private_ips = [var.tg_if1_ip]
security_groups = [aws_security_group.CSITSG.id]
- depends_on = [aws_vpc.CSITVPC, aws_subnet.b]
+ depends_on = [aws_vpc.CSITVPC, aws_subnet.b, aws_instance.tg]
attachment {
instance = aws_instance.tg.id
@@ -188,7 +188,7 @@ resource "aws_network_interface" "tg_if2" {
private_ip = var.tg_if2_ip
private_ips = [var.tg_if2_ip]
security_groups = [aws_security_group.CSITSG.id]
- depends_on = [aws_vpc.CSITVPC, aws_subnet.d]
+ depends_on = [aws_vpc.CSITVPC, aws_subnet.d, aws_instance.tg]
attachment {
instance = aws_instance.tg.id
@@ -242,7 +242,7 @@ resource "aws_instance" "tg" {
}
resource "aws_instance" "dut1" {
- depends_on = [aws_vpc.CSITVPC, aws_placement_group.CSITPG]
+ depends_on = [aws_vpc.CSITVPC, aws_placement_group.CSITPG, aws_instance.tg]
ami = var.ami_image
availability_zone = var.avail_zone
instance_type = var.instance_type
@@ -292,7 +292,10 @@ resource "null_resource" "deploy_tg" {
depends_on = [
aws_instance.tg,
aws_network_interface.tg_if1,
- aws_network_interface.tg_if2
+ aws_network_interface.tg_if2,
+ aws_instance.dut1,
+ aws_network_interface.dut1_if1,
+ aws_network_interface.dut1_if2
]
connection {
@@ -328,6 +331,9 @@ resource "null_resource" "deploy_tg" {
resource "null_resource" "deploy_dut1" {
depends_on = [
+ aws_instance.tg,
+ aws_network_interface.tg_if1,
+ aws_network_interface.tg_if2,
aws_instance.dut1,
aws_network_interface.dut1_if1,
aws_network_interface.dut1_if2
diff --git a/fdio.infra.terraform/2n_aws_c5n/deploy/versions.tf b/fdio.infra.terraform/2n_aws_c5n/deploy/versions.tf
index 8b7b8c5f32..8017bb9dc3 100644
--- a/fdio.infra.terraform/2n_aws_c5n/deploy/versions.tf
+++ b/fdio.infra.terraform/2n_aws_c5n/deploy/versions.tf
@@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
- version = "~> 3.28.0"
+ version = "~> 3.32.0"
}
null = {
source = "hashicorp/null"
diff --git a/fdio.infra.terraform/3n_aws_c5n/deploy/main.tf b/fdio.infra.terraform/3n_aws_c5n/deploy/main.tf
index 7c029c6c54..d8968bf5fe 100644
--- a/fdio.infra.terraform/3n_aws_c5n/deploy/main.tf
+++ b/fdio.infra.terraform/3n_aws_c5n/deploy/main.tf
@@ -134,7 +134,7 @@ resource "aws_network_interface" "dut1_if1" {
private_ip = var.dut1_if1_ip
private_ips = [var.dut1_if1_ip]
security_groups = [aws_security_group.CSITSG.id]
- depends_on = [aws_vpc.CSITVPC, aws_subnet.b]
+ depends_on = [aws_vpc.CSITVPC, aws_subnet.b, aws_instance.dut1]
attachment {
instance = aws_instance.dut1.id
@@ -152,7 +152,7 @@ resource "aws_network_interface" "dut1_if2" {
private_ip = var.dut1_if2_ip
private_ips = [var.dut1_if2_ip]
security_groups = [aws_security_group.CSITSG.id]
- depends_on = [aws_vpc.CSITVPC]
+ depends_on = [aws_vpc.CSITVPC, aws_subnet.c, aws_instance.dut1]
attachment {
instance = aws_instance.dut1.id
@@ -170,7 +170,7 @@ resource "aws_network_interface" "dut2_if1" {
private_ip = var.dut2_if1_ip
private_ips = [var.dut2_if1_ip]
security_groups = [aws_security_group.CSITSG.id]
- depends_on = [aws_vpc.CSITVPC, aws_subnet.c]
+ depends_on = [aws_vpc.CSITVPC, aws_subnet.c, aws_instance.dut2]
attachment {
instance = aws_instance.dut2.id
@@ -188,7 +188,7 @@ resource "aws_network_interface" "dut2_if2" {
private_ip = var.dut2_if2_ip
private_ips = [var.dut2_if2_ip]
security_groups = [aws_security_group.CSITSG.id]
- depends_on = [aws_vpc.CSITVPC, aws_subnet.d]
+ depends_on = [aws_vpc.CSITVPC, aws_subnet.d, aws_instance.dut2]
attachment {
instance = aws_instance.dut2.id
@@ -206,7 +206,7 @@ resource "aws_network_interface" "tg_if1" {
private_ip = var.tg_if1_ip
private_ips = [var.tg_if1_ip]
security_groups = [aws_security_group.CSITSG.id]
- depends_on = [aws_vpc.CSITVPC, aws_subnet.b]
+ depends_on = [aws_vpc.CSITVPC, aws_subnet.b, aws_instance.tg]
attachment {
instance = aws_instance.tg.id
@@ -224,7 +224,7 @@ resource "aws_network_interface" "tg_if2" {
private_ip = var.tg_if2_ip
private_ips = [var.tg_if2_ip]
security_groups = [aws_security_group.CSITSG.id]
- depends_on = [aws_vpc.CSITVPC, aws_subnet.d]
+ depends_on = [aws_vpc.CSITVPC, aws_subnet.d, aws_instance.tg]
attachment {
instance = aws_instance.tg.id
@@ -262,7 +262,6 @@ data "aws_network_interface" "tg_if2" {
# Instances
resource "aws_instance" "tg" {
- depends_on = [aws_vpc.CSITVPC, aws_placement_group.CSITPG]
ami = var.ami_image
availability_zone = var.avail_zone
instance_type = var.instance_type
@@ -275,6 +274,11 @@ resource "aws_instance" "tg" {
source_dest_check = false
# host_id = "1"
+ depends_on = [
+ aws_vpc.CSITVPC,
+ aws_placement_group.CSITPG,
+ ]
+
root_block_device {
volume_size = 50
}
@@ -286,7 +290,6 @@ resource "aws_instance" "tg" {
}
resource "aws_instance" "dut1" {
- depends_on = [aws_vpc.CSITVPC, aws_placement_group.CSITPG]
ami = var.ami_image
availability_zone = var.avail_zone
instance_type = var.instance_type
@@ -299,6 +302,12 @@ resource "aws_instance" "dut1" {
source_dest_check = false
# host_id = "2"
+ depends_on = [
+ aws_vpc.CSITVPC,
+ aws_placement_group.CSITPG,
+ aws_instance.tg
+ ]
+
root_block_device {
volume_size = 50
}
@@ -310,7 +319,6 @@ resource "aws_instance" "dut1" {
}
resource "aws_instance" "dut2" {
- depends_on = [aws_vpc.CSITVPC, aws_placement_group.CSITPG]
ami = var.ami_image
availability_zone = var.avail_zone
instance_type = var.instance_type
@@ -323,6 +331,13 @@ resource "aws_instance" "dut2" {
source_dest_check = false
# host_id = "3"
+ depends_on = [
+ aws_vpc.CSITVPC,
+ aws_placement_group.CSITPG,
+ aws_instance.tg,
+ aws_instance.dut1
+ ]
+
root_block_device {
volume_size = 50
}
@@ -358,7 +373,13 @@ resource "null_resource" "deploy_tg" {
depends_on = [
aws_instance.tg,
aws_network_interface.tg_if1,
- aws_network_interface.tg_if2
+ aws_network_interface.tg_if2,
+ aws_instance.dut1,
+ aws_network_interface.dut1_if1,
+ aws_network_interface.dut1_if2,
+ aws_instance.dut2,
+ aws_network_interface.dut2_if1,
+ aws_network_interface.dut2_if2
]
connection {
@@ -394,9 +415,15 @@ resource "null_resource" "deploy_tg" {
resource "null_resource" "deploy_dut1" {
depends_on = [
+ aws_instance.tg,
+ aws_network_interface.tg_if1,
+ aws_network_interface.tg_if2,
aws_instance.dut1,
aws_network_interface.dut1_if1,
- aws_network_interface.dut1_if2
+ aws_network_interface.dut1_if2,
+ aws_instance.dut2,
+ aws_network_interface.dut2_if1,
+ aws_network_interface.dut2_if2
]
connection {
@@ -432,6 +459,12 @@ resource "null_resource" "deploy_dut1" {
resource "null_resource" "deploy_dut2" {
depends_on = [
+ aws_instance.tg,
+ aws_network_interface.tg_if1,
+ aws_network_interface.tg_if2,
+ aws_instance.dut1,
+ aws_network_interface.dut1_if1,
+ aws_network_interface.dut1_if2,
aws_instance.dut2,
aws_network_interface.dut2_if1,
aws_network_interface.dut2_if2
diff --git a/fdio.infra.terraform/3n_aws_c5n/deploy/versions.tf b/fdio.infra.terraform/3n_aws_c5n/deploy/versions.tf
index 8b7b8c5f32..8017bb9dc3 100644
--- a/fdio.infra.terraform/3n_aws_c5n/deploy/versions.tf
+++ b/fdio.infra.terraform/3n_aws_c5n/deploy/versions.tf
@@ -2,7 +2,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
- version = "~> 3.28.0"
+ version = "~> 3.32.0"
}
null = {
source = "hashicorp/null"
="s">dpdk_plugin.so | crypto_native_plugin.so | ... | crypto_ipsecmb_plugin.so | crypto_openssl_plugin.so | ${crypto_type}= | HW_DH895xcc | ${nic_name}= | Intel-X710 | ${nic_driver}= | vfio-pci | ${osi_layer}= | L3 | ${overhead}= | ${78} | ${tg_if1_ip4}= | 192.168.10.2 | ${dut1_if1_ip4}= | 192.168.10.1 | ${dut1_if2_ip4}= | 100.0.0.1 | ${dut2_if1_ip4}= | 100.0.0.2 | ${dut2_if2_ip4}= | 192.168.20.1 | ${tg_if2_ip4}= | 192.168.20.2 | ${raddr_ip4}= | 20.0.0.0 | ${laddr_ip4}= | 10.0.0.0 | ${addr_range}= | ${24} | ${n_tunnels}= | ${1000} # Traffic profile: | ${traffic_profile}= | trex-sl-3n-ethip4-ip4dst${n_tunnels} *** Keywords *** | Local Template | | [Documentation] | | ... | [Cfg] DUTs runs IPsec tunneling AES_128_CBC / HMAC_SHA_512 config.\ | | ... | Each DUT uses ${phy_cores} physical core(s) for worker threads. | | ... | [Ver] Measure NDR and PDR values using MLRsearch algorithm.\ | | | | ... | *Arguments:* | | ... | - frame_size - Framesize in Bytes in integer or string (IMIX_v4_1). | | ... | Type: integer, string | | ... | - phy_cores - Number of physical cores. Type: integer | | ... | - rxq - Number of RX queues, default value: ${None}. Type: integer | | | | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${None} | | | | Set Test Variable | \${frame_size} | | | | # These are enums (not strings) so they cannot be in Variables table. | | ${encr_alg}= | Crypto Alg AES CBC 128 | | ${auth_alg}= | Integ Alg SHA 512 256 | | | | Given Set Max Rate And Jumbo | | And Add worker threads to all DUTs | ${phy_cores} | ${rxq} | | And Pre-initialize layer driver | ${nic_driver} | | And Apply startup configuration on all VPP DUTs | | When Initialize layer driver | ${nic_driver} | | And Initialize layer interface | | And Initialize IPSec in 3-node circular topology | | And VPP IPsec Add Multiple Tunnels | | ... | ${nodes} | ${dut1_if2} | ${dut2_if1} | ${n_tunnels} | | ... | ${encr_alg} | ${auth_alg} | ${dut1_if2_ip4} | ${dut2_if1_ip4} | | ... | ${laddr_ip4} | ${raddr_ip4} | ${addr_range} | | Then Find NDR and PDR intervals using optimized search *** Test Cases *** | tc01-64B-1c-ethip4ipsec1000tnlhw-ip4base-policy-aes128cbc-hmac512sha-ndrpdr | | [Tags] | 64B | 1C | | frame_size=${64} | phy_cores=${1} | tc02-64B-2c-ethip4ipsec1000tnlhw-ip4base-policy-aes128cbc-hmac512sha-ndrpdr | | [Tags] | 64B | 2C | | frame_size=${64} | phy_cores=${2} | tc03-64B-4c-ethip4ipsec1000tnlhw-ip4base-policy-aes128cbc-hmac512sha-ndrpdr | | [Tags] | 64B | 4C | | frame_size=${64} | phy_cores=${4} | tc04-1518B-1c-ethip4ipsec1000tnlhw-ip4base-policy-aes128cbc-hmac512sha-ndrpdr | | [Tags] | 1518B | 1C | | frame_size=${1518} | phy_cores=${1} | tc05-1518B-2c-ethip4ipsec1000tnlhw-ip4base-policy-aes128cbc-hmac512sha-ndrpdr | | [Tags] | 1518B | 2C | | frame_size=${1518} | phy_cores=${2} | tc06-1518B-4c-ethip4ipsec1000tnlhw-ip4base-policy-aes128cbc-hmac512sha-ndrpdr | | [Tags] | 1518B | 4C | | frame_size=${1518} | phy_cores=${4} | tc10-IMIX-1c-ethip4ipsec1000tnlhw-ip4base-policy-aes128cbc-hmac512sha-ndrpdr | | [Tags] | IMIX | 1C | | frame_size=IMIX_v4_1 | phy_cores=${1} | tc11-IMIX-2c-ethip4ipsec1000tnlhw-ip4base-policy-aes128cbc-hmac512sha-ndrpdr | | [Tags] | IMIX | 2C | | frame_size=IMIX_v4_1 | phy_cores=${2} | tc12-IMIX-4c-ethip4ipsec1000tnlhw-ip4base-policy-aes128cbc-hmac512sha-ndrpdr | | [Tags] | IMIX | 4C | | frame_size=IMIX_v4_1 | phy_cores=${4}