Finish the 2.0 plugin main features

Although I know this not follows best practices, this huge commit
reorganizes and defines the mail functionality for the rest of the
plugin refactor work:

 * Renames and moves tasks to puppet/manifests/midonet-* names
 * Stops, reconfigures and restarts Neutron
 * Makes DHCP and metadata work
 * Improves documentation

Change-Id: I6d5ed20ba212a089b808c09fe50a8aedaab74721
This commit is contained in:
Jaume Devesa 2015-07-20 19:27:57 +02:00
parent 42b1053123
commit 3b9b7ee013
53 changed files with 657 additions and 1563 deletions

1
.gitignore vendored
View File

@ -1,3 +1,2 @@
.build/
**.rpm
**.swp

View File

@ -1,38 +0,0 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$all_nodes = $fuel_settings['nodes']
$nsdb_nodes = filter_nodes($all_nodes, 'role', 'nsdb')
$zoo_ips = generate_api_zookeeper_ips($nsdb_nodes)
$m_version = $fuel_settings['midonet']['version']
# MidoNet api manifest
class {'::midonet::repository':
midonet_repo => "http://repo.midonet.org/midonet/${m_version}/RHEL"
} ->
class {'::midonet::midonet_api':
zk_servers => $zoo_ips,
keystone_auth => true,
keystone_host => $::fuel_settings['management_vip'],
keystone_admin_token => $::fuel_settings['keystone']['admin_token'],
api_ip => $::fuel_settings['public_vip'],
api_port => '8081'
}
# HA proxy configuration
Openstack::Ha::Haproxy_service {
server_names => filter_hash($::controllers, 'name'),
ipaddresses => filter_hash($::controllers, 'internal_address'),
public_virtual_ip => $::fuel_settings['public_vip'],
internal_virtual_ip => $::fuel_settings['management_vip'],
}
#TODO(haproxy call)
# Open ports
firewall {'502 Midonet api':
port => '8081',
proto => 'tcp',
action => 'accept',
}

View File

@ -0,0 +1,11 @@
#!/bin/bash
source /root/openrc
router_id=`neutron router-list | grep "network_id" | awk '{print $2}'`
neutron router-gateway-clear $router_id
subnet_id=`neutron router-port-list $router_id | grep "subnet_id" | awk '{print $8}' | awk -F '\"' '{print $2}'`
neutron router-interface-delete $router_id $subnet_id
neutron router-delete $router_id
neutron subnet-delete $subnet_id
neutron net-delete net04
neutron net-delete net04_ext

View File

@ -1,21 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
file { '/etc/yum.repos.d/CentOS-Base.repo':
ensure => absent,
}
file { '/etc/yum.repos.d/epel.repo':
ensure => absent,
}

View File

@ -1,17 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
$fuel_settings = parseyaml($astute_settings_yaml)
$service_endpoint = $::fuel_settings['management_vip']
class { 'plugin_midonet::compute_neutron': }

View File

@ -1,79 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
$fuel_settings = parseyaml($astute_settings_yaml)
$nodes_hash = $::fuel_settings['nodes']
$node = filter_nodes($nodes_hash,'name',$::hostname)
#Network
$internal_address = $node[0]['internal_address']
$public_int = $::fuel_settings['public_interface']
$gateways = filter_nodes($nodes_hash,'role','midonet-gw')
$gateways_internal_addresses = nodes_to_hash($gateways,'name','internal_address')
#amqp
$primary_controller_nodes = filter_nodes($nodes_hash,'role','primary-controller')
$controllers = concat($primary_controller_nodes, filter_nodes($nodes_hash,'role','controller'))
$controller_internal_addresses = nodes_to_hash($controllers,'name','internal_address')
$controller_nodes = ipsort(values($controller_internal_addresses))
if $::internal_address in $controller_nodes {
# prefer local MQ broker if it exists on this node
$amqp_nodes = concat(['127.0.0.1'], fqdn_rotate(delete($controller_nodes, $::internal_address)))
} else {
$amqp_nodes = fqdn_rotate($controller_nodes)
}
$amqp_port = '5673'
$amqp_hosts = inline_template("<%= @amqp_nodes.map {|x| x + ':' + @amqp_port}.join ',' %>")
$amqp_user = 'nova'
$amqp_password = $::fuel_settings['rabbit']['password']
$access_hash = $::fuel_settings['access']
$midonet_api_address = $primary_controller_nodes[0]['internal_address']
#Logging
$verbose = true
$debug = $::fuel_settings['debug']
$use_syslog = $::fuel_settings['use_syslog'] ? { default=>true }
$syslog_log_facility_neutron = 'LOG_LOCAL4'
#Neutron
$db_host = $::fuel_settings['management_vip']
$neutron_db_user = 'neutron'
$neutron_config = $::fuel_settings['quantum_settings']
$network_provider = 'neutron'
$neutron_db_password = $neutron_config['database']['passwd']
$neutron_user_password = $neutron_config['keystone']['admin_password']
$neutron_metadata_proxy_secret = $neutron_config['metadata']['metadata_proxy_shared_secret']
$base_mac = 'fa:16:3e:00:00:00'
$neutron_db_dbname = 'neutron'
$service_plugins = ['neutron.services.l3_router.l3_router_plugin.L3RouterPlugin','neutron.services.metering.metering_plugin.MeteringPlugin']
$mechanism_drivers = 'openvswitch'
$service_endpoint = $::fuel_settings['management_vip']
#Nova
$nova_user_password = $::fuel_settings['nova']['user_password']
stage { 'repos':
before => Stage['main']
}
class {'plugin_midonet::repos':
stage => repos,
}
class {'plugin_midonet::controller':
} ->
exec { '/etc/init.d/tomcat6 restart':
}

View File

@ -53,15 +53,35 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
EOF
cat <<EOF > /etc/yum.repos.d/midonet-third-party.repo
[midonet-third-party]
name=Midonet third party repo
baseurl=http://repo.midonet.org/misc/RHEL/6/misc
enabled=1
gpgcheck=1
gpgkey=http://repo.midonet.org/packages.midokura.key
timeout=60
EOF
gem install json
gem install faraday
# Need to set these steps for a default zookeeper installation
yum install -y java-1.7.0-openjdk
mkdir -p /usr/java
ln -s /etc/alternatives/jre_1.7.0 /usr/java/default
fi
puppet module uninstall puppetlabs-stdlib
puppet module install ripienaar-module_data
puppet module install midonet-cassandra
puppet module install deric-zookeeper
puppet module install puppetlabs-apt
puppet module install puppetlabs-java
puppet module install puppetlabs-tomcat --ignore-dependencies
puppet module install ripienaar-module_data --force
puppet module install puppetlabs-java --ignore-dependencies --force
puppet module install puppetlabs-apt --ignore-dependencies --force
puppet module install midonet-cassandra --ignore-dependencies --force
puppet module install richardc-datacat --force
puppet module install deric-zookeeper --ignore-dependencies --force
puppet module install puppetlabs-concat --ignore-dependencies --force
puppet module install nanliu-staging --ignore-dependencies --force
puppet module install puppetlabs-tomcat --ignore-dependencies --force
rm -rf /etc/puppet/modules/midonet
git clone git://github.com/midonet/puppet-midonet /etc/puppet/modules/midonet
if [[ ! -a /etc/puppet/modules/neutron/manifests/plugins/midonet.pp ]]; then

View File

