123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- class nova::cells (
- $bandwidth_update_interval = '600',
- $call_timeout = '60',
- $capabilities = ['hypervisor=xenserver;kvm','os=linux;windows'],
- $cell_name = 'nova',
- $cell_type = undef,
- $cell_parent_name = undef,
- $create_cells = true,
- $db_check_interval = '60',
- $enabled = true,
- $ensure_package = 'present',
- $instance_updated_at_threshold = '3600',
- $instance_update_num_instances = '1',
- $manage_service = true,
- $max_hop_count = '10',
- $mute_child_interval = '300',
- $mute_weight_multiplier = '-10.0',
- $mute_weight_value = '1000.0',
- $ram_weight_multiplier = '10.0',
- $reserve_percent = '10.0',
- $rpc_driver_queue_base = 'cells.intercell',
- $scheduler_filter_classes = 'nova.cells.filters.all_filters',
- $scheduler = 'nova.cells.scheduler.CellsScheduler',
- $scheduler_retries = '10',
- $scheduler_retry_delay = '2',
- $scheduler_weight_classes = 'nova.cells.weights.all_weighers',
- $weight_offset = '1.0',
- $weight_scale = '1.0',
- ) {
- include ::nova::deps
- include ::nova::params
- case $cell_type {
- 'parent': {
- nova_config { 'DEFAULT/compute_api_class': value => 'nova.compute.cells_api.ComputeCellsAPI' }
- nova_config { 'cells/cell_type': value => 'api' }
- }
- 'child': {
- nova_config { 'cells/cell_type': value => 'compute' }
- }
- default: { fail("Unsupported cell_type parameter value: '${cell_type}'. Should be 'parent' or 'child'.") }
- }
- nova_config {
- 'cells/bandwidth_update_interval': value => $bandwidth_update_interval;
- 'cells/call_timeout': value => $call_timeout;
- 'cells/capabilities': value => join($capabilities, ',');
- 'cells/db_check_interval': value => $db_check_interval;
- 'cells/enable': value => $enabled;
- 'cells/instance_updated_at_threshold': value => $instance_updated_at_threshold;
- 'cells/instance_update_num_instances': value => $instance_update_num_instances;
- 'cells/max_hop_count': value => $max_hop_count;
- 'cells/mute_child_interval': value => $mute_child_interval;
- 'cells/mute_weight_multiplier': value => $mute_weight_multiplier;
- 'cells/mute_weight_value': value => $mute_weight_value;
- 'cells/name': value => $cell_name;
- 'cells/ram_weight_multiplier': value => $ram_weight_multiplier;
- 'cells/reserve_percent': value => $reserve_percent;
- 'cells/rpc_driver_queue_base': value => $rpc_driver_queue_base;
- 'cells/scheduler_filter_classes': value => $scheduler_filter_classes;
- 'cells/scheduler_retries': value => $scheduler_retries;
- 'cells/scheduler_retry_delay': value => $scheduler_retry_delay;
- 'cells/scheduler': value => $scheduler;
- 'cells/scheduler_weight_classes': value => $scheduler_weight_classes;
- }
- nova::generic_service { 'cells':
- enabled => $enabled,
- manage_service => $manage_service,
- package_name => $::nova::params::cells_package_name,
- service_name => $::nova::params::cells_service_name,
- ensure_package => $ensure_package,
- }
- if $create_cells {
- @@nova::manage::cells { $cell_name:
- cell_type => $cell_type,
- cell_parent_name => $cell_parent_name,
- rabbit_username => $::nova::rabbit_userid,
- rabbit_password => $::nova::rabbit_password,
- rabbit_hosts => $::nova::rabbit_hosts,
- rabbit_port => $::nova::rabbit_port,
- rabbit_virtual_host => $::nova::rabbit_virtual_host,
- weight_offset => $weight_offset,
- weight_scale => $weight_scale,
- before => Service['cells']
- }
- case $cell_type {
- 'parent': {
-
- Nova::Manage::Cells <<| cell_parent_name == $cell_parent_name and cell_type == 'child' |>>
- }
- 'child': {
-
- Nova::Manage::Cells <<| name == $cell_parent_name and cell_type == 'parent' |>>
- }
- default: {
- fail("Invalid cell_type parameter value: ${cell_type}")
- }
- }
- }
- }
|