.. code:: bash
- $ ceph fs nfs cluster create [--size=1] <cluster_id>
+ $ ceph nfs cluster create <type=cephfs> [--size=1] <clusterid>
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.
+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
.. code:: bash
- $ ceph fs nfs export create <fsname> <binding> [--readonly] [--path=/path/in/cephfs] [--attach=<cluster_id>]
+ $ ceph nfs export create <type=cephfs> <fsname> <binding> [--readonly] [--path=/path/in/cephfs] [--attach=<clusterid>]
It creates export rados objects containing the export block. Here binding is
-the pseudo root name.
+the pseudo root name and type is export type. Currently only CephFS is
+supported.
Configuring NFS-Ganesha to export CephFS with vstart
====================================================
self._write_raw_config(conf_block, "export-{}".format(export.export_id))
self._update_common_conf(export.export_id)
- def create_export(self, fs_name, pseudo_path, read_only, path, cluster_id):
+ def create_export(self, export_type, fs_name, pseudo_path, read_only, path, cluster_id):
+ if export_type != 'cephfs':
+ return -errno.EINVAL,"", f"Invalid export type: {export_type}"
#TODO Check if valid cluster
if cluster_id not in self.exports:
self.exports[cluster_id] = []
"write configuration into rados object %s/%s/nfs-conf\n",
self.pool_name, self.pool_ns)
- def create_nfs_cluster(self, size):
+ def create_nfs_cluster(self, export_type, size):
+ if export_type != 'cephfs':
+ return -errno.EINVAL,"", f"Invalid export type: {export_type}"
+
pool_list = [p['pool_name'] for p in self.mgr.get_osdmap().dump().get('pools', [])]
client = 'client.%s' % self.cluster_id
'perm': 'r'
},
{
- 'cmd': 'fs nfs export create '
+ 'cmd': 'nfs export create '
+ 'name=type,type=CephString '
'name=fsname,type=CephString '
'name=binding,type=CephString '
'name=readonly,type=CephBool,req=false '
'perm': 'rw'
},
{
- 'cmd': 'fs nfs cluster create '
- 'name=size,type=CephInt,req=false '
- 'name=cluster_id,type=CephString ',
+ 'cmd': 'nfs cluster create '
+ 'name=type,type=CephString '
+ 'name=clusterid,type=CephString '
+ 'name=size,type=CephInt,req=false ',
'desc': "Create an NFS Cluster",
'perm': 'rw'
},
return self.vc.clone_cancel(
vol_name=cmd['vol_name'], clone_name=cmd['clone_name'], group_name=cmd.get('group_name', None))
- def _cmd_fs_nfs_export_create(self, inbuf, cmd):
- return self.fs_export.create_export(fs_name=cmd['fsname'],
+ def _cmd_nfs_export_create(self, inbuf, cmd):
+ #TODO Extend export creation for rgw.
+ return self.fs_export.create_export(export_type=cmd['type'], fs_name=cmd['fsname'],
pseudo_path=cmd['binding'], read_only=cmd.get('readonly', False),
path=cmd.get('path', '/'), cluster_id=cmd.get('attach','None'))
def _cmd_fs_nfs_export_delete(self, inbuf, cmd):
return self.fs_export.delete_export(cmd['export_id'])
- def _cmd_fs_nfs_cluster_create(self, inbuf, cmd):
- nfs_cluster_obj = NFSCluster(self, cmd['cluster_id'])
- return nfs_cluster_obj.create_nfs_cluster(size=cmd.get('size', 1))
+ def _cmd_nfs_cluster_create(self, inbuf, cmd):
+ nfs_cluster_obj = NFSCluster(self, cmd['clusterid'])
+ return nfs_cluster_obj.create_nfs_cluster(export_type=cmd['type'], size=cmd.get('size', 1))
osd "allow rw pool=$pool_name namespace=$namespace, allow rw tag cephfs data=a" \
mds "allow rw path=/" \
>> "$keyring_fn"
- prun ceph_adm fs nfs cluster create $name
+ prun ceph_adm nfs cluster create cephfs $name
echo "NFS_CORE_PARAM {
Enable_NLM = false;
pid file = $ganesha_dir/ganesha.pid
EOF
- prun ceph_adm fs nfs export create "a" "/cephfs" --attach=$name
+ prun ceph_adm nfs export create cephfs "a" "/cephfs" --attach=$name
prun ganesha-rados-grace -p $pool_name -n $namespace add $name
prun ganesha-rados-grace -p $pool_name -n $namespace