Skip to content

Commit 5749929

Browse files
committed
VeOS Switch
1 parent 2f3f92e commit 5749929

19 files changed

Lines changed: 2762 additions & 2 deletions

ci/nmstate_validate.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -x
4+
5+
if ! command -v nmstatectl; then
6+
echo "nmstatectl is not installed"
7+
exit 0
8+
fi
9+
10+
if ! command -v yq; then
11+
echo "yq is not installed"
12+
exit 0
13+
fi
14+
15+
for document_idx in $(yq '.spec.desiredState | document_index' "$1" | grep -v "\---")
16+
do
17+
yq ".spec.desiredState | select(document_index == $document_idx)" "$1" | nmstatectl -q validate --
18+
done

scenarios/sno-nxsw/heat_template.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
heat_template_version: rocky
33

4-
description: >
5-
Heat template to set up SNO (Single Node OpenShift) infrastructure, 1x Controller, 1x OCP Master (no ironic nodes)
4+
description: |
5+
Heat template to set up SNO (Single Node OpenShift) infrastructure,
6+
1x Controller, 1x OCP Master, 1x Switch, 2x Ironic nodes
67
78
parameters:
89
dns_servers:

scenarios/sno-veos/README.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# SNO-NXSW Scenario
2+
3+
## Overview
4+
5+
The `sno-veos` scenario is a Single Node OpenShift (SNO) deployment scenario
6+
for HotStack that deploys OpenStack on OpenShift with ironic bare metal
7+
provisioning capabilities and network switch integration.
8+
9+
## Architecture
10+
11+
This scenario provisions:
12+
13+
- **1x Controller Node**: Management and DNS/DHCP services
14+
- **1x OpenShift Master Node**: Single node OpenShift cluster running OpenStack services
15+
- **1x Switch Node**: vEOS Lab switch with trunk ports for tenant VLAN networks
16+
- **2x Ironic Nodes**: Virtual bare metal nodes for testing Ironic provisioning workflows
17+
18+
## Features
19+
20+
- **Complete OpenStack Stack**: Full OpenStack deployment with ironic bare
21+
metal service
22+
- **Network Switch Integration**: Automated switch configuration with
23+
Zero Prov (??? Arista vEOS) and NGS (Networking Generic Switch)
24+
- **Complete Networking**: All OpenStack service networks with dedicated
25+
ironic networks
26+
- **SNO Deployment**: Single node OpenShift optimized for OpenStack services
27+
- **Development Ready**: Ideal for testing and development environments
28+
- **Bare Metal Provisioning**: Ironic service with 2 nodes for testing bare
29+
metal workflows
30+
31+
## Networks
32+
33+
- **machine-net**: 192.168.32.0/24 - External access network
34+
- **ctlplane-net**: 192.168.122.0/24 - Control plane network
35+
- **internal-api-net**: 172.17.0.0/24 - OpenStack internal API network
36+
- **storage-net**: 172.18.0.0/24 - Storage network
37+
- **tenant-net**: 172.19.0.0/24 - Tenant network for OpenStack workloads
38+
- **ironic-net**: 172.20.1.0/24 - Ironic network for bare metal provisioning
39+
- **tenant-vlan103**: 172.20.3.0/24 - Tenant VLAN network (VLAN 103)
40+
- **tenant-vlan104**: 172.20.4.0/24 - Tenant VLAN network (VLAN 104)
41+
- **ironic0-br-net**: 172.20.5.0/29 - Ironic0 bridge network
42+
- **ironic1-br-net**: 172.20.5.8/29 - Ironic1 bridge network
43+
44+
## Switch Instance Configuration
45+
46+
The switch instance provides network switching capabilities with the following
47+
interface configuration:
48+
49+
### Network Interface Summary
50+
51+
```text
52+
Switch Instance:
53+
├── eth0: machine-net (management interface)
54+
├── eth1: trunk (ironic:101, tenant-vlan103:103, tenant-vlan104:104)
55+
├── eth2: ironic0-br-net (ironic bridge network)
56+
└── eth3: ironic1-br-net (ironic bridge network)
57+
```
58+
59+
### VLAN Mapping
60+
61+
- **VLAN 101**: ironic (172.20.1.0/24)
62+
- **VLAN 102**: Default native VLAN
63+
- **VLAN 103**: tenant-vlan103 (172.20.3.0/24)
64+
- **VLAN 104**: tenant-vlan104 (172.20.4.0/24)
65+
66+
The switch uses the `nxsw` image and provides dual trunk ports for redundancy
67+
and high availability.
68+
69+
### POAP (Power-On Auto Provisioning)
70+
71+
POAP is a Cisco NX-OS feature that automates the initial configuration of
72+
network switches. When the switch boots up, it automatically:
73+
74+
1. **Downloads Configuration**: Fetches the switch configuration from a
75+
TFTP/HTTP server
76+
2. **Applies Settings**: Automatically configures interfaces, VLANs, and
77+
network settings
78+
3. **Enables Services**: Activates required network services (NETCONF, LACP, LLDP)
79+
4. **Validates Setup**: Performs integrity checks using MD5 checksums
80+
81+
In this scenario, POAP enables zero-touch deployment of the NX-OS switch with pre-configured:
82+
83+
- **Interface Configuration**: Trunk and access ports for tenant VLANs
84+
- **VLAN Setup**: VLANs for network segmentation
85+
- **Management Settings**: IP addressing, DNS, and routing configuration
86+
- **Security**: User accounts and access control
87+
88+
## Ironic Nodes
89+
90+
The scenario includes 2 virtual bare metal nodes for testing Ironic provisioning:
91+
92+
### Ironic Node 0
93+
94+
- **Network**: ironic0-br-net (172.20.5.0/29)
95+
- **Purpose**: Bare metal provisioning testing
96+
- **Configuration**: Virtual media boot capable with sushy-tools
97+
98+
### Ironic Node 1
99+
100+
- **Network**: ironic1-br-net (172.20.5.8/29)
101+
- **Purpose**: Bare metal provisioning testing
102+
- **Configuration**: Virtual media boot capable with sushy-tools
103+
104+
## Usage
105+
106+
This scenario is ideal for:
107+
108+
- Testing OpenStack deployments with neutron ML2 plugins
109+
- Validating bare metal provisioning workflows with Ironic
110+
- Network switch integration testing with OpenStack
111+
- Development and testing of networking-generic-switch functionality
112+
113+
## Files
114+
115+
- `bootstrap_vars.yml`: Main configuration variables
116+
- `heat_template.yaml`: OpenStack Heat template for infrastructure
117+
- `automation-vars.yml`: Automation pipeline definition
118+
- `manifests/`: OpenShift/Kubernetes manifests
119+
- `test-operator/`: Test automation configuration
120+
121+
## Upload switch image to cloud
122+
123+
```bash
124+
openstack image create vEOS-lab-4.34.1F \
125+
--disk-format qcow2 \
126+
--file vEOS-lab-4.34.1F.qcow2 \
127+
--property hw_video_model=none
128+
```
129+
130+
## Deployment
131+
132+
Follow the standard HotStack deployment process with this scenario by setting
133+
the scenario name to `sno-veos` in your deployment configuration.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
stages:
3+
- name: Dependencies
4+
stages: >-
5+
{{
6+
lookup("ansible.builtin.template",
7+
"common/stages/deps-stages.yaml.j2")
8+
}}
9+
10+
- name: Cinder LVM
11+
stages: >-
12+
{{
13+
lookup("ansible.builtin.file",
14+
"common/stages/cinder-lvm-label-stages.yaml")
15+
}}
16+
17+
- name: TopoLVM
18+
stages: >-
19+
{{
20+
lookup("ansible.builtin.template",
21+
"common/stages/topolvm-stages.yaml.j2")
22+
}}
23+
24+
- name: OLM Openstack
25+
stages: >-
26+
{{
27+
lookup("ansible.builtin.template",
28+
"common/stages/olm-openstack-stages.yaml.j2")
29+
}}
30+
31+
- name: NodeNetworkConfigurationPolicy (nncp)
32+
manifest: manifests/networking/nncp.yaml
33+
wait_conditions:
34+
- >-
35+
oc wait -n openstack nncp -l osp/nncm-config-type=standard
36+
--for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured
37+
--timeout=180s
38+
39+
- name: NetworkAttchmentDefinition (NAD)
40+
manifest: manifests/networking/nad.yaml
41+
42+
- name: MetalLB - L2Advertisement and IPAddressPool
43+
manifest: manifests/networking/metallb.yaml
44+
45+
- name: Netconfig
46+
manifest: manifests/networking/netconfig.yaml
47+
48+
- name: NGS config (Networking Generic Switch)
49+
manifest: manifests/ngs/config.yaml
50+
wait_conditions:
51+
- >-
52+
oc wait -n openstack secret neutron-switch-config
53+
--for jsonpath='{.metadata.name}'=neutron-switch-config
54+
--timeout=30s
55+
56+
- name: Openstack Version
57+
manifest: manifests/openstack-version.yaml
58+
patches:
59+
- path: spec.customContainerImages
60+
value: "{{ customContainerImages }}"
61+
wait_conditions:
62+
- >-
63+
oc wait -n openstack openstackversions.core.openstack.org controlplane
64+
--for condition=Initialized --timeout=30m
65+
run_conditions:
66+
- >-
67+
{{ customContainerImages is defined and customContainerImages | length > 0 }}
68+
69+
- name: OpenstackControlPlane
70+
manifest: manifests/control-plane.yaml
71+
wait_conditions:
72+
- >-
73+
oc wait -n openstack openstackcontrolplane controlplane
74+
--for condition=Ready --timeout=30m
75+
76+
- name: Update openstack-operators OLM
77+
stages: >-
78+
{{
79+
lookup('ansible.builtin.template',
80+
'common/stages/openstack-olm-update.yaml.j2')
81+
}}
82+
run_conditions:
83+
- >-
84+
{{
85+
openstack_operators_update is defined and
86+
openstack_operators_update | bool
87+
}}
88+
89+
- name: Wait for condition MinorUpdateAvailable True
90+
wait_conditions:
91+
- >-
92+
oc -n openstack wait openstackversions.core.openstack.org controlplane
93+
--for=condition=MinorUpdateAvailable=True --timeout=10m
94+
run_conditions:
95+
- "{{ openstack_update is defined and openstack_update | bool }}"
96+
97+
- name: "Minor update :: Create OpenStackVersion patch"
98+
documentation: |
99+
This creates a patch file `{{ manifests_dir }}/patches/openstack_version_patch.yaml`
100+
If `openstack_update_custom_images` is defined it will populate the customContainerImages
101+
in the OpenstackVersion YAML patch.
102+
shell: >-
103+
{{
104+
lookup('ansible.builtin.template',
105+
'common/scripts/create_openstack_version_patch.sh.j2')
106+
}}
107+
run_conditions:
108+
- "{{ openstack_update is defined and openstack_update | bool }}"
109+
110+
- name: "Minor update :: Update the target version in the OpenStackVersion custom resource (CR)"
111+
documentation: |
112+
The `hotstack-openstack-version-patch` script will get the `availableVersion`
113+
and us it to replace the string `__TARGET_VERSION__` in the patch file and
114+
apply the patch using `oc patch` command.
115+
command: >-
116+
hotstack-openstack-version-patch --namespace openstack --name controlplane
117+
--file {{ manifests_dir }}/patches/openstack_version_patch.yaml
118+
wait_conditions:
119+
- oc -n openstack wait openstackversions.core.openstack.org controlplane
120+
--for=condition=Ready --timeout=10m
121+
run_conditions:
122+
- "{{ openstack_update is defined and openstack_update | bool }}"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
os_cloud: default
3+
os_floating_network: public
4+
os_router_external_network: public
5+
6+
controller_ssh_pub_key: "{{ lookup('ansible.builtin.file', '~/.ssh/id_rsa.pub') }}"
7+
8+
scenario: sno-veos
9+
scenario_dir: scenarios
10+
stack_template_path: "{{ scenario_dir }}/{{ scenario }}/heat_template.yaml"
11+
automation_vars_file: "{{ scenario_dir }}/{{ scenario }}/automation-vars.yml"
12+
test_operator_automation_vars_file: "{{ scenario_dir }}/{{ scenario }}/test-operator/automation-vars.yml"
13+
14+
openstack_operators_image: quay.io/openstack-k8s-operators/openstack-operator-index:latest
15+
openstack_operator_channel: alpha
16+
openstack_operator_starting_csv: null
17+
18+
openshift_version: stable-4.18
19+
20+
ntp_servers: []
21+
dns_servers:
22+
- 8.8.8.8
23+
- 8.8.4.4
24+
25+
pull_secret_file: ~/pull-secret.txt
26+
27+
ovn_k8s_gateway_config_host_routing: true
28+
enable_iscsi: true
29+
enable_multipath: true
30+
31+
cinder_volume_pvs:
32+
- /dev/vdc
33+
- /dev/vdd
34+
- /dev/vde
35+
36+
stack_name: "hs-{{ scenario }}-{{ zuul.build[:8] | default('no-zuul') }}"
37+
stack_parameters:
38+
# On misconfigured clouds, uncomment these to avoid issues.
39+
# Ref: https://access.redhat.com/solutions/7059376
40+
# net_value_specs:
41+
# mtu: 1442
42+
dns_servers: "{{ dns_servers }}"
43+
ntp_servers: "{{ ntp_servers }}"
44+
controller_ssh_pub_key: "{{ controller_ssh_pub_key }}"
45+
router_external_network: "{{ os_router_external_network | default('public') }}"
46+
floating_ip_network: "{{ os_floating_network | default('public') }}"
47+
controller_params:
48+
image: hotstack-controller
49+
flavor: hotstack.small
50+
ocp_master_params:
51+
image: ipxe-boot-usb
52+
flavor: hotstack.xxlarge
53+
switch_params:
54+
image: vEOS64-lab-4.34.1F
55+
flavor: hotstack.large
56+
ironic_params:
57+
image: CentOS-Stream-GenericCloud-9
58+
cd_image: sushy-tools-blank-image
59+
flavor: hotstack.medium
60+
61+
customContainerImages:
62+
neutronAPIImage: quay.io/steveb/openstack-neutron-server:18.0.9-2.1751380459-ngs

0 commit comments

Comments
 (0)