From c07046edeee562142c90aa3cadd4bdc47b0a15da Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 1 Nov 2016 10:00:07 -0700 Subject: [PATCH] Make n-net refuse to start unless using CellsV1 At the Barcenlona summit, we discussed disabling n-net everywhere as a precursor to removal. The only exception for using n-net is as required for CellsV1 users, which require it as the only out-of-the-box supported networking option. We will remove this check and n-net entirely when those users have a migration path to neutron and cellsv2. Depends-On: I47f72eac6a7657bf44319fa5d2df18ce62827f6f Change-Id: I7309afa5230bcaeeeddb554d95c327d3a614ae6e --- nova/cmd/network.py | 8 +++++++- nova/tests/unit/cmd/test_cmd_db_blocks.py | 1 + .../nova-network-only-for-cellsv1-dfb72fb1d3339bb3.yaml | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/nova-network-only-for-cellsv1-dfb72fb1d3339bb3.yaml diff --git a/nova/cmd/network.py b/nova/cmd/network.py index 0e1733dda469..7b57c7e1c876 100644 --- a/nova/cmd/network.py +++ b/nova/cmd/network.py @@ -25,7 +25,7 @@ from nova.cmd import common as cmd_common from nova.conductor import rpcapi as conductor_rpcapi import nova.conf from nova import config -from nova.i18n import _LW +from nova.i18n import _LE, _LW from nova import objects from nova.objects import base as objects_base from nova import service @@ -39,6 +39,12 @@ LOG = logging.getLogger('nova.network') def main(): config.parse_args(sys.argv) logging.setup(CONF, "nova") + + if not CONF.cells.enable: + LOG.error(_LE('Nova network is deprecated and not supported ' + 'except as required for CellsV1 deployments.')) + return 1 + utils.monkey_patch() objects.register_all() diff --git a/nova/tests/unit/cmd/test_cmd_db_blocks.py b/nova/tests/unit/cmd/test_cmd_db_blocks.py index 98d812f1b970..80ad457354ae 100644 --- a/nova/tests/unit/cmd/test_cmd_db_blocks.py +++ b/nova/tests/unit/cmd/test_cmd_db_blocks.py @@ -51,6 +51,7 @@ class ComputeMainTest(test.NoDBTestCase): db.api.instance_get, 1, 2) def test_network_main_blocks_db(self): + self.flags(enable=True, group='cells') with restore_db(): self._call_main(network) self.assertRaises(exception.DBNotAllowed, diff --git a/releasenotes/notes/nova-network-only-for-cellsv1-dfb72fb1d3339bb3.yaml b/releasenotes/notes/nova-network-only-for-cellsv1-dfb72fb1d3339bb3.yaml new file mode 100644 index 000000000000..8a449cc0ed95 --- /dev/null +++ b/releasenotes/notes/nova-network-only-for-cellsv1-dfb72fb1d3339bb3.yaml @@ -0,0 +1,6 @@ +--- +deprecations: + - Nova network was deprecated in Newton and is no longer + supported for regular deployments in Ocata. The network + service binary will now refuse to start, except in the special + case of CellsV1 where it is still required to function. \ No newline at end of file