GlusterManager and a few standalone
management routines have been moved
to the newly created glusterfs/common.py;
both glusterfs and glusterfs_native drivers
import these from there. The obnoxious
import of glusterfs to glusterfs_native
has been eliminated.
Partially implements bp modular-glusterfs-share-layouts
Change-Id: I6a94f1056bd45187c0268d75fa854b127b2b562d
On last midcycle meetup was decided to make snapshots optional feature.
Features:
- Add new boolean capability 'snapshot_support' to base share driver
so every existing share driver will inherit it. Make value of it be
calculated from the fact of redefinition of three main driver
methods for snapshots 'create_snapshot', 'delete_snapshot' and
'create_share_from_snapshot'.
- Set extra spec 'snapshot_support' with share type creation by default
to 'True'
- Restrict deletion of extra spec 'snapshot_support' that is expected
to exist
- Allow to redefine new extra spec 'snapshot_support'
- Restrict API 'snapshot create' for share created with
share type that has extra spec 'snapshot_support' equal to 'False'.
- Add migration where new extra spec 'snapshot_support' is added
to all share types that do not have it yet.
Partially implements bp snapshots-optional
Change-Id: I069d9e911c7d7a708fa518b38ed10572a45e5f42
We need the so-called management address of a GlusterFS
volume (ssh address of its management node) at a few places
for bookkeping reasons (certain data like GlusterFS version
is stored in management address-keyed dicts).
So far it was available only through ad-hoc mangling of
various attributes of a GlusterManager instance that
represents the volume. Now we make it available
directly from GlusterManager as an attribute.
Also fix an occurrence of ad-hoc mangling going wrong,
ie. where a wrongly constructed address is attempted
to be used as dict key.
Change-Id: Ic5a96bc99943dda3592372512916257d53f61b80
Closes-Bug: #1476710
Edit doc and comments to mention that the driver
- can work with NFS-Ganesha, used by the GlusterFS backend to serve
NFS shares.
- does not provide read-only access level for shares.
And add some minor cosmetic fixes to the doc.
Change-Id: Ib0e53befbd48e5cbfea98a52876f381384beb268
- Remove passing DB reference to drivers in __init__() method
- Remove db reference from Generic driver and service_instance
- Remove db reference from Netapp share driver
- Remove db reference from Glusterfs share driver
- Remove db reference from Glusterfs_Native share driver
- Remove db reference from Quobyte share driver
- Remove db reference from IBM GPFS driver
- Remove db reference from HDS_SOP driver
- Remove db reference from HDFSNative driver
- Remove db reference from fake driver
- Remove db reference from unit tests.
Change-Id: I74a636a8897caa6fc4af833c1568471fe1cb0987
- add gluster_version method to GlusterManager class
- gluster: check if version of the GlusterFS server is at least 3.5
- gluster_native: check if version of the GlusterFS server is at least 3.6
- gluster_native: on snaphot creation failure, interpret errno only
for GlusterFS strictly later than 3.6
Change-Id: I242ea83c3a31670eb6a13c11e39d0c2228170c50
Closes-Bug: #1417352
So far glusterfs_native was able to create shares
from volumes listed in 'glusterfs_targets' config
option.
New behavior: a regexp pattern is to be provided
through the glusterfs_volume_pattern config option.
Upon share creation, grep gluster server's volumes
with this pattern and create the new share from
one among those.
Change-Id: I12ba0dbad0b1174c57e94acd5e7f6653f5bfaae8
Closes-Bug: #1437176
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
Unify identical messages by adding '.' or remove/adding
spaces if the content of the message is identical to reduce
translation effort.
Change-Id: Ie611b75fd8891a583fab9e0971a80f329a6793ac
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
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
- Refactor the main driver class, GlusterFSShareDriver, to make it
pluggable with different NAS helpers.
- Add GlusterNFS helper class to manage shares served by Gluster-NFS
server. The management of these share was earlier done within the
main driver class.
- Enhance the methods of the GlusterAddress class that would be used
by the main driver class and the helper classes. Rename the
GlusterAddress class to GlusterManager class. This class would
contain the methods to interface with the backend GlusterFS volumes.
- Retire GlusterAddress.make_gluster_args() in favor of
GlusterManager.make_gluster_call(). The make_gluster_call() method
implements a more correct approach to remote execution. It's
remote execution is based on processutils.ssh_execute. The
make_gluster_args() method that it replaces facilitated remote
execution by prefixing arguments with 'ssh'.
- Move the interface used to fetch the value of an option set on a
GlusterFS volume, from the main driver class to the GlusterManager
class.
Partially implements blueprint gateway-mediated-with-ganesha
Change-Id: I3cbeb49c26f5f24152b42b649ce3bc75451964ef
Due to unclear meanings of existing names for share drivers modes it was
decided to replace string driver modes with boolean value, since we have only
two possible values that will clearly say what it used for by name of opt.
This replacement includes following changes:
- String opt 'share_driver_mode' is replaced with
bool opt 'driver_handles_share_servers'. New bool opt does not have
default value and should be defined explicitly.
- Class ShareDriver (parent class for share drivers) now expects additional
argument 'driver_handles_share_servers' which is mandatory and should be
provided by child classes. Expected values are boolean or tuple/list/set of
booleans that says what modes are supported. Above new config opt will be
compared to these.
- Update interfaces 'setup_server' and 'teardown_server' of class ShareDriver.
These interfaces now consider driver modes and call new additional private
methods only when driver is enabled to mode with share servers handling.
These new private methods are '_setup_server' and '_teardown_server', they
should be redefined by child classes when share servers should be handled by
Manila.
- To get know current driver mode within child classes just call property
'driver_handles_share_servers'. It can not be changed by child classes and
returns value that is set by config opt with same name.
- Remove methods 'setup_server' and 'teardown_server' from all share drivers,
that do not support handling of share servers.
- Rename methods 'setup_server' and 'teardown_server' to appropriate
private methods for drivers that do support handling of share servers.
- Update unit tests related to all changed places.
- Make Devstack set new mandatory bool opt.
Implements bp rename-driver-modes
Change-Id: I33402959bc4bbc34cfd4d7308ad0a7bcff3669b5
Driver mode functionality was implemented to be able to specify how
driver should work and filter backends scheduling share creation based on this.
Add to all drivers update of attr 'mode' based on its current behavior.
Set 'share_driver_mode' extra spec to volume/share type with one of available
values. Scheduler will use it for host filtering.
Implements blueprint driver-modes-for-scheduler
Change-Id: Ida644f630ee07c51c02aea5d6280980b5d704c2f
Several things are implemented:
- Allocation/deallocation now handled by drivers instead of share manager.
It provides flexibility for drivers.
- Network plugin interface was updated to support new approach for
configuration options setting.
Config opts for network plugin can be defined via three sources:
a) using separate config group
b) using config group of back end
c) using DEFAULT config group
Variants (a) and (b) are mutually exclusive, there are switched by
opt 'network_config_group' that belongs to share driver interface.
Implements bp network-helper
Change-Id: I3b05369f01777675c1b834af5ee076d8b7219a0f
Currently, glusterfs driver creates shares, subdirectories within
GlusterFS volume, ignoring the share size argument. Use GlusterFS's
ability to set hard-limit quota on subdirectories (shares) to enable
creation of shares of specific size.
Change-Id: I28b4787e0ada4f6505d929f8d417218a0dc4d0b4
Closes-Bug: #1401000
LOG.warn etc. should be translated separately and thus messages need to
be marked with _LW for LOG.warn, _LI for LOG.info and _LE for LOG.errors
and LOG.exception.
Mark all LOG invocations with proper translation marker.
Use ',' instead of '%' when adding variables to log messages to allow
lazy evaluation.
Add new hacking checks for these.
Change-Id: I31d3ee50f30c63d7d647b1c2b1eae50bf96f0c74
oslo.i18n provides the i18n function that were provided by
oslo-incubator's gettextutils module
Import _ where needed, oslo.i18n deprecated the builtin method.
Closes-Bug: #1382187
Change-Id: I12aa1c725aa4bb52a9aa46e9c3d2b303839de48b
glusterfs driver has an option to specify the GlusterFS volume to be
mounted on the Manila host. The GlusterFS volume to be mounted is
presently specified in a file, whose path is the config option
glusterfs_volumes_config. Instead have a string valued config option
in manila.conf that directly takes the same input.
Change-Id: I3f8734174db71ef232620c55d4ecdd2b5d0192ad
Closes-Bug: #1365941
This patch adds basic support for glusterfs native protocol driver
that uses cert based access type.
A Manila share is a GlusterFS volume. Unlike the generic driver, this
does not use service VM approach. Instances directly talk with the
GlusterFS backend storage pool. Instance use the 'glusterfs' protocol
to mount the GlusterFS share. Access to the share is allowed via
SSL Certificates. Only the share which has the SSL trust established
with the GlusterFS backend can mount and hence use the share.
Establishing the SSL trust between the instance and backend is done
out of band of Manila.
Partially-implements blueprint cert-based-access-type
Change-Id: I229d481086478317f1c43635304a16794372f09d
LOG.xxx("Hello %s" % xyz) should be LOG.xxx("Hello %s", xyz).
This allows the logging package to skip creating the
formatted log message if the message is not going to be emitted because
of the current log level.
The change touches error, warning and info LOG messages.
Adjust test suite for the above change since LOG now uses two parameters
instead of one.
Fix grammar, add missing "." to log messages in some places.
Change-Id: I86404c34502f07ed6dbda1c82b13db888c60f074
Make help strings consistent:
* Add missing spaces between words
* Capitalize first word of help
* Add "." at end of string
* Improve wording and capitalization
This follows the oslo.config style guide:
http://docs.openstack.org/developer/oslo.config/styleguide.html
Change-Id: I8243909249423b6b58ccda0d800856f46b0953c5
Fix H302 and enable the test:
H302 import only modules.'from X import Y' does not import a module
Fix also in the touched files the following:
E128 continuation line under-indented for visual indent
Change-Id: I3116c030a5dc0b5be2b4413beaa460e483215774
Partial-Bug: #1333290
Fix these issues and enable E126 and E127:
E126 continuation line over-indented for hanging indent
E127 continuation line over-indented for visual indent
Also fix a few occurences in the touched files of:
E128 continuation line under-indented for visual indent
H405 multi line docstring summary not separated with an empty line
Partial-Bug: #1333290
Change-Id: If822401fc7e1db49d595a0736a0dff8e00dfd217
Fix these issues:
./manila/tests/windows/windowsutils.py:29:1: F821 undefined name 'cfg'
./manila/share/drivers/glusterfs.py:165:1: F821 undefined name 'config'
glusterfs.py: It should be config_file, adjust the message as well.
windowsutils.py: Add import for cfg.
Closes-Bug: #1351959
Change-Id: I9fa5087d2be6ecc262f9581d372f70f96373a387
- Modify interface methods to comply with changes to the share manager.
The changes were in the following commit,
4c8a658d95
Change-Id: I6fde3e6d351f18878dc55fb3535f1dd0b811c352
- allow share or sub-directory access to more than one guest/ip address
by modifying the GlusterFS volume configuration options that change
the Gluster-NFS server settings.
`nfs.export-dir` option does not interpret a spec of
'/dir(host1),/dir(host2)'as we expected, ie. two independent access
specifiers -- instead, it just discards the latter. The required
format looks as follows: '/dir(host1|host2)'. Update the export-dir
generating routines accordingly.
- properly remove the last share or sub-directory access setting in a
GlusterFS volume when needed by an API request to changes access
rules of shares.
`volume set` option in GlusterFS volume settings cannot take empty
value, use instead `volume reset` to go back to defaults
- GlusterFS volume contains all the shares. It has a default setting
that allows NFS access to its entire contents. So turn off this
setting as a part of the initial driver setup.
turn off `nfs.export-volumes` setting.
Change-Id: I652a13d4d34d1b4c5ee3d31af40143a098c38074
setup_network,get_network_allocations methods
are not called by manager in singletenant drivers.
So we do not need to define them.
Partially-implements bp setup-teardown-server-enhancements
Change-Id: I17d1f26dfc1e322738991f65aac8beb216e47a98
Added class GlusterfsShareDriver,
derived from manila.share.driver.ShareDriver,
implementing create and delete share capabilities
and access control.
Change-Id: I909ad28d316d071dd1a4790843eae25ade4a9c95