summaryrefslogtreecommitdiffstats
path: root/yardstick/orchestrator
diff options
context:
space:
mode:
authorrexlee8776 <limingjiang@huawei.com>2017-02-14 02:53:25 +0000
committerrexlee8776 <limingjiang@huawei.com>2017-02-26 16:32:42 +0000
commite05cd29cc62e52e8e78e949ab66c82e38e303ca8 (patch)
tree6ba3daaa77042058eea85ab215d365d8b62d17c2 /yardstick/orchestrator
parent8fdfd0f7ae809966e946b9425838e5c2c2fad215 (diff)
heat context support affinity and anti-affinity
JIRA: YARDSTICK-566 Current Heat context support affinity and availability arguments but not support affinity and anti-affinity. Enhance Heat context to support affinity and anti-affinity: 1. can create heat server group with affinity/anti-affinity 2. each server could be specified which server group they are in Change-Id: I46e7376fd116c6e109cb5dcb1c168460918e6d43 Signed-off-by: rexlee8776 <limingjiang@huawei.com>
Diffstat (limited to 'yardstick/orchestrator')
-rw-r--r--yardstick/orchestrator/heat.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/yardstick/orchestrator/heat.py b/yardstick/orchestrator/heat.py
index e39c4356c..500776e0e 100644
--- a/yardstick/orchestrator/heat.py
+++ b/yardstick/orchestrator/heat.py
@@ -197,6 +197,16 @@ class HeatTemplate(HeatObject):
'properties': {'name': name}
}
+ def add_server_group(self, name, policies): # pragma: no cover
+ """add to the template a ServerGroup"""
+ log.debug("adding Nova::ServerGroup '%s'", name)
+ policies = policies if isinstance(policies, list) else [policies]
+ self.resources[name] = {
+ 'type': 'OS::Nova::ServerGroup',
+ 'properties': {'name': name,
+ 'policies': policies}
+ }
+
def add_subnet(self, name, network, cidr):
"""add to the template a Neutron Subnet"""
log.debug("adding Neutron::Subnet '%s' in network '%s', cidr '%s'",