summaryrefslogtreecommitdiff
path: root/src/PVE/Network/SDN/Vnets.pm
AgeCommit message (Collapse)Author
2024-04-08sdn: dhcp: rollback allocated ips on failureStefan Hanreich
If DHCP is configured for IPv4 and IPv6, failing to obtain an IPv6 IP does not roll back the allocation made for IPv4. This patch rolls back any changes made in case of failure, so that IP allocation is actually atomic. Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com> Reviewed-by: Stefan Lendl <s.lendl@proxmox.com> Tested-by: Stefan Lendl <s.lendl@proxmox.com> Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
2024-04-08sdn: dhcp: only consider subnets that have dhcp-range configuredStefan Hanreich
If DHCP is enabled on a zone with subnets, but no subnet has a dhcp-range configured, then starting a VM will fail because no IP can be allocated. This patch fixes this by only considering subnets that have a dhcp-range configured and only failing if there is at least one subnet with a dhcp-range configured. Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com> Reviewed-by: Stefan Lendl <s.lendl@proxmox.com> Tested-by: Stefan Lendl <s.lendl@proxmox.com> Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
2024-04-08sdn: dhcp: request both IPv4 and IPv6 addresses on VM startStefan Lendl
If previously an IP was allocated in the IPAM, but a new subnet added for the other IP version, we need to allocate an IP in the new subnet. Signed-off-by: Stefan Lendl <s.lendl@proxmox.com> Reviewed-by: Stefan Hanreich <s.hanreich@proxmox.com> Tested-by: Stefan Hanreich <s.hanreich@proxmox.com>
2024-04-08sdn: dhcp: get next free ip for a specific IP versionStefan Lendl
Specify the IP version (4|6) for which an IP shall be requested from the IPAM. Signed-off-by: Stefan Lendl <s.lendl@proxmox.com> Reviewed-by: Stefan Hanreich <s.hanreich@proxmox.com> Tested-by: Stefan Hanreich <s.hanreich@proxmox.com>
2023-11-21sdn: register MAC in IPAM if not foundStefan Lendl
if inside add_dhcp_mapping, which is called at VM or LCX start, we do not find an IP in IPAM, register the MAC. This is very useful as a fallback if for some reason an IP mapping was deleted or there is a bug somewhere that does not register an IP. This acts more like DHCP to allocate an IP on demand. In order to properly register the IP, the VMID and hostname is required as a parameter. Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
2023-11-18add add_dhcp_mappingAlexandre Derumier
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2023-11-18subnet: vnet: refactor IPAM related methodsStefan Hanreich
Those methods are used by the DHCP plugins to attain the next free IP address for a given DHCP range, as well as delete all entries with a certain MAC address. Co-Authored-By: Alexandre Derumier <aderumier@odiso.com> Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2023-11-18sdn: preparations for DHCP pluginStefan Hanreich
Add the option to retrieve the running configuration instead of only the pending configuration via the config methods. Refactor methods using the running config to utilize the new parameter. Add helper methods and return additional attributes from the getter functions that are needed by the dhcp plugins. Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2023-06-06fix #4389: evpn: exit nodes: null routes subnets from other zonesAlexandre Derumier
We don't want to routes subnets between different zones when same exit node is used. Signed-off-by: Alexandre Derumier <aderumier@odiso.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-25separate packaging and source build systemThomas Lamprecht
like almost all of our repos do nowadays, modern git can detect such things on rebase so in development stuff should be hopefully not too much affected by this. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>