Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1699839

Summary: [OVN] Exception on attempt to create an instance connected to public network
Product: Red Hat OpenStack Reporter: Roman Safronov <rsafrono>
Component: python-networking-ovnAssignee: Jakub Libosvar <jlibosva>
Status: CLOSED WORKSFORME QA Contact: Eran Kuris <ekuris>
Severity: high Docs Contact:
Priority: high    
Version: 13.0 (Queens)CC: apevec, lhh, lmartins, majopela, scohen, twilson
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-25 09:23:35 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:

Description Roman Safronov 2019-04-15 11:01:50 UTC
Description of problem:
Impossible to run an instance connected to the external network. Instance created in ERROR state, exception seen in neutron logs (see below)

Version-Release number of selected component (if applicable):
13.0-RHEL-7/2019-04-10.1

How reproducible:
always

Steps to Reproduce:
1. Create an external network 
(note, I tried to create shared and not shared network, same result)
example command
openstack network create --provider-network-type flat --provider-physical-network datacentre --external external
or for shared one
openstack network create --provider-network-type flat --provider-physical-network datacentre --share --external external

2. Create an external network subnet 
(note, i tried to create with dhcp enabled and not enabled, same result)
openstack subnet create --no-dhcp --gateway 10.0.0.1 --dns-nameserver 10.0.0.1 --network external --subnet-range 10.0.0.0/24 --allocation-pool start=10.0.0.151,end=10.0.0.200 external-subnet
or with dhcp enabled
openstack subnet create --gateway 10.0.0.1 --dns-nameserver 10.0.0.1 --network external --subnet-range 10.0.0.0/24 --allocation-pool start=10.0.0.151,end=10.0.0.200 external-subnet


3. Create security group and try to create an instance
openstack server create --flavor m1.nano --image cirros35 --security-group overcloud_sg   --nic net-id=external  vm_1

Actual results:
Instance created in ERROR state, exception seen in neutron logs (see below)

Expected results:
No exceptions, instance created and state is ACTIVE

Additional info:

from neutron/server.log

2019-04-15 10:44:34.355 28 DEBUG ovsdbapp.backend.ovs_idl.transaction [-] Running txn command(idx=3): DbRemoveCommand(if_exists=False, column=records, keyvalues={}, record=e173cdac-2ec2-4f21-bdba-37b8773d5645, v
alues=(u'host-10-0-0-153',), table=DNS) do_commit /usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/transaction.py:84
2019-04-15 10:44:34.356 28 ERROR ovsdbapp.backend.ovs_idl.transaction [req-ec354b24-798c-4033-ac03-204b0d6a50e0 d31d909be1824786a245a09a1dc8dad6 966641895d4e4c0b821bf98312304b48 - default default] Traceback (mos
t recent call last):
  File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/connection.py", line 99, in run
    txn.results.put(txn.do_commit())
  File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/transaction.py", line 86, in do_commit
    command.run_idl(txn)
  File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/command.py", line 310, in run_idl
    if isinstance(getattr(record, self.column), dict):
  File "/usr/lib64/python2.7/site-packages/ovs/db/idl.py", line 816, in __getattr__
    del dmap[key]
KeyError: u'host-10-0-0-153.ovn.test'

