summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQiLiang <liangqi1@huawei.com>2016-01-12 20:10:40 +0000
committerqi liang <liangqi1@huawei.com>2016-01-12 12:52:06 +0000
commit10e55c026879912a36247f8958c954cb7521f9e5 (patch)
treea9a1327bd60aa3064476178c2277f74e3f5d52d5
parente749d09788edbd1040dabb082e13bd1a1cbc3a7a (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>
-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 = []