Skip to content

Commit 7f108fa

Browse files
committed
OSDOCS-12623: Documented the Ansible playbook offline migration method
1 parent 5e2449e commit 7f108fa

File tree

4 files changed

+210
-11
lines changed

4 files changed

+210
-11
lines changed
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/ovn_kubernetes_network_provider/migrate-from-openshift-sdn.adoc
4+
// * networking/ovn_kubernetee_network_provider/rollback-to-openshift-sdn.adoc
5+
6+
ifeval::["{context}" == "rollback-to-openshift-sdn"]
7+
:rollback:
8+
endif::[]
9+
10+
:_mod-docs-content-type: PROCEDURE
11+
ifndef::rollback[]
12+
[id="nw-ovn-kubernetes-ansible-migration-about_{context}"]
13+
= Using an Ansible playbook to migrate to the OVN-Kubernetes network plugin
14+
15+
As a cluster administrator, you can use an Ansible collection, `network.offline_migration_sdn_to_ovnk`, to migrate from the OpenShift SDN Container Network Interface (CNI) network plugin to the OVN-Kubernetes plugin for your cluster. The Ansible collection includes the following playbooks:
16+
17+
* `playbooks/playbook-migration.yml`: Includes playbooks that execute in a sequence where each playbook represents a step in the migration process.
18+
* `playbooks/playbook-rollback.yml`: Includes playbooks that execute in a sequence where each playbook represents a step in the rollback process.
19+
endif::rollback[]
20+
21+
ifdef::rollback[]
22+
[id="nw-ovn-kubernetes-ansible-rollback_{context}"]
23+
= Using an Ansible playbook to roll back to the OpenShift SDN network plugin
24+
25+
As a cluster administrator, you can use the `playbooks/playbook-rollback.yml` from the `network.offline_migration_sdn_to_ovnk` Ansible collection to roll back from the OVN-Kubernetes plugin to the OpenShift SDN Container Network Interface (CNI) network plugin.
26+
endif::rollback[]
27+
28+
.Prerequisites
29+
30+
* You installed the `python3` package, minimum version 3.10.
31+
* You installed the `jmespath` and `jq` packages.
32+
* You logged in to the {hybrid-console} and opened the link:https://console.redhat.com/ansible/ansible-dashboard[Ansible Automation Platform] web console.
33+
* You created a security group rule that allows User Datagram Protocol (UDP) packets on port `6081` for all nodes on all cloud platforms. If you do not do this task, your cluster might fail to schedule pods.
34+
ifndef::rollback[]
35+
* If the OpenShift-SDN plugin uses the `100.64.0.0/16` and `100.88.0.0/16` address ranges, you patched the address ranges. For more information, see "Patching OVN-Kubernetes address ranges" in the _Additional resources_ section.
36+
endif::rollback[]
37+
38+
.Procedure
39+
40+
. Install the `ansible-core` package, minimum version 2.15. The following example command shows how to install the `ansible-core` package on {op-system-base-full}:
41+
+
42+
[source,terminal]
43+
----
44+
$ sudo dnf install -y ansible-core
45+
----
46+
47+
. Create an `ansible.cfg` file and add information similar to the following example to the file. Ensure that file exists in the same directory as where the `ansible-galaxy` commands and the playbooks run.
48+
+
49+
[source,ini,subs="attributes+"]
50+
----
51+
$ cat << EOF >> ansible.cfg
52+
[galaxy]
53+
server_list = automation_hub, validated
54+
55+
[galaxy_server.automation_hub]
56+
url=https://console.redhat.com/api/automation-hub/content/published/
57+
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
58+
token=
59+
60+
#[galaxy_server.release_galaxy]
61+
#url=https://galaxy.ansible.com/
62+
63+
[galaxy_server.validated]
64+
url=https://console.redhat.com/api/automation-hub/content/validated/
65+
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
66+
token=
67+
EOF
68+
----
69+
70+
. From the Ansible Automation Platform web console, go to the link:https://console.redhat.com/ansible/automation-hub/token/[Connect to Hub] page and complete the following steps:
71+
+
72+
.. In the *Offline token* section of the page, click the *Load token* button.
73+
+
74+
.. After the token loads, click the *Copy to clipboard* icon.
75+
+
76+
.. Open the `ansible.cfg` file and paste the API token in the `token=` parameter. The API token is required for authenticating against the server URL specified in the `ansible.cfg` file.
77+
78+
. Install the `network.offline_migration_sdn_to_ovnk` Ansible collection by entering the following `ansible-galaxy` command:
79+
+
80+
[source,terminal]
81+
----
82+
$ ansible-galaxy collection install network.offline_migration_sdn_to_ovnk
83+
----
84+
85+
. Verify that the `network.offline_migration_sdn_to_ovnk` Ansible collection is installed on your system:
86+
+
87+
[source,terminal]
88+
----
89+
$ ansible-galaxy collection list | grep network.offline_migration_sdn_to_ovnk
90+
----
91+
+
92+
.Example output
93+
+
94+
[source,terminal]
95+
----
96+
network.offline_migration_sdn_to_ovnk 1.0.2
97+
----
98+
+
99+
The `network.offline_migration_sdn_to_ovnk` Ansible collection is saved in the default path of `~/.ansible/collections/ansible_collections/network/offline_migration_sdn_to_ovnk/`.
100+
+
101+
ifndef::rollback[]
102+
. Configure migration features in the `playbooks/playbook-migration.yml` file:
103+
+
104+
[source,yaml]
105+
----
106+
# ...
107+
migration_interface_name: eth0
108+
migration_disable_auto_migration: true
109+
migration_egress_ip: false
110+
migration_egress_firewall: false
111+
migration_multicast: false
112+
migration_mtu: 1400
113+
migration_geneve_port: 6081
114+
migration_ipv4_subnet: "100.64.0.0/16"
115+
# ...
116+
----
117+
+
118+
`migration_interface_name`:: If you use an `NodeNetworkConfigurationPolicy` (NNCP) resource on a primary interface, specify the interface name in the `migration-playbook.yml` file so that the NNCP resource gets deleted on the primary interface during the migration process.
119+
`migration_disable_auto_migration`:: Disables the auto-migration of OpenShift SDN CNI plug-in features to the OVN-Kubernetes plugin. If you disable auto-migration of features, you must also set the `migration_egress_ip`, `migration_egress_firewall`, and `migration_multicast` parameters to `false`. If you need to enable auto-migration of features, set the parameter to `false`.
120+
`migration_mtu`:: Optional parameter that sets a specific maximum transmission unit (MTU) to your cluster network after the migration process.
121+
`migration_geneve_port`:: Optional parameter that sets a Geneve port for OVN-Kubernetes. The default port is `6081`.
122+
`migration_ipv4_subnet`:: Optional parameter that sets an IPv4 address range for internal use by OVN-Kubernetes. The default value for the parameter is `100.64.0.0/16`.
123+
124+
. To run the `playbooks/playbook-migration.yml` file, enter the following command:
125+
+
126+
[source,terminal]
127+
----
128+
$ ansible-playbook -v playbooks/playbook-migration.yml
129+
----
130+
endif::rollback[]
131+
ifdef::rollback[]
132+
. Configure rollback features in the `playbooks/playbook-migration.yml` file:
133+
+
134+
[source,terminal]
135+
----
136+
# ...
137+
rollback_disable_auto_migration: true
138+
rollback_egress_ip: false
139+
rollback_egress_firewall: false
140+
rollback_multicast: false
141+
rollback_mtu: 1400
142+
rollback_vxlanPort: 4790
143+
# ...
144+
----
145+
+
146+
`rollback_disable_auto_migration`:: Disables the auto-migration of OVN-Kubernetes plug-in features to the OpenShift SDN CNI plug-in. If you disable auto-migration of features, you must also set the `rollback_egress_ip`, `rollback_egress_firewall`, and `rollback_multicast` parameters to `false`. If you need to enable auto-migration of features, set the parameter to `false`.
147+
`rollback_mtu`:: Optional parameter that sets a specific maximum transmission unit (MTU) to your cluster network after the migration process.
148+
`rollback_vxlanPort`:: Optional parameter that sets a VXLAN (Virtual Extensible LAN) port for use by OpenShift SDN CNI plug-in. The default value for the parameter is `4790`.
149+
150+
. To run the `playbooks/playbook-rollback.yml` file, enter the following command:
151+
+
152+
[source,terminal]
153+
----
154+
$ ansible-playbook -v playbooks/playbook-rollback.yml
155+
----
156+
endif::rollback[]
157+
158+
ifeval::["{context}" == "rollback-to-openshift-sdn"]
159+
:!rollback:
160+
endif::[]

