Chapter 4. Preparing for the undercloud upgrade
Before you perform the undercloud upgrade, you must complete some preparation steps so that the undercloud upgrade runs successfully.
4.1. Upgrading with external Ceph prerequisite
If you are upgrading with external Ceph deployments, before you can upgrade your Red Hat OpenStack Platform deployment, you must upgrade your Red Hat Ceph Storage cluster from version 3 to version 4. For more information, see Upgrading a Red Hat Ceph Storage cluster in the Red Hat Ceph Storage 4 Installation Guide .
4.2. New memory requirements
In Red Hat OpenStack Platform 16.1, the undercloud has new memory requirements:
Red Hat OpenStack Platform 13 | Red Hat OpenStack Platform 16.1 |
---|---|
16 GB RAM | 24 GB RAM |
Ensure that your undercloud meets these new requirements before you proceed with the upgrade.
4.3. Using predictable NIC names for the undercloud node
Before you run the Leapp upgrade on the undercloud node, you must check for kernel-based NIC names, which usually contain an eth
prefix. These NIC names are usually unpredictable in terms of NIC assignments.
You can run the playbook-nics.yaml
playbook to rename NIC names to use the em
NIC prefix. You can also set a different NIC prefix, by modifying the prefix
variable when running the playbook. However, the NIC changes are only applied after the Leapp upgrade process completes and the node is rebooted.
Procedure
-
Log in to the undercloud as the
stack
user. Create an Ansible playbook named
playbook-nics.yaml
and copy the following content into the playbook:--- - name: Rename eth devices hosts: all become: yes vars: prefix: "em" undercloud_conf: "/home/stack/undercloud.conf" osnet_conf: "/etc/os-net-config/config.json" tasks: - set_fact: eth_interfaces: "{{ ansible_interfaces | select('match','eth.*') | list }}" - debug: msg: "{{ eth_interfaces }}" - name: Update udev rules lineinfile: line: "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"{{ ansible_facts[item]['perm_macaddress'] | default(ansible_facts[item]['macaddress']) }}\", NAME=\"{{ item|replace('eth',prefix) }}\"" path: /etc/udev/rules.d/70-rhosp-persistent-net.rules create: True with_items: "{{ eth_interfaces }}" - name: Rename eth files block: - name: Check that eth files exists stat: path: /etc/sysconfig/network-scripts/ifcfg-{{ item }} register: nic_result with_items: "{{ eth_interfaces }}" - name: Copy nic files using the new prefix copy: remote_src: True src: "{{ item.stat.path }}" dest: "{{ item.stat.path|replace('eth',prefix) }}" with_items: "{{ nic_result.results }}" when: item.stat.exists - name: Edit NAME in new network-script files lineinfile: regexp: "^NAME=.*" line: "NAME={{ item.item|replace('eth',prefix) }}" path: "{{ item.stat.path|replace('eth',prefix) }}" with_items: "{{ nic_result.results }}" when: item.stat.exists - name: Edit DEVICE in new network-script files lineinfile: regexp: "^DEVICE=.*" line: "DEVICE={{ item.item|replace('eth',prefix) }}" path: "{{ item.stat.path|replace('eth',prefix) }}" with_items: "{{ nic_result.results }}" when: item.stat.exists - name: Backup old eth network-script files copy: remote_src: True src: "{{ item.stat.path }}" dest: "{{ item.stat.path }}.bak" with_items: "{{ nic_result.results }}" when: item.stat.exists - name: Remove old eth network-script files file: path: "{{ item.stat.path }}" state: absent with_items: "{{ nic_result.results }}" when: item.stat.exists - name: Rename route files block: - name: Check that route files exists stat: path: /etc/sysconfig/network-scripts/route-{{ item }} register: route_result with_items: "{{ eth_interfaces }}" - name: Copy route files using the new prefix copy: remote_src: True src: "{{ item.stat.path }}" dest: "{{ item.stat.path|replace('eth',prefix) }}" with_items: "{{ route_result.results }}" when: item.stat.exists - name: Update prefix in route files that use IP command arguments format replace: regexp: "eth" replace: "{{ prefix }}" path: "{{ item.stat.path|replace('eth',prefix) }}" with_items: "{{ route_result.results }}" when: item.stat.exists - name: Backup old route files copy: remote_src: True src: "{{ item.stat.path }}" dest: "{{ item.stat.path }}.bak" with_items: "{{ route_result.results }}" when: item.stat.exists - name: Remove old route files file: path: "{{ item.stat.path }}" state: absent with_items: "{{ route_result.results }}" when: item.stat.exists - name: Perform a final regex for any remaining eth prefixes in ifcfg files block: - name: Get a list of all ifcfg files find: paths: /etc/sysconfig/network-scripts/ patterns: 'ifcfg-*' excludes: '*.bak' register: ifcfg_files - name: Perform final regex on ifcfg files replace: path: "{{ item[0].path }}" regexp: "{{ item[1] }}" replace: "{{ item[1]|replace('eth',prefix) }}" with_nested: - "{{ ifcfg_files.files }}" - "{{ eth_interfaces }}" - name: Replace interface name in files referencing old eth interface block: - name: Check if undercloud.conf exists stat: path: "{{ undercloud_conf }}" register: undercloud_conf_stat - name: Replace interface name in undercloud.conf replace: path: "{{ undercloud_conf }}" regexp: 'eth(\d+)' replace: "{{ prefix }}\\1" when: undercloud_conf_stat.stat.exists - name: Check if os-net-config's config.json exists stat: path: "{{ osnet_conf }}" register: osnet_conf_stat - name: Replace interface name in config.json replace: path: "{{ osnet_conf }}" regexp: 'eth(\d+)' replace: "{{ prefix }}\\1" when: osnet_conf_stat.stat.exists - name: Patch vlan devices block: - name: Check that vlan files exists stat: path: /etc/sysconfig/network-scripts/ifcfg-{{ item }} register: nic_result when: item.startswith("vlan") with_items: "{{ ansible_interfaces }}" - name: Backup old vlan network-script files copy: remote_src: True src: "{{ item.stat.path }}" dest: "{{ item.stat.path }}.bak" when: item.item.startswith("vlan") and item.stat.exists with_items: "{{ nic_result.results }}" - name: Edit PHYSDEV in new network-script files replace: path: "{{ item.stat.path }}" regexp: "^PHYSDEV=eth" replace: "PHYSDEV={{ prefix }}" when: item.item.startswith("vlan") and item.stat.exists with_items: "{{ nic_result.results }}"
NoteYou will use this playbook to rename the overcloud NICs at a later stage in the upgrade process.
Run the
playbook-nics.yaml
playbook on the undercloud:$ ansible-playbook -c local -i localhost, playbook-nics.yaml
The playbook sets the new NIC prefix to
em
. To set a different NIC prefix, set theprefix
variable when running the playbook:$ ansible-playbook -c local -i localhost, -e prefix="mynic" ~/playbook-nics.yaml
The NIC changes are only applied after the Leapp upgrade process completes and the node is rebooted.
4.4. Setting the SSH root permission parameter on the undercloud
The Leapp upgrade checks whether the PermitRootLogin
parameter exists in the /etc/ssh/sshd_config
file. You must explicitly set this parameter to either yes
or no
.
For security purposes, set this parameter to no
to disable SSH access to the root user on the undercloud.
Procedure
-
Log in to the undercloud as the
stack
user. Check the
/etc/ssh/sshd_config
file for thePermitRootLogin
parameter:$ sudo grep PermitRootLogin /etc/ssh/sshd_config
If the parameter is not in the
/etc/ssh/sshd_config
file, edit the file and set thePermitRootLogin
parameter:PermitRootLogin no
- Save the file.
4.5. Converting to next generation power management drivers
Red Hat OpenStack Platform now uses next generation drivers, also known as hardware types, that replace older drivers.
The following table shows an analogous comparison between older drivers with their next generation hardware type equivalent:
Old Driver | New Hardware Type |
---|---|
|
|
|
|
|
|
|
|
VBMC ( |
|
|
|
In OpenStack Platform 15, these older drivers have been removed and are no longer accessible. You must change to hardware types before upgrading to OpenStack Platform 16.1.
Procedure
Check the current list of hardware types enabled:
$ source ~/stackrc $ openstack baremetal driver list --type dynamic
If you use a hardware type driver that is not enabled, enable the driver using the
enabled_hardware_types
parameter in theundercloud.conf
file:enabled_hardware_types = ipmi,redfish,idrac
Save the file and refresh the undercloud:
$ openstack undercloud install
Run the following commands, substituting the
OLDDRIVER
andNEWDRIVER
variables for your power management type:$ source ~/stackrc $ OLDDRIVER="pxe_ipmitool" $ NEWDRIVER="ipmi" $ for NODE in $(openstack baremetal node list --driver $OLDDRIVER -c UUID -f value) ; do openstack baremetal node set $NODE --driver $NEWDRIVER; done