Skip to content

Commit

Permalink
SM-Mitaka: added support of mitaka to SM
Browse files Browse the repository at this point in the history
Partial-Bug: #1593675

changes:
1. new parameters for neutron under nova.conf
2. v2.1 version for keystone endpoint
3. nova_api database is needed for mitaka onwards
4. Enforce contrail-openstack package to be installed before openstack

PATCH 2:
made default_domain optional for kilo/liberty (pre-mitaka)

Conflicts:
	contrail/environment/modules/contrail/manifests/profile/openstack/provision.pp

Change-Id: Ia38b2b8f4ba72c4cbbae2a0ac4c95144ef6d496b
  • Loading branch information
Dheeraj Gautam committed Aug 1, 2016
1 parent b8b0987 commit 03d948b
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 13 deletions.
Expand Up @@ -36,6 +36,8 @@

if ( $package_sku =~ /^*:12\.0.*$/) {
$neutron_extensions = ":${::python_dist}/neutron_lbaas/extensions"
} elsif ( $package_sku =~ /^*:13\.0.*$/) {
$neutron_extensions = ":${::python_dist}/neutron_lbaas/extensions"
} else {
$neutron_extensions = ""
}
Expand Down
5 changes: 2 additions & 3 deletions contrail/environment/modules/contrail/manifests/params.pp
Expand Up @@ -872,16 +872,15 @@
# Set the contrail_dist_kernel_version
if ($kernel_version != "" ) {
$contrail_dist_kernel_version = $kernel_version
$contrail_grub_string = "GRUB_DEFAULT=\'Advanced options for Ubuntu>Ubuntu, with Linux ${kernel_version}-generic\'"
} else {
if ($lsbdistrelease == "14.04") {
$contrail_dist_kernel_version = "3.13.0-85"
$contrail_grub_string = 'GRUB_DEFAULT=\'Advanced options for Ubuntu>Ubuntu, with Linux 3.13.0-85-generic\''
} else {
$contrail_dist_kernel_version = "3.13.0-34"
$contrail_grub_string = 'GRUB_DEFAULT=\'Advanced options for Ubuntu>Ubuntu, with Linux 3.13.0-34-generic\''
}
}
$contrail_grub_string = "GRUB_DEFAULT=\'Advanced options for Ubuntu>Ubuntu, with Linux ${contrail_dist_kernel_version}-generic\'"

if ($huge_pages == "" or $core_mask == "" ) {
$enable_dpdk = false
} else {
Expand Down
Expand Up @@ -63,6 +63,7 @@
class { '::keystone':
admin_token => $admin_token,
database_connection => $keystone_db_conn,
default_domain => 'default',
enabled => true,
admin_bind_host => $admin_bind_host,
sync_db => true,
Expand Down
Expand Up @@ -14,6 +14,7 @@
$address_api = $::contrail::params::os_controller_api_address ,
$sriov_enable = $::contrail::params::sriov_enable,
$enable_ceilometer = $::contrail::params::enable_ceilometer,
$package_sku = $::contrail::params::package_sku,
$contrail_internal_vip = $::contrail::params::contrail_internal_vip,
$openstack_rabbit_servers = $::contrail::params::openstack_rabbit_ip_list,
$neutron_shared_secret = $::contrail::params::os_neutron_shared_secret,
Expand All @@ -30,6 +31,14 @@
allowed_hosts => $allowed_hosts,
}

if ( $package_sku =~ /^*:13\.0.*$/) {
## TODO: Remove once we move to mitaka modules
class {'::nova::db::mysql_api':
password => $service_password,
allowed_hosts => $allowed_hosts,
}
}

$compute_ip_list = $::contrail::params::compute_ip_list
$tmp_index = inline_template('<%= @compute_ip_list.index(@host_control_ip) %>')

Expand All @@ -38,9 +47,6 @@
} else {
$contrail_is_compute = false
}
notify { "openstack::common::nova -contrail_is_compute = $contrail_is_compute":;}
notify { "openstack::common::nova - tmp_index = X$tmp_index X":;}
notify { "openstack::common::nova - controller_mgmt_address = $controller_mgmt_address":; }

if ($internal_vip != "" and $internal_vip != undef) {
$neutron_ip_address = $controller_mgmt_address
Expand Down Expand Up @@ -111,6 +117,19 @@
osapi_compute_workers => $osapi_compute_workers
}

if ( $package_sku =~ /^*:13\.0.*$/) {
## TODO: Remove once we move to mitaka modules
$nova_api_db_conn = join(["mysql://nova_api:",$database_credentials,"/nova_api"],'')
nova_config {
'api_database/connection': value => $nova_api_db_conn;
'neutron/auth_type': value => 'password';
'neutron/project_name': value => 'services';
'neutron/auth_url': value => "http://${controller_mgmt_address}:35357";
'neutron/username': value => 'neutron';
'neutron/password': value => $neutron_password;
}
}

