Commit Graph

9 Commits

Author SHA1 Message Date
Ivan Kolodyazhny ac2f6391e2 Remove exception.Error class
CinderException can be used as a low-level exception so we don't need to
introduce one more wrapper for Exception.

TSM backup driver modified without testing. Removed code was broken
because it tried to use not existing Exception class attributes.

Change-Id: Ie67d919f8f59572268f1f07946fb2d2f14a851f1
2020-07-21 18:21:21 +03:00
Michael Still 861646d1ba Implement privsep boilerplate in cinder.
This includes implementing a first trivial example of how to use
privsep to run something as root, specifically the cgroup throttling
driver.

This code is modelled strongly on how nova has chosen to use privsep.
Consistency is probably good here, but it does imply that the cinder
team is ok with the decisons nova has made about implementation.

Change-Id: Ic401138a10a72cb4b976a1a6aba272cafcb40d8b
2018-06-06 09:42:54 +08:00
Sean McGinnis a55a6b5c71 Remove log translations
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.

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: I4c96f3590d46205c45d12ee4ead8c208e11c52c5
2017-03-19 14:59:57 +00:00
Victor Stinner 2e20e70e14 Fix volume throttling to Python 3
BlkioCgroup._set_limits(): sort devices before iterating on them to
have a reliable behaviour.

The devs variable is a dictionary. On Python 3, the hash function is
now randomized, so iterating on a dictionary gives items in a random
order. Use sorted() to iterate on the list of sorted devices instead.

tox.ini: add cinder.tests.unit.test_volume_throttling to Python 3.

Blueprint cinder-python3
Partial-Bug: #1348818
Change-Id: Icf7141f772397c7ac08f0f1e21ad74cb86a06351
2015-10-02 07:01:03 +00:00
Cindy Pallares cafb5d449f Fix multi-line docstrings to meet hacking rules
According to the PEP8(H405), multi-line docstring summaries
should be separated by an empty line.

Change-Id: I5cd8a9064dcefc504e85946ecdf1f56f10145d35
Closes-bug: #1407162
2015-07-30 11:34:16 -05:00
Victor Stinner 3fabed9d64 Replace dit.itervalues() with dict.values()
This change adds Python 3 compatibility to the modified code.

The itervalues() method of Python 2 dictionaries was renamed to values() on
Python 3. As discussed on the openstack-dev mailing list, itervalues() must be
replaced with values(), six.itervalues() should not be used. In OpenStack, the
overhead of creating a temporary list with dict.values() on Python 2 is
negligible.

Blueprint cinder-python3

Change-Id: Ibcf4597aeef1835f08bee2d6831205c428884c31
2015-06-12 15:21:09 +02:00
Sean McGinnis adfff0b141 Remove use of deprecated LOG.warn
LOG.warn is deprecated and LOG.warning should be used.

This patch fixes up instances of LOG.warn usage and adds a
hacking check to make sure it doesn't creep back in.

See Logger.warning note here for background:
https://docs.python.org/3/library/logging.html

Also cleaned up some remaining instances where logging was
preformatting strings rather than passing in formatting
arguments to the logger to handle.

Change-Id: Id2e6cba489d8509601820b5aed83652f71be2bdc
2015-05-13 10:51:45 -05:00
Ivan Kolodyazhny 5980da5d88 Use oslo.log instead of oslo-incubator
log module was removed from oslo-incubator after oslo.log released.

Change-Id: I205d0625c502cb462919edc76d12091edcc21b1b
Implements: blueprint port-oslo-incubator-to-oslo-log
Partial-Bug: #1381563
2015-03-11 21:45:04 -05:00
Tomoki Sekiyama ccd7463ef6 Limit volume copy bandwidth per backend
Currently, by setting volume_copy_bps_limit in cinder.conf,
volume/image copy can be throttled to mitigate slow down of
instances' volume access during the copy. However, this is a global
setting and applied to all the backends.
This change enables admins to configure volume_copy_bps_limit to
different values among backends by specifying it in each backend
section.

In addition, with this change, the bps limit will be divided when
multiple volume copy operations run concurrently on the same backend.
For example, if volume_copy_bps_limit is set to 100MB/s, and 2 copies
are running on a backend, each copy can use up to 50MB/s.
This behavior will be useful for QoS which ensures a certain amount
of bandwidth is kept for instances' volume access.

This introduces Throttle classes to count volume copies in a backend
and setup bandwidth limit.

Change-Id: Ie390b46538556fa704b06ffc79cd6cc000bd5936
Implents: blueprint limit-volume-copy-bps-per-backend
2015-02-23 16:30:20 -05:00