Composable Midonet for Neutron
authorDan Prince <dprince@redhat.com>
Thu, 23 Jun 2016 14:52:43 +0000 (10:52 -0400)
committerEmilien Macchi <emilien@redhat.com>
Fri, 8 Jul 2016 14:44:05 +0000 (14:44 +0000)
Depends-On: I2393fc3c360f5f5786411f64dbcd06f380376093

Change-Id: I606cb1f7ef7d651b5d145bfa10ef3aa1561b1590
Partially-implements: blueprint composable-services-within-roles

environments/neutron-midonet.yaml
environments/puppet-pacemaker.yaml
overcloud-resource-registry-puppet.yaml
puppet/manifests/overcloud_controller.pp
puppet/manifests/overcloud_controller_pacemaker.pp
puppet/services/neutron-midonet.yaml [new file with mode: 0644]
puppet/services/pacemaker/neutron-midonet.yaml [new file with mode: 0644]

index 7f50f15..90b98ae 100644 (file)
@@ -4,6 +4,8 @@ resource_registry:
   OS::TripleO::Controller::Net::SoftwareConfig: ../net-config-linux-bridge.yaml # We have to avoid any ovs bridge. MidoNet is incompatible with its datapath
   OS::TripleO::Services::NeutronL3Agent: OS::Heat::None
   OS::TripleO::Services::NeutronOvsAgent: OS::Heat::None
+  # Override the NeutronCorePlugin to use Nuage
+  OS::TripleO::Services::NeutronCorePlugin: OS::TripleO::Services::NeutronCorePluginMidonet
 
 parameter_defaults:
   EnableZookeeperOnController: true
index d1df6c4..8043ccb 100644 (file)
@@ -28,6 +28,7 @@ resource_registry:
   OS::TripleO::Services::NeutronCorePluginPlumgrid: ../puppet/services/pacemaker/neutron-plugin-plumgrid.yaml
   OS::TripleO::Services::NeutronCorePluginNuage: ../puppet/services/pacemaker/neutron-plugin-nuage.yaml
   OS::TripleO::Services::NeutronCorePluginOpencontrail: ../puppet/services/pacemaker/neutron-plugin-opencontrail.yaml
+  OS::TripleO::Services::NeutronCorePluginMidonet: ../puppet/services/pacemaker/neutron-midonet.yaml
   OS::TripleO::Services::NeutronOvsAgent: ../puppet/services/pacemaker/neutron-ovs-agent.yaml
   OS::TripleO::Services::RabbitMQ: ../puppet/services/pacemaker/rabbitmq.yaml
   OS::TripleO::Services::HAproxy: ../puppet/services/pacemaker/haproxy.yaml
index 8ec2a79..591b030 100644 (file)
@@ -151,6 +151,7 @@ resource_registry:
   OS::TripleO::Services::NeutronCorePluginPlumgrid: puppet/services/neutron-plugin-plumgrid.yaml
   OS::TripleO::Services::NeutronCorePluginNuage: puppet/services/neutron-plugin-nuage.yaml
   OS::TripleO::Services::NeutronCorePluginOpencontrail: puppet/services/neutron-plugin-opencontrail.yaml
+  OS::TripleO::Services::NeutronCorePluginMidonet: puppet/services/neutron-midonet.yaml
   OS::TripleO::Services::NeutronOvsAgent: puppet/services/neutron-ovs-agent.yaml
   OS::TripleO::Services::RabbitMQ: puppet/services/rabbitmq.yaml
   OS::TripleO::Services::HAproxy: puppet/services/haproxy.yaml
index 985b3f0..de84bcf 100644 (file)
@@ -87,66 +87,6 @@ if hiera('step') >= 4 {
   }
   include ::nova::config
 
