65 Commits

Author SHA1 Message Date
Michael Krotscheck
f828a9969e Added CORS support to Manila
This adds the CORS support middleware to Manila, allowing a deployer
to optionally configure rules under which a javascript client may
break the single-origin policy and access the API directly.

For Manila, the paste.ini method of deploying the middleware was
chosen, because it needs to be able to annotate error responses
created by other middlewares. If one such middleware throws an
error - such as an auth error from keystone - that error response
must still have CORS headers in order to be readable by the
user agent.

OpenStack CrossProject Spec:
   http://specs.openstack.org/openstack/openstack-specs/specs/cors-support.html
Oslo_Middleware Docs:
   http://docs.openstack.org/developer/oslo.middleware/cors.html
OpenStack Cloud Admin Guide:
   http://docs.openstack.org/admin-guide-cloud/cross_project_cors.html

Change-Id: I9d4b6d0eb380da3eae3867fcebe30fdd5824978d
2015-11-11 10:10:58 -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 720ec904456594b453cfd220b002bdc8c0d50e08

Change-Id: I86f9b7da21716346f96bae3ce30446589e4c4c37
2015-10-18 08:31:59 -04:00
Masaki Matsushita
c032fe44b1 Remove LegacyFormatter from logging_sample.conf
manila.openstack.common.log.LegacyFormatter no longer exists.
This change removes it from logging_sample.conf.

Change-Id: I67daa0e11458272c0a67bd0754c00902d36e27ef
Closes-Bug: #1499263
2015-09-24 18:43:40 +09:00
Jenkins
fb7e91ae31 Merge "Non-admin user can perform 'extra-specs-list'" 2015-09-17 13:53:28 +00:00
Clinton Knight
20a0b6bce0 Non-admin user can perform 'extra-specs-list'
This bug, inherited from Cinder, allows a tenant to view share
extra specs using the extra-specs-list CLI command.  The Cinder
fix was to check the admin context in the DB layer and filter out
all extra specs for non-admins.  This approach doesn't work for
Manila, because some extra specs are required and are effectively
part of the Manila API (DHSS, snapshot_support).  So in Manila we
define a set of tenant-visible extra specs and restrict the extra
spec values to that set in the share type view builder. Also, we
add policies for the share type list APIs so that admins can
control access to those if desired.

The separate API to list extra specs already has adequate checking
for non-admin users; the CLI was listing the extra specs returned
by the share type API, which is now filtered as described.

Co-Authored-By: Andrew Kerr <andrew.kerr@netapp.com>
Change-Id: I9b0a8ddc064c246286f26760b703db6e3e1bcd46
Closes-Bug: #1475285
2015-09-16 18:14:25 +00: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
Clinton Knight
dddc068879 Add v2 Manila API path as base for microversions
To prevent a microversioned client from managing a non-microversioned
Manila server, Manila must update its REST endpoints by adding /v2 for
all microversioned APIs.

This commit does the following:

* Add /v2 to the URL map, connected to all the same /v1 API methods
* Renumber the microversion sequence starting from 2.0
* Update the versions API to reflect v2
* Publish the new endpoint to Keystone in the DevStack plug-in
* Update relevant documentation
* Update Tempest tests for microversions
APIImpact
Co-Authored-By: Andrew Kerr <andrew.kerr@netapp.com>
Closes-Bug: 1488624
Change-Id: I56a516b5f81914557dd2465746629431cfd6deac
2015-09-10 13:58:26 +00:00
Jenkins
3e0284b524 Merge "Add SSL middleware to fix incorrect version host_url" 2015-09-10 11:58:48 +00:00
Rodrigo Barbieri
0524ab8fc2 Add Share Migration feature
Share Migration allows a share to be migrated from
one host#pool to another host#pool through the
"manila migrate <share> <host#pool>" command. It first
calls the driver to perform it in an optimized way if
possible. If the driver returns that it did not migrate,
it performs a generic migration.

A new field has been added to "shares" table: task_state,
which tracks migration status.

For driver migration, the method migrate_share in driver
base class should be overridden.

For generic migration, drivers may use new config options
to achieve the necessary configuration:
- migration_mounting_backend_ip: If backend has additional
exports IP for admin network, specify it here.
- migration_data_copy_node_ip: IP of entity performing
migration between backends, such as manila node or
data copy service node. This may not apply for
DHSS = true drivers.
- migration_protocol_mount_command: specify mount command
with protocol and additional parameters. Advisable to restrict
protocols per backend. Defaults to "mount -t <share_proto>".

