* [pve-devel] [PATCH pve-network 1/4] evpn: frr: use datacenter default profile (lower timeouts)
2020-11-30 11:35 [pve-devel] [PATCH pve-network 0/4] various cleanups Alexandre Derumier
@ 2020-11-30 11:35 ` Alexandre Derumier
2020-11-30 11:35 ` [pve-devel] [PATCH pve-network 2/4] get_local_vnets: display vnet alias in comments Alexandre Derumier
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Derumier @ 2020-11-30 11:35 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
PVE/Network/SDN/Controllers/EvpnPlugin.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
index e59c142..b997cca 100644
--- a/PVE/Network/SDN/Controllers/EvpnPlugin.pm
+++ b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
@@ -288,7 +288,7 @@ sub write_controller_config {
push @{$final_config}, "log syslog informational";
push @{$final_config}, "ip forwarding";
push @{$final_config}, "ipv6 forwarding";
- push @{$final_config}, "frr defaults traditional";
+ push @{$final_config}, "frr defaults datacenter";
push @{$final_config}, "service integrated-vtysh-config";
push @{$final_config}, "hostname $nodename";
push @{$final_config}, "!";
--
2.20.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pve-devel] [PATCH pve-network 2/4] get_local_vnets: display vnet alias in comments
2020-11-30 11:35 [pve-devel] [PATCH pve-network 0/4] various cleanups Alexandre Derumier
2020-11-30 11:35 ` [pve-devel] [PATCH pve-network 1/4] evpn: frr: use datacenter default profile (lower timeouts) Alexandre Derumier
@ 2020-11-30 11:35 ` Alexandre Derumier
2020-11-30 11:35 ` [pve-devel] [PATCH pve-network 3/4] use canonical ipv6 address (RFC 5952) everywhere Alexandre Derumier
2020-11-30 11:35 ` [pve-devel] [PATCH pve-network 4/4] ipam : pve: don't register hostname/description Alexandre Derumier
3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Derumier @ 2020-11-30 11:35 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
PVE/Network/SDN.pm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/PVE/Network/SDN.pm b/PVE/Network/SDN.pm
index c0c5672..ed891de 100644
--- a/PVE/Network/SDN.pm
+++ b/PVE/Network/SDN.pm
@@ -188,6 +188,8 @@ sub get_local_vnets {
my $vnet = PVE::Network::SDN::Vnets::sdn_vnets_config($vnets_cfg, $vnetid);
my $zoneid = $vnet->{zone};
+ my $comments = $vnet->{alias};
+
my $privs = [ 'SDN.Audit', 'SDN.Allocate' ];
next if !$zoneid;
@@ -196,7 +198,7 @@ sub get_local_vnets {
my $zone_config = PVE::Network::SDN::Zones::sdn_zones_config($zones_cfg, $zoneid);
next if defined($zone_config->{nodes}) && !$zone_config->{nodes}->{$nodename};
- $vnets->{$vnetid} = { type => 'vnet', active => '1' };
+ $vnets->{$vnetid} = { type => 'vnet', active => '1', comments => $comments };
}
return $vnets;
--
2.20.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pve-devel] [PATCH pve-network 3/4] use canonical ipv6 address (RFC 5952) everywhere
2020-11-30 11:35 [pve-devel] [PATCH pve-network 0/4] various cleanups Alexandre Derumier
2020-11-30 11:35 ` [pve-devel] [PATCH pve-network 1/4] evpn: frr: use datacenter default profile (lower timeouts) Alexandre Derumier
2020-11-30 11:35 ` [pve-devel] [PATCH pve-network 2/4] get_local_vnets: display vnet alias in comments Alexandre Derumier
@ 2020-11-30 11:35 ` Alexandre Derumier
2020-11-30 11:35 ` [pve-devel] [PATCH pve-network 4/4] ipam : pve: don't register hostname/description Alexandre Derumier
3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Derumier @ 2020-11-30 11:35 UTC (permalink / raw)
To: pve-devel
we want only 1 format for ipam database
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
PVE/Network/SDN/Dns/PowerdnsPlugin.pm | 3 +--
PVE/Network/SDN/Ipams/PVEPlugin.pm | 5 +++--
PVE/Network/SDN/Subnets.pm | 9 ++++++++-
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/PVE/Network/SDN/Dns/PowerdnsPlugin.pm b/PVE/Network/SDN/Dns/PowerdnsPlugin.pm
index b00432e..3fbd595 100644
--- a/PVE/Network/SDN/Dns/PowerdnsPlugin.pm
+++ b/PVE/Network/SDN/Dns/PowerdnsPlugin.pm
@@ -7,8 +7,7 @@ use PVE::Cluster;
use PVE::Tools;
use JSON;
use Net::IP;
-use NetAddr::IP;
-
+use NetAddr::IP qw(:lower);
use base('PVE::Network::SDN::Dns::Plugin');
sub type {
diff --git a/PVE/Network/SDN/Ipams/PVEPlugin.pm b/PVE/Network/SDN/Ipams/PVEPlugin.pm
index e4c9ef7..a2e7d86 100644
--- a/PVE/Network/SDN/Ipams/PVEPlugin.pm
+++ b/PVE/Network/SDN/Ipams/PVEPlugin.pm
@@ -6,7 +6,8 @@ use PVE::INotify;
use PVE::Cluster qw(cfs_read_file cfs_write_file cfs_register_file cfs_lock_file);
use PVE::Tools;
use JSON;
-use NetAddr::IP;
+use NetAddr::IP qw(:lower);
+
use Net::IP;
use Digest::SHA;
@@ -134,7 +135,7 @@ sub add_next_freeip {
while(1) {
$iplist++;
last if $iplist eq $broadcast;
- my $ip = $iplist->addr();
+ my $ip = $iplist->canon();
next if defined($dbsubnet->{ips}->{$ip});
$freeip = $ip;
last;
diff --git a/PVE/Network/SDN/Subnets.pm b/PVE/Network/SDN/Subnets.pm
index 74a538c..81970a1 100644
--- a/PVE/Network/SDN/Subnets.pm
+++ b/PVE/Network/SDN/Subnets.pm
@@ -5,6 +5,7 @@ use warnings;
use Net::Subnet qw(subnet_matcher);
use Net::IP;
+use NetAddr::IP qw(:lower);
use PVE::Cluster qw(cfs_read_file cfs_write_file cfs_lock_file);
use PVE::Network::SDN::Dns;
@@ -213,6 +214,9 @@ sub add_ip {
return if !$subnet || !$ip;
+ my $ipaddr = new NetAddr::IP($ip);
+ $ip = $ipaddr->canon();
+
my $ipamid = $zone->{ipam};
my $dns = $zone->{dns};
my $dnszone = $zone->{dnszone};
@@ -255,7 +259,10 @@ sub add_ip {
sub del_ip {
my ($zone, $subnetid, $subnet, $ip, $hostname) = @_;
- return if !$subnet;
+ return if !$subnet || !$ip;
+
+ my $ipaddr = new NetAddr::IP($ip);
+ $ip = $ipaddr->canon();
my $ipamid = $zone->{ipam};
my $dns = $zone->{dns};
--
2.20.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pve-devel] [PATCH pve-network 4/4] ipam : pve: don't register hostname/description
2020-11-30 11:35 [pve-devel] [PATCH pve-network 0/4] various cleanups Alexandre Derumier
` (2 preceding siblings ...)
2020-11-30 11:35 ` [pve-devel] [PATCH pve-network 3/4] use canonical ipv6 address (RFC 5952) everywhere Alexandre Derumier
@ 2020-11-30 11:35 ` Alexandre Derumier
3 siblings, 0 replies; 5+ messages in thread
From: Alexandre Derumier @ 2020-11-30 11:35 UTC (permalink / raw)
To: pve-devel
we already have this informations in vm/ct config,
and we are limited in space in pmxcfs
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
PVE/Network/SDN/Ipams/PVEPlugin.pm | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/PVE/Network/SDN/Ipams/PVEPlugin.pm b/PVE/Network/SDN/Ipams/PVEPlugin.pm
index a2e7d86..4925274 100644
--- a/PVE/Network/SDN/Ipams/PVEPlugin.pm
+++ b/PVE/Network/SDN/Ipams/PVEPlugin.pm
@@ -98,10 +98,7 @@ sub add_ip {
die "IP '$ip' already exist\n" if defined($dbsubnet->{ips}->{$ip});
- $dbsubnet->{ips}->{$ip} = {
- hostname => $hostname,
- description => $description,
- };
+ $dbsubnet->{ips}->{$ip} = {};
write_db($db);
});
@@ -144,10 +141,7 @@ sub add_next_freeip {
die "can't find free ip in subnet '$cidr'\n" if !$freeip;
- $dbsubnet->{ips}->{$freeip} = {
- hostname => $hostname,
- description => $description,
- };
+ $dbsubnet->{ips}->{$freeip} = {};
write_db($db);
});
--
2.20.1
^ permalink raw reply [flat|nested] 5+ messages in thread