From 825bd7d9e13ccbdf552e3bb01718d043d83487c6 Mon Sep 17 00:00:00 2001 From: Janki Chhatbar Date: Fri, 5 Jan 2018 12:35:52 +0530 Subject: [PATCH] Configure qemu group setting as hugetlbfs for ovs-dpdk Till now, the ovs service file and ovs-ctl command files are patched to allow ovs to run with qemu group. In order to remove this workarounds, a new group hugetlbfs is created which will be shared between ovs and qemu. This patch contains the changes required for applying these changes. Vhostuser Socket Directory is changed from "/var/run/openvswitch" to "/var/lib/vhost_sockets" to avoid modifying the directory access by packaged scripts. Depends-On: I5fc2f852c66c2b825af96aba2657d0f9085dc8c3 Patch-url: https://review.openstack.org/#/c/547961/ Change-Id: Id727a514610816c8223aa0dcd49a70caec29a21d --- ...issions.yaml => ovs-dpdk-permissions.yaml} | 3 ++- puppet/services/neutron-ovs-dpdk-agent.yaml | 12 ++++----- puppet/services/opendaylight-ovs.yaml | 27 ++++++++++++++++++- ...ovs-dpdk-permissions-50c5b33334ff4711.yaml | 9 +++++++ 4 files changed, 43 insertions(+), 8 deletions(-) rename environments/{neutron-ovs-dpdk-permissions.yaml => ovs-dpdk-permissions.yaml} (91%) create mode 100644 releasenotes/notes/ovs-dpdk-permissions-50c5b33334ff4711.yaml diff --git a/environments/neutron-ovs-dpdk-permissions.yaml b/environments/ovs-dpdk-permissions.yaml similarity index 91% rename from environments/neutron-ovs-dpdk-permissions.yaml rename to environments/ovs-dpdk-permissions.yaml index 168a1415b3..698a4ec26a 100644 --- a/environments/neutron-ovs-dpdk-permissions.yaml +++ b/environments/ovs-dpdk-permissions.yaml @@ -11,5 +11,6 @@ # updates and upgrades. parameter_defaults: - NeutronVhostuserSocketGroup: "hugetlbfs" + ComputeOvsDpdkParameters: + VhostuserSocketGroup: "hugetlbfs" diff --git a/puppet/services/neutron-ovs-dpdk-agent.yaml b/puppet/services/neutron-ovs-dpdk-agent.yaml index d5ec16566a..eb27c00821 100644 --- a/puppet/services/neutron-ovs-dpdk-agent.yaml +++ b/puppet/services/neutron-ovs-dpdk-agent.yaml @@ -45,7 +45,7 @@ parameters: type: string tags: - role_specific - NeutronVhostuserSocketGroup: + VhostuserSocketGroup: default: "qemu" description: > The vhost-user socket directory group name. @@ -54,7 +54,7 @@ parameters: type: string tags: - role_specific - NeutronVhostuserSocketUser: + VhostuserSocketUser: default: "qemu" description: > The vhost-user socket directory user name. @@ -87,14 +87,14 @@ resources: - map_replace: - neutron::agents::ml2::ovs::datapath_type: NeutronDatapathType neutron::agents::ml2::ovs::vhostuser_socket_dir: NeutronVhostuserSocketDir - vhostuser_socket_group: NeutronVhostuserSocketGroup - vhostuser_socket_user: NeutronVhostuserSocketUser + vhostuser_socket_group: VhostuserSocketGroup + vhostuser_socket_user: VhostuserSocketUser - values: {get_param: [RoleParameters]} - values: NeutronDatapathType: {get_param: NeutronDatapathType} NeutronVhostuserSocketDir: {get_param: NeutronVhostuserSocketDir} - NeutronVhostuserSocketGroup: {get_param: NeutronVhostuserSocketGroup} - NeutronVhostuserSocketUser: {get_param: NeutronVhostuserSocketUser} + VhostuserSocketGroup: {get_param: VhostuserSocketGroup} + VhostuserSocketUser: {get_param: VhostuserSocketUser} Ovs: type: ./openvswitch.yaml diff --git a/puppet/services/opendaylight-ovs.yaml b/puppet/services/opendaylight-ovs.yaml index 36a40dfb82..330f936b28 100644 --- a/puppet/services/opendaylight-ovs.yaml +++ b/puppet/services/opendaylight-ovs.yaml @@ -62,7 +62,7 @@ parameters: VhostuserSocketDir: description: Specify the directory to use for vhostuser sockets type: string - default: "/var/run/openvswitch" + default: "/var/lib/vhost_sockets" tags: - role_specific EndpointMap: @@ -114,6 +114,24 @@ parameters: - allowed_values: - 1 - 2 + VhostuserSocketGroup: + default: "qemu" + description: > + The vhost-user socket directory group name. + Defaults to 'qemu'. When vhostuser mode is 'dpdkvhostuserclient' + (which is the default mode), the vhost socket is created by qemu. + type: string + tags: + - role_specific + VhostuserSocketUser: + default: "qemu" + description: > + The vhost-user socket directory user name. + Defaults to 'qemu'. When vhostuser mode is 'dpdkvhostuserclient' + (which is the default mode), the vhost socket is created by qemu. + type: string + tags: + - role_specific parameter_groups: - label: deprecated @@ -162,6 +180,8 @@ resources: neutron::plugins::ovs::opendaylight::provider_mappings: OpenDaylightProviderMappings neutron::plugins::ovs::opendaylight::enable_hw_offload: OvsHwOffload vswitch::ovs::enable_hw_offload: OvsHwOffload + tripleo::profile::base::neutron::plugins::ovs::opendaylight::vhostuser_socket_group: VhostuserSocketGroup + tripleo::profile::base::neutron::plugins::ovs::opendaylight::vhostuser_socket_user: VhostuserSocketUser - values: {get_param: [RoleParameters]} - values: HostAllowedNetworkTypes: {get_param: HostAllowedNetworkTypes} @@ -170,6 +190,8 @@ resources: OvsVhostuserMode: {get_param: OvsVhostuserMode} OpenDaylightProviderMappings: {get_param: OpenDaylightProviderMappings} OvsHwOffload: {get_param: OvsHwOffload} + VhostuserSocketGroup: {get_param: VhostuserSocketGroup} + VhostuserSocketUser: {get_param: VhostuserSocketUser} outputs: role_data: @@ -222,6 +244,9 @@ outputs: - {} - get_attr: [Ovs, role_data, config_settings] - get_attr: [RoleParametersValue, value] + service_config_settings: + nova_libvirt: + nova::compute::libvirt::qemu::group: {get_attr: [RoleParametersValue, value, 'tripleo::profile::base::neutron::plugins::ovs::opendaylight::vhostuser_socket_group']} step_config: | include tripleo::profile::base::neutron::plugins::ovs::opendaylight upgrade_tasks: diff --git a/releasenotes/notes/ovs-dpdk-permissions-50c5b33334ff4711.yaml b/releasenotes/notes/ovs-dpdk-permissions-50c5b33334ff4711.yaml new file mode 100644 index 0000000000..03b381cbcb --- /dev/null +++ b/releasenotes/notes/ovs-dpdk-permissions-50c5b33334ff4711.yaml @@ -0,0 +1,9 @@ +--- +features: + - Till now, the ovs service file and ovs-ctl command files are patched + to allow ovs to run with qemu group. In order to remove this + workarounds, a new group hugetlbfs is created which will be shared + between ovs and qemu. Vhostuser Socket Directory is changed from + "/var/run/openvswitch" to "/var/lib/vhost_sockets" to avoid modifying + the directory access by packaged scripts. Use env file + ovs-dpdk-permissions.yaml while deploying. \ No newline at end of file