Re: [pve-devel] [RFC] towards automated integration testing

2023-10-16 Thread Stefan Hanreich
On 10/13/23 15:33, Lukas Wagner wrote: > - Additionally, it should be easy to run these integration tests locally > on a developer's workstation in order to write new test cases, as well > as troubleshooting and debugging existing test cases. The local > test environment should match the

[pve-devel] [WIP v2 pve-network 02/10] subnets: vnets: preparations for DHCP plugins

2023-10-17 Thread Stefan Hanreich
-by: Stefan Hanreich --- src/PVE/Network/SDN/Subnets.pm | 25 + src/PVE/Network/SDN/Vnets.pm | 27 +-- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/PVE/Network/SDN/Subnets.pm b/src/PVE/Network/SDN/Subnets.pm index 6bb42e5

[pve-devel] [WIP v2 pve-manager 08/10] sdn: regenerate DHCP config on reload

2023-10-17 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- PVE/API2/Network.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm index 00d964a79..f39f04f52 100644 --- a/PVE/API2/Network.pm +++ b/PVE/API2/Network.pm @@ -660,6 +660,7 @@ __PACKAGE__->register_met

[pve-devel] [WIP v2 pve-network 06/10] ipam: Add helper methods for DHCP to PVE IPAM

2023-10-17 Thread Stefan 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. Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/Ipams/PVEPlugin.pm | 64 ++ 1 file changed, 64

[pve-devel] [WIP v2 qemu-server 09/10] sdn: dhcp: add DHCP setup to vm-network-scripts

2023-10-17 Thread Stefan Hanreich
: Stefan Hanreich --- PVE/QemuServer.pm | 14 ++ vm-network-scripts/pve-bridge | 3 +++ vm-network-scripts/pve-bridgedown | 19 +++ 3 files changed, 36 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 2cd8948..6c1e463 100644 --- a

[pve-devel] [WIP v2 pve-network 05/10] dhcp: add DHCP plugin for dnsmasq

2023-10-17 Thread Stefan Hanreich
reload that does not disrupt the dnsmasq daemon in any way. This plugin currently only works for simple Zones with subnets that have a gateway configured, since I use the gateway as listening address for dnsmasq. Signed-off-by: Stefan Hanreich --- debian/control | 1 + s

[pve-devel] [WIP v2 pve-cluster 01/10] cluster files: add dhcp.cfg

2023-10-17 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- src/PVE/Cluster.pm | 1 + src/pmxcfs/status.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/PVE/Cluster.pm b/src/PVE/Cluster.pm index cfa2583..aac4574 100644 --- a/src/PVE/Cluster.pm +++ b/src/PVE/Cluster.pm @@ -78,6 +78,7 @@ my $observed

[pve-devel] [WIP v2 pve-network 04/10] dhcp: subnet: add DHCP options to subnet configuration

2023-10-17 Thread Stefan Hanreich
Parse the dhcp-ranges when getting the configuration via the Subnet class. Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/SubnetPlugin.pm | 32 + src/PVE/Network/SDN/Subnets.pm | 18 2 files changed, 50 insertions(+) diff --git a/src

[pve-devel] [WIP v2 pve-network 03/10] dhcp: add abstract class for DHCP plugins

2023-10-17 Thread Stefan Hanreich
function configures the settings for a specific subnet (that can contain multiple DHCP ranges). This sets global settings for a specific subnet such as DNS server or gateway. configure_range This configures a DHCP range that is available for a given Subnet. Signed-off-by: Stefan Hanreich --- src/PVE

[pve-devel] [WIP v2 cluster/network/manager/qemu-server/container 00/10] Add support for DHCP servers to SDN

2023-10-17 Thread Stefan Hanreich
simplified DHCP configuration settings pve-cluster: Stefan Hanreich (1): cluster files: add dhcp.cfg src/PVE/Cluster.pm | 1 + src/pmxcfs/status.c | 1 + 2 files changed, 2 insertions(+) pve-network: Stefan Hanreich (6): subnets: vnets: preparations for DHCP plugins dhcp: add abstract class f

[pve-devel] [WIP v2 pve-container 10/10] sdn: dhcp: setup DHCP mappings in LXC hooks

2023-10-17 Thread Stefan Hanreich
Setup DHCP mappings if a container has interfaces on a SDN network managed via DHCP. Additionally remove the mapping in the stop_cleanup function so the mapping gets removed when forcefully stopping the container. Signed-off-by: Stefan Hanreich --- src/PVE/LXC.pm| 10

[pve-devel] [WIP v2 pve-network 07/10] dhcp: regenerate config for DHCP servers on reload

2023-10-17 Thread Stefan Hanreich
Regenerate the configuration files for the different DHCP server plugins when applying SDN settings by calling the respective hooks of the plugin responsible for configuring a DHCP instance. Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN.pm | 11 +- src/PVE/Network/SDN/Dhcp.pm

Re: [pve-devel] [WIP v2 cluster/network/manager/qemu-server/container 00/10] Add support for DHCP servers to SDN

2023-10-17 Thread Stefan Hanreich
er thing: What happens when a user changes the MAC address via the UI? I'd either disallow it completely or we need to update the DHCP configuration files and IPAM On 10/17/23 15:54, Stefan Hanreich wrote: > This is a WIP patch series, since I will be gone for 3 weeks and wanted to > share

