tripleo-heat-templates/deployment/neutron/neutron-sriov-agent-container-puppet.yaml
Dan Prince 7d957ff262 step5: flatten the neutron service configurations
This change combines the previous puppet and docker files into a single
file that performs the docker service installation and configuration
for the neutron-sriov-agent, neutron-plugin-nsx, and neutron-sfc-api
services.

Change-Id: I3403575928df245798468b2d17f4a620bbf209e5
Related-Blueprint: services-yaml-flattening
2019-02-28 10:24:51 -05:00

203 lines
7.2 KiB
YAML

heat_template_version: rocky
description: >
OpenStack Neutron SR-IOV service
parameters:
DockerNeutronSriovImage:
description: The container image to use for the Neutron SR-IOV agent
type: string
DockerNeutronConfigImage:
description: The container image to use for the neutron config_volume
type: string
ServiceData:
default: {}
description: Dictionary packing service data
type: json
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDefaults.
type: json
DefaultPasswords:
default: {}
type: json
RoleName:
default: ''
description: Role name on which the service is applied
type: string
RoleParameters:
default: {}
description: Parameters specific to the role
type: json
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
NeutronPhysicalDevMappings:
description: >
List of <physical_network>:<physical device>
All physical networks listed in network_vlan_ranges
on the server should have mappings to appropriate
interfaces on each agent.
Example "tenant0:ens2f0,tenant1:ens2f1"
type: comma_delimited_list
default: ""
tags:
- role_specific
NeutronExcludeDevices:
description: >
List of <network_device>:<excluded_devices> mapping
network_device to the agent's node-specific list of virtual functions
that should not be used for virtual networking. excluded_devices is a
semicolon separated list of virtual functions to exclude from
network_device. The network_device in the mapping should appear in the
physical_device_mappings list.
type: comma_delimited_list
default: ""
tags:
- role_specific
NeutronSriovNumVFs:
description: |
Provide the list of VFs to be reserved for each SR-IOV interface.
Format ["<interface_name1>:<numvfs1>:<mode>","<interface_name2>:<numvfs2>"]
Example ["eth1:4096:switchdev","eth2:128:legacy","eth3:30"]
type: comma_delimited_list
default: ""
tags:
- role_specific
NeutronSriovAgentExtensions:
default: ""
description: >
Comma-separated list of extensions enabled for the Neutron SR-IOV agents.
type: comma_delimited_list
tags:
- role_specific
RpcPort:
default: 5672
description: The network port for messaging backend
type: number
resources:
# Merging role-specific parameters (RoleParameters) with the default parameters.
# RoleParameters will have the precedence over the default parameters.
RoleParametersValue:
type: OS::Heat::Value
properties:
type: json
value:
map_replace:
- map_replace:
- neutron::agents::ml2::sriov::physical_device_mappings: NeutronPhysicalDevMappings
neutron::agents::ml2::sriov::exclude_devices: NeutronExcludeDevices
tripleo::host::sriov::number_of_vfs: NeutronSriovNumVFs
neutron::agents::ml2::sriov::extensions: NeutronSriovAgentExtensions
- values: {get_param: [RoleParameters]}
- values:
NeutronPhysicalDevMappings: {get_param: NeutronPhysicalDevMappings}
NeutronExcludeDevices: {get_param: NeutronExcludeDevices}
NeutronSriovNumVFs: {get_param: NeutronSriovNumVFs}
NeutronSriovAgentExtensions: {get_param: NeutronSriovAgentExtensions}
ContainersCommon:
type: ./containers-common.yaml
NeutronBase:
type: ../../puppet/services/neutron-base.yaml
properties:
EndpointMap: {get_param: EndpointMap}
ServiceData: {get_param: ServiceData}
ServiceNetMap: {get_param: ServiceNetMap}
DefaultPasswords: {get_param: DefaultPasswords}
RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters}
NeutronLogging:
type: OS::TripleO::Services::Logging::NeutronCommon
properties:
NeutronServiceName: sriov-nic-agent
outputs:
role_data:
description: Role data for Neutron sriov service
value:
service_name: neutron_sriov_agent
config_settings:
map_merge:
- get_attr: [NeutronBase, role_data, config_settings]
- get_attr: [RoleParametersValue, value]
- get_attr: [NeutronLogging, config_settings]
puppet_config:
config_volume: neutron
puppet_tags: neutron_config,neutron_agent_sriov_numvfs,neutron_sriov_agent_config
step_config: |
include ::tripleo::profile::base::neutron::sriov
config_image: {get_param: DockerNeutronConfigImage}
kolla_config:
/var/lib/kolla/config_files/neutron_sriov_agent.json:
command:
list_join:
- ' '
- - /usr/bin/neutron-sriov-nic-agent --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/sriov_agent.ini --config-dir /etc/neutron/conf.d/common
- get_attr: [NeutronLogging, cmd_extra_args]
config_files:
- source: "/var/lib/kolla/config_files/src/*"
dest: "/"
merge: true
preserve_properties: true
permissions:
- path: /var/log/neutron
owner: neutron:neutron
recurse: true
docker_config:
step_4:
neutron_sriov_agent:
start_order: 10
image: {get_param: DockerNeutronSriovImage}
net: host
pid: host
privileged: true
restart: always
healthcheck:
test:
list_join:
- ' '
- - '/openstack/healthcheck'
- yaql:
expression: str($.data.port)
data:
port: {get_param: RpcPort}
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
- {get_attr: [NeutronLogging, volumes]}
-
- /var/lib/kolla/config_files/neutron_sriov_agent.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/neutron/:/var/lib/kolla/config_files/src:ro
- /lib/modules:/lib/modules:ro
- /run:/run
- /sys/class/net:/sys/class/net:rw
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
host_prep_tasks:
list_concat:
- {get_attr: [NeutronLogging, host_prep_tasks]}
- - name: enable virt_sandbox_use_netlink for healtcheck
seboolean:
name: virt_sandbox_use_netlink
persistent: yes
state: yes
metadata_settings:
get_attr: [NeutronBase, role_data, metadata_settings]
upgrade_tasks: []
post_upgrade_tasks:
- when: step|int == 1
import_role:
name: tripleo-docker-rm
vars:
containers_to_rm:
- neutron_sriov_agent