Bug 1490092

Summary: OVN network subnet without DNS or gateway unexpected behaviour
Product: [oVirt] ovirt-provider-ovn Reporter: Mor <mkalfon>
Component: providerAssignee: Marcin Mirecki <mmirecki>
Status: CLOSED CURRENTRELEASE QA Contact: Mor <mkalfon>
Severity: high Docs Contact:
Priority: high    
Version: 1.0.4CC: bugs, danken, ylavi
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 11:07:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine and ovirt-provider-ovn logs none

Description Mor 2017-09-10 06:29:58 UTC
Created attachment 1324244 [details]
engine and ovirt-provider-ovn logs

Description of problem:
When creating OVN subnet without specifying a DNS server or gateway, OVN throws a generic error in the UI: "Error while executing action Add Subnet to Provider: Failed to communicate with the external provider, see log for additional details.", and the provider doesn't handle the case, and throws an exception:
Traceback (most recent call last):
  File "/usr/share/ovirt-provider-ovn/handlers/base_handler.py", line 111, in _handle_request
    method, key, id, content)
  File "/usr/share/ovirt-provider-ovn/handlers/selecting_handler.py", line 53, in handle_request
    self._get_response_handler(method, key), content, id
  File "/usr/share/ovirt-provider-ovn/handlers/neutron.py", line 36, in call_response_handler
    return response_handler(ovn_north, content, id)
  File "/usr/share/ovirt-provider-ovn/handlers/neutron_responses.py", line 143, in post_subnets
    subnet = nb_db.add_subnet(received_subnet)
  File "/usr/share/ovirt-provider-ovn/ovndb/ovn_north_mappers.py", line 58, in wrapper
    else f(wrapped_self, rest_data))
  File "/usr/share/ovirt-provider-ovn/ovndb/ovn_north_mappers.py", line 41, in wrapper
    return cls.rest2row(wrapped_self, f, rest_data, entity_id)
  File "/usr/share/ovirt-provider-ovn/ovndb/ovn_north_mappers.py", line 272, in rest2row
    if SubnetMapper.REST_SUBNET_DNS_NAMESERVERS in rest_data
IndexError: list index out of range


Version-Release number of selected component (if applicable):
ovirt-provider-ovn-1.1-2.20170905145914.gitaf4fe87.el7.centos.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create OVN network with subnet, specify CIDR, and don't specify gateway or DNS server.

Actual results:
UI throws error, ovirt-provider-ovn throws exception.

Expected results:
UI should display a guided message to the user, for example, "DNS / gateway is required in order to create a subnet". ovirt-provider-ovn should handle this and log similar message.

Comment 1 Mor 2017-09-25 11:13:56 UTC
Verified on:
4.2.0-0.0.master.20170924221426.git196b802.el7.centos

Comment 2 Sandro Bonazzola 2017-12-20 11:07:09 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.