Commit Graph

30 Commits

Author SHA1 Message Date
Kiran Pawar 54c4f91aa1 NetApp: Stop clone split while deleting child share.
If share created from snapshot is deleted immediately after creation
and if clone split operation is in progress, then delete call fails.
Fix this issue by first stopping the clone split job and then continue
with deletion.

Closes-bug: #1960239
Change-Id: If9844b3da70cec427c6260ee239c8c6131ed77ed
2023-11-22 12:48:12 +00:00
Maurice Escher d3310b0b38 [NetApp] Fix lack of retry HTTP requests
The driver HTTP requester is not handling connection error with some
retries for avoiding temporary network failure in name resolution.
This patch adds a custom `HTTPAdapter` with 5 retries, according to
urrlib3 documentation [1]. Also, the connection retry will be visible
in the log [2].

[1] https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html#module-urllib3.util.retry
[2] https://paste.opendev.org/show/bIcwjk91d4vy5Hnxxs4Z/

Closes-Bug: #1971542
Change-Id: Ic9ff8208f10df9dbed09717d6b218f6293d2338a
2022-08-23 09:25:49 +00:00
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
Adam Harwell 9974f6c8be NetApp: properly use netapp_server_port config
This config option was being ignored/overwritten with default values.

Closes-Bug: #1945365
Change-Id: Id1c95154b1c4c536ac8744f6f09d569bc34bbfb9
2021-09-28 14:10:23 -07:00
silvacarloss 74d5a1b2cf [NetApp] Share server migration through SVM migrate
Implements share server migration using a proper mechanism
provided by ONTAP. In case the driver identifies that the ONTAP
version matches the version where this mechanism is available,
ONTAP will automatically chose to use this instead of SVM DR.

- Implemented new methods for migrating a share server using a
new mechanism provided by ONTAP, when both source and destination
clusters have versions >= 9.10. This new migration mechanism
supports nondisruptive migrations in case there aren't network
changes in the migration.

- The NetApp now does not need to create an actual share server in
the backend prior to the migration, in case SVM Migrate is being
used.

- The NetApp ONTAP driver can now reuse network allocations from
the source share server in case a share network change wasn't
identified.

Change-Id: Idf1581d933d11280287f6801fd4aa886a627f66f
Depends-On: I48bafd92fe7a4d4ae0bafd5bf1961dace56b6005
2021-09-07 09:03:32 -03:00
Douglas Viroel 0b04d8d671 [NetApp] Add support for FPolicy native mode
This patch adds support for automated creation of FPolicy policies
and association to a share. The FPolicy configuration can be added using
 the extra-specs 'netapp:fpolicy_extensions_to_include',
'netapp:fpolicy_extensions_to_exclude' and 'netapp:fpolicy_file_operations'.

Change-Id: I661de95bfb6f8e68b3a8c58663bb6055e9b809f6
Implements: bp netapp-fpolicy-support
Signed-off-by: Douglas Viroel <viroel@gmail.com>
2021-03-11 10:46:51 -03:00
Felipe Rodrigues 70f7859f98 [NetApp] Fix hard-coded CA cert path for SSL
NetApp driver is hard-coding the location of CA certificates for SSL
verification during HTTPS requests. This location may change depending
on the environment or/and backend.

This patch adds the `netapp_ssl_cert_path` configuration, enabling
each backend to choose the directory with certificates of trusted CA
or the CA bundle. If set to a directory, it must have been processed
using the c_rehash utility supplied with OpenSSL. If not informed,
it will use the Mozilla's carefully curated collection of Root
Certificates for validating the trustworthiness of SSL certificates.

Closes-Bug: #1900191
Change-Id: Idbed4745104de26af99bb16e07c6890637dfcfd1
2020-11-16 16:04:26 -03:00
Douglas Viroel 4bcf21eaf1 [NetApp] Add support for share server migration
This patch adds support for share server migration between NetApp
ONTAP drivers. This operation is now supported for migrating a share
server and all its resources between two different clusters.
Share server migration relies on ONTAP features available only in
versions equal and greater than ``9.4``. Also, in order to have share
server migration working across ONTAP clusters, they must be peered in
advance.
At this moment, share server migration doesn't support migrate a share
server without disrupting the access to shares, since the export locations
are updated at the migration complete phase.
The driver doesn't support changing security services while changing the
destination share network. This functionality can be added in the future.

