]>
git.proxmox.com Git - pve-network.git/blob - PVE/Network/SDN/Zones/FaucetPlugin.pm
1 package PVE
::Network
::SDN
::Zones
::FaucetPlugin
;
5 use PVE
::Network
::SDN
::Zones
::VlanPlugin
;
7 use base
('PVE::Network::SDN::Zones::VlanPlugin');
17 description
=> 'Faucet dataplane id',
25 nodes
=> { optional
=> 1},
26 'dp-id' => { optional
=> 0 },
27 # 'uplink-id' => { optional => 0 },
28 'controller' => { optional
=> 0 },
29 dns
=> { optional
=> 1 },
30 reversedns
=> { optional
=> 1 },
31 dnszone
=> { optional
=> 1 },
32 ipam
=> { optional
=> 1 },
36 # Plugin implementation
37 sub generate_sdn_config
{
38 my ($class, $plugin_config, $zoneid, $vnetid, $vnet, $uplinks, $controller, $config) = @_;
40 my $mtu = $vnet->{mtu
};
41 my $uplink = $plugin_config->{'uplink-id'};
42 my $dpid = $plugin_config->{'dp-id'};
43 my $dphex = printf("%x",$dpid); #fixme :should be 16characters hex
45 my $iface = $uplinks->{$uplink}->{name
};
46 $iface = "uplink${uplink}" if !$iface;
49 my @iface_config = ();
50 push @iface_config, "ovs_type OVSPort";
51 push @iface_config, "ovs_bridge $zoneid";
52 push @iface_config, "ovs_mtu $mtu" if $mtu;
53 push(@{$config->{$iface}}, @iface_config) if !$config->{$iface};
57 push @iface_config, "ovs_port $iface";
58 push @iface_config, "ovs_type OVSBridge";
59 push @iface_config, "ovs_mtu $mtu" if $mtu;
61 push @iface_config, "ovs_extra set bridge $zoneid other-config:datapath-id=$dphex";
62 push @iface_config, "ovs_extra set bridge $zoneid other-config:disable-in-band=true";
63 push @iface_config, "ovs_extra set bridge $zoneid fail_mode=secure";
64 push @iface_config, "ovs_extra set-controller $vnetid tcp:127.0.0.1:6653";
66 push(@{$config->{$zoneid}}, @iface_config) if !$config->{$zoneid};