|
| 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