If additional customization is needed, drivers may override
certain methods:
- _mount_share: return the mount command.
- _umount_share: return the umount command.
- _get_access_rule_for_data_copy: return an access rule with
the IP address which will allow the manila node or data copy node
to mount the share after added permission through
allow-access API command.

Change-Id: I8dde892cb7c0180b2b56d8c7d680dfe2320c2ec7
Implements: blueprint share-migration
2015-09-06 22:52:41 -03:00
Alex Meade
680fd50d3e Add Consistency Groups API
This patch adds the /consistency-groups and /cgsnapshots
endpoints as well as AdminActions for both.

Partially implements bp manila-consistency-groups

APIImpact

Change-Id: I5fd0d3341766fdba4d92f4a43c3d1186e7a4b38e
2015-09-05 18:21:17 -04:00
Igor Malinovskiy
91e438b40e Add Share instances Admin API
Add admin API which allows:
- Get share instances of given share
- Get all share instances
- Get share instance details by id
- Reset share instance state
- Force-delete share instance

Add appropriate unit and tempest tests.

APIImpact
Change-Id: Ie96dfc18b491cb4d9705da4eaca5bc4ce43225ea
Partially-Implements: blueprint share-instances
2015-08-31 13:41:17 +03:00
Igor Malinovskiy
15fb464e5d Add availability zones support
Rework availability zones support which was inherited from Cinder:
- Add public API extension
- Preserve AZ if creating a share from a snapshot
- Always set AZ in Share API or Share Manager
- Update db schema and create db migration
- Update appropriate unit tests

APIImpact
Partially-Implements: blueprint availability-zones

Change-Id: Iea9fbc3fea5c0128772115c028989121f397e0c5
2015-08-26 18:48:16 +03:00
Clinton Knight
145165a22e Implement Manila REST API microversions
The OpenStack API working group recommends all projects adopt
Nova-style microversions for versioning their REST APIs.  This
commit ports the Nova microversion code and docs to Manila.

With this patch, the API version is bumped to 1.1, and the
versions API (which has always returned horribly outdated
values) is the first API that is versioned.  The 1.1 version
of the versions API includes the minimum and current API
version values.

Implements bp: manila-rest-api-microversions
Change-Id: Ifa8e394335a4eb3ad21f53a873530aee241c00e8
2015-08-13 19:51:19 +00:00
Deliang Fan
32295b5c3c Add SSL middleware to fix incorrect version host_url
The Manila API does not behave properly if it is behind an SSL
termination proxy. If this is the case, the host_url in version
resource are build using http protocol instead of https.

To handle to correct host_url with proxy, first, we should enable
X-Forwarded-Host in proxy so that Manila can get the right client
ip. Second, we should enable X-Forwarded-Proto, with the new SSL
middleware, Manila will get original protocol.

Change-Id: I2dac983481718e6d639453e3f03f41baf8cea56d
Closes-Bug: #1384379
2015-08-11 12:00:51 +08:00
Ramana Raja
29456c2299 glusterfs_native: fix delete share
With GlusterFS 3.7.x versions, the delete share operation fails when
deleting the contents of a GlusterFS volume, a share. This is because
two directories are auto-created within a GlusterFS volume when it's
started and GlusterFS refuses to unlink their paths. Fix this issue, by
not trying to remove the two directory paths, but remove their contents
and the rest of the contents of the volume.

Change-Id: I1675bbf593bf578301d6899ee3f9860320080956
Closes-Bug: #1473324
2015-07-21 14:43:25 +05:30
Igor Malinovskiy
36fae29ea5 Add share shrink API
Implement optional API for shrinking shares:
"manila shrink <share-id> <new-size>"

- Implement tenant-facing API for shrinking shares
- Add appropriate unit tests

Partially implements bp share-shrink-api

Change-Id: I48f8e05793a992b11fb180b0b4dbf43bcffb4229
2015-06-04 09:46:24 +03:00
Igor Malinovskiy
f67bcf81ae Add share extend API
Implement API for extending shares similar to Cinder:
"manila extend <share-id> <new-size>"

- Implement tenant-facing API for extending shares
- Add appropriate unit tests

Partially implements bp share-extend-api

Change-Id: Ic63ecb1c2881ac9c8b59010efe3a37413f18f28d
2015-05-18 17:23:04 +03:00
Lin Yang
2b49e807d3 Move to the oslo.middleware library
This patch moves Manila to using olso.middleware, updates it to
use the sizelimit middleware in oslo_middleware namespace.

Change-Id: I10c3cbeb9d43b504f14375df4dac87b323fab5bf
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
2015-04-27 14:13:08 +08:00
Thomas Bechtold
f4efdb7721 Switch to new style policy language
New style policy language is much more human readable and the prefered
way to describe policies.

