Browse Source

Merge "Refactor OVN bridge MAC addresses"

changes/18/789718/1
Zuul 5 months ago
committed by Gerrit Code Review
parent
commit
40528d4a86
  1. 7
      common/deploy-steps-playbooks-common.yaml
  2. 55
      deployment/ovn/ovn-controller-container-puppet.yaml
  3. 2
      environments/standalone/standalone-overcloud.yaml
  4. 2
      environments/standalone/standalone-tripleo.yaml
  5. 4
      environments/undercloud.yaml
  6. 2
      environments/undercloud/undercloud-minion.yaml
  7. 4
      overcloud-resource-registry-puppet.j2.yaml
  8. 7
      overcloud.j2.yaml
  9. 31
      puppet/role.role.j2.yaml
  10. 7
      sample-env-generator/standalone.yaml
  11. 4
      sample-env-generator/undercloud-minion.yaml

7
common/deploy-steps-playbooks-common.yaml

@ -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

55
deployment/ovn/ovn-controller-container-puppet.yaml

@ -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: []

2
environments/standalone/standalone-overcloud.yaml

@ -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

2
environments/standalone/standalone-tripleo.yaml

@ -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

4
environments/undercloud.yaml

@ -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

2
environments/undercloud/undercloud-minion.yaml

@ -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

4
overcloud-resource-registry-puppet.j2.yaml

@ -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 %}

7
overcloud.j2.yaml

@ -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

31
puppet/role.role.j2.yaml

@ -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:

7
sample-env-generator/standalone.yaml

@ -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

4
sample-env-generator/undercloud-minion.yaml

@ -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…
Cancel
Save