Change flat network name for nosdn fdio scenario
[apex-tripleo-heat-templates.git] / puppet / services / neutron-sriov-agent.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Neutron SR-IOV nic agent configured with Puppet
5
6 parameters:
7   ServiceData:
8     default: {}
9     description: Dictionary packing service data
10     type: json
11   ServiceNetMap:
12     default: {}
13     description: >
14       Mapping of service_name -> network name. Typically set via
15       parameter_defaults in the resource registry. This mapping overrides those
16       in ServiceNetMapDefaults.
17     type: json
18   DefaultPasswords:
19     default: {}
20     type: json
21   RoleName:
22     default: ''
23     description: Role name on which the service is applied
24     type: string
25   RoleParameters:
26     default: {}
27     description: Parameters specific to the role
28     type: json
29   EndpointMap:
30     default: {}
31     description: Mapping of service endpoint -> protocol. Typically set
32                  via parameter_defaults in the resource registry.
33     type: json
34   NeutronPhysicalDevMappings:
35     description: >
36       List of <physical_network>:<physical device>
37       All physical networks listed in network_vlan_ranges
38       on the server should have mappings to appropriate
39       interfaces on each agent.
40       Example "tenant0:ens2f0,tenant1:ens2f1"
41     type: comma_delimited_list
42     default: ""
43   NeutronExcludeDevices:
44     description: >
45       List of <network_device>:<excluded_devices> mapping
46       network_device to the agent's node-specific list of virtual functions
47       that should not be used for virtual networking. excluded_devices is a
48       semicolon separated list of virtual functions to exclude from
49       network_device. The network_device in the mapping should appear in the
50       physical_device_mappings list.
51     type: comma_delimited_list
52     default: ""
53   NeutronSriovNumVFs:
54     description: >
55       Provide the list of VFs to be reserved for each SR-IOV interface.
56       Format "<interface_name1>:<numvfs1>,<interface_name2>:<numvfs2>"
57       Example "eth1:4096,eth2:128"
58     type: comma_delimited_list
59     default: ""
60
61 resources:
62
63   NeutronBase:
64     type: ./neutron-base.yaml
65     properties:
66       ServiceData: {get_param: ServiceData}
67       ServiceNetMap: {get_param: ServiceNetMap}
68       DefaultPasswords: {get_param: DefaultPasswords}
69       EndpointMap: {get_param: EndpointMap}
70       RoleName: {get_param: RoleName}
71       RoleParameters: {get_param: RoleParameters}
72
73   # Merging role-specific parameters (RoleParameters) with the default parameters.
74   # RoleParameters will have the precedence over the default parameters.
75   RoleParametersValue:
76     type: OS::Heat::Value
77     properties:
78       type: json
79       value:
80         map_replace:
81           - map_replace:
82             - neutron::agents::ml2::sriov::physical_device_mappings: NeutronPhysicalDevMappings
83               neutron::agents::ml2::sriov::exclude_devices: NeutronExcludeDevices
84               tripleo::host::sriov::number_of_vfs: NeutronSriovNumVFs
85             - values: {get_param: [RoleParameters]}
86           - values:
87               NeutronPhysicalDevMappings: {get_param: NeutronPhysicalDevMappings}
88               NeutronExcludeDevices: {get_param: NeutronExcludeDevices}
89               NeutronSriovNumVFs: {get_param: NeutronSriovNumVFs}
90
91 outputs:
92   role_data:
93     description: Role data for the Neutron SR-IOV nic agent service.
94     value:
95       service_name: neutron_sriov_agent
96       config_settings:
97         map_merge:
98           - get_attr: [NeutronBase, role_data, config_settings]
99           - get_attr: [RoleParametersValue, value]
100       step_config: |
101         include ::tripleo::profile::base::neutron::sriov
102       upgrade_tasks:
103         - name: Check if neutron_sriov_agent is deployed
104           command: systemctl is-enabled neutron-sriov-nic-agent
105           tags: common
106           ignore_errors: True
107           register: neutron_sriov_nic_agent_enabled
108         - name: "PreUpgrade step0,validation: Check service neutron-server is running"
109           shell: /usr/bin/systemctl show 'neutron-sriov-nic-agent' --property ActiveState | grep '\bactive\b'
110           when: neutron_sriov_nic_agent_enabled.rc == 0
111           tags: step0,validation
112         - name: Stop neutron_sriov_nic_agent service
113           tags: step1
114           when: neutron_sriov_nic_agent_enabled.rc == 0
115           service: name=neutron-sriov-nic-agent state=stopped