From 20f34fc556a45f3bd408433a6be99553e863f8ed Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Wed, 22 May 2019 16:07:36 +0200 Subject: [PATCH] Rework neutron AZ configs considering OVN Allow Neutron to be configured for use of AZs w/o additional t-h-t services introduced. Limitations for the used NeutronMechanismDrivers: * Right now OVN doesn't support AZ aware routing scheduling (later in Train cycle OVN ml2 driver will be extended to support it). * Nor there is Neutron agents deployed normally for OVN. * We do allow the L3 agent taking AZ configs disregard of the used NeutronMechanismDrivers. * But we take the safe path for the DHCP agent and prohibit AZ configuration for it in the OVN case. So there is effectively nothing applies there for Neutron AZs and OVN as it takes a little to no sense to do that yet. Related blueprint split-controlplane-templates Change-Id: I0d97b004c4f162fdefc97a7b603c0136686fa21c Signed-off-by: Bogdan Dobrelya --- .../neutron/neutron-api-container-puppet.yaml | 42 ++++++ deployment/neutron/neutron-az-config.yaml | 121 ------------------ .../neutron-dhcp-container-puppet.yaml | 22 ++++ .../neutron/neutron-l3-container-puppet.yaml | 12 ++ environments/neutron-az-config.yaml | 2 - overcloud-resource-registry-puppet.j2.yaml | 1 - ...on-az-config-service-3085b2c296df06c9.yaml | 32 +++-- 7 files changed, 97 insertions(+), 135 deletions(-) delete mode 100644 deployment/neutron/neutron-az-config.yaml delete mode 100644 environments/neutron-az-config.yaml diff --git a/deployment/neutron/neutron-api-container-puppet.yaml b/deployment/neutron/neutron-api-container-puppet.yaml index 39bf22c682..6e30374f76 100644 --- a/deployment/neutron/neutron-api-container-puppet.yaml +++ b/deployment/neutron/neutron-api-container-puppet.yaml @@ -112,6 +112,33 @@ parameters: default: '500' type: string description: Number of ports allowed per tenant, and minus means unlimited. + # TODO(bogdando): Right now OVN doesn't support AZ aware routing scheduling. + # Later in Train cycle OVN ml2 driver will be extended to support it. + # Until then, we have to determine if NeutronMechanismDrivers is OVN or OVS. + NeutronMechanismDrivers: + default: 'ovn' + description: | + The mechanism drivers for the Neutron tenant network. + type: comma_delimited_list + NeutronDefaultAvailabilityZones: + description: Comma-separated list of default network availability zones to + be used by Neutron if its resource is created without + availability zone hints. If not set, no AZs will be configured + for Neutron network services. + default: '' + type: comma_delimited_list + NeutronNetworkSchedulerDriver: + description: The network schedule driver to use for avialability zones. + default: neutron.scheduler.dhcp_agent_scheduler.AZAwareWeightScheduler + type: string + NeutronRouterSchedulerDriver: + description: The router schedule driver to use for avialability zones. + default: neutron.scheduler.l3_agent_scheduler.AZLeastRoutersScheduler + type: string + NeutronDhcpLoadType: + description: Additional to the availability zones aware network scheduler. + default: networks + type: string # DEPRECATED: the following options are deprecated and are currently maintained # for backwards compatibility. They will be removed in the Ocata cycle. NeutronL3HA: @@ -142,6 +169,9 @@ conditions: neutron_ovs_int_br_unset: {equals : [{get_param: NeutronOvsIntegrationBridge}, '']} internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]} neutron_dvr_unset: {equals : [{get_param: NeutronEnableDVR}, '']} + ovn_enabled: {equals: [{get_param: NeutronMechanismDrivers}, 'ovn']} + az_unset: {equals: [{get_param: NeutronDefaultAvailabilityZones}, '']} + omit_az_configs: {or: [ovn_enabled, az_unset]} resources: @@ -276,6 +306,18 @@ outputs: - neutron_ovs_int_br_unset - {} - neutron::server::ovs_integration_bridge: {get_param: NeutronOvsIntegrationBridge} + - + if: + - omit_az_configs + - {} + - + neutron::server::dhcp_load_type: {get_param: NeutronDhcpLoadType} + neutron::server::network_scheduler_driver: + {get_param: NeutronNetworkSchedulerDriver} + neutron::server::router_scheduler_driver: + {get_param: NeutronRouterSchedulerDriver} + neutron::server::default_availability_zones: + {get_param: NeutronDefaultAvailabilityZones} service_config_settings: fluentd: tripleo_fluentd_groups_neutron_api: diff --git a/deployment/neutron/neutron-az-config.yaml b/deployment/neutron/neutron-az-config.yaml deleted file mode 100644 index 65068e089c..0000000000 --- a/deployment/neutron/neutron-az-config.yaml +++ /dev/null @@ -1,121 +0,0 @@ -heat_template_version: rocky - -description: > - Configuration of Neutron Availability Zones in the overcloud - -parameters: - 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 - AdminPassword: - description: The password for the keystone admin account, used for - monitoring, querying neutron etc. - type: string - hidden: true - NeutronDefaultAvailabilityZones: - description: Comma-separated list of default network availability zones to - be used by Neutron if its resource is created without - availability zone hints. If not set, the default will be equal - to the stack/plan name. - default: '' - type: string - NeutronL3AgentAvailabilityZone: - description: Availability zone for Neutron L3 agent. If not set, the - default will be equal to the stack/plan name - default: '' - type: string - NeutronDhcpAgentAvailabilityZone: - description: Availability zone for Neutron DHCP agent. If not set, the - default will be equal to the stack/plan name - default: '' - type: string - NeutronNetworkSchedulerDriver: - description: The network schedule driver to use for avialability zones. - default: neutron.scheduler.dhcp_agent_scheduler.AZAwareWeightScheduler - type: string - NeutronRouterSchedulerDriver: - description: The router schedule driver to use for avialability zones. - default: neutron.scheduler.l3_agent_scheduler.AZLeastRoutersScheduler - type: string - NeutronDhcpLoadType: - description: Additional to the availability zones aware network scheduler. - default: networks - type: string - RootStackName: - description: The name of the stack/plan. - type: string - -resources: - NeutronAvailabilityZones: - type: OS::Heat::Value - properties: - value: - if: - - equals: - - {get_param: NeutronDefaultAvailabilityZones} - - "" - - {get_param: RootStackName} - - {get_param: NeutronDefaultAvailabilityZones} - - NeutronL3AgentAvailabilityZoneReal: - type: OS::Heat::Value - properties: - value: - if: - - equals: - - {get_param: NeutronL3AgentAvailabilityZone} - - "" - - {get_param: RootStackName} - - {get_param: NeutronL3AgentAvailabilityZone} - - NeutronDhcpAgentAvailabilityZoneReal: - type: OS::Heat::Value - properties: - value: - if: - - equals: - - {get_param: NeutronDhcpAgentAvailabilityZone} - - "" - - {get_param: RootStackName} - - {get_param: NeutronDhcpAgentAvailabilityZone} - -outputs: - role_data: - description: Role data for the Neutron Availability Zone configuration value - service: - service_name: neutron_az_config - config_settings: - neutron::server::dhcp_load_type: {get_param: NeutronDhcpLoadType} - neutron::server::network_scheduler_driver: - {get_param: NeutronNetworkSchedulerDriver} - neutron::server::router_scheduler_driver: - {get_param: NeutronRouterSchedulerDriver} - neutron::server::default_availability_zones: - {str_split: [',', {get_attr: [NeutronAvailabilityZones, value]}]} - neutron::agents::l3::availability_zone: - {get_attr: [NeutronL3AgentAvailabilityZoneReal, value]} - neutron::agents::dhcp::availability_zone: - {get_attr: [NeutronDhcpAgentAvailabilityZoneReal, value]} diff --git a/deployment/neutron/neutron-dhcp-container-puppet.yaml b/deployment/neutron/neutron-dhcp-container-puppet.yaml index df48b2e145..a8463a54eb 100644 --- a/deployment/neutron/neutron-dhcp-container-puppet.yaml +++ b/deployment/neutron/neutron-dhcp-container-puppet.yaml @@ -121,6 +121,21 @@ parameters: default: false description: Neutron DHCP agent to use broadcast in DHCP replies type: boolean + # TODO(bogdando): The experimental OVN SRIOV environment includes the + # DHCP agent service. We keep it safe to not break it with AZ-related + # configurations. Therefore, we have to determine, if + # NeutronMechanismDrivers is OVN or not. This may change in future, + # when OVN/SRIOV supports Neutron AZ configurations for the agent services. + NeutronMechanismDrivers: + default: 'ovn' + description: | + The mechanism drivers for the Neutron tenant network. + type: comma_delimited_list + NeutronDhcpAgentAvailabilityZone: + description: Availability zone for Neutron DHCP agent. If not set, + no AZs will be configured for Neutron network services. + default: '' + type: string conditions: @@ -131,6 +146,9 @@ conditions: service_wrapper_debug_unset: {equals : [{get_param: NeutronWrapperDebug}, false]} service_debug_unset: {equals: [{get_param: NeutronDhcpAgentDebug}, '']} dhcp_ovs_intergation_bridge_unset: {equals: [{get_param: NeutronDhcpOvsIntegrationBridge}, '']} + ovn_enabled: {equals: [{get_param: NeutronMechanismDrivers}, 'ovn']} + az_unset: {equals: [{get_param: NeutronDhcpAgentAvailabilityZone}, '']} + omit_az_configs: {or: [ovn_enabled, az_unset]} resources: @@ -219,6 +237,10 @@ outputs: - dhcp_ovs_intergation_bridge_unset - {} - neutron::agents::dhcp::ovs_integration_bridge: {get_param: NeutronDhcpOvsIntegrationBridge} + - if: + - omit_az_configs + - {} + - neutron::agents::dhcp::availability_zone: {get_param: NeutronDhcpAgentAvailabilityZone} service_config_settings: map_merge: - get_attr: [NeutronBase, role_data, service_config_settings] diff --git a/deployment/neutron/neutron-l3-container-puppet.yaml b/deployment/neutron/neutron-l3-container-puppet.yaml index 3567f8198b..c49ab7ba65 100644 --- a/deployment/neutron/neutron-l3-container-puppet.yaml +++ b/deployment/neutron/neutron-l3-container-puppet.yaml @@ -101,6 +101,13 @@ parameters: type: string constraints: - allowed_values: [ '', 'true', 'True', 'TRUE', 'false', 'False', 'FALSE'] + # NOTE(bogdando): we allow the L3 agent to have AZ configs defined disregard of + # the used NeutronMechanismDrivers. + NeutronL3AgentAvailabilityZone: + description: Availability zone for Neutron L3 agent. If not set, + no AZs will be configured for Neutron network services. + default: '' + type: string # DEPRECATED: the following options are deprecated and are currently maintained # for backwards compatibility. They will be removed in the Pike cycle. @@ -119,6 +126,7 @@ conditions: docker_enabled: {equals: [{get_param: ContainerCli}, 'docker']} service_debug_unset: {equals : [{get_param: NeutronWrapperDebug}, false]} external_network_bridge_empty: {equals : [{get_param: NeutronExternalNetworkBridge}, "''"]} + az_unset: {equals: [{get_param: NeutronL3AgentAvailabilityZone}, '']} resources: @@ -198,6 +206,10 @@ outputs: - external_network_bridge_empty - {} - neutron::agents::l3::external_network_bridge: {get_param: NeutronExternalNetworkBridge} + - if: + - az_unset + - {} + - neutron::agents::l3::availability_zone: {get_param: NeutronL3AgentAvailabilityZone} service_config_settings: map_merge: - get_attr: [NeutronBase, role_data, service_config_settings] diff --git a/environments/neutron-az-config.yaml b/environments/neutron-az-config.yaml deleted file mode 100644 index 07e547a2c4..0000000000 --- a/environments/neutron-az-config.yaml +++ /dev/null @@ -1,2 +0,0 @@ -resource_registry: - OS::TripleO::Services::NeutronAZConfig: ../deployment/nova/neutron-az-config.yaml diff --git a/overcloud-resource-registry-puppet.j2.yaml b/overcloud-resource-registry-puppet.j2.yaml index e1bfb0236b..a9623a8dea 100644 --- a/overcloud-resource-registry-puppet.j2.yaml +++ b/overcloud-resource-registry-puppet.j2.yaml @@ -209,7 +209,6 @@ resource_registry: OS::TripleO::Services::NovaScheduler: deployment/nova/nova-scheduler-container-puppet.yaml OS::TripleO::Services::NovaVncProxy: deployment/nova/nova-vnc-proxy-container-puppet.yaml OS::TripleO::Services::Novajoin: OS::Heat::None - OS::TripleO::Services::NeutronAZConfig: OS::Heat::None OS::TripleO::Services::NovaAZConfig: OS::Heat::None OS::TripleO::Services::ContainersLogrotateCrond: deployment/logrotate/logrotate-crond-container-puppet.yaml OS::TripleO::Services::OpenShift::Master: OS::Heat::None diff --git a/releasenotes/notes/neutron-az-config-service-3085b2c296df06c9.yaml b/releasenotes/notes/neutron-az-config-service-3085b2c296df06c9.yaml index 7de8798d21..3c76ace5fc 100644 --- a/releasenotes/notes/neutron-az-config-service-3085b2c296df06c9.yaml +++ b/releasenotes/notes/neutron-az-config-service-3085b2c296df06c9.yaml @@ -1,14 +1,24 @@ --- features: - | - A new service, NeutronAZConfig, is avaialable which can be used to configure - Neutron for using avaialabiity zones. By default the service is mapped to - None, but can be enabled by including `environments/neutron-az-config.yaml`. - ``NeutronDefaultAvailabilityZones``, ``NeutronDhcpAgentAvailabilityZone``, - ``NeutronL3AgentAvailabilityZone``, ``NeutronDhcpAgentsPerNetwork``, - ``NeutronNetworkSchedulerDriver``, ``NeutronRouterSchedulerDriver`` and - ``NeutronDhcpLoadType`` parameters can be used to configure various AZ - configurations. By default, ``Neutron*AvailabilityZone`` takes the name of - the heat stack/deployment plan, and ``NeutronDefaultAvailabilityZones`` - takes an additional value 'nova'. For details, see - `Official Documentaion `_. + Neutron can be configured for using avaialabiity zones (AZs). + + .. note:: OVN does not normally run Neutron agents and also has yet support + for AZ-aware routing scheduling. Therefore, no effective AZ configurations + can be applied for the network services for the + ``NeutronMechanismDrivers: ovn`` case. + + `NeutronDefaultAvailabilityZones`, `NeutronDhcpAgentAvailabilityZone`, + `NeutronL3AgentAvailabilityZone`, `NeutronDhcpAgentsPerNetwork`, + `NeutronNetworkSchedulerDriver`, `NeutronRouterSchedulerDriver` and + `NeutronDhcpLoadType` can be used to configure various AZ configurations. + + By default, `Neutron*AvailabilityZone(s)` takes an empty value, which + defines no AZs associated with the associated Neutron network service. + + .. note:: The empty AZ name cannot be re-defined via + `Neutron*AvailabilityZone(s)` because of the empty value has been + reserved for another purposes in t-h-t. + + For details, see + `Official Documentaion `_.