Updating a subnet to enable dhcp is failing

Bug #1332231 reported by Vedamurthy Joshi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Fix Committed
High
Praneet Bachheti

Bug Description

Build 1.06-47

Create a subnet with dhcp disabled.
Update the subnet to enable the dhcp. This fails.

root@nodec34:~# neutron subnet-create net1 10.0.0.0/24 --enable_dhcp False
Created a new subnet:
+-------------------------+--------------------------------------------+
| Field | Value |
+-------------------------+--------------------------------------------+
| allocation_pools | {"start": "10.0.0.2", "end": "10.0.0.254"} |
| cidr | 10.0.0.0/24 |
| contrail:instance_count | 0 |
| contrail:ipam_fq_name | default-domain |
| | default-project |
| | default-network-ipam |
| dns_nameservers | |
| enable_dhcp | False |
| gateway_ip | 10.0.0.1 |
| host_routes | |
| id | 7a7408dc-363d-44ea-a0f9-30e6e6d824ca |
| ip_version | 4 |
| name | |
| network_id | 333c09f3-bd69-4207-acd5-5f157f8aaeb3 |
| tenant_id | bcbac3687162482bb9a59175e58f639b |
+-------------------------+--------------------------------------------+
root@nodec34:~#

root@nodec34:~# neutron subnet-update 7a7408dc-363d-44ea-a0f9-30e6e6d824ca --enable_dhcp true
Request Failed: internal server error while processing your request.
root@nodec34:~#

2014-06-19 23:18:43.3 ERROR [neutron.api.v2.resource] update failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/neutron/api/v2/resource.py", line 84, in resource
    result = method(request=request, **args)
  File "/usr/lib/python2.7/dist-packages/neutron/api/v2/base.py", line 486, in update
    obj = obj_updater(request.context, id, **kwargs)
  File "/usr/lib/python2.7/dist-packages/neutron_plugin_contrail/plugins/opencontrail/contrailplugin.py", line 406, in update_subnet
    raise e
AttributeError: 'DBInterface' object has no attribute 'subnet_update'

Tags: config
information type: Proprietary → Public
Revision history for this message
Vedamurthy Joshi (vedujoshi) wrote :

On Build 1.06-50, I am getting below error while setting the dhcp to false.

2014-06-21 14:11:04.202 ERROR [neutron.api.v2.resource] update failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/neutron/api/v2/resource.py", line 84, in resource
    result = method(request=request, **args)
  File "/usr/lib/python2.7/dist-packages/neutron/api/v2/base.py", line 486, in update
    obj = obj_updater(request.context, id, **kwargs)
  File "/usr/lib/python2.7/dist-packages/neutron_plugin_contrail/plugins/opencontrail/contrailplugin.py", line 408, in update_subnet
    raise e
HttpError: HTTP Status: 500 Content: Virtual-Network(default-domain:admin:mynet1) has invalid subnet(10.0.1.0/24)

Revision history for this message
Prakash Bailkeri (prakashmb) wrote :

This error is due to check with vnc_addr_mgmt.py to disallow subnet update.

                if ((req_subnet['enable_dhcp'] != db_subnet['enable_dhcp']) or
                    (req_subnet['gw'] != db_subnet['gw']) or
                    (set(req_subnet.get('dns_nameservers') or []) !=
                     set(db_subnet.get('dns_nameservers') or []))):
                    raise AddrMgmtSubnetInvalid(vn_fq_name_str, key)

Numan Siddique is working on fix to remove these checks (leaving the gw check behind)

Revision history for this message
Numan Siddique (numansiddique) wrote :

https://review.opencontrail.org/#/c/500/ this should fix the above 'invalid subnet' error

Revision history for this message
Vedamurthy Joshi (vedujoshi) wrote :

On 1.10, i dont get internal server error, but update is not happing

root@nodec22:/usr/lib/python2.7/dist-packages/neutronclient# neutron subnet-update 0c90fd0c-770c-4859-ac06-e585f47ad080 --enable_dhcp=True
Updated subnet: 0c90fd0c-770c-4859-ac06-e585f47ad080
root@nodec22:/usr/lib/python2.7/dist-packages/neutronclient#

