diff options
4 files changed, 47 insertions, 16 deletions
diff --git a/ansible/roles/configure_rabbitmq/tasks/main.yml b/ansible/roles/configure_rabbitmq/tasks/main.yml index 3ad60c1ea..4ff4222dc 100644 --- a/ansible/roles/configure_rabbitmq/tasks/main.yml +++ b/ansible/roles/configure_rabbitmq/tasks/main.yml @@ -12,6 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. --- +- name: Create rabbitmq configuration + template: + src: rabbitmq.config.j2 + dest: /etc/rabbitmq/rabbitmq.config + +- name: Define user definitions file + template: + src: user_definitions.json.j2 + dest: /etc/rabbitmq/definitions.json + - name: Restart rabbitmq service: name: rabbitmq-server @@ -20,11 +30,5 @@ - name: rabbitmqctl start_app shell: rabbitmqctl start_app -- name: Configure rabbitmq - rabbitmq_user: - user: yardstick - password: yardstick - configure_priv: .* - read_priv: .* - write_priv: .* - state: present +- name: Enable management plugin + shell: rabbitmq-plugins enable rabbitmq_management diff --git a/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 b/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 new file mode 100644 index 000000000..8f07edf5c --- /dev/null +++ b/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 @@ -0,0 +1,5 @@ + [
+ {rabbitmq_management, [
+ {load_definitions, "/etc/rabbitmq/definitions.json"}
+ ]}
+].
\ No newline at end of file diff --git a/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 b/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 new file mode 100644 index 000000000..831675ff1 --- /dev/null +++ b/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 @@ -0,0 +1,23 @@ + {
+ "users": [{
+ "name": "yardstick",
+ "password_hash": "{{ }}",
+ "hashing_algorithm": "rabbit_password_hashing_sha256",
+ "tags": ""
+ }],
+ "vhosts": [{
+ "name": "/"
+ }],
+ "permissions": [{
+ "user": "yardstick",
+ "vhost": "/",
+ "configure": ".*",
+ "write": ".*",
+ "read": ".*"
+ }],
+ "parameters": [],
+ "policies": [],
+ "queues": [],
+ "exchanges": [],
+ "bindings": []
+}
diff --git a/yardstick/benchmark/contexts/standalone/ovs_dpdk.py b/yardstick/benchmark/contexts/standalone/ovs_dpdk.py index 73311f0c2..3ad1097b0 100644 --- a/yardstick/benchmark/contexts/standalone/ovs_dpdk.py +++ b/yardstick/benchmark/contexts/standalone/ovs_dpdk.py @@ -46,7 +46,8 @@ class OvsDpdkContext(base.Context): '2.7.0': '16.11.1', '2.7.1': '16.11.2', '2.7.2': '16.11.3', - '2.8.0': '17.05.2' + '2.8.0': '17.05.2', + '2.8.1': '17.05.2' } DEFAULT_OVS = '2.6.0' @@ -166,8 +167,7 @@ class OvsDpdkContext(base.Context): version = self.ovs_properties.get('version', {}) ovs_ver = [int(x) for x in version.get('ovs', self.DEFAULT_OVS).split('.')] ovs_add_port = ('ovs-vsctl add-port {br} {port} -- ' - 'set Interface {port} type={type_}{dpdk_args}') - ovs_add_queue = 'ovs-vsctl set Interface {port} options:n_rxq={queue}' + 'set Interface {port} type={type_}{dpdk_args}{dpdk_rxq}') chmod_vpath = 'chmod 0777 {0}/var/run/openvswitch/dpdkvhostuser*' cmd_list = [ @@ -176,6 +176,8 @@ class OvsDpdkContext(base.Context): 'ovs-vsctl add-br {0} -- set bridge {0} datapath_type=netdev'. format(MAIN_BRIDGE) ] + dpdk_rxq = " options:n_rxq={queue}".format( + queue=self.ovs_properties.get("queues", 1)) ordered_network = collections.OrderedDict(self.networks) for index, vnf in enumerate(ordered_network.values()): @@ -183,10 +185,7 @@ class OvsDpdkContext(base.Context): dpdk_args = " options:dpdk-devargs=%s" % vnf.get("phy_port") dpdk_list.append(ovs_add_port.format( br=MAIN_BRIDGE, port='dpdk%s' % vnf.get("port_num", 0), - type_='dpdk', dpdk_args=dpdk_args)) - dpdk_list.append(ovs_add_queue.format( - port='dpdk%s' % vnf.get("port_num", 0), - queue=self.ovs_properties.get("queues", 1))) + type_='dpdk', dpdk_args=dpdk_args, dpdk_rxq=dpdk_rxq)) # Sorting the array to make sure we execute dpdk0... in the order list.sort(dpdk_list) @@ -196,7 +195,7 @@ class OvsDpdkContext(base.Context): for index, _ in enumerate(ordered_network): cmd_list.append(ovs_add_port.format( br=MAIN_BRIDGE, port='dpdkvhostuser%s' % index, - type_='dpdkvhostuser', dpdk_args="")) + type_='dpdkvhostuser', dpdk_args="", dpdk_rxq="")) ovs_flow = ("ovs-ofctl add-flow {0} in_port=%s,action=output:%s". format(MAIN_BRIDGE)) |