Commit Graph

40 Commits

Author SHA1 Message Date
zhongjun 0b99fdaa9a Implement share backup
Add share backup feature in Data Copy Service and
Share Service. It will allow the user to create, restore
and delete backups as well as listing backups and showing
the details of a specific backup.

APIImpact
DOCImpact

Change-Id: I7d10cf47864cd21932315375d84dc728ff738f23
Implement: blueprint share-backup
2023-08-10 11:11:42 +00:00
Takashi Kajinami 68a5e93ff9 Fix reference to deprecated quota_driver option
The commit 76cfc9405e moved all quota_*
options to the separate quota section but the commit missed one usage
of the old quota_driver option, and the remaining usage causes
the following warning warning to appear repeatedly.

Config option None.quota_driver is deprecated.
Use option quota.driver instead.

This replaces the remaining usage to get rid of that warning.

Related-Bug: #1934025
Closes-Bug: #1983125
Change-Id: Ie49dbe4633a34d1832f0dedb658d83ec74d351df
2022-08-02 09:22:50 +09:00
haixin 7f2b25332a remove usage of six library
remove usage of six library from the following directory:
1:share
2:volume
and some files.

Change-Id: If5bb2976bc54887c74649a00deaeaa71e296aaaa
2022-02-10 02:46:34 +00:00
Takashi Kajinami 76cfc9405e Migrate all quota parameters to [quota] section.
Currently we register all parameters about the quota feature to
[DEFAULT] section. However it is difficult for operators to identity
that some of these parameters like reservation_expire are used in the
quota feature, based of names and descriptions of the parameters.

This change migrates all quota options to the new [quota] section,
so that operators can easily understand which parameters are used
in the quota feature.

Closes-Bug: #1934025
Change-Id: I83b5750da7083718d39efb56262a49dae0a05f48
2021-07-30 08:47:56 +09:00
kpdev 0045293942 Add config option to set per_share_size_limit.
This feature allows admin to set share size limit for a project.
The defaults will either come from the default values
set in the quota configuration option or via manila.conf
if the user has configured default values for quotas there.

The quota_per_share_gigabytes defaults to -1["No Limit"] always
unless changed in manila.conf by admin.

Closes-Bug: #1811943

Change-Id: Ida126c8c419b8bf4d2a194f061a0809d52b47ab8
2021-03-09 11:58:17 +01:00
silvacarloss 413e5e6d08 Fix manila OverQuota issue while managing shares
Fixes the OverQuota issue while managing shares. Now, when a share
manage request is received and there is no available quota to this
resource, manila will allow the quotas to be exceeded and the
administrator will need to adjust it.

Change-Id: If6edfa79965f1a0e6959b436c53a714217d23f7d
Closes-Bug: #1863298
2020-09-18 21:28:11 +00:00
silvacarloss dceced6d6e Add new quota for share replicas
This patch adds new quotas for share replicas and replica sizes.
This quotas can be related to either tenants and users or tenants
and share types. Now, when creating a share replica, manila will
check if there are resources available for that specific request.

Partially-Implements: bp limit-share-replicas-per-share
Change-Id: I8ba7bc6f167c28d6c169b2187d0e1bda7cad3f69
2020-04-06 13:17:30 +00:00
Andreas Jaeger 27808af118 Hacking: Fix E731
Fix:
E731 do not assign a lambda expression, use a def

I just marked the lambdas with noqa.

Fix also other problems found by hacking in files changed.

Change-Id: I4e47670f5a96e61fba617e4cb9478958f7089711
2020-04-01 14:11:10 +02:00
Goutham Pacha Ravi 4b6cfcf690 Destroy type quotas when a share type is deleted
Upon share type deletion, we were leaving behind
share type quotas, usages and reservations. These
couldn't be cleaned up without resorting to manual
intervention.

Cleanup quotas when a share type is being destroyed,
since the resources that they pertained to are gone
too.

Closes-Bug: #1811680
Change-Id: I04b1fe88808596aa8c05429b964190d654587f9a
2019-03-15 00:10:37 -07:00
Valeriy Ponomaryov 256b5c84ba Add share groups and share group snapshots quotas
"Quota" APIs now will return two new following keys:

- 'share_groups'
- 'share_group_snapshots'

For user and project, but not share type.
Default values can be configured using following config options:

- 'quota_share_groups'
- 'quota_share_group_snapshots'

APIImpact
DocImpact
Implements BluePrint add-share-groups-quota
Change-Id: I397a8e886226cb22fa50abdf2a4a938bb04c655d
2017-07-26 11:32:43 +03:00
Valeriy Ponomaryov 05c42ecf70 Add quotas per share type
With this feature it will be possible to set quotas per share type
for all existing quota resources. It is useful for deployments with
multiple backends that are accessible via different share types.

Also, fix one of existing DB migrations that hangs on PostgreSQL.

APIImpact
DocImpact
Implements blueprint support-quotas-per-share-type
Change-Id: I8472418c2eb363cf5a76c672c7fdea72f21e4f63
2017-07-19 17:29:04 +03:00
yfzhao 8dd6cd5850 Remove log translations in others 5/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 5/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: Ifebf6bf1ab8280c3ad3c573ae3772624bf47b461
Depends-On: I9fd264a443c634465b8548067f86ac14c1a51faa
Partial-Bug: #1674542
2017-04-08 02:19:02 +00:00
Tom Patzig 8d3e72f8b2 Update quota of proper user on resource delete
When deleting a resource (share, snapshot, share-network) the quota
usage of the current user gets updated, which might not be the same
user, who created that resource. That means the quota usage will never
be reduced for initial user.
This fix adds the resources user_id to the quota update statements, to
update the quota_usage for the user, that created this resource,
irregardless who deletes it.

Change-Id: Iefe8f4d0e7c526e3ed94c1994ba62f1a2a929ba2
Closes-Bug: #1542598
2016-03-11 12:55:44 +01:00
ting.wang 2bc625399f Using dict.items() is better than six.iteritems(dict)
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
2016-01-19 22:22:48 +08:00
houming-wang 51069d5390 Performance: leverage dict comprehension in PEP-0274
PEP-0274 introduced dict comprehensions to replace dict constructor
with a sequence of length-2 sequences, these are benefits copied
from [1]:
  The dictionary constructor approach has two distinct disadvantages
  from the proposed syntax though.  First, it isn't as legible as a
  dict comprehension.  Second, it forces the programmer to create an
  in-core list object first, which could be expensive.
Manila does not support python 2.6, we can leverage this.
There is deep dive about PEP-0274[2] and basic tests about
performance[3].
Note: This commit doesn't handle dict constructor with kwagrs.
This commit also adds a hacking rule.

[1]http://legacy.python.org/dev/peps/pep-0274/
[2]http://doughellmann.com/2012/11/12/the-performance-impact-of-using
   -dict-instead-of-in-cpython-2-7-2.html
[3]http://paste.openstack.org/show/480757/

Change-Id: I87d26a46ef0d494f92afb1d3bebda2797a12413c
Closes-Bug: #1524771
2015-12-11 19:24:56 -05: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
Valeriy Ponomaryov c0019bce6b Add snapshot gigabytes quota
Manila has used single gigabytes quota for shares and snapshots.
Config opt 'no_snapshot_gb_quota' is set to False by default, that has been
used for enabling/disabling of snapshot gigabytes quota considerations.

Add separate snapshot gigabyte quota and remove opt 'no_snapshot_gb_quota' that
is not needed anymore. To be able to set infinite quota for snapshot gigabytes,
just set value for new config option 'quota_snapshot_gigabytes' to '-1'.

Change-Id: I43cb95ff3d0d3e6191f520b52edb67a0a44e9c2c
Implements BP add-snapshot-gb-quota
2015-02-26 07:42:28 +00:00
Valeriy Ponomaryov 63a0504c21 Use oslo_log lib
Module 'log' from oslo-incubator was removed after release of oslo_log library.
So, start using oslo_log, but keep oslo-incubator code yet other common modules
within Manila codebase use it.