2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers [req-ec354b24-798c-4033-ac03-204b0d6a50e0 d31d909be1824786a245a09a1dc8dad6 966641895d4e4c0b821bf98312304b48 - default default] Mechanism driver 'ovn'
 failed in update_port_postcommit: KeyError: u'host-10-0-0-153.ovn.test'
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers Traceback (most recent call last):
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/managers.py", line 427, in _call_on_drivers
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers     getattr(driver.obj, method_name)(context)
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/networking_ovn/ml2/mech_driver.py", line 531, in update_port_postcommit
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers     self._ovn_client.update_port(port, port_object=original_port)
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/networking_ovn/common/ovn_client.py", line 504, in update_port
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers     self.add_txns_to_remove_port_dns_records(txn, port_object)
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers   File "/usr/lib64/python2.7/contextlib.py", line 24, in __exit__
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers     self.gen.next()
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/networking_ovn/ovsdb/impl_idl_ovn.py", line 139, in transaction
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers     yield t
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers   File "/usr/lib64/python2.7/contextlib.py", line 24, in __exit__
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers     self.gen.next()
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/ovsdbapp/api.py", line 102, in transaction
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers     del self._nested_txns_map[cur_thread_id]
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/ovsdbapp/api.py", line 59, in __exit__
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers     self.result = self.commit()
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers   File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/transaction.py", line 62, in commit
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers     raise result.ex
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers KeyError: u'host-10-0-0-153.ovn.test'
2019-04-15 10:44:34.356 28 ERROR neutron.plugins.ml2.managers 
2019-04-15 10:44:34.357 28 ERROR neutron.plugins.ml2.plugin [req-ec354b24-798c-4033-ac03-204b0d6a50e0 d31d909be1824786a245a09a1dc8dad6 966641895d4e4c0b821bf98312304b48 - default default] mechanism_manager.update
_port_postcommit failed for port 9940992f-1fed-499f-bb0e-db41f2f01579: MechanismDriverError
2019-04-15 10:44:34.379 28 DEBUG neutron.plugins.ml2.managers [req-ec354b24-798c-4033-ac03-204b0d6a50e0 d31d909be1824786a245a09a1dc8dad6 966641895d4e4c0b821bf98312304b48 - default default] Attempting to bind por
t 9940992f-1fed-499f-bb0e-db41f2f01579 on host compute-0.localdomain for vnic_type normal with profile  bind_port /usr/lib/python2.7/site-packages/neutron/plugins/ml2/managers.py:745
2019-04-15 10:44:34.379 28 DEBUG neutron.plugins.ml2.managers [req-ec354b24-798c-4033-ac03-204b0d6a50e0 d31d909be1824786a245a09a1dc8dad6 966641895d4e4c0b821bf98312304b48 - default default] Attempting to bind por
t 9940992f-1fed-499f-bb0e-db41f2f01579 on host compute-0.localdomain at level 0 using segments [{'network_id': '48c91900-e4b8-4780-be63-597700758845', 'segmentation_id': None, 'physical_network': u'datacentre', 
'id': 'd985de24-1f64-4622-875e-47f5f74abd6e', 'network_type': u'flat'}] _bind_port_level /usr/lib/python2.7/site-packages/neutron/plugins/ml2/managers.py:766
2019-04-15 10:44:34.380 28 DEBUG networking_ovn.ml2.mech_driver [req-ec354b24-798c-4033-ac03-204b0d6a50e0 d31d909be1824786a245a09a1dc8dad6 966641895d4e4c0b821bf98312304b48 - default default] Attempting to bind p
ort 9940992f-1fed-499f-bb0e-db41f2f01579 on host compute-0.localdomain for network segment with type flat, segmentation ID None, physical network datacentre bind_port /usr/lib/python2.7/site-packages/networking_
ovn/ml2/mech_driver.py:635

Comment 1 Roman Safronov 2019-04-15 12:29:09 UTC
Note: I tested the same scenario on a upstream Queens environment with linuxbridge mechanism driver and instance booted successfully.

Comment 2 Roman Safronov 2019-04-16 13:17:07 UTC
Note: tested same scenario on OSP14z2: 14.0-RHEL-7/2019-04-12.1. Worked properly. Instance stated successfully and was accessible (created external subnet with dhcp enabled).

Comment 4 Roman Safronov 2019-04-25 09:23:35 UTC
Failed to reproduce on 13.0-RHEL-7/2019-04-18.2, an instance connected to external network was successfully created with status ACTIVE and was accessible.
As I do not have sos reports from the environment from the description I am closing the issue as WORKSFORME. 
In case the issue re-occur a new bug will be opened with sos report specified.