For now in passive mode, a link with a higher value has a lower
priority. If the current active link fails the one with the next
higher priority will take over. Use 255 as maximum, as internally
kronosnet uses an uin8_t variable for this, and while there can be
"only" 8 links currently it may be still nice to use different values
that ]0..1[ for them, e.g., when re-shuffling link priorities it's
useful to have space between them.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
format_description => 'IP',
description => "Hostname (or IP) of this corosync link address.",
},
+ priority => {
+ optional => 1,
+ type => 'integer',
+ minimum => 0,
+ maximum => 255,
+ default => 0,
+ description => "The priority for the link when knet is used in 'passive' mode. Lower value means higher priority.",
+ },
};
my $corosync_link_desc = {
type => 'string', format => $corosync_link_format,
debug => 'off',
},
};
+ my $totem = $conf->{totem};
- my $link1 = PVE::Cluster::parse_corosync_link($param{link1});
+ $totem->{interface}->{0}->{knet_link_priority} = $link0->{priority}
+ if defined($link0->{priority});
+ my $link1 = PVE::Cluster::parse_corosync_link($param{link1});
if ($link1->{address}) {
$conf->{totem}->{interface}->{1} = {
linknumber => 1,
};
- $conf->{totem}->{link_mode} = 'passive';
+ $totem->{link_mode} = 'passive';
+ $totem->{interface}->{1}->{knet_link_priority} = $link1->{priority}
+ if defined($link1->{priority});
$conf->{nodelist}->{node}->{$nodename}->{ring1_addr} = $link1->{address};
}