From 71d59bb0a34349f3ed2b95d70452b771cc8039d2 Mon Sep 17 00:00:00 2001 From: Numan Siddique Date: Thu, 25 Jan 2018 19:33:39 +0530 Subject: [PATCH] ovn: Provide the option to configure OVNCMSOptions ('ovn-cms-options') as a role parameter This option was recently supported in ovn-controller [1]. If this value is configured in the external_ids column of OpenvSwitch table of OVS database, ovn-controller copies it to the chassis table, which will be read by Neutron OVN mechanism driver. OVN mech driver can take certain decisions based on the value. One such use case is setting the value 'enable-chassis-as-gw' in this option. Only those chassis which has this option set, will be considered as a candidate to schedule a neutron router. So, the administrator can decide to use only controller nodes (or networker nodes) for scheduling the router. [1] - https://github.com/openvswitch/ovs/commit/4705963f2ce3d0a1fa2184f1456944cf23711284 Change-Id: Iabe5aec30c740447b9714e1b1ace366768488bdb Signed-off-by: Numan Siddique --- docker/services/ovn-controller.yaml | 17 ++++++++++++++++- .../services-docker/neutron-ovn-ha.yaml | 2 ++ environments/services-docker/neutron-ovn.yaml | 2 ++ puppet/services/ovn-controller.yaml | 6 ++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/docker/services/ovn-controller.yaml b/docker/services/ovn-controller.yaml index f7299ae7f4..189d78c169 100644 --- a/docker/services/ovn-controller.yaml +++ b/docker/services/ovn-controller.yaml @@ -87,8 +87,23 @@ outputs: recurse: true docker_config: step_4: + configure_cms_options: + start_order: 0 + detach: false + net: host + privileged: true + user: root + command: ['/bin/bash', '-c', 'CMS_OPTS=$(hiera ovn::controller::ovn_cms_options -c /etc/puppet/hiera.yaml); if [ X"$CMS_OPTS" != X ]; then ovs-vsctl set open . external_ids:ovn-cms-opts=$CMS_OPTS; fi'] + image: &ovn_controller_image {get_param: DockerOvnControllerImage} + volumes: + list_concat: + - {get_attr: [ContainersCommon, volumes]} + - + - /lib/modules:/lib/modules:ro + - /run/openvswitch:/run/openvswitch ovn_controller: - image: {get_param: DockerOvnControllerImage} + start_order: 1 + image: *ovn_controller_image net: host privileged: true user: root diff --git a/environments/services-docker/neutron-ovn-ha.yaml b/environments/services-docker/neutron-ovn-ha.yaml index 2a36c46232..faf3beaeb4 100644 --- a/environments/services-docker/neutron-ovn-ha.yaml +++ b/environments/services-docker/neutron-ovn-ha.yaml @@ -27,3 +27,5 @@ parameter_defaults: NeutronPluginExtensions: "qos,port_security,dns" ComputeParameters: NeutronBridgeMappings: "" + ControllerParameters: + OVNCMSOptions: "enable-chassis-as-gw" diff --git a/environments/services-docker/neutron-ovn.yaml b/environments/services-docker/neutron-ovn.yaml index d79a6117e3..c766bb6a92 100644 --- a/environments/services-docker/neutron-ovn.yaml +++ b/environments/services-docker/neutron-ovn.yaml @@ -27,3 +27,5 @@ parameter_defaults: NeutronPluginExtensions: "qos,port_security,dns" ComputeParameters: NeutronBridgeMappings: "" + ControllerParameters: + OVNCMSOptions: "enable-chassis-as-gw" diff --git a/puppet/services/ovn-controller.yaml b/puppet/services/ovn-controller.yaml index 106caf02f7..18cb9665d2 100644 --- a/puppet/services/ovn-controller.yaml +++ b/puppet/services/ovn-controller.yaml @@ -57,6 +57,10 @@ parameters: description: Whether Metadata Service has to be enabled type: boolean default: true + OVNCMSOptions: + description: The CMS options to configure in ovs db + type: string + default: "" resources: @@ -70,9 +74,11 @@ resources: map_replace: - map_replace: - ovn::controller::ovn_bridge_mappings: NeutronBridgeMappings + ovn::controller::ovn_cms_options: OVNCMSOptions - values: {get_param: [RoleParameters]} - values: NeutronBridgeMappings: {get_param: NeutronBridgeMappings} + OVNCMSOptions: {get_param: OVNCMSOptions} conditions: force_config_drive: {equals: [{get_param: OVNMetadataEnabled}, false]}