[contrail][horizon] Bad subnet request: update of allocation_pools is not allowed

Bug #1638847 reported by Serg Lystopad
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Fuel Contrail plugin
Fix Released
Medium
Illia Polliul

Bug Description

Detailed bug description:
The error appears when horizon user updates DNS servers addresses in existing subnet (VN subnet).

Erros comes from Contrail, log files contains

in Contrail controller /var/log/contrail/contrail-api-0-stdout.log
172.18.62.1 - - [2016-11-01 13:32:00] "POST /neutron/subnet HTTP/1.1" 200 559 0.127021
<pre>Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py", line 290, in plugin_update_subnet
    subnet['resource'])
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 2325, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 2659, in subnet_update
    msg="update of allocation_pools is not allowed")
  File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 194, in _raise_contrail_exception
    bottle.abort(400, json.dumps(exc_info))
  File "/usr/lib/python2.7/dist-packages/bottle.py", line 2310, in abort
    raise HTTPError(code, text)
HTTPError
</pre>
172.18.62.1 - - [2016-11-01 13:32:01] "POST /neutron/subnet HTTP/1.1" 400 227 0.007812

in MOS controller /var/log/neutron/server.log:2016-11-01 13:45:45.400 24899 INFO neutron.api.v2.resource [req-e88a1d62-cb23-413a-98c4-abb5c48a1536 805a89456ccbbe3c338a1472d0127b3b3b01133a75d53e6246eee2f49aefdf20 20446d16f9ef4613871ef4272fe8e12c - - -] update failed (client error): Bad subnet request: update of allocation_pools is not allowed

in MOS controller /var/log/horizon/horizon.log
2016-11-01 12:50:31,803 1260 WARNING horizon.exceptions Recoverable error: Bad subnet request: update of allocation_pools is not allowed

Updating DNS servers using CLI works just fine:

root@node-22:/etc/cinder# neutron subnet-show a662c998-1080-4c03-8fb9-2ae69caa99f7
+-------------------+------------------------------------------------+
| Field | Value |
+-------------------+------------------------------------------------+
| allocation_pools | {"start": "10.10.10.10", "end": "10.10.10.32"} |
| cidr | 10.10.10.0/24 |
| dns_nameservers | 8.8.8.8 |
| enable_dhcp | True |
| gateway_ip | 10.10.10.1 |
| host_routes | |
| id | a662c998-1080-4c03-8fb9-2ae69caa99f7 |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | Joomla subnet |
| network_id | 62038f1a-904b-46a7-926b-562e3162a646 |
| tenant_id | 3f6dcba833ff42a5a10541afdadc0da6 |
+-------------------+------------------------------------------------+
root@node-22:/etc/cinder# neutron subnet-update --dns-nameserver 4.4.2.2 a662c998-1080-4c03-8fb9-2ae69caa99f7
Updated subnet: a662c998-1080-4c03-8fb9-2ae69caa99f7
root@node-22:/etc/cinder# neutron subnet-show a662c998-1080-4c03-8fb9-2ae69caa99f7
+-------------------+------------------------------------------------+
| Field | Value |
+-------------------+------------------------------------------------+
| allocation_pools | {"start": "10.10.10.10", "end": "10.10.10.32"} |
| cidr | 10.10.10.0/24 |
| dns_nameservers | 4.4.2.2 |
| enable_dhcp | True |
| gateway_ip | 10.10.10.1 |
| host_routes | |
| id | a662c998-1080-4c03-8fb9-2ae69caa99f7 |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | Joomla subnet |
| network_id | 62038f1a-904b-46a7-926b-562e3162a646 |
| tenant_id | 3f6dcba833ff42a5a10541afdadc0da6 |
+-------------------+------------------------------------------------+

Steps to reproduce:
deploy MOS8 with fuel-plugin-contrail 4.0, go to Horizon Network->Networks
select some VN, edit existing subnetwork, go to Subnet Detail tab change 'DNS Name Servers' value, hit 'Create'

Expected results:
 DNS servers has been changed
Actual result:
 error - Bad subnet request: update of allocation_pools is not allowed

