[2.0a4] When providng DHCP a smarter default dynamic range is needed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Mike Pontillo |
Bug Description
When using the "Provide DHCP" option to provide DHCP for the first time on a subnet, we simply scan the subnet for the largest available block, and pre-populate the start and end IP addresses with that range.
That is not desirable, because then there will not be any room left over on the subnet for static IP addresses.
We should take the largest range and make a better initial proposal. Suggestion:
- Initially try to propose no more than 1/4 of the range to be dynamic. For example, on a /24, we could attempt to allocate 64 addresses to the dynamic range.
- If less than 50% of the range is available for allocation, try to use 50% of the largest available block of addresses. For example, if there are 50 addresses free on a /24 and we go to provide DHCP, we should propose a range with 25 addresses for the dynamic range, so that the remaining 25 addresses can be used for static IP address assignment.
Additionally, we need better client-side validation to ensure selected IP addresses are within the subnet specified by the user. (for added benefit, we can even validate that the addresses are not within an existing allocation block - before submitting it to the server)
Related branches
- Blake Rouse (community): Approve
-
Diff: 790 lines (+423/-83)12 files modifiedsrc/maasserver/api/subnets.py (+8/-1)
src/maasserver/api/tests/test_subnets.py (+19/-4)
src/maasserver/models/subnet.py (+12/-4)
src/maasserver/static/js/angular/controllers/tests/test_vlan_details.js (+57/-56)
src/maasserver/static/js/angular/controllers/vlan_details.js (+25/-6)
src/maasserver/static/partials/vlan-details.html (+3/-3)
src/maasserver/testing/factory.py (+3/-2)
src/maasserver/websockets/handlers/subnet.py (+2/-1)
src/maasserver/websockets/handlers/tests/test_subnet.py (+2/-1)
src/maastesting/factory.py (+4/-2)
src/provisioningserver/utils/network.py (+163/-3)
src/provisioningserver/utils/tests/test_network.py (+125/-0)
Changed in maas: | |
milestone: | none → 2.0.0 |
importance: | High → Critical |
Changed in maas: | |
assignee: | nobody → Jeffrey C Jones (trapnine) |
status: | Triaged → In Progress |
Changed in maas: | |
assignee: | Jeffrey C Jones (trapnine) → Mike Pontillo (mpontillo) |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |