Commit Graph

22 Commits

Author SHA1 Message Date
CaiqueMello 9ddddeeea3 [NetApp] Fix non-disruptive migration cifs shares
Migrate non-disruptive cifs share from different pools change the
export location. When the non-disruptive migration complete
process is started a new share and export location is created. As
result, Manila finds a conflict between the old export location and
the new one.

This patch add a condition to skip export location creation when
a CIFS migration is in progress, also change the way that the export
location is created. Instead of create the export path with share
name, the new one is taken from the backend. The fix is only for
ZAPI API calls.

Change-Id: I1bb888a0b644f0b071816d275d464c4dd27125a7
Co-authored-by: Lucas Oliveira <lucasmoliveira059@gmail.com>
Closes-bug: #1920937
2023-03-21 13:16:53 +00:00
Felipe Rodrigues 556c361558 [NetApp] Add readable replication type support
Implement the `readable` replication type for the NetApp driver.
The driver will keep having support for the `dr` type as well, being
the driver replication type a list containing them.

The replicas for readable style are mounted, created the export and
applied the QoS. When promoting, the original active replica does
not need to be unmounted. The user just loses the write access.

The update access interface is now applying rules for non active
replicas that are readable.

Implements: bp netapp-readable-replica
Change-Id: Icc74eaecc75c3064715f91bebb994e93c0053663
Signed-off-by: Felipe Rodrigues <felipefuty01@gmail.com>
2021-09-02 18:07:23 +00:00
Zuul d08f1ae5d9 Merge "[NetApp] Fix CIFS promote back issue" 2020-09-22 08:23:57 +00:00
silvacarloss c3aed22f94 [NetApp] Fix CIFS promote back issue
This change fixes the NetApp promote back issue when using CIFS
protocol. When promoting a replica, the NetApp ONTAP driver
attempts to create a new CIFS share entity (an access point as
defined in [1]) for the new active replica. This behavior
causes a failure since the storage identifies that a current
backend CIFS share with the same name exists, considering
that the reffered replica was once the active one.

This issue is addressed by removing the related CIFS share
entity when the replica gets promoted.

[1] https://library.netapp.com/ecmdocs/ECMP1401220/html/GUID-1898D717-A510-4B3D-B2E3-CCDDD5BD0089.html

Closes-Bug: #1879368
Change-Id: Id9bdd5df0ff05ea08881dd2c83397f0a367d9945
2020-09-21 17:55:12 +00: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
Goutham Pacha Ravi 598223985a Use unittest.mock instead of third party lib
mock was adopted into standard python
in version 3.3 [1]. Since manila no longer
supports python2.7, we can use the inbuilt
mock package rather than the third party
lib.

Fix some issues with imports that weren't
following our import conventions of grouping
imports [3]

Add a hacking test to ensure we don't regress
on this.

[1] https://docs.python.org/3/library/unittest.mock.html
[2] http://lists.openstack.org/pipermail/openstack-discuss/2020-March/013281.html
[3] https://docs.openstack.org/hacking/latest/user/hacking.html#imports

Co-Authored-By: Sean McGinnis <sean.mcginnis@gmail.com>
Change-Id: If857a49fbf526983e712282a25d7e8bef5093533
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-04-17 16:24:27 -07:00
Goutham Pacha Ravi 5e8df296ab NetApp cDOT: Fix security style for CIFS shares
If the backing FlexVol security style is configured
incorrectly, end users cannot write to their manila
shares.

Change-Id: I12c85c54c7318592ac0b34efe3624d175d2e6976
Closes-Bug: #1696000
2017-08-08 12:17:31 -04:00
Tom Barron 72ab1442ad Remove unused logging import and LOG global
This patch removes unused global LOG variable
and logging imports from various manila modules,
and adds a script to be run as part of pep8 that
will ensure that these do not creep back into
the codebase.

Change-Id: I162c4b2478df45aaf6ea8009b102d6de1a4e309e
2016-04-05 07:06:08 -04:00
Clinton Knight b0ecb2fca4 Support export location metadata in NetApp cDOT drivers
Since the export location metadata feature has merged in Manila core,
we can support it in the NetApp drivers. The initial need is to
report which paths are preferred.