Change-Id: Ib741e2222ad36fa481ca8003387ecc1d9e8231e6
Implements: blueprint switch-to-new-style-policy-lang
2015-04-14 07:27:07 +02:00
Clinton Knight
72f5f0485a Fix issues with get_pool scheduler API
The scheduler API 'get_pools' was copied from Cinder and has several
problems.  The REST endpoint, /scheduler-stats/get_pools, is not a
REST-appropriate name.  The API allows filtering but filters are not
currently supported by the Manila scheduler.  The API was added as an
extension, not part of the v1 API as it should be.  After restarting
the scheduler service, the API doesn't return any data until a share
has been created (Cinder was used as a model for fixing this one).
This patch fixes all of these issues.

Closes-Bug: #1422042
Change-Id: I7e32efb5390fd4b0a62f644ca5a12dcad14d8a9b
2015-03-16 16:32:15 +00:00
Igor Malinovskiy
f69664b1fd Add basic manage/unmanage share functionality
Manage share functionality adds possibility to add existing
shares to manila. On other hand unmanage functionality adds
possibility to remove shares from manila, but without physical
removal from share backend.

Due to high implementation complexity and risks it was
decided to implement  manage/unmanage methods only for
driver_manage_share_servers=False driver's and implement
this functionality for other cases in future. Also administrator
can't unmanage shares that were created with a share_server.

- Add manage() and unmanage() methods in admin API
- Add manage_share() and unmanage_share() methods to share rpcapi
and share manager
- Update share rpcapi version to 1.1
- Add manage_existing(), unmanage() methods
to share driver
- Add appropriate unit tests.

Partially implements bp manage-shares

Change-Id: Iedfd85cb6bdfade67c04f62c04756ac192db6b66
2015-03-13 11:02:17 +02:00
Igor Malinovskiy
35b3a508f8 Implement private share_types
Add share_type_access extension which introduces
the ability to manage share type access:
* Share types are public by default
* Private share types can be created by setting
  the is_public boolean field to False at creation time.
* Access to a private share type can be controlled
  by adding or removing a project from it.
* Private share types without projects are only visible
  by users with the admin role/context.
Implementation details and unit tests were mostly adapted
from Cinder and Nova access extensions.

Implements bp private-share-types

Change-Id: I83ee57c6a516b5382d074c0082525ad7feadd59c
2015-03-10 12:17:26 +02:00
Ramana Raja
a0097bfe15 ganesha: fix execute call using invalid argument
An execute call in the ganesha manager module that writes ganesha
export config files is made with 'process_input' argument. This
argument is invalid for processutils's ssh_execute() method which is
used by the execute call to write config files to a remote ganesha
server node. Fix this by not using the 'process_input' argument instead
use other arguments that would still enable the execute call to write
ganesha config files.

Change-Id: I58369468ac7be1de38364a1c1bf6cbf8695b9a1d
Closes-Bug: #1422235
2015-02-16 10:21:52 +05:30
Jenkins
79857b61c5 Merge "Pool-aware Scheduler Support" 2015-02-05 01:37:54 +00:00
Rushil Chugh
0253ed11d8 Pool-aware Scheduler Support
This change introduces pool-aware scheduler to address the need for
supporting multiple pools from one storage controller.
Derived from the Cinder Implementation of Pool-aware Scheduler -
https://review.openstack.org/#/c/98715/ and
https://review.openstack.org/#/c/119938

Implements blueprint: dynamic-storage-pools

Change-Id: I3aee5ed1f96f972f7d40fbd981393559587c1a23
2015-02-04 23:27:06 +00:00
Ramana Raja
80698a4420 ganesha: fix resetting of exports
When resetting exports, i.e., remove files present in the ganesha
export directory, during manager service initalization, ignore if the
directory is already empty. This allows ganesha manage service to
initialize even if the ganesha export directory is empty.

Change-Id: Iabe3f36d4f05b0fc451695b261a538b2e87be7a5
Closes-Bug: #1416958
2015-02-02 11:38:10 +05:30
Nilesh Bhosale
9e77994c9f Adding required rootwrap filters for GPFS driver
The rootwrap filters for commands 'df' and 'stat', which were part
of the volume.filters before, were recently removed considering those
to be unused. But, GPFS manila driver uses those and fails while
performing certain operations, in their absence.
Hence, adding those back.

