[pve-devel] [WIP pve-network 0/3] dhcp changes

Alexandre Derumier aderumier at odiso.com
Thu Nov 9 01:25:07 CET 2023


Here my current work, based on wip2 Stefan Hanreich

It's not yet completed, I'll try to send a more complete serie next week

- patch1: remove need of dhcp.cfg, and declare dhcp plugin type in zone directly.
  each zone is a dhcpserver , that's make sense, as 2 zones can have same subnets in differents vrf.
 
- patch2/3:  need more patches, but my idea is to split the ipam add|del ip && the dhcp server ip-mac reservation file genreation.

  at vm|nic create : find a free ip in dhcp range and register ip/mac in ipam
  at vm start : search ip from mac in ipam, and add add it to local dhcp reversation file 

  also reuse currently vnet add_next_free_ip, as it's already plugged with dns too.





Alexandre Derumier (3):
  define dhcpplugin in zone
  dhcp : add|del_ip_mapping: only add|del dhcp reservervation
  vnet|subnet: add_next_free_ip : implement dhcprange ipam search

 src/PVE/API2/Network/SDN/Zones.pm         |   1 +
 src/PVE/Network/SDN.pm                    |   4 +-
 src/PVE/Network/SDN/Dhcp.pm               | 166 ++++++----------------
 src/PVE/Network/SDN/Dhcp/Dnsmasq.pm       |  32 ++---
 src/PVE/Network/SDN/Dhcp/Plugin.pm        |  28 +---
 src/PVE/Network/SDN/Ipams/PVEPlugin.pm    |  12 +-
 src/PVE/Network/SDN/Ipams/Plugin.pm       |   7 +
 src/PVE/Network/SDN/SubnetPlugin.pm       |   4 -
 src/PVE/Network/SDN/Subnets.pm            |  22 ++-
 src/PVE/Network/SDN/Vnets.pm              |   4 +-
 src/PVE/Network/SDN/Zones/SimplePlugin.pm |   7 +-
 11 files changed, 106 insertions(+), 181 deletions(-)

-- 
2.39.2





More information about the pve-devel mailing list