Skip to content

Commit 17a6c34

Browse files
committed
OSDOCS-16201-RE: Documented migrating a br-ex interface to NMState
1 parent b4e9302 commit 17a6c34

File tree

4 files changed

+135
-2
lines changed

4 files changed

+135
-2
lines changed

installing/installing_bare_metal/bare-metal-postinstallation-configuration.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ include::modules/creating-manifest-file-customized-br-ex-bridge.adoc[leveloffset
3636
// Making disruptive changes to a customized br-ex bridge
3737
include::modules/making-disruptive-changes-br-ex-bridge.adoc[leveloffset=+1]
3838

39+
// Migrating a configured br-ex bridge to NMState
40+
include::modules/migrating-br-ex-bridge-nmstate.adoc[leveloffset=+1]
41+
42+
[role="_additional-resources"]
43+
.Additional resources
44+
45+
* xref:../installing_bare_metal/ipi/ipi-install-installation-workflow.adoc#creating-manifest-file-customized-br-ex-bridge_ipi-install-installation-workflow[Installer-provisioned infrastructure: Creating a manifest object that includes a customized `br-ex` bridge]
46+
47+
* xref:../../installing/installing_bare_metal/upi/installing-bare-metal.adoc#creating-manifest-file-customized-br-ex-bridge_installing-bare-metal[User-provisioned infrastructure: Creating a manifest object that includes a customized `br-ex` bridge]
48+
3949
// Services for a user-managed load balancer
4050
include::modules/nw-osp-services-external-load-balancer.adoc[leveloffset=+1]
4151

modules/creating-manifest-file-customized-br-ex-bridge.adoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ endif::postinstall-bare-metal[]
8181
.Procedure
8282

8383
ifndef::postinstall-bare-metal[]
84-
. Create a NMState configuration file that has decoded base64 information for your customized `br-ex` bridge network:
84+
. Create an NMState configuration file and define a customized `br-ex` bridge network configuration in the file:
8585
+
8686
.Example of an NMState configuration for a customized `br-ex` bridge network
8787
[source,yaml]
@@ -182,6 +182,13 @@ If you have a single global configuration specified in an `/etc/nmstate/openshif
182182
path: /etc/nmstate/openshift/cluster.yml
183183
# ...
184184
----
185+
186+
. Apply the updates from the `MachineConfig` object to your cluster by entering the following command:
187+
+
188+
[source,terminal]
189+
----
190+
$ oc apply -f <machine_config>.yml
191+
----
185192
endif::postinstall-bare-metal[]
186193

187194
ifdef::postinstall-bare-metal[]

modules/making-disruptive-changes-br-ex-bridge.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ $ base64 -w0 <nmstate_configuration>.yml <1>
4848
$ oc apply -f <machine_config>.yml
4949
----
5050

51-
. Create a bare `MachineConfig` object but do not make any configuration changes to the file.
51+
. Create a bare `MachineConfig` object but do not make any configuration changes to the file:
5252
+
5353
[source,yaml]
5454
----
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * installing/installing_bare_metal/bare-metal-postinstallation-configuration.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="migrating-br-ex-bridge-nmstate_{context}"]
7+
= Migrating a configured br-ex bridge to NMState
8+
9+
If you used the `configure-ovs.sh` shell script to set a `br-ex` bridge during cluster installation, you can migrate the `br-ex` bridge to NMState as a postinstallation task. NMState provides a declarative and idempotent way to handle configuring the `br-ex` bridge.
10+
11+
[NOTE]
12+
====
13+
The initial steps in the procedure do not show example configurations. For detailed example configurations that would represent objects to create during cluster installation, see the "Creating a manifest object that includes a customized br-ex bridge" link in the _Additional resources_ section.
14+
====
15+
16+
After you migrate your configured `br-ex` bridge to NMState, you cannot reverse the operation. This means that you cannot migrate back to the shell script version of the `br-ex` bridge.
17+
18+
[IMPORTANT]
19+
====
20+
Misconfiguring any files that form part of the migration operation can cause disruptive changes to your cluster. Reverting these changes might not always be possible.
21+
====
22+
23+
.Prerequisties
24+
25+
* You used the `configure-ovs.sh` shell script to set a `br-ex` bridge for your cluster.
26+
27+
.Procedure
28+
29+
. Create an NMState configuration file for your customized `br-ex` bridge network. In a later step, the `MachineConfig` object saves the NMState configuration file in the `/etc/nmstate/openshift` directory path.
30+
31+
. Use the `cat` command to base64-encode the contents of the NMState configuration file:
32+
+
33+
[source,terminal]
34+
----
35+
$ cat <nmstate_configuration>.yaml | base64
36+
----
37+
+
38+
--
39+
where:
40+
41+
`<nmstate_configuration>`:: Specifies `<nmstate_configuration>` with the name of your NMState resource YAML file.
42+
--
43+
44+
. Create a `MachineConfig` manifest file and define a customized `br-ex` bridge network configuration in the file. Additionally, ensure that you specify the path to the base64-encoded NMState configuration file so that the contents of this file get embedded in the `MachineConfig` manifest file.
45+
46+
. Apply the updates from the `MachineConfig` object to your cluster by entering the following command:
47+
+
48+
[source,terminal]
49+
----
50+
$ oc apply -f <machine_config>.yml
51+
----
52+
53+
. Create a bare `MachineConfig` object but do not make any configuration changes to the file:
54+
+
55+
[source,yaml]
56+
----
57+
apiVersion: machineconfiguration.openshift.io/v1
58+
kind: MachineConfig
59+
metadata:
60+
labels:
61+
machineconfiguration.openshift.io/role: master
62+
name: 10-force-reboot-master
63+
spec:
64+
config:
65+
ignition:
66+
version: 3.2.0
67+
storage:
68+
files:
69+
- contents:
70+
source: data:text/plain;charset=utf-8;base64,
71+
mode: 0644
72+
overwrite: true
73+
path: /etc/force-reboot
74+
---
75+
apiVersion: machineconfiguration.openshift.io/v1
76+
kind: MachineConfig
77+
metadata:
78+
labels:
79+
machineconfiguration.openshift.io/role: worker
80+
name: 10-force-reboot-worker
81+
spec:
82+
config:
83+
ignition:
84+
version: 3.2.0
85+
storage:
86+
files:
87+
- contents:
88+
source: data:text/plain;charset=utf-8;base64,
89+
mode: 0644
90+
overwrite: true
91+
path: /etc/force-reboot
92+
# ...
93+
----
94+
95+
. Start a reboot operation by applying the bare `MachineConfig` object configuration to your cluster by entering the following command:
96+
+
97+
[source,terminal]
98+
----
99+
$ oc apply -f <bare_machine_config>.yml
100+
----
101+
102+
. Delete the bare `MachineConfig` object by entering the following command:
103+
+
104+
[source,terminal]
105+
----
106+
$ oc delete machineconfig <machine_config_name>
107+
----
108+
109+
.Verification
110+
111+
* Use the `nmstatectl` tool to check the configuration for the `br-ex` bridge interface by running the following command. The tool checks a node that runs the `br-ex` bridge interface and not the location where you deployed the `MachineConfig` objects.
112+
+
113+
[source,terminal]
114+
----
115+
$ sudo nmstatectl show br-ex
116+
----

0 commit comments

Comments
 (0)