Description of the environment:
VERSION:
  feature_groups:
    - mirantis
  production: "docker"
  release: "8.0"
  api: "1.0"
  build_number: "570"
  build_id: "570"
  fuel-nailgun_sha: "558ca91a854cf29e395940c232911ffb851899c1"
  python-fuelclient_sha: "4f234669cfe88a9406f4e438b1e1f74f1ef484a5"
  fuel-agent_sha: "658be72c4b42d3e1436b86ac4567ab914bfb451b"
  fuel-nailgun-agent_sha: "b2bb466fd5bd92da614cdbd819d6999c510ebfb1"
  astute_sha: "b81577a5b7857c4be8748492bae1dec2fa89b446"
  fuel-library_sha: "c2a335b5b725f1b994f78d4c78723d29fa44685a"
  fuel-ostf_sha: "3bc76a63a9e7d195ff34eadc29552f4235fa6c52"
  fuel-mirror_sha: "fb45b80d7bee5899d931f926e5c9512e2b442749"
  fuelmenu_sha: "78ffc73065a9674b707c081d128cb7eea611474f"
  shotgun_sha: "63645dea384a37dde5c01d4f8905566978e5d906"
  network-checker_sha: "a43cf96cd9532f10794dce736350bf5bed350e9d"
  fuel-upgrade_sha: "616a7490ec7199f69759e97e42f9b97dfc87e85b"
  fuelmain_sha: "d605bcbabf315382d56d0ce8143458be67c53434"

[root@fuel8 ~]# fuel plugins | grep contrail
16 | contrail | 4.0.0 | 4.0.0

# contrail-version
Package Version Build-ID | Repo | Package Name
-------------------------------------- ------------------------------ ----------------------------------
contrail-analytics 3.0.2.0-51 51
contrail-config 3.0.2.0-51 51
contrail-config-openstack 3.0.2.0-51 51
contrail-control 3.0.2.0-51 51
contrail-dns 3.0.2.0-51 51
contrail-f5 3.0.2.0-51 51
contrail-lib 3.0.2.0-51 51
contrail-nodemgr 3.0.2.0-51 51
contrail-openstack-analytics 3.0.2.0-51 51
contrail-openstack-config 3.0.2.0-51 51
contrail-openstack-control 3.0.2.0-51 51
contrail-openstack-database 3.0.2.0-51 51
contrail-openstack-webui 3.0.2.0-51 51
contrail-setup 3.0.2.0-51 51
contrail-utils 3.0.2.0-51 51
contrail-web-controller 3.0.2.0-51 51
contrail-web-core 3.0.2.0-51 51
ifmap-python-client 0.1-2 51
ifmap-server 0.3.2-1contrail2 51
neutron-plugin-contrail 3.0.2.0-51 51
python-contrail 3.0.2.0-51 51
python-neutronclient 1:3.1.0-0ubuntu1~cloud0.2contrail51

Revision history for this message
Volodymyr Rozhanskyy (vrozhanskyy) wrote :

Defect reporduced on MOS 9.0
Same behavior:
Expected results:
 DNS servers has been changed
Actual result:
 error - Bad subnet request: update of allocation_pools is not allowed

plugin version :
 name | version | package_version | releases
 Contrail | 5.0.0 | 4.0.0 | ubuntu (mitaka-9.0)
Contrail version :
Package Version Build-ID | Repo | Package Name
-------------------------------------- ------------------------------ ----------------------------------
contrail-config 3.1.0.0-25 25
contrail-config-openstack 3.1.0.0-25 25
contrail-control 3.1.0.0-25 25
contrail-database-common 3.1.0.0-25 25
contrail-dns 3.1.0.0-25 25
contrail-f5 3.1.0.0-25 25
contrail-lib 3.1.0.0-25 25
contrail-nodemgr 3.1.0.0-25 25
contrail-openstack-config 3.1.0.0-25 25
contrail-openstack-control 3.1.0.0-25 25
contrail-openstack-database 3.1.0.0-25 25
contrail-openstack-webui 3.1.0.0-25 25
contrail-setup 3.1.0.0-25 25
contrail-utils 3.1.0.0-25 25
contrail-web-controller 3.1.0.0-25 25
contrail-web-core 3.1.0.0-25 25
ifmap-python-client 0.1-2 25
ifmap-server 0.3.2-1contrail2 25
neutron-plugin-contrail 3.1.0.0-25 25
python-contrail 3.1.0.0-25 25
python-neutronclient 1:4.1.1-2~cloud0.2contrail 25

