123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338 |
- class nova::compute (
- $enabled = true,
- $manage_service = true,
- $ensure_package = 'present',
- $vnc_enabled = true,
- $vncserver_proxyclient_address = '127.0.0.1',
- $vncproxy_host = false,
- $vncproxy_protocol = 'http',
- $vncproxy_port = '6080',
- $vncproxy_path = '/vnc_auto.html',
- $vnc_keymap = 'en-us',
- $force_config_drive = false,
- $virtio_nic = false,
- $neutron_enabled = true,
- $install_bridge_utils = true,
- $instance_usage_audit = false,
- $instance_usage_audit_period = 'month',
- $force_raw_images = true,
- $reserved_host_memory = '512',
- $heal_instance_info_cache_interval = '60',
- $pci_passthrough = $::os_service_default,
- $config_drive_format = $::os_service_default,
- $allow_resize_to_same_host = false,
- $resize_confirm_window = $::os_service_default,
- $vcpu_pin_set = $::os_service_default,
- $resume_guests_state_on_host_boot = $::os_service_default,
- $keymgr_api_class = $::os_service_default,
- $barbican_auth_endpoint = $::os_service_default,
- $barbican_endpoint = $::os_service_default,
- $barbican_api_version = $::os_service_default,
- $max_concurrent_live_migrations = $::os_service_default,
-
- $default_availability_zone = undef,
- $default_schedule_zone = undef,
- $internal_service_availability_zone = undef,
- $compute_manager = $::os_service_default,
- ) {
- include ::nova::deps
- include ::nova::params
- if $default_availability_zone {
- warning("The default_availability_zone parameter is deprecated and will be removed in a \
- future release. Use default_availability_zone parameter of nova class instead.")
- }
- if $default_schedule_zone {
- warning("The default_schedule_zone parameter is deprecated and will be removed in a \
- future release. Use default_schedule_zone parameter of nova class instead.")
- }
- if $internal_service_availability_zone {
- warning("The internal_service_availability_zone parameter is deprecated and will be \
- removed in a future release. Use internal_service_availability_zone parameter of nova class instead.")
- }
- if $compute_manager {
- warning("compute_manager is marked as deprecated in Nova but still needed when Ironic \
- is used. It will be removed once Nova removes it.")
- }
- $vcpu_pin_set_real = pick(join(any2array($vcpu_pin_set), ','), $::os_service_default)
-
-
-
- if !is_service_default($pci_passthrough) and !empty($pci_passthrough) {
- $pci_passthrough_real = check_array_of_hash($pci_passthrough)
- } else {
- $pci_passthrough_real = $::os_service_default
- }
-
- if $keymgr_api_class =~ /barbican/ {
- ensure_packages('cryptsetup', {
- ensure => present,
- tag => 'openstack',
- })
- }
- include ::nova::availability_zone
- nova_config {
- 'DEFAULT/reserved_host_memory_mb': value => $reserved_host_memory;
- 'DEFAULT/compute_manager': value => $compute_manager;
- 'DEFAULT/heal_instance_info_cache_interval': value => $heal_instance_info_cache_interval;
- 'DEFAULT/pci_passthrough_whitelist': value => $pci_passthrough_real;
- 'DEFAULT/resize_confirm_window': value => $resize_confirm_window;
- 'DEFAULT/vcpu_pin_set': value => $vcpu_pin_set_real;
- 'DEFAULT/resume_guests_state_on_host_boot': value => $resume_guests_state_on_host_boot;
- 'key_manager/api_class': value => $keymgr_api_class;
- 'barbican/auth_endpoint': value => $barbican_auth_endpoint;
- 'barbican/barbican_endpoint': value => $barbican_endpoint;
- 'barbican/barbican_api_version': value => $barbican_api_version;
- 'DEFAULT/max_concurrent_live_migrations': value => $max_concurrent_live_migrations;
- }
- ensure_resource('nova_config', 'DEFAULT/allow_resize_to_same_host', { value => $allow_resize_to_same_host })
- if ($vnc_enabled) {
- include ::nova::vncproxy::common
- nova_config {
- 'vnc/vncserver_proxyclient_address': value =>
- $vncserver_proxyclient_address;
- 'vnc/keymap': value => $vnc_keymap;
- }
- } else {
- nova_config {
- 'vnc/vncserver_proxyclient_address': ensure => absent;
- 'vnc/keymap': ensure => absent;
- }
- }
- nova_config {
- 'vnc/enabled': value => $vnc_enabled;
- }
- if $neutron_enabled != true and $install_bridge_utils {
-
- package { 'bridge-utils':
- ensure => present,
- tag => ['openstack', 'nova-support-package'],
- }
- }
- nova::generic_service { 'compute':
- enabled => $enabled,
- manage_service => $manage_service,
- package_name => $::nova::params::compute_package_name,
- service_name => $::nova::params::compute_service_name,
- ensure_package => $ensure_package,
- before => Exec['networking-refresh']
- }
- if $force_config_drive {
- nova_config { 'DEFAULT/force_config_drive': value => true }
- } else {
- nova_config { 'DEFAULT/force_config_drive': ensure => absent }
- }
- if $virtio_nic {
-
- nova_config { 'DEFAULT/libvirt_use_virtio_for_bridges': value => true }
- }
- if $instance_usage_audit and $instance_usage_audit_period in ['hour', 'day', 'month', 'year'] {
- nova_config {
- 'DEFAULT/instance_usage_audit': value => $instance_usage_audit;
- 'DEFAULT/instance_usage_audit_period': value => $instance_usage_audit_period;
- }
- } else {
- nova_config {
- 'DEFAULT/instance_usage_audit': ensure => absent;
- 'DEFAULT/instance_usage_audit_period': ensure => absent;
- }
- }
- nova_config {
- 'DEFAULT/force_raw_images': value => $force_raw_images;
- }
- if is_service_default($config_drive_format) or $config_drive_format == 'iso9660' {
- ensure_packages($::nova::params::genisoimage_package_name, {
- tag => ['openstack', 'nova-support-package'],
- })
- }
- nova_config {
- 'DEFAULT/config_drive_format': value => $config_drive_format;
- }
- }
|