root@nodec22:/usr/lib/python2.7/dist-packages/neutronclient# neutron subnet-show 0c90fd0c-770c-4859-ac06-e585f47ad080
+------------------+---------------------------------------------------+
| Field | Value |
+------------------+---------------------------------------------------+
| allocation_pools | {"last_ip": "70.1.1.254", "first_ip": "70.1.1.2"} |
| cidr | 70.1.1.0/24 |
| dns_nameservers | |
| enable_dhcp | False |
| gateway_ip | 70.1.1.1 |
| id | 0c90fd0c-770c-4859-ac06-e585f47ad080 |
| ip_version | 4 |
| name | |
| network_id | d12a1c0a-1158-4ace-961c-c30de6c50644 |
| tenant_id | c579a77385914ecfb6698515d3c5c3cf |
+------------------+---------------------------------------------------+
root@nodec22:/usr/lib/python2.7/dist-packages/neutronclient#

Sachin Bansal (sbansal)
Changed in juniperopenstack:
assignee: Hampapur Ajay (hajay) → Praneet Bachheti (praneetb)
Revision history for this message
Praneet Bachheti (praneetb) wrote :

commit 04a065157ce759d0fc05e76c03b8297e9a4ed8b9
Author: Praneet Bachheti <email address hidden>
Date: Tue Jul 29 10:18:23 2014 -0700

    port subnet update from R1.06
    - we do not support gateway_ip update

    Change-Id: I56d336a2ef2cdcc8463eb7dee267baa632735910

Changed in juniperopenstack:
status: New → Fix Committed
Revision history for this message
Vedamurthy Joshi (vedujoshi) wrote : Re: [Bug 1332231] Re: Updating a subnet to enable dhcp is failing
Download full text (3.3 KiB)

Could you please commit this to 1.10 ?

On 7/31/14, 10:01 AM, "Praneet Bachheti" <email address hidden> wrote:

>commit 04a065157ce759d0fc05e76c03b8297e9a4ed8b9
>Author: Praneet Bachheti <email address hidden>
>Date: Tue Jul 29 10:18:23 2014 -0700
>
> port subnet update from R1.06
> - we do not support gateway_ip update
>
> Change-Id: I56d336a2ef2cdcc8463eb7dee267baa632735910
>
>** Changed in: juniperopenstack
> Status: New => Fix Committed
>
>--
>You received this bug notification because you are a member of Contrail
>Systems engineering, which is subscribed to Juniper Openstack.
>https://bugs.launchpad.net/bugs/1332231
>
>Title:
> Updating a subnet to enable dhcp is failing
>
>Status in Juniper Openstack distribution:
> Fix Committed
>
>Bug description:
> Build 1.06-47
>
> Create a subnet with dhcp disabled.
> Update the subnet to enable the dhcp. This fails.
>
> root@nodec34:~# neutron subnet-create net1 10.0.0.0/24 --enable_dhcp
>False
> Created a new subnet:
> +-------------------------+--------------------------------------------+
> | Field | Value |
> +-------------------------+--------------------------------------------+
> | allocation_pools | {"start": "10.0.0.2", "end": "10.0.0.254"} |
> | cidr | 10.0.0.0/24 |
> | contrail:instance_count | 0 |
> | contrail:ipam_fq_name | default-domain |
> | | default-project |
> | | default-network-ipam |
> | dns_nameservers | |
> | enable_dhcp | False |
> | gateway_ip | 10.0.0.1 |
> | host_routes | |
> | id | 7a7408dc-363d-44ea-a0f9-30e6e6d824ca |
> | ip_version | 4 |
> | name | |
> | network_id | 333c09f3-bd69-4207-acd5-5f157f8aaeb3 |
> | tenant_id | bcbac3687162482bb9a59175e58f639b |
> +-------------------------+--------------------------------------------+
> root@nodec34:~#
>
> root@nodec34:~# neutron subnet-update
>7a7408dc-363d-44ea-a0f9-30e6e6d824ca --enable_dhcp true
> Request Failed: internal server error while processing your request.
> root@nodec34:~#
>
>
> 2014-06-19 23:18:43.3 ERROR [neutron.api.v2.resource] update failed
> Traceback (most recent call last):
> File "/usr/lib/python2.7/dist-packages/neutron/api/v2/resource.py",
>line 84, in resource
> result = method(request=request, **args)
> File "/usr/lib/python2.7/dist-packages/neutron/api/v2/base.py", line
>486, in update
> obj = obj_updater(request.context, id, **kwargs)
> File
>"/usr/lib/python2.7/dist-packages/neutron_plugin_contrail/plugins/opencont
>rail/contrailplugin.py", line 406, in update_su...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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