diff --git a/packstack/plugins/nova_300.py b/packstack/plugins/nova_300.py index da06f52cb..a1c251593 100644 --- a/packstack/plugins/nova_300.py +++ b/packstack/plugins/nova_300.py @@ -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 diff --git a/packstack/puppet/modules/packstack/manifests/keystone/nova.pp b/packstack/puppet/modules/packstack/manifests/keystone/nova.pp index f96f1a4d3..1bd6cc69a 100644 --- a/packstack/puppet/modules/packstack/manifests/keystone/nova.pp +++ b/packstack/puppet/modules/packstack/manifests/keystone/nova.pp @@ -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, + } } diff --git a/packstack/puppet/modules/packstack/manifests/mariadb/services.pp b/packstack/puppet/modules/packstack/manifests/mariadb/services.pp index 249b83329..366669ad8 100755 --- a/packstack/puppet/modules/packstack/manifests/mariadb/services.pp +++ b/packstack/puppet/modules/packstack/manifests/mariadb/services.pp @@ -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 diff --git a/packstack/puppet/modules/packstack/manifests/mariadb/services_remote.pp b/packstack/puppet/modules/packstack/manifests/mariadb/services_remote.pp index 7bad034de..87df08bd7 100755 --- a/packstack/puppet/modules/packstack/manifests/mariadb/services_remote.pp +++ b/packstack/puppet/modules/packstack/manifests/mariadb/services_remote.pp @@ -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' { diff --git a/packstack/puppet/modules/packstack/manifests/nova.pp b/packstack/puppet/modules/packstack/manifests/nova.pp index 0b2955018..4658fbbad 100644 --- a/packstack/puppet/modules/packstack/manifests/nova.pp +++ b/packstack/puppet/modules/packstack/manifests/nova.pp @@ -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'), } } diff --git a/packstack/puppet/modules/packstack/manifests/nova/api.pp b/packstack/puppet/modules/packstack/manifests/nova/api.pp index 402b541b3..d29150e73 100644 --- a/packstack/puppet/modules/packstack/manifests/nova/api.pp +++ b/packstack/puppet/modules/packstack/manifests/nova/api.pp @@ -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 { diff --git a/packstack/puppet/modules/packstack/manifests/nova/compute.pp b/packstack/puppet/modules/packstack/manifests/nova/compute.pp index b6d36d871..dc8f599b9 100644 --- a/packstack/puppet/modules/packstack/manifests/nova/compute.pp +++ b/packstack/puppet/modules/packstack/manifests/nova/compute.pp @@ -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'}) diff --git a/releasenotes/notes/nova-placement-api-acf32977978da6fb.yaml b/releasenotes/notes/nova-placement-api-acf32977978da6fb.yaml new file mode 100644 index 000000000..7cf1b4ffa --- /dev/null +++ b/releasenotes/notes/nova-placement-api-acf32977978da6fb.yaml @@ -0,0 +1,4 @@ +--- +features: + - Packstack now installs and configures the Nova Placement API which is + required from Ocata onwards. \ No newline at end of file