Co-Authored-By: Andre Beltrami <debeltrami@gmail.com>

Implements: bp netapp-share-server-migration
Depends-On: Ic0751027d2c3f1ef7ab0f7836baff3070a230cfd
Change-Id: Idfac890c034cf8cbb65abf685ab6cab5ef13a4b1
Signed-off-by: Douglas Viroel <viroel@gmail.com>
2020-09-11 16:24:24 -03:00
Felipe Rodrigues 29622725e4 [NetApp] Fix HTTPS connection for python 3.7
With python3.7, the eventlet is breaking the ssl.py, so the https
is not working. This patch fixes it by changing the request library
(urllib by requests), the new library can be built over the
pyopenssl.py instead of ssl.py.

Closes-Bug: #1878993
Change-Id: I9c0b1f332ead25634f3dc3aebfdc8b51dfbc4178
2020-06-23 12:45:34 +00:00
danielarthurt c169902d41 [NetApp] Fix share shrink error status
This patch fixes the error raised by NetApp driver when the user try
to shrink a share to a size smaller than the current used space. Now
the driver raises "shrinking_possible_data_loss" instead of
"shrinking_error".

Change-Id: I01a549a0e299ae0d0d9b603a9d0797f16f4b68b3
Closes-Bug: #1858328
2020-04-22 15:50:11 +00:00
Jose Porrua 48e4e65b02 NetApp cDOT: Add NVE support in Manila
NVE is a software-based technology for encrypting
data at rest one volume at a time. An encryption
key, accessible only to the storage system,
ensures that volume data cannot be read if the
underlying device is repurposed, returned,
misplaced or stolen.

Signed-off-by: Erlon R. Cruz <erlon@netapp.com>
Signed-off-by: Tiago Pasqualini <tiagod@netapp.com>

Change-Id: Ib622c3d64cbec5a7254f6074f07d6f56f6492ca4
Implements: blueprint netapp-encrypted-shares
2018-01-24 13:44:23 -02:00
Ben Swartzlander ed3d93eb9b Allow ZAPI over IPv6
When an IPv6 literal is specified in manila.conf for the
netapp_hostname option, automatically URL-escape it.

Closes-bug: 1730509

Change-Id: Id55e870066b6a669da83aa6a96f74ea76d6103bd
2017-11-06 16:52:29 -05:00
Goutham Pacha Ravi 148f77f184 NetApp ONTAP: Add support for filtering API tracing
API Tracing is valuable when diagnosing problems or
unexpected behaviors with the ONTAP Manila driver.

However, turning it on may spam logs and make it rather
harder to trace through specific API calls.

Change-Id: I3c91638138ec1a2652efdadbc86176afa295abd8
2017-09-20 16:01:33 -04:00
zhongjun 50df32ceec Use parenthesis instead of backslashes in share folder
Use parenthesis instead of backslashes in share folder

TrivialFix
Change-Id: I6c2ea07b0bfc5852b28e44989406cc10eb972e39
2017-06-15 17:43:33 +08:00
Goutham Pacha Ravi 20e89b9691 NetApp cDOT: Add Intra-Vserver migration support
Add migration support in the cDOT driver.

Change-Id: I72e045b1c978b752f38cc3018cb2a7084e3f3e36
Implements: blueprint netapp-cdot-driver-optimized-migration
2017-01-21 13:06:30 -05:00
Alex Meade e663275e24 NetApp cDOT: Fix status updates for replicas
When promoting or updating a replica that is on a backend that is unreachable,
the status and replica_state fields for the replica should be ERROR.

Closes-Bug: #1554170

