Add support for Packstack to configure the new Nova requirements

The Nova placement API is now required from Ocata onwards[1][2].
This patch configures it to live generally side by side the nova API.

Also, after a nova compute is set up, we need to call "nova-manage
cell_v2 discover_hosts" to set up the host in a cell.

[1]: http://lists.openstack.org/pipermail/openstack-dev/2017-January/111295.html
[2]: https://review.openstack.org/#/c/427367/

Closes-Bug: #1661512
Change-Id: I4275cc6ed046a5fcd4b32c11e926beef5abad1cb
This commit is contained in:
David Moreau-Simard 2017-02-01 15:13:33 -05:00 committed by Javier Pena
parent 8168496c9e
commit 3b7f027126
8 changed files with 140 additions and 18 deletions

View File

@ -328,7 +328,7 @@ def create_api_manifest(config, messages):
fw_details[key]['host'] = "ALL"
fw_details[key]['service_name'] = "nova api"
fw_details[key]['chain'] = "INPUT"
fw_details[key]['ports'] = ['8773', '8774', '8775']
fw_details[key]['ports'] = ['8773', '8774', '8775', '8778']
fw_details[key]['proto'] = "tcp"
config['FIREWALL_NOVA_API_RULES'] = fw_details

View File

@ -3,7 +3,9 @@ class packstack::keystone::nova ()
$nova_protocol = 'http'
$nova_host = hiera('CONFIG_KEYSTONE_HOST_URL')
$nova_port = '8774'
$nova_url = "${nova_protocol}://${nova_host}:$nova_port/v2.1/%(tenant_id)s"
$nova_placement_port = '8778'
$nova_url = "${nova_protocol}://${nova_host}:${nova_port}/v2.1/%(tenant_id)s"
$nova_placement_url = "${nova_protocol}://${nova_host}:${nova_placement_port}/placement"
class { '::nova::keystone::auth':
region => hiera('CONFIG_KEYSTONE_REGION'),
@ -12,4 +14,12 @@ class packstack::keystone::nova ()
admin_url => $nova_url,
internal_url => $nova_url,
}
class { '::nova::keystone::auth_placement':
region => hiera('CONFIG_KEYSTONE_REGION'),
password => hiera('CONFIG_NOVA_KS_PW'),
public_url => $nova_placement_url,
admin_url => $nova_placement_url,
internal_url => $nova_placement_url,
}
}

View File

@ -101,6 +101,12 @@ class packstack::mariadb::services ()
allowed_hosts => '%',
charset => 'utf8',
}
class { '::nova::db::mysql_placement':
password => hiera('CONFIG_NOVA_DB_PW'),
host => '%',
allowed_hosts => '%',
charset => 'utf8',
}
}
if hiera('CONFIG_PANKO_INSTALL') == 'y' and

View File

