Skip to content

Commit 7a3e9b0

Browse files
committed
OSDOCS-12623: Documented the Ansible playbook offline migration method
1 parent 0d8b97b commit 7a3e9b0

File tree

4 files changed

+193
-9
lines changed

4 files changed

+193
-9
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: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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
Although a rollback procedure is provided, the offline migration is intended to be a one-way process.
1111

@@ -20,14 +20,14 @@ include::snippets/sdn-deprecation-statement.adoc[]
2020
The following sections provide more information about the offline migration method.
2121

2222
[id="supported-platforms-offline-migrating-ovn-kubernetes"]
23-
== Supported platforms when using the offline migration method
23+
== Supported platforms when using the offline migration methods
2424

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

27-
.Supported platforms for the offline migration method
27+
.Supported platforms for the manual offline migration method
2828
[cols="1,1", options="header"]
2929
|===
30-
| Platform | Offline Migration
30+
| Platform | Offline migration
3131

3232
| Bare metal hardware (IPI and UPI) |&#10003;
3333
| Amazon Web Services (AWS) (IPI and UPI) |&#10003;
@@ -41,7 +41,7 @@ The following table provides information about the supported platforms for the o
4141
|===
4242

4343
[id="considerations-migrating-ovn-kubernetes-network-provider_{context}"]
44-
== Considerations for offline migration to the OVN-Kubernetes network plugin
44+
== Considerations for the offline migration methods to the OVN-Kubernetes network plugin
4545

4646
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.
4747

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ As a cluster administrator, you can migrate to the OVN-Kubernetes network plugin
1010

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

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

1616
Offline migration::
1717
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.
1818

19+
Limited live migration (Preferred method)::
20+
This is an automated process that migrates your cluster from OpenShift SDN to OVN-Kubernetes.
21+
1922
[WARNING]
2023
====
2124
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.
@@ -101,6 +104,16 @@ include::modules/nw-ovn-kubernetes-migration-about.adoc[leveloffset=+1]
101104
// How the offline migration process works
102105
include::modules/nw-network-plugin-migration-process.adoc[leveloffset=+2]
103106

107+
// Using an Ansible playbook to migrate to the OVN-Kubernetes network plugin
108+
include::modules/nw-ovn-kubernetes-ansible-migration.adoc[leveloffset=+2]
109+
110+
[role="_additional-resources"]
111+
.Additional resources
112+
113+
* 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]
114+
115+
* link:https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/latest[Getting started with playbooks (Red Hat Ansible Automation Platform documentation)]
116+
104117
// Migrating to the OVN-Kubernetes network plugin by using the offline migration method
105118
include::modules/nw-ovn-kubernetes-migration.adoc[leveloffset=+2]
106119

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

Lines changed: 12 additions & 1 deletion
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]
20-
include::modules/nw-ovn-kubernetes-rollback-live.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
31+
include::modules/nw-ovn-kubernetes-rollback-live.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)