Puppet Module for MidoNet project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OpenDev Sysadmins a8cec1dc12 OpenDev Migration Patch 2 months ago
data Remove references to non existant zookeeper and cassandra classes 3 years ago
files Configure static uplink ifaces on startup in RHEL7 2 years ago
lib/puppet Add new cidr2ip function 2 years ago
manifests Enable everything so Insights work when deployed 2 years ago
spec Replace openstack.org git:// URLs with https:// 3 months ago
templates Enable everything so Insights work when deployed 2 years ago
.fixtures.yml Rely `puppet-cassandra` for backwards compatibility 4 years ago
.gitignore Moving puppet-midonet to OpenStack gerrit 3 years ago
.gitreview OpenDev Migration Patch 2 months ago
CONTRIBUTING.md Improve documentation for real 3 years ago
Gemfile Pin version of beaker rspecgit add Gemfile 2 years ago
Puppetfile Pin all puppet dependencies in Puppetfile 2 years ago
README.md Makes README.md beautiful and up to date 2 years ago
Rakefile Replace openstack.org git:// URLs with https:// 3 months ago
metadata.json Make sure LB and FWAAS are installed 2 years ago

README.md

midonet

Table of Contents

  1. Overview - What is the midonet module?
  2. Module Description - What does the module do?
  3. Setup - The basics of getting started with midonet
  4. Implementation - An under-the-hood peek at what the module is doing
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module
  7. Contributors - Those with commits

Overview

This Puppet module is maintained by Midokura and is used to flexibly configure and manage all MidoNet components.

To understand all MidoNet components and how they relate to each other, check out the MidoNet Reference Architecture.

Module Description

The midonet module is a thorough attempt to make Puppet capable of managing the entirety of MidoNet. This includes manifests to provision both open source and enterprise components:

  • MidoNet Cluster (formerly known as the MidoNet API)
  • MidoNet CLI
  • MidoNet Agent (also known as Midolman)
  • MEM
  • MEM Insights

Uplink configuration for gateway nodes is also set up through the use of this module. Currently both static and BGP uplinks are supported.

This module is tested in combination with other modules needed to build and leverage a MidoNet installation.

Setup

What the neutron module affects:

  • MidoNet, which replaces the default plugin for Neutron.

Prerequisites

To use this module correctly, the following dependencies have to be met:

  • Have the gems faraday and multipart-post installed correctly (if using Puppet 4.x use the gem executable from Puppet’s main path)
  • Have a working Zookeeper & Cassandra setup

Installing midonet

puppet module install midonet-midonet

Beginning with midonet

A very basic installation of MidoNet on a controller node looks like the following:

include ::midonet::repository

class { '::midonet::cluster':
  zookeeper_hosts      => [ { 'ip' => '127.0.0.1' } ],
  cassandra_servers    => [ { 'ip' => '127.0.0.1' } ],
  cassandra_rep_factor => '1',
  keystone_admin_token => 'token',
  keystone_host        => '127.0.0.1',
} ->
class { '::midonet::cli':
  username => 'admin',
  password => 'safe_password',
} ->
class { '::midonet::agent':
  controller_host => '127.0.0.1',
  metadata_port   => '8775',
  shared_secret   => 'shared_secret',
  zookeeper_hosts => [ { 'ip' => '127.0.0.1' } ],
}

And on compute nodes:

include ::midonet::repository

class { '::midonet::agent':
  controller_host => '127.0.0.1',
  metadata_port   => '8775',
  shared_secret   => 'shared_secret',
  zookeeper_hosts => [ { 'ip' => '127.0.0.1' } ],
}

Afterwards on every controller/compute, the midonet_host_registry custom type should be used to register the node in MidoNet.

On gateway nodes one should install Midolman (see above) and configure the uplink:

  • Use the ::midonet::gateway::static class to configure a fake static uplink
  • Use the midonet_gateway_bgp custom type to configure the BGP uplink

For examples on how to use all the classes see the manifests in the roles folder at midonet/puppet-midonet_openstack.

Implementation

midonet

midonet is a combination of Puppet manifest and ruby code to deliver configuration and extra functionality through types and providers.

Types

midonet_gateway_bgp

The midonet_gateway_bgp provider allows to configure a BGP uplink in the gateway node.

midonet_gateway_bgp { 'edge-router':
  ensure                  => present,
  bgp_local_as_number     => '65520',
  bgp_advertised_networks => [ '200.200.0.0/24' ],
  bgp_neighbors           => [
    {
      'ip_address' => '192.168.1.6',
      'remote_asn' => '65506',
      'remote_net' => '192.168.1.0/24'
    }
  ],
  midonet_api_url         => 'http://127.0.0.1:8181',
  username                => 'admin',
  password                => 'safe_password',
  tenant_name             => 'admin',
}
bgp_local_as_number

The local AS number that this gateway will use.

bgp_advertised_networks

An array listing all the floating IP networks that will be advertised.

bgp_neighbors

An array of BGP peers. Each on the elements needs to have the following attributes:

  • ip_address: IP address of the BGP peer
  • remote_asn: Remote AS number
  • remote_net: Network on which the BGP peer is
midonet_api_url

URL of the MidoNet API in the format http://<HOST>:<PORT>.

username

Username for the admin user. Defaults to admin.

password

Password for this user. Defaults to admin.

tenant_name

Tenant name on which we want to apply the changes. Defaults to admin.

midonet_host_registry

The midonet_host_registry registers a MidoNet node through the MidoNet API. It is necessary to use this type on every node that runs Midolman.

midonet_host_registry { 'myhost':
  ensure              => present,
  midonet_api_url     => 'http://127.0.0.1:8181',
  tunnelzone_name     => 'tzone0'
  tunnelzone_type     => 'gre',
  username            => 'admin',
  password            => 'admin',
  tenant_name         => 'admin',
  underlay_ip_address => $::ipaddress,
}
midonet_api_url

URL for the MidoNet API in the form of http://<HOST>:<PORT>.

tunnelzone_name

Name of the tunnel zone where the host will be registered. Defaults to tzone0.

tunnelzone_type

The type of tunnel zone. Can be set to gre or vxlan. Defaults to gre.

username

Username of the admin user in Keystone. Defaults to admin.

password

Password of the admin user in Keystone. Defaults to admin.

tenant_name

Tenant name of the admin user. Defaults to admin.

underlay_ip_address

IP address that will be used to as the underlay layer to create the tunnels. It will take the fact $::ipaddress by default.

midonet_client_conf

This type is used to manage the configuration at /root/.midonetrc.

midonet_client_conf {
  'cli/username': value => 'admin';
}

This would set the username setting inside the cli section to admin.

Limitations

The following platforms are supported:

  • Ubuntu 14.04 (Trusty)
  • Ubuntu 16.04 (Xenial)
  • CentOS 7

The module has been tested in both Puppet versions 3.x and 4.x.

Please note that if there is a dedicated analytics node provisioned with ::midonet::analytics you will need to place a virtualhost file manually on the controller for the midonet manager to be able to reach the analytics endpoints (using ProxyPass is enough).

Beaker-Rspec

This module has beaker-rspec tests

To run:

bundle install
bundle exec rspec spec/acceptance

Development

The project follows for the most part the OpenStack development model. Developer documentation for the entire puppet-openstack project is at:

Check out current bugs or open new ones on JIRA project:

https://midonet.atlassian.net/projects/PUP

Feel free to assign an empty one to yourself!

Contributors

The github contributor graph.