From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id A8A1E1FF09F for ; Thu, 03 Sep 2026 14:56:38 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2FFC721580; Thu, 03 Sep 2026 14:56:38 +0200 (CEST) From: Gabriel Goller To: pve-devel@lists.proxmox.com Subject: [PATCH network] sdn: remove faucet controller and zone Date: Thu, 3 Sep 2026 14:56:24 +0200 Message-ID: <20260903125629.424793-1-g.goller@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1788440190222 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.329 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 4DCQNND5BOX43XDUD7PJCBC4UOMY2VCC X-Message-ID-Hash: 4DCQNND5BOX43XDUD7PJCBC4UOMY2VCC X-MailFrom: g.goller@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Was never exposed and doesn't work anyways. Signed-off-by: Gabriel Goller --- src/PVE/API2/Network/SDN/Controllers.pm | 1 - src/PVE/API2/Network/SDN/Zones.pm | 1 - src/PVE/Network/SDN/Controllers.pm | 2 - .../Network/SDN/Controllers/FaucetPlugin.pm | 95 ------------------- src/PVE/Network/SDN/Controllers/Makefile | 2 +- src/PVE/Network/SDN/Zones.pm | 2 - src/PVE/Network/SDN/Zones/FaucetPlugin.pm | 72 -------------- src/PVE/Network/SDN/Zones/Makefile | 2 +- 8 files changed, 2 insertions(+), 175 deletions(-) delete mode 100644 src/PVE/Network/SDN/Controllers/FaucetPlugin.pm delete mode 100644 src/PVE/Network/SDN/Zones/FaucetPlugin.pm diff --git a/src/PVE/API2/Network/SDN/Controllers.pm b/src/PVE/API2/Network/SDN/Controllers.pm index 7f8729334cf6..9b119607f43f 100644 --- a/src/PVE/API2/Network/SDN/Controllers.pm +++ b/src/PVE/API2/Network/SDN/Controllers.pm @@ -12,7 +12,6 @@ use PVE::Network::SDN::Controllers; use PVE::Network::SDN::Controllers::Plugin; use PVE::Network::SDN::Controllers::EvpnPlugin; use PVE::Network::SDN::Controllers::BgpPlugin; -use PVE::Network::SDN::Controllers::FaucetPlugin; use Storable qw(dclone); use PVE::JSONSchema qw(get_standard_option); diff --git a/src/PVE/API2/Network/SDN/Zones.pm b/src/PVE/API2/Network/SDN/Zones.pm index b897cbdff973..5d98ef6656ca 100644 --- a/src/PVE/API2/Network/SDN/Zones.pm +++ b/src/PVE/API2/Network/SDN/Zones.pm @@ -18,7 +18,6 @@ use PVE::Network::SDN::Vnets; use PVE::Network::SDN; use PVE::Network::SDN::Zones::EvpnPlugin; -use PVE::Network::SDN::Zones::FaucetPlugin; use PVE::Network::SDN::Zones::Plugin; use PVE::Network::SDN::Zones::QinQPlugin; use PVE::Network::SDN::Zones::SimplePlugin; diff --git a/src/PVE/Network/SDN/Controllers.pm b/src/PVE/Network/SDN/Controllers.pm index b2c2f9d91a5c..b1c0a72f2aeb 100644 --- a/src/PVE/Network/SDN/Controllers.pm +++ b/src/PVE/Network/SDN/Controllers.pm @@ -14,12 +14,10 @@ use PVE::Network::SDN::Zones; use PVE::Network::SDN::Controllers::EvpnPlugin; use PVE::Network::SDN::Controllers::BgpPlugin; use PVE::Network::SDN::Controllers::IsisPlugin; -use PVE::Network::SDN::Controllers::FaucetPlugin; use PVE::Network::SDN::Controllers::Plugin; PVE::Network::SDN::Controllers::EvpnPlugin->register(); PVE::Network::SDN::Controllers::BgpPlugin->register(); PVE::Network::SDN::Controllers::IsisPlugin->register(); -PVE::Network::SDN::Controllers::FaucetPlugin->register(); PVE::Network::SDN::Controllers::Plugin->init(); sub sdn_controllers_config { diff --git a/src/PVE/Network/SDN/Controllers/FaucetPlugin.pm b/src/PVE/Network/SDN/Controllers/FaucetPlugin.pm deleted file mode 100644 index 5024bed99b9e..000000000000 --- a/src/PVE/Network/SDN/Controllers/FaucetPlugin.pm +++ /dev/null @@ -1,95 +0,0 @@ -package PVE::Network::SDN::Controllers::FaucetPlugin; - -use strict; -use warnings; -use PVE::Network::SDN::Controllers::Plugin; -use PVE::Tools; -use PVE::INotify; -use PVE::JSONSchema qw(get_standard_option); -use CPAN::Meta::YAML; -use Encode; - -use base('PVE::Network::SDN::Controllers::Plugin'); - -sub type { - return 'faucet'; -} - -sub properties { - return {}; -} - -# Plugin implementation -sub generate_controller_config { - my ($class, $plugin_config, $controller_cfg, $id, $uplinks, $config) = @_; - -} - -sub generate_controller_zone_config { - my ($class, $plugin_config, $controller, $controller_cfg, $id, $uplinks, $config) = @_; - - my $dpid = $plugin_config->{'dp-id'}; - my $dphex = printf("%x", $dpid); - - my $zone_config = { - dp_id => $dphex, - hardware => "Open vSwitch", - }; - - $config->{faucet}->{dps}->{$id} = $zone_config; - -} - -sub generate_controller_vnet_config { - my ($class, $plugin_config, $controller, $zone, $zoneid, $vnetid, $config) = @_; - - my $mac = $plugin_config->{mac}; - my $ipv4 = $plugin_config->{ipv4}; - my $ipv6 = $plugin_config->{ipv6}; - my $tag = $plugin_config->{tag}; - my $alias = $plugin_config->{alias}; - - my @ips = (); - push @ips, $ipv4 if $ipv4; - push @ips, $ipv6 if $ipv6; - - my $vlan_config = { vid => $tag }; - - $vlan_config->{description} = $alias if $alias; - $vlan_config->{faucet_mac} = $mac if $mac; - $vlan_config->{faucet_vips} = \@ips if scalar @ips > 0; - - $config->{faucet}->{vlans}->{$vnetid} = $vlan_config; - - push(@{ $config->{faucet}->{routers}->{$zoneid}->{vlans} }, $vnetid); - -} - -sub write_controller_config { - my ($class, $plugin_config, $config) = @_; - - my $rawconfig = encode('UTF-8', CPAN::Meta::YAML::Dump($config->{faucet})); - - return if !$rawconfig; - return if !-d "/etc/faucet"; - - my $frr_config_file = "/etc/faucet/faucet.yaml"; - - my $writefh = IO::File->new($frr_config_file, ">"); - print $writefh $rawconfig; - $writefh->close(); -} - -sub reload_controller { - my ($class) = @_; - - my $conf_file = "/etc/faucet/faucet.yaml"; - my $bin_path = "/usr/bin/faucet"; - - if (-e $conf_file && -e $bin_path) { - PVE::Tools::run_command(['systemctl', 'reload', 'faucet']); - } -} - -1; - diff --git a/src/PVE/Network/SDN/Controllers/Makefile b/src/PVE/Network/SDN/Controllers/Makefile index fd9f881a0ad2..1464f29086f7 100644 --- a/src/PVE/Network/SDN/Controllers/Makefile +++ b/src/PVE/Network/SDN/Controllers/Makefile @@ -1,4 +1,4 @@ -SOURCES=Plugin.pm FaucetPlugin.pm EvpnPlugin.pm BgpPlugin.pm IsisPlugin.pm +SOURCES=Plugin.pm EvpnPlugin.pm BgpPlugin.pm IsisPlugin.pm PERL5DIR=${DESTDIR}/usr/share/perl5 diff --git a/src/PVE/Network/SDN/Zones.pm b/src/PVE/Network/SDN/Zones.pm index f66830324766..3ea0b954d97d 100644 --- a/src/PVE/Network/SDN/Zones.pm +++ b/src/PVE/Network/SDN/Zones.pm @@ -14,7 +14,6 @@ use PVE::Network::SDN::Zones::VlanPlugin; use PVE::Network::SDN::Zones::QinQPlugin; use PVE::Network::SDN::Zones::VxlanPlugin; use PVE::Network::SDN::Zones::EvpnPlugin; -use PVE::Network::SDN::Zones::FaucetPlugin; use PVE::Network::SDN::Zones::SimplePlugin; use PVE::Network::SDN::Zones::Plugin; @@ -22,7 +21,6 @@ PVE::Network::SDN::Zones::VlanPlugin->register(); PVE::Network::SDN::Zones::QinQPlugin->register(); PVE::Network::SDN::Zones::VxlanPlugin->register(); PVE::Network::SDN::Zones::EvpnPlugin->register(); -PVE::Network::SDN::Zones::FaucetPlugin->register(); PVE::Network::SDN::Zones::SimplePlugin->register(); PVE::Network::SDN::Zones::Plugin->init(); diff --git a/src/PVE/Network/SDN/Zones/FaucetPlugin.pm b/src/PVE/Network/SDN/Zones/FaucetPlugin.pm deleted file mode 100644 index 5f069aea85de..000000000000 --- a/src/PVE/Network/SDN/Zones/FaucetPlugin.pm +++ /dev/null @@ -1,72 +0,0 @@ -package PVE::Network::SDN::Zones::FaucetPlugin; - -use strict; -use warnings; -use PVE::Network::SDN::Zones::VlanPlugin; - -use base('PVE::Network::SDN::Zones::VlanPlugin'); - -sub type { - return 'faucet'; -} - -sub properties { - return { - 'dp-id' => { - type => 'integer', - description => 'Faucet dataplane id', - }, - }; -} - -sub options { - - return { - nodes => { optional => 1 }, - 'dp-id' => { optional => 0 }, - # 'uplink-id' => { optional => 0 }, - 'controller' => { optional => 0 }, - dns => { optional => 1 }, - reversedns => { optional => 1 }, - dnszone => { optional => 1 }, - ipam => { optional => 1 }, - }; -} - -# Plugin implementation -sub generate_sdn_config { - my ($class, $plugin_config, $zoneid, $vnetid, $vnet, $uplinks, $controller, $config) = @_; - - my $mtu = $vnet->{mtu}; - my $uplink = $plugin_config->{'uplink-id'}; - my $dpid = $plugin_config->{'dp-id'}; - my $dphex = printf("%x", $dpid); #fixme :should be 16characters hex - - my $iface = $uplinks->{$uplink}->{name}; - $iface = "uplink${uplink}" if !$iface; - - #tagged interface - my @iface_config = (); - push @iface_config, "ovs_type OVSPort"; - push @iface_config, "ovs_bridge $zoneid"; - push @iface_config, "ovs_mtu $mtu" if $mtu; - push(@{ $config->{$iface} }, @iface_config) if !$config->{$iface}; - - #vnet bridge - @iface_config = (); - push @iface_config, "ovs_port $iface"; - push @iface_config, "ovs_type OVSBridge"; - push @iface_config, "ovs_mtu $mtu" if $mtu; - - push @iface_config, "ovs_extra set bridge $zoneid other-config:datapath-id=$dphex"; - push @iface_config, "ovs_extra set bridge $zoneid other-config:disable-in-band=true"; - push @iface_config, "ovs_extra set bridge $zoneid fail_mode=secure"; - push @iface_config, "ovs_extra set-controller $vnetid tcp:127.0.0.1:6653"; - - push(@{ $config->{$zoneid} }, @iface_config) if !$config->{$zoneid}; - - return $config; -} - -1; - diff --git a/src/PVE/Network/SDN/Zones/Makefile b/src/PVE/Network/SDN/Zones/Makefile index 8454388d7eb7..7ea779a46967 100644 --- a/src/PVE/Network/SDN/Zones/Makefile +++ b/src/PVE/Network/SDN/Zones/Makefile @@ -1,4 +1,4 @@ -SOURCES=Plugin.pm VlanPlugin.pm VxlanPlugin.pm FaucetPlugin.pm EvpnPlugin.pm QinQPlugin.pm SimplePlugin.pm +SOURCES=Plugin.pm VlanPlugin.pm VxlanPlugin.pm EvpnPlugin.pm QinQPlugin.pm SimplePlugin.pm PERL5DIR=${DESTDIR}/usr/share/perl5 -- 2.47.3