First iteration of libvirt and nova-compute as a composable services

This is a first iteration of implementing libvirt and nova compute as
composable services.

Note: some parameters are still in puppet/compute.yaml -- we'll move
them later in a next iteration.

Implements: blueprint composable-services-within-roles

Depends-On: I0b765f8cb08633005c1fc5a5a2a8e5658ff44302
Change-Id: I752198cdf231ef13062ba96c3877e5defd618c3a
This commit is contained in:
Emilien Macchi 2016-06-14 17:27:07 -04:00
parent c5ea6e699c
commit 9f1b58e8ac
7 changed files with 50 additions and 43 deletions

View File

@ -160,6 +160,7 @@ resource_registry:
OS::TripleO::Services::NovaConsoleauth: puppet/services/nova-consoleauth.yaml
OS::TripleO::Services::NovaVncproxy: puppet/services/nova-vncproxy.yaml
OS::TripleO::Services::NovaCompute: puppet/services/nova-compute.yaml
OS::TripleO::Services::NovaLibvirt: puppet/services/nova-libvirt.yaml
OS::TripleO::Services::Ntp: puppet/services/time/ntp.yaml
OS::TripleO::Services::SwiftProxy: puppet/services/swift-proxy.yaml
OS::TripleO::Services::SwiftStorage: puppet/services/swift-storage.yaml

View File

@ -577,9 +577,10 @@ parameters:
ComputeServices:
default:
- OS::TripleO::Services::Timezone
- OS::TripleO::Services::NovaCompute
- OS::TripleO::Services::Ntp
- OS::TripleO::Services::Snmp
- OS::TripleO::Services::NovaCompute
- OS::TripleO::Services::NovaLibvirt
description: A list of service resources (configured in the Heat
resource_registry) which represent nested stacks
for each service that should get installed on the Compute Nodes.

View File

@ -500,6 +500,10 @@ resources:
nova::rabbit_port: {get_input: rabbit_client_port}
nova::upgrade_level_compute: {get_input: upgrade_level_nova_compute}
nova_compute_driver: {get_input: nova_compute_driver}
# TODO(emilien): move libvirt & migration parameters in libvirt profile
# used to deploy libvirt/kvm dependencies:
nova::compute::libvirt::services::libvirt_virt_type: {get_input: nova_compute_libvirt_type}
# used to configured nova.conf:
nova::compute::libvirt::libvirt_virt_type: {get_input: nova_compute_libvirt_type}
nova::compute::neutron::libvirt_vif_driver: {get_input: nova_compute_libvirt_vif_driver}
nova_api_host: {get_input: nova_api_host}

View File

@ -6,8 +6,6 @@ nova::notification_driver: messagingv2
nova::compute::instance_usage_audit: true
nova::compute::instance_usage_audit_period: 'hour'
nova::compute::libvirt::migration_support: true
nova::compute::rbd::libvirt_rbd_secret_uuid: "%{hiera('ceph::profile::params::fsid')}"
nova::network::neutron::neutron_auth_type: 'v3password'

View File

@ -22,19 +22,6 @@ Exec <| tag == 'kmod::load' |> -> Sysctl <| |>
if hiera('step') >= 4 {
file { ['/etc/libvirt/qemu/networks/autostart/default.xml',
'/etc/libvirt/qemu/networks/default.xml']:
ensure => absent,
before => Service['libvirt'],
}
# in case libvirt has been already running before the Puppet run, make
# sure the default network is destroyed
exec { 'libvirt-default-net-destroy':
command => '/usr/bin/virsh net-destroy default',
onlyif => '/usr/bin/virsh net-info default | /bin/grep -i "^active:\s*yes"',
before => Service['libvirt'],
}
# When utilising images for deployment, we need to reset the iSCSI initiator name to make it unique
exec { 'reset-iscsi-initiator-name':
command => '/bin/echo InitiatorName=$(/usr/sbin/iscsi-iname) > /etc/iscsi/initiatorname.iscsi',
@ -58,12 +45,6 @@ if hiera('step') >= 4 {
}
include ::ceph::conf
include ::ceph::profile::client
$client_keys = hiera('ceph::profile::params::client_keys')
$client_user = join(['client.', hiera('tripleo::profile::base::cinder::volume::rbd::cinder_rbd_user_name')])
class { '::nova::compute::rbd':
libvirt_rbd_secret_key => $client_keys[$client_user]['secret'],
}
}
if hiera('cinder_enable_nfs_backend', false) {
@ -77,24 +58,7 @@ if hiera('step') >= 4 {
package { 'nfs-utils': } -> Service['nova-compute']
}
if str2bool(hiera('nova::use_ipv6', false)) {
$vncserver_listen = '::0'
} else {
$vncserver_listen = '0.0.0.0'
}
if $rbd_ephemeral_storage {
class { '::nova::compute::libvirt':
libvirt_disk_cachemodes => ['network=writeback'],
libvirt_hw_disk_discard => 'unmap',
vncserver_listen => $vncserver_listen,
}
} else {
class { '::nova::compute::libvirt' :
vncserver_listen => $vncserver_listen,
}
}
# TODO(emilien): figure if we *really* need those 2 parameters:
nova_config {
'DEFAULT/my_ip': value => $ipaddress;
'DEFAULT/linuxnet_interface_driver': value => 'nova.network.linux_net.LinuxOVSInterfaceDriver';
@ -106,7 +70,7 @@ if hiera('step') >= 4 {
content => hiera('midonet_libvirt_qemu_data')
}
}
include ::nova::network::neutron
include ::neutron
include ::neutron::config

View File

@ -16,10 +16,18 @@ resources:
outputs:
role_data:
description: Role data for the Nova Conductor service.
description: Role data for the Nova Compute service.
value:
config_settings:
map_merge:
- get_attr: [NovaBase, role_data, config_settings]
- nova::compute::libvirt::manage_libvirt_services: false
# we manage migration in nova common puppet profile
nova::compute::libvirt::migration_support: false
tripleo::profile::base::nova::manage_migration: true
tripleo::profile::base::nova::nova_compute_enabled: true
step_config: |
include tripleo::profile::base::nova::compute
# TODO(emilien): figure how to deal with libvirt profile.
# We'll probably threat it like we do with Neutron plugins.
# Until then, just include it in the default nova-compute role.
include tripleo::profile::base::nova::compute::libvirt

View File

@ -0,0 +1,31 @@
heat_template_version: 2016-04-08
description: >
Libvirt service configured with Puppet
parameters:
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
resources:
NovaBase:
type: ./nova-base.yaml
outputs:
role_data:
description: Role data for the Libvirt service.
value:
config_settings:
map_merge:
- get_attr: [NovaBase, role_data, config_settings]
# we include ::nova::compute::libvirt::services in nova/libvirt profile
- nova::compute::libvirt::manage_libvirt_services: false
# we manage migration in nova common puppet profile
nova::compute::libvirt::migration_support: false
tripleo::profile::base::nova::manage_migration: true
tripleo::profile::base::nova::libvirt_enabled: true
step_config: |
include tripleo::profile::base::nova::libvirt