Commit Graph

61 Commits

Author SHA1 Message Date
Kiran Pawar 5f0f14a7f8 Add quiesce_wait_time option to share replica promote API.
Currently netapp_snapmirror_quiesce_timeout is an option of replica
promote that can only be set by the operator. There are scenarios where
high timeout value set by operator does not fit well e.g. disaster
stroke and user want to do an unplanned failover fast. Added new
option 'quiesce_wait_time' to share replica promote API which allows
to use specified wait_time(in seconds) instead of config option.

Closes-bug: #2000171
Change-Id: Ib02063ee8b82f7374cd89f90e7f24a845c6c7cd7
2023-02-08 16:05:28 +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
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
zengyingzhe 5ef160ca75 Change a parameter key for CIFS mounting command
While Huawei driver mounting CIFS filesystem, the username parameter
key passed to the mount command is by the form of "user=***", which's
compatible as "username=***" in Ubuntu. However, for some other
systems, such as Redhat, it is not valid.

This patch changes it to the more compatible form "username=***".

Change-Id: Ifa2ca7bcdceef2d47e2841a27ddf51d86f1ef63c
Closes-Bug: #1740816
2018-03-02 09:07:02 +08:00
zengyingzhe 6fabe14f56 Huawei driver supports snapshot revert
Implement the revert_to_snapshot interface in Huawei driver to
support this capability.

Implements: blueprint huawei-driver-support-snapshot-revert
Change-Id: Ib92afcce59bd5ee018b3a99cff47d892c88145e4
2017-12-19 19:30:45 +08: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
Goutham Pacha Ravi 64a73b1419 Refactor Access Rules APIs
- Pull up policy check to beginning of the APIs.
- Avoid making access rules changes when one or
  more instances of the share are in an invalid state.
- Add back the per rule share instance access status.
  This restoration provides better visibility for which
  rules were applied successfully.
- Remove 'updating' and 'updating_multiple' as valid
  states for the share instance access rules status.
- Deprecate the access rule state 'new' in favor of
  'queued_to_apply' and the share instance access rules
  status 'out_of_sync' in favor of 'syncing'.

In a new API micro-version:
- Allow access rule changes irrespective of the share's
   access_rules_status.
- Expose new access rule states and share's
  access_rules_status values.

Access rules for each share instance now transition
from 'queued_to_apply' to 'applying' to 'active' or 'error';
and from 'active', 'queued_to_apply', 'applying' or 'error'
to 'queued_to_deny' to 'denying' to 'deleted'.

APIImpact
DocImpact

Partially-implements: bp fix-and-improve-access-rules
Co-Authored-By: Mike Rooney <rooneym@netapp.com>
Change-Id: Ic25e63215b5ba723cbc8cab7c51789c698e76f28
2017-01-19 15:02:58 -05:00
zhongjun2 a9cf8adfbf Trivial fix translate issues
Fix some translate issues according to oslo.i18n guideline [1].

[1] http://docs.openstack.org/developer/oslo.i18n/guidelines.html

Change-Id: I93da3f1f834fb193bd2253208f689cc112baddd1
2016-12-19 22:04:40 +08:00
zzxwill fb44a0a49e Put all imports from manila.i18n in one line
Put '_', '_LW', '_LI', '_LE' from manila.i18n in one line
to make it beautify. Nova, neutron and many other projects
follow this rule. Like
bc5035343d/nova/virt/disk/mount/nbd.py
ee42af1011/neutron/cmd/ipset_cleanup.py
(added more files)

Change-Id: If7ed442ebe946b32b3234ce37b38ee3a5ccbcb39
2016-09-14 06:07:33 +00:00
zhaohua 88898b553d Implement replication support in huawei driver
Implement the following interfaces:
  - create_replica
  - delete_replica
  - promote_replica
  - update_replica_state

DocImpact

Change-Id: I1c52c9f67daa8440050a03e7e9ead5ca32ded458
Implements: bp huawei-driver-support-replication
2016-08-27 07:47:48 +00:00
liuke2 fed9412f13 Huawei: Support reporting disk type of pool
Adding support for reporting disk type of pool in huawei manila
driver. When creating share we can specify the disk type of the
pool we want to use ssd/sas/nl_sas/mix, manila driver will report
the disk type of the pools.

