From 785d1b2b38805e35bf344792342b255aedfa3549 Mon Sep 17 00:00:00 2001 From: Saravanan KR Date: Wed, 29 Nov 2017 17:44:39 +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. Depends-On: I674cbd45e17906448dd54acfdf7a7059880b7278 Change-Id: Iec6be0b99e84b0c89f791c3c9694fe10f3a1e7db --- .../neutron-ovs-dpdk-permissions.yaml | 15 +++++++ .../pre_network/host_config_and_reboot.yaml | 42 ++++++++++++++++++- puppet/services/neutron-ovs-dpdk-agent.yaml | 25 +++++++++++ 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 environments/neutron-ovs-dpdk-permissions.yaml diff --git a/environments/neutron-ovs-dpdk-permissions.yaml b/environments/neutron-ovs-dpdk-permissions.yaml new file mode 100644 index 0000000000..168a1415b3 --- /dev/null +++ b/environments/neutron-ovs-dpdk-permissions.yaml @@ -0,0 +1,15 @@ +# This permission changes should be applied only on the fresh deployment of +# queens, minor updates in queens (and future) and then upgrades from queens +# to future versions. +# +# It should NOT be used for upgrade from pike, ocata, newton as the existing +# vhost ports and ovs will be with root permissions. Modifying the ovs to run +# with new user during upgrades will result in errors as the existing files and +# folders need to be updated with new permissions. If this is required during +# the upgrade, it is preferrable to do it externally after upgrade. Once the +# changes has been applied, this environment file can be used for further +# updates and upgrades. + +parameter_defaults: + NeutronVhostuserSocketGroup: "hugetlbfs" + diff --git a/extraconfig/pre_network/host_config_and_reboot.yaml b/extraconfig/pre_network/host_config_and_reboot.yaml index 82eca625c4..d13145c41a 100644 --- a/extraconfig/pre_network/host_config_and_reboot.yaml +++ b/extraconfig/pre_network/host_config_and_reboot.yaml @@ -198,8 +198,47 @@ resources: _TUNED_PROFILE_NAME_: {get_param: [RoleParameters, TunedProfileName]} _TUNED_CORES_: {get_param: [RoleParameters, IsolCpusList]} + # Details @https://bugzilla.redhat.com/show_bug.cgi?id=1515269 + # Ensure gid of hugetlbfs matching with kolla so that container deployment + # and baremetal (future migrating to container) deployment have same id. This + # is a new group created from ovs2.8 onwards. 42477 is the kolla hugetlbfs + # gid value. Ensure that it is applied and restart(ovs) or reboot(host) + # before starting with DPDK initialization. + DpdkVhostGroupConfig: + type: OS::Heat::SoftwareConfig + depends_on: HostParametersDeployment + condition: is_dpdk_config_required + properties: + group: ansible + outputs: + - name: result + config: | + --- + - hosts: localhost + connection: local + gather_facts: False + tasks: + - group: + name: "hugetlbfs" + gid: 42477 + + DpdkVhostGroupDeployment: + type: OS::Heat::SoftwareDeployment + depends_on: HostParametersDeployment + condition: is_dpdk_config_required + properties: + name: DpdkVhostGroupDeployment + server: {get_param: server} + config: {get_resource: DpdkVhostGroupConfig} + actions: + if: + - deployment_actions_empty + - [] + - ['CREATE'] # Only do this on CREATE + RebootConfig: type: OS::Heat::SoftwareConfig + depends_on: DpdkVhostGroupDeployment condition: is_reboot_config_required properties: group: script @@ -212,7 +251,7 @@ resources: RebootDeployment: type: OS::Heat::SoftwareDeployment - depends_on: HostParametersDeployment + depends_on: DpdkVhostGroupDeployment condition: is_reboot_config_required properties: name: RebootDeployment @@ -234,6 +273,7 @@ resources: # maintained, restart of ovs is required. EnableDpdkConfig: type: OS::Heat::SoftwareConfig + depends_on: RebootDeployment condition: is_dpdk_config_required properties: group: script diff --git a/puppet/services/neutron-ovs-dpdk-agent.yaml b/puppet/services/neutron-ovs-dpdk-agent.yaml index 180da486d2..609c709fd0 100644 --- a/puppet/services/neutron-ovs-dpdk-agent.yaml +++ b/puppet/services/neutron-ovs-dpdk-agent.yaml @@ -45,6 +45,24 @@ parameters: type: string tags: - role_specific + NeutronVhostuserSocketGroup: + 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 + NeutronVhostuserSocketUser: + 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 resources: @@ -69,10 +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 - values: {get_param: [RoleParameters]} - values: NeutronDatapathType: {get_param: NeutronDatapathType} NeutronVhostuserSocketDir: {get_param: NeutronVhostuserSocketDir} + NeutronVhostuserSocketGroup: {get_param: NeutronVhostuserSocketGroup} + NeutronVhostuserSocketUser: {get_param: NeutronVhostuserSocketUser} Ovs: type: ./openvswitch.yaml @@ -97,6 +119,9 @@ outputs: - neutron::agents::ml2::ovs::enable_dpdk: true - 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, vhostuser_socket_group]} step_config: {get_attr: [NeutronOvsAgent, role_data, step_config]} upgrade_tasks: get_attr: [Ovs, role_data, upgrade_tasks]