Change-Id: Ib736385f15058028b2bc0e38d325d0c256f6dd93
Closes-Bug: #1413544
2015-01-22 16:03:28 +05:30
chen-li
acbd2aad45 Merge "volume" and "share" rootwrap filters into one file
There is no need to keep rootwrap filters in separate files
with 'volume' and 'share' prefixes.
So, merge it and remove unused filters.

Change-Id: I2fbea254faed5d8fc668cba58211d1df0e0e82f3
2015-01-05 21:06:42 +08:00
chen-li
2452252256 Strip exec_dirs prefix from rootwrap filters
Rootwrap supports for a configurable set of trusted
directories to search executables in (exec_dirs),
which defaults to system PATH.

Make the rootwrap filters more portable by removing
the explicit exec_dirs prefix from them. This allows
a binary to be installed in any of the exec_dirs and
still be used by rootwrap, which improves cross-distro
portability.

Change-Id: I9a346c0fcddc7ac8af50f72df6d401b5079e4d58
Closes-Bug: #1405068
2014-12-24 08:20:40 +08: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
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
Jenkins
752b296e15 Merge "Fix couple of nit picks" 2014-11-17 19:40:01 +00:00
Valeriy Ponomaryov
b7de18eb4a Fix couple of nit picks
Fixed two nit picks:

1) in service_instance module was improper statement about amount of
external methods.

2) After commit merge
https://github.com/openstack/manila/commit/883e02f2

part of etc/manila/README.manila.conf info became outdated.

Change-Id: I68b9efc9bc1f701cb4ea8dbecf69ec58f7cb5df3
2014-11-15 12:41:14 +00:00
Thomas Bechtold
73d867a12c Use keystonemiddleware and manila.conf for config
Switch to keystonemiddleware so a full keystoneclient installation is no
longer required.
Also move the configuration parameters for auth_token from api-paste.ini
to manila.conf. api-paste.ini configuration can still be used and take
priority over parameters from manila.conf.
Finally adjust devstack lib and use manila.conf to configure auth_token.

Related-Bug: #1240753
Change-Id: I4317ffca174a0f73dddc7030b367d49130040c77
2014-11-14 08:38:34 +01:00
Julia Varlamova
6c04272429 Improve share-network list API filtering
Add filtering share-network list by creation date, associated security
service ID, project ID (for admin context only).

Limit share network list using 'offset' and 'limit' options.

Add policy rule for 'get_all_share_networks' action.

Remove 'status' field from returned share nerwork's view,
as share_network model doesn't have such attribute. So, None was always
returned as a status.

Fix DB api function share_network_get_all_by_security_service - second param
should be named 'security_service_id' instead of 'share_network_id'.

Add unit and tempest tests.

Implements bp improve-share-network-list-filtering

Change-Id: I7c3e44068fb39672d1d6c9e06527fde2604672a9
2014-10-30 09:56:18 +04:00
Andreas Jaeger
883e02f219 Switch to oslo.config
The config module in oslo-incubator has been replaced by oslo.config.
Projects need to switch completely to oslo.config for kilo.

This patch does:
* Register options with oslo.config (new file manila/opts.py)
* Generate the config file using oslo-config-generator
* Remove obsoleted entries for this from openstack-common.conf
* Remove oslo-incubator config files

Change-Id: I30b594423c08782e13a1f615099ae65f997a8551
Closes-Bug: #1382183
2014-10-22 19:55:45 +02:00
Julia Varlamova
f3289eb610 Add new search options for security service
We can filter security services only by status, name, id and type now.

Add new search options:
    user,
    server,
    dns_ip,
    domain
to _get_security_services in SecurityServiceController to be able to filter
security services by these fields.

Allow filtering security services by share network id.

Add information about share networks to result if 'detailed' mode enabled.

Add unit and tempest tests for filtering security services.

Implements bp improve-security-service-list-filtering

Change-Id: I8b3845c2d705188ec1dc0db33c1e20c8e6c5e559
2014-10-16 11:16:22 +04:00
Deepak C Shetty
10c3f8fb1f Add support for working with multiple glusterfs volumes
This patch adds support for working with multiple glusterfs volumes
for the GlusterFS native protocol driver. Since the semantics and
mapping for native driver is different compared to GlusterFS NFS
driver, this patch refactors the native driver as a standalone
driver and fixes some flows to fit the native driver with the
Manila share flows.

A more recent version of glusterfs having SSL support is needed.

Change-Id: I567c7602e97c9d55551baa29f121c05da2985007
Closes-Bug: #1368669
2014-09-24 11:50:31 +00:00
vponomaryov
dd4bd5c487 Remove LVM driver
Support of LVM driver is planned to be dropped as it is duplicates
functionality from Cinder. Default driver is Generic driver, that uses Cinder.

