Skip to content

Commit 4269d7c

Browse files
committed
python-common/ceph/deployment: Add resource limits to nvmeof configuration
Fixes https://tracker.ceph.com/issues/68967 Signed-off-by: Gil Bregman <[email protected]>
1 parent c5eacfc commit 4269d7c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

src/python-common/ceph/deployment/service_spec.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,10 @@ def __init__(self,
13421342
ping_spdk_under_lock: Optional[bool] = False,
13431343
max_hosts_per_namespace: Optional[int] = 1,
13441344
max_namespaces_with_netmask: Optional[int] = 1000,
1345+
max_subsystems: Optional[int] = 128,
1346+
max_namespaces: Optional[int] = 1024,
1347+
max_namespaces_per_subsystem: Optional[int] = 256,
1348+
max_hosts_per_subsystem: Optional[int] = 32,
13451349
server_key: Optional[str] = None,
13461350
server_cert: Optional[str] = None,
13471351
client_key: Optional[str] = None,
@@ -1425,6 +1429,14 @@ def __init__(self,
14251429
self.max_hosts_per_namespace = max_hosts_per_namespace
14261430
#: ``max_namespaces_with_netmask`` max number of namespaces which are not auto visible
14271431
self.max_namespaces_with_netmask = max_namespaces_with_netmask
1432+
#: ``max_subsystems`` max number of subsystems
1433+
self.max_subsystems = max_subsystems
1434+
#: ``max_namespaces`` max number of namespaces on all subsystems
1435+
self.max_namespaces = max_namespaces
1436+
#: ``max_namespaces_per_subsystem`` max number of namespaces per one subsystem
1437+
self.max_namespaces_per_subsystem = max_namespaces_per_subsystem
1438+
#: ``max_hosts_per_subsystem`` max number of hosts per subsystems
1439+
self.max_hosts_per_subsystem = max_hosts_per_subsystem
14281440
#: ``allowed_consecutive_spdk_ping_failures`` # of ping failures before aborting gateway
14291441
self.allowed_consecutive_spdk_ping_failures = allowed_consecutive_spdk_ping_failures
14301442
#: ``spdk_ping_interval_in_seconds`` sleep interval in seconds between SPDK pings
@@ -1613,6 +1625,36 @@ def validate(self) -> None:
16131625
):
16141626
raise SpecValidationError("Log file directory backups can't be negative")
16151627

1628+
if (self.max_hosts_per_namespace and self.max_hosts_per_namespace < 0):
1629+
raise SpecValidationError("Max hosts per namespace can't be negative")
1630+
1631+
if (self.max_namespaces_with_netmask and self.max_namespaces_with_netmask < 0):
1632+
raise SpecValidationError("Max namespaces with netmask can't be negative")
1633+
1634+
if type(self.max_subsystems) != int:
1635+
raise SpecValidationError("Max subsystems must be an integer")
1636+
1637+
if self.max_subsystems <= 0:
1638+
raise SpecValidationError("Max subsystems must be greater than zero")
1639+
1640+
if type(self.max_namespaces) != int:
1641+
raise SpecValidationError("Max namespaces must be an integer")
1642+
1643+
if self.max_namespaces <= 0:
1644+
raise SpecValidationError("Max namespaces must be greater than zero")
1645+
1646+
if type(self.max_namespaces_per_subsystem) != int:
1647+
raise SpecValidationError("Max namespaces per subsystem must be an integer")
1648+
1649+
if self.max_namespaces_per_subsystem <= 0:
1650+
raise SpecValidationError("Max namespaces per subsystem must be greater than zero")
1651+
1652+
if type(self.max_hosts_per_subsystem) != int:
1653+
raise SpecValidationError("Max hosts per subsystem must be an integer")
1654+
1655+
if self.max_hosts_per_subsystem <= 0:
1656+
raise SpecValidationError("Max hosts per subsystem must be greater than zero")
1657+
16161658
if (
16171659
self.monitor_timeout
16181660
and self.monitor_timeout < 0.0

0 commit comments

Comments
 (0)