Switch use_neutron=true by default
The old nova-network was deprecated in Newton and, according nova release notes, no longer supported for regular deployment in Ocata. Change the unit tests with the assumption that neutron is the default. Change-Id: I67b23fe8797425bf47e4b2370fb82885b74318ae
This commit is contained in:
parent
5de5e9b306
commit
176b480f53
|
@ -73,11 +73,9 @@ be set to DEBUG. By default the sahara's log level is set to WARNING.
|
||||||
Networking configuration
|
Networking configuration
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
By default sahara is configured to use the nova-network implementation
|
By default sahara is configured to use the neutron. Additionally, if the
|
||||||
of OpenStack Networking. If an OpenStack cluster uses neutron,
|
cluster supports network namespaces the ``use_namespaces`` property can
|
||||||
then the ``use_neutron`` parameter should be set to ``True`` in the
|
be used to enable their usage.
|
||||||
sahara configuration file. Additionally, if the cluster supports network
|
|
||||||
namespaces the ``use_namespaces`` property can be used to enable their usage.
|
|
||||||
|
|
||||||
.. sourcecode:: cfg
|
.. sourcecode:: cfg
|
||||||
|
|
||||||
|
@ -90,6 +88,10 @@ namespaces the ``use_namespaces`` property can be used to enable their usage.
|
||||||
instance and namespaces are used, some additional configuration is
|
instance and namespaces are used, some additional configuration is
|
||||||
required, please see :ref:`non-root-users` for more information.
|
required, please see :ref:`non-root-users` for more information.
|
||||||
|
|
||||||
|
If an OpenStack cluster uses the deprecated nova-network,
|
||||||
|
then the ``use_neutron`` parameter should be set to ``False`` in the
|
||||||
|
sahara configuration file.
|
||||||
|
|
||||||
.. _floating_ip_management:
|
.. _floating_ip_management:
|
||||||
|
|
||||||
Floating IP management
|
Floating IP management
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#use_floating_ips=true
|
#use_floating_ips=true
|
||||||
|
|
||||||
# Use Neutron or Nova Network (boolean value)
|
# Use Neutron or Nova Network (boolean value)
|
||||||
#use_neutron=false
|
#use_neutron=true
|
||||||
|
|
||||||
# Use network namespaces for communication (only valid to use in conjunction
|
# Use network namespaces for communication (only valid to use in conjunction
|
||||||
# with use_neutron=True)
|
# with use_neutron=True)
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- Neutron is used by default now (use_neutron=True).
|
||||||
|
Nova-network is not functionaly for most use cases
|
||||||
|
starting from Ocata.
|
|
@ -78,7 +78,7 @@ networking_opts = [
|
||||||
help="The suffix of the node's FQDN. In nova-network that is "
|
help="The suffix of the node's FQDN. In nova-network that is "
|
||||||
"the dhcp_domain config parameter."),
|
"the dhcp_domain config parameter."),
|
||||||
cfg.BoolOpt('use_neutron',
|
cfg.BoolOpt('use_neutron',
|
||||||
default=False,
|
default=True,
|
||||||
help="Use Neutron Networking (False indicates the use of Nova "
|
help="Use Neutron Networking (False indicates the use of Nova "
|
||||||
"networking)."),
|
"networking)."),
|
||||||
cfg.BoolOpt('use_namespaces',
|
cfg.BoolOpt('use_namespaces',
|
||||||
|
|
|
@ -221,6 +221,7 @@ class TestQuotas(base.SaharaTestCase):
|
||||||
@mock.patch('sahara.utils.openstack.nova.client',
|
@mock.patch('sahara.utils.openstack.nova.client',
|
||||||
return_value=FakeNovaClient(nova_limits))
|
return_value=FakeNovaClient(nova_limits))
|
||||||
def test_get_nova_limits(self, nova):
|
def test_get_nova_limits(self, nova):
|
||||||
|
self.override_config('use_neutron', False)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
{'cpu': 10, 'floatingips': 200,
|
{'cpu': 10, 'floatingips': 200,
|
||||||
'instances': 3, 'ram': 9, 'security_group_rules': 'unlimited',
|
'instances': 3, 'ram': 9, 'security_group_rules': 'unlimited',
|
||||||
|
@ -238,6 +239,7 @@ class TestQuotas(base.SaharaTestCase):
|
||||||
@mock.patch('sahara.utils.openstack.neutron.client',
|
@mock.patch('sahara.utils.openstack.neutron.client',
|
||||||
return_value=FakeNeutronClient(neutron_limits))
|
return_value=FakeNeutronClient(neutron_limits))
|
||||||
def test_neutron_limits(self, neutron):
|
def test_neutron_limits(self, neutron):
|
||||||
|
self.override_config('use_neutron', False)
|
||||||
self.assertEqual({}, quotas._get_neutron_limits())
|
self.assertEqual({}, quotas._get_neutron_limits())
|
||||||
self.override_config('use_neutron', True)
|
self.override_config('use_neutron', True)
|
||||||
self.assertEqual({'floatingips': 2340,
|
self.assertEqual({'floatingips': 2340,
|
||||||
|
|
|
@ -158,6 +158,7 @@ class TestClusterCreateValidation(u.ValidationTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_cluster_create_mixed_nova_neutron(self):
|
def test_cluster_create_mixed_nova_neutron(self):
|
||||||
|
self.override_config("use_neutron", False)
|
||||||
self._assert_create_object_validation(
|
self._assert_create_object_validation(
|
||||||
data={
|
data={
|
||||||
'name': "test-name",
|
'name': "test-name",
|
||||||
|
@ -378,7 +379,6 @@ class TestClusterCreateValidation(u.ValidationTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_cluster_create_availability_zone(self):
|
def test_cluster_create_availability_zone(self):
|
||||||
self.override_config('use_neutron', True)
|
|
||||||
self._assert_create_object_validation(
|
self._assert_create_object_validation(
|
||||||
data={
|
data={
|
||||||
'name': 'testname',
|
'name': 'testname',
|
||||||
|
@ -407,7 +407,6 @@ class TestClusterCreateValidation(u.ValidationTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_cluster_create_wrong_availability_zone(self):
|
def test_cluster_create_wrong_availability_zone(self):
|
||||||
self.override_config('use_neutron', True)
|
|
||||||
self._assert_create_object_validation(
|
self._assert_create_object_validation(
|
||||||
data={
|
data={
|
||||||
'name': 'testname',
|
'name': 'testname',
|
||||||
|
@ -435,7 +434,6 @@ class TestClusterCreateValidation(u.ValidationTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_cluster_create_wrong_volumes_availability_zone(self):
|
def test_cluster_create_wrong_volumes_availability_zone(self):
|
||||||
self.override_config('use_neutron', True)
|
|
||||||
self._assert_create_object_validation(
|
self._assert_create_object_validation(
|
||||||
data={
|
data={
|
||||||
'name': 'testname',
|
'name': 'testname',
|
||||||
|
@ -532,6 +530,8 @@ class TestClusterCreateFlavorValidation(base.SaharaWithDbTestCase):
|
||||||
"plugin_name": "fake",
|
"plugin_name": "fake",
|
||||||
"hadoop_version": "0.1",
|
"hadoop_version": "0.1",
|
||||||
"cluster_template_id": '%s' % ctmpl_id,
|
"cluster_template_id": '%s' % ctmpl_id,
|
||||||
|
"neutron_management_network": "d9a3bebc-f788-4b81-"
|
||||||
|
"9a93-aa048022c1ca",
|
||||||
'default_image_id': '550e8400-e29b-41d4-a716-446655440000'
|
'default_image_id': '550e8400-e29b-41d4-a716-446655440000'
|
||||||
}
|
}
|
||||||
patchers = u.start_patch(False)
|
patchers = u.start_patch(False)
|
||||||
|
@ -542,6 +542,8 @@ class TestClusterCreateFlavorValidation(base.SaharaWithDbTestCase):
|
||||||
"name": "testwithnodegroups",
|
"name": "testwithnodegroups",
|
||||||
"plugin_name": "fake",
|
"plugin_name": "fake",
|
||||||
"hadoop_version": "0.1",
|
"hadoop_version": "0.1",
|
||||||
|
"neutron_management_network": "d9a3bebc-f788-4b81-"
|
||||||
|
"9a93-aa048022c1ca",
|
||||||
"node_groups": [
|
"node_groups": [
|
||||||
{
|
{
|
||||||
"name": "allinone",
|
"name": "allinone",
|
||||||
|
@ -576,6 +578,8 @@ class TestClusterCreateFlavorValidation(base.SaharaWithDbTestCase):
|
||||||
"name": "testwithnodegroups",
|
"name": "testwithnodegroups",
|
||||||
"plugin_name": "fake",
|
"plugin_name": "fake",
|
||||||
"hadoop_version": "0.1",
|
"hadoop_version": "0.1",
|
||||||
|
"neutron_management_network": "d9a3bebc-f788-4b81-"
|
||||||
|
"9a93-aa048022c1ca",
|
||||||
"node_groups": [
|
"node_groups": [
|
||||||
{
|
{
|
||||||
"name": "allinone",
|
"name": "allinone",
|
||||||
|
@ -614,6 +618,8 @@ class TestClusterCreateFlavorValidation(base.SaharaWithDbTestCase):
|
||||||
"plugin_name": "fake",
|
"plugin_name": "fake",
|
||||||
"hadoop_version": "0.1",
|
"hadoop_version": "0.1",
|
||||||
"cluster_template_id": '%s' % ctmpl_id,
|
"cluster_template_id": '%s' % ctmpl_id,
|
||||||
|
"neutron_management_network": "d9a3bebc-f788-4b81-"
|
||||||
|
"9a93-aa048022c1ca",
|
||||||
'default_image_id': '550e8400-e29b-41d4-a716-446655440000',
|
'default_image_id': '550e8400-e29b-41d4-a716-446655440000',
|
||||||
"node_groups": [
|
"node_groups": [
|
||||||
{
|
{
|
||||||
|
@ -639,6 +645,8 @@ class TestClusterCreateFlavorValidation(base.SaharaWithDbTestCase):
|
||||||
"name": "testtmplnodegroups",
|
"name": "testtmplnodegroups",
|
||||||
"plugin_name": "fake",
|
"plugin_name": "fake",
|
||||||
"hadoop_version": "0.1",
|
"hadoop_version": "0.1",
|
||||||
|
"neutron_management_network": "d9a3bebc-f788-4b81-"
|
||||||
|
"9a93-aa048022c1ca",
|
||||||
"node_groups": [
|
"node_groups": [
|
||||||
{
|
{
|
||||||
"node_group_template_id": '%s' % ng_id,
|
"node_group_template_id": '%s' % ng_id,
|
||||||
|
|
|
@ -422,7 +422,9 @@ class ValidationTestCase(base.SaharaTestCase):
|
||||||
'plugin_name': 'fake',
|
'plugin_name': 'fake',
|
||||||
'hadoop_version': '0.1',
|
'hadoop_version': '0.1',
|
||||||
'default_image_id': '550e8400-e29b-41d4-a716-446655440000',
|
'default_image_id': '550e8400-e29b-41d4-a716-446655440000',
|
||||||
'domain_name': 'domain.org.'
|
'domain_name': 'domain.org.',
|
||||||
|
'neutron_management_network': 'd9a3bebc-f788-4b81-'
|
||||||
|
'9a93-aa048022c1ca'
|
||||||
}
|
}
|
||||||
self._assert_create_object_validation(data=data)
|
self._assert_create_object_validation(data=data)
|
||||||
data = {
|
data = {
|
||||||
|
|
|
@ -159,6 +159,7 @@ class FakeNodeGroup(object):
|
||||||
def __init__(self, user, priv_key):
|
def __init__(self, user, priv_key):
|
||||||
self.image_username = user
|
self.image_username = user
|
||||||
self.cluster = FakeCluster(priv_key)
|
self.cluster = FakeCluster(priv_key)
|
||||||
|
self.floating_ip_pool = 'public'
|
||||||
|
|
||||||
|
|
||||||
class FakeInstance(object):
|
class FakeInstance(object):
|
||||||
|
|
Loading…
Reference in New Issue