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
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 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
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
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
Replace assertEqual(None, *) with assertIsNone in tests to have
more clear messages in case of failure.
Closes-Bug: #1280522
Change-Id: I2d5285add72678b5a61b4f66879c4d066afc34c7
The Manila test module uses a class called StubOutForTesting, which
is an awkward holdover from when the unit tests were using Mox.
Alex wrote a more elegant and capable mocker method,
manila.test.TestCase.mock_object, in the Cinder project which we
have now added to Manila. So to remove the duplicate functionality
and legacy code, all references to self.stubs.Set() in the Manila
tests should be replaced with self.mock_object() and any related
dead code should be removed.
Resolves-bug: #1415602
Change-Id: Ie5f203c0b2cb57ad00d9ec8db0529075b6fef261
There are amounts of copy-pasted code for fake separated
in different files, they should be put in one place.
This patch moves the following into module fake_share:
* fake_share
* fake_snapshot
* fake_access
Partial-Bug: #1416285
Change-Id: I78e7fc56c80ee19a8c01c5f37b428f019aa47e58
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