Commit Graph

24 Commits

Author SHA1 Message Date
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
Zuul 45f98a7d0a Merge "Replace retrying with tenacity" 2021-09-03 17:07:51 +00:00
ashrod98 903aab1920 Replace retrying with tenacity
We are replacing all usages of the 'retrying' package with
'tenacity' as the author of retrying is not actively maintaining
the project. Tenacity is a fork of retrying, but has improved the
interface and extensibility (see [1] for more details). Our end
goal here is removing the retrying package from our requirements.

Tenacity provides the same functionality as retrying, but has the
following major differences to account for:
- Tenacity uses seconds rather than ms as retrying did
  (the retry interface in manila exposed time in seconds as well)
- Tenacity has different kwargs for the decorator and
Retrying class itself.
- Tenacity has a different approach for retrying args by
using classes for its stop/wait/retry kwargs.
- By default tenacity raises a RetryError if a retried callable
times out; retrying raises the last exception from the callable.
Tenacity provides backwards compatibility here by offering
the 'reraise' kwarg - we are going to set this in the retry interface
by default.
- For retries that check a result, tenacity will raise if the
retried function raises, whereas retrying retried on all
exceptions - we haven't exposed this in the retry interface.

This patch updates all usages of retrying with tenacity.
Unit tests are added where applicable.

[1] https://github.com/jd/tenacity

Co-Authored-By: boden <bodenvmw@gmail.com>
Co-Authored-By: Goutham Pacha Ravi <gouthampravi@gmail.com>
Closes-Bug: #1635393
Change-Id: Ia0c3fa5cd82356a33becbf57444f3db5ffbb0dd0
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2021-09-01 18:31:38 -07: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
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
zhufl e8adec1b96 Fix parameters passed to exception
Do not pass reason parameter to ShareNotFound/ManilaException/
InvalidParameterValue/ShareGroupTypeNotFound/InvalidVolume, for
reason is not in the message format.

Change-Id: I4af25be0d5095c704b40fafbde3fafa298103596
2019-03-19 17:40:40 +08:00
zhufl ae721a518c Add missing ws seperator between words
This is to add missing ws seperator between words in log message.

Change-Id: I0980fbb2c0eb4e76aa752a4fed97cc5c4463b123
2019-03-13 14:16:44 +08:00
Chris Yang ad62e9dde3 QNAP: Fix inconsistent cases while create/manage from snapshot
There are two situation may cause the size of share/snapshot
managed by manila is inconsistent with the NAS backend.
One is to create a share from snapshot. While the other one
is to manage an existing snapshot.

Change-Id: Iaef8d8cb4be0d8872a2796c0fc69279c14f15a80
Closes-Bug: #1810476
2019-01-04 18:38:32 +08:00
Chris Yang cb7b8e292a QNAP: driver should not manage snapshot which does not exist
The snapshot which does not exist in NAS shuold not be managed.

Change-Id: I06475ccc507ee62f3da8f8795694f6da14064036
Closes-Bug: #1810374
2019-01-03 17:03:21 +08:00
Chris Yang bc2a18eee5 QNAP: Support QES FW on TDS series NAS
Support both QTS and QES FW on TDS series NAS models.

Change-Id: I87129fae531b6d50b8490785badcb054a9dd9397
2019-01-01 14:20:40 +08:00
zhufl 6eea03bce7 Add missing ws separator between words
This is to add missing ws separator between words.

Change-Id: I8b471b87c6a12783a6b8bf56ec1523103f471090
2018-11-21 14:49:07 +08:00
Chris Yang a8ccc1ac12 QNAP: Add support for QES 2.1.0
This patch do the following change to the QNAP Manila driver:
1. Add support for QNAP QES firmware 2.1.0.

Change-Id: I81320b6af988d19526241fd0856b427fcf1f96d7
Implements: blueprint qnap-support-qes-210
2018-07-20 11:17:28 +08:00
Zuul e4acaa5bf1 Merge "Use class name in invocation of super" 2018-06-12 17:28:22 +00:00
Chris Yang a3314dbef9 QNAP: driver changes share size when manage share
After manage share, driver updates the share size.
The share size should not be updated.

Change-Id: I5f670495cd61b63d1c0669c274b502a6a691e4e2
Closes-Bug: #1773761
2018-06-09 14:03:54 +08:00
Goutham Pacha Ravi fd23a6387c Use class name in invocation of super
Fix pylint E103 warning raised by usage of
self.__class__ to refer to the derived class
in super() methods.

self.__class__ is a reasonable first argument
to super() in any method of a class, as long
as the method is not going to be invoked in
derived classes.

Python3 removes this ambiguity by not requiring
arguments for the super() method.

[1] https://docs.pylint.org/en/1.6.0/features.html#id33

Change-Id: I6071b6cfd8cff2be3853d739f71b94da990cda97
2018-06-06 17:47:18 -07:00
Chris Yang 69b8810264 QNAP: Add support for QES 2.0.0
This patch do the following change to the QNAP Manila driver:
1. Add support for QNAP QES firmware 2.0.0.

Change-Id: Ifd4a1f042cd35fc0b2fd77fa8602a9aead65bc62
Implements: blueprint qnap-support-qes-200
2018-01-09 02:01:45 +08:00
Chris Yang 487aa691fd Add support for enhanced features to the QNAP Manila driver
This adds enhanced supports to the QNAP Manila driver:
 - Thin Provisioning
 - SSD Cache
 - Deduplication
 - Compression

Change-Id: I0c92ecf6ac55e2f6fbf1d41132e97fa2d40c3ebd
Implements: blueprint qnap-enhance-support
2018-01-05 15:01:10 +08:00
Chris Yang 205ef44283 QNAP Manila driver: Access rule setting is override by the later rule setting.
When user try to add access rule1 and access rule2, share will first set to
the rule1 and then override by the rule2.

We expect that share should apply both access rule1 and access rule2.

Change-Id: Id77cffb5efe4388e3b66aa85fc89cf6f51d5bd98
Closes-Bug: #1736370
2017-12-25 09:32:02 +08:00
Chris Yang 4c2b5e9335 QNAP: Add support for QES 1.1.4
This patch do the following changes to the QNAP Manila driver:
1. Add support for QNAP QES firmware 1.1.4.
2. Correct the default parameters in edit share function.
2. Remove unused code flow.
4. Add more debug log and write more test cases.

    Implements: blueprint support-qes-114

Change-Id: I977ef3e66a21a52116b44059ad5aeaf1560b47b7
2017-12-06 14:47:52 +08:00
shangxiaobj 5084efe621 [Trivialfix]Fix typos
Fix the typos in manila.

Change-Id: I4d446759eddf512c46247aca0bab08b4c8155d9a
2017-08-01 01:25:50 -07:00
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
Pony Chou cf182947b7 Add QNAP Manila Driver
This driver supports below features:
 - Create NFS Share
 - Delete NFS Share
 - Allow NFS Share access (IP access type)
 - Deny NFS Share access
 - Create snapshot
 - Delete snapshot
 - Create share from snapshot
 - Extend share
 - Manage share
 - Unmanage share
 - Manage snapshot
 - Unmanage snapshot

DocImpact
Implements: blueprint qnap-manila-driver

Change-Id: I4e4278a870af7be1c026385b85ea309b2d1773a9
2017-01-21 21:46:15 +08:00