aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQiLiang <liangqi1@huawei.com>2016-01-12 20:10:40 +0000
committerqi liang <liangqi1@huawei.com>2016-01-12 13:21:46 +0000
commit8bb02c59547badff1a7a2e2ab4a9f3622a0134d1 (patch)
treea12eb8a97cf802c459fb7a6b21b4a33947b59454
parentfe6060a3c1305a23bee5e52a6c28b308ff2bfb22 (diff)
Workround for openstack nova bug
Notes: if placement_groups policy is "availability" and > 2 servers in this group may still have this issue. JIRA: YARDSTICK-200 Signed-off-by: QiLiang <liangqi1@huawei.com> (cherry picked from commit 10e55c026879912a36247f8958c954cb7521f9e5) Change-Id: I4b56ea63fc1adae6985c0d5101359299839cd86c
-rw-r--r--yardstick/benchmark/contexts/heat.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py
index 7bd430bc5..8c514d250 100644
--- a/yardstick/benchmark/contexts/heat.py
+++ b/yardstick/benchmark/contexts/heat.py
@@ -129,8 +129,27 @@ class HeatContext(Context):
scheduler_hints = {}
for pg in server.placement_groups:
update_scheduler_hints(scheduler_hints, added_servers, pg)
- server.add_to_template(template, self.networks, scheduler_hints)
- added_servers.append(server.stack_name)
+ # workround for openstack nova bug, check JIRA: YARDSTICK-200
+ # for details
+ if len(availability_servers) == 2:
+ if len(scheduler_hints["different_host"]) == 0:
+ scheduler_hints.pop("different_host", None)
+ server.add_to_template(template,
+ self.networks,
+ scheduler_hints)
+ added_servers.append(server.stack_name)
+ else:
+ scheduler_hints["different_host"] = \
+ scheduler_hints["different_host"][0]
+ server.add_to_template(template,
+ self.networks,
+ scheduler_hints)
+ added_servers.append(server.stack_name)
+ else:
+ server.add_to_template(template,
+ self.networks,
+ scheduler_hints)
+ added_servers.append(server.stack_name)
# create list of servers with affinity policy
affinity_servers = []