Implements bp use-oslo-log-lib

Change-Id: I88224f7c2bd99adb78140dfc3fa73cea437f29cd
2015-02-08 10:42:40 +00:00
Thomas Bechtold 071d0b59c1 Switch to using oslo_* instead of oslo.*
The oslo team is recommending everyone to switch to the
non-namespaced versions of libraries. Updating the hacking
rule to include a check to prevent oslo.* import from
creeping back in.
oslo.messaging is the only exception because this package doesn't
currently support non-namespaced imports.

Change-Id: I3987e651bc880c8ffa7c0105df0298679dcd3a43
2015-01-27 09:19:50 +01:00
vponomaryov 1bffbf0a7a Increase quotas and number of threads for tempest
Increase quotas for Cinder (Generic driver case) and Manila.
Increase number of threads for tempest run to simulate concurrency and
have test run in shorter time slot.

Change-Id: Ic7473c94eeb2b45533c028352b56e4027cd7eead
2014-12-20 14:23:30 +02:00
Andreas Jaeger 15641fba88 Convert files to use _LE and friends
LOG.warn etc. should be translated separately and thus messages need to
be marked with _LW for LOG.warn, _LI for LOG.info and _LE for LOG.errors
and LOG.exception.

Mark all LOG invocations with proper translation marker.

Use ',' instead of '%' when adding variables to log messages to allow
lazy evaluation.

Add new hacking checks for these.

Change-Id: I31d3ee50f30c63d7d647b1c2b1eae50bf96f0c74
2014-10-31 09:47:59 +01:00
Andreas Jaeger 2ad967a6fd Use oslo.utils
Change usage of modules that are deprecated in oslo-incubator.
Use the corresponding module from oslo.utils.

A followup patch will sync with oslo-incubator and remove the now
obsolete modules.

Change-Id: I4f949de57e333832dcc7c1e256ce82e2db0144cb
Partial-Bug: #1382189
2014-10-21 14:39:48 +02:00
Andreas Jaeger 7b659fc4e0 Use oslo.i18n
oslo.i18n provides the i18n function that were provided by
oslo-incubator's gettextutils module

Import _ where needed, oslo.i18n deprecated the builtin method.

Closes-Bug: #1382187
Change-Id: I12aa1c725aa4bb52a9aa46e9c3d2b303839de48b
2014-10-19 19:21:03 +02:00
Rafael Rivero e08d717b47 Fixes several typos (Manila)
Fixes several docstring typographical errors.

Change-Id: I335a74e9fe7fe03e8c95a66e6e3f63a8329043f7
2014-09-25 12:50:12 -07:00
Your Name ef921f29e2 Increase share-network default quota
Now Manila has too small quota for share networks, that affects gate tests with
exception "ShareNetworksLimitExceeded".

Changes:
- increased quota from 5 to 10;
- updated description of quota with proper info.

Change-Id: I1e3127780785ec689d02a4a0bcce42d903df7d72
Closes-Bug: #1368460
2014-09-12 13:23:22 -04:00
Jenkins 948aa13e7b Merge "Improve help strings" 2014-08-29 06:07:27 +00:00
Andreas Jaeger ab61d9bad4 Improve help strings
Make help strings consistent:
* Add missing spaces between words
* Capitalize first word of help
* Add "." at end of string
* Improve wording and capitalization

This follows the oslo.config style guide:
http://docs.openstack.org/developer/oslo.config/styleguide.html

Change-Id: I8243909249423b6b58ccda0d800856f46b0953c5
2014-08-28 06:56:59 +02:00
Andreas Jaeger 8203c51081 Flake8: Fix and enable H404
Fix and enable flake8 test H404:
H404  multi line docstring should start without a leading new line

