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

Migrate data plane nodes from the ifcfg provider to the Nmstate provider.

Before you begin

  • 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-admin privileges.
  • 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

  1. Identify the data plane nodes that you intend to migrate to Nmstate in this batch. Then use live or cold migration to move any running instances from those nodes to other nodes that will continue to operate during the Nmstate migration of this batch.

    For more information about your instance migration options, see: Migrate instances between Compute nodes.

  2. Create a CR file, such as ifcfg-to-nmstate.yaml, with the following contents:
    apiVersion: dataplane.openstack.org/v1beta1
    kind: OpenStackDataPlaneDeployment
    metadata:
      name: <name>
    spec:
      nodeSets:
        - <node-set-name>
      servicesOverride:
        - configure-network
      ansibleLimit: <nodename1, nodename2, etc>
      ansibleExtraVars:
        edpm_network_config_purge_provider: "ifcfg"
        edpm_network_config_nmstate: "true"
        edpm_network_config_template: |
          ...
          network_config: <full network configuration post-migration>
          minimum_config: <configuration used to maintain comm with server>
    • servicesOverride:configure-network ensures that the operation updates the network configuration and no other services
    • ansibleLimit: (optional) is a list of node names. The migration affects only the listed nodes. Ensure that each listed node belongs to one of the node sets specified in nodeSets:.
    • edpm_network_config_purge_provider: "ifcfg" directs the Ansible Playbook to purge the ifcfg files.
    • edpm_network_config_nmstate: "true" directs the Ansible Playbook to configure the Nmstate provider.
    • edpm_network_config_template:network_config defines the network configuration of the data plane networks after the migration
    • edpm_network_config_template:minimum_config defines a minimal network configuration that remains operational throughout the migration to maintain control plane connectivity and prevent interruption.
  3. Create the CR:
    $ oc apply -f migrate-to-nmstate.yaml

Results

  1. 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 True and Message is Setup complete.

  2. Use SSH to log in to one of the migrated nodes and make sure the ifcfg scripts have been removed:
    $ ls /etc/sysconfig/network-scripts

    If you see any file that begins with ifcfg- other than ifcfg-lo, the ifcfg purge playbook did not completely remove the ifcfg files as expected.

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

  4. 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
  5. 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

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