[pve-devel] [RFC manager] Allow specifying cluster and public network separately

Philip Abernethy p.abernethy at proxmox.com
Wed Aug 30 09:41:43 CEST 2017


---
We always recommend putting ceph-internal communication into a separate cluster
network. Yet pveceph init does not allow to specify one, leading to
difficulties if one were to follow the setup guide on the wiki, which proceeds
to create monitors after the ceph network was initialised.
In case you never had to, changing the IP of a monitor is a huge PITA.
Ideally I'd like to group cluster_network and public_network so that either
both or neither have to be specified. Also I'd like this group to be mutually
exclusive with the network param, with the whole construct still being
optional.
But I'm not sure if your cmdline builder can deliver that.

 PVE/API2/Ceph.pm | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index 7f709f55..6062e173 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -783,7 +783,22 @@ __PACKAGE__->register_method ({
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    network => {
-		description => "Use specific network for all ceph related traffic",
+		description => "Use specific network for all ceph related traffic.\n" .
+		"Takes precedence over public_network and cluster_network.",
+		type => 'string', format => 'CIDR',
+		optional => 1,
+		maxLength => 128,
+	    },
+	    public_network => {
+		description => "Use specific network for all ceph data traffic.\n" .
+		"Specify along with cluster_network.",
+		type => 'string', format => 'CIDR',
+		optional => 1,
+		maxLength => 128,
+	    },
+	    cluster_network => {
+		description => "Use specific network for all internal ceph traffic.\n" .
+		"Specify along with public_network.",
 		type => 'string', format => 'CIDR',
 		optional => 1,
 		maxLength => 128,
@@ -877,6 +892,9 @@ __PACKAGE__->register_method ({
 	if ($param->{network}) {
 	    $cfg->{global}->{'public network'} = $param->{network};
 	    $cfg->{global}->{'cluster network'} = $param->{network};
+	} elsif ($param->{public_network} && $param->{cluster_network}) {
+	    $cfg->{global}->{'public network'} = $param->{public_network};
+	    $cfg->{global}->{'cluster network'} = $param->{cluster_network};
 	}
 
 	PVE::CephTools::write_ceph_config($cfg);
-- 
2.11.0





More information about the pve-devel mailing list