-  if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
-
-    # TODO(devvesa) provide non-controller ips for these services
-    $zookeeper_node_ips = hiera('neutron_api_node_ips')
-    $cassandra_node_ips = hiera('neutron_api_node_ips')
-
-    # Run zookeeper in the controller if configured
-    if hiera('enable_zookeeper_on_controller') {
-      class {'::tripleo::cluster::zookeeper':
-        zookeeper_server_ips => $zookeeper_node_ips,
-        # TODO: create a 'bind' hiera key for zookeeper
-        zookeeper_client_ip  => hiera('neutron::bind_host'),
-        zookeeper_hostnames  => hiera('controller_node_names')
-      }
-    }
-
-    # Run cassandra in the controller if configured
-    if hiera('enable_cassandra_on_controller') {
-      class {'::tripleo::cluster::cassandra':
-        cassandra_servers => $cassandra_node_ips,
-        # TODO: create a 'bind' hiera key for cassandra
-        cassandra_ip      => hiera('neutron::bind_host'),
-      }
-    }
-
-    class {'::tripleo::network::midonet::agent':
-      zookeeper_servers => $zookeeper_node_ips,
-      cassandra_seeds   => $cassandra_node_ips
-    }
-
-    class {'::tripleo::network::midonet::api':
-      zookeeper_servers    => $zookeeper_node_ips,
-      vip                  => hiera('public_virtual_ip'),
-      keystone_ip          => hiera('public_virtual_ip'),
-      keystone_admin_token => hiera('keystone::admin_token'),
-      # TODO: create a 'bind' hiera key for api
-      bind_address         => hiera('neutron::bind_host'),
-      admin_password       => hiera('admin_password')
-    }
-
-    # TODO: find a way to get an empty list from hiera
-    # TODO: when doing the composable midonet plugin, don't forget to
-    # set service_plugins to an empty array in Hiera.
-    class {'::neutron':
-      service_plugins => []
-    }
-
-  }
-
-  # If the value of core plugin is set to 'midonet',
-  # skip all the ML2 configuration
-  if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
-
-    class {'::neutron::plugins::midonet':
-      midonet_api_ip    => hiera('public_virtual_ip'),
-      keystone_tenant   => hiera('neutron::server::auth_tenant'),
-      keystone_password => hiera('neutron::server::password')
-    }
-  }
-
   # Ceilometer
   $ceilometer_backend = downcase(hiera('ceilometer_backend'))
   case $ceilometer_backend {
index ce9c6f7..d7b1ce5 100644 (file)
@@ -281,63 +281,6 @@ MYSQL_HOST=localhost\n",
 
   include ::nova::config
 
-  if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
-
-    # TODO(devvesa) provide non-controller ips for these services
-    $zookeeper_node_ips = hiera('neutron_api_node_ips')
-    $cassandra_node_ips = hiera('neutron_api_node_ips')
-
-    # Run zookeeper in the controller if configured
-    if hiera('enable_zookeeper_on_controller') {
-      class {'::tripleo::cluster::zookeeper':
-        zookeeper_server_ips => $zookeeper_node_ips,
-        # TODO: create a 'bind' hiera key for zookeeper
-        zookeeper_client_ip  => hiera('neutron::bind_host'),
-        zookeeper_hostnames  => split(hiera('controller_node_names'), ',')
-      }
-    }
-
-    # Run cassandra in the controller if configured
-    if hiera('enable_cassandra_on_controller') {
-      class {'::tripleo::cluster::cassandra':
-        cassandra_servers => $cassandra_node_ips,
-        # TODO: create a 'bind' hiera key for cassandra
-        cassandra_ip      => hiera('neutron::bind_host'),
-      }
-    }
-
-    class {'::tripleo::network::midonet::agent':
-      zookeeper_servers => $zookeeper_node_ips,
-      cassandra_seeds   => $cassandra_node_ips
-    }
-
-    class {'::tripleo::network::midonet::api':
-      zookeeper_servers    => $zookeeper_node_ips,
-      vip                  => hiera('public_virtual_ip'),
-      keystone_ip          => hiera('public_virtual_ip'),
-      keystone_admin_token => hiera('keystone::admin_token'),
-      # TODO: create a 'bind' hiera key for api
-      bind_address         => hiera('neutron::bind_host'),
-      admin_password       => hiera('admin_password')
-    }
-
-    # Configure Neutron
-    # TODO: when doing the composable midonet plugin, don't forget to
-    # set service_plugins to an empty array in Hiera.
-    class {'::neutron':
-      service_plugins => []
-    }
-
-  }
-
-  if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
-    class {'::neutron::plugins::midonet':
-      midonet_api_ip    => hiera('public_virtual_ip'),
-      keystone_tenant   => hiera('neutron::server::auth_tenant'),
-      keystone_password => hiera('neutron::server::password')
-    }
-  }
-
   # Ceilometer
   case downcase(hiera('ceilometer_backend')) {
     /mysql/: {
@@ -519,49 +462,6 @@ password=\"${mysql_root_password}\"",
                           Pacemaker::Resource::Ocf['openstack-core']],
     }
 
