Commit Graph

16 Commits

Author SHA1 Message Date
Goutham Pacha Ravi ee8af90109 Implement Ensure Shares in the CephFS driver
This allows switching between NFS protocol helpers
that the driver currently supports and avoids
unnecessary ensuring of driver resources on restarts
unless a small set of config opts are toggled.

Use of either NFS protocol helper in the driver
will trigger access rules to be reapplied when
ensuring shares.

Implements: bp use-cephadm-nfs-ganesha
Partial-Bug: #2035137
Change-Id: I93c4e8616a1cfb5ab713b420aff69464969f28d5
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2023-09-11 12:30:25 -07:00
haixin a73b299374 Remove usage of six lib for third party/vendors drivers.
Python2 is no longer supported, so in this patch
set we remove the usage of the six (py2 and py3
compatibility library) in favor of py3 syntax.

Change-Id: I3ddfad568a1b578bee23a6d1a96de9551e336bb4
2022-01-29 03:01:17 +00:00
Victoria Martinez de la Cruz a830710939 Update cephfs drivers to use ceph-mgr client
Use python rados client to talk to the ceph-mgr service.

A python rados client is created by the driver that lasts
during the driver's lifecycle.

The drivers can now work with multiple filesystem clusters.
The filesystem to be used by manila can be specified by the
driver option 'cephfs_filesystem_name'.

The removal of a share will be quicker for the manila user.
The ceph-mgr volumes module moves the share's content to
a trash folder and purges the trash's contents
(`rm -rf` of the backend CephFS subvolume/subtree) aysnchronously,
whereas the ceph_volume_client library moves the share's content
and purges the content synchronously.

Implements: bp update-cephfs-drivers

Co-Authored-By: Victoria Martinez de la Cruz <victoria@redhat.com>
Co-Authored-By: Ramana Raja <rraja@redhat.com>
Co-Authored-By: Tom Barron <tpb@dyncloud.net>

DocImpact

Change-Id: I1f81db1ba7724c0784d87f9cb92bb696f6778806
2021-03-24 10:50:05 -04:00
Andreas Jaeger 3fdd9983e0 Hacking: Fix W605
Fix:
W605 invalid escape sequence

This is the final change I plan for hacking, the remaining problems
need further investigation by manila team and decision whether and how
to solve them.

Change-Id: I73d73e044eaaf412bf7ace358a3f07c8d269d6cf
2020-04-01 14:38:14 +02:00
Tom Barron 9df750fd19 Only allow IP access type for CephFS NFS
For the CephFS NFS back end only ``IP`` access type
is valid so enforce this in the driver.

Also validate access level since there is a utility
routine to check both access type and access level.

Closes-bug: #1816420
Change-Id: I6c96f861b30ef7ccac05a7c199a62f0d69044c3a
2019-03-20 18:42:01 -04:00
Tom Barron a65c2b0974 Fix ganesha for 0.0.0.0/0 access
Translate '0.0.0.0/0' to '0.0.0.0' when allowing IP
access with the ganesha driver since the ganesha back end
cannot handle the former expression and the latter has
the desired effect of allowing access to all IPs.

Closes-bug: #1800627

Change-Id: Ica698b6a70a128522c2c2de76a69e59207fd60ac
2018-11-26 12:48:18 +00:00
Ramana Raja add46c036b ganesha: store exports and export counter in RADOS
Allow the ganesha driver to store ganesha exports
and export counter as Ceph RADOS objects. This enables
highly available(HA) Ganesha servers in manila deployments
to store their config in a HA storage.

Implements: blueprint ganesha-ha-rados
Change-Id: Ia51156055fa10d0661e662c9c998829864f1a204
2017-12-08 10:33:44 +05:30
Ramana Raja 9de31168d3 cephfs/driver: add nfs protocol support
Add a NFS protocol helper class that can modify exports of a Ganesha
server based on share access rule changes. This allows the manila
guests to access shares in CephFS backend using NFS protocol through
NFS-Ganesha gateways.

And while adding the driver's helper class that subclasses Ganesha
library's GaneshaNASHelper2 identified minor issues in the
Ganesha library. Fix the issues by:

* escaping special character '=' in values of Ganesha conf's string
  options, except for option CLIENTS, by enclosing the values with
  double quotes.

* add a new callback interface to GaneshaNASHelper class to
  allow driver's to perform Ganesha FSAL specific cleanup.

Partially-implements: bp cephfs-nfs-support
Depends-On: I5234bae0595efdcd30305a32bf9c121072a3625e
Change-Id: I9709d94cdb6f8d3e92b8dfc91b2ec4e154a8ec20
2017-06-19 15:38:38 +05:30
Ramana Raja a8e522961c ganesha: dynamically update access of share
You can dynamically update access lists of exports with Ganesha
version >= 2.4. Make ganesha library use this feature in a new helper
class, GaneshaNASHelper2, to cleanly implement share access rules
changes without undesired interruptions.

