From fa8660917a97e3d7700845713b213fb3c2bb05b9 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Sun, 21 Oct 2018 17:27:14 +0200 Subject: [PATCH] Add cells v1 deprecation notice and remove broken code In Nova cells v1 has been deprecated since Ocata but we have no notices about it. This adds warnings about it being deprecated and will be removed. The functionality in nova::cells when passing create_cells parameter is broken and has therefore been removed and instead outputs a warning and is deprecated. A known issue has been added to the release notes to inform about this. It's probably safe to say that nobody is using it since it has been broken since we switched over to transport_url for rabbit, it's also safe to probably assume that no deployments that run cell v1 right now will be running a later version of Nova. Closes-Bug: 1687395 Change-Id: I564fc4f43a752b051280dce095a52ca4d477fb09 --- lib/puppet/provider/nova_cells/nova_manage.rb | 2 + lib/puppet/type/nova_cells.rb | 2 + manifests/cells.pp | 44 ++++++------------- manifests/manage/cells.pp | 5 +++ ...cells-v1-deprecation-0f3aaa22f83b06e0.yaml | 15 +++++++ 5 files changed, 37 insertions(+), 31 deletions(-) create mode 100644 releasenotes/notes/add-cells-v1-deprecation-0f3aaa22f83b06e0.yaml diff --git a/lib/puppet/provider/nova_cells/nova_manage.rb b/lib/puppet/provider/nova_cells/nova_manage.rb index 1ed085722..0ec8271a4 100644 --- a/lib/puppet/provider/nova_cells/nova_manage.rb +++ b/lib/puppet/provider/nova_cells/nova_manage.rb @@ -19,6 +19,8 @@ # # nova_cells provider # +# CELL v1 IS DEPRECATED AND WILL BE REMOVED +# require File.join(File.dirname(__FILE__), '..','..','..', 'puppet/provider/nova') diff --git a/lib/puppet/type/nova_cells.rb b/lib/puppet/type/nova_cells.rb index 4765fd439..21cb7266b 100644 --- a/lib/puppet/type/nova_cells.rb +++ b/lib/puppet/type/nova_cells.rb @@ -19,6 +19,8 @@ # # nova_cells type # +# CELL v1 IS DEPRECATED AND WILL BE REMOVED +# # == Parameters # [*name*] # Name for the new cell diff --git a/manifests/cells.pp b/manifests/cells.pp index 61b0b4ff2..237e93b5d 100644 --- a/manifests/cells.pp +++ b/manifests/cells.pp @@ -20,6 +20,8 @@ # # Installs the Nova Cells # +# CELL v1 IS DEPRECATED AND THIS WILL BE REMOVED. +# # === Parameters: # # [*enabled*] @@ -30,10 +32,6 @@ # (optional) Whether to start/stop the service # Defaults to true # -# [*create_cells*] -# Create cells with nova-manage -# Defaults to 'True' -# # [*ensure_package*] # Desired ensure state of packages. # Defaults to present @@ -132,6 +130,12 @@ # It might be used by some cell scheduling code in the future # Defaults to '1.0' # +#### DEPRECATED PARAMETERS +# +# [*create_cells*] +# Create cells with nova-manage +# Defaults to 'True' +# class nova::cells ( $bandwidth_update_interval = '600', $call_timeout = '60', @@ -139,7 +143,6 @@ class nova::cells ( $cell_name = 'nova', $cell_type = undef, $cell_parent_name = undef, - $create_cells = true, $db_check_interval = '60', $enabled = true, $ensure_package = 'present', @@ -160,11 +163,15 @@ class nova::cells ( $scheduler_weight_classes = 'nova.cells.weights.all_weighers', $weight_offset = '1.0', $weight_scale = '1.0', + ## DEPRECATED PARAMETERS + $create_cells = undef, ) { include ::nova::deps include ::nova::params + warning('nova::cells v1 is deprecated and will be removed in a future release') + case $cell_type { 'parent': { nova_config { 'DEFAULT/compute_api_class': value => 'nova.compute.cells_api.ComputeCellsAPI' } @@ -209,32 +216,7 @@ class nova::cells ( } 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': { - # A parent cell must declare its child cell(s) - Nova::Manage::Cells <<| cell_parent_name == $cell_parent_name and cell_type == 'child' |>> - } - 'child': { - # A child cell must declare its parent cell - Nova::Manage::Cells <<| name == $cell_parent_name and cell_type == 'parent' |>> - } - default: { - fail("Invalid cell_type parameter value: ${cell_type}") - } - } + warning('cells v1 is deprecated and nova::cells::create_cells has no effect') } } diff --git a/manifests/manage/cells.pp b/manifests/manage/cells.pp index c2bad4a95..87898ac99 100644 --- a/manifests/manage/cells.pp +++ b/manifests/manage/cells.pp @@ -18,6 +18,9 @@ # # # Configuring the database in each cell +# +# CELL v1 IS DEPRECATED AND WILL BE REMOVED +# # == Namevar # The namevar will be the name of the cell # @@ -73,6 +76,8 @@ define nova::manage::cells ( include ::nova::deps + warning('nova::cells v1 is deprecated and will be removed in a future release') + nova_cells { $name: ensure => present, cell_type => $cell_type, diff --git a/releasenotes/notes/add-cells-v1-deprecation-0f3aaa22f83b06e0.yaml b/releasenotes/notes/add-cells-v1-deprecation-0f3aaa22f83b06e0.yaml new file mode 100644 index 000000000..08276c5d3 --- /dev/null +++ b/releasenotes/notes/add-cells-v1-deprecation-0f3aaa22f83b06e0.yaml @@ -0,0 +1,15 @@ +--- +issues: + - | + The nova::cells::create_cells functionality is not working and will not + be fixed and has therefore been removed. +upgrade: + - | + The nova::cells::create_cells functionality is deprecated and has no effect + since it was broken before and will not be fixed. Cells v1 has been + deprecated in Nova since Ocata and will be removed soon. +deprecations: + - | + The Cell v1 functionality is now deprecated and should not be used. + It has been deprecated since Ocata and will be removed soon. This affects + nova::cells, nova::manage::cells and the nova_cells resource.