Implements: blueprint huawei-pool-disktype-support
Change-Id: I1f694e8c93f79851f838d226830d9ab5344cf35a
2016-07-22 01:47:14 +00:00
Jenkins e50114897c Merge "Huawei driver support access of all IPs" 2016-07-21 17:51:05 +00:00
Jenkins ea307ccb49 Merge "Huawei: Add share sectorsize config in Huawei driver" 2016-07-21 12:23:52 +00:00
liucheng 96795787ae Huawei: Add share sectorsize config in Huawei driver
Data in the file system consists of fixed-length disk blocks.
The size of the blocks (also known as file system sector size)
affects disk space usage and performance.
The value of blocks can be 4 KB, 8 KB, 16 KB, 32 KB, or 64 KB.

Change-Id: I95a9aa7e071c470c21dc0fa009ba96a7c7439ce6
Implements: blueprint huawei-driver-block-size-config
2016-07-13 12:56:19 +08:00
zhaohua aa6a0e229b Huawei driver support access of all IPs
In access-allow and access-deny, change 0.0.0.0/0 to asterisk(*)
to represent IP addresses of all clients.

Change-Id: I7b79cf5fde88ba8eb273d71d6eb40bea5b744673
Closes-Bug: #1576557
2016-07-12 14:50:24 +08:00
Jenkins 58970a603c Merge "Huawei: Add manage share snapshot in Huawei driver" 2016-06-17 13:33:23 +00:00
liucheng d1303438e9 Huawei: Add manage share snapshot in Huawei driver
Manage share snapshot on the array,
before managing the snapshot, make sure that the
source share is managed by OpenStack.

Implements: blueprint huawei-driver-manage-snapshot
Change-Id: I085106dccec5d371771fa112898e980bae182d11
2016-06-12 01:07:19 +00:00
zhongjun 548975ee2d Huawei: Fix exception in update_access not found
When share is deleted in the backend, user is unable to delete
share because of error thrown in update_access(). Make backend raise
ShareResourceNotFound exception in case share not found during
"update_access" operation, because share manager expects it for
proper handling of share deletion, thus allowing share to be
deleted in this case, without having to use force-delete.

After add ShareResourceNotFound exception, it will need a parameter
named share id(share['id']), so add share id to share info in
create_share_from_snapshot function.

Change-Id: I9756ff882e6960b07f5f0abac94057c687830ad0
Closes-Bug: #1585035
2016-05-26 09:19:09 +08:00
tpsilva 02a9a2c3e2 Remove default values for update_access()
update_access method has None as default values for add_rules and
delete_rules. These parameters should always be iterables, so this
should be removed. This patch removes the default values for this
method on the base class and on all implemented classes.

Change-Id: I86f4ccc9d496ec6183bd0fa5be9a77c3451378d5
Closes-bug: #1555294
2016-03-14 15:24:41 -03:00
Rodrigo Barbieri cae5a0152c Move Share Migration code to Data Service
Removed functionality of Share Migration relying on Manila Share
Service node, moved code to Data Service node for copy phase.

Added parameter 'notify' and share/api methods for future
implementation (see dependent patches).

Added new copy operation statuses, in order to implement future
API calls to obtain progress and cancel migration.

Added possibility of 2-phase migration for driver migration and
generic (fallback) migration.

Added admin export location support and removed approach of
replacing IP with config parameter.

Added Admin-only API entry points to:
- Migration Cancel (only during copying)
- Reset Task State field
- Migration Get Progress (only during copying)
- Migration Complete (2nd phase migration)
- Notify parameter on Migrate Share

APIImpact
DocImpact

Implements: blueprint data-service-migration
Change-Id: I1d65aac2f36942cd70eb214be561d59a15a4ba26
2016-03-03 09:34:29 -03:00
zhaohua bc24ef82ec Huawei driver improve support of StandaloneNetworkPlugin
Add 'None' as a legal value of 'network_type'
Add choose the port which has least number of logic port
to setup server in flat network.

Change-Id: Id6bd63fce62004f8ff54e6959931cb7a175bbf93
Closes-Bug: #1549183
2016-03-02 14:26:43 +08:00
zhaohua 1cbf87a382 Huawei driver code review
Code and log format.
Change external lock to internal to improve performance.
Use deepcopy instead of copy.