Re: [pve-devel] [WIP v2 cluster/network/manager/qemu-server/container 00/10] Add support for DHCP servers to SDN

2023-10-17 Thread Stefan Hanreich
> Maybe try to see if we can use pve ipam as cache in front of external > ipam. Yes, it would also be cool if you could look at implementing the two newly added methods from the PVEPlugin for Netbox / Phpipam, since you have more experience with those. I also looked into merging those two methods

Re: [pve-devel] [RFC pve-network] do not remove DHCP mapping on stop

2023-11-08 Thread Stefan Hanreich
On 11/8/23 15:32, DERUMIER, Alexandre wrote: > hi, > I'm back from Holiday, and I'll finally time to work on dhcp. > Welcome back! It's also my first day after holiday today. > I wonder if we couldn't add a property on subnet or dhcp, > where user could choose between ephemeral ip (create a vm st

Re: [pve-devel] [WIP v2 pve-network 05/10] dhcp: add DHCP plugin for dnsmasq

2023-11-09 Thread Stefan Hanreich
On 11/8/23 18:18, DERUMIER, Alexandre wrote: > Also, currently, I'm not sure why we need to define the dhcp in > /etc/pve/sdn/dhcp.cfg ? > > couldn't we simply add something like : "dhcp:1" or "dhcp:dnsmasq" on > the zone ? That sounds like a good idea and would simplify stuff a lot. I'll tr

Re: [pve-devel] [RFC series pve-network/pve-cluster/qemu-server] DHCP

2023-11-13 Thread Stefan Hanreich
On 11/13/23 11:04, Alexandre Derumier wrote: > I have splitted the ipam add|del , from the dhcp lease reservation. > > The ipam add|del ip is done when creating|deleting vm, or add|del a vm nic > > The dhcp reservation is done at vm start. > > The delete of dhcp reservation is done at vm destr

Re: [pve-devel] [RFC series pve-network/pve-cluster/qemu-server] DHCP

2023-11-13 Thread Stefan Hanreich
On 11/13/23 16:44, DERUMIER, Alexandre wrote: > I think it also need api to add dhcp-range in subnet, as for external > ipam like netbox, It need to call netbox api to add the ip range. > > So, maybe a button in subnet panel :"add dhcp-range", allowing to add > multiple range. Yes, that's wha

Re: [pve-devel] [RFC qemu-server 2/5] vmnic add|remove : add|del ip in ipam

2023-11-13 Thread Stefan Hanreich
On 11/13/23 11:04, Alexandre Derumier wrote: > if ($have_sdn) { > -PVE::Network::SDN::Dhcp::add_mapping($vmid, $net->{bridge}, > $net->{macaddr}); > +PVE::Network::SDN::Dhcp::add_mapping($net->{bridge}, $net->{macaddr}); > > PVE::Network::SDN::Zones::tap_create($iface, $net->{br

[pve-devel] [WIP v3 pve-cluster 01/22] add priv/macs.db

2023-11-14 Thread Stefan Hanreich
From: Alexandre Derumier use to cache mac-ip list association. can be use by external ipam, firewall,etc for fast lookup Signed-off-by: Alexandre Derumier --- src/PVE/Cluster.pm | 1 + src/pmxcfs/status.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/PVE/Cluster.pm b/src/PVE/Clus

[pve-devel] [WIP v3 pve-network 03/22] subnet: add dhcp options

2023-11-14 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/SubnetPlugin.pm | 29 + src/PVE/Network/SDN/Subnets.pm | 23 +++ 2 files changed, 52 insertions(+) diff --git a/src/PVE/Network/SDN/SubnetPlugin.pm b/src/PVE/Network/SDN/SubnetPlugin.pm

[pve-devel] [WIP v3 pve-network 07/22] dhcp: add abstract class for DHCP plugins

2023-11-14 Thread Stefan Hanreich
Co-Authored-By: Alexandre Derumier Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/Dhcp/Makefile | 8 src/PVE/Network/SDN/Dhcp/Plugin.pm | 65 ++ src/PVE/Network/SDN/Makefile | 1 + 3 files changed, 74 insertions(+) create mode 100644 src/PVE

[pve-devel] [WIP v3 pve-manager 15/22] sdn: regenerate DHCP config on reload

2023-11-14 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- PVE/API2/Network.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm index 00d964a79..f39f04f52 100644 --- a/PVE/API2/Network.pm +++ b/PVE/API2/Network.pm @@ -660,6 +660,7 @@ __PACKAGE__->register_met

[pve-devel] [WIP v3 pve-network 10/22] api: add IPAM endpoints

2023-11-14 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- src/PVE/API2/Network/SDN.pm | 6 ++ src/PVE/API2/Network/SDN/Ipam.pm | 172 ++ src/PVE/API2/Network/SDN/Makefile | 2 +- 3 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 src/PVE/API2/Network/SDN

[pve-devel] [WIP v3 pve-network 14/22] sdn: fix tests

2023-11-14 Thread Stefan Hanreich
From: Alexandre Derumier Signed-off-by: Stefan Hanreich --- src/test/run_test_subnets.pl | 8 +++- src/test/run_test_vnets.pl | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/test/run_test_subnets.pl b/src/test/run_test_subnets.pl index f6564e1..c98359a 100755

[pve-devel] [WIP v3 pve-network 08/22] sdn: dhcp: add dnsmasq plugin

2023-11-14 Thread Stefan Hanreich
Co-Authored-By: Alexandre Derumier Signed-off-by: Stefan Hanreich --- debian/control | 1 + src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 198 2 files changed, 199 insertions(+) create mode 100644 src/PVE/Network/SDN/Dhcp/Dnsmasq.pm diff --git a

[pve-devel] [WIP v3 qemu-server 20/22] vm_start : vm-network-scripts: get ip from ipam and add dhcp reservation

2023-11-14 Thread Stefan Hanreich
From: Alexandre Derumier Signed-off-by: Stefan Hanreich --- vm-network-scripts/pve-bridge | 5 + 1 file changed, 5 insertions(+) diff --git a/vm-network-scripts/pve-bridge b/vm-network-scripts/pve-bridge index d37ce33..24efaad 100755 --- a/vm-network-scripts/pve-bridge +++ b/vm-network

[pve-devel] [WIP v3 qemu-server 22/22] vm_destroy: delete ip from ipam && dhcp

2023-11-14 Thread Stefan Hanreich
From: Alexandre Derumier Co-Authored-By: Stefan Hanreich Signed-off-by: Stefan Hanreich --- PVE/QemuServer.pm | 17 + 1 file changed, 17 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index fecdb9c..c9c061c 100644 --- a/PVE/QemuServer.pm +++ b/PVE

[pve-devel] [WIP v3 pve-network 05/22] sdn: subnet: vnet: refactor IPAM related methods

2023-11-14 Thread Stefan Hanreich
Co-Authored-By: Alexandre Derumier Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/SubnetPlugin.pm | 3 +- src/PVE/Network/SDN/Subnets.pm | 50 ++- src/PVE/Network/SDN/Vnets.pm| 95 + 3 files changed, 92 insertions(+), 56 deletions

[pve-devel] [WIP v3 pve-manager 17/22] sdn: subnet: add panel for editing DHCP ranges

2023-11-14 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- www/manager6/sdn/SubnetEdit.js | 161 - 1 file changed, 160 insertions(+), 1 deletion(-) diff --git a/www/manager6/sdn/SubnetEdit.js b/www/manager6/sdn/SubnetEdit.js index b9825d2a3..ab3b9d021 100644 --- a/www/manager6/sdn

[pve-devel] [WIP v3 pve-network 06/22] ipam: plugins: preparations for DHCP

2023-11-14 Thread Stefan Hanreich
Co-Authored-By: Alexandre Derumier Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/Ipams.pm | 80 +++- src/PVE/Network/SDN/Ipams/NetboxPlugin.pm | 86 -- src/PVE/Network/SDN/Ipams/PVEPlugin.pm | 85 +++-- src/PVE

[pve-devel] [WIP v3 pve-manager 18/22] sdn: dhcp: add view for DHCP mappings

2023-11-14 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- www/css/ext6-pve.css| 10 +- www/manager6/Makefile | 2 + www/manager6/dc/Config.js | 12 +- www/manager6/sdn/MappingEdit.js | 65 ++ www/manager6/tree/DhcpTree.js | 215 5 files

[pve-devel] [WIP v3 pve-network 04/22] sdn: zone: add dhcp options

2023-11-14 Thread Stefan Hanreich
Co-Authored-By: Alexandre Derumier Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/Zones/SimplePlugin.pm | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/PVE/Network/SDN/Zones/SimplePlugin.pm b/src/PVE/Network/SDN/Zones/SimplePlugin.pm index 4922903..f30278c

[pve-devel] [WIP v3 pve-network 02/22] sdn: preparations for DHCP plugin

2023-11-14 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/Subnets.pm | 25 + src/PVE/Network/SDN/Vnets.pm | 27 +-- src/PVE/Network/SDN/Zones.pm | 34 +- 3 files changed, 51 insertions(+), 35 deletions(-) diff

[pve-devel] [WIP v3 cluster/network/manager/qemu-server 00/22] Add support for DHCP servers to SDN

2023-11-14 Thread Stefan Hanreich
fied DHCP configuration settings pve-cluster: Alexandre Derumier (1): add priv/macs.db src/PVE/Cluster.pm | 1 + src/pmxcfs/status.c | 1 + 2 files changed, 2 insertions(+) pve-network: Alexandre Derumier (1): sdn: fix tests Stefan Hanreich (12): sdn: preparations for DHCP plugin subnet:

[pve-devel] [WIP v3 pve-network 11/22] api: subnet: add dhcp ranges

2023-11-14 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- src/PVE/API2/Network/SDN/Subnets.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PVE/API2/Network/SDN/Subnets.pm b/src/PVE/API2/Network/SDN/Subnets.pm index eb6b41b..c263cd5 100644 --- a/src/PVE/API2/Network/SDN/Subnets.pm +++ b/src/PVE/API2/Network

[pve-devel] [WIP v3 pve-network 12/22] api: zone: add dhcp options

2023-11-14 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- src/PVE/API2/Network/SDN/Zones.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PVE/API2/Network/SDN/Zones.pm b/src/PVE/API2/Network/SDN/Zones.pm index 4c8b7e1..1c3356e 100644 --- a/src/PVE/API2/Network/SDN/Zones.pm +++ b/src/PVE/API2/Network/SDN

[pve-devel] [WIP v3 pve-network 09/22] sdn: dhcp: add helper for creating DHCP leases

2023-11-14 Thread Stefan Hanreich
Co-Authored-By: Alexandre Derumier Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/Dhcp.pm | 115 +++ src/PVE/Network/SDN/Makefile | 2 +- 2 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 src/PVE/Network/SDN/Dhcp.pm diff --git a

[pve-devel] [WIP v3 pve-network 13/22] dhcp: regenerate config for DHCP servers on reload

2023-11-14 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN.pm | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PVE/Network/SDN.pm b/src/PVE/Network/SDN.pm index 057034f..c306527 100644 --- a/src/PVE/Network/SDN.pm +++ b/src/PVE/Network/SDN.pm @@ -12,6 +12,7 @@ use PVE

[pve-devel] [WIP v3 qemu-server 19/22] vmnic add|remove : add|del ip in ipam

2023-11-14 Thread Stefan Hanreich
From: Alexandre Derumier Signed-off-by: Stefan Hanreich --- PVE/QemuServer.pm | 38 ++ 1 file changed, 38 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index c465fb6..1ae1cb0 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -64,6

[pve-devel] [WIP v3 pve-manager 16/22] sdn: add DHCP option to Zone dialogue

2023-11-14 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- www/manager6/sdn/zones/Base.js | 4 ++-- www/manager6/sdn/zones/SimpleEdit.js | 10 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/www/manager6/sdn/zones/Base.js b/www/manager6/sdn/zones/Base.js index 602e4c16b..80ce51bac

[pve-devel] [WIP v3 qemu-server 21/22] api2: create|restore|clone: add_free_ip

2023-11-14 Thread Stefan Hanreich
From: Alexandre Derumier Signed-off-by: Stefan Hanreich --- PVE/API2/Qemu.pm | 6 ++ PVE/QemuServer.pm | 31 +++ 2 files changed, 37 insertions(+) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 38bdaab..a0f8243 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE

Re: [pve-devel] [WIP v3 pve-manager 18/22] sdn: dhcp: add view for DHCP mappings

2023-11-15 Thread Stefan Hanreich
On 11/15/23 13:09, DERUMIER, Alexandre wrote: > I think that this panel could be named "Ipam" instead "Dhcp Mappings" Yes, good point, I've actually already renamed it locally. ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxm

Re: [pve-devel] [WIP v3 pve-manager 17/22] sdn: subnet: add panel for editing DHCP ranges

2023-11-15 Thread Stefan Hanreich
On 11/15/23 14:09, DERUMIER, Alexandre wrote: > Creating a new subnet without dhcp range is failing with > > " > Parameter verification failed. (400) > dhcp-range: type check ('array') failed Thanks for the report! Already fixed it! Also, creating a new Zone that is not Simple also failed, t

Re: [pve-devel] [PATCH pve-container 1/6] nic hotplug : add|del ips in ipam

2023-11-15 Thread Stefan Hanreich
On 11/15/23 15:21, Alexandre Derumier wrote: > + if ($have_sdn) { > + > PVE::Network::SDN::Vnets::add_next_free_cidr($newnet->{bridge}, > $conf->{hostname}, $newnet->{hwaddr}, "vmid: $vmid", undef, 1); > + } Maybe I missed something, but with Containers we

Re: [pve-devel] [PATCH dnsmasq 0/1] purge previous ip/mac lease of dhcp reply

2023-11-16 Thread Stefan Hanreich
Maybe this [1][2] could be a less intrusive solution for this issue? [1] https://manpages.ubuntu.com/manpages/focal/en/man1/dhcp_release.1.html [2] https://packages.debian.org/de/sid/dnsmasq-utils ___ pve-devel mailing list pve-devel@lists.proxmox.com

Re: [pve-devel] [PATCH dnsmasq 0/1] purge previous ip/mac lease of dhcp reply

2023-11-17 Thread Stefan Hanreich
On 11/17/23 11:46, DERUMIER, Alexandre wrote: > The problem is that dbus is only working with 1 instance of dnsmasq. :/ > > That mean it'll not work if we need mulitple instance, in differents > zones/vrf for example You should be able to set the service name via `--enable-dbus` then you can ha

[pve-devel] [PATCH v4 pve-network 04/33] sdn: zone: add dhcp option

2023-11-17 Thread Stefan Hanreich
Co-Authored-By: Alexandre Derumier Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/Zones/SimplePlugin.pm | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/PVE/Network/SDN/Zones/SimplePlugin.pm b/src/PVE/Network/SDN/Zones/SimplePlugin.pm index 4922903..f30278c

[pve-devel] [PATCH v4 cluster/network/manager/qemu-server/container/docs 00/33] Add support for DHCP servers to SDN

2023-11-17 Thread Stefan Hanreich
x tests sdn: fix subnets && netbox ipam tests add add_dhcp_mapping Stefan Hanreich (12): sdn: preparations for DHCP plugin subnet: add dhcp options sdn: zone: add dhcp option ipam: plugins: preparations for DHCP subnet: vnet: refactor IPAM related methods dhcp: add abstract

[pve-devel] [PATCH v4 pve-network 12/33] api: zone: add dhcp option

2023-11-17 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- src/PVE/API2/Network/SDN/Zones.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PVE/API2/Network/SDN/Zones.pm b/src/PVE/API2/Network/SDN/Zones.pm index 4c8b7e1..1c3356e 100644 --- a/src/PVE/API2/Network/SDN/Zones.pm +++ b/src/PVE/API2/Network/SDN

[pve-devel] [PATCH v4 pve-manager 17/33] sdn: regenerate DHCP config on reload

2023-11-17 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- PVE/API2/Network.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm index 00d964a79..f39f04f52 100644 --- a/PVE/API2/Network.pm +++ b/PVE/API2/Network.pm @@ -660,6 +660,7 @@ __PACKAGE__->register_met

[pve-devel] [PATCH v4 pve-network 14/33] sdn: fix tests

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier Signed-off-by: Stefan Hanreich --- src/test/run_test_subnets.pl | 8 +++- src/test/run_test_vnets.pl | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/test/run_test_subnets.pl b/src/test/run_test_subnets.pl index f6564e1..c98359a 100755

[pve-devel] [PATCH v4 pve-network 10/33] api: add endpoints for managing PVE IPAM

2023-11-17 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- src/PVE/API2/Network/SDN.pm | 6 + src/PVE/API2/Network/SDN/Ipam.pm | 221 ++ src/PVE/API2/Network/SDN/Makefile | 2 +- 3 files changed, 228 insertions(+), 1 deletion(-) create mode 100644 src/PVE/API2/Network/SDN/Ipam.pm

[pve-devel] [PATCH v4 qemu-server 25/33] nic hotplug: add_dhcp_mapping

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier Signed-off-by: Alexandre Derumier --- PVE/QemuServer.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index b4cb741..5e158b3 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -5339,6 +5339,7 @@ sub vmconfig_update_net

[pve-devel] [PATCH v4 pve-network 15/33] sdn: fix subnets && netbox ipam tests

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier Signed-off-by: Alexandre Derumier --- src/test/ipams/netbox/expected.add_ip| 2 +- src/test/ipams/netbox/expected.add_ip_notgateway | 2 +- src/test/ipams/netbox/expected.add_next_freeip | 2 +- src/test/ipams/netbox/expected.update_ip | 2 +- src/

[pve-devel] [PATCH v4 pve-network 06/33] subnet: vnet: refactor IPAM related methods

2023-11-17 Thread Stefan 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 Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/SubnetPlugin.pm | 3 +- src/PVE/Network

[pve-devel] [PATCH v4 pve-manager 19/33] sdn: subnet: add panel for editing dhcp ranges

2023-11-17 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- www/manager6/Makefile | 1 + www/manager6/sdn/SubnetEdit.js | 160 - 2 files changed, 160 insertions(+), 1 deletion(-) diff --git a/www/manager6/Makefile b/www/manager6/Makefile index dccd2ba1c..093452cd7 100644 --- a

[pve-devel] [PATCH v4 pve-container 32/33] lxc-pve-prestart-hook : add_dhcp_mapping

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier Signed-off-by: Alexandre Derumier --- src/lxc-pve-prestart-hook | 15 +++ 1 file changed, 15 insertions(+) diff --git a/src/lxc-pve-prestart-hook b/src/lxc-pve-prestart-hook index 936d0bf..fc577e4 100755 --- a/src/lxc-pve-prestart-hook +++ b/src/lxc-pve-pre

[pve-devel] [PATCH v4 pve-network 05/33] ipam: plugins: preparations for DHCP

2023-11-17 Thread Stefan Hanreich
Adds a new file priv/macs.db for caching the queries to IPAM. Additionally adds and imeplements methods to the IPAM plugins that are required for the DHCP functionality. Co-Authored-By: Alexandre Derumier Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/Ipams.pm | 80

[pve-devel] [PATCH v4 pve-network 03/33] subnet: add dhcp options

2023-11-17 Thread Stefan Hanreich
Additionally add a helper function for parsing the DHCP ranges of a subnet. Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/SubnetPlugin.pm | 29 + src/PVE/Network/SDN/Subnets.pm | 23 +++ 2 files changed, 52 insertions(+) diff --git

[pve-devel] [PATCH v4 pve-cluster 01/33] add priv/macs.db

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier use to cache mac-ip list association. can be use by external ipam, firewall,etc for fast lookup Signed-off-by: Alexandre Derumier --- src/PVE/Cluster.pm | 1 + src/pmxcfs/status.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/PVE/Cluster.pm b/src/PVE/Clus

[pve-devel] [PATCH v4 pve-network 02/33] sdn: preparations for DHCP plugin

2023-11-17 Thread Stefan Hanreich
plugins. Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/Subnets.pm | 25 + src/PVE/Network/SDN/Vnets.pm | 27 +-- src/PVE/Network/SDN/Zones.pm | 34 +- 3 files changed, 51 insertions(+), 35 deletions

[pve-devel] [PATCH v4 pve-network 11/33] api: subnet: add dhcp ranges

2023-11-17 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- src/PVE/API2/Network/SDN/Subnets.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PVE/API2/Network/SDN/Subnets.pm b/src/PVE/API2/Network/SDN/Subnets.pm index eb6b41b..c263cd5 100644 --- a/src/PVE/API2/Network/SDN/Subnets.pm +++ b/src/PVE/API2/Network

[pve-devel] [PATCH v4 pve-network 07/33] dhcp: add abstract class for DHCP plugins

2023-11-17 Thread Stefan Hanreich
-by: Stefan Hanreich --- src/PVE/Network/SDN/Dhcp/Makefile | 8 src/PVE/Network/SDN/Dhcp/Plugin.pm | 65 ++ src/PVE/Network/SDN/Makefile | 1 + 3 files changed, 74 insertions(+) create mode 100644 src/PVE/Network/SDN/Dhcp/Makefile create mode 100644 src

[pve-devel] [PATCH v4 pve-network 13/33] dhcp: regenerate config for DHCP plugins on applying configuration

2023-11-17 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN.pm | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PVE/Network/SDN.pm b/src/PVE/Network/SDN.pm index 057034f..c306527 100644 --- a/src/PVE/Network/SDN.pm +++ b/src/PVE/Network/SDN.pm @@ -12,6 +12,7 @@ use PVE

[pve-devel] [PATCH v4 pve-network 09/33] sdn: dhcp: add helper for creating DHCP leases

2023-11-17 Thread Stefan Hanreich
This helper can be used to create DHCP entries for a specific zone. It is used by the API to create DHCP leases for VMs/CTs. Co-Authored-By: Alexandre Derumier Signed-off-by: Stefan Hanreich --- src/PVE/Network/SDN/Dhcp.pm | 115 +++ src/PVE/Network/SDN

[pve-devel] [PATCH v4 pve-network 08/33] sdn: dhcp: add dnsmasq plugin

2023-11-17 Thread Stefan Hanreich
basis. Additionally it creates the file /etc/default/dnsmasq. that provides default options for the dnsmasq service. Leases are stored in /var/lib/misc/dnsmasq.. Co-Authored-By: Alexandre Derumier Signed-off-by: Stefan Hanreich --- debian/control | 1 + src/PVE/Network

[pve-devel] [PATCH v4 qemu-server 22/33] vm_start : vm-network-scripts: add_dhcp_reservation

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier Signed-off-by: Stefan Hanreich Signed-off-by: Alexandre Derumier --- vm-network-scripts/pve-bridge | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vm-network-scripts/pve-bridge b/vm-network-scripts/pve-bridge index d37ce33..e8f8798 100755 --- a/vm-network

[pve-devel] [PATCH v4 qemu-server 24/33] vm_destroy: delete ip from ipam

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier Co-Authored-By: Stefan Hanreich Signed-off-by: Stefan Hanreich Signed-off-by: Alexandre Derumier --- PVE/QemuServer.pm | 17 + 1 file changed, 17 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index b92743c..b4cb741 100644 --- a/PVE

[pve-devel] [PATCH v4 qemu-server 21/33] vmnic add|remove : add|del ip in ipam

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier Co-Authored-by: Stefan Lendl Signed-off-by: Stefan Hanreich Signed-off-by: Alexandre Derumier --- PVE/QemuServer.pm | 40 1 file changed, 40 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index c465fb6

[pve-devel] [PATCH v4 pve-container 30/33] vm_clone : create ips in ipams

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier also delete ips in case of failure Signed-off-by: Alexandre Derumier --- src/PVE/API2/LXC.pm | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index e15de28..ee4fdca 100644 --- a/src/PVE/API2/LXC.pm +++ b

[pve-devel] [PATCH v4 pve-container 29/33] vm_create|restore: create ips in ipam

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier also delete ips on create failure Co-Authored-by: Stefan Hanreich Signed-off-by: Alexandre Derumier --- src/PVE/API2/LXC.pm | 4 src/PVE/LXC.pm | 13 + 2 files changed, 17 insertions(+) diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm

[pve-devel] [PATCH v4 pve-container 27/33] nic hotplug : add|del ips in ipam

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier Co-Authored-by: Stefan Hanreich Signed-off-by: Alexandre Derumier --- src/PVE/LXC.pm| 17 + src/PVE/LXC/Config.pm | 12 2 files changed, 29 insertions(+) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 8f53b53..b6df6d6 100644

[pve-devel] [PATCH v4 pve-docs 33/33] sdn: dhcp: Add documentation for DHCP

2023-11-17 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- pvesdn.adoc | 122 1 file changed, 122 insertions(+) diff --git a/pvesdn.adoc b/pvesdn.adoc index b796c5e..24878e2 100644 --- a/pvesdn.adoc +++ b/pvesdn.adoc @@ -79,6 +79,9 @@ In addition to this, the

[pve-devel] [PATCH v4 pve-container 28/33] vm_destroy: remove ips from ipam for all interfaces

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier Signed-off-by: Alexandre Derumier --- src/PVE/LXC.pm | 16 1 file changed, 16 insertions(+) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index b6df6d6..4472e0f 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -46,6 +46,7 @@ use PVE::LXC::Tools; my

[pve-devel] [PATCH v4 pve-container 31/33] vm_apply_pending: add|del ips from ipam for offline changes

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier Co-Authored-by: Stefan Hanreich Signed-off-by: Alexandre Derumier --- src/PVE/LXC/Config.pm | 15 +++ 1 file changed, 15 insertions(+) diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm index c884313..823a2b9 100644 --- a/src/PVE/LXC/Config.pm

[pve-devel] [PATCH v4 pve-manager 20/33] sdn: ipam: add ipam panel

2023-11-17 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- www/css/ext6-pve.css | 22 ++- www/manager6/Makefile | 1 + www/manager6/dc/Config.js | 12 +- www/manager6/sdn/IpamEdit.js | 78 ++ www/manager6/tree/DhcpTree.js | 267 ++ 5 files changed, 372

[pve-devel] [PATCH v4 pve-network 16/33] add add_dhcp_mapping

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier Signed-off-by: Alexandre Derumier --- src/PVE/Network/SDN/Dhcp.pm | 9 --- src/PVE/Network/SDN/Dhcp/Dnsmasq.pm | 40 - src/PVE/Network/SDN/Dhcp/Plugin.pm | 2 +- src/PVE/Network/SDN/Vnets.pm| 15 +++ 4 files cha

[pve-devel] [PATCH v4 pve-manager 18/33] sdn: add DHCP option to Zone dialogue

2023-11-17 Thread Stefan Hanreich
Co-Authored-by: Stefan Lendl Signed-off-by: Stefan Hanreich --- www/manager6/sdn/zones/Base.js | 6 -- www/manager6/sdn/zones/SimpleEdit.js | 10 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/www/manager6/sdn/zones/Base.js b/www/manager6/sdn/zones/Base.js

[pve-devel] [PATCH v4 qemu-server 23/33] api2: create|restore|clone: add_free_ip

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier Co-Authored-by: Stefan Lendl Signed-off-by: Stefan Hanreich Signed-off-by: Alexandre Derumier --- PVE/API2/Qemu.pm | 6 ++ PVE/QemuServer.pm | 15 +++ 2 files changed, 21 insertions(+) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 38bdaab

[pve-devel] [PATCH v4 qemu-server 26/33] nic online bridge/vlan change: link disconnect/reconnect

2023-11-17 Thread Stefan Hanreich
From: Alexandre Derumier We want to notify guest of the change, so it can resubmit dhcp request, or send gratuitous arp,... Signed-off-by: Alexandre Derumier --- PVE/QemuServer.pm | 13 + 1 file changed, 13 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 5e1

Re: [pve-devel] [PATCH v4 pve-network 06/33] subnet: vnet: refactor IPAM related methods

2023-11-17 Thread Stefan Hanreich
On 11/17/23 15:13, Stefan Lendl wrote: > If an IP was found, the loop will just start again. > This should be (tested): > > last if $ip; Ah yes, I fixed the symptom of this already elsewhere but here it makes a lot more sense! ___ pve-devel mailing

Re: [pve-devel] [PATCH v4 pve-manager 20/33] sdn: ipam: add ipam panel

2023-11-17 Thread Stefan Hanreich
On 11/17/23 16:04, DERUMIER, Alexandre wrote: > I wonder if this panel could be integrated in zone panel (accessible > from the tree). I fear that this might overload the panel a bit. > as It's not related to the sdn configuration itself. (and don't need > sdn reload) > > I think yhis could a

Re: [pve-devel] [PATCH v4 cluster/network/manager/qemu-server/container/docs 00/33] Add support for DHCP servers to SDN

2023-11-17 Thread Stefan Hanreich
On 11/17/23 16:47, DERUMIER, Alexandre wrote: >>>   * dnsmasq and IPv6 (and DHCP in general) do not really play well >>> together, >>>     so using subnets with IPv6 configured is wonky > > I didn't have tested yet, but it's seem that dnsmasq only support old > classic duid reservation and not m

Re: [pve-devel] [PATCH v4 cluster/network/manager/qemu-server/container/docs 00/33] Add support for DHCP servers to SDN

2023-11-17 Thread Stefan Hanreich
On 11/17/23 17:05, Stefan Hanreich wrote: > Maybe the issue here are the respective fwbr interfaces inbetween? I guess that's unlikely since that would affect VMs as well I suppose ___ pve-devel mailing list pve-devel@lists.proxmox.c

Re: [pve-devel] [PATCH v4 pve-network 10/33] api: add endpoints for managing PVE IPAM

2023-11-20 Thread Stefan Hanreich
On 11/18/23 17:27, Thomas Lamprecht wrote: > what's the deal with Ipam vs. Ipams? > > I did not looked to closely into it but it seems like the existing Ipams, > plural, > is for managing ipam plugins and Ipam, singular, here is for getting the > current > state? That should really be better

Re: [pve-devel] [PATCH v4 pve-network 10/33] api: add endpoints for managing PVE IPAM

2023-11-20 Thread Stefan Hanreich
On 11/20/23 13:28, DERUMIER, Alexandre wrote: > Hi, > >>> I'll look again into this, maybe POST / PUT / DELETE >>> `/ipams/pve/mapping` or `/ipams/pve/ip` would be a good alternative >>> here? We need to move away from MAC addresses as a unique identifier >>> anyway (since with dual-stack there ca

Re: [pve-devel] [PATCH v4 pve-network 10/33] api: add endpoints for managing PVE IPAM

2023-11-20 Thread Stefan Hanreich
On 11/20/23 13:34, Stefan Hanreich wrote: > Not sure about this, since the endpoint returns the state of the PVE > IPAM and never returns the state of Netbox IPAM, for instance. Since if > you want to inspect that state you would use the Netbox API / Web UI. > For that reason i

[pve-devel] [PATCH pve-network 1/2] api: refactor URL structure for Ipam

2023-11-20 Thread Stefan Hanreich
: Stefan Hanreich --- src/PVE/API2/Network/SDN.pm | 6 -- src/PVE/API2/Network/SDN/Ipams.pm| 83 + src/PVE/API2/Network/SDN/{Ipam.pm => Ips.pm} | 97 ++-- src/PVE/API2/Network/SDN/Makefile| 2 +- src/PVE/API2/Network/SDN/Vnets

[pve-devel] [PATCH network/manager 0/2] Refactor IPAM API methods

2023-11-20 Thread Stefan Hanreich
the create / update / delete methods to the Zone endpoint and then it would be possible to show a proper child relation. pve-network: Stefan Hanreich (1): api: refactor URL structure for Ipam src/PVE/API2/Network/SDN.pm | 6 -- src/PVE/API2/Network/SDN/Ipams.pm

[pve-devel] [PATCH pve-manager 2/2] sdn: Update IPAM API endpoints

2023-11-20 Thread Stefan Hanreich
The IPAM-related API endpoints were moved, reflect those changes in the UI as well. Signed-off-by: Stefan Hanreich --- www/manager6/sdn/IpamEdit.js | 4 +++- www/manager6/tree/DhcpTree.js | 15 +++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/www/manager6/sdn

[pve-devel] [PATCH container 0/3] Bugfixes for DHCP

2023-11-20 Thread Stefan Hanreich
lines in the container configuration. pve-container: Stefan Hanreich (3): hotplug network: Only change IPAM when MAC or bridge changes network: Do not always reserve new IP in IPAM config: Use LXC Config instead of QemuServer for parsing net src/PVE/LXC.pm| 26

[pve-devel] [PATCH pve-container 1/3] hotplug network: Only change IPAM when MAC or bridge changes

2023-11-20 Thread Stefan Hanreich
Currently a new IPAM entry is created everytime a NIC config changes. When editing properties other than MAC or Bridge this could lead to duplicated entries in the IPAM. Only reserve a new IP when the bridge or MAC changes or the NIC is completely new. Signed-off-by: Stefan Hanreich --- src/PVE

[pve-devel] [PATCH pve-container 3/3] config: Use LXC Config instead of QemuServer for parsing net

2023-11-20 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- src/PVE/LXC.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index c239715..071faca 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -2771,7 +2771,7 @@ sub create_ifaces_ipams_ips { for my $opt

[pve-devel] [PATCH pve-container 2/3] network: Do not always reserve new IP in IPAM

2023-11-20 Thread Stefan Hanreich
Currently when updating the network configuration of a container, SDN would always create a new entry in the IPAM. Only create a new entry when the bridge or MAC changes or the NIC is completely new. Signed-off-by: Stefan Hanreich --- src/PVE/LXC/Config.pm | 6 -- 1 file changed, 4

[pve-devel] [PATCH v2 pve-container 2/4] network: Do not always reserve new IP in IPAM

2023-11-20 Thread Stefan Hanreich
Currently when updating the network configuration of a container, SDN would always create a new entry in the IPAM. Only create a new entry when the bridge or MAC changes or the NIC is completely new. Signed-off-by: Stefan Hanreich --- src/PVE/LXC/Config.pm | 6 -- 1 file changed, 4

[pve-devel] [PATCH v2 pve-container 1/4] hotplug network: Only change IPAM when MAC or bridge changes

2023-11-20 Thread Stefan Hanreich
Currently a new IPAM entry is created everytime a NIC config changes. When editing properties other than MAC or Bridge this could lead to duplicated entries in the IPAM. Only reserve a new IP when the bridge or MAC changes or the NIC is completely new. Signed-off-by: Stefan Hanreich --- src/PVE

[pve-devel] [PATCH v2 pve-container 3/4] config: Use LXC Config instead of QemuServer for parsing net

2023-11-20 Thread Stefan Hanreich
Signed-off-by: Stefan Hanreich --- src/PVE/LXC.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index c239715..847b8c8 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -2771,9 +2771,9 @@ sub create_ifaces_ipams_ips { for my

[pve-devel] [PATCH v2 container 0/4] Bugfixes for DHCP

2023-11-20 Thread Stefan Hanreich
lines in the container configuration. pve-container: Stefan Hanreich (4): hotplug network: Only change IPAM when MAC or bridge changes network: Do not always reserve new IP in IPAM config: Use LXC Config instead of QemuServer for parsing net create: Do not call create_ifaces_ipams_ips src

[pve-devel] [PATCH v2 pve-container 4/4] create: Do not call create_ifaces_ipams_ips

2023-11-20 Thread Stefan Hanreich
Since create_vm already calls update_pct_config, which in turn calls vmconfig_apply_pending we do not need to explicitly create the IPAM entries when creating a container from scratch. Signed-off-by: Stefan Hanreich --- src/PVE/API2/LXC.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/src

  1   2   3   4   5   6   7   8   >