Bug 1651523

Summary: [OVN Migration] after migration, openstack network agent list command display neutron agent
Product: Red Hat OpenStack Reporter: Eran Kuris <ekuris>
Component: python-networking-ovnAssignee: Miguel Angel Ajo <majopela>
Status: CLOSED DUPLICATE QA Contact: Roman Safronov <rsafrono>
Severity: medium Docs Contact:
Priority: high    
Version: 14.0 (Rocky)CC: apevec, jlibosva, lhh, lmartins, majopela
Target Milestone: z2Keywords: TestOnly, Triaged, ZStream
Target Release: 16.0 (Train on RHEL 8.1)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-networking-ovn-7.1.0-0.20200129045656.844540e.el8ost Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-08 14:01:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
migration log none

Description Eran Kuris 2018-11-20 09:30:05 UTC
Created attachment 1507386 [details]
migration log

Description of problem:
After ovn migration completed I check the output of OpenStack network agent list
and it looks like we can see the legacy neutron agent. They are not alive but still, I expected that they will not display in OVN deployment after migration process performed.

Ansible  [migration: Deleting the neutron agents] actually ran in the controller-0. it is expected to be run in localhost (i.e undercloud)

TASK [migration : Generate neutron resources cleanup script] **********************************************************************************************************************************
task path: /home/stack/ovn_migration/playbooks/roles/migration/tasks/delete-neutron-resources.yml:12
Monday 19 November 2018  11:17:31 -0500 (0:00:00.586)       1:06:27.269 *******
META: noop
META: noop
META: noop
META: noop
changed: [controller-0] => {"changed": true, "checksum": "fd0d852ef79dfbe3c5384eecce8fec53579acf6c", "dest": "/home/stack/ovn_migration/delete_neutron_resources/delete-neutron-resources.sh", "gid": 0, "group": "root", "md5sum": "9f41d4008b512c54b2ffbf84a1b8cb4f", "mode": "0744", "owner": "root", "secontext": "unconfined_u:object_r:user_home_t:s0", "size": 551, "src": "/home/heat-admin/.ansible/tmp/ansible-tmp-1542644251.88-161854948129152/source", "state": "file", "uid": 0}

TASK [migration : Deleting the neutron agents] ************************************************************************************************************************************************
task path: /home/stack/ovn_migration/playbooks/roles/migration/tasks/delete-neutron-resources.yml:18
Monday 19 November 2018  11:17:32 -0500 (0:00:01.061)       1:06:28.330 *******
META: noop
META: noop
META: noop
META: noop
changed: [controller-0] => {"changed": true, "cmd": "/home/stack/ovn_migration/delete_neutron_resources/delete-neutron-resources.sh 2>&1 > /home/stack/ovn_migration/delete_neutron_resources/delete-neutron-resources.sh.log", "delta": "0:00:01.479081", "end": "2018-11-19 16:17:34.880606", "rc": 0, "start": "2018-11-19 16:17:33.401525", "stderr": "", "stderr_lines": [], "stdout": "+ source /home/stack/overcloudrc\n/home/stack/ovn_migration/delete_neutron_resources/delete-neutron-resources.sh: line 5: /home/stack/overcloudrc: No such file or directory\n++ openstack network agent list\n++ awk '{print $2}'\n++ grep neutron-\nMissing value auth-url required for auth plugin password\n++ openstack network list\n++ awk '{print $2}'\n++ grep 'HA network tenant'\nMissing value auth-url required for auth plugin password\n+ exit 0", "stdout_lines": ["+ source /home/stack/overcloudrc", "/home/stack/ovn_migration/delete_neutron_resources/delete-neutron-resources.sh: line 5: /home/stack/overcloudrc: No such file or directory", "++ openstack network agent list", "++ awk '{print $2}'", "++ grep neutron-", "Missing value auth-url required for auth plugin password", "++ openstack network list", "++ awk '{print $2}'", "++ grep 'HA network tenant'", "Missing value auth-url required for auth plugin password", "+ exit 0"]}
META: ran handlers
META: ran handlers



Version-Release number of selected component (if applicable):
osp14 14.0-RHEL-7/2018-11-13.1

How reproducible:
100%

Steps to Reproduce:
1.run ovn migration 
2.run the command:
 openstack network agent list
3.

Actual results:


Expected results:


Additional info:

Comment 1 Miguel Angel Ajo 2018-11-20 09:36:07 UTC
Working on this cone

Comment 2 Miguel Angel Ajo 2018-11-20 10:02:16 UTC
Workaround for this after migration, from the undercloud, this can be ran:


source ~/overcloudrc

# Delete neutron agents
for i in `openstack network agent list | grep neutron- | awk {'print $2'}`
do
  openstack network agent delete $i
done


delete_network_ports() {
    net_id=$1
    for p in `openstack port list --network $net_id | grep -v ID | awk '{print $2}'`
    do
        openstack port delete $p
    done
}

# Delete HA networks and ports
for i in `openstack network list | grep "HA network tenant" | awk '{print $2}'`
do
    delete_network_ports $i
    openstack network delete $i
done

Comment 4 Miguel Angel Ajo 2018-11-21 12:02:07 UTC
Merged upstream.

Comment 8 Lon Hohberger 2020-03-03 11:40:07 UTC
According to our records, this should be resolved by python-networking-ovn-7.1.0-0.20200204065607.57ac389.el8ost.  This build is available now.

Comment 9 Roman Safronov 2020-09-08 14:01:11 UTC
It was tested on RHOS-16.1-RHEL-8-20200831.n.1, deletion of neutron agents initiated as expected but it fails due to bz1828889.

*** This bug has been marked as a duplicate of bug 1828889 ***