|
| 1 | +// Module included in the following assemblies: |
| 2 | +//networking/ovn_kubernetes_network_provider/migrate-from-openshift-sdn.adoc |
| 3 | + |
| 4 | +:_mod-docs-content-type: PROCEDURE |
| 5 | +[id="migrate-sdn-ovn-ocm-cli_{context}"] |
| 6 | += Initiate migration using the OpenShift Cluster Manager API command-line interface (ocm) CLI |
| 7 | + |
| 8 | +[WARNING] |
| 9 | +==== |
| 10 | +You can only initiate migration on clusters that are version 4.16.24 and above. |
| 11 | +==== |
| 12 | + |
| 13 | +.Prerequisites |
| 14 | + |
| 15 | +* You installed the link:https://console.redhat.com/openshift/downloads[OpenShift Cluster Manager API command-line interface (`ocm`)]. |
| 16 | +
|
| 17 | +[IMPORTANT] |
| 18 | +==== |
| 19 | +[subs="attributes+"] |
| 20 | +OpenShift Cluster Manager API command-line interface (`ocm`) is a Technology Preview feature only. |
| 21 | +For more information about the support scope of Red Hat Technology Preview features, see link:https://access.redhat.com/support/offerings/techpreview/[Technology Preview Features Support Scope]. |
| 22 | +==== |
| 23 | + |
| 24 | +.Procedure |
| 25 | + |
| 26 | +. Create a JSON file with the following content: |
| 27 | + |
| 28 | ++ |
| 29 | +[source,json] |
| 30 | +---- |
| 31 | +{ |
| 32 | + "type": "sdnToOvn" |
| 33 | +} |
| 34 | +---- |
| 35 | ++ |
| 36 | +
|
| 37 | +** Optional: Within the JSON file, you can configure internal subnets using any or all of the options `join`, `masquerade`, and `transit`, along with a single CIDR per option, as shown in the following example: |
| 38 | ++ |
| 39 | +[source,json] |
| 40 | +---- |
| 41 | +{ |
| 42 | + "type": "sdnToOvn", |
| 43 | + "sdn_to_ovn": { |
| 44 | + "transit_ipv4": "192.168.255.0/24", |
| 45 | + "join_ipv4": "192.168.255.0/24", |
| 46 | + "masquerade_ipv4": "192.168.255.0/24" |
| 47 | + } |
| 48 | +} |
| 49 | +---- |
| 50 | ++ |
| 51 | +[NOTE] |
| 52 | +==== |
| 53 | +OVN-Kubernetes reserves the following IP address ranges: |
| 54 | +
|
| 55 | +`100.64.0.0/16`. This IP address range is used for the `internalJoinSubnet` parameter of OVN-Kubernetes by default. |
| 56 | +
|
| 57 | +`100.88.0.0/16`. This IP address range is used for the `internalTransSwitchSubnet` parameter of OVN-Kubernetes by default. |
| 58 | +
|
| 59 | +If these IP addresses have been used by OpenShift SDN or any external networks that might communicate with this cluster, you must patch them to use a different IP address range before initiating the limited live migration. For more information, see _Patching OVN-Kubernetes address ranges_ in the _Additional resources_ section. |
| 60 | +==== |
| 61 | ++ |
| 62 | +
|
| 63 | +. To initiate the migration, run the following post request in a terminal window: |
| 64 | + |
| 65 | ++ |
| 66 | +[source,terminal] |
| 67 | +---- |
| 68 | +$ ocm post /api/clusters_mgmt/v1/clusters/{cluster_id}/migrations <1> |
| 69 | + --body=myjsonfile.json <2> |
| 70 | +---- |
| 71 | +<1> Replace `{cluster_id}` with the ID of the cluster you want to migrate to the OVN-Kubernetes network plugin. |
| 72 | +<2> Replace `myjsonfile.json` with the name of the JSON file you created in the previous step. |
| 73 | ++ |
| 74 | +.Example output |
| 75 | ++ |
| 76 | +[source,json] |
| 77 | +---- |
| 78 | +{ |
| 79 | + "kind": "ClusterMigration", |
| 80 | + "href": "/api/clusters_mgmt/v1/clusters/2gnts65ra30sclb114p8qdc26g5c8o3e/migrations/2gois8j244rs0qrfu9ti2o790jssgh9i", |
| 81 | + "id": "7sois8j244rs0qrhu9ti2o790jssgh9i", |
| 82 | + "cluster_id": "2gnts65ra30sclb114p8qdc26g5c8o3e", |
| 83 | + "type": "sdnToOvn", |
| 84 | + "state": { |
| 85 | + "value": "scheduled", |
| 86 | + "description": "" |
| 87 | + }, |
| 88 | + "sdn_to_ovn": { |
| 89 | + "transit_ipv4": "100.65.0.0/16", |
| 90 | + "join_ipv4": "100.66.0.0/16" |
| 91 | + }, |
| 92 | + "creation_timestamp": "2025-02-05T14:56:34.878467542Z", |
| 93 | + "updated_timestamp": "2025-02-05T14:56:34.878467542Z" |
| 94 | +} |
| 95 | +---- |
| 96 | + |
| 97 | +// :_mod-docs-content-type: PROCEDURE |
| 98 | +// [id="verify-sdn-ovn-ocm_{context}"] |
| 99 | +// = Verify migration status using the OCM CLI |
| 100 | + |
| 101 | +.Verification |
| 102 | + |
| 103 | +* To check the status of the migration, run the following command: |
| 104 | +
|
| 105 | ++ |
| 106 | +
|
| 107 | +[source,terminal] |
| 108 | +---- |
| 109 | +$ ocm get cluster $cluster_id/migration <1> |
| 110 | +---- |
| 111 | +<1> Replace `$cluster_id` with the ID of the cluster that the migration was applied to. |
0 commit comments