2016-09-17 11:09:55 -04:00
|
|
|
# Configure the Nova service
|
2016-02-17 23:26:02 -05:00
|
|
|
#
|
|
|
|
# [*libvirt_rbd*]
|
|
|
|
# (optional) Boolean to configure or not Nova
|
|
|
|
# to use Libvirt RBD backend.
|
|
|
|
# Defaults to false.
|
|
|
|
#
|
2016-08-17 16:49:06 -04:00
|
|
|
# [*libvirt_virt_type*]
|
|
|
|
# (optional) Libvirt domain type. Options are: kvm, lxc, qemu, uml, xen
|
|
|
|
# Defaults to 'qemu'
|
|
|
|
#
|
2016-12-13 13:37:49 -07:00
|
|
|
# [*libvirt_cpu_mode*]
|
|
|
|
# (optional) The libvirt CPU mode to configure.
|
|
|
|
# Possible values include custom, host-model, none, host-passthrough.
|
|
|
|
# Defaults to 'none'
|
|
|
|
#
|
2023-03-21 21:22:26 +09:00
|
|
|
# [*modular_libvirt*]
|
|
|
|
# (optional) Use modular libvirt daemons instead of the monolithic libvirtd
|
|
|
|
# deamon
|
|
|
|
# Defaults to false
|
|
|
|
#
|
2016-07-08 15:59:50 -04:00
|
|
|
# [*volume_encryption*]
|
|
|
|
# (optional) Boolean to configure or not volume encryption
|
|
|
|
# Defaults to false.
|
|
|
|
#
|
2017-12-28 11:25:51 -08:00
|
|
|
# [*notification_topics*]
|
|
|
|
# (optional) AMQP topic used for OpenStack notifications
|
2023-03-01 10:29:37 +09:00
|
|
|
# Defaults to $facts['os_service_default'].
|
2017-12-28 11:25:51 -08:00
|
|
|
#
|
2023-03-15 11:01:31 +09:00
|
|
|
# [*cinder_enabled*]
|
|
|
|
# (optional) Boolean to configure or not cinder options.
|
|
|
|
# Defaults to false.
|
|
|
|
#
|
2023-11-22 11:16:30 +09:00
|
|
|
# [*libvirt_guests_enabled*]
|
|
|
|
# (optional) Boolean to configure or not libvirt-guests
|
|
|
|
# Defaults to false.
|
|
|
|
#
|
2016-02-17 23:26:02 -05:00
|
|
|
class openstack_integration::nova (
|
2023-11-22 11:16:30 +09:00
|
|
|
$libvirt_rbd = false,
|
|
|
|
$libvirt_virt_type = 'qemu',
|
|
|
|
$libvirt_cpu_mode = 'none',
|
|
|
|
$modular_libvirt = false,
|
|
|
|
$volume_encryption = false,
|
|
|
|
$notification_topics = $facts['os_service_default'],
|
|
|
|
$cinder_enabled = false,
|
|
|
|
$libvirt_guests_enabled = false,
|
2016-02-17 23:26:02 -05:00
|
|
|
) {
|
2015-12-23 22:54:56 +01:00
|
|
|
|
2019-12-08 12:59:28 +01:00
|
|
|
include openstack_integration::config
|
|
|
|
include openstack_integration::params
|
2016-03-01 18:50:40 -05:00
|
|
|
|
|
|
|
if $::openstack_integration::config::ssl {
|
|
|
|
openstack_integration::ssl_key { 'nova':
|
2017-05-03 16:12:22 -04:00
|
|
|
notify => Service['httpd'],
|
2016-03-01 18:50:40 -05:00
|
|
|
require => Package['nova-common'],
|
|
|
|
}
|
|
|
|
Exec['update-ca-certificates'] ~> Service['httpd']
|
|
|
|
}
|
2016-02-26 19:13:28 -05:00
|
|
|
|
2017-01-06 08:57:09 -05:00
|
|
|
$default_transport_url = os_transport_url({
|
|
|
|
'transport' => $::openstack_integration::config::messaging_default_proto,
|
2016-12-13 12:48:28 -07:00
|
|
|
'host' => $::openstack_integration::config::host,
|
2017-01-06 08:57:09 -05:00
|
|
|
'port' => $::openstack_integration::config::messaging_default_port,
|
|
|
|
'username' => 'nova',
|
|
|
|
'password' => 'an_even_bigger_secret',
|
|
|
|
})
|
|
|
|
|
|
|
|
$notification_transport_url = os_transport_url({
|
|
|
|
'transport' => $::openstack_integration::config::messaging_notify_proto,
|
|
|
|
'host' => $::openstack_integration::config::host,
|
|
|
|
'port' => $::openstack_integration::config::messaging_notify_port,
|
2016-12-13 12:48:28 -07:00
|
|
|
'username' => 'nova',
|
|
|
|
'password' => 'an_even_bigger_secret',
|
|
|
|
})
|
|
|
|
|
2017-09-15 08:33:55 -04:00
|
|
|
openstack_integration::mq_user { 'nova':
|
2015-12-23 22:54:56 +01:00
|
|
|
password => 'an_even_bigger_secret',
|
2017-09-15 08:33:55 -04:00
|
|
|
before => Anchor['nova::service::begin'],
|
2017-01-06 08:57:09 -05:00
|
|
|
}
|
|
|
|
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::db::mysql':
|
2021-08-12 17:48:51 +09:00
|
|
|
charset => $::openstack_integration::params::mysql_charset,
|
2022-08-02 08:17:09 +09:00
|
|
|
collate => $::openstack_integration::params::mysql_collate,
|
2015-12-23 22:54:56 +01:00
|
|
|
password => 'nova',
|
2023-02-24 14:05:02 +09:00
|
|
|
host => $::openstack_integration::config::host,
|
2015-12-23 22:54:56 +01:00
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::db::mysql_api':
|
2021-08-12 17:48:51 +09:00
|
|
|
charset => $::openstack_integration::params::mysql_charset,
|
2022-08-02 08:17:09 +09:00
|
|
|
collate => $::openstack_integration::params::mysql_collate,
|
2021-08-12 17:48:51 +09:00
|
|
|
password => 'nova',
|
2023-02-24 14:05:02 +09:00
|
|
|
host => $::openstack_integration::config::host,
|
2016-02-05 10:05:05 -05:00
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
include nova::cell_v2::simple_setup
|
2017-03-08 08:23:09 -07:00
|
|
|
|
|
|
|
# NOTE(aschultz): workaround for race condition for discover_hosts being run
|
|
|
|
# prior to the compute being registered
|
|
|
|
exec { 'wait-for-compute-registration':
|
|
|
|
path => ['/bin', '/usr/bin'],
|
2018-11-02 18:05:59 +05:30
|
|
|
command => 'sleep 30',
|
2017-03-08 08:23:09 -07:00
|
|
|
refreshonly => true,
|
|
|
|
notify => Class['nova::cell_v2::discover_hosts'],
|
|
|
|
subscribe => Anchor['nova::service::end'],
|
|
|
|
}
|
|
|
|
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::keystone::auth':
|
2016-05-19 10:51:51 +02:00
|
|
|
public_url => "${::openstack_integration::config::base_url}:8774/v2.1",
|
|
|
|
internal_url => "${::openstack_integration::config::base_url}:8774/v2.1",
|
|
|
|
admin_url => "${::openstack_integration::config::base_url}:8774/v2.1",
|
2023-05-19 11:12:37 +02:00
|
|
|
roles => ['admin', 'service'],
|
2016-05-19 10:51:51 +02:00
|
|
|
password => 'a_big_secret',
|
2015-12-23 22:54:56 +01:00
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::keystone::authtoken':
|
2023-05-23 10:14:59 +09:00
|
|
|
password => 'a_big_secret',
|
|
|
|
user_domain_name => 'Default',
|
|
|
|
project_domain_name => 'Default',
|
|
|
|
auth_url => $::openstack_integration::config::keystone_admin_uri,
|
|
|
|
www_authenticate_uri => $::openstack_integration::config::keystone_auth_uri,
|
|
|
|
memcached_servers => $::openstack_integration::config::memcached_servers,
|
|
|
|
service_token_roles_required => true,
|
2016-08-25 10:47:55 -04:00
|
|
|
}
|
2023-05-19 11:12:37 +02:00
|
|
|
class { 'nova::keystone::service_user':
|
|
|
|
send_service_user_token => true,
|
|
|
|
password => 'a_big_secret',
|
|
|
|
user_domain_name => 'Default',
|
|
|
|
project_domain_name => 'Default',
|
|
|
|
auth_url => $::openstack_integration::config::keystone_admin_uri,
|
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::logging':
|
2018-07-10 10:40:05 +08:00
|
|
|
debug => true,
|
|
|
|
}
|
2020-10-26 23:58:15 +09:00
|
|
|
class { 'nova::db':
|
2023-02-24 14:05:02 +09:00
|
|
|
database_connection => os_database_connection({
|
|
|
|
'dialect' => 'mysql+pymysql',
|
|
|
|
'host' => $::openstack_integration::config::ip_for_url,
|
|
|
|
'username' => 'nova',
|
|
|
|
'password' => 'nova',
|
|
|
|
'database' => 'nova',
|
|
|
|
'charset' => 'utf8',
|
2023-03-20 14:18:09 +09:00
|
|
|
'extra' => $::openstack_integration::config::db_extra,
|
2023-02-24 14:05:02 +09:00
|
|
|
}),
|
|
|
|
api_database_connection => os_database_connection({
|
|
|
|
'dialect' => 'mysql+pymysql',
|
|
|
|
'host' => $::openstack_integration::config::ip_for_url,
|
|
|
|
'username' => 'nova_api',
|
|
|
|
'password' => 'nova',
|
|
|
|
'database' => 'nova_api',
|
|
|
|
'charset' => 'utf8',
|
2023-03-20 14:18:09 +09:00
|
|
|
'extra' => $::openstack_integration::config::db_extra,
|
2023-02-24 14:05:02 +09:00
|
|
|
}),
|
2020-10-26 23:58:15 +09:00
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova':
|
2019-04-23 15:22:34 +01:00
|
|
|
default_transport_url => $default_transport_url,
|
|
|
|
notification_transport_url => $notification_transport_url,
|
|
|
|
rabbit_use_ssl => $::openstack_integration::config::ssl,
|
|
|
|
notification_driver => 'messagingv2',
|
|
|
|
notify_on_state_change => 'vm_and_task_state',
|
|
|
|
notification_topics => $notification_topics,
|
2015-12-23 22:54:56 +01:00
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::api':
|
2023-11-13 01:42:02 +09:00
|
|
|
api_bind_address => $::openstack_integration::config::host,
|
|
|
|
sync_db => false,
|
|
|
|
sync_db_api => false,
|
|
|
|
service_name => 'httpd',
|
2018-11-24 12:08:19 +01:00
|
|
|
}
|
2023-08-03 22:58:31 +09:00
|
|
|
class { 'nova::cache':
|
|
|
|
backend => 'dogpile.cache.pymemcache',
|
|
|
|
enabled => true,
|
|
|
|
memcache_servers => $::openstack_integration::config::memcache_servers,
|
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::db::sync':
|
2018-11-24 12:08:19 +01:00
|
|
|
extra_params => '--debug',
|
|
|
|
db_sync_timeout => 600,
|
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::db::sync_api':
|
2018-11-24 12:08:19 +01:00
|
|
|
extra_params => '--debug',
|
|
|
|
db_sync_timeout => 600,
|
2018-08-20 15:03:31 +02:00
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::metadata':
|
2018-08-20 15:03:31 +02:00
|
|
|
neutron_metadata_proxy_shared_secret => 'a_big_secret',
|
2017-05-03 16:12:22 -04:00
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::wsgi::apache_api':
|
2022-08-15 01:58:58 +09:00
|
|
|
bind_host => $::openstack_integration::config::host,
|
2023-03-01 10:29:37 +09:00
|
|
|
ssl_key => "/etc/nova/ssl/private/${facts['networking']['fqdn']}.pem",
|
2018-08-20 15:03:31 +02:00
|
|
|
ssl_cert => $::openstack_integration::params::cert_path,
|
|
|
|
ssl => $::openstack_integration::config::ssl,
|
2023-10-05 22:11:14 +09:00
|
|
|
workers => 2,
|
2018-08-20 15:03:31 +02:00
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::wsgi::apache_metadata':
|
2022-08-15 01:58:58 +09:00
|
|
|
bind_host => $::openstack_integration::config::host,
|
2023-03-01 10:29:37 +09:00
|
|
|
ssl_key => "/etc/nova/ssl/private/${facts['networking']['fqdn']}.pem",
|
2017-05-03 16:12:22 -04:00
|
|
|
ssl_cert => $::openstack_integration::params::cert_path,
|
|
|
|
ssl => $::openstack_integration::config::ssl,
|
2023-08-03 12:42:54 +09:00
|
|
|
workers => 2,
|
2015-12-23 22:54:56 +01:00
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::placement':
|
2017-02-13 15:56:14 -05:00
|
|
|
auth_url => $::openstack_integration::config::keystone_admin_uri,
|
|
|
|
password => 'a_big_secret',
|
2016-12-02 13:49:09 -05:00
|
|
|
}
|
2023-08-03 12:42:54 +09:00
|
|
|
class { 'nova::conductor':
|
|
|
|
workers => 2,
|
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::cron::archive_deleted_rows': }
|
2016-07-08 15:59:50 -04:00
|
|
|
if $volume_encryption {
|
2021-08-06 10:21:38 +09:00
|
|
|
class { 'nova::key_manager':
|
|
|
|
backend => 'castellan.key_manager.barbican_key_manager.BarbicanKeyManager'
|
|
|
|
}
|
|
|
|
class { 'nova::key_manager::barbican':
|
|
|
|
auth_endpoint => "${::openstack_integration::config::keystone_auth_uri}/v3",
|
|
|
|
barbican_endpoint => "${::openstack_integration::config::base_url}:9311"
|
|
|
|
}
|
2023-05-23 10:14:59 +09:00
|
|
|
class { 'nova::key_manager::barbican::service_user':
|
|
|
|
password => 'a_big_secret',
|
|
|
|
user_domain_name => 'Default',
|
|
|
|
project_domain_name => 'Default',
|
|
|
|
auth_url => $::openstack_integration::config::keystone_admin_uri,
|
|
|
|
}
|
2016-07-08 15:59:50 -04:00
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::compute':
|
2015-12-23 22:54:56 +01:00
|
|
|
vnc_enabled => true,
|
|
|
|
instance_usage_audit => true,
|
|
|
|
instance_usage_audit_period => 'hour',
|
|
|
|
}
|
2021-03-29 10:10:27 +09:00
|
|
|
|
2022-04-25 17:26:54 +09:00
|
|
|
# NOTE(tkajinam): In Ubuntu, libvirtd-tcp.socket fails to start because of
|
|
|
|
# libvirtd.service running, though we stop the service in
|
|
|
|
# puppet-nova. Until we fix the failure, use ssh transport
|
|
|
|
# which does not require socket services.
|
2023-03-01 10:29:37 +09:00
|
|
|
$migration_transport = $facts['os']['family'] ? {
|
2022-04-25 17:26:54 +09:00
|
|
|
'Debian' => 'ssh',
|
|
|
|
default => 'tcp'
|
|
|
|
}
|
|
|
|
class { 'nova::migration::libvirt':
|
2023-03-21 21:22:26 +09:00
|
|
|
transport => $migration_transport,
|
|
|
|
listen_address => $::openstack_integration::config::host,
|
|
|
|
modular_libvirt => $modular_libvirt,
|
2022-04-25 17:26:54 +09:00
|
|
|
}
|
|
|
|
|
2021-03-29 10:10:27 +09:00
|
|
|
$images_type = $libvirt_rbd ? {
|
|
|
|
true => 'rbd',
|
2023-03-01 10:29:37 +09:00
|
|
|
false => $facts['os_service_default']
|
2021-03-29 10:10:27 +09:00
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::compute::libvirt':
|
2023-03-21 21:22:26 +09:00
|
|
|
virt_type => $libvirt_virt_type,
|
|
|
|
cpu_mode => $libvirt_cpu_mode,
|
|
|
|
images_type => $images_type,
|
|
|
|
manage_libvirt_services => false,
|
|
|
|
}
|
|
|
|
class { 'nova::compute::libvirt::services':
|
|
|
|
modular_libvirt => $modular_libvirt,
|
2015-12-23 22:54:56 +01:00
|
|
|
}
|
2022-06-26 18:16:58 +09:00
|
|
|
class { 'nova::compute::libvirt::networks': }
|
2016-02-17 23:26:02 -05:00
|
|
|
if $libvirt_rbd {
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::compute::rbd':
|
2016-02-17 23:26:02 -05:00
|
|
|
libvirt_rbd_user => 'openstack',
|
|
|
|
libvirt_rbd_secret_uuid => '7200aea0-2ddd-4a32-aa2a-d49f66ab554c',
|
|
|
|
libvirt_rbd_secret_key => 'AQD7kyJQQGoOBhAAqrPAqSopSwPrrfMMomzVdw==',
|
|
|
|
libvirt_images_rbd_pool => 'nova',
|
|
|
|
rbd_keyring => 'client.openstack',
|
|
|
|
# ceph packaging is already managed by puppet-ceph
|
|
|
|
manage_ceph_client => false,
|
|
|
|
}
|
|
|
|
# make sure ceph pool exists before running nova-compute
|
|
|
|
Exec['create-nova'] -> Service['nova-compute']
|
2021-06-04 00:55:56 +09:00
|
|
|
} else {
|
|
|
|
include openstacklib::iscsid
|
|
|
|
Service['iscsid'] -> Service['nova-compute']
|
2016-02-17 23:26:02 -05:00
|
|
|
}
|
2023-08-03 12:42:54 +09:00
|
|
|
class { 'nova::scheduler':
|
|
|
|
workers => 2,
|
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::scheduler::filter': }
|
2023-02-24 19:19:56 +09:00
|
|
|
class { 'nova::vncproxy':
|
2023-02-28 13:20:41 +09:00
|
|
|
host => $::openstack_integration::config::host
|
2023-02-24 19:19:56 +09:00
|
|
|
}
|
2016-02-04 18:07:01 -05:00
|
|
|
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'nova::network::neutron':
|
2020-02-24 03:08:55 +09:00
|
|
|
auth_url => "${::openstack_integration::config::keystone_admin_uri}/v3",
|
|
|
|
password => 'a_big_secret',
|
2017-06-30 13:41:16 +08:00
|
|
|
default_floating_pool => 'public',
|
2015-12-23 22:54:56 +01:00
|
|
|
}
|
2023-03-15 11:01:31 +09:00
|
|
|
if $cinder_enabled {
|
|
|
|
class { 'nova::cinder':
|
|
|
|
auth_url => $::openstack_integration::config::keystone_admin_uri,
|
|
|
|
password => 'a_big_secret',
|
|
|
|
auth_type => 'password',
|
|
|
|
}
|
|
|
|
}
|
2023-11-22 11:16:30 +09:00
|
|
|
if $libvirt_guests_enabled {
|
|
|
|
class { 'nova::compute::libvirt_guests':
|
|
|
|
enabled => true,
|
|
|
|
manage_service => true,
|
|
|
|
}
|
|
|
|
}
|
2015-12-23 22:54:56 +01:00
|
|
|
|
2017-02-09 10:19:31 -05:00
|
|
|
Keystone_endpoint <||> -> Service['nova-compute']
|
|
|
|
Keystone_service <||> -> Service['nova-compute']
|
2019-08-06 10:20:53 +02:00
|
|
|
|
|
|
|
Keystone_endpoint <||> -> Service['nova-conductor']
|
|
|
|
Keystone_service <||> -> Service['nova-conductor']
|
|
|
|
Keystone_endpoint <||> -> Service['nova-scheduler']
|
|
|
|
Keystone_service <||> -> Service['nova-scheduler']
|
2015-12-23 22:54:56 +01:00
|
|
|
}
|