Deploying ML2 Plug-in with Red Hat OpenStack
Starting in Contrail Networking Release 2011, the ML2 Neutron plug-in is used to integrate OpenStack with Contrail Networking Fabric. Follow these steps to deploy ML2 plugin with Red Hat OpenStack 13 (RHOSP 13).
Deploy Contrail Command and CFM without Orchestrator
Follow these steps to deploy Contrail Command with intermediate OpenStack Keystone.
- Deploy Contrail Command.
- From the Contrail Command UI, deploy Contrail Control nodes and select None when selecting orchestrator.
Configure Fabric by using Contrail Command
Follow these steps to configure fabric by using Contrail Command
Ensure that the following requirements are met.
Switches are configured to provide connectivity for RHOSP networking.
Names of servers are used as host names in RHOSP deployments.
Virtual port groups that are created for deployment on ports and that are used by the fabric, conforms to ML2 naming convention.
For OVS ports, there is one virtual port group for every control node.
ML2 naming convention:
`vpg#{base64(nodename)`
.These virtual port groups are not used for SRIOV ports.
For SRIOV ports, there is one virtual port group for every pair of compute node and physical network.
ML2 naming convention:
`vpg#{base64(nodename)}#{base64(physnet)}`
All SRIOV ports need are tagged with the name of the physical network they are associated to. For example,
`label=tenant1`
.UUID of the virtual port group is set as a result of the
uuid.uuid3(uuid.NAMESPACE_DNS, str(name))
Python function.Created virtual port groups for all networks used in OOO provisioning.
The following script for creating virtual port groups is provided in the config-api container. This script is used for creating the infrastructure ports that are needed for RHOSP deployment.
python /opt/contrail/utils/provision_infra_nw.py –connections <connection.yaml> –fabric <fabricname> Sample Connection.yaml: rhosp-provisioning1: cidr: 192.XX.XX.0/24 gateway: 192.XX.XX.254 vlan: 801 servers: 5c7s5-node1.localdomain: 5c7-qfx6: - xe-0/0/54_0 5c7s5-node2.localdomain: 5c7-qfx6: - xe-0/0/54_1 rhosp-int-api1: cidr: 10.XX.XX.0/24 gateway: 10.XX.XX.254 vlan: 811 data: True servers: 5c7s5-node1.localdomain: 5c7-qfx5: - xe-0/0/50_0 5c7s5-node2.localdomain: 5c7-qfx5: - xe-0/0/50_1
Add servers to Contrail Command.
The server name should match the name that the node will inherit once OOO provisioning is complete.
hostname_map.yaml
is used here.Follow these steps to import servers by using the Contrail Command UI.
Navigate to Infrastructure>Servers and click Import.
The Import Server pop-up is displayed.
To import a server, click Browse and navigate to the local directory and select the
.json
file.Alternatively, you can drag and drop the
.json
file in the Drag a file here, or browse pane.Click Import to import the server.
Import Node (Server) Profiles.
Follow these steps to import node profiles by using the Contrail Command UI.
Navigate to Infrastructure>Servers and click the Server Profiles tab.
The Import Server Profile pop-up is displayed.
To import a server profile, click Browse and navigate to the local directory and select the
.json
file.Alternatively, you can drag and drop the
.json
file in the Drag a file here, or browse pane.Click Import to import the server profile.
Associate node profiles (server profiles) and assign tags to SRIOV port only.
Follow these steps to associate node profiles to servers by using the Contrail Command UI.
Navigate to Infrastructure>Servers.
The Servers page is displayed.
Select the server you want to assign a server profile to by selecting the check box next to the name of the server.
Click Assign to server profile.
The Assign Server Profile pop-up is displayed.
Select the server profile from the Server Profile list and click Assign.
The profile is now assigned.
Sample Server Profile
{ "nodes": [ { "name": "5c7s5-node2.localdomain", "type": "baremetal", "ports": [{ "name": "enp94s0f0", "mac_address": "90:e2:ba:4c:65:c9", "switch_name": "5c7-qfx6", "port_name": "xe-0/0/54:1", "switch_id": "10:0e:7e:bd:94:72" }, { "name": "enp94s0f1", "mac_address": "90:e2:ba:4c:65:c9", "switch_name": "5c7-qfx5", "port_name": "xe-0/0/50:1", "switch_id": "10:0e:7e:bd:94:72" }, { "name": "enp94s0f2", "mac_address": "90:e2:ba:4c:65:c9", "switch_name": "5c7-qfx5", "port_name": "xe-0/0/2", "switch_id": "10:0e:7e:bd:94:72" }, { "name": "enp94s0f3", "mac_address": "90:e2:ba:4c:65:c9", "switch_name": "5c7-qfx6", "port_name": "xe-0/0/2", "switch_id": "10:0e:7e:bd:94:72" } ] } ] } Sample Node profile: { "resources": [ { "kind": "card", "data": { "name": "card1", "fq_name": ["card1"], "interface_map": { "port_info": [ { "name": "enp94s0f2", "labels": ["physnet1"] }, { "name": "enp94s0f3", "labels": ["physnet2"] } ] } } }, { "kind": "hardware", "data": { "name": "sriov-server1", "fq_name": ["sriov-server1"], "card_refs": [ { "to": ["card1"] } ] } }, { "kind": "tag", "data": { "tag_type_name": "label", "tag_value": "phynet1", "fq_name": ["label=physnet1"] } }, { "kind": "tag", "data": { "tag_type_name": "label", "tag_value": "physnet2", "fq_name": ["label=physnet2"] } }, { "kind": "node_profile", "data": { "hardware_refs": [ { "to": ["sriov-server1"] } ], "parent_type": "global-system-config", "name": "sriov_1", "fq_name": ["default-global-system-config", "sriov_1"], "node_profile_vendor": "Sriov-server", "node_profile_type": "end-system" } } ] }
Deploy RHOSP13 with ML2 Plug-in
Follow these steps to deploy RHOSP13 with ML2 plug-in.
For detailed instructions on deployment, see RHOSP13 DIRECTOR INSTALLATION AND USAGE.
Configure Connectivity between RHOSP Internal API Network and Contrail Command Virtual Machines
To configure connectivity between RHOSP internal API network and Contrail Command virtual machines, assign an IP from the network to an interface of the virtual machine.
[stack@command ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth2 # This file is autogenerated by os-net-config DEVICE=eth2 ONBOOT=yes HOTPLUG=no NM_CONTROLLED=no BOOTPROTO=none MTU=1500 [stack@command ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth2.710 # This file is autogenerated by os-net-config TYPE=vlan VLAN=yes DEVICE=eth2.710 ONBOOT=yes HOTPLUG=no NM_CONTROLLED=no BOOTPROTO=none MTU=1500 IPADDR=10.1.0.9 NETMASK=255.255.xxx.x
Add Red Hat OpenStack Orchestrator
You can add Red Hat OpenStack Orchestrator by using the Contrail Command user interface.
Follow these steps to add Red Hat OpenStack Orchestrator.
Create Swift Containers in OpenStack
Create a swift container and name it ”contrail_container” with public read and list permissions. You can create a swift container from the Openstack UI.
Follow these steps to create a swift container by using the OpenStack UI.
(Optional) Deploy AppFormix and sFlows
Install AppFormix and xFlows by using appformix-ansible-deployer
. Ensure that instance.yml has information on OOO and Keystone.
After you have installed Contrail and Red Hat OpenStack, follow these steps to install AppFormix HA and xFlows HA.
Follow these steps to install AppFormix HA.
Before you begin, ensure that Python3 is installed on xFlow nodes.
Follow these steps to install xFlow HA.
Identify the Contrail Cluster ID from the /contrail-clusters API by using a debugger.
Add
appformix_flows
role to the node in the instances.yml file, where you want to install xFlows.#docker exec -it contrail_command bash #cd /usr/share/contrail/appformix-ansible-deployer/xflow #source venv/bin/activate #bash deploy_insights_flow.sh <instances.yml path> --cluster-id <contrail_cluster_id>
Sample instances.yml file snippets.
in-band installation of xFlows.
instances: host1: ip: 10.XX.XX.137 provider: bms roles: config: analytics: openstack: appformix_openstack_controller: host2: ip: 10.XX.XX.136 provider: bms roles: appformix_bare_host: host3: ip: 10.XX.XX.135 provider: bms roles: appformix_bare_host: appformix_flows: …... contrail_configuration: AUTH_MODE: keystone KEYSTONE_AUTH_HOST: 10.XX.XX.137 KEYSTONE_AUTH_URL_VERSION: /v3 ……. xflow_configuration: telemetry_in_band_cidr: 1.XX.XX.1/24 loadbalancer_management_vip: 10.XX.XX.166 loadbalancer_collector_vip: 1.XX.XX.3 telemetry_in_band_vlan_id: 51
xflow_configuration
for out-of-band installation of xFlows.xflow_configuration: loadbalancer_collector_vip: 10.XX.XX.166
After AppFormix and xFlows installation is completed, add endpoints.
Navigate to Infrastructure>Cluster>Advanced Options>Endpoints page in the Contrail Command UI and click Create to add endpoints.
Sample Network Files
tripleo-heat-templates/network/config/single-nic-vlans/role.role.j2.yaml
heat_template_version: queens description: > Software Config to drive os-net-config to configure VLANs for the {{role.name}} role. parameters: ControlPlaneIp: default: '' description: IP address/subnet on the ctlplane network type: string {%- for network in networks %} {{network.name}}IpSubnet: default: '' description: IP address/subnet on the {{network.name_lower}} network type: string {%- endfor %} {%- for network in networks %} {{network.name}}NetworkVlanID: default: {{network.vlan}} description: Vlan ID for the {{network.name_lower}} network traffic. type: number {%- endfor %} ControlPlaneSubnetCidr: # Override this via parameter_defaults default: '24' description: The subnet CIDR of the control plane network. type: string ControlPlaneDefaultRoute: # Override this via parameter_defaults description: The default route of the control plane network. type: string {%- for network in networks %} {%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} {{network.name}}InterfaceDefaultRoute: default: '{{network.gateway_ipv6}}' description: default route for the {{network.name_lower}} network type: string {%- elif network.gateway_ip|default(false) %} {{network.name}}InterfaceDefaultRoute: default: '{{network.gateway_ip}}' description: default route for the {{network.name_lower}} network type: string {%- endif %} {%- endfor %} DnsServers: # Override this via parameter_defaults default: [] description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. type: comma_delimited_list EC2MetadataIp: # Override this via parameter_defaults description: The IP address of the EC2 metadata server. type: string DnsSearchDomains: # Override this via parameter_defaults default: [] description: A list of DNS search domains to be added (in order) to resolv.conf. type: comma_delimited_list resources: OsNetConfigImpl: type: OS::Heat::SoftwareConfig properties: group: script config: str_replace: template: get_file: ../../scripts/run-os-net-config.sh params: $network_config: network_config: - type: ovs_bridge {%- if role.name.startswith('CephStorage') or role.name.startswith('ObjectStorage') or role.name.startswith('BlockStorage') %} name: br-storage {%- else %} name: bridge_name {%- endif %} use_dhcp: false dns_servers: get_param: DnsServers domain: get_param: DnsSearchDomains addresses: - ip_netmask: list_join: - / - - get_param: ControlPlaneIp - get_param: ControlPlaneSubnetCidr routes: - ip_netmask: 169.254.xxx.xxx/32 next_hop: get_param: EC2MetadataIp - default: true next_hop: get_param: ControlPlaneDefaultRoute members: - type: interface name: nic1 # force the MAC address of the bridge to this interface primary: true {%- for network in networks if network.enabled|default(true) and network.name in role.networks %} {%- if network.name not in ["Tenant"] %} - type: vlan vlan_id: get_param: {{network.name}}NetworkVlanID addresses: - ip_netmask: get_param: {{network.name}}IpSubnet {%- endif %} {%- endfor %} - type: ovs_bridge name: br-vlans members: - type: interface name: nic2 primary: true outputs: OS::stack_id: description: The OsNetConfigImpl resource. value: get_resource: OsNetConfigImpl
tripleo-heat-templates/network/config/single-nic-vlans/compute-sriov.yaml
heat_template_version: queens description: > Software Config to drive os-net-config to configure VLANs for the {{role.name}} role. parameters: ControlPlaneIp: default: '' description: IP address/subnet on the ctlplane network type: string {%- for network in networks %} {{network.name}}IpSubnet: default: '' description: IP address/subnet on the {{network.name_lower}} network type: string {%- endfor %} {%- for network in networks %} {{network.name}}NetworkVlanID: default: {{network.vlan}} description: Vlan ID for the {{network.name_lower}} network traffic. type: number {%- endfor %} ControlPlaneSubnetCidr: # Override this via parameter_defaults default: '24' description: The subnet CIDR of the control plane network. type: string ControlPlaneDefaultRoute: # Override this via parameter_defaults description: The default route of the control plane network. type: string {%- for network in networks %} {%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} {{network.name}}InterfaceDefaultRoute: default: '{{network.gateway_ipv6}}' description: default route for the {{network.name_lower}} network type: string {%- elif network.gateway_ip|default(false) %} {{network.name}}InterfaceDefaultRoute: default: '{{network.gateway_ip}}' description: default route for the {{network.name_lower}} network type: string {%- endif %} {%- endfor %} DnsServers: # Override this via parameter_defaults default: [] description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. type: comma_delimited_list EC2MetadataIp: # Override this via parameter_defaults description: The IP address of the EC2 metadata server. type: string DnsSearchDomains: # Override this via parameter_defaults default: [] description: A list of DNS search domains to be added (in order) to resolv.conf. type: comma_delimited_list resources: OsNetConfigImpl: type: OS::Heat::SoftwareConfig properties: group: script config: str_replace: template: get_file: ../../scripts/run-os-net-config.sh params: $network_config: network_config: - type: ovs_bridge {%- if role.name.startswith('CephStorage') or role.name.startswith('ObjectStorage') or role.name.startswith('BlockStorage') %} name: br-storage {%- else %} name: bridge_name {%- endif %} use_dhcp: false dns_servers: get_param: DnsServers domain: get_param: DnsSearchDomains addresses: - ip_netmask: list_join: - / - - get_param: ControlPlaneIp - get_param: ControlPlaneSubnetCidr routes: - ip_netmask: 169.254.xxx.xxx/32 next_hop: get_param: EC2MetadataIp - default: true next_hop: get_param: ControlPlaneDefaultRoute members: - type: interface name: nic1 # force the MAC address of the bridge to this interface primary: true {%- for network in networks if network.enabled|default(true) and network.name in role.networks %} {%- if network.name not in ["Tenant"] %} - type: vlan vlan_id: get_param: {{network.name}}NetworkVlanID addresses: - ip_netmask: get_param: {{network.name}}IpSubnet {%- endif %} {%- endfor %} - type: ovs_bridge name: br-vlans members: - type: interface name: nic2 primary: true - type: ovs_bridge name: br-link0 members: - type: interface name: nic3 primary: true - type: ovs_bridge name: br-link1 members: - type: interface name: nic4 primary: true outputs: OS::stack_id: description: The OsNetConfigImpl resource. value: get_resource: OsNetConfigImpl
Change History Table
Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.