Implements: blueprint netapp-cdot-export-location-metadata
Depends-On: Ibb88c64ddd899c09cd148f398e21ac613be9f15b
Change-Id: I77e3a6464c6da59cfafa34bd23c23740efbcf7c1
2016-02-26 17:33:20 +00:00
Clinton Knight 6ef6482822 Implement update_access() in NetApp cDOT drivers
This commit replaces the allow_access and deny_access methods
in the NetApp cDOT drivers with the new update_access method.  Due
to how cDOT works, the driver always uses the full update path
instead of adding or removing access rules one at a time.

The rules are added in an order that guarantees no transient
interruptions occur, and the IP addresses for NFS are sorted such
that single addresses and smaller subnets take precedence over
larger networks.

Change-Id: I040690895ca1a60f5964a6d01a799b613f7f6a30
Implements: blueprint netapp-cdot-update-access
2016-02-21 14:50:09 +00:00
Clinton Knight d6b1c143b4 NetApp cDOT driver should support read-only CIFS shares
Read-only shares are now a required Manila feature.  The cDOT driver
supports read-only access for NFS shares but not CIFS.  This commit
adds CIFS read-only support.

Closes-Bug: #1513509
Change-Id: Ib7367d80c263331341ca136b61fa8185e894db3b
2015-12-09 15:02:38 +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
Jenkins 4d8266ed1e Merge "Add manage/unmanage support to NetApp cDOT driver" 2015-09-01 08:46:08 +00: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
Clinton Knight 153154c60c Add manage/unmanage support to NetApp cDOT driver
This commit adds support to the cDOT driver for the driver methods
manage_existing and unmanage.  The logic follows three sections:

1. Locate the resource to be managed, which is specified as the
cDOT flexvol name in the export_path argument.
2. Ensure the flexvol to be brought under Manila management is
of the appropriate type, the extra specs from the share type are
valid and match the specified pool, and the flexvol has no LUNs
or other flexvols mounted underneath it.
3. Rename the flexvol using normal Manila naming conventions,
remount it on a new path matching the new name, update it to
conform to all relevant qualified extra specs, and remove any
existing export rules.

Implements blueprint netapp-cdot-driver-manage-unmanage-share

Change-Id: Ib6832baf24585791bf7ec292e5c6cdeb83fe280d
2015-08-20 16:52:49 +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 0bb3186845 cDOT multi-SVM driver may choose unsuitable physical port for LIFs
The algorithm used by the NetApp cDOT multi-SVM driver for choosing
a physical port on which to create logical interfaces (LIFs) is too
simplistic, which can result in the selection of ports that won't
work at all or which are far inferior to other choices.  This patch
improves the port selection query, sorts ports by speed, and allows
the user to override the port selection via a regex setting in the
manila.conf file.

Closes-Bug: #1434918
Change-Id: Idedcb0db23df3a745f0c1ced2652da008746f0a6
2015-04-02 19:17:45 +00:00
Clinton Knight 725a9ced55 cDOT driver should report all share export locations
Manila has the ability for shares to report multiple export locations.
This is an important capability for drivers that manage storage
backends that export shares on multiple network interfaces.  This
commit adds this capability to the cDOT driver.  This commit also
updates the cDOT driver to use backslashes in CIFS export paths.

Change-Id: I772caaad2871a072bb5bc4a505678d9fbf0c579c
Closes-Bug: #1429246
2015-03-18 13:44:20 +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 2e2b718edd Manila cDOT storage service catalog
Like Cinder, Manila has a scheduler that operates (among other things)
on extra spec values in share types to determine which backend should
receive a new share.  In Kilo, Manila will adopt the pools feature from
Cinder, such that the scheduler may choose from more than one storage
destination per backend.  This commit adds a couple of per-pool
attributes to the share stats reported by the cDOT driver to the scheduler,
including aggregate disk type and RAID type.

Implements blueprint cdot-storage-service-catalog

Change-Id: Ice616d4189832d0e4b1a0fdfdd31b82b8c0a831d
2015-02-21 18:08:08 +00:00
Clinton Knight dc2aa75e7c Support Manila pools in NetApp Clustered Data ONTAP driver
The Cinder pools feature is being ported to Manila, and drivers must be
updated to report pools in order to use this feature.  This patch adds
support for pools to the NetApp Clustered Data ONTAP driver for Manila.

Implements blueprint support-pools-in-netapp-cdot-driver

Change-Id: Iba327a745227e6219e6e1fc77af407f097905d8f
2015-02-16 20:18:50 +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