Refactor OVN bridge MAC addresses
Moving the network and port management for OVN bridge MAC addresses to ansible. Removes the heat resources, and adds an external deploy task at step 0 in the ovn controller service templates which uses the 'tripleo_ovn_mac_addresses' ansible module to create/remove OVN mac address ports. Adds parameter role_specific OVNStaticBridgeMacMappings, parameter that can be used to set static bridge mac mappings. When this is set no neutron resources will be created by the tripleo_ovn_mac_addresses ansible module. OVNStaticBridgeMacMappings must be used for standalone deployments. Implements: blueprint network-data-v2-port Depends-On: https://review.opendev.org/782891 Depends-On: https://review.opendev.org/783137 Change-Id: I6ce29d2908e76044c55eb96d0d3779fe67ba9169
This commit is contained in:
parent
5fd7b3c9f6
commit
a120ada72e
common
deployment/ovn
environments
overcloud-resource-registry-puppet.j2.yamlovercloud.j2.yamlpuppet
sample-env-generator
@ -53,7 +53,7 @@
|
||||
- always
|
||||
|
||||
- hosts: all
|
||||
name: Load Service VIP variables
|
||||
name: Include extra variables from files
|
||||
gather_facts: "{{ gather_facts | default(false) }}"
|
||||
any_errors_fatal: false
|
||||
ignore_unreachable: true
|
||||
@ -63,6 +63,11 @@
|
||||
file: "{{ playbook_dir }}/service_vip_vars.yaml"
|
||||
name: service_vip_vars
|
||||
ignore_errors: yes
|
||||
- name: Include OVN bridge MAC address variables
|
||||
include_vars:
|
||||
file: "{{ playbook_dir }}/ovn_bridge_mac_address_vars.yaml"
|
||||
name: ovn_bridge_mac_address_vars
|
||||
ignore_errors: yes
|
||||
tags:
|
||||
- always
|
||||
|
||||
|
@ -4,6 +4,9 @@ description: >
|
||||
OpenStack containerized Ovn Controller agent.
|
||||
|
||||
parameters:
|
||||
RootStackName:
|
||||
description: The name of the stack/plan.
|
||||
type: string
|
||||
EndpointMap:
|
||||
default: {}
|
||||
description: Mapping of service endpoint -> protocol. Typically set
|
||||
@ -118,6 +121,22 @@ parameters:
|
||||
default: ''
|
||||
description: Override the private key size used when creating the
|
||||
certificate for this service
|
||||
OVNStaticBridgeMacMappings:
|
||||
type: json
|
||||
default: {}
|
||||
description: |
|
||||
Static OVN Bridge MAC address mappings. Unique OVN bridge mac addresses
|
||||
is dynamically allocated by creating neutron ports. When neutron isn't
|
||||
available, for instance in the standalone deployment, use this parameter
|
||||
to provide static OVN bridge mac addresses. For example:
|
||||
controller-0:
|
||||
datacenter: 00:00:5E:00:53:00
|
||||
provider: 00:00:5E:00:53:01
|
||||
compute-0:
|
||||
datacenter: 00:00:5E:00:54:00
|
||||
provider: 00:00:5E:00:54:01
|
||||
tags:
|
||||
- role_specific
|
||||
|
||||
conditions:
|
||||
force_config_drive: {equals: [{get_param: OVNMetadataEnabled}, false]}
|
||||
@ -148,6 +167,21 @@ resources:
|
||||
OVNCMSOptions: {get_param: OVNCMSOptions}
|
||||
OvsHwOffload: {get_param: OvsHwOffload}
|
||||
|
||||
OVNBridgeMappingsValue:
|
||||
type: OS::Heat::Value
|
||||
properties:
|
||||
type: json
|
||||
value:
|
||||
map_replace:
|
||||
- map_replace:
|
||||
- ovn_bridge_mappings: NeutronBridgeMappings
|
||||
ovn_static_bridge_mac_mappings: OVNStaticBridgeMacMappings
|
||||
- values: {get_param: [RoleParameters]}
|
||||
- values:
|
||||
NeutronBridgeMappings: {get_param: NeutronBridgeMappings}
|
||||
OVNStaticBridgeMacMappings: {get_param: OVNStaticBridgeMacMappings}
|
||||
|
||||
|
||||
outputs:
|
||||
role_data:
|
||||
description: Role data for the Ovn Controller agent.
|
||||
@ -369,4 +403,25 @@ outputs:
|
||||
service:
|
||||
name: neutron-cleanup
|
||||
enabled: yes
|
||||
external_deploy_tasks:
|
||||
- when:
|
||||
- step|int == 0
|
||||
name: ovn_controller_external_deploy_init
|
||||
block:
|
||||
- name:
|
||||
str_replace:
|
||||
template: create ovn mac address for $ROLE_NAME role nodes
|
||||
params:
|
||||
$ROLE_NAME: {get_param: RoleName}
|
||||
tripleo_ovn_mac_addresses:
|
||||
playbook_dir: "{{ playbook_dir }}"
|
||||
stack_name: {get_param: RootStackName}
|
||||
role_name: {get_param: RoleName}
|
||||
server_resource_names:
|
||||
str_replace:
|
||||
template: '{{ groups["$ROLE_NAME"] }}'
|
||||
params:
|
||||
$ROLE_NAME: {get_param: RoleName}
|
||||
ovn_bridge_mappings: {get_attr: [OVNBridgeMappingsValue, value, ovn_bridge_mappings]}
|
||||
ovn_static_bridge_mac_mappings: {get_attr: [OVNBridgeMappingsValue, value, ovn_static_bridge_mac_mappings]}
|
||||
upgrade_tasks: []
|
||||
|
@ -51,8 +51,6 @@ parameter_defaults:
|
||||
SwiftReplicas: 1
|
||||
|
||||
resource_registry:
|
||||
OS::TripleO::OVNMacAddressNetwork: OS::Heat::None
|
||||
OS::TripleO::OVNMacAddressPort: OS::Heat::None
|
||||
OS::TripleO::Services::AodhApi: OS::Heat::None
|
||||
OS::TripleO::Services::AodhEvaluator: OS::Heat::None
|
||||
OS::TripleO::Services::AodhListener: OS::Heat::None
|
||||
|
@ -58,8 +58,6 @@ parameter_defaults:
|
||||
|
||||
resource_registry:
|
||||
OS::TripleO::Network::Ports::ControlPlaneVipPort: ../../deployed-server/deployed-neutron-port.yaml
|
||||
OS::TripleO::OVNMacAddressNetwork: OS::Heat::None
|
||||
OS::TripleO::OVNMacAddressPort: OS::Heat::None
|
||||
OS::TripleO::Services::AodhApi: OS::Heat::None
|
||||
OS::TripleO::Services::AodhEvaluator: OS::Heat::None
|
||||
OS::TripleO::Services::AodhListener: OS::Heat::None
|
||||
|
@ -68,10 +68,6 @@ resource_registry:
|
||||
# Undercloud HA services
|
||||
OS::TripleO::Services::HAproxy: OS::Heat::None
|
||||
|
||||
# Don't create OVN Chassis MAC address nets/ports on the undercloud
|
||||
OS::TripleO::OVNMacAddressNetwork: OS::Heat::None
|
||||
OS::TripleO::OVNMacAddressPort: OS::Heat::None
|
||||
|
||||
parameter_defaults:
|
||||
# ensure we enable ip_forward before docker gets run
|
||||
KernelIpForward: 1
|
||||
|
@ -106,8 +106,6 @@ parameter_defaults:
|
||||
|
||||
resource_registry:
|
||||
OS::TripleO::Network::Ports::ControlPlaneVipPort: OS::Heat::None
|
||||
OS::TripleO::OVNMacAddressNetwork: OS::Heat::None
|
||||
OS::TripleO::OVNMacAddressPort: OS::Heat::None
|
||||
OS::TripleO::Services::AodhApi: OS::Heat::None
|
||||
OS::TripleO::Services::AodhEvaluator: OS::Heat::None
|
||||
OS::TripleO::Services::AodhListener: OS::Heat::None
|
||||
|
@ -64,10 +64,6 @@ resource_registry:
|
||||
# TripleO overcloud networks
|
||||
OS::TripleO::Network: network/networks.yaml
|
||||
|
||||
# Special network to allocate unique OVN chassis mac addresses, for distributed vlan traffic.
|
||||
OS::TripleO::OVNMacAddressNetwork: network/ovn_mac_addr_net.yaml
|
||||
OS::TripleO::OVNMacAddressPort: network/ports/ovn_mac_addr_port.yaml
|
||||
|
||||
{%- for network in networks if network.enabled|default(true) %}
|
||||
OS::TripleO::Network::{{network.name}}: OS::Heat::None
|
||||
{%- endfor %}
|
||||
|
@ -805,9 +805,7 @@ resources:
|
||||
|
||||
{{role.name}}:
|
||||
type: OS::Heat::ResourceGroup
|
||||
depends_on:
|
||||
- Networks
|
||||
- OVNMacAddressNetwork
|
||||
depends_on: Networks
|
||||
update_policy:
|
||||
batch_create:
|
||||
max_batch_size: {get_param: NodeCreateBatchSize}
|
||||
@ -947,9 +945,6 @@ resources:
|
||||
properties:
|
||||
CtlplaneNetworkCidrs: {get_attr: [ControlVirtualIP, network, tags]}
|
||||
|
||||
OVNMacAddressNetwork:
|
||||
type: OS::TripleO::OVNMacAddressNetwork
|
||||
|
||||
{%- for role in roles %}
|
||||
{{role.name}}GroupVars:
|
||||
type: OS::Heat::Value
|
||||
|
@ -461,37 +461,6 @@ resources:
|
||||
fqdn_ctlplane: {get_attr: [NetHostMap, value, ctlplane, fqdn]}
|
||||
fqdn_canonical: {get_attr: [NetHostMap, value, canonical, fqdn]}
|
||||
hostname_resolve_network: {get_param: [ServiceNetMap, {{role.name}}HostnameResolveNetwork]}
|
||||
ovn_chassis_mac_map: {get_attr: [{{server_resource_name}}OVNChassisMacMap, value]}
|
||||
|
||||
{{server_resource_name}}OVNChassisMacPorts:
|
||||
type: OS::Heat::ResourceGroup
|
||||
properties:
|
||||
count:
|
||||
yaql:
|
||||
expression: $.data.len()
|
||||
data: {get_param: OVNBridgeMappings}
|
||||
resource_def:
|
||||
type: OS::TripleO::OVNMacAddressPort
|
||||
properties:
|
||||
PortName: {{server_resource_name}}-ovn-mac-%index%
|
||||
|
||||
{{server_resource_name}}OVNChassisMacMap:
|
||||
type: OS::Heat::Value
|
||||
properties:
|
||||
type: json
|
||||
value:
|
||||
yaql:
|
||||
expression: let(physnets => switch(isList($.data.physnets) => $.data.physnets, true => [])) ->
|
||||
$physnets.zip($.data.macs).toDict($.first(), $.last())
|
||||
data:
|
||||
physnets:
|
||||
yaql:
|
||||
expression: $.data.select($.split(':').first())
|
||||
data: {get_param: OVNBridgeMappings}
|
||||
macs:
|
||||
yaql:
|
||||
expression: switch(isDict($.data) => $.data.values(), true => [])
|
||||
data: {get_attr: [{{server_resource_name}}OVNChassisMacPorts, attributes, mac_address]}
|
||||
|
||||
outputs:
|
||||
ansible_host_vars_map:
|
||||
|
@ -135,9 +135,6 @@ environments:
|
||||
OS::TripleO::Services::Rsyslog: ../../deployment/logging/rsyslog-baremetal-ansible.yaml
|
||||
# Zaqar
|
||||
OS::TripleO::Services::Zaqar: OS::Heat::None
|
||||
# Don't create OVN Chassis MAC address nets/ports on the standalone
|
||||
OS::TripleO::OVNMacAddressNetwork: OS::Heat::None
|
||||
OS::TripleO::OVNMacAddressPort: OS::Heat::None
|
||||
|
||||
-
|
||||
name: standalone/standalone-overcloud
|
||||
@ -185,10 +182,6 @@ environments:
|
||||
resource_registry:
|
||||
OS::TripleO::Services::OpenStackClients: ../../deployment/clients/openstack-clients-baremetal-ansible.yaml
|
||||
|
||||
# Don't create OVN Chassis MAC address nets/ports on the standalone
|
||||
OS::TripleO::OVNMacAddressNetwork: OS::Heat::None
|
||||
OS::TripleO::OVNMacAddressPort: OS::Heat::None
|
||||
|
||||
# Aodh
|
||||
OS::TripleO::Services::AodhApi: OS::Heat::None
|
||||
OS::TripleO::Services::AodhEvaluator: OS::Heat::None
|
||||
|
@ -93,10 +93,6 @@ environments:
|
||||
# Disable by default
|
||||
OS::TripleO::Services::IronicConductor: OS::Heat::None
|
||||
|
||||
# Don't create OVN Chassis MAC address nets/ports on the standalone
|
||||
OS::TripleO::OVNMacAddressNetwork: OS::Heat::None
|
||||
OS::TripleO::OVNMacAddressPort: OS::Heat::None
|
||||
|
||||
# Disable all the services not used when deploying just a minion
|
||||
OS::TripleO::Services::AodhApi: OS::Heat::None
|
||||
OS::TripleO::Services::AodhEvaluator: OS::Heat::None
|
||||
|
Loading…
x
Reference in New Issue
Block a user