Change-Id: I7e4dd53a70aea2beeed1404c54e354f773a94427
2016-03-17 23:24:07 -04:00
Clinton Knight 4a2290193c NetApp cDOT driver should not split clones
An earlier bug (https://bugs.launchpad.net/manila/+bug/1259988
"NetApp cDOT driver should split clone from snapshot after
creation") led us to modify the NetApp cDOT driver to split cloned
shares off from their parents immediately upon creation. As
described in that bug report, the fix makes the source snapshot
deletable after the clone split is done. However, the more
significant negative consequence is that the storage efficiency
gains from having cloned the blocks are lost. We have had
complaints from users who expect to retain the storage efficiency
of cDOT snapshots and cloning.

The fix is to not start a clone split during the
create-from-snapshot workflow. Instead, if/when a request to
delete the locked snapshot is received, the driver should start
the clone split at that time and soft-delete the snapshot. The
driver already has logic for reaping soft-deleted objects, so it
is straightforward to also reap deleted snapshots as they become
un-busy.

Change-Id: I0f7ba8f76dce6f55c64e156b372317387d299fa6
Closes-Bug: #1554592
2016-03-14 17:43:36 +00:00
Alex Meade d9dea3e182 NetApp: Add Replication support in cDOT
Add support for the replication driver workflows
within the NetApp single-svm cDOT driver.

Implements: blueprint netapp-cdot-single-svm-replication
Co-Authored-By: Clinton Knight <cknight@netapp.com>
Co-Authored-By: Goutham Pacha Ravi <gouthamr@netapp.com>

Change-Id: I0a55433f1953facdd5169a2991c67d3f046bcf06
2016-03-01 18:16:49 +00:00
Clinton Knight f925c04900 Revert netapp_lib dependency in NetApp cDOT Manila drivers
The community asked us to remove the dependency on a PyPI
library with a proprietary license.  This commit does that
while preserving some minor refactoring that was done at the
same time.

Reverts commit ca6168d01b.

Closes-Bug: #1499334
Change-Id: I1a4b1b2b2151bb222ae5c77b9b317e7505255067
2015-09-25 13:06:38 -04:00
Clinton Knight ca6168d01b Update NetApp cDOT Manila drivers to use netapp_lib
Like other vendors, NetApp has published a storage controller
client library to PyPI for use by its OpenStack drivers.  This
patch updates the NetApp cDOT Manila drivers to use the new
library.  In particular, the unit tests must still work in the
gate in the absence of the new library.

Implements bp: use-pypi-client-library-in-netapp-cdot-drivers
Change-Id: I362f7ea584bb15a39c761fb5114391f557506764
2015-08-20 21:44:32 +00:00
Jenkins 1f75a46cb4 Merge "Replace (int, long) with six.integer_types" 2015-08-07 15:10:47 +00:00
Julia Varlamova c3e749dafd Fix imports for py34 compatibility
Fix imports of:
    urllib2
    httplib
    __builtin__
    StringIO
    UserDict

Partially-Implements: bp py3-compatibility

Change-Id: I0da74d504456cbb9680973bdabc091cf8786bc9a
2015-08-05 17:32:13 +03:00
Julia Varlamova 3500bd64cd Replace (int, long) with six.integer_types
Python 3 hasn't type 'long', there is only integer type 'int',
which mostly behaves like the long type in Python 2.

Partially-Implements: bp py3-compatibility

Change-Id: I78eb93837cbe137c9ce4dd1b3cf0f4744696ade4
2015-07-31 07:12:12 -04:00
Clinton Knight dab1e3bc14 Enable Manila multi-SVM driver on NetApp cDOT 8.3
cDOT 8.3 includes numerous new networking features, at least one
of which (broadcast domains) must be used when creating network
interfaces.  This patch enables the multi-SVM driver on cDOT 8.3
by ensuring that each physical port selected to host share server
logical interfaces (LIFs) is a member of a broadcast domain.
A couple of other API tweaks are included that also impeded
operation on cDOT 8.3.

Closes-Bug: #1425754
Change-Id: Ibe92aee217462bce06485e195b930f2fdf43fcc0
2015-07-10 22:41:53 +00:00
Jenkins 79d3a38b19 Merge "NetApp cDOT driver is too strict in delete workflows" 2015-04-09 19:21:01 +00:00
Clinton Knight 6999c8d26b NetApp cDOT driver is too strict in delete workflows
If a share or share server is not created successfully,
sometimes Manila will not save the vserver info in the
share or share server object. In such cases, when asked
to delete such a share or share server, the cDOT driver
should not protest about the lack of vserver info but
instead should log a warning and not raise an exception
(which leaves the object in an error_deleting state).

This patch addresses a number of issues in the delete,
share-server-delete, and snapshot-delete workflows where
the cDOT driver could unnecessarily raise an exception
when it should merely do nothing and allow the workflow
to proceed.

Change-Id: I54cf96b8a24ac5272b37bce2f5118551504a1699
Closes-Bug: #1438893
2015-04-08 19:41:39 +00:00
Clinton Knight 9b6771a580 NetApp cDOT driver uses deprecated APIs for NFS exports
The nfs-exportfs-* APIs that the NetApp cDOT driver currently uses
for NFS export management are 7-mode APIs which were left in for
backwards compatibility. It's not the recommended/supported way
to do NFS export management. We need to modify the driver to use
the supported set of export-policy-* and export-rule-* APIs.

Closes-Bug: #1370761
Closes-Bug: #1437509
Change-Id: I91347d27ba69d4a20fe73ce7e75f58c9818ea6d8
2015-04-06 21:53:14 +00:00
Clinton Knight d37f44f04a cDOT driver should split clone from snapshot after creation
When the cDOT driver receives a create_share_from_snapshot command,
it clones the share/flexvol from the specified snapshot in the
parent share/flexvol.  But if the resulting clone is not split
from its parent, the snapshot remains busy and may not be deleted.
This is resolved by starting a clone split operation anytime a
clone is created.

During the split operation, which usually completes within
seconds, the snapshot remains busy.  This patch detects that
condition in the snapshot delete path and waits up to a minute
for the busy condition to clear.

Change-Id: I44bac106f7f7a1acc968c1d9a526dcef85f657b7
Closes-Bug: #1259988
2015-04-02 17:16:17 +00:00
Clinton Knight f27538323b Single-SVM Manila driver for NetApp Clustered Data ONTAP
The extant Manila driver for cDOT supports multi-svm mode only
(i.e. driver_handles_share_servers = True).  This commit adds
a single-svm cDOT driver (driver_handles_share_servers = False)
for simpler operation without network plug-ins.  To work in this
mode the storage admin must pre-create a vserver with the desired
LIFs and protocols configured, and specify the vserver in
the config variable 'netapp_vserver'.

To configure this driver, use a config like the following:

[cmode]
share_driver = manila.share.drivers.netapp.common.NetAppDriver
driver_handles_share_servers = False
netapp_storage_family = ontap_cluster
netapp_server_hostname=192.168.228.42
netapp_login=admin
netapp_password=cluster3
netapp_server_port=443
netapp_transport_type=https
netapp_aggregate_name_search_pattern=manila
netapp_vserver = manila_svm

Implements blueprint netapp-cdot-driver-without-handling-share-servers

Change-Id: I0cfafe3d64a9a9b52f1eca9f28a0e937b3b84f44
2015-03-02 19:24:41 +00:00
Clinton Knight 12eeedb639 Manila NetApp cDOT driver refactoring
The Manila cDOT driver is a single file exceeding 1200 lines.  It contains
multiple things (driver code, protocol helpers, ZAPI invocation code,
options) that should be split apart to allow for easier maintenance and
readability and add the potential for code sharing when we reintroduce
a 7-mode driver, add a single-SVM cDOT driver, etc.

We recently refactored NetApp's DOT Cinder drivers into a 4-layer
structure (interface, library, client, API) that separates concerns and
achieves the goals set forth above.  This commit satisfies a plan to
do the same thing in Manila.  The implementation steps are:

1. Update directory structure to match that of the Cinder NetApp drivers
2. Create driver interface shim
3. Move driver code to library (with base & C-mode classes, to allow for
   7-mode code sharing later)
4. Move protocol helpers to separate files (already organized by base &
   C-mode classes)
5. Split out ZAPI code to client layer (with base & C-mode classes, to
   allow for 7-mode code sharing later)
6. Implement NetApp driver factory as in Cinder
7. Implement common NetApp options file as in Cinder
8. Implement cDOT API call optimizations
9. Update all unit tests as needed

Note that this patch appears to treble the total number of code lines.
This is due to the addition of many more unit tests plus a large amount
of fake controller API data to feed the API client tests.

Implements: blueprint netapp-manila-cdot-driver-refactoring
Closes-Bug: #1410317
Partial-Bug: #1396953
Closes-Bug: #1370965
Closes-Bug: #1418690
Closes-Bug: #1418696

Change-Id: I3fc0d09adf84a3708f110a89a7c8c760f4ce3588
2015-02-10 12:30:24 +00:00