Deprecate nova-network code

Nova will be removing nova-network soon, this deprecates all
the classes and parameters that are related to nova-network
and will be removed when nova removes it's support.

Please see references in nova.conf [1] and the nova release notes. [2]

[1] https://docs.openstack.org/nova/rocky/configuration/sample-config.html
[2] https://docs.openstack.org/releasenotes/nova/rocky.html

Depends-On: https://review.openstack.org/#/c/614577/
Change-Id: If87ad30e1be62cb767d98045d075340c9513bc90
This commit is contained in:
Tobias Urdin 2018-10-26 10:03:12 +02:00
parent f2ab2d4783
commit 1296187b85
17 changed files with 105 additions and 22 deletions

View File

@ -16,6 +16,11 @@ Puppet::Type.newtype(:nova_network) do
newparam(:label) do newparam(:label) do
desc "The Nova network label" desc "The Nova network label"
defaultto "novanetwork" defaultto "novanetwork"
munge do |value|
Puppet.deprecation_warning('nova_network is deprecated and will be removed in a future release')
value
end
end end
newparam(:num_networks) do newparam(:num_networks) do

View File

@ -4,6 +4,8 @@
# This will use virtio for VM guests and the # This will use virtio for VM guests and the
# specified driver for the VIF # specified driver for the VIF
# #
# DEPRECATED!
#
# === Parameters # === Parameters
# #
# [*libvirt_vif_driver*] # [*libvirt_vif_driver*]
@ -21,6 +23,10 @@ class nova::compute::neutron (
) { ) {
include ::nova::deps include ::nova::deps
# NOTE(tobias-urdin): libvirt/vif_driver option does not exist and force_snat_range is
# a nova-network specific config which is deprecated.
warning('nova::compute::network class is deprecated and will be removed in a future release')
nova_config { nova_config {
'libvirt/vif_driver': value => $libvirt_vif_driver; 'libvirt/vif_driver': value => $libvirt_vif_driver;
} }

View File

@ -364,10 +364,6 @@
# (optional) Sets a version cap for messages sent to scheduler services # (optional) Sets a version cap for messages sent to scheduler services
# Defaults to $::os_service_default # Defaults to $::os_service_default
# #
# [*use_ipv6*]
# (optional) Use IPv6 or not.
# Defaults to $::os_service_default
#
# [*purge_config*] # [*purge_config*]
# (optional) Whether to set only the specified config options # (optional) Whether to set only the specified config options
# in the nova config. # in the nova config.
@ -442,6 +438,10 @@
# exceptions in the API service # exceptions in the API service
# Defaults to undef # Defaults to undef
# #
# [*use_ipv6*]
# (optional) Use IPv6 or not.
# Defaults to undef
#
class nova( class nova(
$ensure_package = 'present', $ensure_package = 'present',
$database_connection = undef, $database_connection = undef,
@ -527,7 +527,6 @@ class nova(
$upgrade_level_intercell = $::os_service_default, $upgrade_level_intercell = $::os_service_default,
$upgrade_level_network = $::os_service_default, $upgrade_level_network = $::os_service_default,
$upgrade_level_scheduler = $::os_service_default, $upgrade_level_scheduler = $::os_service_default,
$use_ipv6 = $::os_service_default,
$cpu_allocation_ratio = $::os_service_default, $cpu_allocation_ratio = $::os_service_default,
$ram_allocation_ratio = $::os_service_default, $ram_allocation_ratio = $::os_service_default,
$disk_allocation_ratio = $::os_service_default, $disk_allocation_ratio = $::os_service_default,
@ -542,6 +541,7 @@ class nova(
$debug = undef, $debug = undef,
$image_service = undef, $image_service = undef,
$notify_on_api_faults = undef, $notify_on_api_faults = undef,
$use_ipv6 = undef,
) inherits nova::params { ) inherits nova::params {
include ::nova::deps include ::nova::deps
@ -557,6 +557,10 @@ class nova(
and nova::debug is deprecated and has been moved to nova::logging class, please set them there.') and nova::debug is deprecated and has been moved to nova::logging class, please set them there.')
} }
if $use_ipv6 {
warning('nova::use_ipv6 is deprecated and will be removed in a future release')
}
validate_array($enabled_ssl_apis) validate_array($enabled_ssl_apis)
if empty($enabled_ssl_apis) and $use_ssl { if empty($enabled_ssl_apis) and $use_ssl {
warning('enabled_ssl_apis is empty but use_ssl is set to true') warning('enabled_ssl_apis is empty but use_ssl is set to true')
@ -751,9 +755,13 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.")
topics => $notification_topics, topics => $notification_topics,
} }
# TODO(tobias-urdin): Remove when use_ipv6 params is removed.
nova_config {
'os_vif_linux_bridge/use_ipv6': value => $use_ipv6;
}
nova_config { nova_config {
'cinder/catalog_info': value => $cinder_catalog_info; 'cinder/catalog_info': value => $cinder_catalog_info;
'os_vif_linux_bridge/use_ipv6': value => $use_ipv6;
'DEFAULT/ovsdb_connection': value => $ovsdb_connection; 'DEFAULT/ovsdb_connection': value => $ovsdb_connection;
'notifications/notification_format': value => $notification_format; 'notifications/notification_format': value => $notification_format;
# Following may need to be broken out to different nova services # Following may need to be broken out to different nova services

View File

@ -1,5 +1,7 @@
# === Parameters: # === Parameters:
# #
# DEPRECATED!
#
# [*network*] # [*network*]
# (required) IPv4 CIDR of network to create. # (required) IPv4 CIDR of network to create.
# #
@ -54,6 +56,8 @@ define nova::manage::network (
include ::nova::deps include ::nova::deps
warning('nova::manage::network is deprecated and will be removed in a future release')
nova_network { $name: nova_network { $name:
ensure => present, ensure => present,
network => $network, network => $network,

View File

@ -1,5 +1,7 @@
# bridge.pp # bridge.pp
# #
# DEPRECATED!
#
# === Parameters: # === Parameters:
# #
# [*ip*] # [*ip*]
@ -15,6 +17,8 @@ define nova::network::bridge (
) { ) {
include ::nova::deps include ::nova::deps
warning('nova::network::bridge is deprecated and will be removed in a future release')
case $::osfamily { case $::osfamily {
'Debian': { 'Debian': {

View File

@ -2,6 +2,8 @@
# #
# Configuration settings for nova flat network # Configuration settings for nova flat network
# #
# DEPRECATED!
#
# === Parameters: # === Parameters:
# #
# [*fixed_range*] # [*fixed_range*]
@ -28,6 +30,8 @@ class nova::network::flat (
include ::nova::deps include ::nova::deps
warning('nova::network::flat is deprecated and nova-network will be removed in a future release')
if $public_interface { if $public_interface {
nova_config { 'DEFAULT/public_interface': value => $public_interface } nova_config { 'DEFAULT/public_interface': value => $public_interface }
} }

View File

@ -2,6 +2,8 @@
# #
# Configures nova-network with flat dhcp option # Configures nova-network with flat dhcp option
# #
# DEPRECATED!
#
# === Parameters: # === Parameters:
# #
# [*fixed_range*] # [*fixed_range*]
@ -53,6 +55,8 @@ class nova::network::flatdhcp (
include ::nova::deps include ::nova::deps
warning('nova::network::flatdhcp is deprecated and nova-network will be removed in a future release')
if $::osfamily == 'RedHat' and $::operatingsystem != 'Fedora' { if $::osfamily == 'RedHat' and $::operatingsystem != 'Fedora' {
package { 'dnsmasq-utils': package { 'dnsmasq-utils':
ensure => present, ensure => present,

View File

@ -59,13 +59,6 @@
# and not the Identity service API IP and port. # and not the Identity service API IP and port.
# Defaults to 'http://127.0.0.1:5000/v3' # Defaults to 'http://127.0.0.1:5000/v3'
# #
# [*firewall_driver*]
# (optional) Firewall driver.
# This prevents nova from maintaining a firewall so it does not interfere
# with Neutron's. Set to 'nova.virt.firewall.IptablesFirewallDriver'
# to re-enable the Nova firewall.
# Defaults to 'nova.virt.firewall.NoopFirewallDriver'
#
# [*vif_plugging_is_fatal*] # [*vif_plugging_is_fatal*]
# (optional) Fail to boot instance if vif plugging fails. # (optional) Fail to boot instance if vif plugging fails.
# This prevents nova from booting an instance if vif plugging notification # This prevents nova from booting an instance if vif plugging notification
@ -78,14 +71,23 @@
# notification is not being used. # notification is not being used.
# Defaults to '300' # Defaults to '300'
# #
# [*dhcp_domain*]
# (optional) domain to use for building the hostnames
# Defaults to 'novalocal'
#
# [*default_floating_pool*] # [*default_floating_pool*]
# (optional) Default pool for floating IPs # (optional) Default pool for floating IPs
# Defaults to 'nova' # Defaults to 'nova'
# #
### DEPRECATED PARAMS
#
# [*firewall_driver*]
# (optional) Firewall driver.
# This prevents nova from maintaining a firewall so it does not interfere
# with Neutron's. Set to 'nova.virt.firewall.IptablesFirewallDriver'
# to re-enable the Nova firewall.
# Defaults to 'nova.virt.firewall.NoopFirewallDriver'
#
# [*dhcp_domain*]
# (optional) domain to use for building the hostnames
# Defaults to 'novalocal'
#
class nova::network::neutron ( class nova::network::neutron (
$neutron_password = false, $neutron_password = false,
$neutron_auth_type = 'v3password', $neutron_auth_type = 'v3password',
@ -99,18 +101,31 @@ class nova::network::neutron (
$neutron_region_name = 'RegionOne', $neutron_region_name = 'RegionOne',
$neutron_ovs_bridge = 'br-int', $neutron_ovs_bridge = 'br-int',
$neutron_extension_sync_interval = '600', $neutron_extension_sync_interval = '600',
$firewall_driver = 'nova.virt.firewall.NoopFirewallDriver',
$vif_plugging_is_fatal = true, $vif_plugging_is_fatal = true,
$vif_plugging_timeout = '300', $vif_plugging_timeout = '300',
$dhcp_domain = 'novalocal',
$default_floating_pool = 'nova', $default_floating_pool = 'nova',
# DEPRECATED PARAMS
$firewall_driver = 'nova.virt.firewall.NoopFirewallDriver',
$dhcp_domain = 'novalocal',
) { ) {
include ::nova::deps include ::nova::deps
if $firewall_driver {
warning('nova::network::neutron::firewall_driver is deprecated and will be removed in a future release')
}
if $dhcp_domain {
warning('nova::network::neutron::dhcp_domain is deprecated and will be removed in a future release')
}
# TODO(tobias-urdin): Remove these in the T release.
nova_config {
'DEFAULT/dhcp_domain': value => $dhcp_domain;
'DEFAULT/firewall_driver': value => $firewall_driver;
}
nova_config { nova_config {
'DEFAULT/dhcp_domain': value => $dhcp_domain;
'DEFAULT/firewall_driver': value => $firewall_driver;
'DEFAULT/vif_plugging_is_fatal': value => $vif_plugging_is_fatal; 'DEFAULT/vif_plugging_is_fatal': value => $vif_plugging_is_fatal;
'DEFAULT/vif_plugging_timeout': value => $vif_plugging_timeout; 'DEFAULT/vif_plugging_timeout': value => $vif_plugging_timeout;
'neutron/default_floating_pool': value => $default_floating_pool; 'neutron/default_floating_pool': value => $default_floating_pool;

View File

@ -2,6 +2,8 @@
# #
# Configures nova network to use vlans # Configures nova network to use vlans
# #
# DEPRECATED!
#
# === Parameters: # === Parameters:
# #
# [*fixed_range*] # [*fixed_range*]
@ -47,6 +49,8 @@ class nova::network::vlan (
include ::nova::deps include ::nova::deps
warning('nova::network::vlan is deprecated and nova-network will be removed in a future release')
if $::osfamily == 'RedHat' and $::operatingsystem != 'Fedora' { if $::osfamily == 'RedHat' and $::operatingsystem != 'Fedora' {
package { 'dnsmasq-utils': package { 'dnsmasq-utils':
ensure => present, ensure => present,

View File

@ -0,0 +1,23 @@
---
deprecations:
- |
nova::network::bridge class is deprecated and will be removed in a future release
because it doesn't align with this modules purpose to configure nova nad not networking
interfaces.
- |
nova::network::flat, nova::network::flatdhcp and nova::network::vlan classes is now
deprecated and will be removed in a future release. Nova-network is deprecated in nova
and will be removed in a future release.
- |
firewall_driver and dhcp_domain parameters in nova::network::neutron is deprecated and will
be removed in a future release. These are replaced by use_neutron and DNS domain functionality
in neutron, these were focused on supporting nova-network and will be removed when nova-network
support is removed from nova.
- |
nova_network resource is deprecated and will be removed in a future release.
- |
nova::compute::neutron class is deprecated and will be removed in a future release.
- |
nova::manage::network is deprecated and will be removed in a future release.
- |
nova::use_ipv6 is deprecated and will be removed in a future release.

View File

@ -1,4 +1,6 @@
# TODO(tobias-urdin): This is deprecated and should be removed in T release.
require 'spec_helper' require 'spec_helper'
describe 'nova::compute::neutron' do describe 'nova::compute::neutron' do
context 'with default parameters' do context 'with default parameters' do

View File

@ -52,7 +52,6 @@ describe 'nova' do
is_expected.to contain_nova_config('DEFAULT/service_down_time').with_value('60') is_expected.to contain_nova_config('DEFAULT/service_down_time').with_value('60')
is_expected.to contain_nova_config('DEFAULT/rootwrap_config').with_value('/etc/nova/rootwrap.conf') is_expected.to contain_nova_config('DEFAULT/rootwrap_config').with_value('/etc/nova/rootwrap.conf')
is_expected.to contain_nova_config('DEFAULT/report_interval').with_value('10') is_expected.to contain_nova_config('DEFAULT/report_interval').with_value('10')
is_expected.to contain_nova_config('os_vif_linux_bridge/use_ipv6').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/ovsdb_connection').with_value('<SERVICE DEFAULT>') is_expected.to contain_nova_config('DEFAULT/ovsdb_connection').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>') is_expected.to contain_nova_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>') is_expected.to contain_nova_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')

View File

@ -1,3 +1,4 @@
# TODO(tobias-urdin): This is deprecated and should be removed in T release.
require 'spec_helper' require 'spec_helper'
describe 'nova::network::flat' do describe 'nova::network::flat' do

View File

@ -1,3 +1,4 @@
# TODO(tobias-urdin): This is deprecated and should be removed in T release.
require 'spec_helper' require 'spec_helper'
describe 'nova::network::flatdhcp' do describe 'nova::network::flatdhcp' do

View File

@ -1,3 +1,4 @@
# TODO(tobias-urdin): This is deprecated and should be removed in T release.
require 'spec_helper' require 'spec_helper'
describe 'nova::network::vlan' do describe 'nova::network::vlan' do

View File

@ -1,3 +1,4 @@
# TODO(tobias-urdin): This is deprecated and should be removed in T release.
require 'puppet' require 'puppet'
require 'puppet/provider/nova_network/nova' require 'puppet/provider/nova_network/nova'
require 'tempfile' require 'tempfile'

View File

@ -1,3 +1,4 @@
# TODO(tobias-urdin): This is deprecated and should be removed in T release.
require 'puppet' require 'puppet'
require 'puppet/type/nova_network' require 'puppet/type/nova_network'
describe 'Puppet::Type.type(:nova_network)' do describe 'Puppet::Type.type(:nova_network)' do