Merge "added avinetworks lbaas funcionality"
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..5e52b04
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,4 @@
+[gerrit]
+host=gerrit.mcp.mirantis.net
+port=29418
+project=salt-formulas/neutron.git
diff --git a/README.rst b/README.rst
index 8a8d5c7..8726426 100644
--- a/README.rst
+++ b/README.rst
@@ -40,6 +40,7 @@
user: neutron
password: pwd
tenant: service
+ endpoint_type: internal
message_queue:
engine: rabbitmq
host: 127.0.0.1
@@ -127,6 +128,7 @@
user: neutron
password: pwd
tenant: service
+ endpoint_type: internal
message_queue:
engine: rabbitmq
host: 127.0.0.1
@@ -238,6 +240,7 @@
user: neutron
password: pwd
tenant: service
+ endpoint_type: internal
message_queue:
engine: rabbitmq
host: 127.0.0.1
@@ -346,6 +349,7 @@
user: neutron
password: pwd
tenant: service
+ endpoint_type: internal
message_queue:
engine: rabbitmq
host: 127.0.0.1
@@ -535,6 +539,66 @@
ovs:
driver: openvswitch
+Neutron OVS DPDK
+==================
+
+Enable datapath netdev for neutron openvswitch agent
+
+.. code-block:: yaml
+
+ neutron:
+ server:
+ version: mitaka
+ ...
+ dpdk: True
+ ...
+
+ neutron:
+ compute:
+ version: mitaka
+ plugin: ml2
+ dpdk: True
+ backend:
+ engine: ml2
+ ...
+ mechanism:
+ ovs:
+ driver: openvswitch
+
+Neutron OVS SR-IOV
+==================
+
+.. code-block:: yaml
+
+ neutron:
+ server:
+ version: mitaka
+ plugin: ml2
+ backend:
+ engine: ml2
+ ...
+ mechanism:
+ ovs:
+ driver: openvswitch
+ sriov:
+ driver: sriovnicswitch
+
+ neutron:
+ compute:
+ version: mitaka
+ plugin: ml2
+ ...
+ backend:
+ engine: ml2
+ tenant_network_types: "flat,vlan" # Can be mixed flat,vlan,vxlan
+ sriov:
+ nic_one:
+ devname: eth1
+ physical_network: physnet3
+ mechanism:
+ ovs:
+ driver: openvswitch
+
Neutron Server with OpenContrail
==================================
diff --git a/neutron/_modules/neutronng.py b/_modules/neutronng.py
similarity index 100%
rename from neutron/_modules/neutronng.py
rename to _modules/neutronng.py
diff --git a/neutron/_states/neutronng.py b/_states/neutronng.py
similarity index 97%
rename from neutron/_states/neutronng.py
rename to _states/neutronng.py
index df0736d..9d4deaa 100644
--- a/neutron/_states/neutronng.py
+++ b/_states/neutronng.py
@@ -86,8 +86,11 @@
tenant_id = None
LOG.debug('Cannot get the tenant id. User {0} is not an admin.'.format(
connection_args['connection_user']))
- existing_network = _neutron_module_call(
- 'list_networks', name=name, **connection_args)
+ existing_networks = _neutron_module_call(
+ 'list_networks', **connection_args)
+ for network in existing_networks:
+ if network.get(name) == name:
+ existing_network = network
network_arguments = _get_non_null_args(
name=name,
provider_network_type=provider_network_type,
@@ -101,8 +104,11 @@
if not existing_network:
network_arguments.update(connection_args)
_neutron_module_call('create_network', **network_arguments)
- existing_network = _neutron_module_call(
- 'list_networks', name=name, **connection_args)
+ existing_networks = _neutron_module_call(
+ 'list_networks', **connection_args)
+ for network in existing_networks:
+ if network.get(name) == name:
+ existing_network = network
if existing_network:
return _created(name, 'network', existing_network[name])
return _update_failed(name, 'network')
diff --git a/metadata/service/control/cluster.yml b/metadata/service/control/cluster.yml
index 2a235c1..eaa8707 100644
--- a/metadata/service/control/cluster.yml
+++ b/metadata/service/control/cluster.yml
@@ -3,6 +3,8 @@
classes:
- service.neutron.support
parameters:
+ _param:
+ keystone_neutron_endpoint_type: internal
neutron:
server:
enabled: true
@@ -26,6 +28,7 @@
user: neutron
password: ${_param:keystone_neutron_password}
tenant: service
+ endpoint_type: ${_param:keystone_neutron_endpoint_type}
message_queue:
engine: rabbitmq
host: ${_param:cluster_vip_address}
diff --git a/metadata/service/control/container.yml b/metadata/service/control/container.yml
index 76931da..bca3d9e 100644
--- a/metadata/service/control/container.yml
+++ b/metadata/service/control/container.yml
@@ -1,4 +1,6 @@
parameters:
+ _param:
+ keystone_neutron_endpoint_type: internal
kubernetes:
control:
configmap:
@@ -29,6 +31,7 @@
user: neutron
password: ${_param:keystone_neutron_password}
tenant: service
+ endpoint_type: ${_param:keystone_neutron_endpoint_type}
message_queue:
engine: rabbitmq
host: ${_param:rabbitmq_service_host}
diff --git a/metadata/service/control/single.yml b/metadata/service/control/single.yml
index ea2c0f7..3be2831 100644
--- a/metadata/service/control/single.yml
+++ b/metadata/service/control/single.yml
@@ -3,6 +3,8 @@
classes:
- service.neutron.support
parameters:
+ _param:
+ keystone_neutron_endpoint_type: internal
neutron:
server:
enabled: true
@@ -29,6 +31,7 @@
user: neutron
password: ${_param:keystone_neutron_password}
tenant: service
+ endpoint_type: ${_param:keystone_neutron_endpoint_type}
message_queue:
engine: rabbitmq
host: ${_param:single_address}
diff --git a/neutron/compute.sls b/neutron/compute.sls
index 057d40c..e67eac5 100644
--- a/neutron/compute.sls
+++ b/neutron/compute.sls
@@ -12,6 +12,35 @@
- require:
- pkg: neutron_compute_packages
+{% if compute.backend.sriov is defined %}
+
+neutron_sriov_package:
+ pkg.installed:
+ - name: neutron-sriov-agent
+
+/etc/neutron/plugins/ml2/sriov_agent.ini:
+ file.managed:
+ - source: salt://neutron/files/{{ compute.version }}/sriov_agent.ini
+ - template: jinja
+ - watch_in:
+ - service: neutron_compute_services
+ - require:
+ - pkg: neutron_compute_packages
+ - pkg: neutron_sriov_package
+
+neutron_sriov_service:
+ service.running:
+ - name: neutron-sriov-agent
+ - enable: true
+ - watch_in:
+ - service: neutron_compute_services
+ - watch:
+ - file: /etc/neutron/neutron.conf
+ - file: /etc/neutron/plugins/ml2/openvswitch_agent.ini
+ - file: /etc/neutron/plugins/ml2/sriov_agent.ini
+
+{% endif %}
+
{% if compute.dvr %}
neutron_dvr_packages:
diff --git a/neutron/files/collectd_openstack_neutron.conf b/neutron/files/collectd_openstack_neutron.conf
index 43bbf02..199e7ba 100644
--- a/neutron/files/collectd_openstack_neutron.conf
+++ b/neutron/files/collectd_openstack_neutron.conf
@@ -5,6 +5,7 @@
Username "{{ plugin.username }}"
Password "{{ plugin.password }}"
Tenant "{{ plugin.tenant }}"
+ Region "{{ plugin.region }}"
MaxRetries "{{ plugin.max_retries|default(2) }}"
Timeout "{{ plugin.timeout|default(20) }}"
PaginationLimit "{{ plugin.pagination_limit|default(100) }}"
diff --git a/neutron/files/collectd_openstack_neutron_agents.conf b/neutron/files/collectd_openstack_neutron_agents.conf
index 41a42b4..a86fffc 100644
--- a/neutron/files/collectd_openstack_neutron_agents.conf
+++ b/neutron/files/collectd_openstack_neutron_agents.conf
@@ -5,6 +5,7 @@
Username "{{ plugin.username }}"
Password "{{ plugin.password }}"
Tenant "{{ plugin.tenant }}"
+ Region "{{ plugin.region }}"
MaxRetries "2"
Timeout "20"
</Module>
diff --git a/neutron/files/mitaka/ml2_conf.ini b/neutron/files/mitaka/ml2_conf.ini
index a0879b1..67841f2 100644
--- a/neutron/files/mitaka/ml2_conf.ini
+++ b/neutron/files/mitaka/ml2_conf.ini
@@ -196,7 +196,11 @@
# Driver for security groups firewall in the L2 agent (string value)
#firewall_driver = <None>
+{%- if server.dpdk %}
+firewall_driver = openvswitch
+{%- else %}
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
+{%- endif %}
# Controls whether the neutron security group API is enabled in the server. It should be false when using no security groups or using the
# nova security group API. (boolean value)
diff --git a/neutron/files/mitaka/neutron-server.conf.Debian b/neutron/files/mitaka/neutron-server.conf.Debian
index a18203e..e27b2bd 100644
--- a/neutron/files/mitaka/neutron-server.conf.Debian
+++ b/neutron/files/mitaka/neutron-server.conf.Debian
@@ -1054,7 +1054,7 @@
# keystone catalog and should be one of public, internal or admin. (string
# value)
# Allowed values: public, admin, internal
-#endpoint_type = public
+endpoint_type = {{ server.identity.get('endpoint_type', 'public') }}
#
# From nova.auth
diff --git a/neutron/files/mitaka/openvswitch_agent.ini b/neutron/files/mitaka/openvswitch_agent.ini
index 4656e35..b93aaeb 100644
--- a/neutron/files/mitaka/openvswitch_agent.ini
+++ b/neutron/files/mitaka/openvswitch_agent.ini
@@ -207,6 +207,9 @@
# to 'netdev'. (string value)
# Allowed values: system, netdev
#datapath_type = system
+{%- if neutron.dpdk %}
+datapath_type = netdev
+{%- endif %}
# OVS vhost-user socket directory. (string value)
#vhostuser_socket_dir = /var/run/openvswitch
@@ -240,7 +243,11 @@
# Driver for security groups firewall in the L2 agent (string value)
#firewall_driver = <None>
+{%- if neutron.dpdk %}
+firewall_driver = openvswitch
+{%- else %}
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
+{%- endif %}
# Controls whether the neutron security group API is enabled in the server. It should be false when using no security groups or using the
# nova security group API. (boolean value)
diff --git a/neutron/files/mitaka/sriov_agent.ini b/neutron/files/mitaka/sriov_agent.ini
new file mode 100644
index 0000000..d4ac823
--- /dev/null
+++ b/neutron/files/mitaka/sriov_agent.ini
@@ -0,0 +1,45 @@
+{%- if pillar.neutron.gateway is defined %}
+{%- from "neutron/map.jinja" import gateway as neutron with context %}
+{%- else %}
+{%- from "neutron/map.jinja" import compute as neutron with context %}
+{%- endif %}
+[DEFAULT]
+
+#
+# From oslo.log
+#
+
+# If set to true, the logging level will be set to DEBUG instead of the default INFO level. (boolean value)
+#debug = false
+
+# If set to false, the logging level will be set to WARNING instead of the default INFO level. (boolean value)
+# This option is deprecated for removal.
+# Its value may be silently ignored in the future.
+#verbose = true
+
+[agent]
+
+#
+# From neutron.ml2.sriov.agent
+#
+
+# Extensions list to use (list value)
+#extensions =
+
+
+[ml2_sriov]
+
+#
+# From neutron.ml2.sriov.agent
+#
+
+# Comma-separated list of <physical_network>:<network_device> tuples mapping physical network names to the agent's node-specific physical
+# network device interfaces of SR-IOV physical function to be used for VLAN networks. All physical networks listed in network_vlan_ranges on
+# the server should have mappings to appropriate interfaces on each agent. (list value)
+#physical_device_mappings =
+physical_device_mappings = {%- for nic_name, sriov in neutron.backend.sriov.iteritems() %}{{ sriov.physical_network }}:{{ sriov.devname }}{% if not loop.last %},{% endif %}{%- endfor %}
+
+# Comma-separated list of <network_device>:<vfs_to_exclude> tuples, mapping network_device to the agent's node-specific list of virtual
+# functions that should not be used for virtual networking. vfs_to_exclude is a semicolon-separated list of virtual functions to exclude
+# from network_device. The network_device in the mapping should appear in the physical_device_mappings list. (list value)
+#exclude_devices =
diff --git a/neutron/map.jinja b/neutron/map.jinja
index d00f754..27382b4 100644
--- a/neutron/map.jinja
+++ b/neutron/map.jinja
@@ -3,6 +3,7 @@
'Debian': {
'pkgs': ['neutron-openvswitch-agent', 'openvswitch-switch', 'python-pycadf'],
'services': ['neutron-openvswitch-agent'],
+ 'dpdk': false,
'audit': {
'enabled': false
}
@@ -10,6 +11,7 @@
'RedHat': {
'pkgs': ['openstack-neutron-openvswitch', 'openvswitch', 'python-pycadf'],
'services': ['neutron-openvswitch-agent'],
+ 'dpdk': false,
'audit': {
'enabled': false
}
@@ -19,20 +21,23 @@
{% set gateway = salt['grains.filter_by']({
'Debian': {
'pkgs': ['neutron-dhcp-agent', 'neutron-openvswitch-agent', 'neutron-l3-agent', 'openvswitch-common', 'neutron-metadata-agent'],
- 'services': ['neutron-openvswitch-agent', 'neutron-metadata-agent', 'neutron-l3-agent', 'neutron-dhcp-agent']
+ 'services': ['neutron-openvswitch-agent', 'neutron-metadata-agent', 'neutron-l3-agent', 'neutron-dhcp-agent'],
+ 'dpdk': false
},
'RedHat': {
'pkgs': ['openstack-neutron-openvswitch'],
- 'services': ['neutron-openvswitch-agent', 'neutron-metadata-agent', 'neutron-l3-agent', 'neutron-dhcp-agent']
+ 'services': ['neutron-openvswitch-agent', 'neutron-metadata-agent', 'neutron-l3-agent', 'neutron-dhcp-agent'],
+ 'dpdk': false
},
}, merge=pillar.neutron.get('gateway', {})) %}
{% set server = salt['grains.filter_by']({
'Debian': {
- 'pkgs': ['neutron-server','neutron-lbaas-agent', 'gettext-base', 'python-pycadf'],
+ 'pkgs': ['neutron-server','python-neutron-lbaas', 'gettext-base', 'python-pycadf'],
'pkgs_ml2': ['neutron-plugin-ml2'],
'services': ['neutron-server'],
'notification': False,
+ 'dpdk': false,
'audit': {
'enabled': false
}
@@ -42,6 +47,7 @@
'pkgs': ['openstack-neutron'],
'services': ['neutron-server'],
'notification': False,
+ 'dpdk': false,
'audit': {
'enabled': false
}
diff --git a/neutron/meta/collectd.yml b/neutron/meta/collectd.yml
index e96fe23..ca77ce7 100644
--- a/neutron/meta/collectd.yml
+++ b/neutron/meta/collectd.yml
@@ -15,6 +15,7 @@
username: {{ server.identity.user }}
password: {{ server.identity.password }}
tenant: {{ server.identity.tenant }}
+ region: {{ server.identity.region }}
openstack_neutron_agents:
plugin: python
template: neutron/files/collectd_openstack_neutron_agents.conf
@@ -22,5 +23,6 @@
username: {{ server.identity.user }}
password: {{ server.identity.password }}
tenant: {{ server.identity.tenant }}
+ region: {{ server.identity.region }}
{%- endif %}
{%- endif %}
diff --git a/neutron/meta/heka.yml b/neutron/meta/heka.yml
index b14c967..1fc60ff 100644
--- a/neutron/meta/heka.yml
+++ b/neutron/meta/heka.yml
@@ -28,7 +28,10 @@
neutron_log:
engine: logstreamer
log_directory: "/var/log"
- file_match: 'neutron/(?P<Service>(dhcp-agent|l3-agent|metadata-agent|neutron-netns-cleanup|openvswitch-agent|neutron-lbaas-agent|server))\.log\.?(?P<Seq>\d*)$'
+ # Depending on the package version, the Neutron server logs are either at
+ # /var/log/neutron/neutron-server.log or /var/log/neutron/server.log and
+ # the following regexp will deal with both situations.
+ file_match: 'neutron/(neutron-)?(?P<Service>(dhcp-agent|l3-agent|metadata-agent|neutron-netns-cleanup|openvswitch-agent|neutron-lbaas-agent|server))\.log\.?(?P<Seq>\d*)$'
differentiator: ['neutron', '_', 'Service']
priority: ["^Seq"]
decoder: "neutron_decoder"
diff --git a/tests/pillar/compute_dpdk.sls b/tests/pillar/compute_dpdk.sls
new file mode 100644
index 0000000..0a3a498
--- /dev/null
+++ b/tests/pillar/compute_dpdk.sls
@@ -0,0 +1,25 @@
+neutron:
+ compute:
+ agent_mode: legacy
+ dpdk: True
+ backend:
+ engine: ml2
+ tenant_network_types: "flat,vlan"
+ mechanism:
+ ovs:
+ driver: openvswitch
+ dvr: false
+ enabled: true
+ external_access: false
+ local_ip: 10.1.0.105
+ message_queue:
+ engine: rabbitmq
+ host: 172.16.10.254
+ password: workshop
+ port: 5672
+ user: openstack
+ virtual_host: /openstack
+ metadata:
+ host: 172.16.10.254
+ password: password
+ version: mitaka
diff --git a/tests/pillar/compute_sriov.sls b/tests/pillar/compute_sriov.sls
new file mode 100644
index 0000000..9504878
--- /dev/null
+++ b/tests/pillar/compute_sriov.sls
@@ -0,0 +1,28 @@
+neutron:
+ compute:
+ agent_mode: legacy
+ backend:
+ engine: ml2
+ tenant_network_types: "flat,vxlan"
+ sriov:
+ nic_one:
+ devname: eth1
+ physical_network: physnet3
+ mechanism:
+ ovs:
+ driver: openvswitch
+ dvr: false
+ enabled: true
+ external_access: false
+ local_ip: 10.1.0.105
+ message_queue:
+ engine: rabbitmq
+ host: 172.16.10.254
+ password: workshop
+ port: 5672
+ user: openstack
+ virtual_host: /openstack
+ metadata:
+ host: 172.16.10.254
+ password: password
+ version: mitaka
diff --git a/tests/pillar/control_cluster.sls b/tests/pillar/control_cluster.sls
index 1d21783..1aba7fd 100644
--- a/tests/pillar/control_cluster.sls
+++ b/tests/pillar/control_cluster.sls
@@ -32,6 +32,7 @@
user: neutron
password: password
tenant: service
+ endpoint_type: internal
message_queue:
engine: rabbitmq
members:
diff --git a/tests/pillar/control_dvr.sls b/tests/pillar/control_dvr.sls
index ca2b75e..7684188 100644
--- a/tests/pillar/control_dvr.sls
+++ b/tests/pillar/control_dvr.sls
@@ -35,6 +35,7 @@
region: RegionOne
tenant: service
user: neutron
+ endpoint_type: internal
l3_ha: false
message_queue:
engine: rabbitmq
diff --git a/tests/pillar/control_nodvr.sls b/tests/pillar/control_nodvr.sls
index 4fed20a..154c47e 100644
--- a/tests/pillar/control_nodvr.sls
+++ b/tests/pillar/control_nodvr.sls
@@ -35,6 +35,7 @@
region: RegionOne
tenant: service
user: neutron
+ endpoint_type: internal
l3_ha: True
message_queue:
engine: rabbitmq
diff --git a/tests/pillar/control_single.sls b/tests/pillar/control_single.sls
index 73529cf..1f8a28e 100644
--- a/tests/pillar/control_single.sls
+++ b/tests/pillar/control_single.sls
@@ -32,6 +32,7 @@
user: neutron
password: password
tenant: service
+ endpoint_type: internal
message_queue:
engine: rabbitmq
host: 127.0.0.1