[pve-devel] [PATCH manager 2/2] ceph: increase allowed service names to 63 characters

Dominik Csapak d.csapak at proxmox.com
Mon Feb 24 12:01:36 CET 2020


according to rfc 1034[0], each label of a domain name can be 63 octets
so increase that limit in the api calls and in ceph_service_cmd

users can now create ceph services on machines with hostnames
longer than 32 characters

0: https://tools.ietf.org/html/rfc1034#section-3.1

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/Ceph.pm     | 6 +++---
 PVE/Ceph/Services.pm | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index 391382f8..72d21c90 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -424,7 +424,7 @@ __PACKAGE__->register_method ({
 		type => 'string',
 		optional => 1,
 		default => 'ceph.target',
-		pattern => '(ceph|mon|mds|osd|mgr)(\.[A-Za-z0-9\-]{1,32})?',
+		pattern => '(ceph|mon|mds|osd|mgr)(\.[A-Za-z0-9\-]{1,63})?',
 	    },
 	},
     },
@@ -475,7 +475,7 @@ __PACKAGE__->register_method ({
 		type => 'string',
 		optional => 1,
 		default => 'ceph.target',
-		pattern => '(ceph|mon|mds|osd|mgr)(\.[A-Za-z0-9\-]{1,32})?',
+		pattern => '(ceph|mon|mds|osd|mgr)(\.[A-Za-z0-9\-]{1,63})?',
 	    },
 	},
     },
@@ -526,7 +526,7 @@ __PACKAGE__->register_method ({
 		type => 'string',
 		optional => 1,
 		default => 'ceph.target',
-		pattern => '(mon|mds|osd|mgr)(\.[A-Za-z0-9\-]{1,32})?',
+		pattern => '(mon|mds|osd|mgr)(\.[A-Za-z0-9\-]{1,63})?',
 	    },
 	},
     },
diff --git a/PVE/Ceph/Services.pm b/PVE/Ceph/Services.pm
index 45eb6c3f..ac3d7ae7 100644
--- a/PVE/Ceph/Services.pm
+++ b/PVE/Ceph/Services.pm
@@ -62,7 +62,7 @@ sub ceph_service_cmd {
     my ($action, $service) = @_;
 
     my $pve_ceph_cfgpath = PVE::Ceph::Tools::get_config('pve_ceph_cfgpath');
-    if ($service && $service =~ m/^(mon|osd|mds|mgr|radosgw)(\.([A-Za-z0-9\-]{1,32}))?$/) {
+    if ($service && $service =~ m/^(mon|osd|mds|mgr|radosgw)(\.([A-Za-z0-9\-]{1,63}))?$/) {
 	$service = defined($3) ? "ceph-$1\@$3" : "ceph-$1.target";
     } else {
 	$service = "ceph.target";
-- 
2.20.1




More information about the pve-devel mailing list