Skip to content

Instantly share code, notes, and snippets.

@ajarr
Last active February 25, 2019 04:02
Show Gist options
  • Save ajarr/05776c0aa497aad1d7c126fdd9d27e29 to your computer and use it in GitHub Desktop.
Save ajarr/05776c0aa497aad1d7c126fdd9d27e29 to your computer and use it in GitHub Desktop.
All-in-one dev setup for manila's cephfs/nfs-ganesha driver

Dev testing manila's cephfs(NFS) driver

Reference https://docs.openstack.org/developer/manila/devref/cephfs_driver.html

Create all-in-one** CephFS/Ganesha/Manila setup using devstack in a CentOS7 machine similar to the one in the upstream gate, gate-manila-tempest-minimal-dsvm-cephfs-nfs-centos-7-nv

** Ceph server daemons (1 OSD, 1 MON, 1 MDS), NFS-Ganesha server, and manila-services all run in the same machine.

  • Clone devstack
$ git clone https://github.com/openstack-dev/devstack
$ cd devstack
  • Create a local.conf
cat <<EOF >local.conf
[[local|localrc]]
HOST_IP=10.0.2.15
DATABASE_PASSWORD=rengen
RABBIT_PASSWORD=guest
SERVICE_TOKEN=rengen
SERVICE_PASSWORD=rengen
ADMIN_PASSWORD=rengen


INSTALL_TESTONLY_PACKAGES=yes
INSTALL_TEMPEST=True

# Enable logging
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=/opt/stack/logs
LOGDAYS=2

RECLONE=no

disable_service horizon

disable_service heat
disable_service h-eng
disable_service h-api
disable_service h-api-cfn
disable_service h-api-cw

disable_service n-net

enable_service neutron
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta

enable_plugin manila git://git.openstack.org/openstack/manila
enable_plugin devstack-plugin-ceph git://git.openstack.org/openstack/devstack-plugin-ceph

ENABLE_CEPH_CINDER=False
ENABLE_CEPH_GLANCE=False
ENABLE_CEPH_C_BAK=False
ENABLE_CEPH_NOVA=False
ENABLE_CEPH_MANILA=True
MANILA_CEPH_DRIVER=cephfsnfs
EOF
  • Run devstack
$./stack.sh
  • If stack run is successful, then manila-services, Ceph servers, and NFS-Ganesha server should be up and running.
$ ps aux | grep manila
$ sudo ceph -s
$ systemctl status nfs-ganesha
  • Set the ganesha server's IP address (the nova guest VM should be able to connect to this address) in the cephfsnfs1 driver section of manila.conf using the `cephfs_ganesha_server_ip' option. Now restart the manila share service.
[cephfsnfs1]
cephfs_ganesha_server_ip = 172.24.4.3
share_driver = manila.share.drivers.cephfs.driver.CephFSDriver
share_backend_name = CEPHFSNFS1
driver_handles_share_servers = False
cephfs_protocol_helper_type = NFS
cephfs_conf_path = /etc/ceph/ceph.conf
cephfs_auth_id = manila
  • Configure a share type that matches the CephFS/NFS-Ganesha backend capabilities.
manila type-create cephfsnfstype false
manila type-key cephfsnfstype set vendor_name=Ceph storage_protocol=NFS
  • Create a share.
manila create --share-type cephfsnfstype --name cephnfsshare1 nfs 1
  • Note the export location of the share:
manila share-export-location-list cephnfsshare1

The export location of the share contains the IP address of the NFS-Ganesha server and the path to be mounted. It is of the form, {NFS-Ganesha server address}:{path to be mounted}

  • Allow access to a nova VM, which can connect to the ganesha server.
manila access-allow cephnfsshare1 ip 172.24.4.225
  • Try mounting the NFS share from the VM, IP 172.24.4.225
sudo mount -t nfs 172.24.4.3:/volumes/_nogroup/6732900b-32c1-4816-a529-4d6d3f15811e /mnt/nfs/
@rishabh-d-dave
Copy link

Since manila_tempest_tests recently moved out of the Manila's git repo, following extra line would be required for setting up Manila with CephFS as backend -

enable_plugin manila-tempest-plugin git://git.openstack.org/openstack/manila-tempest-plugin

@rishabh-d-dave
Copy link

And the reference link gets redirected to https://docs.openstack.org/manila/latest/. Perhaps, it should be replaced by this one - https://docs.openstack.org/manila/pike/contributor/cephfs_driver.html.

Hopefully, I am not bugging you with changes.

@fengyd2018
Copy link

fengyd2018 commented Jun 6, 2018

. stackrc
manila type-create cephfsnfstype false
ERROR: Access was denied to this resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment