Commit Graph

40 Commits

Author SHA1 Message Date
ashrod98 47e7c78f37 Conditional Import for FIPS Compliance
Conditionally Import Parakimo
Separate SSH functions into ssh_utils.py for safe conditional import.

Change-Id: Ia1a3ee69bef76b52e4e6df1e73488c018ac0f3c9
2024-02-06 20:30:39 +00:00
Manish Honap 6431b86f19 Add config option reserved_share_extend_percentage
'reserved_share_extend_percentage' backend config option allows Manila
to consider different reservation percentage for share extend
operation. With this option, under existing limit of
'reserved_share_percentage', we do not want user to create new share if
limit is hit, but allow user to extend existing share.

DocImpact

Closes-Bug: #1961087
Change-Id: I000a7f530569ff80495b1df62a91981dc5865023
2022-06-14 23:08:31 +05:30
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
kpdev 6ca10003a9 Add config option reserved_share_from_snapshot_percentage.
This config option allows different value for reservation percentage,
mostly useful on the platforms, where shares can only be created from
the snapshot on the host where snapshot was taken. The lower value of
this config option against existing (reserved_share_percentage) allows
to create shares from the snapshot on the same host up to a higher
threshold even though non-snapshot/regular share create fails.
In case this config option is not set, the shares created from snapshot
will use reservation percentage value set in 'reserved_share_percentage'.
This will be useful for users who want to keep same reservation percentage
for both non-snapshot/regular and snapshot shares.

DocImpact

Closes-Bug: #1938060
Change-Id: I390da933fe92875e3c7ee40709eacacc030278dc
2021-08-27 19:10:36 +02:00
Tom Barron 5af3b8e68b Remove deprecated config and auth
Remove manila configuration options
and auth classes that were deprecated
before the Ussuri release.

Change-Id: I148225926cd249a0dd8d1f8c02b22ed06487f405
2021-04-26 11:53:58 -04:00
Douglas Viroel 6c47b193b0 Create share from snapshot in another pool or backend
This patch enables the creation of a share from snapshot
specifying another pool or backend. In the scheduler, a
new filter and weigher were implemented in order to consider
this operation if the backend supports it. Also, a new
field called 'progress' was added in the share and share
instance. The 'progress' field indicates the status
of the operation create share from snapshot (in percentage).
Finally, a new periodic task was added in order to constantly
check the share status.

Partially-implements: bp create-share-from-snapshot-in-another-pool-or-backend

DOCImpact
Change-Id: Iab13a0961eb4a387a502246e5d4b79bc9046e04b
Co-authored-by: carloss <ces.eduardo98@gmail.com>
Co-authored-by: dviroel <viroel@gmail.com>
2020-04-09 11:15:22 -03: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
Goutham Pacha Ravi 3e855d5f60 [pylint] Fix/ignore pylint errors in non-test modules
Pylint does not play very well with dynamic object
manipulation in python This creates a lot of
false-positives in the code-base which affects
contributors looking for genuine failures.

So, this change
- adds pylint ignore statements where appropriate
  to disable testing these lines of code and failing.
- replaces all the pylint error codes (they are
  hard to remember/relate to) with error names
  which are easier to understand when reading the
  code.
- initializes sqlalchemy model objects as dictionaries
  which is a valid representation over None.
- removes ignore directives on six.moves which
  is globally ignored in our pylintrc.
- adds alembic.op to the ignored
  modules list since they are not supported by
  pylint and have known issues.

This patch is the beginning of a series of
commits to use pylint in a sane way on manila code.

Change-Id: I44616821c5311d6f14986697efbbe5624de364a5
2019-02-25 17:23:15 +00:00
junboli fb17422c86 Enable some off-by-default checks
Some of the available checks are disabled by default, like:
[H106] Don't put vim configuration in source files
[H203] Use assertIs(Not)None to check for None
[H904] Use ',' instead of '%', String interpolation should be
       delayed to be handled by the logging code, rather than
       being done at the point of the logging call.

Change-Id: Ie985fcf78997a86d41e40eacbb4a5ace8592a348
2017-08-03 16:13:32 +08:00
digvijay2016 32a5a088a9 GPFS: Changing default value of NFS server type
Spectrum Scale provide NFS service with Ganesha server
by default (protocol node). So altering the default value
of NFS server for easiness.

Implements: blueprint gpfs-nfs-server-type-default-value-change

Change-Id: I2e3adeca58505c2da4a5675f7342bb2a174078cc
2017-06-08 12:36:51 +05:30
digvijay2016 e90dd3d711 GPFS Path: Fix bugs related to initialization of GPFS Driver
Due to lack of GPFS path ('/usr/lpp/mmfs/bin/') export, driver
is not able to find the GPFS commands causing the initialization
failure.
With this patch, GPFS will be able to run all GPFS commands
irrespective of GPFS path export.

Change-Id: I1aa8baf884dfaa42c37e575f0b6e1317f18543a1
Closes-bug: #1690785
2017-05-23 12:39:42 +05:30
Jenkins d9f2f59539 Merge "Remove log translations in share and share_group 4/5" 2017-04-07 15:52:27 +00:00
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
luqitao 86a1bc189c Use HostAddressOpt for opts that accept IP and hostnames
Some configuration options were accepting both IP addresses
and hostnames. Since there was no specific OSLO opt type to
support this, we were using ``StrOpt``. The change [1] that
added support for ``HostAddressOpt`` type was merged in Ocata
and became available for use with oslo version 3.22.

This patch changes the opt type of configuration options to use
this more relevant opt type - HostAddressOpt.

[1] I77bdb64b7e6e56ce761d76696bc4448a9bd325eb

TrivialFix

Change-Id: I44ba478ff14a6184434dd030efd9b7fa92458c7a
2017-03-21 08:14:01 -04:00
Mark Sturdevant cbda16bc57 GPFS: Add update_access()
Add update_access() implementation to replace the deprecated
allow_access() and deny_access().

Change-Id: I206f1284bddc02452087e24061619ca3c04395a4
Implements: blueprint gpfs-update-access
2016-12-30 13:16:07 -08:00
digvijay2016 fb4b0b86e9 Add support for manage/unmanage in GPFS driver
Added support for manage/unmanage in GPFS NFS driver.
This patch added functions that allow share on Spectrum Scale
node to be managed by OpenStack if existing fileset is an
independent fileset and doesn't have any NFS export
over the fileset path. Also, share can be unmanaged from
OpenStack but still left in Spectrum Scale cluster.

Implements: blueprint gpfs-manage-support

Change-Id: I9134408b59c30ac4bc593f287294741f6e996136
2016-12-28 15:06:42 +05:30
Mark Sturdevant 9157b8afb2 GPFS KNFS: Fix deny access to succeed when possible
Use looser error code checking and add a verify
after deny access so that the call will succeed
whenever it can be confirmed that the access no
longer exists.

This fixes a variety of situations where previously
a return code of 1 while attempting to remove access
would cause the manila access rule to get stuck while
the actual client access export was removed or never
existed.

Change-Id: Ie058a6185e3f5d91fb1cf232301eb0ac6ddcea7e
Closes-Bug: #1651587
2016-12-23 01:17:20 +00:00
Mark Sturdevant b76a2af237 GPFS KNFS: Do not reuse ssh prefix in loop
Fix GPFS KNFS allow/deny access so that it does not reuse
the ssh prefix when looping through NFS server commands for
allow and deny access.

This fixes GPFS KNFS allow/deny access incorrect behavior
when multiple NFS servers are configured (gpfs_nfs_server_list)
and any of the servers are remote (except the last one).

Change-Id: I8c182eed386e8325b087c3192d363502bb848633
Closes-Bug: #1651578
2016-12-21 15:33:48 -08:00
Mark Sturdevant 5e7323cd1f GPFS CES: Fix bugs related to access rules not found
Several bugs are caused by an error code and
exception raised when a path has no NFS exports.
Use the machine-readable mmnfs export list command
(the -Y option) which does not cause an exception
when checking for exports.

Co-Authored-By: digvijay2016 <digvijay.ukirde@in.ibm.com>

Change-Id: I770756e0a36c5b61386878164b651fadf9730b7f
Closes-Bug: #1650043
Closes-Bug: #1650044
Closes-Bug: #1650045
2016-12-16 11:23:04 -08:00
Gaurang Tapase a91fa6e154 Refactor GPFS driver for NFS ganesha support
Spectrum Scale supports NFS ganesha through CES protocol services. This
change replaces the current NFS ganesha support with the Spectrum Scale
CES infrastructure.

Implements: blueprint gpfs-ces-support

Change-Id: I8eb307c19761788ea71c15c889794f8b5f110253
2016-08-10 04:47:20 -04:00
Tom Barron 467321bceb Do not supply logging arguments as tuple.
Logging format arguments are not supposed to be tuples, but
are rather to be supplied separately - i.e., use
   LOG.debug('%s is %s', arg1, arg2)
instead of
   LOG.debug('%s is %s', (arg1, arg2))

Rid the manila codebase of this logging format error and
add a hacking check for this.  The hacking check will not
catch all corner cases but should help prevent this error
in most cases.

Change-Id: Ibea39f1f90c0444eae5cfcd6090b2a00d84ab923
Closes-Bug: #1585394
2016-06-09 17:22:36 -04:00
ZhiQiang Fan 2a148d3d31 Use oslo_config new type PortOpt for port options
The oslo_config library provides new type PortOpt to validate the
range of port now.

Change-Id: I8d1746c399268d7b3388db82de77c5e6c06844a3
ref: https://github.com/openstack/oslo.config/blob/2.6.0/oslo_config/cfg.py#L1114
2015-11-12 00:32:35 -07:00
Shuquan Huang 8247f350af remove default=None for config options
In the cfg module default=None is set as the default value.

