From 2c50abe05af33d7150cbeec40bcdf31a626c0844 Mon Sep 17 00:00:00 2001 From: Brian Elliott Date: Fri, 28 Sep 2012 02:54:51 +0000 Subject: Max I/O ops per host scheduler filter Provide ability to filter hosts based on the number of concurrent build, resize, and image snapshot operations in progress. FLAGS.max_io_ops_per_host is used to control the number of concurrent permitted operations. Change-Id: I77feca00a6b6b248de8423cef7fb8da2cf704930 --- nova/tests/scheduler/test_host_filters.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'nova/tests') diff --git a/nova/tests/scheduler/test_host_filters.py b/nova/tests/scheduler/test_host_filters.py index 42d43a197..b1e1ec897 100644 --- a/nova/tests/scheduler/test_host_filters.py +++ b/nova/tests/scheduler/test_host_filters.py @@ -1278,3 +1278,19 @@ class HostFiltersTestCase(test.TestCase): retry = dict(num_attempts=1, hosts=['host3', 'host1']) filter_properties = dict(retry=retry) self.assertFalse(filt_cls.host_passes(host, filter_properties)) + + def test_filter_num_iops_passes(self): + self.flags(max_io_ops_per_host=8) + filt_cls = self.class_map['IoOpsFilter']() + host = fakes.FakeHostState('host1', 'compute', + {'num_io_ops': 7}) + filter_properties = {} + self.assertTrue(filt_cls.host_passes(host, filter_properties)) + + def test_filter_num_iops_fails(self): + self.flags(max_io_ops_per_host=8) + filt_cls = self.class_map['IoOpsFilter']() + host = fakes.FakeHostState('host1', 'compute', + {'num_io_ops': 8}) + filter_properties = {} + self.assertFalse(filt_cls.host_passes(host, filter_properties)) -- cgit