When updating a share's access rules, the new helper class differs
from the older GaneshaNASHelper class as follows:
* Looks for an existing export and edits its client access list;
  creates a new export if it can't find one; and removes an export if
  the access list ends up empty. Rather than awkwardly create or
  remove an export per addition or removal of an access rule.
* Issues DBUS UpdateAccess command to dynamically update an export.

Implements: bp ganesha-dynamic-update-export

Co-Authored-By: Csaba Henk <chenk@redhat.com>

Change-Id: I01ec100c0afe28a84e9afa8e0660d299e4b3d160
2017-06-05 22:36:15 +05:30
yfzhao 059fae0ed5 Remove log translations in share and share_group 4/5
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.
This is the 4/5 commit.
Old commit will be abandoned: https://review.openstack.org/#/c/447822/

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: Ia46e9dc4953c788274f5c9b763b2fed96c28d60e
Depends-On: I9fd264a443c634465b8548067f86ac14c1a51faa
Partial-Bug: #1674542
2017-03-31 10:20:11 +08:00
Csaba Henk bde7105a5b ganesha: implement update_access
As with Ganesha there is no direct way to
bulk process a set of rules, in update_access()
we just call down to the old allow/deny methods
iteratively.

However, they got underscore prefixed:
{allow,deny}_access -> _{allow,deny}_access

The update_access method has the

  update_access(base_path, share, add_rules, delete_rules, recovery_mode)

interface. Drivers using a ganesha.NASHelperBase derived
helpers and implementing the

  update_access(..., access_rules, add_rules, delete_rules, ...)

interface should decide about recovery mode by access_rules
content and pass down either access_rules or add_rules
to the helper's update_rules as add_rules (respectively in recovery
and normal mode, and also setting the recovery_mode flag
appropriately). The driver is also responsible for checking
the validity of the rules, for which we add support
by the NASHelperBase

  supported_access_types
  supported_access_levels

attributes and the utils._get_valid_access_rules utility
method.

Co-Authored-By: Ramana Raja <rraja@redhat.com>
Implements bp ganesha-update-access

Change-Id: Iea3a3ce3db44df792b5cf516979ff79c61d5b182
2016-06-13 19:29:10 +02:00
Surya Ghatty 6a0bd8c5ad Remove unintended exposure of private attribute
GaneshaNASHelper has a class attribute confrx that is
currently coded up as a public variable. This was unintended.

Made the following changes to fix this:
1. The variable name was updated from confrx to _confrx
per pep8 guidelines for defining non-public variables and instances.
2. All references to this variable have been updated.

Depends-On: Id7d43dee256856062bd0dadad9c469c1500ee36e
Change-Id: Ie4fe96cd9cf9f0ea281c94f5c1378b255f60bada
Co-Authored-By: Andrea Ma <ayma@us.ibm.com>
Co-Authored-By: Andrei Ta <ata@us.ibm.com>
Co-Authored-By: Michael Rowden <mrrowden@us.ibm.com>
Closes-Bug: #1551497
2016-03-03 12:21:45 +00:00
Julia Varlamova c8f0a75398 Wrap iterators and 'dict_items' for py34 compatibitity
Change iterators and 'dict_items' objects to list with additional 'list()' method
to avoid versions incompatibility

Partially-Implements: bp py3-compatibility

Change-Id: Ic6b437cd0d57ca3d4b343b590d11c4e53492d223
2015-08-06 12:06:47 +03:00
Valeriy Ponomaryov 63a0504c21 Use oslo_log lib
Module 'log' from oslo-incubator was removed after release of oslo_log library.
So, start using oslo_log, but keep oslo-incubator code yet other common modules
within Manila codebase use it.

Implements bp use-oslo-log-lib

Change-Id: I88224f7c2bd99adb78140dfc3fa73cea437f29cd
2015-02-08 10:42:40 +00:00
Thomas Bechtold 071d0b59c1 Switch to using oslo_* instead of oslo.*
The oslo team is recommending everyone to switch to the
non-namespaced versions of libraries. Updating the hacking
rule to include a check to prevent oslo.* import from
creeping back in.
oslo.messaging is the only exception because this package doesn't
currently support non-namespaced imports.

Change-Id: I3987e651bc880c8ffa7c0105df0298679dcd3a43
2015-01-27 09:19:50 +01:00
Csaba Henk 559b478e85 ganesha: NFS-Ganesha instrumentation
Introduce the ganesha share driver helper module
which provides the GaneshaNASHelper class from which
share drivers can derive NFS-Ganesha backed protocol
helpers.

Some utility functions are also added to ease
integration.

Partially implements blueprint gateway-mediated-with-ganesha

Change-Id: I8683ea5eb43d7a8eaf0dfa6af3791782d32b944a
2014-12-18 15:49:33 +01:00