Roll back the Nmstate migration

If a migration from the ifcfg provider to the Nmstate provider fails, you can roll back to the ifcfg provider. The rollback CR file can be a copy of the original migration file with a few changes.

Roll back to ifcfg

Roll back a failed Nmstate migration to restore the ifcfg provider.

Before you begin

  • Latest RHOSO.
  • Your environment was successfully backed up.
  • You attempted a migration from ifcfg to Nmstate and the results were not acceptable.

Procedure

  1. Create a CR file, such as nmstate-ifcfg.yaml, with the following contents. This can be a copy of the file that you used for the migration attempt, with the relevant parameter changes:
    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: "nmstate"
        edpm_network_config_nmstate: "false"
        edpm_network_config_template: |
          ...
          network_config: <full network configuration in rolled back deployment>
          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 rollback 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: "nmstate" directs the Ansible Playbook to purge the Nmstate configuration.
    • edpm_network_config_nmstate: "false" directs the Ansible Playbook to configure the ifcfg 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.
  2. Delete the failed CR:
    $ oc delete -f migration.yaml -n openstack
  3. Apply the CR:
    $ oc apply -f nmstate-ifcfg.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, nmstate-ifcfg.

    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 added back:
    $ ls /etc/sysconfig/network-scripts

    You should see multiple files that begin with ifcfg-.

Nmstate rollback CR example

Review an example CR for rolling back Compute nodes to the ifcfg provider after a failed Nmstate migration.

The following example OpenStackDataPlaneNodeSet CR defines a migration of a Compute node from the from the Nmstate provider to the ifcfg provider after a failed Nmstate migration. The example includes optional fields. Review the example and update the optional fields to the correct values for your environment or remove them before using the example in your Red Hat OpenStack Services on OpenShift (RHOSO) deployment.

apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneDeployment
metadata:
  name: nmstate-ifcfg
  namespace: openstack
spec:
  nodeSets:
    - openstack-edpm
  servicesOverride:
    - configure-network
  ansibleLimit: compute-1
  ansibleExtraVars:
    edpm_network_config_purge_provider: "nmstate"
    edpm_network_config_nmstate: "false"
    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 }}