From 47c67d55989c53aaff1f1a13be65fe8a84247961 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Mon, 7 Sep 2015 13:42:19 +0200 Subject: [PATCH] openstack: throttle job scheduling by default When running a suite with 50 jobs, it will schedule about 100 instance creation within less than a minute. It is likely to exceed the API quotas of the OpenStack provider (number of instance creation per minute) and lead to instance creation failures. Set the teuthology-suite to be called with --throttle 15 by default, that is about 60 / 15 = 4 * 2 = ~8 server creation per minute. http://tracker.ceph.com/issues/12977 Fixes: #12977 Signed-off-by: Loic Dachary --- scripts/openstack.py | 9 +++++++++ teuthology/openstack/test/test_openstack.py | 1 + 2 files changed, 10 insertions(+) diff --git a/scripts/openstack.py b/scripts/openstack.py index 4038efd2d9..e0b9e049b2 100644 --- a/scripts/openstack.py +++ b/scripts/openstack.py @@ -157,5 +157,14 @@ and analyze results. 'the keywords in the comma separated keyword ' 'string specified. ') ) + parser.add_argument( + '--throttle', + help=('When scheduling, wait SLEEP seconds between jobs. ' + 'Useful to avoid bursts that may be too hard on ' + 'the underlying infrastructure or exceed OpenStack API ' + 'limits (server creation per minute for instance).'), + type=int, + default=15, + ) return parser.parse_args(argv) diff --git a/teuthology/openstack/test/test_openstack.py b/teuthology/openstack/test/test_openstack.py index 9d8dcc6d7a..20f2cd3c36 100644 --- a/teuthology/openstack/test/test_openstack.py +++ b/teuthology/openstack/test/test_openstack.py @@ -93,6 +93,7 @@ openstack keypair delete {key_name} || true '--timeout', '234', '--filter', 'trasher', '--filter-out', 'erasure-code', + '--throttle', '3', ] argv = (self.options + ['--upload', -- 2.39.5