[pve-devel] [PATCH cluster] pvecm join: also default to resolved IP with use_ssh param

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Mar 29 11:06:08 CEST 2018


We already switched to this behaviour in pvecm create and pvecm join
(with API) but did not changed it for the case when a user requested
to use the old method to join with --use_ssh.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 data/PVE/CLI/pvecm.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/data/PVE/CLI/pvecm.pm b/data/PVE/CLI/pvecm.pm
index 7e16586..23a15a9 100755
--- a/data/PVE/CLI/pvecm.pm
+++ b/data/PVE/CLI/pvecm.pm
@@ -107,6 +107,7 @@ __PACKAGE__->register_method ({
 	my $nodename = PVE::INotify::nodename();
 
 	my $host = $param->{hostname};
+	my $local_ip_address = remote_node_ip($nodename);
 
 	PVE::Cluster::assert_joinable($param->{ring0_addr}, $param->{ring1_addr}, $param->{force});
 
@@ -150,7 +151,7 @@ __PACKAGE__->register_method ({
 
 	    push @$cmd, '--nodeid', $param->{nodeid} if $param->{nodeid};
 	    push @$cmd, '--votes', $param->{votes} if defined($param->{votes});
-	    push @$cmd, '--ring0_addr', $param->{ring0_addr} if defined($param->{ring0_addr});
+	    push @$cmd, '--ring0_addr', $param->{ring0_addr} // $local_ip_address;
 	    push @$cmd, '--ring1_addr', $param->{ring1_addr} if defined($param->{ring1_addr});
 
 	    if (system (@$cmd) != 0) {
-- 
2.14.2





More information about the pve-devel mailing list