cinder/cinder/tests/scheduler
Zhiteng Huang c600446931 Add affinity/anti-affinity filters
Cinder has done a good job hiding the details of storage backends from end
users by using volume types.  However there are use cases where users who
build their application on top of volumes would like to be able to 'choose'
where a volume be created on.  How can Cinder provide such capability without
hurting the simplicity we have been keeping?  Affinity/anti-affinity is one
of the flexibility we can provide without exposing details to backends.

The term affinity/anti-affinity here is to to describe the relationship
between two sets of volumes in terms of location.  To limit the scope, we
describe one volume is affinity with the other one only when they reside in
the same volume back-end (this notion can be extended to volume pools if
volume pool support lands in Cinder); on the contrary, 'anti-affinity'
relation between two sets of volumes simply implies they are on different
Cinder back-ends (pools).

This affinity/anti-affinity filter filters Cinder backend based on hint
specified by end user.  The hint expresses the affinity or anti-affinity
relation between new volumes and existing volume(s).  This allows end
users to provide hints like 'please put this volume to a place that is
different from where Volume-XYZ resides in'.

This change adds two new filters to Cinder - SameBackendFilter and
DifferentBackendFilter.  These two filters will look at the scheduler hint
provided by end users (via scheduler hint extension) and filter backends by
checking the 'host' of old and new volumes see if a backend meets the
requirement (being on the same backend as existing volume or not being on
the same backend(s) as existing volume(s)).

For example:
  Volume A is on 'backend 1', to create Volume B on the same backend as A,
  use:
    cinder create --hint same_host=VolA-UUID SIZE

  To create Volume C on different backend than that of A, use:
    cinder create --hint different_host=VolA-UUID SIZE

  Now, to create Volume D on different backend other than those of A and C,
  use:
    cinder create --hint different_host=VolA-UUID --hint
    different_host=VolC-UUID SIZE
  or:
    cinder create --hint different_host="[VolA-UUID, VolC-UUID]" SIZE

implements bp: affinity-antiaffinity-filter

DocImpact

Change-Id: I19f298bd87b0069c0d1bb133202188d3bf65b770
2014-07-15 17:56:39 +08:00
..
__init__.py Enable flake8 H303,H304 checking 2014-04-15 09:16:01 +00:00
fakes.py Add disabled kwarg to service_get_all_by_topic 2014-04-25 17:03:13 +01:00
test_allocated_capacity_weigher.py Add disabled kwarg to service_get_all_by_topic 2014-04-25 17:03:13 +01:00
test_capacity_weigher.py Add disabled kwarg to service_get_all_by_topic 2014-04-25 17:03:13 +01:00
test_chance_weigher.py Fix and enable gating on F401 2013-12-20 15:01:23 +01:00
test_filter_scheduler.py Add ability to modify volume type 2014-01-06 22:02:09 +02:00
test_host_filters.py Add affinity/anti-affinity filters 2014-07-15 17:56:39 +08:00
test_host_manager.py Add disabled kwarg to service_get_all_by_topic 2014-04-25 17:03:13 +01:00
test_rpcapi.py Port to oslo.messaging 2014-03-10 17:03:03 +01:00
test_scheduler_options.py Enable flake8 F841 checking 2014-04-01 11:38:35 +04:00
test_scheduler.py Drop Chance/SimpleScheduler Implementation 2014-01-09 18:29:27 +08:00
test_volume_number_weigher.py Support Volume Num Weighter 2014-06-26 16:13:18 +08:00