Migrate to the Nmstate provider
You can perform the Nmstate migration in batches. A batch can consist of one node, a specific list of nodes in a node set, an entire node set, or multiple node sets.
Migrate nodes from ifcfg to Nmstate Copy linkLink copied!
Migrate data plane nodes from the ifcfg provider to the Nmstate provider.
Before you begin Copy linkLink copied!
- Your environment is running the latest version of RHOSO.
- You are logged on to a workstation that has access to the Red Hat OpenShift Container Platform (RHOCP) cluster as a user with
cluster-adminprivileges. - You backed up your current environment with your preferred third-party backup and recovery tool.
Note In the case of a failed migration and rollback, you can use the backup as a basis of comparison to ensure the rolled back configuration is comparable to the original configuration. You do not need a backup to perform a rollback.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Verify that the CR is created:
$ oc get openstackdataplanedeployment <name>Where <name> is the name of the CR, specified in
metadata.name. For example,ifcfg-nmstate.The CR is completed when the Status is
Trueand Message isSetup complete. - Use SSH to log in to one of the migrated nodes and make sure the
ifcfgscripts have been removed:$ ls /etc/sysconfig/network-scriptsIf you see any file that begins with
ifcfg-other thanifcfg-lo, theifcfgpurge playbook did not completely remove theifcfgfiles as expected. - Use OpenStack to verify that the correct network agents are running on one of the migrated Compute nodes:
$ oc rsh openstackclient $ openstack network agent list -host <hostname>Where <hostname> is the name of the Compute node. For example,
compute-1.ctlplane.example.com. - Check the migration pod status:
$ oc get pods | grep migration- Sample output
-
configure-network-edpm-network-migration-ifcfg-nmstate-2-opxmp8 0/1 Completed 0 4d1h configure-network-edpm-network-migration-ifcfg-nmstate-3-o8gq9d 0/1 Completed 0 3d6h configure-network-edpm-network-migration-ifcfg-nmstate-opesdk48 0/1 Completed 0 4d1h configure-network-edpm-network-migration-nmstate-ifcfg-2-ong4q8 0/1 Completed 0 4d1h configure-network-edpm-network-migration-nmstate-ifcfg-3-ozd84t 0/1 Completed 0 3d6h configure-network-edpm-network-migration-nmstate-ifcfg-opexsdb9 0/1 Completed 0 4d1h
- Check the logs for error messages.
$ oc logs -f \ configure-network-edpm-network-migration-ifcfg-nmstate-opesdk48- Sample output
-
PLAY RECAP ********************************************************************* compute-1 : ok=38 changed=4 unreachable=0 failed=0 skipped=9 rescued=0 ignored=0
Nmstate migration CR example Copy linkLink copied!
Review an example CR for migrating Compute nodes from the ifcfg provider to the Nmstate provider.
The following example OpenStackDataPlaneDeployment CR defines a migration of a set of nodes from the ifcfg provider to the Nmstate provider. The example includes optional fields.
Review the example. Before using the example in your environment, update the optional fields to the correct values for your environment.
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneDeployment
metadata:
name: ifcfg-nmstate
namespace: openstack
spec:
nodeSets:
- openstack-edpm
servicesOverride:
- configure-network
ansibleLimit: compute-1
ansibleExtraVars:
edpm_network_config_purge_provider: "ifcfg"
edpm_network_config_nmstate: "true"
edpm_network_config_template: |
---
{% set mtu_list = [ctlplane_mtu] %}
{% for network in nodeset_networks %}
{{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }}
{%- endfor %}
{% set min_viable_mtu = mtu_list | max %}
network_config:
- type: interface
name: nic1
use_dhcp: false
- type: interface
name: nic2
use_dhcp: true
- type: linux_bond
name: bond_api
use_dhcp: false
bonding_options: "mode=active-backup"
dns_servers: {{ ctlplane_dns_nameservers }}
domain: {{ dns_search_domains }}
members:
- type: interface
name: nic3
primary: true
- type: interface
name: nic4
addresses:
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }}
routes:
- default: true
next_hop: {{ ctlplane_gateway_ip }}
- type: vlan
vlan_id: {{ lookup('vars', networks_lower['internalapi'] ~ '_vlan_id') }}
device: bond_api
addresses:
- ip_netmask: {{ lookup('vars', networks_lower['internalapi'] ~ '_ip') }}/{{ lookup('vars', networks_lower['internalapi'] ~ '_cidr') }}
- type: vlan
vlan_id: {{ lookup('vars', networks_lower['storage'] ~ '_vlan_id') }}
device: bond_api
addresses:
- ip_netmask: {{ lookup('vars', networks_lower['storage'] ~ '_ip') }}/{{ lookup('vars', networks_lower['storage'] ~ '_cidr') }}
- type: ovs_user_bridge
name: br-link0
use_dhcp: false
ovs_extra: "set port br-link0 tag={{ lookup('vars', networks_lower['tenant'] ~ '_vlan_id') }}"
addresses:
- ip_netmask: {{ lookup('vars', networks_lower['tenant'] ~ '_ip') }}/{{ lookup('vars', networks_lower['tenant'] ~ '_cidr')}}
members:
- type: ovs_dpdk_bond
name: dpdkbond0
mtu: 9000
rx_queue: 1
ovs_extra: "set port dpdkbond0 bond_mode=balance-slb"
members:
- type: ovs_dpdk_port
name: dpdk0
members:
- type: interface
name: nic7
- type: ovs_dpdk_port
name: dpdk1
members:
- type: interface
name: nic8
- type: ovs_user_bridge
name: br-dpdk0
use_dhcp: false
mtu: 9000
members:
- type: ovs_dpdk_port
rx_queue: 1
name: dpdk2
members:
- type: interface
name: nic5
- type: ovs_user_bridge
name: br-dpdk1
use_dhcp: false
mtu: 9000
members:
- type: ovs_dpdk_port
rx_queue: 1
name: dpdk3
members:
- type: interface
name: nic6
- type: sriov_pf
name: nic9
mtu: 9000
numvfs: 5
use_dhcp: false
defroute: false
nm_controlled: true
hotplug: true
promisc: false
drivers_autoprobe: false
- type: sriov_pf
name: nic10
mtu: 9000
numvfs: 5
use_dhcp: false
defroute: false
nm_controlled: true
hotplug: true
promisc: false
drivers_autoprobe: false
- type: sriov_pf
name: nic11
mtu: 9000
numvfs: 5
use_dhcp: false
defroute: false
nm_controlled: true
hotplug: true
promisc: false
drivers_autoprobe: false
- type: sriov_pf
name: nic12
mtu: 9000
numvfs: 5
use_dhcp: false
defroute: false
nm_controlled: true
hotplug: true
promisc: false
drivers_autoprobe: false
minimum_config:
- type: interface
name: nic1
use_dhcp: false
- type: interface
name: nic2
use_dhcp: true
- type: linux_bond
name: bond_api
use_dhcp: false
bonding_options: "mode=active-backup"
domain: {{ dns_search_domains }}
dns_servers: {{ ctlplane_dns_nameservers }}
members:
- type: interface
name: nic3
primary: true
- type: interface
name: nic4
addresses:
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }}
routes:
- default: true
next_hop: {{ ctlplane_gateway_ip }}