Changes:
- removed LVM driver
- removed related stuff to LVM driver

Partially implements blueprint remove-lvm-driver
Change-Id: If2df592db082fdc5d609a5ce644106fee7d0583d
2014-08-19 12:05:12 +03:00
Thomas Bechtold
c16feaea5e Use common config generator
Delete Manila's implementation located in tools/conf and replace
it with common config generator located in tools/config. The new config
generator include config options from other modules (olso.messaging,
oslo.db, oslo.db.concurrency) which improves the generated sample config.

Change-Id: I553e1a8ec414383e2d79d445ebd10e0e1ffa1ae4
2014-08-12 16:33:06 +02:00
Valeriy Ponomaryov
729e37bd04 Add share_server_id filter option to 'get_all' share API method
Added one more filter option - 'share_server_id' to 'get_all' method,
by default only admin can list shares with it.
Also made little refactor for this method and covered with unittests.
Added tempest tests to cover changes.

Partially-implements blueprint add-admin-api-list-shares-for-share-server

Change-Id: I54f5458d3bb365c7a6fd0c8c7dce664cc7d01fc2
2014-08-04 04:20:31 -04:00
Dan Sneddon
8b541ab12d Adds undocumented policies and defaults in policy.json
Some policies for specific actions exist in Manila but are not documented in
etc/manila/policy.json. This makes someone have to dig to see what is available
when looking quickly.

The fix adds all actions from the APIs to policy.json, with default policy for
most of the newly added actions, and rule:admin_api for the rest. The fix
changes the share_network and security_service actions to default. The fix also
removes four actions no longer in the API. The actions quotas:update_for_user
and quotas:update_for_project are replaced with quotas:update. The actions
share_network:activate and share:network:deactivate have been removed.

Change-Id: I2e9510d59d0d3b70974f1a851ee5d2246154caf4
Closes-Bug: #1326797
2014-07-25 10:10:30 -07:00
Valeriy Ponomaryov
83e94d735e Add share-server-delete API
This API is useful when share-server autodeletion is disabled, which is default behaviour.

Changes:
- added new api method with deletion of share server
- added db method, that takes list of shares by share server id
- changed logic of share manager, that is related to concurrency issues
- added unit and tempest tests to cover changes

Partially-implements blueprint add-admin-api-delete-share-server

Change-Id: I03b452de2cd4fe34c648b2434dab1b9244b1b005
2014-07-15 14:13:57 +00:00
Valeriy Ponomaryov
cc0081fd10 Added force-delete action to admin actions
force-delete action will be available
for shares and snapshots with admin creds.

Partially implements: blueprint manila-client-enhancements

Change-Id: I896e8a83109879b96f0d7ef2ca2e52fcb7528bb3
2014-06-06 10:52:42 +03:00
Valeriy Ponomaryov
66fd6ab621 Added share server api
Added APIs are:
share-server-list
share-server-show %server_id%
share-server-details %server_id%

Partially implements: blueprint add-share-server-list-api

Change-Id: I2e7722082e6c81db8a0411511b53e64fd8e04e26
2014-05-30 05:17:19 -04:00
vponomaryov
cb24cbafeb Replaced manila.conf.sample with README.manila.conf
DocImpact
Closes-Bug: #1314154
Change-Id: I9ab583f3c3bbe8cf43af2e75a36659519f940186
2014-04-29 15:59:07 +03:00
Yulia Portnova
dd4cbb9096 Added API to manage volume types
Partially-implements bp volume-type-support

Change-Id: I1a58cf82c659b49e5258a563788cb8e5b05bfb8a
2014-04-29 05:12:02 -04:00
Aleks Chirko
90cb627f9e Add share network activate and deactivate
Add activation and deactivation requests
handling into share networks API.

Implements bp: share-network-activation-api

Change-Id: Ifadda82b279de3bcf31967a28bd8356e12c64d63
2014-03-10 10:18:56 +02:00
vponomaryov
3e290e7051 Add handling of share-networks to tempest plugin
After making multitenant generic driver default driver
for devstack, tempest should be able to create share-networks
depending on networks of tenant to be able to create shares.

Change-Id: I43a744eb42442c8d6367d894773adc05a5f3f600
2014-03-10 00:12:52 +02:00
vponomaryov
62767fe047 Update policy.json
Removed restrictions for security-services and
share-networks, because it should be available
for all users.

Change-Id: I4ec3ee40b9afe91ac451e8b0a4136176a7976609
2014-03-09 20:45:24 +02:00