---------------------------------------------------------------------------------------

There is a workaround to set DNS via Horizon.You need to update DNS and also clear section in Allocation Pool then hit Save. DNS for subnet will be updated .

okosse (okosse)
Changed in mos:
status: New → Confirmed
Revision history for this message
Denis Meltsaykin (dmeltsaykin) wrote :

It looks like Horizon tries to change all the fields of a subnet despite the fact that only DNS-server has changed.

tags: added: area-horizon
Revision history for this message
Serg Lystopad (slystopad) wrote :

Denis is right -

when neutron CLI is used request contains only 'dns_nameservers' property:
<167>Nov 15 13:33:45 node-22 neutron-server: 2016-11-15 13:33:45.533 5674 DEBUG neutron.api.v2.base [req-59b5f19c-543e-4a3e-a557-e182836bfe9b 52b0b9b6ba4e0fd9fd1d59cd132
c18706b32d235999c690a6596e340396d3064 1eaece135abf4ea4bf71f02d3fc80a24 - - -] Request body: {u'subnet': {u'dns_nameservers': [u'8.8.4.4']}} prepare_request_body /usr/lib
/python2.7/dist-packages/neutron/api/v2/base.py:656

request from Horizon contains all subnet properties:
<167>Nov 15 14:21:42 node-22 neutron-server: 2016-11-15 14:21:42.951 5670 DEBUG neutron.api.v2.base [req-b5a1875b-e199-4deb-9a6c-1fbb4c6153b7 eb861722fc48810f4ac0165b6ef
83e8f2dba328dbd63758ea04e1130b53e2a83 3f6dcba833ff42a5a10541afdadc0da6 - - -] Request body: {u'subnet': {u'dns_nameservers': [u'222.222.222.222'], u'allocation_pools': [
{u'start': u'10.1.1.2', u'end': u'10.1.1.254'}], u'host_routes': [], u'name': u'xxx_sub', u'enable_dhcp': True}} prepare_request_body /usr/lib/python2.7/dist-packages/ne
utron/api/v2/base.py:656

Revision history for this message
Serg Lystopad (slystopad) wrote :

> There is a workaround to set DNS via Horizon.You need to update DNS and also clear section in Allocation Pool then hit Save. DNS for subnet will be updated .

There is no 'Allocation Pool' field when you edit existing subnet (screenshot is attached)

Revision history for this message
Sergii Rizvan (srizvan) wrote :

We were able to fix the issue by installing Contrail extension to Horizon: https://github.com/Juniper/contrail-horizon/
It contains the next code which disables Allocation Pools form from being shown: https://github.com/Juniper/contrail-horizon/blob/ad5e538aae1af850b22d79403841c368ae3601e6/openstack_dashboard/dashboards/project/networking/subnets/workflows.py#L144-L146
So appropriate approach for fixing the issue might be just including this extension to Contrail plugin.

Revision history for this message
Denis Meltsaykin (dmeltsaykin) wrote :

I'm re-assigning this bug to the Fuel Contrail team and moving from 9.2-mu-1 since plugins are not part of MUs.

Revision history for this message
Illia Polliul (ipolliul) wrote :

Adding Contrail-Horizon solves this problems, but adds some other. I'll investigate it further.

Revision history for this message
Illia Polliul (ipolliul) wrote :
no longer affects: mos
Changed in fuel-plugin-contrail:
assignee: nobody → Illia Polliul (ipolliul)
milestone: none → 5.0.1
importance: Undecided → Medium
status: New → Fix Released
no longer affects: mos/10.0.x
no longer affects: mos/8.0.x
no longer affects: mos/9.x
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.