From 03f2c2efd598fc4ca69a3e96ca93b1696932f734 Mon Sep 17 00:00:00 2001 From: Ilja Rotar Date: Thu, 6 Jun 2024 13:17:26 +0200 Subject: [PATCH 01/21] Add mixed topology --- Makefile | 5 ++++- mini-lab.mixed.yaml | 51 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 mini-lab.mixed.yaml diff --git a/Makefile b/Makefile index 679dd0b3..016e6225 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,9 @@ LAB_TOPOLOGY=mini-lab.cumulus.yaml else ifeq ($(MINI_LAB_FLAVOR),sonic) LAB_MACHINES=machine01,machine02 LAB_TOPOLOGY=mini-lab.sonic.yaml +else ifeq ($(MINI_LAB_FLAVOR),mixed) +LAB_MACHINES=machine01,machine02 +LAB_TOPOLOGY=mini-lab.mixed.yaml else $(error Unknown flavor $(MINI_LAB_FLAVOR)) endif @@ -121,9 +124,9 @@ cleanup-control-plane: .PHONY: cleanup-partition cleanup-partition: - mkdir -p clab-mini-lab sudo $(CONTAINERLAB) destroy --topo mini-lab.cumulus.yaml sudo $(CONTAINERLAB) destroy --topo mini-lab.sonic.yaml + sudo $(CONTAINERLAB) destroy --topo mini-lab.mixed.yaml .PHONY: _privatenet _privatenet: env diff --git a/mini-lab.mixed.yaml b/mini-lab.mixed.yaml new file mode 100644 index 00000000..80aa1866 --- /dev/null +++ b/mini-lab.mixed.yaml @@ -0,0 +1,51 @@ +name: mini-lab +prefix: "" + +mgmt: + network: bridge + +topology: + nodes: + leaf01: + kind: cvx + image: networkop/cx:3.7.0 + kernel: docker.io/grigoriymikh/kernel:4.1.0 + sandbox: grigoriymikh/sandbox:latest + labels: + ansible-group: cumulus + binds: + - apt-transport-https.tar.gz:/root/jessie-apt-transport-fix.tar.gz + - files/ssh/id_rsa.pub:/root/.ssh/authorized_keys + leaf02: + kind: linux + image: ${MINI_LAB_SONIC_IMAGE} + labels: + ansible-group: sonic + binds: + - /dev:/dev + - files/ssh/id_rsa.pub:/authorized_keys + inet: + kind: linux + image: quay.io/frrouting/frr:9.1.0 + binds: + - files/inet/daemons:/etc/frr/daemons + - files/inet/frr.conf:/etc/frr/frr.conf + - files/inet/vtysh.conf:/etc/frr/vtysh.conf + - files/inet/network.sh:/root/network.sh + exec: + - sh /root/network.sh + vms: + kind: linux + image: ${MINI_LAB_VM_IMAGE} + binds: + - /dev:/dev + - scripts:/mini-lab + links: + - endpoints: ["leaf01:swp31", "inet:eth1"] + - endpoints: ["leaf02:eth1", "inet:eth2"] + - endpoints: ["leaf01:swp1", "vms:lan0"] + - endpoints: ["leaf02:eth2", "vms:lan1"] + - endpoints: ["leaf01:swp2", "vms:lan2"] + - endpoints: ["leaf02:eth3", "vms:lan3"] + - endpoints: ["leaf01:swp3", "vms:lan4"] + - endpoints: ["leaf02:eth4", "vms:lan5"] From 061d0cae7d79b7ae97dddd931f113b3dff05ff23 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Mon, 16 Sep 2024 14:33:52 +0200 Subject: [PATCH 02/21] enable simulated migration in mixed setup --- Makefile | 20 ++++++- deploy_partition.yaml | 2 +- .../{leaf02.yaml => leaf02-cvx.yaml} | 0 inventories/partition.yaml | 24 ++------- mini-lab.mixed.yaml | 54 ++++++++++++++----- scripts/migrate.sh | 15 ++++++ scripts/mirror_tap_to_lan.sh | 1 - 7 files changed, 77 insertions(+), 39 deletions(-) rename inventories/host_vars/{leaf02.yaml => leaf02-cvx.yaml} (100%) create mode 100755 scripts/migrate.sh diff --git a/Makefile b/Makefile index 58b3698e..7086f8a5 100644 --- a/Makefile +++ b/Makefile @@ -25,13 +25,16 @@ MAX_RETRIES := 30 ifeq ($(MINI_LAB_FLAVOR),cumulus) LAB_MACHINES=machine01,machine02 LAB_TOPOLOGY=mini-lab.cumulus.yaml +LAB_SWITCHES=leaf01 leaf02 VRF=vrf20 else ifeq ($(MINI_LAB_FLAVOR),sonic) LAB_MACHINES=machine01,machine02 LAB_TOPOLOGY=mini-lab.sonic.yaml +LAB_SWITCHES=leaf01 leaf02 else ifeq ($(MINI_LAB_FLAVOR),mixed) LAB_MACHINES=machine01,machine02 LAB_TOPOLOGY=mini-lab.mixed.yaml +LAB_SWITCHES=leaf01 leaf02-cvx leaf02-sonic VRF=Vrf20 else $(error Unknown flavor $(MINI_LAB_FLAVOR)) @@ -57,8 +60,7 @@ up: env control-plane-bake partition-bake # without restarting the metal-core # TODO: should be investigated and fixed if possible sleep 10 - ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o "PubkeyAcceptedKeyTypes +ssh-rsa" root@leaf01 -i files/ssh/id_rsa 'systemctl restart metal-core' - ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o "PubkeyAcceptedKeyTypes +ssh-rsa" root@leaf02 -i files/ssh/id_rsa 'systemctl restart metal-core' + @$(MAKE) --no-print-directory restart-metal-core .PHONY: restart restart: down up @@ -170,6 +172,20 @@ ssh-leaf01: ssh-leaf02: ssh -o StrictHostKeyChecking=no -o "PubkeyAcceptedKeyTypes +ssh-rsa" -i files/ssh/id_rsa root@leaf02 +.PHONY: restart-metal-core +restart-metal-core: + $(foreach host,$(LAB_SWITCHES),ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o "PubkeyAcceptedKeyTypes +ssh-rsa" root@$(host) -i files/ssh/id_rsa 'systemctl restart metal-core';) + +.PHONY: migrate-cumulus-to-sonic +migrate-cumulus-to-sonic: + docker exec vms /mini-lab/migrate.sh tap1 lan1 lan6 + docker exec vms /mini-lab/migrate.sh tap3 lan3 lan7 + +.PHONY: migrate-sonic-to-cumulus +migrate-sonic-to-cumulus: + docker exec vms /mini-lab/migrate.sh tap1 lan6 lan1 + docker exec vms /mini-lab/migrate.sh tap3 lan7 lan3 + ## MACHINE MANAGEMENT ## .PHONY: start-machines diff --git a/deploy_partition.yaml b/deploy_partition.yaml index 7a59227e..fa86448c 100644 --- a/deploy_partition.yaml +++ b/deploy_partition.yaml @@ -85,6 +85,6 @@ retries: 60 delay: 3 until: - - lookup('metal', 'search', 'switch', api_url=metal_partition_metal_api_protocol+'://'+metal_partition_metal_api_addr+':'+metal_partition_metal_api_port|string+metal_partition_metal_api_basepath, api_hmac=metal_partition_metal_api_hmac_edit_key) | length == 2 + - lookup('metal', 'search', 'switch', api_url=metal_partition_metal_api_protocol+'://'+metal_partition_metal_api_addr+':'+metal_partition_metal_api_port|string+metal_partition_metal_api_basepath, api_hmac=metal_partition_metal_api_hmac_edit_key) | length >= 2 - lookup('metal', 'search', 'switch', api_url=metal_partition_metal_api_protocol+'://'+metal_partition_metal_api_addr+':'+metal_partition_metal_api_port|string+metal_partition_metal_api_basepath, api_hmac=metal_partition_metal_api_hmac_edit_key)[0]["last_sync"] != None - lookup('metal', 'search', 'switch', api_url=metal_partition_metal_api_protocol+'://'+metal_partition_metal_api_addr+':'+metal_partition_metal_api_port|string+metal_partition_metal_api_basepath, api_hmac=metal_partition_metal_api_hmac_edit_key)[1]["last_sync"] != None diff --git a/inventories/host_vars/leaf02.yaml b/inventories/host_vars/leaf02-cvx.yaml similarity index 100% rename from inventories/host_vars/leaf02.yaml rename to inventories/host_vars/leaf02-cvx.yaml diff --git a/inventories/partition.yaml b/inventories/partition.yaml index 23c0490e..018ce9f7 100644 --- a/inventories/partition.yaml +++ b/inventories/partition.yaml @@ -10,27 +10,9 @@ partition: leaves: leaves: - hosts: - leaf01: - lo: 10.0.0.11 - asn: 4200000011 - metal_core_cidr: 10.0.1.1/{{ metal_core_cidr_mask }} - - dhcp_default_lease_time: 600 - dhcp_max_lease_time: 600 - dhcp_subnets: - - network: 10.0.1.0 - netmask: 255.255.255.0 - range: - begin: 10.0.1.2 - end: 10.0.1.255 - options: - - routers {{ dhcp_server_ip }} - - domain-name-servers 1.1.1.1, 8.8.8.8 - leaf02: - lo: 10.0.0.12 - asn: 4200000012 - metal_core_cidr: 10.0.1.128/{{ metal_core_cidr_mask }} + children: + cumulus: + sonic: vars: pixie_server_ip: 10.0.1.1 dhcp_server_ip: 10.0.1.1 diff --git a/mini-lab.mixed.yaml b/mini-lab.mixed.yaml index 80aa1866..df9d5f91 100644 --- a/mini-lab.mixed.yaml +++ b/mini-lab.mixed.yaml @@ -5,9 +5,8 @@ mgmt: network: bridge topology: - nodes: - leaf01: - kind: cvx + kinds: + cvx: image: networkop/cx:3.7.0 kernel: docker.io/grigoriymikh/kernel:4.1.0 sandbox: grigoriymikh/sandbox:latest @@ -16,7 +15,17 @@ topology: binds: - apt-transport-https.tar.gz:/root/jessie-apt-transport-fix.tar.gz - files/ssh/id_rsa.pub:/root/.ssh/authorized_keys - leaf02: + linux: + image: ${MINI_LAB_VM_IMAGE} + + nodes: + mini_lab_ext: + kind: bridge + leaf01: + kind: cvx + leaf02-cvx: + kind: cvx + leaf02-sonic: kind: linux image: ${MINI_LAB_SONIC_IMAGE} labels: @@ -26,7 +35,7 @@ topology: - files/ssh/id_rsa.pub:/authorized_keys inet: kind: linux - image: quay.io/frrouting/frr:9.1.0 + image: quay.io/frrouting/frr:10.0.1 binds: - files/inet/daemons:/etc/frr/daemons - files/inet/frr.conf:/etc/frr/frr.conf @@ -36,16 +45,33 @@ topology: - sh /root/network.sh vms: kind: linux - image: ${MINI_LAB_VM_IMAGE} binds: - /dev:/dev - scripts:/mini-lab + www: + kind: linux + image: docker.io/library/nginx:alpine-slim + network-mode: none + exec: + - ip addr add 203.0.113.3/24 dev ext + - ip route add 203.0.113.128/25 via 203.0.113.2 dev ext + links: - - endpoints: ["leaf01:swp31", "inet:eth1"] - - endpoints: ["leaf02:eth1", "inet:eth2"] - - endpoints: ["leaf01:swp1", "vms:lan0"] - - endpoints: ["leaf02:eth2", "vms:lan1"] - - endpoints: ["leaf01:swp2", "vms:lan2"] - - endpoints: ["leaf02:eth3", "vms:lan3"] - - endpoints: ["leaf01:swp3", "vms:lan4"] - - endpoints: ["leaf02:eth4", "vms:lan5"] + - endpoints: ["inet:ext", "mini_lab_ext:inet"] + mtu: 9000 + - endpoints: ["www:ext", "mini_lab_ext:www"] + + - endpoints: ["leaf01:swp1", "inet:eth1"] + - endpoints: ["leaf01:swp2", "vms:lan0"] + - endpoints: ["leaf01:swp3", "vms:lan2"] + - endpoints: ["leaf01:swp4", "vms:lan4"] + + - endpoints: ["leaf02-cvx:swp1", "inet:eth2"] + - endpoints: ["leaf02-cvx:swp2", "vms:lan1"] + - endpoints: ["leaf02-cvx:swp3", "vms:lan3"] + - endpoints: ["leaf02-cvx:swp4", "vms:lan5"] + + - endpoints: ["leaf02-sonic:eth1", "inet:eth3"] + - endpoints: ["leaf02-sonic:eth2", "vms:lan6"] + - endpoints: ["leaf02-sonic:eth3", "vms:lan7"] + - endpoints: ["leaf02-sonic:eth4", "vms:lan8"] diff --git a/scripts/migrate.sh b/scripts/migrate.sh new file mode 100755 index 00000000..63fac018 --- /dev/null +++ b/scripts/migrate.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -o errexit +TAP_IF=$1 +FROM_IF=$2 +TO_IF=$3 + +tc qdisc del dev $FROM_IF ingress +tc qdisc del dev $TAP_IF ingress + +tc qdisc add dev $TO_IF ingress +tc filter add dev $TO_IF parent ffff: protocol all u32 match u8 0 0 action mirred egress redirect dev $TAP_IF + +tc qdisc add dev $TAP_IF ingress +tc filter add dev $TAP_IF parent ffff: protocol all u32 match u8 0 0 action mirred egress redirect dev $TO_IF diff --git a/scripts/mirror_tap_to_lan.sh b/scripts/mirror_tap_to_lan.sh index f62b6d5e..55e1ba3a 100755 --- a/scripts/mirror_tap_to_lan.sh +++ b/scripts/mirror_tap_to_lan.sh @@ -1,6 +1,5 @@ #!/bin/bash -# Script is taken from https://netdevops.me/2021/transparently-redirecting-packets/frames-between-interfaces/ # Script is taken from https://netdevops.me/2021/transparently-redirecting-packetsframes-between-interfaces/ # Read it for better understanding From 75d4d269136cf3c108cf4935285fdf63bd245f19 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Mon, 16 Sep 2024 14:49:44 +0200 Subject: [PATCH 03/21] remove -cvx suffix from leaf02 --- Makefile | 2 +- mini-lab.mixed.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 7086f8a5..c6a0935f 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ LAB_SWITCHES=leaf01 leaf02 else ifeq ($(MINI_LAB_FLAVOR),mixed) LAB_MACHINES=machine01,machine02 LAB_TOPOLOGY=mini-lab.mixed.yaml -LAB_SWITCHES=leaf01 leaf02-cvx leaf02-sonic +LAB_SWITCHES=leaf01 leaf02 leaf02-sonic VRF=Vrf20 else $(error Unknown flavor $(MINI_LAB_FLAVOR)) diff --git a/mini-lab.mixed.yaml b/mini-lab.mixed.yaml index df9d5f91..3d94570e 100644 --- a/mini-lab.mixed.yaml +++ b/mini-lab.mixed.yaml @@ -23,7 +23,7 @@ topology: kind: bridge leaf01: kind: cvx - leaf02-cvx: + leaf02: kind: cvx leaf02-sonic: kind: linux @@ -66,10 +66,10 @@ topology: - endpoints: ["leaf01:swp3", "vms:lan2"] - endpoints: ["leaf01:swp4", "vms:lan4"] - - endpoints: ["leaf02-cvx:swp1", "inet:eth2"] - - endpoints: ["leaf02-cvx:swp2", "vms:lan1"] - - endpoints: ["leaf02-cvx:swp3", "vms:lan3"] - - endpoints: ["leaf02-cvx:swp4", "vms:lan5"] + - endpoints: ["leaf02:swp1", "inet:eth2"] + - endpoints: ["leaf02:swp2", "vms:lan1"] + - endpoints: ["leaf02:swp3", "vms:lan3"] + - endpoints: ["leaf02:swp4", "vms:lan5"] - endpoints: ["leaf02-sonic:eth1", "inet:eth3"] - endpoints: ["leaf02-sonic:eth2", "vms:lan6"] From e076f9edb3cf335ffbe0acc28fcab2162859bf15 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Mon, 16 Sep 2024 15:07:21 +0200 Subject: [PATCH 04/21] fix wrong hostname --- .github/workflows/integration.yaml | 1 + inventories/host_vars/{leaf02-cvx.yaml => leaf02.yaml} | 0 2 files changed, 1 insertion(+) rename inventories/host_vars/{leaf02-cvx.yaml => leaf02.yaml} (100%) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 2f77350c..c6eedba5 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -21,6 +21,7 @@ jobs: flavors: - name: cumulus - name: sonic + - name: mixed steps: - name: Gain back workspace permissions # https://github.com/actions/checkout/issues/211 diff --git a/inventories/host_vars/leaf02-cvx.yaml b/inventories/host_vars/leaf02.yaml similarity index 100% rename from inventories/host_vars/leaf02-cvx.yaml rename to inventories/host_vars/leaf02.yaml From 80f23c75f99d9681d7e423a057a78482477d6280 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Mon, 16 Sep 2024 15:18:18 +0200 Subject: [PATCH 05/21] remove mixed setup from integration tests for now --- .github/workflows/integration.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index c6eedba5..2f77350c 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -21,7 +21,6 @@ jobs: flavors: - name: cumulus - name: sonic - - name: mixed steps: - name: Gain back workspace permissions # https://github.com/actions/checkout/issues/211 From 31314a5e00cc4a291b78cded0e10d427d776451c Mon Sep 17 00:00:00 2001 From: iljarotar Date: Mon, 16 Sep 2024 15:47:51 +0200 Subject: [PATCH 06/21] readme --- README.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c18c448e..055f8790 100644 --- a/README.md +++ b/README.md @@ -193,15 +193,30 @@ docker compose run --rm metalctl machine rm e0ab02d2-27cd-5a5e-8efc-080ba80cf258 ## Flavors -There's few versions of mini-lab environment that you can run. We call them flavors. There's 2 flavors at the moment: +There are three versions, or flavors, of the mini-lab environment which differ in regards to the NOS running on the leaves: -- `default` -- runs 2 machines. -- `cluster-api` -- runs 3 machines. Useful for testing Control plane and worker node deployment with [Cluster API provider](https://github.com/metal-stack/cluster-api-provider-metalstack). -- `sonic` -- use SONiC as network operating system for the leaves +- `cumulus` -- runs 2 Cumulus switches. +- `sonic` -- runs 2 SONiC switches +- `mixed` -- starts 2 Cumulus switches and one SONiC switch, where the SONiC switch is not connected to any machines yet. Read the `Switch migration` section to see how this setup can be used to simulate switch migration from Cumulus to SONiC or vice versa. In order to start specific flavor, you can define the flavor as follows: ```bash -export MINI_LAB_FLAVOR=cluster-api +export MINI_LAB_FLAVOR=sonic make ``` + +# Switch migration + +The strategy for migrating a Cumulus rack to SONiC without downtime involves migrating one switch first creating a mixed setup with Cumulus and SONiC running alongside each other and then migrating the second one. +To simulate the first half of this procdure in the mini-lab, the following steps are performed: + +- start the mini-lab with the `mixed` flavor. +- run `eval $(make dev-env)` to get access to the lab via `metalctl`. +- run `metalctl switch migrate mini-lab-leaf02 leaf02-sonic` to adjust machine connections in the database. +- run `make migrate-cumulus-to-sonic` to adjust the redirect rules in the `vms` container. This simulates changing the cables of the machines from one switch to another. +- run `make firewall machine` to allocate a firewall and a machine + +Wait for a few minutes and run `metalctl machine ls`. If everything works as expected you should see that both machines have `Phoned Home`. + +Although migrating from Cumulus to SONiC is the more important use case, the other direction is supported as well. Just run `metalctl switch migrate leaf02-sonic mini-lab-leaf02` followed by `make migrate-sonic-to-cumulus`. From e4cac402d132f0558518138045a46ef4205945c9 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Mon, 16 Sep 2024 15:52:02 +0200 Subject: [PATCH 07/21] remove orphans --- Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index c6a0935f..560c4e66 100644 --- a/Makefile +++ b/Makefile @@ -130,24 +130,24 @@ cleanup-partition: .PHONY: _privatenet _privatenet: env - docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network | grep user-private-network || docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network allocate --partition mini-lab --project 00000000-0000-0000-0000-000000000001 --name user-private-network + docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network | grep user-private-network || docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network allocate --partition mini-lab --project 00000000-0000-0000-0000-000000000001 --name user-private-network .PHONY: _public_ips _public_ips: env - docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip list --name firewall | grep firewall || docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip create --network internet-mini-lab --project 00000000-0000-0000-0000-000000000001 --ipaddress 203.0.113.129 --name firewall - docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip list --name machine | grep machine || docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip create --network internet-mini-lab --project 00000000-0000-0000-0000-000000000001 --ipaddress 203.0.113.130 --name machine + docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip list --name firewall | grep firewall || docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip create --network internet-mini-lab --project 00000000-0000-0000-0000-000000000001 --ipaddress 203.0.113.129 --name firewall + docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip list --name machine | grep machine || docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip create --network internet-mini-lab --project 00000000-0000-0000-0000-000000000001 --ipaddress 203.0.113.130 --name machine .PHONY: machine machine: _privatenet _public_ips - docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl machine create --description test --name test --hostname test --project 00000000-0000-0000-0000-000000000001 --partition mini-lab --image $(MACHINE_OS) --size v1-small-x86 --userdata "@/tmp/ignition.json" --ips 203.0.113.130 --networks internet-mini-lab,$(shell docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}') + docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl machine create --description test --name test --hostname test --project 00000000-0000-0000-0000-000000000001 --partition mini-lab --image $(MACHINE_OS) --size v1-small-x86 --userdata "@/tmp/ignition.json" --ips 203.0.113.130 --networks internet-mini-lab,$(shell docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}') .PHONY: firewall firewall: _privatenet _public_ips - docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl firewall create --description fw --name fw --hostname fw --project 00000000-0000-0000-0000-000000000001 --partition mini-lab --image firewall-ubuntu-3.0 --size v1-small-x86 --userdata "@/tmp/ignition.json" --ips 203.0.113.129 --firewall-rules-file=/tmp/rules.yaml --networks internet-mini-lab,$(shell docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}') + docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl firewall create --description fw --name fw --hostname fw --project 00000000-0000-0000-0000-000000000001 --partition mini-lab --image firewall-ubuntu-3.0 --size v1-small-x86 --userdata "@/tmp/ignition.json" --ips 203.0.113.129 --firewall-rules-file=/tmp/rules.yaml --networks internet-mini-lab,$(shell docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}') .PHONY: ls ls: env - docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl machine ls + docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl machine ls ## SWITCH MANAGEMENT ## @@ -194,7 +194,7 @@ start-machines: .PHONY: _password _password: env - docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl machine consolepassword $(MACHINE_UUID) + docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl machine consolepassword $(MACHINE_UUID) .PHONY: password-machine01 password-machine01: @@ -210,7 +210,7 @@ password-machine03: .PHONY: _free-machine _free-machine: env - docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl machine rm $(MACHINE_UUID) + docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl machine rm $(MACHINE_UUID) docker exec vms /mini-lab/manage_vms.py --names $(MACHINE_NAME) kill --with-disks docker exec vms /mini-lab/manage_vms.py --names $(MACHINE_NAME) create From 6d22f23f0663a0e2606803db039a60c146f23e59 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Tue, 17 Sep 2024 09:39:24 +0200 Subject: [PATCH 08/21] remove 3rd machine --- .github/workflows/integration.yaml | 1 + Makefile | 8 ++++---- images/sonic/config_db.json | 8 -------- mini-lab.cumulus.yaml | 2 -- mini-lab.mixed.yaml | 7 ++----- mini-lab.sonic.yaml | 2 -- scripts/manage_vms.py | 9 --------- 7 files changed, 7 insertions(+), 30 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 2f77350c..c6eedba5 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -21,6 +21,7 @@ jobs: flavors: - name: cumulus - name: sonic + - name: mixed steps: - name: Gain back workspace permissions # https://github.com/actions/checkout/issues/211 diff --git a/Makefile b/Makefile index 560c4e66..c186a5b6 100644 --- a/Makefile +++ b/Makefile @@ -178,13 +178,13 @@ restart-metal-core: .PHONY: migrate-cumulus-to-sonic migrate-cumulus-to-sonic: - docker exec vms /mini-lab/migrate.sh tap1 lan1 lan6 - docker exec vms /mini-lab/migrate.sh tap3 lan3 lan7 + docker exec vms /mini-lab/migrate.sh tap1 lan1 lan4 + docker exec vms /mini-lab/migrate.sh tap3 lan3 lan5 .PHONY: migrate-sonic-to-cumulus migrate-sonic-to-cumulus: - docker exec vms /mini-lab/migrate.sh tap1 lan6 lan1 - docker exec vms /mini-lab/migrate.sh tap3 lan7 lan3 + docker exec vms /mini-lab/migrate.sh tap1 lan4 lan1 + docker exec vms /mini-lab/migrate.sh tap3 lan5 lan3 ## MACHINE MANAGEMENT ## diff --git a/images/sonic/config_db.json b/images/sonic/config_db.json index 02977d12..28417a08 100644 --- a/images/sonic/config_db.json +++ b/images/sonic/config_db.json @@ -63,14 +63,6 @@ "admin_status": "up", "mtu": "9100" }, - "Ethernet12": { - "lanes": "37,38,39,40", - "alias": "fortyGigE0/12", - "index": "3", - "speed": "40000", - "admin_status": "up", - "mtu": "9100" - } }, "VERSIONS": { "DATABASE": { diff --git a/mini-lab.cumulus.yaml b/mini-lab.cumulus.yaml index 30e43971..65aaf2ca 100644 --- a/mini-lab.cumulus.yaml +++ b/mini-lab.cumulus.yaml @@ -53,7 +53,5 @@ topology: - endpoints: ["leaf02:swp1", "vms:lan1"] - endpoints: ["leaf01:swp2", "vms:lan2"] - endpoints: ["leaf02:swp2", "vms:lan3"] - - endpoints: ["leaf01:swp3", "vms:lan4"] - - endpoints: ["leaf02:swp3", "vms:lan5"] - endpoints: ["leaf01:swp31", "inet:eth1"] - endpoints: ["leaf02:swp31", "inet:eth2"] diff --git a/mini-lab.mixed.yaml b/mini-lab.mixed.yaml index 3d94570e..0c996d5e 100644 --- a/mini-lab.mixed.yaml +++ b/mini-lab.mixed.yaml @@ -64,14 +64,11 @@ topology: - endpoints: ["leaf01:swp1", "inet:eth1"] - endpoints: ["leaf01:swp2", "vms:lan0"] - endpoints: ["leaf01:swp3", "vms:lan2"] - - endpoints: ["leaf01:swp4", "vms:lan4"] - endpoints: ["leaf02:swp1", "inet:eth2"] - endpoints: ["leaf02:swp2", "vms:lan1"] - endpoints: ["leaf02:swp3", "vms:lan3"] - - endpoints: ["leaf02:swp4", "vms:lan5"] - endpoints: ["leaf02-sonic:eth1", "inet:eth3"] - - endpoints: ["leaf02-sonic:eth2", "vms:lan6"] - - endpoints: ["leaf02-sonic:eth3", "vms:lan7"] - - endpoints: ["leaf02-sonic:eth4", "vms:lan8"] + - endpoints: ["leaf02-sonic:eth2", "vms:lan4"] + - endpoints: ["leaf02-sonic:eth3", "vms:lan5"] diff --git a/mini-lab.sonic.yaml b/mini-lab.sonic.yaml index f9e7f400..a09f8835 100644 --- a/mini-lab.sonic.yaml +++ b/mini-lab.sonic.yaml @@ -57,5 +57,3 @@ topology: - endpoints: ["leaf02:eth2", "vms:lan1"] - endpoints: ["leaf01:eth3", "vms:lan2"] - endpoints: ["leaf02:eth3", "vms:lan3"] - - endpoints: ["leaf01:eth4", "vms:lan4"] - - endpoints: ["leaf02:eth4", "vms:lan5"] diff --git a/scripts/manage_vms.py b/scripts/manage_vms.py index 2f2008cf..0b015ec4 100755 --- a/scripts/manage_vms.py +++ b/scripts/manage_vms.py @@ -25,15 +25,6 @@ "lan_indices": [2, 3], "serial-port": 4001, }, - "machine03": { - "name": "machine03", - "uuid": "2a92f14d-d3b1-4d46-b813-5d058103743e", - "disk-path": "/machine03.img", - "disk-size": "5G", - "memory": "2G", - "lan_indices": [4, 5], - "serial-port": 4002, - }, } From 8ec92c2d22412296fcc91d902387de41ff328bb6 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Tue, 17 Sep 2024 09:48:01 +0200 Subject: [PATCH 09/21] remove remove-orphans flag --- Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index c186a5b6..144780ba 100644 --- a/Makefile +++ b/Makefile @@ -130,24 +130,24 @@ cleanup-partition: .PHONY: _privatenet _privatenet: env - docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network | grep user-private-network || docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network allocate --partition mini-lab --project 00000000-0000-0000-0000-000000000001 --name user-private-network + docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network | grep user-private-network || docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network allocate --partition mini-lab --project 00000000-0000-0000-0000-000000000001 --name user-private-network .PHONY: _public_ips _public_ips: env - docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip list --name firewall | grep firewall || docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip create --network internet-mini-lab --project 00000000-0000-0000-0000-000000000001 --ipaddress 203.0.113.129 --name firewall - docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip list --name machine | grep machine || docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip create --network internet-mini-lab --project 00000000-0000-0000-0000-000000000001 --ipaddress 203.0.113.130 --name machine + docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip list --name firewall | grep firewall || docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip create --network internet-mini-lab --project 00000000-0000-0000-0000-000000000001 --ipaddress 203.0.113.129 --name firewall + docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip list --name machine | grep machine || docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network ip create --network internet-mini-lab --project 00000000-0000-0000-0000-000000000001 --ipaddress 203.0.113.130 --name machine .PHONY: machine machine: _privatenet _public_ips - docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl machine create --description test --name test --hostname test --project 00000000-0000-0000-0000-000000000001 --partition mini-lab --image $(MACHINE_OS) --size v1-small-x86 --userdata "@/tmp/ignition.json" --ips 203.0.113.130 --networks internet-mini-lab,$(shell docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}') + docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl machine create --description test --name test --hostname test --project 00000000-0000-0000-0000-000000000001 --partition mini-lab --image $(MACHINE_OS) --size v1-small-x86 --userdata "@/tmp/ignition.json" --ips 203.0.113.130 --networks internet-mini-lab,$(shell docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}') .PHONY: firewall firewall: _privatenet _public_ips - docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl firewall create --description fw --name fw --hostname fw --project 00000000-0000-0000-0000-000000000001 --partition mini-lab --image firewall-ubuntu-3.0 --size v1-small-x86 --userdata "@/tmp/ignition.json" --ips 203.0.113.129 --firewall-rules-file=/tmp/rules.yaml --networks internet-mini-lab,$(shell docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}') + docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl firewall create --description fw --name fw --hostname fw --project 00000000-0000-0000-0000-000000000001 --partition mini-lab --image firewall-ubuntu-3.0 --size v1-small-x86 --userdata "@/tmp/ignition.json" --ips 203.0.113.129 --firewall-rules-file=/tmp/rules.yaml --networks internet-mini-lab,$(shell docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl network list --name user-private-network -o template --template '{{ .id }}') .PHONY: ls ls: env - docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl machine ls + docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl machine ls ## SWITCH MANAGEMENT ## @@ -194,7 +194,7 @@ start-machines: .PHONY: _password _password: env - docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl machine consolepassword $(MACHINE_UUID) + docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl machine consolepassword $(MACHINE_UUID) .PHONY: password-machine01 password-machine01: @@ -210,7 +210,7 @@ password-machine03: .PHONY: _free-machine _free-machine: env - docker compose run --remove-orphans $(DOCKER_COMPOSE_TTY_ARG) metalctl machine rm $(MACHINE_UUID) + docker compose run $(DOCKER_COMPOSE_TTY_ARG) metalctl machine rm $(MACHINE_UUID) docker exec vms /mini-lab/manage_vms.py --names $(MACHINE_NAME) kill --with-disks docker exec vms /mini-lab/manage_vms.py --names $(MACHINE_NAME) create From 0d5e3cb8912282dd1a44999883f35c9a8a5d9bd9 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Tue, 17 Sep 2024 10:36:07 +0200 Subject: [PATCH 10/21] fix missing vrf for sonic --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 144780ba..921147f2 100644 --- a/Makefile +++ b/Makefile @@ -31,11 +31,12 @@ else ifeq ($(MINI_LAB_FLAVOR),sonic) LAB_MACHINES=machine01,machine02 LAB_TOPOLOGY=mini-lab.sonic.yaml LAB_SWITCHES=leaf01 leaf02 +VRF=Vrf20 else ifeq ($(MINI_LAB_FLAVOR),mixed) LAB_MACHINES=machine01,machine02 LAB_TOPOLOGY=mini-lab.mixed.yaml LAB_SWITCHES=leaf01 leaf02 leaf02-sonic -VRF=Vrf20 +VRF=vrf20 else $(error Unknown flavor $(MINI_LAB_FLAVOR)) endif From ef080bde13ad8b1551950d27a8be87c492c57e29 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Tue, 17 Sep 2024 11:32:34 +0200 Subject: [PATCH 11/21] fix json syntax error --- images/sonic/config_db.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/sonic/config_db.json b/images/sonic/config_db.json index 28417a08..9ce60c98 100644 --- a/images/sonic/config_db.json +++ b/images/sonic/config_db.json @@ -62,7 +62,7 @@ "speed": "40000", "admin_status": "up", "mtu": "9100" - }, + } }, "VERSIONS": { "DATABASE": { From 6848beaf658986af4db7d7f892f1085386a9ef2f Mon Sep 17 00:00:00 2001 From: iljarotar Date: Tue, 17 Sep 2024 11:34:26 +0200 Subject: [PATCH 12/21] formatting --- images/sonic/config_db.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/sonic/config_db.json b/images/sonic/config_db.json index 9ce60c98..3f331b91 100644 --- a/images/sonic/config_db.json +++ b/images/sonic/config_db.json @@ -69,4 +69,4 @@ "VERSION": "version_202311_03" } } -} +} \ No newline at end of file From 43616d3cb3be02c62c541d37acfef0d81ca0295f Mon Sep 17 00:00:00 2001 From: iljarotar Date: Tue, 17 Sep 2024 13:54:43 +0200 Subject: [PATCH 13/21] always pull sonic image --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 921147f2..85f24658 100644 --- a/Makefile +++ b/Makefile @@ -89,9 +89,7 @@ partition: partition-bake .PHONY: partition-bake partition-bake: external_network docker pull $(MINI_LAB_VM_IMAGE) -ifeq ($(MINI_LAB_FLAVOR),sonic) docker pull $(MINI_LAB_SONIC_IMAGE) -endif @if ! sudo $(CONTAINERLAB) --topo $(LAB_TOPOLOGY) inspect | grep -i leaf01 > /dev/null; then \ sudo --preserve-env $(CONTAINERLAB) deploy --topo $(LAB_TOPOLOGY) --reconfigure && \ ./scripts/deactivate_offloading.sh; fi From 56a133f81fee8f3c74d582a92bf63e3cd9db2c85 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Tue, 17 Sep 2024 14:50:28 +0200 Subject: [PATCH 14/21] another try --- images/sonic/config_db.json | 2 +- mini-lab.mixed.yaml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/images/sonic/config_db.json b/images/sonic/config_db.json index 3f331b91..b34fca11 100644 --- a/images/sonic/config_db.json +++ b/images/sonic/config_db.json @@ -55,7 +55,7 @@ "admin_status": "up", "mtu": "9100" }, - "Ethernet8": { + "Ethernet120": { "lanes": "33,34,35,36", "alias": "fortyGigE0/8", "index": "2", diff --git a/mini-lab.mixed.yaml b/mini-lab.mixed.yaml index 0c996d5e..a86d2405 100644 --- a/mini-lab.mixed.yaml +++ b/mini-lab.mixed.yaml @@ -61,14 +61,14 @@ topology: mtu: 9000 - endpoints: ["www:ext", "mini_lab_ext:www"] - - endpoints: ["leaf01:swp1", "inet:eth1"] - - endpoints: ["leaf01:swp2", "vms:lan0"] - - endpoints: ["leaf01:swp3", "vms:lan2"] + - endpoints: ["leaf01:swp1", "vms:lan0"] + - endpoints: ["leaf01:swp2", "vms:lan2"] + - endpoints: ["leaf01:swp31", "inet:eth1"] - - endpoints: ["leaf02:swp1", "inet:eth2"] - - endpoints: ["leaf02:swp2", "vms:lan1"] - - endpoints: ["leaf02:swp3", "vms:lan3"] + - endpoints: ["leaf02:swp1", "vms:lan1"] + - endpoints: ["leaf02:swp2", "vms:lan3"] + - endpoints: ["leaf02:swp31", "inet:eth2"] - - endpoints: ["leaf02-sonic:eth1", "inet:eth3"] - - endpoints: ["leaf02-sonic:eth2", "vms:lan4"] - - endpoints: ["leaf02-sonic:eth3", "vms:lan5"] + - endpoints: ["leaf02-sonic:eth1", "vms:lan4"] + - endpoints: ["leaf02-sonic:eth2", "vms:lan5"] + - endpoints: ["leaf02-sonic:eth31", "inet:eth3"] From 4b7d5f8ef50e3b31aaccff658212b967e9ad1d66 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Tue, 17 Sep 2024 14:57:35 +0200 Subject: [PATCH 15/21] back to previous sonic config --- images/sonic/config_db.json | 2 +- mini-lab.mixed.yaml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/images/sonic/config_db.json b/images/sonic/config_db.json index b34fca11..3f331b91 100644 --- a/images/sonic/config_db.json +++ b/images/sonic/config_db.json @@ -55,7 +55,7 @@ "admin_status": "up", "mtu": "9100" }, - "Ethernet120": { + "Ethernet8": { "lanes": "33,34,35,36", "alias": "fortyGigE0/8", "index": "2", diff --git a/mini-lab.mixed.yaml b/mini-lab.mixed.yaml index a86d2405..1736c258 100644 --- a/mini-lab.mixed.yaml +++ b/mini-lab.mixed.yaml @@ -61,14 +61,14 @@ topology: mtu: 9000 - endpoints: ["www:ext", "mini_lab_ext:www"] - - endpoints: ["leaf01:swp1", "vms:lan0"] - - endpoints: ["leaf01:swp2", "vms:lan2"] + - endpoints: ["leaf01:swp2", "vms:lan0"] + - endpoints: ["leaf01:swp3", "vms:lan2"] - endpoints: ["leaf01:swp31", "inet:eth1"] - - endpoints: ["leaf02:swp1", "vms:lan1"] - - endpoints: ["leaf02:swp2", "vms:lan3"] + - endpoints: ["leaf02:swp2", "vms:lan1"] + - endpoints: ["leaf02:swp3", "vms:lan3"] - endpoints: ["leaf02:swp31", "inet:eth2"] - - endpoints: ["leaf02-sonic:eth1", "vms:lan4"] - - endpoints: ["leaf02-sonic:eth2", "vms:lan5"] - - endpoints: ["leaf02-sonic:eth31", "inet:eth3"] + - endpoints: ["leaf02-sonic:eth2", "vms:lan4"] + - endpoints: ["leaf02-sonic:eth3", "vms:lan5"] + - endpoints: ["leaf02-sonic:eth1", "inet:eth3"] From 6f19254952f5128958ea9086bccb029f978d5492 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Wed, 18 Sep 2024 11:41:45 +0200 Subject: [PATCH 16/21] use Ethernet120 as uplink in sonic --- images/sonic/config_db.json | 2 +- inventories/group_vars/sonic/main.yaml | 2 +- mini-lab.mixed.yaml | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/images/sonic/config_db.json b/images/sonic/config_db.json index 3f331b91..b34fca11 100644 --- a/images/sonic/config_db.json +++ b/images/sonic/config_db.json @@ -55,7 +55,7 @@ "admin_status": "up", "mtu": "9100" }, - "Ethernet8": { + "Ethernet120": { "lanes": "33,34,35,36", "alias": "fortyGigE0/8", "index": "2", diff --git a/inventories/group_vars/sonic/main.yaml b/inventories/group_vars/sonic/main.yaml index 557f9bd3..fddd86ab 100644 --- a/inventories/group_vars/sonic/main.yaml +++ b/inventories/group_vars/sonic/main.yaml @@ -3,7 +3,7 @@ dhcp_listening_interfaces: - Vlan4000 metal_core_spine_uplinks: - - Ethernet0 + - Ethernet120 sonic_docker_routing_config_mode: split-unified sonic_frr_mgmt_framework_config: false diff --git a/mini-lab.mixed.yaml b/mini-lab.mixed.yaml index 1736c258..52b72bc6 100644 --- a/mini-lab.mixed.yaml +++ b/mini-lab.mixed.yaml @@ -61,14 +61,14 @@ topology: mtu: 9000 - endpoints: ["www:ext", "mini_lab_ext:www"] - - endpoints: ["leaf01:swp2", "vms:lan0"] - - endpoints: ["leaf01:swp3", "vms:lan2"] + - endpoints: ["leaf01:swp1", "vms:lan0"] + - endpoints: ["leaf01:swp2", "vms:lan2"] - endpoints: ["leaf01:swp31", "inet:eth1"] - - endpoints: ["leaf02:swp2", "vms:lan1"] - - endpoints: ["leaf02:swp3", "vms:lan3"] + - endpoints: ["leaf02:swp1", "vms:lan1"] + - endpoints: ["leaf02:swp2", "vms:lan3"] - endpoints: ["leaf02:swp31", "inet:eth2"] - - endpoints: ["leaf02-sonic:eth2", "vms:lan4"] - - endpoints: ["leaf02-sonic:eth3", "vms:lan5"] - - endpoints: ["leaf02-sonic:eth1", "inet:eth3"] + - endpoints: ["leaf02-sonic:eth1", "vms:lan4"] + - endpoints: ["leaf02-sonic:eth2", "vms:lan5"] + - endpoints: ["leaf02-sonic:eth3", "inet:eth3"] From 09fb8152e14c56ba524816c157d8749e8950a999 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Wed, 18 Sep 2024 12:02:24 +0200 Subject: [PATCH 17/21] adjust sonic topo --- mini-lab.sonic.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mini-lab.sonic.yaml b/mini-lab.sonic.yaml index a09f8835..cc0f1498 100644 --- a/mini-lab.sonic.yaml +++ b/mini-lab.sonic.yaml @@ -51,9 +51,9 @@ topology: - endpoints: ["inet:ext", "mini_lab_ext:inet"] mtu: 9000 - endpoints: ["www:ext", "mini_lab_ext:www"] - - endpoints: ["leaf01:eth1", "inet:eth1"] - - endpoints: ["leaf02:eth1", "inet:eth2"] - - endpoints: ["leaf01:eth2", "vms:lan0"] - - endpoints: ["leaf02:eth2", "vms:lan1"] - - endpoints: ["leaf01:eth3", "vms:lan2"] - - endpoints: ["leaf02:eth3", "vms:lan3"] + - endpoints: ["leaf01:eth1", "vms:lan0"] + - endpoints: ["leaf02:eth1", "vms:lan1"] + - endpoints: ["leaf01:eth2", "vms:lan2"] + - endpoints: ["leaf02:eth2", "vms:lan3"] + - endpoints: ["leaf01:eth3", "inet:eth1"] + - endpoints: ["leaf02:eth3", "inet:eth2"] From 25a13540a878ee3de63a7ec9abefef152dfc59f3 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Thu, 19 Sep 2024 09:28:34 +0200 Subject: [PATCH 18/21] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 055f8790..2ee593df 100644 --- a/README.md +++ b/README.md @@ -209,7 +209,7 @@ make # Switch migration The strategy for migrating a Cumulus rack to SONiC without downtime involves migrating one switch first creating a mixed setup with Cumulus and SONiC running alongside each other and then migrating the second one. -To simulate the first half of this procdure in the mini-lab, the following steps are performed: +To simulate the first half of this procedure in the mini-lab, the following steps are performed: - start the mini-lab with the `mixed` flavor. - run `eval $(make dev-env)` to get access to the lab via `metalctl`. From 5d4e412a81420173e9d9b52e9903713dc3697021 Mon Sep 17 00:00:00 2001 From: iljarotar Date: Mon, 23 Sep 2024 11:33:28 +0200 Subject: [PATCH 19/21] metal-api override --- inventories/group_vars/all/images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventories/group_vars/all/images.yaml b/inventories/group_vars/all/images.yaml index 86b83341..34a7772f 100644 --- a/inventories/group_vars/all/images.yaml +++ b/inventories/group_vars/all/images.yaml @@ -7,7 +7,7 @@ metal_stack_release_version: develop # metal_hammer_image_url: https://images.metal-stack.io/metal-hammer/pull-requests//metal-hammer-initrd.img.lz4 # metal_api_image_name: -# metal_api_image_tag: +metal_api_image_tag: switch-migrate # metal_metalctl_image_name: # metal_metalctl_image_tag: # metal_masterdata_api_image_name: From 4255fefd58248361f2d66390d7c389e5405fe57c Mon Sep 17 00:00:00 2001 From: iljarotar Date: Mon, 23 Sep 2024 13:33:54 +0200 Subject: [PATCH 20/21] adapt port config --- images/sonic/config_db.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/images/sonic/config_db.json b/images/sonic/config_db.json index b34fca11..f185025e 100644 --- a/images/sonic/config_db.json +++ b/images/sonic/config_db.json @@ -41,25 +41,25 @@ "PORT": { "Ethernet0": { "lanes": "25,26,27,28", - "alias": "fortyGigE0/0", - "index": "0", - "speed": "40000", + "alias": "Eth1/1(Port1)", + "index": "1", + "speed": "25000", "admin_status": "up", "mtu": "9100" }, "Ethernet4": { "lanes": "29,30,31,32", - "alias": "fortyGigE0/4", - "index": "1", - "speed": "40000", + "alias": "Eth2/1(Port2)", + "index": "2", + "speed": "25000", "admin_status": "up", "mtu": "9100" }, "Ethernet120": { "lanes": "33,34,35,36", - "alias": "fortyGigE0/8", - "index": "2", - "speed": "40000", + "alias": "Eth31(Port31)", + "index": "31", + "speed": "100000", "admin_status": "up", "mtu": "9100" } From e033e9c8554083b6d6a978f01374a64df7308adc Mon Sep 17 00:00:00 2001 From: iljarotar Date: Thu, 17 Oct 2024 15:58:43 +0200 Subject: [PATCH 21/21] formatting --- README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ec26e8b3..cb89ce3f 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ The mini-lab is a small, virtual setup to locally run the metal-stack. It deploy - [Requirements](#requirements) - [Known Limitations](#known-limitations) - [Try it out](#try-it-out) - - [Reinstall machine](#reinstall-machine) - - [Free machine](#free-machine) + - [Reinstall machine](#reinstall-machine) + - [Free machine](#free-machine) - [Flavors](#flavors) @@ -29,7 +29,7 @@ The mini-lab is a small, virtual setup to locally run the metal-stack. It deploy Here is some code that should help you to set up most of the requirements: - ```bash +```bash # If UFW enabled. # Disable the firewall or allow traffic through Docker network IP range. sudo ufw status @@ -58,11 +58,11 @@ sudo chmod +x /usr/local/bin/kind The following ports are used statically on your host machine: | Port | Bind Address | Description | -|:----:|:------------ |:---------------------------------- | -| 6443 | 0.0.0.0 | kube-apiserver of the kind cluster | -| 4443 | 0.0.0.0 | HTTPS ingress | -| 4150 | 0.0.0.0 | nsqd | -| 8080 | 0.0.0.0 | HTTP ingress | +| :--: | :----------- | :--------------------------------- | +| 6443 | 0.0.0.0 | kube-apiserver of the kind cluster | +| 4443 | 0.0.0.0 | HTTPS ingress | +| 4150 | 0.0.0.0 | nsqd | +| 8080 | 0.0.0.0 | HTTP ingress | ## Known Limitations @@ -111,7 +111,7 @@ make firewall make machine ``` -__Alternatively__, you may want to issue the `metalctl` commands on your own: +**Alternatively**, you may want to issue the `metalctl` commands on your own: ```bash docker compose run --rm metalctl network allocate \ @@ -199,7 +199,6 @@ There are three versions, or flavors, of the mini-lab environment which differ i - `sonic` -- runs 2 SONiC switches - `mixed` -- starts 2 Cumulus switches and one SONiC switch, where the SONiC switch is not connected to any machines yet. Read the `Switch migration` section to see how this setup can be used to simulate switch migration from Cumulus to SONiC or vice versa. - In order to start specific flavor, you can define the flavor as follows: ```bash