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>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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