]> git.proxmox.com Git - pve-cluster.git/commitdiff
pvecm create: remove rrp_mode parameter
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 Feb 2017 15:59:06 +0000 (16:59 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 28 Feb 2017 10:41:18 +0000 (11:41 +0100)
I detected a bug where we overwrote the whole $interfaces variable
(and so all interfaces from the corosync config) if the 'rrp_mode'
param was set.

While this would be easy to with by changing the line to
$interfaces .= ...
I removed the whole rrp_mode parameter instead.

As:
a) I've seen no one running into this bug, so this parameter was not
   really used either way.
b) only the 'passive' is supported and works, 'active' has a whole
   lot of problems. If someone really wants it he should edit the
   corosync config file to achieve this

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/PVE/CLI/pvecm.pm

index f15f467d89856247737f72e7b6fd4e7b149fa1c0..294486f9480d2953590996697242979475aa13ea 100755 (executable)
@@ -133,15 +133,6 @@ __PACKAGE__->register_method ({
                    " Defaults to the hostname of the node.",
                optional => 1,
            },
                    " Defaults to the hostname of the node.",
                optional => 1,
            },
-           rrp_mode => {
-               type => 'string',
-               enum => ['none', 'active', 'passive'],
-               description => "This specifies the mode of redundant ring, which" .
-                   " may be none, active or passive. Using multiple interfaces".
-                   " only allows 'active' or 'passive'.",
-               default => 'none',
-               optional => 1,
-           },
            bindnet1_addr => {
                type => 'string', format => 'ip',
                description => "This specifies the network address the corosync ring 1".
            bindnet1_addr => {
                type => 'string', format => 'ip',
                description => "This specifies the network address the corosync ring 1".
@@ -202,13 +193,11 @@ __PACKAGE__->register_method ({
            die "IPv6 and IPv4 cannot be mixed, use one or the other!\n"
                if Net::IP::ip_is_ipv6($param->{bindnet1_addr}) != $bind_is_ipv6;
 
            die "IPv6 and IPv4 cannot be mixed, use one or the other!\n"
                if Net::IP::ip_is_ipv6($param->{bindnet1_addr}) != $bind_is_ipv6;
 
-           die "rrp_mode 'none' is not allowed when using multiple interfaces,".
-               " use 'active' or 'passive'!\n"
-               if !$param->{rrp_mode} || $param->{rrp_mode} eq 'none';
-
            $interfaces .= "\n  interface {\n    ringnumber: 1\n" .
                "    bindnetaddr: $param->{bindnet1_addr}\n  }\n";
 
            $interfaces .= "\n  interface {\n    ringnumber: 1\n" .
                "    bindnetaddr: $param->{bindnet1_addr}\n  }\n";
 
+           $interfaces .= "rrp_mode: passive\n"; # only passive is stable and tested
+
            $ring_addresses .= "\n    ring1_addr: $param->{ring1_addr}";
 
        } elsif($param->{rrp_mode} && $param->{rrp_mode} ne 'none') {
            $ring_addresses .= "\n    ring1_addr: $param->{ring1_addr}";
 
        } elsif($param->{rrp_mode} && $param->{rrp_mode} ne 'none') {
@@ -220,9 +209,6 @@ __PACKAGE__->register_method ({
 
        }
 
 
        }
 
-       $interfaces = "rrp_mode: $param->{rrp_mode}\n  " . $interfaces
-           if $param->{rrp_mode};
-
        # No, corosync cannot deduce this on its own
        my $ipversion = $bind_is_ipv6 ? 'ipv6' : 'ipv4';
 
        # No, corosync cannot deduce this on its own
        my $ipversion = $bind_is_ipv6 ? 'ipv6' : 'ipv4';