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>
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
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
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
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
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
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
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