@ -368,6 +368,80 @@ class packstack::mariadb::services_remote () {
provider => 'mysql',
require => Remote_database_user['nova@%'],
}
remote_database { 'nova_api':
ensure => 'present',
charset => 'utf8',
db_host => hiera('CONFIG_MARIADB_HOST'),
db_user => hiera('CONFIG_MARIADB_USER'),
db_password => hiera('CONFIG_MARIADB_PW'),
provider => 'mysql',
}
remote_database_user { 'nova_api@%':
password_hash => mysql_password($mariadb_nova_noinstall_db_pw),
db_host => hiera('CONFIG_MARIADB_HOST'),
db_user => hiera('CONFIG_MARIADB_USER'),
db_password => hiera('CONFIG_MARIADB_PW'),
provider => 'mysql',
require => Remote_database['nova_api'],
}
remote_database_grant { 'nova_api@%/nova_api':
privileges => 'all',
db_host => hiera('CONFIG_MARIADB_HOST'),
db_user => hiera('CONFIG_MARIADB_USER'),
db_password => hiera('CONFIG_MARIADB_PW'),
provider => 'mysql',
require => Remote_database_user['nova_api@%'],
}
remote_database { 'nova_placement':
ensure => 'present',
charset => 'utf8',
db_host => hiera('CONFIG_MARIADB_HOST'),
db_user => hiera('CONFIG_MARIADB_USER'),
db_password => hiera('CONFIG_MARIADB_PW'),
provider => 'mysql',
}
remote_database_user { 'nova_placement@%':
password_hash => mysql_password($mariadb_nova_noinstall_db_pw),
db_host => hiera('CONFIG_MARIADB_HOST'),
db_user => hiera('CONFIG_MARIADB_USER'),
db_password => hiera('CONFIG_MARIADB_PW'),
provider => 'mysql',
require => Remote_database['nova_placement'],
}
remote_database_grant { 'nova_placement@%/nova_placement':
privileges => 'all',
db_host => hiera('CONFIG_MARIADB_HOST'),
db_user => hiera('CONFIG_MARIADB_USER'),
db_password => hiera('CONFIG_MARIADB_PW'),
provider => 'mysql',
require => Remote_database_user['nova_placement@%'],
}
remote_database { 'nova_cell0':
ensure => 'present',
charset => 'utf8',
db_host => hiera('CONFIG_MARIADB_HOST'),
db_user => hiera('CONFIG_MARIADB_USER'),
db_password => hiera('CONFIG_MARIADB_PW'),
provider => 'mysql',
}
remote_database_grant { 'nova@%/nova_cell0':
privileges => 'all',
db_host => hiera('CONFIG_MARIADB_HOST'),
db_user => hiera('CONFIG_MARIADB_USER'),
db_password => hiera('CONFIG_MARIADB_PW'),
provider => 'mysql',
require => [ Remote_database_user['nova@%'],
Remote_database['nova_cell0'] ],
}
}
if hiera('CONFIG_SAHARA_INSTALL') == 'y' {

View File

@ -42,20 +42,21 @@ class packstack::nova ()
}
class { '::nova':
glance_api_servers => "${nova_common_rabbitmq_cfg_storage_host}:9292",
default_transport_url => "rabbit://${rabbit_userid}:${rabbit_password}@${rabbit_host}:${rabbit_port}/",
rabbit_use_ssl => hiera('CONFIG_AMQP_SSL_ENABLED'),
debug => hiera('CONFIG_DEBUG_MODE'),
nova_public_key => $public_key,
nova_private_key => $private_key,
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
kombu_ssl_keyfile => $kombu_ssl_keyfile,
kombu_ssl_certfile => $kombu_ssl_certfile,
notification_driver => $nova_common_notification_driver,
notify_on_state_change => $notify_on_state_change,
database_connection => "mysql+pymysql://nova:${nova_db_pw}@${nova_mariadb_host}/nova",
api_database_connection => "mysql+pymysql://nova_api:${nova_db_pw}@${nova_mariadb_host}/nova_api",
cpu_allocation_ratio => hiera('CONFIG_NOVA_SCHED_CPU_ALLOC_RATIO'),
ram_allocation_ratio => hiera('CONFIG_NOVA_SCHED_RAM_ALLOC_RATIO'),
glance_api_servers => "${nova_common_rabbitmq_cfg_storage_host}:9292",
default_transport_url => "rabbit://${rabbit_userid}:${rabbit_password}@${rabbit_host}:${rabbit_port}/",
rabbit_use_ssl => hiera('CONFIG_AMQP_SSL_ENABLED'),
debug => hiera('CONFIG_DEBUG_MODE'),
nova_public_key => $public_key,
nova_private_key => $private_key,
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
kombu_ssl_keyfile => $kombu_ssl_keyfile,
kombu_ssl_certfile => $kombu_ssl_certfile,
notification_driver => $nova_common_notification_driver,
notify_on_state_change => $notify_on_state_change,
database_connection => "mysql+pymysql://nova:${nova_db_pw}@${nova_mariadb_host}/nova",
api_database_connection => "mysql+pymysql://nova_api:${nova_db_pw}@${nova_mariadb_host}/nova_api",
placement_database_connection => "mysql+pymysql://nova_placement:${nova_db_pw}@${nova_mariadb_host}/nova_placement",
cpu_allocation_ratio => hiera('CONFIG_NOVA_SCHED_CPU_ALLOC_RATIO'),
ram_allocation_ratio => hiera('CONFIG_NOVA_SCHED_RAM_ALLOC_RATIO'),
}
}

View File

@ -42,7 +42,24 @@ class packstack::nova::api ()
metadata_workers => hiera('CONFIG_SERVICE_WORKERS'),
}
Package<| title == 'nova-common' |> -> Class['nova::api']
class { '::nova::wsgi::apache_placement':
bind_host => $bind_host,
api_port => '8778',
ssl => false,
workers => hiera('CONFIG_SERVICE_WORKERS'),
} ->
# TODO(jpena): remove the sample file from the package, then remove this workaround
# https://review.rdoproject.org/r/4721
file { '/etc/httpd/conf.d/00-nova-placement-api.conf':
ensure => absent,
before => Service['httpd'],
}
class { '::nova::placement':
auth_url => $auth_uri,
password => $admin_password,
os_region_name => hiera('CONFIG_KEYSTONE_REGION'),
}
$db_purge = hiera('CONFIG_NOVA_DB_PURGE_ENABLE')
if $db_purge {

View File

@ -59,6 +59,16 @@ class packstack::nova::compute ()
instance_usage_audit_period => $instance_usage_audit_period,
}
class { '::nova::placement':
auth_url => hiera('CONFIG_KEYSTONE_PUBLIC_URL'),
password => hiera('CONFIG_NOVA_KS_PW'),
os_region_name => hiera('CONFIG_KEYSTONE_REGION'),
}
include ::nova::cell_v2::discover_hosts
Class['nova::compute'] ~> Class['nova::cell_v2::discover_hosts']
# Tune the host with a virtual hosts profile
ensure_packages(['tuned'], {'ensure' => 'present'})

View File

@ -0,0 +1,4 @@
---
features:
- Packstack now installs and configures the Nova Placement API which is
required from Ocata onwards.