-    if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
-      pacemaker::resource::service {'tomcat':
-        clone_params => 'interleave=true',
-      }
-    }
-    if hiera('neutron::core_plugin') == 'midonet.neutron.plugin_v1.MidonetPluginV2' {
-      #midonet-chain chain keystone-->neutron-server-->dhcp-->metadata->tomcat
-      pacemaker::constraint::base { 'neutron-server-to-dhcp-agent-constraint':
-        constraint_type => 'order',
-        first_resource  => "${::neutron::params::server_service}-clone",
-        second_resource => "${::neutron::params::dhcp_agent_service}-clone",
-        first_action    => 'start',
-        second_action   => 'start',
-        require         => [Pacemaker::Resource::Service[$::neutron::params::server_service],
-                            Pacemaker::Resource::Service[$::neutron::params::dhcp_agent_service]],
-      }
-      pacemaker::constraint::base { 'neutron-dhcp-agent-to-metadata-agent-constraint':
-        constraint_type => 'order',
-        first_resource  => "${::neutron::params::dhcp_agent_service}-clone",
-        second_resource => "${::neutron::params::metadata_agent_service}-clone",
-        first_action    => 'start',
-        second_action   => 'start',
-        require         => [Pacemaker::Resource::Service[$::neutron::params::dhcp_agent_service],
-                            Pacemaker::Resource::Service[$::neutron::params::metadata_agent_service]],
-      }
-      pacemaker::constraint::base { 'neutron-metadata-agent-to-tomcat-constraint':
-        constraint_type => 'order',
-        first_resource  => "${::neutron::params::metadata_agent_service}-clone",
-        second_resource => 'tomcat-clone',
-        first_action    => 'start',
-        second_action   => 'start',
-        require         => [Pacemaker::Resource::Service[$::neutron::params::metadata_agent_service],
-                            Pacemaker::Resource::Service['tomcat']],
-      }
-      pacemaker::constraint::colocation { 'neutron-dhcp-agent-to-metadata-agent-colocation':
-        source  => "${::neutron::params::metadata_agent_service}-clone",
-        target  => "${::neutron::params::dhcp_agent_service}-clone",
-        score   => 'INFINITY',
-        require => [Pacemaker::Resource::Service[$::neutron::params::dhcp_agent_service],
-                    Pacemaker::Resource::Service[$::neutron::params::metadata_agent_service]],
-      }
-    }
-
     # Nova
     pacemaker::constraint::base { 'keystone-then-nova-consoleauth-constraint':
       constraint_type => 'order',
diff --git a/puppet/services/neutron-midonet.yaml b/puppet/services/neutron-midonet.yaml
new file mode 100644 (file)
index 0000000..736c01c
--- /dev/null
@@ -0,0 +1,48 @@
+heat_template_version: 2016-04-08
+
+description: >
+  OpenStack Neutron Midonet plugin and services
+
+parameters:
+  EndpointMap:
+    default: {}
+    description: Mapping of service endpoint -> protocol. Typically set
+                 via parameter_defaults in the resource registry.
+    type: json
+  NeutronPassword:
+    description: The password for the neutron service and db account, used by neutron agents.
+    type: string
+    hidden: true
+  AdminPassword:
+    description: The password for the keystone admin account, used for monitoring, querying neutron etc.
+    type: string
+    hidden: true
+  AdminToken:
+    description: The keystone auth secret and db password.
+    type: string
+    hidden: true
+  EnableZookeeperOnController:
+    label: Enable Zookeeper On Controller
+    description: 'Whether enable Zookeeper cluster on Controller'
+    type: boolean
+    default: false
+  EnableCassandraOnController:
+    label: Enable Cassandra On Controller
+    description: 'Whether enable Cassandra cluster on Controller'
+    type: boolean
+    default: false
+
+outputs:
+  role_data:
+    description: Role data for the Neutron Midonet plugin and services
+    value:
+      config_settings:
+        tripleo::profile::base::neutron::midonet::admin_password: {get_param: AdminPassword}
+        tripleo::profile::base::neutron::midonet::keystone_admin_token: {get_param: AdminToken}
+        tripleo::profile::base::neutron::midonet::neutron_auth_password: {get_param: NeutronPassword}
+        tripleo::profile::base::neutron::midonet::zk_on_controller: {get_param: EnableZookeeperOnController}
+        tripleo::profile::base::neutron::midonet::neutron_auth_tenant: 'service'
+        enable_cassandra_on_controller: {get_param: EnableCassandraOnController}
+        neutron::service_plugins: []
+      step_config: |
+        include tripleo::profile::base::neutron::plugins::midonet
diff --git a/puppet/services/pacemaker/neutron-midonet.yaml b/puppet/services/pacemaker/neutron-midonet.yaml
new file mode 100644 (file)
index 0000000..f9fd992
--- /dev/null
@@ -0,0 +1,28 @@
+heat_template_version: 2016-04-08
+
+description: >
+  OpenStack Neutron Midonet with Pacemaker configured with Puppet
+
+parameters:
+  EndpointMap:
+    default: {}
+    description: Mapping of service endpoint -> protocol. Typically set
+                 via parameter_defaults in the resource registry.
+    type: json
+
+resources:
+
+  NeutronMidonetBase:
+    type: ../neutron-midonet.yaml
+    properties:
+      EndpointMap: {get_param: EndpointMap}
+
+outputs:
+  role_data:
+    description: Role data for the Neutron Midonet plugin.
+    value:
+      config_settings:
+        map_merge:
+          - get_attr: [NeutronMidonetBase, role_data, config_settings]
+      step_config: |
+        include ::tripleo::profile::pacemaker::neutron::plugins::midonet