modules/nw-ovn-kubernetes-migration-about.adoc

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
[id="nw-ovn-kubernetes-migration-about_{context}"]
66
= Offline migration to the OVN-Kubernetes network plugin overview
77

8-
The offline migration method is a manual process that includes some downtime, during which your cluster is unreachable. This method is primarily used for self-managed {product-title} deployments, and is an alternative to the limited live migration procedure. It should be used in the event that you cannot perform a limited live migration to the OVN-Kubernetes network plugin.
8+
The offline migration method is a manual process that includes some downtime, during which your cluster is unreachable. You can use an Ansible playbook that automates the offline migration steps so that you can save time. These methods are primarily used for self-managed {product-title} deployments, and are an alternative to the limited live migration procedure. Use these methods only when you cannot perform a limited live migration to the OVN-Kubernetes network plugin.
99

1010
[IMPORTANT]
1111
====
1212
Before you migrate your {product-title} cluster to use the OVN-Kubernetes network plugin, update your cluster to the latest z-stream release so that all the latest bug fixes apply to your cluster.
1313
====
1414

15-
Although a rollback procedure is provided, the offline migration is intended to be a one-way process.
15+
Although a rollback procedure is provided, the offline migration methods are intended as one-way processes.
1616

1717
////
1818
[IMPORTANT]
@@ -25,14 +25,14 @@ include::snippets/sdn-deprecation-statement.adoc[]
2525
The following sections provide more information about the offline migration method.
2626

