Commit Graph

10 Commits

Author SHA1 Message Date
Erlon R. Cruz f33b234aa0 Make scheduler check online_extend_support capability
Since Pike release, Cinder supports volume online extending, and by
default it assumes that every backend supports this feature. This
assumption causes a bug on those backends that don't support it. On
such backends, an online extending attempt leaves the volume in
error_extending state.

This patch allows a backend to report to the scheduler if it does not
support online extending. This way, an online extending attempt will
fail, without leaving the volume in error_extending state.

Closes-bug: #1765182
Change-Id: I2c31b5c171574074a8fc7ba86f94f983fc9658f7
Co-Authored-By: Lucio Seki <luciomitsuru.seki@fit-tecnologia.org.br>
2018-06-26 14:42:34 -03:00
Ngo Quoc Cuong 8ca93ac3f7 Enable H904 check
H904  String interpolation should be delayed to be handled by the
logging code, rather than being done at the point of the logging call.
Use ',' instead of '%'.

See: https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html#adding-variables-to-log-messages

Change-Id: Ib5781b837ba60028dce6dddd5b198647e002c8f1
2017-07-05 21:27:05 -04:00
Gorka Eguileor 41bbdbc8a9 Cosmetic changes to scheduler
Now that we have clustered services it is no longer correct to refer to
"hosts" in the scheduler, as we may be referring to a cluster sometimes.

This patch changes those cases where "host" is no longer appropriate
(ie: `find_retype_host`) and uses the more generic name "backend" (ie:
`find_retype_backend`).

Specs: https://review.openstack.org/327283
Implements: blueprint cinder-volume-active-active-support
Change-Id: I6edbdaf5f38841c7e801b5f3fc0cab3e8ef44a20
2016-12-14 17:48:53 +01:00
Eric Harney 9abeca399e Fix volume creation with no volume type
Allow creation of volumes with no volume type.  This
has always been supported but was accidentally broken
with recent changes.

If a type is not specified, the capabilities filter can
skip processing type-related checks.

This reverts most of 8a594c8 "Fix NoneType Attribute Error"

Closes-Bug: #1610073
Co-Author: Tom Barron <tbarron@redhat.com>
Change-Id: I7cb8435af379099c60f0f84d7bad4a6660d2d636
2016-08-10 13:40:27 -04:00
xiexs d899d88eca Remove six.iter*
As mentioned in [1], we should avoid using
six.iteritems/six.iterkeys to achieve iterators.
Let's use dict.items/dict.keys instead, as
it should return iterators in PY3 as well.
(As for PY2, the performance about list should
be negligible)

[1] https://wiki.openstack.org/wiki/Python3

Change-Id: Ia9659075a206b3b4d3a0dc7eb3b006b7b43f8f4d
2016-06-28 23:23:10 -04:00
Clinton Knight db0cba28be Capability lists in Cinder scheduler
Some volume drivers would like to report pool capabilities such as
'compression': [True, False] to denote a pool which can simultaneously
handle volumes with compression enabled and others with compression
disabled. This commit enhances the CapabilitiesFilter to handle this
use case. An extra spec value will be compared to a capability list
and will be passed by the filter if it matches anything in the list.

This feature shipped in Manila during Mitaka, and this commit is
line-for-line identical to that one. 100% unit test coverage is
included.

Change-Id: I0d70360c5c3e7824d226de3b2eb5cfdfb94621c2
Implements: blueprint support-scheduler-capability-lists
2016-06-23 00:46:16 +00:00
Cao ShuFeng dae983163a Support None value of extra_specs in cinder-scheduler filter
Now cinder backends hava capabilities of None value.
Cinder-api also allow user to set volume type's extra_specs to None
value. However we cann't use these capabilities in cinder scheduler
filter.
This change supports None value of extra_specs in cinder-scheduler
filter.

Further more, Our VolumeType object don't allow none value of
extra_specs and this causs failure when trying to create a
volume from such volume type. This commit also changes that
field type to DictOfNullableStringsField which allows it.

Also object backporting procedure is added to make sure that before
sending data to older services we're switching None to empty string.
(PS: if older service use functions like volume.refersh to read
None value of extra_spec from db itself, it will hit bug #1588798
anyway.)

Co-Authored-By: Michal Dulko <michal.dulko@intel.com>

Change-Id: I301adc5980dbacec5e84de7c66e6d12d132643cd
Closes-bug: #1588798
2016-06-16 07:46:25 -04:00
Xi Yang d0676023e8 Replace logging with oslo_log
Some modules are still using logging, this
patch is going to replace it.

Change-Id: Id79913376b946f4aff1be6a24b7c95dc21fc28cf
2016-03-07 09:43:37 +08:00
Eric Harney d36762fcf9 Improve logging to debug invalid "extra_specs" entries
When volume creation fails due to invalid extra_specs entry,
it's hard to find a mismatch between extra_specs and capabilities
exposed by multiple hosts. This additional log printing will
help to detect a root cause of the failure.

See-Also: Ibca56c8ad4cc473ad35f1c79e9892acbf08bf5f1
Co-Authored-By: Sergey Gotliv <sgotliv@redhat.com>
Change-Id: I921a8df18684221c424570882e7b932fc648acb1
2016-02-08 10:16:11 -05:00
Michał Dulko fab6b4ef58 Move oslo-incubator's scheduler module to cinder
oslo-incubator is ending its life and we should move remaining
dependencies from there to cinder namespace. This commit does so with
openstack.common.scheduler. Apart from that tests from oslo-incubator
repository are added.

Change-Id: I10d88c120c9c847826986483065f5493e91f89d6
Closes-Bug: 1519337
2015-11-24 15:49:31 +01:00