Commit Graph

23 Commits

Author SHA1 Message Date
Takashi Kajinami b488f42332 Bump hacking
hacking 3.1.x is too old.

Change-Id: Ic5131276ac1d1a1a959d0a5b16398ae12fae0c18
2024-01-27 23:57:00 +09:00
Goutham Pacha Ravi 609b925a51 Don't fail remove-export in NFS-Ganesha
When dropping an export over DBUS, if there's a problem
with the removal, we can ignore the failure and move on.
If not, the share ends up in an "error_deleting" state.

There's not much that we can do here besides logging
the failure as an exception.

Change-Id: I73c2706c9d889f8d08057a543b2a963740bb3f33
Closes-Bug: #2035572
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2023-10-21 09:56:42 +00:00
Victoria Martinez de la Cruz f32be69fc4 Refactor the Ceph NFS driver to use Cephadm NFS
CephAdmNFSProtocol helper has been added to allow users to consume NFS clusters
deployed using cephadm. This presents many advantages, since the operator
no longer needs to maintain their own instances of NFS Ganesha apart of the
Ceph cluster. For this, we now communicate with ceph mgr using
the nfs plugin. Read more about this plugin in
https://docs.ceph.com/en/latest/cephfs/nfs/

Implements: bp/use-cephadm-nfs-ganesha

DocImpact

Change-Id: I1826f2970528928a31b32a664013380e38bbd7c9
2022-09-07 15:44:45 +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
Douglas Viroel 9fbde73868 Fix pep8 issues
Fixing pep8 issues for flake8 release 3.8.0:
 - E741 (ambiguous variable name)
 - E225 (missing whitespace around operator)

Change-Id: I23c8a07d6ab8745bd3d32922b24920bde2f9eeb8
2020-05-12 11:20:20 -03:00
Andreas Jaeger 3be50ced7a Hacking: Fix E741
E741 ambiguous variable name 'l'

Also fix other problems found by hacking in files touched.

Change-Id: I8171994716092ae7f12018861e95ed52fee57b18
2020-04-01 13:27:33 +02:00
Tom Barron f6613f9553 Fix pylint errors for ganesha manager
Closes-bug: #1813800
Change-Id: Id9858f9e016cef2d82d19df24947ae07eba916da
2019-01-29 17:07:55 +00:00
Tom Barron 1f160196e4 Fix bare exceptions in ganesha manager
Closes-Bug: #1779922
Change-Id: Ife18c61c4d195a73980a03287700df7ba9b52b9c
2018-07-03 19:44:30 +00:00
Ramana Raja 15727cd157 ganesha: read and store non-ASCII data in exports
For py27, allow reading and storing non-ASCII data in exports
stored as Ceph RADOS objects (This is possible with py3).
Do this by decoding binary data and encoding text data with 'utf-8'
when reading and writing RADOS export objects.

TrivialFix

Change-Id: Idcf8b1c1ed1a65e2cce19726997694d993879c14
2018-01-02 18:06:54 +05:30
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
Pengju Jiao 728632866a ganesha: cleanup of tmp config files
Currently in ganesha driver, while writing ganesha
config files some times the tmp config files are not
cleaned up. It is because moving the config file from
tmp location to the correct ganesha config location
sometimes goes wrong.

This patch adds operation of cleaning up the tmp config
files.

Change-Id: Id93a5062c48e99afc26594f05cbf29cffce1499e
Closes-Bug: #1717135
2017-09-18 21:28:38 +08:00
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
daiki kato ffcef13cf9 Fix typos
This patch fixes several typos.

TrivialFix

Change-Id: Icd2ab913106107f2ed34408db9ef7fb1a255b076
2016-03-17 14:05:55 +09:00
ting.wang 2bc625399f Using dict.items() is better than six.iteritems(dict)
Replacing dict.iteritems()/.itervalues() with
six.iteritems(dict)/six.itervalues(dict) was preferred in the past,
but there was a discussion suggesting to avoid six for this[1].
The overhead of creating a temporary list on Python 2 is negligible.

[1]http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html
Partially-implements blueprint py3-compatibility

Change-Id: Ia2298733188b3d964d43a547504ede2ebeaba9bd
2016-01-19 22:22:48 +08:00
Valeriy Ponomaryov ed6ed47202 Fix string/binary conversions for py34 compatibility
Default type of strings in py 2 and 3 are different. So, convert them
explicitly when it is needed for py 2/3 compatibility.

Partially-Implements: bp py3-compatibility
Change-Id: I9b2d7e97fdc7d073a16e729ce0e90b92281fdf8d
2015-08-07 15:33:36 +03:00
Ramana Raja a0097bfe15 ganesha: fix execute call using invalid argument
An execute call in the ganesha manager module that writes ganesha
export config files is made with 'process_input' argument. This
argument is invalid for processutils's ssh_execute() method which is
used by the execute call to write config files to a remote ganesha
server node. Fix this by not using the 'process_input' argument instead
use other arguments that would still enable the execute call to write
ganesha config files.

Change-Id: I58369468ac7be1de38364a1c1bf6cbf8695b9a1d
Closes-Bug: #1422235
2015-02-16 10:21:52 +05:30
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
Ramana Raja 80698a4420 ganesha: fix resetting of exports
When resetting exports, i.e., remove files present in the ganesha
export directory, during manager service initalization, ignore if the
directory is already empty. This allows ganesha manage service to
initialize even if the ganesha export directory is empty.

Change-Id: Iabe3f36d4f05b0fc451695b261a538b2e87be7a5
Closes-Bug: #1416958
2015-02-02 11:38:10 +05:30
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