yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #51234
[Bug 1580927] Re: spans beyond the subnet for /31 and /32 in IPam
** Changed in: neutron
Status: Invalid => Confirmed
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1580927
Title:
spans beyond the subnet for /31 and /32 in IPam
Status in neutron:
Confirmed
Bug description:
summary: When needing to create a point to point connection via a
subnet, generally and /31 is the recommended cidr. Neutron supports
/31 via disabling dhcp and gateway on a subnet. However, IPam does
not provide the allocation pool of the subnet properly and a VM cannot
be created.
Steps to reproduce
root@ubuntu:~# neutron subnet-create --disable-dhcp --no-gateway --cidr=10.14.0.20/31 --name bug-subnet 69c5342a-5526-4257-880a-f8fd2e633de9
Created a new subnet:
+-------------------+--------------------------------------+
| Field | Value |
+-------------------+--------------------------------------+
| allocation_pools | |
| cidr | 10.14.0.20/31 |
| dns_nameservers | |
| enable_dhcp | False |
| gateway_ip | |
| host_routes | |
| id | 63ce4e26-9838-4fa3-b2d5-e59f88f5b7ce |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | bug-subnet |
| network_id | 69c5342a-5526-4257-880a-f8fd2e633de9 |
| subnetpool_id | |
| tenant_id | ca02fc470acc4a27b468dff32ee850b2 |
+-------------------+--------------------------------------+
root@ubuntu:~# neutron subnet-update --allocation-pool start=10.14.0.20,end=10.14.0.21 bug-subnet
The allocation pool 10.14.0.20-10.14.0.21 spans beyond the subnet cidr 10.14.0.20/31.
Recommended Fix:
in db/ipam_backend_mixin.py :: function: validate_allocation_pools
~~lines: 276
if start_ip < subnet_first_ip or end_ip > subnet_last_ip:
LOG.info(_LI("Found pool larger than subnet "
"CIDR:%(start)s - %(end)s"),
{'start': start_ip, 'end': end_ip})
raise n_exc.OutOfBoundsAllocationPool(
pool=ip_pool,
subnet_cidr=subnet_cidr)
This if block should have a special case for ipv4 /31 and /32 for "<= and >=" :
start_ip <= subnet_first_ip or end_ip >= subnet_last_ip
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1580927/+subscriptions
References