.. code:: bash
- $ ceph nfs cluster create <type=cephfs> [--size=1] <clusterid>
+ $ ceph nfs cluster create <type=cephfs> <clusterid> [<placement>]
This creates a common recovery pool for all Ganesha daemons, new user based on
cluster_id and common ganesha config rados object.
-Here size denotes the number of ganesha daemons within a cluster and type is
-export type. Currently only CephFS is supported.
-
-.. note:: This does not setup ganesha recovery database and start the daemons.
- It needs to be done manually if not using vstart for creating
- clusters. Please refer `ganesha-rados-grace doc
- <https://github.com/nfs-ganesha/nfs-ganesha/blob/next/src/doc/man/ganesha-rados-grace.rst>`_
+Here type is export type and placement specifies the size of cluster and hosts.
+For more details on placement specification refer the `orchestrator doc
+<https://docs.ceph.com/docs/master/mgr/orchestrator/#placement-specification>`_.
+Currently only CephFS export type is supported.
Create CephFS Export
====================
log.exception(str(e))
return True
- def _call_orch_apply_nfs(self, size):
+ def _call_orch_apply_nfs(self, placement):
spec = NFSServiceSpec(service_type='nfs', service_id=self.cluster_id,
pool=self.pool_name, namespace=self.pool_ns,
- placement=PlacementSpec.from_string(str(size)))
+ placement=PlacementSpec.from_string(placement))
try:
completion = self.mgr.apply_nfs(spec)
self.mgr._orchestrator_wait([completion])
except Exception as e:
log.exception("Failed to create NFS daemons:{}".format(e))
- def create_nfs_cluster(self, export_type, size):
+ def create_nfs_cluster(self, export_type, placement):
if export_type != 'cephfs':
return -errno.EINVAL,"", f"Invalid export type: {export_type}"
if self.check_cluster_exists():
log.info(f"{self.cluster_id} cluster already exists")
else:
- self._call_orch_apply_nfs(size)
+ self._call_orch_apply_nfs(placement)
return 0, "", "NFS Cluster Created Successfully"
'cmd': 'nfs cluster create '
'name=type,type=CephString '
'name=clusterid,type=CephString '
- 'name=size,type=CephInt,req=false ',
+ 'name=placement,type=CephString,req=false ',
'desc': "Create an NFS Cluster",
'perm': 'rw'
},
return self.fs_export.delete_export(cmd['export_id'])
def _cmd_nfs_cluster_create(self, inbuf, cmd):
- #TODO add placement option
nfs_cluster_obj = NFSCluster(self, cmd['clusterid'])
- return nfs_cluster_obj.create_nfs_cluster(export_type=cmd['type'], size=cmd.get('size', 1))
+ return nfs_cluster_obj.create_nfs_cluster(export_type=cmd['type'],
+ placement=cmd.get('placement', None))