Change-Id: I13dc13bb5e81d65300680df094cde538c7a6f6df
Partial-Bug: #1333290
2014-08-27 10:47:45 +00:00
Andreas Jaeger baad6f7894 Further pep8 fixes
Fix the following issues in some files:
F401 'XXX' imported but unused
E123 closing bracket does not match indentation of opening bracket's
line
E126 continuation line over-indented for hanging indent
E128 continuation line under-indented for visual indent
E129 visually indented line with same indent as next logical line
H904  Wrap long lines in parentheses instead of a backslash

Partial-Bug: #1333290
Change-Id: Ic9b3a1e47fd24d2835f35f2ef71c4519908ff049
2014-08-15 15:41:56 +02:00
Valeriy Ponomaryov 8abe92efa9 py3: use six.string_types instead of basestring
six is the canonical compatibility library for supporting Python 2 and 3
in a single codebase.

The basestring was removed in Python 3 and we should use 'six.string_types'
instead of 'basestring' to make code compatible with py 2 and 3 as well.

Partially-implements blueprint py3-compatibility

Change-Id: Idb452afdc2a828089627e14f90c53f3967ceb2ad
2014-07-25 06:02:44 +00:00
Valeriy Ponomaryov ed197a5f10 py33: use six.iteritems for item iterations (part1)
Partially-implements blueprint py3-compatibility

Change-Id: I0c3356cbaefeb77b6543711d79c370b3f1032683
2014-07-07 12:30:30 -04:00
Yulia Portnova 5bff6370b4 Increase default quota for share networks from 3 to 5
Change-Id: I6eaa854249a6b22b9e0161a1e69468d88f755e16
2014-05-13 17:06:33 +03:00
Christian Berendt 79cd06323c debug level logs should not be translated
According to the OpenStack translation policy available at
https://wiki.openstack.org/wiki/LoggingStandards debug messages
should not be translated. Like mentioned in several changes in
Nova by garyk this is to help prioritize log translation.

Change-Id: Idd917acd97481d6b644e307adb002354b37f34a1
2014-05-13 14:13:53 +02:00
vponomaryov 4c6bae0e68 Added quota for share-networks
Partially-implements bp quota-for-share-networks

Change-Id: I4283626c4f25b43ea62514b792cbd14afe133e74
2014-03-25 17:55:58 +02:00
Andrei V. Ostapenko 54ee1b2aaa Added per user-tenant quota support
Added per user-tenant quota support.
Added user-quotas extension, that turns on user quota support if it is
loaded.
Added force parameter, that lets to ignore check if admin want to
force update when run 'manila quota-update'
Added 'extended-quotas' extension that has provides ability for admins
to be able to delete a non-default quota (absolute limit) for a
tenant, so that tenant's quota will revert back to the configured default,
and makes the force parameter always be passed if the client wants
to set the new quota lower than what is already used and reserved.
Added user quota support to db.api, sqlalchemy.api, sqlalchemy.models.
Added migrations for user quota support.

Implement bp: user-quota-support

Change-Id: Ifb8f8a041c2fa54e2ed3a8219e87607b161438ca
2013-10-16 14:14:02 +03:00
Andrei V. Ostapenko 3f24fee218 Removing deprecated using of flags module from project
Moving file flags.py to manila/common/config.py,
replacing FLAGS by CONF. Rename modules fake_flags to conf_fixture,
test_flags to test_conf, declare_flags to declare_conf,
runtime_flags to runtime_conf like it was done in cinder, nova, glance etc.

Implement bp: use-oslo-conf

Change-Id: I38d869123e5e706d3b06f1844b97ead05e22668f
2013-10-07 13:17:27 +03:00
Yulia Portnova d20f8e92ab quotas for snapshot 2013-09-16 16:13:44 +03:00
Yulia Portnova 4f5dde7db5 Fixed flake8 errors 2013-09-11 12:34:25 +03:00
Yulia Portnova 68c71d8de2 Quotas fixed.
quotas unittests fixed.
2013-09-09 15:04:15 +03:00
Yulia Portnova dc4ce932ed Renamed cinder to manila.
Fixed setup.py, fixed bin scripts.
2013-09-02 09:59:07 +03:00