2 ##############################################################################
3 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
11 - name: get nova-compute host
13 source /etc/yardstick/openstack.creds;
14 openstack availability zone list --long | grep nova-compute | sort | awk '{print $7}';
17 register: compute_nodes
19 - name: get existing flavor list
21 source /etc/yardstick/openstack.creds;
22 openstack flavor list | grep "True" | cut -f 2 -d ' ';
27 - name: create pinned-cpu and regular host aggregate
29 source /etc/yardstick/openstack.creds;
30 openstack aggregate create pinned-cpu;
31 openstack aggregate create regular;
32 nova aggregate-set-metadata pinned-cpu pinned=true;
33 nova aggregate-set-metadata regular pinned=false;
34 nova aggregate-add-host pinned-cpu {{ compute_nodes.stdout_lines[0] }};
35 nova aggregate-add-host regular {{ compute_nodes.stdout_lines[1] }};
39 - name: set flavor default property
41 source /etc/yardstick/openstack.creds;
42 openstack flavor set --property aggregate_instance_extra_specs:pinned=false {{item}};
46 - '{{ flavors.stdout_lines }}'
48 - name: create flavor yardstick-pinned-flavor
52 name: yardstick-pinned-flavor
57 - name: set yardstick-pinned-flavor property
59 source /etc/yardstick/openstack.creds;
60 openstack flavor set --property hw:cpu_policy=dedicated yardstick-pinned-flavor;
61 openstack flavor set --property hw:numa_nodes=1 yardstick-pinned-flavor
62 openstack flavor set --property aggregate_instance_extra_specs:pinned=true yardstick-pinned-flavor;