@_cli_write_command(
'orch apply',
'name=service_type,type=CephChoices,strings=mon|mgr|rbd-mirror|crash|alertmanager|grafana|node-exporter|prometheus '
- 'name=placement,type=CephString,req=false',
+ 'name=placement,type=CephString,req=false '
+ 'name=unmanaged,type=CephBool,req=false',
'Update the size or placement for a service')
- def _apply_misc(self, service_type, placement=None):
+ def _apply_misc(self, service_type, placement=None, unmanaged=False):
placement = PlacementSpec.from_string(placement)
placement.validate()
- spec = ServiceSpec(service_type, placement=placement)
+ spec = ServiceSpec(service_type, placement=placement,
+ unmanaged=unmanaged)
if service_type == 'mgr':
completion = self.apply_mgr(spec)
@_cli_write_command(
'orch apply mds',
'name=fs_name,type=CephString '
- 'name=placement,type=CephString,req=false',
+ 'name=placement,type=CephString,req=false '
+ 'name=unmanaged,type=CephBool,req=false',
'Update the number of MDS instances for the given fs_name')
- def _apply_mds(self, fs_name, placement=None):
+ def _apply_mds(self, fs_name, placement=None, unmanaged=False):
placement = PlacementSpec.from_string(placement)
placement.validate()
spec = ServiceSpec(
'mds', fs_name,
- placement=placement)
+ placement=placement,
+ unmanaged=unmanaged)
completion = self.apply_mds(spec)
self._orchestrator_wait([completion])
raise_if_exception(completion)
'orch apply rgw',
'name=realm_name,type=CephString '
'name=zone_name,type=CephString '
- 'name=placement,type=CephString,req=false',
+ 'name=placement,type=CephString,req=false '
+ 'name=unmanaged,type=CephBool,req=false',
'Update the number of RGW instances for the given zone')
- def _apply_rgw(self, zone_name, realm_name, placement=None):
+ def _apply_rgw(self, zone_name, realm_name, placement=None, unmanaged=False):
spec = RGWSpec(
rgw_realm=realm_name,
rgw_zone=zone_name,
placement=PlacementSpec.from_string(placement),
+ unmanaged=unmanaged,
)
completion = self.apply_rgw(spec)
self._orchestrator_wait([completion])
@_cli_write_command(
'orch apply nfs',
"name=svc_id,type=CephString "
- 'name=placement,type=CephString,req=false',
+ 'name=placement,type=CephString,req=false '
+ 'name=unmanaged,type=CephBool,req=false',
'Scale an NFS service')
- def _apply_nfs(self, svc_id, placement=None):
+ def _apply_nfs(self, svc_id, placement=None, unmanaged=False):
spec = NFSServiceSpec(
svc_id,
placement=PlacementSpec.from_string(placement),
+ unmanaged=unmanaged,
)
completion = self.apply_nfs(spec)
self._orchestrator_wait([completion])
"""
def __init__(self,
- service_type, # type: str
+ service_type, # type: str
service_id=None, # type: Optional[str]
- placement: Optional[PlacementSpec] = None,
- count: Optional[int] = None):
+ placement=None, # type: Optional[PlacementSpec]
+ count=None, # type: Optional[int]
+ unmanaged=False, # type: bool
+ ):
self.placement = PlacementSpec() if placement is None else placement # type: PlacementSpec
assert service_type
self.service_type = service_type
self.service_id = service_id
+ self.unmanaged = unmanaged
@classmethod
def from_json(cls, json_spec):
class NFSServiceSpec(ServiceSpec):
def __init__(self, service_id, pool=None, namespace=None, placement=None,
- service_type='nfs'):
+ service_type='nfs', unmanaged=False):
assert service_type == 'nfs'
- super(NFSServiceSpec, self).__init__('nfs', service_id=service_id, placement=placement)
+ super(NFSServiceSpec, self).__init__(
+ 'nfs', service_id=service_id,
+ placement=placement, unmanaged=unmanaged)
#: RADOS pool where NFS client recovery data is stored.
self.pool = pool
placement=None,
service_type='rgw',
rgw_frontend_port=None, # type: Optional[int]
+ unmanaged=False, # type: bool
):
assert service_type == 'rgw'
if service_id:
(rgw_realm, rgw_zone) = service_id.split('.', 1)
else:
service_id = '%s.%s' % (rgw_realm, rgw_zone)
- super(RGWSpec, self).__init__('rgw', service_id=service_id, placement=placement)
+ super(RGWSpec, self).__init__(
+ 'rgw', service_id=service_id,
+ placement=placement, unmanaged=unmanaged)
self.rgw_realm = rgw_realm
self.rgw_zone = rgw_zone