class { '::nova::vncproxy':
host => $vncproxy_host,
enabled => 'true',
Expand All @@ -121,7 +140,7 @@
'nova::scheduler',
'nova::objectstore',
'nova::consoleauth',
'nova::conductor'
'nova::conductor',
]:
enabled => 'true',
}
Expand Down
Expand Up @@ -21,6 +21,12 @@
$internal_vip = $::contrail::params::internal_vip
$contrail_internal_vip = $::contrail::params::contrail_internal_vip

if ( $package_sku =~ /^*:13\.0.*$/) {
$endpoint_version = "v2.1"
} else {
$endpoint_version = "v2"
}

class { 'keystone::endpoint':
public_url => "http://${keystone_ip_to_use}:5000",
admin_url => "http://${keystone_ip_to_use}:35357",
Expand Down Expand Up @@ -58,6 +64,7 @@
admin_url_v3 => "http://${controller_address_management}:8774/v3",
internal_url_v3 => "http://${controller_address_management}:8774/v3",
region => $region_name,
compute_version => $endpoint_version
} ->
class { '::neutron::keystone::auth':
password => $neutron_password,
Expand Down
Expand Up @@ -24,12 +24,11 @@
contrail::lib::report_status { 'openstack_started': state => 'openstack_started' } ->
package {'contrail-openstack' :
ensure => latest,
before => [ Class['::mysql::server'] ]
#Package['keystone'], Package['glance-api'], Package['glance-registry'],
#Package['cinder'],Package['cinder-api'],Package['heat-engine'],Package['nova-common'],
#Package['python-nova'],Package['heat-api'],Package['heat-common'],Package['heat-api-cfn'],
#Package['python-numpy'], Package['pm-utils'], Package['libguestfs-tools'],
#Package['python-mysqldb'], Package['python-keystone'], Package['python-cinderclient']]
before => [ Class['::mysql::server'],
Package['keystone', 'glance-api', 'glance-registry', 'cinder','cinder-api',
'heat-engine','nova-common', 'python-nova','heat-api','heat-common','heat-api-cfn',
'python-numpy', 'pm-utils', 'libguestfs-tools', 'python-mysqldb',
'python-keystone', 'python-cinderclient']]
} ->
class { 'memcached': } ->
class {'::nova::quota' :
Expand Down
8 changes: 8 additions & 0 deletions contrail/environment/modules/nova/manifests/api.pp
Expand Up @@ -350,11 +350,19 @@
Package<| title == $::nova::params::api_package_name |> ~> Exec['nova-db-sync']
Package<| title == $::nova::params::common_package_name |> ~> Exec['nova-db-sync']

Package<| title == $::nova::params::api_package_name |> ~> Exec['nova-api-db-sync']
Package<| title == $::nova::params::common_package_name |> ~> Exec['nova-api-db-sync']

exec { 'nova-db-sync':
command => '/usr/bin/nova-manage db sync',
refreshonly => true,
subscribe => Exec['post-nova_config'],
}
exec { 'nova-api-db-sync':
command => '/usr/bin/nova-manage api_db sync',
refreshonly => true,
subscribe => Exec['post-nova_config'],
}
}

# Remove auth configuration from api-paste.ini
Expand Down
55 changes: 55 additions & 0 deletions contrail/environment/modules/nova/manifests/db/mysql_api.pp
@@ -0,0 +1,55 @@
# == Class: nova::db::mysql_api
#
# Class that configures mysql for the nova_api database.
#
# === Parameters:
#
# [*password*]
# Password to use for the nova user
#
# [*dbname*]
# (optional) The name of the database
# Defaults to 'nova_api'
#
# [*user*]
# (optional) The mysql user to create
# Defaults to 'nova_api'
#
# [*host*]
# (optional) The IP address of the mysql server
# Defaults to '127.0.0.1'
#
# [*charset*]
# (optional) The charset to use for the nova database
# Defaults to 'utf8'
#
# [*collate*]
# (optional) The collate to use for the nova database
# Defaults to 'utf8_general_ci'
#
# [*allowed_hosts*]
# (optional) Additional hosts that are allowed to access this DB
# Defaults to undef
#
class nova::db::mysql_api(
$password,
$dbname = 'nova_api',
$user = 'nova_api',
$host = '127.0.0.1',
$charset = 'utf8',
$collate = 'utf8_general_ci',
$allowed_hosts = undef,
) {

::openstacklib::db::mysql { 'nova_api':
user => $user,
password_hash => mysql_password($password),
dbname => $dbname,
host => $host,
charset => $charset,
collate => $collate,
allowed_hosts => $allowed_hosts,
}

::Openstacklib::Db::Mysql['nova_api'] ~> Exec<| title == 'nova-api-db-sync' |>
}

0 comments on commit 03d948b

Please sign in to comment.