Change-Id: I9303e2ae4b8f301757744efc09136868db29472a
Closes-bug: #1323975
2015-11-08 20:12:25 +08:00
Gaurang Tapase 838eae240d Add IBM GPFS Manila driver
Adding GPFS driver back as the third party CI system
for GPFS driver is up and running.

This is a revert of commit 720ec90445

Change-Id: I86f9b7da21716346f96bae3ce30446589e4c4c37
2015-10-18 08:31:59 -04:00
Ben Swartzlander 720ec90445 Remove IBM GPFS driver due to lack of CI
The Manila community set a deadline of 3 Sep 2015 for all drivers
to have reporting CI systems, and there is no CI system for the
IBM GPFS driver. As agreed, the driver will be removed until such
time that a CI system exists.

Change-Id: I76f238a1a6eb039e4ddc1cb189115ab3e686c56b
2015-09-15 16:36:08 -04:00
Sergey Vilgelm 087fa055b5 Fix missing value types for log message
This patch add missing value types for some log message of exception.

Change-Id: I661d597f5b87923078cdf1556d72b28e7fa18b5f
Closes-Bug: #1494574
2015-09-14 10:49:40 +03:00
Gaurang Tapase 6aae96c527 Adding extend share support in IBM GPFS Driver
This change helps extend the size of the share by
changing the quota on GPFS fileset created for
that share.

Change-Id: I8076200b1350feadbb782ccd330e477c6edd52aa
Closes-Bug: #1481180
2015-08-12 03:28:24 -04:00
Igor Malinovskiy 94e8c921db Remove passing DB reference to drivers in Share Manager
- 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
2015-04-21 17:23:13 +03:00
Ramana Raja a992aa0013 Fix log/error message formatting
- Use '%' for variable substitution in the message used for logging a
  call and throwing an exception.

- Use log marker functions(_LI(), _LW(), _LE(), and _LC()) to send
  message directly to the log.

- Use ',' for variable subsitution in the message in a log marker
  function.

Change-Id: Ib925014e79d2c380954d952f5dbc835971a0b320
Closes-Bug: #1439762
2015-04-08 10:24:37 +05:30
Nilesh Bhosale 5ccfe81eea IBM GPFS Manila Driver Docs
Adding documentation for the IBM GPFS Manila driver.

Implements: blueprint gpfs-driver

Change-Id: Idc098ca1005c59e80df212285e5bfb523e36376b
2015-03-23 22:35:09 +05:30
Nilesh Bhosale fe51a03874 Improve error handling in GPFS driver
Improving the error handling and error messages as follows:
- Check for exit status for the commands executed over SSH
- Following Log Translation guidelines

Change-Id: Ide6a37d9c00062ce4b025063da97f2e236c4f986
Closes-Bug: #1420739
2015-03-05 11:02:58 +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
chen-li 7b050b8932 Remove startswith for share_proto check
We have explicit definition for supported share protocols.
Using "startswith" to search for substring is not a right way.

Change-Id: I8f482aea74249efca3bd490d971cf3e944919bb8
2015-01-30 08:27:44 +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
Valeriy Ponomaryov b719d0ffa6 Replace string driver modes with boolean value
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
2015-01-22 10:47:40 +00:00
Ponomaryov Valeriy a9c25274ab Add driver mode attr definition for all drivers
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
2015-01-05 18:40:30 +00:00
Ponomaryov Valeriy 8695d471f5 Rename share driver stats update method
Method 'get_share_stats' of share drivers uses private method called
'_update_share_status'. But it should use 'stats' instead of 'status'.
Some drivers have redefined it. So, rename it for base driver class and
remove duplicated redefinitions of 'get_share_stats' in share drivers.

Change-Id: Ib9a1184256380268376b1da426526f8394c2308a
2014-12-28 20:46:12 +02: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
Valeriy Ponomaryov 36db3f3917 Move networking from share manager to driver interface
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
2014-12-16 17:32:24 +02:00
Nilesh Bhosale f45df7f02b Adding GPFS Manila driver
Supporing GPFS exports over kernel NFS and Ganesha NFS
Supporting following Manila functionality:
1. Create, List, Delete Shares
2. Create, List, Delete Share Snapshots
3. Create Share from a Share Snapshot
4. Allow, Deny access to a share based on IP

Supports, local and remote GPFS nodes to the Manila service node,
in a GPFS cluster

Limitation:
1. While using remote GPFS node, with Ganesha NFS, 'gpfs_private_key'
for remote login to the GPFS node must be specified and there must be
a passwordless authentication already setup between the Manila and the
remote GPFS node.

DocImpact

Implements: blueprint gpfs-driver
Change-Id: I6664054ba52d03814cea846cb0d79cd853632814
2014-11-10 20:32:03 +05:30