Change-Id: Icb816fa9b47dbdfa5dfbb34e55ded8e167ba7ec8
Closes-Bug: #1550106
2016-03-01 10:37:49 +08:00
zhaohua 2844ed7fe8 Implement update_access() method in huawei driver
Add update_access() method to huawei driver.
Do not remove allow_access() and deny_access().

Change-Id: Ic96ee3166b1b9f6a604688c0eea8f1c8131be919
Implements: bp huawei-driver-implement-update-access
2016-02-29 16:24:14 +08:00
Jenkins 934d7ec336 Merge "Huawei driver: change CIFS rw to full control" 2016-02-26 18:00:27 +00:00
Jenkins 8bf18d0211 Merge "Validate qos during share creation" 2016-02-26 04:38:32 +00:00
zhaohua 5cf704c28e Huawei driver: change CIFS rw to full control
User who has 'read and write' permission of cifs is unable to delete files.
This is not manila's 'rw' permission expected.
Change the 'rw' permission of CIFS to 'full control'.

Change-Id: Ie84f27c561d9aa4ec5f67b5d380ad45761e2f4cb
Closes-Bug: #1550093
2016-02-26 10:15:04 +08:00
liucheng d69928f365 Validate qos during share creation
When creating a qos share, incomplete parameter validation will
cause shares been added into improper qos group.
While some of Huawei array do not support qos, compatibility will
be a problem, so we will take array version into account.

Change-Id: I6f2591d55f2f57e5cc1a67d8049dc81ffddc1102
Closes-Bug: #1545559
2016-02-23 10:44:21 +08:00
zhaohua c2d285e089 Three ways to set Thin/Thick Type in Huawei driver
1.If thin_provisioning is set in the share type extra-specs,
  it will be used(thin share will be created if "capabilities:
  thin_provisioning=<is> True", thick share will be created if
  "capabilities:thin_provisioning=<is> False")
2.If "thin_provisioning" is not present in the share_type, the config value
  of "AllocType" in the config file will be used(thin share will be created
  if "AllocType=Thin", thick share will be created if "AllocType=Thick")
3.If two of aboves are not present, then thick share will be created by default.

Change-Id: I8153aa79fb04a4221675d7ec2e4b24947ec6f9d7
Closes-Bug: #1542133
2016-02-22 10:36:01 +08:00
liucheng e9ca434486 Huawei: Create share from snapshot support in Huawei driver
Once create share from snapshot is in Manila core,
we should support the API in the Huawei drivers.

Implements: blueprint huawei-driver-create-share-from-snapshot
Change-Id: I906916f6ae7f5625863ca9f8e3324480048374de
2016-02-03 16:17:53 +08:00
zhongjun fb80e16126 QoS support for Huawei Driver
QoS is a common attribute, so add the QoS
capability in Huawei Driver.

Partially implements: bp manila-support-qos
Change-Id: I394f7d2ece96bf75edbea604e5db0f030f4d8970
2016-01-21 10:32:29 +08:00
huyang 32cebee564 Huawei: Ensure that share is exported
Ensure share is used when the share manager service starts.
Ensure share checks the share status on the array
and changes the logical IP from the configuration
file.

Implements: blueprint huawei-driver-ensure-share
Change-Id: I29d8a5306b88edcbf7bd405da05db1e6da39f41f
2016-01-20 10:31:42 +08:00
vponomaryov 33b3183672 Fix pep8 failure
pep8 job started have following error:

./manila/share/drivers/huawei/v3/connection.py:1216:57:
    W292 no newline at end of file

So, fix it to unblock gates.

Change-Id: I765b28876237497b56bd60d48496299e86707d5a
Closes-Bug: #1535303
2016-01-18 15:36:34 +02:00
Jenkins a22f4e94be Merge "Huawei: Add share server support" 2016-01-18 00:04:12 +00:00
zhongjun 5dfc143909 QoS support for shares
QoS is a common attribute, so add the QoS
capability in common capabilities doc.
This is a simple first step towards what the
blueprints proposes.