2727
[id="supported-platforms-offline-migrating-ovn-kubernetes"]
28-
== Supported platforms when using the offline migration method
28+
== Supported platforms when using the offline migration methods
2929

30-
The following table provides information about the supported platforms for the offline migration type.
30+
The following table provides information about the supported platforms for the manual offline migration type.
3131

32-
.Supported platforms for the offline migration method
32+
.Supported platforms for the manual offline migration method
3333
[cols="1,1", options="header"]
3434
|===
35-
| Platform | Offline Migration
35+
| Platform | Offline migration
3636

3737
| Bare-metal hardware |&#10003;
3838
| {aws-first} |&#10003;
@@ -44,18 +44,33 @@ The following table provides information about the supported platforms for the o
4444
| Nutanix |&#10003;
4545
|===
4646

47+
The following table provides information about the supported platforms for the manual offline migration type.
48+
49+
.Supported platforms for the Ansible playbook offline migration method
50+
[cols="1,1", options="header"]
51+
|===
52+
| Platform | Ansible playbook offline migration
53+
54+
| Bare-metal hardware |&#10003;
55+
| {aws-first} |&#10003;
56+
| {gcp-first} |&#10003;
57+
| {ibm-cloud-name} |&#10003;
58+
| {azure-first} |&#10003;
59+
| {vmw-first} |&#10003;
60+
|===
61+
4762
[NOTE]
4863
====
49-
Each listed platform supports installing an {product-title} cluster on installer-provisioned infrastructure and user-provisioned infrastructure.
64+
For each listed platform in these tables, the platform supports installing an {product-title} cluster on installer-provisioned infrastructure and user-provisioned infrastructure.
5065
====
5166

5267
[id="best-practices-migrating-ovn-kubernetes-network-provider_{context}"]
53-
== Best practices for offline migration to the OVN-Kubernetes network plugin
68+
== Best practices for manual offline migration and the Ansible playbook offline migration methods
5469

