[pve-devel] [PATCH 3/4] pvecm create: add corosync.conf parameters for ipv6

Wolfgang Bumiller w.bumiller at proxmox.com
Thu May 21 13:07:43 CEST 2015


pvecm create now adds the following additional corosync.conf parameters:
 * totem.ip_version
 * totem.interface.ringnumber
 * totem.interface.bindnetaddr

For ipv6 corosync needs a 'totem.interface' list with at least one entry
containing a bindnetaddr setting. Additionally 'totem.ip_version' needs to
explicitly be set to ipv6 (or an 'mcastaddr' set, which corosync can
choose automatically, though, so we let it do just that).
---
 data/PVE/pvecm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/data/PVE/pvecm b/data/PVE/pvecm
index f5cacf1..9dba9fa 100755
--- a/data/PVE/pvecm
+++ b/data/PVE/pvecm
@@ -5,6 +5,7 @@ use warnings;
 use Getopt::Long;
 use Socket;
 use IO::File;
+use Net::IP;
 use File::Path;
 use File::Basename;
 use Data::Dumper; # fixme: remove 
@@ -154,12 +155,21 @@ __PACKAGE__->register_method ({
 
 	$param->{votes} = 1 if !defined($param->{votes});
 
+	# No, corosync cannot deduce this on its own
+	my $ipversion = Net::IP::ip_is_ipv6($local_ip_address) ? 'ipv6' : 'ipv4';
+
 	my $config = <<_EOD;
 totem {
   version: 2
   secauth: on
   cluster_name: $clustername
   config_version: 1
+  ip_version: $ipversion
+  interface {
+    ringnumber: 0
+    bindnetaddr: $local_ip_address
+  }
+  netmtu: 1480
 }
 
 nodelist {
-- 
2.1.4





More information about the pve-devel mailing list