@ -1,77 +0,0 @@
#!/bin/bash
osfamily=$(facter osfamily)
if [[ $osfamily == "RedHat" ]]; then
# Install lsb library to get '$::lsbdistrelease' and '$::lsbmajdistrelease'
yum -y install redhat-lsb-core git
# Install epel repo
yum -y localinstall https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# Install Cento5 Vault repos for Java 1.7 OpenJDK and dependencies
cat <<EOF > /etc/yum.repos.d/Centos5-Vault.repo
[C6.5-base]
name=CentOS-6.5 - Base
baseurl=http://vault.centos.org/6.5/os/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
[C6.5-updates]
name=CentOS-6.5 - Updates
baseurl=http://vault.centos.org/6.5/updates/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
[C6.5-extras]
name=CentOS-6.5 - Extras
baseurl=http://vault.centos.org/6.5/extras/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
[C6.5-contrib]
name=CentOS-6.5 - Contrib
baseurl=http://vault.centos.org/6.5/contrib/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
[C6.5-centosplus]
name=CentOS-6.5 - CentOSPlus
baseurl=http://vault.centos.org/6.5/centosplus/\$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
EOF
cat <<EOF > /etc/yum.repos.d/midonet-third-party.repo
[midonet-third-party]
name=Midonet third party repo
baseurl=http://repo.midonet.org/misc/RHEL/6/misc
enabled=1
gpgcheck=1
gpgkey=http://repo.midonet.org/packages.midokura.key
timeout=60
EOF
# Need to set these steps for a default zookeeper installation
yum install -y java-1.7.0-openjdk
mkdir -p /usr/java
ln -s /etc/alternatives/jre_1.7.0 /usr/java/default
fi
puppet module uninstall puppetlabs-stdlib
puppet module install ripienaar-module_data
puppet module install midonet-cassandra
puppet module install deric-zookeeper
puppet module install puppetlabs-apt
puppet module install puppetlabs-java
puppet module install puppetlabs-tomcat --ignore-dependencies
git clone git://github.com/midonet/puppet-midonet /etc/puppet/modules/midonet

View File

@ -1,32 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
$fuel_settings = parseyaml($astute_settings_yaml)
$nodes_hash = $::fuel_settings['nodes']
$node = filter_nodes($nodes_hash,'name',$::hostname)
$internal_address = $node[0]['internal_address']
$gateways = filter_nodes($nodes_hash,'role','midonet-gw')
$gateways_internal_addresses = nodes_to_hash($gateways,'name','internal_address')
stage { 'repos':
before => Stage['main']
}
class {'plugin_midonet::repos':
stage => repos,
}
class {'plugin_midonet::midolman':
}

View File

@ -0,0 +1,17 @@
exec {'service midolman stop':
path => '/sbin'
} ->
exec {'/usr/bin/mm-dpctl --delete-dp ovs-system':
path => "/usr/bin:/usr/sbin:/bin",
onlyif => '/usr/bin/mm-dpctl --show-dp ovs-system'
} ->
exec {'/usr/bin/mm-dpctl --delete-dp midonet':
path => "/usr/bin:/usr/sbin:/bin",
onlyif => '/usr/bin/mm-dpctl --show-dp midonet'
} ->
exec {'service midolman start':
path => '/sbin'
}

View File

@ -0,0 +1,63 @@
$nodes_hash = hiera('nodes', {})
$roles = node_roles($nodes_hash, hiera('uid'))
$ovs_agent_name = $operatingsystem ? {
'CentOS' => 'neutron-openvswitch-agent',
'Ubuntu' => 'neutron-plugin-openvswitch-agent',
}
$l3_agent_name = $operatingsystem ? {
'CentOS' => 'neutron-l3-agent',
'Ubuntu' => 'neutron-l3-agent'
}
$dhcp_agent_name = $operatingsystem ? {
'CentOS' => 'neutron-dhcp-agent',
'Ubuntu' => 'neutron-dhcp-agent'
}
$metadata_agent_name = $operatingsystem ? {
'CentOS' => 'neutron-metadata-agent',
'Ubuntu' => 'neutron-metadata-agent'
}
if member($roles, 'primary-controller') {
cs_resource { "p_${ovs_agent_name}":
ensure => absent,
}
exec {'stop-dhcp-agent':
command => 'crm resource stop p_neutron-dhcp-agent',
path => '/usr/bin:/usr/sbin'
} ->
exec {'stop-metadata-agent':
command => 'crm resource stop p_neutron-metadata-agent',
path => '/usr/bin:/usr/sbin'
} ->
exec {'stop-l3-agent':
command => 'crm resource stop p_neutron-l3-agent',
path => '/usr/bin:/usr/sbin'
}
} else {
service {$ovs_agent_name:
ensure => stopped,
enable => false,
}
service {$l3_agent_name:
ensure => stopped,
enable => false,
}
service {$dhcp_agent_name:
ensure => stopped
}
service {$metadata_agent_name:
ensure => stopped
}
}
service { 'neutron-server':
ensure => stopped
}

View File

@ -0,0 +1,19 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$api_ip = $::fuel_settings['management_vip']
$tz_type = $::fuel_settings['midonet']['tunnel_type']
$username = $fuel_settings['access']['user']
$password = $fuel_settings['access']['password']
$tenant_name = $fuel_settings['access']['tenant']
midonet_host_registry {$::fqdn:
midonet_api_url => "http://${api_ip}:8081",
username => $username,
password => $password,
tenant_name => $tenant_name,
underlay_ip_address => $::ipaddress_br_mesh,
tunnelzone_type => $tz_type,
tunnelzone_name => 'tzonefuel',
ensure => present
}

View File

@ -0,0 +1,61 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$all_nodes = $fuel_settings['nodes']
$nsdb_nodes = filter_nodes($all_nodes, 'role', 'nsdb')
$zoo_ips = generate_api_zookeeper_ips($nsdb_nodes)
$cass_hash = nodes_to_hash($nsdb_nodes, 'name', 'internal_address')
$api_ip = $::fuel_settings['management_vip']
$m_version = $::fuel_settings['midonet']['version']
$username = $fuel_settings['access']['user']
$password = $fuel_settings['access']['password']
$tenant_name = $fuel_settings['access']['tenant']
$ovsdb_service_name = $operatingsystem ? {
'CentOS' => 'openvswitch',
'CentOS' => 'openvswitch-switch'
}
$openvswitch_package_neutron = $operatingsystem ? {
'CentOS' => 'openstack-neutron-openvswitch',
'Ubuntu' => 'neutron-plugin-openvswitch-agent'
}
$openvswitch_package = $operatingsystem ? {
'CentOS' => 'openvswitch',
'Ubuntu' => 'openvswitch-switch'
}
$mido_repo = $operatingsystem ? {
'CentOS' => "http://repo.midonet.org/midonet/${m_version}/RHEL",
'Ubuntu' => "http://repo.midonet.org/midonet/${m_version}"
}
# MidoNet api manifest
class {'::midonet::repository':
midonet_repo => $mido_repo
} ->
service {$ovsdb_service_name:
ensure => stopped,
enable => false
} ->
package {$openvswitch_package_neutron:
ensure => absent
} ->
package {$openvswitch_package:
ensure => absent
} ->
class {'::midonet::midonet_agent':
zk_servers => $zoo_ips,
cassandra_seeds => values($cass_hash)
} ->
class {'::midonet::midonet_cli':
api_endpoint => "http://${api_ip}:8081/midonet-api",
username => $username,
password => $password,
tenant_name => $tenant_name
}

View File

