diff options
| author | Stefan Hanreich <s.hanreich@proxmox.com> | 2025-07-16 15:08:14 +0200 |
|---|---|---|
| committer | Thomas Lamprecht <t.lamprecht@proxmox.com> | 2025-07-17 00:10:48 +0200 |
| commit | 472f28f924de9253acaef70a9cb78ff3869d577a (patch) | |
| tree | 30f51dcb914a7d431aa7bdba4ea5894c26d985dc /src/PVE/API2/Network | |
| parent | 9794f3a7de8863d182f24b5fa676b8ad376cc26d (diff) | |
zone: vxlan: add fabrics integration
Add a new property to the VXLAN zone, that can contain the name of a
fabric. This automatically generates the peer-list from the fabric,
instead of having to manually write a comma-separated IP list. This
changes the peer field to optional from required. Either the peers or
the fabric field needs to be set, and this is now validated in the
update hook of the VXLAN zone.
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Link: https://lore.proxmox.com/20250716130837.585796-54-g.goller@proxmox.com
Diffstat (limited to 'src/PVE/API2/Network')
| -rw-r--r-- | src/PVE/API2/Network/SDN/Fabrics/Fabric.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/PVE/API2/Network/SDN/Fabrics/Fabric.pm b/src/PVE/API2/Network/SDN/Fabrics/Fabric.pm index d59b134..8c47b1b 100644 --- a/src/PVE/API2/Network/SDN/Fabrics/Fabric.pm +++ b/src/PVE/API2/Network/SDN/Fabrics/Fabric.pm @@ -237,6 +237,15 @@ __PACKAGE__->register_method({ } } + # check if this fabric is used in a vxlan zone + my $zone_cfg = PVE::Network::SDN::Zones::config(); + for my $key (keys %{ $zone_cfg->{ids} }) { + my $zone = $zone_cfg->{ids}->{$key}; + if ($zone->{type} eq "vxlan" && $zone->{fabric} eq $id) { + die "this fabric is still used in the VXLAN zone \"$key\""; + } + } + my $digest = extract_param($param, 'digest'); PVE::Tools::assert_if_modified($config->digest(), $digest) if $digest; |