Partially implements: bp manila-support-qos
Change-Id: I377bf0abcc62239c9a1a5ee5c28c336b2b6c410a
2016-01-15 10:15:50 +08:00
huyang 1b63324bd0 Huawei: Add share server support
Add share server support for Huawei driver.
Also implement the required setup_server
and teardown_server functions.

DocImpact
Change-Id: I1380a94b2cdc956f64eb738f708056f65713e4c2
Implements: blueprint huawei-share-server-support
2016-01-15 09:21:28 +08:00
zhaohua 9096fc7919 Huawei driver report pool capabilities [True, False]
In liberty, huawei driver has been changed to support only
thin or thick filesystem in one storagepool because of bug#1491272.
Now in mitaka, after blueprint support-lists-in-capabilities-filter
has been merged. The scheduler is able to handle one storage pool
report "thin_provisioning" :[True, False].
Most of the code is the revert of bug#1491272.

Change-Id: Ibde3053be02274956e9a689845d5f3ef6c005c51
Closes-Bug: #1532651
2016-01-13 10:28:58 +08:00
liucheng e2c94a599e Huawei: Add manage share with share type in Huawei driver
Manage share that is already on array,
before this time we just changed share's name,
now we import it with share_type and retype it.

Implements: blueprint manage-share-on-array
Change-Id: I906916f6ae7f5625863ca9f8e3324489937263cd
2016-01-08 15:00:13 +08:00
liucheng 49761cd38a Use constants instead of literals in Huawei Driver
We judged filesystem alloctype by literals,
now we change these literals to constants.

Change-Id: Iaeb64ed83b4c44e3e7d150c615ad03f8b1b4ce90
Closes-Bug: #1529015
2016-01-06 14:30:08 +08:00
Jenkins 6c70839cfd Merge "Fix create snapshot API in Huawei driver" 2015-09-12 00:25:57 +00:00
Jenkins 341e90eb2d Merge "Missing check in ShareManager::manage_existing()" 2015-09-11 19:37:48 +00:00
zhongjun 037fc4bbee Fix create snapshot API in Huawei driver
Since "Migrate share" have been merged, The share['id']
is not consistent with share['name']. So can not use 'share_name'
in create_share API and use 'share_id' in create_snapshot API at
the same time. Now change snapshot['share']['share_id']
to snapshot['share_name'] in create_snapshot API.

Change-Id: Ieedda9318762ba2c683788f023a87728d7287504
Closes-Bug: #1494614
2015-09-11 15:30:43 +08:00
Clinton Knight fd492fc11d Missing check in ShareManager::manage_existing()
In ShareManager::manage_existing(), there is a check for the DHSS mode of
the driver but there is no check for the DHSS mode in the specified share
type. This omission requires redundant checks in the drivers. This patch
adds the missing check to the share manager, removes the redundant checks
from the drivers, and updates all relevant unit tests.  Also, fix a
couple minor tempest resource cleanup issues discovered while
debugging this issue.

Change-Id: Ib579fd0558e59c28777342bb9d36def12f6bf4da
Closes-Bug: #1493869
2015-09-10 15:47:38 +00:00
zhaohua b980e254ae Huawei driver: fix reports reduplicate pools
Huawei driver tried to support both thin and thick filesystem
in one storagepool. But it's not compatible with the scheduler.
So, change the logic of Huawei driver to support only thin or
thick in one storagepool.

Change-Id: I6da6f2d46787bb2f1fe94bd86a4703094182059d
Closes-Bug: #1491272
2015-09-10 18:55:26 +08:00
zhongjun 7b0089ea68 Fix description in Huawei driver
- Since "Change REST command" have been merged
(see https://review.openstack.org/#/c/213643/),
Several new functions need to be synchronized.
- Change "import _, _LI, _LW" to "import _,
import _LI, import _LW".
- Modify the inaccurate description.

Change-Id: Ibe0e80b98bf19a025f38bc93b2a988bd7f5bad69
Closes-Bug: #1493236
2015-09-08 15:36:19 +08:00
Jenkins e56e35f252 Merge "Fix extend share API in Huawei driver" 2015-09-01 08:06:09 +00:00
Jenkins d2b74bdd37 Merge "Fix incorrect use of snapshot instances" 2015-09-01 07:35:27 +00:00