@ -0,0 +1,67 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$all_nodes = $fuel_settings['nodes']
$nsdb_nodes = filter_nodes($all_nodes, 'role', 'nsdb')
$zoo_ips = generate_api_zookeeper_ips($nsdb_nodes)
$m_version = $fuel_settings['midonet']['version']
$primary_controller_nodes = filter_nodes($all_nodes, 'role', 'primary-controller')
$controllers = concat($primary_controller_nodes, filter_nodes($all_nodes, 'role', 'controller'))
# MidoNet api manifest
class {'::midonet::repository':
midonet_repo => "http://repo.midonet.org/midonet/${m_version}/RHEL"
} ->
class {'::midonet::midonet_api':
zk_servers => $zoo_ips,
keystone_auth => true,
keystone_host => $::fuel_settings['management_vip'],
keystone_admin_token => $::fuel_settings['keystone']['admin_token'],
bind_address => $::ipaddress_br_mgmt,
api_ip => $::fuel_settings['public_vip'],
api_port => '8081'
}
# HA proxy configuration
Haproxy::Service { use_include => true }
Haproxy::Balancermember { use_include => true }
Openstack::Ha::Haproxy_service {
server_names => filter_hash($controllers, 'name'),
ipaddresses => filter_hash($controllers, 'internal_address'),
public_virtual_ip => $::fuel_settings['public_vip'],
internal_virtual_ip => $::fuel_settings['management_vip'],
}
openstack::ha::haproxy_service { 'midonetapi':
order => 199,
listen_port => 8081,
balancermember_port => 8081,
define_backups => true,
before_start => true,
public => true,
haproxy_config_options => {
'balance' => 'roundrobin',
'option' => ['httplog'],
},
balancermember_options => 'check',
}
exec { 'haproxy reload':
command => 'export OCF_ROOT="/usr/lib/ocf"; (ip netns list | grep haproxy) && ip netns exec haproxy /usr/lib/ocf/resource.d/fuel/ns_haproxy reload',
path => '/usr/bin:/usr/sbin:/bin:/sbin',
logoutput => true,
provider => 'shell',
tries => 10,
try_sleep => 10,
returns => [0, ''],
}
Haproxy::Listen <||> -> Exec['haproxy reload']
Haproxy::Balancermember <||> -> Exec['haproxy reload']
firewall {'502 Midonet api':
port => '8081',
proto => 'tcp',
action => 'accept',
}

View File

