This patch adds a delete cli command to ShareCommands
The helper CLI command checks if service if up. If service
is down, it deletes the share instance
Closes-Bug: #1867030
Change-Id: I6a0575c1ed86213010e50fe1b7a733cdf7fa1736
Some of the cores middleware options should have overridden default
values but the override method was not actually called so the library
defaults are still used.
Closes-Bug: #2051691
Change-Id: I8dac03c787bf729c60c2e0ecc9c03b7ba9a5b5a5
The placeholder was added when the upgrade check framework was
initially added, but it should have been removed when any real check
was added.
Change-Id: Ia3658b925ec9ad7a1f8938bbcc56dc595e427f8f
Manila can now configure a share network with multiple subnets
in an availability zone. Also, it can add a new subnet for an
availability that has share servers, which will triger an update
share server allocations.
Changes:
- API:
- Bump version to 2.70.
- setup share network with multiple subents per az.
- Block manage server with multiple subnets.
- Allow add subnet for in-use share servers.
- `share_network_subnet_id` is dropped from ShareServer view
- `share_network_subnet_ids` is added in ShareServer view
- `network_allocation_update_support` is added to ShareServer and
ShareNetwork views.
- Add a check operation for share network subnet create.
- DB:
- Remove `share_network_subnet_id` from share_servers.
- Create mapping table `share_server_share_network_subnet_mappings`.
- Fix queries with new db design.
- Add migration downgrade and upgrade alembic.
- Add `share_network_subnet_id` to the NetworkAllocations.
- Scheduler:
- Change `AvailabilityZoneFilter` to take in account if the
host supports the allocation required by the setup request.
- Manager:
- Bump RPC API version.
- `_setup_server` allocating multiple subnets.
- Modify signature of driver `_setup_server` interface, passing a
list of `network_info` for each subnet.
- Share server DB creation to inform a list of subnets and
create with `network_allocation_update_support`.
- Implement `check_update_share_server_network_allocations` and
`update_share_server_network_allocations`.
- Drivers:
- For legacy compatibility, all drivers implementing `_setup_server`
consume the first element of the `network_ino`.
- Dummy Driver:
- Implement `_setup_server` with new signature as multiple subnet.
- Modify the `backend_details` to save allocations for all subnets.
- Report update allocation and share server multiple subnet support.
- Implement `check_update_share_server_network_allocations` and
`update_share_server_network_allocations` interfaces.
Signed-off-by: Felipe Rodrigues <felipefuty01@gmail.com>
Co-Authored-By: Andre Beltrami <debeltrami@gmail.com>
Co-Authored-By: Fábio Oliveira <fabioaurelio1269@gmail.com>
Co-Authored-By: Nahim Alves de Souza <nahimsouza@outlook.com>
Co-Authored-By: Caique Mello <caique_mellosbo@hotmail.com>
DocImpact
APIImpact
Partially-Implements: blueprint multiple-share-network-subnets
Change-Id: I7de9de4ae509182e9494bba604979cce03acceec
This patch implements the update of security service's association
with in-use share networks. The following changes were added:
- New share network APIs: `share_network_security_service_update`
and `share_network_reset_state`.
- A new `status` attribute was added to share network model to
identify when it's in a modification state, called 'network_change'.
Other supported status that were added: 'active' and 'error'.
- New 'security_service_update_support' property was added to both
share server and share network models, to identify when this resources
are able to process security service update for in-use share networks.
- New driver interface was added to support update of security service's
configuration of a given share server.
DocImpact
APIImpact
Partially Implements: bp add-security-service-in-use-share-networks
Co-Authored-By: Carlos Eduardo <ces.eduardo98@gmail.com>
Co-Authored-By: Douglas Viroel <viroel@gmail.com>
Co-Authored-By: Andre Beltrami <debeltrami@gmail.com>
Change-Id: I129a794dfd2d179fa2b9a2fed050459d6f00b0de
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:
1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.
2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.
Also convert manila/tests/policy.json to manila/tests/policy.yaml
using oslopolicy-convert-json-to-yaml tool and replace
policy.json to policy.yaml ref from doc and tests.
[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html
Change-Id: I3748313912b2527c43c9b16a6ba3e3ccd4cf5221
We can also condense this code a bit to allow
adding more resources who have a "host" attribute.
Closes-Bug: #1895323
Change-Id: I5b750217e019b7bc5281006f63feba8fa06db534
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
print_function is available from python 3.0.0
with_statement has been available from python 2.6
Change-Id: Idb6dd5bb4f9d57cf544e8e55d173e3c85c9da455
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
Monkey patch the original current_thread to use the up-to-date _active
global variable. This solution is based on that documented at:
https://github.com/eventlet/eventlet/issues/592
Change-Id: Ifc6420d927c0ce9e04ff3b3253e81a474591e9bb
Closes-Bug: #1863021
Fix:
E305 expected 2 blank lines after class or function definition, found 1
Fix also other problems found by hacking in these files.
Change-Id: I880afc40adf974cbb0e60f8dc5931f77d51f451b
Lazy translation of messages is not used in OpenStack [1].
This causes problems for commands which use translatable messages.
The lazy translation effort was abandoned several years ago.
[1] http://lists.openstack.org/pipermail/openstack-dev/2018-November/136289.html
Change-Id: I25a9ec0a96b7c57f8a6928c0537bf133f6b6931c
This adds basic framework for manila-status upgrade
check commands. For now it has only "check_placeholder"
check implemented.
Real checks can be added to this tool in the future.
Change-Id: Id809535d0a01617916a8e29f151ca4e61f738fad
Story: 2003657
Task: 26139
usage: manila-manage share update_host --currenthost CURRENTHOST
--newhost NEWHOST
[--force FORCE]
--currenthost CURRENTHOST Current share host name.
--newhost NEWHOST New share host name.
--force FORCE Ignore validations.
A fully qualified host string is of the format
'HostA@BackendB#PoolC'. The command allows making
substring modifications to update the host or the
host and backend. To avoid making gratuitous changes,
the complete host string must be specified.
Change-Id: I0f30ab6135c8c438860341cc68b512311e9c4711
Remove code which allowed manila-manage to attempt to escalate
privileges so that configuration files can be read by users who
normally wouldn't have access, but do have sudo access.
Change-Id: Ie3bf9a81ee8d723cd8618643fa9d7382462aae42
Closes-Bug:#1611171
Adds a task to manila-scheduler service which periodically (once per day
by default) cleans up expired user messages. In user messages spec I
preferred doing this cleanup by a "manila-manage" command invoked by
user. But because it would mean another task management for admin and
because cinder uses periodic task too, I diverged from the spec.
Change-Id: If0ba2383d4d7eaca4dee8a0d39f39c5481bfbfdd
Partially-Implements: bp user-messages
Oslo_reports enables OpenStack projects to dump Guru Meditation
Reports with useful debugging information to files or stderr.
By default it will genarate report to stdout stream.
To configure GMR you have to add the following section
to manila.conf:
[oslo_reports]
log_dir = '/path/to/logs/dir'
Implements: blueprint guru-meditation-report
Change-Id: Ia730d56374764231e5ec88f0b71ff8e23361fa6a
Change [1] deprecated this command in newton and
promised to remove it in ocata.
[1] I0ac0c699071324b218f63422354a871b7fa3b81e
Depends-On: I3aa1d145d21d587355af538a3569adf0b4ca715f
Change-Id: I589e6c0f2f44f3e5e54ee9d9368dfa2423dec1d3
Manila currently uses file locks from oslo_concurrency to
coordinate operations racing with each other to perform a
particular action. In many situations, deployers may need a
distributed lock to a local file lock (or even a file lock living on
a shared file system). This need is accentuated if they were running
Manila services in HA or if they were using Share Replication across
AZs where manila-share services were running off different controllers
that would not be able to share a common oslo_concurrency
file lock or be protected against service/lock management failures.
Integrate Tooz library with helper methods to create a locking
coordinator and allow deployers to make the choice between file
and distributed locks.
Start the manila share service with Tooz backed coordination.
Replace the locks used for Share Replication work-flows in the
share manager to use Tooz based locks.
Co-Authored-By: Goutham Pacha Ravi <gouthampravi@gmail.com>
Co-Authored-By: Szymon Wroblewski <szymon.wroblewski@intel.com>
Co-Authored-By: Tom Barron <tpb@dyncloud.net>
Related-Bug: #1585241
Partially-implements: bp distributed-locking-with-tooz
Change-Id: I710e86bd42034fa3b93b87ff77fa48ada8661168
Cloud admins delete lots of DB records manually that were
"soft-deleted" in Manila. They do it to reduce size of DB
and increase response speed. Therefore, add "manila-manage
db purge" command that will make cloud admins life easier
allowing them to purge such DB records in one click.
Examples of usage:
$ manila-manage db purge 5
Partially-implements: blueprint clean-deleted-row-in-db
Depends-on: 0ec71e29b2
Change-Id: I4fd83d44f4a1b6b7633a60249ba775f6d86d1cdc
When running pep8 checks, fail if executable
files have accidentally been added.
Co-Authored-By: Eric Harney <eharney@redhat.com>
Closes-Bug: 1566328
Change-Id: I7280c0403cd473cd4b88cfc021d4f605a7bb35f2
/usr/local/bin/manila-all purports to start all the manila
services within a single process. We should deprecate this
command since to do this in production would be a very bad
idea - completely un-"cloudy" - and we don't even do it in
devstack.
Implements blueprint deprecate-manila-all
Change-Id: I0ac0c699071324b218f63422354a871b7fa3b81e
The default values needed for manila's implementation of cors
middleware have been moved from paste.ini into the configuration
hooks provided by oslo.config. Furthermore, these values have been
added to the default initialization procedure. This ensures
that if a value remains unset in the configuration file, it will
fallback to using sane defaults. It also ensures that an operator
modifying the configuration will be presented with that same
set of defaults.
Change-Id: Ie4adc39866a4ee6132eab6a111660218b3e6e5bd
Closes-Bug: #1551836
Added a new service defined as data, whose purpose is to
receive requests, process data operations such as copying,
migration, backup, and send back the response after operation
has been completed.
In this patch the service has no methods, it is empty, the
operation it should perform will be added in subsequent patches.
Implements: blueprint data-copy-service
Change-Id: I31365c8ac4197541af175c82f8f18a3d11740a99
Replacing dict.iteritems()/.itervalues() with
six.iteritems(dict)/six.itervalues(dict) was preferred in the past,
but there was a discussion suggesting to avoid six for this[1].
The overhead of creating a temporary list on Python 2 is negligible.
[1]http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html
Partially-implements blueprint py3-compatibility
Change-Id: Ia2298733188b3d964d43a547504ede2ebeaba9bd
Commands "manila-manage service list" and "manila-manage host list"
were displaying availability zone instance instead of its name.
Such bug appeared after implementation of Availability zone model.
So, fix it by providing 'name' field of availability zone model.
Change-Id: I14c3451380df01853183aed265344b1783c95939
Closes-Bug: #1499677
In manila-manage.rst version is misspelled
it is corrected. In manage.py according to
help option I changed revision to version
Change-Id: Icc83b3dcfc31104a015c9e6929335daed5a8bb8b
Closes-Bug: #1487249
Due to the limit of Python interpreter, API service of Manila can't
really utilize underlying multi-core architecture even libraries
like eventlet has been used. To make API service much more scalable,
we'd adopt multi-process (worker) mode that has been used for long
in Glance/Swift/Nova/Cinder.
The default behavior isn't changed with this patch, Manila API
service will still run in one process (default value of
osapi_volume_workers is None).
Implementation wise, a good portion of manila/service.py has been
removed because those content has been merged in Oslo version of
service module. manila/wsgi.py is also updated to adopt the change
for multiple WSGI servers running in separate processes.
DocImpact: 'New config option osapi_share_workers is used to specify
number of API service workers (OS processes) to launch for Manila
API service. Setting this config option to a proper value (e.g.
osapi_share_workers = # of CPU cores/threads of the machine) can
greatly improve the total throughput of API service [# of API
requests can be handled per second].'
Also removed out-dated comments in manila/cmd/api.py due to the fact
that this bug [1] has been fixed in eventlet 0.9.13
This commit is port from two Cinder changes - [2] and [3].
[1] https://bitbucket.org/eventlet/eventlet/issue/92/eventletgreen-override-of-oswaitpid
[2] I8361d0dc0d43040e48634ff1aee1324e5e0af466
[3] Iab32a3fe230a11692a8cad274304214247d6c2c6
Implement bp: multi-process-api-service
Change-Id: I1cb98c938fd4e1dabe75c78a7ef392d6d7387dab
Sync common code from oslo-incubator. The main reason for it is removal
of usage 'log' module from incubator in manila codebase. Because we already
use another 'log' from library 'oslo_log'.
Head of oslo-incubator code that was used for 'sync' operation was at
following commit:
commit f5646edc61b9653d7ff71ed0177ed77811bbdcd0
Author: Elena Ezhova <eezhova@mirantis.com>
Date: Tue Apr 7 17:46:16 2015 +0300
Additional changes:
- Added explicit registration of 'oslo_log.log' options to all manila scripts
- Module 'manila.openstack.common.log' removed as unused
Change-Id: I5b98d3863329227531fdb94ad7dbf5b3e5c51141
Code from manila/openstack/common/policy.py duplicates code
from oslo_policy, so we remove this module and use oslo_policy instead.
Implements bp use-oslo-policy-lib
Change-Id: I289221a1e96f6c705deef4070be113d69c57f6e0
Manila scripts located in bin/* should be covered with unit tests.
In order to add unit tests for bin/* scripts:
- all
- api
- manage
- scheduler
- share
we move them into manila/cmd and use pbr to setup console scripts
which will call the respective main function of each script under manila/cmd.
It will allow us to import from manila.cmd and individually test each 'main' function.
Add unit tests for manila/cmd/* scripts.
Implements bp unit-tests-for-manila-scripts
Change-Id: I9be6b948a6de7ba76405411e98d7531cf225b57e