Subnet update with allocation-pools and no-allocation-pools does not reflect in Configuration DataStore
Description
Environment
Operating System: All
Platform: All
Attachments
Activity
Venkatrangan Govindarajan January 31, 2018 at 7:03 AM
Fixed in networking-odl

Hari Prasad December 14, 2017 at 9:37 AM
I've tested with above patch and observed issue is not reproduced .
Thanks for your patch.

Isaku Yamahata December 13, 2017 at 1:38 AM
Can you please try https://review.openstack.org/#/c/527556/ ?

Isaku Yamahata December 13, 2017 at 1:25 AM
It looks like an issue in netwokring-odl or openstack neutron. Let me dig into it.
Also can you get openstack neutron log with debug=true and with logger ml2 driver enabled?

Hari Prasad November 10, 2017 at 10:56 AMEdited
I have tested the same scenario in pike/nitrogen and have observed during subnet creation, the Json request made with "allocation_pools" from networking-odl where as in subnet update json request made without "allocation_pools".
please find the attachment for server log.
Subnet create:
----------------
2017-11-10 18:03:28.469 7256 INFO networking_odl.journal.journal [req-942d2a71-0534-4f77-a901-046e63f7e52f - - - - -] Processing - create subnet 45a46065-aa42-41a2-ac72-1a3f2013da83
2017-11-10 18:03:28.469 7256 DEBUG networking_odl.common.client [req-942d2a71-0534-4f77-a901-046e63f7e52f - - - - -] Sending METHOD (post) URL (http://192.168.70.111:8080/controller/nb/v2/neutron/subnets) JSON ({
"subnet": {
"updated_at": "2017-11-10T23:03:28Z",
"ipv6_ra_mode": null,
"allocation_pools": [
{
"start": "10.0.0.20",
"end": "10.0.0.100"
}
],
"host_routes": [],
"revision_number": 0,
"ipv6_address_mode": null,
"id": "45a46065-aa42-41a2-ac72-1a3f2013da83",
"dns_nameservers": [],
"gateway_ip": "10.0.0.1",
"shared": false,
"project_id": "6897fe14713d429f9dc88cf878f80a11",
"description": "",
"tags": [],
"cidr": "10.0.0.0/24",
"service_types": [],
"name": "sub1",
"enable_dhcp": true,
"network_id": "1bbbb3fc-34bd-4c9a-b583-8bf604a88243",
"tenant_id": "6897fe14713d429f9dc88cf878f80a11",
"created_at": "2017-11-10T23:03:28Z",
"ip_version": 4
}
}) request /usr/lib/python2.7/site-packages/networking_odl/common/client.py:89
Subnetupdate:
---------------
2017-11-10 18:04:43.891 7262 INFO networking_odl.journal.journal [req-bfc04f5b-f8f2-403b-8acf-69eadb2c46f0 - - - - -] Processing - update subnet 45a46065-aa42-41a2-ac72-1a3f2013da83
2017-11-10 18:04:43.893 7262 DEBUG networking_odl.common.client [req-bfc04f5b-f8f2-403b-8acf-69eadb2c46f0 - - - - -] Sending METHOD (put) URL (http://192.168.70.111:8080/controller/nb/v2/neutron/subnets/45a46065-aa42-41a2-ac72-1a3f2013da83) JSON ({
"subnet": {
"updated_at": "2017-11-10T23:04:43Z",
"ipv6_ra_mode": null,
"host_routes": [],
"revision_number": 1,
"ipv6_address_mode": null,
"dns_nameservers": [],
"gateway_ip": "10.0.0.1",
"shared": false,
"description": "",
"tags": [],
"service_types": [],
"name": "sub1",
"enable_dhcp": true,
"created_at": "2017-11-10T23:03:28Z"
}
}) request /usr/lib/python2.7/site-packages/networking_odl/common/client.py:89
If am not wrong, the update request should made with the "allocation-pool", which was missing above, so that config data store not update with "allocation-pools".
Distro: distribution-karaf-0.6.0-Carbon.tar.gz
Openstack setup: carbon + ocata
ODL setup: 3 node cluster setup
Steps:
1. Create a network:
network create net1 --provider-network-type vxlan
2. Create a subnet:
subnet create --network net1 --allocation-pool start=10.0.0.20,end=10.0.0.100 --subnet-range 10.0.0.0/24 sub1
Set allocation pool
===================
3. Update subnet:
subnet set --allocation-pool start=10.0.0.101,end=10.0.0.200 sub1
Karaf logs:
Update Subnet notification handler is invoked Original: Subnet{getAllocationPools=[AllocationPools{getEnd=IpAddress [_ipv4Address=Ipv4Address [_value=10.0.0.100]], getStart=IpAddress [_ipv4Address=Ipv4Address [_value=10.0.0.20]], augmentations={}}], getCidr=IpPrefix [_ipv4Prefix=Ipv4Prefix [_value=10.0.0.0/24]], getDnsNameservers=[], getGatewayIp=IpAddress [_ipv4Address=Ipv4Address [_value=10.0.0.1]], getHostRoutes=[], getIpVersion=class org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.IpVersionV4, getName=sub1, getNetworkId=Uuid [_value=a1159d34-fc70-4418-b980-b47103ca28b2], getProjectId=9c9916b0cd944640a4286dbf148d5c6a, getRevisionNumber=2, getTenantId=Uuid [_value=9c9916b0-cd94-4640-a428-6dbf148d5c6a], getUuid=Uuid [_value=fddc3173-1ee6-4e32-89d9-a7eeeac2bef1], isEnableDhcp=true, augmentations={}}, Update: Subnet{getCidr=IpPrefix [_ipv4Prefix=Ipv4Prefix [_value=10.0.0.0/24]], getDnsNameservers=[], getGatewayIp=IpAddress [_ipv4Address=Ipv4Address [_value=10.0.0.1]], getHostRoutes=[], getIpVersion=class org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.IpVersionV4, getName=sub1, getNetworkId=Uuid [_value=a1159d34-fc70-4418-b980-b47103ca28b2], getRevisionNumber=3, getTenantId=Uuid [_value=9c9916b0-cd94-4640-a428-6dbf148d5c6a], getUuid=Uuid [_value=fddc3173-1ee6-4e32-89d9-a7eeeac2bef1], isEnableDhcp=true, augmentations={}}
Set no-allocation pool
======================
4. Update subnet:
subnet set --allocation-pool start=10.0.0.101,end=10.0.0.200 --no-allocation-pool sub1
Karaf logs:
Update Subnet notification handler is invoked Original: Subnet{getCidr=IpPrefix [_ipv4Prefix=Ipv4Prefix [_value=10.0.0.0/24]], getDnsNameservers=[], getGatewayIp=IpAddress [_ipv4Address=Ipv4Address [_value=10.0.0.1]], getHostRoutes=[], getIpVersion=class org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.IpVersionV4, getName=sub1, getNetworkId=Uuid [_value=a1159d34-fc70-4418-b980-b47103ca28b2], getRevisionNumber=3, getTenantId=Uuid [_value=9c9916b0-cd94-4640-a428-6dbf148d5c6a], getUuid=Uuid [_value=fddc3173-1ee6-4e32-89d9-a7eeeac2bef1], isEnableDhcp=true, augmentations={}}, Update: Subnet{getCidr=IpPrefix [_ipv4Prefix=Ipv4Prefix [_value=10.0.0.0/24]], getDnsNameservers=[], getGatewayIp=IpAddress [_ipv4Address=Ipv4Address [_value=10.0.0.1]], getHostRoutes=[], getIpVersion=class org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.constants.rev150712.IpVersionV4, getName=sub1, getNetworkId=Uuid [_value=a1159d34-fc70-4418-b980-b47103ca28b2], getRevisionNumber=4, getTenantId=Uuid [_value=9c9916b0-cd94-4640-a428-6dbf148d5c6a], getUuid=Uuid [_value=fddc3173-1ee6-4e32-89d9-a7eeeac2bef1], isEnableDhcp=true, augmentations={}}
Observation:
1. In both updates, the allocation-pools values are not modified.
Whereas, while giving the "openstack subnet show sub1" command, the allocation pools are modified with updated values.
PFA for Datastore and Openstack show command.