@ -20,7 +20,8 @@ $cass_hash = nodes_to_hash($nsdb_nodes, 'name', 'internal_address')
class {'::midonet::zookeeper':
servers => values($zoo_hash),
server_id => $zoo_hash["${::fqdn}"]['id']
server_id => $zoo_hash["${::fqdn}"]['id'],
client_ip => $zoo_hash["${::fqdn}"]['host']
}
class {'::midonet::cassandra':

View File

@ -0,0 +1,111 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$address = hiera('management_vip')
$m_version = $fuel_settings['midonet']['version']
# amqp settings
$controllers = hiera('controllers')
$controller_internal_addresses = nodes_to_hash($controllers,'name','internal_address')
$controller_nodes = ipsort(values($controller_internal_addresses))
$internal_address = hiera('internal_address')
if $internal_address in $controller_nodes {
# prefer local MQ broker if it exists on this node
$amqp_nodes = concat(['127.0.0.1'], fqdn_rotate(delete($controller_nodes, $internal_address)))
} else {
$amqp_nodes = fqdn_rotate($controller_nodes)
}
$amqp_port = '5673'
$amqp_hosts = inline_template("<%= @amqp_nodes.map {|x| x + ':' + @amqp_port}.join ',' %>")
$rabbit_hash = hiera('rabbit_hash', {})
$service_endpoint = hiera('management_vip')
$neutron_config = hiera('quantum_settings')
$neutron_db_password = $neutron_config['database']['passwd']
$neutron_user_password = $neutron_config['keystone']['admin_password']
ensure_resource('file', '/etc/neutron/plugins/midonet', {
ensure => directory,
owner => 'root',
group => 'neutron',
mode => '0640'}
)
neutron_plugin_midonet {
'MIDONET/midonet_uri': value => "http://${address}:8081/midonet-api";
'MIDONET/username': value => 'admin';
'MIDONET/password': value => 'admin';
'MIDONET/project_id': value => 'admin';
} ->
package {'python-neutron-plugin-midonet':
ensure => present
}
if $::osfamily == 'Debian' {
file_line { '/etc/default/neutron-server:NEUTRON_PLUGIN_CONFIG':
path => '/etc/default/neutron-server',
match => '^NEUTRON_PLUGIN_CONFIG=(.*)$',
line => "NEUTRON_PLUGIN_CONFIG=/etc/neutron/plugins/midonet/midonet.ini",
notify => Service['neutron-server'],
}
}
# In RH, this link is used to start Neutron process but in Debian, it's used only
# to manage database synchronization.
if defined(File['/etc/neutron/plugin.ini']) {
File <| path == '/etc/neutron/plugin.ini' |> { target => '/etc/neutron/plugins/midonet/midonet.ini' }
}
else {
file {'/etc/neutron/plugin.ini':
ensure => link,
target => '/etc/neutron/plugins/midonet/midonet.ini'
}
}
class {'::neutron':
verbose => false,
debug => false,
use_syslog => false,
log_facility => 'LOG_USER',
base_mac => 'fa:16:3e:00:00:00',
core_plugin => 'midonet.neutron.plugin.MidonetPluginV2',
service_plugins => [],
allow_overlapping_ips => true,
mac_generation_retries => 32,
dhcp_lease_duration => 600,
dhcp_agents_per_network => 2,
report_interval => 5,
rabbit_user => $rabbit_hash['user'],
rabbit_host => ['localhost'],
rabbit_hosts => [$amqp_hosts],
rabbit_port => '5672',
rabbit_password => $rabbit_hash['password'],
kombu_reconnect_delay => '5.0',
network_device_mtu => undef,
}
class { '::neutron::server':
sync_db => $primary_controller ? {true => 'primary', default => 'slave'},
auth_host => $service_endpoint,
auth_port => '35357',
auth_protocol => 'http',
auth_password => $neutron_user_password,
auth_tenant => 'services',
auth_user => 'neutron',
auth_uri => "http://${service_endpoint}:35357/v2.0",
database_retry_interval => 2,
database_connection => "mysql://neutron:${neutron_db_password}@${service_endpoint}/neutron?&read_timeout=60",
database_max_retries => -1,
agent_down_time => 15,
api_workers => min($::processorcount + 0, 50 + 0),
rpc_workers => 0,
} ->
class { '::neutron::agents::dhcp':
debug => false,
interface_driver => 'neutron.agent.linux.interface.MidonetInterfaceDriver',
dhcp_driver => 'midonet.neutron.agent.midonet_driver.DhcpNoOpDriver',
enable_isolated_metadata => true,
enabled => true,
}

View File

@ -0,0 +1,21 @@
exec { 'drop_neutron_db':
command => "mysql -e 'drop database if exists neutron;'",
path => '/usr/bin',
}
exec { 'create_neutron_db':
command => "mysql -e 'create database neutron character set utf8;'",
path => '/usr/bin',
}
exec { 'grant_neutron_db':
command => "mysql -e \"grant all on neutron.* to 'neutron'@'%';\"",
path => '/usr/bin',
}
exec { 'neutron_db_sync':
command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head',
path => '/usr/bin',
}
Exec['drop_neutron_db'] -> Exec['create_neutron_db'] -> Exec['grant_neutron_db'] -> Exec['neutron_db_sync']

View File

@ -0,0 +1,93 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$access_hash = hiera('access', {})
$keystone_admin_tenant = $access_hash[tenant]
$neutron_settings = hiera('quantum_settings')
$nets = $neutron_settings['predefined_networks']
$nodes_hash = hiera('nodes', {})
$roles = node_roles($nodes_hash, hiera('uid'))
$segment_id = $nets['net04']['L2']['segment_id']
$vm_net_l3 = $nets['net04']['L3']
$tz_type = $::fuel_settings['midonet']['tunnel_type']
$vm_net = { shared => false,
"L2" => { network_type => $tz_type,
router_ext => false,
physnet => false,
segment_id => $segment_id,
},
"L3" => $vm_net_l3,
tenant => 'admin'
}
$alloc = split($nets['net04_ext']['L3']['floating'], ':')
$allocation_pools = "start=${alloc[0]},end=${alloc[1]}"
$metadata_agent_name = $operatingsystem ? {
'CentOS' => 'neutron-metadata-agent'
}
service { 'neutron-server':
ensure => running,
}
if member($roles, 'primary-controller') {
exec {'refresh-dhcp-agent':
command => 'crm resource start p_neutron-dhcp-agent',
path => '/usr/bin:/usr/sbin',
tries => 3,
try_sleep => 10,
} ->
exec {'refresh-metadata-agent':
command => 'crm resource start p_neutron-metadata-agent',
path => '/usr/bin:/usr/sbin',
tries => 3,
try_sleep => 10,
} ->
neutron_network { 'net04':
ensure => present,
router_external => $nets['net04']['L2']['router_ext'],
tenant_name => $nets['net04']['tenant'],
shared => $nets['net04']['shared']
} ->
neutron_subnet { "net04__subnet":
ensure => present,
cidr => $nets['net04']['L3']['subnet'],
network_name => 'net04',
tenant_name => $nets['net04']['tenant'],
gateway_ip => $nets['net04']['L3']['gateway'],
enable_dhcp => $nets['net04']['L3']['enable_dhcp'],
dns_nameservers => $nets['net04']['L3']['nameservers']
} ->
neutron_network { 'net04_ext':
ensure => present,
router_external => $nets['net04_ext']['L2']['router_ext'],
tenant_name => $nets['net04_ext']['tenant'],
shared => $nets['net04_ext']['shared']
} ->
neutron_subnet { "net04_ext__subnet":
ensure => present,
cidr => $nets['net04_ext']['L3']['subnet'],
network_name => 'net04_ext',
tenant_name => $nets['net04_ext']['tenant'],
gateway_ip => $nets['net04_ext']['L3']['gateway'],
enable_dhcp => $nets['net04_ext']['L3']['enable_dhcp'],
dns_nameservers => $nets['net04_ext']['L3']['nameservers']
} ->
neutron_router { 'router04':
ensure => present,
tenant_name => 'admin',
gateway_network_name => 'net04_ext',
} ->
neutron_router_interface { "router04:net04__subnet":
ensure => present,
}
}

View File

@ -1,61 +0,0 @@
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
#released updates
[update]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

View File

@ -1,27 +0,0 @@
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

View File

@ -1,30 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
module Puppet::Parser::Functions
newfunction(:create_tunnel_zone, :doc => <<-EOS
This function creates tunnel zone based on input nodes hash
EOS
) do |argv|
nodes_hash = argv[0]
tzone = `midonet-cli -e "create tunnel-zone name default type gre"`.strip
list_host = `midonet-cli -e "host list"`.split("\n")
list_host.map! { |line| [line.split(" ")[1],line.split(" ")[3]]}
list_host = Hash[list_host]
list_host.each do |uuid,fqdn|
addr = nodes_hash[fqdn]
`midonet-cli -e "tunnel-zone #{tzone} add member host #{uuid} address #{addr}"`
end
end
end

View File

@ -1,36 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
Puppet::Type.type(:midolman_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/midolman/midolman.conf'
end
end

View File

@ -1,69 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
Puppet::Type.type(:midonet_host).provide(:ruby) do
optional_commands :midonet_cli => "midonet-cli"
def tunnel_zone
res = ''
tzones = midonet_cli('-e', "tunnel-zone list").split("\n")
tzones.each do |zone|
if zone.split(' ')[3] == resource[:tunnel_zone]
res = zone.split(' ')[1]
end
end
res
end
def hosts
res = {}
list_host = midonet_cli('-e', "tunnel-zone #{tunnel_zone} list member").split("\n")
list_host.each do |line|
host_id = line.split(' ')[3]
res[midonet_cli('-e',"show host #{host_id}").split(' ')[3]] = host_id
end
# list_host.map! { |line| [line.split(" ")[3],line.split(" ")[1]]}
# list_host = Hash[list_host]
# list_host
res
end
def exists?
# puts "DEBUG!!!", hosts.inspect
hosts.keys().include?(resource[:name])
end
def host_id
res = ''
list_host = midonet_cli('-e', "host list").split("\n")
# puts "HOST_ID", list_host.inspect
list_host.each do |line|
if line.split(' ')[3] == resource[:name]
res = line.split(' ')[1]
break
end
end
res
end
def create
# puts "DEBUG CREATE!!!", hosts.inspect, host_id
# puts "DEBUG CREATE!!!", "tunnel-zone #{tunnel_zone} add member host #{host_id} address #{resource[:nodes][resource[:name]]}"
midonet_cli('-e',"tunnel-zone #{tunnel_zone} add member host #{host_id} address #{resource[:nodes][resource[:name]]}")
end
def destroy
end
end

View File

@ -1,29 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
Puppet::Type.type(:midonet_tunnel_zone).provide(:ruby) do
optional_commands :midonet_cli => "midonet-cli"
def exists?
tunnel_zones = midonet_cli('-e', "tunnel-zone list").split("\n")
tunnel_zones.map! { |line| [line.split(" ")[1],line.split(" ")[3]]}
tunnel_zones = Hash[tunnel_zones]
tunnel_zones.values().include?(resource[:name])
end
def create
midonet_cli('-e',"create tunnel-zone name #{resource[:name]} type gre")
end
def destroy
end
end

View File

@ -1,36 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
Puppet::Type.type(:neutron_plugin_midonet).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def file_path
'/etc/neutron/plugins/midonet/midonet.ini'
end
end

View File

@ -1,32 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
Puppet::Type.newtype(:midolman_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from midonet_plugin.ini'
newvalues(/\S+\/\S+/)
end
newproperty(:value) do
desc 'The value of the setting to be defined.'
munge do |value|
value = value.to_s.strip
value.capitalize! if value =~ /^(true|false)$/i
value
end
end
end

View File

@ -1,30 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
Puppet::Type.newtype(:midonet_host) do
ensurable
newparam(:name, :namevar => true) do
desc 'FQDN of midonet host'
end
newparam(:nodes) do
desc 'Midonet nodes hash { fqdn => ip }'
end
newparam(:tunnel_zone) do
desc 'Tunnel zone name'
end
end

View File

@ -1,22 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
Puppet::Type.newtype(:midonet_tunnel_zone) do
ensurable
newparam(:name, :namevar => true) do
desc 'FQDN of midonet host'
end
end

View File

@ -1,32 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
Puppet::Type.newtype(:neutron_plugin_midonet) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from midonet_plugin.ini'
newvalues(/\S+\/\S+/)
end
newproperty(:value) do
desc 'The value of the setting to be defined.'
munge do |value|
value = value.to_s.strip
value.capitalize! if value =~ /^(true|false)$/i
value
end
end
end

View File

@ -1,68 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
class plugin_midonet::compute_neutron {
$neutron_config = $::fuel_settings['quantum_settings']
class { 'nova::compute::neutron':
}
class { 'nova::network::neutron':
neutron_admin_password => $neutron_config['keystone']['admin_password'],
neutron_url => "http://${::service_endpoint}:9696",
neutron_admin_auth_url => "http://${::service_endpoint}:35357/v2.0",
}
service {'openstack-nova-compute':
ensure => running,
}
Nova_config <||> ~> Service['openstack-nova-compute']
service { 'libvirt':
name => 'libvirtd',
ensure => running,
}
file_line { 'user_root':
path => '/etc/libvirt/qemu.conf',
line => 'user = "root"',
notify => Service['libvirt']
}
file_line { 'group_root':
path => '/etc/libvirt/qemu.conf',
line => 'group = "root"',
notify => Service['libvirt']
}
file_line { 'cgroup_controllers':
path => '/etc/libvirt/qemu.conf',
line => 'cgroup_controllers = [ "cpu", "devices", "memory", "blkio", "cpuset", "cpuacct" ]',
notify => Service['libvirt']
}
file_line { 'clear_emulator_capabilities':
path => '/etc/libvirt/qemu.conf',
line => 'clear_emulator_capabilities = 0',
notify => Service['libvirt']
}
file_line { 'cgroup_device_acl':
path => '/etc/libvirt/qemu.conf',
line => 'cgroup_device_acl = [
"/dev/null", "/dev/full", "/dev/zero",
"/dev/random", "/dev/urandom",
"/dev/ptmx", "/dev/kvm", "/dev/kqemu",
"/dev/rtc","/dev/hpet", "/dev/vfio/vfio",
"/dev/net/tun"
]',
notify => Service['libvirt']
}
}

View File

@ -1,81 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
class plugin_midonet::controller {
$midokura_user = $fuel_settings['midonet']['midokura_user']
$midokura_password = $fuel_settings['midonet']['midokura_password']
include plugin_midonet::neutron
Package['openstack-neutron-midonet'] -> Neutron_plugin_midonet <||> ~> Service<| title == 'neutron' |>
Neutron_plugin_midonet <||> -> Exec<| title == 'neutron-db-sync_plugin' |>
Neutron_plugin_midonet <||> -> Exec<| title == 'neutron-db-sync' |>
Neutron_dhcp_agent_config<||> ~> Service<| title == 'neutron' |>
# file { '/etc/yum.repos.d/midokura.repo':
# content => template('plugin_midonet/midokura.repo.erb'),
# }
file { '/var/run/netns':
mode => '0755',
}
package { 'python-neutron-plugin-midonet':
ensure => present,
} ->
package { 'python-midonetclient':
ensure => present,
} ->
package { 'openstack-neutron-midonet':
ensure => present,
}
neutron_plugin_midonet {
'midonet/midonet_uri': value => "http://${::midonet_api_address}:8081/midonet-api";
'midonet/username': value => $::access_hash['user'];
'midonet/password': value => $::access_hash['password'];
'midonet/project_id': value => $::access_hash['tenant'];
'midonet/auth_url': value => "http://${::service_endpoint}:35357/v2.0";
}
file {'/etc/neutron/plugin.ini':
ensure => link,
target => '/etc/neutron/plugins/midonet/midonet.ini',
require => Package['python-neutron-plugin-midonet']
}
file { '/usr/lib/python2.6/site-packages/midonet':
ensure => link,
target => '/usr/lib/python2.7/site-packages/midonet',
require => Package['python-neutron-plugin-midonet']
}
file { '/root/.midonetrc':
content => template('plugin_midonet/midonetrc.erb'),
}
# exec { 'drop_neutron_database':
# refreshonly => true,
# notify => Service['neutron'],
# }
# neutron_dhcp_agent_config {
# 'DEFAULT/enable_isolated_metadata': value => 'True';
# 'DEFAULT/dhcp_driver': value => 'neutron.plugins.midonet.agent.midonet_driver.DhcpNoOpDriver';
# 'DEFAULT/interface_driver': value => 'neutron.agent.linux.interface.MidonetInterfaceDriver';
# 'DEFAULT/ovs_use_veth': value => 'False';
# 'DEFAULT/root_helper': value => 'sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf';
# 'DEFAULT/use_namespaces': value => 'True';
# 'DEFAULT/debug': value => 'True';
# }
}

View File

@ -1,98 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Define: mysql::db
#
# This module creates database instances, a user, and grants that user
# privileges to the database. It can also import SQL from a file in order to,
# for example, initialize a database schema.
#
# Since it requires class mysql::server, we assume to run all commands as the
# root mysql user against the local mysql server.
#
# Parameters:
# [*title*] - mysql database name.
# [*user*] - username to create and grant access.
# [*password*] - user's password.
# [*charset*] - database charset.
# [*host*] - host for assigning privileges to user.
# [*grant*] - array of privileges to grant user.
# [*enforce_sql*] - whether to enforce or conditionally run sql on creation.
# [*sql*] - sql statement to run.
#
# Actions:
#
# Requires:
#
# class mysql::server
#
# Sample Usage:
#
# mysql::db { 'mydb':
# user => 'my_user',
# password => 'password',
# host => $::hostname,
# grant => ['all']
# }
#
define plugin_midonet::db (
$user,
$password,
$allowed_hosts,
$charset = 'utf8',
$host = 'localhost',
$grant = 'all',
$sql = '',
$enforce_sql = false,
) {
database { $name:
ensure => present,
charset => $charset,
provider => 'mysql',
}
database_user { "${user}@${host}":
ensure => present,
password_hash => mysql_password($password),
provider => 'mysql',
require => Database[$name],
}
database_grant { "${user}@${host}/${name}":
privileges => $grant,
provider => 'mysql',
require => Database_user["${user}@${host}"],
}
neutron::db::mysql::host_access { $allowed_hosts:
user => $user,
password => $password,
database => $name,
}
$refresh = ! $enforce_sql
if $sql {
exec{ "${name}-import":
command => "/usr/bin/mysql ${name} < ${sql}",
logoutput => true,
refreshonly => $refresh,
require => Database_grant["${user}@${host}/${name}"],
subscribe => Database[$name],
}
}
}

View File

@ -1,40 +0,0 @@
define plugin_midonet::kern_module ($ensure) {
$modulesfile = $operatingsystem ? { debian => "/etc/modules", redhat => "/etc/rc.modules", centos=>"/etc/rc.modules" }
case $operatingsystem {
redhat: { file { "/etc/rc.modules": ensure => file, mode => 755 } }
centos: { file { "/etc/rc.modules": ensure => file, mode => 755 } }
}
case $ensure {
present: {
exec { "insert_module_${name}":
command => $operatingsystem ? {
debian => "/bin/echo '${name}' >> '${modulesfile}'",
redhat => "/bin/echo '/sbin/modprobe ${name}' >> '${modulesfile}' ",
centos => "/bin/echo '/sbin/modprobe ${name}' >> '${modulesfile}' "
},
unless => $operatingsystem ? {
debian => "/bin/grep -qFx '${name}' '${modulesfile}'",
redhat => "/bin/grep -q '^/sbin/modprobe ${name}\$' '${modulesfile}'",
centos => "/bin/grep -q '^/sbin/modprobe ${name}\$' '${modulesfile}'",
}
}
exec { "/sbin/modprobe ${name}": unless => "/bin/grep -q '^${name} ' '/proc/modules'" }
}
absent: {
exec { "/sbin/modprobe -r ${name}": onlyif => "/bin/grep -q '^${name} ' '/proc/modules'" }
exec { "remove_module_${name}":
command => $operatingsystem ? {
debian => "/usr/bin/perl -ni -e 'print unless /^\\Q${name}\\E\$/' '${modulesfile}'",
redhat => "/usr/bin/perl -ni -e 'print unless /^\\Q/sbin/modprobe ${name}\\E\$/' '${modulesfile}'",
centos => "/usr/bin/perl -ni -e 'print unless /^\\Q/sbin/modprobe ${name}\\E\$/' '${modulesfile}'"
},
onlyif => $operatingsystem ? {
debian => "/bin/grep -qFx '${name}' '${modulesfile}'",
redhat => "/bin/grep -q '^/sbin/modprobe ${name}\$' '${modulesfile}'",
centos => "/bin/grep -q '^/sbin/modprobe ${name}\$' '${modulesfile}'"
}
}
}
default: { err ( "unknown ensure value ${ensure}" ) }
}
}

View File

@ -1,46 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
class plugin_midonet::midolman {
if $::fuel_settings['role'] == 'compute' {
plugin_midonet::kern_module { 'vhost_net':
ensure => present,
}
}
$zoo_nodes = inline_template("<%= scope.lookupvar('::gateways_internal_addresses').collect { |name,info| info+':2181'}.join(',') %>")
$cassanda_nodes = inline_template("<%= scope.lookupvar('::gateways_internal_addresses').values.join(',')%>")
package { 'midolman':
ensure => present,
} ->
midolman_config {
'zookeeper/zookeeper_hosts': value => $zoo_nodes;
'cassandra/servers': value => $cassanda_nodes;
'cassandra/replication_factor': value => 3;
'midolman/bgpd_binary': value => '/usr/sbin';
} ~>
service { 'midolman':
ensure => running,
}
if $::fuel_settings['role'] == 'midonet-gw' or $::fuel_settings['role'] == 'midonet-simplegw' {
l23network::l3::ifconfig {$::fuel_settings['midonet']['bgb1_iface']:
ipaddr => 'none',
check_by_ping => 'none',
}
l23network::l3::ifconfig {$::fuel_settings['midonet']['bgb2_iface']:
ipaddr => 'none',
check_by_ping => 'none',
}
}
}

View File

@ -1,53 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
class plugin_midonet::midonet_agent {
# include nova::params
plugin_midonet::kern_module { 'vhost_net':
ensure => present,
}
# package { 'midolman':
# ensure => present,
#}
# nova_config {
# 'DEFAULT/libvirt_vif_driver': value => 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver';
# 'MIDONET/midonet_use_tunctl': value => "True";
# 'MIDONET/midonet_uri': value => "http://${::midonet_api_address}:8081/midonet-api"
# 'MIDONET/username': value => $::access_hash['user'];
# 'MIDONET/password': value => $::access_hash['password'];
# 'MIDONET/project_id': value => $::access_hash['tenant'];
# 'MIDONET/auth_url': value => "http://${::service_endpoint}:35357/v2.0";
# }
#
# service { 'nova-compute':
# name => $::nova::params::compute_service_name,
# ensure => running,
# }
# Nova_config <||> ~> Service['nova-compute']
# $zoo_nodes = inline_template("<%= scope.lookupvar('::gateways_internal_addresses').collect { |name,info| info+':2181'}.join(',') %>")
# $cassanda_nodes = inline_template("<%= scope.lookupvar('::gateways_internal_addresses').values.join(',')%>")
#
# midolman_config {
# 'zookeeper/zookeeper_hosts': value => $zoo_nodes;
# 'cassandra/servers': value => $cassanda_nodes;
# 'cassandra/replication_factor': values => 3;
# } ~>
# service { 'midolman':
# ensure => running,
# }
}

View File

@ -1,129 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
class plugin_midonet::neutron {
$primary_controller = $::fuel_settings['role'] ? { 'primary-controller'=>true, default=>false }
if $primary_controller {
if ($::neutron::params::server_package) {
# Debian platforms
Package<| title == 'neutron-server' |> ~> Exec['neutron-db-sync']
} else {
# RH platforms
Package<| title == 'neutron' |> ~> Exec['neutron-db-sync']
}
exec { 'neutron-db-sync_plugin':
command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head',
path => '/usr/bin',
refreshonly => true,
tries => 10,
# TODO(bogdando) contribute change to upstream:
# new try_sleep param for sleep driven development (SDD)
try_sleep => 20,
}
#NOTE(bogdando) contribute change to upstream #1384133
Neutron_config<||> -> Exec['neutron-db-sync']
Exec['neutron-db-sync'] -> Service<| title == 'neutron-server' |>
}
plugin_midonet::db { $::neutron_db_dbname:
user => $::neutron_db_user,
password => $::neutron_db_password,
allowed_hosts => [ '%', $::hostname ],
host => '127.0.0.1',
}
if $primary_controller {
class { 'neutron::keystone::auth':
password => $::neutron_user_password,
public_address => $::fuel_settings['public_vip'],
admin_address => $::fuel_settings['management_vip'],
internal_address => $::fuel_settings['management_vip'],
}
}
class { 'cluster::haproxy_ocf':
primary_controller => $primary_controller
}
Haproxy::Service { use_include => true }
Haproxy::Balancermember { use_include => true }
Openstack::Ha::Haproxy_service {
server_names => filter_hash($::controllers, 'name'),
ipaddresses => filter_hash($::controllers, 'internal_address'),
public_virtual_ip => $::fuel_settings['public_vip'],
internal_virtual_ip => $::fuel_settings['management_vip'],
}
class { 'openstack::ha::neutron': }
class { 'openstack::network':
network_provider => $::neutron_db_user,
agents => ['dhcp', 'metadata'],
ha_agents => false,
verbose => $::verbose,
debug => $::debug,
use_syslog => $::use_syslog,
syslog_log_facility => $::syslog_log_facility_neutron,
neutron_server => true,
neutron_db_uri => "mysql://${::neutron_db_user}:${::neutron_db_password}@${::db_host}/${::neutron_db_dbname}?&read_timeout=60",
public_address => $::fuel_settings['public_vip'],
internal_address => $::fuel_settings['management_vip'], # Could be this node or, internal_vip
admin_address => $::fuel_settings['management_vip'],
nova_neutron => true,
base_mac => $::base_mac,
core_plugin => 'midonet.neutron.plugin.MidonetPluginV2',
service_plugins => '',
#ovs
mechanism_drivers => $::mechanism_drivers,
local_ip => $::internal_address, # $::internal_adress is this node
# bridge_mappings => $bridge_mappings,
# network_vlan_ranges => $vlan_range,
# enable_tunneling => $enable_tunneling,
# tunnel_id_ranges => $tunnel_id_ranges,
#Queue settings
queue_provider => 'rabbitmq',
amqp_hosts => [$::amqp_hosts],
amqp_user => $::amqp_user,
amqp_password => $::amqp_password,
# keystone
admin_password => $::neutron_user_password,
auth_host => $::internal_address,
auth_url => "http://${::service_endpoint}:35357/v2.0",
neutron_url => "http://${::service_endpoint}:9696",
#metadata
shared_secret => $::neutron_metadata_proxy_secret,
metadata_ip => $::service_endpoint,
#nova settings
private_interface => false,
public_interface => $::public_int,
fixed_range => false,
floating_range => false,
# network_manager => $network_manager,
# network_config => $config_overrides,
create_networks => false,
# num_networks => $num_networks,
# network_size => $network_size,
# nameservers => $nameservers,
enable_nova_net => false, # just setup networks, but don't start nova-network service on controllers
nova_admin_password => $::nova_user_password,
nova_url => "http://${service_endpoint}:8774/v2",
}
}

View File

@ -1,17 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
class plugin_midonet::params {
$zoo_hosts = generate_zookeeper_hash($::fuel_settings['nodes'],'midonet-gw')
}

View File

@ -1,59 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
class plugin_midonet::repos {
include l23network::params
package { 'openvswitch':
name => $::l23network::params::ovs_common_package_name,
ensure => absent,
} ->
package { 'openvswitch-datapath':
name => $::l23network::params::ovs_datapath_package_name,
ensure => absent,
}
file { '/etc/yum.repos.d/CentOS-Base.repo':
ensure => present,
content => template('plugin_midonet/CentOS-Base.repo'),
}
file { '/etc/yum.repos.d/epel.repo':
ensure => present,
content => template('plugin_midonet/epel.repo'),
}
yumrepo { 'midokura':
# ensure => present,
gpgcheck => 0,
enabled => 1,
baseurl => "http://${::fuel_settings['midonet']['repo_username']}:${::fuel_settings['midonet']['repo_password']}@yum.midokura.com/repo/v1.8/stable/RHEL/6/",
# gpgkey => "http://<%= midokura_user %>:<%= midokura_password %>@yum.midokura.com/repo/RPM-GPG-KEY-midokura",
}
yumrepo { 'midokura_neutron_pligin':
# ensure => present,
gpgcheck => 0,
enabled => 1,
baseurl => "http://${::fuel_settings['midonet']['repo_username']}:${::fuel_settings['midonet']['repo_password']}@yum.midokura.com/repo/openstack-juno/stable/RHEL/6/",
# gpgkey => "http://<%= midokura_user %>:<%= midokura_password %>@yum.midokura.com/repo/RPM-GPG-KEY-midokura",
}
yumrepo { 'datastax':
# ensure => present,
gpgcheck => 0,
enabled => 1,
baseurl => "http://rpm.datastax.com/community",
}
}

View File

@ -1,53 +0,0 @@
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=0
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=0
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

View File

@ -1,3 +0,0 @@
#!/bin/bash
midonet-cli -e "create tunnel-zone name default type gre"

View File

@ -1,26 +0,0 @@
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=0
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=0

View File

@ -1,11 +0,0 @@
[DATABASE]
sql_connection = <%= @sql_connection %>
sql_max_retries = 100
[MIDONET]
midonet_uri = http://<%= scope.lookupvar('::midonet_api_address') %>:8081/midonet-api
username = <%= scope.lookupvar('::access_hash')['user'] %>
password = <%= scope.lookupvar('::access_hash')['password'] %>
project_id = <%= scope.lookupvar('::access_hash')['tenant'] %>
auth_url = http://<%= scope.lookupvar('::service_endpoint') %>:35357/v2.0

View File

@ -1,5 +0,0 @@
[cli]
api_url=http://<%= scope.lookupvar('::fuel_settings')['public_vip'] %>:8081/midonet-api
username=<%= scope.lookupvar('::access_hash')['user'] %>
password=<%= scope.lookupvar('::access_hash')['password'] %>
project_id=<%= scope.lookupvar('::access_hash')['tenant'] %>

View File

@ -1,77 +0,0 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
$fuel_settings = parseyaml($astute_settings_yaml)
$nodes_hash = $::fuel_settings['nodes']
$primary_controller_nodes = filter_nodes($nodes_hash,'role','primary-controller')
$controllers = concat($primary_controller_nodes, filter_nodes($nodes_hash,'role','controller'))
$db_gateways = filter_nodes($nodes_hash,'role','midonet-gw')
$gateways = filter_nodes($nodes_hash,'role','midonet-simplegw')
$computes = filter_nodes($nodes_hash,'role','compute')
$midonet_nodes1 = concat($controllers,$db_gateways)
$midonet_nodes2 = concat($gateways,$computes)
$midonet_nodes = concat($midonet_nodes1,$midonet_nodes2)
$nodes_adresses = nodes_to_hash($midonet_nodes,'fqdn','internal_address')
$access_hash = $::fuel_settings['access']
$service_endpoint = $::fuel_settings['management_vip']
$neutron_config = $::fuel_settings['quantum_settings']
Nova_config<||> -> Exec['/etc/init.d/openstack-nova-api restart']
nova_config {
'DEFAULT/enabled_apis': value => 'ec2,osapi_compute,metadata';
'DEFAULT/service_neutron_metadata_proxy': value => 'true';
'DEFAULT/neutron_metadata_proxy_shared_secret': value => $neutron_config['metadata']['metadata_proxy_shared_secret'];
}
exec { '/etc/init.d/openstack-nova-api restart':
}
if $fuel_settings['role'] == 'primary-controller' {
$nodes_fqdn = keys($nodes_adresses)
midonet_tunnel_zone { 'default':
ensure => present,
} ->
midonet_host { $nodes_fqdn:
ensure => present,
nodes => $nodes_adresses,
tunnel_zone => 'default',
require => Midonet_tunnel_zone['default'],
}
# create_tunnel_zone($nodes_adresses)
}
Neutron_dhcp_agent_config<||> ~> Service['neutron-dhcp-agent']
Neutron_dhcp_agent_config<||> ~> Service['neutron-metadata-agent']
service { 'neutron-dhcp-agent':
ensure => running,
}
service { 'neutron-metadata-agent':
ensure => running,
}
neutron_dhcp_agent_config {
'DEFAULT/enable_isolated_metadata': value => 'True';
'DEFAULT/dhcp_driver': value => 'midonet.neutron.agent.midonet_driver.DhcpNoOpDriver';
'DEFAULT/interface_driver': value => 'neutron.agent.linux.interface.MidonetInterfaceDriver';
'DEFAULT/ovs_use_veth': value => 'False';
'DEFAULT/root_helper': value => 'sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf';
'DEFAULT/use_namespaces': value => 'True';
'DEFAULT/debug': value => 'False';
'midonet/midonet_uri': value => "http://${::service_endpoint}:8081/midonet-api";
'midonet/username': value => $::access_hash['user'];
'midonet/password': value => $::access_hash['password'];
'midonet/project_id': value => $::access_hash['tenant'];
'midonet/auth_url': value => "http://${::service_endpoint}:35357/v2.0";
}

View File

@ -18,19 +18,66 @@ for Infrastructure-as-a-Service (IaaS) clouds. This plugin provides the puppet
manifests to install all the components to deploy easily MidoNet with Fuel in a
production environment.
There are no prerequisites to use the MidoNet plugin: MidoNet is Open Source,
and the plugins sets the repositories from where download and install MidoNet
packages. Only on Fuel, you need to [#Enable Experimental Features](enable the
experimental features).
### Limitations ###
The plugin is **only** compatible with OpenStack environments deployed with
Neutron + GRE as network configuration.
Installation
------------
TODO: Enable experimental features
### Enable Experimental Features ###
To be able to install MidoNet, you should enable Experimental Features[1]. To do
so, Manually modify the /etc/fuel/version.yaml file to add "experimental" to the
"feature_groups" list in the "VERSION" section. For example:
VERSION:
...
feature_groups:
- mirantis
- experimental
And restart the Nailgun container with dependencies by running:
$ dockerctl restart nailgun
$ dockerctl restart nginx
$ dockerctl shell cobbler
$ cobbler sync
$ exit
### Install the Plugin ###
To install the MidoNet Fuel plugin:
* Download it from the [Fuel Plugins Catalog](https://www.mirantis.com/products/openstack-drivers-and-plugins/fuel-plugins/)
* Copy the `rpm` file to the Fuel Master node:
[root@home ~]# scp midonet-1.0-2.0.0-1.noarch.rpm root@fuel-master:/tmp
* Log into Fuel master node and install the plugin using the Fuel CLI:
[root@fuel-master ~]# fuel plugins --install midonet-1.0-2.0.0-1.noarch.rpm
* Verify the plugin is installed correctly:
[root@fuel-master ~]# fuel plugins
id | name | version | package_version
---|---------|---------|----------------
9 | midonet | 2.0.0 | 2.0.0
Follow the Fuel Plugin Installation guidelines[1] to install the MidoNet plugin.
After that, you'll need to create a role and a group to put the tasks on the
Deployment Graph[2]
Deployment Graph[3]. Read the next section to do so.
### Create the role NSDB ###
### Create the MidoNet roles ###
Create a YAML file with the role definition, like this:
Create a YAML file with the _NoStateDataBase_ (nsdb) definition, like this:
name: nsdb
@ -44,13 +91,15 @@ Create a YAML file with the role definition, like this:
And name it, for instance, `nsdb.yaml`
And create the role for both environments (`Ubuntu 2014.2.2-6.1` and `Centos
2014.2.2-6.1`) using the Fuel CLI:
2014.2.2-6.1`) using the Fuel CLI[4]:
$ fuel role --create --rel 1 --file nsdb.yaml
$ fuel role --create --rel 2 --file nsdb.yaml
Then you can create the group 'nsdb` on the tasks. This is based on the
*Creating a separate role and attaching a task to it[3]* section on the
TODO(devvesa): explain the `gateway` node.
Then you can create the groups `nsdb` and `gateway` on the tasks. This is based
on the *Creating a separate role and attaching a task to it[5]* section on the
Reference Architecture. This is not necessary at all, but it is useful to set
the group after the *logging* task and see the Puppet logs when the deployment
of MidoNet tasks is deploying.
@ -89,42 +138,6 @@ Append the `nsdb_group.yaml` file into the `deployment_tasks.yaml` one
cat /tmp/nsdb_group.yaml >> ./release_1/deployment_tasks.yaml
Open your favourite text editor and edit the
'./release_1/deployment_tasks.yaml', look for the `primary-controller` id group:
- id: primary-controller
parameters:
strategy:
type: one_by_one
required_for:
- deploy_end
requires:
- deploy_start
role:
- primary-controller
type: group
And replace the `requires` tag from `deploy_start` to `nsdb`:
- id: primary-controller
parameters:
strategy:
type: one_by_one
required_for:
- deploy_end
requires:
- nsdb
role:
- primary-controller
type: group
Q: WHAT I HAVE DONE?
A: MidoNet API will be deployed in the controller. To configure the API, we need
to know the location of the ZooKeeper services. Replacing `deploy_start` to
`nsdb` (the role that deploys Zookeeper) we will guarantee that any controller
will always be deployed after any `nsdb` host and the API will have all the
needed data to be deployed properly.
And upload the edited `deployment-tasks` file to the release 1:
fuel rel --rel 1 --deployment-tasks --upload
@ -136,7 +149,7 @@ _pre\_deployment_ and _post_deployment_ stages, adding this group and these
tasks into the main graph will allow `nsdb` to:
* Configure _logging_ to see Puppet and MCollective logs related to the tasks
from the Fuel Web Console.
from the Fuel Web UI.
* Access to hiera variables.
* Access to global variables.
* Configure the IP addresses for each Fuel network.
@ -146,14 +159,26 @@ Guide
### Select Environment ###
TODO(devvesa): still not sure if we can use the Neutron + GRE one
When creating the environment, choose Neutron with GRE on the Network tab.
TODO(devvesa): add screenshot
MidoNet plugin does not interact with the rest of the options, so choose
whatever your deployment demands on them.
### Enable Plugin ###
Once the environment is created, choose which encapsulation technology you want
to use to send data between hosts on the Private network: GRE or VXLAN.
You should enter Settings tab of the Fuel Web UI to do that. Please, provide
more details here. Specially, in terms of fields/checkboxes etc
TODO(devvesa): add screenshot
Once the environment is created, enter in Settings tab of the Fuel Web UI,
scroll down until 'Neutron MidoNet plugin' and enable the checkbox.
After that, choose which encapsulation technology you want
to use to send data between hosts on the Private network: GRE or VXLAN and one
of the available MidoNet versions.
TODO(devvesa); add screenshot
### Network Configuration ###
@ -165,7 +190,8 @@ and document it here.
Appendix
--------
[1]: [Fuel Plugin Installation guidelines](https://docs.mirantis.com/openstack/fuel/fuel-6.1/user-guide.html#install-plugin)
[2]: [Task Based Deployment](https://docs.mirantis.com/openstack/fuel/fuel-6.1/reference-architecture.html#task-based-deployment)
[3]: [Creating a separate role and attaching a task to
it](https://docs.mirantis.com/openstack/fuel/fuel-6.1/reference-architecture.html#creating-a-separate-role-and-attaching-a-task-to-it)
[1]: [Enable Experimental Features](https://docs.mirantis.com/openstack/fuel/fuel-6.1/operations.html#enable-experimental-features)
[2]: [Fuel Plugin Installation guidelines](https://docs.mirantis.com/openstack/fuel/fuel-6.1/user-guide.html#install-plugin)
[3]: [Task Based Deployment](https://docs.mirantis.com/openstack/fuel/fuel-6.1/reference-architecture.html#task-based-deployment)
[4]: [Fuel CLI](https://docs.mirantis.com/openstack/fuel/fuel-6.1/user-guide.html#using-fuel-cli)
[5]: [Creating a separate role and attaching a task to it](https://docs.mirantis.com/openstack/fuel/fuel-6.1/reference-architecture.html#creating-a-separate-role-and-attaching-a-task-to-it)

View File

@ -3,7 +3,7 @@ name: midonet
# Human-readable name for your plugin
title: Neutron Midonet plugin
# Plugin version
version: 1.0.25
version: 1.0.71
# Description
description: Enable to use plugin Midonet for Neutron
# Required fuel version

View File

@ -3,3 +3,4 @@
# Add here any the actions which are required before plugin build
# like packages building, packages downloading from mirrors and so on.
# The script should return 0 if there were no errors.
#!/bin/bash

View File

@ -1,85 +1,103 @@
# Define the tasks to create midonet
- id: install_nsdb_dependencies
role: [nsdb]
#
# Pre-deployment tasks
#
- id: midonet_install_dependencies
role: [primary-controller, controller, compute, nsdb]
stage: pre_deployment/6001
required_for: [pre_deployment_end]
type: shell
parameters:
cmd: ./install_nsdb_dependencies.sh
cmd: ./install_dependencies.sh
timeout: 360
- id: install_controller_dependencies
role: [primary-controller, controller]
stage: pre_deployment/6001
required_for: [pre_deployment_end]
type: shell
# Post-deployment tasks
- id: midonet_enable_ip_forward
role: [nsdb, compute]
stage: post_deployment/4400
required_for: [post_deployment_end]
type: puppet
parameters:
cmd: ./install_controller_dependencies.sh
puppet_manifest: puppet/manifests/midonet-enable-ip-forward.pp
puppet_modules: "puppet/modules/:/etc/puppet/modules/"
timeout: 360
- id: cassandra_and_zookeeper
- id: midonet_cassandra_and_zookeeper
role: [nsdb]
stage: post_deployment/6001
required_for: [deploy_end]
type: puppet
parameters:
puppet_manifest: nsdb.pp
puppet_modules: "puppet/:/etc/puppet/modules/"
puppet_manifest: puppet/manifests/midonet-nsdb.pp
puppet_modules: "puppet/modules/:/etc/puppet/modules/"
timeout: 360
- id: enable_ip_forward
role: [nsdb, compute]
stage: post_deployment/4001
required_for: [post_deployment_end]
- id: midonet_clean_neutron_db
role: [primary-controller]
stage: post_deployment/6400
type: shell
parameters:
cmd: ./clean_neutron.sh
timeout: 360
fail_on_error: false
- id: midonet_disable_services
role: [primary-controller, controller, compute]
stage: post_deployment/6405
type: puppet
parameters:
puppet_manifest: enable_ip_forward.pp
puppet_modules: "puppet/:/etc/puppet/modules/"
timeout: 360
- id: midonet_api
puppet_manifest: puppet/manifests/midonet-disable-services.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 60
- id: midonet_deploy_api
role: [primary-controller, controller]
stage: post_deployment/6501
stage: post_deployment/6410
type: puppet
parameters:
puppet_manifest: api.pp
puppet_modules: "puppet/:/etc/puppet/modules/"
puppet_manifest: puppet/manifests/midonet-install-api.pp
puppet_modules: puppet/modules:/etc/puppet/modules/
timeout: 360
priority: 400
# - role: ['controller','midonet-gw','compute','midonet-simplegw']
# stage: post_deployment
# type: puppet
# parameters:
# puppet_manifest: midolman_site.pp
# puppet_modules: "puppet/:/etc/puppet/modules/"
# timeout: 360
# priority: 500
# - role: ['controller']
# stage: post_deployment
# type: puppet
# parameters:
# puppet_manifest: controller_site.pp
# puppet_modules: "puppet/:/etc/puppet/modules/"
# timeout: 360
# priority: 600
# - role: ['controller']
# stage: post_deployment
# type: puppet
# parameters:
# puppet_manifest: tunnels_site.pp
# puppet_modules: "puppet/:/etc/puppet/modules/"
# timeout: 3600
# priority: 800
# - role: ['compute']
# stage: post_deployment
# type: puppet
# parameters:
# puppet_manifest: compute_site.pp
# puppet_modules: "puppet/:/etc/puppet/modules/"
# timeout: 360
# priority: 900
# - role: '*'
# stage: post_deployment
# type: puppet
# parameters:
# puppet_manifest: cleanup.pp
# puppet_modules: "puppet/:/etc/puppet/modules/"
# timeout: 360
# priority: 1000
#
- id: midonet_agent
role: [primary-controller, controller, compute]
stage: post_deployment/6415
type: puppet
parameters:
puppet_manifest: puppet/manifests/midonet-install-agent.pp
puppet_modules: "puppet/modules/:/etc/puppet/modules/"
timeout: 360
- id: midonet_delete_datapaths
role: [primary-controller, controller, compute]
stage: post_deployment/6420
type: puppet
parameters:
puppet_manifest: puppet/manifests/midonet-delete-datapaths.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 60
- id: midonet_host_registry
role: [primary-controller, controller, compute]
stage: post_deployment/6425
type: puppet
parameters:
puppet_manifest: puppet/manifests/midonet-host-registry.pp
puppet_modules: "puppet/modules/:/etc/puppet/modules/"
timeout: 360
- id: midonet_reconfigure_neutron
role: [primary-controller, controller]
stage: post_deployment/6430
type: puppet
parameters:
puppet_manifest: puppet/manifests/midonet-reconfigure-neutron.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 220
- id: midonet_recreate_neutron_db
role: [primary-controller]
stage: post_deployment/6435
type: puppet
parameters:
puppet_manifest: puppet/manifests/midonet-recreate-neutron-db.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 360
- id: midonet_restart_neutron
role: ['primary-controller', 'controller']
stage: post_deployment/6440
type: puppet
parameters:
puppet_manifest: puppet/manifests/midonet-restart-neutron.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 210