[pve-devel] [PATCH cluster v3 14/14] use resolved IP address for ring0_addr as default

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Dec 19 12:52:39 CET 2017


---

new in v3

 data/PVE/API2/ClusterConfig.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/data/PVE/API2/ClusterConfig.pm b/data/PVE/API2/ClusterConfig.pm
index c0fb57e..48f81a5 100644
--- a/data/PVE/API2/ClusterConfig.pm
+++ b/data/PVE/API2/ClusterConfig.pm
@@ -472,7 +472,7 @@ __PACKAGE__->register_method ({
 	    ring0_addr => {
 		type => 'string', format => 'address',
 		description => "Hostname (or IP) of the corosync ring0 address of this node.".
-		    " Defaults to nodes hostname.",
+		    " Defaults IP resolved by nodes hostname.",
 		optional => 1,
 	    },
 	    ring1_addr => {
@@ -515,6 +515,7 @@ __PACKAGE__->register_method ({
 	    PVE::Cluster::ssh_unmerge_known_hosts();
 
 	    my $host = $param->{hostname};
+	    my $local_ip_address = PVE::Cluster::remote_node_ip($nodename);
 
 	    my $conn_args = {
 		username => 'root at pam',
@@ -547,7 +548,7 @@ __PACKAGE__->register_method ({
 	    $args->{force} = $param->{force} if defined($param->{force});
 	    $args->{nodeid} = $param->{nodeid} if $param->{nodeid};
 	    $args->{votes} = $param->{votes} if defined($param->{votes});
-	    $args->{ring0_addr} = $ring0_addr if defined($ring0_addr);
+	    $args->{ring0_addr} = $ring0_addr // $local_ip_address;
 	    $args->{ring1_addr} = $ring1_addr if defined($ring1_addr);
 
 	    print "Request addition of this node\n";
-- 
2.11.0





More information about the pve-devel mailing list