From 855379056d1650560cb8d92eb70562218d25f149 Mon Sep 17 00:00:00 2001 From: Saravanan KR Date: Fri, 7 Aug 2020 09:33:30 +0530 Subject: [PATCH] Reset sriov_numvfs to 0 before leapp upgrade Leapp's actor persistentnetnamesconfig will try to apply the nic names based on the mac address. Whlie collecting the data, leapp will also add the VFs details to RHEL7 catalog (leapp.db). But when RHEL8 ramfs boots, it will not find the VF interfaces. VFs will be configured using sriov_config service on boot (not applied during upgrade). Remove VFs before leapp upgrade as a workaround. Closes-Bug: #1890769 Change-Id: I5054d5970e6c88cf3cdcd9c3850ef926040bc827 --- .../neutron-sriov-agent-container-puppet.yaml | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/deployment/neutron/neutron-sriov-agent-container-puppet.yaml b/deployment/neutron/neutron-sriov-agent-container-puppet.yaml index ff15933342..430705a60b 100644 --- a/deployment/neutron/neutron-sriov-agent-container-puppet.yaml +++ b/deployment/neutron/neutron-sriov-agent-container-puppet.yaml @@ -239,4 +239,33 @@ outputs: - [] metadata_settings: get_attr: [NeutronBase, role_data, metadata_settings] - upgrade_tasks: [] + upgrade_tasks: + - name: upgrade prepare for leapp to remove extra sriov vfs + tags: + - never + - system_upgrade + - system_upgrade_prepare + when: + - step|int == 3 + - upgrade_leapp_enabled + block: + - name: reset all vfs as leapp will look for all interfaces on reboot + shell: | + for item in $(find /sys/class/net/ -type l); do + DEVPATH="$item/device/sriov_numvfs" + if [ -f $DEVPATH ]; then + NUM_VFS=$(cat $DEVPATH) + if [[ $NUM_VFS != 0 ]]; then + echo 0 >$DEVPATH + fi + fi + done + - name: remove sriov_config service for leapp upgrade + file: + path: "/etc/systemd/system/sriov_config.service" + state: absent + register: sriov_config_remove_result + - name: reload systemd daemon after removing sriov_config service + systemd: + daemon-reload: yes + when: sriov_config_remove_result['changed']