5570
For a list of best practices when migrating to the OVN-Kubernetes network plugin with the offline migration method, see link:https://access.redhat.com/articles/7076160[Best practices for OpenShift SDN to OVN Kubernetes CNI Offline migration].
5671

5772
[id="considerations-migrating-ovn-kubernetes-network-provider_{context}"]
58-
== Considerations for offline migration to the OVN-Kubernetes network plugin
73+
== Considerations for the offline migration methods to the OVN-Kubernetes network plugin
5974

6075
If you have more than 150 nodes in your {product-title} cluster, then open a support case for consultation on your migration to the OVN-Kubernetes network plugin.
6176

networking/ovn_kubernetes_network_provider/migrate-from-openshift-sdn.adoc

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ Additionally, if your cluster uses a third-party container network interface (CN
1818

1919
The following methods exist for migrating from the OpenShift SDN network plugin to the OVN-Kubernetes plugin:
2020

21-
Limited live migration (preferred method)::
22-
This is an automated process that migrates your cluster from OpenShift SDN to OVN-Kubernetes.
21+
Ansible playbook::
22+
The Ansible playbook method automates the offline migration method steps. This method has the same usage scenarios as the manual offline migration method.
2323

2424
Offline migration::
2525
This is a manual process that includes some downtime. This method is primarily used for self-managed {product-title} deployments, and consider using this method when you cannot perform a limited live migration to the OVN-Kubernetes network plugin.
2626

27+
Limited live migration (Preferred method)::
28+
This is an automated process that migrates your cluster from OpenShift SDN to OVN-Kubernetes.
29+
2730
[WARNING]
2831
====
2932
For the limited live migration method only, do not automate the migration from OpenShift SDN to OVN-Kubernetes with a script or another tool such as Red{nbsp}Hat Ansible Automation Platform. This might cause outages or crash your {product-title} cluster.
@@ -128,6 +131,16 @@ include::modules/nw-ovn-kubernetes-migration-about.adoc[leveloffset=+1]
128131
// How the offline migration process works
129132
include::modules/nw-network-plugin-migration-process.adoc[leveloffset=+2]
130133

134+
// Using an Ansible playbook to migrate to the OVN-Kubernetes network plugin
135+
include::modules/nw-ovn-kubernetes-ansible-migration.adoc[leveloffset=+2]
136+
137+
[role="_additional-resources"]
138+
.Additional resources
139+
140+
* xref:../../networking/ovn_kubernetes_network_provider/migrate-from-openshift-sdn.adoc#nw-ovn-kubernetes-ansible-migration-about_migrate-from-openshift-sdn[Patching OVN-Kubernetes address ranges]
141+
142+
* link:https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/latest[Getting started with playbooks (Red Hat Ansible Automation Platform documentation)]
143+
131144
// Migrating to the OVN-Kubernetes network plugin by using the offline migration method
132145
include::modules/nw-ovn-kubernetes-migration.adoc[leveloffset=+2]
133146

networking/ovn_kubernetes_network_provider/rollback-to-openshift-sdn.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,16 @@ As a cluster administrator, you can roll back to the OpenShift SDN network plugi
1616

1717
include::snippets/sdn-deprecation-statement.adoc[]
1818

19+
// Using the offline migration method to roll back to the OpenShift SDN network plugin
1920
include::modules/nw-ovn-kubernetes-rollback.adoc[leveloffset=+1]
21+
22+
// Using an Ansible playbook to roll back to the OpenShift SDN network plugin
23+
include::modules/nw-ovn-kubernetes-ansible-migration.adoc[leveloffset=+1]
24+
25+
[role="_additional-resources"]
26+
.Additional resources
27+
28+
* xref:../../networking/ovn_kubernetes_network_provider/migrate-from-openshift-sdn.adoc#nw-ovn-kubernetes-ansible-migration-about_migrate-from-openshift-sdn[Patching OVN-Kubernetes address ranges]
29+
30+
// Using the limited live migration method to roll back to the OpenShift SDN network plugin
2031
include::modules/nw-ovn-kubernetes-rollback-live.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)