Bug 1651523 - [OVN Migration] after migration, openstack network agent list command display neutron agent
Summary: [OVN Migration] after migration, openstack network agent list command display...
Keywords:
Status: MODIFIED
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-networking-ovn
Version: 14.0 (Rocky)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: z2
: 16.0
Assignee: Miguel Angel Ajo
QA Contact: Eran Kuris
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-20 09:30 UTC by Eran Kuris
Modified: 2020-02-25 14:36 UTC (History)
5 users (show)

Fixed In Version: python-networking-ovn-7.1.0-0.20200129045656.844540e.el8ost
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)
migration log (645.25 KB, text/plain)
2018-11-20 09:30 UTC, Eran Kuris
no flags Details


Links
System ID Priority Status Summary Last Updated
Launchpad 1804194 None None None 2018-11-20 11:05:39 UTC
OpenStack gerrit 618983 'None' MERGED Fix neutron resource cleanup after ml2/ovs migration 2020-02-25 14:22:07 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.