Nova Deprecation

Deprecation of parameters listed in Mitaka
during Newton cycle

Change-Id: I9abc7531a94a7f8b983f93be426dbed3c7697e8d
This commit is contained in:
Iury Gregory Melo Ferreira 2016-05-21 04:21:29 -03:00
parent fbd74de805
commit e2254647bc
10 changed files with 77 additions and 79 deletions

View File

@ -58,10 +58,6 @@
# Number of instances to update per periodic task run
# Defaults to '1'
#
# [*manager*]
# Number of instances to update per periodic task run
# Defaults to 'nova.cells.manager.CellsManager'
#
# [*cell_name*]
# name of this cell
# Defaults to 'nova'
@ -140,6 +136,12 @@
# It might be used by some cell scheduling code in the future
# Defaults to '1.0'
#
# DEPRECATED
#
# [*manager*]
# DEPRECATED. Number of instances to update per periodic task run
# Defaults to undef
#
class nova::cells (
$bandwidth_update_interval = '600',
$call_timeout = '60',
@ -155,7 +157,6 @@ class nova::cells (
$instance_updated_at_threshold = '3600',
$instance_update_num_instances = '1',
$manage_service = true,
$manager = 'nova.cells.manager.CellsManager',
$max_hop_count = '10',
$mute_child_interval = '300',
$mute_weight_multiplier = '-10.0',
@ -169,12 +170,18 @@ class nova::cells (
$scheduler_retry_delay = '2',
$scheduler_weight_classes = 'nova.cells.weights.all_weighers',
$weight_offset = '1.0',
$weight_scale = '1.0'
$weight_scale = '1.0',
# Deprecated
$manager = undef,
) {
include ::nova::deps
include ::nova::params
if $manager {
warning('manager parameter is deprecated, has no effect and will be removed in a future release.')
}
case $cell_type {
'parent': {
nova_config { 'DEFAULT/compute_api_class': value => 'nova.compute.cells_api.ComputeCellsAPI' }
@ -196,7 +203,6 @@ class nova::cells (
'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/manager': value => $manager;
'cells/max_hop_count': value => $max_hop_count;
'cells/mute_child_interval': value => $mute_child_interval;
'cells/mute_weight_multiplier': value => $mute_weight_multiplier;

View File

@ -65,10 +65,6 @@
# Applicable only for cases when Neutron was disabled
# Defaults to true
#
# [*network_device_mtu*]
# (optional) The MTU size for the interfaces managed by nova
# Defaults to undef
#
# [*instance_usage_audit*]
# (optional) Generate periodic compute.instance.exists notifications.
# Defaults to false
@ -87,11 +83,6 @@
# The amount of memory in MB reserved for the host.
# Defaults to '512'
#
# [*compute_manager*]
# Compute manager
# The driver that will manage the running instances.
# Defaults to nova.compute.manager.ComputeManager
#
# [*pci_passthrough*]
# (optional) Pci passthrough hash in format of:
# Defaults to undef
@ -127,6 +118,15 @@
# (optional) The availability zone to show internal services under.
# Defaults to undef
#
# [*network_device_mtu*]
# (optional) Deprecated. The MTU size for the interfaces managed by nova
# Defaults to undef
#
# [*compute_manager*]
# Deprecated. Compute manager
# The driver that will manage the running instances.
# Defaults to $::os_service_default
#
class nova::compute (
$enabled = true,
$manage_service = true,
@ -142,12 +142,10 @@ class nova::compute (
$virtio_nic = false,
$neutron_enabled = true,
$install_bridge_utils = true,
$network_device_mtu = undef,
$instance_usage_audit = false,
$instance_usage_audit_period = 'month',
$force_raw_images = true,
$reserved_host_memory = '512',
$compute_manager = 'nova.compute.manager.ComputeManager',
$heal_instance_info_cache_interval = '60',
$pci_passthrough = undef,
$config_drive_format = $::os_service_default,
@ -157,6 +155,8 @@ class nova::compute (
$default_availability_zone = undef,
$default_schedule_zone = undef,
$internal_service_availability_zone = undef,
$network_device_mtu = undef,
$compute_manager = $::os_service_default,
) {
include ::nova::deps
@ -174,6 +174,14 @@ class nova::compute (
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 $network_device_mtu {
warning('network_device_mtu parameter is deprecated, has no effect and will be removed in a future release.')
}
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.')
}
include ::nova::availability_zone
nova_config {
@ -230,16 +238,6 @@ class nova::compute (
nova_config { 'DEFAULT/libvirt_use_virtio_for_bridges': value => true }
}
if $network_device_mtu {
nova_config {
'DEFAULT/network_device_mtu': value => $network_device_mtu;
}
} else {
nova_config {
'DEFAULT/network_device_mtu': ensure => absent;
}
}
if $instance_usage_audit and $instance_usage_audit_period in ['hour', 'day', 'month', 'year'] {
nova_config {
'DEFAULT/instance_usage_audit': value => $instance_usage_audit;

View File

@ -65,14 +65,6 @@
# otherwise, use a boolean to remove or not the base images.
# Defaults to undef
#
# [*remove_unused_kernels*]
# (optional) Should unused kernel images be removed?
# This is only safe to enable if all compute nodes
# have been updated to support this option.
# If undef is specified, remove the line in nova.conf
# otherwise, use a boolean to remove or not the kernels.
# Defaults to undef
#
# [*remove_unused_resized_minimum_age_seconds*]
# (optional) Unused resized base images younger
# than this will not be removed
@ -105,6 +97,16 @@
# (optional) Compute driver.
# Defaults to 'libvirt.LibvirtDriver'
#
# DEPRECATED
#
# [*remove_unused_kernels*]
# (optional) DEPRECATED. Should unused kernel images be removed?
# This is only safe to enable if all compute nodes
# have been updated to support this option.
# If undef is specified, remove the line in nova.conf
# otherwise, use a boolean to remove or not the kernels.
# Defaults to undef
#
class nova::compute::libvirt (
$ensure_package = 'present',
$libvirt_virt_type = 'kvm',
@ -118,13 +120,14 @@ class nova::compute::libvirt (
$libvirt_inject_key = false,
$libvirt_inject_partition = -2,
$remove_unused_base_images = undef,
$remove_unused_kernels = undef,
$remove_unused_resized_minimum_age_seconds = undef,
$remove_unused_original_minimum_age_seconds = undef,
$libvirt_service_name = $::nova::params::libvirt_service_name,
$virtlock_service_name = $::nova::params::virtlock_service_name,
$virtlog_service_name = $::nova::params::virtlog_service_name,
$compute_driver = 'libvirt.LibvirtDriver'
$compute_driver = 'libvirt.LibvirtDriver',
# Deprecated
$remove_unused_kernels = undef,
) inherits nova::params {
include ::nova::deps
@ -262,14 +265,8 @@ class nova::compute::libvirt (
}
}
if $remove_unused_kernels != undef {
nova_config {
'libvirt/remove_unused_kernels': value => $remove_unused_kernels;
}
} else {
nova_config {
'libvirt/remove_unused_kernels': ensure => absent;
}
if $remove_unused_kernels {
warning('remove_unused_kernels parameter is deprecated, has no effect and will be removed in a future release.')
}
if $remove_unused_resized_minimum_age_seconds != undef {

View File

@ -250,10 +250,6 @@
# (optional) Path to the rootwrap configuration file to use for running commands as root
# Defaults to '/etc/nova/rootwrap.conf'
#
# [*use_syslog*]
# (optional) Use syslog for logging
# Defaults to undef
#
# [*use_stderr*]
# (optional) Use stderr for logging
# Defaults to undef
@ -370,16 +366,20 @@
# (optional) Use IPv6 or not.
# Defaults to $::os_service_default
#
# [*purge_config*]
# (optional) Whether to set only the specified config options
# in the nova config.
# Defaults to false.
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
# (optional) Set log output to verbose output.
# Defaults to undef
#
# [*purge_config*]
# (optional) Whether to set only the specified config options
# in the nova config.
# Defaults to false.
# [*use_syslog*]
# (optional) Deprecated. Use syslog for logging
# Defaults to undef
#
class nova(
$ensure_package = 'present',
@ -448,7 +448,6 @@ class nova(
$key_file = false,
$nova_public_key = undef,
$nova_private_key = undef,
$use_syslog = undef,
$use_stderr = undef,
$log_facility = undef,
$notification_driver = $::os_service_default,
@ -470,6 +469,7 @@ class nova(
$purge_config = false,
# DEPRECATED PARAMETERS
$verbose = undef,
$use_syslog = undef,
) inherits nova::params {
include ::nova::deps
@ -487,6 +487,10 @@ class nova(
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
if $use_syslog {
warning('use_syslog parameter is deprecated, has no effect and will be removed in a future release.')
}
if $use_ssl {
if !$cert_file {
fail('The cert_file parameter is required when use_ssl is set to true')

View File

@ -8,10 +8,6 @@
# (Optional) Should the daemons log debug messages
# Defaults to $::os_service_default
#
# [*use_syslog*]
# (Optional) Use syslog for logging.
# Defaults to $::os_service_default
#
# [*use_stderr*]
# (optional) Use stderr for logging
# Defaults to $::os_service_default
@ -92,8 +88,11 @@
# DEPRECATED: Parameter has no effect
# Defaults to undef
#
# [*use_syslog*]
# (Optional) DEPRECATED. Use syslog for logging.
# Defaults to undef
#
class nova::logging(
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/nova',
@ -111,13 +110,13 @@ class nova::logging(
$log_date_format = $::os_service_default,
# DEPRECATED PARAMETERS
$verbose = undef,
$use_syslog = undef,
) {
include ::nova::deps
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
# to use nova::<myparam> first then nova::logging::<myparam>.
$use_syslog_real = pick($::nova::use_syslog,$use_syslog)
$use_stderr_real = pick($::nova::use_stderr,$use_stderr)
$log_facility_real = pick($::nova::log_facility,$log_facility)
$log_dir_real = pick($::nova::log_dir,$log_dir)
@ -127,10 +126,13 @@ class nova::logging(
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
if $use_syslog {
warning('use_syslog is deprecated, has no effect and will be removed in a future release.')
}
oslo::log { 'nova_config':
debug => $debug_real,
use_stderr => $use_stderr_real,
use_syslog => $use_syslog_real,
log_dir => $log_dir_real,
syslog_log_facility => $log_facility_real,
logging_context_format_string => $logging_context_format_string,

View File

@ -0,0 +1,8 @@
---
deprecations:
- libvirt remove_unused_kernels, cells manager
are deprecated. They have no effect and will be removed in a future
release.
- DEFAULT use_syslog/network_device_mtu/compute_manager
are deprecated. Only compute_manager has effect, because Ironic use.
They will be removed in a future release.

View File

@ -36,7 +36,6 @@ describe 'nova::cells' do
:driver => 'nova.cells.rpc_driver.CellsRPCDriver',
:instance_updated_at_threshold => '3600',
:instance_update_num_instances => '1',
:manager => 'nova.cells.manager.CellsManager',
:max_hop_count => '10',
:mute_child_interval => '300',
:mute_weight_multiplier => '-10.0',
@ -81,7 +80,6 @@ describe 'nova::cells' do
is_expected.to contain_nova_config('cells/driver').with(:value => 'nova.cells.rpc_driver.CellsRPCDriver')
is_expected.to contain_nova_config('cells/instance_updated_at_threshold').with(:value => '3600')
is_expected.to contain_nova_config('cells/instance_update_num_instances').with(:value => '1')
is_expected.to contain_nova_config('cells/manager').with(:value => 'nova.cells.manager.CellsManager')
is_expected.to contain_nova_config('cells/max_hop_count').with(:value => '10')
is_expected.to contain_nova_config('cells/mute_child_interval').with(:value => '300')
is_expected.to contain_nova_config('cells/mute_weight_multiplier').with(:value => '-10.0')

View File

@ -56,7 +56,6 @@ describe 'nova::compute::libvirt' do
it { is_expected.to contain_nova_config('vnc/vncserver_listen').with_value('127.0.0.1')}
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_base_images').with_ensure('absent')}
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_ensure('absent')}
it { is_expected.to contain_nova_config('libvirt/remove_unused_kernels').with_ensure('absent')}
it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_ensure('absent')}
end
@ -70,7 +69,6 @@ describe 'nova::compute::libvirt' do
:libvirt_disk_cachemodes => ['file=directsync','block=none'],
:libvirt_hw_disk_discard => 'unmap',
:remove_unused_base_images => true,
:remove_unused_kernels => true,
:remove_unused_resized_minimum_age_seconds => 3600,
:remove_unused_original_minimum_age_seconds => 3600,
:libvirt_service_name => 'custom_service',
@ -93,7 +91,6 @@ describe 'nova::compute::libvirt' do
it { is_expected.to contain_nova_config('vnc/vncserver_listen').with_value('0.0.0.0')}
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_base_images').with_value(true)}
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_value(3600)}
it { is_expected.to contain_nova_config('libvirt/remove_unused_kernels').with_value(true)}
it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_value(3600)}
it {
is_expected.to contain_service('libvirt').with(
@ -239,7 +236,6 @@ describe 'nova::compute::libvirt' do
it { is_expected.to contain_nova_config('vnc/vncserver_listen').with_value('127.0.0.1')}
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_base_images').with_ensure('absent')}
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_ensure('absent')}
it { is_expected.to contain_nova_config('libvirt/remove_unused_kernels').with_ensure('absent')}
it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_ensure('absent')}
end
@ -248,7 +244,6 @@ describe 'nova::compute::libvirt' do
{ :libvirt_virt_type => 'qemu',
:vncserver_listen => '0.0.0.0',
:remove_unused_base_images => true,
:remove_unused_kernels => true,
:remove_unused_resized_minimum_age_seconds => 3600,
:remove_unused_original_minimum_age_seconds => 3600
}
@ -258,7 +253,6 @@ describe 'nova::compute::libvirt' do
it { is_expected.to contain_nova_config('vnc/vncserver_listen').with_value('0.0.0.0')}
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_base_images').with_value(true)}
it { is_expected.to contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_value(3600)}
it { is_expected.to contain_nova_config('libvirt/remove_unused_kernels').with_value(true)}
it { is_expected.to contain_nova_config('libvirt/remove_unused_resized_minimum_age_seconds').with_value(3600)}
it { is_expected.to contain_package('libvirt').with(
:name => 'libvirt-daemon-kvm',

View File

@ -24,7 +24,6 @@ describe 'nova::compute' do
})
end
it { is_expected.to contain_nova_config('DEFAULT/network_device_mtu').with(:ensure => 'absent') }
it { is_expected.to contain_nova_config('DEFAULT/allow_resize_to_same_host').with(:value => 'false') }
it { is_expected.to contain_nova_config('DEFAULT/vcpu_pin_set').with(:value => '<SERVICE DEFAULT>') }
it { is_expected.to_not contain_nova_config('vnc/novncproxy_base_url') }
@ -59,7 +58,6 @@ describe 'nova::compute' do
{ :enabled => false,
:ensure_package => '2012.1-2',
:vncproxy_host => '127.0.0.1',
:network_device_mtu => 9999,
:force_raw_images => false,
:reserved_host_memory => '0',
:compute_manager => 'ironic.nova.compute.manager.ClusteredComputeManager',
@ -93,10 +91,6 @@ describe 'nova::compute' do
is_expected.to contain_nova_config('DEFAULT/compute_manager').with_value('ironic.nova.compute.manager.ClusteredComputeManager')
end
it 'configures network_device_mtu' do
is_expected.to contain_nova_config('DEFAULT/network_device_mtu').with_value('9999')
end
it 'configures vnc in nova.conf' do
is_expected.to contain_nova_config('vnc/enabled').with_value(true)
is_expected.to contain_nova_config('vnc/vncserver_proxyclient_address').with_value('127.0.0.1')

View File

@ -23,7 +23,6 @@ describe 'nova::logging' do
:instance_format => '[instance: %(uuid)s] ',
:instance_uuid_format => '[instance: %(uuid)s] ',
:log_date_format => '%Y-%m-%d %H:%M:%S',
:use_syslog => true,
:use_stderr => false,
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
@ -55,7 +54,6 @@ describe 'nova::logging' do
shared_examples 'basic default logging settings' do
it 'configures nova logging settins with default values' do
is_expected.to contain_nova_config('DEFAULT/use_syslog').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/log_dir').with(:value => '/var/log/nova')
is_expected.to contain_nova_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
@ -64,7 +62,6 @@ describe 'nova::logging' do
shared_examples 'basic non-default logging settings' do
it 'configures nova logging settins with non-default values' do
is_expected.to contain_nova_config('DEFAULT/use_syslog').with(:value => 'true')
is_expected.to contain_nova_config('DEFAULT/use_stderr').with(:value => 'false')
is_expected.to contain_nova_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO')
is_expected.to contain_nova_config('DEFAULT/log_dir').with(:value => '/var/log')